import { i as formatErrorMessage } from "../errors-Bi-6nmCG.js";
import { p as resolveUserPath } from "../utils-CCC-BEJH.js";
import { n as VERSION } from "../version-Crcn9X9T.js";
import { y as resolveSessionAgentIds } from "../agent-scope-CaoKDRYA.js";
import { a as isSubagentSessionKey } from "../session-key-utils-Bx3apsJ3.js";
import { a as resolveAgentDir, s as resolveDefaultAgentDir } from "../agent-scope-config-D93I737S.js";
import { o as resolveEmbeddedAgentRuntime } from "../agent-runtime-id-DiL2DId7.js";
import { n as disposeRegisteredAgentHarnesses } from "../registry-CKWZ5IjU.js";
import { s as resolveContextEngineOwnerPluginId } from "../registry-Dca-zXEr.js";
import { d as resetAgentEventsForTest, i as emitAgentEvent, l as onAgentEvent } from "../agent-events-C1B8VhOg.js";
import { s as appendSessionTranscriptMessage } from "../transcript-DTK-W1ir.js";
import { t as emitSessionTranscriptUpdate } from "../transcript-events-DTn-thXR.js";
import { d as resolveSessionWriteLockOptions, i as acquireSessionWriteLock, l as resolveSessionWriteLockAcquireTimeoutMs } from "../session-write-lock-DdzbgbFT.js";
import { f as resolveModelAuthMode } from "../model-auth-bhDdmQ9J.js";
import { _ as resolveActiveEmbeddedRunSessionId, n as abortEmbeddedAgentRun, r as clearActiveEmbeddedRun, t as abortAndDrainEmbeddedAgentRun, y as setActiveEmbeddedRun } from "../runs-CbxEjpG8.js";
import { o as normalizeUsage } from "../usage-C67Kbb7n.js";
import { _ as wrapToolWithBeforeToolCallHook, f as requestDeferredPluginToolApproval, h as setBeforeToolCallDiagnosticsEnabled, m as runBeforeToolCallHook, o as getBeforeToolCallPolicyDiagnosticState, s as hasBeforeToolCallPolicy, u as isToolWrappedWithBeforeToolCallHook } from "../agent-tools.before-tool-call-CM6tZ9oc.js";
import { i as getPluginToolMeta } from "../tools-QeaLKzZk.js";
import { t as callGatewayTool } from "../gateway-WI564Bwt.js";
import { n as runAgentHarnessBeforeMessageWriteHook, t as runAgentHarnessAfterToolCallHook } from "../hook-helpers-BDvAg6mY.js";
import { r as assertContextEngineHostSupport, t as CODEX_APP_SERVER_CONTEXT_ENGINE_HOST } from "../host-compat-BibWlia2.js";
import { o as normalizeHeartbeatToolResponse, t as HEARTBEAT_RESPONSE_TOOL_NAME } from "../heartbeat-tool-response-D6-_RNEN.js";
import { h as supportsModelTools } from "../openai-transport-stream-m7wBQ7Jz.js";
import { t as log } from "../logger-DPtkRKXl.js";
import { t as buildAgentHookContextChannelFields } from "../hook-agent-context-52t6V0oE.js";
import { a as selectDefaultNodeFromList, i as resolveNodeIdFromList, t as listNodes } from "../nodes-utils-8KKTrlyH.js";
import { P as formatToolAggregate } from "../streaming-12rsbHgp.js";
import { c as hasSandboxBindReadonlyHostShadows, l as resolveWritableSandboxBindHostRoots, o as resolveSandboxContext, s as hasSandboxBindContainerPathAliases } from "../sandbox-D1Xjn9ps.js";
import { a as resolveBootstrapContextForRun, n as buildBootstrapContextForFiles, o as resolveBootstrapFilesForRun } from "../bootstrap-files-BYaqRk3A.js";
import { n as isMessagingTool, r as isMessagingToolSendAction } from "../embedded-agent-messaging-DTuPChZb.js";
import { a as extractToolResultMediaArtifact, s as filterToolResultMediaUrls } from "../embedded-agent-subscribe.tools-DM6Ez-J1.js";
import { a as runAgentHarnessLlmInputHook, i as runAgentHarnessBeforeAgentFinalizeHook, n as getAgentHarnessHookRunner, o as runAgentHarnessLlmOutputHook, r as runAgentHarnessAgentEndHook, t as awaitAgentHarnessAgentEndHook } from "../lifecycle-hook-helpers-jfl4FRRA.js";
import { i as projectRuntimeToolInputSchema, o as normalizeProviderToolSchemas, r as inspectRuntimeToolInputSchemas, t as filterProviderNormalizableTools } from "../tool-schema-projection-DM9C8Yiq.js";
import { n as normalizeAgentRuntimeTools, t as logAgentRuntimeToolDiagnostics } from "../tools-s_H40HMt.js";
import { n as buildSkillWorkshopPromptSection, t as SKILL_WORKSHOP_TOOL_NAME } from "../skill-workshop-prompt-Ro8fA5Wx.js";
import { c as resolveCompactionTimeoutMs, o as compactContextEngineWithSafetyTimeout, s as compactWithSafetyTimeout, t as createAgentToolResultMiddlewareRunner } from "../tool-result-middleware-DfhfLqvc.js";
import { o as resolveAttemptFsWorkspaceOnly } from "../attempt.prompt-helpers-irc-bhNH.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-Dc5V44nD.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-RLsYbrr2.js";
import { r as resolveEmbeddedAttemptToolConstructionPlan, t as applyEmbeddedAttemptToolsAllow } from "../attempt-tool-construction-plan-C32M6pQQ.js";
import { r as resolveAttemptSpawnWorkspaceDir } from "../attempt.thread-helpers-BoamoNdT.js";
import { t as classifyEmbeddedAgentRunResultForModelFallback } from "../result-fallback-classifier-MBd8eRQd.js";
import { r as buildAgentRuntimePlan } from "../build-DZDEN1zi.js";
import { t as resolveOpenClawAgentDir } from "../agent-dir-compat-OXC8pdWa.js";
import { t as formatApprovalDisplayPath } from "../approval-display-paths-DlQSsCnq.js";
import { a as inferToolMetaFromArgs, c as createCodexAppServerToolResultExtensionRunner, d as runAgentHarnessBeforeCompactionHook, i as formatToolProgressOutput, l as resolveAgentHarnessBeforePromptBuildResult, n as classifyAgentHarnessTerminalOutcome, o as loadCodexBundleMcpThreadConfig, r as detectAndLoadAgentHarnessPromptImages, s as queueAgentHarnessMessage, t as TOOL_PROGRESS_OUTPUT_MAX_CHARS, u as runAgentHarnessAfterCompactionHook } from "../agent-harness-runtime-BXJ-VtQA.js";
import { c as resolveNativeHookRelayDeferredToolApproval, l as testing, n as hasNativeHookRelayInvocation, o as registerNativeHookRelay, r as invokeNativeHookRelay, t as buildNativeHookRelayCommand } from "../native-hook-relay-CwaU_q_7.js";
export { CODEX_APP_SERVER_CONTEXT_ENGINE_HOST, 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, awaitAgentHarnessAgentEndHook, bootstrapHarnessContextEngine, buildAgentHookContextChannelFields, buildAgentRuntimePlan, buildBootstrapContextForFiles, buildEmbeddedAttemptToolRunContext, buildHarnessContextEngineRuntimeContext, buildHarnessContextEngineRuntimeContextFromUsage, buildNativeHookRelayCommand, buildSkillWorkshopPromptSection, callGatewayTool, classifyAgentHarnessTerminalOutcome, classifyEmbeddedAgentRunResultForModelFallback, classifyEmbeddedAgentRunResultForModelFallback as classifyEmbeddedPiRunResultForModelFallback, clearActiveEmbeddedRun, compactContextEngineWithSafetyTimeout, compactWithSafetyTimeout, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, detectAndLoadAgentHarnessPromptImages, disposeRegisteredAgentHarnesses, log as embeddedAgentLog, emitAgentEvent, emitSessionTranscriptUpdate, estimateRenderedLlmBoundaryTokenPressure, extractToolResultMediaArtifact, filterProviderNormalizableTools, filterToolResultMediaUrls, finalizeHarnessContextEngineTurn, formatApprovalDisplayPath, formatErrorMessage, formatPrePromptPrecheckLog, formatToolAggregate, formatToolProgressOutput, getAgentHarnessHookRunner, getBeforeToolCallPolicyDiagnosticState, getPluginToolMeta, 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, requestDeferredPluginToolApproval, resetAgentEventsForTest, resolveActiveEmbeddedRunSessionId, resolveAgentDir, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptFsWorkspaceOnly, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveBootstrapFilesForRun, resolveCompactionTimeoutMs, resolveContextEngineOwnerPluginId, resolveDefaultAgentDir, resolveEmbeddedAgentRuntime, resolveEmbeddedAttemptToolConstructionPlan, resolveModelAuthMode, resolveNativeHookRelayDeferredToolApproval, 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 };
