import { i as formatErrorMessage } from "../errors-Ca_eBjrO.js";
import { m as resolveUserPath } from "../utils-BmpsSbZo.js";
import { n as VERSION } from "../version-Crcn9X9T.js";
import { y as resolveSessionAgentIds } from "../agent-scope-BhR6l0A-.js";
import { a as isSubagentSessionKey } from "../session-key-utils-Bx3apsJ3.js";
import { a as resolveAgentDir, s as resolveDefaultAgentDir } from "../agent-scope-config-BkE-30yC.js";
import { o as resolveEmbeddedAgentRuntime } from "../agent-runtime-id-DiL2DId7.js";
import { n as disposeRegisteredAgentHarnesses } from "../registry-DeUb3Oys.js";
import { g as resetAgentEventsForTest, p as onAgentEvent, s as emitAgentEvent } from "../agent-events-7y1r8HOP.js";
import { s as resolveContextEngineOwnerPluginId } from "../registry-D6EXS38s.js";
import { t as emitSessionTranscriptUpdate } from "../transcript-events-DTn-thXR.js";
import { o as resolveSessionWriteLockAcquireTimeoutMs, s as resolveSessionWriteLockOptions, t as acquireSessionWriteLock } from "../session-write-lock-zBXVT1L_.js";
import { j as appendSessionTranscriptMessage } from "../session-accessor-BIKwjMqm.js";
import { f as resolveModelAuthMode } from "../model-auth-DwWYfC_1.js";
import { f as resolveActiveEmbeddedRunSessionId } from "../run-state-C7GcUbL6.js";
import { n as abortEmbeddedAgentRun, r as clearActiveEmbeddedRun, t as abortAndDrainEmbeddedAgentRun, v as setActiveEmbeddedRun } from "../runs-skKzFB3N.js";
import { o as normalizeUsage } from "../usage-C67Kbb7n.js";
import { M as getChannelAgentToolMeta, N as consumeAdjustedParamsForToolCall, P as consumePreExecutionBlockedToolCall, a as getBeforeToolCallPolicyDiagnosticState, c as isToolWrappedWithBeforeToolCallHook, d as requestDeferredPluginToolApproval, h as wrapToolWithBeforeToolCallHook, i as finalizeToolTerminalPresentation, m as setBeforeToolCallDiagnosticsEnabled, o as hasBeforeToolCallPolicy, p as runBeforeToolCallHook } from "../agent-tools.before-tool-call-By1cn9zx.js";
import { i as getPluginToolMeta } from "../tools-DKcsOD7f.js";
import { t as callGatewayTool } from "../gateway-BEg4yNzU.js";
import { n as runAgentHarnessBeforeMessageWriteHook, t as runAgentHarnessAfterToolCallHook } from "../hook-helpers-DTpKY_rC.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-BB32sUHt.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-jL8pUpkL.js";
import { c as resolveWebSearchToolPolicy } from "../codex-native-web-search-core-CKotpr6C.js";
import { _ as supportsModelTools } from "../openai-transport-stream-DfL7wfVB.js";
import { t as log } from "../logger-qStGM-gc.js";
import { n as projectRuntimeToolInputSchema } from "../headers-BTPwoHcI.js";
import { t as buildAgentHookContextChannelFields } from "../hook-agent-context-52t6V0oE.js";
import { t as createOpenClawCodingTools } from "../agent-tools-BwYLYSow.js";
import { a as selectDefaultNodeFromList, i as resolveNodeIdFromList, t as listNodes } from "../nodes-utils-rXoid2A1.js";
import { M as formatToolAggregate } from "../streaming-DgJ5zJjm.js";
import { c as hasSandboxBindReadonlyHostShadows, l as resolveWritableSandboxBindHostRoots, o as resolveSandboxContext, s as hasSandboxBindContainerPathAliases } from "../sandbox-DyQZfx4j.js";
import { a as resolveBootstrapContextForRun, n as buildBootstrapContextForFiles, o as resolveBootstrapFilesForRun } from "../bootstrap-files-DbJNHghm.js";
import { a as isMessagingToolSendAction, r as isMessagingTool } from "../embedded-agent-messaging-iHm1e_9t.js";
import { _ as sanitizeToolResult, c as extractMessagingToolSendResult, f as extractToolResultMediaArtifact, m as filterToolResultMediaUrls, s as extractMessagingToolSend, v as isToolResultError } from "../embedded-agent-message-tool-source-reply-DvAaSCgm.js";
import { i as isReplaySafeToolCall } from "../tool-mutation-PCZVqoCy.js";
import { a as runAgentHarnessLlmInputHook, i as runAgentHarnessBeforeAgentFinalizeHook, n as getAgentHarnessHookRunner, o as runAgentHarnessLlmOutputHook, r as runAgentHarnessAgentEndHook, t as awaitAgentHarnessAgentEndHook } from "../lifecycle-hook-helpers-PCMPYVvz.js";
import { a as normalizeProviderToolSchemas, r as inspectRuntimeToolInputSchemas, t as filterProviderNormalizableTools } from "../tool-schema-projection-BrWFBJLM.js";
import { n as normalizeAgentRuntimeTools, t as logAgentRuntimeToolDiagnostics } from "../tools-B3eMtGau.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--3OOrQvP.js";
import { c as resolveCompactionTimeoutMs, o as compactContextEngineWithSafetyTimeout, s as compactWithSafetyTimeout, t as createAgentToolResultMiddlewareRunner } from "../tool-result-middleware-CEucOAdg.js";
import { o as resolveAttemptFsWorkspaceOnly } from "../attempt.prompt-helpers-sRduNeAq.js";
import { r as resolveEmbeddedAttemptToolConstructionPlan, t as applyEmbeddedAttemptToolsAllow } from "../attempt-tool-construction-plan-JMz6jaYQ.js";
import { r as resolveAttemptSpawnWorkspaceDir } from "../attempt.thread-helpers-Dsz0ZzVI.js";
import { t as classifyEmbeddedAgentRunResultForModelFallback } from "../result-fallback-classifier-CgIYnUSD.js";
import { r as buildAgentRuntimePlan } from "../build-CaSFSMFY.js";
import { t as resolveOpenClawAgentDir } from "../agent-dir-compat-BVP6he3r.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-Bk99eHl8.js";
import { c as resolveNativeHookRelayDeferredToolApproval, l as testing, n as hasNativeHookRelayInvocation, o as registerNativeHookRelay, r as invokeNativeHookRelay, t as buildNativeHookRelayCommand } from "../native-hook-relay-EgHgIogj.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, consumeAdjustedParamsForToolCall, consumePreExecutionBlockedToolCall, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, createOpenClawCodingTools, detectAndLoadAgentHarnessPromptImages, disposeRegisteredAgentHarnesses, log as embeddedAgentLog, emitAgentEvent, emitSessionTranscriptUpdate, estimateRenderedLlmBoundaryTokenPressure, extractMessagingToolSend, extractMessagingToolSendResult, extractToolResultMediaArtifact, filterProviderNormalizableTools, filterToolResultMediaUrls, finalizeHarnessContextEngineTurn, finalizeToolTerminalPresentation, formatApprovalDisplayPath, formatErrorMessage, formatPrePromptPrecheckLog, formatToolAggregate, formatToolProgressOutput, getAgentHarnessHookRunner, getBeforeToolCallPolicyDiagnosticState, getChannelAgentToolMeta, getPluginToolMeta, hasBeforeToolCallPolicy, hasNativeHookRelayInvocation, hasSandboxBindContainerPathAliases, hasSandboxBindReadonlyHostShadows, inferToolMetaFromArgs, inspectRuntimeToolInputSchemas, invokeNativeHookRelay, isActiveHarnessContextEngine, isAgentToolReplaySafe, isMessagingTool, isMessagingToolSendAction, isReplaySafeToolCall, isSubagentSessionKey, isToolResultError, 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, resolveWebSearchToolPolicy, resolveWritableSandboxBindHostRoots, runAgentCleanupStep, runAgentHarnessAfterCompactionHook, runAgentHarnessAfterToolCallHook, runAgentHarnessAgentEndHook, runAgentHarnessBeforeAgentFinalizeHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, runBeforeToolCallHook, runHarnessContextEngineMaintenance, sanitizeToolResult, selectDefaultNodeFromList, setActiveEmbeddedRun, setBeforeToolCallDiagnosticsEnabled, shouldPreemptivelyCompactBeforePrompt, supportsModelTools, wrapToolWithBeforeToolCallHook };
