@openclaw/codex 2026.9.1 → 2026.9.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 (109) hide show
  1. package/README.md +2 -0
  2. package/dist/api.js +18 -23
  3. package/dist/apply-B6el6hdO.js +357 -0
  4. package/dist/{attempt-client-cleanup-DYHcRQAa.js → attempt-client-cleanup-D6cR54TV.js} +113 -49
  5. package/dist/{attempt-context-DmQUNWwT.js → attempt-context-AO4DSjE0.js} +11 -9
  6. package/dist/{event-projector-usage-C5mcrGjp.js → attempt-notifications--H8zXR5-.js} +3 -89
  7. package/dist/auth-cache-key-Kq6oerr6.js +498 -0
  8. package/dist/auth-profile-CwzO4_RG.js +43 -0
  9. package/dist/auth-profile-selection-DFu9e167.js +45 -0
  10. package/dist/{binding-connection-E6uDsPlx.js → binding-connection-QqgcPCgk.js} +18 -3
  11. package/dist/{bounded-turn-wzJrwKKe.js → bounded-turn-lRpmZHFv.js} +54 -150
  12. package/dist/build-state-6RL6qohz.js +19 -0
  13. package/dist/{capabilities-dIjNVCYH.js → capabilities-BeqLPbtM.js} +2 -1
  14. package/dist/cli-metadata.js +1 -1
  15. package/dist/client-BEKu4yDx.js +3983 -0
  16. package/dist/command-dispatch-CisT9Jqq.js +21 -0
  17. package/dist/{command-formatters-CLHhEB1Q.js → command-formatters-DeTfrapr.js} +2 -2
  18. package/dist/{command-handlers-CTGb2csu.js → command-handlers-BfIsJEuA.js} +158 -76
  19. package/dist/command-rpc-BMqRQOFX.js +226 -0
  20. package/dist/{compact-_t0HQrUS.js → compact-CGJZ2rlb.js} +89 -49
  21. package/dist/config-JDfTI4VI.js +106 -0
  22. package/dist/{config-BhmfC1s6.js → config-options-jnIFvwxD.js} +208 -654
  23. package/dist/config-runtime-BWf6JLWG.js +11 -0
  24. package/dist/config-utils-C57JiJrU.js +69 -0
  25. package/dist/conversation-binding-CxOlHiix.js +889 -0
  26. package/dist/{plugin-marketplace-discovery-CfFlKqDl.js → conversation-control-CUCrSIQI.js} +36 -155
  27. package/dist/doctor-contract-api.js +8 -9
  28. package/dist/{dynamic-tools-BU9tmlYm.js → dynamic-tools-D-JBoaLt.js} +734 -698
  29. package/dist/{effective-mcp-catalog-DzYBW4h1.js → effective-mcp-catalog-J_5Ep5Um.js} +4 -3
  30. package/dist/{elicitation-input-DMkeki8d.js → elicitation-input-DPoK8F7w.js} +8 -22
  31. package/dist/ephemeral-turn-DSwzP8YY.js +101 -0
  32. package/dist/{event-projector-assistant-message-DHRFXKbS.js → event-projector-assistant-message-BmBM4qBV.js} +23 -27
  33. package/dist/event-projector-usage-CIyrYYid.js +102 -0
  34. package/dist/{harness-DXVZ5II5.js → harness-FR6eQgyO.js} +47 -17
  35. package/dist/harness.js +1 -1
  36. package/dist/history-rejection-B4nOXNXF.js +13 -0
  37. package/dist/{image-payload-sanitizer-CnfoUPCE.js → image-payload-sanitizer-tupAr-2o.js} +29 -15
  38. package/dist/incognito-session-uhrBF6wJ.js +15 -0
  39. package/dist/index.js +413 -2893
  40. package/dist/{isolated-completion-kg9kv4iH.js → isolated-completion-DHBefrzg.js} +12 -21
  41. package/dist/{managed-binary-4-Vjz5GH.js → managed-binary-DrjjRRUD.js} +17 -84
  42. package/dist/managed-thread-store-D1t5jh3G.js +66 -0
  43. package/dist/media-understanding-provider.js +4 -1
  44. package/dist/{model-catalog-CUM68Hkl.js → model-catalog-B_6M04Wo.js} +6 -5
  45. package/dist/{models-sYnEc0gd.js → models-P9k2qAof.js} +4 -4
  46. package/dist/native-execution-policy-umd0tgh4.js +128 -0
  47. package/dist/{native-subagent-monitor-CnH147jH.js → native-subagent-monitor-BbCUKRwC.js} +76 -48
  48. package/dist/node-cli-sessions-rj0ysJwM.js +527 -0
  49. package/dist/{node-exec-server.runtime-CstNHCmC.js → node-exec-server.runtime-BY_ctYnT.js} +54 -23
  50. package/dist/plan-BMJdMOEF.js +711 -0
  51. package/dist/plugin-activation-BQK-f5sV.js +133 -0
  52. package/dist/{thread-resume-C7pyVKeW.js → plugin-app-cache-key-CdSQzWyX.js} +5 -53
  53. package/dist/{plugin-approval-roundtrip-CNe-Xrjx.js → plugin-approval-roundtrip-DeW95wB5.js} +1 -1
  54. package/dist/plugin-inventory-CoRCzWW4.js +325 -0
  55. package/dist/plugin-marketplace-discovery-3akBizzF.js +134 -0
  56. package/dist/{plugin-metadata-cache-BFrPhb2c.js → plugin-metadata-cache-DgNfRAGA.js} +13 -9
  57. package/dist/protocol-CAAcVIKF.js +275 -0
  58. package/dist/{provider-capabilities-DW5p4k9w.js → provider-capabilities-W4tfK5Y5.js} +2 -2
  59. package/dist/{rate-limits-CawQJfUS.js → rate-limits-Bqnx1N4z.js} +1 -1
  60. package/dist/request-CGvGOpeR.js +198 -0
  61. package/dist/{run-attempt-D1hJO4fX.js → run-attempt-DwKds3DN.js} +1498 -1028
  62. package/dist/{runtime-artifact-C3jVimFn.js → runtime-artifact-T-NwqeSH.js} +28 -28
  63. package/dist/sandbox-guard-BcT66fWy.js +165 -0
  64. package/dist/{session-binding-BHuTCRZQ.js → session-binding-CKSepwIC.js} +118 -324
  65. package/dist/session-binding-record-CaZjYwNS.js +256 -0
  66. package/dist/session-catalog-HaDcp7Sv.js +1533 -0
  67. package/dist/session-catalog-adoption-BKLtSrwi.js +251 -0
  68. package/dist/session-catalog-archive-D0i2pGj2.js +56 -0
  69. package/dist/session-catalog-home-id-D7-aLiNt.js +190 -0
  70. package/dist/session-catalog-node-adoption-BUuDYY8R.js +182 -0
  71. package/dist/session-catalog-node-continue-CBtc4wkI.js +238 -0
  72. package/dist/session-catalog-parsing-CdD3JhdM.js +280 -0
  73. package/dist/session-catalog-provenance-DkJHo735.js +124 -0
  74. package/dist/{session-cli-CmFEXMAM.js → session-cli-CbgaHh0f.js} +3 -2
  75. package/dist/session-history-Cz-tOOYj.js +96 -0
  76. package/dist/{session-upstream-marker-C351-5Qw.js → session-history-import-DFN7sWRU.js} +5 -49
  77. package/dist/session-history-read-cxPUxyVV.js +50 -0
  78. package/dist/session-history-worker-runtime.js +60 -0
  79. package/dist/{settled-turn-context-D3SNWtUn.js → session-history.worker-CNEvGaU5.js} +75 -69
  80. package/dist/session-history.worker.js +2 -0
  81. package/dist/{session-initialization-BeWzjGiR.js → session-initialization-Jo86C60I.js} +2 -1
  82. package/dist/{session-permission-policy-DeWVTCMj.js → session-permission-policy-B22InTp_.js} +4 -7
  83. package/dist/{session-retirement-BujDjXVF.js → session-retirement-BSNG_mhf.js} +8 -7
  84. package/dist/session-upstream-marker-D15C9NHp.js +46 -0
  85. package/dist/settled-turn-context-Du6gdUDd.js +45 -0
  86. package/dist/{settled-turn-finalizer-BVJx4yoc.js → settled-turn-finalizer-BuLUrZl2.js} +54 -42
  87. package/dist/shared-client-CVhez2Uo.js +2911 -0
  88. package/dist/{side-question-BTZAII4l.js → side-question-DLbr2vUU.js} +135 -191
  89. package/dist/source-Da-h6f7e.js +518 -0
  90. package/dist/thread-archive-guard-D1bP04Tf.js +53 -0
  91. package/dist/{thread-lifecycle-DAcEJ_Om.js → thread-lifecycle-D1pzRwHB.js} +467 -977
  92. package/dist/{thread-ownership-zGokd8i1.js → thread-ownership-D6oASVRu.js} +15 -17
  93. package/dist/{thread-policy-g4KbJPzp.js → thread-policy-D8kI7yAO.js} +2 -2
  94. package/dist/thread-resume-T5cveyxA.js +52 -0
  95. package/dist/timeout-BVw8aaM1.js +33 -0
  96. package/dist/transcript-mirror-attestation-DibE0krH.js +89 -0
  97. package/dist/{transcript-mirror-DTUxFWa_.js → transcript-mirror-t5TOccct.js} +111 -379
  98. package/dist/{transport-stdio-CyPldczm.js → transport-stdio-BGjHoYLr.js} +80 -48
  99. package/dist/{upstream-session-fork-CYlBIGVt.js → upstream-session-fork-De-sLJ2r.js} +94 -166
  100. package/dist/{usage-Bj-rrzkR.js → usage-CPPTmBvZ.js} +4 -3
  101. package/dist/version-omm6IPI3.js +12 -0
  102. package/dist/{web-search-provider.runtime-D2FWSK4w.js → web-search-provider.runtime-CSVgQL0w.js} +3 -3
  103. package/openclaw.plugin.json +22 -1
  104. package/package.json +6 -6
  105. package/dist/request-DYAI5FQE.js +0 -475
  106. package/dist/session-catalog-yyvTWFOw.js +0 -3120
  107. package/dist/session-history-C5J1AKzG.js +0 -87
  108. package/dist/shared-client-DxcfF9KX.js +0 -7494
  109. package/dist/{auth-binding-Ds_QVm-X.js → auth-binding-Co2Vfcf_.js} +1 -1
