@openclaw/codex 2026.9.6 → 2026.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/assets/icon.png +0 -0
- package/dist/.setup/{account-usage-runtime-Eem_WGqY.mjs → account-usage-runtime-G348lY1q.mjs} +5 -5
- package/dist/.setup/{apply-DDOi8uNx.mjs → apply-Cqb-YoCS.mjs} +22 -36
- package/dist/.setup/{attempt-client-cleanup-CEv1cKwF.mjs → attempt-client-cleanup-B-S7ngS_.mjs} +128 -37
- package/dist/.setup/attempt-workspace-context-BJ5Z_olH.mjs +164 -0
- package/dist/.setup/{auth-binding-DhLWa_7K.mjs → auth-binding-BLWz7stm.mjs} +14 -1
- package/dist/.setup/{auth-cache-key-B2mpaI9D.mjs → auth-cache-key-Dnps4W4_.mjs} +36 -34
- package/dist/.setup/{auth-profile-WqZtZfXN.mjs → auth-profile-B0okYl2D.mjs} +1 -2
- package/dist/.setup/auth-start-options-BPIPeEX8.mjs +44 -0
- package/dist/.setup/{binding-connection-ThoatDcb.mjs → binding-connection-DTtN1KrX.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-yoHrABt-.mjs → binding-connection.runtime-6TpgD1M6.mjs} +4 -4
- package/dist/.setup/{bounded-turn-B2HScEgT.mjs → bounded-turn-BNunZPtz.mjs} +15 -18
- package/dist/.setup/bounded-turn-isolation-B8K_ylqk.mjs +14 -0
- package/dist/.setup/{build-state-C7EnDVgr.mjs → build-state-DIQ5O_-S.mjs} +1 -1
- package/dist/.setup/{capabilities-CDXOOFdZ.mjs → capabilities-B3WEZl4e.mjs} +2 -10
- package/dist/.setup/{client-catalog-response-BMgt_4q4.mjs → client-catalog-response-DRvx_wCC.mjs} +1 -1
- package/dist/.setup/{client-Cs08OXVQ.mjs → client-qyUBJlGZ.mjs} +138 -399
- package/dist/.setup/{command-dispatch-B4JuOsOk.mjs → command-dispatch-Btrs1D6f.mjs} +5 -8
- package/dist/.setup/{command-formatters-Bmqvr9tO.mjs → command-formatters-R3ckE3Co.mjs} +29 -61
- package/dist/.setup/{command-handlers-DW7Lx9oH.mjs → command-handlers-DvlCHJch.mjs} +222 -343
- package/dist/.setup/{command-rpc-DixIj3HW.mjs → command-rpc-skzRq4wD.mjs} +15 -18
- package/dist/.setup/compact-8ttks5U5.mjs +776 -0
- package/dist/.setup/{config-BoTP_mrL.mjs → config-DKhXquav.mjs} +26 -28
- package/dist/.setup/{config-options-BvaRs51b.mjs → config-options-CzyWLTJt.mjs} +24 -37
- package/dist/.setup/{config-parsing-CcB9iPoq.mjs → config-parsing-b088LyhT.mjs} +57 -60
- package/dist/.setup/{config-runtime-C8Rw1m1m.mjs → config-runtime-C0NbLms1.mjs} +2 -2
- package/dist/.setup/{config-security-BEReZ6go.mjs → config-security-CE-FcGw9.mjs} +32 -111
- package/dist/.setup/{config-utils-DujwEnhg.mjs → config-utils-D0CXecki.mjs} +3 -13
- package/dist/.setup/context-engine-projection-PezSESth.mjs +387 -0
- package/dist/.setup/{conversation-binding-DP-gMrBP.mjs → conversation-binding-74LaGGH-.mjs} +67 -90
- package/dist/.setup/{conversation-binding-data-CrcyZk6O.mjs → conversation-binding-data-C746z5Pn.mjs} +8 -12
- package/dist/.setup/{conversation-control-uK9Jomlc.mjs → conversation-control-OrN6zuaY.mjs} +8 -8
- package/dist/.setup/{cyber-failover-DYwbmf1o.mjs → cyber-failover-XV0nNRZu.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-e9G3J9-e.mjs → cyber-failover-notice-RNpGpTyP.mjs} +1 -1
- package/dist/.setup/{dynamic-tools-BDXl-8Cw.mjs → dynamic-tools-Db2sY5cZ.mjs} +2305 -2606
- package/dist/.setup/{effective-mcp-catalog-CvnvnGIe.mjs → effective-mcp-catalog-Bi6-SQ7i.mjs} +8 -17
- package/dist/.setup/{ephemeral-turn-poidXgek.mjs → ephemeral-turn-DiCS1ijR.mjs} +3 -3
- package/dist/.setup/event-projector-assistant-message-MV_1dj-3.mjs +69 -0
- package/dist/.setup/{event-projector-usage-CnBS8Wa3.mjs → event-projector-usage-03R0I2dM.mjs} +3 -25
- package/dist/.setup/event-projector-values-DJSz8BTk.mjs +106 -0
- package/dist/.setup/incognito-session-DWYapfwf.mjs +2 -0
- package/dist/.setup/{inference-context-D96l9-ew.mjs → inference-context-D-9gWlTR.mjs} +16 -18
- package/dist/.setup/inference-dispatch-CMZtjQyz.mjs +359 -0
- package/dist/.setup/inference-metadata-CgIf7sOx.mjs +81 -0
- package/dist/.setup/{inference-proxy-b-aJMSxm.mjs → inference-proxy-DhcXOgUE.mjs} +174 -214
- package/dist/.setup/{isolated-completion-BIZFhTNG.mjs → isolated-completion-D80IXfQF.mjs} +9 -12
- package/dist/.setup/{managed-binary-BnshlFag.mjs → managed-binary-kiWRhNRE.mjs} +8 -12
- package/dist/.setup/{model-catalog-CfXJf9Ay.mjs → model-catalog-DiC0Tkha.mjs} +11 -10
- package/dist/.setup/model-runtime-BdqzOMkU.mjs +11 -0
- package/dist/.setup/{models-KnqBv0hE.mjs → models-DfLmPV0k.mjs} +9 -18
- package/dist/.setup/{native-auth-rWbGbMn3.mjs → native-auth-CuG53tu4.mjs} +4 -4
- package/dist/.setup/{native-execution-policy-umd0tgh4.mjs → native-execution-policy-BxZJy5mP.mjs} +5 -30
- package/dist/.setup/{native-subagent-monitor-D3filLY2.mjs → native-subagent-monitor-BwkQXf9e.mjs} +4395 -3609
- package/dist/.setup/native-subagent-pending-assignments-DwkCzLvD.mjs +203 -0
- package/dist/.setup/native-task-assignments-DMQ0g3hu.mjs +194 -0
- package/dist/.setup/{node-cli-sessions-r3avj02l.mjs → node-cli-sessions-HC4W6FLI.mjs} +19 -49
- package/dist/.setup/{node-exec-server.runtime-BDwWXVpK.mjs → node-exec-server.runtime-BgBfWQqo.mjs} +3 -6
- package/dist/.setup/{plan-CN3VwfNU.mjs → plan-DPdMk1Oy.mjs} +49 -92
- package/dist/.setup/{plugin-activation-DT3MNtqj.mjs → plugin-activation-cNHRfaxU.mjs} +8 -36
- package/dist/.setup/{plugin-app-cache-key-B2CsSdnV.mjs → plugin-app-cache-key-BL9B5H0L.mjs} +6 -23
- package/dist/.setup/{plugin-inventory-BoRei8Z4.mjs → plugin-inventory-Cky2XJUw.mjs} +21 -21
- package/dist/.setup/{plugin-marketplace-discovery-CDOi8IFs.mjs → plugin-marketplace-discovery-D_dV9FXa.mjs} +18 -24
- package/dist/.setup/{plugin-metadata-cache-Ctmo83k_.mjs → plugin-metadata-cache-BRwtRct9.mjs} +116 -176
- package/dist/.setup/{provider-BOsxQHOM.mjs → provider-D6F_7p1I.mjs} +11 -14
- package/dist/.setup/{provider-capabilities-BfE88FZ5.mjs → provider-capabilities-DG5qbsUZ.mjs} +13 -18
- package/dist/.setup/{rate-limits-CMU3DUD0.mjs → rate-limits-B7-X2TgG.mjs} +9 -31
- package/dist/.setup/{request-D2L0zMrq.mjs → request-BZOfsSXW.mjs} +7 -6
- package/dist/.setup/responses-oauth-twnuTaAa.mjs +93 -0
- package/dist/.setup/rpc-error-BlD2vuzn.mjs +31 -0
- package/dist/.setup/{run-attempt-BHu11r7h.mjs → run-attempt-dYJhjZrp.mjs} +1035 -1023
- package/dist/.setup/{run-attempt-lifecycle-B7JbY4-F.mjs → run-attempt-lifecycle-C-6O3Exn.mjs} +10 -24
- package/dist/.setup/{runtime-artifact-CLZ8udh-.mjs → runtime-artifact-DDQ-HGXf.mjs} +16 -4
- package/dist/.setup/runtime-artifact-connection-D68qQn1m.mjs +78 -0
- package/dist/.setup/sandbox-guard-DjCz2eOw.mjs +126 -0
- package/dist/.setup/scope-DOC1Xjc8.mjs +6 -0
- package/dist/.setup/session-binding-DGCYAfvD.mjs +443 -0
- package/dist/.setup/{session-binding-record-BGoz8wOK.mjs → session-binding-record-Oe9L-CNY.mjs} +52 -130
- package/dist/.setup/{session-binding-sidecars-BlB5EvIS.mjs → session-binding-sidecars-jo6H8dFr.mjs} +196 -17
- package/dist/.setup/{session-catalog-Pno1xGcl.mjs → session-catalog-BFafIiF6.mjs} +185 -350
- package/dist/.setup/{session-catalog-adoption-BI6UTDZT.mjs → session-catalog-adoption-BU_pHWG7.mjs} +7 -6
- package/dist/.setup/{session-catalog-archive-lHBqzhaO.mjs → session-catalog-archive-spHfihri.mjs} +6 -6
- package/dist/.setup/session-catalog-events-BMCFMZw-.mjs +139 -0
- package/dist/.setup/session-catalog-home-id-vlih0B_g.mjs +22 -0
- package/dist/.setup/{session-catalog-index-B9_VQIUz.mjs → session-catalog-index-DwJjnF5k.mjs} +126 -122
- package/dist/.setup/{session-catalog-index-order-hcdz07yN.mjs → session-catalog-index-order-BcQpHks3.mjs} +1 -1
- package/dist/.setup/{session-catalog-index-state-Dgh8ORJm.mjs → session-catalog-index-state-TeO7EyO-.mjs} +3 -2
- package/dist/.setup/session-catalog-limits-DDxOsQeC.mjs +14 -0
- package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +170 -0
- package/dist/.setup/session-catalog-native-projection-CuaFZuQE.mjs +178 -0
- package/dist/.setup/{session-catalog-node-adoption-ITddWx_X.mjs → session-catalog-node-adoption-DgXvSGu0.mjs} +10 -27
- package/dist/.setup/{session-catalog-node-continue-6g6qi4A9.mjs → session-catalog-node-continue-DjKXHBbi.mjs} +8 -10
- package/dist/.setup/session-catalog-node-lookup-CtAXI5W5.mjs +56 -0
- package/dist/.setup/{session-catalog-native-projection-DowriLid.mjs → session-catalog-parsing-CPGaPYr-.mjs} +11 -194
- package/dist/.setup/{session-catalog-projection-zK_PUsiE.mjs → session-catalog-projection-CGfzfP93.mjs} +6 -4
- package/dist/.setup/session-catalog-provenance-DoAvktcj.mjs +95 -0
- package/dist/.setup/{session-cli-irrD-uo7.mjs → session-cli-DlmBHYIe.mjs} +9 -22
- package/dist/.setup/{session-history-BrqhSCf9.mjs → session-history-D83lJWHG.mjs} +4 -6
- package/dist/.setup/{session-history-import-D-3wAgOP.mjs → session-history-import-WhX-X33a.mjs} +7 -10
- package/dist/.setup/session-history-read-Ov3StuL4.mjs +133 -0
- package/dist/.setup/{session-history.worker-CaCh0xF_.mjs → session-history.worker-MnPKncqP.mjs} +9 -5
- package/dist/.setup/session-initialization-6aveB9qb.mjs +22 -0
- package/dist/.setup/{session-permission-policy-BI1QK_98.mjs → session-permission-policy-Ci_fVX6y.mjs} +4 -8
- package/dist/.setup/{session-retirement-BH-S6qkJ.mjs → session-retirement-LlYWBKTJ.mjs} +17 -17
- package/dist/.setup/{settled-turn-context-fmwouT5I.mjs → settled-turn-context-D4yj4rxf.mjs} +1 -1
- package/dist/.setup/{settled-turn-finalizer-DiAi6Kx6.mjs → settled-turn-finalizer-DW9W3gza.mjs} +14 -10
- package/dist/.setup/{shared-client-DA4VR4Eb.mjs → shared-client-CJCTeFpQ.mjs} +783 -412
- package/dist/.setup/shared-client-lifecycle-7xgtlo15.mjs +153 -0
- package/dist/.setup/{side-question-BJ1wSDcB.mjs → side-question-BLeGj7TQ.mjs} +79 -143
- package/dist/.setup/{source-CUzJq5WN.mjs → source-CJis_1EF.mjs} +80 -137
- package/dist/.setup/{thread-lifecycle-B3mfz1TG.mjs → thread-lifecycle-_bAbjedG.mjs} +294 -737
- package/dist/.setup/{thread-ownership-DcTtAcXj.mjs → thread-ownership-B6pPt21M.mjs} +45 -10
- package/dist/.setup/{incognito-session-uhrBF6wJ.mjs → thread-ownership-queue-Dp24d7-F.mjs} +1 -2
- package/dist/.setup/{thread-policy-DGuQsuFC.mjs → thread-policy-gNPzzpVp.mjs} +46 -7
- package/dist/.setup/{thread-requests-BLvGkP2R.mjs → thread-requests-OWGOiDaV.mjs} +199 -302
- package/dist/.setup/{thread-resume-DIBXwOpE.mjs → thread-resume-GOry0AYh.mjs} +6 -6
- package/dist/.setup/{timeout-C910MdAB.mjs → timeout-CXOfNoaX.mjs} +1 -35
- package/dist/.setup/{transcript-history-projection-ZZpkFkJ_.mjs → transcript-history-projection-DRSifI-1.mjs} +17 -89
- package/dist/.setup/{transcript-mirror-attestation-CzM-94NC.mjs → transcript-mirror-attestation-YSegaktH.mjs} +3 -4
- package/dist/.setup/{transcript-mirror-BtHDBp1G.mjs → transcript-mirror-kxmCYsuF.mjs} +7 -9
- package/dist/.setup/{transport-stdio-h2VHOskC.mjs → transport-stdio-Bdegpn2V.mjs} +5 -22
- package/dist/.setup/transport-websocket-BTBE-LD9.mjs +211 -0
- package/dist/.setup/{upstream-prompt-provenance-LphB8slG.mjs → upstream-prompt-provenance-fXkKbPVC.mjs} +3 -9
- package/dist/.setup/{upstream-session-fork-BUr4OUbC.mjs → upstream-session-fork-gkdRj2yH.mjs} +23 -23
- package/dist/.setup/{usage-BML0r-ua.mjs → usage-CApUvLOV.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-DUMbefVY.mjs → usage-limit-error-wSMQkbpV.mjs} +4 -19
- package/dist/.setup/{web-search-provider.runtime-CDKlN-Rv.mjs → web-search-provider.runtime-UKgeiBUG.mjs} +8 -19
- package/dist/api.js +9 -11
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +50 -8
- package/dist/harness.js +344 -1
- package/dist/index.js +193 -245
- package/dist/media-understanding-provider.js +9 -22
- package/dist/migration-provider-api.js +1 -1
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +3 -3
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +14 -2
- package/package.json +7 -6
- package/dist/.setup/attempt-workspace-context-DUVEn_CS.mjs +0 -331
- package/dist/.setup/compact-Du5UvtxA.mjs +0 -680
- package/dist/.setup/event-projector-assistant-message-BsruvNrH.mjs +0 -103
- package/dist/.setup/event-projector-items-C6L_5ZiT.mjs +0 -234
- package/dist/.setup/harness-a_MsE4-_.mjs +0 -355
- package/dist/.setup/history-rejection-B4nOXNXF.mjs +0 -13
- package/dist/.setup/image-payload-sanitizer-tupAr-2o.mjs +0 -79
- package/dist/.setup/local-runtime-attribution-B_2mnqhb.mjs +0 -19
- package/dist/.setup/native-subagent-history-0nYYgo0k.mjs +0 -148
- package/dist/.setup/native-subagent-task-ids-wb8CKZGN.mjs +0 -441
- package/dist/.setup/plugin-approval-roundtrip-C0MZzCuP.mjs +0 -122
- package/dist/.setup/rolldown-runtime-8H4AJuhK.mjs +0 -14
- package/dist/.setup/sandbox-guard-C2sRMOEY.mjs +0 -166
- package/dist/.setup/session-binding-Cm0apEbd.mjs +0 -692
- package/dist/.setup/session-catalog-events-Bj6j94E_.mjs +0 -347
- package/dist/.setup/session-history-read-B3ZfSUbF.mjs +0 -50
- package/dist/.setup/session-initialization-rcgbZiid.mjs +0 -75
- package/dist/.setup/thread-history-page-DoVpnHim.mjs +0 -83
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
1
|
+
import { a as marketplaceRef, n as isOpenAiCuratedMarketplace, o as pluginReadParams, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-Cky2XJUw.mjs";
|
|
2
|
+
import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-BL9B5H0L.mjs";
|
|
3
|
+
import { o as withCodexAppServerJsonClient } from "./request-BZOfsSXW.mjs";
|
|
4
|
+
import "./config-DKhXquav.mjs";
|
|
5
|
+
import { t as __exportAll } from "./session-binding-sidecars-jo6H8dFr.mjs";
|
|
6
|
+
import { asNonArrayRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
7
|
import path from "node:path";
|
|
7
8
|
import os from "node:os";
|
|
8
9
|
import fs from "node:fs/promises";
|
|
9
|
-
import { isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
|
|
10
10
|
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
11
|
+
import { isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
|
|
11
12
|
import { pathExists } from "openclaw/plugin-sdk/security-runtime";
|
|
12
|
-
import {
|
|
13
|
+
import { tryReadJson } from "@openclaw/fs-safe/json";
|
|
13
14
|
//#region extensions/codex/src/migration/helpers.ts
|
|
14
|
-
async function exists(filePath) {
|
|
15
|
-
return await pathExists(filePath);
|
|
16
|
-
}
|
|
17
15
|
async function isDirectory(filePath) {
|
|
18
16
|
if (!filePath) return false;
|
|
19
17
|
try {
|
|
@@ -34,60 +32,48 @@ function sanitizeName(value) {
|
|
|
34
32
|
return value.trim().toLowerCase().replaceAll(/[^a-z0-9._-]+/gu, "-").replaceAll(/^-+|-+$/gu, "").slice(0, 64);
|
|
35
33
|
}
|
|
36
34
|
async function readJsonObject(filePath) {
|
|
37
|
-
|
|
38
|
-
const { value: parsed } = await readJsonFileWithFallback(filePath, {});
|
|
39
|
-
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
|
|
35
|
+
return asNonArrayRecord(filePath ? await tryReadJson(filePath) : null);
|
|
40
36
|
}
|
|
41
37
|
//#endregion
|
|
42
38
|
//#region extensions/codex/src/migration/source-files.ts
|
|
43
39
|
const SKILL_FILENAME = "SKILL.md";
|
|
44
40
|
const MAX_SCAN_DEPTH = 6;
|
|
45
41
|
const MAX_DISCOVERED_DIRS = 2e3;
|
|
46
|
-
async function
|
|
47
|
-
return await fs.readdir(dir, { withFileTypes: true }).catch(() => []);
|
|
48
|
-
}
|
|
49
|
-
async function discoverSkillDirs(params) {
|
|
42
|
+
async function discoverSourceDirs(params, readSource) {
|
|
50
43
|
if (!params.root || !await isDirectory(params.root)) return [];
|
|
51
44
|
const discovered = [];
|
|
52
45
|
async function visit(dir, depth) {
|
|
53
46
|
if (discovered.length >= MAX_DISCOVERED_DIRS || depth > MAX_SCAN_DEPTH) return;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
discovered.push(
|
|
58
|
-
name,
|
|
59
|
-
source: dir,
|
|
60
|
-
sourceLabel: params.sourceLabel
|
|
61
|
-
});
|
|
47
|
+
if (params.excludeSystem && depth === 1 && path.basename(dir) === ".system") return;
|
|
48
|
+
const source = await readSource(dir);
|
|
49
|
+
if (source !== void 0) {
|
|
50
|
+
discovered.push(source);
|
|
62
51
|
return;
|
|
63
52
|
}
|
|
64
|
-
for (const entry of await
|
|
53
|
+
for (const entry of await fs.readdir(dir, { withFileTypes: true }).catch(() => [])) if (entry.isDirectory()) await visit(path.join(dir, entry.name), depth + 1);
|
|
65
54
|
}
|
|
66
55
|
await visit(params.root, 0);
|
|
67
56
|
return discovered;
|
|
68
57
|
}
|
|
58
|
+
async function discoverSkillDirs(params) {
|
|
59
|
+
return discoverSourceDirs(params, async (dir) => await pathExists(path.join(dir, SKILL_FILENAME)) ? {
|
|
60
|
+
name: path.basename(dir),
|
|
61
|
+
source: dir,
|
|
62
|
+
sourceLabel: params.sourceLabel
|
|
63
|
+
} : void 0);
|
|
64
|
+
}
|
|
69
65
|
async function discoverPluginDirs(codexHome) {
|
|
70
|
-
|
|
71
|
-
if (!await isDirectory(root)) return [];
|
|
72
|
-
const discovered = /* @__PURE__ */ new Map();
|
|
73
|
-
async function visit(dir, depth) {
|
|
74
|
-
if (discovered.size >= MAX_DISCOVERED_DIRS || depth > MAX_SCAN_DEPTH) return;
|
|
66
|
+
return (await discoverSourceDirs({ root: path.join(codexHome, "plugins", "cache") }, async (dir) => {
|
|
75
67
|
const manifestPath = path.join(dir, ".codex-plugin", "plugin.json");
|
|
76
|
-
if (await
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
for (const entry of await safeReadDir(dir)) if (entry.isDirectory()) await visit(path.join(dir, entry.name), depth + 1);
|
|
88
|
-
}
|
|
89
|
-
await visit(root, 0);
|
|
90
|
-
return [...discovered.values()].toSorted((a, b) => a.source.localeCompare(b.source));
|
|
68
|
+
if (!await pathExists(manifestPath)) return;
|
|
69
|
+
const manifest = await readJsonObject(manifestPath);
|
|
70
|
+
return {
|
|
71
|
+
name: (typeof manifest.name === "string" ? manifest.name.trim() : "") || path.basename(dir),
|
|
72
|
+
source: dir,
|
|
73
|
+
migratable: false,
|
|
74
|
+
message: "Cached Codex plugin bundle found. Review manually unless the plugin is also installed in the source Codex app-server inventory"
|
|
75
|
+
};
|
|
76
|
+
})).toSorted((a, b) => a.source.localeCompare(b.source));
|
|
91
77
|
}
|
|
92
78
|
async function discoverCodexMemoryFile(candidate) {
|
|
93
79
|
try {
|
|
@@ -186,19 +172,6 @@ function sourceCodexAppServerStartOptions(codexHome) {
|
|
|
186
172
|
}
|
|
187
173
|
};
|
|
188
174
|
}
|
|
189
|
-
function buildInstalledPluginSource(plugin) {
|
|
190
|
-
const pluginName = pluginNameFromSummary(plugin);
|
|
191
|
-
if (!pluginName) return;
|
|
192
|
-
return {
|
|
193
|
-
name: plugin.name,
|
|
194
|
-
pluginName,
|
|
195
|
-
marketplaceName: CODEX_PLUGINS_MARKETPLACE_NAME,
|
|
196
|
-
source: `${CODEX_PLUGINS_MARKETPLACE_NAME}/${pluginName}`,
|
|
197
|
-
migratable: true,
|
|
198
|
-
installed: plugin.installed,
|
|
199
|
-
enabled: plugin.enabled
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
175
|
function discoverInstalledCuratedPluginSources(response) {
|
|
203
176
|
const installedByName = /* @__PURE__ */ new Map();
|
|
204
177
|
for (const marketplace of response.marketplaces) {
|
|
@@ -206,27 +179,28 @@ function discoverInstalledCuratedPluginSources(response) {
|
|
|
206
179
|
const remote = !marketplace.path;
|
|
207
180
|
for (const summary of marketplace.plugins) {
|
|
208
181
|
if (!summary.installed) continue;
|
|
209
|
-
const
|
|
210
|
-
if (!
|
|
211
|
-
const existing = installedByName.get(
|
|
182
|
+
const pluginName = pluginNameFromSummary(summary);
|
|
183
|
+
if (!pluginName) continue;
|
|
184
|
+
const existing = installedByName.get(pluginName);
|
|
212
185
|
if (existing && (!remote || existing.remote)) continue;
|
|
213
|
-
installedByName.set(
|
|
214
|
-
plugin
|
|
215
|
-
|
|
216
|
-
|
|
186
|
+
installedByName.set(pluginName, {
|
|
187
|
+
plugin: {
|
|
188
|
+
name: summary.name,
|
|
189
|
+
pluginName,
|
|
190
|
+
marketplaceName: CODEX_PLUGINS_MARKETPLACE_NAME,
|
|
191
|
+
source: `${CODEX_PLUGINS_MARKETPLACE_NAME}/${pluginName}`,
|
|
192
|
+
migratable: true,
|
|
193
|
+
installed: summary.installed,
|
|
194
|
+
enabled: summary.enabled
|
|
195
|
+
},
|
|
196
|
+
marketplace: marketplaceRef(marketplace, CODEX_PLUGINS_MARKETPLACE_NAME),
|
|
197
|
+
...remote ? { readPluginName: summary.remotePluginId?.trim() || void 0 } : { readPluginName: pluginName },
|
|
217
198
|
remote
|
|
218
199
|
});
|
|
219
200
|
}
|
|
220
201
|
}
|
|
221
202
|
return Array.from(installedByName.values());
|
|
222
203
|
}
|
|
223
|
-
function marketplaceRef(marketplace) {
|
|
224
|
-
return {
|
|
225
|
-
name: CODEX_PLUGINS_MARKETPLACE_NAME,
|
|
226
|
-
...marketplace.path ? { path: marketplace.path } : {},
|
|
227
|
-
...!marketplace.path ? { remoteMarketplaceName: marketplace.name } : {}
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
204
|
async function withPluginMigrationEligibility(params) {
|
|
231
205
|
const pending = [];
|
|
232
206
|
const evaluated = [];
|
|
@@ -260,7 +234,10 @@ async function withPluginMigrationEligibility(params) {
|
|
|
260
234
|
});
|
|
261
235
|
continue;
|
|
262
236
|
}
|
|
263
|
-
const apps = detail.detail.apps.map(
|
|
237
|
+
const apps = detail.detail.apps.map(({ id, name }) => ({
|
|
238
|
+
id,
|
|
239
|
+
name
|
|
240
|
+
})).toSorted((left, right) => left.id.localeCompare(right.id));
|
|
264
241
|
pending.push({
|
|
265
242
|
plugin,
|
|
266
243
|
apps
|
|
@@ -275,53 +252,30 @@ async function withPluginMigrationEligibility(params) {
|
|
|
275
252
|
} catch (error) {
|
|
276
253
|
sourceAccountError = coerceErrorMessage(error);
|
|
277
254
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
code: "codex_account_unavailable",
|
|
284
|
-
apps,
|
|
285
|
-
error: sourceAccountError
|
|
286
|
-
},
|
|
287
|
-
message: `Codex plugin "${plugin.pluginName ?? plugin.name}" owns apps, but the source Codex app-server account could not be read: ${sourceAccountError}`
|
|
288
|
-
});
|
|
289
|
-
return evaluated;
|
|
290
|
-
}
|
|
291
|
-
if (sourceAccount === "non_chatgpt") {
|
|
292
|
-
for (const { plugin, apps } of pending) evaluated.push({
|
|
293
|
-
...plugin,
|
|
294
|
-
migratable: false,
|
|
295
|
-
migrationBlock: {
|
|
296
|
-
code: "codex_subscription_required",
|
|
297
|
-
apps
|
|
298
|
-
},
|
|
299
|
-
message: codexSubscriptionRequiredMessage(plugin)
|
|
300
|
-
});
|
|
301
|
-
return evaluated;
|
|
302
|
-
}
|
|
303
|
-
if (!params.verifyPluginApps) {
|
|
304
|
-
for (const { plugin, apps } of pending) evaluated.push({
|
|
305
|
-
...plugin,
|
|
255
|
+
const unavailable = (code, reason, error) => evaluated.concat(pending.map(({ plugin, apps }) => ({
|
|
256
|
+
...plugin,
|
|
257
|
+
migratable: false,
|
|
258
|
+
migrationBlock: {
|
|
259
|
+
code,
|
|
306
260
|
apps,
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
|
|
261
|
+
...error !== void 0 ? { error } : {}
|
|
262
|
+
},
|
|
263
|
+
message: `Codex plugin "${plugin.pluginName ?? plugin.name}" owns apps, but ${reason}`
|
|
264
|
+
})));
|
|
265
|
+
if (sourceAccountError && !params.verifyPluginApps) return unavailable("codex_account_unavailable", `the source Codex app-server account could not be read: ${sourceAccountError}`, sourceAccountError);
|
|
266
|
+
if (sourceAccount === "non_chatgpt") return unavailable("codex_subscription_required", codexPluginMigrationSubscriptionWarning());
|
|
267
|
+
if (!params.verifyPluginApps) return evaluated.concat(pending.map(({ plugin, apps }) => ({
|
|
268
|
+
...plugin,
|
|
269
|
+
apps,
|
|
270
|
+
migratable: true
|
|
271
|
+
})));
|
|
272
|
+
let snapshot;
|
|
273
|
+
try {
|
|
274
|
+
snapshot = await refreshSourceAppInventory(params.requestOptions);
|
|
275
|
+
} catch (error) {
|
|
312
276
|
const message = coerceErrorMessage(error);
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
migratable: false,
|
|
316
|
-
migrationBlock: {
|
|
317
|
-
code: "app_inventory_unavailable",
|
|
318
|
-
apps,
|
|
319
|
-
error: message
|
|
320
|
-
},
|
|
321
|
-
message: `Codex plugin "${plugin.pluginName ?? plugin.name}" owns apps, but source app inventory could not be read: ${message}`
|
|
322
|
-
});
|
|
323
|
-
});
|
|
324
|
-
if (!snapshot) return evaluated;
|
|
277
|
+
return unavailable("app_inventory_unavailable", `source app inventory could not be read: ${message}`, message);
|
|
278
|
+
}
|
|
325
279
|
const appInfoById = new Map(snapshot.apps.map((app) => [app.id, app]));
|
|
326
280
|
const installedAppsById = new Map(snapshot.installedApps.map((app) => [app.id, app]));
|
|
327
281
|
for (const { plugin, apps: declaredApps } of pending) {
|
|
@@ -348,12 +302,10 @@ async function withPluginMigrationEligibility(params) {
|
|
|
348
302
|
return evaluated;
|
|
349
303
|
}
|
|
350
304
|
async function readSourceCodexAccount(options) {
|
|
351
|
-
|
|
305
|
+
switch ((await options.request({
|
|
352
306
|
method: "account/read",
|
|
353
307
|
requestParams: { refreshToken: false }
|
|
354
|
-
})
|
|
355
|
-
if (!response.account || typeof response.account !== "object" || Array.isArray(response.account)) return "missing";
|
|
356
|
-
switch (response.account.type) {
|
|
308
|
+
})).account?.type) {
|
|
357
309
|
case "chatgpt": return "chatgpt";
|
|
358
310
|
case "apiKey":
|
|
359
311
|
case "amazonBedrock": return "non_chatgpt";
|
|
@@ -392,12 +344,6 @@ async function refreshSourceAppInventory(options) {
|
|
|
392
344
|
forceRefetch: true
|
|
393
345
|
});
|
|
394
346
|
}
|
|
395
|
-
function sourcePluginAppFact(app) {
|
|
396
|
-
return {
|
|
397
|
-
id: app.id,
|
|
398
|
-
name: app.name
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
347
|
function sourcePluginAppFactWithInventory(app, info, installedApp) {
|
|
402
348
|
if (!installedApp) return app;
|
|
403
349
|
if (!info) return installedApp.enabled ? {
|
|
@@ -434,9 +380,6 @@ function appInventoryBlockMessage(plugin, apps, code) {
|
|
|
434
380
|
function codexPluginMigrationSubscriptionWarning() {
|
|
435
381
|
return "Codex app-backed plugin migration requires the Codex app-server source account to be logged in with a ChatGPT subscription account. Log in to the Codex app with subscription auth; OpenClaw auth or API-key auth does not satisfy Codex app connector access.";
|
|
436
382
|
}
|
|
437
|
-
function codexSubscriptionRequiredMessage(plugin) {
|
|
438
|
-
return `Codex plugin "${plugin.pluginName ?? plugin.name}" owns apps, but ${codexPluginMigrationSubscriptionWarning()}`;
|
|
439
|
-
}
|
|
440
383
|
function pluginNameFromSummary(summary) {
|
|
441
384
|
const candidates = [summary.name, summary.id];
|
|
442
385
|
for (const candidate of candidates) {
|
|
@@ -478,20 +421,20 @@ async function discoverCodexSource(options = {}) {
|
|
|
478
421
|
});
|
|
479
422
|
const plugins = [...sourcePluginDiscovery.plugins, ...cachedPlugins].toSorted((a, b) => a.source.localeCompare(b.source));
|
|
480
423
|
const archivePaths = [];
|
|
481
|
-
if (!skipAssets && await
|
|
424
|
+
if (!skipAssets && await pathExists(configPath)) archivePaths.push({
|
|
482
425
|
id: "archive:config.toml",
|
|
483
426
|
path: configPath,
|
|
484
427
|
relativePath: "config.toml",
|
|
485
428
|
message: "Codex config is archived for manual review; it is not activated automatically"
|
|
486
429
|
});
|
|
487
|
-
if (!skipAssets && await
|
|
430
|
+
if (!skipAssets && await pathExists(hooksPath)) archivePaths.push({
|
|
488
431
|
id: "archive:hooks/hooks.json",
|
|
489
432
|
path: hooksPath,
|
|
490
433
|
relativePath: "hooks/hooks.json",
|
|
491
434
|
message: "Codex native hooks are archived for manual review because they can execute commands"
|
|
492
435
|
});
|
|
493
436
|
const skills = [...codexSkills, ...personalAgentSkills].toSorted((a, b) => a.source.localeCompare(b.source));
|
|
494
|
-
const hasAuth = !options.memoryOnly && await
|
|
437
|
+
const hasAuth = !options.memoryOnly && await pathExists(authPath);
|
|
495
438
|
const high = Boolean(memoryFiles.length || codexSkills.length || plugins.length || archivePaths.length || hasAuth);
|
|
496
439
|
const medium = personalAgentSkills.length > 0;
|
|
497
440
|
return {
|
|
@@ -501,7 +444,7 @@ async function discoverCodexSource(options = {}) {
|
|
|
501
444
|
...await isDirectory(codexSkillsDir) ? { codexSkillsDir } : {},
|
|
502
445
|
...await isDirectory(agentsSkillsDir) ? { personalAgentsSkillsDir: agentsSkillsDir } : {},
|
|
503
446
|
...hasAuth ? { authPath } : {},
|
|
504
|
-
...await
|
|
447
|
+
...await pathExists(modelsCachePath) ? { modelsCachePath } : {},
|
|
505
448
|
memoryFiles,
|
|
506
449
|
skills,
|
|
507
450
|
plugins,
|
|
@@ -516,4 +459,4 @@ function sanitizePluginName(value) {
|
|
|
516
459
|
return value.trim().toLowerCase().replaceAll(/\s+/gu, "-");
|
|
517
460
|
}
|
|
518
461
|
//#endregion
|
|
519
|
-
export { source_exports as a,
|
|
462
|
+
export { source_exports as a, hasCodexSource as i, defaultCodexHome as n, readJsonObject as o, discoverCodexSource as r, sanitizeName as s, codexPluginMigrationSubscriptionWarning as t };
|