@bitkyc08/opencodex 2.76.0 → 2.78.0-preview.20261005

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 (353) hide show
  1. package/bin/ocx.mjs +11 -10
  2. package/gui/dist/assets/App-CppMz-6w.js +54 -0
  3. package/gui/dist/assets/App-lCIslZ1L.css +1 -0
  4. package/gui/dist/assets/{Tray-DjNwwrWS.js → Tray-CJWQqtVv.js} +1 -1
  5. package/gui/dist/assets/index-DQt9srNi.js +94 -0
  6. package/gui/dist/assets/index-DmQB8D_R.css +1 -0
  7. package/gui/dist/assets/quota-summary-BMsyoZH2.js +1 -0
  8. package/gui/dist/index.html +4 -3
  9. package/package.json +1 -1
  10. package/src/adapters/anthropic/beta-allowlist.ts +19 -2
  11. package/src/adapters/anthropic/client-identity.ts +13 -4
  12. package/src/adapters/anthropic/native-client-preamble.ts +31 -0
  13. package/src/adapters/anthropic/passthrough.ts +103 -25
  14. package/src/adapters/antigravity-refusal.ts +28 -0
  15. package/src/adapters/cursor/protobuf-request.ts +6 -0
  16. package/src/adapters/cursor/request-builder.ts +3 -0
  17. package/src/adapters/cursor/structured-output.ts +13 -0
  18. package/src/adapters/cursor/types.ts +2 -0
  19. package/src/adapters/devin/cloud-direct/chat.ts +7 -2
  20. package/src/adapters/devin/trajectory.ts +49 -0
  21. package/src/adapters/devin.ts +13 -0
  22. package/src/adapters/ollama-native.ts +62 -19
  23. package/src/adapters/openai-responses/passthrough.ts +133 -103
  24. package/src/adapters/openai-responses/request-strips.ts +10 -4
  25. package/src/adapters/zed.ts +26 -4
  26. package/src/bridge/response-json.ts +14 -14
  27. package/src/bridge/sse.ts +15 -5
  28. package/src/chatgpt/app-server-shim/bundle-trust.ts +40 -10
  29. package/src/chatgpt/app-server-shim/gate-rewrite.ts +3 -0
  30. package/src/claude/agents-inject.ts +4 -43
  31. package/src/claude/gateway-cache.ts +16 -13
  32. package/src/claude/inbound-model-options.ts +9 -2
  33. package/src/claude/intercept/cli-catalog.ts +27 -16
  34. package/src/claude/intercept/client-hello.ts +103 -0
  35. package/src/claude/intercept/model-bindings.ts +3 -2
  36. package/src/claude/intercept/picker-bootstrap.ts +37 -16
  37. package/src/claude/intercept/picker-budget.ts +41 -0
  38. package/src/claude/intercept/picker-listener.ts +279 -66
  39. package/src/claude/outbound.ts +2 -0
  40. package/src/claude/subagent-force-status.ts +53 -0
  41. package/src/claude/subagent-model.ts +93 -0
  42. package/src/cli/access-audio-input.ts +84 -0
  43. package/src/cli/access-audio-live.ts +99 -0
  44. package/src/cli/access-audio.ts +123 -0
  45. package/src/cli/access-data-client.ts +127 -0
  46. package/src/cli/access-data-plane.ts +104 -0
  47. package/src/cli/access-data-response.ts +76 -0
  48. package/src/cli/access.ts +65 -2
  49. package/src/cli/account-api.ts +33 -6
  50. package/src/cli/account-auth.ts +111 -42
  51. package/src/cli/account-key-quota.ts +118 -0
  52. package/src/cli/account-main.ts +11 -4
  53. package/src/cli/account-next-actions.ts +63 -0
  54. package/src/cli/account-policy-dto.ts +68 -0
  55. package/src/cli/account-policy.ts +167 -0
  56. package/src/cli/account-target.ts +8 -0
  57. package/src/cli/account.ts +37 -9
  58. package/src/cli/agent-runtime-settings.ts +130 -0
  59. package/src/cli/agent-settings.ts +101 -0
  60. package/src/cli/agent.ts +29 -2
  61. package/src/cli/alias.ts +7 -2
  62. package/src/cli/aside-profiles.ts +2 -2
  63. package/src/cli/capabilities-access-remote.ts +147 -0
  64. package/src/cli/capabilities-accounts.ts +195 -0
  65. package/src/cli/capabilities-agents-routing.ts +414 -0
  66. package/src/cli/capabilities-base.ts +783 -0
  67. package/src/cli/capabilities-command.ts +1 -0
  68. package/src/cli/capabilities-integrations.ts +264 -0
  69. package/src/cli/capabilities-lab.ts +214 -0
  70. package/src/cli/capabilities-observe-system.ts +662 -0
  71. package/src/cli/capabilities-provider-models.ts +302 -0
  72. package/src/cli/capabilities.ts +30 -1190
  73. package/src/cli/capability-types.ts +54 -0
  74. package/src/cli/catalog-command-result.ts +57 -0
  75. package/src/cli/chatgpt-command.ts +35 -9
  76. package/src/cli/claude-agent-startup-sync.ts +17 -0
  77. package/src/cli/claude-desktop-profile.ts +100 -0
  78. package/src/cli/claude-desktop.ts +39 -6
  79. package/src/cli/claude.ts +22 -6
  80. package/src/cli/codex-shim-autorestore.ts +2 -1
  81. package/src/cli/codex-shim-readiness.ts +109 -0
  82. package/src/cli/combo-input.ts +88 -0
  83. package/src/cli/combo-result.ts +52 -0
  84. package/src/cli/combo-stats.ts +123 -0
  85. package/src/cli/combo.ts +37 -14
  86. package/src/cli/companion-timeline.ts +142 -0
  87. package/src/cli/companion-usage.ts +146 -0
  88. package/src/cli/companion.ts +12 -3
  89. package/src/cli/config-command.ts +24 -8
  90. package/src/cli/connect.ts +19 -0
  91. package/src/cli/dispatch.ts +55 -82
  92. package/src/cli/doctor.ts +22 -4
  93. package/src/cli/export-command.ts +20 -9
  94. package/src/cli/gui.ts +8 -3
  95. package/src/cli/help-catalog.ts +101 -0
  96. package/src/cli/help-models-context.ts +17 -0
  97. package/src/cli/help-navigation.ts +50 -0
  98. package/src/cli/help-recovery.ts +66 -0
  99. package/src/cli/help.ts +69 -11
  100. package/src/cli/index.ts +38 -27
  101. package/src/cli/injection-follow.ts +35 -0
  102. package/src/cli/inspect.ts +5 -0
  103. package/src/cli/integration-aside-sync.ts +69 -0
  104. package/src/cli/integration-cursor.ts +106 -0
  105. package/src/cli/integration-input.ts +60 -0
  106. package/src/cli/integration-journal.ts +49 -0
  107. package/src/cli/integration-plan-dto.ts +156 -0
  108. package/src/cli/integration-preview.ts +215 -0
  109. package/src/cli/integrations.ts +24 -18
  110. package/src/cli/json-input.ts +134 -0
  111. package/src/cli/link.ts +32 -4
  112. package/src/cli/local-sync-result.ts +41 -0
  113. package/src/cli/log-follow.ts +84 -0
  114. package/src/cli/log-view-filter.ts +146 -0
  115. package/src/cli/logout-command.ts +44 -0
  116. package/src/cli/model-picker-ordering.ts +137 -0
  117. package/src/cli/models-custom-input.ts +107 -0
  118. package/src/cli/models-custom-runtime.ts +112 -0
  119. package/src/cli/models-order.ts +194 -0
  120. package/src/cli/models-runtime-subcommands.ts +2 -0
  121. package/src/cli/models-runtime.ts +9 -1
  122. package/src/cli/models.ts +66 -81
  123. package/src/cli/observe-stream.ts +142 -0
  124. package/src/cli/observe.ts +75 -34
  125. package/src/cli/opencode.ts +54 -10
  126. package/src/cli/provider-batch.ts +77 -0
  127. package/src/cli/provider-lifecycle-runtime.ts +170 -0
  128. package/src/cli/provider-result.ts +124 -0
  129. package/src/cli/provider-runtime.ts +15 -12
  130. package/src/cli/provider-settings.ts +143 -0
  131. package/src/cli/provider.ts +116 -64
  132. package/src/cli/registry.ts +90 -24
  133. package/src/cli/remote-workspace-hub.ts +83 -0
  134. package/src/cli/remote-workspace.ts +6 -1
  135. package/src/cli/restart-failure.ts +27 -0
  136. package/src/cli/root.ts +42 -9
  137. package/src/cli/route-policy-write.ts +137 -0
  138. package/src/cli/route-policy.ts +8 -0
  139. package/src/cli/runtime-api.ts +57 -80
  140. package/src/cli/secret-args.ts +149 -0
  141. package/src/cli/settings-result.ts +30 -0
  142. package/src/cli/storage.ts +77 -7
  143. package/src/cli/system-command.ts +60 -2
  144. package/src/cli/system-restart-client.ts +20 -3
  145. package/src/cli/system-settings-parity.ts +83 -0
  146. package/src/cli/tray-proxy.ts +3 -2
  147. package/src/cli/update-restart-candidate.ts +21 -0
  148. package/src/cli/update-restart-child.ts +81 -0
  149. package/src/cli/update-restart-home.ts +38 -0
  150. package/src/cli/update-restart-transport.ts +193 -0
  151. package/src/cli/update-restart.ts +260 -0
  152. package/src/cli/usage-model-search.ts +58 -0
  153. package/src/cli/usage-report.ts +13 -5
  154. package/src/cli/v2-input.ts +66 -0
  155. package/src/cli/v2-local-output.ts +37 -0
  156. package/src/cli/v2-runtime.ts +90 -0
  157. package/src/cli/v2.ts +102 -144
  158. package/src/clients/config-export/contracts.ts +100 -0
  159. package/src/clients/config-export/droid.ts +54 -2
  160. package/src/clients/config-export/dsh.ts +21 -0
  161. package/src/clients/config-export/kilo.ts +12 -2
  162. package/src/clients/config-export/model-metadata.ts +10 -4
  163. package/src/clients/config-export/reasoning-metadata.ts +47 -0
  164. package/src/clients/config-export.ts +53 -67
  165. package/src/clients/omo-role-models.ts +17 -3
  166. package/src/codex/account-credit-use.ts +4 -2
  167. package/src/codex/account-runtime-state.ts +21 -0
  168. package/src/codex/account-store.ts +11 -47
  169. package/src/codex/account-usability.ts +11 -8
  170. package/src/codex/auth-api/account-list.ts +73 -63
  171. package/src/codex/auth-api/main-account-probe.ts +25 -12
  172. package/src/codex/auth-api/pool-mode-gate.ts +6 -9
  173. package/src/codex/auth-api/pool-quota-probe.ts +2 -4
  174. package/src/codex/auth-api/reset-credit-service.ts +3 -2
  175. package/src/codex/auth-context.ts +30 -11
  176. package/src/codex/catalog/aggregation.ts +3 -0
  177. package/src/codex/catalog/build-entries.ts +1 -1
  178. package/src/codex/catalog/bundled.ts +9 -2
  179. package/src/codex/catalog/heal-observation.ts +66 -0
  180. package/src/codex/catalog/model-hints.ts +2 -1
  181. package/src/codex/catalog/model-visibility.ts +6 -3
  182. package/src/codex/catalog/parsing.ts +2 -0
  183. package/src/codex/catalog/provider-models.ts +13 -4
  184. package/src/codex/catalog/publication-observer.ts +19 -0
  185. package/src/codex/catalog/remote.ts +13 -15
  186. package/src/codex/catalog/restore.ts +19 -6
  187. package/src/codex/catalog/retained-sync.ts +60 -11
  188. package/src/codex/catalog/routed-removal.ts +116 -0
  189. package/src/codex/catalog/write-audit-contract.ts +21 -0
  190. package/src/codex/catalog/write-audit.ts +171 -0
  191. package/src/codex/catalog-self-heal.ts +284 -0
  192. package/src/codex/catalog-write-serialization.ts +71 -7
  193. package/src/codex/chatgpt-refresh-failure.ts +56 -0
  194. package/src/codex/codex-home-owner.ts +124 -0
  195. package/src/codex/convergence.ts +57 -16
  196. package/src/codex/features.ts +8 -1
  197. package/src/codex/inject/restore.ts +46 -4
  198. package/src/codex/inject.ts +11 -1
  199. package/src/codex/internal/catalog-writer.ts +120 -13
  200. package/src/codex/journal.ts +49 -13
  201. package/src/codex/main-account.ts +144 -11
  202. package/src/codex/management-convergence.ts +3 -0
  203. package/src/codex/quota-refresh-outcome.ts +17 -2
  204. package/src/codex/quota-types.ts +36 -1
  205. package/src/codex/quota.ts +67 -16
  206. package/src/codex/refresh.ts +20 -9
  207. package/src/codex/routing/cooldown-math.ts +10 -4
  208. package/src/codex/routing/selection.ts +11 -4
  209. package/src/codex/routing.ts +9 -9
  210. package/src/codex/runtime.ts +7 -1
  211. package/src/codex/shim-diagnostics.ts +80 -0
  212. package/src/codex/shim-fingerprint.ts +7 -2
  213. package/src/codex/shim-migration.ts +153 -0
  214. package/src/codex/shim-overlay.ts +509 -0
  215. package/src/codex/shim-path-resolution.ts +145 -0
  216. package/src/codex/shim-probe.ts +4 -3
  217. package/src/codex/shim-state-file.ts +93 -7
  218. package/src/codex/shim.ts +54 -107
  219. package/src/codex/subagent-model-fallback.ts +2 -1
  220. package/src/codex/sync.ts +24 -4
  221. package/src/combos/failover.ts +101 -1
  222. package/src/combos/index.ts +1 -0
  223. package/src/combos/jev.ts +13 -3
  224. package/src/combos/resolve.ts +12 -0
  225. package/src/config/atomic-write.ts +13 -8
  226. package/src/config/diagnostics.ts +23 -1
  227. package/src/config/load-degrade.ts +7 -0
  228. package/src/config/provider-validation.ts +3 -0
  229. package/src/config/schema/chatgpt-desktop.ts +22 -0
  230. package/src/config/schema/compaction-triggers.ts +8 -0
  231. package/src/config/schema/config-schema.ts +43 -14
  232. package/src/config/schema/leaf-validators.ts +8 -3
  233. package/src/config/subagent-models.ts +12 -0
  234. package/src/generated/compatibility-version.json +645 -237
  235. package/src/grok/session-identity.ts +33 -0
  236. package/src/integrations/catalog-refresh.ts +1 -1
  237. package/src/integrations/merge.ts +13 -5
  238. package/src/integrations/mutation-plan.ts +50 -5
  239. package/src/integrations/omp-yaml-source.ts +181 -1
  240. package/src/integrations/ownership-policy.ts +66 -0
  241. package/src/integrations/registry.ts +50 -1
  242. package/src/integrations/state.ts +106 -19
  243. package/src/integrations/target.ts +25 -2
  244. package/src/integrations/writer.ts +107 -35
  245. package/src/lib/gui-pair-capability.ts +17 -0
  246. package/src/lib/package-tree-integrity.ts +42 -1
  247. package/src/lib/provider-client-headers.ts +62 -0
  248. package/src/lib/proxy-env.ts +3 -0
  249. package/src/lib/test-home-guard.ts +2 -1
  250. package/src/oauth/anthropic-account-refusal.ts +19 -8
  251. package/src/oauth/anthropic-continuity.ts +65 -0
  252. package/src/oauth/anthropic-identity.ts +75 -0
  253. package/src/oauth/anthropic-routing.ts +20 -15
  254. package/src/oauth/anthropic.ts +34 -3
  255. package/src/oauth/generic-account-failover.ts +21 -0
  256. package/src/oauth/health.ts +32 -5
  257. package/src/oauth/index.ts +42 -35
  258. package/src/oauth/local-token-detect.ts +7 -0
  259. package/src/oauth/pool-settings-capability.ts +9 -2
  260. package/src/oauth/refresh-policy.ts +2 -0
  261. package/src/oauth/store.ts +55 -6
  262. package/src/oauth/types.ts +9 -0
  263. package/src/protocols/encoders/messages.ts +4 -3
  264. package/src/protocols/plan-snapshot.ts +1 -1
  265. package/src/protocols/settings.ts +28 -4
  266. package/src/providers/antigravity-effort-families.ts +75 -0
  267. package/src/providers/antigravity-models.ts +54 -16
  268. package/src/providers/antigravity-wire-snapshot.ts +66 -0
  269. package/src/providers/derive.ts +2 -0
  270. package/src/providers/model-rename-fields.ts +3 -0
  271. package/src/providers/new-model-policy.ts +48 -10
  272. package/src/providers/registry/entries-extended.ts +3 -0
  273. package/src/providers/registry/model-ids.ts +2 -0
  274. package/src/providers/registry/model-seeds.ts +5 -0
  275. package/src/providers/registry/types.ts +4 -0
  276. package/src/responses/compaction.ts +19 -0
  277. package/src/router.ts +6 -0
  278. package/src/server/auth-cors.ts +9 -0
  279. package/src/server/caller-session-identity.ts +32 -0
  280. package/src/server/chat-completions.ts +10 -0
  281. package/src/server/claude-messages.ts +29 -15
  282. package/src/server/droid-reasoning-default.ts +50 -0
  283. package/src/server/github-copilot-responses-repair.ts +3 -6
  284. package/src/server/grok-responses-control-frame.ts +2 -2
  285. package/src/server/grok-responses-snapshot-repair.ts +4 -5
  286. package/src/server/gui-session.ts +33 -11
  287. package/src/server/index/claude-intercept-lifecycle.ts +4 -0
  288. package/src/server/index/serve-options.ts +13 -7
  289. package/src/server/index.ts +1 -1
  290. package/src/server/management/agent-settings-routes.ts +12 -134
  291. package/src/server/management/config-routes.ts +1 -1
  292. package/src/server/management/context.ts +8 -1
  293. package/src/server/management/cursor-integration-routes.ts +3 -3
  294. package/src/server/management/integration-routes.ts +69 -11
  295. package/src/server/management/link-routes.ts +20 -13
  296. package/src/server/management/model-routes.ts +3 -3
  297. package/src/server/management/model-row-export-metadata.ts +150 -0
  298. package/src/server/management/model-rows.ts +148 -9
  299. package/src/server/management/native-integration-routes.ts +2 -2
  300. package/src/server/management/oauth-account-routes.ts +96 -30
  301. package/src/server/management/route-registry.ts +29 -27
  302. package/src/server/management/shared.ts +19 -5
  303. package/src/server/management/subagent-model-routes.ts +214 -0
  304. package/src/server/messages-native-eligibility.ts +3 -6
  305. package/src/server/messages-native-oauth.ts +82 -35
  306. package/src/server/messages-native.ts +78 -16
  307. package/src/server/relay.ts +14 -44
  308. package/src/server/request-log-generation-window.ts +38 -0
  309. package/src/server/request-log.ts +13 -0
  310. package/src/server/responses/adapter-dispatch.ts +152 -28
  311. package/src/server/responses/codex-auth-error.ts +10 -2
  312. package/src/server/responses/combo-stream-preflight.ts +29 -3
  313. package/src/server/responses/compaction-routing.ts +10 -1
  314. package/src/server/responses/core-auth.ts +67 -30
  315. package/src/server/responses/core-codex-account.ts +6 -3
  316. package/src/server/responses/core-combo-failure.ts +5 -1
  317. package/src/server/responses/core-combo-native.ts +7 -1
  318. package/src/server/responses/core-combo.ts +64 -7
  319. package/src/server/responses/core-normalize.ts +7 -0
  320. package/src/server/responses/core-options.ts +5 -0
  321. package/src/server/responses/fetch-helpers.ts +9 -0
  322. package/src/server/responses/passthrough-delivery.ts +1 -1
  323. package/src/server/responses/policy-fallback.ts +1 -1
  324. package/src/server/responses/request-prepare.ts +5 -0
  325. package/src/server/responses/request-spend.ts +30 -30
  326. package/src/server/responses-custom-tool-repair.ts +2 -2
  327. package/src/server/responses-hosted-image-display.ts +70 -9
  328. package/src/server/responses-terminal-repair.ts +15 -2
  329. package/src/server/sse-frame-buffer.ts +38 -36
  330. package/src/server/sse-payload-rewrite.ts +78 -49
  331. package/src/server/ws-bridge.ts +1 -11
  332. package/src/service/cli.ts +6 -1
  333. package/src/service/ownership-mutation-lease.d.mts +26 -0
  334. package/src/service/ownership-mutation-lease.mjs +76 -1
  335. package/src/service/windows-taskxml.ts +1 -2
  336. package/src/service-manager-probe.ts +36 -2
  337. package/src/types/config.ts +6 -0
  338. package/src/types/provider.ts +28 -10
  339. package/src/update/index.ts +2 -1
  340. package/src/update/npm-invocation.mjs +35 -3
  341. package/src/update/proxy-liveness-probe.mjs +38 -8
  342. package/src/update/update-failure-guidance.d.mts +6 -0
  343. package/src/update/update-failure-guidance.mjs +30 -5
  344. package/src/usage/expected-prices.ts +9 -0
  345. package/src/usage/log.ts +7 -0
  346. package/src/usage/summary.ts +82 -1
  347. package/src/web-search/loop.ts +11 -8
  348. package/src/web-search/run-turn-loop.ts +10 -7
  349. package/gui/dist/assets/App-CddorHdA.js +0 -51
  350. package/gui/dist/assets/App-DMudtISW.css +0 -1
  351. package/gui/dist/assets/index-Btze1I3T.css +0 -1
  352. package/gui/dist/assets/index-CvnY7E6i.js +0 -86
  353. package/gui/dist/assets/quota-summary-B_AWpHfP.js +0 -1
