import { i as formatErrorMessage } from "../errors-MtvAMHJ_.js";
import { p as resolveUserPath } from "../utils-BQafJ6e6.js";
import { n as VERSION } from "../version-DuSfZTOW.js";
import { y as resolveSessionAgentIds } from "../agent-scope-DTd9OXHs.js";
import { a as isSubagentSessionKey } from "../session-key-utils-Bx3apsJ3.js";
import { a as resolveAgentDir, s as resolveDefaultAgentDir } from "../agent-scope-config-By9b6pJY.js";
import { o as resolveEmbeddedAgentRuntime } from "../agent-runtime-id-DMhQOgsZ.js";
import { n as disposeRegisteredAgentHarnesses } from "../registry-6sxIX6DF.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-CwTiaz2D.js";
import { t as emitSessionTranscriptUpdate } from "../transcript-events-_AiEotlV.js";
import { d as resolveSessionWriteLockOptions, i as acquireSessionWriteLock, l as resolveSessionWriteLockAcquireTimeoutMs } from "../session-write-lock-CP15IEDO.js";
import { f as resolveModelAuthMode } from "../model-auth-Cfg2Le-d.js";
import { g as resolveActiveEmbeddedRunSessionId, n as abortEmbeddedAgentRun, r as clearActiveEmbeddedRun, t as abortAndDrainEmbeddedAgentRun, v as setActiveEmbeddedRun } from "../runs-Bd_hn50O.js";
import { o as normalizeUsage } from "../usage-CMHCCi6P.js";
import { r as assertContextEngineHostSupport, t as CODEX_APP_SERVER_CONTEXT_ENGINE_HOST } from "../host-compat-BUYjFk3g.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-DD8G327H.js";
import { t as log } from "../logger-B-ebHg8Q.js";
import { t as buildAgentHookContextChannelFields } from "../hook-agent-context-BP451Fk5.js";
import { i as getPluginToolMeta } from "../tools-hnmJiORs.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-BWiJPaky.js";
import { t as callGatewayTool } from "../gateway-CHdyw57b.js";
import { a as selectDefaultNodeFromList, i as resolveNodeIdFromList, t as listNodes } from "../nodes-utils-CgUQhA4_.js";
import { P as formatToolAggregate } from "../streaming-CZboOBxe.js";
import { c as hasSandboxBindReadonlyHostShadows, l as resolveWritableSandboxBindHostRoots, o as resolveSandboxContext, s as hasSandboxBindContainerPathAliases } from "../sandbox-DuhOjAib.js";
import { a as resolveBootstrapContextForRun, n as buildBootstrapContextForFiles, o as resolveBootstrapFilesForRun } from "../bootstrap-files-CpygIprr.js";
import { a as extractToolResultMediaArtifact, m as isMessagingToolSendAction, p as isMessagingTool, s as filterToolResultMediaUrls } from "../embedded-agent-subscribe.tools-VciZj5Dg.js";
import { a as runAgentHarnessLlmInputHook, i as runAgentHarnessBeforeAgentFinalizeHook, n as getAgentHarnessHookRunner, o as runAgentHarnessLlmOutputHook, r as runAgentHarnessAgentEndHook, t as awaitAgentHarnessAgentEndHook } from "../lifecycle-hook-helpers-Cht-5tlB.js";
import { i as projectRuntimeToolInputSchema, o as normalizeProviderToolSchemas, r as inspectRuntimeToolInputSchemas, t as filterProviderNormalizableTools } from "../tool-schema-projection-0MZop83m.js";
import { n as normalizeAgentRuntimeTools, t as logAgentRuntimeToolDiagnostics } from "../tools-COABcHcD.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-DBVQzIvJ.js";
import { o as resolveAttemptFsWorkspaceOnly } from "../attempt.prompt-helpers-OLEAixtT.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-BmgWb1L9.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-hL09_GB7.js";
import { r as resolveEmbeddedAttemptToolConstructionPlan, t as applyEmbeddedAttemptToolsAllow } from "../attempt-tool-construction-plan-zYrgkfqX.js";
import { r as resolveAttemptSpawnWorkspaceDir } from "../attempt.thread-helpers-CleElSxP.js";
import { t as classifyEmbeddedAgentRunResultForModelFallback } from "../result-fallback-classifier-B_CPALME.js";
import { r as buildAgentRuntimePlan } from "../build-CMwfuqxU.js";
import { t as resolveOpenClawAgentDir } from "../agent-dir-compat-ChEecuvo.js";
import { t as formatApprovalDisplayPath } from "../approval-display-paths-BqRczx-P.js";
import { n as runAgentHarnessBeforeMessageWriteHook, t as runAgentHarnessAfterToolCallHook } from "../hook-helpers-q7iFLUuU.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-DL2IIGJD.js";
import { c as resolveNativeHookRelayDeferredToolApproval, l as testing, n as hasNativeHookRelayInvocation, o as registerNativeHookRelay, r as invokeNativeHookRelay, t as buildNativeHookRelayCommand } from "../native-hook-relay-_j6JhcET.js";
export { CODEX_APP_SERVER_CONTEXT_ENGINE_HOST, VERSION as DEX_VERSION, HEARTBEAT_RESPONSE_TOOL_NAME, 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 };