@@ -1,24 +1,15 @@
1
- import { c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-DxcfF9KX.js";
2
- import { A as isCodexFastServiceTier } from "./config-BhmfC1s6.js";
3
- import { o as isCodexAppServerNativeAuthProfile, r as bindingStoreKey, s as normalizeCodexAppServerBindingModelProvider } from "./session-binding-BHuTCRZQ.js";
4
- import { E as resolveCodexAppServerRequestModelSelection, O as resolveCodexBindingModelProviderFallback } from "./thread-lifecycle-DAcEJ_Om.js";
5
- import { a as formatCodexDisplayText } from "./command-formatters-CLHhEB1Q.js";
6
- import { n as resolveCodexBindingAppServerConnection } from "./binding-connection-E6uDsPlx.js";
7
- import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
1
+ import { n as isCodexFastServiceTier } from "./config-utils-C57JiJrU.js";
2
+ import { r as bindingStoreKey } from "./session-binding-record-CaZjYwNS.js";
3
+ import { a as formatCodexDisplayText } from "./command-formatters-DeTfrapr.js";
4
+ import "./config-JDfTI4VI.js";
5
+ import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-QqgcPCgk.js";
6
+ import { n as normalizeCodexAppServerBindingModelProvider, t as isCodexAppServerNativeAuthProfile } from "./auth-profile-CwzO4_RG.js";
7
+ import { c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-CVhez2Uo.js";
8
+ import { E as resolveCodexAppServerRequestModelSelection, O as resolveCodexBindingModelProviderFallback } from "./thread-lifecycle-D1pzRwHB.js";
9
+ import "./session-binding-CKSepwIC.js";
8
10
  import { resolveAgentDir } from "openclaw/plugin-sdk/agent-runtime";
9
11
  import { getSessionEntry, patchSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
10
12
  import { ModelSelectionLockedError, applyModelOverrideWithAuthProfileCompatibility } from "openclaw/plugin-sdk/model-session-runtime";
11
- //#region extensions/codex/src/command-authorization.ts
12
- const CODEX_NATIVE_EXECUTION_AUTH_ERROR = "Only an owner or operator.admin can control Codex native execution.";
13
- const CODEX_HOST_INSPECTION_AUTH_ERROR = "Only an owner or operator.admin can inspect Codex host state.";
14
- const CODEX_FULL_PERMISSIONS_AUTH_ERROR = "Full Codex permissions require operator.admin. Choose Admin in the Control UI permission picker, or use an admin-authenticated CLI.";
15
- function hasCodexAdminScope(ctx) {
16
- return ctx.gatewayClientScopes?.includes("operator.admin") === true;
17
- }
18
- function canMutateCodexHost(ctx) {
19
- return ctx.senderIsOwner === true || hasCodexAdminScope(ctx);
20
- }
21
- //#endregion
22
13
  //#region extensions/codex/src/conversation-control.ts
23
14
  const CODEX_CONVERSATION_CONTROL_STATE = Symbol.for("openclaw.codex.conversationControl");
24
15
  function getActiveTurns() {
@@ -44,7 +35,7 @@ async function stopCodexConversationTurn(params) {
44
35
  message: "No active Codex run to stop."
45
36
  };
46
37
  const lookup = buildBindingLookup(params);
47
- const binding = await params.bindingStore.read(params.identity);
38
+ const binding = params.binding;
48
39
  if (binding?.threadId !== active.threadId) return {
49
40
  stopped: false,
50
41
  message: "The active Codex run no longer matches this session binding."
@@ -65,7 +56,10 @@ async function stopCodexConversationTurn(params) {
65
56
  await client.request("turn/interrupt", {
66
57
  threadId: active.threadId,
67
58
  turnId: active.turnId
68
- }, { timeoutMs: runtime.requestTimeoutMs });
59
+ }, {
60
+ timeoutMs: runtime.requestTimeoutMs,
61
+ assertCurrent: params.assertCurrent
62
+ });
69
63
  } finally {
70
64
  if (!active.client) releaseLeasedSharedCodexAppServerClient(client);
71
65
  }
@@ -86,7 +80,7 @@ async function steerCodexConversationTurn(params) {
86
80
  message: "No active Codex run to steer."
87
81
  };
88
82
  const lookup = buildBindingLookup(params);
89
- const binding = await params.bindingStore.read(params.identity);
83
+ const binding = params.binding;
90
84
  if (binding?.threadId !== active.threadId) return {
91
85
  steered: false,
92
86
  message: "The active Codex run no longer matches this session binding."
@@ -112,7 +106,10 @@ async function steerCodexConversationTurn(params) {
112
106
  text,
113
107
  text_elements: []
114
108
  }]
115
- }, { timeoutMs: runtime.requestTimeoutMs });
109
+ }, {
110
+ timeoutMs: runtime.requestTimeoutMs,
111
+ assertCurrent: params.assertCurrent
112
+ });
116
113
  } finally {
117
114
  if (!active.client) releaseLeasedSharedCodexAppServerClient(client);
118
115
  }
