@openclaw/codex 2026.9.5 → 2026.9.6

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 (120) hide show
  1. package/dist/.setup/{account-usage-runtime-C2MOIvfq.mjs → account-usage-runtime-Eem_WGqY.mjs} +5 -5
  2. package/dist/.setup/{apply-CJ0ZfmBG.mjs → apply-DDOi8uNx.mjs} +22 -28
  3. package/dist/.setup/{attempt-client-cleanup-BpYKdTA0.mjs → attempt-client-cleanup-CEv1cKwF.mjs} +58 -43
  4. package/dist/.setup/attempt-workspace-context-DUVEn_CS.mjs +331 -0
  5. package/dist/.setup/{auth-cache-key-QirmgiCo.mjs → auth-cache-key-B2mpaI9D.mjs} +9 -81
  6. package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
  7. package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
  8. package/dist/.setup/{binding-connection-Bm38niE8.mjs → binding-connection-ThoatDcb.mjs} +1 -1
  9. package/dist/.setup/{binding-connection.runtime-CnRMC0ta.mjs → binding-connection.runtime-yoHrABt-.mjs} +4 -4
  10. package/dist/.setup/{bounded-turn-BtlZcivC.mjs → bounded-turn-B2HScEgT.mjs} +138 -32
  11. package/dist/.setup/{build-state-Xx9ybZqa.mjs → build-state-C7EnDVgr.mjs} +1 -1
  12. package/dist/.setup/{capabilities-_vXcZGSx.mjs → capabilities-CDXOOFdZ.mjs} +1 -1
  13. package/dist/.setup/{client-vXs2929Q.mjs → client-Cs08OXVQ.mjs} +583 -559
  14. package/dist/.setup/client-catalog-response-BMgt_4q4.mjs +285 -0
  15. package/dist/.setup/{command-dispatch-naHIZwwF.mjs → command-dispatch-B4JuOsOk.mjs} +8 -4
  16. package/dist/.setup/{command-formatters-CGEkdawF.mjs → command-formatters-Bmqvr9tO.mjs} +8 -4
  17. package/dist/.setup/{command-handlers-BtAJEW1X.mjs → command-handlers-DW7Lx9oH.mjs} +106 -172
  18. package/dist/.setup/{command-rpc-DHFpn4le.mjs → command-rpc-DixIj3HW.mjs} +36 -21
  19. package/dist/.setup/{compact-C3i3qlzj.mjs → compact-Du5UvtxA.mjs} +14 -21
  20. package/dist/.setup/{config-CedDWjM-.mjs → config-BoTP_mrL.mjs} +3 -3
  21. package/dist/.setup/{config-options-BsanJ8QG.mjs → config-options-BvaRs51b.mjs} +46 -30
  22. package/dist/.setup/{config-runtime-CeAhl_h4.mjs → config-runtime-C8Rw1m1m.mjs} +1 -1
  23. package/dist/.setup/{config-security-BRQ2mgW9.mjs → config-security-BEReZ6go.mjs} +35 -120
  24. package/dist/.setup/{conversation-binding-DhzrpTM6.mjs → conversation-binding-DP-gMrBP.mjs} +21 -32
  25. package/dist/.setup/{conversation-control-DN53ns41.mjs → conversation-control-uK9Jomlc.mjs} +28 -67
  26. package/dist/.setup/{dynamic-tools-D16lOp67.mjs → dynamic-tools-BDXl-8Cw.mjs} +848 -578
  27. package/dist/.setup/{effective-mcp-catalog-K6kLCN8X.mjs → effective-mcp-catalog-CvnvnGIe.mjs} +3 -3
  28. package/dist/.setup/{ephemeral-turn-R1gA8Sn6.mjs → ephemeral-turn-poidXgek.mjs} +9 -6
  29. package/dist/.setup/{event-projector-assistant-message-DNUR1s0A.mjs → event-projector-assistant-message-BsruvNrH.mjs} +2 -4
  30. package/dist/.setup/{event-projector-items-DyTQ_XqL.mjs → event-projector-items-C6L_5ZiT.mjs} +42 -8
  31. package/dist/.setup/{event-projector-usage-C7Ntzs-f.mjs → event-projector-usage-CnBS8Wa3.mjs} +1 -1
  32. package/dist/.setup/{harness-rxaaoN-o.mjs → harness-a_MsE4-_.mjs} +23 -17
  33. package/dist/.setup/{inference-context-fulhZuz8.mjs → inference-context-D96l9-ew.mjs} +1 -1
  34. package/dist/.setup/inference-proxy-b-aJMSxm.mjs +601 -0
  35. package/dist/.setup/{isolated-completion-B6srt48J.mjs → isolated-completion-BIZFhTNG.mjs} +17 -10
  36. package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
  37. package/dist/.setup/{managed-binary-DP6Rib3P.mjs → managed-binary-BnshlFag.mjs} +13 -2
  38. package/dist/.setup/{model-catalog-DkvUuBey.mjs → model-catalog-CfXJf9Ay.mjs} +9 -10
  39. package/dist/.setup/{models-BDFgm_G-.mjs → models-KnqBv0hE.mjs} +3 -3
  40. package/dist/.setup/{native-auth-BLZGqFjw.mjs → native-auth-rWbGbMn3.mjs} +4 -4
  41. package/dist/.setup/{native-subagent-history-YXaL6dMd.mjs → native-subagent-history-0nYYgo0k.mjs} +26 -13
  42. package/dist/.setup/{native-subagent-monitor-B1hxzIOy.mjs → native-subagent-monitor-D3filLY2.mjs} +145 -317
  43. package/dist/.setup/{native-subagent-task-ids-DsuOonKv.mjs → native-subagent-task-ids-wb8CKZGN.mjs} +69 -39
  44. package/dist/.setup/{node-cli-sessions-Cl8b2ZF3.mjs → node-cli-sessions-r3avj02l.mjs} +86 -68
  45. package/dist/.setup/node-exec-server.runtime-BDwWXVpK.mjs +247 -0
  46. package/dist/.setup/{plan-xD7WKYTM.mjs → plan-CN3VwfNU.mjs} +74 -76
  47. package/dist/.setup/{plugin-activation-r8nq5Jzp.mjs → plugin-activation-DT3MNtqj.mjs} +7 -16
  48. package/dist/.setup/{plugin-app-cache-key-BOxKP7db.mjs → plugin-app-cache-key-B2CsSdnV.mjs} +4 -20
  49. package/dist/.setup/{plugin-approval-roundtrip-CjfzafAZ.mjs → plugin-approval-roundtrip-C0MZzCuP.mjs} +1 -1
  50. package/dist/.setup/{plugin-inventory-DUle8DLz.mjs → plugin-inventory-BoRei8Z4.mjs} +16 -7
  51. package/dist/.setup/{plugin-marketplace-discovery-P-Vndfqq.mjs → plugin-marketplace-discovery-CDOi8IFs.mjs} +4 -1
  52. package/dist/.setup/{plugin-metadata-cache-DsS5buNa.mjs → plugin-metadata-cache-Ctmo83k_.mjs} +224 -154
  53. package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
  54. package/dist/.setup/{provider-fFh_-VR3.mjs → provider-BOsxQHOM.mjs} +9 -5
  55. package/dist/.setup/{provider-capabilities-B8J4Dy-O.mjs → provider-capabilities-BfE88FZ5.mjs} +31 -3
  56. package/dist/.setup/{rate-limits-DOEGYRNs.mjs → rate-limits-CMU3DUD0.mjs} +116 -137
  57. package/dist/.setup/{request-BioXJLYa.mjs → request-D2L0zMrq.mjs} +23 -15
  58. package/dist/.setup/{run-attempt-rlA07pUv.mjs → run-attempt-BHu11r7h.mjs} +1197 -617
  59. package/dist/.setup/{runtime-artifact-Dy38Z5iU.mjs → runtime-artifact-CLZ8udh-.mjs} +29 -45
  60. package/dist/.setup/{sandbox-guard-BBP-RbTf.mjs → sandbox-guard-C2sRMOEY.mjs} +1 -1
  61. package/dist/.setup/{session-binding-_0W_fHRr.mjs → session-binding-Cm0apEbd.mjs} +3 -32
  62. package/dist/.setup/{session-binding-record-TH3xA0zj.mjs → session-binding-record-BGoz8wOK.mjs} +22 -3
  63. package/dist/.setup/{session-binding-sidecars-CKYEcfNn.mjs → session-binding-sidecars-BlB5EvIS.mjs} +48 -45
  64. package/dist/.setup/{session-catalog-fUdWDx-U.mjs → session-catalog-Pno1xGcl.mjs} +482 -182
  65. package/dist/.setup/{session-catalog-adoption-CR_whkEW.mjs → session-catalog-adoption-BI6UTDZT.mjs} +57 -25
  66. package/dist/.setup/{session-catalog-archive-CwZaPacf.mjs → session-catalog-archive-lHBqzhaO.mjs} +6 -6
  67. package/dist/.setup/{session-catalog-events-jMcYfQyd.mjs → session-catalog-events-Bj6j94E_.mjs} +122 -25
  68. package/dist/.setup/{session-catalog-index-B141u15s.mjs → session-catalog-index-B9_VQIUz.mjs} +178 -78
  69. package/dist/.setup/{session-catalog-index-order-Cc5BzlQr.mjs → session-catalog-index-order-hcdz07yN.mjs} +2 -2
  70. package/dist/.setup/{session-catalog-index-state-BAuDztHN.mjs → session-catalog-index-state-Dgh8ORJm.mjs} +5 -2
  71. package/dist/.setup/{session-catalog-native-projection-ChV3cCtm.mjs → session-catalog-native-projection-DowriLid.mjs} +30 -13
  72. package/dist/.setup/{session-catalog-node-adoption-BVRsYOSh.mjs → session-catalog-node-adoption-ITddWx_X.mjs} +24 -12
  73. package/dist/.setup/{session-catalog-node-continue-Dowv8osw.mjs → session-catalog-node-continue-6g6qi4A9.mjs} +22 -13
  74. package/dist/.setup/{session-catalog-projection-C1Bj9Jl-.mjs → session-catalog-projection-zK_PUsiE.mjs} +13 -5
  75. package/dist/.setup/{session-cli-DIj-IE-E.mjs → session-cli-irrD-uo7.mjs} +4 -4
  76. package/dist/.setup/{session-history-C--SrLI8.mjs → session-history-BrqhSCf9.mjs} +17 -22
  77. package/dist/.setup/{session-history-import-JHXT5Xfi.mjs → session-history-import-D-3wAgOP.mjs} +4 -4
  78. package/dist/.setup/{session-history.worker-CpNj7H_P.mjs → session-history.worker-CaCh0xF_.mjs} +5 -18
  79. package/dist/.setup/{session-initialization-DH1z6fXn.mjs → session-initialization-rcgbZiid.mjs} +2 -2
  80. package/dist/.setup/{session-permission-policy-DhurXY0l.mjs → session-permission-policy-BI1QK_98.mjs} +2 -2
  81. package/dist/.setup/{session-retirement-CU87AOg9.mjs → session-retirement-BH-S6qkJ.mjs} +25 -6
  82. package/dist/.setup/{settled-turn-finalizer-CiY2bLFK.mjs → settled-turn-finalizer-DiAi6Kx6.mjs} +8 -8
  83. package/dist/.setup/{shared-client-BpTtuLQ5.mjs → shared-client-DA4VR4Eb.mjs} +59 -89
  84. package/dist/.setup/{side-question-DSCZyoBD.mjs → side-question-BJ1wSDcB.mjs} +147 -211
  85. package/dist/.setup/{source-Bjp4UQij.mjs → source-CUzJq5WN.mjs} +9 -9
  86. package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
  87. package/dist/.setup/{thread-archive-guard-jmecf6OJ.mjs → thread-archive-guard-C9frICzX.mjs} +10 -3
  88. package/dist/.setup/{thread-history-page-BTx-4xsg.mjs → thread-history-page-DoVpnHim.mjs} +1 -1
  89. package/dist/.setup/{thread-lifecycle-Cik28qWn.mjs → thread-lifecycle-B3mfz1TG.mjs} +172 -2271
  90. package/dist/.setup/{thread-ownership-skomxnIt.mjs → thread-ownership-DcTtAcXj.mjs} +4 -2
  91. package/dist/.setup/{thread-policy-Cjs4B8xf.mjs → thread-policy-DGuQsuFC.mjs} +19 -3
  92. package/dist/.setup/thread-requests-BLvGkP2R.mjs +2205 -0
  93. package/dist/.setup/{thread-resume-BkNpj9Pz.mjs → thread-resume-DIBXwOpE.mjs} +6 -6
  94. package/dist/.setup/{timeout-DZF05XrR.mjs → timeout-C910MdAB.mjs} +19 -2
  95. package/dist/.setup/{transcript-history-projection-DHNBDhCU.mjs → transcript-history-projection-ZZpkFkJ_.mjs} +94 -64
  96. package/dist/.setup/{transcript-mirror-D4qp_leP.mjs → transcript-mirror-BtHDBp1G.mjs} +218 -198
  97. package/dist/.setup/{transport-stdio-Cmx94Oiy.mjs → transport-stdio-h2VHOskC.mjs} +135 -55
  98. package/dist/.setup/{upstream-session-fork-D3UKxgVD.mjs → upstream-session-fork-BUr4OUbC.mjs} +44 -36
  99. package/dist/.setup/{usage-BOgBEKso.mjs → usage-BML0r-ua.mjs} +5 -4
  100. package/dist/.setup/{usage-limit-error-C0ow7DOc.mjs → usage-limit-error-DUMbefVY.mjs} +4 -4
  101. package/dist/.setup/{web-search-provider.runtime-CTGuJt6i.mjs → web-search-provider.runtime-CDKlN-Rv.mjs} +4 -3
  102. package/dist/api.js +23 -12
  103. package/dist/catalog-page-worker-entrypoint.js +12 -0
  104. package/dist/catalog-page.worker.js +9 -0
  105. package/dist/cli-metadata.js +1 -1
  106. package/dist/doctor-contract-api.js +2 -2
  107. package/dist/harness.js +1 -1
  108. package/dist/index.js +221 -170
  109. package/dist/media-understanding-provider.js +2 -2
  110. package/dist/migration-provider-api.js +1 -1
  111. package/dist/provider-discovery.js +1 -1
  112. package/dist/session-history-worker-runtime.js +15 -32
  113. package/dist/session-history.worker.js +1 -1
  114. package/package.json +9 -6
  115. package/dist/.setup/attempt-context-VXVwTCfS.mjs +0 -636
  116. package/dist/.setup/inference-proxy-CC15HuSi.mjs +0 -311
  117. package/dist/.setup/launch-args-DnMak49W.mjs +0 -111
  118. package/dist/.setup/node-exec-server.runtime-BaViBKNz.mjs +0 -226
  119. package/dist/.setup/version-CoqzXPgK.mjs +0 -12
  120. package/dist/.setup/{native-execution-policy-YBMHSzC4.mjs → native-execution-policy-umd0tgh4.mjs} +1 -1
