@openclaw/codex 2026.7.2-beta.7 → 2026.8.1-beta.2

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 (55) hide show
  1. package/README.md +2 -0
  2. package/dist/{app-server-policy-BSaO2JIT.js → app-server-policy-zcBDc1JU.js} +1 -1
  3. package/dist/attempt-client-cleanup-DMLXUfa8.js +735 -0
  4. package/dist/{notification-correlation-CU6_AnOb.js → binding-connection-I5Bo-AsX.js} +3 -37
  5. package/dist/{bounded-turn-D2ZAgZVz.js → bounded-turn-qgZmzy_4.js} +50 -49
  6. package/dist/{capabilities-BFDTVYr4.js → capabilities-CybGI1oz.js} +8 -2
  7. package/dist/cli-metadata.js +1 -1
  8. package/dist/{command-formatters-C336eRVS.js → command-formatters-B1AEz8ZA.js} +18 -18
  9. package/dist/{command-handlers-DAHUSry9.js → command-handlers-Db8pu_ds.js} +484 -95
  10. package/dist/{compact-D_uvHurS.js → compact-LspQaGfl.js} +213 -199
  11. package/dist/{conversation-binding-data-BHRpYbX3.js → conversation-binding-data-CW2GuupV.js} +6 -10
  12. package/dist/doctor-contract-api.js +40 -43
  13. package/dist/{dynamic-tools-D2gYkSBO.js → dynamic-tools-BVdyWkUD.js} +2597 -1221
  14. package/dist/{effective-mcp-catalog-Bbd98Inw.js → effective-mcp-catalog-DIIhAtOZ.js} +20 -15
  15. package/dist/{event-projector-assistant-message-DTgnPPVF.js → event-projector-assistant-message-BwxV4d6N.js} +11 -23
  16. package/dist/{attempt-notifications-AP-a-Q5k.js → event-projector-usage-e5huIQWu.js} +113 -29
  17. package/dist/harness.js +80 -14
  18. package/dist/image-payload-sanitizer-CnfoUPCE.js +65 -0
  19. package/dist/index.js +591 -240
  20. package/dist/isolated-completion-C58NbL40.js +75 -0
  21. package/dist/local-runtime-attribution-B_2mnqhb.js +19 -0
  22. package/dist/media-understanding-provider.js +5 -5
  23. package/dist/{models-BBMKU4jA.js → models-BFlpn1Ex.js} +12 -17
  24. package/dist/native-subagent-monitor-DyTGmTUx.js +3111 -0
  25. package/dist/{plugin-app-cache-key-DztPafOA.js → plugin-app-cache-key-C3H2CVp6.js} +5 -5
  26. package/dist/plugin-marketplace-discovery-CzrGJdCR.js +385 -0
  27. package/dist/{computer-use-CYEc8U3w.js → plugin-metadata-cache-CNJPj4_b.js} +105 -5
  28. package/dist/protocol-validators-B4F7L8Rf.js +2346 -0
  29. package/dist/{rate-limits-CU-gVCCS.js → rate-limits-DZXmOL8-.js} +17 -35
  30. package/dist/{request-qKh331yu.js → request-BRl5_UfX.js} +3 -3
  31. package/dist/{run-attempt-CY9WlDLc.js → run-attempt-P8BdxC1I.js} +4837 -9047
  32. package/dist/{runtime-artifact-CmtG_t1L.js → runtime-artifact-BVSPdd6g.js} +8 -23
  33. package/dist/{sandbox-guard-NuhpXmPB.js → sandbox-guard-Cmwc9eIk.js} +6 -13
  34. package/dist/{session-binding-BXpo9ymA.js → session-binding-DPxIvMgE.js} +246 -265
  35. package/dist/{session-catalog-DyOgR4WH.js → session-catalog-xwNi_SDM.js} +159 -109
  36. package/dist/{session-cli-2PZaFLRh.js → session-cli-7hgXZDV7.js} +1 -1
  37. package/dist/session-retirement-DoMMJFKm.js +36 -0
  38. package/dist/{session-upstream-marker-B6U7tLw5.js → session-upstream-marker-CrIFX06J.js} +1 -1
  39. package/dist/{settled-turn-finalizer-CXY2Z9dT.js → settled-turn-finalizer-BRWBO4MO.js} +21 -13
  40. package/dist/{shared-client-DTbvH-XV.js → shared-client-kIBbGjk4.js} +587 -223
  41. package/dist/{side-question-_ulBk1AL.js → side-question-9HAL26l9.js} +101 -52
  42. package/dist/{thread-lifecycle-DF53ogiA.js → thread-lifecycle-Bu1BTDXr.js} +694 -753
  43. package/dist/thread-ownership-6kOQHlyC.js +92 -0
  44. package/dist/thread-resume-CPrJNQVM.js +30 -0
  45. package/dist/transcript-mirror-B9gGgnJS.js +570 -0
  46. package/dist/{transport-stdio-DXgGZ7Ib.js → transport-stdio-DIImwDVS.js} +11 -0
  47. package/dist/upstream-prompt-provenance-ClRBije0.js +41 -0
  48. package/dist/{upstream-session-fork-Dy4Xvuoj.js → upstream-session-fork-CE-_LdnP.js} +5 -5
  49. package/dist/{usage-CQ6GhD5-.js → usage-CHlV0e-o.js} +3 -3
  50. package/dist/{web-search-provider.runtime-CCFhg2z5.js → web-search-provider.runtime-DRw2Vl42.js} +8 -9
  51. package/openclaw.plugin.json +18 -3
  52. package/package.json +5 -5
  53. package/dist/conversation-control-xsIeXbo4.js +0 -287
  54. package/dist/event-projector-usage-Xp4AlR2k.js +0 -86
  55. package/dist/transcript-mirror-DzsdNCf5.js +0 -6924
