@openclaw/codex 2026.9.4 → 2026.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/activity.svg +30 -0
- package/assets/icon.png +0 -0
- package/dist/.setup/account-usage-runtime-C2MOIvfq.mjs +75 -0
- package/dist/{apply-CvT8tW5i.js → .setup/apply-CJ0ZfmBG.mjs} +11 -11
- package/dist/.setup/async-questions-DdhOCwGi.mjs +27 -0
- package/dist/{attempt-client-cleanup-DKHzbwt5.js → .setup/attempt-client-cleanup-BpYKdTA0.mjs} +29 -14
- package/dist/{attempt-context-D44yeDII.js → .setup/attempt-context-VXVwTCfS.mjs} +5 -5
- package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +5 -0
- package/dist/{auth-binding-CWlKVccJ.js → .setup/auth-binding-DhLWa_7K.mjs} +1 -1
- package/dist/{auth-cache-key-7orQae_j.js → .setup/auth-cache-key-QirmgiCo.mjs} +3 -3
- package/dist/{auth-profile-CwzO4_RG.js → .setup/auth-profile-WqZtZfXN.mjs} +1 -1
- package/dist/.setup/binding-connection-Bm38niE8.mjs +50 -0
- package/dist/.setup/binding-connection.runtime-CnRMC0ta.mjs +48 -0
- package/dist/{bounded-turn-C_Hneydj.js → .setup/bounded-turn-BtlZcivC.mjs} +16 -11
- package/dist/{build-state-BCmg9-5p.js → .setup/build-state-Xx9ybZqa.mjs} +1 -1
- package/dist/{capabilities-8vx68WLH.js → .setup/capabilities-_vXcZGSx.mjs} +1 -1
- package/dist/{client-B57KWPQx.js → .setup/client-vXs2929Q.mjs} +332 -163
- package/dist/{command-dispatch-BpduNGVf.js → .setup/command-dispatch-naHIZwwF.mjs} +3 -3
- package/dist/{command-formatters-lxlkNZgU.js → .setup/command-formatters-CGEkdawF.mjs} +2 -2
- package/dist/{command-handlers-tiL9iWj7.js → .setup/command-handlers-BtAJEW1X.mjs} +59 -42
- package/dist/{command-rpc-CR5EOEZX.js → .setup/command-rpc-DHFpn4le.mjs} +22 -13
- package/dist/{compact-B_H3AOd7.js → .setup/compact-C3i3qlzj.mjs} +28 -43
- package/dist/{config-oIORaQ5T.js → .setup/config-CedDWjM-.mjs} +5 -4
- package/dist/{config-options-CXMq1T-C.js → .setup/config-options-BsanJ8QG.mjs} +6 -418
- package/dist/{protocol-5bh1G-H7.js → .setup/config-parsing-CcB9iPoq.mjs} +9 -51
- package/dist/{config-runtime-D0zGNIHu.js → .setup/config-runtime-CeAhl_h4.mjs} +2 -2
- package/dist/.setup/config-security-BRQ2mgW9.mjs +465 -0
- package/dist/{conversation-binding-DsB4-O7U.js → .setup/conversation-binding-DhzrpTM6.mjs} +23 -21
- package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs} +1 -1
- package/dist/{conversation-control-CtUu1b3m.js → .setup/conversation-control-DN53ns41.mjs} +17 -13
- package/dist/.setup/cyber-failover-DYwbmf1o.mjs +123 -0
- package/dist/.setup/cyber-failover-notice-e9G3J9-e.mjs +17 -0
- package/dist/{dynamic-tools-CmN5RAip.js → .setup/dynamic-tools-D16lOp67.mjs} +101 -55
- package/dist/{effective-mcp-catalog-Bd73bqA8.js → .setup/effective-mcp-catalog-K6kLCN8X.mjs} +3 -3
- package/dist/{ephemeral-turn-D78_VmzO.js → .setup/ephemeral-turn-R1gA8Sn6.mjs} +4 -5
- package/dist/{event-projector-assistant-message-BmBM4qBV.js → .setup/event-projector-assistant-message-DNUR1s0A.mjs} +6 -3
- package/dist/{event-projector-items-5VhsECCO.js → .setup/event-projector-items-DyTQ_XqL.mjs} +1 -1
- package/dist/{attempt-notifications-C9XufG6l.js → .setup/event-projector-usage-C7Ntzs-f.mjs} +102 -9
- package/dist/{harness-C7rRa7bm.js → .setup/harness-rxaaoN-o.mjs} +74 -20
- package/dist/{inference-context-Dr_mzvk4.js → .setup/inference-context-fulhZuz8.mjs} +1 -1
- package/dist/{inference-proxy-HGXKUIre.js → .setup/inference-proxy-CC15HuSi.mjs} +4 -4
- package/dist/{isolated-completion-DWVb5U2J.js → .setup/isolated-completion-B6srt48J.mjs} +7 -7
- package/dist/{launch-args-RXQwn8zV.js → .setup/launch-args-DnMak49W.mjs} +22 -1
- package/dist/{managed-binary-D22rNEcR.js → .setup/managed-binary-DP6Rib3P.mjs} +2 -2
- package/dist/{managed-thread-store-D1t5jh3G.js → .setup/managed-thread-store-BMqgThVL.mjs} +48 -14
- package/dist/{model-catalog-Dq2n8f_p.js → .setup/model-catalog-DkvUuBey.mjs} +35 -10
- package/dist/{models-PCKOim-h.js → .setup/models-BDFgm_G-.mjs} +3 -3
- package/dist/.setup/native-auth-BLZGqFjw.mjs +57 -0
- package/dist/{native-subagent-history-DjtPloaU.js → .setup/native-subagent-history-YXaL6dMd.mjs} +24 -29
- package/dist/.setup/native-subagent-monitor-B1hxzIOy.mjs +5031 -0
- package/dist/{native-subagent-task-ids-BzTdT0Uw.js → .setup/native-subagent-task-ids-DsuOonKv.mjs} +32 -8
- package/dist/{node-cli-sessions-DKaOmVUh.js → .setup/node-cli-sessions-Cl8b2ZF3.mjs} +1 -1
- package/dist/{node-exec-server.runtime-Cl2vapEi.js → .setup/node-exec-server.runtime-BaViBKNz.mjs} +3 -3
- package/dist/{plan-7uG-Fp36.js → .setup/plan-xD7WKYTM.mjs} +64 -48
- package/dist/{plugin-activation-BYQculil.js → .setup/plugin-activation-r8nq5Jzp.mjs} +3 -3
- package/dist/{plugin-app-cache-key-d0eKxy7b.js → .setup/plugin-app-cache-key-BOxKP7db.mjs} +29 -25
- package/dist/{plugin-approval-roundtrip-Bz3FT8W5.js → .setup/plugin-approval-roundtrip-CjfzafAZ.mjs} +1 -1
- package/dist/{plugin-inventory-oL4Na1ZG.js → .setup/plugin-inventory-DUle8DLz.mjs} +7 -6
- package/dist/{plugin-metadata-cache-ClPJpRio.js → .setup/plugin-metadata-cache-DsS5buNa.mjs} +29 -14
- package/dist/{provider-capabilities-BvCUL69A.js → .setup/provider-capabilities-B8J4Dy-O.mjs} +2 -2
- package/dist/{provider-MQ8PVkuE.js → .setup/provider-fFh_-VR3.mjs} +4 -4
- package/dist/{rate-limits-CBMmWBr9.js → .setup/rate-limits-DOEGYRNs.mjs} +90 -46
- package/dist/{request-B7hEkBGq.js → .setup/request-BioXJLYa.mjs} +113 -33
- package/dist/.setup/run-attempt-lifecycle-B7JbY4-F.mjs +71 -0
- package/dist/{run-attempt-CvsAAGa0.js → .setup/run-attempt-rlA07pUv.mjs} +580 -498
- package/dist/{runtime-artifact-BJ0rXBZ_.js → .setup/runtime-artifact-Dy38Z5iU.mjs} +2 -2
- package/dist/{sandbox-guard-BxgyoM8M.js → .setup/sandbox-guard-BBP-RbTf.mjs} +3 -3
- package/dist/{session-binding-CI8UuilT.js → .setup/session-binding-_0W_fHRr.mjs} +46 -64
- package/dist/{session-binding-record-Bcvslnhf.js → .setup/session-binding-record-TH3xA0zj.mjs} +181 -3
- package/dist/.setup/session-binding-sidecars-CKYEcfNn.mjs +543 -0
- package/dist/{session-catalog-adoption-tcZi1IfX.js → .setup/session-catalog-adoption-CR_whkEW.mjs} +6 -6
- package/dist/{session-catalog-archive-CwKg8Xz2.js → .setup/session-catalog-archive-CwZaPacf.mjs} +6 -6
- package/dist/.setup/session-catalog-events-jMcYfQyd.mjs +250 -0
- package/dist/.setup/session-catalog-fUdWDx-U.mjs +2464 -0
- package/dist/.setup/session-catalog-index-B141u15s.mjs +1070 -0
- package/dist/.setup/session-catalog-index-order-Cc5BzlQr.mjs +48 -0
- package/dist/.setup/session-catalog-index-state-BAuDztHN.mjs +180 -0
- package/dist/{thread-history-page-D0JIp48V.js → .setup/session-catalog-native-projection-ChV3cCtm.mjs} +206 -95
- package/dist/{session-catalog-node-adoption-B1tgDW-m.js → .setup/session-catalog-node-adoption-BVRsYOSh.mjs} +3 -3
- package/dist/{session-catalog-node-continue-Ci-DXyJP.js → .setup/session-catalog-node-continue-Dowv8osw.mjs} +7 -7
- package/dist/.setup/session-catalog-projection-C1Bj9Jl-.mjs +414 -0
- package/dist/{session-cli-DNN_jhGc.js → .setup/session-cli-DIj-IE-E.mjs} +4 -4
- package/dist/{session-history-Cz-tOOYj.js → .setup/session-history-C--SrLI8.mjs} +10 -5
- package/dist/{session-history-import-DwyijFI6.js → .setup/session-history-import-JHXT5Xfi.mjs} +4 -4
- package/dist/{session-history-read-cxPUxyVV.js → .setup/session-history-read-B3ZfSUbF.mjs} +2 -2
- package/dist/{session-history.worker-BeK1YOyT.js → .setup/session-history.worker-CpNj7H_P.mjs} +5 -6
- package/dist/{session-initialization-Ct0_Hzmg.js → .setup/session-initialization-DH1z6fXn.mjs} +2 -2
- package/dist/{session-permission-policy-BBmXA8Eg.js → .setup/session-permission-policy-DhurXY0l.mjs} +2 -2
- package/dist/{session-retirement-B2YfbAAT.js → .setup/session-retirement-CU87AOg9.mjs} +6 -6
- package/dist/{settled-turn-context-Du6gdUDd.js → .setup/settled-turn-context-fmwouT5I.mjs} +2 -2
- package/dist/{settled-turn-finalizer-Dn91stmc.js → .setup/settled-turn-finalizer-CiY2bLFK.mjs} +9 -9
- package/dist/{shared-client-CscigXXL.js → .setup/shared-client-BpTtuLQ5.mjs} +286 -145
- package/dist/{side-question-BGMJQf4U.js → .setup/side-question-DSCZyoBD.mjs} +64 -47
- package/dist/{source-CElXU0Oy.js → .setup/source-Bjp4UQij.mjs} +7 -6
- package/dist/{thread-archive-guard-DfpBr-Sz.js → .setup/thread-archive-guard-jmecf6OJ.mjs} +1 -1
- package/dist/.setup/thread-history-page-BTx-4xsg.mjs +83 -0
- package/dist/{thread-lifecycle-DXl1-I6b.js → .setup/thread-lifecycle-Cik28qWn.mjs} +256 -128
- package/dist/{thread-ownership-BsDRTsyp.js → .setup/thread-ownership-skomxnIt.mjs} +4 -4
- package/dist/{thread-policy-BuEQfE0g.js → .setup/thread-policy-Cjs4B8xf.mjs} +2 -2
- package/dist/{thread-resume-DsDOZpFg.js → .setup/thread-resume-BkNpj9Pz.mjs} +8 -5
- package/dist/.setup/timeout-DZF05XrR.mjs +63 -0
- package/dist/{transcript-history-projection-v17wXgdK.js → .setup/transcript-history-projection-DHNBDhCU.mjs} +8 -3
- package/dist/{transcript-mirror-C5CKgNy6.js → .setup/transcript-mirror-D4qp_leP.mjs} +15 -6
- package/dist/{transcript-mirror-attestation-DibE0krH.js → .setup/transcript-mirror-attestation-CzM-94NC.mjs} +4 -1
- package/dist/{transport-stdio-BGjHoYLr.js → .setup/transport-stdio-Cmx94Oiy.mjs} +149 -44
- package/dist/{upstream-session-fork-BZerMte_.js → .setup/upstream-session-fork-D3UKxgVD.mjs} +27 -26
- package/dist/{usage-tCk-mg_x.js → .setup/usage-BOgBEKso.mjs} +4 -4
- package/dist/.setup/usage-limit-error-C0ow7DOc.mjs +166 -0
- package/dist/{version-omm6IPI3.js → .setup/version-CoqzXPgK.mjs} +1 -1
- package/dist/{web-search-provider.runtime-B7bGbGWq.js → .setup/web-search-provider.runtime-CTGuJt6i.mjs} +3 -3
- package/dist/api.js +6 -6
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +8 -528
- package/dist/harness.js +1 -1
- package/dist/index.js +123 -83
- package/dist/media-understanding-provider.js +3 -3
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-tool-policy.js +12 -0
- package/dist/provider-discovery.js +18 -0
- package/dist/session-history-worker-runtime.js +23 -5
- package/dist/session-history.worker.js +2 -2
- package/dist/web-search-contract-api.js +1 -1
- package/openclaw.plugin.json +354 -69
- package/package.json +11 -8
- package/dist/binding-connection-D3udKbIE.js +0 -60
- package/dist/event-projector-usage-BfXmpOec.js +0 -102
- package/dist/native-subagent-history-owner-Pcp7JuVF.js +0 -34
- package/dist/native-subagent-monitor-fQ7eIXEf.js +0 -2978
- package/dist/rpc-error-ttN_QjEm.js +0 -30
- package/dist/session-catalog-ct-AH01I.js +0 -1477
- package/dist/session-catalog-home-id-CwhLdC03.js +0 -18
- package/dist/session-catalog-provenance-D-dIfRAH.js +0 -96
- package/dist/timeout-BVw8aaM1.js +0 -33
- package/dist/{auth-profile-selection-DFu9e167.js → .setup/auth-profile-selection-DFu9e167.mjs} +0 -0
- package/dist/{config-utils-DujwEnhg.js → .setup/config-utils-DujwEnhg.mjs} +0 -0
- package/dist/{context-compaction-activity-CMla5FPJ.js → .setup/context-compaction-activity-CMla5FPJ.mjs} +0 -0
- package/dist/{elicitation-input-DPoK8F7w.js → .setup/elicitation-input-DPoK8F7w.mjs} +0 -0
- package/dist/{history-rejection-B4nOXNXF.js → .setup/history-rejection-B4nOXNXF.mjs} +0 -0
- package/dist/{image-payload-sanitizer-tupAr-2o.js → .setup/image-payload-sanitizer-tupAr-2o.mjs} +0 -0
- package/dist/{incognito-session-uhrBF6wJ.js → .setup/incognito-session-uhrBF6wJ.mjs} +0 -0
- package/dist/{local-runtime-attribution-B_2mnqhb.js → .setup/local-runtime-attribution-B_2mnqhb.mjs} +0 -0
- package/dist/{native-execution-policy-umd0tgh4.js → .setup/native-execution-policy-YBMHSzC4.mjs} +1 -1
- /package/dist/{plugin-marketplace-discovery-P-Vndfqq.js → .setup/plugin-marketplace-discovery-P-Vndfqq.mjs} +0 -0
- /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
- /package/dist/{session-binding-meta-B7aEMU7g.js → .setup/session-binding-meta-B7aEMU7g.mjs} +0 -0
- /package/dist/{session-upstream-marker-D15C9NHp.js → .setup/session-upstream-marker-D15C9NHp.mjs} +0 -0
- /package/dist/{upstream-prompt-provenance-LphB8slG.js → .setup/upstream-prompt-provenance-LphB8slG.mjs} +0 -0
- /package/dist/{web-search-provider.shared-BrZmlqyR.js → .setup/web-search-provider.shared-BrZmlqyR.mjs} +0 -0
package/dist/{native-subagent-task-ids-BzTdT0Uw.js → .setup/native-subagent-task-ids-DsuOonKv.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as readNonEmptyString, _ as normalizeOptionalString$1, c as itemName, l as itemStatus, m as shouldSynthesizeToolProgressForItem, w as readNonEmptyStringArray } from "./event-projector-items-
|
|
3
|
-
import { asNonArrayRecord, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
1
|
+
import { m as isJsonObject } from "./config-security-BRQ2mgW9.mjs";
|
|
2
|
+
import { C as readNonEmptyString, _ as normalizeOptionalString$1, c as itemName, l as itemStatus, m as shouldSynthesizeToolProgressForItem, w as readNonEmptyStringArray } from "./event-projector-items-DyTQ_XqL.mjs";
|
|
3
|
+
import { asNonArrayRecord, normalizeOptionalString, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
5
5
|
import { formatToolAggregate, formatToolProgressOutput, inferToolMetaFromArgs } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
6
6
|
import { redactSensitiveFieldValue, redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
@@ -373,15 +373,39 @@ function stringifyJsonValue(value) {
|
|
|
373
373
|
}
|
|
374
374
|
//#endregion
|
|
375
375
|
//#region extensions/codex/src/app-server/native-subagent-task-ids.ts
|
|
376
|
-
/**
|
|
377
|
-
* Shared identifiers for representing Codex native subagents as OpenClaw task
|
|
378
|
-
* runtime rows.
|
|
379
|
-
*/
|
|
380
376
|
/** Task runtime namespace for Codex native subagent task rows. */
|
|
381
377
|
const CODEX_NATIVE_SUBAGENT_RUNTIME = "subagent";
|
|
382
378
|
/** Task kind used to distinguish native Codex subagents from other subagent runtimes. */
|
|
383
379
|
const CODEX_NATIVE_SUBAGENT_TASK_KIND = "codex-native";
|
|
384
380
|
/** Run id prefix for task rows keyed by Codex child thread ids. */
|
|
385
381
|
const CODEX_NATIVE_SUBAGENT_RUN_ID_PREFIX = "codex-thread:";
|
|
382
|
+
/** Initial tasks keep their shipped locator; later assignments belong to a native turn. */
|
|
383
|
+
function codexNativeSubagentRunId(threadId, turnId) {
|
|
384
|
+
return `${CODEX_NATIVE_SUBAGENT_RUN_ID_PREFIX}${threadId.trim()}${turnId ? `:turn:${turnId}` : ""}`;
|
|
385
|
+
}
|
|
386
|
+
function readCodexNativeSubagentRunId(runId) {
|
|
387
|
+
if (!runId?.startsWith("codex-thread:")) return;
|
|
388
|
+
const [threadId, turnId] = runId.slice(13).split(":turn:");
|
|
389
|
+
return threadId?.trim() ? {
|
|
390
|
+
threadId,
|
|
391
|
+
...turnId ? { turnId } : {}
|
|
392
|
+
} : void 0;
|
|
393
|
+
}
|
|
394
|
+
function readNativeTaskAssignment(task) {
|
|
395
|
+
const runId = task.runId;
|
|
396
|
+
const identity = readCodexNativeSubagentRunId(runId);
|
|
397
|
+
if (!runId || !identity) return;
|
|
398
|
+
const storedTurnId = isJsonObject(task.detail) ? normalizeOptionalString(readStringField(task.detail, "nativeTurnId")) : void 0;
|
|
399
|
+
return {
|
|
400
|
+
runId,
|
|
401
|
+
childThreadId: identity.threadId,
|
|
402
|
+
nativeTurnId: storedTurnId ?? identity.turnId,
|
|
403
|
+
initialTurnId: identity.turnId
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
function readNativeSubagentThreadIds(value) {
|
|
407
|
+
if (!Array.isArray(value)) return [];
|
|
408
|
+
return value.filter((entry) => typeof entry === "string" && entry.trim() !== "");
|
|
409
|
+
}
|
|
386
410
|
//#endregion
|
|
387
|
-
export {
|
|
411
|
+
export { truncateToolTranscriptText as A, TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS as C, formatToolSummary as D, formatToolOutput as E, normalizeToolTranscriptArguments as O, TOOL_PROGRESS_ECHO_PREFIX_MIN_CHARS as S, collectDynamicToolContentText as T, inferCodexDynamicToolMeta as _, readCodexNativeSubagentRunId as a, sanitizeCodexToolArguments as b, isCommandBearingToolItem as c, itemOutputText as d, itemToolArgs as f, shouldSuppressChannelProgressForItem as g, itemTranscriptResultText as h, codexNativeSubagentRunId as i, toolOutputRawEchoSignature as k, isNativePostToolUseRelayItem as l, itemToolResult as m, CODEX_NATIVE_SUBAGENT_RUN_ID_PREFIX as n, readNativeSubagentThreadIds as o, itemToolError as p, CODEX_NATIVE_SUBAGENT_TASK_KIND as r, readNativeTaskAssignment as s, CODEX_NATIVE_SUBAGENT_RUNTIME as t, itemMeta as u, isCodexCommandBearingToolCall as v, ToolOutputAccumulator as w, sanitizeCodexToolResponse as x, resolveCodexToolProgressDetailMode as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as formatCodexDisplayText } from "./command-formatters-
|
|
1
|
+
import { o as formatCodexDisplayText } from "./command-formatters-CGEkdawF.mjs";
|
|
2
2
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
4
4
|
import { runCommandBuffered } from "openclaw/plugin-sdk/process-runtime";
|
package/dist/{node-exec-server.runtime-Cl2vapEi.js → .setup/node-exec-server.runtime-BaViBKNz.mjs}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { i as resolveManagedCodexNativeCommand, r as resolveManagedCodexAppServerStartOptions, t as isManagedCodexDesktopCommand } from "./managed-binary-
|
|
2
|
-
import { i as closeCodexAppServerTransportAndWait, t as createStdioTransport } from "./transport-stdio-
|
|
1
|
+
import { i as resolveManagedCodexNativeCommand, r as resolveManagedCodexAppServerStartOptions, t as isManagedCodexDesktopCommand } from "./managed-binary-DP6Rib3P.mjs";
|
|
2
|
+
import { i as closeCodexAppServerTransportAndWait, t as createStdioTransport } from "./transport-stdio-Cmx94Oiy.mjs";
|
|
3
3
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
+
import { stripVTControlCharacters } from "node:util";
|
|
4
5
|
import { killProcessTree } from "openclaw/plugin-sdk/process-runtime";
|
|
5
6
|
import path from "node:path";
|
|
6
7
|
import { mkdir } from "node:fs/promises";
|
|
7
8
|
import { once } from "node:events";
|
|
8
9
|
import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
9
10
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
10
|
-
import { stripVTControlCharacters } from "node:util";
|
|
11
11
|
import { StringDecoder } from "node:string_decoder";
|
|
12
12
|
import { sanitizeEnvVars } from "openclaw/plugin-sdk/sandbox";
|
|
13
13
|
//#region extensions/codex/src/node-exec-server.runtime.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-
|
|
2
|
-
import "./config-
|
|
3
|
-
import {
|
|
1
|
+
import { c as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-DUle8DLz.mjs";
|
|
2
|
+
import "./config-CedDWjM-.mjs";
|
|
3
|
+
import { c as resolveHomePath, i as hasCodexSource, l as sanitizeName, n as defaultCodexHome, o as exists, r as discoverCodexSource, s as readJsonObject, t as codexPluginMigrationSubscriptionWarning } from "./source-Bjp4UQij.mjs";
|
|
4
4
|
import { asBoolean, asOptionalRecord, isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { runCommandBuffered } from "openclaw/plugin-sdk/process-runtime";
|
|
@@ -10,10 +10,56 @@ import { canonicalPathFromExistingAncestor, isPathInside } from "openclaw/plugin
|
|
|
10
10
|
import { readSecretFile } from "openclaw/plugin-sdk/secret-file";
|
|
11
11
|
import { fileURLToPath } from "node:url";
|
|
12
12
|
import { loadAuthProfileStoreWithoutExternalProfiles, resolveAgentConfig, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-runtime";
|
|
13
|
-
import { extractErrorCode } from "openclaw/plugin-sdk/security-runtime";
|
|
14
13
|
import { applyAuthProfileConfig, buildApiKeyCredential, buildOauthProviderAuthResult, buildOpenAICodexCredentialExtra, hasUsableOAuthCredential, resolveOpenAICodexAuthIdentity, resolveOpenAICodexImportProfileName, updateAuthProfileStoreWithLock } from "openclaw/plugin-sdk/provider-auth";
|
|
14
|
+
import { extractErrorCode } from "openclaw/plugin-sdk/security-runtime";
|
|
15
15
|
import { MIGRATION_REASON_TARGET_EXISTS, createMigrationItem, createMigrationManualItem, hasMigrationConfigPatchConflict, markMigrationItemConflict, markMigrationItemError, markMigrationItemSkipped, mergeMigrationConfigValue, readMigrationConfigPath, resolveMigrationConfigRuntime, summarizeMigrationItems } from "openclaw/plugin-sdk/migration";
|
|
16
16
|
import { decodeOpenAICodexJwtPayload } from "openclaw/plugin-sdk/provider-oauth-runtime";
|
|
17
|
+
//#region extensions/codex/src/migration/auth-profile-target.ts
|
|
18
|
+
const OPENAI_PROVIDER_ID$1 = "openai";
|
|
19
|
+
const LEGACY_CODEX_PROFILE_ID = "openai:default";
|
|
20
|
+
function findMatchingOAuthProfile(store, credential) {
|
|
21
|
+
const subject = oauthSubject(credential);
|
|
22
|
+
if (!subject) return;
|
|
23
|
+
for (const [profileId, existing] of Object.entries(store.profiles)) {
|
|
24
|
+
if (existing.type !== "oauth" || existing.provider !== credential.provider) continue;
|
|
25
|
+
const previous = oauthSubject(existing);
|
|
26
|
+
if (previous?.accountId === subject.accountId && previous.userId === subject.userId) return profileId;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function oauthSubject(credential) {
|
|
30
|
+
const claims = decodeOpenAICodexJwtPayload(credential.access)?.["https://api.openai.com/auth"];
|
|
31
|
+
if (!isRecord(claims)) return;
|
|
32
|
+
const accountId = normalizeOptionalString(claims.chatgpt_account_id);
|
|
33
|
+
const userId = normalizeOptionalString(claims.chatgpt_user_id) ?? normalizeOptionalString(claims.user_id);
|
|
34
|
+
return accountId && userId ? {
|
|
35
|
+
accountId,
|
|
36
|
+
userId
|
|
37
|
+
} : void 0;
|
|
38
|
+
}
|
|
39
|
+
function findMatchingApiKeyProfile(store, provider, key) {
|
|
40
|
+
for (const [profileId, existing] of Object.entries(store.profiles)) if (existing.type === "api_key" && existing.provider === provider && existing.key === key) return profileId;
|
|
41
|
+
}
|
|
42
|
+
function itemProfileTarget(credential, store, ctx, source) {
|
|
43
|
+
if (credential.kind === "oauth") {
|
|
44
|
+
const profile = credential.result.profiles[0];
|
|
45
|
+
const matched = profile?.credential.type === "oauth" ? findMatchingOAuthProfile(store, profile.credential) : void 0;
|
|
46
|
+
if (matched) return {
|
|
47
|
+
profileId: matched,
|
|
48
|
+
matchedExisting: true
|
|
49
|
+
};
|
|
50
|
+
const legacyProfile = ctx.config.auth?.profiles?.[LEGACY_CODEX_PROFILE_ID];
|
|
51
|
+
return {
|
|
52
|
+
profileId: legacyProfile?.provider === OPENAI_PROVIDER_ID$1 && legacyProfile.mode === "oauth" && source.codexHome === defaultCodexHome() && profile?.credential.type === "oauth" && oauthSubject(profile.credential) !== void 0 && !Object.entries(store.profiles).some(([id, existing]) => id !== "openai:default" && existing.type === "oauth" && existing.provider === OPENAI_PROVIDER_ID$1) ? LEGACY_CODEX_PROFILE_ID : credential.profileId,
|
|
53
|
+
matchedExisting: false
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const matched = findMatchingApiKeyProfile(store, credential.provider, credential.key);
|
|
57
|
+
return {
|
|
58
|
+
profileId: matched ?? credential.profileId,
|
|
59
|
+
matchedExisting: Boolean(matched)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
17
63
|
//#region extensions/codex/src/migration/cli-credentials.ts
|
|
18
64
|
/** Explicit migration reads the storage selected by the native credential owner. */
|
|
19
65
|
async function readAuthFile(home) {
|
|
@@ -48,8 +94,8 @@ async function readDirectKeyring(home, signal) {
|
|
|
48
94
|
async function readSelectedCredentialStorage(options, requireApiKey) {
|
|
49
95
|
options.signal?.throwIfAborted();
|
|
50
96
|
const home = await fs.realpath(options.codexHome).catch(() => path.resolve(options.codexHome));
|
|
51
|
-
const { CodexAppServerClient } = await import("./client-
|
|
52
|
-
const { resolveManagedCodexPackageEntrypoint, resolveManagedCodexNativeCommand } = await import("./managed-binary-
|
|
97
|
+
const { CodexAppServerClient } = await import("./client-vXs2929Q.mjs").then((n) => n.n);
|
|
98
|
+
const { resolveManagedCodexPackageEntrypoint, resolveManagedCodexNativeCommand } = await import("./managed-binary-DP6Rib3P.mjs").then((n) => n.n);
|
|
53
99
|
const launcher = resolveManagedCodexPackageEntrypoint(path.dirname(fileURLToPath(import.meta.url)));
|
|
54
100
|
const command = launcher ? resolveManagedCodexNativeCommand(launcher) : void 0;
|
|
55
101
|
if (!command) return;
|
|
@@ -164,7 +210,7 @@ async function readCodexCliActiveApiKeyAsync(options) {
|
|
|
164
210
|
const OPENAI_PROVIDER_ID = "openai";
|
|
165
211
|
const OPENAI_OAUTH_ITEM_ID = "auth:openai";
|
|
166
212
|
const OPENAI_API_KEY_ITEM_ID = "auth:openai:api-key";
|
|
167
|
-
const OPENAI_CODEX_DEFAULT_MODEL = "openai/gpt-
|
|
213
|
+
const OPENAI_CODEX_DEFAULT_MODEL = "openai/gpt-6-astra";
|
|
168
214
|
const CODEX_IMPORT_DISPLAY_NAME = "Codex import";
|
|
169
215
|
const CODEX_REASON_AUTH_NOT_SELECTED = "auth credential migration not selected";
|
|
170
216
|
const CODEX_REASON_AUTH_PROFILE_EXISTS = "auth profile exists";
|
|
@@ -255,43 +301,6 @@ async function readCodexAuthCredentials(source, options) {
|
|
|
255
301
|
...options.signal ? { signal: options.signal } : {}
|
|
256
302
|
}), options.credentialKind === "oauth" ? null : await buildCodexApiKeyCredential(source, options.allowKeychainPrompt, options.signal)].filter((entry) => entry !== null);
|
|
257
303
|
}
|
|
258
|
-
function findMatchingOAuthProfile(store, credential) {
|
|
259
|
-
const subject = oauthSubject(credential);
|
|
260
|
-
if (!subject) return;
|
|
261
|
-
for (const [profileId, existing] of Object.entries(store.profiles)) {
|
|
262
|
-
if (existing.type !== "oauth" || existing.provider !== credential.provider) continue;
|
|
263
|
-
const previous = oauthSubject(existing);
|
|
264
|
-
if (previous?.accountId === subject.accountId && previous.userId === subject.userId) return profileId;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
function oauthSubject(credential) {
|
|
268
|
-
const claims = decodeOpenAICodexJwtPayload(credential.access)?.["https://api.openai.com/auth"];
|
|
269
|
-
if (!isRecord(claims)) return;
|
|
270
|
-
const accountId = normalizeOptionalString(claims.chatgpt_account_id);
|
|
271
|
-
const userId = normalizeOptionalString(claims.chatgpt_user_id) ?? normalizeOptionalString(claims.user_id);
|
|
272
|
-
return accountId && userId ? {
|
|
273
|
-
accountId,
|
|
274
|
-
userId
|
|
275
|
-
} : void 0;
|
|
276
|
-
}
|
|
277
|
-
function findMatchingApiKeyProfile(store, provider, key) {
|
|
278
|
-
for (const [profileId, existing] of Object.entries(store.profiles)) if (existing.type === "api_key" && existing.provider === provider && existing.key === key) return profileId;
|
|
279
|
-
}
|
|
280
|
-
function itemProfileTarget(credential, store) {
|
|
281
|
-
if (credential.kind === "oauth") {
|
|
282
|
-
const profile = credential.result.profiles[0];
|
|
283
|
-
const matched = profile?.credential.type === "oauth" ? findMatchingOAuthProfile(store, profile.credential) : void 0;
|
|
284
|
-
return {
|
|
285
|
-
profileId: matched ?? credential.profileId,
|
|
286
|
-
matchedExisting: Boolean(matched)
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
const matched = findMatchingApiKeyProfile(store, credential.provider, credential.key);
|
|
290
|
-
return {
|
|
291
|
-
profileId: matched ?? credential.profileId,
|
|
292
|
-
matchedExisting: Boolean(matched)
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
304
|
function replaceConfigDraft(draft, next) {
|
|
296
305
|
for (const key of Object.keys(draft)) delete draft[key];
|
|
297
306
|
Object.assign(draft, next);
|
|
@@ -437,7 +446,7 @@ async function buildCodexAuthItems(params) {
|
|
|
437
446
|
const store = loadAuthProfileStoreWithoutExternalProfiles(params.targets.agentDir);
|
|
438
447
|
const skipped = !params.ctx.includeSecrets;
|
|
439
448
|
return credentials.map((credential) => {
|
|
440
|
-
const { profileId, matchedExisting } = itemProfileTarget(credential, store);
|
|
449
|
+
const { profileId, matchedExisting } = itemProfileTarget(credential, store, params.ctx, params.source);
|
|
441
450
|
const existing = store.profiles[profileId];
|
|
442
451
|
const configProfile = authProfileConfigForCredential(credential, profileId);
|
|
443
452
|
const configConflict = configProfile ? hasAuthProfileConfigConflict(params.ctx.config, configProfile, Boolean(params.ctx.overwrite)) : false;
|
|
@@ -459,6 +468,7 @@ async function buildCodexAuthItems(params) {
|
|
|
459
468
|
sourceProfileId: credential.profileId,
|
|
460
469
|
sourceCredentialFingerprint: sourceCredentialFingerprint(credential),
|
|
461
470
|
sourceKind: "codex-native-selected-storage",
|
|
471
|
+
...profileId === "openai:default" && !matchedExisting ? { legacyNativeHome: params.source.codexHome } : {},
|
|
462
472
|
credentialKind: credential.kind,
|
|
463
473
|
credentialImportUnavailable: unavailable
|
|
464
474
|
}
|
|
@@ -482,6 +492,7 @@ async function applyCodexAuthItems(params) {
|
|
|
482
492
|
})).find((candidate) => candidate.provider === provider && candidate.kind === credentialKind && (!sourceProfileId || candidate.profileId === sourceProfileId));
|
|
483
493
|
if (!credential) return [markMigrationItemSkipped(item, CODEX_REASON_AUTH_NO_LONGER_PRESENT)];
|
|
484
494
|
if (item.details?.sourceCredentialFingerprint !== sourceCredentialFingerprint(credential)) return [markMigrationItemSkipped(item, CODEX_REASON_AUTH_NO_LONGER_PRESENT)];
|
|
495
|
+
if (item.details?.legacyNativeHome !== void 0 && (item.details.legacyNativeHome !== source.codexHome || source.codexHome !== defaultCodexHome())) return [markMigrationItemSkipped(item, CODEX_REASON_AUTH_NO_LONGER_PRESENT)];
|
|
485
496
|
ctx.signal?.throwIfAborted();
|
|
486
497
|
const oauthProfile = credential.kind === "oauth" ? credential.result.profiles[0] : void 0;
|
|
487
498
|
const oauthCredential = oauthProfile?.credential.type === "oauth" ? oauthProfile.credential : void 0;
|
|
@@ -497,9 +508,14 @@ async function applyCodexAuthItems(params) {
|
|
|
497
508
|
stateDir: ctx.stateDir,
|
|
498
509
|
updater: (freshStore) => {
|
|
499
510
|
ctx.signal?.throwIfAborted();
|
|
500
|
-
const
|
|
511
|
+
const effectiveStore = loadAuthProfileStoreWithoutExternalProfiles(targets.agentDir);
|
|
512
|
+
if (item.details?.legacyNativeHome !== void 0 && itemProfileTarget(credential, effectiveStore, ctx, source).profileId !== profileId) {
|
|
513
|
+
conflicted = true;
|
|
514
|
+
return false;
|
|
515
|
+
}
|
|
516
|
+
const existing = effectiveStore.profiles[profileId];
|
|
501
517
|
if (!ctx.overwrite && existing) {
|
|
502
|
-
if ((credential.kind === "oauth" ? findMatchingOAuthProfile(
|
|
518
|
+
if ((credential.kind === "oauth" ? findMatchingOAuthProfile(effectiveStore, oauthCredential) : findMatchingApiKeyProfile(effectiveStore, credential.provider, credential.key)) === profileId) {
|
|
503
519
|
unusable = existing.type === "oauth" && !hasUsableOAuthCredential(existing);
|
|
504
520
|
return false;
|
|
505
521
|
}
|
|
@@ -519,7 +535,7 @@ async function applyCodexAuthItems(params) {
|
|
|
519
535
|
});
|
|
520
536
|
if (conflicted) return [markMigrationItemConflict(item, CODEX_REASON_AUTH_PROFILE_EXISTS)];
|
|
521
537
|
if (unusable) return [markMigrationItemSkipped(item, CODEX_REASON_AUTH_PROFILE_UNUSABLE)];
|
|
522
|
-
if (!store
|
|
538
|
+
if (!store || !loadAuthProfileStoreWithoutExternalProfiles(targets.agentDir).profiles[profileId]) return [markMigrationItemError(item, CODEX_REASON_AUTH_PROFILE_WRITE_FAILED)];
|
|
523
539
|
const configResult = configPatchMode !== "apply" ? "unavailable" : await applyCodexAuthConfig(ctx, credential, profileId);
|
|
524
540
|
if (configResult === "conflict") return [markMigrationItemConflict(item, CODEX_REASON_AUTH_PROFILE_EXISTS)];
|
|
525
541
|
const migratedItem = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as CODEX_PLUGINS_MARKETPLACE_NAME, i as pluginReadParams, n as isOpenAiCuratedMarketplace, r as isOpenAiCuratedMarketplaceName, t as findCodexMarketplacePluginSummary } from "./plugin-inventory-
|
|
2
|
-
import {
|
|
3
|
-
import "./config-
|
|
1
|
+
import { c as CODEX_PLUGINS_MARKETPLACE_NAME, i as pluginReadParams, n as isOpenAiCuratedMarketplace, r as isOpenAiCuratedMarketplaceName, t as findCodexMarketplacePluginSummary } from "./plugin-inventory-DUle8DLz.mjs";
|
|
2
|
+
import { i as CodexAppServerRpcError } from "./timeout-DZF05XrR.mjs";
|
|
3
|
+
import "./config-CedDWjM-.mjs";
|
|
4
4
|
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
5
|
//#region extensions/codex/src/app-server/plugin-activation.ts
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as resolveCodexAppServerUserHomeDir, g as resolveCodexAppServerLocalHomeDir, h as resolveCodexAppServerHomeDir } from "./config-security-BRQ2mgW9.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
@@ -6,6 +6,22 @@ import { OPENCLAW_VERSION, embeddedAgentLog } from "openclaw/plugin-sdk/agent-ha
|
|
|
6
6
|
import { isFutureDateTimestampMs, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
7
7
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
8
8
|
import { readPluginPackageVersion } from "openclaw/plugin-sdk/extension-shared";
|
|
9
|
+
//#region extensions/codex/src/app-server/app-identity.ts
|
|
10
|
+
/**
|
|
11
|
+
* Apps SDK manifests and installed Codex connections can name the same app
|
|
12
|
+
* with asdk_app_ and legacy connector_ prefixes. Only the shared 128-bit ID
|
|
13
|
+
* establishes equivalence; display names never establish app ownership.
|
|
14
|
+
* Keep the installed ID for native config and calls. This comparison bridge
|
|
15
|
+
* can retire when installed inventories consistently return Apps SDK IDs.
|
|
16
|
+
*/
|
|
17
|
+
function codexAppIdentityKey(id) {
|
|
18
|
+
return id.replace(/^connector_([a-f0-9]{32})$/, "asdk_app_$1");
|
|
19
|
+
}
|
|
20
|
+
/** Resolves a declared app against account-authorized runtime metadata. */
|
|
21
|
+
function findCodexAppById(apps, id) {
|
|
22
|
+
return apps.find((app) => app.id === id) ?? apps.find((app) => codexAppIdentityKey(app.id) === codexAppIdentityKey(id));
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
9
25
|
//#region extensions/codex/src/app-server/app-inventory-cache.ts
|
|
10
26
|
/**
|
|
11
27
|
* Process-local cache for Codex app-server app inventories, keyed by runtime
|
|
@@ -69,7 +85,7 @@ var CodexAppInventoryCache = class {
|
|
|
69
85
|
};
|
|
70
86
|
const entry = this.entries.get(key);
|
|
71
87
|
if (entry) {
|
|
72
|
-
const scope = invalidatedAppIds?.filter(Boolean) ?? [];
|
|
88
|
+
const scope = invalidatedAppIds?.filter(Boolean).map(codexAppIdentityKey) ?? [];
|
|
73
89
|
if (!entry.invalidated) entry.invalidatedAppIds = scope.length ? [...scope].toSorted() : void 0;
|
|
74
90
|
else if (entry.invalidatedAppIds && scope.length) entry.invalidatedAppIds = Array.from(/* @__PURE__ */ new Set([...entry.invalidatedAppIds, ...scope])).toSorted();
|
|
75
91
|
else entry.invalidatedAppIds = void 0;
|
|
@@ -106,7 +122,7 @@ var CodexAppInventoryCache = class {
|
|
|
106
122
|
const promise = this.refreshUncoalesced(params, refreshToken, previousRefresh);
|
|
107
123
|
const currentRefresh = {
|
|
108
124
|
promise,
|
|
109
|
-
targetAppIds: new Set(params.targetAppIds?.filter(Boolean) ?? [])
|
|
125
|
+
targetAppIds: new Set(params.targetAppIds?.filter(Boolean).map(codexAppIdentityKey) ?? [])
|
|
110
126
|
};
|
|
111
127
|
this.inFlight.set(params.key, currentRefresh);
|
|
112
128
|
try {
|
|
@@ -133,7 +149,7 @@ var CodexAppInventoryCache = class {
|
|
|
133
149
|
key: params.key,
|
|
134
150
|
apps: inventory.apps,
|
|
135
151
|
installedApps: inventory.installedApps,
|
|
136
|
-
...params.targetAppIds?.some(Boolean) ? { targetAppIds: Array.from(new Set(params.targetAppIds.filter(Boolean))).toSorted() } : {},
|
|
152
|
+
...params.targetAppIds?.some(Boolean) ? { targetAppIds: Array.from(new Set(params.targetAppIds.filter(Boolean).map(codexAppIdentityKey))).toSorted() } : {},
|
|
137
153
|
fetchedAtMs: nowMs,
|
|
138
154
|
expiresAtMs,
|
|
139
155
|
revision: this.revision
|
|
@@ -191,13 +207,13 @@ function resolvePublishedInventorySnapshot(existing, snapshot, nowMs) {
|
|
|
191
207
|
}
|
|
192
208
|
/** Replaces refreshed target rows in place, deletes vanished ones, appends new ones. */
|
|
193
209
|
function mergeRefreshedRows(existingRows, refreshedRows, refreshedTargetIds) {
|
|
194
|
-
const refreshedById = new Map(refreshedRows.map((row) => [row.id, row]));
|
|
195
|
-
const existingIds = new Set(existingRows.map((row) => row.id));
|
|
210
|
+
const refreshedById = new Map(refreshedRows.map((row) => [codexAppIdentityKey(row.id), row]));
|
|
211
|
+
const existingIds = new Set(existingRows.map((row) => codexAppIdentityKey(row.id)));
|
|
196
212
|
return [...existingRows.flatMap((row) => {
|
|
197
|
-
if (!refreshedTargetIds.has(row.id)) return [row];
|
|
198
|
-
const refreshed = refreshedById.get(row.id);
|
|
213
|
+
if (!refreshedTargetIds.has(codexAppIdentityKey(row.id))) return [row];
|
|
214
|
+
const refreshed = refreshedById.get(codexAppIdentityKey(row.id));
|
|
199
215
|
return refreshed ? [refreshed] : [];
|
|
200
|
-
}), ...refreshedRows.filter((row) => !existingIds.has(row.id))];
|
|
216
|
+
}), ...refreshedRows.filter((row) => !existingIds.has(codexAppIdentityKey(row.id)))];
|
|
201
217
|
}
|
|
202
218
|
/**
|
|
203
219
|
* A refresh retires exactly the invalidation scope it re-read: a complete
|
|
@@ -217,7 +233,7 @@ function resolveRemainingInvalidationScope(existing, snapshot) {
|
|
|
217
233
|
}
|
|
218
234
|
function doesInFlightRefreshCover(existing, params) {
|
|
219
235
|
if (existing.targetAppIds.size === 0) return true;
|
|
220
|
-
const requestedAppIds = new Set(params.targetAppIds?.filter(Boolean) ?? []);
|
|
236
|
+
const requestedAppIds = new Set(params.targetAppIds?.filter(Boolean).map(codexAppIdentityKey) ?? []);
|
|
221
237
|
return requestedAppIds.size > 0 && Array.from(requestedAppIds).every((appId) => existing.targetAppIds.has(appId));
|
|
222
238
|
}
|
|
223
239
|
/** Serializes a refresh failure without leaking large or sensitive error data. */
|
|
@@ -257,8 +273,8 @@ function normalizeRuntimeIdentityForCacheKey(value) {
|
|
|
257
273
|
}
|
|
258
274
|
async function readInstalledApps(request, options) {
|
|
259
275
|
const installed = await request("app/installed", { forceRefresh: options.forceRefresh });
|
|
260
|
-
const targetIds = new Set((options.targetAppIds ?? []).filter(Boolean));
|
|
261
|
-
const apps = targetIds.size === 0 ? installed.apps : installed.apps.filter((app) => targetIds.has(app.id));
|
|
276
|
+
const targetIds = new Set((options.targetAppIds ?? []).filter(Boolean).map(codexAppIdentityKey));
|
|
277
|
+
const apps = targetIds.size === 0 ? installed.apps : installed.apps.filter((app) => targetIds.has(codexAppIdentityKey(app.id)));
|
|
262
278
|
if (apps.length === 0) return {
|
|
263
279
|
apps: [],
|
|
264
280
|
installedApps: []
|
|
@@ -335,14 +351,6 @@ function isSensitiveErrorDataKey(key) {
|
|
|
335
351
|
*/
|
|
336
352
|
const require = createRequire(import.meta.url);
|
|
337
353
|
const CODEX_PLUGIN_VERSION = readPluginPackageVersion({ require });
|
|
338
|
-
let catalogConnectionHomes = /* @__PURE__ */ new Map();
|
|
339
|
-
function catalogConnectionHomeKey(fingerprint, agentDir) {
|
|
340
|
-
return `${agentDir ?? ""}\0${fingerprint}`;
|
|
341
|
-
}
|
|
342
|
-
/** Replaces the lifecycle-owned catalog connection snapshot used by supervised bindings. */
|
|
343
|
-
function replaceCodexCatalogConnectionHomes(homes) {
|
|
344
|
-
catalogConnectionHomes = new Map(homes.map((home) => [catalogConnectionHomeKey(home.fingerprint, home.agentDir), home.codexHome]));
|
|
345
|
-
}
|
|
346
354
|
/** Builds the full app inventory cache key for Codex plugin/app discovery. */
|
|
347
355
|
function buildCodexPluginAppCacheKey(params) {
|
|
348
356
|
return buildCodexAppInventoryCacheKey({
|
|
@@ -379,10 +387,6 @@ function buildCodexAppServerConnectionFingerprint(appServer, agentDir) {
|
|
|
379
387
|
cwd: appServer.start.cwd ?? null
|
|
380
388
|
});
|
|
381
389
|
}
|
|
382
|
-
/** Looks up a snapshotted catalog store without repeating filesystem discovery on a run. */
|
|
383
|
-
function resolveCodexCatalogConnectionHome(fingerprint, agentDir) {
|
|
384
|
-
return catalogConnectionHomes.get(catalogConnectionHomeKey(fingerprint, agentDir));
|
|
385
|
-
}
|
|
386
390
|
function resolveCodexAppServerConnectionHome(start, agentDir) {
|
|
387
391
|
const configured = start.env?.CODEX_HOME?.trim();
|
|
388
392
|
if (configured) return configured;
|
|
@@ -424,4 +428,4 @@ function fingerprintCodexPluginAppCacheCredentials(startOptions) {
|
|
|
424
428
|
return `sha256:${hash.digest("hex")}`;
|
|
425
429
|
}
|
|
426
430
|
//#endregion
|
|
427
|
-
export {
|
|
431
|
+
export { defaultCodexAppInventoryCache as a, findCodexAppById as c, CodexAppInventoryCache as i, buildCodexAppServerRuntimeFingerprint as n, serializeCodexAppInventoryError as o, buildCodexPluginAppCacheKey as r, codexAppIdentityKey as s, buildCodexAppServerConnectionFingerprint as t };
|
package/dist/{plugin-approval-roundtrip-Bz3FT8W5.js → .setup/plugin-approval-roundtrip-CjfzafAZ.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { it as resolveCodexGatewayTimeoutWithGraceMs } from "./shared-client-BpTtuLQ5.mjs";
|
|
2
2
|
import { isApprovalNotFoundError, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
3
3
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
4
4
|
//#region extensions/codex/src/app-server/plugin-approval-roundtrip.ts
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
1
|
+
import { f as resolveCodexPluginsPolicy } from "./config-parsing-CcB9iPoq.mjs";
|
|
2
|
+
import { c as findCodexAppById } from "./plugin-app-cache-key-BOxKP7db.mjs";
|
|
3
|
+
import "./config-CedDWjM-.mjs";
|
|
3
4
|
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
4
5
|
//#region extensions/codex/src/app-server/config-contracts.ts
|
|
5
6
|
const CODEX_PLUGINS_MARKETPLACE_NAME = "openai-curated";
|
|
@@ -109,7 +110,7 @@ async function readCodexPluginInventory(params) {
|
|
|
109
110
|
activationRequired: pluginPolicy.enabled && (unavailableByMarketplacePolicy || !summary.installed || !summary.enabled),
|
|
110
111
|
authRequired: apps.some((app) => app.needsAuth || !app.accessible),
|
|
111
112
|
appOwnership,
|
|
112
|
-
ownedAppIds,
|
|
113
|
+
ownedAppIds: Array.from(/* @__PURE__ */ new Set([...ownedAppIds, ...apps.map((app) => app.id)])).toSorted(),
|
|
113
114
|
apps
|
|
114
115
|
});
|
|
115
116
|
}
|
|
@@ -237,9 +238,9 @@ function resolveOwnedApps(params) {
|
|
|
237
238
|
});
|
|
238
239
|
return [];
|
|
239
240
|
}
|
|
240
|
-
const
|
|
241
|
+
const appInfos = params.appInventory?.snapshot?.apps ?? [];
|
|
241
242
|
return detailApps.map((app) => {
|
|
242
|
-
const info =
|
|
243
|
+
const info = findCodexAppById(appInfos, app.id);
|
|
243
244
|
if (!info) return {
|
|
244
245
|
id: app.id,
|
|
245
246
|
name: app.name,
|
|
@@ -248,7 +249,7 @@ function resolveOwnedApps(params) {
|
|
|
248
249
|
needsAuth: true
|
|
249
250
|
};
|
|
250
251
|
return Object.assign({
|
|
251
|
-
id:
|
|
252
|
+
id: info.id,
|
|
252
253
|
name: app.name,
|
|
253
254
|
accessible: info.isAccessible,
|
|
254
255
|
enabled: info.isEnabled,
|
package/dist/{plugin-metadata-cache-ClPJpRio.js → .setup/plugin-metadata-cache-DsS5buNa.mjs}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { s as
|
|
3
|
-
import {
|
|
4
|
-
import { l as resolveMacOSDesktopCodexBundledMarketplaceCandidates, s as resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath, t as isManagedCodexDesktopCommand } from "./managed-binary-
|
|
5
|
-
import { n as describeControlFailure } from "./capabilities-
|
|
6
|
-
import { i as requestCodexAppServerJson } from "./request-
|
|
7
|
-
import "./config-
|
|
8
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
9
|
-
import { $ as
|
|
1
|
+
import { h as resolveCodexAppServerHomeDir } from "./config-security-BRQ2mgW9.mjs";
|
|
2
|
+
import { c as isCodexAppServerIndeterminateTransportError, o as isCodexAppServerConnectionClosedError, s as isCodexAppServerIndeterminateRequestCancellationError } from "./client-vXs2929Q.mjs";
|
|
3
|
+
import { o as resolveCodexComputerUseConfig } from "./config-options-BsanJ8QG.mjs";
|
|
4
|
+
import { l as resolveMacOSDesktopCodexBundledMarketplaceCandidates, s as resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath, t as isManagedCodexDesktopCommand } from "./managed-binary-DP6Rib3P.mjs";
|
|
5
|
+
import { n as describeControlFailure } from "./capabilities-_vXcZGSx.mjs";
|
|
6
|
+
import { i as requestCodexAppServerJson } from "./request-BioXJLYa.mjs";
|
|
7
|
+
import "./config-CedDWjM-.mjs";
|
|
8
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-CeAhl_h4.mjs";
|
|
9
|
+
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 } from "./shared-client-BpTtuLQ5.mjs";
|
|
10
10
|
import { existsSync } from "node:fs";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import fs$1 from "node:fs/promises";
|
|
@@ -33,6 +33,9 @@ const COMPUTER_USE_MARKETPLACE_NAME_PRIORITY = [
|
|
|
33
33
|
];
|
|
34
34
|
const COMPUTER_USE_LIVE_TEST_RETRY_COUNT = 1;
|
|
35
35
|
const COMPUTER_USE_LIVE_TEST_THREAD_NAME = "OpenClaw Computer Use readiness probe";
|
|
36
|
+
const COMPUTER_USE_LIST_APPS_TOOL = "list_apps";
|
|
37
|
+
const COMPUTER_USE_UNIFIED_JS_TOOL = "js";
|
|
38
|
+
const COMPUTER_USE_UNIFIED_JS_PROBE = "await cua.getState();";
|
|
36
39
|
/** Reads Computer Use readiness without installing or mutating app-server state. */
|
|
37
40
|
async function readCodexComputerUseStatus(params = {}) {
|
|
38
41
|
const config = resolveComputerUseConfig(params);
|
|
@@ -318,7 +321,8 @@ async function readComputerUseTools(params) {
|
|
|
318
321
|
params.releaseNativeConfigFence?.();
|
|
319
322
|
const { liveTest, repair } = await runCodexComputerUseLiveTest({
|
|
320
323
|
request: params.request,
|
|
321
|
-
config: params.config
|
|
324
|
+
config: params.config,
|
|
325
|
+
tools
|
|
322
326
|
});
|
|
323
327
|
const compatibilityStartupAllowed = !liveTest.ok && !params.config.strictReadiness;
|
|
324
328
|
return {
|
|
@@ -342,6 +346,7 @@ async function runCodexComputerUseLiveTest(params) {
|
|
|
342
346
|
const startedAt = Date.now();
|
|
343
347
|
let lastError;
|
|
344
348
|
let repair;
|
|
349
|
+
const probe = resolveComputerUseLiveTestProbe(params.tools);
|
|
345
350
|
for (let attempt = 0; attempt <= COMPUTER_USE_LIVE_TEST_RETRY_COUNT; attempt += 1) {
|
|
346
351
|
let threadId;
|
|
347
352
|
try {
|
|
@@ -350,12 +355,12 @@ async function runCodexComputerUseLiveTest(params) {
|
|
|
350
355
|
developerInstructions: COMPUTER_USE_LIVE_TEST_THREAD_NAME,
|
|
351
356
|
ephemeral: true
|
|
352
357
|
}, { timeoutMs: params.config.liveTestTimeoutMs })).thread.id;
|
|
353
|
-
await params.request("mcpServer/tool/call", {
|
|
358
|
+
if ((await params.request("mcpServer/tool/call", {
|
|
354
359
|
threadId,
|
|
355
360
|
server: params.config.mcpServerName,
|
|
356
|
-
tool:
|
|
357
|
-
arguments:
|
|
358
|
-
}, { timeoutMs: params.config.toolCallTimeoutMs });
|
|
361
|
+
tool: probe.tool,
|
|
362
|
+
arguments: probe.arguments
|
|
363
|
+
}, { timeoutMs: params.config.toolCallTimeoutMs })).isError === true) throw new Error(`Computer Use readiness tool ${params.config.mcpServerName}.${probe.tool} returned an error result`);
|
|
359
364
|
return {
|
|
360
365
|
liveTest: {
|
|
361
366
|
status: "passed",
|
|
@@ -395,6 +400,16 @@ async function runCodexComputerUseLiveTest(params) {
|
|
|
395
400
|
...repair ? { repair } : {}
|
|
396
401
|
};
|
|
397
402
|
}
|
|
403
|
+
function resolveComputerUseLiveTestProbe(tools) {
|
|
404
|
+
if (tools?.includes(COMPUTER_USE_UNIFIED_JS_TOOL) && !tools.includes(COMPUTER_USE_LIST_APPS_TOOL)) return {
|
|
405
|
+
tool: COMPUTER_USE_UNIFIED_JS_TOOL,
|
|
406
|
+
arguments: { code: COMPUTER_USE_UNIFIED_JS_PROBE }
|
|
407
|
+
};
|
|
408
|
+
return {
|
|
409
|
+
tool: COMPUTER_USE_LIST_APPS_TOOL,
|
|
410
|
+
arguments: {}
|
|
411
|
+
};
|
|
412
|
+
}
|
|
398
413
|
async function repairComputerUseMcpRuntime(request, config) {
|
|
399
414
|
try {
|
|
400
415
|
await request("config/mcpServer/reload", void 0, { timeoutMs: config.liveTestTimeoutMs });
|
package/dist/{provider-capabilities-BvCUL69A.js → .setup/provider-capabilities-B8J4Dy-O.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-
|
|
2
|
-
import {
|
|
1
|
+
import { h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-BpTtuLQ5.mjs";
|
|
2
|
+
import { lt as normalizeCodexDynamicToolName } from "./thread-lifecycle-Cik28qWn.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
|
|
@@ -12,7 +12,7 @@ function buildCodexMigrationProvider(params = {}) {
|
|
|
12
12
|
description: "Import Codex memory and skills while keeping Codex native plugins and hooks explicit.",
|
|
13
13
|
supportedItemKinds: ["memory", "auth"],
|
|
14
14
|
async detect(ctx) {
|
|
15
|
-
const { discoverCodexSource, hasCodexSource } = await import("./source-
|
|
15
|
+
const { discoverCodexSource, hasCodexSource } = await import("./source-Bjp4UQij.mjs").then((n) => n.a);
|
|
16
16
|
const source = await discoverCodexSource({
|
|
17
17
|
input: ctx.source,
|
|
18
18
|
memoryOnly: isMemoryOnlyMigration(ctx),
|
|
@@ -28,16 +28,16 @@ function buildCodexMigrationProvider(params = {}) {
|
|
|
28
28
|
};
|
|
29
29
|
},
|
|
30
30
|
async plan(ctx) {
|
|
31
|
-
const { buildCodexMigrationPlan } = await import("./plan-
|
|
31
|
+
const { buildCodexMigrationPlan } = await import("./plan-xD7WKYTM.mjs");
|
|
32
32
|
return buildCodexMigrationPlan(ctx);
|
|
33
33
|
},
|
|
34
34
|
deferredApply: { retrySafe: true },
|
|
35
35
|
prepareApply(ctx) {
|
|
36
36
|
if (isMemoryOnlyMigration(ctx) || isAuthOnlyMigration(ctx)) return;
|
|
37
|
-
return import("./apply-
|
|
37
|
+
return import("./apply-CJ0ZfmBG.mjs").then(({ prepareTargetCodexAppServer }) => prepareTargetCodexAppServer(ctx));
|
|
38
38
|
},
|
|
39
39
|
async apply(ctx, plan) {
|
|
40
|
-
const { applyCodexMigrationPlan } = await import("./apply-
|
|
40
|
+
const { applyCodexMigrationPlan } = await import("./apply-CJ0ZfmBG.mjs");
|
|
41
41
|
return await applyCodexMigrationPlan({
|
|
42
42
|
ctx,
|
|
43
43
|
plan,
|