@openclaw/codex 2026.9.3 → 2026.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/activity.svg +30 -0
- package/assets/icon.png +0 -0
- package/dist/.setup/account-usage-runtime-C2MOIvfq.mjs +75 -0
- package/dist/{apply-B6el6hdO.js → .setup/apply-CJ0ZfmBG.mjs} +12 -13
- package/dist/.setup/async-questions-DdhOCwGi.mjs +27 -0
- package/dist/{attempt-client-cleanup-D6cR54TV.js → .setup/attempt-client-cleanup-BpYKdTA0.mjs} +30 -211
- package/dist/{attempt-context-AO4DSjE0.js → .setup/attempt-context-VXVwTCfS.mjs} +6 -6
- package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +5 -0
- package/dist/{auth-binding-Co2Vfcf_.js → .setup/auth-binding-DhLWa_7K.mjs} +2 -2
- package/dist/{auth-cache-key-Kq6oerr6.js → .setup/auth-cache-key-QirmgiCo.mjs} +3 -3
- package/dist/{auth-profile-CwzO4_RG.js → .setup/auth-profile-WqZtZfXN.mjs} +1 -1
- package/dist/.setup/binding-connection-Bm38niE8.mjs +50 -0
- package/dist/.setup/binding-connection.runtime-CnRMC0ta.mjs +48 -0
- package/dist/{bounded-turn-lRpmZHFv.js → .setup/bounded-turn-BtlZcivC.mjs} +19 -14
- package/dist/{build-state-6RL6qohz.js → .setup/build-state-Xx9ybZqa.mjs} +1 -1
- package/dist/{capabilities-BeqLPbtM.js → .setup/capabilities-_vXcZGSx.mjs} +1 -1
- package/dist/{client-BEKu4yDx.js → .setup/client-vXs2929Q.mjs} +355 -164
- package/dist/{command-dispatch-CisT9Jqq.js → .setup/command-dispatch-naHIZwwF.mjs} +3 -3
- package/dist/{command-formatters-DeTfrapr.js → .setup/command-formatters-CGEkdawF.mjs} +4 -3
- package/dist/{command-handlers-BfIsJEuA.js → .setup/command-handlers-BtAJEW1X.mjs} +812 -152
- package/dist/{command-rpc-BMqRQOFX.js → .setup/command-rpc-DHFpn4le.mjs} +37 -21
- package/dist/{compact-CGJZ2rlb.js → .setup/compact-C3i3qlzj.mjs} +28 -43
- package/dist/{config-JDfTI4VI.js → .setup/config-CedDWjM-.mjs} +5 -4
- package/dist/{config-options-jnIFvwxD.js → .setup/config-options-BsanJ8QG.mjs} +9 -421
- package/dist/{protocol-CAAcVIKF.js → .setup/config-parsing-CcB9iPoq.mjs} +9 -51
- package/dist/{config-runtime-BWf6JLWG.js → .setup/config-runtime-CeAhl_h4.mjs} +2 -2
- package/dist/.setup/config-security-BRQ2mgW9.mjs +465 -0
- package/dist/{config-utils-C57JiJrU.js → .setup/config-utils-DujwEnhg.mjs} +2 -4
- package/dist/{conversation-binding-CxOlHiix.js → .setup/conversation-binding-DhzrpTM6.mjs} +60 -47
- package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs} +1 -1
- package/dist/{conversation-control-CUCrSIQI.js → .setup/conversation-control-DN53ns41.mjs} +17 -13
- package/dist/.setup/cyber-failover-DYwbmf1o.mjs +123 -0
- package/dist/.setup/cyber-failover-notice-e9G3J9-e.mjs +17 -0
- package/dist/{dynamic-tools-D-JBoaLt.js → .setup/dynamic-tools-D16lOp67.mjs} +168 -61
- package/dist/{effective-mcp-catalog-J_5Ep5Um.js → .setup/effective-mcp-catalog-K6kLCN8X.mjs} +3 -3
- package/dist/{ephemeral-turn-DSwzP8YY.js → .setup/ephemeral-turn-R1gA8Sn6.mjs} +4 -5
- package/dist/{event-projector-assistant-message-BmBM4qBV.js → .setup/event-projector-assistant-message-DNUR1s0A.mjs} +6 -3
- package/dist/.setup/event-projector-items-DyTQ_XqL.mjs +200 -0
- package/dist/{attempt-notifications--H8zXR5-.js → .setup/event-projector-usage-C7Ntzs-f.mjs} +102 -9
- package/dist/{harness-FR6eQgyO.js → .setup/harness-rxaaoN-o.mjs} +90 -19
- package/dist/.setup/inference-context-fulhZuz8.mjs +94 -0
- package/dist/.setup/inference-proxy-CC15HuSi.mjs +311 -0
- package/dist/{isolated-completion-DHBefrzg.js → .setup/isolated-completion-B6srt48J.mjs} +7 -7
- package/dist/{launch-args-RXQwn8zV.js → .setup/launch-args-DnMak49W.mjs} +22 -1
- package/dist/{managed-binary-DrjjRRUD.js → .setup/managed-binary-DP6Rib3P.mjs} +11 -2
- package/dist/{managed-thread-store-D1t5jh3G.js → .setup/managed-thread-store-BMqgThVL.mjs} +48 -14
- package/dist/{model-catalog-B_6M04Wo.js → .setup/model-catalog-DkvUuBey.mjs} +35 -10
- package/dist/{models-P9k2qAof.js → .setup/models-BDFgm_G-.mjs} +3 -3
- package/dist/.setup/native-auth-BLZGqFjw.mjs +57 -0
- package/dist/.setup/native-subagent-history-YXaL6dMd.mjs +135 -0
- package/dist/.setup/native-subagent-monitor-B1hxzIOy.mjs +5031 -0
- package/dist/.setup/native-subagent-task-ids-DsuOonKv.mjs +411 -0
- package/dist/{node-cli-sessions-rj0ysJwM.js → .setup/node-cli-sessions-Cl8b2ZF3.mjs} +1 -1
- package/dist/{node-exec-server.runtime-BY_ctYnT.js → .setup/node-exec-server.runtime-BaViBKNz.mjs} +5 -5
- package/dist/{plan-BMJdMOEF.js → .setup/plan-xD7WKYTM.mjs} +331 -79
- package/dist/{plugin-activation-BQK-f5sV.js → .setup/plugin-activation-r8nq5Jzp.mjs} +24 -19
- package/dist/{plugin-app-cache-key-CdSQzWyX.js → .setup/plugin-app-cache-key-BOxKP7db.mjs} +29 -25
- package/dist/{plugin-approval-roundtrip-DeW95wB5.js → .setup/plugin-approval-roundtrip-CjfzafAZ.mjs} +1 -1
- package/dist/{plugin-inventory-CoRCzWW4.js → .setup/plugin-inventory-DUle8DLz.mjs} +12 -8
- package/dist/{plugin-marketplace-discovery-3akBizzF.js → .setup/plugin-marketplace-discovery-P-Vndfqq.mjs} +18 -15
- package/dist/{plugin-metadata-cache-DgNfRAGA.js → .setup/plugin-metadata-cache-DsS5buNa.mjs} +33 -14
- package/dist/{provider-capabilities-W4tfK5Y5.js → .setup/provider-capabilities-B8J4Dy-O.mjs} +2 -2
- package/dist/.setup/provider-fFh_-VR3.mjs +50 -0
- package/dist/{rate-limits-Bqnx1N4z.js → .setup/rate-limits-DOEGYRNs.mjs} +90 -46
- package/dist/.setup/request-BioXJLYa.mjs +292 -0
- package/dist/.setup/run-attempt-lifecycle-B7JbY4-F.mjs +71 -0
- package/dist/{run-attempt-DwKds3DN.js → .setup/run-attempt-rlA07pUv.mjs} +644 -491
- package/dist/{runtime-artifact-T-NwqeSH.js → .setup/runtime-artifact-Dy38Z5iU.mjs} +2 -2
- package/dist/{sandbox-guard-BcT66fWy.js → .setup/sandbox-guard-BBP-RbTf.mjs} +4 -3
- package/dist/{session-binding-CKSepwIC.js → .setup/session-binding-_0W_fHRr.mjs} +45 -63
- package/dist/{session-binding-record-CaZjYwNS.js → .setup/session-binding-record-TH3xA0zj.mjs} +181 -3
- package/dist/.setup/session-binding-sidecars-CKYEcfNn.mjs +543 -0
- package/dist/{session-catalog-adoption-BKLtSrwi.js → .setup/session-catalog-adoption-CR_whkEW.mjs} +6 -6
- package/dist/{session-catalog-archive-D0i2pGj2.js → .setup/session-catalog-archive-CwZaPacf.mjs} +6 -6
- package/dist/.setup/session-catalog-events-jMcYfQyd.mjs +250 -0
- package/dist/.setup/session-catalog-fUdWDx-U.mjs +2464 -0
- package/dist/.setup/session-catalog-index-B141u15s.mjs +1070 -0
- package/dist/.setup/session-catalog-index-order-Cc5BzlQr.mjs +48 -0
- package/dist/.setup/session-catalog-index-state-BAuDztHN.mjs +180 -0
- package/dist/{session-catalog-parsing-CdD3JhdM.js → .setup/session-catalog-native-projection-ChV3cCtm.mjs} +213 -21
- package/dist/{session-catalog-node-adoption-BUuDYY8R.js → .setup/session-catalog-node-adoption-BVRsYOSh.mjs} +3 -3
- package/dist/{session-catalog-node-continue-CBtc4wkI.js → .setup/session-catalog-node-continue-Dowv8osw.mjs} +7 -7
- package/dist/.setup/session-catalog-projection-C1Bj9Jl-.mjs +414 -0
- package/dist/{session-cli-CbgaHh0f.js → .setup/session-cli-DIj-IE-E.mjs} +4 -4
- package/dist/{session-history-Cz-tOOYj.js → .setup/session-history-C--SrLI8.mjs} +10 -5
- package/dist/{session-history-import-DFN7sWRU.js → .setup/session-history-import-JHXT5Xfi.mjs} +4 -4
- package/dist/{session-history-read-cxPUxyVV.js → .setup/session-history-read-B3ZfSUbF.mjs} +2 -2
- package/dist/{session-history.worker-CNEvGaU5.js → .setup/session-history.worker-CpNj7H_P.mjs} +192 -89
- package/dist/{session-initialization-Jo86C60I.js → .setup/session-initialization-DH1z6fXn.mjs} +2 -2
- package/dist/{session-permission-policy-B22InTp_.js → .setup/session-permission-policy-DhurXY0l.mjs} +2 -2
- package/dist/{session-retirement-BSNG_mhf.js → .setup/session-retirement-CU87AOg9.mjs} +6 -6
- package/dist/{settled-turn-context-Du6gdUDd.js → .setup/settled-turn-context-fmwouT5I.mjs} +2 -2
- package/dist/{settled-turn-finalizer-BuLUrZl2.js → .setup/settled-turn-finalizer-CiY2bLFK.mjs} +10 -10
- package/dist/{shared-client-CVhez2Uo.js → .setup/shared-client-BpTtuLQ5.mjs} +495 -156
- package/dist/{side-question-DLbr2vUU.js → .setup/side-question-DSCZyoBD.mjs} +64 -47
- package/dist/{source-Da-h6f7e.js → .setup/source-Bjp4UQij.mjs} +15 -14
- package/dist/{thread-archive-guard-D1bP04Tf.js → .setup/thread-archive-guard-jmecf6OJ.mjs} +1 -1
- package/dist/.setup/thread-history-page-BTx-4xsg.mjs +83 -0
- package/dist/{thread-lifecycle-D1pzRwHB.js → .setup/thread-lifecycle-Cik28qWn.mjs} +330 -150
- package/dist/{thread-ownership-D6oASVRu.js → .setup/thread-ownership-skomxnIt.mjs} +4 -4
- package/dist/{thread-policy-D8kI7yAO.js → .setup/thread-policy-Cjs4B8xf.mjs} +3 -3
- package/dist/{thread-resume-T5cveyxA.js → .setup/thread-resume-BkNpj9Pz.mjs} +8 -5
- package/dist/.setup/timeout-DZF05XrR.mjs +63 -0
- package/dist/{session-catalog-home-id-D7-aLiNt.js → .setup/transcript-history-projection-DHNBDhCU.mjs} +73 -20
- package/dist/{transcript-mirror-t5TOccct.js → .setup/transcript-mirror-D4qp_leP.mjs} +15 -6
- package/dist/{transcript-mirror-attestation-DibE0krH.js → .setup/transcript-mirror-attestation-CzM-94NC.mjs} +4 -1
- package/dist/{transport-stdio-BGjHoYLr.js → .setup/transport-stdio-Cmx94Oiy.mjs} +149 -44
- package/dist/{upstream-session-fork-De-sLJ2r.js → .setup/upstream-session-fork-D3UKxgVD.mjs} +27 -26
- package/dist/{usage-CPPTmBvZ.js → .setup/usage-BOgBEKso.mjs} +4 -4
- package/dist/.setup/usage-limit-error-C0ow7DOc.mjs +166 -0
- package/dist/{version-omm6IPI3.js → .setup/version-CoqzXPgK.mjs} +1 -1
- package/dist/{web-search-provider.runtime-CSVgQL0w.js → .setup/web-search-provider.runtime-CTGuJt6i.mjs} +3 -3
- package/dist/api.js +28 -20
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +8 -528
- package/dist/harness.js +1 -1
- package/dist/index.js +130 -135
- package/dist/media-understanding-provider.js +3 -3
- package/dist/migration-provider-api.js +2 -0
- package/dist/native-tool-policy.js +12 -0
- package/dist/provider-discovery.js +18 -0
- package/dist/session-history-worker-runtime.js +23 -5
- package/dist/session-history.worker.js +2 -2
- package/dist/web-search-contract-api.js +1 -1
- package/openclaw.plugin.json +354 -68
- package/package.json +11 -8
- package/dist/binding-connection-QqgcPCgk.js +0 -60
- package/dist/event-projector-usage-CIyrYYid.js +0 -102
- package/dist/native-subagent-monitor-BbCUKRwC.js +0 -3350
- package/dist/request-CGvGOpeR.js +0 -198
- package/dist/session-catalog-HaDcp7Sv.js +0 -1533
- package/dist/session-catalog-provenance-DkJHo735.js +0 -124
- package/dist/timeout-BVw8aaM1.js +0 -33
- package/dist/{auth-profile-selection-DFu9e167.js → .setup/auth-profile-selection-DFu9e167.mjs} +0 -0
- package/dist/{context-compaction-activity-CMla5FPJ.js → .setup/context-compaction-activity-CMla5FPJ.mjs} +0 -0
- package/dist/{elicitation-input-DPoK8F7w.js → .setup/elicitation-input-DPoK8F7w.mjs} +0 -0
- package/dist/{history-rejection-B4nOXNXF.js → .setup/history-rejection-B4nOXNXF.mjs} +0 -0
- package/dist/{image-payload-sanitizer-tupAr-2o.js → .setup/image-payload-sanitizer-tupAr-2o.mjs} +0 -0
- package/dist/{incognito-session-uhrBF6wJ.js → .setup/incognito-session-uhrBF6wJ.mjs} +0 -0
- package/dist/{local-runtime-attribution-B_2mnqhb.js → .setup/local-runtime-attribution-B_2mnqhb.mjs} +0 -0
- package/dist/{native-execution-policy-umd0tgh4.js → .setup/native-execution-policy-YBMHSzC4.mjs} +1 -1
- /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
- /package/dist/{session-binding-meta-B7aEMU7g.js → .setup/session-binding-meta-B7aEMU7g.mjs} +0 -0
- /package/dist/{session-upstream-marker-D15C9NHp.js → .setup/session-upstream-marker-D15C9NHp.mjs} +0 -0
- /package/dist/{upstream-prompt-provenance-LphB8slG.js → .setup/upstream-prompt-provenance-LphB8slG.mjs} +0 -0
- /package/dist/{web-search-provider.shared-BrZmlqyR.js → .setup/web-search-provider.shared-BrZmlqyR.mjs} +0 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { CODEX_NATIVE_TOOL_REQUIREMENTS } from "../native-tool-policy.js";
|
|
2
|
+
import { d as CODEX_OPENCLAW_DIRECT_DYNAMIC_TOOL_NAMESPACE, m as isJsonObject, p as flattenCodexDynamicToolFunctions } from "./config-security-BRQ2mgW9.mjs";
|
|
3
|
+
import { d as readCodexPluginConfig, l as isCodexRemoteExecPlacementSandbox } from "./config-parsing-CcB9iPoq.mjs";
|
|
4
|
+
import { B as withDynamicToolTranscriptDetails, E as createCodexElicitationResponse, L as resolveCodexToolAbortTerminalReason, R as createFailedDynamicToolResponse, w as readCodexTurn, z as withDynamicToolExecutionState } from "./client-vXs2929Q.mjs";
|
|
5
|
+
import { o as formatCodexDisplayText } from "./command-formatters-CGEkdawF.mjs";
|
|
6
|
+
import { c as itemName, f as shouldClearTerminalPresentationForNativeItem, l as itemStatus, n as auditNativeToolTerminalStatus, r as auditNativeToolUnfinishedStatus, t as auditNativeToolName, x as readItem } from "./event-projector-items-DyTQ_XqL.mjs";
|
|
7
|
+
import { s as codexAppIdentityKey } from "./plugin-app-cache-key-BOxKP7db.mjs";
|
|
8
|
+
import "./config-CedDWjM-.mjs";
|
|
9
|
+
import { r as sanitizeInlineImageDataUrl, t as invalidInlineImageText } from "./image-payload-sanitizer-tupAr-2o.mjs";
|
|
10
|
+
import { v as isCodexNotificationForTurn } from "./attempt-client-cleanup-BpYKdTA0.mjs";
|
|
11
|
+
import { H as emitCodexNativePreToolUseFailureDiagnostic, at as filterCodexDynamicToolsForDisabledNativeSurface, ct as isSystemAgentOnlyCodexDynamicToolAllowlist, it as filterCodexDynamicTools, lt as normalizeCodexDynamicToolName, ot as isForcedPrivateQaCodexRuntime, w as resolveCodexWebSearchPlan } from "./thread-lifecycle-Cik28qWn.mjs";
|
|
12
|
+
import { n as resolveCodexNativeExecutionPolicy, r as resolveCodexNodeExecToolOverrides } from "./native-execution-policy-YBMHSzC4.mjs";
|
|
13
|
+
import { a as CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME, c as createNodeExecAliasDynamicTool, i as CODEX_GATEWAY_PROCESS_DYNAMIC_TOOL_NAME, l as isCodexDynamicToolExcluded, o as createGatewayExecProjection, r as CODEX_GATEWAY_EXEC_DYNAMIC_TOOL_NAME, s as createGatewayProcessProjection } from "./provider-capabilities-B8J4Dy-O.mjs";
|
|
14
|
+
import { a as requestPluginApprovalOutcome, c as truncateCodexApprovalDisplayText, i as requestPluginApproval, l as waitForPluginApprovalDecision, n as codexApprovalTimeoutText, o as sanitizeCodexApprovalVisibleText, r as mapExecDecisionToOutcome, s as stripDanglingCodexApprovalTerminalSequence, t as approvalRequestExplicitlyUnavailable } from "./plugin-approval-roundtrip-CjfzafAZ.mjs";
|
|
11
15
|
import { createRequire } from "node:module";
|
|
12
16
|
import { asNonArrayRecord, asOptionalRecord, isRecord, normalizeOptionalString, normalizeTrimmedStringList, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
17
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -20,22 +24,22 @@ import { once } from "node:events";
|
|
|
20
24
|
import { spawn } from "node:child_process";
|
|
21
25
|
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
22
26
|
import { DEFAULT_MAX_LIVE_TOOL_RESULT_CHARS, estimateToolResultTextChars, resolveLiveToolResultMaxChars, sliceToolResultTextToBudget, sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
27
|
+
import { emitTrustedDiagnosticEvent } from "openclaw/plugin-sdk/diagnostic-runtime";
|
|
23
28
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
24
29
|
import { createStageTimingTracker, formatStageTimings } from "openclaw/plugin-sdk/time-runtime";
|
|
25
30
|
import { isPathStrictlyInside, root } from "openclaw/plugin-sdk/file-access-runtime";
|
|
26
31
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
27
32
|
import { resolveAgentDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
28
|
-
import { HEARTBEAT_RESPONSE_TOOL_NAME, buildAgentHookContextChannelFields, buildEmbeddedAttemptToolRunContext, consumeAdjustedParamsForToolCall, consumePreExecutionBlockedToolCall, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, embeddedAgentLog, extractMessagingToolSend, extractMessagingToolSendResult, extractToolResultMediaArtifact, filterProviderNormalizableTools, filterToolResultMediaUrls, finalizeAgentToolAvailability, finalizeToolTerminalPresentation, formatApprovalDisplayPath, formatToolExecutionErrorMessage, getBeforeToolCallFailureDisposition, getChannelAgentToolMeta, getPluginToolMeta, getPluginToolSideEffectOwnerKey, hasNativeHookRelayInvocation, invokeNativeHookRelay, isDeliveredMessageToolOnlySourceReplyResult, isDeliveredMessagingToolResult, isHostScopedAgentToolActive, isMessagingTool, isMessagingToolSendAction, isReplaySafeToolCall, isSubagentSessionKey, isToolResultError, isToolWrappedWithBeforeToolCallHook, normalizeAgentRuntimeTools, normalizeHeartbeatToolResponse, projectRuntimeToolInputSchema, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveNativeHookRelayDeferredToolApproval, resolveToolExecutionErrorKind, resolveToolResultFailureKind, runAgentHarnessAfterToolCallHook, sanitizeToolResult, setBeforeToolCallDiagnosticsEnabled, supportsModelTools, wrapToolWithBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
33
|
+
import { HEARTBEAT_RESPONSE_TOOL_NAME, applyEmbeddedAttemptToolsAllow, buildAgentHookContextChannelFields, buildEmbeddedAttemptToolRunContext, consumeAdjustedParamsForToolCall, consumePreExecutionBlockedToolCall, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, embeddedAgentLog, extractMessagingToolSend, extractMessagingToolSendResult, extractToolResultMediaArtifact, filterProviderNormalizableTools, filterToolResultMediaUrls, finalizeAgentToolAvailability, finalizeToolTerminalPresentation, formatApprovalDisplayPath, formatToolExecutionErrorMessage, getBeforeToolCallFailureDisposition, getChannelAgentToolMeta, getPluginToolMeta, getPluginToolSideEffectOwnerKey, hasNativeHookRelayInvocation, invokeNativeHookRelay, isDeliveredMessageToolOnlySourceReplyResult, isDeliveredMessagingToolResult, isHostScopedAgentToolActive, isMessagingTool, isMessagingToolSendAction, isReplaySafeToolCall, isSubagentSessionKey, isToolResultError, isToolWrappedWithBeforeToolCallHook, normalizeAgentRuntimeTools, normalizeHeartbeatToolResponse, projectRuntimeToolInputSchema, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveNativeHookRelayDeferredToolApproval, resolveToolExecutionErrorKind, resolveToolResultFailureKind, runAgentHarnessAfterToolCallHook, sanitizeToolResult, setBeforeToolCallDiagnosticsEnabled, supportsModelTools, wrapToolWithBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
29
34
|
import { formatErrorMessage as formatErrorMessage$2, redactSensitiveText } from "openclaw/plugin-sdk/security-runtime";
|
|
30
|
-
import {
|
|
35
|
+
import { consumeTrustedToolNoStartError, copyInternalToolResultState, getCoreTtsToolResultMediaUrls } from "openclaw/plugin-sdk/agent-harness-tool-runtime";
|
|
31
36
|
import { isIP } from "node:net";
|
|
32
37
|
import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
33
38
|
import { formatMcpCodexApprovalRemedy, requiresMcpCodexToolApproval, resolveCodexScheduledToolProjectionFactory, resolveProjectedMcpCodexToolApprovalMode, runWithCronCreatorAuthorityCapabilityResolver } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
34
39
|
import { buildRemoteCommand, isToolAllowed, sanitizeEnvVars } from "openclaw/plugin-sdk/sandbox";
|
|
40
|
+
import { SsrFBlockedError, isBlockedHostnameOrIp } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
35
41
|
import { saveMediaBuffer } from "openclaw/plugin-sdk/media-store";
|
|
36
42
|
import { getMediaDir } from "openclaw/plugin-sdk/media-runtime";
|
|
37
|
-
import { consumeTrustedToolNoStartError, copyInternalToolResultState, getCoreTtsToolResultMediaUrls } from "openclaw/plugin-sdk/agent-harness-tool-runtime";
|
|
38
|
-
import { SsrFBlockedError, isBlockedHostnameOrIp } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
39
43
|
import { normalizeOpenAIStrictCompatSchema } from "openclaw/plugin-sdk/provider-tools";
|
|
40
44
|
//#region extensions/codex/src/app-server/dynamic-tool-build-state.ts
|
|
41
45
|
/** Mutable dependency seam shared by dynamic-tool construction and its behavioral tests. */
|
|
@@ -105,14 +109,6 @@ function filterCodexVisionTools(tools, params) {
|
|
|
105
109
|
* OpenClaw-owned tools, Codex native-tool fallback rules, sandbox shell shims,
|
|
106
110
|
* and provider allowlist normalization.
|
|
107
111
|
*/
|
|
108
|
-
const CODEX_NATIVE_SANDBOX_TOOL_REQUIREMENTS = [
|
|
109
|
-
"exec",
|
|
110
|
-
"process",
|
|
111
|
-
"read",
|
|
112
|
-
"write",
|
|
113
|
-
"edit",
|
|
114
|
-
"apply_patch"
|
|
115
|
-
];
|
|
116
112
|
const CODEX_MEMORY_FLUSH_DYNAMIC_TOOL_ALLOW = /* @__PURE__ */ new Set(["read", "write"]);
|
|
117
113
|
const CODEX_DISABLED_NATIVE_SHELL_DYNAMIC_TOOLS = /* @__PURE__ */ new Set([
|
|
118
114
|
"exec",
|
|
@@ -209,6 +205,7 @@ async function buildDynamicTools(input) {
|
|
|
209
205
|
nativeToolSurfaceEnabled: input.nativeToolSurfaceEnabled,
|
|
210
206
|
nativeProviderWebSearchSupport: input.nativeProviderWebSearchSupport
|
|
211
207
|
});
|
|
208
|
+
const messageToolProvider = resolveCodexMessageToolProvider(params);
|
|
212
209
|
const webFetchHostnameAllowlistRef = {};
|
|
213
210
|
const toolConstructionPlan = resolveCodexNodePlacementToolConstructionPlan(input.sandbox, input.nativeToolSurfaceEnabled);
|
|
214
211
|
const options = {
|
|
@@ -228,11 +225,11 @@ async function buildDynamicTools(input) {
|
|
|
228
225
|
} : void 0,
|
|
229
226
|
sandbox: input.sandbox,
|
|
230
227
|
...toolConstructionPlan ? { toolConstructionPlan } : {},
|
|
231
|
-
messageProvider:
|
|
228
|
+
messageProvider: messageToolProvider,
|
|
232
229
|
toolPolicyMessageProvider: params.messageProvider ?? params.messageChannel,
|
|
233
230
|
...params.onToolResult ? { questionPrompt: {
|
|
234
231
|
send: params.onToolResult,
|
|
235
|
-
|
|
232
|
+
messageChannel: messageToolProvider
|
|
236
233
|
} } : {},
|
|
237
234
|
inputProvenance: params.inputProvenance,
|
|
238
235
|
trustedInternalHandoff: params.trustedInternalHandoff,
|
|
@@ -335,7 +332,7 @@ async function buildDynamicTools(input) {
|
|
|
335
332
|
agentId: input.policyAgentId,
|
|
336
333
|
sessionKey: input.sandboxSessionKey,
|
|
337
334
|
sandboxToolPolicy: input.sandbox?.tools,
|
|
338
|
-
messageProvider:
|
|
335
|
+
messageProvider: messageToolProvider,
|
|
339
336
|
agentAccountId: params.agentAccountId,
|
|
340
337
|
groupId: params.groupId,
|
|
341
338
|
groupChannel: params.groupChannel,
|
|
@@ -456,7 +453,7 @@ function canCodexAppServerNativeToolSurfaceHonorSandbox(sandbox, options = {}) {
|
|
|
456
453
|
return false;
|
|
457
454
|
}
|
|
458
455
|
function canSandboxToolPolicyExposeCodexNativeToolSurface(sandbox) {
|
|
459
|
-
return
|
|
456
|
+
return CODEX_NATIVE_TOOL_REQUIREMENTS.every((toolName) => isToolAllowed(sandbox.tools, toolName));
|
|
460
457
|
}
|
|
461
458
|
function isCodexMemoryFlushRun(params) {
|
|
462
459
|
return params?.trigger === "memory" && Boolean(params.memoryFlushWritePath?.trim());
|
|
@@ -565,13 +562,12 @@ function placeDisabledNativeShellToolsInDirectNamespace(tools, nativeToolSurface
|
|
|
565
562
|
}
|
|
566
563
|
/** Applies a normalized tool allowlist while preserving shell aliases for exec/process. */
|
|
567
564
|
function filterCodexDynamicToolsForAllowlist(tools, toolsAllow) {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
return allowSet.has(normalized) || normalized === "sandbox_exec" && allowSet.has("exec") || normalized === "sandbox_process" && (allowSet.has("exec") || allowSet.has("process")) || normalized === "gateway_exec" && allowSet.has("exec") || normalized === "gateway_process" && (allowSet.has("exec") || allowSet.has("process")) || normalized === "node_exec" && allowSet.has("exec");
|
|
565
|
+
return applyEmbeddedAttemptToolsAllow(tools, toolsAllow, {
|
|
566
|
+
toolMeta: getPluginToolMeta,
|
|
567
|
+
toolAliases: (tool) => {
|
|
568
|
+
const normalized = normalizeCodexDynamicToolName(tool.name);
|
|
569
|
+
return normalized === "sandbox_exec" || normalized === "gateway_exec" || normalized === "node_exec" ? ["exec"] : normalized === "sandbox_process" || normalized === "gateway_process" ? ["exec", "process"] : [];
|
|
570
|
+
}
|
|
575
571
|
});
|
|
576
572
|
}
|
|
577
573
|
/** Detects the wildcard allowlist marker after Codex tool-name normalization. */
|
|
@@ -1854,32 +1850,50 @@ async function readFile(execServer, params) {
|
|
|
1854
1850
|
async function writeFile(execServer, params) {
|
|
1855
1851
|
const record = requireObject(params, "fs/writeFile params");
|
|
1856
1852
|
const filePath = resolveExecServerPath(requireString(record.path, "path"), "write path");
|
|
1853
|
+
const fsBridge = execServer.fsBridge;
|
|
1854
|
+
const canonicalDestination = await fsBridge.resolvePinnedMutationTarget?.({
|
|
1855
|
+
filePath,
|
|
1856
|
+
action: "write"
|
|
1857
|
+
});
|
|
1857
1858
|
assertFsSandboxAccess(execServer, record, [{
|
|
1858
1859
|
path: filePath,
|
|
1859
1860
|
access: "write"
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1861
|
+
}, ...canonicalDestination ? [{
|
|
1862
|
+
path: canonicalDestination.policyPath,
|
|
1863
|
+
access: "write"
|
|
1864
|
+
}] : []]);
|
|
1862
1865
|
if ((await fsBridge.stat({ filePath: posix.dirname(filePath) }))?.type !== "directory") throw new JsonRpcProtocolError(JSON_RPC_NOT_FOUND, "parent directory not found");
|
|
1863
1866
|
await fsBridge.writeFile({
|
|
1864
1867
|
filePath,
|
|
1865
1868
|
data: Buffer.from(requireBase64String(record.dataBase64, "dataBase64"), "base64"),
|
|
1866
|
-
mkdir: false
|
|
1869
|
+
mkdir: false,
|
|
1870
|
+
pinnedPath: canonicalDestination?.pinnedPath
|
|
1867
1871
|
});
|
|
1868
1872
|
}
|
|
1869
1873
|
/** Creates a sandbox directory, respecting recursive and parent-directory semantics. */
|
|
1870
1874
|
async function createDirectory(execServer, params) {
|
|
1871
1875
|
const record = requireObject(params, "fs/createDirectory params");
|
|
1872
1876
|
const filePath = resolveExecServerPath(requireString(record.path, "path"), "create-directory path");
|
|
1877
|
+
const fsBridge = execServer.fsBridge;
|
|
1878
|
+
const canonicalDestination = await fsBridge.resolvePinnedMutationTarget?.({
|
|
1879
|
+
filePath,
|
|
1880
|
+
action: "mkdir"
|
|
1881
|
+
});
|
|
1873
1882
|
assertFsSandboxAccess(execServer, record, [{
|
|
1874
1883
|
path: filePath,
|
|
1875
1884
|
access: "write"
|
|
1876
|
-
}
|
|
1877
|
-
|
|
1885
|
+
}, ...canonicalDestination ? [{
|
|
1886
|
+
path: canonicalDestination.policyPath,
|
|
1887
|
+
access: "write"
|
|
1888
|
+
}] : []]);
|
|
1878
1889
|
if (record.recursive === false) {
|
|
1879
1890
|
const parentPath = posix.dirname(filePath);
|
|
1880
1891
|
if ((await fsBridge.stat({ filePath: parentPath }))?.type !== "directory") throw new JsonRpcProtocolError(JSON_RPC_NOT_FOUND, "parent directory not found");
|
|
1881
1892
|
}
|
|
1882
|
-
await fsBridge.mkdirp({
|
|
1893
|
+
await fsBridge.mkdirp({
|
|
1894
|
+
filePath,
|
|
1895
|
+
pinnedPath: canonicalDestination?.pinnedPath
|
|
1896
|
+
});
|
|
1883
1897
|
}
|
|
1884
1898
|
/** Returns normalized metadata for a sandbox path. */
|
|
1885
1899
|
async function getMetadata(execServer, params) {
|
|
@@ -1928,15 +1942,26 @@ async function removePath(execServer, params) {
|
|
|
1928
1942
|
const record = requireObject(params, "fs/remove params");
|
|
1929
1943
|
const filePath = resolveExecServerPath(requireString(record.path, "path"), "remove path");
|
|
1930
1944
|
const fsSandboxPolicy = resolveFsSandboxPolicy(execServer, record);
|
|
1945
|
+
const canonicalDestination = await execServer.fsBridge.resolvePinnedMutationTarget?.({
|
|
1946
|
+
filePath,
|
|
1947
|
+
action: "remove"
|
|
1948
|
+
});
|
|
1931
1949
|
assertResolvedFsSandboxAccess(fsSandboxPolicy, [{
|
|
1932
1950
|
path: filePath,
|
|
1933
1951
|
access: "write"
|
|
1934
|
-
}
|
|
1935
|
-
|
|
1952
|
+
}, ...canonicalDestination ? [{
|
|
1953
|
+
path: canonicalDestination.policyPath,
|
|
1954
|
+
access: "write"
|
|
1955
|
+
}] : []]);
|
|
1956
|
+
if (record.recursive !== false) {
|
|
1957
|
+
assertNoReadOnlyDescendant(fsSandboxPolicy, filePath, "remove");
|
|
1958
|
+
if (canonicalDestination) assertNoReadOnlyDescendant(fsSandboxPolicy, canonicalDestination.policyPath, "remove");
|
|
1959
|
+
}
|
|
1936
1960
|
await execServer.fsBridge.remove({
|
|
1937
1961
|
filePath,
|
|
1938
1962
|
recursive: record.recursive !== false,
|
|
1939
|
-
force: record.force !== false
|
|
1963
|
+
force: record.force !== false,
|
|
1964
|
+
pinnedPath: canonicalDestination?.pinnedPath
|
|
1940
1965
|
});
|
|
1941
1966
|
}
|
|
1942
1967
|
/** Copies sandbox files or recursive directories while enforcing source and destination policy. */
|
|
@@ -1970,10 +1995,25 @@ async function copySandboxPath(execServer, params) {
|
|
|
1970
1995
|
}]);
|
|
1971
1996
|
const sourceStat = await fsBridge.stat({ filePath: params.sourcePath });
|
|
1972
1997
|
if (!sourceStat) throw new JsonRpcProtocolError(JSON_RPC_NOT_FOUND, "file not found");
|
|
1973
|
-
|
|
1998
|
+
const canonicalDestination = await fsBridge.resolvePinnedMutationTarget?.({
|
|
1999
|
+
filePath: params.destinationPath,
|
|
2000
|
+
action: sourceStat.type === "directory" ? "mkdir" : "copy-destination"
|
|
2001
|
+
});
|
|
2002
|
+
const canonicalPolicyEntries = canonicalDestination ? [{
|
|
2003
|
+
path: canonicalDestination.policyPath,
|
|
2004
|
+
access: "write"
|
|
2005
|
+
}] : [];
|
|
2006
|
+
assertResolvedFsSandboxAccess(params.fsSandboxPolicy, canonicalPolicyEntries);
|
|
2007
|
+
if (sourceStat.type === "directory") {
|
|
1974
2008
|
if (!params.recursive) throw new Error(`Cannot copy directory without recursive=true: ${params.sourcePath}`);
|
|
1975
|
-
if (pathContains(normalizeSandboxAbsolutePath(
|
|
1976
|
-
|
|
2009
|
+
if (pathContains(normalizeSandboxAbsolutePath((await fsBridge.resolvePinnedMutationTarget?.({
|
|
2010
|
+
filePath: params.sourcePath,
|
|
2011
|
+
action: "mkdir"
|
|
2012
|
+
}))?.policyPath ?? params.sourcePath, "copy source path"), normalizeSandboxAbsolutePath(canonicalDestination?.policyPath ?? params.destinationPath, "copy destination path"))) throw new Error("Cannot recursively copy a directory into itself.");
|
|
2013
|
+
await fsBridge.mkdirp({
|
|
2014
|
+
filePath: params.destinationPath,
|
|
2015
|
+
pinnedPath: canonicalDestination?.pinnedPath
|
|
2016
|
+
});
|
|
1977
2017
|
for (const entry of await listDirectoryEntries(execServer, params.sourcePath, params.fsSandboxPolicy)) {
|
|
1978
2018
|
if (!entry.isDirectory && !entry.isFile) throw new Error(`Cannot copy unsupported filesystem entry: ${entry.fileName}`);
|
|
1979
2019
|
await copySandboxPath(execServer, {
|
|
@@ -1989,7 +2029,8 @@ async function copySandboxPath(execServer, params) {
|
|
|
1989
2029
|
await fsBridge.copyFile({
|
|
1990
2030
|
sourcePath: params.sourcePath,
|
|
1991
2031
|
destinationPath: params.destinationPath,
|
|
1992
|
-
mkdir: true
|
|
2032
|
+
mkdir: true,
|
|
2033
|
+
pinnedPath: canonicalDestination?.pinnedPath
|
|
1993
2034
|
});
|
|
1994
2035
|
return;
|
|
1995
2036
|
}
|
|
@@ -2001,7 +2042,8 @@ async function copySandboxPath(execServer, params) {
|
|
|
2001
2042
|
await fsBridge.writeFile({
|
|
2002
2043
|
filePath: params.destinationPath,
|
|
2003
2044
|
data,
|
|
2004
|
-
mkdir: true
|
|
2045
|
+
mkdir: true,
|
|
2046
|
+
pinnedPath: canonicalDestination?.pinnedPath
|
|
2005
2047
|
});
|
|
2006
2048
|
}
|
|
2007
2049
|
function assertSandboxFileReadWithinLimit(stat) {
|
|
@@ -4220,7 +4262,7 @@ function resolvePluginElicitation(params) {
|
|
|
4220
4262
|
const appId = readFirstString$1(meta, PLUGIN_APP_ID_META_KEYS) ?? readFirstString$1(requestParams, PLUGIN_APP_ID_META_KEYS);
|
|
4221
4263
|
const connectorId = readFirstString$1(meta, PLUGIN_CONNECTOR_ID_META_KEYS);
|
|
4222
4264
|
const isCodexConnectorApproval = isCodexConnectorApprovalElicitation(requestParams, meta);
|
|
4223
|
-
if (isCodexConnectorApproval && appId && connectorId && appId !== connectorId) return {
|
|
4265
|
+
if (isCodexConnectorApproval && appId && connectorId && codexAppIdentityKey(appId) !== codexAppIdentityKey(connectorId)) return {
|
|
4224
4266
|
kind: "decline",
|
|
4225
4267
|
reason: "app_id_connector_id_mismatch"
|
|
4226
4268
|
};
|
|
@@ -4229,20 +4271,19 @@ function resolvePluginElicitation(params) {
|
|
|
4229
4271
|
kind: "decline",
|
|
4230
4272
|
reason: "missing_policy_context"
|
|
4231
4273
|
};
|
|
4232
|
-
const
|
|
4233
|
-
if (entry
|
|
4274
|
+
const matches = Object.entries(context.apps).filter(([id]) => codexAppIdentityKey(id) === codexAppIdentityKey(appId)).map(([, entry]) => entry);
|
|
4275
|
+
if (matches.some((entry) => entry.source === "account") && !isCodexConnectorApproval) return {
|
|
4234
4276
|
kind: "decline",
|
|
4235
4277
|
reason: "account_app_source_mismatch"
|
|
4236
4278
|
};
|
|
4237
|
-
return uniquePluginMatch(
|
|
4279
|
+
return uniquePluginMatch(matches, "app_id");
|
|
4238
4280
|
}
|
|
4239
4281
|
if (isCodexConnectorApproval && connectorId) {
|
|
4240
4282
|
if (!context) return {
|
|
4241
4283
|
kind: "decline",
|
|
4242
4284
|
reason: "missing_policy_context"
|
|
4243
4285
|
};
|
|
4244
|
-
|
|
4245
|
-
return uniquePluginMatch(entry ? [entry] : [], "connector_id");
|
|
4286
|
+
return uniquePluginMatch(Object.entries(context.apps).filter(([id]) => codexAppIdentityKey(id) === codexAppIdentityKey(connectorId)).map(([, entry]) => entry), "connector_id");
|
|
4246
4287
|
}
|
|
4247
4288
|
const serverName = readNonBlankStringField(requestParams, "serverName");
|
|
4248
4289
|
if (serverName && context) {
|
|
@@ -4662,6 +4703,64 @@ function readFirstString$1(record, keys) {
|
|
|
4662
4703
|
}
|
|
4663
4704
|
}
|
|
4664
4705
|
//#endregion
|
|
4706
|
+
//#region extensions/codex/src/app-server/dynamic-tool-automations-allowlist.ts
|
|
4707
|
+
function createCodexAutomationsToolsAllowResolver(specs) {
|
|
4708
|
+
const names = /* @__PURE__ */ new Set();
|
|
4709
|
+
const qualifiedNames = /* @__PURE__ */ new Map();
|
|
4710
|
+
for (const spec of specs) {
|
|
4711
|
+
if (spec.type === "function") {
|
|
4712
|
+
names.add(spec.name);
|
|
4713
|
+
continue;
|
|
4714
|
+
}
|
|
4715
|
+
for (const tool of spec.tools) {
|
|
4716
|
+
names.add(tool.name);
|
|
4717
|
+
const separator = spec.name.endsWith("_") || tool.name.startsWith("_") ? "" : "__";
|
|
4718
|
+
qualifiedNames.set(`${spec.name}${separator}${tool.name}`, tool.name);
|
|
4719
|
+
}
|
|
4720
|
+
}
|
|
4721
|
+
function resolveList(value) {
|
|
4722
|
+
const resolved = value.map((name) => typeof name !== "string" || names.has(name) ? name : qualifiedNames.get(name) ?? name);
|
|
4723
|
+
return resolved.every((name, index) => name === value[index]) ? value : resolved;
|
|
4724
|
+
}
|
|
4725
|
+
function resolvePayload(value) {
|
|
4726
|
+
if (!isJsonObject(value) || !Array.isArray(value.toolsAllow)) return value;
|
|
4727
|
+
const toolsAllow = resolveList(value.toolsAllow);
|
|
4728
|
+
return toolsAllow === value.toolsAllow ? value : {
|
|
4729
|
+
...value,
|
|
4730
|
+
toolsAllow
|
|
4731
|
+
};
|
|
4732
|
+
}
|
|
4733
|
+
function resolveJobFields(value, paddedKeys) {
|
|
4734
|
+
let resolved = value;
|
|
4735
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
4736
|
+
const field = paddedKeys ? key.trim() : key;
|
|
4737
|
+
if (key !== field && Object.hasOwn(value, field)) continue;
|
|
4738
|
+
const next = field === "toolsAllow" && Array.isArray(entry) ? resolveList(entry) : field === "payload" || field === "namePayload" ? resolvePayload(entry) : entry;
|
|
4739
|
+
if (next !== entry) {
|
|
4740
|
+
if (resolved === value) resolved = { ...value };
|
|
4741
|
+
resolved[key] = next;
|
|
4742
|
+
}
|
|
4743
|
+
}
|
|
4744
|
+
return resolved;
|
|
4745
|
+
}
|
|
4746
|
+
return (args) => {
|
|
4747
|
+
if (!isJsonObject(args)) return args;
|
|
4748
|
+
const job = args.job;
|
|
4749
|
+
if (!job || isJsonObject(job) && Object.keys(job).length === 0) return resolveJobFields(args, false);
|
|
4750
|
+
if (!isJsonObject(job)) return args;
|
|
4751
|
+
const wrapper = isJsonObject(job.data) ? "data" : isJsonObject(job.job) ? "job" : void 0;
|
|
4752
|
+
const wrapped = wrapper ? job[wrapper] : void 0;
|
|
4753
|
+
const resolved = wrapper && isJsonObject(wrapped) ? {
|
|
4754
|
+
...job,
|
|
4755
|
+
[wrapper]: resolveJobFields(wrapped, true)
|
|
4756
|
+
} : resolveJobFields(job, true);
|
|
4757
|
+
return resolved === job ? args : {
|
|
4758
|
+
...args,
|
|
4759
|
+
job: resolved
|
|
4760
|
+
};
|
|
4761
|
+
};
|
|
4762
|
+
}
|
|
4763
|
+
//#endregion
|
|
4665
4764
|
//#region extensions/codex/src/app-server/dynamic-tool-catalog.ts
|
|
4666
4765
|
/** Namespace attached to OpenClaw-owned dynamic tools exposed to Codex. */
|
|
4667
4766
|
const CODEX_OPENCLAW_DYNAMIC_TOOL_NAMESPACE = "openclaw";
|
|
@@ -5083,6 +5182,11 @@ function createCodexDynamicToolBridge(params) {
|
|
|
5083
5182
|
const registrationNames = inheritedNames ?? new Set(registeredProjection.tools.map((entry) => entry.name));
|
|
5084
5183
|
const finalized = finalizeCodexToolAvailability(availableProjection.tools.filter((entry) => registrationNames.has(entry.name)));
|
|
5085
5184
|
const availableTools = finalized.tools;
|
|
5185
|
+
const pluginLocalMediaTrustByToolName = /* @__PURE__ */ new Map();
|
|
5186
|
+
for (const { name, tool } of availableTools) {
|
|
5187
|
+
const pluginMeta = getPluginToolMeta(tool);
|
|
5188
|
+
if (pluginMeta) pluginLocalMediaTrustByToolName.set(name, new Set(pluginMeta.trustedLocalMedia === true ? [name] : []));
|
|
5189
|
+
}
|
|
5086
5190
|
availableProjection.quarantinedTools.push(...finalized.quarantinedTools);
|
|
5087
5191
|
const toolMap = new Map(availableTools.map((entry) => [entry.name, entry]));
|
|
5088
5192
|
const quarantinedAvailableToolNames = new Set(availableProjection.quarantinedTools.map((tool) => tool.tool));
|
|
@@ -5121,6 +5225,12 @@ function createCodexDynamicToolBridge(params) {
|
|
|
5121
5225
|
const legacyExtensionRunner = createCodexAppServerToolResultExtensionRunner(toolResultHookContext);
|
|
5122
5226
|
const executionSnapshotStates = /* @__PURE__ */ new Map();
|
|
5123
5227
|
const directToolNames = params.directToolNames;
|
|
5228
|
+
const specs = inheritedSpecs ?? createCodexDynamicToolSpecs({
|
|
5229
|
+
entries: registeredSpecTools,
|
|
5230
|
+
loading: params.loading ?? "searchable",
|
|
5231
|
+
directToolNames
|
|
5232
|
+
});
|
|
5233
|
+
const resolveAutomationsToolsAllow = createCodexAutomationsToolsAllowResolver(specs);
|
|
5124
5234
|
let readRemoteWorkspaceFile;
|
|
5125
5235
|
return {
|
|
5126
5236
|
availableTools: availableTools.map((entry) => entry.tool),
|
|
@@ -5136,11 +5246,7 @@ function createCodexDynamicToolBridge(params) {
|
|
|
5136
5246
|
loading: params.loading ?? "searchable",
|
|
5137
5247
|
directToolNames
|
|
5138
5248
|
}),
|
|
5139
|
-
specs
|
|
5140
|
-
entries: registeredSpecTools,
|
|
5141
|
-
loading: params.loading ?? "searchable",
|
|
5142
|
-
directToolNames
|
|
5143
|
-
}),
|
|
5249
|
+
specs,
|
|
5144
5250
|
resultContentSourceForTool: (toolName) => toolMap.get(toolName)?.tool.resultContentSource,
|
|
5145
5251
|
sideEffectOwnerKeyForTool: (toolName) => {
|
|
5146
5252
|
const tool = toolMap.get(toolName)?.tool;
|
|
@@ -5177,7 +5283,7 @@ function createCodexDynamicToolBridge(params) {
|
|
|
5177
5283
|
});
|
|
5178
5284
|
}
|
|
5179
5285
|
const { tool, name: toolName } = toolEntry;
|
|
5180
|
-
const rawArguments = call.arguments;
|
|
5286
|
+
const rawArguments = toolName === "automations" ? resolveAutomationsToolsAllow(call.arguments) : call.arguments;
|
|
5181
5287
|
const args = asNonArrayRecord(rawArguments);
|
|
5182
5288
|
const startedAt = Date.now();
|
|
5183
5289
|
const signal = composeAbortSignals(params.signal, options?.signal);
|
|
@@ -5338,7 +5444,8 @@ function createCodexDynamicToolBridge(params) {
|
|
|
5338
5444
|
autoDeliveryTtsMediaUrls,
|
|
5339
5445
|
coreTtsToolResult: autoDeliveryTtsMediaUrls?.length ? rawResult : void 0,
|
|
5340
5446
|
messagingTarget: confirmedMessagingTarget,
|
|
5341
|
-
sourceReplyFinal
|
|
5447
|
+
sourceReplyFinal,
|
|
5448
|
+
trustedLocalMediaToolNames: pluginLocalMediaTrustByToolName.get(toolName)
|
|
5342
5449
|
});
|
|
5343
5450
|
if (deliveredSourceReply || receiptConfirmedSourceReply || toolConfirmedSourceReply) telemetry.didDeliverSourceReplyViaMessageTool = true;
|
|
5344
5451
|
const continuesSourceReplyProgress = confirmedSourceReply && sourceReplyFinal === false;
|
|
@@ -5512,7 +5619,7 @@ function collectToolTelemetry(params) {
|
|
|
5512
5619
|
if (params.result && !params.signal.aborted) {
|
|
5513
5620
|
const media = extractToolResultMediaArtifact(params.result);
|
|
5514
5621
|
if (media) {
|
|
5515
|
-
const mediaUrls = filterToolResultMediaUrls(params.toolName, media.mediaUrls, params.mediaTrustResult ?? params.result);
|
|
5622
|
+
const mediaUrls = filterToolResultMediaUrls(params.toolName, media.mediaUrls, params.coreTtsToolResult ?? params.mediaTrustResult ?? params.result, params.trustedLocalMediaToolNames);
|
|
5516
5623
|
const seen = new Set(params.telemetry.toolMediaUrls);
|
|
5517
5624
|
const autoDeliveryMediaUrls = new Set(params.telemetry.toolAutoDeliveryMediaUrls);
|
|
5518
5625
|
const rawAutoDeliveryMediaUrls = new Set(params.autoDeliveryTtsMediaUrls);
|
package/dist/{effective-mcp-catalog-J_5Ep5Um.js → .setup/effective-mcp-catalog-K6kLCN8X.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as retainSharedCodexAppServerClientByInstanceId } from "./shared-client-
|
|
3
|
-
import "./session-binding-
|
|
1
|
+
import { p as sessionBindingIdentity } from "./session-binding-record-TH3xA0zj.mjs";
|
|
2
|
+
import { _ as retainSharedCodexAppServerClientByInstanceId } from "./shared-client-BpTtuLQ5.mjs";
|
|
3
|
+
import "./session-binding-_0W_fHRr.mjs";
|
|
4
4
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { assignMcpCatalogSafeServerNames } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
6
6
|
//#region extensions/codex/src/app-server/effective-mcp-catalog.ts
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { T as readCodexTurnCompletedNotification } from "./client-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as CodexUsageProjection } from "./event-projector-usage-CIyrYYid.js";
|
|
1
|
+
import { m as isJsonObject } from "./config-security-BRQ2mgW9.mjs";
|
|
2
|
+
import { T as readCodexTurnCompletedNotification } from "./client-vXs2929Q.mjs";
|
|
3
|
+
import { m as getCodexAppServerTurnRouter } from "./attempt-client-cleanup-BpYKdTA0.mjs";
|
|
4
|
+
import { c as readCodexNotificationItem, s as isTerminalTurnStatus, t as CodexUsageProjection } from "./event-projector-usage-C7Ntzs-f.mjs";
|
|
6
5
|
import { readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
6
|
import { toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
8
7
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as resolveCodexLocalRuntimeAttribution } from "./local-runtime-attribution-B_2mnqhb.
|
|
1
|
+
import { t as resolveCodexLocalRuntimeAttribution } from "./local-runtime-attribution-B_2mnqhb.mjs";
|
|
2
2
|
import { formatErrorMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
3
3
|
//#region extensions/codex/src/app-server/event-projector-assistant-message.ts
|
|
4
4
|
const ZERO_USAGE = {
|
|
@@ -70,13 +70,16 @@ function createAssistantCommentaryMessage(params, text, itemId, timestamp) {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
function createAssistantAsyncMessage(params, text, itemId, timestamp) {
|
|
73
|
+
function createAssistantAsyncMessage(params, text, itemId, timestamp, questions) {
|
|
74
74
|
return {
|
|
75
75
|
...createNonterminalAssistantMessage(params, [{
|
|
76
76
|
type: "text",
|
|
77
77
|
text
|
|
78
78
|
}], timestamp),
|
|
79
|
-
openclawAsyncDelivery: {
|
|
79
|
+
openclawAsyncDelivery: {
|
|
80
|
+
itemId,
|
|
81
|
+
...questions ? { questions } : {}
|
|
82
|
+
}
|
|
80
83
|
};
|
|
81
84
|
}
|
|
82
85
|
function createAssistantReasoningMessage(params, text) {
|