@openclaw/codex 2026.9.5 → 2026.9.7

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 (174) hide show
  1. package/README.md +2 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/.setup/{account-usage-runtime-C2MOIvfq.mjs → account-usage-runtime-DFhbh1zz.mjs} +6 -6
  4. package/dist/.setup/{apply-CJ0ZfmBG.mjs → apply-D3GcSoSa.mjs} +35 -55
  5. package/dist/.setup/{attempt-client-cleanup-BpYKdTA0.mjs → attempt-client-cleanup-DOP-cW5j.mjs} +179 -73
  6. package/dist/.setup/attempt-workspace-context-C5HigshI.mjs +164 -0
  7. package/dist/.setup/{auth-binding-DhLWa_7K.mjs → auth-binding-BLWz7stm.mjs} +14 -1
  8. package/dist/.setup/{auth-cache-key-QirmgiCo.mjs → auth-cache-key-Dbvq-QgB.mjs} +41 -111
  9. package/dist/.setup/{auth-profile-WqZtZfXN.mjs → auth-profile-B0okYl2D.mjs} +1 -2
  10. package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
  11. package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
  12. package/dist/.setup/auth-start-options-BPIPeEX8.mjs +44 -0
  13. package/dist/.setup/{binding-connection-Bm38niE8.mjs → binding-connection-DTtN1KrX.mjs} +2 -2
  14. package/dist/.setup/{binding-connection.runtime-CnRMC0ta.mjs → binding-connection.runtime-6TpgD1M6.mjs} +5 -5
  15. package/dist/.setup/{bounded-turn-BtlZcivC.mjs → bounded-turn-CbjoN2OW.mjs} +140 -37
  16. package/dist/.setup/bounded-turn-isolation-B8K_ylqk.mjs +14 -0
  17. package/dist/.setup/{build-state-Xx9ybZqa.mjs → build-state-Da1_z0kd.mjs} +1 -1
  18. package/dist/.setup/{capabilities-_vXcZGSx.mjs → capabilities-B3WEZl4e.mjs} +2 -10
  19. package/dist/.setup/{client-vXs2929Q.mjs → client-N0JpgSzF.mjs} +635 -872
  20. package/dist/.setup/client-catalog-response-5HHLdcde.mjs +285 -0
  21. package/dist/.setup/{command-dispatch-naHIZwwF.mjs → command-dispatch-BeAoaovI.mjs} +9 -8
  22. package/dist/.setup/{command-formatters-CGEkdawF.mjs → command-formatters-R3ckE3Co.mjs} +36 -64
  23. package/dist/.setup/{command-handlers-BtAJEW1X.mjs → command-handlers-ylTMS00z.mjs} +301 -488
  24. package/dist/.setup/{command-rpc-DHFpn4le.mjs → command-rpc-CGJGUQ6Y.mjs} +40 -28
  25. package/dist/.setup/compact-C2WamavS.mjs +776 -0
  26. package/dist/.setup/{config-CedDWjM-.mjs → config-DKhXquav.mjs} +26 -28
  27. package/dist/.setup/{config-options-BsanJ8QG.mjs → config-options-CzyWLTJt.mjs} +68 -65
  28. package/dist/.setup/{config-parsing-CcB9iPoq.mjs → config-parsing-b088LyhT.mjs} +57 -60
  29. package/dist/.setup/{config-runtime-CeAhl_h4.mjs → config-runtime-C0NbLms1.mjs} +2 -2
  30. package/dist/.setup/{config-security-BRQ2mgW9.mjs → config-security-CE-FcGw9.mjs} +51 -215
  31. package/dist/.setup/{config-utils-DujwEnhg.mjs → config-utils-D0CXecki.mjs} +3 -13
  32. package/dist/.setup/context-engine-projection-PezSESth.mjs +387 -0
  33. package/dist/.setup/{conversation-binding-DhzrpTM6.mjs → conversation-binding-3Min8qvP.mjs} +71 -105
  34. package/dist/.setup/{conversation-binding-data-CrcyZk6O.mjs → conversation-binding-data-C746z5Pn.mjs} +8 -12
  35. package/dist/.setup/{conversation-control-DN53ns41.mjs → conversation-control-CEP8X5JC.mjs} +30 -69
  36. package/dist/.setup/{cyber-failover-DYwbmf1o.mjs → cyber-failover-XV0nNRZu.mjs} +1 -1
  37. package/dist/.setup/{cyber-failover-notice-e9G3J9-e.mjs → cyber-failover-notice-RNpGpTyP.mjs} +1 -1
  38. package/dist/.setup/{dynamic-tools-D16lOp67.mjs → dynamic-tools-DzlsLUuS.mjs} +3136 -3167
  39. package/dist/.setup/{effective-mcp-catalog-K6kLCN8X.mjs → effective-mcp-catalog-CxUtC-xG.mjs} +8 -17
  40. package/dist/.setup/{ephemeral-turn-R1gA8Sn6.mjs → ephemeral-turn-CDsPJOa2.mjs} +9 -6
  41. package/dist/.setup/event-projector-assistant-message-CigreO4K.mjs +69 -0
  42. package/dist/.setup/{event-projector-usage-C7Ntzs-f.mjs → event-projector-usage-03R0I2dM.mjs} +4 -26
  43. package/dist/.setup/event-projector-values-DJSz8BTk.mjs +106 -0
  44. package/dist/.setup/incognito-session-DWYapfwf.mjs +2 -0
  45. package/dist/.setup/{inference-context-fulhZuz8.mjs → inference-context-D-9gWlTR.mjs} +16 -18
  46. package/dist/.setup/inference-dispatch-CMZtjQyz.mjs +359 -0
  47. package/dist/.setup/inference-metadata-CgIf7sOx.mjs +81 -0
  48. package/dist/.setup/inference-proxy-DhcXOgUE.mjs +561 -0
  49. package/dist/.setup/{isolated-completion-B6srt48J.mjs → isolated-completion-Dm3PzxJk.mjs} +15 -11
  50. package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
  51. package/dist/.setup/{managed-binary-DP6Rib3P.mjs → managed-binary-kiWRhNRE.mjs} +16 -9
  52. package/dist/.setup/{model-catalog-DkvUuBey.mjs → model-catalog-PAuZgJC6.mjs} +14 -14
  53. package/dist/.setup/model-runtime-BdqzOMkU.mjs +11 -0
  54. package/dist/.setup/{models-BDFgm_G-.mjs → models-DHXZtVVk.mjs} +9 -18
  55. package/dist/.setup/{native-auth-BLZGqFjw.mjs → native-auth-CuG53tu4.mjs} +5 -5
  56. package/dist/.setup/{native-execution-policy-YBMHSzC4.mjs → native-execution-policy-BxZJy5mP.mjs} +6 -31
  57. package/dist/.setup/{native-subagent-monitor-B1hxzIOy.mjs → native-subagent-monitor-Dpsmf2wz.mjs} +4422 -3808
  58. package/dist/.setup/native-subagent-pending-assignments-DwkCzLvD.mjs +203 -0
  59. package/dist/.setup/native-task-assignments-DMQ0g3hu.mjs +194 -0
  60. package/dist/.setup/{node-cli-sessions-Cl8b2ZF3.mjs → node-cli-sessions-HC4W6FLI.mjs} +99 -111
  61. package/dist/.setup/node-exec-server.runtime-BgBfWQqo.mjs +244 -0
  62. package/dist/.setup/{plan-xD7WKYTM.mjs → plan-Y-QIvrKB.mjs} +118 -163
  63. package/dist/.setup/{plugin-activation-r8nq5Jzp.mjs → plugin-activation-cNHRfaxU.mjs} +10 -47
  64. package/dist/.setup/{plugin-app-cache-key-BOxKP7db.mjs → plugin-app-cache-key-BL9B5H0L.mjs} +9 -42
  65. package/dist/.setup/{plugin-inventory-DUle8DLz.mjs → plugin-inventory-Cky2XJUw.mjs} +32 -23
  66. package/dist/.setup/{plugin-marketplace-discovery-P-Vndfqq.mjs → plugin-marketplace-discovery-D_dV9FXa.mjs} +22 -25
  67. package/dist/.setup/{plugin-metadata-cache-DsS5buNa.mjs → plugin-metadata-cache-DsjsL1dr.mjs} +328 -318
  68. package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
  69. package/dist/.setup/provider-DH8NSzGt.mjs +51 -0
  70. package/dist/.setup/{provider-capabilities-B8J4Dy-O.mjs → provider-capabilities-CAxoF-X1.mjs} +35 -12
  71. package/dist/.setup/{rate-limits-DOEGYRNs.mjs → rate-limits-B7-X2TgG.mjs} +123 -166
  72. package/dist/.setup/{request-BioXJLYa.mjs → request-BHZ1nz8d.mjs} +25 -16
  73. package/dist/.setup/responses-oauth-twnuTaAa.mjs +93 -0
  74. package/dist/.setup/rpc-error-BlD2vuzn.mjs +31 -0
  75. package/dist/.setup/{run-attempt-rlA07pUv.mjs → run-attempt-D8RZUOzY.mjs} +2046 -1454
  76. package/dist/.setup/{run-attempt-lifecycle-B7JbY4-F.mjs → run-attempt-lifecycle-C-6O3Exn.mjs} +10 -24
  77. package/dist/.setup/{runtime-artifact-Dy38Z5iU.mjs → runtime-artifact-DDQ-HGXf.mjs} +43 -47
  78. package/dist/.setup/runtime-artifact-connection-D68qQn1m.mjs +78 -0
  79. package/dist/.setup/sandbox-guard-DjCz2eOw.mjs +126 -0
  80. package/dist/.setup/scope-DOC1Xjc8.mjs +6 -0
  81. package/dist/.setup/session-binding-DGCYAfvD.mjs +443 -0
  82. package/dist/.setup/{session-binding-record-TH3xA0zj.mjs → session-binding-record-Oe9L-CNY.mjs} +73 -132
  83. package/dist/.setup/{session-binding-sidecars-CKYEcfNn.mjs → session-binding-sidecars-jo6H8dFr.mjs} +242 -60
  84. package/dist/.setup/{session-catalog-fUdWDx-U.mjs → session-catalog-4sCdv5qx.mjs} +598 -452
  85. package/dist/.setup/{session-catalog-adoption-CR_whkEW.mjs → session-catalog-adoption-BU_pHWG7.mjs} +59 -26
  86. package/dist/.setup/{session-catalog-archive-CwZaPacf.mjs → session-catalog-archive-spHfihri.mjs} +7 -7
  87. package/dist/.setup/session-catalog-events-DePDzzjc.mjs +139 -0
  88. package/dist/.setup/session-catalog-home-id-vlih0B_g.mjs +22 -0
  89. package/dist/.setup/{session-catalog-index-B141u15s.mjs → session-catalog-index-CZvDzC6z.mjs} +286 -182
  90. package/dist/.setup/{session-catalog-index-order-Cc5BzlQr.mjs → session-catalog-index-order-BcQpHks3.mjs} +2 -2
  91. package/dist/.setup/{session-catalog-index-state-BAuDztHN.mjs → session-catalog-index-state-TeO7EyO-.mjs} +6 -2
  92. package/dist/.setup/session-catalog-limits-DDxOsQeC.mjs +14 -0
  93. package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +170 -0
  94. package/dist/.setup/session-catalog-native-projection-DjhwGL6x.mjs +178 -0
  95. package/dist/.setup/{session-catalog-node-adoption-BVRsYOSh.mjs → session-catalog-node-adoption-DgXvSGu0.mjs} +30 -35
  96. package/dist/.setup/{session-catalog-node-continue-Dowv8osw.mjs → session-catalog-node-continue-DjKXHBbi.mjs} +25 -18
  97. package/dist/.setup/session-catalog-node-lookup-CtAXI5W5.mjs +56 -0
  98. package/dist/.setup/{session-catalog-native-projection-ChV3cCtm.mjs → session-catalog-parsing-CPGaPYr-.mjs} +14 -180
  99. package/dist/.setup/{session-catalog-projection-C1Bj9Jl-.mjs → session-catalog-projection-Cr5qP5Dj.mjs} +15 -5
  100. package/dist/.setup/session-catalog-provenance-DoAvktcj.mjs +95 -0
  101. package/dist/.setup/{session-cli-DIj-IE-E.mjs → session-cli-Cn_nCqfq.mjs} +11 -24
  102. package/dist/.setup/{session-history-C--SrLI8.mjs → session-history-D83lJWHG.mjs} +16 -23
  103. package/dist/.setup/{session-history-import-JHXT5Xfi.mjs → session-history-import-WhX-X33a.mjs} +7 -10
  104. package/dist/.setup/session-history-read-Ov3StuL4.mjs +133 -0
  105. package/dist/.setup/{session-history.worker-CpNj7H_P.mjs → session-history.worker-MnPKncqP.mjs} +14 -23
  106. package/dist/.setup/session-initialization-6aveB9qb.mjs +22 -0
  107. package/dist/.setup/{session-permission-policy-DhurXY0l.mjs → session-permission-policy-Ci_fVX6y.mjs} +4 -8
  108. package/dist/.setup/{session-retirement-CU87AOg9.mjs → session-retirement-qMTxkNx2.mjs} +31 -12
  109. package/dist/.setup/{settled-turn-context-fmwouT5I.mjs → settled-turn-context-D4yj4rxf.mjs} +1 -1
  110. package/dist/.setup/{settled-turn-finalizer-CiY2bLFK.mjs → settled-turn-finalizer-BsvEabkw.mjs} +17 -13
  111. package/dist/.setup/{shared-client-BpTtuLQ5.mjs → shared-client-DqyTMYug.mjs} +826 -485
  112. package/dist/.setup/shared-client-lifecycle-DJIgqgMw.mjs +153 -0
  113. package/dist/.setup/{side-question-DSCZyoBD.mjs → side-question-C4kCmQy1.mjs} +206 -334
  114. package/dist/.setup/{source-Bjp4UQij.mjs → source-CS_7GFJZ.mjs} +82 -139
  115. package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
  116. package/dist/.setup/{thread-archive-guard-jmecf6OJ.mjs → thread-archive-guard-C9frICzX.mjs} +10 -3
  117. package/dist/.setup/thread-lifecycle-DPflntEJ.mjs +2362 -0
  118. package/dist/.setup/{incognito-session-uhrBF6wJ.mjs → thread-ownership-queue-Dp24d7-F.mjs} +1 -2
  119. package/dist/.setup/{thread-ownership-skomxnIt.mjs → thread-ownership-roNP0l1c.mjs} +47 -10
  120. package/dist/.setup/thread-policy-DTd-DtkX.mjs +109 -0
  121. package/dist/.setup/thread-requests-B_bRnMGN.mjs +2102 -0
  122. package/dist/.setup/{thread-resume-BkNpj9Pz.mjs → thread-resume-CdDaoc7T.mjs} +6 -6
  123. package/dist/.setup/timeout-CXOfNoaX.mjs +46 -0
  124. package/dist/.setup/transcript-history-projection-DRSifI-1.mjs +201 -0
  125. package/dist/.setup/{transcript-mirror-attestation-CzM-94NC.mjs → transcript-mirror-attestation-YSegaktH.mjs} +3 -4
  126. package/dist/.setup/{transcript-mirror-D4qp_leP.mjs → transcript-mirror-kxmCYsuF.mjs} +224 -206
  127. package/dist/.setup/{transport-stdio-Cmx94Oiy.mjs → transport-stdio-Bdegpn2V.mjs} +138 -75
  128. package/dist/.setup/transport-websocket-BTBE-LD9.mjs +211 -0
  129. package/dist/.setup/{upstream-prompt-provenance-LphB8slG.mjs → upstream-prompt-provenance-fXkKbPVC.mjs} +3 -9
  130. package/dist/.setup/{upstream-session-fork-D3UKxgVD.mjs → upstream-session-fork-CBeVjBpT.mjs} +48 -40
  131. package/dist/.setup/{usage-BOgBEKso.mjs → usage-BMzNxeR_.mjs} +5 -4
  132. package/dist/.setup/{usage-limit-error-C0ow7DOc.mjs → usage-limit-error-QXerDo3i.mjs} +5 -20
  133. package/dist/.setup/{web-search-provider.runtime-CTGuJt6i.mjs → web-search-provider.runtime-P77OUeoo.mjs} +10 -20
  134. package/dist/api.js +25 -16
  135. package/dist/catalog-page-worker-entrypoint.js +12 -0
  136. package/dist/catalog-page.worker.js +9 -0
  137. package/dist/cli-metadata.js +1 -1
  138. package/dist/doctor-contract-api.js +50 -8
  139. package/dist/harness.js +344 -1
  140. package/dist/index.js +345 -346
  141. package/dist/media-understanding-provider.js +9 -22
  142. package/dist/migration-provider-api.js +1 -1
  143. package/dist/provider-discovery.js +1 -1
  144. package/dist/session-history-worker-runtime.js +16 -33
  145. package/dist/session-history.worker.js +1 -1
  146. package/openclaw.plugin.json +14 -2
  147. package/package.json +11 -7
  148. package/dist/.setup/attempt-context-VXVwTCfS.mjs +0 -636
  149. package/dist/.setup/compact-C3i3qlzj.mjs +0 -687
  150. package/dist/.setup/event-projector-assistant-message-DNUR1s0A.mjs +0 -105
  151. package/dist/.setup/event-projector-items-DyTQ_XqL.mjs +0 -200
  152. package/dist/.setup/harness-rxaaoN-o.mjs +0 -349
  153. package/dist/.setup/history-rejection-B4nOXNXF.mjs +0 -13
  154. package/dist/.setup/image-payload-sanitizer-tupAr-2o.mjs +0 -79
  155. package/dist/.setup/inference-proxy-CC15HuSi.mjs +0 -311
  156. package/dist/.setup/launch-args-DnMak49W.mjs +0 -111
  157. package/dist/.setup/local-runtime-attribution-B_2mnqhb.mjs +0 -19
  158. package/dist/.setup/native-subagent-history-YXaL6dMd.mjs +0 -135
  159. package/dist/.setup/native-subagent-task-ids-DsuOonKv.mjs +0 -411
  160. package/dist/.setup/node-exec-server.runtime-BaViBKNz.mjs +0 -226
  161. package/dist/.setup/plugin-approval-roundtrip-CjfzafAZ.mjs +0 -122
  162. package/dist/.setup/provider-fFh_-VR3.mjs +0 -50
  163. package/dist/.setup/rolldown-runtime-8H4AJuhK.mjs +0 -14
  164. package/dist/.setup/sandbox-guard-BBP-RbTf.mjs +0 -166
  165. package/dist/.setup/session-binding-_0W_fHRr.mjs +0 -721
  166. package/dist/.setup/session-catalog-events-jMcYfQyd.mjs +0 -250
  167. package/dist/.setup/session-history-read-B3ZfSUbF.mjs +0 -50
  168. package/dist/.setup/session-initialization-DH1z6fXn.mjs +0 -75
  169. package/dist/.setup/thread-history-page-BTx-4xsg.mjs +0 -83
  170. package/dist/.setup/thread-lifecycle-Cik28qWn.mjs +0 -4904
  171. package/dist/.setup/thread-policy-Cjs4B8xf.mjs +0 -54
  172. package/dist/.setup/timeout-DZF05XrR.mjs +0 -63
  173. package/dist/.setup/transcript-history-projection-DHNBDhCU.mjs +0 -243
  174. package/dist/.setup/version-CoqzXPgK.mjs +0 -12
