@openclaw/codex 2026.9.4 → 2026.9.6
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-Eem_WGqY.mjs +75 -0
- package/dist/{apply-CvT8tW5i.js → .setup/apply-DDOi8uNx.mjs} +24 -30
- package/dist/.setup/async-questions-DdhOCwGi.mjs +27 -0
- package/dist/{attempt-client-cleanup-DKHzbwt5.js → .setup/attempt-client-cleanup-CEv1cKwF.mjs} +79 -49
- package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +5 -0
- package/dist/.setup/attempt-workspace-context-DUVEn_CS.mjs +331 -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-B2mpaI9D.mjs} +9 -81
- package/dist/{auth-profile-CwzO4_RG.js → .setup/auth-profile-WqZtZfXN.mjs} +1 -1
- package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
- package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
- package/dist/.setup/binding-connection-ThoatDcb.mjs +50 -0
- package/dist/.setup/binding-connection.runtime-yoHrABt-.mjs +48 -0
- package/dist/{bounded-turn-C_Hneydj.js → .setup/bounded-turn-B2HScEgT.mjs} +143 -32
- package/dist/{build-state-BCmg9-5p.js → .setup/build-state-C7EnDVgr.mjs} +1 -1
- package/dist/{capabilities-8vx68WLH.js → .setup/capabilities-CDXOOFdZ.mjs} +1 -1
- package/dist/{client-B57KWPQx.js → .setup/client-Cs08OXVQ.mjs} +705 -512
- package/dist/.setup/client-catalog-response-BMgt_4q4.mjs +285 -0
- package/dist/{command-dispatch-BpduNGVf.js → .setup/command-dispatch-B4JuOsOk.mjs} +8 -4
- package/dist/{command-formatters-lxlkNZgU.js → .setup/command-formatters-Bmqvr9tO.mjs} +8 -4
- package/dist/{command-handlers-tiL9iWj7.js → .setup/command-handlers-DW7Lx9oH.mjs} +137 -186
- package/dist/{command-rpc-CR5EOEZX.js → .setup/command-rpc-DixIj3HW.mjs} +47 -23
- package/dist/{compact-B_H3AOd7.js → .setup/compact-Du5UvtxA.mjs} +29 -51
- package/dist/{config-oIORaQ5T.js → .setup/config-BoTP_mrL.mjs} +5 -4
- package/dist/{config-options-CXMq1T-C.js → .setup/config-options-BvaRs51b.mjs} +50 -446
- package/dist/{protocol-5bh1G-H7.js → .setup/config-parsing-CcB9iPoq.mjs} +9 -51
- package/dist/{config-runtime-D0zGNIHu.js → .setup/config-runtime-C8Rw1m1m.mjs} +2 -2
- package/dist/.setup/config-security-BEReZ6go.mjs +380 -0
- package/dist/{conversation-binding-DsB4-O7U.js → .setup/conversation-binding-DP-gMrBP.mjs} +29 -38
- package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs} +1 -1
- package/dist/{conversation-control-CtUu1b3m.js → .setup/conversation-control-uK9Jomlc.mjs} +32 -67
- 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-BDXl-8Cw.mjs} +936 -620
- package/dist/{effective-mcp-catalog-Bd73bqA8.js → .setup/effective-mcp-catalog-CvnvnGIe.mjs} +3 -3
- package/dist/{ephemeral-turn-D78_VmzO.js → .setup/ephemeral-turn-poidXgek.mjs} +9 -7
- package/dist/{event-projector-assistant-message-BmBM4qBV.js → .setup/event-projector-assistant-message-BsruvNrH.mjs} +8 -7
- package/dist/{event-projector-items-5VhsECCO.js → .setup/event-projector-items-C6L_5ZiT.mjs} +42 -8
- package/dist/{attempt-notifications-C9XufG6l.js → .setup/event-projector-usage-CnBS8Wa3.mjs} +102 -9
- package/dist/{harness-C7rRa7bm.js → .setup/harness-a_MsE4-_.mjs} +81 -21
- package/dist/{inference-context-Dr_mzvk4.js → .setup/inference-context-D96l9-ew.mjs} +1 -1
- package/dist/.setup/inference-proxy-b-aJMSxm.mjs +601 -0
- package/dist/{isolated-completion-DWVb5U2J.js → .setup/isolated-completion-BIZFhTNG.mjs} +18 -11
- package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
- package/dist/{managed-binary-D22rNEcR.js → .setup/managed-binary-BnshlFag.mjs} +14 -3
- 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-CfXJf9Ay.mjs} +36 -12
- package/dist/{models-PCKOim-h.js → .setup/models-KnqBv0hE.mjs} +3 -3
- package/dist/.setup/native-auth-rWbGbMn3.mjs +57 -0
- package/dist/{native-subagent-history-DjtPloaU.js → .setup/native-subagent-history-0nYYgo0k.mjs} +43 -35
- package/dist/.setup/native-subagent-monitor-D3filLY2.mjs +4859 -0
- package/dist/{native-subagent-task-ids-BzTdT0Uw.js → .setup/native-subagent-task-ids-wb8CKZGN.mjs} +98 -44
- package/dist/{node-cli-sessions-DKaOmVUh.js → .setup/node-cli-sessions-r3avj02l.mjs} +86 -68
- package/dist/.setup/node-exec-server.runtime-BDwWXVpK.mjs +247 -0
- package/dist/{plan-7uG-Fp36.js → .setup/plan-CN3VwfNU.mjs} +133 -119
- package/dist/{plugin-activation-BYQculil.js → .setup/plugin-activation-DT3MNtqj.mjs} +7 -16
- package/dist/{plugin-app-cache-key-d0eKxy7b.js → .setup/plugin-app-cache-key-B2CsSdnV.mjs} +32 -44
- package/dist/{plugin-approval-roundtrip-Bz3FT8W5.js → .setup/plugin-approval-roundtrip-C0MZzCuP.mjs} +1 -1
- package/dist/{plugin-inventory-oL4Na1ZG.js → .setup/plugin-inventory-BoRei8Z4.mjs} +21 -11
- package/dist/{plugin-marketplace-discovery-P-Vndfqq.js → .setup/plugin-marketplace-discovery-CDOi8IFs.mjs} +4 -1
- package/dist/{plugin-metadata-cache-ClPJpRio.js → .setup/plugin-metadata-cache-Ctmo83k_.mjs} +226 -141
- package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
- package/dist/{provider-MQ8PVkuE.js → .setup/provider-BOsxQHOM.mjs} +9 -5
- package/dist/{provider-capabilities-BvCUL69A.js → .setup/provider-capabilities-BfE88FZ5.mjs} +31 -3
- package/dist/{rate-limits-CBMmWBr9.js → .setup/rate-limits-CMU3DUD0.mjs} +174 -151
- package/dist/{request-B7hEkBGq.js → .setup/request-D2L0zMrq.mjs} +130 -42
- package/dist/{run-attempt-CvsAAGa0.js → .setup/run-attempt-BHu11r7h.mjs} +1628 -966
- package/dist/.setup/run-attempt-lifecycle-B7JbY4-F.mjs +71 -0
- package/dist/{runtime-artifact-BJ0rXBZ_.js → .setup/runtime-artifact-CLZ8udh-.mjs} +29 -45
- package/dist/{sandbox-guard-BxgyoM8M.js → .setup/sandbox-guard-C2sRMOEY.mjs} +3 -3
- package/dist/{session-binding-CI8UuilT.js → .setup/session-binding-Cm0apEbd.mjs} +36 -83
- package/dist/{session-binding-record-Bcvslnhf.js → .setup/session-binding-record-BGoz8wOK.mjs} +202 -5
- package/dist/.setup/session-binding-sidecars-BlB5EvIS.mjs +546 -0
- package/dist/.setup/session-catalog-Pno1xGcl.mjs +2764 -0
- package/dist/{session-catalog-adoption-tcZi1IfX.js → .setup/session-catalog-adoption-BI6UTDZT.mjs} +58 -26
- package/dist/{session-catalog-archive-CwKg8Xz2.js → .setup/session-catalog-archive-lHBqzhaO.mjs} +6 -6
- package/dist/.setup/session-catalog-events-Bj6j94E_.mjs +347 -0
- package/dist/.setup/session-catalog-index-B9_VQIUz.mjs +1170 -0
- package/dist/.setup/session-catalog-index-order-hcdz07yN.mjs +48 -0
- package/dist/.setup/session-catalog-index-state-Dgh8ORJm.mjs +183 -0
- package/dist/{thread-history-page-D0JIp48V.js → .setup/session-catalog-native-projection-DowriLid.mjs} +223 -95
- package/dist/{session-catalog-node-adoption-B1tgDW-m.js → .setup/session-catalog-node-adoption-ITddWx_X.mjs} +25 -13
- package/dist/{session-catalog-node-continue-Ci-DXyJP.js → .setup/session-catalog-node-continue-6g6qi4A9.mjs} +24 -15
- package/dist/.setup/session-catalog-projection-zK_PUsiE.mjs +422 -0
- package/dist/{session-cli-DNN_jhGc.js → .setup/session-cli-irrD-uo7.mjs} +3 -3
- package/dist/{session-history-Cz-tOOYj.js → .setup/session-history-BrqhSCf9.mjs} +19 -19
- package/dist/{session-history-import-DwyijFI6.js → .setup/session-history-import-D-3wAgOP.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-CaCh0xF_.mjs} +10 -24
- package/dist/{session-initialization-Ct0_Hzmg.js → .setup/session-initialization-rcgbZiid.mjs} +2 -2
- package/dist/{session-permission-policy-BBmXA8Eg.js → .setup/session-permission-policy-BI1QK_98.mjs} +2 -2
- package/dist/{session-retirement-B2YfbAAT.js → .setup/session-retirement-BH-S6qkJ.mjs} +26 -7
- 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-DiAi6Kx6.mjs} +12 -12
- package/dist/{shared-client-CscigXXL.js → .setup/shared-client-DA4VR4Eb.mjs} +332 -221
- package/dist/{side-question-BGMJQf4U.js → .setup/side-question-BJ1wSDcB.mjs} +183 -230
- package/dist/{source-CElXU0Oy.js → .setup/source-CUzJq5WN.mjs} +11 -10
- package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
- package/dist/{thread-archive-guard-DfpBr-Sz.js → .setup/thread-archive-guard-C9frICzX.mjs} +10 -3
- package/dist/.setup/thread-history-page-DoVpnHim.mjs +83 -0
- package/dist/{thread-lifecycle-DXl1-I6b.js → .setup/thread-lifecycle-B3mfz1TG.mjs} +347 -2318
- package/dist/{thread-ownership-BsDRTsyp.js → .setup/thread-ownership-DcTtAcXj.mjs} +6 -4
- package/dist/{thread-policy-BuEQfE0g.js → .setup/thread-policy-DGuQsuFC.mjs} +19 -3
- package/dist/.setup/thread-requests-BLvGkP2R.mjs +2205 -0
- package/dist/{thread-resume-DsDOZpFg.js → .setup/thread-resume-DIBXwOpE.mjs} +8 -5
- package/dist/.setup/timeout-C910MdAB.mjs +80 -0
- package/dist/{transcript-history-projection-v17wXgdK.js → .setup/transcript-history-projection-ZZpkFkJ_.mjs} +96 -61
- package/dist/{transcript-mirror-C5CKgNy6.js → .setup/transcript-mirror-BtHDBp1G.mjs} +224 -195
- 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-h2VHOskC.mjs} +274 -89
- package/dist/{upstream-session-fork-BZerMte_.js → .setup/upstream-session-fork-BUr4OUbC.mjs} +51 -42
- package/dist/{usage-tCk-mg_x.js → .setup/usage-BML0r-ua.mjs} +5 -4
- package/dist/.setup/usage-limit-error-DUMbefVY.mjs +166 -0
- package/dist/{web-search-provider.runtime-B7bGbGWq.js → .setup/web-search-provider.runtime-CDKlN-Rv.mjs} +4 -3
- package/dist/api.js +23 -12
- 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 +8 -528
- package/dist/harness.js +1 -1
- package/dist/index.js +306 -215
- 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 +36 -35
- 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 +14 -8
- package/dist/attempt-context-D44yeDII.js +0 -636
- package/dist/binding-connection-D3udKbIE.js +0 -60
- package/dist/event-projector-usage-BfXmpOec.js +0 -102
- package/dist/inference-proxy-HGXKUIre.js +0 -311
- package/dist/launch-args-RXQwn8zV.js +0 -90
- package/dist/native-subagent-history-owner-Pcp7JuVF.js +0 -34
- package/dist/native-subagent-monitor-fQ7eIXEf.js +0 -2978
- package/dist/node-exec-server.runtime-Cl2vapEi.js +0 -226
- 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/version-omm6IPI3.js +0 -12
- /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-umd0tgh4.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
package/dist/{plugin-metadata-cache-ClPJpRio.js → .setup/plugin-metadata-cache-Ctmo83k_.mjs}
RENAMED
|
@@ -1,15 +1,167 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import "./config-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { d as resolveCodexAppServerHomeDir } from "./config-security-BEReZ6go.mjs";
|
|
2
|
+
import { o as resolveCodexComputerUseConfig } from "./config-options-BvaRs51b.mjs";
|
|
3
|
+
import { d as resolveMacOSDesktopCodexBundledMarketplaceCandidates, l as resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath, t as isManagedCodexDesktopCommand } from "./managed-binary-BnshlFag.mjs";
|
|
4
|
+
import { n as describeControlFailure } from "./capabilities-CDXOOFdZ.mjs";
|
|
5
|
+
import { r as requestCodexAppServerClientJson } from "./request-D2L0zMrq.mjs";
|
|
6
|
+
import "./config-BoTP_mrL.mjs";
|
|
7
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C8Rw1m1m.mjs";
|
|
8
|
+
import { $ as assertNotSymlink, D as acquireCodexNativeConfigFence, Q as resolveCodexManagedBundledMarketplacePath, Y as reconcileCodexComputerUseStartArtifacts, b as waitForCodexAppServerClientDesktopGenerationDrain, c as getLeasedSharedCodexAppServerClient, d as readCodexAppServerClientDesktopGeneration, g as resolveCodexNativeConfigFenceKey, h as releaseLeasedSharedCodexAppServerClient, p as readCodexAppServerClientProcessIdentity, t as assertCodexAppServerClientStartSelectionCurrent, u as isCodexAppServerStartSelectionChangedError, x as withLeasedCodexAppServerClientStartSelectionRetry } from "./shared-client-DA4VR4Eb.mjs";
|
|
9
|
+
import { c as isCodexAppServerIndeterminateTransportError, o as isCodexAppServerConnectionClosedError, s as isCodexAppServerIndeterminateRequestCancellationError } from "./client-Cs08OXVQ.mjs";
|
|
10
|
+
import { r as CodexAppServerUnsafeSubscriptionError, u as retireUnsafeCodexTurnClientBestEffort } from "./attempt-client-cleanup-CEv1cKwF.mjs";
|
|
10
11
|
import { existsSync } from "node:fs";
|
|
11
12
|
import path from "node:path";
|
|
12
13
|
import fs$1 from "node:fs/promises";
|
|
14
|
+
import { toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
15
|
+
//#region extensions/codex/src/app-server/computer-use-readiness.ts
|
|
16
|
+
/** Computer Use readiness probes and their native subscription lifecycle. */
|
|
17
|
+
function createComputerUseRequest(params) {
|
|
18
|
+
const assertCurrent = params.assertCurrent;
|
|
19
|
+
if (params.request) {
|
|
20
|
+
const request = params.request;
|
|
21
|
+
if (!assertCurrent) return request;
|
|
22
|
+
return async (method, requestParams, options) => {
|
|
23
|
+
if (method !== "thread/unsubscribe") assertCurrent();
|
|
24
|
+
return await request(method, requestParams, options);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const client = params.client;
|
|
28
|
+
if (!client) throw new Error("Computer Use setup requires an acquired app-server client");
|
|
29
|
+
return async (method, requestParams, options) => await client.request(method, requestParams, {
|
|
30
|
+
timeoutMs: options?.timeoutMs ?? params.timeoutMs,
|
|
31
|
+
signal: options?.signal ?? params.signal,
|
|
32
|
+
...method === "thread/unsubscribe" ? {} : { assertCurrent }
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const COMPUTER_USE_LIVE_TEST_RETRY_COUNT = 1;
|
|
36
|
+
const COMPUTER_USE_LIVE_TEST_THREAD_NAME = "OpenClaw Computer Use readiness probe";
|
|
37
|
+
const COMPUTER_USE_LIST_APPS_TOOL = "list_apps";
|
|
38
|
+
const COMPUTER_USE_UNIFIED_JS_TOOL = "js";
|
|
39
|
+
const COMPUTER_USE_UNIFIED_JS_PROBE = "await cua.getState();";
|
|
40
|
+
async function runCodexComputerUseLiveTest(params) {
|
|
41
|
+
const startedAt = Date.now();
|
|
42
|
+
let lastError;
|
|
43
|
+
let repair;
|
|
44
|
+
const probe = resolveComputerUseLiveTestProbe(params.tools);
|
|
45
|
+
for (let attempt = 0; attempt <= COMPUTER_USE_LIVE_TEST_RETRY_COUNT; attempt += 1) {
|
|
46
|
+
let threadId;
|
|
47
|
+
let outcome;
|
|
48
|
+
try {
|
|
49
|
+
threadId = (await params.request("thread/start", {
|
|
50
|
+
input: [],
|
|
51
|
+
developerInstructions: COMPUTER_USE_LIVE_TEST_THREAD_NAME,
|
|
52
|
+
ephemeral: true
|
|
53
|
+
}, { timeoutMs: params.config.liveTestTimeoutMs })).thread.id;
|
|
54
|
+
if ((await params.request("mcpServer/tool/call", {
|
|
55
|
+
threadId,
|
|
56
|
+
server: params.config.mcpServerName,
|
|
57
|
+
tool: probe.tool,
|
|
58
|
+
arguments: probe.arguments
|
|
59
|
+
}, { timeoutMs: params.config.toolCallTimeoutMs })).isError === true) throw new Error(`Computer Use readiness tool ${params.config.mcpServerName}.${probe.tool} returned an error result`);
|
|
60
|
+
outcome = {
|
|
61
|
+
ok: true,
|
|
62
|
+
liveTest: {
|
|
63
|
+
status: "passed",
|
|
64
|
+
ok: true,
|
|
65
|
+
attempted: true,
|
|
66
|
+
attempts: attempt + 1,
|
|
67
|
+
timeoutMs: params.config.liveTestTimeoutMs,
|
|
68
|
+
retried: attempt > 0,
|
|
69
|
+
repaired: Boolean(repair?.attempted && repair.warnings.length === 0),
|
|
70
|
+
durationMs: Math.max(0, Date.now() - startedAt),
|
|
71
|
+
message: "Computer Use live test passed."
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
} catch (error) {
|
|
75
|
+
outcome = {
|
|
76
|
+
ok: false,
|
|
77
|
+
error
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
let cleanupError;
|
|
81
|
+
if (threadId) try {
|
|
82
|
+
await cleanupComputerUseProbeThread(params, threadId);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
cleanupError = toErrorObject(error, "Computer Use readiness cleanup failed");
|
|
85
|
+
}
|
|
86
|
+
if (!outcome.ok && (params.signal?.aborted || isCodexAppServerStartSelectionChangedError(outcome.error))) throw toErrorObject(outcome.error, "Computer Use live test failed");
|
|
87
|
+
if (cleanupError) throw cleanupError;
|
|
88
|
+
if (outcome.ok) return {
|
|
89
|
+
liveTest: outcome.liveTest,
|
|
90
|
+
...repair ? { repair } : {}
|
|
91
|
+
};
|
|
92
|
+
lastError = outcome.error;
|
|
93
|
+
if (attempt < COMPUTER_USE_LIVE_TEST_RETRY_COUNT && params.config.autoRepair) repair = await repairComputerUseMcpRuntime(params.request, params.config);
|
|
94
|
+
}
|
|
95
|
+
const errorMessage = describeControlFailure(lastError);
|
|
96
|
+
return {
|
|
97
|
+
liveTest: {
|
|
98
|
+
status: "failed",
|
|
99
|
+
ok: false,
|
|
100
|
+
attempted: true,
|
|
101
|
+
attempts: 2,
|
|
102
|
+
timeoutMs: params.config.liveTestTimeoutMs,
|
|
103
|
+
retried: true,
|
|
104
|
+
repaired: Boolean(repair?.attempted && repair.warnings.length === 0),
|
|
105
|
+
durationMs: Math.max(0, Date.now() - startedAt),
|
|
106
|
+
message: `Computer Use live test failed after 2 attempts: ${errorMessage}`,
|
|
107
|
+
error: errorMessage
|
|
108
|
+
},
|
|
109
|
+
...repair ? { repair } : {}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function resolveComputerUseLiveTestProbe(tools) {
|
|
113
|
+
if (tools?.includes(COMPUTER_USE_UNIFIED_JS_TOOL) && !tools.includes(COMPUTER_USE_LIST_APPS_TOOL)) return {
|
|
114
|
+
tool: COMPUTER_USE_UNIFIED_JS_TOOL,
|
|
115
|
+
arguments: { code: COMPUTER_USE_UNIFIED_JS_PROBE }
|
|
116
|
+
};
|
|
117
|
+
return {
|
|
118
|
+
tool: COMPUTER_USE_LIST_APPS_TOOL,
|
|
119
|
+
arguments: {}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
async function repairComputerUseMcpRuntime(request, config) {
|
|
123
|
+
try {
|
|
124
|
+
await request("config/mcpServer/reload", void 0, { timeoutMs: config.liveTestTimeoutMs });
|
|
125
|
+
return {
|
|
126
|
+
attempted: true,
|
|
127
|
+
killedPids: [],
|
|
128
|
+
warnings: [],
|
|
129
|
+
message: "Reloaded Computer Use MCP servers through Codex app-server."
|
|
130
|
+
};
|
|
131
|
+
} catch (error) {
|
|
132
|
+
const message = `Could not reload Computer Use MCP servers: ${describeControlFailure(error)}`;
|
|
133
|
+
return {
|
|
134
|
+
attempted: true,
|
|
135
|
+
killedPids: [],
|
|
136
|
+
warnings: [message],
|
|
137
|
+
message
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
async function cleanupComputerUseProbeThread(params, threadId) {
|
|
142
|
+
try {
|
|
143
|
+
await params.request("thread/unsubscribe", { threadId }, {
|
|
144
|
+
timeoutMs: params.config.liveTestTimeoutMs,
|
|
145
|
+
signal: AbortSignal.timeout(params.config.liveTestTimeoutMs)
|
|
146
|
+
});
|
|
147
|
+
} catch (error) {
|
|
148
|
+
if (params.client) await retireUnsafeCodexTurnClientBestEffort(params.client, "Computer Use readiness cleanup");
|
|
149
|
+
throw new CodexAppServerUnsafeSubscriptionError("Computer Use readiness cleanup failed", { cause: error });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function skippedLiveTestStatus(config, message) {
|
|
153
|
+
return {
|
|
154
|
+
status: "skipped",
|
|
155
|
+
ok: false,
|
|
156
|
+
attempted: false,
|
|
157
|
+
attempts: 0,
|
|
158
|
+
timeoutMs: config.liveTestTimeoutMs,
|
|
159
|
+
retried: false,
|
|
160
|
+
repaired: false,
|
|
161
|
+
message
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
13
165
|
//#region extensions/codex/src/app-server/computer-use.ts
|
|
14
166
|
/**
|
|
15
167
|
* Computer Use plugin/MCP readiness checks and optional install flow for Codex
|
|
@@ -31,8 +183,6 @@ const COMPUTER_USE_MARKETPLACE_NAME_PRIORITY = [
|
|
|
31
183
|
"openai-curated-remote",
|
|
32
184
|
"local"
|
|
33
185
|
];
|
|
34
|
-
const COMPUTER_USE_LIVE_TEST_RETRY_COUNT = 1;
|
|
35
|
-
const COMPUTER_USE_LIVE_TEST_THREAD_NAME = "OpenClaw Computer Use readiness probe";
|
|
36
186
|
/** Reads Computer Use readiness without installing or mutating app-server state. */
|
|
37
187
|
async function readCodexComputerUseStatus(params = {}) {
|
|
38
188
|
const config = resolveComputerUseConfig(params);
|
|
@@ -41,6 +191,7 @@ async function readCodexComputerUseStatus(params = {}) {
|
|
|
41
191
|
return await inspectCodexComputerUse({
|
|
42
192
|
...params,
|
|
43
193
|
computerUseConfig: config,
|
|
194
|
+
runLiveTest: true,
|
|
44
195
|
installPlugin: false
|
|
45
196
|
});
|
|
46
197
|
} catch (error) {
|
|
@@ -48,8 +199,8 @@ async function readCodexComputerUseStatus(params = {}) {
|
|
|
48
199
|
}
|
|
49
200
|
}
|
|
50
201
|
/**
|
|
51
|
-
* Ensures
|
|
52
|
-
* allows safe auto-install.
|
|
202
|
+
* Ensures installation and MCP exposure before a turn, optionally installing when
|
|
203
|
+
* config allows safe auto-install. Only strict startup waits for a live probe.
|
|
53
204
|
*/
|
|
54
205
|
async function ensureCodexComputerUse(params = {}) {
|
|
55
206
|
const config = resolveComputerUseConfig(params);
|
|
@@ -57,19 +208,19 @@ async function ensureCodexComputerUse(params = {}) {
|
|
|
57
208
|
const status = await inspectCodexComputerUse({
|
|
58
209
|
...params,
|
|
59
210
|
computerUseConfig: config,
|
|
211
|
+
runLiveTest: config.strictReadiness,
|
|
60
212
|
installPlugin: false
|
|
61
213
|
});
|
|
62
214
|
if (status.ready) return status;
|
|
63
|
-
if (isNonStrictLiveTestStartupAllowed(status, config)) return status;
|
|
64
215
|
if (config.autoInstall) {
|
|
65
216
|
const blockedAutoInstallStatus = blockUnsafeAutoInstallStatus(config);
|
|
66
217
|
if (blockedAutoInstallStatus) throw new CodexComputerUseSetupError(blockedAutoInstallStatus);
|
|
67
218
|
const installedStatus = await inspectCodexComputerUse({
|
|
68
219
|
...params,
|
|
69
220
|
computerUseConfig: config,
|
|
221
|
+
runLiveTest: config.strictReadiness,
|
|
70
222
|
installPlugin: true
|
|
71
223
|
});
|
|
72
|
-
if (isNonStrictLiveTestStartupAllowed(installedStatus, config)) return installedStatus;
|
|
73
224
|
if (!installedStatus.ready) throw new CodexComputerUseSetupError(installedStatus);
|
|
74
225
|
return installedStatus;
|
|
75
226
|
}
|
|
@@ -90,13 +241,13 @@ async function installCodexComputerUse(params = {}) {
|
|
|
90
241
|
const status = await inspectCodexComputerUse({
|
|
91
242
|
...params,
|
|
92
243
|
computerUseConfig: config,
|
|
244
|
+
runLiveTest: true,
|
|
93
245
|
installPlugin: true
|
|
94
246
|
});
|
|
95
247
|
if (!status.ready) throw new CodexComputerUseSetupError(status);
|
|
96
248
|
return status;
|
|
97
249
|
}
|
|
98
250
|
async function inspectCodexComputerUse(params) {
|
|
99
|
-
if (!params.installPlugin) return await inspectCodexComputerUseWithoutFence(params);
|
|
100
251
|
const resolvedRuntime = resolveCodexAppServerRuntimeOptions({
|
|
101
252
|
pluginConfig: params.pluginConfig,
|
|
102
253
|
managedCommandOrder: "desktop-first"
|
|
@@ -104,19 +255,57 @@ async function inspectCodexComputerUse(params) {
|
|
|
104
255
|
const operationTimeoutMs = params.timeoutMs ?? resolvedRuntime.requestTimeoutMs;
|
|
105
256
|
const deadline = operationTimeoutMs > 0 ? Date.now() + operationTimeoutMs : void 0;
|
|
106
257
|
const remainingTimeoutMs = () => deadline === void 0 ? operationTimeoutMs : Math.max(1, deadline - Date.now());
|
|
107
|
-
|
|
258
|
+
const clientOptions = {
|
|
259
|
+
startOptions: resolvedRuntime.start,
|
|
260
|
+
pluginConfig: params.pluginConfig,
|
|
261
|
+
config: params.config,
|
|
262
|
+
agentDir: params.agentDir,
|
|
263
|
+
abandonSignal: params.signal,
|
|
264
|
+
assertCurrent: params.assertCurrent
|
|
265
|
+
};
|
|
266
|
+
const lease = {};
|
|
108
267
|
try {
|
|
109
268
|
let client = params.client;
|
|
110
269
|
if (!client && !params.request) {
|
|
111
270
|
client = await getLeasedSharedCodexAppServerClient({
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
271
|
+
...clientOptions,
|
|
272
|
+
timeoutMs: remainingTimeoutMs()
|
|
273
|
+
});
|
|
274
|
+
lease.client = client;
|
|
275
|
+
}
|
|
276
|
+
if (!params.installPlugin) {
|
|
277
|
+
if (!lease.client) return await inspectCodexComputerUseWithoutFence(params);
|
|
278
|
+
return await withLeasedCodexAppServerClientStartSelectionRetry({
|
|
279
|
+
lease,
|
|
280
|
+
options: {
|
|
281
|
+
...clientOptions,
|
|
282
|
+
timeoutMs: remainingTimeoutMs()
|
|
283
|
+
},
|
|
284
|
+
signal: params.signal,
|
|
285
|
+
run: async (readClient, requestOptions) => {
|
|
286
|
+
const { assertCurrent } = requestOptions();
|
|
287
|
+
return await inspectCodexComputerUseWithoutFence({
|
|
288
|
+
...params,
|
|
289
|
+
client: readClient,
|
|
290
|
+
request: async (method, requestParams, options) => {
|
|
291
|
+
const scopedOptions = method === "thread/unsubscribe" ? {
|
|
292
|
+
timeoutMs: options?.timeoutMs ?? operationTimeoutMs,
|
|
293
|
+
signal: options?.signal,
|
|
294
|
+
assertCurrent
|
|
295
|
+
} : requestOptions();
|
|
296
|
+
return await requestCodexAppServerClientJson({
|
|
297
|
+
client: readClient,
|
|
298
|
+
method,
|
|
299
|
+
requestParams,
|
|
300
|
+
config: params.config,
|
|
301
|
+
timeoutMs: Math.min(options?.timeoutMs ?? operationTimeoutMs, scopedOptions.timeoutMs),
|
|
302
|
+
signal: scopedOptions.signal,
|
|
303
|
+
assertCurrent: scopedOptions.assertCurrent
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
118
308
|
});
|
|
119
|
-
leasedClient = client;
|
|
120
309
|
}
|
|
121
310
|
const explicitManagedInstall = client && !resolveCodexComputerUseConfig({ pluginConfig: params.pluginConfig }).autoInstall ? await resolveExplicitManagedComputerUseInstallContext({
|
|
122
311
|
...params,
|
|
@@ -167,7 +356,7 @@ async function inspectCodexComputerUse(params) {
|
|
|
167
356
|
if (releaseFenceOnReturn) release();
|
|
168
357
|
}
|
|
169
358
|
} finally {
|
|
170
|
-
if (
|
|
359
|
+
if (lease.client) releaseLeasedSharedCodexAppServerClient(lease.client);
|
|
171
360
|
}
|
|
172
361
|
}
|
|
173
362
|
async function inspectCodexComputerUseWithoutFence(params) {
|
|
@@ -198,8 +387,11 @@ async function inspectCodexComputerUseWithoutFence(params) {
|
|
|
198
387
|
if (!pluginInspection.ok) return pluginInspection.status;
|
|
199
388
|
return await readComputerUseTools({
|
|
200
389
|
request,
|
|
390
|
+
client: params.client,
|
|
391
|
+
signal: params.signal,
|
|
201
392
|
config: params.computerUseConfig,
|
|
202
393
|
plugin: pluginInspection.plugin,
|
|
394
|
+
runLiveTest: params.runLiveTest,
|
|
203
395
|
installPlugin: params.installPlugin,
|
|
204
396
|
releaseNativeConfigFence: params.releaseNativeConfigFence
|
|
205
397
|
});
|
|
@@ -224,7 +416,10 @@ async function prepareExplicitManagedComputerUseInstall(params) {
|
|
|
224
416
|
ownsIsolatedCodexHome: true,
|
|
225
417
|
desktopGeneration: context.desktopGeneration,
|
|
226
418
|
forceCacheRefresh: true,
|
|
227
|
-
assertCurrent: () =>
|
|
419
|
+
assertCurrent: () => {
|
|
420
|
+
params.assertCurrent?.();
|
|
421
|
+
assertCodexAppServerClientStartSelectionCurrent({ client: context.client });
|
|
422
|
+
}
|
|
228
423
|
});
|
|
229
424
|
}
|
|
230
425
|
async function resolveExplicitManagedComputerUseInstallContext(params) {
|
|
@@ -315,10 +510,14 @@ async function readComputerUseTools(params) {
|
|
|
315
510
|
reason: "ready",
|
|
316
511
|
message: "Computer Use is ready."
|
|
317
512
|
});
|
|
513
|
+
if (!params.runLiveTest) return status;
|
|
318
514
|
params.releaseNativeConfigFence?.();
|
|
319
515
|
const { liveTest, repair } = await runCodexComputerUseLiveTest({
|
|
320
516
|
request: params.request,
|
|
321
|
-
|
|
517
|
+
client: params.client,
|
|
518
|
+
signal: params.signal,
|
|
519
|
+
config: params.config,
|
|
520
|
+
tools
|
|
322
521
|
});
|
|
323
522
|
const compatibilityStartupAllowed = !liveTest.ok && !params.config.strictReadiness;
|
|
324
523
|
return {
|
|
@@ -335,88 +534,6 @@ async function readComputerUseTools(params) {
|
|
|
335
534
|
message: liveTest.ok ? "Computer Use is ready." : compatibilityStartupAllowed ? `${liveTest.message} Startup is allowed because computerUse.strictReadiness is false.` : liveTest.message
|
|
336
535
|
};
|
|
337
536
|
}
|
|
338
|
-
function isNonStrictLiveTestStartupAllowed(status, config) {
|
|
339
|
-
return !config.strictReadiness && status.reason === "live_test_failed" && status.installed && status.pluginEnabled && status.mcpServerAvailable && status.installation.ok && status.exposure.ok;
|
|
340
|
-
}
|
|
341
|
-
async function runCodexComputerUseLiveTest(params) {
|
|
342
|
-
const startedAt = Date.now();
|
|
343
|
-
let lastError;
|
|
344
|
-
let repair;
|
|
345
|
-
for (let attempt = 0; attempt <= COMPUTER_USE_LIVE_TEST_RETRY_COUNT; attempt += 1) {
|
|
346
|
-
let threadId;
|
|
347
|
-
try {
|
|
348
|
-
threadId = (await params.request("thread/start", {
|
|
349
|
-
input: [],
|
|
350
|
-
developerInstructions: COMPUTER_USE_LIVE_TEST_THREAD_NAME,
|
|
351
|
-
ephemeral: true
|
|
352
|
-
}, { timeoutMs: params.config.liveTestTimeoutMs })).thread.id;
|
|
353
|
-
await params.request("mcpServer/tool/call", {
|
|
354
|
-
threadId,
|
|
355
|
-
server: params.config.mcpServerName,
|
|
356
|
-
tool: "list_apps",
|
|
357
|
-
arguments: {}
|
|
358
|
-
}, { timeoutMs: params.config.toolCallTimeoutMs });
|
|
359
|
-
return {
|
|
360
|
-
liveTest: {
|
|
361
|
-
status: "passed",
|
|
362
|
-
ok: true,
|
|
363
|
-
attempted: true,
|
|
364
|
-
attempts: attempt + 1,
|
|
365
|
-
timeoutMs: params.config.liveTestTimeoutMs,
|
|
366
|
-
retried: attempt > 0,
|
|
367
|
-
repaired: Boolean(repair?.attempted && repair.warnings.length === 0),
|
|
368
|
-
durationMs: Math.max(0, Date.now() - startedAt),
|
|
369
|
-
message: "Computer Use live test passed."
|
|
370
|
-
},
|
|
371
|
-
...repair ? { repair } : {}
|
|
372
|
-
};
|
|
373
|
-
} catch (error) {
|
|
374
|
-
if (isCodexAppServerStartSelectionChangedError(error)) throw error;
|
|
375
|
-
lastError = error;
|
|
376
|
-
} finally {
|
|
377
|
-
if (threadId) await cleanupComputerUseProbeThread(params.request, threadId, params.config);
|
|
378
|
-
}
|
|
379
|
-
if (attempt < COMPUTER_USE_LIVE_TEST_RETRY_COUNT && params.config.autoRepair) repair = await repairComputerUseMcpRuntime(params.request, params.config);
|
|
380
|
-
}
|
|
381
|
-
const errorMessage = describeControlFailure(lastError);
|
|
382
|
-
return {
|
|
383
|
-
liveTest: {
|
|
384
|
-
status: "failed",
|
|
385
|
-
ok: false,
|
|
386
|
-
attempted: true,
|
|
387
|
-
attempts: 2,
|
|
388
|
-
timeoutMs: params.config.liveTestTimeoutMs,
|
|
389
|
-
retried: true,
|
|
390
|
-
repaired: Boolean(repair?.attempted && repair.warnings.length === 0),
|
|
391
|
-
durationMs: Math.max(0, Date.now() - startedAt),
|
|
392
|
-
message: `Computer Use live test failed after 2 attempts: ${errorMessage}`,
|
|
393
|
-
error: errorMessage
|
|
394
|
-
},
|
|
395
|
-
...repair ? { repair } : {}
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
async function repairComputerUseMcpRuntime(request, config) {
|
|
399
|
-
try {
|
|
400
|
-
await request("config/mcpServer/reload", void 0, { timeoutMs: config.liveTestTimeoutMs });
|
|
401
|
-
return {
|
|
402
|
-
attempted: true,
|
|
403
|
-
killedPids: [],
|
|
404
|
-
warnings: [],
|
|
405
|
-
message: "Reloaded Computer Use MCP servers through Codex app-server."
|
|
406
|
-
};
|
|
407
|
-
} catch (error) {
|
|
408
|
-
const message = `Could not reload Computer Use MCP servers: ${describeControlFailure(error)}`;
|
|
409
|
-
return {
|
|
410
|
-
attempted: true,
|
|
411
|
-
killedPids: [],
|
|
412
|
-
warnings: [message],
|
|
413
|
-
message
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
async function cleanupComputerUseProbeThread(request, threadId, config) {
|
|
418
|
-
await Promise.allSettled([request("thread/unsubscribe", { threadId }, { timeoutMs: config.liveTestTimeoutMs }), request("thread/archive", { threadId }, { timeoutMs: config.liveTestTimeoutMs })]);
|
|
419
|
-
}
|
|
420
537
|
async function resolveMarketplaceRef(params) {
|
|
421
538
|
let preferredMarketplaceName = params.config.marketplaceName;
|
|
422
539
|
if (params.config.marketplaceSource && params.allowAdd) {
|
|
@@ -679,44 +796,12 @@ function exposureStatusFromTools(config, tools) {
|
|
|
679
796
|
message: `Computer Use MCP server ${config.mcpServerName} exposes ${tools.length} tools.`
|
|
680
797
|
};
|
|
681
798
|
}
|
|
682
|
-
function skippedLiveTestStatus(config, message) {
|
|
683
|
-
return {
|
|
684
|
-
status: "skipped",
|
|
685
|
-
ok: false,
|
|
686
|
-
attempted: false,
|
|
687
|
-
attempts: 0,
|
|
688
|
-
timeoutMs: config.liveTestTimeoutMs,
|
|
689
|
-
retried: false,
|
|
690
|
-
repaired: false,
|
|
691
|
-
message
|
|
692
|
-
};
|
|
693
|
-
}
|
|
694
799
|
function pluginWarnings(plugin) {
|
|
695
800
|
const warnings = [];
|
|
696
801
|
const source = plugin.summary.source;
|
|
697
802
|
if (source && typeof source === "object" && "type" in source && source.type === "remote") warnings.push("Computer Use plugin is resolved from a remote marketplace; live local bundles are preferred.");
|
|
698
803
|
return warnings;
|
|
699
804
|
}
|
|
700
|
-
function createComputerUseRequest(params) {
|
|
701
|
-
if (params.request) return params.request;
|
|
702
|
-
if (params.client) return async (method, requestParams, options) => await params.client.request(method, requestParams, {
|
|
703
|
-
timeoutMs: options?.timeoutMs ?? params.timeoutMs,
|
|
704
|
-
signal: params.signal
|
|
705
|
-
});
|
|
706
|
-
const runtime = resolveCodexAppServerRuntimeOptions({
|
|
707
|
-
pluginConfig: params.pluginConfig,
|
|
708
|
-
managedCommandOrder: "desktop-first"
|
|
709
|
-
});
|
|
710
|
-
return async (method, requestParams, options) => await requestCodexAppServerJson({
|
|
711
|
-
method,
|
|
712
|
-
requestParams,
|
|
713
|
-
timeoutMs: options?.timeoutMs ?? params.timeoutMs ?? runtime.requestTimeoutMs,
|
|
714
|
-
pluginConfig: params.pluginConfig,
|
|
715
|
-
startOptions: runtime.start,
|
|
716
|
-
config: params.config,
|
|
717
|
-
agentDir: params.agentDir
|
|
718
|
-
});
|
|
719
|
-
}
|
|
720
805
|
function resolveComputerUseConfig(params) {
|
|
721
806
|
const overrides = params.forceEnable ? {
|
|
722
807
|
...params.overrides,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
//#region extensions/codex/src/app-server/protocol.ts
|
|
3
|
+
/** Namespace Codex keeps directly model-visible without exposing it to Code Mode guests. */
|
|
4
|
+
const CODEX_OPENCLAW_DIRECT_DYNAMIC_TOOL_NAMESPACE = "openclaw_direct";
|
|
5
|
+
function flattenCodexDynamicToolFunctions(tools) {
|
|
6
|
+
return (tools ?? []).flatMap((tool) => tool.type === "namespace" ? tool.tools : [tool]);
|
|
7
|
+
}
|
|
8
|
+
/** Asserts the experimental beforeTurnId request field before it crosses the app-server boundary. */
|
|
9
|
+
function assertCodexThreadForkParams(value) {
|
|
10
|
+
if (!isRecord(value) || typeof value.threadId !== "string" || !value.threadId.trim() || value.beforeTurnId !== void 0 && value.beforeTurnId !== null && typeof value.beforeTurnId !== "string") throw new Error("Invalid Codex app-server thread/fork params");
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
function isJsonObject(value) {
|
|
14
|
+
return isRecord(value);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { isJsonObject as i, assertCodexThreadForkParams as n, flattenCodexDynamicToolFunctions as r, CODEX_OPENCLAW_DIRECT_DYNAMIC_TOOL_NAMESPACE as t };
|
|
@@ -9,10 +9,14 @@ function buildCodexMigrationProvider(params = {}) {
|
|
|
9
9
|
return {
|
|
10
10
|
id: "codex",
|
|
11
11
|
label: "Codex",
|
|
12
|
-
description:
|
|
12
|
+
description: [
|
|
13
|
+
"Import consolidated memories, selected Codex and personal AgentSkills, and selected eligible openai-curated plugins.",
|
|
14
|
+
"Auth credentials require separate consent. Sessions and chat history are not imported.",
|
|
15
|
+
"Codex config and hooks are saved for manual review, not activated. Source files are not moved or deleted."
|
|
16
|
+
].join(" "),
|
|
13
17
|
supportedItemKinds: ["memory", "auth"],
|
|
14
18
|
async detect(ctx) {
|
|
15
|
-
const { discoverCodexSource, hasCodexSource } = await import("./source-
|
|
19
|
+
const { discoverCodexSource, hasCodexSource } = await import("./source-CUzJq5WN.mjs").then((n) => n.a);
|
|
16
20
|
const source = await discoverCodexSource({
|
|
17
21
|
input: ctx.source,
|
|
18
22
|
memoryOnly: isMemoryOnlyMigration(ctx),
|
|
@@ -28,16 +32,16 @@ function buildCodexMigrationProvider(params = {}) {
|
|
|
28
32
|
};
|
|
29
33
|
},
|
|
30
34
|
async plan(ctx) {
|
|
31
|
-
const { buildCodexMigrationPlan } = await import("./plan-
|
|
35
|
+
const { buildCodexMigrationPlan } = await import("./plan-CN3VwfNU.mjs");
|
|
32
36
|
return buildCodexMigrationPlan(ctx);
|
|
33
37
|
},
|
|
34
38
|
deferredApply: { retrySafe: true },
|
|
35
39
|
prepareApply(ctx) {
|
|
36
40
|
if (isMemoryOnlyMigration(ctx) || isAuthOnlyMigration(ctx)) return;
|
|
37
|
-
return import("./apply-
|
|
41
|
+
return import("./apply-DDOi8uNx.mjs").then(({ prepareTargetCodexAppServer }) => prepareTargetCodexAppServer(ctx));
|
|
38
42
|
},
|
|
39
43
|
async apply(ctx, plan) {
|
|
40
|
-
const { applyCodexMigrationPlan } = await import("./apply-
|
|
44
|
+
const { applyCodexMigrationPlan } = await import("./apply-DDOi8uNx.mjs");
|
|
41
45
|
return await applyCodexMigrationPlan({
|
|
42
46
|
ctx,
|
|
43
47
|
plan,
|
package/dist/{provider-capabilities-BvCUL69A.js → .setup/provider-capabilities-BfE88FZ5.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-
|
|
2
|
-
import {
|
|
1
|
+
import { h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-DA4VR4Eb.mjs";
|
|
2
|
+
import { ut as normalizeCodexDynamicToolName } from "./thread-requests-BLvGkP2R.mjs";
|
|
3
3
|
import { pinExecToolTarget } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
4
4
|
import { loadNodeExecAvailability } from "openclaw/plugin-sdk/node-selection-runtime";
|
|
5
5
|
//#region extensions/codex/src/app-server/shell-dynamic-tools.ts
|
|
@@ -51,6 +51,27 @@ function createGatewayProcessProjection(createProjection, processTool) {
|
|
|
51
51
|
description: "Manage background shell sessions in the existing per-session OpenClaw process scope: list, poll, log, write, send-keys, submit, paste, kill, clear, or remove. Use for gateway_exec follow-up; use native Codex shell session handling for ordinary local work."
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
+
function createSandboxExecProjection(execTool) {
|
|
55
|
+
return {
|
|
56
|
+
...execTool,
|
|
57
|
+
name: "sandbox_exec",
|
|
58
|
+
description: "Run a shell command through OpenClaw's configured sandbox backend for this session. Use when OpenClaw sandboxing is active or when a command must execute in the sandbox backend, such as an SSH-backed sandbox or Docker container-path bind layout. Use Codex's native shell only when no OpenClaw sandbox is active and native Code Mode is available.",
|
|
59
|
+
execute: async (toolCallId, args, signal, onUpdate) => {
|
|
60
|
+
const result = await execTool.execute(toolCallId, args, signal, onUpdate);
|
|
61
|
+
return {
|
|
62
|
+
...result,
|
|
63
|
+
content: result.content.map((item) => item.type === "text" ? Object.assign({}, item, { text: item.text.replace(PROCESS_FOLLOWUP_TEXT, "Use sandbox_process (list/poll/log/write/send-keys/submit/paste/kill/clear/remove) for follow-up.") }) : item)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function createSandboxProcessProjection(processTool) {
|
|
69
|
+
return {
|
|
70
|
+
...processTool,
|
|
71
|
+
name: "sandbox_process",
|
|
72
|
+
description: "Manage background shell sessions through OpenClaw's configured sandbox backend for this session: list, poll, log, write, send-keys, submit, paste, kill, clear, or remove. Use only for sandbox follow-up; use Codex's native shell session handling only when no OpenClaw sandbox is active and native Code Mode is available."
|
|
73
|
+
};
|
|
74
|
+
}
|
|
54
75
|
//#endregion
|
|
55
76
|
//#region extensions/codex/src/app-server/provider-capabilities.ts
|
|
56
77
|
function resolveOverriddenProviderWebSearchSupport(modelProviderOverride) {
|
|
@@ -59,6 +80,12 @@ function resolveOverriddenProviderWebSearchSupport(modelProviderOverride) {
|
|
|
59
80
|
return provider === "openai" ? "supported" : "unsupported";
|
|
60
81
|
}
|
|
61
82
|
async function readConfiguredProviderWebSearchSupport(params) {
|
|
83
|
+
if (params.expectedNativeModelProvider) {
|
|
84
|
+
if (((await params.client.request("config/read", { includeLayers: false }, {
|
|
85
|
+
timeoutMs: params.timeoutMs,
|
|
86
|
+
signal: params.signal
|
|
87
|
+
})).config.model_provider ?? "openai") !== params.expectedNativeModelProvider) return "unknown";
|
|
88
|
+
}
|
|
62
89
|
return (await params.client.request("modelProvider/capabilities/read", {}, {
|
|
63
90
|
timeoutMs: params.timeoutMs,
|
|
64
91
|
signal: params.signal
|
|
@@ -89,6 +116,7 @@ async function resolveCodexProviderWebSearchSupport(params) {
|
|
|
89
116
|
client,
|
|
90
117
|
timeoutMs: params.appServer.requestTimeoutMs,
|
|
91
118
|
modelProviderOverride: params.modelProviderOverride,
|
|
119
|
+
expectedNativeModelProvider: params.expectedNativeModelProvider,
|
|
92
120
|
signal: params.signal
|
|
93
121
|
});
|
|
94
122
|
} catch {
|
|
@@ -98,4 +126,4 @@ async function resolveCodexProviderWebSearchSupport(params) {
|
|
|
98
126
|
}
|
|
99
127
|
}
|
|
100
128
|
//#endregion
|
|
101
|
-
export { CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME as a, createNodeExecAliasDynamicTool as c, CODEX_GATEWAY_PROCESS_DYNAMIC_TOOL_NAME as i,
|
|
129
|
+
export { CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME as a, createNodeExecAliasDynamicTool as c, isCodexDynamicToolExcluded as d, CODEX_GATEWAY_PROCESS_DYNAMIC_TOOL_NAME as i, createSandboxExecProjection as l, resolveCodexProviderWebSearchSupportForClient as n, createGatewayExecProjection as o, CODEX_GATEWAY_EXEC_DYNAMIC_TOOL_NAME as r, createGatewayProcessProjection as s, resolveCodexProviderWebSearchSupport as t, createSandboxProcessProjection as u };
|