codex-multi-auth 2.17.2 → 2.18.0

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 (405) hide show
  1. package/.codex-plugin/plugin.json +1 -1
  2. package/README.md +86 -425
  3. package/config/README.md +1 -1
  4. package/config/codex-legacy.json +12 -212
  5. package/config/codex-modern.json +4 -80
  6. package/config/minimal-codex.json +1 -1
  7. package/dist/index.d.ts +0 -1
  8. package/dist/lib/account-policy.d.ts +18 -2
  9. package/dist/lib/account-policy.js +97 -40
  10. package/dist/lib/accounts/rate-limits.d.ts +0 -1
  11. package/dist/lib/accounts.d.ts +0 -1
  12. package/dist/lib/accounts.js +4 -5
  13. package/dist/lib/api-route-store.d.ts +0 -1
  14. package/dist/lib/audit.d.ts +0 -1
  15. package/dist/lib/audit.js +43 -12
  16. package/dist/lib/auth/account-access.d.ts +0 -1
  17. package/dist/lib/auth/account-access.js +5 -1
  18. package/dist/lib/auth/auth.d.ts +4 -3
  19. package/dist/lib/auth/auth.js +220 -28
  20. package/dist/lib/auth/browser.d.ts +0 -1
  21. package/dist/lib/auth/callback-guidance.d.ts +0 -1
  22. package/dist/lib/auth/device-auth.d.ts +0 -1
  23. package/dist/lib/auth/index.d.ts +0 -1
  24. package/dist/lib/auth/org-override.d.ts +0 -1
  25. package/dist/lib/auth/server.d.ts +1 -2
  26. package/dist/lib/auth/server.js +100 -53
  27. package/dist/lib/auth/token-utils.d.ts +0 -1
  28. package/dist/lib/auth-rate-limit.d.ts +0 -1
  29. package/dist/lib/budget-guard.d.ts +16 -2
  30. package/dist/lib/budget-guard.js +123 -43
  31. package/dist/lib/capability-policy.d.ts +0 -1
  32. package/dist/lib/circuit-breaker.d.ts +20 -1
  33. package/dist/lib/circuit-breaker.js +24 -5
  34. package/dist/lib/cli.d.ts +0 -1
  35. package/dist/lib/codex-cli/index.d.ts +0 -1
  36. package/dist/lib/codex-cli/observability.d.ts +0 -1
  37. package/dist/lib/codex-cli/state.d.ts +0 -1
  38. package/dist/lib/codex-cli/sync.d.ts +0 -1
  39. package/dist/lib/codex-cli/writer.d.ts +0 -1
  40. package/dist/lib/codex-manager/account-credentials.d.ts +0 -1
  41. package/dist/lib/codex-manager/account-manager-commands.d.ts +0 -1
  42. package/dist/lib/codex-manager/account-pool-write.d.ts +0 -1
  43. package/dist/lib/codex-manager/active-account-sync.d.ts +6 -0
  44. package/dist/lib/codex-manager/active-account-sync.js +336 -0
  45. package/dist/lib/codex-manager/api-login-menu.d.ts +0 -1
  46. package/dist/lib/codex-manager/backend-category-entry.d.ts +0 -1
  47. package/dist/lib/codex-manager/backend-category-helpers.d.ts +0 -1
  48. package/dist/lib/codex-manager/backend-category-prompt.d.ts +0 -1
  49. package/dist/lib/codex-manager/backend-settings-controller.d.ts +0 -1
  50. package/dist/lib/codex-manager/backend-settings-entry.d.ts +0 -1
  51. package/dist/lib/codex-manager/backend-settings-helpers.d.ts +0 -1
  52. package/dist/lib/codex-manager/backend-settings-prompt.d.ts +0 -1
  53. package/dist/lib/codex-manager/backend-settings-schema.d.ts +0 -1
  54. package/dist/lib/codex-manager/behavior-settings-panel.d.ts +0 -1
  55. package/dist/lib/codex-manager/commands/account.d.ts +8 -3
  56. package/dist/lib/codex-manager/commands/account.js +46 -34
  57. package/dist/lib/codex-manager/commands/best.d.ts +0 -1
  58. package/dist/lib/codex-manager/commands/bridge.d.ts +0 -1
  59. package/dist/lib/codex-manager/commands/budget.d.ts +8 -3
  60. package/dist/lib/codex-manager/commands/budget.js +6 -4
  61. package/dist/lib/codex-manager/commands/check.d.ts +0 -1
  62. package/dist/lib/codex-manager/commands/config-explain.d.ts +0 -1
  63. package/dist/lib/codex-manager/commands/debug-bundle.d.ts +0 -1
  64. package/dist/lib/codex-manager/commands/forecast.d.ts +0 -1
  65. package/dist/lib/codex-manager/commands/history.d.ts +0 -1
  66. package/dist/lib/codex-manager/commands/init-config.d.ts +0 -1
  67. package/dist/lib/codex-manager/commands/integrations.d.ts +0 -1
  68. package/dist/lib/codex-manager/commands/limits.d.ts +0 -1
  69. package/dist/lib/codex-manager/commands/models.d.ts +0 -1
  70. package/dist/lib/codex-manager/commands/monitor.d.ts +0 -1
  71. package/dist/lib/codex-manager/commands/report.d.ts +0 -1
  72. package/dist/lib/codex-manager/commands/resets.d.ts +0 -1
  73. package/dist/lib/codex-manager/commands/resets.js +9 -1
  74. package/dist/lib/codex-manager/commands/rotation.d.ts +0 -1
  75. package/dist/lib/codex-manager/commands/status.d.ts +0 -1
  76. package/dist/lib/codex-manager/commands/switch.d.ts +0 -1
  77. package/dist/lib/codex-manager/commands/uninstall.d.ts +0 -1
  78. package/dist/lib/codex-manager/commands/unpin.d.ts +0 -1
  79. package/dist/lib/codex-manager/commands/usage.d.ts +0 -1
  80. package/dist/lib/codex-manager/commands/verify.d.ts +0 -1
  81. package/dist/lib/codex-manager/commands/why-selected.d.ts +0 -1
  82. package/dist/lib/codex-manager/commands/workspace.d.ts +0 -1
  83. package/dist/lib/codex-manager/dashboard-display-panel.d.ts +0 -1
  84. package/dist/lib/codex-manager/dashboard-formatters.d.ts +0 -1
  85. package/dist/lib/codex-manager/dashboard-settings-controller.d.ts +0 -1
  86. package/dist/lib/codex-manager/dashboard-settings-data.d.ts +0 -1
  87. package/dist/lib/codex-manager/dashboard-settings-entry.d.ts +0 -1
  88. package/dist/lib/codex-manager/experimental-settings-entry.d.ts +0 -1
  89. package/dist/lib/codex-manager/experimental-settings-prompt.d.ts +0 -1
  90. package/dist/lib/codex-manager/experimental-settings-schema.d.ts +0 -1
  91. package/dist/lib/codex-manager/experimental-sync-target-entry.d.ts +0 -1
  92. package/dist/lib/codex-manager/experimental-sync-target.d.ts +0 -1
  93. package/dist/lib/codex-manager/forecast-report-shared.d.ts +0 -1
  94. package/dist/lib/codex-manager/formatters/account-formatters.d.ts +0 -1
  95. package/dist/lib/codex-manager/formatters/index.d.ts +0 -1
  96. package/dist/lib/codex-manager/formatters/model-formatters.d.ts +0 -1
  97. package/dist/lib/codex-manager/formatters/quota-formatters.d.ts +0 -1
  98. package/dist/lib/codex-manager/formatters/text-style.d.ts +0 -1
  99. package/dist/lib/codex-manager/health-check.d.ts +0 -1
  100. package/dist/lib/codex-manager/help.d.ts +0 -1
  101. package/dist/lib/codex-manager/login-action-panel.d.ts +0 -1
  102. package/dist/lib/codex-manager/login-flow.d.ts +0 -1
  103. package/dist/lib/codex-manager/login-menu-actions.d.ts +0 -1
  104. package/dist/lib/codex-manager/login-menu-data.d.ts +0 -1
  105. package/dist/lib/codex-manager/login-oauth.d.ts +0 -1
  106. package/dist/lib/codex-manager/login-workspace-choice.d.ts +0 -1
  107. package/dist/lib/codex-manager/manual-callback.d.ts +0 -1
  108. package/dist/lib/codex-manager/persist-selected-account.d.ts +0 -1
  109. package/dist/lib/codex-manager/quota-cache-helpers.d.ts +0 -1
  110. package/dist/lib/codex-manager/rate-limit-markers.d.ts +0 -1
  111. package/dist/lib/codex-manager/repair-commands.d.ts +0 -1
  112. package/dist/lib/codex-manager/settings-hub/backend.d.ts +0 -1
  113. package/dist/lib/codex-manager/settings-hub/dashboard.d.ts +0 -1
  114. package/dist/lib/codex-manager/settings-hub/experimental.d.ts +0 -1
  115. package/dist/lib/codex-manager/settings-hub/index.d.ts +0 -1
  116. package/dist/lib/codex-manager/settings-hub/shared.d.ts +0 -1
  117. package/dist/lib/codex-manager/settings-hub-entry.d.ts +0 -1
  118. package/dist/lib/codex-manager/settings-hub-menu.d.ts +0 -1
  119. package/dist/lib/codex-manager/settings-hub-prompt.d.ts +0 -1
  120. package/dist/lib/codex-manager/settings-hub.d.ts +0 -1
  121. package/dist/lib/codex-manager/settings-panels.d.ts +0 -1
  122. package/dist/lib/codex-manager/settings-persist-utils.d.ts +0 -1
  123. package/dist/lib/codex-manager/settings-preview.d.ts +0 -1
  124. package/dist/lib/codex-manager/settings-write-queue.d.ts +0 -1
  125. package/dist/lib/codex-manager/statusline-settings-panel.d.ts +0 -1
  126. package/dist/lib/codex-manager/theme-settings-panel.d.ts +0 -1
  127. package/dist/lib/codex-manager/unified-settings-controller.d.ts +0 -1
  128. package/dist/lib/codex-manager/unified-settings-entry.d.ts +0 -1
  129. package/dist/lib/codex-manager.d.ts +1 -2
  130. package/dist/lib/codex-manager.js +5 -95
  131. package/dist/lib/concurrency.d.ts +0 -1
  132. package/dist/lib/config-schema.d.ts +0 -1
  133. package/dist/lib/config.d.ts +0 -1
  134. package/dist/lib/config.js +46 -241
  135. package/dist/lib/constants.d.ts +0 -1
  136. package/dist/lib/context-budget/model-context-windows.d.ts +1 -2
  137. package/dist/lib/context-budget/model-context-windows.js +10 -13
  138. package/dist/lib/context-budget-guard.d.ts +0 -1
  139. package/dist/lib/context-budget-response.d.ts +0 -1
  140. package/dist/lib/context-overflow.d.ts +0 -1
  141. package/dist/lib/dashboard-settings.d.ts +0 -1
  142. package/dist/lib/entitlement-cache.d.ts +0 -1
  143. package/dist/lib/env-parsing.d.ts +13 -1
  144. package/dist/lib/env-parsing.js +21 -0
  145. package/dist/lib/errors.d.ts +0 -1
  146. package/dist/lib/forecast.d.ts +0 -1
  147. package/dist/lib/fs-retry.d.ts +0 -1
  148. package/dist/lib/health.d.ts +0 -1
  149. package/dist/lib/index.d.ts +0 -1
  150. package/dist/lib/integration-generators.d.ts +0 -1
  151. package/dist/lib/live-account-sync.d.ts +0 -1
  152. package/dist/lib/local-bridge.d.ts +0 -1
  153. package/dist/lib/local-bridge.js +4 -1
  154. package/dist/lib/local-client-tokens.d.ts +0 -1
  155. package/dist/lib/local-client-tokens.js +125 -30
  156. package/dist/lib/logger.d.ts +0 -1
  157. package/dist/lib/logger.js +11 -1
  158. package/dist/lib/model-capability-matrix.d.ts +0 -1
  159. package/dist/lib/model-route-policy.d.ts +1 -2
  160. package/dist/lib/named-backup-export.d.ts +0 -1
  161. package/dist/lib/oc-chatgpt-import-adapter.d.ts +0 -1
  162. package/dist/lib/oc-chatgpt-orchestrator.d.ts +0 -1
  163. package/dist/lib/oc-chatgpt-target-detection.d.ts +3 -3
  164. package/dist/lib/oc-chatgpt-target-detection.js +40 -13
  165. package/dist/lib/parallel-probe.d.ts +0 -1
  166. package/dist/lib/policy/runtime-policy-cache.d.ts +80 -0
  167. package/dist/lib/policy/runtime-policy-cache.js +310 -0
  168. package/dist/lib/policy/runtime-policy.d.ts +1 -2
  169. package/dist/lib/policy/runtime-policy.js +46 -19
  170. package/dist/lib/preemptive-quota-scheduler.d.ts +0 -1
  171. package/dist/lib/proactive-refresh.d.ts +0 -1
  172. package/dist/lib/prompts/codex-host-bridge.d.ts +0 -1
  173. package/dist/lib/prompts/codex.d.ts +0 -1
  174. package/dist/lib/prompts/fetch-utils.d.ts +0 -1
  175. package/dist/lib/prompts/host-codex-prompt.d.ts +0 -1
  176. package/dist/lib/quota-cache.d.ts +0 -1
  177. package/dist/lib/quota-cache.js +60 -36
  178. package/dist/lib/quota-probe.d.ts +0 -1
  179. package/dist/lib/quota-probe.js +5 -2
  180. package/dist/lib/quota-readiness.d.ts +0 -1
  181. package/dist/lib/recovery/constants.d.ts +0 -1
  182. package/dist/lib/recovery/storage.d.ts +0 -1
  183. package/dist/lib/recovery/types.d.ts +0 -1
  184. package/dist/lib/recovery.d.ts +0 -1
  185. package/dist/lib/redaction.d.ts +0 -1
  186. package/dist/lib/refresh-guardian.d.ts +0 -1
  187. package/dist/lib/refresh-lease.d.ts +0 -1
  188. package/dist/lib/refresh-queue.d.ts +0 -1
  189. package/dist/lib/request/client-cancellation.d.ts +0 -1
  190. package/dist/lib/request/error-classification.d.ts +0 -1
  191. package/dist/lib/request/error-classification.js +41 -52
  192. package/dist/lib/request/failover-config.d.ts +0 -1
  193. package/dist/lib/request/failure-policy.d.ts +0 -1
  194. package/dist/lib/request/fetch-helpers.d.ts +0 -1
  195. package/dist/lib/request/fetch-helpers.js +1 -1
  196. package/dist/lib/request/headers.d.ts +0 -1
  197. package/dist/lib/request/helpers/input-utils.d.ts +0 -1
  198. package/dist/lib/request/helpers/input-utils.js +88 -34
  199. package/dist/lib/request/helpers/model-map.d.ts +2 -3
  200. package/dist/lib/request/helpers/model-map.js +120 -78
  201. package/dist/lib/request/helpers/tool-utils.d.ts +0 -1
  202. package/dist/lib/request/helpers/tool-utils.js +421 -4
  203. package/dist/lib/request/index.d.ts +0 -1
  204. package/dist/lib/request/rate-limit-backoff.d.ts +0 -1
  205. package/dist/lib/request/rate-limit-decision.d.ts +0 -1
  206. package/dist/lib/request/request-attempt-budget.d.ts +0 -1
  207. package/dist/lib/request/request-init.d.ts +0 -1
  208. package/dist/lib/request/request-resilience.d.ts +0 -1
  209. package/dist/lib/request/request-transformer.d.ts +1 -2
  210. package/dist/lib/request/request-transformer.js +51 -26
  211. package/dist/lib/request/response-compaction.d.ts +0 -1
  212. package/dist/lib/request/response-handler.d.ts +0 -1
  213. package/dist/lib/request/response-metadata.d.ts +0 -1
  214. package/dist/lib/request/response-outcome.d.ts +0 -1
  215. package/dist/lib/request/stream-failover-runtime.d.ts +0 -1
  216. package/dist/lib/request/stream-failover.d.ts +0 -1
  217. package/dist/lib/request/stream-failover.js +28 -4
  218. package/dist/lib/request/token-refresh.d.ts +0 -1
  219. package/dist/lib/request/url-rewriting.d.ts +0 -1
  220. package/dist/lib/request/wait-utils.d.ts +0 -1
  221. package/dist/lib/rotation.d.ts +0 -1
  222. package/dist/lib/routing-mutex.d.ts +0 -1
  223. package/dist/lib/routing-profiles.d.ts +16 -2
  224. package/dist/lib/routing-profiles.js +119 -44
  225. package/dist/lib/runtime/account-check-helpers.d.ts +0 -1
  226. package/dist/lib/runtime/account-check-types.d.ts +0 -1
  227. package/dist/lib/runtime/account-check.d.ts +0 -1
  228. package/dist/lib/runtime/account-manager-cache-entry.d.ts +0 -1
  229. package/dist/lib/runtime/account-manager-cache.d.ts +0 -1
  230. package/dist/lib/runtime/account-model-catalog.d.ts +1 -2
  231. package/dist/lib/runtime/account-pool.d.ts +0 -1
  232. package/dist/lib/runtime/account-reset-credits.d.ts +0 -1
  233. package/dist/lib/runtime/account-reset-credits.js +8 -2
  234. package/dist/lib/runtime/account-scope.d.ts +0 -1
  235. package/dist/lib/runtime/account-select-event.d.ts +0 -1
  236. package/dist/lib/runtime/account-selection.d.ts +0 -1
  237. package/dist/lib/runtime/account-state.d.ts +0 -1
  238. package/dist/lib/runtime/account-status.d.ts +0 -1
  239. package/dist/lib/runtime/account-storage-scope-entry.d.ts +0 -1
  240. package/dist/lib/runtime/api-model-capabilities.d.ts +0 -1
  241. package/dist/lib/runtime/api-model-runtime.d.ts +0 -1
  242. package/dist/lib/runtime/app-bind.d.ts +0 -1
  243. package/dist/lib/runtime/app-helper-selection.d.ts +0 -1
  244. package/dist/lib/runtime/auth-facade.d.ts +0 -1
  245. package/dist/lib/runtime/automatic-account-checks.d.ts +0 -1
  246. package/dist/lib/runtime/automatic-subscription-checks.d.ts +0 -1
  247. package/dist/lib/runtime/browser-oauth-flow.d.ts +0 -1
  248. package/dist/lib/runtime/capability-boost.d.ts +0 -1
  249. package/dist/lib/runtime/catalog-capabilities.d.ts +0 -1
  250. package/dist/lib/runtime/config-toml.d.ts +0 -1
  251. package/dist/lib/runtime/context-budget-settings.d.ts +0 -1
  252. package/dist/lib/runtime/event-handler.d.ts +0 -1
  253. package/dist/lib/runtime/first-run.d.ts +0 -1
  254. package/dist/lib/runtime/flagged-verify-types.d.ts +0 -1
  255. package/dist/lib/runtime/hydrate-emails.d.ts +0 -1
  256. package/dist/lib/runtime/inference-activity.d.ts +0 -1
  257. package/dist/lib/runtime/live-sync-entry.d.ts +0 -1
  258. package/dist/lib/runtime/live-sync.d.ts +0 -1
  259. package/dist/lib/runtime/loader-setup.d.ts +0 -1
  260. package/dist/lib/runtime/login-menu-accounts.d.ts +0 -1
  261. package/dist/lib/runtime/manual-oauth-flow.d.ts +0 -1
  262. package/dist/lib/runtime/model-discovery-status.d.ts +0 -1
  263. package/dist/lib/runtime/native-account-storage.d.ts +0 -1
  264. package/dist/lib/runtime/native-account-sync.d.ts +0 -1
  265. package/dist/lib/runtime/native-binding-lock.d.ts +0 -1
  266. package/dist/lib/runtime/native-client-auth.d.ts +0 -1
  267. package/dist/lib/runtime/native-provider-config.d.ts +0 -1
  268. package/dist/lib/runtime/native-rate-limits.d.ts +2 -1
  269. package/dist/lib/runtime/native-rate-limits.js +23 -6
  270. package/dist/lib/runtime/preemptive-quota.d.ts +0 -1
  271. package/dist/lib/runtime/quota-headers.d.ts +0 -1
  272. package/dist/lib/runtime/quota-probe.d.ts +0 -1
  273. package/dist/lib/runtime/quota-settings.d.ts +0 -1
  274. package/dist/lib/runtime/refresh-guardian-entry.d.ts +0 -1
  275. package/dist/lib/runtime/refresh-guardian.d.ts +0 -1
  276. package/dist/lib/runtime/request-init.d.ts +0 -1
  277. package/dist/lib/runtime/reset-credit-routing.d.ts +0 -1
  278. package/dist/lib/runtime/reset-credits.d.ts +0 -1
  279. package/dist/lib/runtime/response-output-history.d.ts +0 -1
  280. package/dist/lib/runtime/responses-websocket.d.ts +0 -1
  281. package/dist/lib/runtime/resume-picker.d.ts +0 -1
  282. package/dist/lib/runtime/rotation-account-selection.d.ts +0 -1
  283. package/dist/lib/runtime/rotation-proxy-state.d.ts +0 -1
  284. package/dist/lib/runtime/rotation-server-types.d.ts +0 -1
  285. package/dist/lib/runtime/rotation-storage-meta.d.ts +0 -1
  286. package/dist/lib/runtime/rotation-token-refresh.d.ts +0 -1
  287. package/dist/lib/runtime/runtime-capability-failures.d.ts +0 -1
  288. package/dist/lib/runtime/runtime-current-account.d.ts +0 -1
  289. package/dist/lib/runtime/runtime-observability.d.ts +0 -1
  290. package/dist/lib/runtime/runtime-services.d.ts +0 -1
  291. package/dist/lib/runtime/session-affinity-entry.d.ts +0 -1
  292. package/dist/lib/runtime/session-recovery.d.ts +0 -1
  293. package/dist/lib/runtime/status-marker.d.ts +0 -1
  294. package/dist/lib/runtime/storage-scope.d.ts +0 -1
  295. package/dist/lib/runtime/subscription-first-use.d.ts +0 -1
  296. package/dist/lib/runtime/subscription-quota-event.d.ts +0 -1
  297. package/dist/lib/runtime/subscription-quota-order.d.ts +0 -1
  298. package/dist/lib/runtime/toast.d.ts +0 -1
  299. package/dist/lib/runtime/ui-runtime-entry.d.ts +0 -1
  300. package/dist/lib/runtime/ui-runtime.d.ts +0 -1
  301. package/dist/lib/runtime/verify-flagged.d.ts +0 -1
  302. package/dist/lib/runtime/workspace-model-scopes.d.ts +0 -1
  303. package/dist/lib/runtime-constants.d.ts +0 -1
  304. package/dist/lib/runtime-paths.d.ts +0 -1
  305. package/dist/lib/runtime-rotation-proxy.d.ts +1 -1
  306. package/dist/lib/runtime-rotation-proxy.js +133 -0
  307. package/dist/lib/schemas.d.ts +35 -13
  308. package/dist/lib/schemas.js +19 -2
  309. package/dist/lib/session-affinity.d.ts +0 -1
  310. package/dist/lib/shutdown.d.ts +0 -1
  311. package/dist/lib/storage/account-clear-entry.d.ts +0 -1
  312. package/dist/lib/storage/account-clear.d.ts +0 -1
  313. package/dist/lib/storage/account-match-utils.d.ts +0 -1
  314. package/dist/lib/storage/account-persistence.d.ts +0 -1
  315. package/dist/lib/storage/account-port.d.ts +0 -1
  316. package/dist/lib/storage/account-save-entry.d.ts +0 -1
  317. package/dist/lib/storage/account-save.d.ts +9 -2
  318. package/dist/lib/storage/account-save.js +4 -1
  319. package/dist/lib/storage/account-snapshot.d.ts +0 -1
  320. package/dist/lib/storage/backup-metadata-builder.d.ts +0 -1
  321. package/dist/lib/storage/backup-metadata.d.ts +0 -1
  322. package/dist/lib/storage/backup-paths.d.ts +0 -1
  323. package/dist/lib/storage/backup-restore.d.ts +0 -1
  324. package/dist/lib/storage/cache-artifacts.d.ts +0 -1
  325. package/dist/lib/storage/credential-sidecars.d.ts +0 -1
  326. package/dist/lib/storage/error-hints.d.ts +0 -1
  327. package/dist/lib/storage/file-lock.d.ts +0 -1
  328. package/dist/lib/storage/file-lock.js +33 -1
  329. package/dist/lib/storage/file-paths.d.ts +0 -1
  330. package/dist/lib/storage/fixture-guards.d.ts +0 -1
  331. package/dist/lib/storage/flagged-entry.d.ts +0 -1
  332. package/dist/lib/storage/flagged-load-entry.d.ts +0 -1
  333. package/dist/lib/storage/flagged-save-entry.d.ts +0 -1
  334. package/dist/lib/storage/flagged-storage-file.d.ts +0 -1
  335. package/dist/lib/storage/flagged-storage-io.d.ts +0 -1
  336. package/dist/lib/storage/flagged-storage.d.ts +0 -1
  337. package/dist/lib/storage/gitignore.d.ts +0 -1
  338. package/dist/lib/storage/hash.d.ts +0 -1
  339. package/dist/lib/storage/health.d.ts +0 -1
  340. package/dist/lib/storage/identity.d.ts +0 -1
  341. package/dist/lib/storage/import-export.d.ts +0 -1
  342. package/dist/lib/storage/json-store-lock.d.ts +105 -0
  343. package/dist/lib/storage/json-store-lock.js +259 -0
  344. package/dist/lib/storage/metadata-section.d.ts +0 -1
  345. package/dist/lib/storage/migrations.d.ts +0 -1
  346. package/dist/lib/storage/migrations.js +31 -18
  347. package/dist/lib/storage/named-backup-entry.d.ts +0 -1
  348. package/dist/lib/storage/named-backups-entry.d.ts +0 -1
  349. package/dist/lib/storage/named-backups.d.ts +0 -1
  350. package/dist/lib/storage/path-state.d.ts +0 -1
  351. package/dist/lib/storage/paths.d.ts +0 -1
  352. package/dist/lib/storage/pending-auth.d.ts +9 -3
  353. package/dist/lib/storage/pending-auth.js +30 -8
  354. package/dist/lib/storage/project-migration.d.ts +0 -1
  355. package/dist/lib/storage/public-types.d.ts +0 -1
  356. package/dist/lib/storage/record-identity.d.ts +0 -1
  357. package/dist/lib/storage/record-utils.d.ts +0 -1
  358. package/dist/lib/storage/restore-assessment.d.ts +0 -1
  359. package/dist/lib/storage/restore-backup-entry.d.ts +0 -1
  360. package/dist/lib/storage/restore-metadata.d.ts +0 -1
  361. package/dist/lib/storage/save-retry.d.ts +0 -1
  362. package/dist/lib/storage/snapshot-inspectors.d.ts +0 -1
  363. package/dist/lib/storage/snapshot-merge.d.ts +0 -1
  364. package/dist/lib/storage/storage-parser.d.ts +2 -1
  365. package/dist/lib/storage/storage-parser.js +10 -2
  366. package/dist/lib/storage/transactions.d.ts +0 -1
  367. package/dist/lib/storage.d.ts +15 -2
  368. package/dist/lib/storage.js +612 -25
  369. package/dist/lib/synthetic-response.d.ts +0 -1
  370. package/dist/lib/table-formatter.d.ts +0 -1
  371. package/dist/lib/temp-path.d.ts +0 -1
  372. package/dist/lib/tools/hashline-tools.d.ts +0 -1
  373. package/dist/lib/types.d.ts +0 -1
  374. package/dist/lib/ui/ansi.d.ts +0 -1
  375. package/dist/lib/ui/auth-menu-builder.d.ts +0 -1
  376. package/dist/lib/ui/auth-menu.d.ts +0 -1
  377. package/dist/lib/ui/check-progress.d.ts +0 -1
  378. package/dist/lib/ui/confirm.d.ts +0 -1
  379. package/dist/lib/ui/display-width.d.ts +0 -1
  380. package/dist/lib/ui/format.d.ts +0 -1
  381. package/dist/lib/ui/index.d.ts +0 -1
  382. package/dist/lib/ui/runtime.d.ts +0 -1
  383. package/dist/lib/ui/select.d.ts +0 -1
  384. package/dist/lib/ui/theme.d.ts +0 -1
  385. package/dist/lib/ui/ui-copy.d.ts +1 -2
  386. package/dist/lib/ui/ui-copy.js +1 -1
  387. package/dist/lib/unified-settings.d.ts +13 -11
  388. package/dist/lib/unified-settings.js +22 -14
  389. package/dist/lib/update-notice.d.ts +0 -1
  390. package/dist/lib/usage/index.d.ts +0 -1
  391. package/dist/lib/usage/ledger.d.ts +0 -1
  392. package/dist/lib/usage/pricing.d.ts +1 -2
  393. package/dist/lib/usage/pricing.js +41 -16
  394. package/dist/lib/usage/redaction.d.ts +0 -1
  395. package/dist/lib/usage/stream-usage-deferral.d.ts +0 -1
  396. package/dist/lib/usage/types.d.ts +0 -1
  397. package/dist/lib/usage/usage-extraction.d.ts +0 -1
  398. package/dist/lib/utils.d.ts +21 -1
  399. package/dist/lib/utils.js +31 -0
  400. package/dist/lib/wsl.d.ts +0 -1
  401. package/package.json +11 -5
  402. package/scripts/codex-bin-resolver.js +20 -1
  403. package/scripts/codex-multi-auth.js +7 -1
  404. package/scripts/codex.js +385 -89
  405. package/skills/codex-auth-setup/SKILL.md +73 -0