@@ -1,6 +1,6 @@
1
- import { W as isJsonObject } from "./shared-client-DTbvH-XV.js";
1
+ import { ct as isJsonObject } from "./shared-client-kIBbGjk4.js";
2
+ import { asBoolean, asFiniteNumber, normalizeOptionalString, parseStrictFiniteNumber } from "openclaw/plugin-sdk/string-coerce-runtime";
2
3
  import { MAX_DATE_TIMESTAMP_MS, resolveExpiresAtMsFromEpochSeconds } from "openclaw/plugin-sdk/number-runtime";
3
- import { asFiniteNumber, parseStrictFiniteNumber } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
5
5
  import { PROVIDER_LABELS, clampPercent } from "openclaw/plugin-sdk/provider-usage";
6
6
  //#region extensions/codex/src/app-server/rate-limits.ts
@@ -21,7 +21,7 @@ const CODEX_USAGE_LIMIT_MESSAGE_PREFIX = "You've reached your Codex subscription
21
21
  const CODEX_USAGE_LIMIT_STATE_MISMATCH_MESSAGE = "Codex rejected the request with a usage-limit error, but its current account usage does not report an exhausted limit.";
22
22
  /** Enriches Codex usage-limit failures with reset timing and recovery guidance. */
23
23
  function formatCodexUsageLimitErrorMessage(params) {
24
- const message = normalizeText(params.message);
24
+ const message = normalizeOptionalString(params.message);
25
25
  if (!isCodexUsageLimitError(params.codexErrorInfo)) return;
26
26
  const nowMs = params.nowMs ?? Date.now();
27
27
  const usageSummary = summarizeCodexAccountUsage(params.rateLimits, nowMs);
@@ -47,7 +47,7 @@ function formatCodexUsageLimitErrorMessage(params) {
47
47
  }
48
48
  /** Detects usage-limit messages that need a fresh rate-limit query before display. */
49
49
  function shouldRefreshCodexRateLimitsForUsageLimitMessage(message) {
50
- const text = normalizeText(message);
50
+ const text = normalizeOptionalString(message);
51
51
  return Boolean(text?.startsWith(CODEX_USAGE_LIMIT_MESSAGE_PREFIX) && !text.includes("Next reset "));
52
52
  }
53
53
  /** Formats compact summaries for raw Codex rate-limit snapshot payloads. */
@@ -133,7 +133,7 @@ function summarizeRateLimitSnapshot(snapshot, nowMs) {
133
133
  const window = readRateLimitWindow(snapshot, key);
134
134
  return window ? [formatRateLimitWindow(key, window, nowMs)] : [];
135
135
  });
