@openclaw/codex 2026.7.2-beta.1 → 2026.7.2-beta.3

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.
Files changed (41) hide show
  1. package/README.md +1 -1
  2. package/dist/{app-server-policy-DVcxdse_.js → app-server-policy-DUMF2Xyr.js} +1 -1
  3. package/dist/{attempt-notifications-DEv9h7iC.js → attempt-notifications-Ecjyzufe.js} +3 -6
  4. package/dist/cli-metadata.js +1 -1
  5. package/dist/{command-formatters-D6ZlGNmb.js → command-formatters-NCTL7A2q.js} +38 -3
  6. package/dist/{command-handlers-Cpl9fUWv.js → command-handlers-DtFbZiba.js} +70 -15
  7. package/dist/{compact-FnJmiPNA.js → compact-Kgy26gIM.js} +4 -5
  8. package/dist/{computer-use-DVzr8OP1.js → computer-use-C7x4ZaqR.js} +4 -4
  9. package/dist/{conversation-control-DtQ-E7mr.js → conversation-control-B0s3aIjT.js} +5 -7
  10. package/dist/doctor-contract-api.js +1 -1
  11. package/dist/{dynamic-tools-BMLoaTeG.js → dynamic-tools-D_vSVmv9.js} +851 -434
  12. package/dist/harness.js +11 -6
  13. package/dist/index.js +52 -31
  14. package/dist/{media-understanding-provider-D580L0P8.js → media-understanding-provider-IPNNQre6.js} +11 -12
  15. package/dist/media-understanding-provider.js +1 -1
  16. package/dist/{models-DuKzZA6G.js → models-DD5zBdX5.js} +5 -9
  17. package/dist/{notification-correlation-DfaCm0mx.js → notification-correlation-C8DVQ_Bq.js} +3 -3
  18. package/dist/{plugin-app-cache-key-BKNjHMEs.js → plugin-app-cache-key-DJbhLYSK.js} +2 -2
  19. package/dist/{rate-limits-Dhp04Rqo.js → rate-limits-CqhWQ2R9.js} +9 -6
  20. package/dist/{request-DborTWgw.js → request-9yf9pZjf.js} +54 -8
  21. package/dist/{run-attempt-VPVJoYDP.js → run-attempt-BIoO8ISr.js} +637 -351
  22. package/dist/{config-c48K5HP9.js → session-binding-Bmt20HfB.js} +788 -3
  23. package/dist/{session-catalog-7H112Tr_.js → session-catalog-CA7R-hX2.js} +82 -45
  24. package/dist/{session-cli-B28RhCyp.js → session-cli-Bxk3-Wqz.js} +2 -2
  25. package/dist/{shared-client-D4mFI9al.js → shared-client-CSXLtCLE.js} +304 -81
  26. package/dist/{side-question-CgJBz52s.js → side-question-DtzquMOb.js} +15 -13
  27. package/dist/{thread-lifecycle-BgLXzjvV.js → thread-lifecycle-CQ_9mAa1.js} +1821 -1582
  28. package/dist/{protocol-validators-dZQ-UTOa.js → transcript-mirror-D9rTxx2P.js} +485 -2
  29. package/dist/usage-CuPpFgTc.js +25 -0
  30. package/dist/{web-search-provider.runtime-Bs-eTn5U.js → web-search-provider.runtime-_x5XTeqh.js} +3 -3
  31. package/npm-shrinkwrap.json +30 -30
  32. package/openclaw.plugin.json +21 -6
  33. package/package.json +6 -6
  34. package/dist/capabilities-42Dfn2TV.js +0 -33
  35. package/dist/prompt-overlay.js +0 -15
  36. package/dist/protocol-BMifTfdW.js +0 -15
  37. package/dist/provider-catalog.js +0 -118
  38. package/dist/provider-discovery.js +0 -34
  39. package/dist/provider.js +0 -307
  40. package/dist/session-binding-BMfX1OX-.js +0 -786
  41. package/dist/transcript-mirror-DhLwFIL4.js +0 -485