@@ -125,7 +122,8 @@ async function setCodexConversationModel(params) {
125
122
  const model = params.model.trim();
126
123
  if (!model) return "Usage: /codex model <model>";
127
124
  const lookup = buildBindingLookup(params);
128
- const binding = await requireThreadBinding(params.bindingStore, params.identity);
125
+ params.assertCurrent();
126
+ const binding = requirePreparedThreadBinding(params.binding);
129
127
  if (binding.connectionScope === "supervision") throw new ModelSelectionLockedError();
130
128
  const modelProvider = resolveConversationControlModelProvider({
131
129
  authProfileId: binding.authProfileId,
@@ -155,10 +153,11 @@ async function setCodexConversationModel(params) {
155
153
  if (identity.kind === "session" && identity.sessionKey) {
156
154
  if (!await patchSessionEntry({
157
155
  agentId: identity.agentId,
158
- storePath: resolveStorePath(params.config?.session?.store, { agentId: identity.agentId }),
156
+ storePath: params.storePath ?? resolveStorePath(params.config?.session?.store, { agentId: identity.agentId }),
159
157
  sessionKey: identity.sessionKey,
160
158
  requireWriteSuccess: true,
161
159
  replaceEntry: true,
160
+ assertCommitAllowed: params.assertCurrent,
162
161
  update: (entry) => {
163
162
  if (entry.sessionId !== identity.sessionId) throw new Error("Codex session changed while applying the model selection.");
164
163
  applyModelOverrideWithAuthProfileCompatibility({
@@ -175,23 +174,25 @@ async function setCodexConversationModel(params) {
175
174
  return entry;
176
175
  }
177
176
  })) throw new Error("Codex session changed while applying the model selection.");
178
- if (modelChanged && binding.contextEngine?.projection) await patchThreadBinding(params.bindingStore, identity, binding.threadId, projectionPatch);
177
+ if (modelChanged && binding.contextEngine?.projection) await patchThreadBinding(params.bindingStore, identity, binding.threadId, projectionPatch, params.assertCurrent);
179
178
  } else await patchThreadBinding(params.bindingStore, params.identity, binding.threadId, {
180
179
  model: nextModel,
181
180
  modelProvider: nextModelProvider,
182
181
  ...projectionPatch
183
- });
182
+ }, params.assertCurrent);
184
183
  return `Codex model set to ${formatCodexDisplayText(nextModel)}.`;
185
184
  }
186
185
  async function setCodexConversationFastMode(params) {
187
- const binding = await requireThreadBinding(params.bindingStore, params.identity);
186
+ params.assertCurrent();
187
+ const binding = requirePreparedThreadBinding(params.binding);
188
188
  if (params.enabled == null) return `Codex fast mode: ${isCodexFastServiceTier(binding.serviceTier) ? "on" : "off"}.`;
189
189
  const serviceTier = params.enabled ? "priority" : "flex";
190
- await patchThreadBinding(params.bindingStore, params.identity, binding.threadId, { serviceTier });
190
+ await patchThreadBinding(params.bindingStore, params.identity, binding.threadId, { serviceTier }, params.assertCurrent);
191
191
  return `Codex fast mode ${params.enabled ? "enabled" : "disabled"}.`;
192
192
  }
193
193
  async function setCodexConversationPermissions(params) {
194
- const storePath = resolveStorePath(params.config?.session?.store, { agentId: params.session.agentId });
194
+ params.assertCurrent();
195
+ const storePath = params.storePath ?? resolveStorePath(params.config?.session?.store, { agentId: params.session.agentId });
195
196
  if (!params.mode) {
196
197
  const entry = getSessionEntry({
197
198
  agentId: params.session.agentId,
@@ -200,6 +201,7 @@ async function setCodexConversationPermissions(params) {
200
201
  sessionKey: params.session.sessionKey,
201
202
  storePath
202
203
  });
204
+ params.assertCurrent();
203
205
  if (entry?.sessionId !== params.session.sessionId) throw new Error("Codex session changed while reading the permission mode.");
204
206
  return `Codex permissions: ${formatPermissionsMode(entry.permissionMode)}.`;
205
207
  }
@@ -209,6 +211,7 @@ async function setCodexConversationPermissions(params) {
209
211
  sessionKey: params.session.sessionKey,
210
212
  requireWriteSuccess: true,
211
213
  replaceEntry: true,
214
+ assertCommitAllowed: params.assertCurrent,
212
215
  update: (entry) => {
213
216
  if (entry.sessionId !== params.session.sessionId) throw new Error("Codex session changed while applying the permission mode.");
214
217
  entry.permissionMode = params.mode === "yolo" ? "full" : "guarded";
@@ -237,17 +240,16 @@ function parseCodexPermissionsModeArg(arg) {
237
240
  function formatPermissionsMode(mode) {
238
241
  return mode === "full" ? "full access" : mode ?? "default";
239
242
  }
240
- async function requireThreadBinding(bindingStore, identity) {
241
- const binding = await bindingStore.read(identity);
243
+ function requirePreparedThreadBinding(binding) {
242
244
  if (!binding?.threadId) throw new Error("No Codex thread is attached to this OpenClaw session yet.");
243
245
  return binding;
244
246
  }
245
- async function patchThreadBinding(bindingStore, identity, threadId, patch) {
247
+ async function patchThreadBinding(bindingStore, identity, threadId, patch, assertCurrent) {
246
248
  if (!await bindingStore.mutate(identity, {
247
249
  kind: "patch",
248
250
  threadId,
249
251
  patch
250
- })) throw new Error("Codex thread binding changed while applying the control update.");
252
+ }, assertCurrent)) throw new Error("Codex thread binding changed while applying the control update.");
251
253
  }
252
254
  function buildBindingLookup(params) {
253
255
  const agentDir = params.agentDir?.trim();
@@ -267,125 +269,4 @@ function resolveConversationControlModelProvider(params) {
267
269
  return modelProvider.toLowerCase() === "openai" ? "openai" : modelProvider;
268
270
  }
269
271
  //#endregion
270
- //#region extensions/codex/src/plugin-marketplace-discovery.ts
271
- /** Read-only discovery of Codex-owned local, curated, and remote plugin marketplaces. */
272
- const PLUGIN_SEGMENT_PATTERN = /^[A-Za-z0-9_-]+$/;
273
- const MAX_PLUGIN_DESCRIPTION_LENGTH = 160;
274
- const SUPPLEMENTAL_MARKETPLACE_KINDS = [
275
- "workspace-directory",
276
- "shared-with-me",
277
- "created-by-me-remote",
278
- "vertical"
279
- ];
280
- /** Validates the same identifier segments required by Codex's stable PluginId parser. */
281
- function parseCodexPluginMarketplaceId(value) {
282
- const separator = value.lastIndexOf("@");
283
- if (separator <= 0 || separator === value.length - 1) return;
284
- const pluginName = value.slice(0, separator);
285
- const marketplaceName = value.slice(separator + 1);
286
- return PLUGIN_SEGMENT_PATTERN.test(pluginName) && PLUGIN_SEGMENT_PATTERN.test(marketplaceName) ? {
287
- pluginName,
288
- marketplaceName
289
- } : void 0;
290
- }
291
- /** Lists local/global first and separately requests workspace, shared, and personal catalogs. */
292
- async function discoverCodexMarketplacePlugins(params) {
293
- const requestParams = { cwds: [params.workspaceDir] };
294
- const primary = await params.request(requestParams);
295
- const warnings = (primary.marketplaceLoadErrors ?? []).map((error) => boundedCatalogText(error.message));
296
- const marketplaces = [...primary.marketplaces];
297
- try {
298
- const supplemental = await params.request({
299
- ...requestParams,
300
- marketplaceKinds: [...SUPPLEMENTAL_MARKETPLACE_KINDS]
301
- });
302
- marketplaces.push(...supplemental.marketplaces);
303
- warnings.push(...(supplemental.marketplaceLoadErrors ?? []).map((error) => boundedCatalogText(error.message)));
304
- } catch (error) {
305
- let recoveredSupplementalMarketplace = false;
306
- for (const kind of SUPPLEMENTAL_MARKETPLACE_KINDS) try {
307
- const supplemental = await params.request({
308
- ...requestParams,
309
- marketplaceKinds: [kind]
310
- });
311
- marketplaces.push(...supplemental.marketplaces);
312
- recoveredSupplementalMarketplace ||= supplemental.marketplaces.length > 0;
313
- warnings.push(...(supplemental.marketplaceLoadErrors ?? []).map((loadError) => boundedCatalogText(loadError.message)));
314
- } catch (kindError) {
315
- warnings.push(boundedCatalogText(`${kind} marketplace unavailable: ${kindError instanceof Error ? kindError.message : String(kindError)}`));
316
- }
317
- if (!recoveredSupplementalMarketplace && warnings.length === 0) warnings.push(boundedCatalogText(`Additional marketplaces could not be listed: ${error instanceof Error ? error.message : String(error)}`));
318
- }
319
- const discovered = /* @__PURE__ */ new Map();
320
- const ambiguous = /* @__PURE__ */ new Set();
321
- for (const marketplace of marketplaces) {
322
- if (!PLUGIN_SEGMENT_PATTERN.test(marketplace.name)) continue;
323
- for (const summary of marketplace.plugins) {
324
- const pluginName = pluginSlug(summary, marketplace.name);
325
- if (!pluginName) continue;
326
- const id = `${pluginName}@${marketplace.name}`;
327
- if (ambiguous.has(id)) continue;
328
- const previous = discovered.get(id);
329
- const next = {
330
- id,
331
- pluginName,
332
- marketplaceName: marketplace.name,
333
- installed: summary.installed,
334
- enabled: summary.enabled,
335
- available: summary.availability !== "DISABLED_BY_ADMIN" && summary.installPolicy !== "NOT_AVAILABLE",
336
- ...summary.installPolicy ? { installPolicy: summary.installPolicy } : {},
337
- ...summary.authPolicy ? { authPolicy: summary.authPolicy } : {},
338
- ...marketplace.path ? { marketplacePath: marketplace.path } : {},
339
- ...summary.remotePluginId?.trim() ? {
340
- remotePluginId: summary.remotePluginId.trim(),
341
- mustShowInstallationInterstitial: summary.mustShowInstallationInterstitial ?? null
342
- } : {},
343
- summaryId: summary.id
344
- };
345
- const description = pluginDescription(summary);
346
- if (description) next.description = description;
347
- if (previous && (previous.marketplacePath !== next.marketplacePath || previous.remotePluginId !== next.remotePluginId)) {
348
- discovered.delete(id);
349
- ambiguous.add(id);
350
- warnings.push(`Multiple discovered plugins share ${id}; installation requires a unique identity.`);
351
- continue;
352
- }
353
- if (!previous) discovered.set(id, next);
354
- else {
355
- const preferred = !previous.installed && next.installed || !previous.enabled && next.installed && next.enabled ? next : previous;
356
- discovered.set(id, {
357
- ...preferred,
358
- available: previous.available && next.available,
359
- ...preferred.remotePluginId ? { mustShowInstallationInterstitial: previous.mustShowInstallationInterstitial === true || next.mustShowInstallationInterstitial === true ? true : previous.mustShowInstallationInterstitial === false && next.mustShowInstallationInterstitial === false ? false : null } : {},
360
- ...previous.installPolicy === "NOT_AVAILABLE" || next.installPolicy === "NOT_AVAILABLE" ? { installPolicy: "NOT_AVAILABLE" } : {}
361
- });
362
- }
363
- }
364
- }
365
- return {
366
- plugins: [...discovered.values()].toSorted((left, right) => left.id.localeCompare(right.id)),
367
- warnings
368
- };
369
- }
370
- function pluginSlug(summary, marketplaceName) {
371
- const qualified = parseCodexPluginMarketplaceId(summary.id);
372
- if (qualified?.marketplaceName === marketplaceName) return qualified.pluginName;
373
- const identitySegment = summary.id.split("/").at(-1);
374
- if (identitySegment && PLUGIN_SEGMENT_PATTERN.test(identitySegment)) return identitySegment;
375
- return PLUGIN_SEGMENT_PATTERN.test(summary.name) ? summary.name : void 0;
376
- }
377
- function pluginDescription(summary) {
378
- const description = asOptionalRecord(summary.interface)?.shortDescription;
379
- if (typeof description !== "string") return;
380
- return boundedCatalogText(description) || void 0;
381
- }
382
- function boundedCatalogText(value) {
383
- let sanitized = "";
384
- for (const character of value) {
385
- const codePoint = character.codePointAt(0);
386
- sanitized += codePoint !== void 0 && (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) ? " " : character;
387
- }
388
- return sanitized.replace(/\s+/g, " ").trim().slice(0, MAX_PLUGIN_DESCRIPTION_LENGTH);
389
- }
390
- //#endregion
391
- export { hasCodexAdminScope as _, parseCodexPermissionsModeArg as a, setCodexConversationModel as c, stopCodexConversationTurn as d, trackCodexConversationActiveTurn as f, canMutateCodexHost as g, CODEX_NATIVE_EXECUTION_AUTH_ERROR as h, parseCodexFastModeArg as i, setCodexConversationPermissions as l, CODEX_HOST_INSPECTION_AUTH_ERROR as m, parseCodexPluginMarketplaceId as n, readCodexConversationActiveTurn as o, CODEX_FULL_PERMISSIONS_AUTH_ERROR as p, formatPermissionsMode as r, setCodexConversationFastMode as s, discoverCodexMarketplacePlugins as t, steerCodexConversationTurn as u };
272
+ export { setCodexConversationFastMode as a, steerCodexConversationTurn as c, readCodexConversationActiveTurn as i, stopCodexConversationTurn as l, parseCodexFastModeArg as n, setCodexConversationModel as o, parseCodexPermissionsModeArg as r, setCodexConversationPermissions as s, formatPermissionsMode as t, trackCodexConversationActiveTurn as u };
@@ -1,16 +1,17 @@
1
1
  import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./session-binding-meta-B7aEMU7g.js";
2
2
  import { asNullableRecord, asOptionalRecord, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
3
- import fs from "node:fs/promises";
4
- import path from "node:path";
5
- import { canonicalPathFromExistingAncestor, isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
6
3
  import { createHash } from "node:crypto";
7
- import { isDeepStrictEqual } from "node:util";
8
- import { pathExists } from "openclaw/plugin-sdk/security-runtime";
9
4
  import { listAgentIds, resolveAgentDir, resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
5
+ import path from "node:path";
6
+ import fs from "node:fs/promises";
10
7
  import { setImmediate } from "node:timers/promises";
11
- import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
8
+ import { canonicalPathFromExistingAncestor, isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
9
+ import { isDeepStrictEqual } from "node:util";
12
10
  import { withFileLock } from "openclaw/plugin-sdk/file-lock";
11
+ import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
13
12
  import { archiveLegacyStateSource, legacyStateFileExists } from "openclaw/plugin-sdk/runtime-doctor-migrations";
13
+ import { pathExists } from "openclaw/plugin-sdk/security-runtime";
14
+ import { resolveStorePath } from "openclaw/plugin-sdk/session-store-paths";
14
15
  //#region extensions/codex/src/migration/session-binding-orphans.ts
15
16
  const PAGE_SIZE = 512;
16
17
  const KEY_PREFIXES = ["session-key:", "session:"];
@@ -122,7 +123,6 @@ const LEGACY_BINDING_LOCK_OPTIONS = {
122
123
  stale: 12e4
123
124
  };
124
125
  async function collectSessionSurfaces(params) {
125
- const { resolveStorePath } = await import("openclaw/plugin-sdk/session-store-runtime");
126
126
  const surfaces = /* @__PURE__ */ new Map();
127
127
  const stateRoot = await canonicalPathFromExistingAncestor(params.stateDir);
128
128
  const add = async (root, storePath, agentId, scan) => {
@@ -268,7 +268,6 @@ async function* walkSidecars(root) {
268
268
  }
269
269
  }
270
270
  async function collectBindingOwners(sources, surfaces, params) {
271
- const { resolveStorePath } = await import("openclaw/plugin-sdk/session-store-runtime");
272
271
  const sourcePaths = new Set(await Promise.all(sources.map((source) => canonicalPathFromExistingAncestor(source.transcriptPath))));
273
272
  const owners = /* @__PURE__ */ new Map();
274
273
  const storePaths = new Set(surfaces.flatMap((surface) => [...surface.storePaths]));
@@ -392,7 +391,7 @@ async function migrateSource(source, candidates, params, store) {
392
391
  return await withFileLock(source.sidecarPath, LEGACY_BINDING_LOCK_OPTIONS, async () => {
393
392
  const [contents, stat] = await Promise.all([fs.readFile(source.sidecarPath, "utf8"), fs.stat(source.sidecarPath)]);
394
393
  const raw = JSON.parse(contents);
395
- const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-BHuTCRZQ.js").then((n) => n.f), import("./conversation-binding-data-BiodpIzq.js").then((n) => n.t)]);
394
+ const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-CKSepwIC.js").then((n) => n.c), import("./conversation-binding-data-BiodpIzq.js").then((n) => n.t)]);
396
395
  const agentId = owner?.agentId ?? (source.agentIds.size === 1 ? [...source.agentIds][0] : void 0);
397
396
  const baseStored = createStoredCodexAppServerBinding(raw, {
398
397
  now: stat.mtime.toISOString(),