@@ -1,4 +1,4 @@
1
- import { _ as resolveCodexAppServerUserHomeDir, g as resolveCodexAppServerLocalHomeDir, h as resolveCodexAppServerHomeDir } from "./config-security-BRQ2mgW9.mjs";
1
+ import { n as resolveCodexAppServerLocalHomeDir, r as resolveCodexAppServerUserHomeDir, t as resolveCodexAppServerHomeDir } from "./auth-start-options-BPIPeEX8.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { createHash } from "node:crypto";
@@ -23,15 +23,9 @@ function findCodexAppById(apps, id) {
23
23
  }
24
24
  //#endregion
25
25
  //#region extensions/codex/src/app-server/app-inventory-cache.ts
26
- /**
27
- * Process-local cache for Codex app-server app inventories, keyed by runtime
28
- * identity and safe to refresh in the background.
29
- */
30
- /** Default app inventory cache freshness window. */
31
26
  const CODEX_APP_INVENTORY_CACHE_TTL_MS = 36e5;
32
27
  const CODEX_APP_READ_BATCH_LIMIT = 100;
33
28
  const MAX_SERIALIZED_ERROR_MESSAGE_LENGTH = 500;
34
- /** In-memory app inventory cache with coalesced refreshes per key. */
35
29
  var CodexAppInventoryCache = class {
36
30
  constructor(options = {}) {
37
31
  this.entries = /* @__PURE__ */ new Map();
@@ -41,7 +35,6 @@ var CodexAppInventoryCache = class {
41
35
  this.revision = 0;
42
36
  this.ttlMs = options.ttlMs ?? CODEX_APP_INVENTORY_CACHE_TTL_MS;
43
37
  }
44
- /** Reads a snapshot and schedules refresh when missing, stale, or forced. */
45
38
  read(params) {
46
39
  const nowMs = resolveDateTimestampMs(params.nowMs);
47
40
  const entry = this.entries.get(params.key);
@@ -66,10 +59,6 @@ var CodexAppInventoryCache = class {
66
59
  ...entry.lastError ? { diagnostic: entry.lastError } : {}
67
60
  };
68
61
  }
69
- /** Forces or joins an immediate refresh for a cache key. */
70
- refreshNow(params) {
71
- return this.refresh(params);
72
- }
73
62
  /**
74
63
  * Marks a key stale and records the reason as a diagnostic. A scope names
75
64
  * the app ids the invalidation concerns so a covering targeted refresh can
@@ -77,7 +66,7 @@ var CodexAppInventoryCache = class {
77
66
  */
78
67
  invalidate(key, reason, nowMs = Date.now(), invalidatedAppIds) {
79
68
  this.revision += 1;
80
- this.refreshTokens.set(key, (this.refreshTokens.get(key) ?? 0) + 1);
69
+ this.refreshTokens.delete(key);
81
70
  this.inFlight.delete(key);
82
71
  const diagnostic = {
83
72
  message: reason,
@@ -95,7 +84,6 @@ var CodexAppInventoryCache = class {
95
84
  } else this.diagnostics.set(key, diagnostic);
96
85
  return this.revision;
97
86
  }
98
- /** Clears all cached snapshots, diagnostics, in-flight requests, and revision state. */
99
87
  clear() {
100
88
  this.entries.clear();
101
89
  this.inFlight.clear();
@@ -103,20 +91,18 @@ var CodexAppInventoryCache = class {
103
91
  this.diagnostics.clear();
104
92
  this.revision = 0;
105
93
  }
106
- /** Returns the monotonically increasing cache revision. */
107
94
  getRevision() {
108
95
  return this.revision;
109
96
  }
110
97
  scheduleRefresh(params) {
111
- const existing = this.inFlight.get(params.key);
112
- if (existing && !params.forceRefetch && doesInFlightRefreshCover(existing, params)) return true;
113
- this.refresh(params).catch(() => void 0);
98
+ this.refreshNow(params).catch(() => void 0);
114
99
  return true;
115
100
  }
116
- async refresh(params) {
101
+ /** Forces or joins an immediate refresh for a cache key. */
102
+ async refreshNow(params) {
117
103
  const existing = this.inFlight.get(params.key);
118
104
  if (existing && !params.forceRefetch && doesInFlightRefreshCover(existing, params)) return existing.promise;
119
- const refreshToken = (this.refreshTokens.get(params.key) ?? 0) + 1;
105
+ const refreshToken = Symbol("app-inventory-refresh");
120
106
  this.refreshTokens.set(params.key, refreshToken);
121
107
  const previousRefresh = params.forceRefetch ? void 0 : existing?.promise;
122
108
  const promise = this.refreshUncoalesced(params, refreshToken, previousRefresh);
@@ -236,7 +222,6 @@ function doesInFlightRefreshCover(existing, params) {
236
222
  const requestedAppIds = new Set(params.targetAppIds?.filter(Boolean).map(codexAppIdentityKey) ?? []);
237
223
  return requestedAppIds.size > 0 && Array.from(requestedAppIds).every((appId) => existing.targetAppIds.has(appId));
238
224
  }
239
- /** Serializes a refresh failure without leaking large or sensitive error data. */
240
225
  function serializeCodexAppInventoryError(error) {
241
226
  const record = isRecord(error) ? error : void 0;
242
227
  const data = record && "data" in record ? redactErrorData(record.data) : void 0;
@@ -247,9 +232,7 @@ function serializeCodexAppInventoryError(error) {
247
232
  ...data !== void 0 ? { data } : {}
248
233
  };
249
234
  }
250
- /** Shared app inventory cache used by Codex app-server runtime paths. */
251
235
  const defaultCodexAppInventoryCache = new CodexAppInventoryCache();
252
- /** Builds a stable cache key from build versions and runtime identity fields. */
253
236
  function buildCodexAppInventoryCacheKey(input, openClawVersion, codexPluginVersion) {
254
237
  return JSON.stringify({
255
238
  openClawVersion,
@@ -287,23 +270,7 @@ async function readInstalledApps(request, options) {
287
270
  return {
288
271
  apps: apps.flatMap((installedApp) => {
289
272
  const metadata = metadataById.get(installedApp.id);
290
- if (!metadata) return [];
291
- return [{
292
- id: installedApp.id,
293
- name: metadata.name,
294
- description: metadata.description ?? null,
295
- logoUrl: metadata.iconUrl ?? null,
296
- logoUrlDark: metadata.iconUrlDark ?? null,
297
- distributionChannel: metadata.distributionChannel ?? null,
298
- branding: null,
299
- appMetadata: null,
300
- labels: null,
301
- installUrl: metadata.installUrl ?? null,
302
- isAccessible: true,
303
- isEnabled: installedApp.enabled,
304
- pluginDisplayNames: metadata.pluginDisplayNames,
305
- ...metadata.toolSummaries ? { toolSummaries: metadata.toolSummaries } : {}
306
- }];
273
+ return metadata ? [metadata] : [];
307
274
  }),
308
275
  installedApps: apps
309
276
  };
@@ -388,7 +355,7 @@ function buildCodexAppServerConnectionFingerprint(appServer, agentDir) {
388
355
  });
389
356
  }
390
357
  function resolveCodexAppServerConnectionHome(start, agentDir) {
391
- const configured = start.env?.CODEX_HOME?.trim();
358
+ const configured = start.codexHome ?? start.env?.CODEX_HOME?.trim();
392
359
  if (configured) return configured;
393
360
  if (start.transport === "unix" && (!start.url || start.url === "unix://")) return resolveCodexAppServerUserHomeDir(start.env ?? process.env);
394
361
  if (start.transport !== "stdio") return null;
@@ -407,7 +374,7 @@ function resolveCodexPluginAppCacheEndpoint(appServer) {
407
374
  }
408
375
  /** Resolves the CODEX_HOME value that scopes local app-server inventory. */
409
376
  function resolveCodexPluginAppCacheCodexHome(appServer, agentDir) {
410
- const configuredCodexHome = appServer.start.env?.CODEX_HOME?.trim();
377
+ const configuredCodexHome = appServer.start.codexHome ?? appServer.start.env?.CODEX_HOME?.trim();
411
378
  if (configuredCodexHome) return configuredCodexHome;
412
379
  return appServer.start.transport === "stdio" && agentDir ? resolveCodexAppServerHomeDir(agentDir) : void 0;
413
380
  }
@@ -1,19 +1,14 @@
1
- import { f as resolveCodexPluginsPolicy } from "./config-parsing-CcB9iPoq.mjs";
2
- import { c as findCodexAppById } from "./plugin-app-cache-key-BOxKP7db.mjs";
3
- import "./config-CedDWjM-.mjs";
1
+ import { f as resolveCodexPluginsPolicy } from "./config-parsing-b088LyhT.mjs";
2
+ import { c as findCodexAppById } from "./plugin-app-cache-key-BL9B5H0L.mjs";
3
+ import "./config-DKhXquav.mjs";
4
4
  import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
5
5
  //#region extensions/codex/src/app-server/config-contracts.ts
6
6
  const CODEX_PLUGINS_MARKETPLACE_NAME = "openai-curated";
7
7
  const CODEX_PLUGINS_WORKSPACE_MARKETPLACE_NAME = "workspace-directory";
8
8
  //#endregion
9
9
  //#region extensions/codex/src/app-server/plugin-inventory.ts
10
- /**
11
- * Reads Codex plugin marketplace state and app inventory to decide which
12
- * plugin-owned apps can be exposed to a native Codex thread.
13
- */
14
10
  const CODEX_PLUGINS_REMOTE_MARKETPLACE_NAME = `${CODEX_PLUGINS_MARKETPLACE_NAME}-remote`;
15
11
  const CODEX_PLUGINS_API_MARKETPLACE_NAME = "openai-api-curated";
16
- /** Reads configured Codex plugin state and maps owned apps to readiness diagnostics. */
17
12
  async function readCodexPluginInventory(params) {
18
13
  const policy = params.policy ?? resolveCodexPluginsPolicy(params.pluginConfig);
19
14
  if (!policy.enabled) return {
@@ -114,8 +109,16 @@ async function readCodexPluginInventory(params) {
114
109
  apps
115
110
  });
116
111
  }
112
+ const missingKeys = /* @__PURE__ */ new Set();
113
+ for (const diagnostic of diagnostics) if (diagnostic.code === "plugin_missing" || diagnostic.code === "marketplace_missing") {
114
+ if (diagnostic.plugin) missingKeys.add(diagnostic.plugin.configKey);
115
+ embeddedAgentLog.error(diagnostic.message, { code: diagnostic.code });
116
+ }
117
117
  return {
118
- policy,
118
+ policy: {
119
+ ...policy,
120
+ pluginPolicies: policy.pluginPolicies.filter((plugin) => !missingKeys.has(plugin.configKey))
121
+ },
119
122
  records,
120
123
  diagnostics,
121
124
  ...appInventory ? { appInventory } : {}
@@ -140,7 +143,6 @@ function pluginReadParams(marketplace, pluginName) {
140
143
  pluginName
141
144
  };
142
145
  }
143
- /** Returns configured plugin keys whose current metadata may still recover. */
144
146
  function resolveRecoverableCodexPluginConfigKeys(params) {
145
147
  return params.policy.pluginPolicies.filter((pluginPolicy) => pluginPolicy.enabled && !isSettledMissingPluginPolicy({
146
148
  pluginPolicy,
@@ -149,8 +151,11 @@ function resolveRecoverableCodexPluginConfigKeys(params) {
149
151
  configCwd: params.configCwd
150
152
  })).map((pluginPolicy) => pluginPolicy.configKey).toSorted();
151
153
  }
152
- async function listCodexPluginMetadata(params, marketplaceName) {
153
- const requestParams = buildPluginCatalogRequestParams(params, marketplaceName);
154
+ async function listCodexPluginMetadata(params, marketplaceName, options = {}) {
155
+ const requestParams = {
156
+ ...buildPluginCatalogRequestParams(params, marketplaceName),
157
+ ...options.forceRefetch ? { forceRefetch: true } : {}
158
+ };
154
159
  if (!params.metadataCache || !params.appCacheKey) return await params.request("plugin/list", requestParams);
155
160
  return (await params.metadataCache.load({
156
161
  appCacheKey: params.appCacheKey,
@@ -196,7 +201,7 @@ function readCachedAppInventory(params) {
196
201
  if (!params.appCache || !params.appCacheKey) return;
197
202
  const request = async (method, requestParams) => await params.request(method, requestParams);
198
203
  return params.appCache.read({
199
- key: params.appCacheKey,
204
+ key: params.appInventoryCacheKey ?? params.appCacheKey,
200
205
  request,
201
206
  nowMs: params.nowMs,
202
207
  suppressRefresh: params.suppressAppInventoryRefresh
@@ -225,7 +230,7 @@ async function readPluginDetail(params, marketplace, pluginPolicy, summary, diag
225
230
  }
226
231
  function resolveAppOwnership(params) {
227
232
  if (params.detail && params.detail.apps.length > 0) return "proven";
228
- return (params.appInventory?.snapshot?.apps ?? []).filter((app) => app.pluginDisplayNames.some((displayName) => displayName === params.summary.name)).length > 0 ? "ambiguous" : "none";
233
+ return (params.appInventory?.snapshot?.apps ?? []).some((app) => app.pluginDisplayNames.includes(params.summary.name)) ? "ambiguous" : "none";
229
234
  }
230
235
  function resolveOwnedApps(params) {
231
236
  const detailApps = params.detail?.apps ?? [];
@@ -239,6 +244,7 @@ function resolveOwnedApps(params) {
239
244
  return [];
240
245
  }
241
246
  const appInfos = params.appInventory?.snapshot?.apps ?? [];
247
+ const installedApps = params.appInventory?.snapshot?.installedApps ?? [];
242
248
  return detailApps.map((app) => {
243
249
  const info = findCodexAppById(appInfos, app.id);
244
250
  if (!info) return {
@@ -248,15 +254,19 @@ function resolveOwnedApps(params) {
248
254
  enabled: false,
249
255
  needsAuth: true
250
256
  };
251
- return Object.assign({
252
- id: info.id,
253
- name: app.name,
254
- accessible: info.isAccessible,
255
- enabled: info.isEnabled,
256
- needsAuth: !info.isAccessible
257
- }, resolveOwnedAppApprovalOverrideKeys(info));
257
+ return Object.assign(toCodexPluginOwnedAccountApp(info, findCodexAppById(installedApps, info.id)), { name: app.name });
258
258
  }).toSorted((left, right) => left.id.localeCompare(right.id));
259
259
  }
260
+ function toCodexPluginOwnedAccountApp(app, installedApp) {
261
+ return {
262
+ id: app.id,
263
+ name: app.name,
264
+ accessible: true,
265
+ enabled: installedApp?.enabled ?? false,
266
+ needsAuth: false,
267
+ ...resolveOwnedAppApprovalOverrideKeys(app)
268
+ };
269
+ }
260
270
  /** Returns current tool keys whose overrides could bypass the requested reviewer. */
261
271
  function resolveOwnedAppApprovalOverrideKeys(app) {
262
272
  if (!app.toolSummaries) return {};
@@ -321,9 +331,8 @@ function marketplaceRef(marketplace, name) {
321
331
  function isOpenAiCuratedMarketplace(marketplace) {
322
332
  return isOpenAiCuratedMarketplaceName(marketplace.name);
323
333
  }
324
- /** True for all Codex wire aliases of the same OpenAI-curated catalog. */
325
334
  function isOpenAiCuratedMarketplaceName(marketplaceName) {
326
335
  return marketplaceName === "openai-curated" || marketplaceName === CODEX_PLUGINS_REMOTE_MARKETPLACE_NAME || marketplaceName === CODEX_PLUGINS_API_MARKETPLACE_NAME;
327
336
  }
328
337
  //#endregion
329
- export { readCodexPluginInventory as a, CODEX_PLUGINS_MARKETPLACE_NAME as c, pluginReadParams as i, CODEX_PLUGINS_WORKSPACE_MARKETPLACE_NAME as l, isOpenAiCuratedMarketplace as n, resolveOwnedAppApprovalOverrideKeys as o, isOpenAiCuratedMarketplaceName as r, resolveRecoverableCodexPluginConfigKeys as s, findCodexMarketplacePluginSummary as t };
338
+ export { marketplaceRef as a, resolveRecoverableCodexPluginConfigKeys as c, CODEX_PLUGINS_WORKSPACE_MARKETPLACE_NAME as d, listCodexPluginMetadata as i, toCodexPluginOwnedAccountApp as l, isOpenAiCuratedMarketplace as n, pluginReadParams as o, isOpenAiCuratedMarketplaceName as r, readCodexPluginInventory as s, findCodexMarketplacePluginSummary as t, CODEX_PLUGINS_MARKETPLACE_NAME as u };
@@ -1,3 +1,4 @@
1
+ import { d as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN } from "./config-utils-D0CXecki.mjs";
1
2
  import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
2
3
  //#region extensions/codex/src/command-authorization.ts
3
4
  const CODEX_NATIVE_EXECUTION_AUTH_ERROR = "Only an owner or operator.admin can control Codex native execution.";
@@ -9,11 +10,13 @@ function hasCodexAdminScope(ctx) {
9
10
  function canMutateCodexHost(ctx) {
10
11
  return ctx.senderIsOwner === true || hasCodexAdminScope(ctx);
11
12
  }
13
+ function assertCodexHostOwnerCurrent(ctx) {
14
+ if (!hasCodexAdminScope(ctx)) ctx.assertOwnerCurrent?.();
15
+ }
12
16
  //#endregion
13
17
  //#region extensions/codex/src/plugin-marketplace-discovery.ts
14
18
  /** Read-only discovery of Codex-owned local, curated, and remote plugin marketplaces. */
15
19
  const PLUGIN_NAME_PATTERN = /^[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*$/;
16
- const MARKETPLACE_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;
17
20
  const MAX_PLUGIN_METADATA_LENGTH = 160;
18
21
  const SUPPLEMENTAL_MARKETPLACE_KINDS = [
19
22
  "workspace-directory",
@@ -31,7 +34,7 @@ function parseCodexPluginMarketplaceId(value) {
31
34
  if (separator <= 0 || separator === value.length - 1) return;
32
35
  const pluginName = value.slice(0, separator);
33
36
  const marketplaceName = value.slice(separator + 1);
34
- return PLUGIN_NAME_PATTERN.test(pluginName) && MARKETPLACE_NAME_PATTERN.test(marketplaceName) ? {
37
+ return PLUGIN_NAME_PATTERN.test(pluginName) && CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN.test(marketplaceName) ? {
35
38
  pluginName,
36
39
  marketplaceName
37
40
  } : void 0;
@@ -39,26 +42,25 @@ function parseCodexPluginMarketplaceId(value) {
39
42
  /** Lists local/global first and separately requests workspace, shared, and personal catalogs. */
40
43
  async function discoverCodexMarketplacePlugins(params) {
41
44
  const requestParams = { cwds: [params.workspaceDir] };
42
- const primary = await params.request(requestParams);
43
- const warnings = (primary.marketplaceLoadErrors ?? []).map((error) => boundedCatalogText(error.message));
44
- const marketplaces = [...primary.marketplaces];
45
- try {
46
- const supplemental = await params.request({
45
+ const warnings = [];
46
+ const marketplaces = [];
47
+ const readMarketplaces = async (marketplaceKinds) => {
48
+ const response = await params.request({
47
49
  ...requestParams,
48
- marketplaceKinds: [...SUPPLEMENTAL_MARKETPLACE_KINDS]
50
+ ...marketplaceKinds ? { marketplaceKinds } : {}
49
51
  });
50
- marketplaces.push(...supplemental.marketplaces);
51
- warnings.push(...(supplemental.marketplaceLoadErrors ?? []).map((error) => boundedCatalogText(error.message)));
52
+ marketplaces.push(...response.marketplaces);
53
+ warnings.push(...(response.marketplaceLoadErrors ?? []).map((error) => boundedCatalogText(error.message)));
54
+ return response.marketplaces.length > 0;
55
+ };
56
+ await readMarketplaces();
57
+ try {
58
+ await readMarketplaces([...SUPPLEMENTAL_MARKETPLACE_KINDS]);
52
59
  } catch (error) {
53
60
  let recoveredSupplementalMarketplace = false;
54
61
  for (const kind of SUPPLEMENTAL_MARKETPLACE_KINDS) try {
55
- const supplemental = await params.request({
56
- ...requestParams,
57
- marketplaceKinds: [kind]
58
- });
59
- marketplaces.push(...supplemental.marketplaces);
60
- recoveredSupplementalMarketplace ||= supplemental.marketplaces.length > 0;
61
- warnings.push(...(supplemental.marketplaceLoadErrors ?? []).map((loadError) => boundedCatalogText(loadError.message)));
62
+ const found = await readMarketplaces([kind]);
63
+ recoveredSupplementalMarketplace ||= found;
62
64
  } catch (kindError) {
63
65
  warnings.push(boundedCatalogText(`${kind} marketplace unavailable: ${kindError instanceof Error ? kindError.message : String(kindError)}`));
64
66
  }
@@ -67,7 +69,7 @@ async function discoverCodexMarketplacePlugins(params) {
67
69
  const discovered = /* @__PURE__ */ new Map();
68
70
  const ambiguous = /* @__PURE__ */ new Set();
69
71
  for (const marketplace of marketplaces) {
70
- if (!MARKETPLACE_NAME_PATTERN.test(marketplace.name)) continue;
72
+ if (!CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN.test(marketplace.name)) continue;
71
73
  for (const summary of marketplace.plugins) {
72
74
  const pluginName = pluginSlug(summary, marketplace.name);
73
75
  if (!pluginName) continue;
@@ -126,12 +128,7 @@ function pluginSlug(summary, marketplaceName) {
126
128
  }
127
129
  function boundedCatalogText(value) {
128
130
  if (typeof value !== "string") return "";
129
- let sanitized = "";
130
- for (const character of value) {
131
- const codePoint = character.codePointAt(0);
132
- sanitized += codePoint !== void 0 && (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) ? " " : character;
133
- }
134
- return sanitized.replace(/\s+/g, " ").trim().slice(0, MAX_PLUGIN_METADATA_LENGTH);
131
+ return value.replace(/\p{Cc}/gu, " ").replace(/\s+/g, " ").trim().slice(0, MAX_PLUGIN_METADATA_LENGTH);
135
132
  }
136
133
  //#endregion
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 };
134
+ export { CODEX_HOST_INSPECTION_AUTH_ERROR as a, canMutateCodexHost as c, CODEX_FULL_PERMISSIONS_AUTH_ERROR as i, hasCodexAdminScope as l, filterCodexMarketplacePlugins as n, CODEX_NATIVE_EXECUTION_AUTH_ERROR as o, parseCodexPluginMarketplaceId as r, assertCodexHostOwnerCurrent as s, discoverCodexMarketplacePlugins as t };