@openclaw/codex 2026.9.4 → 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-CvT8tW5i.js → .setup/apply-CJ0ZfmBG.mjs} +11 -11
- package/dist/.setup/async-questions-DdhOCwGi.mjs +27 -0
- package/dist/{attempt-client-cleanup-DKHzbwt5.js → .setup/attempt-client-cleanup-BpYKdTA0.mjs} +29 -14
- package/dist/{attempt-context-D44yeDII.js → .setup/attempt-context-VXVwTCfS.mjs} +5 -5
- package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +5 -0
- package/dist/{auth-binding-CWlKVccJ.js → .setup/auth-binding-DhLWa_7K.mjs} +1 -1
- package/dist/{auth-cache-key-7orQae_j.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-C_Hneydj.js → .setup/bounded-turn-BtlZcivC.mjs} +16 -11
- package/dist/{build-state-BCmg9-5p.js → .setup/build-state-Xx9ybZqa.mjs} +1 -1
- package/dist/{capabilities-8vx68WLH.js → .setup/capabilities-_vXcZGSx.mjs} +1 -1
- package/dist/{client-B57KWPQx.js → .setup/client-vXs2929Q.mjs} +332 -163
- package/dist/{command-dispatch-BpduNGVf.js → .setup/command-dispatch-naHIZwwF.mjs} +3 -3
- package/dist/{command-formatters-lxlkNZgU.js → .setup/command-formatters-CGEkdawF.mjs} +2 -2
- package/dist/{command-handlers-tiL9iWj7.js → .setup/command-handlers-BtAJEW1X.mjs} +59 -42
- package/dist/{command-rpc-CR5EOEZX.js → .setup/command-rpc-DHFpn4le.mjs} +22 -13
- package/dist/{compact-B_H3AOd7.js → .setup/compact-C3i3qlzj.mjs} +28 -43
- package/dist/{config-oIORaQ5T.js → .setup/config-CedDWjM-.mjs} +5 -4
- package/dist/{config-options-CXMq1T-C.js → .setup/config-options-BsanJ8QG.mjs} +6 -418
- package/dist/{protocol-5bh1G-H7.js → .setup/config-parsing-CcB9iPoq.mjs} +9 -51
- package/dist/{config-runtime-D0zGNIHu.js → .setup/config-runtime-CeAhl_h4.mjs} +2 -2
- package/dist/.setup/config-security-BRQ2mgW9.mjs +465 -0
- package/dist/{conversation-binding-DsB4-O7U.js → .setup/conversation-binding-DhzrpTM6.mjs} +23 -21
- package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs} +1 -1
- package/dist/{conversation-control-CtUu1b3m.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-CmN5RAip.js → .setup/dynamic-tools-D16lOp67.mjs} +101 -55
- package/dist/{effective-mcp-catalog-Bd73bqA8.js → .setup/effective-mcp-catalog-K6kLCN8X.mjs} +3 -3
- package/dist/{ephemeral-turn-D78_VmzO.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/{event-projector-items-5VhsECCO.js → .setup/event-projector-items-DyTQ_XqL.mjs} +1 -1
- package/dist/{attempt-notifications-C9XufG6l.js → .setup/event-projector-usage-C7Ntzs-f.mjs} +102 -9
- package/dist/{harness-C7rRa7bm.js → .setup/harness-rxaaoN-o.mjs} +74 -20
- package/dist/{inference-context-Dr_mzvk4.js → .setup/inference-context-fulhZuz8.mjs} +1 -1
- package/dist/{inference-proxy-HGXKUIre.js → .setup/inference-proxy-CC15HuSi.mjs} +4 -4
- package/dist/{isolated-completion-DWVb5U2J.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-D22rNEcR.js → .setup/managed-binary-DP6Rib3P.mjs} +2 -2
- package/dist/{managed-thread-store-D1t5jh3G.js → .setup/managed-thread-store-BMqgThVL.mjs} +48 -14
- package/dist/{model-catalog-Dq2n8f_p.js → .setup/model-catalog-DkvUuBey.mjs} +35 -10
- package/dist/{models-PCKOim-h.js → .setup/models-BDFgm_G-.mjs} +3 -3
- package/dist/.setup/native-auth-BLZGqFjw.mjs +57 -0
- package/dist/{native-subagent-history-DjtPloaU.js → .setup/native-subagent-history-YXaL6dMd.mjs} +24 -29
- package/dist/.setup/native-subagent-monitor-B1hxzIOy.mjs +5031 -0
- package/dist/{native-subagent-task-ids-BzTdT0Uw.js → .setup/native-subagent-task-ids-DsuOonKv.mjs} +32 -8
- package/dist/{node-cli-sessions-DKaOmVUh.js → .setup/node-cli-sessions-Cl8b2ZF3.mjs} +1 -1
- package/dist/{node-exec-server.runtime-Cl2vapEi.js → .setup/node-exec-server.runtime-BaViBKNz.mjs} +3 -3
- package/dist/{plan-7uG-Fp36.js → .setup/plan-xD7WKYTM.mjs} +64 -48
- package/dist/{plugin-activation-BYQculil.js → .setup/plugin-activation-r8nq5Jzp.mjs} +3 -3
- package/dist/{plugin-app-cache-key-d0eKxy7b.js → .setup/plugin-app-cache-key-BOxKP7db.mjs} +29 -25
- package/dist/{plugin-approval-roundtrip-Bz3FT8W5.js → .setup/plugin-approval-roundtrip-CjfzafAZ.mjs} +1 -1
- package/dist/{plugin-inventory-oL4Na1ZG.js → .setup/plugin-inventory-DUle8DLz.mjs} +7 -6
- package/dist/{plugin-metadata-cache-ClPJpRio.js → .setup/plugin-metadata-cache-DsS5buNa.mjs} +29 -14
- package/dist/{provider-capabilities-BvCUL69A.js → .setup/provider-capabilities-B8J4Dy-O.mjs} +2 -2
- package/dist/{provider-MQ8PVkuE.js → .setup/provider-fFh_-VR3.mjs} +4 -4
- package/dist/{rate-limits-CBMmWBr9.js → .setup/rate-limits-DOEGYRNs.mjs} +90 -46
- package/dist/{request-B7hEkBGq.js → .setup/request-BioXJLYa.mjs} +113 -33
- package/dist/.setup/run-attempt-lifecycle-B7JbY4-F.mjs +71 -0
- package/dist/{run-attempt-CvsAAGa0.js → .setup/run-attempt-rlA07pUv.mjs} +580 -498
- package/dist/{runtime-artifact-BJ0rXBZ_.js → .setup/runtime-artifact-Dy38Z5iU.mjs} +2 -2
- package/dist/{sandbox-guard-BxgyoM8M.js → .setup/sandbox-guard-BBP-RbTf.mjs} +3 -3
- package/dist/{session-binding-CI8UuilT.js → .setup/session-binding-_0W_fHRr.mjs} +46 -64
- package/dist/{session-binding-record-Bcvslnhf.js → .setup/session-binding-record-TH3xA0zj.mjs} +181 -3
- package/dist/.setup/session-binding-sidecars-CKYEcfNn.mjs +543 -0
- package/dist/{session-catalog-adoption-tcZi1IfX.js → .setup/session-catalog-adoption-CR_whkEW.mjs} +6 -6
- package/dist/{session-catalog-archive-CwKg8Xz2.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/{thread-history-page-D0JIp48V.js → .setup/session-catalog-native-projection-ChV3cCtm.mjs} +206 -95
- package/dist/{session-catalog-node-adoption-B1tgDW-m.js → .setup/session-catalog-node-adoption-BVRsYOSh.mjs} +3 -3
- package/dist/{session-catalog-node-continue-Ci-DXyJP.js → .setup/session-catalog-node-continue-Dowv8osw.mjs} +7 -7
- package/dist/.setup/session-catalog-projection-C1Bj9Jl-.mjs +414 -0
- package/dist/{session-cli-DNN_jhGc.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-DwyijFI6.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-BeK1YOyT.js → .setup/session-history.worker-CpNj7H_P.mjs} +5 -6
- package/dist/{session-initialization-Ct0_Hzmg.js → .setup/session-initialization-DH1z6fXn.mjs} +2 -2
- package/dist/{session-permission-policy-BBmXA8Eg.js → .setup/session-permission-policy-DhurXY0l.mjs} +2 -2
- package/dist/{session-retirement-B2YfbAAT.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-Dn91stmc.js → .setup/settled-turn-finalizer-CiY2bLFK.mjs} +9 -9
- package/dist/{shared-client-CscigXXL.js → .setup/shared-client-BpTtuLQ5.mjs} +286 -145
- package/dist/{side-question-BGMJQf4U.js → .setup/side-question-DSCZyoBD.mjs} +64 -47
- package/dist/{source-CElXU0Oy.js → .setup/source-Bjp4UQij.mjs} +7 -6
- package/dist/{thread-archive-guard-DfpBr-Sz.js → .setup/thread-archive-guard-jmecf6OJ.mjs} +1 -1
- package/dist/.setup/thread-history-page-BTx-4xsg.mjs +83 -0
- package/dist/{thread-lifecycle-DXl1-I6b.js → .setup/thread-lifecycle-Cik28qWn.mjs} +256 -128
- package/dist/{thread-ownership-BsDRTsyp.js → .setup/thread-ownership-skomxnIt.mjs} +4 -4
- package/dist/{thread-policy-BuEQfE0g.js → .setup/thread-policy-Cjs4B8xf.mjs} +2 -2
- package/dist/{thread-resume-DsDOZpFg.js → .setup/thread-resume-BkNpj9Pz.mjs} +8 -5
- package/dist/.setup/timeout-DZF05XrR.mjs +63 -0
- package/dist/{transcript-history-projection-v17wXgdK.js → .setup/transcript-history-projection-DHNBDhCU.mjs} +8 -3
- package/dist/{transcript-mirror-C5CKgNy6.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-BZerMte_.js → .setup/upstream-session-fork-D3UKxgVD.mjs} +27 -26
- package/dist/{usage-tCk-mg_x.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-B7bGbGWq.js → .setup/web-search-provider.runtime-CTGuJt6i.mjs} +3 -3
- package/dist/api.js +6 -6
- 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 +123 -83
- package/dist/media-understanding-provider.js +3 -3
- package/dist/migration-provider-api.js +1 -1
- 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 -69
- package/package.json +11 -8
- package/dist/binding-connection-D3udKbIE.js +0 -60
- package/dist/event-projector-usage-BfXmpOec.js +0 -102
- package/dist/native-subagent-history-owner-Pcp7JuVF.js +0 -34
- package/dist/native-subagent-monitor-fQ7eIXEf.js +0 -2978
- package/dist/rpc-error-ttN_QjEm.js +0 -30
- package/dist/session-catalog-ct-AH01I.js +0 -1477
- package/dist/session-catalog-home-id-CwhLdC03.js +0 -18
- package/dist/session-catalog-provenance-D-dIfRAH.js +0 -96
- package/dist/timeout-BVw8aaM1.js +0 -33
- package/dist/{auth-profile-selection-DFu9e167.js → .setup/auth-profile-selection-DFu9e167.mjs} +0 -0
- package/dist/{config-utils-DujwEnhg.js → .setup/config-utils-DujwEnhg.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/{plugin-marketplace-discovery-P-Vndfqq.js → .setup/plugin-marketplace-discovery-P-Vndfqq.mjs} +0 -0
- /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,40 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { D as handleDynamicToolCallWithTimeout, E as createCodexElicitationResponse, L as resolveCodexToolAbortTerminalReason, S as readCodexDynamicToolCallParams, i as isCodexAppServerApprovalRequest, j as resolveDynamicToolCallTimeoutMs, s as isCodexAppServerIndeterminateRequestCancellationError, v as assertCodexThreadForkResponse, x as assertCodexTurnStartResponse } from "./client-
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import { i as resolveCodexBindingAppServerConnection, r as requireCodexSupervisionModelSelection } from "./binding-connection-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { o as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
1
|
+
import { p as sessionBindingIdentity } from "./session-binding-record-TH3xA0zj.mjs";
|
|
2
|
+
import { E as readCodexRequirementsToml, l as shouldAutoApproveCodexAppServerApprovals, m as isJsonObject, n as hasCodexMcpToolApprovalOverrides, u as withMcpElicitationsApprovalPolicy } from "./config-security-BRQ2mgW9.mjs";
|
|
3
|
+
import { c as isCodexPairedNodeRemoteExecPlacementSandbox, d as readCodexPluginConfig, l as isCodexRemoteExecPlacementSandbox, u as isCodexSandboxExecServerEnabled } from "./config-parsing-CcB9iPoq.mjs";
|
|
4
|
+
import { D as handleDynamicToolCallWithTimeout, E as createCodexElicitationResponse, L as resolveCodexToolAbortTerminalReason, S as readCodexDynamicToolCallParams, i as isCodexAppServerApprovalRequest, j as resolveDynamicToolCallTimeoutMs, s as isCodexAppServerIndeterminateRequestCancellationError, v as assertCodexThreadForkResponse, x as assertCodexTurnStartResponse } from "./client-vXs2929Q.mjs";
|
|
5
|
+
import { i as resolveCodexAppServerHomeScope, l as resolveCodexModelBackedReviewerPolicyContext } from "./config-options-BsanJ8QG.mjs";
|
|
6
|
+
import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-DOEGYRNs.mjs";
|
|
7
|
+
import { i as resolveCodexBindingAppServerConnection, r as requireCodexSupervisionModelSelection } from "./binding-connection-Bm38niE8.mjs";
|
|
8
|
+
import { n as resolveOpenClawExecPolicyForCodexAppServer, t as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-CedDWjM-.mjs";
|
|
9
|
+
import { P as ensureCodexAppServerClientRuntime, Z as resolveCodexAppServerPreparedAuthHandoff, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease, q as readRecentCodexRateLimits, x as withLeasedCodexAppServerClientStartSelectionRetry } from "./shared-client-BpTtuLQ5.mjs";
|
|
10
|
+
import { f as unsubscribeCodexThreadBestEffort, l as retireUnsafeCodexTurnClientBestEffort, o as interruptCodexTurnAndWaitBestEffort } from "./attempt-client-cleanup-BpYKdTA0.mjs";
|
|
11
|
+
import { t as CodexEphemeralTurn } from "./ephemeral-turn-R1gA8Sn6.mjs";
|
|
12
|
+
import { A as resolveCodexBindingModelProviderFallback, D as resolveCodexAppServerModelProvider, E as CODEX_NATIVE_PERSONALITY_NONE, F as CODEX_NATIVE_HOOK_RELAY_EVENTS, H as emitCodexNativePreToolUseFailureDiagnostic, O as resolveCodexAppServerRequestModelSelection, Ot as mergeCodexThreadConfigs, R as buildCodexNativeHookRelayConfig, b as buildCodexRuntimeThreadConfig, c as resolveCodexAppServerReasoningEffort, it as filterCodexDynamicTools, kt as refreshCodexPluginAppApprovalPolicy, o as buildCodexUserInput, r as buildCodexTemporalAdditionalContext, s as readCodexSupportedReasoningEfforts, ut as resolveCodexDynamicToolsLoading, w as resolveCodexWebSearchPlan, z as buildCodexNativeHookRelayDisabledConfig } from "./thread-lifecycle-Cik28qWn.mjs";
|
|
13
|
+
import { o as resolveCodexSessionBinding } from "./session-binding-_0W_fHRr.mjs";
|
|
14
|
+
import { i as refreshCodexThreadPolicy, n as CodexThreadPolicyHandoffError, r as assertCodexSupervisionThreadLineage } from "./thread-policy-Cjs4B8xf.mjs";
|
|
15
|
+
import { t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-BBP-RbTf.mjs";
|
|
16
|
+
import { C as shouldRequireCodexSandboxExecServerEnvironment, S as shouldEnableCodexAppServerNativeToolSurface, T as filterCodexVisionTools, a as emitDynamicToolStartedDiagnostic, b as resolveCodexNodePlacementToolConstructionPlan, c as ensureCodexSandboxExecServerEnvironment, d as CodexNativeToolLifecycleProjector, i as emitDynamicToolErrorDiagnostic, l as releaseCodexSandboxExecServerEnvironment, o as emitDynamicToolTerminalDiagnostic, r as routeCodexAppServerElicitationRequest, s as handleCodexAppServerApprovalRequest, t as createCodexDynamicToolBridge, v as resolveCodexExternalSandboxPolicyForOpenClawSandbox, x as resolveCodexSandboxEnvironmentSelection, y as resolveCodexMessageToolProvider } from "./dynamic-tools-D16lOp67.mjs";
|
|
17
|
+
import { n as resolveCodexProviderWebSearchSupportForClient } from "./provider-capabilities-B8J4Dy-O.mjs";
|
|
18
|
+
import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, r as resolveCodexEffectiveSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-DhurXY0l.mjs";
|
|
18
19
|
import { readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
19
20
|
import { randomUUID } from "node:crypto";
|
|
21
|
+
import { isDeepStrictEqual } from "node:util";
|
|
20
22
|
import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
21
23
|
import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
22
|
-
import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage,
|
|
24
|
+
import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, resolveAgentDir as resolveAgentDir$2, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, runAgentCleanupStep, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
23
25
|
import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
24
|
-
import { isDeepStrictEqual } from "node:util";
|
|
25
26
|
import { loadCodexBundleMcpApprovalConfig, resolveCodexMcpToolOverridesForAgent } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var CodexSideQuestionTimeoutError = class extends Error {
|
|
29
|
-
constructor(..._args) {
|
|
30
|
-
super(..._args);
|
|
31
|
-
this.name = "TimeoutError";
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const CODEX_SIDE_NATIVE_HOOK_RELAY_MIN_TTL_MS = 18e5;
|
|
35
|
-
const CODEX_SIDE_NATIVE_HOOK_RELAY_TTL_GRACE_MS = 3e5;
|
|
36
|
-
const CODEX_SIDE_NATIVE_HOOK_RELAY_STARTUP_REQUEST_COUNT = 3;
|
|
37
|
-
const CODEX_SIDE_NATIVE_HOOK_RELAY_EVENTS_WITH_APP_SERVER_APPROVALS = CODEX_NATIVE_HOOK_RELAY_EVENTS.filter((event) => event !== "permission_request");
|
|
27
|
+
import { registerNativeHookRelayForBundledRuntime } from "openclaw/plugin-sdk/native-hook-relay-runtime";
|
|
28
|
+
//#region extensions/codex/src/app-server/side-question-instructions.ts
|
|
38
29
|
const SIDE_DEVELOPER_INSTRUCTIONS = `You are in a side conversation, not the main thread.
|
|
39
30
|
|
|
40
31
|
This side conversation is for answering questions and lightweight, non-mutating exploration without disrupting the main thread. Do not present yourself as continuing the main thread's active task.
|
|
@@ -48,6 +39,19 @@ External tools may be available according to this thread's current permissions.
|
|
|
48
39
|
You may perform non-mutating inspection, including reading or searching files and running checks that do not alter repo-tracked files.
|
|
49
40
|
|
|
50
41
|
Do not modify files, source, git state, permissions, configuration, workspace state, or external state unless the user explicitly requests that mutation in this side conversation. Do not request escalated permissions or broader sandbox access unless the user explicitly requests a mutation that requires it. If the user explicitly requests a mutation, keep it minimal, local to the request, and avoid disrupting the main thread.`;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region extensions/codex/src/app-server/side-question.ts
|
|
44
|
+
const SIDE_QUESTION_COMPLETION_TIMEOUT_MS = 6e5;
|
|
45
|
+
var CodexSideQuestionTimeoutError = class extends Error {
|
|
46
|
+
constructor(..._args) {
|
|
47
|
+
super(..._args);
|
|
48
|
+
this.name = "TimeoutError";
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const CODEX_SIDE_NATIVE_HOOK_RELAY_MIN_TTL_MS = 18e5;
|
|
52
|
+
const CODEX_SIDE_NATIVE_HOOK_RELAY_TTL_GRACE_MS = 3e5;
|
|
53
|
+
const CODEX_SIDE_NATIVE_HOOK_RELAY_STARTUP_REQUEST_COUNT = 3;
|
|
54
|
+
const CODEX_SIDE_NATIVE_HOOK_RELAY_EVENTS_WITH_APP_SERVER_APPROVALS = CODEX_NATIVE_HOOK_RELAY_EVENTS.filter((event) => event !== "permission_request");
|
|
51
55
|
async function runCodexAppServerSideQuestion(params, options) {
|
|
52
56
|
const bindingIdentity = sessionBindingIdentity({
|
|
53
57
|
sessionId: params.sessionId,
|
|
@@ -126,11 +130,12 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
126
130
|
bindingModel: binding.model,
|
|
127
131
|
nativeAuthProfile: usesSupervisionConnection || preparedNativeAuthProfile
|
|
128
132
|
});
|
|
129
|
-
const connection = resolveCodexBindingAppServerConnection({
|
|
133
|
+
const connection = await resolveCodexBindingAppServerConnection({
|
|
130
134
|
binding,
|
|
131
135
|
authProfileId,
|
|
132
136
|
pluginConfig,
|
|
133
137
|
execPolicy,
|
|
138
|
+
assertCurrent,
|
|
134
139
|
modelProvider: reviewerPolicyContext.modelProvider,
|
|
135
140
|
model: reviewerPolicyContext.model,
|
|
136
141
|
config: params.cfg,
|
|
@@ -222,6 +227,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
222
227
|
if (nativeExecutionBlock) throw new Error(nativeExecutionBlock);
|
|
223
228
|
if (!nativeToolSurfaceEnabled) throw new Error("Codex-native /btw side-question mode is unavailable because the effective tool policy restricts Codex native tools for this session.");
|
|
224
229
|
const clientOptions = {
|
|
230
|
+
assertCurrent,
|
|
225
231
|
startOptions: appServer.start,
|
|
226
232
|
timeoutMs: appServer.requestTimeoutMs,
|
|
227
233
|
authRequirement: preparedRuntimeAuth.plan.modelRoute?.authRequirement,
|
|
@@ -342,7 +348,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
342
348
|
} : {},
|
|
343
349
|
config: params.cfg
|
|
344
350
|
});
|
|
345
|
-
const handleServerRequest = async (request, _scope, requestSignal) => {
|
|
351
|
+
const handleServerRequest = async (request, _scope, requestSignal, setExecutionTimeoutMs) => {
|
|
346
352
|
const signal = AbortSignal.any([requestSignal, runAbortController.signal]);
|
|
347
353
|
if (signal.aborted) return;
|
|
348
354
|
if (!childThreadId || !turnId) return;
|
|
@@ -377,8 +383,10 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
377
383
|
if (!call || call.threadId !== childThreadId || call.turnId !== turnId) return;
|
|
378
384
|
const timeoutMs = resolveDynamicToolCallTimeoutMs({
|
|
379
385
|
call,
|
|
380
|
-
config: params.cfg
|
|
386
|
+
config: params.cfg,
|
|
387
|
+
toolBridge
|
|
381
388
|
});
|
|
389
|
+
setExecutionTimeoutMs?.(timeoutMs);
|
|
382
390
|
const toolStartedAt = Date.now();
|
|
383
391
|
const diagnosticContext = {
|
|
384
392
|
call,
|
|
@@ -459,6 +467,8 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
459
467
|
else pendingNativePreToolUseFailures.push(failure);
|
|
460
468
|
}
|
|
461
469
|
}) : void 0;
|
|
470
|
+
await nativeHookRelay?.prepareInvocation();
|
|
471
|
+
assertCurrent();
|
|
462
472
|
const nativeHookRelayConfig = nativeHookRelay ? buildCodexNativeHookRelayConfig({
|
|
463
473
|
relay: nativeHookRelay,
|
|
464
474
|
events: nativeHookRelayEvents,
|
|
@@ -579,11 +589,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
579
589
|
});
|
|
580
590
|
const turnResponse = assertCodexTurnStartResponse(await client.request("turn/start", {
|
|
581
591
|
threadId: sideThreadId,
|
|
582
|
-
input:
|
|
583
|
-
type: "text",
|
|
584
|
-
text: params.question.trim(),
|
|
585
|
-
text_elements: []
|
|
586
|
-
}],
|
|
592
|
+
input: buildCodexUserInput(params.question.trim(), params.images),
|
|
587
593
|
additionalContext: buildCodexTemporalAdditionalContext(sideRunParams, { sessionStatusAvailable: toolBridge.availableTools.some((tool) => tool.name === "session_status") }),
|
|
588
594
|
...sandboxEnvironment ? {
|
|
589
595
|
cwd: sandboxEnvironment.cwd,
|
|
@@ -640,17 +646,15 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
640
646
|
codexErrorInfo: result.turn?.error?.codexErrorInfo ?? null
|
|
641
647
|
} }, readRecentCodexRateLimits(client));
|
|
642
648
|
if (result.turn?.status === "interrupted") throw new Error("Codex /btw side thread was interrupted.");
|
|
643
|
-
const trimmed = result.text;
|
|
644
649
|
assertCurrent();
|
|
645
|
-
if (!
|
|
650
|
+
if (!result.text) throw new Error("Codex /btw completed without an answer.");
|
|
646
651
|
return {
|
|
647
|
-
text:
|
|
652
|
+
text: result.text,
|
|
648
653
|
usage: result.usage
|
|
649
654
|
};
|
|
650
655
|
} finally {
|
|
651
656
|
try {
|
|
652
|
-
|
|
653
|
-
nativeToolRunWasAbortedBeforeCleanup = runWasAbortedBeforeCleanup;
|
|
657
|
+
nativeToolRunWasAbortedBeforeCleanup = runAbortController.signal.aborted;
|
|
654
658
|
params.opts?.abortSignal?.removeEventListener("abort", abortFromUpstream);
|
|
655
659
|
if (!runAbortController.signal.aborted) runAbortController.abort("codex_side_question_finished");
|
|
656
660
|
await Promise.allSettled(activeDynamicToolCalls);
|
|
@@ -665,7 +669,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
665
669
|
if (policyWriteUncertain && childClient) await retireUnsafeCodexTurnClientBestEffort(childClient, "side policy handoff");
|
|
666
670
|
collector?.route.release();
|
|
667
671
|
try {
|
|
668
|
-
nativeToolLifecycleProjector?.finalizeActive(
|
|
672
|
+
nativeToolLifecycleProjector?.finalizeActive(nativeToolRunWasAbortedBeforeCleanup);
|
|
669
673
|
} finally {
|
|
670
674
|
activateNativePreToolUseFailureFallback();
|
|
671
675
|
}
|
|
@@ -677,6 +681,15 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
677
681
|
} finally {
|
|
678
682
|
releaseCodexAppServerClientLease(clientLease);
|
|
679
683
|
nativeHookRelay?.unregister();
|
|
684
|
+
await runAgentCleanupStep({
|
|
685
|
+
runId: sideRunParams.runId,
|
|
686
|
+
sessionId: sideRunParams.sessionId,
|
|
687
|
+
step: "codex-side-native-hook-relay-release",
|
|
688
|
+
log: embeddedAgentLog,
|
|
689
|
+
cleanup: async () => {
|
|
690
|
+
await nativeHookRelay?.drain();
|
|
691
|
+
}
|
|
692
|
+
});
|
|
680
693
|
}
|
|
681
694
|
}
|
|
682
695
|
}
|
|
@@ -687,7 +700,7 @@ function resolveCodexSideNativeHookRelayEvents(params) {
|
|
|
687
700
|
}
|
|
688
701
|
function registerCodexSideNativeHookRelay(params) {
|
|
689
702
|
if (params.options.enabled === false) return;
|
|
690
|
-
return
|
|
703
|
+
return registerNativeHookRelayForBundledRuntime({
|
|
691
704
|
provider: "codex",
|
|
692
705
|
...params.agentId ? { agentId: params.agentId } : {},
|
|
693
706
|
sessionId: params.sessionId,
|
|
@@ -797,11 +810,15 @@ async function createCodexSideToolBridge(input) {
|
|
|
797
810
|
send: async (payload) => {
|
|
798
811
|
await publishSideToolResult(payload);
|
|
799
812
|
},
|
|
800
|
-
...
|
|
813
|
+
...messageToolProvider ? { messageChannel: messageToolProvider } : {}
|
|
801
814
|
} : void 0;
|
|
802
815
|
const allTools = createOpenClawCodingTools({
|
|
803
816
|
agentId: input.sessionAgentId,
|
|
804
817
|
requesterThinkingLevel: input.params.resolvedThinkLevel ?? "off",
|
|
818
|
+
requesterModel: input.params.runtimeModel ? {
|
|
819
|
+
provider: input.params.runtimeModel.provider,
|
|
820
|
+
model: input.params.runtimeModel.id
|
|
821
|
+
} : void 0,
|
|
805
822
|
sessionKey: sandboxSessionKey,
|
|
806
823
|
runSessionKey: input.params.sessionKey && input.params.sessionKey !== sandboxSessionKey ? input.params.sessionKey : void 0,
|
|
807
824
|
sessionId: input.params.sessionId,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
2
|
-
import { c as CODEX_PLUGINS_MARKETPLACE_NAME, i as pluginReadParams, n as isOpenAiCuratedMarketplace } from "./plugin-inventory-
|
|
3
|
-
import {
|
|
4
|
-
import { o as withCodexAppServerJsonClient } from "./request-
|
|
5
|
-
import "./config-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
+
import { c as CODEX_PLUGINS_MARKETPLACE_NAME, i as pluginReadParams, n as isOpenAiCuratedMarketplace } from "./plugin-inventory-DUle8DLz.mjs";
|
|
3
|
+
import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-BOxKP7db.mjs";
|
|
4
|
+
import { o as withCodexAppServerJsonClient } from "./request-BioXJLYa.mjs";
|
|
5
|
+
import "./config-CedDWjM-.mjs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import os from "node:os";
|
|
8
8
|
import fs from "node:fs/promises";
|
|
@@ -120,6 +120,7 @@ async function discoverCodexMemorySources(codexHome) {
|
|
|
120
120
|
//#region extensions/codex/src/migration/source.ts
|
|
121
121
|
var source_exports = /* @__PURE__ */ __exportAll({
|
|
122
122
|
codexPluginMigrationSubscriptionWarning: () => codexPluginMigrationSubscriptionWarning,
|
|
123
|
+
defaultCodexHome: () => defaultCodexHome,
|
|
123
124
|
discoverCodexSource: () => discoverCodexSource,
|
|
124
125
|
hasCodexSource: () => hasCodexSource
|
|
125
126
|
});
|
|
@@ -515,4 +516,4 @@ function sanitizePluginName(value) {
|
|
|
515
516
|
return value.trim().toLowerCase().replaceAll(/\s+/gu, "-");
|
|
516
517
|
}
|
|
517
518
|
//#endregion
|
|
518
|
-
export {
|
|
519
|
+
export { source_exports as a, resolveHomePath as c, hasCodexSource as i, sanitizeName as l, defaultCodexHome as n, exists as o, discoverCodexSource as r, readJsonObject as s, codexPluginMigrationSubscriptionWarning as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as isJsonObject } from "./config-security-BRQ2mgW9.mjs";
|
|
2
2
|
import { normalizeBoundedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/codex/src/app-server/thread-archive-guard.ts
|
|
4
4
|
const DESCENDANT_PAGE_LIMIT = 100;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { A as parseTranscriptPage, M as readControlCursor, g as CatalogParamsError } from "./session-catalog-native-projection-ChV3cCtm.mjs";
|
|
2
|
+
//#region extensions/codex/src/app-server/thread-history-page.ts
|
|
3
|
+
const TURN_ITEM_CURSOR_PREFIX = "turn-item:";
|
|
4
|
+
function encodeTurnItemCursor(turnCursor, itemId) {
|
|
5
|
+
return TURN_ITEM_CURSOR_PREFIX + Buffer.from(JSON.stringify([turnCursor, itemId])).toString("base64url");
|
|
6
|
+
}
|
|
7
|
+
function decodeTurnItemCursor(cursor) {
|
|
8
|
+
if (!cursor?.startsWith(TURN_ITEM_CURSOR_PREFIX)) return { turnCursor: cursor };
|
|
9
|
+
let value;
|
|
10
|
+
try {
|
|
11
|
+
value = JSON.parse(Buffer.from(cursor.slice(10), "base64url").toString());
|
|
12
|
+
} catch {
|
|
13
|
+
throw new CatalogParamsError("invalid Codex transcript item cursor");
|
|
14
|
+
}
|
|
15
|
+
if (!Array.isArray(value) || value.length !== 2 || typeof value[0] !== "string" || !value[0] || typeof value[1] !== "string" || !value[1]) throw new CatalogParamsError("invalid Codex transcript item cursor");
|
|
16
|
+
return {
|
|
17
|
+
turnCursor: value[0],
|
|
18
|
+
itemId: value[1]
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Legacy stores expose only turn cursors; an item identity preserves paging across appends. */
|
|
22
|
+
async function readLegacyCodexHistoryPage(readTurns, request, projection) {
|
|
23
|
+
const { turnCursor, itemId } = decodeTurnItemCursor(request.cursor);
|
|
24
|
+
const page = parseTranscriptPage(await readTurns({
|
|
25
|
+
threadId: request.threadId,
|
|
26
|
+
limit: 1,
|
|
27
|
+
sortDirection: "desc",
|
|
28
|
+
itemsView: "full",
|
|
29
|
+
...turnCursor ? { cursor: turnCursor } : {}
|
|
30
|
+
}));
|
|
31
|
+
const source = page.data.flatMap(({ items, ...turn }) => items.toReversed().map((item) => ({
|
|
32
|
+
turnId: turn.id,
|
|
33
|
+
item,
|
|
34
|
+
turn
|
|
35
|
+
})));
|
|
36
|
+
const anchorIndex = itemId ? source.findIndex(({ item }) => item.id === itemId) : -1;
|
|
37
|
+
if (itemId && anchorIndex < 0) throw new CatalogParamsError("Codex transcript changed; refresh the session before loading older items");
|
|
38
|
+
const remaining = source.slice(anchorIndex + 1);
|
|
39
|
+
const items = projection.project(remaining.slice(0, request.limit), request.limit);
|
|
40
|
+
const result = () => {
|
|
41
|
+
const lastSource = remaining[items.length - 1];
|
|
42
|
+
const partial = lastSource !== void 0 && items.length < remaining.length;
|
|
43
|
+
const nativeCursor = partial ? page.backwardsCursor : page.nextCursor;
|
|
44
|
+
const cursor = nativeCursor ? partial ? encodeTurnItemCursor(nativeCursor, lastSource.item.id) : nativeCursor : void 0;
|
|
45
|
+
if (partial && !cursor) throw new Error("Codex app-server did not provide a transcript continuation anchor");
|
|
46
|
+
return {
|
|
47
|
+
items,
|
|
48
|
+
...cursor ? { nextCursor: cursor } : {}
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
let bounded = result();
|
|
52
|
+
while (!projection.fits(bounded)) {
|
|
53
|
+
if (items.length <= 1) throw new Error("Codex transcript item exceeds the safe response size");
|
|
54
|
+
items.pop();
|
|
55
|
+
bounded = result();
|
|
56
|
+
}
|
|
57
|
+
return bounded;
|
|
58
|
+
}
|
|
59
|
+
/** Callers authorize the thread; this reader owns native cursor and response-size semantics. */
|
|
60
|
+
async function readCodexThreadHistoryPage(control, thread, request, projection) {
|
|
61
|
+
if (thread.historyMode !== "paginated") return readLegacyCodexHistoryPage((params) => control.listTurnPage(params), request, projection);
|
|
62
|
+
let limit = request.limit;
|
|
63
|
+
for (;;) {
|
|
64
|
+
const page = await control.listItemPage({
|
|
65
|
+
threadId: request.threadId,
|
|
66
|
+
limit,
|
|
67
|
+
sortDirection: "desc",
|
|
68
|
+
...request.cursor ? { cursor: request.cursor } : {}
|
|
69
|
+
});
|
|
70
|
+
const nextCursor = readControlCursor(page.nextCursor, "transcript next response");
|
|
71
|
+
const items = projection.project(page.data, limit);
|
|
72
|
+
const result = {
|
|
73
|
+
items,
|
|
74
|
+
...nextCursor ? { nextCursor } : {}
|
|
75
|
+
};
|
|
76
|
+
const fittingCount = items.length - (projection.fits(result) ? 0 : 1);
|
|
77
|
+
if (fittingCount === page.data.length) return result;
|
|
78
|
+
if (fittingCount < 1) throw new Error("Codex transcript item exceeds the safe response size");
|
|
79
|
+
limit = fittingCount;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { readLegacyCodexHistoryPage as n, readCodexThreadHistoryPage as t };
|