import { i as formatErrorMessage } from "../errors-CukcbGFO.js";
import { p as resolveUserPath } from "../utils-sBTEdeml.js";
import { n as VERSION } from "../version-CQfgAE7_.js";
import { v as resolveSessionAgentIds } from "../agent-scope-CI3KK9ir.js";
import { a as isSubagentSessionKey } from "../session-key-utils-Ce_xWkNq.js";
import { a as resolveAgentDir, s as resolveDefaultAgentDir } from "../agent-scope-config-CmpG8BCp.js";
import { n as resolveEmbeddedAgentRuntime } from "../runtime-fVbSwiLb.js";
import { n as disposeRegisteredAgentHarnesses } from "../registry-Ssx1J75n.js";
import { o as resolveContextEngineOwnerPluginId } from "../registry-DxH_0Os-.js";
import { d as resetAgentEventsForTest, i as emitAgentEvent, l as onAgentEvent } from "../agent-events-BuYtWSh4.js";
import { c as appendSessionTranscriptMessage } from "../transcript-C99Vx6wh.js";
import { t as emitSessionTranscriptUpdate } from "../transcript-events-ClYG_P1o.js";
import { d as resolveSessionWriteLockOptions, i as acquireSessionWriteLock, l as resolveSessionWriteLockAcquireTimeoutMs } from "../session-write-lock-DHkC8iUQ.js";
import { m as setActiveEmbeddedRun, n as abortEmbeddedPiRun, p as resolveActiveEmbeddedRunSessionId, r as clearActiveEmbeddedRun } from "../runs-Df_ipbBm.js";
import { o as normalizeUsage } from "../usage-DKNTRfvn.js";
import { r as assertContextEngineHostSupport, t as CODEX_APP_SERVER_CONTEXT_ENGINE_HOST } from "../host-compat-DMtVtGSr.js";
import { o as normalizeHeartbeatToolResponse, t as HEARTBEAT_RESPONSE_TOOL_NAME } from "../heartbeat-tool-response-Cf_D5Tj1.js";
import { _ as buildAgentHookContextChannelFields } from "../attempt.prompt-helpers-BsDtdm5W.js";
import { a as resolveBootstrapContextForRun } from "../bootstrap-files-IsboWj0a.js";
import { a as hasBeforeToolCallPolicy, c as isToolWrappedWithBeforeToolCallHook, d as setBeforeToolCallDiagnosticsEnabled, p as wrapToolWithBeforeToolCallHook, u as runBeforeToolCallHook } from "../pi-tools.before-tool-call-C_a89zEZ.js";
import { t as callGatewayTool } from "../gateway-DXsnbD_P.js";
import { d as resolveModelAuthMode } from "../model-auth-VnZDPi_S.js";
import { O as supportsModelTools } from "../openai-transport-stream-C8Ubr8e3.js";
import { A as runAgentCleanupStep, D as normalizeAgentRuntimeTools, E as logAgentRuntimeToolDiagnostics, F as extractToolResultMediaArtifact, G as isMessagingToolSendAction, L as filterToolResultMediaUrls, W as isMessagingTool, a as shouldPreemptivelyCompactBeforePrompt, g as resolveCompactionTimeoutMs, i as formatPrePromptPrecheckLog, k as normalizeProviderToolSchemas, m as compactContextEngineWithSafetyTimeout, n as PREEMPTIVE_OVERFLOW_ERROR_TEXT, p as createAgentToolResultMiddlewareRunner, r as estimateRenderedLlmBoundaryTokenPressure, t as buildEmbeddedAttemptToolRunContext } from "../attempt.tool-run-context-xqRqKj5i.js";
import { N as formatToolAggregate } from "../channel-streaming-C911lp_M.js";
import { t as log } from "../logger-DA8uszJ3.js";
import { a as selectDefaultNodeFromList, i as resolveNodeIdFromList, t as listNodes } from "../nodes-utils-Cyjnvccf.js";
import { c as hasSandboxBindReadonlyHostShadows, l as resolveWritableSandboxBindHostRoots, o as resolveSandboxContext, s as hasSandboxBindContainerPathAliases } from "../sandbox-CjmqiNw5.js";
import { a as finalizeHarnessContextEngineTurn, i as buildHarnessContextEngineRuntimeContextFromUsage, n as bootstrapHarnessContextEngine, o as isActiveHarnessContextEngine, r as buildHarnessContextEngineRuntimeContext, s as runHarnessContextEngineMaintenance, t as assembleHarnessContextEngine } from "../context-engine-lifecycle-CheLntci.js";
import { r as resolveAttemptSpawnWorkspaceDir } from "../attempt.thread-helpers-BAEN4rUO.js";
import { t as classifyEmbeddedPiRunResultForModelFallback } from "../result-fallback-classifier-aMB31LFN.js";
import { r as buildAgentRuntimePlan } from "../build-CNMIcgwp.js";
import { a as runAgentHarnessLlmOutputHook, i as runAgentHarnessLlmInputHook, n as runAgentHarnessAgentEndHook, r as runAgentHarnessBeforeAgentFinalizeHook, t as awaitAgentHarnessAgentEndHook } from "../lifecycle-hook-helpers-BjDrA3D2.js";
import { t as resolveOpenClawAgentDir } from "../agent-dir-compat-DZ-YAL1g.js";
import { t as formatApprovalDisplayPath } from "../approval-display-paths-BqRczx-P.js";
import { a as loadCodexBundleMcpThreadConfig, c as resolveAgentHarnessBeforePromptBuildResult, i as inferToolMetaFromArgs, l as runAgentHarnessAfterCompactionHook, n as classifyAgentHarnessTerminalOutcome, o as queueAgentHarnessMessage, r as formatToolProgressOutput, s as createCodexAppServerToolResultExtensionRunner, t as TOOL_PROGRESS_OUTPUT_MAX_CHARS, u as runAgentHarnessBeforeCompactionHook } from "../agent-harness-runtime-BXRTPk6S.js";
import { a as registerNativeHookRelay, c as runAgentHarnessAfterToolCallHook, l as runAgentHarnessBeforeMessageWriteHook, n as hasNativeHookRelayInvocation, r as invokeNativeHookRelay, s as testing, t as buildNativeHookRelayCommand } from "../native-hook-relay-ppA5CYXg.js";
export { CODEX_APP_SERVER_CONTEXT_ENGINE_HOST, HEARTBEAT_RESPONSE_TOOL_NAME, VERSION as OPENCLAW_VERSION, PREEMPTIVE_OVERFLOW_ERROR_TEXT, TOOL_PROGRESS_OUTPUT_MAX_CHARS, abortEmbeddedPiRun as abortAgentHarnessRun, acquireSessionWriteLock, appendSessionTranscriptMessage, assembleHarnessContextEngine, assertContextEngineHostSupport, awaitAgentHarnessAgentEndHook, bootstrapHarnessContextEngine, buildAgentHookContextChannelFields, buildAgentRuntimePlan, buildEmbeddedAttemptToolRunContext, buildHarnessContextEngineRuntimeContext, buildHarnessContextEngineRuntimeContextFromUsage, buildNativeHookRelayCommand, callGatewayTool, classifyAgentHarnessTerminalOutcome, classifyEmbeddedPiRunResultForModelFallback, clearActiveEmbeddedRun, compactContextEngineWithSafetyTimeout, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, disposeRegisteredAgentHarnesses, log as embeddedAgentLog, emitAgentEvent, emitSessionTranscriptUpdate, estimateRenderedLlmBoundaryTokenPressure, extractToolResultMediaArtifact, filterToolResultMediaUrls, finalizeHarnessContextEngineTurn, formatApprovalDisplayPath, formatErrorMessage, formatPrePromptPrecheckLog, formatToolAggregate, formatToolProgressOutput, hasBeforeToolCallPolicy, hasNativeHookRelayInvocation, hasSandboxBindContainerPathAliases, hasSandboxBindReadonlyHostShadows, inferToolMetaFromArgs, invokeNativeHookRelay, isActiveHarnessContextEngine, isMessagingTool, isMessagingToolSendAction, isSubagentSessionKey, isToolWrappedWithBeforeToolCallHook, listNodes, loadCodexBundleMcpThreadConfig, logAgentRuntimeToolDiagnostics, testing as nativeHookRelayTesting, normalizeAgentRuntimeTools, normalizeHeartbeatToolResponse, normalizeProviderToolSchemas, normalizeUsage, onAgentEvent, queueAgentHarnessMessage, registerNativeHookRelay, resetAgentEventsForTest, resolveActiveEmbeddedRunSessionId, resolveAgentDir, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveCompactionTimeoutMs, resolveContextEngineOwnerPluginId, resolveDefaultAgentDir, resolveEmbeddedAgentRuntime, resolveModelAuthMode, resolveNodeIdFromList, resolveOpenClawAgentDir, resolveSandboxContext, resolveSessionAgentIds, resolveSessionWriteLockAcquireTimeoutMs, resolveSessionWriteLockOptions, resolveUserPath, resolveWritableSandboxBindHostRoots, runAgentCleanupStep, runAgentHarnessAfterCompactionHook, runAgentHarnessAfterToolCallHook, runAgentHarnessAgentEndHook, runAgentHarnessBeforeAgentFinalizeHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, runBeforeToolCallHook, runHarnessContextEngineMaintenance, selectDefaultNodeFromList, setActiveEmbeddedRun, setBeforeToolCallDiagnosticsEnabled, shouldPreemptivelyCompactBeforePrompt, supportsModelTools, wrapToolWithBeforeToolCallHook };