@@ -0,0 +1,196 @@
1
+ import { createRequire } from "node:module";
2
+ import path from "node:path";
3
+ //#region extensions/codex/src/app-server/launch-args.ts
4
+ const CODEX_VALUE_OPTIONS = /* @__PURE__ */ new Set([
5
+ "-m",
6
+ "--model",
7
+ "--local-provider",
8
+ "-p",
9
+ "--profile",
10
+ "-s",
11
+ "--sandbox",
12
+ "-a",
13
+ "--ask-for-approval",
14
+ "-C",
15
+ "--cd",
16
+ "--add-dir",
17
+ "--remote",
18
+ "--remote-auth-token-env",
19
+ "-c",
20
+ "--config",
21
+ "--enable",
22
+ "--disable",
23
+ "--listen",
24
+ "--sock",
25
+ "--code-mode-host",
26
+ "--ws-auth",
27
+ "--ws-token-file",
28
+ "--ws-token-sha256",
29
+ "--ws-shared-secret-file",
30
+ "--ws-issuer",
31
+ "--ws-audience",
32
+ "--ws-max-clock-skew-seconds"
33
+ ]);
34
+ /** One tokenization owner for launch, turn policy, reviewer trust, and private turns. */
35
+ function readCodexArgs(args) {
36
+ const tokens = [];
37
+ let nativeSubcommand = false;
38
+ let end = 0;
39
+ for (const [index, arg] of args.entries()) {
40
+ if (index < end) continue;
41
+ end = index + 1;
42
+ const attached = /^(--[^=]+)=([\s\S]*)$/u.exec(arg) ?? /^(-[cmpisaC])=?([\s\S]+)$/u.exec(arg);
43
+ const name = attached?.[1] ?? arg;
44
+ let value = attached?.[2];
45
+ if (name === "-i" || name === "--image") while (args[end]?.startsWith("-") === false) end += 1;
46
+ else if (!attached && CODEX_VALUE_OPTIONS.has(name)) {
47
+ value = args[end];
48
+ if (value !== void 0) end += 1;
49
+ }
50
+ tokens.push({
51
+ index,
52
+ end,
53
+ name,
54
+ value
55
+ });
56
+ if (name === "app-server") nativeSubcommand = true;
57
+ if (name === "--" && nativeSubcommand) break;
58
+ }
59
+ return tokens;
60
+ }
61
+ /** Uses the native CLI configuration for status without starting its transport. */
62
+ function buildCodexLoginStatusArgs(args) {
63
+ const options = /* @__PURE__ */ new Set([
64
+ "-c",
65
+ "--config",
66
+ "-p",
67
+ "--profile",
68
+ "--enable",
69
+ "--disable"
70
+ ]);
71
+ const tokens = readCodexArgs(args);
72
+ const subcommandIndex = tokens.findLast(({ name }) => name === "app-server")?.index ?? -1;
73
+ const prefix = subcommandIndex < 0 ? [] : args.slice(0, subcommandIndex);
74
+ const configArgs = tokens.filter(({ index, name }) => index > subcommandIndex && options.has(name)).flatMap(({ index, end }) => args.slice(index, end));
75
+ return [
76
+ ...prefix,
77
+ ...configArgs,
78
+ "login",
79
+ "status"
80
+ ];
81
+ }
82
+ function readCodexAppServerConfigOptions(args) {
83
+ return readCodexArgs(args).filter(({ name }) => name === "-c" || name === "--config" || name === "-p" || name === "--profile");
84
+ }
85
+ const NODE_LAUNCH_VALUE_OPTIONS = /* @__PURE__ */ new Set([
86
+ "-r",
87
+ "--require",
88
+ "--import",
89
+ "--loader",
90
+ "--experimental-loader",
91
+ "--max-old-space-size",
92
+ "--max-semi-space-size",
93
+ "--stack-size"
94
+ ]);
95
+ const NODE_LAUNCH_FLAGS = /* @__PURE__ */ new Set([
96
+ "--enable-source-maps",
97
+ "--no-warnings",
98
+ "--trace-warnings",
99
+ "--trace-uncaught",
100
+ "--no-deprecation",
101
+ "--trace-deprecation",
102
+ "--experimental-strip-types",
103
+ "--experimental-transform-types",
104
+ "--no-experimental-strip-types",
105
+ "--use-strict",
106
+ "--expose-gc"
107
+ ]);
108
+ function resolveNodeLauncherModule(value, option, cwd) {
109
+ if (path.isAbsolute(value)) return value;
110
+ if (/^\.{1,2}[\\/]/u.test(value)) return path.resolve(cwd, value);
111
+ if (option === "-r" || option === "--require") return createRequire(path.join(cwd, "openclaw-codex-launcher.cjs")).resolve(value);
112
+ if (/^(?:file|data|node):/u.test(value)) return value;
113
+ throw new Error("Private Codex turns require an absolute or relative file path for ESM preloads");
114
+ }
115
+ /** Separates a supported launcher from native flags before a private turn sanitizes them. */
116
+ function resolveCodexPrivateLauncher(params) {
117
+ const launcherArgs = [];
118
+ let nativeArgs = [...params.args];
119
+ const executable = params.command.split(/[\\/]/u).at(-1)?.toLowerCase();
120
+ if (executable && [
121
+ "node",
122
+ "node.exe",
123
+ "nodejs",
124
+ "nodejs.exe"
125
+ ].includes(executable)) {
126
+ let index = 0;
127
+ while (params.args[index]?.startsWith("-")) {
128
+ const raw = params.args[index];
129
+ index += 1;
130
+ if (raw === "--") {
131
+ launcherArgs.push(raw);
132
+ break;
133
+ }
134
+ const attached = /^(--[^=]+)=([\s\S]*)$/u.exec(raw) ?? /^(-r)([\s\S]+)$/u.exec(raw);
135
+ const name = attached?.[1] ?? raw;
136
+ const normalizedName = name.replaceAll("_", "-");
137
+ if (NODE_LAUNCH_VALUE_OPTIONS.has(normalizedName)) {
138
+ const value = attached?.[2] ?? params.args[index++];
139
+ if (value === void 0 || !value.trim()) throw new Error("Private Codex turns received a Node launcher option without its value");
140
+ const moduleOption = [
141
+ "-r",
142
+ "--require",
143
+ "--import",
144
+ "--loader",
145
+ "--experimental-loader"
146
+ ].includes(normalizedName);
147
+ if (attached && !moduleOption) launcherArgs.push(raw);
148
+ else launcherArgs.push(name, moduleOption ? resolveNodeLauncherModule(value, normalizedName, path.resolve(params.cwd)) : value);
149
+ } else if (!attached && NODE_LAUNCH_FLAGS.has(name)) launcherArgs.push(raw);
150
+ else throw new Error(`Private Codex turns cannot isolate unsupported Node launcher option ${name}`);
151
+ }
152
+ const script = params.args[index];
153
+ if (!script) throw new Error("Private Codex turns require a Node wrapper script");
154
+ launcherArgs.push(path.resolve(params.cwd, script));
155
+ nativeArgs = params.args.slice(index + 1);
156
+ if (!readCodexArgs(nativeArgs).some(({ name }) => name === "app-server")) throw new Error("Private Codex turns require a native app-server command after the Node wrapper");
157
+ }
158
+ if (executable && /^(?:(?:ba|da|z|fi)?sh|python(?:\d+(?:\.\d+)*)?|ruby|perl|cmd|powershell|pwsh)(?:\.exe)?$/u.test(executable)) throw new Error("Private Codex turns cannot isolate inline or interpreted wrappers; use a Node script or a directly executable wrapper");
159
+ const tokens = readCodexArgs(nativeArgs);
160
+ const serverIndex = tokens.findLast(({ name }) => name === "app-server")?.index ?? nativeArgs.length;
161
+ if (tokens.some(({ index, name }) => index < serverIndex && (!name.startsWith("-") || name === "--"))) throw new Error("Private Codex turns cannot isolate this launcher prefix; use a Node script or a directly executable wrapper");
162
+ return {
163
+ launcherArgs,
164
+ nativeArgs
165
+ };
166
+ }
167
+ /** The stdio proxy forwards to an external server; it does not own that runtime. */
168
+ function isCodexAppServerProxyLaunch(args) {
169
+ const tokens = readCodexArgs(args);
170
+ const server = tokens.findLastIndex(({ name }) => name === "app-server");
171
+ return server >= 0 && tokens.slice(server + 1).find(({ name }) => !name.startsWith("-"))?.name === "proxy";
172
+ }
173
+ /** Keeps Codex overrides in one CLI scope without rewriting raw TOML or wrapper prefixes. */
174
+ function normalizeCodexAppServerArgs(rawArgs, enforcedOverride) {
175
+ const tokens = readCodexArgs(rawArgs);
176
+ const subcommandIndex = tokens.findLast(({ name }) => name === "app-server")?.index ?? -1;
177
+ const prefix = subcommandIndex < 0 ? [...rawArgs] : rawArgs.slice(0, subcommandIndex);
178
+ const suffix = [];
179
+ if (subcommandIndex >= 0) for (const token of tokens) {
180
+ if (token.index <= subcommandIndex) continue;
181
+ if (token.name === "--") {
182
+ suffix.push(...rawArgs.slice(token.index));
183
+ break;
184
+ }
185
+ (token.name === "-c" || token.name === "--config" ? prefix : suffix).push(...rawArgs.slice(token.index, token.end));
186
+ }
187
+ if (enforcedOverride && !(prefix.at(-2) === "-c" && prefix.at(-1) === enforcedOverride)) prefix.push("-c", enforcedOverride);
188
+ const normalized = subcommandIndex < 0 ? prefix : [
189
+ ...prefix,
190
+ "app-server",
191
+ ...suffix
192
+ ];
193
+ return normalized.length === rawArgs.length && normalized.every((arg, index) => arg === rawArgs[index]) ? rawArgs : normalized;
194
+ }
195
+ //#endregion
196
+ export { resolveCodexPrivateLauncher as a, readCodexAppServerConfigOptions as i, isCodexAppServerProxyLaunch as n, normalizeCodexAppServerArgs as r, buildCodexLoginStatusArgs as t };
@@ -1,5 +1,4 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
2
- import { n as MANAGED_CODEX_APP_SERVER_PACKAGE } from "./version-CoqzXPgK.mjs";
3
2
  import { createRequire } from "node:module";