@@ -0,0 +1,195 @@
1
+ import type { Capability } from "./capability-types";
2
+
3
+ /** Account pool operations and physical native-login profiles have separate owners. */
4
+ export const ACCOUNT_CAPABILITIES: readonly Capability[] = [
5
+ {
6
+ command: ["logout"],
7
+ summary: "Remove the active stored OAuth credential for a provider locally.",
8
+ usage: "ocx logout <provider> [--live] [--json]",
9
+ routes: [{"method":"POST","path":"/api/oauth/logout"}],
10
+ flags: [{"name":"--live","value":"boolean","summary":"Use the selected public-OAuth runtime logout; no local credential fallback."},{"name":"--json","value":"boolean","summary":"Emit the validated task result as one JSON document."}],
11
+ mutates: true,
12
+ json: "envelope",
13
+ details: ["No-live retains atomic local removed/not-found results and exits0/4. Live sends one provider-level OAuth logout and reports only its success receipt, not removed:true or global sign-out.","Live does not sign out Codex/native-main. Target/argument failure never causes local credential removal."],
14
+ },
15
+ {
16
+ command: ["account", "current"], summary: "Read the active account or API key for a provider.",
17
+ usage: "ocx account current <provider> [--json]",
18
+ routes: [{ method: "GET", path: "/api/codex-auth/accounts" }, { method: "GET", path: "/api/codex-auth/active" }, { method: "GET", path: "/api/oauth/accounts" }, { method: "GET", path: "/api/providers/keys" }],
19
+ flags: [{ name: "--json", value: "boolean", summary: "Emit provider, type, activeId and the projected account." }], mutates: false, json: "envelope",
20
+ details: ["Uses the live route for the configured account family; this does not report the physical native-main profile."],
21
+ },
22
+ {
23
+ command: ["account", "use"], summary: "Select a provider's pool account or API key.",
24
+ usage: "ocx account use <provider> <account-or-key-id|alias|main|auto> [--json]",
25
+ routes: [{ method: "GET", path: "/api/codex-auth/accounts" }, { method: "GET", path: "/api/codex-auth/active" }, { method: "PUT", path: "/api/codex-auth/active" }, { method: "PUT", path: "/api/oauth/accounts/active" }, { method: "PUT", path: "/api/providers/keys/active" }],
26
+ flags: [{ name: "--json", value: "boolean", summary: "Emit the selection receipt, including pin-drain information when present." }], mutates: true, json: "envelope",
27
+ details: ["Codex resolves IDs and aliases before reserved words; an account actually named auto wins. account clear openai always clears. OAuth and API-key selection pass the ID directly. This does not switch the physical Codex App login."],
28
+ },
29
+ {
30
+ command: ["account", "clear"], summary: "Clear a Codex pool's manual account selection pin.",
31
+ usage: "ocx account clear <provider> [--json]",
32
+ routes: [{ method: "PUT", path: "/api/codex-auth/active" }],
33
+ flags: [{ name: "--json", value: "boolean", summary: "Emit the clear receipt." }], mutates: true, json: "envelope",
34
+ details: ["Only Codex account pools are supported; other families are refused. Sends accountId:null without interpreting auto as an account ID."],
35
+ },
36
+ {
37
+ command: ["account", "alias"], summary: "Set or clear an account's display alias.",
38
+ usage: "ocx account alias <provider> <account-or-key-id|alias> <display-name|-> [--json]",
39
+ routes: [{ method: "GET", path: "/api/codex-auth/accounts" }, { method: "PUT", path: "/api/codex-auth/accounts/alias" }, { method: "PUT", path: "/api/oauth/accounts/alias" }, { method: "PUT", path: "/api/providers/keys/alias" }],
40
+ flags: [{ name: "--json", value: "boolean", summary: "Emit the applied alias, or null after clearing." }], mutates: true, json: "envelope",
41
+ details: ["- clears with an empty string. Codex resolves existing aliases; other families take an ID. Native main cannot be renamed; aliases are at most 80 printable characters. rename is an existing command alias."],
42
+ },
43
+ {
44
+ command: ["account", "priority"], summary: "Read or change Codex account selection order.",
45
+ usage: "ocx account priority <provider> <account-id|alias|main> [<-100..100|first|earlier|normal|later|last|reset>] [--json]",
46
+ routes: [{ method: "GET", path: "/api/codex-auth/accounts" }, { method: "GET", path: "/api/codex-auth/active" }, { method: "PUT", path: "/api/codex-auth/accounts/priority" }],
47
+ flags: [{ name: "--json", value: "boolean", summary: "Emit the normalized priority and named preset." }], mutates: true, json: "envelope",
48
+ details: ["Only Codex pools support selection order. Omitting the value reads; reset sends null. Every write releases any manual pin, even if the value is unchanged; running threads retain their account until drained."],
49
+ },
50
+ {
51
+ command: ["account", "clear-cooldown"], summary: "Lift an operator-clearable Codex or Anthropic account cooldown.",
52
+ usage: "ocx account clear-cooldown <provider> <account-id|alias|main> [--json]",
53
+ routes: [{ method: "GET", path: "/api/codex-auth/accounts" }, { method: "GET", path: "/api/oauth/accounts" }, { method: "POST", path: "/api/codex-auth/accounts/clear-cooldown" }, { method: "POST", path: "/api/oauth/accounts/clear-cooldown" }],
54
+ flags: [{ name: "--json", value: "boolean", summary: "Emit whether a cooldown was actually cleared." }], mutates: true, json: "envelope",
55
+ details: ["Other provider families are refused. Resolves Codex or Anthropic account aliases before writing."],
56
+ },
57
+ {
58
+ command: ["account", "remove"], summary: "Remove a pool account or provider API key with explicit confirmation.",
59
+ usage: "ocx account remove <provider> <account-or-key-id|alias> --yes [--json]",
60
+ routes: [{ method: "GET", path: "/api/codex-auth/accounts" }, { method: "GET", path: "/api/codex-auth/active" }, { method: "GET", path: "/api/oauth/accounts" }, { method: "GET", path: "/api/providers/keys" }, { method: "DELETE", path: "/api/codex-auth/accounts" }, { method: "DELETE", path: "/api/oauth/accounts" }, { method: "DELETE", path: "/api/providers/keys" }],
61
+ flags: [{ name: "--yes", value: "boolean", required: true, summary: "Confirm account/key deletion." }, { name: "--json", value: "boolean", summary: "Emit removal and promoted-account information." }], mutates: true, json: "envelope",
62
+ details: ["Native main removal is refused. Reads the account family before and after deletion; a failed post-delete read means deletion may have succeeded. Only Codex resolves aliases here."],
63
+ },
64
+ {
65
+ command: ["account", "add-key"], summary: "Import an existing provider API key from a human-controlled stdin source.",
66
+ usage: "ocx account add-key <provider> [--label <label>] [--json]",
67
+ routes: [{ method: "POST", path: "/api/providers/keys" }],
68
+ flags: [{ name: "--label", value: "string", summary: "Optional label for the imported key." }, { name: "--json", value: "boolean", summary: "Emit a redacted receipt containing the key ID, never the key." }], mutates: true, json: "envelope",
69
+ details: ["API-key providers only. Requires non-TTY stdin and reads one secret line; never put plaintext keys in command arguments or agent transcripts. This imports an upstream credential, not an OpenCodex access-key creation workflow."],
70
+ },
71
+ {
72
+ command: ["account", "import"], summary: "Import Google Antigravity accounts from a bounded Cockpit Tools document.",
73
+ usage: "ocx account import google-antigravity --format cockpit-tools (--file <path>|--stdin) [--json]",
74
+ routes: [{ method: "POST", path: "/api/oauth/accounts/import" }],
75
+ flags: [{ name: "--format", value: "string", required: true, summary: "Only cockpit-tools is supported." }, { name: "--file", value: "string", summary: "Bounded source document; exclusive with --stdin." }, { name: "--stdin", value: "boolean", summary: "Read the document from non-TTY stdin." }, { name: "--json", value: "boolean", summary: "Emit sanitized per-record import outcomes." }], mutates: true, json: "envelope",
76
+ details: ["Human-controlled credential handoff: choose exactly one source. Unsupported providers/formats are refused before source I/O. Partial failures or unsupported records return nonzero; do not echo the document."],
77
+ },
78
+ {
79
+ command: ["account","reauth"],
80
+ summary: "Reauthenticate a provider account through the existing login flow.",
81
+ usage: "ocx account reauth <provider> [--id <account-id>] [--device] [--code -] [--no-wait] [--open-browser <on|off>] [--json]",
82
+ routes: [{"method":"POST","path":"/api/codex-auth/login"},{"method":"GET","path":"/api/codex-auth/login-status"},{"method":"POST","path":"/api/codex-auth/login/code"},{"method":"POST","path":"/api/oauth/login"},{"method":"GET","path":"/api/oauth/status"},{"method":"POST","path":"/api/oauth/login/code"}],
83
+ flags: [{"name":"--id","value":"string","summary":"Account identity to reauthenticate."},{"name":"--device","value":"boolean","summary":"Codex device login; accepted for already-device-native kimi, nous and github-copilot."},{"name":"--code","value":"string","summary":"Use - to read the short-lived authorization code from stdin."},{"name":"--no-wait","value":"boolean","summary":"Return after starting the flow."},{"name":"--json","value":"boolean","summary":"Emit login instructions or completion state."},{"name":"--open-browser","value":"string","summary":"on or off for browser-capable login; rejected for explicit/native device flows."}],
84
+ mutates: true,
85
+ json: "payload",
86
+ details: ["Alias of account login with --reauth. openai, codex and chatgpt address the pool; native main uses account main reauth. Human completes authorization; keep returned login material out of transcripts. Kiro --method cannot be combined with reauth.","Explicit add-account is incompatible with reauth. Browser preference is accepted only by browser-capable flows; device verification remains manual."],
87
+ },
88
+ {
89
+ command: ["account", "code"], summary: "Submit a login redirect or authorization code from stdin.",
90
+ usage: "ocx account code <provider> [--flow <flow-id>] [--code -] [--json]",
91
+ routes: [{ method: "POST", path: "/api/codex-auth/login/code" }, { method: "POST", path: "/api/oauth/login/code" }],
92
+ flags: [{ name: "--flow", value: "string", summary: "Required for openai, codex or chatgpt pool flows." }, { name: "--code", value: "string", summary: "Use - for stdin; omission also reads stdin." }, { name: "--json", value: "boolean", summary: "Emit submission receipt." }], mutates: true, json: "payload",
93
+ details: ["A short-lived credential is a human handoff. Legacy positional/argv code input exists but warns about exposure; use stdin and never echo it."],
94
+ },
95
+ {
96
+ command: ["account", "cancel"], summary: "Cancel a pending account login flow.",
97
+ usage: "ocx account cancel <provider> [--flow <flow-id>] [--json]",
98
+ routes: [{ method: "POST", path: "/api/codex-auth/login/cancel" }, { method: "POST", path: "/api/oauth/login/cancel" }],
99
+ flags: [{ name: "--flow", value: "string", summary: "Required for Codex; selects a native Kiro flow when supplied." }, { name: "--json", value: "boolean", summary: "Emit cancellation receipt." }], mutates: true, json: "payload",
100
+ details: ["Codex cancellation sends flowId. Other providers send provider; Kiro additionally forwards a supplied flowId."],
101
+ },
102
+ {
103
+ command: ["account", "reset-credits"], summary: "Read Codex reset-credit state, or explicitly consume one with operator authorization.",
104
+ usage: "ocx account reset-credits <account-id|main> [--consume --yes [--operation-id <uuid>]] [--json]",
105
+ routes: [{ method: "GET", path: "/api/codex-auth/reset-credits" }, { method: "POST", path: "/api/codex-auth/reset-credits/consume" }],
106
+ flags: [{ name: "--consume", value: "boolean", summary: "Spend a reset credit; requires operator intent and --yes." }, { name: "--yes", value: "boolean", summary: "Confirm consumption." }, { name: "--operation-id", value: "string", summary: "UUIDv4 retry identity; only valid with --consume." }, { name: "--json", value: "boolean", summary: "Emit reset-credit state or receipt." }], mutates: true, json: "payload",
107
+ details: ["A bare invocation reads only. main maps to __main__; reads never consume a credit. This does not control credits-after-limit settings."],
108
+ },
109
+ {
110
+ command: ["account", "main", "doctor"], summary: "Diagnose native Codex login profile storage and recovery state.",
111
+ usage: "ocx account main doctor [--json]", routes: [{ method: "GET", path: "/api/native-main-profiles/doctor" }],
112
+ flags: [{ name: "--json", value: "boolean", summary: "Emit diagnosis; this command also prints JSON by default." }], mutates: false, json: "payload",
113
+ details: ["Reports the physical login in the server's effective CODEX_HOME, independently of pool account selection."],
114
+ },
115
+ {
116
+ command: ["account", "main", "list"], summary: "List encrypted native Codex login profiles.",
117
+ usage: "ocx account main list [--json]", routes: [{ method: "GET", path: "/api/native-main-profiles" }],
118
+ flags: [{ name: "--json", value: "boolean", summary: "Emit public profile metadata, not stored credentials." }], mutates: false, json: "payload",
119
+ },
120
+ {
121
+ command: ["account", "main", "register"], summary: "Register the current physical Codex login as an encrypted profile.",
122
+ usage: "ocx account main register <label> [--json]", routes: [{ method: "POST", path: "/api/native-main-profiles/register" }],
123
+ flags: [{ name: "--json", value: "boolean", summary: "Emit the registration receipt." }], mutates: true, json: "payload",
124
+ details: ["Captures the current login in the effective CODEX_HOME; it does not start a new login or select a pool account."],
125
+ },
126
+ {
127
+ command: ["account", "main", "add"], summary: "Add a native login profile through a human-operated official Codex login.",
128
+ usage: "ocx account main add <label>",
129
+ routes: [{ method: "POST", path: "/api/native-main-profiles/stage" }, { method: "POST", path: "/api/native-main-profiles/stage/heartbeat" }, { method: "POST", path: "/api/native-main-profiles/stage/finish" }, { method: "POST", path: "/api/native-main-profiles/stage/cancel" }],
130
+ flags: [], mutates: true, json: "none",
131
+ details: ["Human handoff: runs official Codex login locally in the server-provided restricted staging home, maintains a writer lease and encrypts the result. No --json, --yes or --rollback mode. Cleanup failure requires account main doctor; never expose writer tokens or credential files."],
132
+ },
133
+ {
134
+ command: ["account", "main", "reauth", "status"], summary: "Read an existing same-identity native-main reauthentication flow.",
135
+ usage: "ocx account main reauth status --flow <id> [--json]", routes: [{ method: "GET", path: "/api/codex-auth/main/reauth-device" }],
136
+ flags: [{ name: "--flow", value: "string", required: true, summary: "Flow ID returned by the human-started reauthentication." }, { name: "--json", value: "boolean", summary: "Emit flow state; pending state may include human login material." }], mutates: false, json: "payload",
137
+ },
138
+ {
139
+ command: ["account", "main", "reauth", "cancel"], summary: "Cancel a native-main reauthentication flow.",
140
+ usage: "ocx account main reauth cancel --flow <id> [--json]", routes: [{ method: "DELETE", path: "/api/codex-auth/main/reauth-device" }],
141
+ flags: [{ name: "--flow", value: "string", required: true, summary: "Flow ID to cancel." }, { name: "--json", value: "boolean", summary: "Emit cancellation state." }], mutates: true, json: "payload",
142
+ },
143
+ {
144
+ command: ["account", "main", "switch"], summary: "Switch the physical Codex App/CLI login to a registered profile.",
145
+ usage: "ocx account main switch <profile-id-or-label> --yes [--json]", routes: [{ method: "POST", path: "/api/native-main-profiles/switch" }],
146
+ flags: [{ name: "--yes", value: "boolean", required: true, summary: "Confirm the operator has closed Codex App/CLI." }, { name: "--json", value: "boolean", summary: "Emit the native-login switch receipt." }], mutates: true, json: "payload",
147
+ details: ["Changes the effective CODEX_HOME login, independently of account use openai. The operator must stop Codex first and restart it afterwards; no automatic restart is performed."],
148
+ },
149
+ {
150
+ command: ["account", "main", "recover"], summary: "Recover an interrupted native-login profile transaction.",
151
+ usage: "ocx account main recover [--rollback --yes] [--json]", routes: [{ method: "POST", path: "/api/native-main-profiles/recover" }],
152
+ flags: [{ name: "--rollback", value: "boolean", summary: "Restore the previous login; requires --yes." }, { name: "--yes", value: "boolean", summary: "Confirm Codex App/CLI is stopped for rollback." }, { name: "--json", value: "boolean", summary: "Emit recovery outcome." }], mutates: true, json: "payload",
153
+ details: ["Even without --rollback this calls recovery with rollback:false; it is not the doctor read. Rollback writes the native login only after explicit confirmation."],
154
+ },
155
+ {
156
+ command: ["account","pool"],
157
+ usage: "ocx account pool <provider> [--enabled <on|off>] [--threshold <0-100>] [--strategy <name>] [--sticky <1-100>] [--quota-window <five-hour|weekly|max-utilization>] [--json]",
158
+ summary: "Read or edit the selected runtime's supported pool policy fields.",
159
+ routes: [{"method":"GET","path":"/api/pool/settings"},{"method":"PUT","path":"/api/pool/settings"}],
160
+ flags: [{"name":"--enabled","value":"string","summary":"Stored pool preference; unsupported for Codex. Not equivalent to threshold0."},{"name":"--threshold","value":"number","summary":"Auto-switch threshold0–100."},{"name":"--strategy","value":"string","summary":"Use a strategy supported by this provider kind; reset-first is Codex, least-loaded is Kiro."},{"name":"--sticky","value":"number","summary":"Sticky limit1–100."},{"name":"--quota-window","value":"string","summary":"Anthropic only: five-hour, weekly or max-utilization."},{"name":"--json","value":"boolean","summary":"Emit the validated task result as one JSON document."}],
161
+ mutates: true,
162
+ json: "envelope",
163
+ details: ["Reads the target supported-field list before a narrow PUT. Null/unsupported, stored/effective and generic inert policy stay distinct; disabling does not promise that reactive429 rotation stops.","No local classification/defaults are round-tripped into the live target; supported-field reads are not CAS."],
164
+ },
165
+ {
166
+ command: ["account","credits"],
167
+ usage: "ocx account credits openai <id|alias|main> <on|off> [--json]; ocx account credits openai --all <on|off> [--json]",
168
+ summary: "Explicitly opt one or all current Codex accounts into paid credits after quota limits.",
169
+ routes: [{"method":"GET","path":"/api/codex-auth/accounts"},{"method":"PUT","path":"/api/codex-auth/accounts/credits"}],
170
+ flags: [{"name":"--all","value":"boolean","summary":"Exclusive with one account selector. On covers current selectable accounts plus main; off clears the opt-in set."},{"name":"--json","value":"boolean","summary":"Emit the validated task result as one JSON document."}],
171
+ mutates: true,
172
+ json: "envelope",
173
+ details: ["Requires explicit operator on/off intent. Showing credit balances does not grant paid-use permission; no login/quota failure auto-enables it.","One/all shapes are exclusive. Strict selected-runtime account resolution refuses ambiguity/unavailable roster; the response owns the applied set. It never consumes a reset grant."],
174
+ },
175
+ {
176
+ command: ["account","quota-activation"],
177
+ usage: "ocx account quota-activation openai <id|alias|main> --window <fiveHour|weekly> <on|off> [--json]",
178
+ summary: "Enable or disable a Codex account window's automatic quota refresh policy.",
179
+ routes: [{"method":"GET","path":"/api/codex-auth/accounts"},{"method":"PUT","path":"/api/settings"}],
180
+ flags: [{"name":"--window","value":"string","summary":"fiveHour or weekly; these spellings differ from pool quota-window.","required":true},{"name":"--json","value":"boolean","summary":"Emit the validated task result as one JSON document."}],
181
+ mutates: true,
182
+ json: "envelope",
183
+ details: ["Writes only the selected account/window mutation, preserving siblings. Enabling an unavailable window returns conflict; disabling remains allowed.","The server may schedule a quota refresh. This does not redeem a reset grant or opt into paid credits."],
184
+ },
185
+ {
186
+ command: ["account","anthropic-reset-grants"],
187
+ usage: "ocx account anthropic-reset-grants [account-id] [--json]",
188
+ summary: "Read Anthropic reset-grant eligibility and pending status without consuming a grant.",
189
+ routes: [{"method":"GET","path":"/api/anthropic/reset-grants"}],
190
+ flags: [{"name":"--json","value":"boolean","summary":"Emit the validated task result as one JSON document."}],
191
+ mutates: false,
192
+ json: "envelope",
193
+ details: ["Optional identity is the exact Anthropic account ID. Omission delegates active/fallback account choice to the server, not the Codex alias resolver.","This GET can refresh access/status information upstream. Empty grants, unavailable status, pending operation and unavailable journal remain distinct. Consume remains a GUI-session-only human handoff; no session acquisition or retry is performed."],
194
+ },
195
+ ];