@@ -105,4 +105,3 @@ export interface ToolResultPart {
105
105
  content: string;
106
106
  }
107
107
  export {};
108
- //# sourceMappingURL=types.d.ts.map
@@ -28,4 +28,3 @@ export interface SessionRecoveryContext {
28
28
  directory: string;
29
29
  }
30
30
  export declare function createSessionRecoveryHook(ctx: SessionRecoveryContext, config: PluginConfig): SessionRecoveryHook | null;
31
- //# sourceMappingURL=recovery.d.ts.map
@@ -14,4 +14,3 @@
14
14
  export declare function maskEmail(value: string): string;
15
15
  /** Mask every address embedded in a free-text string. */
16
16
  export declare function redactEmails(value: string): string;
17
- //# sourceMappingURL=redaction.d.ts.map
@@ -31,4 +31,3 @@ export declare class RefreshGuardian {
31
31
  private applyRefreshOutcome;
32
32
  tick(): Promise<void>;
33
33
  }
34
- //# sourceMappingURL=refresh-guardian.d.ts.map
@@ -47,4 +47,3 @@ export declare class RefreshLeaseCoordinator {
47
47
  private pruneExpiredArtifacts;
48
48
  }
49
49
  export {};
50
- //# sourceMappingURL=refresh-lease.d.ts.map
@@ -113,4 +113,3 @@ export declare function resetRefreshQueue(): void;
113
113
  * @returns Token result
