import { i as formatErrorMessage } from "../errors-BsEHPnZe.js";
import { p as resolveUserPath } from "../utils-CFG_gPqL.js";
import { n as VERSION } from "../version-Crcn9X9T.js";
import { y as resolveSessionAgentIds } from "../agent-scope-BtC8x3tv.js";
import { a as isSubagentSessionKey } from "../session-key-utils-Bx3apsJ3.js";
import { a as resolveAgentDir, s as resolveDefaultAgentDir } from "../agent-scope-config-DPzinpfV.js";
import { o as resolveEmbeddedAgentRuntime } from "../agent-runtime-id-DAlwphDj.js";
import { n as disposeRegisteredAgentHarnesses } from "../registry-Dd7SiL1f.js";
import { s as resolveContextEngineOwnerPluginId } from "../registry-CMq-i5MO.js";
import { d as resetAgentEventsForTest, i as emitAgentEvent, l as onAgentEvent } from "../agent-events-f1e3xUso.js";
import { s as appendSessionTranscriptMessage } from "../transcript-TEA3zqFC.js";
import { t as emitSessionTranscriptUpdate } from "../transcript-events-_AiEotlV.js";
import { d as resolveSessionWriteLockOptions, i as acquireSessionWriteLock, l as resolveSessionWriteLockAcquireTimeoutMs } from "../session-write-lock-wt1fpiqA.js";
import { f as resolveModelAuthMode } from "../model-auth-B8F5zQqF.js";
import { g as resolveActiveEmbeddedRunSessionId, n as abortEmbeddedAgentRun, r as clearActiveEmbeddedRun, t as abortAndDrainEmbeddedAgentRun, v as setActiveEmbeddedRun } from "../runs-C5fsa7El.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-Bs6YWghQ.js";
import { h as supportsModelTools } from "../openai-transport-stream-Bv0IzW3c.js";
import { t as log } from "../logger-Clqrc4ah.js";
import { o as resolveAttemptFsWorkspaceOnly, v as buildAgentHookContextChannelFields } from "../attempt.prompt-helpers-oH7fLvgA.js";
import { i as getPluginToolMeta } from "../tools-DfTfUM6D.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-BnBlaCvT.js";
import { t as callGatewayTool } from "../gateway-C8HyzvSp.js";
import { t as createOpenClawCodingTools } from "../agent-tools-CEuafPvR.js";
import { a as selectDefaultNodeFromList, i as resolveNodeIdFromList, t as listNodes } from "../nodes-utils-DbHNKI49.js";
import { P as formatToolAggregate } from "../streaming-Ct6RwWEH.js";
import { c as hasSandboxBindReadonlyHostShadows, l as resolveWritableSandboxBindHostRoots, o as resolveSandboxContext, s as hasSandboxBindContainerPathAliases } from "../sandbox-DidbHe6t.js";
import { a as resolveBootstrapContextForRun, n as buildBootstrapContextForFiles, o as resolveBootstrapFilesForRun } from "../bootstrap-files-DBiHMu59.js";
import { a as extractToolResultMediaArtifact, h as isMessagingToolSendAction, m as isMessagingTool, s as filterToolResultMediaUrls } from "../embedded-agent-subscribe.tools-DiZmVvGt.js";
import { a as runAgentHarnessLlmInputHook, i as runAgentHarnessBeforeAgentFinalizeHook, n as getAgentHarnessHookRunner, o as runAgentHarnessLlmOutputHook, r as runAgentHarnessAgentEndHook, t as awaitAgentHarnessAgentEndHook } from "../lifecycle-hook-helpers-S1Gf_zJR.js";
import { a as inspectRuntimeToolInputSchemas, c as normalizeProviderToolSchemas, n as normalizeAgentRuntimeTools, o as projectRuntimeToolInputSchema, r as filterProviderNormalizableTools, t as logAgentRuntimeToolDiagnostics } from "../tools-CcmZMhkn.js";
import { n as buildSkillWorkshopPromptSection, t as SKILL_WORKSHOP_TOOL_NAME } from "../skill-workshop-prompt-3nt-4be0.js";
import { a as estimateRenderedLlmBoundaryTokenPressure, c as createAgentToolResultMiddlewareRunner, h as resolveCompactionTimeoutMs, m as compactWithSafetyTimeout, n as runAgentCleanupStep, o as formatPrePromptPrecheckLog, p as compactContextEngineWithSafetyTimeout, r as PREEMPTIVE_OVERFLOW_ERROR_TEXT, s as shouldPreemptivelyCompactBeforePrompt, t as buildEmbeddedAttemptToolRunContext } from "../attempt.tool-run-context-BN4eSlSc.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-DQv-UiN8.js";
import { r as resolveEmbeddedAttemptToolConstructionPlan, t as applyEmbeddedAttemptToolsAllow } from "../attempt-tool-construction-plan-UVMeYUEz.js";
import { r as resolveAttemptSpawnWorkspaceDir } from "../attempt.thread-helpers-QYcmpkFM.js";
import { t as classifyEmbeddedAgentRunResultForModelFallback } from "../result-fallback-classifier-DgHSTvEa.js";
import { r as buildAgentRuntimePlan } from "../build-DuEvcCTl.js";
import { t as resolveOpenClawAgentDir } from "../agent-dir-compat-DhvA9XnM.js";
import { t as formatApprovalDisplayPath } from "../approval-display-paths-BqRczx-P.js";
import { n as runAgentHarnessBeforeMessageWriteHook, t as runAgentHarnessAfterToolCallHook } from "../hook-helpers-C6gOnAgL.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-CmPA8Xsa.js";
import { c as resolveNativeHookRelayDeferredToolApproval, l as testing, n as hasNativeHookRelayInvocation, o as registerNativeHookRelay, r as invokeNativeHookRelay, t as buildNativeHookRelayCommand } from "../native-hook-relay-Cp0Cyjac.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 };
