import { i as formatErrorMessage } from "../errors-yPX8axJ_.js";
import { m as resolveUserPath } from "../utils-Cimvb8Kl.js";
import { n as VERSION } from "../version-CeFj_iGk.js";
import { y as resolveSessionAgentIds } from "../agent-scope-w-woxb95.js";
import { a as isSubagentSessionKey } from "../session-key-utils-CxOAyqGd.js";
import { a as resolveAgentDir, s as resolveDefaultAgentDir } from "../agent-scope-config-BC3QjGdO.js";
import { o as resolveEmbeddedAgentRuntime } from "../agent-runtime-id-DiL2DId7.js";
import { n as disposeRegisteredAgentHarnesses } from "../registry-DBNmGEa8.js";
import { g as resetAgentEventsForTest, p as onAgentEvent, s as emitAgentEvent } from "../agent-events-7y1r8HOP.js";
import { t as FAST_MODE_AUTO_PROGRESS_KIND } from "../reply-payload-BK_jICQ3.js";
import { s as resolveContextEngineOwnerPluginId } from "../registry-DYqt7yEi.js";
import { t as emitSessionTranscriptUpdate } from "../transcript-events-DqJucMXE.js";
import { o as resolveSessionWriteLockAcquireTimeoutMs, s as resolveSessionWriteLockOptions, t as acquireSessionWriteLock } from "../session-write-lock-CPXLevym.js";
import { V as appendSessionTranscriptMessage } from "../session-accessor-DLLBAj07.js";
import { i as getModelProviderRequestTransport, n as attachModelProviderRequestTransport } from "../provider-request-config-DogMq7D5.js";
import { f as resolveModelAuthMode } from "../model-auth-CvWOgjlo.js";
import { n as formatFastModeAutoProgressText, u as resolveFastModeForElapsed } from "../fast-mode-BhVbWk_p.js";
import { f as resolveActiveEmbeddedRunSessionId } from "../run-state-H-K8-BpQ.js";
import { n as abortEmbeddedAgentRun, r as clearActiveEmbeddedRun, t as abortAndDrainEmbeddedAgentRun, v as setActiveEmbeddedRun } from "../runs-CMJ4NP_D.js";
import { o as normalizeUsage } from "../usage-C67Kbb7n.js";
import { i as getPluginToolMeta } from "../tools-BRgDn44c.js";
import { r as assertContextEngineHostSupport, t as CODEX_APP_SERVER_CONTEXT_ENGINE_HOST } from "../host-compat-BibWlia2.js";
import { a as finalizeHarnessContextEngineTurn, d as runAgentEndSideEffects, i as buildHarnessContextEngineRuntimeContextFromUsage, n as bootstrapHarnessContextEngine, o as isActiveHarnessContextEngine, r as buildHarnessContextEngineRuntimeContext, s as runHarnessContextEngineMaintenance, t as assembleHarnessContextEngine, u as awaitAgentEndSideEffects } from "../context-engine-lifecycle-DTk0oKnS.js";
import { o as normalizeHeartbeatToolResponse, t as HEARTBEAT_RESPONSE_TOOL_NAME } from "../heartbeat-tool-response-lbHtsids.js";
import { _ as supportsModelTools } from "../openai-transport-stream-CQMww_Rz.js";
import { t as log } from "../logger-vnMEdTJw.js";
import { t as projectRuntimeToolInputSchema } from "../tool-schema-json-projection-DTb7YiHb.js";
import { t as buildAgentHookContextChannelFields } from "../hook-agent-context-QaWyfwlO.js";
import { a as hasBeforeToolCallPolicy, b as consumeAdjustedParamsForToolCall, d as runBeforeToolCallHook, f as wrapToolWithBeforeToolCallHook, i as getBeforeToolCallPolicyDiagnosticState, l as requestDeferredPluginToolApproval, r as finalizeToolTerminalPresentation, x as consumePreExecutionBlockedToolCall } from "../agent-tools.before-tool-call-CJF8ia7N.js";
import { C as setBeforeToolCallDiagnosticsEnabled, S as isToolWrappedWithBeforeToolCallHook, g as getChannelAgentToolMeta, t as callGatewayTool } from "../gateway-CmFIchQA.js";
import { a as selectDefaultNodeFromList, i as resolveNodeIdFromList, t as listNodes } from "../nodes-utils-BNdG5OFd.js";
import { n as runAgentHarnessBeforeMessageWriteHook, t as runAgentHarnessAfterToolCallHook } from "../hook-helpers-B_RdwZiK.js";
import { M as formatToolAggregate } from "../streaming-CcTOItIG.js";
import { c as hasSandboxBindReadonlyHostShadows, l as resolveWritableSandboxBindHostRoots, o as resolveSandboxContext, s as hasSandboxBindContainerPathAliases } from "../sandbox-DDePE5Ei.js";
import { a as resolveBootstrapContextForRun, n as buildBootstrapContextForFiles, o as resolveBootstrapFilesForRun } from "../bootstrap-files-03cRX8Bb.js";
import { a as isMessagingToolSendAction, r as isMessagingTool } from "../embedded-agent-messaging-D9IdYitZ.js";
import { _ as sanitizeToolResult, c as extractMessagingToolSendResult, d as extractToolErrorMessage, f as extractToolResultMediaArtifact, m as filterToolResultMediaUrls, n as isDeliveredMessageToolOnlySourceReplyResult, r as isDeliveredMessagingToolResult, s as extractMessagingToolSend, v as isToolResultError } from "../embedded-agent-message-tool-source-reply-Btkn9bZP.js";
import { i as isReplaySafeToolCall } from "../tool-mutation-BioMabQh.js";
import { a as runAgentHarnessLlmInputHook, i as runAgentHarnessBeforeAgentFinalizeHook, n as getAgentHarnessHookRunner, o as runAgentHarnessLlmOutputHook, r as runAgentHarnessAgentEndHook, t as awaitAgentHarnessAgentEndHook } from "../lifecycle-hook-helpers-U8F1sMyF.js";
import { n as normalizeProviderToolSchemas } from "../tool-schema-runtime-BQc5DI4B.js";
import { r as inspectRuntimeToolInputSchemas, t as filterProviderNormalizableTools } from "../tool-schema-projection-Bld_BaX8.js";
import { n as normalizeAgentRuntimeTools, t as logAgentRuntimeToolDiagnostics } from "../tools-NpeSva92.js";
import { n as buildSkillWorkshopPromptSection, t as SKILL_WORKSHOP_TOOL_NAME } from "../skill-workshop-prompt-Ro8fA5Wx.js";
import { c as shouldPreemptivelyCompactBeforePrompt, n as runAgentCleanupStep, o as estimateRenderedLlmBoundaryTokenPressure, r as PREEMPTIVE_OVERFLOW_ERROR_TEXT, s as formatPrePromptPrecheckLog, t as buildEmbeddedAttemptToolRunContext, u as isAgentToolReplaySafe } from "../attempt.tool-run-context-CG5iztVz.js";
import { c as resolveCompactionTimeoutMs, o as compactContextEngineWithSafetyTimeout, s as compactWithSafetyTimeout, t as createAgentToolResultMiddlewareRunner } from "../tool-result-middleware-DWXXGzmw.js";
import { o as resolveAttemptFsWorkspaceOnly } from "../attempt.prompt-helpers-DBvrXze6.js";
import { r as resolveEmbeddedAttemptToolConstructionPlan, t as applyEmbeddedAttemptToolsAllow } from "../attempt-tool-construction-plan-B50N6z4A.js";
import { r as resolveAttemptSpawnWorkspaceDir } from "../attempt.thread-helpers-DqZZ_UyO.js";
import { t as classifyEmbeddedAgentRunResultForModelFallback } from "../result-fallback-classifier-BmyIyZAO.js";
import { r as buildAgentRuntimePlan } from "../build-u88X99ij.js";
import { t as resolveOpenClawAgentDir } from "../agent-dir-compat-fAg8EsVn.js";
import { t as formatApprovalDisplayPath } from "../approval-display-paths-DlQSsCnq.js";
import { a as inferToolMetaFromArgs, c as createCodexAppServerToolResultExtensionRunner, d as runAgentHarnessBeforeCompactionHook, f as buildAgentHarnessUserInputAnswers, g as normalizeAgentHarnessUserInputAnswer, h as formatAgentHarnessUserInputPrompt, i as formatToolProgressOutput, l as resolveAgentHarnessBeforePromptBuildResult, m as emptyAgentHarnessUserInputAnswers, n as classifyAgentHarnessTerminalOutcome, o as loadCodexBundleMcpThreadConfig, p as deliverAgentHarnessUserInputPrompt, r as detectAndLoadAgentHarnessPromptImages, s as queueAgentHarnessMessage, t as TOOL_PROGRESS_OUTPUT_MAX_CHARS, u as runAgentHarnessAfterCompactionHook } from "../agent-harness-runtime-DP1yPEiB.js";
import { c as resolveNativeHookRelayDeferredToolApproval, l as testing, n as hasNativeHookRelayInvocation, o as registerNativeHookRelay, r as invokeNativeHookRelay, t as buildNativeHookRelayCommand } from "../native-hook-relay-BhLykbmy.js";
export { CODEX_APP_SERVER_CONTEXT_ENGINE_HOST, FAST_MODE_AUTO_PROGRESS_KIND, HEARTBEAT_RESPONSE_TOOL_NAME, VERSION as OPENCLAW_VERSION, PREEMPTIVE_OVERFLOW_ERROR_TEXT, SKILL_WORKSHOP_TOOL_NAME, TOOL_PROGRESS_OUTPUT_MAX_CHARS, abortEmbeddedAgentRun as abortAgentHarnessRun, abortAndDrainEmbeddedAgentRun as abortAndDrainAgentHarnessRun, acquireSessionWriteLock, appendSessionTranscriptMessage, applyEmbeddedAttemptToolsAllow, assembleHarnessContextEngine, assertContextEngineHostSupport, attachModelProviderRequestTransport, awaitAgentEndSideEffects, awaitAgentHarnessAgentEndHook, bootstrapHarnessContextEngine, buildAgentHarnessUserInputAnswers, buildAgentHookContextChannelFields, buildAgentRuntimePlan, buildBootstrapContextForFiles, buildEmbeddedAttemptToolRunContext, buildHarnessContextEngineRuntimeContext, buildHarnessContextEngineRuntimeContextFromUsage, buildNativeHookRelayCommand, buildSkillWorkshopPromptSection, callGatewayTool, classifyAgentHarnessTerminalOutcome, classifyEmbeddedAgentRunResultForModelFallback, classifyEmbeddedAgentRunResultForModelFallback as classifyEmbeddedPiRunResultForModelFallback, clearActiveEmbeddedRun, compactContextEngineWithSafetyTimeout, compactWithSafetyTimeout, consumeAdjustedParamsForToolCall, consumePreExecutionBlockedToolCall, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, deliverAgentHarnessUserInputPrompt, detectAndLoadAgentHarnessPromptImages, disposeRegisteredAgentHarnesses, log as embeddedAgentLog, emitAgentEvent, emitSessionTranscriptUpdate, emptyAgentHarnessUserInputAnswers, estimateRenderedLlmBoundaryTokenPressure, extractMessagingToolSend, extractMessagingToolSendResult, extractToolErrorMessage, extractToolResultMediaArtifact, filterProviderNormalizableTools, filterToolResultMediaUrls, finalizeHarnessContextEngineTurn, finalizeToolTerminalPresentation, formatAgentHarnessUserInputPrompt, formatApprovalDisplayPath, formatErrorMessage, formatFastModeAutoProgressText, formatPrePromptPrecheckLog, formatToolAggregate, formatToolProgressOutput, getAgentHarnessHookRunner, getBeforeToolCallPolicyDiagnosticState, getChannelAgentToolMeta, getModelProviderRequestTransport, getPluginToolMeta, hasBeforeToolCallPolicy, hasNativeHookRelayInvocation, hasSandboxBindContainerPathAliases, hasSandboxBindReadonlyHostShadows, inferToolMetaFromArgs, inspectRuntimeToolInputSchemas, invokeNativeHookRelay, isActiveHarnessContextEngine, isAgentToolReplaySafe, isDeliveredMessageToolOnlySourceReplyResult, isDeliveredMessagingToolResult, isMessagingTool, isMessagingToolSendAction, isReplaySafeToolCall, isSubagentSessionKey, isToolResultError, isToolWrappedWithBeforeToolCallHook, listNodes, loadCodexBundleMcpThreadConfig, logAgentRuntimeToolDiagnostics, testing as nativeHookRelayTesting, normalizeAgentHarnessUserInputAnswer, normalizeAgentRuntimeTools, normalizeHeartbeatToolResponse, normalizeProviderToolSchemas, normalizeUsage, onAgentEvent, projectRuntimeToolInputSchema, queueAgentHarnessMessage, registerNativeHookRelay, requestDeferredPluginToolApproval, resetAgentEventsForTest, resolveActiveEmbeddedRunSessionId, resolveAgentDir, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptFsWorkspaceOnly, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveBootstrapFilesForRun, resolveCompactionTimeoutMs, resolveContextEngineOwnerPluginId, resolveDefaultAgentDir, resolveEmbeddedAgentRuntime, resolveEmbeddedAttemptToolConstructionPlan, resolveFastModeForElapsed, resolveModelAuthMode, resolveNativeHookRelayDeferredToolApproval, resolveNodeIdFromList, resolveOpenClawAgentDir, resolveSandboxContext, resolveSessionAgentIds, resolveSessionWriteLockAcquireTimeoutMs, resolveSessionWriteLockOptions, resolveUserPath, resolveWritableSandboxBindHostRoots, runAgentCleanupStep, runAgentEndSideEffects, runAgentHarnessAfterCompactionHook, runAgentHarnessAfterToolCallHook, runAgentHarnessAgentEndHook, runAgentHarnessBeforeAgentFinalizeHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, runBeforeToolCallHook, runHarnessContextEngineMaintenance, sanitizeToolResult, selectDefaultNodeFromList, setActiveEmbeddedRun, setBeforeToolCallDiagnosticsEnabled, shouldPreemptivelyCompactBeforePrompt, supportsModelTools, wrapToolWithBeforeToolCallHook };