4
3
  import { constants, existsSync, realpathSync } from "node:fs";
5
4
  import path from "node:path";
@@ -43,6 +42,17 @@ function resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath(params = {}
43
42
  return candidates.find((candidate) => pathExists(candidate));
44
43
  }
45
44
  //#endregion
45
+ //#region extensions/codex/src/app-server/version.ts
46
+ /**
47
+ * Version and package pins for the managed Codex app-server runtime.
48
+ */
49
+ /** Exact Codex app-server version shipped by the OpenClaw Codex bridge. */
50
+ const CODEX_APP_SERVER_VERSION = "0.155.1";
51
+ /** Inclusive runtime compatibility floor for external app-server binaries. */
52
+ const MIN_SUPPORTED_CODEX_APP_SERVER_VERSION = "0.149.0";
53
+ /** npm package name for the managed Codex app-server binary. */
54
+ const MANAGED_CODEX_APP_SERVER_PACKAGE = "@openai/codex";
55
+ //#endregion
46
56
  //#region extensions/codex/src/app-server/managed-binary.ts
47
57
  /**
48
58
  * Resolves the managed Codex app-server binary shipped with or installed beside
@@ -160,6 +170,7 @@ function resolvePackageJsonFromRoot(packageName, root) {
160
170
  function resolveManagedCodexAppServerCommandCandidates(pluginRoot, platform, managedCommandOrder) {
161
171
  const packageCommand = resolveManagedCodexPackageEntrypoint(pluginRoot);
162
172
  const packageCommandPaths = packageCommand ? [packageCommand] : [];
173
+ if (managedCommandOrder === "package-only") return packageCommandPaths;
163
174
  const desktopCommandPaths = resolveMacOSDesktopCodexAppServerCommandCandidates(platform);
164
175
  return managedCommandOrder === "desktop-first" ? [...desktopCommandPaths, ...packageCommandPaths] : [...packageCommandPaths, ...desktopCommandPaths];
165
176
  }
@@ -192,4 +203,4 @@ async function commandPathExists(filePath, platform) {
192
203
  }
193
204
  }
194
205
  //#endregion
195
- export { resolvePackagedCodexNativeCommand as a, resolveMacOSDesktopCodexAppPathCandidates as c, resolveManagedCodexNativeCommand as i, resolveMacOSDesktopCodexBundledMarketplaceCandidates as l, managed_binary_exports as n, setManagedCodexPluginRoot as o, resolveManagedCodexAppServerStartOptions as r, resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath as s, isManagedCodexDesktopCommand as t, resolveMacOSDesktopCodexComputerUseServiceAppCandidates as u };
206
+ export { resolvePackagedCodexNativeCommand as a, MIN_SUPPORTED_CODEX_APP_SERVER_VERSION as c, resolveMacOSDesktopCodexBundledMarketplaceCandidates as d, resolveMacOSDesktopCodexComputerUseServiceAppCandidates as f, resolveManagedCodexNativeCommand as i, resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath as l, managed_binary_exports as n, setManagedCodexPluginRoot as o, resolveManagedCodexAppServerStartOptions as r, CODEX_APP_SERVER_VERSION as s, isManagedCodexDesktopCommand as t, resolveMacOSDesktopCodexAppPathCandidates as u };
@@ -1,13 +1,12 @@
1
- import { r as buildCodexRuntimeModelParams } from "./harness-rxaaoN-o.mjs";
2
- import { m as isJsonObject } from "./config-security-BRQ2mgW9.mjs";
1
+ import { r as buildCodexRuntimeModelParams } from "./harness-a_MsE4-_.mjs";
3
2
  import { d as readCodexPluginConfig } from "./config-parsing-CcB9iPoq.mjs";
4
- import { n as isCodexAppServerProxyLaunch } from "./launch-args-DnMak49W.mjs";
5
- import { o as withCodexAppServerJsonClient } from "./request-BioXJLYa.mjs";
6
- import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-CeAhl_h4.mjs";
3
+ import { n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
4
+ import { o as withCodexAppServerJsonClient } from "./request-D2L0zMrq.mjs";
5
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C8Rw1m1m.mjs";
7
6
  import { a as resolveCodexAppServerAuthProfileStore, r as resolveCodexAppServerAuthProfileId } from "./auth-profile-WqZtZfXN.mjs";
8
- import { r as captureSharedCodexAppServerCatalogLifetime } from "./shared-client-BpTtuLQ5.mjs";
9
- import { t as listAllCodexAppServerModels } from "./models-BDFgm_G-.mjs";
10
- import { probeCodexNativeAuth } from "./native-auth-BLZGqFjw.mjs";
7
+ import { r as captureSharedCodexAppServerCatalogLifetime } from "./shared-client-DA4VR4Eb.mjs";
8
+ import { t as listAllCodexAppServerModels } from "./models-KnqBv0hE.mjs";
9
+ import { probeCodexNativeAuth } from "./native-auth-rWbGbMn3.mjs";
11
10
  //#region extensions/codex/src/app-server/model-catalog.ts
12
11
  const DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS = 2500;
13
12
  const INPUT_TYPES = /* @__PURE__ */ new Set([
@@ -107,11 +106,11 @@ function createCodexAppServerModelCatalog(runtime) {
107
106
  method: "account/read",
108
107
  requestParams: { refreshToken: false }
109
108
  });
110
- const observedType = isJsonObject(account.account) ? account.account.type : void 0;
109
+ const observedType = account.account?.type;
111
110
  return {
112
111
  models,
113
112
  isCurrent,
114
- accountType: account.requiresOpenaiAuth === true ? observedType === "apiKey" || observedType === "chatgpt" ? observedType : void 0 : void 0
113
+ accountType: account.requiresOpenaiAuth ? observedType === "apiKey" || observedType === "chatgpt" ? observedType : void 0 : void 0
115
114
  };
116
115
  });