114
114
  */
115
115
  export declare function queuedRefresh(refreshToken: string): Promise<TokenResult>;
116
- //# sourceMappingURL=refresh-queue.d.ts.map
@@ -2,4 +2,3 @@
2
2
  export declare class ClientCancellationError extends Error {
3
3
  constructor();
4
4
  }
5
- //# sourceMappingURL=client-cancellation.d.ts.map
@@ -79,4 +79,3 @@ export declare function isWorkspaceDisabledError(status: number, code: unknown,
79
79
  * @returns A 403 Response with a JSON body describing the entitlement error and guidance for resolving it
80
80
  */
81
81
  export declare function createEntitlementErrorResponse(_bodyText: string): Response;
82
- //# sourceMappingURL=error-classification.d.ts.map
@@ -12,66 +12,55 @@ const CHATGPT_CODEX_UNSUPPORTED_MODEL_PATTERN = /model is not supported when usi
12
12
  const NORMALIZED_UNSUPPORTED_MODEL_PATTERN = /the model ['"]([^'"]+)['"] is not currently available for this chatgpt account/i;
13
13
  const MODEL_ACCESS_DENIED_PATTERN = /the model [`'"]([^`'"]+)[`'"] does not exist or you do not have access to it/i;
14
14
  export const DEFAULT_UNSUPPORTED_CODEX_FALLBACK_CHAIN = {
15
- // GPT-6 Astra rolls out org by org, so an account that is not entitled yet
16
- // gets a real unsupported-model response for it. This chain only fires when
17
- // the user has opted into `fallbackOnUnsupportedCodexModel` (default
18
- // `false`), and only on that response, so it never silently swaps the model
19
- // out from under a request the account could have served.
15
+ // GPT-6 models roll out org by org, so an account that is not entitled yet
16
+ // gets a real unsupported-model response for them. This chain only fires
17
+ // when the user has opted into `fallbackOnUnsupportedCodexModel` (default
18
+ // `false`), and only on that response, so it never silently swaps the
19
+ // model out from under a request the account could have served.
20
20
  //
21
21
  // This table is walked ONE HOP AT A TIME, not as a per-request candidate
22
- // list. index.ts reassigns `model` to whatever came back and passes that as
23
- // `requestedModel` on the next unsupported response, so reaching `gpt-5.5`
24
- // from Astra requires `gpt-5.6-sol` to carry its own entry below. A second
25
- // element here is only ever consulted when the first is already in
26
- // `attemptedModels` for that same call.
22
+ // list. index.ts reassigns `model` to whatever came back and passes that
23
+ // as `requestedModel` on the next unsupported response, so reaching the
24
+ // terminal models from a launch model requires every intermediate model
25
+ // to carry its own entry below. A second element here is only ever
26
+ // consulted when the first is already in `attemptedModels` for that same
27
+ // call.
27
28
  //
28
- // Depth is not free: every hop spends one of the shared per-request outbound
29
- // attempts (`tryConsumeOutboundRequestAttempt`). A single-account balanced
30
- // session gets a budget of 5, and the aeon walk needs 4 (it needed all 5
31
- // until `gpt-5.4` was retired as the floor), leaving one attempt for a retry
32
- // or a stream failover. Spend two and the tail hop becomes unreachable,
33
- // ending as an attempt-budget-exhausted 503 rather than `gpt-5.5`. Hops are
29
+ // Depth is not free: every hop spends one of the shared per-request
30
+ // outbound attempts (`tryConsumeOutboundRequestAttempt`). A single-account
31
+ // balanced session gets a budget of 5, and the deepest walks — 6.1 Sol and
32
+ // the retired ids that migrate through Astra — spend all 5, the same shape
33
+ // the aeon walk had before `gpt-5.4` was retired as the floor. Hops are
34
34
  // ordered most-valuable-first so what is lost first matters least. Do not
35
- // add a hop to a GPT-6 row without
36
- // re-checking that budget; `test/gpt6-astra-models.test.ts` asserts it.
37
- "gpt-6-astra": ["gpt-5.6-sol", "gpt-5.5"],
38
- // aeon steps to the flagship first: still GPT-6, still Astra, just without
39
- // the long-horizon behaviour.
40
- "gpt-6-astra-aeon": ["gpt-6-astra", "gpt-5.6-sol"],
41
- // Sol and Luna step to the 5.6 tier they replace, never sideways into Astra:
42
- // an account without the new tier is far likelier to lack Astra too, and
43
- // Astra is the priciest hop available ($10/$50 per 1M against Luna's
44
- // $0.10/$0.50). Every hop on these walks still costs more than Luna itself.
35
+ // add a hop to a GPT-6 row without re-checking that budget;
36
+ // `test/gpt6-astra-models.test.ts` asserts it.
37
+ "gpt-6.1-sol": ["gpt-6-sol"],
38
+ // Astra steps to the workhorse rather than to a smaller tier: an account
39
+ // without the flagship is still likelier than not to hold the standard
40
+ // GPT-6 tier, and `gpt-6-sol` keeps the walk inside the generation.
41
+ "gpt-6-astra": ["gpt-6-sol"],
42
+ // Sol and Luna step to the 5.6 tier they replace, never sideways into a
43
+ // pricier model: an account without the new tier is far likelier to lack
44
+ // Astra too, and Astra is the priciest hop available ($10/$50 per 1M
45
+ // against Luna's $0.10/$0.50). Every hop on these walks still costs more
46
+ // than Luna itself.
45
47
  "gpt-6-sol": ["gpt-5.6-sol"],
46
48
  "gpt-6-luna": ["gpt-5.6-luna"],
47
- // The hop that makes the Astra path reach a model every account has. GPT-5.6
48
- // shipped without a chain entry, so an unsupported 5.6 response ended the
49
- // walk; with Astra above it that would have stranded the fallback one rung
50
- // short of the floor it documents.
51
- "gpt-5.6-sol": ["gpt-5.5"],
52
- // Luna gained its row once `gpt-6-luna` started stepping into it; without
53
- // it the Luna walk would stop one rung short of `gpt-5.5`, the same
54
- // stranding the Sol row fixed. It also applies to a direct `gpt-5.6-luna`
55
- // request, which used to end its walk on an unsupported response and now
56
- // retries on the pricier `gpt-5.5`.
57
- "gpt-5.6-luna": ["gpt-5.5"],
58
- // Terra gained its row once the retired codex minis and `gpt-5-mini` began
59
- // stepping into it; without it those walks stopped at Terra instead of the
60
- // `gpt-5.5` floor every other retired id reaches.
61
- "gpt-5.6-terra": ["gpt-5.5"],
62
- "gpt-5": ["gpt-5.5"],
63
- "gpt-5-pro": ["gpt-5.5-pro"],
64
- "gpt-5.5-2026-04-23": ["gpt-5.5"],
65
- "gpt-5.5-20260423": ["gpt-5.5"],
66
- "gpt-5.5-pro-2026-04-23": ["gpt-5.5-pro"],
67
- "gpt-5.5-pro-20260423": ["gpt-5.5-pro"],
68
- // `gpt-5.5` and `gpt-5.5-pro` are the floor: they used to step to `gpt-5.4`,
69
- // which the Codex backend no longer serves (`retirement_at: 2026-08-31` in
70
- // the upstream catalog), so that hop could only ever fail.
71
- //
49
+ // The hop that makes every general walk reach a model almost every account
50
+ // has: `gpt-6-luna` ships on the most plans of any catalog model, which is
51
+ // why the quota-probe chain also ends on it.
52
+ "gpt-5.6-sol": ["gpt-6-luna"],
53
+ // Luna's own row crosses to Sol rather than stopping: a `gpt-5.6-luna`
54
+ // request whose tier is absent retries on the same-generation workhorse
55
+ // instead of ending on an unsupported response.
56
+ "gpt-5.6-luna": ["gpt-5.6-sol"],
57
+ "gpt-5.6-terra": ["gpt-5.6-sol"],
58
+ "gpt-5": ["gpt-5.6-sol"],
59
+ "gpt-5-pro": ["gpt-6-astra"],
72
60
  // A retired id still reaches the backend verbatim through the pass-through
73
61
  // rotation proxy, and the backend rejects it as unsupported. One hop to the
74
- // replacement OpenAI names for it turns that into a working request.
62
+ // replacement OpenAI names for it turns that into a working request, and
63
+ // from there the same staircase above continues toward Luna.
75
64
  ...Object.fromEntries(Object.entries(RETIRED_MODEL_REPLACEMENTS).map(([retired, replacement]) => [
76
65
  retired,
77
66
  [replacement],
@@ -1,4 +1,3 @@
1
1
  import type { FailoverMode } from "./failure-policy.js";
2
2
  export declare function parseFailoverMode(value: string | undefined): FailoverMode;
3
3
  export declare function parseEnvInt(value: string | undefined): number | undefined;
4
- //# sourceMappingURL=failover-config.d.ts.map
@@ -39,4 +39,3 @@ export declare function evaluateFailurePolicy(input: FailurePolicyInput, overrid
39
39
  networkCooldownMs?: number;
40
40
  serverCooldownMs?: number;
41
41
  }): FailurePolicyDecision;
42
- //# sourceMappingURL=failure-policy.d.ts.map
@@ -79,4 +79,3 @@ export declare function handleSuccessResponse(response: Response, isStreaming: b
79
79
  onUsage?: (usage: UsageTokenCounts) => void;
80
80
  streamStallTimeoutMs?: number;
81
81
  }): Promise<Response>;
82
- //# sourceMappingURL=fetch-helpers.d.ts.map
@@ -252,7 +252,7 @@ function normalizeErrorPayload(errorBody, bodyText, statusText, status, diagnost
252
252
  error: {
253
253
  message: `The model '${unsupportedModel}' is not currently available for this ChatGPT account when using Codex OAuth. ` +
254
254
  "This is an account/workspace entitlement gate, not a temporary rate limit. " +
255
- "Try 'gpt-5.6-sol' or 'gpt-5.5', or enable automatic fallback via " +
255
+ "Try 'gpt-6.1-sol' or 'gpt-5.6-sol', or enable automatic fallback via " +
256
256
  'unsupportedCodexPolicy: "fallback" (or CODEX_AUTH_UNSUPPORTED_MODEL_POLICY=fallback). ' +
257
257
  "(Legacy: CODEX_AUTH_FALLBACK_UNSUPPORTED_MODEL=1 or fallbackOnUnsupportedCodexModel).",
258
258
  type: "entitlement_error",
@@ -30,4 +30,3 @@ export declare function createCodexHeaders(init: RequestInit | undefined, accoun
30
30
  * @internal Exported only for sibling lib/request modules; import via fetch-helpers.ts elsewhere.
31
31
  */
32
32
  export declare function logDeprecationHeaders(response: Response): void;
33
- //# sourceMappingURL=headers.d.ts.map
@@ -4,4 +4,3 @@ export declare function isHostSystemPrompt(item: InputItem, cachedPrompt: string
4
4
  export declare function filterHostSystemPromptsWithCachedPrompt(input: InputItem[] | undefined, cachedPrompt: string | null): InputItem[] | undefined;
5
5
  export declare const normalizeOrphanedToolOutputs: (input: InputItem[]) => InputItem[];
6
6
  export declare const injectMissingToolOutputs: (input: InputItem[]) => InputItem[];
7
- //# sourceMappingURL=input-utils.d.ts.map
@@ -49,47 +49,78 @@ const extractHostContext = (contentText) => {
49
49
  return null;
50
50
  return contentText.slice(earliestIndex).trimStart();
51
51
  };
52
- export function isHostSystemPrompt(item, cachedPrompt) {
53
- const isSystemRole = item.role === "developer" || item.role === "system";
54
- if (!isSystemRole)
55
- return false;
56
- const contentText = getContentText(item);
52
+ /**
53
+ * Normalizes the cached host prompt once per filter pass so the per-item
54
+ * checks do not re-trim/re-slice the same string.
55
+ */
56
+ const prepareCachedPrompt = (cachedPrompt) => {
57
+ if (!cachedPrompt)
58
+ return null;
59
+ const trimmed = cachedPrompt.trim();
60
+ return { trimmed, prefix: trimmed.substring(0, 200) };
61
+ };
62
+ const isHostPromptContent = (contentText, cached) => {
57
63
  if (!contentText)
58
64
  return false;
59
- if (cachedPrompt) {
65
+ if (cached) {
60
66
  const contentTrimmed = contentText.trim();
61
- const cachedTrimmed = cachedPrompt.trim();
62
- if (contentTrimmed === cachedTrimmed) {
67
+ if (contentTrimmed === cached.trimmed) {
63
68
  return true;
64
69
  }
65
- if (contentTrimmed.startsWith(cachedTrimmed)) {
70
+ if (contentTrimmed.startsWith(cached.trimmed)) {
66
71
  return true;
67
72
  }
68
73
  const contentPrefix = contentTrimmed.substring(0, 200);
69
- const cachedPrefix = cachedTrimmed.substring(0, 200);
70
- if (contentPrefix === cachedPrefix) {
74
+ if (contentPrefix === cached.prefix) {
71
75
  return true;
72
76
  }
73
77
  }
74
78
  const normalized = contentText.trimStart().toLowerCase();
75
79
  return HOST_PROMPT_SIGNATURES.some((signature) => normalized.startsWith(signature));
80
+ };
81
+ export function isHostSystemPrompt(item, cachedPrompt) {
82
+ const isSystemRole = item.role === "developer" || item.role === "system";
83
+ if (!isSystemRole)
84
+ return false;
85
+ return isHostPromptContent(getContentText(item), prepareCachedPrompt(cachedPrompt));
76
86
  }
77
87
  export function filterHostSystemPromptsWithCachedPrompt(input, cachedPrompt) {
78
88
  if (!Array.isArray(input))
79
89
  return input;
80
- return input.flatMap((item) => {
81
- if (item.role === "user")
82
- return [item];
83
- if (!isHostSystemPrompt(item, cachedPrompt)) {
84
- return [item];
90
+ const cached = prepareCachedPrompt(cachedPrompt);
91
+ // Copy-on-write: most items pass through untouched, so the result array is
92
+ // only materialized once an item is actually dropped or rewritten.
93
+ let filtered = null;
94
+ for (let i = 0; i < input.length; i++) {
95
+ // flatMap skips sparse holes entirely; an explicit `undefined` element
96
+ // still reaches the callback and throws on `.role` — mirrored below.
97
+ if (!(i in input)) {
98
+ if (filtered === null)
99
+ filtered = input.slice(0, i);
100
+ continue;
101
+ }
102
+ const item = input[i];
103
+ const isSystemRole = item.role === "developer" || item.role === "system";
104
+ if (!isSystemRole) {
105
+ if (filtered !== null)
106
+ filtered.push(item);
107
+ continue;
85
108
  }
86
109
  const contentText = getContentText(item);
110
+ if (!isHostPromptContent(contentText, cached)) {
111
+ if (filtered !== null)
112
+ filtered.push(item);
113
+ continue;
114
+ }
87
115
  const preservedContext = extractHostContext(contentText);
116
+ if (filtered === null) {
117
+ filtered = input.slice(0, i);
118
+ }
88
119
  if (preservedContext) {
89
- return [replaceContentText(item, preservedContext)];
120
+ filtered.push(replaceContentText(item, preservedContext));
90
121
  }
91
- return [];
92
- });
122
+ }
123
+ return filtered ?? input;
93
124
  }
94
125
  const getCallId = (item) => {
95
126
  const rawCallId = item.call_id;
@@ -103,13 +134,16 @@ const convertOrphanedOutputToMessage = (item, callId) => {
103
134
  ? item.name
104
135
  : "tool";
105
136
  const labelCallId = callId ?? "unknown";
137
+ // Read `.output` once: the catch fallback must use the same value —
138
+ // re-reading a throwing getter inside the catch would just re-throw.
139
+ const out = item.output;
106
140
  let text;
107
141
  try {
108
- const out = item.output;
109
- text = typeof out === "string" ? out : JSON.stringify(out);
142
+ text =
143
+ typeof out === "string" ? out : (JSON.stringify(out) ?? "");
110
144
  }
111
145
  catch {
112
- text = String(item.output ?? "");
146
+ text = String(out ?? "");
113
147
  }
114
148
  if (text.length > 16000) {
115
149
  text = text.slice(0, 16000) + "\n...[truncated]";
@@ -146,31 +180,43 @@ const collectCallIds = (input) => {
146
180
  };
147
181
  export const normalizeOrphanedToolOutputs = (input) => {
148
182
  const { functionCallIds, localShellCallIds, customToolCallIds } = collectCallIds(input);
149
- return input.map((item) => {
183
+ // Copy-on-write: items pass through by reference until an output actually
184
+ // needs converting; an unchanged input returns the original array instead
185
+ // of a per-item `map` copy.
186
+ let mapped = null;
187
+ for (let i = 0; i < input.length; i++) {
188
+ const item = input[i];
189
+ let converted = item;
150
190
  if (item.type === "function_call_output") {
151
191
  const callId = getCallId(item);
152
192
  const hasMatch = !!callId &&
153
193
  (functionCallIds.has(callId) || localShellCallIds.has(callId));
154
194
  if (!hasMatch) {
155
- return convertOrphanedOutputToMessage(item, callId);
195
+ converted = convertOrphanedOutputToMessage(item, callId);
156
196
  }
157
197
  }
158
- if (item.type === "custom_tool_call_output") {
198
+ else if (item.type === "custom_tool_call_output") {
159
199
  const callId = getCallId(item);
160
200
  const hasMatch = !!callId && customToolCallIds.has(callId);
161
201
  if (!hasMatch) {
162
- return convertOrphanedOutputToMessage(item, callId);
202
+ converted = convertOrphanedOutputToMessage(item, callId);
163
203
  }
164
204
  }
165
- if (item.type === "local_shell_call_output") {
205
+ else if (item.type === "local_shell_call_output") {
166
206
  const callId = getCallId(item);
167
207
  const hasMatch = !!callId && localShellCallIds.has(callId);
168
208
  if (!hasMatch) {
169
- return convertOrphanedOutputToMessage(item, callId);
209
+ converted = convertOrphanedOutputToMessage(item, callId);
170
210
  }
171
211
  }
172
- return item;
173
- });
212
+ if (converted !== item && mapped === null) {
213
+ mapped = input.slice(0, i);
214
+ }
215
+ if (mapped !== null) {
216
+ mapped.push(converted);
217
+ }
218
+ }
219
+ return mapped ?? input;
174
220
  };
175
221
  const CANCELLED_TOOL_OUTPUT = "Operation cancelled by user";
176
222
  const collectOutputCallIds = (input) => {
@@ -188,9 +234,14 @@ const collectOutputCallIds = (input) => {
188
234
  };
189
235
  export const injectMissingToolOutputs = (input) => {
190
236
  const outputCallIds = collectOutputCallIds(input);
191
- const result = [];
192
- for (const item of input) {
193
- result.push(item);
237
+ // Copy-on-write: items pass through by reference; the result array is only
238
+ // materialized when a synthetic output is actually injected.
239
+ let result = null;
240
+ for (let i = 0; i < input.length; i++) {
241
+ const item = input[i];
242
+ if (result !== null) {
243
+ result.push(item);
244
+ }
194
245
  if (item.type === "function_call" ||
195
246
  item.type === "local_shell_call" ||
196
247
  item.type === "custom_tool_call") {
@@ -201,6 +252,9 @@ export const injectMissingToolOutputs = (input) => {
201
252
  : item.type === "local_shell_call"
202
253
  ? "local_shell_call_output"
203
254
  : "custom_tool_call_output";
255
+ if (result === null) {
256
+ result = input.slice(0, i + 1);
257
+ }
204
258
  result.push({
205
259
  type: outputType,
206
260
  call_id: callId,
@@ -209,5 +263,5 @@ export const injectMissingToolOutputs = (input) => {
209
263
  }
210
264
  }
211
265
  }
212
- return result;
266
+ return result ?? input;
213
267
  };
@@ -40,9 +40,9 @@ export interface ModelProfile {
40
40
  * still read naturally.
41
41
  */
42
42
  export declare const CURRENT_CODEX_MODEL = "gpt-5.6-sol";
43
- export declare const DEFAULT_MODEL = "gpt-5.5";
43
+ export declare const DEFAULT_MODEL = "gpt-6.1-sol";
44
44
  export declare const DEFAULT_PROBE_MODEL = "gpt-5.6-sol";
45
- export declare const QUOTA_PROBE_MODEL_CHAIN: readonly ["gpt-5.6-sol", "gpt-5.5", "gpt-6-luna"];
45
+ export declare const QUOTA_PROBE_MODEL_CHAIN: readonly ["gpt-5.6-sol", "gpt-6.1-sol", "gpt-6-luna"];
46
46
  /**
47
47
  * Effective model profiles keyed by canonical model name.
48
48
  *
@@ -99,4 +99,3 @@ export declare function resolveProbeReasoningEffort(model: string | undefined):
99
99
  * `resolveNormalizedModel()` if you want the fallback behavior.
100
100
  */
101
101
  export declare function isKnownModel(modelId: string): boolean;
102
- //# sourceMappingURL=model-map.d.ts.map