import { c as resolveUserPath } from "../home-dir-DxrrpDft.js";
import { r as formatErrorMessage } from "../errors-DMsu67n4.js";
import { n as VERSION } from "../version-CeFj_iGk.js";
import { v as resolveSessionAgentIds } from "../agent-scope-uF6sww3K.js";
import { a as isSubagentSessionKey } from "../session-key-utils-B8sNp9l4.js";
import { a as resolveAgentDir, s as resolveDefaultAgentDir } from "../agent-scope-config-BGhyaQxC.js";
import { B as resolveEmbeddedAgentRuntime } from "../openai-routing-D3lruFAk.js";
import { n as disposeRegisteredAgentHarnesses } from "../registry-AbvkpsVj.js";
import { i as getModelProviderRequestTransport, n as attachModelProviderRequestTransport } from "../provider-request-config-C8QSmO3a.js";
import { S as resetAgentEventsForTest, c as emitAgentEvent, v as onAgentEvent } from "../agent-events-C52gteMx.js";
import { t as FAST_MODE_AUTO_PROGRESS_KIND } from "../reply-payload-BK_jICQ3.js";
import { s as resolveContextEngineOwnerPluginId } from "../registry-smgACtRt.js";
import { Rt as normalizeUsage } from "../session-accessor-DqjaXZhO.js";
import { p as resolveModelAuthMode } from "../model-auth-CS7MDaGJ.js";
import { c as resolveAgentRunAbortLifecycleFields } from "../run-termination-DIsmhjAZ.js";
import { c as resolveFastModeForElapsed, n as formatFastModeAutoProgressText } from "../fast-mode-CFWkImo-.js";
import { A as compactWithSafetyTimeout, j as resolveCompactionTimeoutMs, k as compactContextEngineWithSafetyTimeout } from "../diagnostic-CQ0DDWN6.js";
import { m as resolveActiveEmbeddedRunSessionId } from "../run-state-DTrn_XTM.js";
import { n as abortEmbeddedAgentRun, r as clearActiveEmbeddedRun, t as abortAndDrainEmbeddedAgentRun, x as setActiveEmbeddedRun } from "../runs-CgUcRPtp.js";
import { i as getPluginToolMeta } from "../tools-DbJvplGt.js";
import { r as assertContextEngineHostSupport, t as CODEX_APP_SERVER_CONTEXT_ENGINE_HOST } from "../host-compat-BibWlia2.js";
import { a as buildHarnessContextEngineRuntimeContext, c as isActiveHarnessContextEngine, i as bootstrapHarnessContextEngine, l as runHarnessContextEngineMaintenance, n as runAgentEndSideEffects, o as buildHarnessContextEngineRuntimeContextFromUsage, r as assembleHarnessContextEngine, s as finalizeHarnessContextEngineTurn, t as awaitAgentEndSideEffects } from "../agent-end-side-effects-RY3vYB7g.js";
import { O as isAgentToolReplaySafe, j as isHostScopedAgentToolActive } from "../local-model-lean-H5KrUV5Y.js";
import { a as getBeforeToolCallPolicyDiagnosticState, d as requestDeferredPluginToolApproval, g as consumePreExecutionBlockedToolCall, h as consumeAdjustedParamsForToolCall, i as getBeforeToolCallFailureDisposition, m as wrapToolWithBeforeToolCallHook, o as hasBeforeToolCallPolicy, p as runBeforeToolCallHook, r as finalizeToolTerminalPresentation } from "../agent-tools.before-tool-call-BsTbx05H.js";
import { T as setBeforeToolCallDiagnosticsEnabled, t as callGatewayTool, v as getChannelAgentToolMeta, w as isToolWrappedWithBeforeToolCallHook } from "../gateway-C9uLS6B6.js";
import { a as resolveToolExecutionErrorKind, n as isToolResultError, o as resolveToolResultFailureKind, t as formatToolExecutionErrorMessage } from "../tool-result-error-BAe6SDCB.js";
import { t as log } from "../logger-CPGP1LBb.js";
import { o as normalizeHeartbeatToolResponse, t as HEARTBEAT_RESPONSE_TOOL_NAME } from "../heartbeat-tool-response-B3cJVfMo.js";
import { I as formatToolAggregate } from "../streaming-mCjxA41J.js";
import { a as isMessagingToolSendAction, r as isMessagingTool } from "../embedded-agent-messaging-D75wjwT1.js";
import { a as extractMessagingToolSend, f as filterToolResultMediaUrls, h as sanitizeToolResult, l as extractToolErrorMessage, o as extractMessagingToolSendResult, u as extractToolResultMediaArtifact } from "../embedded-agent-subscribe.tools-Tsj1UwaR.js";
import { n as isDeliveredMessageToolOnlySourceReplyResult, r as isDeliveredMessagingToolResult } from "../embedded-agent-message-tool-source-reply-gbK8fXok.js";
import { B as claimPendingAgentQuestionAnswer, G as emptyAgentHarnessUserInputAnswers, K as formatAgentHarnessUserInputPrompt, U as buildAgentHarnessUserInputAnswers, V as runAgentHarnessGatewayQuestion, W as deliverAgentHarnessUserInputPrompt, q as normalizeAgentHarnessUserInputAnswer, z as cancelPendingAgentQuestionForSession } from "../openclaw-tools-BOZnRe0J.js";
import { r as isReplaySafeToolCall } from "../tool-mutation-D2Iez_1l.js";
import { a as resolveBootstrapContextForRun, n as buildBootstrapContextForFiles, o as resolveBootstrapFilesForRun } from "../bootstrap-files-D9G2_nBd.js";
import { o as resolveAttemptFsWorkspaceOnly } from "../attempt.prompt-helpers-BOoRSetZ.js";
import { a as resolveSessionWriteLockAcquireTimeoutMs, o as resolveSessionWriteLockOptions, t as acquireSessionWriteLock } from "../session-write-lock-CmJ4mpu5.js";
import { a as selectDefaultNodeFromList, i as resolveNodeIdFromList, t as listNodes } from "../nodes-utils-D9e6t-PX.js";
import { n as runAgentHarnessBeforeMessageWriteHook, t as runAgentHarnessAfterToolCallHook } from "../hook-helpers-D0cpcLiM.js";
import { l as supportsModelTools } from "../openai-transport-stream-MyF901om.js";
import { a as hasSandboxBindReadonlyHostShadows, i as hasSandboxBindContainerPathAliases, n as resolveSandboxContext, o as resolveWritableSandboxBindHostRoots } from "../context-HnXvYC_2.js";
import { i as normalizeProviderToolSchemas, n as normalizeAgentRuntimeTools, t as logAgentRuntimeToolDiagnostics } from "../tools-T7llk-Gb.js";
import { i as projectRuntimeToolInputSchema, r as inspectRuntimeToolInputSchemas, t as filterProviderNormalizableTools } from "../tool-schema-projection-ZrMdwk4s.js";
import { r as resolveEmbeddedAttemptToolConstructionPlan, t as applyEmbeddedAttemptToolsAllow } from "../attempt-tool-construction-plan-617uvZzs.js";
import { t as buildAgentHookContextChannelFields } from "../hook-agent-context-BL_Cd-K4.js";
import { n as buildSkillWorkshopPromptSection, t as SKILL_WORKSHOP_TOOL_NAME } from "../skill-workshop-prompt-owAVE1ev.js";
import { r as resolveAttemptSpawnWorkspaceDir } from "../attempt.thread-helpers-Cg1ziZz3.js";
import { c as shouldPreemptivelyCompactBeforePrompt, n as runAgentCleanupStep, o as estimateRenderedLlmBoundaryTokenPressure, r as PREEMPTIVE_OVERFLOW_ERROR_TEXT, s as formatPrePromptPrecheckLog, t as buildEmbeddedAttemptToolRunContext } from "../attempt.tool-run-context-iyd4ZIeK.js";
import { a as runAgentHarnessLlmInputHook, i as runAgentHarnessBeforeAgentFinalizeHook, n as getAgentHarnessHookRunner, o as runAgentHarnessLlmOutputHook, r as runAgentHarnessAgentEndHook, t as awaitAgentHarnessAgentEndHook } from "../lifecycle-hook-helpers-BnNcARCn.js";
import { t as createAgentToolResultMiddlewareRunner } from "../tool-result-middleware-KRwH-o5s.js";
import { t as classifyEmbeddedAgentRunResultForModelFallback } from "../result-fallback-classifier-DGNwN5oa.js";
import { r as buildAgentRuntimePlan } from "../build-BXlzU8Cq.js";
import { a as fingerprintResolvedAuthProfileCredential } from "../execution-auth-binding-CmucNoqo.js";
import { t as resolveOpenClawAgentDir } from "../agent-dir-compat-CCE1JfuT.js";
import { t as formatApprovalDisplayPath } from "../approval-display-paths-DlQSsCnq.js";
import { a as inferToolMetaFromArgs, c as queueAgentHarnessMessage, d as runAgentHarnessAfterCompactionHook, f as runAgentHarnessBeforeCompactionHook, i as formatToolProgressOutput, l as createCodexAppServerToolResultExtensionRunner, n as classifyAgentHarnessTerminalOutcome, o as loadCodexBundleMcpThreadConfig, r as detectAndLoadAgentHarnessPromptImages, s as materializeRequesterScopedMcpToolsForHarnessRun, t as TOOL_PROGRESS_OUTPUT_MAX_CHARS, u as resolveAgentHarnessBeforePromptBuildResult } from "../agent-harness-runtime-BoKDsFft.js";
import { c as resolveNativeHookRelayDeferredToolApproval, l as testing, n as hasNativeHookRelayInvocation, o as registerNativeHookRelay, r as invokeNativeHookRelay, t as buildNativeHookRelayCommand } from "../native-hook-relay-DrXw-gYD.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, applyEmbeddedAttemptToolsAllow, assembleHarnessContextEngine, assertContextEngineHostSupport, attachModelProviderRequestTransport, awaitAgentEndSideEffects, awaitAgentHarnessAgentEndHook, bootstrapHarnessContextEngine, buildAgentHarnessUserInputAnswers, buildAgentHookContextChannelFields, buildAgentRuntimePlan, buildBootstrapContextForFiles, buildEmbeddedAttemptToolRunContext, buildHarnessContextEngineRuntimeContext, buildHarnessContextEngineRuntimeContextFromUsage, buildNativeHookRelayCommand, buildSkillWorkshopPromptSection, callGatewayTool, cancelPendingAgentQuestionForSession, claimPendingAgentQuestionAnswer, classifyAgentHarnessTerminalOutcome, classifyEmbeddedAgentRunResultForModelFallback, classifyEmbeddedAgentRunResultForModelFallback as classifyEmbeddedPiRunResultForModelFallback, clearActiveEmbeddedRun, compactContextEngineWithSafetyTimeout, compactWithSafetyTimeout, consumeAdjustedParamsForToolCall, consumePreExecutionBlockedToolCall, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, deliverAgentHarnessUserInputPrompt, detectAndLoadAgentHarnessPromptImages, disposeRegisteredAgentHarnesses, log as embeddedAgentLog, emitAgentEvent, emptyAgentHarnessUserInputAnswers, estimateRenderedLlmBoundaryTokenPressure, extractMessagingToolSend, extractMessagingToolSendResult, extractToolErrorMessage, extractToolResultMediaArtifact, filterProviderNormalizableTools, filterToolResultMediaUrls, finalizeHarnessContextEngineTurn, finalizeToolTerminalPresentation, fingerprintResolvedAuthProfileCredential, formatAgentHarnessUserInputPrompt, formatApprovalDisplayPath, formatErrorMessage, formatFastModeAutoProgressText, formatPrePromptPrecheckLog, formatToolAggregate, formatToolExecutionErrorMessage, formatToolProgressOutput, getAgentHarnessHookRunner, getBeforeToolCallFailureDisposition, getBeforeToolCallPolicyDiagnosticState, getChannelAgentToolMeta, getModelProviderRequestTransport, getPluginToolMeta, hasBeforeToolCallPolicy, hasNativeHookRelayInvocation, hasSandboxBindContainerPathAliases, hasSandboxBindReadonlyHostShadows, inferToolMetaFromArgs, inspectRuntimeToolInputSchemas, invokeNativeHookRelay, isActiveHarnessContextEngine, isAgentToolReplaySafe, isDeliveredMessageToolOnlySourceReplyResult, isDeliveredMessagingToolResult, isHostScopedAgentToolActive, isMessagingTool, isMessagingToolSendAction, isReplaySafeToolCall, isSubagentSessionKey, isToolResultError, isToolWrappedWithBeforeToolCallHook, listNodes, loadCodexBundleMcpThreadConfig, logAgentRuntimeToolDiagnostics, materializeRequesterScopedMcpToolsForHarnessRun, testing as nativeHookRelayTesting, normalizeAgentHarnessUserInputAnswer, normalizeAgentRuntimeTools, normalizeHeartbeatToolResponse, normalizeProviderToolSchemas, normalizeUsage, onAgentEvent, projectRuntimeToolInputSchema, queueAgentHarnessMessage, registerNativeHookRelay, requestDeferredPluginToolApproval, resetAgentEventsForTest, resolveActiveEmbeddedRunSessionId, resolveAgentDir, resolveAgentHarnessBeforePromptBuildResult, resolveAgentRunAbortLifecycleFields, resolveAttemptFsWorkspaceOnly, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveBootstrapFilesForRun, resolveCompactionTimeoutMs, resolveContextEngineOwnerPluginId, resolveDefaultAgentDir, resolveEmbeddedAgentRuntime, resolveEmbeddedAttemptToolConstructionPlan, resolveFastModeForElapsed, resolveModelAuthMode, resolveNativeHookRelayDeferredToolApproval, resolveNodeIdFromList, resolveOpenClawAgentDir, resolveSandboxContext, resolveSessionAgentIds, resolveSessionWriteLockAcquireTimeoutMs, resolveSessionWriteLockOptions, resolveToolExecutionErrorKind, resolveToolResultFailureKind, resolveUserPath, resolveWritableSandboxBindHostRoots, runAgentCleanupStep, runAgentEndSideEffects, runAgentHarnessAfterCompactionHook, runAgentHarnessAfterToolCallHook, runAgentHarnessAgentEndHook, runAgentHarnessBeforeAgentFinalizeHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessGatewayQuestion, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, runBeforeToolCallHook, runHarnessContextEngineMaintenance, sanitizeToolResult, selectDefaultNodeFromList, setActiveEmbeddedRun, setBeforeToolCallDiagnosticsEnabled, shouldPreemptivelyCompactBeforePrompt, supportsModelTools, wrapToolWithBeforeToolCallHook };