117
116
  if (disposed || observations.get(key) !== observation || !result.isCurrent()) return [];
@@ -1,4 +1,4 @@
1
- import { h as assertCodexModelListResponse } from "./client-vXs2929Q.mjs";
1
+ import { g as assertCodexModelListResponse } from "./client-Cs08OXVQ.mjs";
2
2
  import { normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  //#region extensions/codex/src/app-server/models.ts
4
4
  /**
@@ -37,8 +37,8 @@ async function withCodexAppServerModelRequest(options, run) {
37
37
  if (options.request) return await run(options.request);
38
38
  const timeoutMs = options.timeoutMs ?? 2500;
39
39
  const useSharedClient = options.sharedClient !== false;
40
- const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-BpTtuLQ5.mjs").then((n) => n.y);
41
- const { requestCodexAppServerClientJson } = await import("./request-BioXJLYa.mjs").then((n) => n.a);
40
+ const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-DA4VR4Eb.mjs").then((n) => n.y);
41
+ const { requestCodexAppServerClientJson } = await import("./request-D2L0zMrq.mjs").then((n) => n.a);
42
42
  const client = await (useSharedClient ? getLeasedSharedCodexAppServerClient : createIsolatedCodexAppServerClient)({
43
43
  startOptions: options.startOptions,
44
44
  timeoutMs,
@@ -1,8 +1,8 @@
1
1
  import { d as readCodexPluginConfig } from "./config-parsing-CcB9iPoq.mjs";
2
- import { n as isCodexAppServerProxyLaunch, t as buildCodexLoginStatusArgs } from "./launch-args-DnMak49W.mjs";
3
- import { r as resolveManagedCodexAppServerStartOptions } from "./managed-binary-DP6Rib3P.mjs";
4
- import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-Cmx94Oiy.mjs";
5
- import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-CeAhl_h4.mjs";
2
+ import { n as isCodexAppServerProxyLaunch, t as buildCodexLoginStatusArgs } from "./launch-args-DbFCehO7.mjs";
3
+ import { r as resolveManagedCodexAppServerStartOptions } from "./managed-binary-BnshlFag.mjs";
4
+ import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-h2VHOskC.mjs";
5
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C8Rw1m1m.mjs";
6
6
  import { runUtf8CommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
7
7
  import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
8
8
  //#region extensions/codex/src/app-server/native-auth.ts
@@ -1,11 +1,12 @@
1
- import { S as readCodexNativeSubagentHistoryOwner, p as sessionBindingIdentity, y as codexNativeSubagentHistoryConnectionFingerprint } from "./session-binding-record-TH3xA0zj.mjs";
2
- import { t as readCodexThreadHistoryPage } from "./thread-history-page-BTx-4xsg.mjs";
1
+ import { C as readCodexNativeSubagentHistoryOwner, b as codexNativeSubagentHistoryConnectionFingerprint, m as sessionBindingIdentity } from "./session-binding-record-BGoz8wOK.mjs";
2
+ import { t as readCodexThreadHistoryPage } from "./thread-history-page-DoVpnHim.mjs";
3
+ import { l as itemStatus } from "./event-projector-items-C6L_5ZiT.mjs";
3
4
  import { r as readMirrorIdentity } from "./upstream-prompt-provenance-LphB8slG.mjs";
4
- import { r as projectCodexThreadHistoryItem } from "./transcript-history-projection-DHNBDhCU.mjs";
5
- import { n as buildCodexAppServerRuntimeFingerprint, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-BOxKP7db.mjs";
6
- import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-Bm38niE8.mjs";
7
- import { c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-BpTtuLQ5.mjs";
8
- import { a as readCodexNativeSubagentRunId, f as itemToolArgs, h as itemTranscriptResultText } from "./native-subagent-task-ids-DsuOonKv.mjs";
5
+ import { r as projectCodexThreadHistoryItem } from "./transcript-history-projection-ZZpkFkJ_.mjs";
6
+ import { n as buildCodexAppServerRuntimeFingerprint, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-B2CsSdnV.mjs";
7
+ import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-ThoatDcb.mjs";
8
+ import { c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-DA4VR4Eb.mjs";
9
+ import { a as readCodexNativeSubagentRunId, f as itemToolArgs, g as projectCodexToolActivity, h as itemTranscriptResultText } from "./native-subagent-task-ids-wb8CKZGN.mjs";
9
10
  import { resolveAgentDir } from "openclaw/plugin-sdk/agent-runtime";
10
11
  import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
11
12
  //#region extensions/codex/src/app-server/native-subagent-history.ts
@@ -115,16 +116,28 @@ async function readCodexNativeSubagentHistory(params, options) {
115
116
  cursor: params.cursor,
116
117
  limit: Math.max(1, Math.floor(Math.min(params.limit, 200) / 2))
117
118
  }, {
118
- project: (entries) => entries.map((entry) => projectCodexThreadHistoryItem(thread, entry, taskHistoryToolItems).map((message) => {
119
- const messageIdentity = readMirrorIdentity(message);
120
- if (!messageIdentity) throw new Error("Subagent history message is missing its native identity.");
121
- return Object.assign(message, { messageId: JSON.stringify([threadId, messageIdentity]) });
122
- })),
119
+ project: (entries) => entries.map((entry) => {
120
+ const item = projectCodexToolActivity(entry.item, itemStatus(entry.item) === "running" ? "start" : "result");
121
+ const messages = projectCodexThreadHistoryItem(thread, entry, taskHistoryToolItems).map((message) => {
122
+ const messageIdentity = readMirrorIdentity(message);
123
+ if (!messageIdentity) throw new Error("Subagent history message is missing its native identity.");
124
+ return Object.assign(message, { messageId: JSON.stringify([threadId, messageIdentity]) });
125
+ });
126
+ return {
127
+ messages,
128
+ activity: item ? messages.map(({ messageId }) => ({
129
+ messageId,
130
+ items: item.hideFromChannelProgress ? [] : [item]
131
+ })) : []
132
+ };
133
+ }),
123
134
  fits: (result) => Buffer.byteLength(JSON.stringify(result), "utf8") <= 524288
124
135
  });
125
136
  assertCurrent();
137
+ const rows = page.items.toReversed();
126
138
  return {
127
- messages: page.items.toReversed().flat(),
139
+ messages: rows.flatMap((row) => row.messages),
140
+ activity: rows.flatMap((row) => row.activity),
128
141
  ...page.nextCursor ? { nextCursor: page.nextCursor } : {}
129
142
  };
130
143
  } finally {