136
- const reachedType = readString(snapshot, "rateLimitReachedType") ?? readString(snapshot, "rate_limit_reached_type");
136
+ const reachedType = normalizeOptionalString(snapshot.rateLimitReachedType) ?? normalizeOptionalString(snapshot.rate_limit_reached_type);
137
137
  const suffix = reachedType ? ` (${formatReachedType(reachedType)})` : "";
138
138
  if (windows.length > 0) return `${label}: ${windows.join(" · ")}${suffix}`;
139
139
  if (reachedType) return `${label}: ${formatReachedType(reachedType)}`;
@@ -171,8 +171,8 @@ function sortedRateLimitKeys(keys) {
171
171
  }
172
172
  function addRateLimitSnapshot(snapshot, snapshots, seen) {
173
173
  const signature = [
174
- readNullableString(snapshot, "limitId") ?? readNullableString(snapshot, "limit_id") ?? "",
175
- readNullableString(snapshot, "limitName") ?? readNullableString(snapshot, "limit_name") ?? "",
174
+ normalizeOptionalString(snapshot.limitId) ?? normalizeOptionalString(snapshot.limit_id) ?? "",
175
+ normalizeOptionalString(snapshot.limitName) ?? normalizeOptionalString(snapshot.limit_name) ?? "",
176
176
  formatWindowSignature(snapshot.primary),
177
177
  formatWindowSignature(snapshot.secondary)
178
178
  ].join("|");
@@ -187,17 +187,17 @@ function readRateLimitWindow(snapshot, key) {
187
187
  const window = snapshot[key];
188
188
  if (!isJsonObject(window)) return;
189
189
  return {
190
- resetsAtMs: resolveExpiresAtMsFromEpochSeconds(readNumber(window, "resetsAt") ?? readNumber(window, "resets_at"), { maxMs: MAX_DATE_TIMESTAMP_MS }) ?? 0,
190
+ resetsAtMs: resolveExpiresAtMsFromEpochSeconds(asFiniteNumber(window.resetsAt) ?? asFiniteNumber(window.resets_at), { maxMs: MAX_DATE_TIMESTAMP_MS }) ?? 0,
191
191
  ...readOptionalNumberField(window, "usedPercent", "used_percent"),
192
192
  ...readOptionalNumberField(window, "windowDurationMins", "window_duration_mins", "windowMinutes", "window_minutes")
193
193
  };
194
194
  }
195
195
  function snapshotHasDisplayableData(snapshot) {
196
- if (readString(snapshot, "rateLimitReachedType") ?? readString(snapshot, "rate_limit_reached_type")) return true;
196
+ if (normalizeOptionalString(snapshot.rateLimitReachedType) ?? normalizeOptionalString(snapshot.rate_limit_reached_type)) return true;
197
197
  return readWindowEntries(snapshot).some((entry) => entry.window.usedPercent !== void 0 || entry.window.resetsAtMs > 0);
198
198
  }
199
199
  function readOptionalNumberField(record, ...keys) {
200
- const value = keys.map((key) => readNumber(record, key)).find((entry) => entry !== void 0);
200
+ const value = keys.map((key) => asFiniteNumber(record[key])).find((entry) => entry !== void 0);
201
201
  if (value === void 0) return {};
202
202
  return keys.some((key) => key.toLowerCase().includes("window")) ? { windowDurationMins: value } : { usedPercent: value };
203
203
  }
@@ -208,7 +208,7 @@ function formatRateLimitWindowDetails(window, nowMs) {
208
208
  return `${window.usedPercent === void 0 ? "usage unknown" : `${Math.max(0, 100 - Math.round(window.usedPercent))}% left`}${window.resetsAtMs > nowMs ? ` ⏱${formatResetDuration(window.resetsAtMs, nowMs)}` : ""}`;
209
209
  }
210
210
  function formatLimitLabel(snapshot) {
211
- const label = readNullableString(snapshot, "limitName") ?? readNullableString(snapshot, "limit_name") ?? readNullableString(snapshot, "limitId") ?? readNullableString(snapshot, "limit_id");
211
+ const label = normalizeOptionalString(snapshot.limitName) ?? normalizeOptionalString(snapshot.limit_name) ?? normalizeOptionalString(snapshot.limitId) ?? normalizeOptionalString(snapshot.limit_id);
212
212
  if (!label || label === CODEX_LIMIT_ID) return "Codex";
213
213
  return label.replace(/[_-]+/gu, " ").replace(/\s+/gu, " ").trim();
214
214
  }
@@ -222,10 +222,10 @@ function formatAccountResetTime(resetsAtMs, nowMs) {
222
222
  return `${formatCalendarResetTime(resetsAtMs, nowMs)} (in ${formatRelativeDuration(resetsAtMs - nowMs)})`;
223
223
  }
224
224
  function snapshotHasLimitBlock(snapshot) {
225
- return Boolean(readString(snapshot, "rateLimitReachedType") ?? readString(snapshot, "rate_limit_reached_type") ?? readWindowEntries(snapshot).some((entry) => entry.window.usedPercent !== void 0 && entry.window.usedPercent >= 100));
225
+ return Boolean(normalizeOptionalString(snapshot.rateLimitReachedType) ?? normalizeOptionalString(snapshot.rate_limit_reached_type) ?? readWindowEntries(snapshot).some((entry) => entry.window.usedPercent !== void 0 && entry.window.usedPercent >= 100));
226
226
  }
227
227
  function isCodexLimitSnapshot(snapshot) {
228
- const id = readNullableString(snapshot, "limitId") ?? readNullableString(snapshot, "limit_id");
228
+ const id = normalizeOptionalString(snapshot.limitId) ?? normalizeOptionalString(snapshot.limit_id);
229
229
  return !id || id === CODEX_LIMIT_ID;
230
230
  }
231
231
  function selectCodexProviderUsageSnapshot(value) {
@@ -251,15 +251,15 @@ function formatProviderUsageWindowLabel(entry, entries) {
251
251
  return entry.key === "primary" ? "Short" : "Long";
252
252
  }
253
253
  function resolveCodexProviderUsagePlan(snapshot) {
254
- const plan = readString(snapshot, "planType") ?? readString(snapshot, "plan_type");
254
+ const plan = normalizeOptionalString(snapshot.planType) ?? normalizeOptionalString(snapshot.plan_type);
255
255
  const creditSummary = formatCodexCreditSummary(isJsonObject(snapshot.credits) ? snapshot.credits : void 0);
256
256
  if (!creditSummary) return plan;
257
257
  return plan ? `${plan} (${creditSummary})` : creditSummary;
258
258
  }
259
259
  function formatCodexCreditSummary(credits) {
260
260
  if (!credits) return;
261
- if ((readBoolean(credits, "hasCredits") ?? readBoolean(credits, "has_credits")) === false) return;
262
- if (readBoolean(credits, "unlimited")) return "Unlimited credits";
261
+ if ((asBoolean(credits.hasCredits) ?? asBoolean(credits.has_credits)) === false) return;
262
+ if (asBoolean(credits.unlimited)) return "Unlimited credits";
263
263
  const balance = typeof credits.balance === "string" ? parseStrictFiniteNumber(credits.balance) : asFiniteNumber(credits.balance);
264
264
  if (balance === void 0 || balance <= 0) return;
265
265
  const roundedBalance = Math.round(balance);
@@ -371,7 +371,7 @@ function formatResetDuration(resetsAtMs, nowMs) {
371
371
  }
372
372
  function formatWindowSignature(value) {
373
373
  if (!isJsonObject(value)) return "";
374
- return `${readNumber(value, "usedPercent") ?? readNumber(value, "used_percent") ?? ""}:${readNumber(value, "resetsAt") ?? readNumber(value, "resets_at") ?? ""}`;
374
+ return `${asFiniteNumber(value.usedPercent) ?? asFiniteNumber(value.used_percent) ?? ""}:${asFiniteNumber(value.resetsAt) ?? asFiniteNumber(value.resets_at) ?? ""}`;
375
375
  }
376
376
  function extractCodexRetryHint(message) {
377
377
  if (!message) return;
@@ -379,23 +379,5 @@ function extractCodexRetryHint(message) {
379
379
  if (tryAgainAt?.[1]) return tryAgainAt[1].trim();
380
380
  return /\btry again\s+((?:tomorrow|in\s+[^.!?\n]+)[^.!?\n]*)(?:[.!?]|$)/iu.exec(message)?.[1]?.trim();
381
381
  }
382
- function readString(record, key) {
383
- const value = record[key];
384
- return typeof value === "string" && value.trim() ? value.trim() : void 0;
385
- }
386
- function readNullableString(record, key) {
387
- return readString(record, key) ?? void 0;
388
- }
389
- function readNumber(record, key) {
390
- return asFiniteNumber(record[key]);
391
- }
392
- function readBoolean(record, key) {
393
- const value = record[key];
394
- return typeof value === "boolean" ? value : void 0;
395
- }
396
- function normalizeText(value) {
397
- const text = value?.trim();
398
- return text ? text : void 0;
399
- }
400
382
  //#endregion
401
383
  export { shouldRefreshCodexRateLimitsForUsageLimitMessage as a, summarizeCodexRateLimits as c, resolveCodexUsageLimitResetAtMs as i, formatCodexUsageLimitErrorMessage as n, summarizeCodexAccountRateLimits as o, hasCodexRateLimitSnapshots as r, summarizeCodexAccountUsage as s, buildCodexAppServerUsageSnapshot as t };
@@ -1,5 +1,5 @@
1
- import { a as getLeasedSharedCodexAppServerClient, g as withTimeout, i as createIsolatedCodexAppServerClient, l as releaseLeasedSharedCodexAppServerClient, p as retireSharedCodexAppServerClientIfCurrent, s as isCodexAppServerStartSelectionChangedError } from "./shared-client-DTbvH-XV.js";
2
- import { t as resolveCodexAppServerDirectSandboxBypassBlock } from "./sandbox-guard-NuhpXmPB.js";
1
+ import { _ as withTimeout, a as getLeasedSharedCodexAppServerClient, i as createIsolatedCodexAppServerClient, l as releaseLeasedSharedCodexAppServerClient, p as retireSharedCodexAppServerClientIfCurrent, s as isCodexAppServerStartSelectionChangedError } from "./shared-client-kIBbGjk4.js";
2
+ import { t as resolveCodexAppServerDirectSandboxBypassBlock } from "./sandbox-guard-Cmwc9eIk.js";
3
3
  //#region extensions/codex/src/app-server/request.ts
4
4
  /** Sends one guarded request over a client lease owned by the caller. */
5
5
  async function requestCodexAppServerClientJson(params) {
@@ -131,7 +131,7 @@ async function withCodexAppServerJsonClient(params, run) {
131
131
  signal: timeoutController.signal
132
132
  });
133
133
  };
134
- return await run(scopedRequest);
134
+ return await run(scopedRequest, client);
135
135
  } catch (error) {
136
136
  if (!isCodexAppServerStartSelectionChangedError(error) || attempt > 0) throw error;
137
137
  if (!params.isolated) retireSharedCodexAppServerClientIfCurrent(client);