@openclaw/codex 2026.9.7 → 2026.10.1-beta.1
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 +8 -0
- package/dist/.setup/{account-usage-runtime-DFhbh1zz.mjs → account-usage-runtime-C4GFoef_.mjs} +5 -5
- package/dist/.setup/app-server-policy-Bg4FZw1f.mjs +23 -0
- package/dist/.setup/{apply-D3GcSoSa.mjs → apply-D02fLpgN.mjs} +48 -39
- package/dist/.setup/attempt-client-cleanup-yLjGwbwT.mjs +155 -0
- package/dist/.setup/{attempt-workspace-context-C5HigshI.mjs → attempt-workspace-context-CbSzT6V2.mjs} +11 -15
- package/dist/.setup/{auth-binding-BLWz7stm.mjs → auth-binding-BoMwpuPN.mjs} +17 -25
- package/dist/.setup/{auth-cache-key-Dbvq-QgB.mjs → auth-cache-key-CEd9QlIs.mjs} +244 -82
- package/dist/.setup/{auth-profile-B0okYl2D.mjs → auth-profile-CgHQ8Vot.mjs} +2 -1
- package/dist/.setup/{auth-profile-selection-DFu9e167.mjs → auth-profile-selection-hr8ocLtz.mjs} +5 -7
- package/dist/.setup/{binding-connection-DTtN1KrX.mjs → binding-connection-C-08ez1w.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-6TpgD1M6.mjs → binding-connection.runtime-Dn2p-fdy.mjs} +3 -3
- package/dist/.setup/{bounded-turn-CbjoN2OW.mjs → bounded-turn-DlHlNTyS.mjs} +14 -13
- package/dist/.setup/{bounded-turn-isolation-B8K_ylqk.mjs → bounded-turn-isolation-DklXNk3k.mjs} +4 -4
- package/dist/.setup/{build-state-Da1_z0kd.mjs → build-state-CIi3Ckqu.mjs} +1 -1
- package/dist/.setup/{capabilities-B3WEZl4e.mjs → capabilities-kQntafj_.mjs} +1 -1
- package/dist/.setup/{client-N0JpgSzF.mjs → client-CBzEVDyb.mjs} +438 -160
- package/dist/.setup/{client-catalog-response-5HHLdcde.mjs → client-catalog-response-CmvIiDdj.mjs} +57 -25
- package/dist/.setup/command-authorization-AikPDtcc.mjs +15 -0
- package/dist/.setup/{command-dispatch-BeAoaovI.mjs → command-dispatch-BE_RdMou.mjs} +3 -3
- package/dist/.setup/{command-formatters-R3ckE3Co.mjs → command-formatters-DV3DHhdr.mjs} +7 -5
- package/dist/.setup/{command-handlers-ylTMS00z.mjs → command-handlers-DNoRq5Ps.mjs} +82 -144
- package/dist/.setup/{command-rpc-CGJGUQ6Y.mjs → command-rpc-B6xsq2dB.mjs} +23 -31
- package/dist/.setup/{compact-C2WamavS.mjs → compact-BLSAd-ru.mjs} +117 -65
- package/dist/.setup/{plugin-metadata-cache-DsjsL1dr.mjs → computer-use-DpolvQHw.mjs} +66 -203
- package/dist/.setup/{config-DKhXquav.mjs → config-0Gxk3_eq.mjs} +5 -6
- package/dist/.setup/{config-options-CzyWLTJt.mjs → config-options-HG_Rr3W_.mjs} +13 -23
- package/dist/.setup/{config-parsing-b088LyhT.mjs → config-parsing-BQq-CHTF.mjs} +41 -4
- package/dist/.setup/{config-runtime-C0NbLms1.mjs → config-runtime-cUYrqu_a.mjs} +2 -2
- package/dist/.setup/{config-security-CE-FcGw9.mjs → config-security-KAPScztc.mjs} +20 -36
- package/dist/.setup/{context-engine-projection-PezSESth.mjs → context-engine-projection-CsgYSQhW.mjs} +11 -14
- package/dist/.setup/{conversation-binding-3Min8qvP.mjs → conversation-binding-CgSSD1Qz.mjs} +36 -48
- package/dist/.setup/{conversation-binding-data-C746z5Pn.mjs → conversation-binding-data-DJ4ix-W5.mjs} +1 -1
- package/dist/.setup/{conversation-control-CEP8X5JC.mjs → conversation-control-tCg763cI.mjs} +19 -21
- package/dist/.setup/{cyber-failover-XV0nNRZu.mjs → cyber-failover-Bb1J6hS1.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-RNpGpTyP.mjs → cyber-failover-notice-XR03ef31.mjs} +1 -1
- package/dist/.setup/doctor-start-options-DPW9JxIE.mjs +63 -0
- package/dist/.setup/dynamic-tool-build-CVrx02cH.mjs +463 -0
- package/dist/.setup/{dynamic-tools-DzlsLUuS.mjs → dynamic-tools-DdsymYGQ.mjs} +238 -878
- package/dist/.setup/{effective-mcp-catalog-CxUtC-xG.mjs → effective-mcp-catalog-BysTBZCW.mjs} +83 -11
- package/dist/.setup/{elicitation-input-DPoK8F7w.mjs → elicitation-input-r9axtppm.mjs} +4 -2
- package/dist/.setup/{ephemeral-turn-CDsPJOa2.mjs → ephemeral-turn-oPKxs3ia.mjs} +2 -2
- package/dist/.setup/{event-projector-assistant-message-CigreO4K.mjs → event-projector-assistant-message-YCL2wspu.mjs} +2 -2
- package/dist/.setup/{event-projector-values-DJSz8BTk.mjs → event-projector-values-DTqZHizf.mjs} +2 -12
- package/dist/.setup/{inference-dispatch-CMZtjQyz.mjs → inference-dispatch-B5UKEUyC.mjs} +12 -21
- package/dist/.setup/{inference-proxy-DhcXOgUE.mjs → inference-proxy-DUO5E2QQ.mjs} +6 -5
- package/dist/.setup/{isolated-completion-Dm3PzxJk.mjs → isolated-completion-D5gbKm6k.mjs} +8 -8
- package/dist/.setup/{managed-binary-kiWRhNRE.mjs → managed-binary-C1VFoVPf.mjs} +31 -38
- package/dist/.setup/mcp-app-session-preparation-CdqsXwZX.mjs +223 -0
- package/dist/.setup/mcp-tool-metadata-j10HhfTC.mjs +43 -0
- package/dist/.setup/{model-catalog-PAuZgJC6.mjs → model-catalog-Dj_uvusa.mjs} +7 -7
- package/dist/.setup/{models-DHXZtVVk.mjs → models-Du_i5G_t.mjs} +10 -7
- package/dist/.setup/{native-auth-CuG53tu4.mjs → native-auth-Cjb9y7IZ.mjs} +5 -6
- package/dist/.setup/{native-execution-policy-BxZJy5mP.mjs → native-execution-policy-ClzpdG3D.mjs} +1 -12
- package/dist/.setup/native-mcp-app-DV7VbfzF.mjs +310 -0
- package/dist/.setup/{native-subagent-monitor-Dpsmf2wz.mjs → native-subagent-monitor-CCEFO6qK.mjs} +235 -318
- package/dist/.setup/{native-subagent-pending-assignments-DwkCzLvD.mjs → native-subagent-pending-assignments-BDqhOdJp.mjs} +0 -4
- package/dist/.setup/{native-task-assignments-DMQ0g3hu.mjs → native-task-assignments-C6KVqiN1.mjs} +9 -8
- package/dist/.setup/{node-cli-sessions-HC4W6FLI.mjs → node-cli-sessions-B5oNDkUS.mjs} +11 -17
- package/dist/.setup/{node-exec-server.runtime-BgBfWQqo.mjs → node-exec-server.runtime-0xSEjKYt.mjs} +2 -2
- package/dist/.setup/{plan-Y-QIvrKB.mjs → plan-CUHSIOep.mjs} +67 -89
- package/dist/.setup/{plugin-activation-cNHRfaxU.mjs → plugin-activation-BcyBv8PG.mjs} +4 -4
- package/dist/.setup/{plugin-app-cache-key-BL9B5H0L.mjs → plugin-app-cache-key-BW8rd98k.mjs} +11 -15
- package/dist/.setup/plugin-approval-roundtrip-uAR-oQfr.mjs +109 -0
- package/dist/.setup/{plugin-inventory-Cky2XJUw.mjs → plugin-inventory-Bf0_piTw.mjs} +29 -51
- package/dist/.setup/{plugin-marketplace-discovery-D_dV9FXa.mjs → plugin-marketplace-discovery-SQPhSuic.mjs} +2 -16
- package/dist/.setup/plugin-metadata-cache-DWnB7VMj.mjs +84 -0
- package/dist/.setup/plugin-thread-config-deadline-CdRzGJt4.mjs +124 -0
- package/dist/.setup/{provider-DH8NSzGt.mjs → provider-BP8ZaZqn.mjs} +4 -4
- package/dist/.setup/provider-capabilities-Z5ZbBxqP.mjs +50 -0
- package/dist/.setup/{rate-limits-B7-X2TgG.mjs → rate-limits-CMPy24F5.mjs} +1 -5
- package/dist/.setup/{request-BHZ1nz8d.mjs → request-BH3FvYUE.mjs} +189 -49
- package/dist/.setup/rpc-error-hmWM21RB.mjs +57 -0
- package/dist/.setup/{run-attempt-D8RZUOzY.mjs → run-attempt-CgvFoW7R.mjs} +553 -727
- package/dist/.setup/{run-attempt-lifecycle-C-6O3Exn.mjs → run-attempt-lifecycle-BuZgVbDA.mjs} +19 -3
- package/dist/.setup/{runtime-artifact-DDQ-HGXf.mjs → runtime-artifact-CUTOOnKw.mjs} +5 -6
- package/dist/.setup/{runtime-artifact-connection-D68qQn1m.mjs → runtime-artifact-connection-CADz3_BY.mjs} +5 -4
- package/dist/.setup/{sandbox-guard-DjCz2eOw.mjs → sandbox-guard-WqE8yPge.mjs} +3 -3
- package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +15 -0
- package/dist/.setup/{session-binding-DGCYAfvD.mjs → session-binding-Ce7BqiPN.mjs} +92 -102
- package/dist/.setup/session-binding-meta-Lkm5Lpf4.mjs +15 -0
- package/dist/.setup/session-binding-record-BZB8RgcF.mjs +179 -0
- package/dist/.setup/session-binding-record-codec-z4ZpDn6E.mjs +216 -0
- package/dist/.setup/{session-binding-sidecars-jo6H8dFr.mjs → session-binding-sidecars-BrdV95Fg.mjs} +8 -2
- package/dist/.setup/{session-catalog-adoption-BU_pHWG7.mjs → session-catalog-adoption-CPIP4S_y.mjs} +34 -18
- package/dist/.setup/{session-catalog-archive-spHfihri.mjs → session-catalog-archive-DcgwvSbF.mjs} +24 -29
- package/dist/.setup/{session-catalog-events-DePDzzjc.mjs → session-catalog-events-KIXOoSnQ.mjs} +5 -5
- package/dist/.setup/{session-catalog-index-CZvDzC6z.mjs → session-catalog-index-DPICGlxr.mjs} +361 -72
- package/dist/.setup/{session-catalog-index-order-BcQpHks3.mjs → session-catalog-index-order-nhyO0wdW.mjs} +1 -1
- package/dist/.setup/{session-catalog-limits-DDxOsQeC.mjs → session-catalog-limits-DEU36Qlo.mjs} +1 -1
- package/dist/.setup/{session-catalog-index-state-TeO7EyO-.mjs → session-catalog-list-request-tXephOB4.mjs} +180 -6
- package/dist/.setup/{session-catalog-native-projection-DjhwGL6x.mjs → session-catalog-native-projection-CTBd4EUm.mjs} +7 -6
- package/dist/.setup/{session-catalog-node-adoption-DgXvSGu0.mjs → session-catalog-node-adoption-7-WEQTB1.mjs} +12 -2
- package/dist/.setup/{session-catalog-node-continue-DjKXHBbi.mjs → session-catalog-node-continue-DLWBwAAO.mjs} +11 -15
- package/dist/.setup/{session-catalog-node-lookup-CtAXI5W5.mjs → session-catalog-node-lookup-Uufckwcm.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-CPGaPYr-.mjs → session-catalog-parsing-B-qWJh2x.mjs} +70 -28
- package/dist/.setup/{session-catalog-projection-Cr5qP5Dj.mjs → session-catalog-projection-CE0_Hffi.mjs} +6 -122
- package/dist/.setup/{session-catalog-provenance-DoAvktcj.mjs → session-catalog-provenance-CmsOE5mh.mjs} +6 -1
- package/dist/.setup/{session-cli-Cn_nCqfq.mjs → session-cli-kH4vuGod.mjs} +1 -2
- package/dist/.setup/{session-history-D83lJWHG.mjs → session-history-BogBHKLk.mjs} +1 -1
- package/dist/.setup/{session-history-import-WhX-X33a.mjs → session-history-import-NWKPa4ZO.mjs} +4 -4
- package/dist/.setup/{session-history-read-Ov3StuL4.mjs → session-history-read-CNN8zwbD.mjs} +8 -19
- package/dist/.setup/{session-history.worker-MnPKncqP.mjs → session-history.worker-Cq_4DYgN.mjs} +3 -3
- package/dist/.setup/{session-initialization-6aveB9qb.mjs → session-initialization-D6dtFQkE.mjs} +2 -2
- package/dist/.setup/{session-permission-policy-Ci_fVX6y.mjs → session-permission-policy-BxIUJ0Zd.mjs} +8 -37
- package/dist/.setup/{session-retirement-qMTxkNx2.mjs → session-retirement-aC60o6P3.mjs} +14 -15
- package/dist/.setup/{settled-turn-context-D4yj4rxf.mjs → settled-turn-context-BZsMjkIO.mjs} +13 -6
- package/dist/.setup/{settled-turn-finalizer-BsvEabkw.mjs → settled-turn-finalizer-CDxCejjC.mjs} +8 -8
- package/dist/.setup/{shared-client-DqyTMYug.mjs → shared-client-DJJ3ljH2.mjs} +291 -272
- package/dist/.setup/{provider-capabilities-CAxoF-X1.mjs → shell-dynamic-tools-Do9lIAT1.mjs} +16 -55
- package/dist/.setup/{side-question-C4kCmQy1.mjs → side-question-B7T0_GEC.mjs} +99 -91
- package/dist/.setup/{source-CS_7GFJZ.mjs → source-DH70LqN0.mjs} +24 -40
- package/dist/.setup/{thread-lifecycle-DPflntEJ.mjs → thread-lifecycle-DkcoX9q-.mjs} +262 -305
- package/dist/.setup/{thread-ownership-roNP0l1c.mjs → thread-ownership-0aRHD9iK.mjs} +10 -8
- package/dist/.setup/{thread-policy-DTd-DtkX.mjs → thread-policy-CXZV97TS.mjs} +22 -21
- package/dist/.setup/{thread-requests-B_bRnMGN.mjs → thread-requests-COrRJcZb.mjs} +107 -98
- package/dist/.setup/{thread-resume-CdDaoc7T.mjs → thread-resume-rx7J68Rx.mjs} +10 -18
- package/dist/.setup/{transcript-history-projection-DRSifI-1.mjs → transcript-history-projection-B9a7HwUV.mjs} +11 -16
- package/dist/.setup/{transcript-mirror-kxmCYsuF.mjs → transcript-mirror-BfLRARNL.mjs} +64 -67
- package/dist/.setup/{transport-stdio-Bdegpn2V.mjs → transport-stdio-a0HDa2Mj.mjs} +27 -8
- package/dist/.setup/{transport-websocket-BTBE-LD9.mjs → transport-websocket-zqJ0Cmtn.mjs} +3 -8
- package/dist/.setup/{attempt-client-cleanup-DOP-cW5j.mjs → turn-router-CX1-EoCp.mjs} +75 -170
- package/dist/.setup/{upstream-session-fork-CBeVjBpT.mjs → upstream-session-fork-LYlaQnbt.mjs} +35 -46
- package/dist/.setup/{usage-BMzNxeR_.mjs → usage-Dmx7B0W2.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-QXerDo3i.mjs → usage-limit-error-M8jVnITZ.mjs} +4 -4
- package/dist/.setup/{web-search-provider.runtime-P77OUeoo.mjs → web-search-provider.runtime-CsVmqbFm.mjs} +4 -20
- package/dist/.setup/websocket-data-XlRvt8Ys.mjs +6 -0
- package/dist/.setup/workspace-write-sandbox-probe-DmUHLrrl.mjs +118 -0
- package/dist/api.js +34 -54
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +15 -27
- package/dist/harness.js +37 -22
- package/dist/index.js +2880 -276
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-session-binding-api.js +2 -0
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +33 -4
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +3 -3
- package/package.json +6 -6
- package/dist/.setup/config-utils-D0CXecki.mjs +0 -57
- package/dist/.setup/incognito-session-DWYapfwf.mjs +0 -2
- package/dist/.setup/managed-thread-store-BMqgThVL.mjs +0 -100
- package/dist/.setup/rpc-error-BlD2vuzn.mjs +0 -31
- package/dist/.setup/session-binding-meta-B7aEMU7g.mjs +0 -6
- package/dist/.setup/session-binding-record-Oe9L-CNY.mjs +0 -375
- package/dist/.setup/session-catalog-4sCdv5qx.mjs +0 -2610
- package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +0 -170
- package/dist/.setup/shared-client-lifecycle-DJIgqgMw.mjs +0 -153
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { t as resolveCodexAppServerHomeDir } from "./auth-start-options-BPIPeEX8.mjs";
|
|
2
|
-
import { o as resolveCodexComputerUseConfig } from "./config-options-
|
|
3
|
-
import { d as resolveMacOSDesktopCodexBundledMarketplaceCandidates, t as isManagedCodexDesktopCommand } from "./managed-binary-
|
|
4
|
-
import { n as describeControlFailure } from "./capabilities-
|
|
5
|
-
import {
|
|
6
|
-
import "./config-
|
|
7
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
8
|
-
import { $ as reconcileCodexComputerUseStartArtifacts, O as acquireCodexNativeConfigFence, at as isLegacyCodexComputerUsePluginDisabled, b as withLeasedCodexAppServerClientStartSelectionRetry, c as getLeasedSharedCodexAppServerClient, ct as assertNotSymlink, d as readCodexAppServerClientDesktopGeneration, g as resolveCodexNativeConfigFenceKey, h as releaseLeasedSharedCodexAppServerClient, it as hasLegacyCodexComputerUseMcpPolicy, nt as resolveBundledComputerUseMarketplacePath, ot as resolveManagedCodexComputerUseConfig, p as readCodexAppServerClientProcessIdentity, rt as resolveClientManagedBundledMarketplacePath, st as ensureCodexComputerUseSharedPluginCache, t as assertCodexAppServerClientStartSelectionCurrent, u as isCodexAppServerStartSelectionChangedError, y as waitForCodexAppServerClientDesktopGenerationDrain } from "./shared-client-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { o as resolveCodexComputerUseConfig } from "./config-options-HG_Rr3W_.mjs";
|
|
3
|
+
import { d as resolveMacOSDesktopCodexBundledMarketplaceCandidates, t as isManagedCodexDesktopCommand } from "./managed-binary-C1VFoVPf.mjs";
|
|
4
|
+
import { n as describeControlFailure } from "./capabilities-kQntafj_.mjs";
|
|
5
|
+
import { n as requestCodexAppServerClientJson } from "./request-BH3FvYUE.mjs";
|
|
6
|
+
import "./config-0Gxk3_eq.mjs";
|
|
7
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
|
|
8
|
+
import { $ as reconcileCodexComputerUseStartArtifacts, O as acquireCodexNativeConfigFence, at as isLegacyCodexComputerUsePluginDisabled, b as withLeasedCodexAppServerClientStartSelectionRetry, c as getLeasedSharedCodexAppServerClient, ct as assertNotSymlink, d as readCodexAppServerClientDesktopGeneration, g as resolveCodexNativeConfigFenceKey, h as releaseLeasedSharedCodexAppServerClient, it as hasLegacyCodexComputerUseMcpPolicy, nt as resolveBundledComputerUseMarketplacePath, ot as resolveManagedCodexComputerUseConfig, p as readCodexAppServerClientProcessIdentity, rt as resolveClientManagedBundledMarketplacePath, st as ensureCodexComputerUseSharedPluginCache, t as assertCodexAppServerClientStartSelectionCurrent, u as isCodexAppServerStartSelectionChangedError, y as waitForCodexAppServerClientDesktopGenerationDrain } from "./shared-client-DJJ3ljH2.mjs";
|
|
9
|
+
import { a as isCodexAppServerIndeterminateRequestCancellationError, i as isCodexAppServerConnectionClosedError, o as isCodexAppServerIndeterminateTransportError } from "./client-CBzEVDyb.mjs";
|
|
10
|
+
import { l as retireUnsafeCodexTurnClientBestEffort, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-yLjGwbwT.mjs";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import fs from "node:fs/promises";
|
|
13
13
|
import { toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
14
|
+
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
14
15
|
//#region extensions/codex/src/app-server/computer-use-readiness.ts
|
|
15
16
|
/** Computer Use readiness probes and their native subscription lifecycle. */
|
|
16
17
|
function createComputerUseRequest(params) {
|
|
@@ -35,12 +36,24 @@ const COMPUTER_USE_LIVE_TEST_RETRY_COUNT = 1;
|
|
|
35
36
|
const COMPUTER_USE_LIVE_TEST_THREAD_NAME = "OpenClaw Computer Use readiness probe";
|
|
36
37
|
const COMPUTER_USE_LIST_APPS_TOOL = "list_apps";
|
|
37
38
|
const COMPUTER_USE_UNIFIED_JS_TOOL = "js";
|
|
38
|
-
const COMPUTER_USE_UNIFIED_JS_PROBE = "await cua.
|
|
39
|
+
const COMPUTER_USE_UNIFIED_JS_PROBE = "await cua.listApps();";
|
|
39
40
|
async function runCodexComputerUseLiveTest(params) {
|
|
40
41
|
const startedAt = Date.now();
|
|
41
42
|
let lastError;
|
|
42
43
|
let repair;
|
|
43
44
|
const probe = resolveComputerUseLiveTestProbe(params.tools);
|
|
45
|
+
const liveTestStatus = (attempts, error) => ({
|
|
46
|
+
status: error === void 0 ? "passed" : "failed",
|
|
47
|
+
ok: error === void 0,
|
|
48
|
+
attempted: true,
|
|
49
|
+
attempts,
|
|
50
|
+
timeoutMs: params.config.liveTestTimeoutMs,
|
|
51
|
+
retried: attempts > 1,
|
|
52
|
+
repaired: Boolean(repair?.attempted && repair.warnings.length === 0),
|
|
53
|
+
durationMs: Math.max(0, Date.now() - startedAt),
|
|
54
|
+
message: error === void 0 ? "Computer Use live test passed." : `Computer Use live test failed after ${attempts} attempts: ${error}`,
|
|
55
|
+
...error === void 0 ? {} : { error }
|
|
56
|
+
});
|
|
44
57
|
for (let attempt = 0; attempt <= COMPUTER_USE_LIVE_TEST_RETRY_COUNT; attempt += 1) {
|
|
45
58
|
let threadId;
|
|
46
59
|
let outcome;
|
|
@@ -58,17 +71,7 @@ async function runCodexComputerUseLiveTest(params) {
|
|
|
58
71
|
}, { timeoutMs: params.config.toolCallTimeoutMs })).isError === true) throw new Error(`Computer Use readiness tool ${params.config.mcpServerName}.${probe.tool} returned an error result`);
|
|
59
72
|
outcome = {
|
|
60
73
|
ok: true,
|
|
61
|
-
liveTest:
|
|
62
|
-
status: "passed",
|
|
63
|
-
ok: true,
|
|
64
|
-
attempted: true,
|
|
65
|
-
attempts: attempt + 1,
|
|
66
|
-
timeoutMs: params.config.liveTestTimeoutMs,
|
|
67
|
-
retried: attempt > 0,
|
|
68
|
-
repaired: Boolean(repair?.attempted && repair.warnings.length === 0),
|
|
69
|
-
durationMs: Math.max(0, Date.now() - startedAt),
|
|
70
|
-
message: "Computer Use live test passed."
|
|
71
|
-
}
|
|
74
|
+
liveTest: liveTestStatus(attempt + 1)
|
|
72
75
|
};
|
|
73
76
|
} catch (error) {
|
|
74
77
|
outcome = {
|
|
@@ -91,20 +94,8 @@ async function runCodexComputerUseLiveTest(params) {
|
|
|
91
94
|
lastError = outcome.error;
|
|
92
95
|
if (attempt < COMPUTER_USE_LIVE_TEST_RETRY_COUNT && params.config.autoRepair) repair = await repairComputerUseMcpRuntime(params.request, params.config);
|
|
93
96
|
}
|
|
94
|
-
const errorMessage = describeControlFailure(lastError);
|
|
95
97
|
return {
|
|
96
|
-
liveTest:
|
|
97
|
-
status: "failed",
|
|
98
|
-
ok: false,
|
|
99
|
-
attempted: true,
|
|
100
|
-
attempts: 2,
|
|
101
|
-
timeoutMs: params.config.liveTestTimeoutMs,
|
|
102
|
-
retried: true,
|
|
103
|
-
repaired: Boolean(repair?.attempted && repair.warnings.length === 0),
|
|
104
|
-
durationMs: Math.max(0, Date.now() - startedAt),
|
|
105
|
-
message: `Computer Use live test failed after 2 attempts: ${errorMessage}`,
|
|
106
|
-
error: errorMessage
|
|
107
|
-
},
|
|
98
|
+
liveTest: liveTestStatus(2, describeControlFailure(lastError)),
|
|
108
99
|
...repair ? { repair } : {}
|
|
109
100
|
};
|
|
110
101
|
}
|
|
@@ -240,8 +231,7 @@ async function ensureCodexComputerUse(params = {}) {
|
|
|
240
231
|
});
|
|
241
232
|
if (status.ready) return status;
|
|
242
233
|
if (config.autoInstall) {
|
|
243
|
-
|
|
244
|
-
if (blockedAutoInstallStatus) throw new CodexComputerUseSetupError(blockedAutoInstallStatus);
|
|
234
|
+
if (config.marketplaceSource) throw new CodexComputerUseSetupError(unavailableStatus(config, "auto_install_blocked", "Computer Use auto-install only uses marketplaces Codex app-server has already discovered. Run /codex computer-use install to install from a configured marketplace source."));
|
|
245
235
|
const installedStatus = await inspectCodexComputerUse({
|
|
246
236
|
...params,
|
|
247
237
|
computerUseConfig: config,
|
|
@@ -280,8 +270,8 @@ async function inspectCodexComputerUse(params) {
|
|
|
280
270
|
managedCommandOrder: "desktop-first"
|
|
281
271
|
});
|
|
282
272
|
const operationTimeoutMs = params.timeoutMs ?? resolvedRuntime.requestTimeoutMs;
|
|
283
|
-
const deadline = operationTimeoutMs > 0 ?
|
|
284
|
-
const remainingTimeoutMs = () => deadline === void 0 ? operationTimeoutMs : Math.max(1, deadline -
|
|
273
|
+
const deadline = operationTimeoutMs > 0 ? performance.now() + operationTimeoutMs : void 0;
|
|
274
|
+
const remainingTimeoutMs = () => deadline === void 0 ? operationTimeoutMs : Math.max(1, deadline - performance.now());
|
|
285
275
|
const clientOptions = {
|
|
286
276
|
startOptions: resolvedRuntime.start,
|
|
287
277
|
pluginConfig: params.pluginConfig,
|
|
@@ -524,19 +514,12 @@ async function readComputerUseTools(params) {
|
|
|
524
514
|
server = await readMcpServerStatus(params.request, params.config.mcpServerName);
|
|
525
515
|
tools = Object.keys(server?.tools ?? {}).toSorted();
|
|
526
516
|
}
|
|
527
|
-
if (!server) return statusFromPlugin({
|
|
528
|
-
config: params.config,
|
|
529
|
-
plugin: params.plugin,
|
|
530
|
-
tools: [],
|
|
531
|
-
reason: "mcp_missing",
|
|
532
|
-
message: `Computer Use is installed, but the ${params.config.mcpServerName} MCP server is not available.`
|
|
533
|
-
});
|
|
534
|
-
if (tools.length === 0) return statusFromPlugin({
|
|
517
|
+
if (!server || tools.length === 0) return statusFromPlugin({
|
|
535
518
|
config: params.config,
|
|
536
519
|
plugin: params.plugin,
|
|
537
520
|
tools,
|
|
538
521
|
reason: "mcp_missing",
|
|
539
|
-
message: `Computer Use is installed, but the ${params.config.mcpServerName} MCP server exposes no tools.`
|
|
522
|
+
message: server ? `Computer Use is installed, but the ${params.config.mcpServerName} MCP server exposes no tools.` : `Computer Use is installed, but the ${params.config.mcpServerName} MCP server is not available.`
|
|
540
523
|
});
|
|
541
524
|
const status = statusFromPlugin({
|
|
542
525
|
config: params.config,
|
|
@@ -585,7 +568,8 @@ async function resolveMarketplaceRef(params) {
|
|
|
585
568
|
} };
|
|
586
569
|
let candidates = await listComputerUseMarketplaceCandidates(params.request, params.config);
|
|
587
570
|
const bundledMarketplacePath = resolveBundledComputerUseMarketplacePath(params);
|
|
588
|
-
|
|
571
|
+
const discoverDefaultMarketplace = params.allowAdd && !params.config.marketplaceSource && !params.config.marketplacePath && !params.config.marketplaceName;
|
|
572
|
+
if (candidates.length === 0 && bundledMarketplacePath && discoverDefaultMarketplace) {
|
|
589
573
|
if (params.managedCodexHome) await migrateLegacyBundledMarketplaceSource({
|
|
590
574
|
request: params.request,
|
|
591
575
|
bundledMarketplacePath,
|
|
@@ -596,7 +580,7 @@ async function resolveMarketplaceRef(params) {
|
|
|
596
580
|
preferredMarketplaceName ??= added.marketplaceName;
|
|
597
581
|
candidates = await listComputerUseMarketplaceCandidates(params.request, params.config);
|
|
598
582
|
}
|
|
599
|
-
const waitUntil =
|
|
583
|
+
const waitUntil = discoverDefaultMarketplace ? Date.now() + params.config.marketplaceDiscoveryTimeoutMs : 0;
|
|
600
584
|
if (candidates.length === 0 && waitUntil > Date.now() && await codexNativePluginsDisabled(params.request)) return { message: "Codex native plugin support is disabled (features.plugins = false). Enable it in the Codex config, then run /codex computer-use install." };
|
|
601
585
|
while (candidates.length === 0) {
|
|
602
586
|
if (Date.now() >= waitUntil) break;
|
|
@@ -633,13 +617,6 @@ async function listComputerUseMarketplaceCandidates(request, config) {
|
|
|
633
617
|
async function codexNativePluginsDisabled(request) {
|
|
634
618
|
return (await request("experimentalFeature/list", {})).data.find(({ name }) => name === "plugins")?.enabled === false;
|
|
635
619
|
}
|
|
636
|
-
function blockUnsafeAutoInstallStatus(config) {
|
|
637
|
-
if (!config.marketplaceSource) return;
|
|
638
|
-
return unavailableStatus(config, "auto_install_blocked", "Computer Use auto-install only uses marketplaces Codex app-server has already discovered. Run /codex computer-use install to install from a configured marketplace source.");
|
|
639
|
-
}
|
|
640
|
-
function shouldAddBundledComputerUseMarketplace(params) {
|
|
641
|
-
return params.allowAdd && !params.config.marketplaceSource && !params.config.marketplacePath && !params.config.marketplaceName && Boolean(resolveBundledComputerUseMarketplacePath(params));
|
|
642
|
-
}
|
|
643
620
|
function findComputerUseMarketplaces(listed, pluginName) {
|
|
644
621
|
return listed.marketplaces.flatMap((marketplace) => {
|
|
645
622
|
const plugin = marketplace.plugins.find((candidate) => candidate.name === pluginName || candidate.id === pluginName || candidate.id === `${pluginName}@${marketplace.name}`);
|
|
@@ -654,7 +631,6 @@ function findComputerUseMarketplaces(listed, pluginName) {
|
|
|
654
631
|
return [{
|
|
655
632
|
kind: "remote",
|
|
656
633
|
name: marketplace.name,
|
|
657
|
-
remoteMarketplaceName: marketplace.name,
|
|
658
634
|
remotePluginId
|
|
659
635
|
}];
|
|
660
636
|
});
|
|
@@ -665,28 +641,13 @@ function chooseKnownComputerUseMarketplace(candidates) {
|
|
|
665
641
|
if (candidate) return candidate;
|
|
666
642
|
}
|
|
667
643
|
}
|
|
668
|
-
function marketplaceDiscoveryWaitUntil(params) {
|
|
669
|
-
if (params.allowAdd && !params.config.marketplaceSource && !params.config.marketplacePath && !params.config.marketplaceName) return Date.now() + params.config.marketplaceDiscoveryTimeoutMs;
|
|
670
|
-
return 0;
|
|
671
|
-
}
|
|
672
644
|
async function delay(ms, signal) {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
};
|
|
680
|
-
const timer = setTimeout(() => {
|
|
681
|
-
signal?.removeEventListener("abort", onAbort);
|
|
682
|
-
resolve();
|
|
683
|
-
}, ms);
|
|
684
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
685
|
-
});
|
|
686
|
-
}
|
|
687
|
-
function abortError(signal) {
|
|
688
|
-
const reason = signal?.reason;
|
|
689
|
-
return reason instanceof Error ? reason : /* @__PURE__ */ new Error("Computer Use setup was aborted.");
|
|
645
|
+
try {
|
|
646
|
+
await sleepWithAbort(Math.max(1, ms), signal);
|
|
647
|
+
} catch (error) {
|
|
648
|
+
if (!signal?.aborted) throw error;
|
|
649
|
+
throw signal.reason instanceof Error ? signal.reason : /* @__PURE__ */ new Error("Computer Use setup was aborted.");
|
|
650
|
+
}
|
|
690
651
|
}
|
|
691
652
|
async function readComputerUsePlugin(request, marketplace, pluginName) {
|
|
692
653
|
return (await request("plugin/read", pluginRequestParams(marketplace, pluginName))).plugin;
|
|
@@ -709,44 +670,39 @@ function pluginRequestParams(marketplace, pluginName) {
|
|
|
709
670
|
marketplacePath: marketplace.path,
|
|
710
671
|
pluginName
|
|
711
672
|
} : {
|
|
712
|
-
remoteMarketplaceName: marketplace.
|
|
673
|
+
remoteMarketplaceName: marketplace.name,
|
|
713
674
|
pluginName: marketplace.remotePluginId
|
|
714
675
|
};
|
|
715
676
|
}
|
|
716
677
|
function statusFromPlugin(params) {
|
|
717
|
-
|
|
718
|
-
enabled: true,
|
|
719
|
-
ready: params.plugin.summary.installed && params.plugin.summary.enabled && params.tools.length > 0,
|
|
720
|
-
reason: params.reason,
|
|
721
|
-
installed: params.plugin.summary.installed,
|
|
722
|
-
pluginEnabled: params.plugin.summary.enabled,
|
|
723
|
-
mcpServerAvailable: params.tools.length > 0,
|
|
724
|
-
pluginName: params.config.pluginName,
|
|
725
|
-
mcpServerName: params.config.mcpServerName,
|
|
726
|
-
marketplaceName: params.plugin.marketplaceName,
|
|
727
|
-
...params.plugin.marketplacePath ? { marketplacePath: params.plugin.marketplacePath } : {},
|
|
728
|
-
tools: params.tools,
|
|
729
|
-
installation: installationStatusFromPlugin(params.plugin, params.message),
|
|
730
|
-
exposure: exposureStatusFromTools(params.config, params.tools),
|
|
731
|
-
liveTest: skippedLiveTestStatus(params.config, "Computer Use live test was not run."),
|
|
732
|
-
warnings: params.plugin.summary.source?.type === "remote" ? ["Computer Use plugin is resolved from a remote marketplace; live local bundles are preferred."] : [],
|
|
733
|
-
message: params.message
|
|
734
|
-
};
|
|
735
|
-
}
|
|
736
|
-
function installationStatusFromPlugin(plugin, message) {
|
|
678
|
+
const { config, plugin, tools, reason, message } = params;
|
|
737
679
|
const installed = plugin.summary.installed && plugin.summary.enabled;
|
|
738
|
-
return {
|
|
739
|
-
status: !plugin.summary.installed ? "not_installed" : installed ? "installed" : "installed_disabled",
|
|
740
|
-
ok: installed,
|
|
741
|
-
message: installed ? "Computer Use plugin is installed and enabled." : message
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
function exposureStatusFromTools(config, tools) {
|
|
745
680
|
const available = tools.length > 0;
|
|
746
681
|
return {
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
682
|
+
enabled: true,
|
|
683
|
+
ready: installed && available,
|
|
684
|
+
reason,
|
|
685
|
+
installed: plugin.summary.installed,
|
|
686
|
+
pluginEnabled: plugin.summary.enabled,
|
|
687
|
+
mcpServerAvailable: available,
|
|
688
|
+
pluginName: config.pluginName,
|
|
689
|
+
mcpServerName: config.mcpServerName,
|
|
690
|
+
marketplaceName: plugin.marketplaceName,
|
|
691
|
+
...plugin.marketplacePath ? { marketplacePath: plugin.marketplacePath } : {},
|
|
692
|
+
tools,
|
|
693
|
+
installation: {
|
|
694
|
+
status: !plugin.summary.installed ? "not_installed" : installed ? "installed" : "installed_disabled",
|
|
695
|
+
ok: installed,
|
|
696
|
+
message: installed ? "Computer Use plugin is installed and enabled." : message
|
|
697
|
+
},
|
|
698
|
+
exposure: {
|
|
699
|
+
status: available ? "available" : "missing",
|
|
700
|
+
ok: available,
|
|
701
|
+
message: available ? `Computer Use MCP server ${config.mcpServerName} exposes ${tools.length} tools.` : `Computer Use MCP server ${config.mcpServerName} is not exposed.`
|
|
702
|
+
},
|
|
703
|
+
liveTest: skippedLiveTestStatus(config, "Computer Use live test was not run."),
|
|
704
|
+
warnings: plugin.summary.source?.type === "remote" ? ["Computer Use plugin is resolved from a remote marketplace; live local bundles are preferred."] : [],
|
|
705
|
+
message
|
|
750
706
|
};
|
|
751
707
|
}
|
|
752
708
|
function resolveComputerUseConfig(params) {
|
|
@@ -760,97 +716,4 @@ function resolveComputerUseConfig(params) {
|
|
|
760
716
|
});
|
|
761
717
|
}
|
|
762
718
|
//#endregion
|
|
763
|
-
|
|
764
|
-
const CODEX_PLUGIN_METADATA_CACHE_TTL_MS = 36e5;
|
|
765
|
-
var CodexPluginMetadataCache = class {
|
|
766
|
-
constructor(nowMs = Date.now) {
|
|
767
|
-
this.nowMs = nowMs;
|
|
768
|
-
this.entries = /* @__PURE__ */ new Map();
|
|
769
|
-
this.inFlight = /* @__PURE__ */ new Map();
|
|
770
|
-
this.generations = /* @__PURE__ */ new Map();
|
|
771
|
-
this.clearGeneration = 0;
|
|
772
|
-
}
|
|
773
|
-
read(appCacheKey, queryKind, requestParams, catalogScope) {
|
|
774
|
-
const entryKey = buildMetadataCacheEntryKey(appCacheKey, queryKind, requestParams, catalogScope);
|
|
775
|
-
const entry = this.entries.get(entryKey);
|
|
776
|
-
if (!entry) return;
|
|
777
|
-
if (entry.expiresAtMs <= this.nowMs()) {
|
|
778
|
-
this.entries.delete(entryKey);
|
|
779
|
-
return;
|
|
780
|
-
}
|
|
781
|
-
return entry.snapshot;
|
|
782
|
-
}
|
|
783
|
-
/** Returns a fresh snapshot or coalesces one catalog or installed-plugin request. */
|
|
784
|
-
async load(params) {
|
|
785
|
-
const entryKey = buildMetadataCacheEntryKey(params.appCacheKey, params.queryKind, params.requestParams, params.catalogScope);
|
|
786
|
-
const cached = this.read(params.appCacheKey, params.queryKind, params.requestParams, params.catalogScope);
|
|
787
|
-
if (cached) return cached;
|
|
788
|
-
const pending = this.inFlight.get(entryKey);
|
|
789
|
-
if (pending) try {
|
|
790
|
-
return await pending.promise;
|
|
791
|
-
} catch {
|
|
792
|
-
if (this.inFlight.get(entryKey) === pending) this.inFlight.delete(entryKey);
|
|
793
|
-
return await this.load(params);
|
|
794
|
-
}
|
|
795
|
-
const generation = this.generations.get(params.appCacheKey) ?? 0;
|
|
796
|
-
const clearGeneration = this.clearGeneration;
|
|
797
|
-
const promise = (async () => {
|
|
798
|
-
const method = params.queryKind === "installed" ? "plugin/installed" : "plugin/list";
|
|
799
|
-
const response = await params.request(method, params.requestParams);
|
|
800
|
-
const snapshot = {
|
|
801
|
-
appCacheKey: params.appCacheKey,
|
|
802
|
-
queryKind: params.queryKind,
|
|
803
|
-
response
|
|
804
|
-
};
|
|
805
|
-
if (generation === (this.generations.get(params.appCacheKey) ?? 0) && clearGeneration === this.clearGeneration && response.marketplaceLoadErrors.length === 0 && (params.cacheable?.(response) ?? true)) this.entries.set(entryKey, {
|
|
806
|
-
snapshot,
|
|
807
|
-
expiresAtMs: this.nowMs() + CODEX_PLUGIN_METADATA_CACHE_TTL_MS
|
|
808
|
-
});
|
|
809
|
-
return snapshot;
|
|
810
|
-
})();
|
|
811
|
-
this.inFlight.set(entryKey, {
|
|
812
|
-
appCacheKey: params.appCacheKey,
|
|
813
|
-
promise
|
|
814
|
-
});
|
|
815
|
-
try {
|
|
816
|
-
return await promise;
|
|
817
|
-
} finally {
|
|
818
|
-
if (this.inFlight.get(entryKey)?.promise === promise) this.inFlight.delete(entryKey);
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
invalidate(appCacheKey) {
|
|
822
|
-
this.generations.set(appCacheKey, (this.generations.get(appCacheKey) ?? 0) + 1);
|
|
823
|
-
for (const [entryKey, entry] of this.entries) if (entry.snapshot.appCacheKey === appCacheKey) this.entries.delete(entryKey);
|
|
824
|
-
for (const [entryKey, pending] of this.inFlight) if (pending.appCacheKey === appCacheKey) this.inFlight.delete(entryKey);
|
|
825
|
-
}
|
|
826
|
-
/** Clears snapshots and prevents late in-flight loads from repopulating them. */
|
|
827
|
-
clear() {
|
|
828
|
-
this.clearGeneration += 1;
|
|
829
|
-
this.generations.clear();
|
|
830
|
-
this.entries.clear();
|
|
831
|
-
this.inFlight.clear();
|
|
832
|
-
}
|
|
833
|
-
};
|
|
834
|
-
const defaultCodexPluginMetadataCache = new CodexPluginMetadataCache();
|
|
835
|
-
function buildMetadataCacheEntryKey(appCacheKey, queryKind, requestParams, catalogScope) {
|
|
836
|
-
if (queryKind !== "installed") {
|
|
837
|
-
const listParams = requestParams;
|
|
838
|
-
const entry = [
|
|
839
|
-
appCacheKey,
|
|
840
|
-
queryKind,
|
|
841
|
-
listParams?.cwds ?? [],
|
|
842
|
-
Array.from(new Set(listParams?.marketplaceKinds ?? [])).toSorted(),
|
|
843
|
-
...catalogScope ? [catalogScope] : []
|
|
844
|
-
];
|
|
845
|
-
return JSON.stringify(entry);
|
|
846
|
-
}
|
|
847
|
-
const installedParams = requestParams;
|
|
848
|
-
return JSON.stringify([
|
|
849
|
-
appCacheKey,
|
|
850
|
-
queryKind,
|
|
851
|
-
installedParams?.cwds ?? [],
|
|
852
|
-
Array.from(new Set(installedParams?.installSuggestionPluginNames ?? [])).toSorted()
|
|
853
|
-
]);
|
|
854
|
-
}
|
|
855
|
-
//#endregion
|
|
856
|
-
export { createComputerUseRequest as a, readCodexComputerUseStatus as i, ensureCodexComputerUse as n, runCodexComputerUseLiveTest as o, installCodexComputerUse as r, defaultCodexPluginMetadataCache as t };
|
|
719
|
+
export { runCodexComputerUseLiveTest as a, createComputerUseRequest as i, installCodexComputerUse as n, readCodexComputerUseStatus as r, ensureCodexComputerUse as t };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./config-
|
|
3
|
-
import "./config-parsing-b088LyhT.mjs";
|
|
1
|
+
import "./config-security-KAPScztc.mjs";
|
|
2
|
+
import { _ as readExecSecurity, b as readRecord, g as readExecAsk } from "./config-parsing-BQq-CHTF.mjs";
|
|
4
3
|
import "./auth-start-options-BPIPeEX8.mjs";
|
|
5
|
-
import { c as canUseCodexModelBackedApprovalsReviewerForModel$1 } from "./config-options-
|
|
6
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
7
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
4
|
+
import { c as canUseCodexModelBackedApprovalsReviewerForModel$1 } from "./config-options-HG_Rr3W_.mjs";
|
|
5
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
|
|
6
|
+
import { t as __exportAll } from "./session-binding-sidecars-BrdV95Fg.mjs";
|
|
8
7
|
import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
9
8
|
import { execPolicy } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
10
9
|
import { resolveExecApprovalsFromFile } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as readNumberEnv, i as normalizeHeaders, l as readRecord, r as normalizeCodexServiceTier, s as readNonEmptyString, t as hashSecretForKey, u as resolveArgs } from "./config-utils-D0CXecki.mjs";
|
|
2
1
|
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
2
|
+
import { t as normalizeCodexServiceTier } from "./service-tier-normalization-Cei89SW6.mjs";
|
|
3
|
+
import { C as selectForcedPromptingSandbox, S as selectForcedDangerFullAccessSandbox, _ as resolveApprovalPolicy, a as resolveDefaultCodexAppServerPolicy, b as resolveEffectiveOpenClawExecModeForCodexAppServer, d as parseCodexRequirementsPolicy, f as readCodexRequirementsToml, g as assertCodexAppServerAllowedForOpenClawExecMode, i as resolveCodexAppServerNetworkProxy, o as resolvePolicyMode, r as inferCodexAppServerConnectionClass, s as resolveTransport, t as assertCodexAppServerConnectionSecurity, v as resolveApprovalsReviewer, x as resolveSandbox, y as resolveCodexPolicyModeForOpenClawExecMode } from "./config-security-KAPScztc.mjs";
|
|
4
|
+
import { a as DEFAULT_CODEX_COMPUTER_USE_PLUGIN_NAME, b as readRecord, d as readCodexPluginConfig, h as normalizeHeaders, n as DEFAULT_CODEX_COMPUTER_USE_LIVE_TEST_TIMEOUT_MS, o as DEFAULT_CODEX_COMPUTER_USE_TOOL_CALL_TIMEOUT_MS, p as hashSecretForKey, r as DEFAULT_CODEX_COMPUTER_USE_MARKETPLACE_DISCOVERY_TIMEOUT_MS, s as assertCodexAppServerCommandHasNoInlineArgs, v as readNonEmptyString, x as resolveArgs, y as readNumberEnv } from "./config-parsing-BQq-CHTF.mjs";
|
|
5
5
|
import { i as readCodexAppServerConfigOptions } from "./launch-args-DbFCehO7.mjs";
|
|
6
6
|
import { r as resolveCodexAppServerUserHomeDir, t as resolveCodexAppServerHomeDir } from "./auth-start-options-BPIPeEX8.mjs";
|
|
7
7
|
import { normalizeTrimmedStringList, parseBooleanValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
-
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
9
8
|
import { resolvePositiveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
9
|
+
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
10
10
|
import { parse } from "smol-toml";
|
|
11
11
|
import { readFileSync } from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
@@ -46,10 +46,10 @@ function isTrustedCodexReviewerConfig(config) {
|
|
|
46
46
|
const providerRecords = providers == null ? void 0 : readRecord(providers);
|
|
47
47
|
const provider = providerRecords?.openai;
|
|
48
48
|
const openAIProvider = provider == null ? void 0 : readRecord(provider);
|
|
49
|
-
return (modelProvider == null || modelProvider === "openai") && (providers == null || providerRecords !== void 0) && (provider == null || openAIProvider !== void 0) && isTrustedOptionalReviewerEndpoint(config.openai_base_url,
|
|
49
|
+
return (modelProvider == null || modelProvider === "openai") && (providers == null || providerRecords !== void 0) && (provider == null || openAIProvider !== void 0) && isTrustedOptionalReviewerEndpoint(config.openai_base_url, "api.openai.com") && isTrustedOptionalReviewerEndpoint(config.chatgpt_base_url, "chatgpt.com") && isTrustedOptionalReviewerEndpoint(openAIProvider?.base_url, "api.openai.com");
|
|
50
50
|
}
|
|
51
|
-
function isTrustedOptionalReviewerEndpoint(value,
|
|
52
|
-
return value == null || typeof value === "string" &&
|
|
51
|
+
function isTrustedOptionalReviewerEndpoint(value, hostname) {
|
|
52
|
+
return value == null || typeof value === "string" && isNativeReviewerBaseUrl(value, hostname);
|
|
53
53
|
}
|
|
54
54
|
function canUseCodexModelBackedApprovalsReviewerForModel(params, resolveAuthProviderId) {
|
|
55
55
|
const explicitProvider = params.modelProvider?.trim().toLowerCase();
|
|
@@ -211,22 +211,12 @@ function hasNonEmptyRecord(value) {
|
|
|
211
211
|
return record !== void 0 && Object.keys(record).length > 0;
|
|
212
212
|
}
|
|
213
213
|
function isNativeOpenAIBaseUrl(value) {
|
|
214
|
-
|
|
215
|
-
try {
|
|
216
|
-
const url = new URL(value);
|
|
217
|
-
return url.protocol === "https:" && url.hostname.toLowerCase() === "api.openai.com";
|
|
218
|
-
} catch {
|
|
219
|
-
return false;
|
|
220
|
-
}
|
|
214
|
+
return isNativeReviewerBaseUrl(value, "api.openai.com");
|
|
221
215
|
}
|
|
222
|
-
function
|
|
216
|
+
function isNativeReviewerBaseUrl(value, hostname) {
|
|
223
217
|
if (typeof value !== "string" || !value.trim()) return true;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
return url.protocol === "https:" && url.hostname.toLowerCase() === "chatgpt.com";
|
|
227
|
-
} catch {
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
218
|
+
const url = URL.parse(value);
|
|
219
|
+
return url?.protocol === "https:" && url.hostname.toLowerCase() === hostname;
|
|
230
220
|
}
|
|
231
221
|
function normalizeCodexModelBackedReviewerPolicyProvider(provider) {
|
|
232
222
|
return provider.toLowerCase() === "openai" ? "openai" : provider;
|
|
@@ -311,7 +301,7 @@ function createCodexAppServerConfig({ resolveProviderIdForAuth }) {
|
|
|
311
301
|
readRequirementsFile: params.readRequirementsFile,
|
|
312
302
|
platform: params.platform
|
|
313
303
|
}) ?? null : params.requirementsToml;
|
|
314
|
-
if (forcePerCommandApprovals && requirementsToml &&
|
|
304
|
+
if (forcePerCommandApprovals && requirementsToml && parseCodexRequirementsPolicy(requirementsToml).allowedApprovalPolicies?.has("untrusted") === false) throw new Error("tools.exec.ask=always requires Codex app-server per-command approvals");
|
|
315
305
|
const forceRuntimePolicy = forceUserReviewer || forceGuardianReviewer || forceDangerFullAccessSandbox;
|
|
316
306
|
const defaultPolicy = explicitPolicyMode && !forceRuntimePolicy && !ignoreLegacyYoloPolicyMode ? void 0 : resolveDefaultCodexAppServerPolicy({
|
|
317
307
|
transport,
|
|
@@ -392,7 +382,7 @@ function createCodexAppServerConfig({ resolveProviderIdForAuth }) {
|
|
|
392
382
|
sandbox: resolvedSandbox,
|
|
393
383
|
approvalsReviewer: forcedPolicy?.approvalsReviewer ?? explicitApprovalsReviewer ?? defaultPolicy?.approvalsReviewer ?? (policyMode === "guardian" ? "auto_review" : "user"),
|
|
394
384
|
...serviceTier ? { serviceTier } : {},
|
|
395
|
-
enableUltrafast: config.enableUltrafast
|
|
385
|
+
enableUltrafast: config.enableUltrafast !== false,
|
|
396
386
|
...resolveCodexAppServerNetworkProxy(config.networkProxy, resolvedSandbox)
|
|
397
387
|
};
|
|
398
388
|
}
|
|
@@ -1,8 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { asNullableRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
1
|
+
import { n as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN, t as normalizeCodexServiceTier } from "./service-tier-normalization-Cei89SW6.mjs";
|
|
2
|
+
import { asNullableRecord, asOptionalRecord as readRecord, normalizeOptionalString as readNonEmptyString, normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
import { createHmac, randomBytes } from "node:crypto";
|
|
3
4
|
import { z } from "zod";
|
|
4
|
-
import { buildSecretInputSchema } from "openclaw/plugin-sdk/secret-input";
|
|
5
|
+
import { buildSecretInputSchema, normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
5
6
|
import { detectWindowsSpawnCommandInlineArgs } from "openclaw/plugin-sdk/windows-spawn";
|
|
7
|
+
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
8
|
+
import { splitCommandArgs } from "openclaw/plugin-sdk/process-runtime";
|
|
9
|
+
//#region extensions/codex/src/app-server/config-utils.ts
|
|
10
|
+
const START_OPTIONS_KEY_SECRET = resolveGlobalSingleton(Symbol.for("openclaw.codexAppServerStartOptionsKeySecret"), () => randomBytes(32));
|
|
11
|
+
const PLAIN_DECIMAL_NUMBER_RE = /^[+-]?(?:(?:\d+\.?\d*)|(?:\.\d+))$/;
|
|
12
|
+
function isCodexFastServiceTier(value) {
|
|
13
|
+
return normalizeCodexServiceTier(value) === "priority";
|
|
14
|
+
}
|
|
15
|
+
function normalizeHeaders(value) {
|
|
16
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
17
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key.trim(), normalizeResolvedSecretInputString({
|
|
18
|
+
value: child,
|
|
19
|
+
path: `plugins.entries.codex.config.appServer.headers.${key}`
|
|
20
|
+
})]).filter((entry) => Boolean(entry[0] && entry[1])));
|
|
21
|
+
}
|
|
22
|
+
function readExecSecurity(value) {
|
|
23
|
+
return value === "deny" || value === "allowlist" || value === "full" ? value : void 0;
|
|
24
|
+
}
|
|
25
|
+
function readExecAsk(value) {
|
|
26
|
+
return value === "off" || value === "on-miss" || value === "always" ? value : void 0;
|
|
27
|
+
}
|
|
28
|
+
function readNumberEnv(value) {
|
|
29
|
+
const trimmed = value?.trim();
|
|
30
|
+
if (!trimmed || !PLAIN_DECIMAL_NUMBER_RE.test(trimmed)) return;
|
|
31
|
+
const parsed = Number(trimmed);
|
|
32
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
33
|
+
}
|
|
34
|
+
function resolveArgs(configArgs, envArgs) {
|
|
35
|
+
if (Array.isArray(configArgs)) return normalizeTrimmedStringList(configArgs);
|
|
36
|
+
return splitCommandArgs(typeof configArgs === "string" ? configArgs : envArgs ?? "", { allowUnclosedQuotes: true });
|
|
37
|
+
}
|
|
38
|
+
function hashSecretForKey(value, label) {
|
|
39
|
+
if (!value) return null;
|
|
40
|
+
return createHmac("sha256", START_OPTIONS_KEY_SECRET).update(label).update("\0").update(value).digest("hex");
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
6
43
|
//#region extensions/codex/src/app-server/session-discovery-config.ts
|
|
7
44
|
const codexSessionCatalogHomeSchema = z.union([z.string().trim().min(1), z.object({
|
|
8
45
|
path: z.string().trim().min(1),
|
|
@@ -227,4 +264,4 @@ function resolveCodexPluginDestructivePolicy(policy) {
|
|
|
227
264
|
};
|
|
228
265
|
}
|
|
229
266
|
//#endregion
|
|
230
|
-
export { DEFAULT_CODEX_COMPUTER_USE_PLUGIN_NAME as a, isCodexPairedNodeRemoteExecPlacementSandbox as c, readCodexPluginConfig as d, resolveCodexPluginsPolicy as f, DEFAULT_CODEX_COMPUTER_USE_MCP_SERVER_NAME as i, isCodexRemoteExecPlacementSandbox as l, DEFAULT_CODEX_COMPUTER_USE_LIVE_TEST_TIMEOUT_MS as n, DEFAULT_CODEX_COMPUTER_USE_TOOL_CALL_TIMEOUT_MS as o, DEFAULT_CODEX_COMPUTER_USE_MARKETPLACE_DISCOVERY_TIMEOUT_MS as r, assertCodexAppServerCommandHasNoInlineArgs as s, DEFAULT_CODEX_APP_SERVER_NETWORK_PROXY_PROFILE_PREFIX as t, isCodexSandboxExecServerEnabled as u };
|
|
267
|
+
export { readExecSecurity as _, DEFAULT_CODEX_COMPUTER_USE_PLUGIN_NAME as a, readRecord as b, isCodexPairedNodeRemoteExecPlacementSandbox as c, readCodexPluginConfig as d, resolveCodexPluginsPolicy as f, readExecAsk as g, normalizeHeaders as h, DEFAULT_CODEX_COMPUTER_USE_MCP_SERVER_NAME as i, isCodexRemoteExecPlacementSandbox as l, isCodexFastServiceTier as m, DEFAULT_CODEX_COMPUTER_USE_LIVE_TEST_TIMEOUT_MS as n, DEFAULT_CODEX_COMPUTER_USE_TOOL_CALL_TIMEOUT_MS as o, hashSecretForKey as p, DEFAULT_CODEX_COMPUTER_USE_MARKETPLACE_DISCOVERY_TIMEOUT_MS as r, assertCodexAppServerCommandHasNoInlineArgs as s, DEFAULT_CODEX_APP_SERVER_NETWORK_PROXY_PROFILE_PREFIX as t, isCodexSandboxExecServerEnabled as u, readNonEmptyString as v, resolveArgs as x, readNumberEnv as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as createCodexAppServerConfig } from "./config-options-
|
|
2
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
1
|
+
import { r as createCodexAppServerConfig } from "./config-options-HG_Rr3W_.mjs";
|
|
2
|
+
import { t as __exportAll } from "./session-binding-sidecars-BrdV95Fg.mjs";
|
|
3
3
|
import { resolveProviderIdForAuth } from "openclaw/plugin-sdk/provider-auth-aliases";
|
|
4
4
|
//#region extensions/codex/src/app-server/config-runtime.ts
|
|
5
5
|
var config_runtime_exports = /* @__PURE__ */ __exportAll({
|