import { i as formatErrorMessage } from "../errors-BsfWgA0I.js";
import { p as resolveUserPath } from "../utils-B5r0V84N.js";
import { n as VERSION } from "../version-BjFOZC7j.js";
import { v as resolveSessionAgentIds } from "../agent-scope-CudANNo3.js";
import { a as isSubagentSessionKey } from "../session-key-utils-AmKO9Roj.js";
import { a as resolveAgentDir, s as resolveDefaultAgentDir } from "../agent-scope-config-BfxErZq2.js";
import { m as resolveEmbeddedAgentRuntime } from "../openai-codex-routing-WA14m8HM.js";
import { n as disposeRegisteredAgentHarnesses } from "../registry-CA-J0IzZ.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 { s as appendSessionTranscriptMessage } from "../transcript-DxGLLD67.js";
import { t as emitSessionTranscriptUpdate } from "../transcript-events-cdgltU-p.js";
import { d as resolveSessionWriteLockOptions, i as acquireSessionWriteLock, l as resolveSessionWriteLockAcquireTimeoutMs } from "../session-write-lock-B48uOlVM.js";
import { g as setActiveEmbeddedRun, m as resolveActiveEmbeddedRunSessionId, n as abortEmbeddedPiRun, r as clearActiveEmbeddedRun } from "../runs-p1TN18LG.js";
import { o as normalizeUsage } from "../usage-Detu9Td-.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-BO5sRfPm.js";
import { v as buildAgentHookContextChannelFields } from "../attempt.prompt-helpers-BwNDZb_U.js";
import { a as resolveBootstrapContextForRun, n as buildBootstrapContextForFiles, o as resolveBootstrapFilesForRun } from "../bootstrap-files-_8BLxDNp.js";
import { a as getBeforeToolCallPolicyDiagnosticState, f as runBeforeToolCallHook, h as wrapToolWithBeforeToolCallHook, l as isToolWrappedWithBeforeToolCallHook, o as hasBeforeToolCallPolicy, p as setBeforeToolCallDiagnosticsEnabled } from "../pi-tools.before-tool-call-DxMCLLt6.js";
import { t as callGatewayTool } from "../gateway-WWlz8UU2.js";
import { d as resolveModelAuthMode } from "../model-auth-qmpmKTAn.js";
import { t as supportsModelTools } from "../model-tool-support-D9jCvogW.js";
import { E as extractToolResultMediaArtifact, I as isMessagingTool, L as isMessagingToolSendAction, O as filterToolResultMediaUrls, _ as resolveCompactionTimeoutMs, a as formatPrePromptPrecheckLog, h as compactContextEngineWithSafetyTimeout, i as estimateRenderedLlmBoundaryTokenPressure, m as createAgentToolResultMiddlewareRunner, n as PREEMPTIVE_OVERFLOW_ERROR_TEXT, o as shouldPreemptivelyCompactBeforePrompt, t as buildEmbeddedAttemptToolRunContext, x as runAgentCleanupStep } from "../attempt.tool-run-context-D_9doVq_.js";
import { N as formatToolAggregate } from "../streaming-Bpx5ncw8.js";
import { t as log } from "../logger-DLLDK9dc.js";
import { a as selectDefaultNodeFromList, i as resolveNodeIdFromList, t as listNodes } from "../nodes-utils-1wEmOXrF.js";
import { i as normalizeProviderToolSchemas, n as normalizeAgentRuntimeTools, t as logAgentRuntimeToolDiagnostics } from "../tools-I6YRP2Tl.js";
import { c as hasSandboxBindReadonlyHostShadows, l as resolveWritableSandboxBindHostRoots, o as resolveSandboxContext, s as hasSandboxBindContainerPathAliases } from "../sandbox-BEN4j_RH.js";
import { n as inspectRuntimeToolInputSchemas, r as projectRuntimeToolInputSchema } from "../tool-schema-projection-BBX8a1zU.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-C_i87ruX.js";
import { r as resolveAttemptSpawnWorkspaceDir } from "../attempt.thread-helpers-B8Gn-rJt.js";
import { t as classifyEmbeddedPiRunResultForModelFallback } from "../result-fallback-classifier-BJg-XR7_.js";
import { r as buildAgentRuntimePlan } from "../build-Bjj39czr.js";
import { a as runAgentHarnessLlmOutputHook, i as runAgentHarnessLlmInputHook, n as runAgentHarnessAgentEndHook, r as runAgentHarnessBeforeAgentFinalizeHook, t as awaitAgentHarnessAgentEndHook } from "../lifecycle-hook-helpers-BULW39MH.js";
import { t as resolveOpenClawAgentDir } from "../agent-dir-compat-CEN4sd-j.js";
import { t as formatApprovalDisplayPath } from "../approval-display-paths-BqRczx-P.js";
import { n as runAgentHarnessBeforeMessageWriteHook, t as runAgentHarnessAfterToolCallHook } from "../hook-helpers-BXrY2MWn.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-Ddodex45.js";
import { c as testing, n as hasNativeHookRelayInvocation, o as registerNativeHookRelay, r as invokeNativeHookRelay, t as buildNativeHookRelayCommand } from "../native-hook-relay-CHSPJ9ZP.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, buildBootstrapContextForFiles, 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, getBeforeToolCallPolicyDiagnosticState, hasBeforeToolCallPolicy, hasNativeHookRelayInvocation, hasSandboxBindContainerPathAliases, hasSandboxBindReadonlyHostShadows, inferToolMetaFromArgs, inspectRuntimeToolInputSchemas, invokeNativeHookRelay, isActiveHarnessContextEngine, isMessagingTool, isMessagingToolSendAction, isSubagentSessionKey, isToolWrappedWithBeforeToolCallHook, listNodes, loadCodexBundleMcpThreadConfig, logAgentRuntimeToolDiagnostics, testing as nativeHookRelayTesting, normalizeAgentRuntimeTools, normalizeHeartbeatToolResponse, normalizeProviderToolSchemas, normalizeUsage, onAgentEvent, projectRuntimeToolInputSchema, queueAgentHarnessMessage, registerNativeHookRelay, resetAgentEventsForTest, resolveActiveEmbeddedRunSessionId, resolveAgentDir, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveBootstrapFilesForRun, 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 };
