@openclaw/codex 2026.9.5 → 2026.9.7
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/README.md +2 -0
- package/assets/icon.png +0 -0
- package/dist/.setup/{account-usage-runtime-C2MOIvfq.mjs → account-usage-runtime-DFhbh1zz.mjs} +6 -6
- package/dist/.setup/{apply-CJ0ZfmBG.mjs → apply-D3GcSoSa.mjs} +35 -55
- package/dist/.setup/{attempt-client-cleanup-BpYKdTA0.mjs → attempt-client-cleanup-DOP-cW5j.mjs} +179 -73
- package/dist/.setup/attempt-workspace-context-C5HigshI.mjs +164 -0
- package/dist/.setup/{auth-binding-DhLWa_7K.mjs → auth-binding-BLWz7stm.mjs} +14 -1
- package/dist/.setup/{auth-cache-key-QirmgiCo.mjs → auth-cache-key-Dbvq-QgB.mjs} +41 -111
- package/dist/.setup/{auth-profile-WqZtZfXN.mjs → auth-profile-B0okYl2D.mjs} +1 -2
- package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
- package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
- package/dist/.setup/auth-start-options-BPIPeEX8.mjs +44 -0
- package/dist/.setup/{binding-connection-Bm38niE8.mjs → binding-connection-DTtN1KrX.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-CnRMC0ta.mjs → binding-connection.runtime-6TpgD1M6.mjs} +5 -5
- package/dist/.setup/{bounded-turn-BtlZcivC.mjs → bounded-turn-CbjoN2OW.mjs} +140 -37
- package/dist/.setup/bounded-turn-isolation-B8K_ylqk.mjs +14 -0
- package/dist/.setup/{build-state-Xx9ybZqa.mjs → build-state-Da1_z0kd.mjs} +1 -1
- package/dist/.setup/{capabilities-_vXcZGSx.mjs → capabilities-B3WEZl4e.mjs} +2 -10
- package/dist/.setup/{client-vXs2929Q.mjs → client-N0JpgSzF.mjs} +635 -872
- package/dist/.setup/client-catalog-response-5HHLdcde.mjs +285 -0
- package/dist/.setup/{command-dispatch-naHIZwwF.mjs → command-dispatch-BeAoaovI.mjs} +9 -8
- package/dist/.setup/{command-formatters-CGEkdawF.mjs → command-formatters-R3ckE3Co.mjs} +36 -64
- package/dist/.setup/{command-handlers-BtAJEW1X.mjs → command-handlers-ylTMS00z.mjs} +301 -488
- package/dist/.setup/{command-rpc-DHFpn4le.mjs → command-rpc-CGJGUQ6Y.mjs} +40 -28
- package/dist/.setup/compact-C2WamavS.mjs +776 -0
- package/dist/.setup/{config-CedDWjM-.mjs → config-DKhXquav.mjs} +26 -28
- package/dist/.setup/{config-options-BsanJ8QG.mjs → config-options-CzyWLTJt.mjs} +68 -65
- package/dist/.setup/{config-parsing-CcB9iPoq.mjs → config-parsing-b088LyhT.mjs} +57 -60
- package/dist/.setup/{config-runtime-CeAhl_h4.mjs → config-runtime-C0NbLms1.mjs} +2 -2
- package/dist/.setup/{config-security-BRQ2mgW9.mjs → config-security-CE-FcGw9.mjs} +51 -215
- package/dist/.setup/{config-utils-DujwEnhg.mjs → config-utils-D0CXecki.mjs} +3 -13
- package/dist/.setup/context-engine-projection-PezSESth.mjs +387 -0
- package/dist/.setup/{conversation-binding-DhzrpTM6.mjs → conversation-binding-3Min8qvP.mjs} +71 -105
- package/dist/.setup/{conversation-binding-data-CrcyZk6O.mjs → conversation-binding-data-C746z5Pn.mjs} +8 -12
- package/dist/.setup/{conversation-control-DN53ns41.mjs → conversation-control-CEP8X5JC.mjs} +30 -69
- package/dist/.setup/{cyber-failover-DYwbmf1o.mjs → cyber-failover-XV0nNRZu.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-e9G3J9-e.mjs → cyber-failover-notice-RNpGpTyP.mjs} +1 -1
- package/dist/.setup/{dynamic-tools-D16lOp67.mjs → dynamic-tools-DzlsLUuS.mjs} +3136 -3167
- package/dist/.setup/{effective-mcp-catalog-K6kLCN8X.mjs → effective-mcp-catalog-CxUtC-xG.mjs} +8 -17
- package/dist/.setup/{ephemeral-turn-R1gA8Sn6.mjs → ephemeral-turn-CDsPJOa2.mjs} +9 -6
- package/dist/.setup/event-projector-assistant-message-CigreO4K.mjs +69 -0
- package/dist/.setup/{event-projector-usage-C7Ntzs-f.mjs → event-projector-usage-03R0I2dM.mjs} +4 -26
- package/dist/.setup/event-projector-values-DJSz8BTk.mjs +106 -0
- package/dist/.setup/incognito-session-DWYapfwf.mjs +2 -0
- package/dist/.setup/{inference-context-fulhZuz8.mjs → inference-context-D-9gWlTR.mjs} +16 -18
- package/dist/.setup/inference-dispatch-CMZtjQyz.mjs +359 -0
- package/dist/.setup/inference-metadata-CgIf7sOx.mjs +81 -0
- package/dist/.setup/inference-proxy-DhcXOgUE.mjs +561 -0
- package/dist/.setup/{isolated-completion-B6srt48J.mjs → isolated-completion-Dm3PzxJk.mjs} +15 -11
- package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
- package/dist/.setup/{managed-binary-DP6Rib3P.mjs → managed-binary-kiWRhNRE.mjs} +16 -9
- package/dist/.setup/{model-catalog-DkvUuBey.mjs → model-catalog-PAuZgJC6.mjs} +14 -14
- package/dist/.setup/model-runtime-BdqzOMkU.mjs +11 -0
- package/dist/.setup/{models-BDFgm_G-.mjs → models-DHXZtVVk.mjs} +9 -18
- package/dist/.setup/{native-auth-BLZGqFjw.mjs → native-auth-CuG53tu4.mjs} +5 -5
- package/dist/.setup/{native-execution-policy-YBMHSzC4.mjs → native-execution-policy-BxZJy5mP.mjs} +6 -31
- package/dist/.setup/{native-subagent-monitor-B1hxzIOy.mjs → native-subagent-monitor-Dpsmf2wz.mjs} +4422 -3808
- package/dist/.setup/native-subagent-pending-assignments-DwkCzLvD.mjs +203 -0
- package/dist/.setup/native-task-assignments-DMQ0g3hu.mjs +194 -0
- package/dist/.setup/{node-cli-sessions-Cl8b2ZF3.mjs → node-cli-sessions-HC4W6FLI.mjs} +99 -111
- package/dist/.setup/node-exec-server.runtime-BgBfWQqo.mjs +244 -0
- package/dist/.setup/{plan-xD7WKYTM.mjs → plan-Y-QIvrKB.mjs} +118 -163
- package/dist/.setup/{plugin-activation-r8nq5Jzp.mjs → plugin-activation-cNHRfaxU.mjs} +10 -47
- package/dist/.setup/{plugin-app-cache-key-BOxKP7db.mjs → plugin-app-cache-key-BL9B5H0L.mjs} +9 -42
- package/dist/.setup/{plugin-inventory-DUle8DLz.mjs → plugin-inventory-Cky2XJUw.mjs} +32 -23
- package/dist/.setup/{plugin-marketplace-discovery-P-Vndfqq.mjs → plugin-marketplace-discovery-D_dV9FXa.mjs} +22 -25
- package/dist/.setup/{plugin-metadata-cache-DsS5buNa.mjs → plugin-metadata-cache-DsjsL1dr.mjs} +328 -318
- package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
- package/dist/.setup/provider-DH8NSzGt.mjs +51 -0
- package/dist/.setup/{provider-capabilities-B8J4Dy-O.mjs → provider-capabilities-CAxoF-X1.mjs} +35 -12
- package/dist/.setup/{rate-limits-DOEGYRNs.mjs → rate-limits-B7-X2TgG.mjs} +123 -166
- package/dist/.setup/{request-BioXJLYa.mjs → request-BHZ1nz8d.mjs} +25 -16
- package/dist/.setup/responses-oauth-twnuTaAa.mjs +93 -0
- package/dist/.setup/rpc-error-BlD2vuzn.mjs +31 -0
- package/dist/.setup/{run-attempt-rlA07pUv.mjs → run-attempt-D8RZUOzY.mjs} +2046 -1454
- package/dist/.setup/{run-attempt-lifecycle-B7JbY4-F.mjs → run-attempt-lifecycle-C-6O3Exn.mjs} +10 -24
- package/dist/.setup/{runtime-artifact-Dy38Z5iU.mjs → runtime-artifact-DDQ-HGXf.mjs} +43 -47
- package/dist/.setup/runtime-artifact-connection-D68qQn1m.mjs +78 -0
- package/dist/.setup/sandbox-guard-DjCz2eOw.mjs +126 -0
- package/dist/.setup/scope-DOC1Xjc8.mjs +6 -0
- package/dist/.setup/session-binding-DGCYAfvD.mjs +443 -0
- package/dist/.setup/{session-binding-record-TH3xA0zj.mjs → session-binding-record-Oe9L-CNY.mjs} +73 -132
- package/dist/.setup/{session-binding-sidecars-CKYEcfNn.mjs → session-binding-sidecars-jo6H8dFr.mjs} +242 -60
- package/dist/.setup/{session-catalog-fUdWDx-U.mjs → session-catalog-4sCdv5qx.mjs} +598 -452
- package/dist/.setup/{session-catalog-adoption-CR_whkEW.mjs → session-catalog-adoption-BU_pHWG7.mjs} +59 -26
- package/dist/.setup/{session-catalog-archive-CwZaPacf.mjs → session-catalog-archive-spHfihri.mjs} +7 -7
- package/dist/.setup/session-catalog-events-DePDzzjc.mjs +139 -0
- package/dist/.setup/session-catalog-home-id-vlih0B_g.mjs +22 -0
- package/dist/.setup/{session-catalog-index-B141u15s.mjs → session-catalog-index-CZvDzC6z.mjs} +286 -182
- package/dist/.setup/{session-catalog-index-order-Cc5BzlQr.mjs → session-catalog-index-order-BcQpHks3.mjs} +2 -2
- package/dist/.setup/{session-catalog-index-state-BAuDztHN.mjs → session-catalog-index-state-TeO7EyO-.mjs} +6 -2
- package/dist/.setup/session-catalog-limits-DDxOsQeC.mjs +14 -0
- package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +170 -0
- package/dist/.setup/session-catalog-native-projection-DjhwGL6x.mjs +178 -0
- package/dist/.setup/{session-catalog-node-adoption-BVRsYOSh.mjs → session-catalog-node-adoption-DgXvSGu0.mjs} +30 -35
- package/dist/.setup/{session-catalog-node-continue-Dowv8osw.mjs → session-catalog-node-continue-DjKXHBbi.mjs} +25 -18
- package/dist/.setup/session-catalog-node-lookup-CtAXI5W5.mjs +56 -0
- package/dist/.setup/{session-catalog-native-projection-ChV3cCtm.mjs → session-catalog-parsing-CPGaPYr-.mjs} +14 -180
- package/dist/.setup/{session-catalog-projection-C1Bj9Jl-.mjs → session-catalog-projection-Cr5qP5Dj.mjs} +15 -5
- package/dist/.setup/session-catalog-provenance-DoAvktcj.mjs +95 -0
- package/dist/.setup/{session-cli-DIj-IE-E.mjs → session-cli-Cn_nCqfq.mjs} +11 -24
- package/dist/.setup/{session-history-C--SrLI8.mjs → session-history-D83lJWHG.mjs} +16 -23
- package/dist/.setup/{session-history-import-JHXT5Xfi.mjs → session-history-import-WhX-X33a.mjs} +7 -10
- package/dist/.setup/session-history-read-Ov3StuL4.mjs +133 -0
- package/dist/.setup/{session-history.worker-CpNj7H_P.mjs → session-history.worker-MnPKncqP.mjs} +14 -23
- package/dist/.setup/session-initialization-6aveB9qb.mjs +22 -0
- package/dist/.setup/{session-permission-policy-DhurXY0l.mjs → session-permission-policy-Ci_fVX6y.mjs} +4 -8
- package/dist/.setup/{session-retirement-CU87AOg9.mjs → session-retirement-qMTxkNx2.mjs} +31 -12
- package/dist/.setup/{settled-turn-context-fmwouT5I.mjs → settled-turn-context-D4yj4rxf.mjs} +1 -1
- package/dist/.setup/{settled-turn-finalizer-CiY2bLFK.mjs → settled-turn-finalizer-BsvEabkw.mjs} +17 -13
- package/dist/.setup/{shared-client-BpTtuLQ5.mjs → shared-client-DqyTMYug.mjs} +826 -485
- package/dist/.setup/shared-client-lifecycle-DJIgqgMw.mjs +153 -0
- package/dist/.setup/{side-question-DSCZyoBD.mjs → side-question-C4kCmQy1.mjs} +206 -334
- package/dist/.setup/{source-Bjp4UQij.mjs → source-CS_7GFJZ.mjs} +82 -139
- package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
- package/dist/.setup/{thread-archive-guard-jmecf6OJ.mjs → thread-archive-guard-C9frICzX.mjs} +10 -3
- package/dist/.setup/thread-lifecycle-DPflntEJ.mjs +2362 -0
- package/dist/.setup/{incognito-session-uhrBF6wJ.mjs → thread-ownership-queue-Dp24d7-F.mjs} +1 -2
- package/dist/.setup/{thread-ownership-skomxnIt.mjs → thread-ownership-roNP0l1c.mjs} +47 -10
- package/dist/.setup/thread-policy-DTd-DtkX.mjs +109 -0
- package/dist/.setup/thread-requests-B_bRnMGN.mjs +2102 -0
- package/dist/.setup/{thread-resume-BkNpj9Pz.mjs → thread-resume-CdDaoc7T.mjs} +6 -6
- package/dist/.setup/timeout-CXOfNoaX.mjs +46 -0
- package/dist/.setup/transcript-history-projection-DRSifI-1.mjs +201 -0
- package/dist/.setup/{transcript-mirror-attestation-CzM-94NC.mjs → transcript-mirror-attestation-YSegaktH.mjs} +3 -4
- package/dist/.setup/{transcript-mirror-D4qp_leP.mjs → transcript-mirror-kxmCYsuF.mjs} +224 -206
- package/dist/.setup/{transport-stdio-Cmx94Oiy.mjs → transport-stdio-Bdegpn2V.mjs} +138 -75
- package/dist/.setup/transport-websocket-BTBE-LD9.mjs +211 -0
- package/dist/.setup/{upstream-prompt-provenance-LphB8slG.mjs → upstream-prompt-provenance-fXkKbPVC.mjs} +3 -9
- package/dist/.setup/{upstream-session-fork-D3UKxgVD.mjs → upstream-session-fork-CBeVjBpT.mjs} +48 -40
- package/dist/.setup/{usage-BOgBEKso.mjs → usage-BMzNxeR_.mjs} +5 -4
- package/dist/.setup/{usage-limit-error-C0ow7DOc.mjs → usage-limit-error-QXerDo3i.mjs} +5 -20
- package/dist/.setup/{web-search-provider.runtime-CTGuJt6i.mjs → web-search-provider.runtime-P77OUeoo.mjs} +10 -20
- package/dist/api.js +25 -16
- package/dist/catalog-page-worker-entrypoint.js +12 -0
- package/dist/catalog-page.worker.js +9 -0
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +50 -8
- package/dist/harness.js +344 -1
- package/dist/index.js +345 -346
- package/dist/media-understanding-provider.js +9 -22
- package/dist/migration-provider-api.js +1 -1
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +16 -33
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +14 -2
- package/package.json +11 -7
- package/dist/.setup/attempt-context-VXVwTCfS.mjs +0 -636
- package/dist/.setup/compact-C3i3qlzj.mjs +0 -687
- package/dist/.setup/event-projector-assistant-message-DNUR1s0A.mjs +0 -105
- package/dist/.setup/event-projector-items-DyTQ_XqL.mjs +0 -200
- package/dist/.setup/harness-rxaaoN-o.mjs +0 -349
- package/dist/.setup/history-rejection-B4nOXNXF.mjs +0 -13
- package/dist/.setup/image-payload-sanitizer-tupAr-2o.mjs +0 -79
- package/dist/.setup/inference-proxy-CC15HuSi.mjs +0 -311
- package/dist/.setup/launch-args-DnMak49W.mjs +0 -111
- package/dist/.setup/local-runtime-attribution-B_2mnqhb.mjs +0 -19
- package/dist/.setup/native-subagent-history-YXaL6dMd.mjs +0 -135
- package/dist/.setup/native-subagent-task-ids-DsuOonKv.mjs +0 -411
- package/dist/.setup/node-exec-server.runtime-BaViBKNz.mjs +0 -226
- package/dist/.setup/plugin-approval-roundtrip-CjfzafAZ.mjs +0 -122
- package/dist/.setup/provider-fFh_-VR3.mjs +0 -50
- package/dist/.setup/rolldown-runtime-8H4AJuhK.mjs +0 -14
- package/dist/.setup/sandbox-guard-BBP-RbTf.mjs +0 -166
- package/dist/.setup/session-binding-_0W_fHRr.mjs +0 -721
- package/dist/.setup/session-catalog-events-jMcYfQyd.mjs +0 -250
- package/dist/.setup/session-history-read-B3ZfSUbF.mjs +0 -50
- package/dist/.setup/session-initialization-DH1z6fXn.mjs +0 -75
- package/dist/.setup/thread-history-page-BTx-4xsg.mjs +0 -83
- package/dist/.setup/thread-lifecycle-Cik28qWn.mjs +0 -4904
- package/dist/.setup/thread-policy-Cjs4B8xf.mjs +0 -54
- package/dist/.setup/timeout-DZF05XrR.mjs +0 -63
- package/dist/.setup/transcript-history-projection-DHNBDhCU.mjs +0 -243
- package/dist/.setup/version-CoqzXPgK.mjs +0 -12
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { it as resolveCodexGatewayTimeoutWithGraceMs } from "./shared-client-BpTtuLQ5.mjs";
|
|
2
|
-
import { isApprovalNotFoundError, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
3
|
-
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
4
|
-
//#region extensions/codex/src/app-server/plugin-approval-roundtrip.ts
|
|
5
|
-
const DEFAULT_CODEX_APPROVAL_TIMEOUT_MS = 12e4;
|
|
6
|
-
const MAX_PLUGIN_APPROVAL_TITLE_LENGTH = 80;
|
|
7
|
-
const MAX_PLUGIN_APPROVAL_DESCRIPTION_LENGTH = 512;
|
|
8
|
-
const ANSI_OSC_SEQUENCE_RE = new RegExp(String.raw`(?:\u001b]|\u009d)[^\u001b\u009c\u0007]*(?:\u0007|\u001b\\|\u009c)`, "g");
|
|
9
|
-
const ANSI_CONTROL_SEQUENCE_RE = new RegExp(String.raw`(?:\u001b\[[0-?]*[ -/]*[@-~]|\u009b[0-?]*[ -/]*[@-~]|\u001b[@-Z\\-_])`, "g");
|
|
10
|
-
const CONTROL_CHARACTER_RE = new RegExp(String.raw`[\u0000-\u001f\u007f-\u009f]+`, "g");
|
|
11
|
-
const INVISIBLE_FORMATTING_CONTROL_RE = new RegExp(String.raw`[\u00ad\u034f\u061c\u200b-\u200f\u202a-\u202e\u2060-\u206f\ufeff\ufe00-\ufe0f\u{e0100}-\u{e01ef}]`, "gu");
|
|
12
|
-
const DANGLING_TERMINAL_SEQUENCE_SUFFIX_RE = new RegExp(String.raw`(?:\u001b\][^\u001b\u009c\u0007]*|\u009d[^\u001b\u009c\u0007]*|\u001b\[[0-?]*[ -/]*|\u009b[0-?]*[ -/]*|\u001b)$`);
|
|
13
|
-
const CODEX_APPROVAL_TIMEOUT_SUBJECTS = {
|
|
14
|
-
command: "Command approval",
|
|
15
|
-
"file-change": "File change approval",
|
|
16
|
-
permissions: "Permission approval",
|
|
17
|
-
other: "Approval"
|
|
18
|
-
};
|
|
19
|
-
function codexApprovalTimeoutText(kind) {
|
|
20
|
-
return `${CODEX_APPROVAL_TIMEOUT_SUBJECTS[kind]} timed out before an operator responded.`;
|
|
21
|
-
}
|
|
22
|
-
/** Starts a two-phase plugin approval request through the OpenClaw gateway. */
|
|
23
|
-
async function requestPluginApproval(params) {
|
|
24
|
-
const timeoutMs = DEFAULT_CODEX_APPROVAL_TIMEOUT_MS;
|
|
25
|
-
return params.hostCapabilities.requestApproval({
|
|
26
|
-
signal: params.signal,
|
|
27
|
-
title: truncateCodexApprovalDisplayText(params.title, MAX_PLUGIN_APPROVAL_TITLE_LENGTH),
|
|
28
|
-
description: truncateCodexApprovalDisplayText(params.description, MAX_PLUGIN_APPROVAL_DESCRIPTION_LENGTH),
|
|
29
|
-
severity: params.severity,
|
|
30
|
-
toolName: params.toolName,
|
|
31
|
-
toolCallId: params.toolCallId,
|
|
32
|
-
...params.mcpTool ? {
|
|
33
|
-
mcpTool: params.mcpTool,
|
|
34
|
-
isMcpToolApprovalActive: params.isMcpToolApprovalActive
|
|
35
|
-
} : {},
|
|
36
|
-
timeoutMs,
|
|
37
|
-
transportTimeoutMs: resolveCodexGatewayTimeoutWithGraceMs(timeoutMs),
|
|
38
|
-
...params.allowedDecisions ? { allowedDecisions: params.allowedDecisions } : {}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
/** Detects the gateway's explicit null-decision marker for unavailable approvals. */
|
|
42
|
-
function approvalRequestExplicitlyUnavailable(result) {
|
|
43
|
-
if (result === null || result === void 0 || typeof result !== "object") return false;
|
|
44
|
-
let descriptor;
|
|
45
|
-
try {
|
|
46
|
-
descriptor = Object.getOwnPropertyDescriptor(result, "decision");
|
|
47
|
-
} catch {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
return descriptor !== void 0 && "value" in descriptor && descriptor.value === null;
|
|
51
|
-
}
|
|
52
|
-
/** Waits for the gateway's final approval decision, respecting turn aborts. */
|
|
53
|
-
async function waitForPluginApprovalDecision(params) {
|
|
54
|
-
const timeoutMs = DEFAULT_CODEX_APPROVAL_TIMEOUT_MS;
|
|
55
|
-
const waitPromise = params.hostCapabilities.waitForApproval({
|
|
56
|
-
approvalId: params.approvalId,
|
|
57
|
-
timeoutMs,
|
|
58
|
-
transportTimeoutMs: resolveCodexGatewayTimeoutWithGraceMs(timeoutMs),
|
|
59
|
-
signal: params.signal
|
|
60
|
-
}).catch((error) => {
|
|
61
|
-
if (isApprovalNotFoundError(error)) return;
|
|
62
|
-
throw error;
|
|
63
|
-
});
|
|
64
|
-
if (!params.signal) return await waitPromise;
|
|
65
|
-
let onAbort;
|
|
66
|
-
const abortPromise = new Promise((_, reject) => {
|
|
67
|
-
if (params.signal.aborted) {
|
|
68
|
-
reject(toErrorObject(params.signal.reason, "Non-Error rejection"));
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
onAbort = () => reject(toErrorObject(params.signal.reason, "Non-Error rejection"));
|
|
72
|
-
params.signal.addEventListener("abort", onAbort, { once: true });
|
|
73
|
-
});
|
|
74
|
-
try {
|
|
75
|
-
return await Promise.race([waitPromise, abortPromise]);
|
|
76
|
-
} finally {
|
|
77
|
-
if (onAbort) params.signal.removeEventListener("abort", onAbort);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/** Converts a gateway exec approval decision into the app-server approval outcome enum. */
|
|
81
|
-
function mapExecDecisionToOutcome(decision) {
|
|
82
|
-
switch (decision) {
|
|
83
|
-
case "allow-once": return "approved-once";
|
|
84
|
-
case "allow-always": return "approved-session";
|
|
85
|
-
case "deny": return "denied";
|
|
86
|
-
default: return "unavailable";
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/** Runs one complete host approval request and maps transport failures to a closed outcome. */
|
|
90
|
-
async function requestPluginApprovalOutcome(params) {
|
|
91
|
-
try {
|
|
92
|
-
const requestResult = await requestPluginApproval({
|
|
93
|
-
...params,
|
|
94
|
-
severity: "warning"
|
|
95
|
-
});
|
|
96
|
-
const approvalId = requestResult?.id;
|
|
97
|
-
if (!approvalId) return "unavailable";
|
|
98
|
-
const approvalResult = approvalRequestExplicitlyUnavailable(requestResult) ? void 0 : await waitForPluginApprovalDecision({
|
|
99
|
-
hostCapabilities: params.hostCapabilities,
|
|
100
|
-
approvalId,
|
|
101
|
-
signal: params.signal
|
|
102
|
-
});
|
|
103
|
-
if (params.signal?.aborted) return "cancelled";
|
|
104
|
-
if (approvalResult?.terminalReason === "timeout") return "timed-out";
|
|
105
|
-
const decision = approvalResult?.decision;
|
|
106
|
-
return mapExecDecisionToOutcome(decision === "allow-always" && params.allowedDecisions?.includes("allow-always") === false ? "allow-once" : decision);
|
|
107
|
-
} catch {
|
|
108
|
-
return params.signal?.aborted ? "cancelled" : "denied";
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
function truncateCodexApprovalDisplayText(value, maxLength) {
|
|
112
|
-
return value.length <= maxLength ? value : `${truncateUtf16Safe(value, maxLength - 3)}...`;
|
|
113
|
-
}
|
|
114
|
-
function stripDanglingCodexApprovalTerminalSequence(value) {
|
|
115
|
-
return value.replace(DANGLING_TERMINAL_SEQUENCE_SUFFIX_RE, "");
|
|
116
|
-
}
|
|
117
|
-
function sanitizeCodexApprovalVisibleText(value, options = {}) {
|
|
118
|
-
const terminalSafe = value.replace(ANSI_OSC_SEQUENCE_RE, "").replace(ANSI_CONTROL_SEQUENCE_RE, "");
|
|
119
|
-
return (options.stripDanglingTerminalSequence ? stripDanglingCodexApprovalTerminalSequence(terminalSafe) : terminalSafe).replace(INVISIBLE_FORMATTING_CONTROL_RE, " ").replace(CONTROL_CHARACTER_RE, " ").replace(/\s+/g, " ").trim();
|
|
120
|
-
}
|
|
121
|
-
//#endregion
|
|
122
|
-
export { requestPluginApprovalOutcome as a, truncateCodexApprovalDisplayText as c, requestPluginApproval as i, waitForPluginApprovalDecision as l, codexApprovalTimeoutText as n, sanitizeCodexApprovalVisibleText as o, mapExecDecisionToOutcome as r, stripDanglingCodexApprovalTerminalSequence as s, approvalRequestExplicitlyUnavailable as t };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//#region extensions/codex/src/migration/provider.ts
|
|
2
|
-
function isMemoryOnlyMigration(ctx) {
|
|
3
|
-
return Boolean(ctx.itemKinds && ctx.itemKinds.length > 0 && ctx.itemKinds.every((kind) => kind === "memory"));
|
|
4
|
-
}
|
|
5
|
-
function isAuthOnlyMigration(ctx) {
|
|
6
|
-
return Boolean(ctx.itemKinds && ctx.itemKinds.length > 0 && ctx.itemKinds.every((kind) => kind === "auth"));
|
|
7
|
-
}
|
|
8
|
-
function buildCodexMigrationProvider(params = {}) {
|
|
9
|
-
return {
|
|
10
|
-
id: "codex",
|
|
11
|
-
label: "Codex",
|
|
12
|
-
description: "Import Codex memory and skills while keeping Codex native plugins and hooks explicit.",
|
|
13
|
-
supportedItemKinds: ["memory", "auth"],
|
|
14
|
-
async detect(ctx) {
|
|
15
|
-
const { discoverCodexSource, hasCodexSource } = await import("./source-Bjp4UQij.mjs").then((n) => n.a);
|
|
16
|
-
const source = await discoverCodexSource({
|
|
17
|
-
input: ctx.source,
|
|
18
|
-
memoryOnly: isMemoryOnlyMigration(ctx),
|
|
19
|
-
authOnly: isAuthOnlyMigration(ctx)
|
|
20
|
-
});
|
|
21
|
-
const found = isMemoryOnlyMigration(ctx) ? source.memoryFiles.length > 0 : isAuthOnlyMigration(ctx) ? Boolean(source.authPath) : hasCodexSource(source);
|
|
22
|
-
return {
|
|
23
|
-
found,
|
|
24
|
-
source: source.root,
|
|
25
|
-
label: "Codex",
|
|
26
|
-
confidence: found ? source.confidence : "low",
|
|
27
|
-
message: found ? "Codex state found." : "Codex state not found."
|
|
28
|
-
};
|
|
29
|
-
},
|
|
30
|
-
async plan(ctx) {
|
|
31
|
-
const { buildCodexMigrationPlan } = await import("./plan-xD7WKYTM.mjs");
|
|
32
|
-
return buildCodexMigrationPlan(ctx);
|
|
33
|
-
},
|
|
34
|
-
deferredApply: { retrySafe: true },
|
|
35
|
-
prepareApply(ctx) {
|
|
36
|
-
if (isMemoryOnlyMigration(ctx) || isAuthOnlyMigration(ctx)) return;
|
|
37
|
-
return import("./apply-CJ0ZfmBG.mjs").then(({ prepareTargetCodexAppServer }) => prepareTargetCodexAppServer(ctx));
|
|
38
|
-
},
|
|
39
|
-
async apply(ctx, plan) {
|
|
40
|
-
const { applyCodexMigrationPlan } = await import("./apply-CJ0ZfmBG.mjs");
|
|
41
|
-
return await applyCodexMigrationPlan({
|
|
42
|
-
ctx,
|
|
43
|
-
plan,
|
|
44
|
-
runtime: params.runtime
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
//#endregion
|
|
50
|
-
export { buildCodexMigrationProvider as t };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import "node:module";
|
|
2
|
-
//#region \0rolldown/runtime.js
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __exportAll = (all, no_symbols) => {
|
|
5
|
-
let target = {};
|
|
6
|
-
for (var name in all) __defProp(target, name, {
|
|
7
|
-
get: all[name],
|
|
8
|
-
enumerable: true
|
|
9
|
-
});
|
|
10
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
11
|
-
return target;
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { __exportAll as t };
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
-
import { l as isCodexRemoteExecPlacementSandbox } from "./config-parsing-CcB9iPoq.mjs";
|
|
3
|
-
import { n as resolveCodexNativeExecutionPolicy, t as formatCodexNativeNodeExecBlock } from "./native-execution-policy-YBMHSzC4.mjs";
|
|
4
|
-
import { tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
5
|
-
import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
6
|
-
import { resolveSandboxRuntimeStatus } from "openclaw/plugin-sdk/sandbox";
|
|
7
|
-
//#region extensions/codex/src/app-server/sandbox-guard.ts
|
|
8
|
-
/**
|
|
9
|
-
* Blocks direct Codex app-server requests that would bypass OpenClaw sandbox or
|
|
10
|
-
* node-exec routing guarantees.
|
|
11
|
-
*/
|
|
12
|
-
var sandbox_guard_exports = /* @__PURE__ */ __exportAll({
|
|
13
|
-
resolveCodexAppServerDirectSandboxBypassBlock: () => resolveCodexAppServerDirectSandboxBypassBlock,
|
|
14
|
-
resolveCodexNativeExecutionBlock: () => resolveCodexNativeExecutionBlock,
|
|
15
|
-
resolveCodexNativeSandboxBlock: () => resolveCodexNativeSandboxBlock
|
|
16
|
-
});
|
|
17
|
-
const DIRECT_METHOD_POLICIES = /* @__PURE__ */ new Map([
|
|
18
|
-
["account/rateLimits/read", "allowed-control-plane"],
|
|
19
|
-
["account/read", "allowed-control-plane"],
|
|
20
|
-
["app/installed", "allowed-control-plane"],
|
|
21
|
-
["app/list", "allowed-control-plane"],
|
|
22
|
-
["app/read", "allowed-control-plane"],
|
|
23
|
-
["config/batchWrite", "allowed-control-plane"],
|
|
24
|
-
["config/mcpServer/reload", "allowed-control-plane"],
|
|
25
|
-
["config/read", "allowed-control-plane"],
|
|
26
|
-
["config/value/write", "allowed-control-plane"],
|
|
27
|
-
["environment/add", "allowed-control-plane"],
|
|
28
|
-
["experimentalFeature/list", "allowed-control-plane"],
|
|
29
|
-
["experimentalFeature/enablement/set", "allowed-control-plane"],
|
|
30
|
-
["feedback/upload", "allowed-control-plane"],
|
|
31
|
-
["hooks/list", "allowed-control-plane"],
|
|
32
|
-
["initialize", "allowed-control-plane"],
|
|
33
|
-
["marketplace/add", "allowed-control-plane"],
|
|
34
|
-
["mcpServerStatus/list", "allowed-control-plane"],
|
|
35
|
-
["model/list", "allowed-control-plane"],
|
|
36
|
-
["plugin/install", "allowed-control-plane"],
|
|
37
|
-
["plugin/installed", "allowed-control-plane"],
|
|
38
|
-
["plugin/list", "allowed-control-plane"],
|
|
39
|
-
["plugin/read", "allowed-control-plane"],
|
|
40
|
-
["skills/list", "allowed-control-plane"],
|
|
41
|
-
["thread/archive", "allowed-control-plane"],
|
|
42
|
-
["thread/inject_items", "allowed-control-plane"],
|
|
43
|
-
["thread/list", "allowed-control-plane"],
|
|
44
|
-
["thread/metadata/update", "allowed-control-plane"],
|
|
45
|
-
["thread/name/set", "allowed-control-plane"],
|
|
46
|
-
["thread/read", "allowed-control-plane"],
|
|
47
|
-
["thread/rollback", "allowed-control-plane"],
|
|
48
|
-
["thread/start", "requires-openclaw-environment"],
|
|
49
|
-
["thread/unarchive", "allowed-control-plane"],
|
|
50
|
-
["thread/unsubscribe", "allowed-control-plane"],
|
|
51
|
-
["turn/interrupt", "allowed-control-plane"],
|
|
52
|
-
["turn/steer", "allowed-control-plane"],
|
|
53
|
-
["command/exec", "blocked-native-bypass"],
|
|
54
|
-
["command/resize", "blocked-native-bypass"],
|
|
55
|
-
["command/terminate", "blocked-native-bypass"],
|
|
56
|
-
["command/write", "blocked-native-bypass"],
|
|
57
|
-
["fuzzyFileSearch", "blocked-native-bypass"],
|
|
58
|
-
["mcpServer/resource/read", "blocked-native-bypass"],
|
|
59
|
-
["mcpServer/tool/call", "blocked-native-bypass"],
|
|
60
|
-
["process/kill", "blocked-native-bypass"],
|
|
61
|
-
["process/resizePty", "blocked-native-bypass"],
|
|
62
|
-
["process/spawn", "blocked-native-bypass"],
|
|
63
|
-
["process/writeStdin", "blocked-native-bypass"],
|
|
64
|
-
["review/start", "blocked-native-bypass"],
|
|
65
|
-
["thread/compact/start", "blocked-native-bypass"],
|
|
66
|
-
["thread/fork", "blocked-native-bypass"],
|
|
67
|
-
["thread/resume", "blocked-native-bypass"],
|
|
68
|
-
["thread/shellCommand", "blocked-native-bypass"],
|
|
69
|
-
["turn/start", "blocked-native-bypass"]
|
|
70
|
-
]);
|
|
71
|
-
const BLOCKED_DIRECT_METHOD_PREFIXES = [
|
|
72
|
-
"command/",
|
|
73
|
-
"fs/",
|
|
74
|
-
"windowsSandbox/"
|
|
75
|
-
];
|
|
76
|
-
const NODE_EXEC_BLOCKED_CONTROL_PLANE_METHODS = /* @__PURE__ */ new Set(["config/mcpServer/reload"]);
|
|
77
|
-
/** Returns a block message when a direct app-server method would bypass OpenClaw execution policy. */
|
|
78
|
-
function resolveCodexAppServerDirectSandboxBypassBlock(params) {
|
|
79
|
-
const policy = resolveDirectMethodPolicy(params.method);
|
|
80
|
-
if (NODE_EXEC_BLOCKED_CONTROL_PLANE_METHODS.has(params.method)) {
|
|
81
|
-
const nodeExecBlock = resolveCodexNativeNodeExecBlock({
|
|
82
|
-
config: params.config,
|
|
83
|
-
sessionKey: params.sessionKey,
|
|
84
|
-
sessionId: params.sessionId,
|
|
85
|
-
surface: `app-server method \`${params.method}\``
|
|
86
|
-
});
|
|
87
|
-
if (nodeExecBlock) return nodeExecBlock;
|
|
88
|
-
}
|
|
89
|
-
if (policy === "allowed-control-plane") return;
|
|
90
|
-
const nodeExecBlock = resolveCodexNativeNodeExecBlock({
|
|
91
|
-
config: params.config,
|
|
92
|
-
sessionKey: params.sessionKey,
|
|
93
|
-
sessionId: params.sessionId,
|
|
94
|
-
surface: `app-server method \`${params.method}\``
|
|
95
|
-
});
|
|
96
|
-
if (nodeExecBlock) return nodeExecBlock;
|
|
97
|
-
const sessionKey = params.sessionKey?.trim() || params.sessionId?.trim();
|
|
98
|
-
if (!sessionKey) return;
|
|
99
|
-
const sandboxBlock = resolveCodexNativeSandboxBlock({
|
|
100
|
-
config: params.config,
|
|
101
|
-
sessionKey,
|
|
102
|
-
sandbox: params.sandbox,
|
|
103
|
-
surface: `app-server method \`${params.method}\``
|
|
104
|
-
});
|
|
105
|
-
if (!sandboxBlock) return;
|
|
106
|
-
if (policy === "requires-openclaw-environment" && hasOpenClawSandboxEnvironmentSelection(params.requestParams)) return;
|
|
107
|
-
return sandboxBlock;
|
|
108
|
-
}
|
|
109
|
-
/** Resolves the generic native-execution block for sandboxed or node-hosted sessions. */
|
|
110
|
-
function resolveCodexNativeExecutionBlock(params) {
|
|
111
|
-
return resolveCodexNativeSandboxBlock(params) ?? resolveCodexNativeNodeExecBlock(params);
|
|
112
|
-
}
|
|
113
|
-
/** Returns a block message when native Codex execution cannot honor active sandboxing. */
|
|
114
|
-
function resolveCodexNativeSandboxBlock(params) {
|
|
115
|
-
if (params.sandboxEnvironmentSelected) return;
|
|
116
|
-
const sessionKey = params.sessionKey?.trim() || params.sessionId?.trim();
|
|
117
|
-
if (!sessionKey) return;
|
|
118
|
-
if (isCodexRemoteExecPlacementSandbox(params.sandbox) || params.sandbox?.enabled === true) return formatCodexNativeSandboxBlock({ surface: params.surface });
|
|
119
|
-
const sandboxAgentId = parseAgentSessionKey(sessionKey)?.agentId ?? params.agentId ?? tryResolveDefaultAgentId(params.config ?? {});
|
|
120
|
-
if (!sandboxAgentId) return;
|
|
121
|
-
if (!resolveSandboxRuntimeStatus({
|
|
122
|
-
cfg: params.config,
|
|
123
|
-
sessionKey,
|
|
124
|
-
agentId: sandboxAgentId,
|
|
125
|
-
classificationAgentId: sandboxAgentId
|
|
126
|
-
}).sandboxed) return;
|
|
127
|
-
return formatCodexNativeSandboxBlock({ surface: params.surface });
|
|
128
|
-
}
|
|
129
|
-
function resolveDirectMethodPolicy(method) {
|
|
130
|
-
const exact = DIRECT_METHOD_POLICIES.get(method);
|
|
131
|
-
if (exact) return exact;
|
|
132
|
-
if (BLOCKED_DIRECT_METHOD_PREFIXES.some((prefix) => method.startsWith(prefix))) return "blocked-native-bypass";
|
|
133
|
-
return "blocked-native-bypass";
|
|
134
|
-
}
|
|
135
|
-
function hasOpenClawSandboxEnvironmentSelection(value) {
|
|
136
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
137
|
-
const environments = value.environments;
|
|
138
|
-
return Array.isArray(environments) && environments.length > 0 && environments.every((entry) => {
|
|
139
|
-
if (!entry || typeof entry !== "object" || Array.isArray(entry)) return false;
|
|
140
|
-
const environment = entry;
|
|
141
|
-
return typeof environment.environmentId === "string" && environment.environmentId.startsWith("openclaw-sandbox-") && typeof environment.cwd === "string" && environment.cwd.trim().length > 0;
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
function formatCodexNativeSandboxBlock(params) {
|
|
145
|
-
return [
|
|
146
|
-
`Codex-native ${params.surface} is unavailable because OpenClaw sandboxing is active for this session.`,
|
|
147
|
-
"This mode cannot route execution through the OpenClaw sandbox backend.",
|
|
148
|
-
"Use a normal Codex harness turn, or run an intentionally unsandboxed session."
|
|
149
|
-
].join(" ");
|
|
150
|
-
}
|
|
151
|
-
function resolveCodexNativeNodeExecBlock(params) {
|
|
152
|
-
const sessionKey = params.sessionKey?.trim() || params.sessionId?.trim();
|
|
153
|
-
const policy = resolveCodexNativeExecutionPolicy({
|
|
154
|
-
config: params.config,
|
|
155
|
-
sessionKey,
|
|
156
|
-
agentId: params.agentId,
|
|
157
|
-
readRuntimeSessionEntry: Boolean(sessionKey)
|
|
158
|
-
});
|
|
159
|
-
if (policy.nativeToolSurfaceAllowed) return;
|
|
160
|
-
return formatCodexNativeNodeExecBlock({
|
|
161
|
-
surface: params.surface,
|
|
162
|
-
reason: policy.blockReason
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
//#endregion
|
|
166
|
-
export { resolveCodexNativeSandboxBlock as n, sandbox_guard_exports as r, resolveCodexNativeExecutionBlock as t };
|