@openclaw/codex 2026.9.3 → 2026.9.4
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/dist/api.js +26 -18
- package/dist/{apply-B6el6hdO.js → apply-CvT8tW5i.js} +11 -12
- package/dist/{attempt-client-cleanup-D6cR54TV.js → attempt-client-cleanup-DKHzbwt5.js} +8 -204
- package/dist/{attempt-context-AO4DSjE0.js → attempt-context-D44yeDII.js} +3 -3
- package/dist/{attempt-notifications--H8zXR5-.js → attempt-notifications-C9XufG6l.js} +1 -1
- package/dist/{auth-binding-Co2Vfcf_.js → auth-binding-CWlKVccJ.js} +1 -1
- package/dist/{auth-cache-key-Kq6oerr6.js → auth-cache-key-7orQae_j.js} +2 -2
- package/dist/{binding-connection-QqgcPCgk.js → binding-connection-D3udKbIE.js} +3 -3
- package/dist/{bounded-turn-lRpmZHFv.js → bounded-turn-C_Hneydj.js} +12 -12
- package/dist/{build-state-6RL6qohz.js → build-state-BCmg9-5p.js} +1 -1
- package/dist/{capabilities-BeqLPbtM.js → capabilities-8vx68WLH.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-BEKu4yDx.js → client-B57KWPQx.js} +27 -5
- package/dist/{command-dispatch-CisT9Jqq.js → command-dispatch-BpduNGVf.js} +3 -3
- package/dist/{command-formatters-DeTfrapr.js → command-formatters-lxlkNZgU.js} +4 -3
- package/dist/{command-handlers-BfIsJEuA.js → command-handlers-tiL9iWj7.js} +783 -140
- package/dist/{command-rpc-BMqRQOFX.js → command-rpc-CR5EOEZX.js} +26 -19
- package/dist/{compact-CGJZ2rlb.js → compact-B_H3AOd7.js} +14 -14
- package/dist/{config-JDfTI4VI.js → config-oIORaQ5T.js} +4 -4
- package/dist/{config-options-jnIFvwxD.js → config-options-CXMq1T-C.js} +5 -5
- package/dist/{config-runtime-BWf6JLWG.js → config-runtime-D0zGNIHu.js} +1 -1
- package/dist/{config-utils-C57JiJrU.js → config-utils-DujwEnhg.js} +2 -4
- package/dist/{conversation-binding-CxOlHiix.js → conversation-binding-DsB4-O7U.js} +53 -42
- package/dist/{conversation-control-CUCrSIQI.js → conversation-control-CtUu1b3m.js} +8 -8
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{dynamic-tools-D-JBoaLt.js → dynamic-tools-CmN5RAip.js} +76 -15
- package/dist/{effective-mcp-catalog-J_5Ep5Um.js → effective-mcp-catalog-Bd73bqA8.js} +3 -3
- package/dist/{ephemeral-turn-DSwzP8YY.js → ephemeral-turn-D78_VmzO.js} +5 -5
- package/dist/event-projector-items-5VhsECCO.js +200 -0
- package/dist/{event-projector-usage-CIyrYYid.js → event-projector-usage-BfXmpOec.js} +1 -1
- package/dist/{harness-FR6eQgyO.js → harness-C7rRa7bm.js} +33 -16
- package/dist/harness.js +1 -1
- package/dist/index.js +39 -84
- package/dist/inference-context-Dr_mzvk4.js +94 -0
- package/dist/inference-proxy-HGXKUIre.js +311 -0
- package/dist/{isolated-completion-DHBefrzg.js → isolated-completion-DWVb5U2J.js} +6 -6
- package/dist/{managed-binary-DrjjRRUD.js → managed-binary-D22rNEcR.js} +10 -1
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +2 -0
- package/dist/{model-catalog-B_6M04Wo.js → model-catalog-Dq2n8f_p.js} +6 -6
- package/dist/{models-P9k2qAof.js → models-PCKOim-h.js} +3 -3
- package/dist/native-subagent-history-DjtPloaU.js +140 -0
- package/dist/native-subagent-history-owner-Pcp7JuVF.js +34 -0
- package/dist/{native-subagent-monitor-BbCUKRwC.js → native-subagent-monitor-fQ7eIXEf.js} +52 -424
- package/dist/native-subagent-task-ids-BzTdT0Uw.js +387 -0
- package/dist/{node-cli-sessions-rj0ysJwM.js → node-cli-sessions-DKaOmVUh.js} +1 -1
- package/dist/{node-exec-server.runtime-BY_ctYnT.js → node-exec-server.runtime-Cl2vapEi.js} +3 -3
- package/dist/{plan-BMJdMOEF.js → plan-7uG-Fp36.js} +288 -52
- package/dist/{plugin-activation-BQK-f5sV.js → plugin-activation-BYQculil.js} +24 -19
- package/dist/{plugin-app-cache-key-CdSQzWyX.js → plugin-app-cache-key-d0eKxy7b.js} +1 -1
- package/dist/{plugin-approval-roundtrip-DeW95wB5.js → plugin-approval-roundtrip-Bz3FT8W5.js} +1 -1
- package/dist/{plugin-inventory-CoRCzWW4.js → plugin-inventory-oL4Na1ZG.js} +7 -4
- package/dist/{plugin-marketplace-discovery-3akBizzF.js → plugin-marketplace-discovery-P-Vndfqq.js} +18 -15
- package/dist/{plugin-metadata-cache-DgNfRAGA.js → plugin-metadata-cache-ClPJpRio.js} +13 -9
- package/dist/{protocol-CAAcVIKF.js → protocol-5bh1G-H7.js} +1 -1
- package/dist/provider-MQ8PVkuE.js +50 -0
- package/dist/{provider-capabilities-W4tfK5Y5.js → provider-capabilities-BvCUL69A.js} +2 -2
- package/dist/{rate-limits-Bqnx1N4z.js → rate-limits-CBMmWBr9.js} +1 -1
- package/dist/{request-CGvGOpeR.js → request-B7hEkBGq.js} +72 -58
- package/dist/rpc-error-ttN_QjEm.js +30 -0
- package/dist/{run-attempt-DwKds3DN.js → run-attempt-CvsAAGa0.js} +108 -37
- package/dist/{runtime-artifact-T-NwqeSH.js → runtime-artifact-BJ0rXBZ_.js} +1 -1
- package/dist/{sandbox-guard-BcT66fWy.js → sandbox-guard-BxgyoM8M.js} +2 -1
- package/dist/{session-binding-CKSepwIC.js → session-binding-CI8UuilT.js} +3 -3
- package/dist/{session-binding-record-CaZjYwNS.js → session-binding-record-Bcvslnhf.js} +1 -1
- package/dist/{session-catalog-adoption-BKLtSrwi.js → session-catalog-adoption-tcZi1IfX.js} +5 -5
- package/dist/{session-catalog-archive-D0i2pGj2.js → session-catalog-archive-CwKg8Xz2.js} +6 -6
- package/dist/{session-catalog-HaDcp7Sv.js → session-catalog-ct-AH01I.js} +31 -87
- package/dist/session-catalog-home-id-CwhLdC03.js +18 -0
- package/dist/{session-catalog-node-adoption-BUuDYY8R.js → session-catalog-node-adoption-B1tgDW-m.js} +2 -2
- package/dist/{session-catalog-node-continue-CBtc4wkI.js → session-catalog-node-continue-Ci-DXyJP.js} +4 -4
- package/dist/{session-catalog-provenance-DkJHo735.js → session-catalog-provenance-D-dIfRAH.js} +2 -30
- package/dist/{session-cli-CbgaHh0f.js → session-cli-DNN_jhGc.js} +2 -2
- package/dist/{session-history-import-DFN7sWRU.js → session-history-import-DwyijFI6.js} +4 -4
- package/dist/session-history-worker-runtime.js +1 -1
- package/dist/{session-history.worker-CNEvGaU5.js → session-history.worker-BeK1YOyT.js} +187 -83
- package/dist/session-history.worker.js +1 -1
- package/dist/{session-initialization-Jo86C60I.js → session-initialization-Ct0_Hzmg.js} +2 -2
- package/dist/{session-permission-policy-B22InTp_.js → session-permission-policy-BBmXA8Eg.js} +2 -2
- package/dist/{session-retirement-BSNG_mhf.js → session-retirement-B2YfbAAT.js} +5 -5
- package/dist/{settled-turn-finalizer-BuLUrZl2.js → settled-turn-finalizer-Dn91stmc.js} +5 -5
- package/dist/{shared-client-CVhez2Uo.js → shared-client-CscigXXL.js} +228 -30
- package/dist/{side-question-DLbr2vUU.js → side-question-BGMJQf4U.js} +18 -18
- package/dist/{source-Da-h6f7e.js → source-CElXU0Oy.js} +12 -12
- package/dist/{thread-archive-guard-D1bP04Tf.js → thread-archive-guard-DfpBr-Sz.js} +1 -1
- package/dist/{session-catalog-parsing-CdD3JhdM.js → thread-history-page-D0JIp48V.js} +83 -2
- package/dist/{thread-lifecycle-D1pzRwHB.js → thread-lifecycle-DXl1-I6b.js} +96 -44
- package/dist/{thread-ownership-D6oASVRu.js → thread-ownership-BsDRTsyp.js} +2 -2
- package/dist/{thread-policy-D8kI7yAO.js → thread-policy-BuEQfE0g.js} +3 -3
- package/dist/{thread-resume-T5cveyxA.js → thread-resume-DsDOZpFg.js} +5 -5
- package/dist/{session-catalog-home-id-D7-aLiNt.js → transcript-history-projection-v17wXgdK.js} +66 -18
- package/dist/{transcript-mirror-t5TOccct.js → transcript-mirror-C5CKgNy6.js} +1 -1
- package/dist/{upstream-session-fork-De-sLJ2r.js → upstream-session-fork-BZerMte_.js} +20 -20
- package/dist/{usage-CPPTmBvZ.js → usage-tCk-mg_x.js} +4 -4
- package/dist/{web-search-provider.runtime-CSVgQL0w.js → web-search-provider.runtime-B7bGbGWq.js} +3 -3
- package/openclaw.plugin.json +1 -0
- package/package.json +4 -4
package/dist/{plugin-marketplace-discovery-3akBizzF.js → plugin-marketplace-discovery-P-Vndfqq.js}
RENAMED
|
@@ -12,21 +12,26 @@ function canMutateCodexHost(ctx) {
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region extensions/codex/src/plugin-marketplace-discovery.ts
|
|
14
14
|
/** Read-only discovery of Codex-owned local, curated, and remote plugin marketplaces. */
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const PLUGIN_NAME_PATTERN = /^[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*$/;
|
|
16
|
+
const MARKETPLACE_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
17
|
+
const MAX_PLUGIN_METADATA_LENGTH = 160;
|
|
17
18
|
const SUPPLEMENTAL_MARKETPLACE_KINDS = [
|
|
18
19
|
"workspace-directory",
|
|
19
20
|
"shared-with-me",
|
|
20
21
|
"created-by-me-remote",
|
|
21
22
|
"vertical"
|
|
22
23
|
];
|
|
24
|
+
function filterCodexMarketplacePlugins(plugins, query, marketplace) {
|
|
25
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
26
|
+
return plugins.filter((plugin) => (!marketplace || plugin.marketplaceName === marketplace) && (!normalizedQuery || `${plugin.id} ${plugin.displayName ?? ""} ${plugin.developerName ?? ""} ${plugin.description ?? ""}`.toLowerCase().includes(normalizedQuery)));
|
|
27
|
+
}
|
|
23
28
|
/** Validates the same identifier segments required by Codex's stable PluginId parser. */
|
|
24
29
|
function parseCodexPluginMarketplaceId(value) {
|
|
25
30
|
const separator = value.lastIndexOf("@");
|
|
26
31
|
if (separator <= 0 || separator === value.length - 1) return;
|
|
27
32
|
const pluginName = value.slice(0, separator);
|
|
28
33
|
const marketplaceName = value.slice(separator + 1);
|
|
29
|
-
return
|
|
34
|
+
return PLUGIN_NAME_PATTERN.test(pluginName) && MARKETPLACE_NAME_PATTERN.test(marketplaceName) ? {
|
|
30
35
|
pluginName,
|
|
31
36
|
marketplaceName
|
|
32
37
|
} : void 0;
|
|
@@ -62,17 +67,21 @@ async function discoverCodexMarketplacePlugins(params) {
|
|
|
62
67
|
const discovered = /* @__PURE__ */ new Map();
|
|
63
68
|
const ambiguous = /* @__PURE__ */ new Set();
|
|
64
69
|
for (const marketplace of marketplaces) {
|
|
65
|
-
if (!
|
|
70
|
+
if (!MARKETPLACE_NAME_PATTERN.test(marketplace.name)) continue;
|
|
66
71
|
for (const summary of marketplace.plugins) {
|
|
67
72
|
const pluginName = pluginSlug(summary, marketplace.name);
|
|
68
73
|
if (!pluginName) continue;
|
|
69
74
|
const id = `${pluginName}@${marketplace.name}`;
|
|
70
75
|
if (ambiguous.has(id)) continue;
|
|
71
76
|
const previous = discovered.get(id);
|
|
77
|
+
const pluginInterface = asOptionalRecord(summary.interface);
|
|
72
78
|
const next = {
|
|
73
79
|
id,
|
|
74
80
|
pluginName,
|
|
75
81
|
marketplaceName: marketplace.name,
|
|
82
|
+
displayName: boundedCatalogText(pluginInterface?.displayName) || void 0,
|
|
83
|
+
developerName: boundedCatalogText(pluginInterface?.developerName) || void 0,
|
|
84
|
+
description: boundedCatalogText(pluginInterface?.shortDescription) || boundedCatalogText(pluginInterface?.longDescription) || void 0,
|
|
76
85
|
installed: summary.installed,
|
|
77
86
|
enabled: summary.enabled,
|
|
78
87
|
available: summary.availability !== "DISABLED_BY_ADMIN" && summary.installPolicy !== "NOT_AVAILABLE",
|
|
@@ -85,8 +94,6 @@ async function discoverCodexMarketplacePlugins(params) {
|
|
|
85
94
|
} : {},
|
|
86
95
|
summaryId: summary.id
|
|
87
96
|
};
|
|
88
|
-
const description = pluginDescription(summary);
|
|
89
|
-
if (description) next.description = description;
|
|
90
97
|
if (previous && (previous.marketplacePath !== next.marketplacePath || previous.remotePluginId !== next.remotePluginId)) {
|
|
91
98
|
discovered.delete(id);
|
|
92
99
|
ambiguous.add(id);
|
|
@@ -114,21 +121,17 @@ function pluginSlug(summary, marketplaceName) {
|
|
|
114
121
|
const qualified = parseCodexPluginMarketplaceId(summary.id);
|
|
115
122
|
if (qualified?.marketplaceName === marketplaceName) return qualified.pluginName;
|
|
116
123
|
const identitySegment = summary.id.split("/").at(-1);
|
|
117
|
-
if (identitySegment &&
|
|
118
|
-
return
|
|
119
|
-
}
|
|
120
|
-
function pluginDescription(summary) {
|
|
121
|
-
const description = asOptionalRecord(summary.interface)?.shortDescription;
|
|
122
|
-
if (typeof description !== "string") return;
|
|
123
|
-
return boundedCatalogText(description) || void 0;
|
|
124
|
+
if (identitySegment && PLUGIN_NAME_PATTERN.test(identitySegment)) return identitySegment;
|
|
125
|
+
return PLUGIN_NAME_PATTERN.test(summary.name) ? summary.name : void 0;
|
|
124
126
|
}
|
|
125
127
|
function boundedCatalogText(value) {
|
|
128
|
+
if (typeof value !== "string") return "";
|
|
126
129
|
let sanitized = "";
|
|
127
130
|
for (const character of value) {
|
|
128
131
|
const codePoint = character.codePointAt(0);
|
|
129
132
|
sanitized += codePoint !== void 0 && (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) ? " " : character;
|
|
130
133
|
}
|
|
131
|
-
return sanitized.replace(/\s+/g, " ").trim().slice(0,
|
|
134
|
+
return sanitized.replace(/\s+/g, " ").trim().slice(0, MAX_PLUGIN_METADATA_LENGTH);
|
|
132
135
|
}
|
|
133
136
|
//#endregion
|
|
134
|
-
export {
|
|
137
|
+
export { CODEX_HOST_INSPECTION_AUTH_ERROR as a, hasCodexAdminScope as c, CODEX_FULL_PERMISSIONS_AUTH_ERROR as i, filterCodexMarketplacePlugins as n, CODEX_NATIVE_EXECUTION_AUTH_ERROR as o, parseCodexPluginMarketplaceId as r, canMutateCodexHost as s, discoverCodexMarketplacePlugins as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { o as resolveCodexComputerUseConfig } from "./config-options-
|
|
2
|
-
import { s as resolveCodexAppServerHomeDir } from "./protocol-
|
|
3
|
-
import { c as isCodexAppServerIndeterminateTransportError, o as isCodexAppServerConnectionClosedError, s as isCodexAppServerIndeterminateRequestCancellationError } from "./client-
|
|
4
|
-
import {
|
|
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 { o as resolveCodexComputerUseConfig } from "./config-options-CXMq1T-C.js";
|
|
2
|
+
import { s as resolveCodexAppServerHomeDir } from "./protocol-5bh1G-H7.js";
|
|
3
|
+
import { c as isCodexAppServerIndeterminateTransportError, o as isCodexAppServerConnectionClosedError, s as isCodexAppServerIndeterminateRequestCancellationError } from "./client-B57KWPQx.js";
|
|
4
|
+
import { l as resolveMacOSDesktopCodexBundledMarketplaceCandidates, s as resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath, t as isManagedCodexDesktopCommand } from "./managed-binary-D22rNEcR.js";
|
|
5
|
+
import { n as describeControlFailure } from "./capabilities-8vx68WLH.js";
|
|
6
|
+
import { i as requestCodexAppServerJson } from "./request-B7hEkBGq.js";
|
|
7
|
+
import "./config-oIORaQ5T.js";
|
|
8
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-D0zGNIHu.js";
|
|
9
|
+
import { $ as reconcileCodexComputerUseStartArtifacts, T as acquireCodexNativeConfigFence, b as waitForCodexAppServerClientDesktopGenerationDrain, c as getLeasedSharedCodexAppServerClient, d as readCodexAppServerClientDesktopGeneration, g as resolveCodexNativeConfigFenceKey, h as releaseLeasedSharedCodexAppServerClient, nt as resolveCodexManagedBundledMarketplacePath, p as readCodexAppServerClientProcessIdentity, rt as assertNotSymlink, t as assertCodexAppServerClientStartSelectionCurrent, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-CscigXXL.js";
|
|
10
10
|
import { existsSync } from "node:fs";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import fs$1 from "node:fs/promises";
|
|
@@ -445,6 +445,7 @@ async function resolveMarketplaceRef(params) {
|
|
|
445
445
|
candidates = await listComputerUseMarketplaceCandidates(params.request, params.config);
|
|
446
446
|
}
|
|
447
447
|
const waitUntil = marketplaceDiscoveryWaitUntil(params);
|
|
448
|
+
if (candidates.length === 0 && waitUntil > Date.now() && await codexNativePluginsDisabled(params.request)) return { message: "Codex native plugin support is disabled (features.plugins = false). Enable it in the Codex config, then run /codex computer-use install." };
|
|
448
449
|
while (candidates.length === 0) {
|
|
449
450
|
if (Date.now() >= waitUntil) break;
|
|
450
451
|
await delay(Math.min(CURATED_MARKETPLACE_POLL_INTERVAL_MS, waitUntil - Date.now()), params.signal);
|
|
@@ -477,6 +478,9 @@ async function migrateLegacyBundledMarketplaceSource(params) {
|
|
|
477
478
|
async function listComputerUseMarketplaceCandidates(request, config) {
|
|
478
479
|
return findComputerUseMarketplaces(await request("plugin/list", { cwds: [] }), config.pluginName);
|
|
479
480
|
}
|
|
481
|
+
async function codexNativePluginsDisabled(request) {
|
|
482
|
+
return (await request("experimentalFeature/list", {})).data.find(({ name }) => name === "plugins")?.enabled === false;
|
|
483
|
+
}
|
|
480
484
|
function blockUnsafeAutoInstallStatus(config) {
|
|
481
485
|
if (!config.marketplaceSource) return;
|
|
482
486
|
return unavailableStatus(config, "auto_install_blocked", "Computer Use auto-install only uses marketplaces Codex app-server has already discovered. Run /codex computer-use install to install from a configured marketplace source.");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as normalizeCodexServiceTier, m as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN } from "./config-utils-DujwEnhg.js";
|
|
2
2
|
import { n as normalizeCodexAppServerArgs } from "./launch-args-RXQwn8zV.js";
|
|
3
3
|
import { asNullableRecord, isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//#region extensions/codex/src/migration/provider.ts
|
|
2
|
+
function isMemoryOnlyMigration(ctx) {
|
|
3
|
+
return Boolean(ctx.itemKinds && ctx.itemKinds.length > 0 && ctx.itemKinds.every((kind) => kind === "memory"));
|
|
4
|
+
}
|
|
5
|
+
function isAuthOnlyMigration(ctx) {
|
|
6
|
+
return Boolean(ctx.itemKinds && ctx.itemKinds.length > 0 && ctx.itemKinds.every((kind) => kind === "auth"));
|
|
7
|
+
}
|
|
8
|
+
function buildCodexMigrationProvider(params = {}) {
|
|
9
|
+
return {
|
|
10
|
+
id: "codex",
|
|
11
|
+
label: "Codex",
|
|
12
|
+
description: "Import Codex memory and skills while keeping Codex native plugins and hooks explicit.",
|
|
13
|
+
supportedItemKinds: ["memory", "auth"],
|
|
14
|
+
async detect(ctx) {
|
|
15
|
+
const { discoverCodexSource, hasCodexSource } = await import("./source-CElXU0Oy.js").then((n) => n.i);
|
|
16
|
+
const source = await discoverCodexSource({
|
|
17
|
+
input: ctx.source,
|
|
18
|
+
memoryOnly: isMemoryOnlyMigration(ctx),
|
|
19
|
+
authOnly: isAuthOnlyMigration(ctx)
|
|
20
|
+
});
|
|
21
|
+
const found = isMemoryOnlyMigration(ctx) ? source.memoryFiles.length > 0 : isAuthOnlyMigration(ctx) ? Boolean(source.authPath) : hasCodexSource(source);
|
|
22
|
+
return {
|
|
23
|
+
found,
|
|
24
|
+
source: source.root,
|
|
25
|
+
label: "Codex",
|
|
26
|
+
confidence: found ? source.confidence : "low",
|
|
27
|
+
message: found ? "Codex state found." : "Codex state not found."
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
async plan(ctx) {
|
|
31
|
+
const { buildCodexMigrationPlan } = await import("./plan-7uG-Fp36.js");
|
|
32
|
+
return buildCodexMigrationPlan(ctx);
|
|
33
|
+
},
|
|
34
|
+
deferredApply: { retrySafe: true },
|
|
35
|
+
prepareApply(ctx) {
|
|
36
|
+
if (isMemoryOnlyMigration(ctx) || isAuthOnlyMigration(ctx)) return;
|
|
37
|
+
return import("./apply-CvT8tW5i.js").then(({ prepareTargetCodexAppServer }) => prepareTargetCodexAppServer(ctx));
|
|
38
|
+
},
|
|
39
|
+
async apply(ctx, plan) {
|
|
40
|
+
const { applyCodexMigrationPlan } = await import("./apply-CvT8tW5i.js");
|
|
41
|
+
return await applyCodexMigrationPlan({
|
|
42
|
+
ctx,
|
|
43
|
+
plan,
|
|
44
|
+
runtime: params.runtime
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { buildCodexMigrationProvider as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-
|
|
2
|
-
import {
|
|
1
|
+
import { h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-CscigXXL.js";
|
|
2
|
+
import { ct as normalizeCodexDynamicToolName } from "./thread-lifecycle-DXl1-I6b.js";
|
|
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as isJsonObject } from "./protocol-
|
|
1
|
+
import { o as isJsonObject } from "./protocol-5bh1G-H7.js";
|
|
2
2
|
import { asBoolean, asFiniteNumber, normalizeOptionalString, parseStrictFiniteNumber } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { MAX_DATE_TIMESTAMP_MS, resolveExpiresAtMsFromEpochSeconds } from "openclaw/plugin-sdk/number-runtime";
|
|
4
4
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { n as withTimeout } from "./timeout-BVw8aaM1.js";
|
|
2
|
+
import { n as withTimeout, t as withAbortableTimeout } from "./timeout-BVw8aaM1.js";
|
|
3
3
|
//#region extensions/codex/src/app-server/request.ts
|
|
4
4
|
var request_exports = /* @__PURE__ */ __exportAll({
|
|
5
5
|
CodexAppServerScopedRequestRejectedError: () => CodexAppServerScopedRequestRejectedError,
|
|
@@ -10,7 +10,7 @@ var request_exports = /* @__PURE__ */ __exportAll({
|
|
|
10
10
|
});
|
|
11
11
|
/** Sends one guarded request over a client lease owned by the caller. */
|
|
12
12
|
async function requestCodexAppServerClientJson(params) {
|
|
13
|
-
const { resolveCodexAppServerDirectSandboxBypassBlock } = await import("./sandbox-guard-
|
|
13
|
+
const { resolveCodexAppServerDirectSandboxBypassBlock } = await import("./sandbox-guard-BxgyoM8M.js").then((n) => n.r);
|
|
14
14
|
const sandboxBlock = resolveCodexAppServerDirectSandboxBypassBlock({
|
|
15
15
|
method: params.method,
|
|
16
16
|
requestParams: params.requestParams,
|
|
@@ -27,7 +27,7 @@ async function requestCodexAppServerClientJson(params) {
|
|
|
27
27
|
}), timeoutMs, `codex app-server ${params.method} timed out`);
|
|
28
28
|
}
|
|
29
29
|
async function requestCodexAppServerJson(params) {
|
|
30
|
-
const { resolveCodexAppServerDirectSandboxBypassBlock } = await import("./sandbox-guard-
|
|
30
|
+
const { resolveCodexAppServerDirectSandboxBypassBlock } = await import("./sandbox-guard-BxgyoM8M.js").then((n) => n.r);
|
|
31
31
|
const sandboxBlock = resolveCodexAppServerDirectSandboxBypassBlock({
|
|
32
32
|
method: params.method,
|
|
33
33
|
requestParams: params.requestParams,
|
|
@@ -122,6 +122,7 @@ async function withCodexAppServerJsonClient(params, run) {
|
|
|
122
122
|
const deadline = Number.isFinite(timeoutMs) && timeoutMs > 0 ? Date.now() + timeoutMs : void 0;
|
|
123
123
|
const isPastDeadline = () => deadline !== void 0 && Date.now() >= deadline;
|
|
124
124
|
const throwIfAbandoned = () => {
|
|
125
|
+
if (timeoutController.signal.aborted && timeoutController.signal.reason instanceof Error) throw timeoutController.signal.reason;
|
|
125
126
|
if (timeoutController.signal.aborted || isPastDeadline()) throw new CodexAppServerScopedRequestRejectedError(timeoutMessage);
|
|
126
127
|
};
|
|
127
128
|
const remainingTimeoutMs = () => {
|
|
@@ -129,69 +130,82 @@ async function withCodexAppServerJsonClient(params, run) {
|
|
|
129
130
|
return deadline === void 0 ? timeoutMs : Math.max(1, deadline - Date.now());
|
|
130
131
|
};
|
|
131
132
|
try {
|
|
132
|
-
return await
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
timeoutMs: remainingTimeoutMs(),
|
|
141
|
-
authProfileId: params.authProfileId,
|
|
142
|
-
authProfileStore: params.authProfileStore,
|
|
143
|
-
authBindingFingerprint: params.authBindingFingerprint,
|
|
144
|
-
preparedAuth: params.preparedAuth,
|
|
145
|
-
authRequirement: params.authRequirement,
|
|
146
|
-
agentDir: params.agentDir,
|
|
147
|
-
config: params.config,
|
|
148
|
-
abandonSignal: timeoutController.signal
|
|
149
|
-
});
|
|
150
|
-
let scopeActive = true;
|
|
151
|
-
const assertCurrent = () => {
|
|
133
|
+
return await withAbortableTimeout({
|
|
134
|
+
signal: timeoutController.signal,
|
|
135
|
+
timeoutMs,
|
|
136
|
+
timeoutMessage,
|
|
137
|
+
promise: (async () => {
|
|
138
|
+
const { resolveCodexAppServerDirectSandboxBypassBlock } = await import("./sandbox-guard-BxgyoM8M.js").then((n) => n.r);
|
|
139
|
+
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, isCodexAppServerStartSelectionChangedError, releaseLeasedSharedCodexAppServerClient, retireSharedCodexAppServerClientIfCurrent } = await import("./shared-client-CscigXXL.js").then((n) => n.y);
|
|
140
|
+
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
152
141
|
throwIfAbandoned();
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
142
|
+
const client = await (params.isolated ? createIsolatedCodexAppServerClient : getLeasedSharedCodexAppServerClient)({
|
|
143
|
+
startOptions: params.startOptions,
|
|
144
|
+
pluginConfig: params.pluginConfig,
|
|
145
|
+
timeoutMs: remainingTimeoutMs(),
|
|
146
|
+
authProfileId: params.authProfileId,
|
|
147
|
+
authProfileStore: params.authProfileStore,
|
|
148
|
+
authBindingFingerprint: params.authBindingFingerprint,
|
|
149
|
+
preparedAuth: params.preparedAuth,
|
|
150
|
+
authRequirement: params.authRequirement,
|
|
151
|
+
agentDir: params.agentDir,
|
|
152
|
+
config: params.config,
|
|
153
|
+
abandonSignal: timeoutController.signal
|
|
154
|
+
});
|
|
155
|
+
let scopeActive = true;
|
|
156
|
+
const assertCurrent = () => {
|
|
157
|
+
throwIfAbandoned();
|
|
158
|
+
if (!scopeActive) throw new CodexAppServerScopedRequestRejectedError("Codex app-server request scope is closed");
|
|
159
|
+
assertRequestOwnerCurrent(params.assertCurrent);
|
|
160
|
+
};
|
|
161
|
+
try {
|
|
167
162
|
assertCurrent();
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
163
|
+
const scopedRequest = async (request) => {
|
|
164
|
+
const sandboxBlock = resolveCodexAppServerDirectSandboxBypassBlock({
|
|
165
|
+
method: request.method,
|
|
166
|
+
requestParams: request.requestParams,
|
|
167
|
+
config: params.config,
|
|
168
|
+
sessionKey: params.sessionKey,
|
|
169
|
+
sessionId: params.sessionId
|
|
170
|
+
});
|
|
171
|
+
if (sandboxBlock) throw new CodexAppServerScopedRequestRejectedError(sandboxBlock);
|
|
172
|
+
assertCurrent();
|
|
173
|
+
return await client.request(request.method, request.requestParams, {
|
|
174
|
+
timeoutMs: remainingTimeoutMs(),
|
|
175
|
+
signal: timeoutController.signal,
|
|
176
|
+
assertCurrent: () => {
|
|
177
|
+
assertCurrent();
|
|
178
|
+
request.assertCurrent?.();
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
return await run(scopedRequest, client, {
|
|
183
|
+
assertCurrent,
|
|
184
|
+
abort: (reason) => {
|
|
185
|
+
if (scopeActive) timeoutController.abort(reason);
|
|
186
|
+
}
|
|
172
187
|
});
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
else releaseLeasedSharedCodexAppServerClient(client);
|
|
188
|
+
} catch (error) {
|
|
189
|
+
if (!isCodexAppServerStartSelectionChangedError(error) || attempt > 0) throw error;
|
|
190
|
+
if (!params.isolated) retireSharedCodexAppServerClientIfCurrent(client);
|
|
191
|
+
throwIfAbandoned();
|
|
192
|
+
} finally {
|
|
193
|
+
scopeActive = false;
|
|
194
|
+
if (params.isolated) await client.closeAndWait({
|
|
195
|
+
exitTimeoutMs: params.isolatedShutdown?.exitTimeoutMs ?? 2e3,
|
|
196
|
+
forceKillDelayMs: params.isolatedShutdown?.forceKillDelayMs ?? 250
|
|
197
|
+
});
|
|
198
|
+
else releaseLeasedSharedCodexAppServerClient(client);
|
|
199
|
+
}
|
|
186
200
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
})
|
|
201
|
+
throw new Error("Codex app-server selection retry loop exited unexpectedly");
|
|
202
|
+
})()
|
|
203
|
+
});
|
|
190
204
|
} catch (error) {
|
|
191
205
|
if (isPastDeadline()) throw new Error(timeoutMessage, { cause: error });
|
|
192
206
|
throw error;
|
|
193
207
|
} finally {
|
|
194
|
-
timeoutController.abort();
|
|
208
|
+
timeoutController.abort(new CodexAppServerScopedRequestRejectedError(timeoutMessage));
|
|
195
209
|
}
|
|
196
210
|
}
|
|
197
211
|
//#endregion
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { o as isJsonObject } from "./protocol-5bh1G-H7.js";
|
|
2
|
+
//#region extensions/codex/src/app-server/rpc-error.ts
|
|
3
|
+
/** RPC error wrapper that preserves app-server error code and data. */
|
|
4
|
+
var CodexAppServerRpcError = class extends Error {
|
|
5
|
+
constructor(error, method) {
|
|
6
|
+
super(formatCodexAppServerRpcErrorMessage(error, method));
|
|
7
|
+
this.name = "CodexAppServerRpcError";
|
|
8
|
+
this.code = error.code;
|
|
9
|
+
this.data = error.data;
|
|
10
|
+
this.method = method;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
function isCodexThreadReadMissingError(error, threadId) {
|
|
14
|
+
return error instanceof CodexAppServerRpcError && error.method === "thread/read" && error.code === -32600 && error.message === `thread not loaded: ${threadId}`;
|
|
15
|
+
}
|
|
16
|
+
function formatCodexAppServerRpcErrorMessage(error, method) {
|
|
17
|
+
const message = error.message || `${method} failed`;
|
|
18
|
+
const detail = readCodexAppServerRpcReloginDetail(error.data);
|
|
19
|
+
return detail && !message.includes(detail) ? `${message}: ${detail}` : message;
|
|
20
|
+
}
|
|
21
|
+
function readCodexAppServerRpcReloginDetail(data) {
|
|
22
|
+
const record = isJsonObject(data) ? data : void 0;
|
|
23
|
+
const nested = isJsonObject(record?.error) ? record.error : record;
|
|
24
|
+
if (!nested) return;
|
|
25
|
+
const isRelogin = nested.action === "relogin" || nested.reason === "cloudRequirements" && nested.errorCode === "Auth";
|
|
26
|
+
const detail = typeof nested.detail === "string" ? nested.detail.trim() : "";
|
|
27
|
+
return isRelogin && detail ? detail : void 0;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { isCodexThreadReadMissingError as n, CodexAppServerRpcError as t };
|