import { i as formatErrorMessage } from "../errors-DT-4GRK9.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-93WG1XkL.js";
import { a as isSubagentSessionKey } from "../session-key-utils-Bx3apsJ3.js";
import { a as resolveAgentDir, s as resolveDefaultAgentDir } from "../agent-scope-config-DIAx4Oyb.js";
import { o as resolveEmbeddedAgentRuntime } from "../agent-runtime-id-DAlwphDj.js";
import { n as disposeRegisteredAgentHarnesses } from "../registry-DrrvQeyE.js";
import { s as resolveContextEngineOwnerPluginId } from "../registry-DBT9gpif.js";
import { d as resetAgentEventsForTest, i as emitAgentEvent, l as onAgentEvent } from "../agent-events-C1B8VhOg.js";
import { s as appendSessionTranscriptMessage } from "../transcript-BHvNwqa0.js";
import { t as emitSessionTranscriptUpdate } from "../transcript-events-_AiEotlV.js";
import { d as resolveSessionWriteLockOptions, i as acquireSessionWriteLock, l as resolveSessionWriteLockAcquireTimeoutMs } from "../session-write-lock-CuYjf0Li.js";
import { f as resolveModelAuthMode } from "../model-auth-DU0RqW4t.js";
import { g as resolveActiveEmbeddedRunSessionId, n as abortEmbeddedAgentRun, r as clearActiveEmbeddedRun, t as abortAndDrainEmbeddedAgentRun, v as setActiveEmbeddedRun } from "../runs-BG-n5RJL.js";
import { o as normalizeUsage } from "../usage-CMHCCi6P.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--2ChYZ9j.js";
import { h as supportsModelTools } from "../openai-transport-stream-DQ1J4_3W.js";
import { t as log } from "../logger-Cjo1J6e_.js";
import { t as buildAgentHookContextChannelFields } from "../hook-agent-context-BP451Fk5.js";
import { i as getPluginToolMeta } from "../tools-jSqjtUkE.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-grvpnebg.js";
import { t as callGatewayTool } from "../gateway-DCrk-dec.js";
import { t as createOpenClawCodingTools } from "../agent-tools-BjNFb1oB.js";
import { a as selectDefaultNodeFromList, i as resolveNodeIdFromList, t as listNodes } from "../nodes-utils-_XedbBkv.js";
import { P as formatToolAggregate } from "../streaming-DaD28kG0.js";
import { c as hasSandboxBindReadonlyHostShadows, l as resolveWritableSandboxBindHostRoots, o as resolveSandboxContext, s as hasSandboxBindContainerPathAliases } from "../sandbox-C-A1eezf.js";
import { a as resolveBootstrapContextForRun, n as buildBootstrapContextForFiles, o as resolveBootstrapFilesForRun } from "../bootstrap-files-DZwrnV_A.js";
import { a as extractToolResultMediaArtifact, m as isMessagingToolSendAction, p as isMessagingTool, s as filterToolResultMediaUrls } from "../embedded-agent-subscribe.tools-DL-kXW7Y.js";
import { a as runAgentHarnessLlmInputHook, i as runAgentHarnessBeforeAgentFinalizeHook, n as getAgentHarnessHookRunner, o as runAgentHarnessLlmOutputHook, r as runAgentHarnessAgentEndHook, t as awaitAgentHarnessAgentEndHook } from "../lifecycle-hook-helpers-Ba2-wW_1.js";
import { i as projectRuntimeToolInputSchema, o as normalizeProviderToolSchemas, r as inspectRuntimeToolInputSchemas, t as filterProviderNormalizableTools } from "../tool-schema-projection-DITyaCVh.js";
import { n as normalizeAgentRuntimeTools, t as logAgentRuntimeToolDiagnostics } from "../tools-CAsCLDBD.js";
import { n as buildSkillWorkshopPromptSection, t as SKILL_WORKSHOP_TOOL_NAME } from "../skill-workshop-prompt-3nt-4be0.js";
import { c as resolveCompactionTimeoutMs, o as compactContextEngineWithSafetyTimeout, s as compactWithSafetyTimeout, t as createAgentToolResultMiddlewareRunner } from "../tool-result-middleware-Sf2qruAk.js";
import { o as resolveAttemptFsWorkspaceOnly } from "../attempt.prompt-helpers-DU8MDU7a.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-O0Ugb34a.js";
import { a as estimateRenderedLlmBoundaryTokenPressure, n as runAgentCleanupStep, o as formatPrePromptPrecheckLog, r as PREEMPTIVE_OVERFLOW_ERROR_TEXT, s as shouldPreemptivelyCompactBeforePrompt, t as buildEmbeddedAttemptToolRunContext } from "../attempt.tool-run-context-Deh51X5g.js";
import { r as resolveEmbeddedAttemptToolConstructionPlan, t as applyEmbeddedAttemptToolsAllow } from "../attempt-tool-construction-plan-BYN90bt6.js";
import { r as resolveAttemptSpawnWorkspaceDir } from "../attempt.thread-helpers-flm4aPVZ.js";
import { t as classifyEmbeddedAgentRunResultForModelFallback } from "../result-fallback-classifier-DL6qryK8.js";
import { r as buildAgentRuntimePlan } from "../build-o3J7h4D4.js";
import { t as resolveOpenClawAgentDir } from "../agent-dir-compat-C381phbY.js";
import { t as formatApprovalDisplayPath } from "../approval-display-paths-DlQSsCnq.js";
import { n as runAgentHarnessBeforeMessageWriteHook, t as runAgentHarnessAfterToolCallHook } from "../hook-helpers-CpCdH7iZ.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-CWy_eOZn.js";
import { c as resolveNativeHookRelayDeferredToolApproval, l as testing, n as hasNativeHookRelayInvocation, o as registerNativeHookRelay, r as invokeNativeHookRelay, t as buildNativeHookRelayCommand } from "../native-hook-relay-DwVynXx4.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, createOpenClawCodingTools, 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 };