@@ -1,14 +1,11 @@
1
- import { i as isJsonObject, t as CODEX_INTERACTIVE_THREAD_SOURCE_KINDS } from "./protocol-BMifTfdW.js";
2
- import { f as resolveCodexAppServerRuntimeOptions, v as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-c48K5HP9.js";
3
- import { n as listCodexAppServerModels } from "./models-DuKzZA6G.js";
4
- import { t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-BKNjHMEs.js";
5
- import { O as CodexAppServerRpcError, a as getLeasedSharedCodexAppServerClient, c as releaseLeasedSharedCodexAppServerClient } from "./shared-client-D4mFI9al.js";
6
- import { c as sessionBindingIdentity, s as reclaimCurrentCodexSessionGeneration } from "./session-binding-BMfX1OX-.js";
7
- import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-DhLwFIL4.js";
8
- import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-42Dfn2TV.js";
9
- import { r as formatCodexDisplayText } from "./command-formatters-D6ZlGNmb.js";
1
+ import { J as CODEX_INTERACTIVE_THREAD_SOURCE_KINDS, R as CodexAppServerRpcError, Z as isJsonObject, a as getLeasedSharedCodexAppServerClient, c as releaseLeasedSharedCodexAppServerClient, m as withTimeout, q as CODEX_INTERACTIVE_CUSTOM_THREAD_SOURCES } from "./shared-client-CSXLtCLE.js";
2
+ import { E as resolveCodexSupervisionAppServerRuntimeOptions, b as resolveCodexAppServerRuntimeOptions, c as sessionBindingIdentity, s as reclaimCurrentCodexSessionGeneration } from "./session-binding-Bmt20HfB.js";
3
+ import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-D9rTxx2P.js";
4
+ import { n as listCodexAppServerModels } from "./models-DD5zBdX5.js";
5
+ import { t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-DJbhLYSK.js";
6
+ import { d as CODEX_CONTROL_METHODS, f as describeControlFailure, r as formatCodexDisplayText } from "./command-formatters-NCTL7A2q.js";
10
7
  import { n as createCodexCliNodeConversationBindingData } from "./conversation-binding-data-BHRpYbX3.js";
11
- import { n as requestCodexAppServerJson, t as requestCodexAppServerClientJson } from "./request-DborTWgw.js";
8
+ import { n as requestCodexAppServerClientJson, r as requestCodexAppServerJson } from "./request-9yf9pZjf.js";
12
9
  import fs from "node:fs/promises";
13
10
  import path from "node:path";
14
11
  import { timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
@@ -24,7 +21,7 @@ import { spawn } from "node:child_process";
24
21
  import { resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
25
22
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
26
23
  import process$1 from "node:process";
27
- import { decodeNodePtyResumeParams, resolveExecutableFromPathEnv, runNodePtyCommand } from "openclaw/plugin-sdk/node-host";
24
+ import { decodeNodePtyResumeParams, resolveNodeHostExecutable, runNodePtyCommand } from "openclaw/plugin-sdk/node-host";
28
25
  //#region extensions/codex/src/node-cli-sessions.ts
29
26
  const CODEX_CLI_SESSIONS_LIST_COMMAND = "codex.cli.sessions.list";
30
27
  const CODEX_CLI_SESSION_RESUME_COMMAND = "codex.cli.session.resume";
@@ -644,12 +641,16 @@ function boundedCatalogString(value, maxLength, overflow = "omit") {
644
641
  if (normalized.length <= maxLength) return normalized;
645
642
  return overflow === "truncate" ? truncateUtf16Safe(normalized, maxLength) : void 0;
646
643
  }
644
+ function normalizeInteractiveThreadSource(source) {
645
+ if (CODEX_INTERACTIVE_THREAD_SOURCE_KINDS.some((kind) => kind === source) || CODEX_INTERACTIVE_CUSTOM_THREAD_SOURCES.some((kind) => kind === source)) return source;
646
+ if (isRecord(source) && CODEX_INTERACTIVE_CUSTOM_THREAD_SOURCES.some((kind) => kind === source.custom)) return source.custom;
647
+ }
647
648
  function isInteractiveThreadSource(source) {
648
- return CODEX_INTERACTIVE_THREAD_SOURCE_KINDS.some((kind) => kind === source);
649
+ return normalizeInteractiveThreadSource(source) !== void 0;
649
650
  }
650
651
  function toCatalogSession(thread, archived) {
651
- const source = thread.source;
652
- if (!isInteractiveThreadSource(source)) return;
652
+ const source = normalizeInteractiveThreadSource(thread.source);
653
+ if (!source) return;
653
654
  const record = thread;
654
655
  const threadId = boundedCatalogString(thread.id, 256);
655
656
  if (!threadId) return;
@@ -1062,6 +1063,7 @@ const CODEX_NODE_CONTINUE_COMMANDS = [
1062
1063
  CODEX_APP_SERVER_THREAD_TURNS_LIST_COMMAND,
1063
1064
  CODEX_CLI_SESSION_RESUME_COMMAND
1064
1065
  ];
1066
+ const NODE_CATALOG_LIST_RESPONSE_TIMEOUT_MS = 8e3;
1065
1067
  function nodeLabel(node) {
1066
1068
  return node.displayName?.trim() || node.remoteIp?.trim() || node.nodeId;
1067
1069
  }
@@ -1084,16 +1086,20 @@ async function listPairedNode(params) {
1084
1086
  nodeId: params.node.nodeId,
1085
1087
  canContinueCodex: canContinueCodexOnNode(params.node)
1086
1088
  };
1087
- if (params.node.connected !== true) return {
1088
- ...common,
1089
- connected: false,
1090
- sessions: [],
1091
- error: {
1092
- code: "NODE_OFFLINE",
1093
- message: "Paired node is offline"
1094
- }
1095
- };
1096
- try {
1089
+ if (params.node.connected !== true) {
1090
+ const host = {
1091
+ ...common,
1092
+ connected: false,
1093
+ sessions: [],
1094
+ error: {
1095
+ code: "NODE_OFFLINE",
1096
+ message: "Paired node is offline"
1097
+ }
1098
+ };
1099
+ params.onHost?.(host);
1100
+ return host;
1101
+ }
1102
+ const eventualHost = Promise.resolve().then(async () => {
1097
1103
  const page = filterCatalogPageByTitle(parseCatalogPage(unwrapNodeInvokePayload(await params.runtime.nodes.invoke({
1098
1104
  nodeId: params.node.nodeId,
1099
1105
  command: CODEX_APP_SERVER_THREADS_LIST_COMMAND,
@@ -1114,6 +1120,15 @@ async function listPairedNode(params) {
1114
1120
  return adopted ? Object.assign({}, session, { openClawSessionKey: adopted.key }) : session;
1115
1121
  })
1116
1122
  };
1123
+ }).catch((error) => ({
1124
+ ...common,
1125
+ connected: true,
1126
+ sessions: [],
1127
+ error: catalogError("NODE_INVOKE_FAILED", error)
1128
+ }));
1129
+ if (params.onHost) eventualHost.then(params.onHost).catch(() => void 0);
1130
+ try {
1131
+ return await withTimeout(eventualHost, NODE_CATALOG_LIST_RESPONSE_TIMEOUT_MS, "paired node Codex session catalog timed out");
1117
1132
  } catch (error) {
1118
1133
  return {
1119
1134
  ...common,
@@ -1159,7 +1174,7 @@ async function resolveNodeCodexRecord(params) {
1159
1174
  }
1160
1175
  function requireContinuableNodeRecord(record) {
1161
1176
  if (record.archived) throw new CatalogParamsError("Codex session is archived on the paired node");
1162
- if (!isInteractiveThreadSource(record.source)) throw new CatalogParamsError("Codex session is not a non-archived interactive CLI or VS Code session");
1177
+ if (!isInteractiveThreadSource(record.source)) throw new CatalogParamsError("Codex session is not a non-archived interactive Codex session");
1163
1178
  if (record.status === "idle" || record.status === "notLoaded") return;
1164
1179
  if (record.status === "active") throw new CatalogParamsError("Codex session is active on the paired node; wait for it to finish before continuing");
1165
1180
  throw new CatalogParamsError("Codex session cannot be continued in its current state");
@@ -1268,8 +1283,15 @@ async function continueNodeCodexSession(params) {
1268
1283
  //#endregion
1269
1284
  //#region extensions/codex/src/session-catalog-terminal.ts
1270
1285
  const CODEX_TERMINAL_RESUME_COMMAND = "codex.terminal.resume.v1";
1271
- function resolveLocalCodexTerminalExecutable(pathEnv = process.env.PATH ?? "") {
1272
- return resolveExecutableFromPathEnv("codex", pathEnv);
1286
+ function resolveLocalCodexTerminalExecutable(env = process.env) {
1287
+ return resolveLocalCodexTerminalResolution(env)?.executable;
1288
+ }
1289
+ function resolveLocalCodexTerminalResolution(env = process.env) {
1290
+ return resolveNodeHostExecutable("codex", {
1291
+ env,
1292
+ pathEnv: env.PATH ?? env.Path ?? "",
1293
+ strategy: "fallback"
1294
+ });
1273
1295
  }
1274
1296
  function codexNodeTerminalCapability(node) {
1275
1297
  const commands = node.invocableCommands ?? node.commands;
@@ -1285,11 +1307,11 @@ async function requireCatalogEligibleThread(control, threadId) {
1285
1307
  });
1286
1308
  const candidate = page.sessions.find((session) => session.threadId === threadId);
1287
1309
  if (candidate) {
1288
- if (candidate.source === "cli" || candidate.source === "vscode") return candidate;
1289
- throw new CatalogParamsError("Codex session is not a non-archived interactive CLI or VS Code session");
1310
+ if (isInteractiveThreadSource(candidate.source)) return candidate;
1311
+ throw new CatalogParamsError("Codex session is not a non-archived interactive Codex session");
1290
1312
  }
1291
1313
  const nextCursor = page.nextCursor?.trim();
1292
- if (!nextCursor) throw new CatalogParamsError("Codex session is not a non-archived interactive CLI or VS Code session");
1314
+ if (!nextCursor) throw new CatalogParamsError("Codex session is not a non-archived interactive Codex session");
1293
1315
  if (seenCursors.has(nextCursor)) throw new CatalogParamsError("Codex session eligibility could not be verified");
1294
1316
  seenCursors.add(nextCursor);
1295
1317
  cursor = nextCursor;
@@ -1302,7 +1324,11 @@ function createCodexTerminalNodeHostCommand(control) {
1302
1324
  cap: CODEX_APP_SERVER_THREADS_CAPABILITY,
1303
1325
  dangerous: false,
1304
1326
  duplex: true,
1305
- isAvailable: ({ env }) => Boolean(resolveExecutableFromPathEnv("codex", env.PATH ?? "")),
1327
+ isAvailable: ({ env }) => Boolean(resolveNodeHostExecutable("codex", {
1328
+ env,
1329
+ pathEnv: env.PATH ?? env.Path ?? "",
1330
+ strategy: "direct"
1331
+ })),
1306
1332
  handle: async (paramsJSON, io) => {
1307
1333
  if (!io) throw new Error("Codex terminal command requires duplex transport");
1308
1334
  const resume = decodeNodePtyResumeParams(paramsJSON, (value) => {
@@ -1310,10 +1336,14 @@ function createCodexTerminalNodeHostCommand(control) {
1310
1336
  return value;
1311
1337
  });
1312
1338
  const record = await requireCatalogEligibleThread(control, resume.threadId);
1313
- const file = resolveExecutableFromPathEnv("codex", process.env.PATH ?? "");
1314
- if (!file) throw new Error("Codex CLI is unavailable");
1339
+ const resolution = resolveNodeHostExecutable("codex", {
1340
+ env: process.env,
1341
+ pathEnv: process.env.PATH ?? process.env.Path ?? "",
1342
+ strategy: "direct"
1343
+ });
1344
+ if (!resolution) throw new Error("Codex CLI is unavailable");
1315
1345
  return JSON.stringify(await runNodePtyCommand({
1316
- file,
1346
+ file: resolution.executable,
1317
1347
  args: ["resume", resume.threadId],
1318
1348
  cwd: record.cwd,
1319
1349
  cols: resume.cols,
@@ -1347,22 +1377,23 @@ async function resolveNodeCatalogEligibleThread(params) {
1347
1377
  seenCursors.add(nextCursor);
1348
1378
  cursor = nextCursor;
1349
1379
  }
1350
- throw new CatalogParamsError("Codex session is not a non-archived interactive CLI or VS Code session");
1380
+ throw new CatalogParamsError("Codex session is not a non-archived interactive Codex session");
1351
1381
  }
1352
1382
  async function openCodexCatalogTerminal(params) {
1353
1383
  const title = `codex resume ${params.threadId.slice(0, 8)}…`;
1354
1384
  if (params.hostId === "gateway:local") {
1355
1385
  const record = await requireCatalogEligibleThread(params.control, params.threadId);
1356
- const executable = resolveLocalCodexTerminalExecutable();
1357
- if (!executable) throw new CatalogParamsError("Codex CLI is unavailable");
1386
+ const resolution = resolveLocalCodexTerminalResolution();
1387
+ if (!resolution) throw new CatalogParamsError("Codex CLI is unavailable");
1358
1388
  return {
1359
1389
  kind: "local",
1360
1390
  argv: [
1361
- executable,
1391
+ resolution.executable,
1362
1392
  "resume",
1363
1393
  params.threadId
1364
1394
  ],
1365
1395
  ...record.cwd ? { cwd: record.cwd } : {},
1396
+ ...resolution.pathEnv ? { pathEnv: resolution.pathEnv } : {},
1366
1397
  title
1367
1398
  };
1368
1399
  }
@@ -1615,9 +1646,8 @@ function createCodexSessionCatalogControlFromRequests(params) {
1615
1646
  archived: false,
1616
1647
  limit: remaining,
1617
1648
  modelProviders: [],
1618
- sortKey: "recency_at",
1649
+ sortKey: "updated_at",
1619
1650
  sortDirection: "desc",
1620
- sourceKinds: [...CODEX_INTERACTIVE_THREAD_SOURCE_KINDS],
1621
1651
  ...cwd ? { cwd } : {},
1622
1652
  ...cursor ? { cursor } : {}
1623
1653
  }, remainingTimeoutMs);
@@ -1787,19 +1817,22 @@ async function listCodexSessionCatalog(params) {
1787
1817
  query,
1788
1818
  runtime: params.runtime
1789
1819
  })] : [];
1820
+ for (const host of localHosts) if (params.onHost) host.then(params.onHost).catch(() => void 0);
1790
1821
  if (!(!requestedHostIds || query.hostIds?.some((hostId) => hostId.startsWith("node:")))) return { hosts: await Promise.all(localHosts) };
1791
1822
  let nodes;
1792
1823
  try {
1793
1824
  nodes = (await params.runtime.nodes.list()).nodes.filter((node) => node.commands?.includes("codex.appServer.threads.list.v1") && (!requestedHostIds || requestedHostIds.has(`node:${node.nodeId}`))).slice(0, 100 - localHosts.length);
1794
1825
  } catch (error) {
1795
- return { hosts: [...await Promise.all(localHosts), {
1826
+ const registryHost = {
1796
1827
  hostId: "node:registry",
1797
1828
  label: "Paired nodes",
1798
1829
  kind: "node",
1799
1830
  connected: false,
1800
1831
  sessions: [],
1801
1832
  error: catalogError("NODE_LIST_FAILED", error)
1802
- }] };
1833
+ };
1834
+ params.onHost?.(registryHost);
1835
+ return { hosts: [...await Promise.all(localHosts), registryHost] };
1803
1836
  }
1804
1837
  const adoptedNodeSessions = listNodeAdoptedSessionEntries({
1805
1838
  config: params.config,
@@ -1810,7 +1843,8 @@ async function listCodexSessionCatalog(params) {
1810
1843
  runtime: params.runtime,
1811
1844
  node,
1812
1845
  query,
1813
- adoptedSessions: adoptedNodeSessions
1846
+ adoptedSessions: adoptedNodeSessions,
1847
+ ...params.onHost ? { onHost: params.onHost } : {}
1814
1848
  });
1815
1849
  return Object.assign(host, codexNodeTerminalCapability(node));
1816
1850
  });
@@ -2315,13 +2349,16 @@ function registerCodexSessionCatalog(params) {
2315
2349
  label: "Codex",
2316
2350
  list: async (query) => {
2317
2351
  const localTerminalAvailable = resolveLocalCodexTerminalExecutable() !== void 0;
2352
+ const { onHost, ...gatewayQuery } = query;
2353
+ const mapHost = (host) => toGenericCatalogHost(host, localTerminalAvailable);
2318
2354
  return (await listCodexSessionCatalog({
2319
2355
  bindingStore: params.bindingStore,
2320
2356
  config: params.getRuntimeConfig(),
2321
2357
  runtime: params.api.runtime,
2322
2358
  control: params.control,
2323
- query
2324
- })).hosts.map((host) => toGenericCatalogHost(host, localTerminalAvailable));
2359
+ query: gatewayQuery,
2360
+ ...onHost ? { onHost: (host) => onHost(mapHost(host)) } : {}
2361
+ })).hosts.map(mapHost);
2325
2362
  },
2326
2363
  read: async (request) => {
2327
2364
  const page = await readCodexSessionTranscript({
@@ -1,8 +1,8 @@
1
- import { a as CODEX_LOCAL_SESSION_HOST_ID } from "./session-catalog-7H112Tr_.js";
1
+ import { a as CODEX_LOCAL_SESSION_HOST_ID } from "./session-catalog-CA7R-hX2.js";
2
2
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
3
3
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
- import { addGatewayClientOptions, callGatewayFromCli } from "openclaw/plugin-sdk/gateway-runtime";
5
4
  import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
5
+ import { addGatewayClientOptions, callGatewayFromCli } from "openclaw/plugin-sdk/gateway-runtime";
6
6
  //#region extensions/codex/src/session-cli.ts
7
7
  const CODEX_SESSION_CATALOG_CLI_TIMEOUT_MS = 75e3;
8
8
  function writeLine(value = "") {