import { i as formatErrorMessage } from "../errors-DDuhvJiB.js";
import { p as resolveUserPath } from "../utils-B5r0V84N.js";
import { n as VERSION } from "../version-BjFOZC7j.js";
import { v as resolveSessionAgentIds } from "../agent-scope-vHns6igz.js";
import { a as isSubagentSessionKey } from "../session-key-utils-AmKO9Roj.js";
import { a as resolveAgentDir, s as resolveDefaultAgentDir } from "../agent-scope-config-Dq1rQbQT.js";
import { m as resolveEmbeddedAgentRuntime } from "../openai-codex-routing-C0Om2pCM.js";
import { n as disposeRegisteredAgentHarnesses } from "../registry-BeJrg9Zg.js";
import { o as resolveContextEngineOwnerPluginId } from "../registry-DxH_0Os-.js";
import { d as resetAgentEventsForTest, i as emitAgentEvent, l as onAgentEvent } from "../agent-events-BuYtWSh4.js";
import { s as appendSessionTranscriptMessage } from "../transcript-ngD8Ifxr.js";
import { t as emitSessionTranscriptUpdate } from "../transcript-events-cdgltU-p.js";
import { d as resolveSessionWriteLockOptions, i as acquireSessionWriteLock, l as resolveSessionWriteLockAcquireTimeoutMs } from "../session-write-lock-D-Co5EtS.js";
import { m as setActiveEmbeddedRun, n as abortEmbeddedPiRun, p as resolveActiveEmbeddedRunSessionId, r as clearActiveEmbeddedRun } from "../runs-2RSJLQSv.js";
import { o as normalizeUsage } from "../usage-BYlXiQhu.js";
import { r as assertContextEngineHostSupport, t as CODEX_APP_SERVER_CONTEXT_ENGINE_HOST } from "../host-compat-DMtVtGSr.js";
import { o as normalizeHeartbeatToolResponse, t as HEARTBEAT_RESPONSE_TOOL_NAME } from "../heartbeat-tool-response-Cf30jwQW.js";
import { _ as buildAgentHookContextChannelFields } from "../attempt.prompt-helpers-B5Kvu3Pl.js";
import { a as resolveBootstrapContextForRun } from "../bootstrap-files-B4l9hS2G.js";
import { a as getBeforeToolCallPolicyDiagnosticState, d as runBeforeToolCallHook, f as setBeforeToolCallDiagnosticsEnabled, l as isToolWrappedWithBeforeToolCallHook, m as wrapToolWithBeforeToolCallHook, o as hasBeforeToolCallPolicy } from "../pi-tools.before-tool-call-Dt64hoi0.js";
import { t as callGatewayTool } from "../gateway-D0cHLUFl.js";
import { d as resolveModelAuthMode } from "../model-auth-BeEM8qbq.js";
import { t as supportsModelTools } from "../model-tool-support-D9jCvogW.js";
import { E as extractToolResultMediaArtifact, I as isMessagingTool, L as isMessagingToolSendAction, O as filterToolResultMediaUrls, _ as resolveCompactionTimeoutMs, a as formatPrePromptPrecheckLog, h as compactContextEngineWithSafetyTimeout, i as estimateRenderedLlmBoundaryTokenPressure, m as createAgentToolResultMiddlewareRunner, n as PREEMPTIVE_OVERFLOW_ERROR_TEXT, o as shouldPreemptivelyCompactBeforePrompt, t as buildEmbeddedAttemptToolRunContext, x as runAgentCleanupStep } from "../attempt.tool-run-context-Vdxv65zN.js";
import { N as formatToolAggregate } from "../channel-streaming-DG_pM5Sv.js";
import { t as log } from "../logger-CjJGUCKM.js";
import { a as selectDefaultNodeFromList, i as resolveNodeIdFromList, t as listNodes } from "../nodes-utils-BCquDHcg.js";
import { i as normalizeProviderToolSchemas, n as normalizeAgentRuntimeTools, t as logAgentRuntimeToolDiagnostics } from "../tools-aTNrd7n7.js";
import { c as hasSandboxBindReadonlyHostShadows, l as resolveWritableSandboxBindHostRoots, o as resolveSandboxContext, s as hasSandboxBindContainerPathAliases } from "../sandbox-BJq_9XXq.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-BhfiQs3B.js";
import { r as resolveAttemptSpawnWorkspaceDir } from "../attempt.thread-helpers-DqwMF8UC.js";
import { t as classifyEmbeddedPiRunResultForModelFallback } from "../result-fallback-classifier-CqgiCO3Y.js";
import { r as buildAgentRuntimePlan } from "../build-Dib_ou58.js";
import { a as runAgentHarnessLlmOutputHook, i as runAgentHarnessLlmInputHook, n as runAgentHarnessAgentEndHook, r as runAgentHarnessBeforeAgentFinalizeHook, t as awaitAgentHarnessAgentEndHook } from "../lifecycle-hook-helpers-BHyC78VI.js";
import { t as resolveOpenClawAgentDir } from "../agent-dir-compat-DUPbU1Wx.js";
import { t as formatApprovalDisplayPath } from "../approval-display-paths-BqRczx-P.js";
import { n as runAgentHarnessBeforeMessageWriteHook, t as runAgentHarnessAfterToolCallHook } from "../hook-helpers-DyVHhAgE.js";
import { n as projectRuntimeToolInputSchema, t as inspectRuntimeToolInputSchemas } from "../tool-schema-projection-DvycgybF.js";
import { a as loadCodexBundleMcpThreadConfig, c as resolveAgentHarnessBeforePromptBuildResult, i as inferToolMetaFromArgs, l as runAgentHarnessAfterCompactionHook, n as classifyAgentHarnessTerminalOutcome, o as queueAgentHarnessMessage, r as formatToolProgressOutput, s as createCodexAppServerToolResultExtensionRunner, t as TOOL_PROGRESS_OUTPUT_MAX_CHARS, u as runAgentHarnessBeforeCompactionHook } from "../agent-harness-runtime-BB0CsLEU.js";
import { c as testing, n as hasNativeHookRelayInvocation, o as registerNativeHookRelay, r as invokeNativeHookRelay, t as buildNativeHookRelayCommand } from "../native-hook-relay-AN6S_wz5.js";
export { CODEX_APP_SERVER_CONTEXT_ENGINE_HOST, HEARTBEAT_RESPONSE_TOOL_NAME, VERSION as OPENCLAW_VERSION, PREEMPTIVE_OVERFLOW_ERROR_TEXT, TOOL_PROGRESS_OUTPUT_MAX_CHARS, abortEmbeddedPiRun as abortAgentHarnessRun, acquireSessionWriteLock, appendSessionTranscriptMessage, assembleHarnessContextEngine, assertContextEngineHostSupport, awaitAgentHarnessAgentEndHook, bootstrapHarnessContextEngine, buildAgentHookContextChannelFields, buildAgentRuntimePlan, buildEmbeddedAttemptToolRunContext, buildHarnessContextEngineRuntimeContext, buildHarnessContextEngineRuntimeContextFromUsage, buildNativeHookRelayCommand, callGatewayTool, classifyAgentHarnessTerminalOutcome, classifyEmbeddedPiRunResultForModelFallback, clearActiveEmbeddedRun, compactContextEngineWithSafetyTimeout, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, disposeRegisteredAgentHarnesses, log as embeddedAgentLog, emitAgentEvent, emitSessionTranscriptUpdate, estimateRenderedLlmBoundaryTokenPressure, extractToolResultMediaArtifact, filterToolResultMediaUrls, finalizeHarnessContextEngineTurn, formatApprovalDisplayPath, formatErrorMessage, formatPrePromptPrecheckLog, formatToolAggregate, formatToolProgressOutput, getBeforeToolCallPolicyDiagnosticState, 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, resetAgentEventsForTest, resolveActiveEmbeddedRunSessionId, resolveAgentDir, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveCompactionTimeoutMs, resolveContextEngineOwnerPluginId, resolveDefaultAgentDir, resolveEmbeddedAgentRuntime, resolveModelAuthMode, 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 };
