@bitkyc08/opencodex 2.100.3 → 2.100.5-preview.20261118.1

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 (249) hide show
  1. package/AGENTS_INSTALL.md +23 -1
  2. package/bin/ocx.mjs +8 -1
  3. package/gui/dist/assets/{App-Dnb6VMsP.js → App-BiOGtxDS.js} +21 -20
  4. package/gui/dist/assets/{Tray-BV4ms9U9.js → Tray-BwsMejUO.js} +1 -1
  5. package/gui/dist/assets/brand-mark-BY1dgACL.js +1 -0
  6. package/gui/dist/assets/{index-DCdXsMyZ.js → index-CwHSKMdG.js} +46 -13
  7. package/gui/dist/assets/index-DJxM-imn.css +2 -0
  8. package/gui/dist/assets/{segment-thumb-features-DXSidY6D.js → segment-thumb-features-Bds9Hb_7.js} +1 -1
  9. package/gui/dist/classic/assets/{App-DA-scMPq.js → App-CGLOiqQL.js} +20 -19
  10. package/gui/dist/classic/assets/{Tray-BrHaVRAq.js → Tray-Da4r2O70.js} +1 -1
  11. package/gui/dist/classic/assets/{index-BqOaGLf5.js → index-CvoKXKL9.js} +46 -13
  12. package/gui/dist/classic/assets/quota-summary-DvqzfCmr.js +1 -0
  13. package/gui/dist/classic/index.html +1 -1
  14. package/gui/dist/index.html +2 -2
  15. package/native/ocx-child/src/cli.rs +5 -3
  16. package/native/ocx-child/src/codex_home.rs +1 -0
  17. package/native/ocx-child/src/link_ws.rs +24 -19
  18. package/native/ocx-child/src/link_ws_frame.rs +136 -50
  19. package/package.json +3 -3
  20. package/src/adapters/anthropic/per-message-effort.ts +296 -0
  21. package/src/adapters/anthropic-input-schema.ts +270 -0
  22. package/src/adapters/anthropic.ts +4 -63
  23. package/src/adapters/claude-cli/adapter.ts +1 -0
  24. package/src/adapters/command-code-tool-text.ts +9 -1
  25. package/src/adapters/command-code.ts +18 -2
  26. package/src/adapters/devin/cloud-direct/chat.ts +95 -14
  27. package/src/adapters/devin/live-models.ts +11 -1
  28. package/src/adapters/google-errors.ts +14 -2
  29. package/src/adapters/kiro/reasoning.ts +3 -0
  30. package/src/adapters/kiro-tools.ts +14 -9
  31. package/src/adapters/openai-responses/passthrough.ts +3 -1
  32. package/src/adapters/openai-responses/request-strips.ts +1 -0
  33. package/src/adapters/qoder/adapter.ts +9 -1
  34. package/src/adapters/tool-catalog-nudge.ts +1 -1
  35. package/src/adapters/zed.ts +4 -2
  36. package/src/claude/chat-tool-dispatch.ts +4 -1
  37. package/src/claude/desktop-remote-store.ts +60 -10
  38. package/src/cli/account-api.ts +4 -0
  39. package/src/cli/account-auth.ts +30 -2
  40. package/src/cli/account-extended.ts +33 -2
  41. package/src/cli/capabilities-access-remote.ts +3 -3
  42. package/src/cli/capabilities-accounts.ts +3 -3
  43. package/src/cli/capabilities-base.ts +11 -6
  44. package/src/cli/capabilities-observe-system.ts +2 -2
  45. package/src/cli/claude.ts +3 -3
  46. package/src/cli/disconnect-runtime.ts +16 -6
  47. package/src/cli/dispatch.ts +7 -1
  48. package/src/cli/index.ts +2 -2
  49. package/src/cli/link-apply-restart.ts +4 -2
  50. package/src/cli/link-routes.ts +4 -1
  51. package/src/cli/link.ts +5 -4
  52. package/src/cli/logout-command.ts +23 -4
  53. package/src/cli/preflight-exemptions.ts +3 -0
  54. package/src/cli/provider.ts +3 -2
  55. package/src/cli/registry.ts +5 -2
  56. package/src/cli/resolve.ts +23 -8
  57. package/src/cli/restart-failure.ts +11 -1
  58. package/src/cli/runtime-api.ts +4 -0
  59. package/src/cli/status.ts +4 -1
  60. package/src/cli/system-command.ts +1 -1
  61. package/src/cli/system-restart-client.ts +9 -3
  62. package/src/cli/system-settings-parity.ts +2 -1
  63. package/src/client/connect.ts +73 -11
  64. package/src/client/desktop-refusal.ts +38 -0
  65. package/src/client/lifecycle-lock.ts +29 -4
  66. package/src/client/runtime-restart.ts +27 -15
  67. package/src/client/runtime.ts +4 -2
  68. package/src/client/state.ts +14 -0
  69. package/src/clients/config-export.ts +12 -7
  70. package/src/codex/account-lifecycle.ts +3 -1
  71. package/src/codex/account-pause.ts +4 -0
  72. package/src/codex/account-runtime-state.ts +4 -0
  73. package/src/codex/auth-api/main-account-probe.ts +3 -1
  74. package/src/codex/auth-api/main-hard-lock-refusal-read.ts +172 -0
  75. package/src/codex/auth-context.ts +40 -2
  76. package/src/codex/catalog/build-entries.ts +10 -0
  77. package/src/codex/catalog/derive-entry.ts +7 -0
  78. package/src/codex/catalog/metadata.ts +8 -0
  79. package/src/codex/catalog/native-models.ts +16 -6
  80. package/src/codex/catalog/pinned-models.ts +1 -0
  81. package/src/codex/catalog/provider-models.ts +5 -5
  82. package/src/codex/catalog/reserve-warn.ts +7 -5
  83. package/src/codex/catalog/reserve.ts +4 -3
  84. package/src/codex/catalog/retained-sync.ts +2 -0
  85. package/src/codex/catalog/routed-defaults.ts +35 -0
  86. package/src/codex/catalog-auto-refresh.ts +13 -2
  87. package/src/codex/config-drift-heal.ts +40 -12
  88. package/src/codex/config-write-lock.ts +39 -1
  89. package/src/codex/convergence.ts +2 -0
  90. package/src/codex/data/roster-pinned-models.json +346 -1
  91. package/src/codex/inject/config-write-section.ts +39 -1
  92. package/src/codex/inject/plan.ts +10 -8
  93. package/src/codex/inject/remove.ts +21 -19
  94. package/src/codex/inject/restore.ts +5 -1
  95. package/src/codex/inject-coordination.ts +58 -7
  96. package/src/codex/inject.ts +10 -12
  97. package/src/codex/journal-config-restore.ts +42 -0
  98. package/src/codex/journal.ts +62 -8
  99. package/src/codex/loopback-target.ts +22 -8
  100. package/src/codex/main-account.ts +94 -30
  101. package/src/codex/native-main-auth-file.ts +14 -0
  102. package/src/codex/native-main-credentials.ts +276 -0
  103. package/src/codex/native-main-owner.ts +3 -0
  104. package/src/codex/native-main-refresh-mode.ts +14 -1
  105. package/src/codex/quota.ts +63 -14
  106. package/src/combos/failover.ts +195 -1
  107. package/src/combos/index.ts +5 -0
  108. package/src/combos/resolve.ts +115 -19
  109. package/src/config/diagnostics.ts +3 -0
  110. package/src/config/live-reconcile.ts +6 -3
  111. package/src/config/load-degrade.ts +2 -0
  112. package/src/config/persisted-mutation.ts +2 -2
  113. package/src/config/persisted-projections.ts +18 -0
  114. package/src/config/process-state.ts +4 -3
  115. package/src/config/reserve-capability.ts +96 -0
  116. package/src/config/schema/config-schema.ts +6 -0
  117. package/src/config/schema/leaf-validators.ts +2 -0
  118. package/src/config/schema/routed-catalog-defaults.ts +49 -0
  119. package/src/config/subagent-models.ts +20 -12
  120. package/src/config.ts +7 -7
  121. package/src/desktop-update/acquire.ts +202 -0
  122. package/src/desktop-update/cli.ts +168 -0
  123. package/src/desktop-update/drain.ts +40 -0
  124. package/src/desktop-update/headless.ts +285 -0
  125. package/src/desktop-update/image.ts +85 -0
  126. package/src/desktop-update/install.ts +53 -0
  127. package/src/desktop-update/msi.ts +72 -0
  128. package/src/desktop-update/release.ts +128 -0
  129. package/src/desktop-update/runtime.ts +155 -0
  130. package/src/desktop-update/staging.ts +118 -0
  131. package/src/desktop-update/trust.ts +45 -0
  132. package/src/generated/compatibility-version.json +327 -195
  133. package/src/generated/model-metadata.ts +3 -3
  134. package/src/images/fulfill-video.ts +3 -3
  135. package/src/images/loop.ts +6 -2
  136. package/src/images/plan.ts +147 -11
  137. package/src/images/types.ts +13 -4
  138. package/src/images/xai-video-client.ts +72 -10
  139. package/src/lib/client-error-body.ts +6 -0
  140. package/src/lib/developer-role-rejection.ts +15 -0
  141. package/src/lib/gcp-adc.ts +48 -4
  142. package/src/lib/offline-resend.ts +150 -0
  143. package/src/lib/paced-stream.ts +3 -3
  144. package/src/lib/provider-outbound.ts +17 -6
  145. package/src/lib/request-failure-model.ts +2 -0
  146. package/src/lib/response-body-inactivity.ts +23 -1
  147. package/src/lib/upstream-retry.ts +39 -6
  148. package/src/link/explicit-route.ts +4 -4
  149. package/src/link/remote-windows.ts +79 -31
  150. package/src/link/residual-recovery.ts +20 -8
  151. package/src/messaging/budget.ts +23 -5
  152. package/src/messaging/remote-ports.ts +22 -10
  153. package/src/messaging/rpc.ts +4 -4
  154. package/src/oauth/antigravity-risk.ts +126 -0
  155. package/src/oauth/credential-siblings.ts +32 -0
  156. package/src/oauth/generic-account-failover.ts +113 -30
  157. package/src/oauth/generic-session-affinity.ts +10 -3
  158. package/src/oauth/index.ts +22 -14
  159. package/src/oauth/login-cli.ts +35 -1
  160. package/src/oauth/pool-kernel.ts +3 -3
  161. package/src/oauth/store.ts +38 -7
  162. package/src/providers/anthropic-billing-refusal.ts +27 -3
  163. package/src/providers/anthropic-reset-grants.ts +4 -0
  164. package/src/providers/claude-cli-usage.ts +2 -0
  165. package/src/providers/codebuddy-models.ts +11 -0
  166. package/src/providers/google-vertex-model-discovery.ts +49 -15
  167. package/src/providers/kiro-models.ts +5 -0
  168. package/src/providers/model-rename-fields.ts +2 -0
  169. package/src/providers/quota/workbuddy.ts +6 -2
  170. package/src/providers/registry/entries-core.ts +9 -3
  171. package/src/providers/registry/entries-extended.ts +20 -9
  172. package/src/providers/registry/model-seeds.ts +4 -1
  173. package/src/providers/stale-context-window-migration.ts +2 -0
  174. package/src/providers/workbuddy-credit-balance.ts +125 -16
  175. package/src/responses/citation-markers.ts +26 -23
  176. package/src/responses/effort-history.ts +732 -0
  177. package/src/routing/history/integrity.ts +41 -4
  178. package/src/server/auth-cors.ts +13 -3
  179. package/src/server/codex-model-list.ts +2 -1
  180. package/src/server/direct-local-http.ts +26 -3
  181. package/src/server/index/link-listener.ts +20 -14
  182. package/src/server/index/serve-options.ts +1 -0
  183. package/src/server/index.ts +3 -2
  184. package/src/server/link-turn.ts +17 -5
  185. package/src/server/management/config-routes.ts +39 -3
  186. package/src/server/management/link-child-preflight.ts +1 -1
  187. package/src/server/management/link-enrollment.ts +3 -3
  188. package/src/server/management/link-route-edit.ts +20 -1
  189. package/src/server/management/link-route-request.ts +11 -5
  190. package/src/server/management/oauth-account-routes.ts +43 -13
  191. package/src/server/management/provider-credential-release.ts +44 -0
  192. package/src/server/management/provider-overwrite-carry.ts +3 -0
  193. package/src/server/management/provider-routes.ts +12 -12
  194. package/src/server/management/static-catalog-probe.ts +33 -0
  195. package/src/server/management/usage-aggregate-cache.ts +6 -3
  196. package/src/server/messages-native.ts +16 -2
  197. package/src/server/proxy-liveness.ts +54 -9
  198. package/src/server/relay.ts +6 -1
  199. package/src/server/request-log-conversation.ts +8 -4
  200. package/src/server/request-log-failure-detail.ts +26 -9
  201. package/src/server/request-log.ts +5 -1
  202. package/src/server/reserve-capability-startup.ts +32 -0
  203. package/src/server/responses/adapter-continuation.ts +59 -25
  204. package/src/server/responses/adapter-delivery.ts +2 -0
  205. package/src/server/responses/adapter-dispatch.ts +39 -18
  206. package/src/server/responses/antigravity-fault-rotation.ts +24 -0
  207. package/src/server/responses/antigravity-validation-refusal.ts +43 -6
  208. package/src/server/responses/codex-tool-catalog.ts +47 -10
  209. package/src/server/responses/combo-selection-keepalive.ts +254 -0
  210. package/src/server/responses/combo-session-recall.ts +26 -1
  211. package/src/server/responses/combo-stream-preflight.ts +35 -26
  212. package/src/server/responses/core-combo-failure.ts +6 -0
  213. package/src/server/responses/core-combo-native.ts +2 -1
  214. package/src/server/responses/core-combo.ts +67 -28
  215. package/src/server/responses/core-errors.ts +9 -6
  216. package/src/server/responses/core-options.ts +10 -0
  217. package/src/server/responses/core.ts +21 -0
  218. package/src/server/responses/estimated-usage.ts +115 -0
  219. package/src/server/responses/input-admission.ts +41 -3
  220. package/src/server/responses/jev-model-invoke.ts +7 -2
  221. package/src/server/responses/passthrough-completion.ts +6 -3
  222. package/src/server/responses/passthrough-delivery.ts +47 -8
  223. package/src/server/responses/passthrough-dispatch.ts +3 -0
  224. package/src/server/responses/request-prepare.ts +9 -5
  225. package/src/server/responses/request-send-budget.ts +1 -1
  226. package/src/server/responses/request-transport.ts +10 -2
  227. package/src/server/responses/sidecar-execution.ts +11 -4
  228. package/src/service/desktop-supervision.d.mts +2 -0
  229. package/src/service/desktop-supervision.mjs +5 -0
  230. package/src/service/windows-checked-stop-live.ts +28 -5
  231. package/src/stall-timeout.ts +11 -0
  232. package/src/types/config.ts +15 -92
  233. package/src/types/provider.ts +13 -0
  234. package/src/types/request.ts +23 -3
  235. package/src/types/routed-catalog-defaults.ts +17 -0
  236. package/src/types/routing-profile.ts +90 -0
  237. package/src/types.ts +1 -0
  238. package/src/update/index.ts +1 -1
  239. package/src/usage/expected-prices.ts +35 -0
  240. package/src/usage/ledger-scanner.ts +44 -10
  241. package/src/usage/log.ts +14 -4
  242. package/src/usage/telemetry-contract.ts +1 -0
  243. package/src/web-search/loop.ts +20 -2
  244. package/src/web-search/parse.ts +2 -12
  245. package/src/web-search/passthrough-bridge.ts +7 -0
  246. package/src/web-search/sources.ts +13 -0
  247. package/gui/dist/assets/brand-mark-XOLJbomA.js +0 -1
  248. package/gui/dist/assets/index-DQtCRNAw.css +0 -2
  249. package/gui/dist/classic/assets/quota-summary-Dy5_wfTT.js +0 -1
@@ -5,6 +5,14 @@ import { modelSelectionGuidance, modelSelectionNextSteps } from "./model-selecti
5
5
  import { warnIfCodexCatalogRefreshPending } from "./account-catalog-refresh";
6
6
  import { isCodexResetCreditOperationId } from "../codex/reset-credit-recovery";
7
7
  import { BROWSER_LAUNCH_FAILED_NOTICE } from "../lib/browser-launch-notice";
8
+ import {
9
+ ANTIGRAVITY_RISK_ACK_FIELD,
10
+ ANTIGRAVITY_RISK_CLI_FLAG,
11
+ antigravityRiskDecisionMessage,
12
+ requiresAntigravityRiskAcknowledgement,
13
+ resolveAntigravityRiskAcknowledgement,
14
+ } from "../oauth/antigravity-risk";
15
+ import { isAgentDriven } from "./agent-driven";
8
16
  import {
9
17
  RuntimeApiError,
10
18
  CliUsageError,
@@ -39,7 +47,7 @@ function writeStdoutFully(text: string): void {
39
47
  }
40
48
 
41
49
  const USAGE = `Usage:
42
- ocx account login <provider> [--id <account-id>] [--reauth] [--device] [--method builder-id|google|github] [--open-browser on|off] [--add-account on|off] [--code -] [--no-wait] [--json]
50
+ ocx account login <provider> [--id <account-id>] [--reauth] [--device] [--method builder-id|google|github] [--open-browser on|off] [--add-account on|off] [--code -] [--no-wait] [--json] [--accept-antigravity-risk]
43
51
  ocx account code <provider> [--flow <flow-id>] [--json] (reads the code from stdin)
44
52
  ocx account cancel <provider> [--flow <flow-id>] [--json] (--flow required for codex)
45
53
  ocx account reset-credits <account-id|main> [--consume --yes [--operation-id <uuid>]] [--json]
@@ -223,8 +231,11 @@ async function login(argv: string[], deps: RuntimeApiDeps): Promise<number | voi
223
231
  const suppliedCode = takeOptionWithSyntax(args, "--code");
224
232
  const openBrowser = loginBoolean(args, "--open-browser");
225
233
  const addAccount = loginBoolean(args, "--add-account");
234
+ const acceptAntigravityRisk = takeFlag(args, ANTIGRAVITY_RISK_CLI_FLAG);
226
235
  if (provider && !isValidProviderName(provider)) throw new CliUsageError("invalid provider name", USAGE);
227
236
  if (!provider) throw new CliUsageError("provider is required", USAGE);
237
+ const antigravityRisk = requiresAntigravityRiskAcknowledgement(provider);
238
+ if (acceptAntigravityRisk && !antigravityRisk) throw new CliUsageError(`${ANTIGRAVITY_RISK_CLI_FLAG} only applies to google-antigravity`, USAGE);
228
239
  if (method !== undefined) {
229
240
  if (provider !== "kiro" || !["builder-id", "google", "github"].includes(method)) {
230
241
  throw new CliUsageError("--method requires kiro and builder-id, google, or github", USAGE);
@@ -250,6 +261,23 @@ async function login(argv: string[], deps: RuntimeApiDeps): Promise<number | voi
250
261
  if (addAccount !== undefined && (reauth || CODEX_NAMES.has(provider))) throw new CliUsageError("--add-account is only valid for fresh provider OAuth login", USAGE);
251
262
  if (openBrowser !== undefined && (device || DEVICE_NATIVE_PROVIDERS.has(provider))) throw new CliUsageError("--open-browser is not supported for device login", USAGE);
252
263
  if (!CODEX_NAMES.has(provider) && id && !reauth) throw new CliUsageError("--id is only valid with --reauth for provider OAuth accounts", USAGE);
264
+ // Antigravity can get the Google account disabled: warn and get an answer before anything
265
+ // else touches stdin or the proxy. A refusal here sends no request at all.
266
+ if (antigravityRisk) {
267
+ const decision = await resolveAntigravityRiskAcknowledgement({
268
+ flag: acceptAntigravityRisk,
269
+ // The question goes to stderr, so a redirected stderr is not a terminal a person can answer.
270
+ interactive: (deps.stdinImpl ?? process.stdin).isTTY === true
271
+ && (deps.antigravityRisk?.promptVisible ?? (() => process.stderr.isTTY === true))(),
272
+ agentDriven: (deps.antigravityRisk?.agentDriven ?? isAgentDriven)(),
273
+ warn: text => console.error(text),
274
+ ask: async question => {
275
+ process.stderr.write(question);
276
+ return await readSecretLine(deps, "confirmation");
277
+ },
278
+ });
279
+ if (decision !== "accepted") throw new CliUsageError(antigravityRiskDecisionMessage(decision));
280
+ }
253
281
  // Only resolve when --code was actually given: a plain `ocx account login`
254
282
  // opens the browser flow and polls, and must not block on stdin.
255
283
  const code = await resolveCode(suppliedCode, deps, false);
@@ -346,7 +374,7 @@ async function login(argv: string[], deps: RuntimeApiDeps): Promise<number | voi
346
374
 
347
375
  const start = publicLoginStart(await runtimeRequest<unknown>("/api/oauth/login", {
348
376
  method: "POST", redirect: "error",
349
- body: JSON.stringify({ provider, addAccount: addAccount ?? !reauth, ...(device && DEVICE_OPT_IN_PROVIDERS.has(provider) ? { device: true } : {}), ...(openBrowser === undefined ? {} : { openBrowser }), ...(reauth && id ? { accountId: id, reauth: true } : {}) }),
377
+ body: JSON.stringify({ provider, addAccount: addAccount ?? !reauth, ...(device && DEVICE_OPT_IN_PROVIDERS.has(provider) ? { device: true } : {}), ...(openBrowser === undefined ? {} : { openBrowser }), ...(reauth && id ? { accountId: id, reauth: true } : {}), ...(antigravityRisk ? { [ANTIGRAVITY_RISK_ACK_FIELD]: true } : {}) }),
350
378
  }, pinned));
351
379
  const xaiDevice = provider === "xai" && device;
352
380
  if (xaiDevice && (!start.flowId?.trim() || !start.url?.trim() || !start.deviceCode?.trim())) {
@@ -4,7 +4,15 @@ import { anthropicProviderIdentityError, cmdAnthropicAccountThreshold } from "./
4
4
  import { isReservedCodexAccountWord, reportCodexAccountTargetError, resolveCodexAccountTarget } from "./account-target";
5
5
  import { hasPassiveAccountQuota } from "../providers/quota";
6
6
  import { isWeeklyAllowancePercent } from "../providers/quota-types";
7
- import { terminalSafeText } from "./runtime-api";
7
+ import { readSecretLine, terminalSafeText } from "./runtime-api";
8
+ import {
9
+ ANTIGRAVITY_RISK_ACK_FIELD,
10
+ ANTIGRAVITY_RISK_CLI_FLAG,
11
+ ANTIGRAVITY_RISK_REFUSAL_CODE,
12
+ antigravityRiskDecisionMessage,
13
+ resolveAntigravityRiskAcknowledgement,
14
+ } from "../oauth/antigravity-risk";
15
+ import { isAgentDriven } from "./agent-driven";
8
16
  import { closeSync, openSync, readSync, readFileSync, statSync } from "node:fs";
9
17
  import {
10
18
  MAX_ACCOUNT_PRIORITY,
@@ -558,6 +566,7 @@ export async function cmdImport(args: string[], deps: AccountDeps): Promise<numb
558
566
  const formatArg = flagValue(args, "--format");
559
567
  const fileArg = flagValue(args, "--file");
560
568
  const fromStdin = flag(args, "--stdin");
569
+ const acceptRisk = flag(args, ANTIGRAVITY_RISK_CLI_FLAG);
561
570
  const provider = args.shift();
562
571
 
563
572
  // Admission happens before source I/O. In particular, an inline JSON positional argument is
@@ -576,6 +585,25 @@ export async function cmdImport(args: string[], deps: AccountDeps): Promise<numb
576
585
  return usage("Error: choose exactly one bounded source: --file <path> or --stdin");
577
586
  }
578
587
 
588
+ // Before reading the document: an imported Antigravity credential carries the same account
589
+ // risk as a fresh login. With --stdin the document owns stdin, so only the flag can accept.
590
+ const stdinInput: AccountStdin = deps.stdinImpl ?? process.stdin;
591
+ const decision = await resolveAntigravityRiskAcknowledgement({
592
+ flag: acceptRisk,
593
+ interactive: !fromStdin && stdinInput.isTTY === true
594
+ && (deps.antigravityRisk?.promptVisible ?? (() => process.stderr.isTTY === true))(),
595
+ agentDriven: (deps.antigravityRisk?.agentDriven ?? isAgentDriven)(),
596
+ warn: text => console.error(text),
597
+ ask: async question => {
598
+ process.stderr.write(question);
599
+ return await readSecretLine(deps, "confirmation");
600
+ },
601
+ });
602
+ if (decision !== "accepted") {
603
+ console.error(antigravityRiskDecisionMessage(decision));
604
+ return 1;
605
+ }
606
+
579
607
  let source: string;
580
608
  try {
581
609
  source = hasFile ? readBoundedImportFile(fileArg.value!) : await readBoundedImportStdin(deps);
@@ -611,6 +639,7 @@ export async function cmdImport(args: string[], deps: AccountDeps): Promise<numb
611
639
  provider,
612
640
  format: formatArg.value,
613
641
  document,
642
+ [ANTIGRAVITY_RISK_ACK_FIELD]: true,
614
643
  }, { signal: controller.signal });
615
644
  } finally {
616
645
  clearTimeout(timer);
@@ -621,7 +650,9 @@ export async function cmdImport(args: string[], deps: AccountDeps): Promise<numb
621
650
  return 1;
622
651
  }
623
652
  if (response.status !== 200) {
624
- if (IMPORT_CODES.has(response.json.code as AccountImportCode)) {
653
+ if (response.json.code === ANTIGRAVITY_RISK_REFUSAL_CODE) {
654
+ console.error(`Error: ${ANTIGRAVITY_RISK_REFUSAL_CODE}`);
655
+ } else if (IMPORT_CODES.has(response.json.code as AccountImportCode)) {
625
656
  console.error(`Error: ${response.json.code as AccountImportCode}`);
626
657
  } else {
627
658
  console.error(`Error: import_request_failed (status ${response.status})`);
@@ -257,7 +257,7 @@ export const ACCESS_REMOTE_CAPABILITIES: readonly Capability[] = [
257
257
  flags: [{ name: "--link-id", value: "string", required: true, summary: "Home-initiated link id." }, { name: "--route", value: "string", required: true, summary: "SSH host alias or destination of the new route." },
258
258
  { name: "--position", value: "number", summary: "Index in the list; by default just before the alias, so direct routes come first and the alias stays last." }, { name: "--json", value: "boolean", summary: "Emit {linkId, pin, routes} as JSON." }],
259
259
  mutates: true, json: "payload",
260
- details: ["The Home first checks that its link known_hosts file trusts only the link's recorded key for the alias (every entry for it, in any case or hashed by an older release, carries that key), then connects over the new route with strict checking against that one key and stores the route only if the same machine answers. Refusals: route_unproven with a cause (hostkey, auth, forward, transient), pin_mismatch, trust_file_unexpected, link_changed, pin_changed, route_exists, route_limit (8 routes), link_operation_in_progress (removal or a Child job holds the link). Exit 5 on a refusal, 4 for an unknown link, 1 when the routes were stored but the running proxy did not apply them (routes_stored_reload_failed; ocx link routes --link-id <id> reads what was stored).", "Adding a route does not move a running tunnel; the Home tries the list in order from the next connection on (ocx link reconnect starts one now). Requires loopback admin authority on the Home."],
260
+ details: ["The Home first checks that its link known_hosts file trusts only the link's recorded key for the alias (every entry for it, in any case or hashed by an older release, carries that key), then connects over the new route with strict checking against that one key and stores the route only if the same machine answers. Refusals: route_unproven with a cause (hostkey, auth, forward, transient), pin_mismatch, trust_file_unexpected, link_changed, pin_changed, route_exists, route_limit (8 routes), link_operation_in_progress (removal or a Child job holds the link), link_retirement_pending (an unfinished removal of the link holds it; finish that revoke first). Exit 5 on a refusal, 4 for an unknown link, 1 when the routes were stored but the running proxy did not apply them (routes_stored_reload_failed; ocx link routes --link-id <id> reads what was stored).", "Adding a route does not move a running tunnel; the Home tries the list in order from the next connection on (ocx link reconnect starts one now). Requires loopback admin authority on the Home."],
261
261
  },
262
262
  {
263
263
  command: ["link", "routes", "remove"], summary: "Remove an SSH route from a Home-initiated link.",
@@ -265,7 +265,7 @@ export const ACCESS_REMOTE_CAPABILITIES: readonly Capability[] = [
265
265
  routes: [{ method: "POST", path: "/api/link/{id}/routes" }],
266
266
  flags: [{ name: "--link-id", value: "string", required: true, summary: "Home-initiated link id." }, { name: "--route", value: "string", required: true, summary: "Route to remove." }, { name: "--json", value: "boolean", summary: "Emit {linkId, pin, routes} as JSON." }],
267
267
  mutates: true, json: "payload",
268
- details: ["The alias is the link's pin and cannot be removed (route_is_pin). Removing the route the tunnel uses restarts the tunnel on the remaining list; removing the last extra route returns the link to one route. Exit 4 for an unknown link or route (link_not_found, route_not_found), 5 on a refusal (route_is_pin, link_operation_in_progress), 1 when the routes were stored but the running proxy did not apply them (routes_stored_reload_failed). Requires loopback admin authority on the Home."],
268
+ details: ["The alias is the link's pin and cannot be removed (route_is_pin). Removing the route the tunnel uses restarts the tunnel on the remaining list; removing the last extra route returns the link to one route. Exit 4 for an unknown link or route (link_not_found, route_not_found), 5 on a refusal (route_is_pin, link_operation_in_progress, link_retirement_pending: an unfinished removal of the link holds it), 1 when the routes were stored but the running proxy did not apply them (routes_stored_reload_failed). Requires loopback admin authority on the Home."],
269
269
  },
270
270
  {
271
271
  command: ["link", "routes", "order"], summary: "Reorder a Home-initiated link's SSH routes.",
@@ -273,7 +273,7 @@ export const ACCESS_REMOTE_CAPABILITIES: readonly Capability[] = [
273
273
  routes: [{ method: "POST", path: "/api/link/{id}/routes" }],
274
274
  flags: [{ name: "--link-id", value: "string", required: true, summary: "Home-initiated link id." }, { name: "--routes", value: "string", required: true, summary: "The current routes, comma separated, in the new order." }, { name: "--json", value: "boolean", summary: "Emit {linkId, pin, routes} as JSON." }],
275
275
  mutates: true, json: "payload",
276
- details: ["The list must name exactly the current routes (route_order_mismatch otherwise), so no route enters unproven. A reorder does not move a running tunnel. Requires loopback admin authority on the Home."],
276
+ details: ["The list must name exactly the current routes (route_order_mismatch otherwise), so no route enters unproven. While an unfinished removal of the link holds it, the reorder is refused (link_retirement_pending); finish that revoke first. A reorder does not move a running tunnel. Requires loopback admin authority on the Home."],
277
277
  },
278
278
  {
279
279
  command: ["link", "operations"], summary: "List or read the enrollments and revokes journalled under an operation id.",
@@ -86,10 +86,10 @@ export const ACCOUNT_CAPABILITIES: readonly Capability[] = [
86
86
  },
87
87
  {
88
88
  command: ["account", "import"], summary: "Import Google Antigravity accounts from a bounded Cockpit Tools document.",
89
- usage: "ocx account import google-antigravity --format cockpit-tools (--file <path>|--stdin) [--json]",
89
+ usage: "ocx account import google-antigravity --format cockpit-tools (--file <path>|--stdin) [--accept-antigravity-risk] [--json]",
90
90
  routes: [{ method: "POST", path: "/api/oauth/accounts/import" }],
91
- 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",
92
- 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."],
91
+ 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: "--accept-antigravity-risk", value: "boolean", summary: "Accept the Google account-ban risk without the y/N prompt; required with --stdin." }, { name: "--json", value: "boolean", summary: "Emit sanitized per-record import outcomes." }], mutates: true, json: "envelope",
92
+ 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.", "Prints the Antigravity account-ban warning before reading the source; --file on a terminal asks y/N, otherwise --accept-antigravity-risk is required. Agent-driven runs are refused even with the flag (AGENTS_INSTALL.md)."],
93
93
  },
94
94
  {
95
95
  command: ["account","reauth"],
@@ -35,8 +35,8 @@ export const CAPABILITIES: readonly Capability[] = [
35
35
  bannerLines: ["ocx chatgpt <sub> Experimental app-server shim: launch|restore|status (macOS)"],
36
36
  details: ["Default off; launch requires chatgptDesktop.appServerShim: true. Restore removes the generated launcher."],
37
37
  },
38
- {"command": ["link","probe"],"summary": "Probe an SSH host fingerprint and OpenCodex version without trusting it.","routes": [{"method": "POST","path": "/api/link/probe"}],"flags": [{"name": "--proxy-command","value": "string","summary": "Explicit ProxyCommand for the alias, passed to ssh on the command line: an absolute path, then words of letters, digits and . _ / : @ + , = - separated by single spaces. Needs --ssh-user, --ssh-port and --exclusive. The link then reads no ssh_config (-F none): the Home offers its SSH agent's keys or a default ~/.ssh/id_* key, or only the --ssh-identity-file key when one is given."},{"name": "--ssh-user","value": "string","summary": "SSH user of the explicit route: a letter or _ then up to 31 letters, digits, ., _ or -."},{"name": "--ssh-port","value": "number","summary": "SSH port of the explicit route, 1 to 65535."},{"name": "--ssh-identity-file","value": "string","summary": "The private key the link authenticates with (link.route/2): an absolute path of letters, digits and . _ + - /. Needs the explicit route. ssh then offers that key alone (IdentitiesOnly=yes, IdentityAgent=none) for every command and tunnel of the link. The Home refuses a missing, symlinked, unreadable or group- or other-accessible file, and a Windows Home refuses the flag; it never reads the key. The key's directory and every directory above it must be owned by this user or root and not writable by group or others (a sticky directory above the key, such as /tmp, excepted), and every symlink on the path must be owned by this user or root; a folder created under umask 002 is group-writable and is refused. Use a path that passes, or run chmod go-w on a private folder of this user's or of the tool that chose the path; never change a shared or system directory such as /tmp or another user's symlink, even as root (hints identity_file_directory, identity_file_ancestor)."},{"name": "--exclusive","value": "boolean","summary": "The link keeps exactly its alias as its one route and refuses route edits."},{"name": "--json","value": "boolean","summary": "Emit alias, fingerprint, key type and version as JSON."}],"mutates": true,"json": "payload","usage": "ocx link probe <alias> [--proxy-command <cmd> --ssh-user <user> --ssh-port <port> [--ssh-identity-file <path>]] [--exclusive] [--json]","details": ["Requires loopback admin authority on the Home. Stores only a temporary pending offer; does not persist host trust or issue a link key."]},
39
- {"command": ["link","add"],"summary": "Connect an SSH Child to this Home after confirming its fingerprint.","routes": [{"method": "POST","path": "/api/link/probe"},{"method": "POST","path": "/api/link/confirm-host"},{"method": "POST","path": "/api/link/apply"}],"flags": [{"name": "--expect-fingerprint","value": "string","summary": "Exact SHA256 host fingerprint; required without an interactive TTY."},{"name": "--proxy-command","value": "string","summary": "Explicit ProxyCommand for the alias, passed to ssh on the command line: an absolute path, then words of letters, digits and . _ / : @ + , = - separated by single spaces. Needs --ssh-user, --ssh-port and --exclusive. The link then reads no ssh_config (-F none): the Home offers its SSH agent's keys or a default ~/.ssh/id_* key, or only the --ssh-identity-file key when one is given."},{"name": "--ssh-user","value": "string","summary": "SSH user of the explicit route: a letter or _ then up to 31 letters, digits, ., _ or -."},{"name": "--ssh-port","value": "number","summary": "SSH port of the explicit route, 1 to 65535."},{"name": "--ssh-identity-file","value": "string","summary": "The private key the link authenticates with (link.route/2): an absolute path of letters, digits and . _ + - /. Needs the explicit route. ssh then offers that key alone (IdentitiesOnly=yes, IdentityAgent=none) for every command and tunnel of the link. The Home refuses a missing, symlinked, unreadable or group- or other-accessible file, and a Windows Home refuses the flag; it never reads the key. The key's directory and every directory above it must be owned by this user or root and not writable by group or others (a sticky directory above the key, such as /tmp, excepted), and every symlink on the path must be owned by this user or root; a folder created under umask 002 is group-writable and is refused. Use a path that passes, or run chmod go-w on a private folder of this user's or of the tool that chose the path; never change a shared or system directory such as /tmp or another user's symlink, even as root (hints identity_file_directory, identity_file_ancestor)."},{"name": "--exclusive","value": "boolean","summary": "The link keeps exactly its alias as its one route and refuses route edits."},{"name": "--operation-id","value": "string","summary": "Journal the enrollment under this id (1-128 letters, digits, . _ : -): reserved ids, a mark per Home effect and the outcome; a repeat with the same id and parameters replays it. Needs --expect-fingerprint."},{"name": "--require-ephemeral","value": "boolean","summary": "Refuse (409 full_install_present) a Child where any runnable full ocx exists, before any plant, key or Child change."},{"name": "--json","value": "boolean","summary": "Emit the verified link result as JSON."}],"mutates": true,"json": "payload","usage": "ocx link add <alias> [--expect-fingerprint SHA256:…] [--proxy-command <cmd> --ssh-user <user> --ssh-port <port> [--ssh-identity-file <path>]] [--exclusive] [--operation-id <id>] [--require-ephemeral] [--json]","details": ["Requires loopback admin authority on the Home. Without a fingerprint, requires a TTY and explicit yes after showing the offered fingerprint. Never prints the link key.","Preflights bound Child restart support and curl, connects, restarts once and verifies a fresh authenticated catalog relay before success. Post-connect failures can leave Child config; the failure names the attempt's link id, so run ocx disconnect --expect-link <id> there (the planted ocx-child's detach --expect-link <id> on a lightweight Child, ~/.cache/opencodex/bin/ocx-child or %LOCALAPPDATA%\\opencodex\\bin\\ocx-child.exe, which need not be on PATH) and, if it disconnected, ocx restart, before retrying: it acts only while the Child belongs to that link."]},
38
+ {"command": ["link","probe"],"summary": "Probe an SSH host fingerprint and OpenCodex version without trusting it.","routes": [{"method": "POST","path": "/api/link/probe"}],"flags": [{"name": "--proxy-command","value": "string","summary": "Explicit ProxyCommand for the alias, passed to ssh on the command line: an absolute path, then words of letters, digits and . _ / : @ + , = - separated by single spaces. Needs --ssh-user, --ssh-port and --exclusive. The link then reads no ssh_config (-F none): the Home offers its SSH agent's keys or a default ~/.ssh/id_* key, or only the --ssh-identity-file key when one is given."},{"name": "--ssh-user","value": "string","summary": "SSH user of the explicit route: a letter or _ then up to 31 letters, digits, ., _ or -."},{"name": "--ssh-port","value": "number","summary": "SSH port of the explicit route, 1 to 65535."},{"name": "--ssh-identity-file","value": "string","summary": "The private key the link authenticates with (link.route/2): an absolute path of letters, digits and . _ + - /. Needs the explicit route. ssh then offers that key alone (IdentitiesOnly=yes, IdentityAgent=none) for every command and tunnel of the link. The Home refuses a missing, symlinked, unreadable or group- or other-accessible file, and a Windows Home refuses the flag; it never reads the key. The key's directory and every directory above it must be owned by this user or root and not writable by group or others (a sticky directory above the key, such as /tmp, excepted), and every symlink on the path must be owned by this user or root; a folder created under umask 002 is group-writable and is refused. Use a path that passes, or run chmod go-w on a private folder this user owns (its own, or one a tool made for it); never change a shared or system directory such as /tmp or another user's symlink, even as root (hints identity_file_directory, identity_file_ancestor)."},{"name": "--exclusive","value": "boolean","summary": "The link keeps exactly its alias as its one route and refuses route edits."},{"name": "--json","value": "boolean","summary": "Emit alias, fingerprint, key type and version as JSON."}],"mutates": true,"json": "payload","usage": "ocx link probe <alias> [--proxy-command <cmd> --ssh-user <user> --ssh-port <port> [--ssh-identity-file <path>]] [--exclusive] [--json]","details": ["Requires loopback admin authority on the Home. Stores only a temporary pending offer; does not persist host trust or issue a link key."]},
39
+ {"command": ["link","add"],"summary": "Connect an SSH Child to this Home after confirming its fingerprint.","routes": [{"method": "POST","path": "/api/link/probe"},{"method": "POST","path": "/api/link/confirm-host"},{"method": "POST","path": "/api/link/apply"}],"flags": [{"name": "--expect-fingerprint","value": "string","summary": "Exact SHA256 host fingerprint; required without an interactive TTY."},{"name": "--proxy-command","value": "string","summary": "Explicit ProxyCommand for the alias, passed to ssh on the command line: an absolute path, then words of letters, digits and . _ / : @ + , = - separated by single spaces. Needs --ssh-user, --ssh-port and --exclusive. The link then reads no ssh_config (-F none): the Home offers its SSH agent's keys or a default ~/.ssh/id_* key, or only the --ssh-identity-file key when one is given."},{"name": "--ssh-user","value": "string","summary": "SSH user of the explicit route: a letter or _ then up to 31 letters, digits, ., _ or -."},{"name": "--ssh-port","value": "number","summary": "SSH port of the explicit route, 1 to 65535."},{"name": "--ssh-identity-file","value": "string","summary": "The private key the link authenticates with (link.route/2): an absolute path of letters, digits and . _ + - /. Needs the explicit route. ssh then offers that key alone (IdentitiesOnly=yes, IdentityAgent=none) for every command and tunnel of the link. The Home refuses a missing, symlinked, unreadable or group- or other-accessible file, and a Windows Home refuses the flag; it never reads the key. The key's directory and every directory above it must be owned by this user or root and not writable by group or others (a sticky directory above the key, such as /tmp, excepted), and every symlink on the path must be owned by this user or root; a folder created under umask 002 is group-writable and is refused. Use a path that passes, or run chmod go-w on a private folder this user owns (its own, or one a tool made for it); never change a shared or system directory such as /tmp or another user's symlink, even as root (hints identity_file_directory, identity_file_ancestor)."},{"name": "--exclusive","value": "boolean","summary": "The link keeps exactly its alias as its one route and refuses route edits."},{"name": "--operation-id","value": "string","summary": "Journal the enrollment under this id (1-128 letters, digits, . _ : -): reserved ids, a mark per Home effect and the outcome; a repeat with the same id and parameters replays it. Needs --expect-fingerprint."},{"name": "--require-ephemeral","value": "boolean","summary": "Refuse (409 full_install_present) a Child where any runnable full ocx exists, before any plant, key or Child change."},{"name": "--json","value": "boolean","summary": "Emit the verified link result as JSON."}],"mutates": true,"json": "payload","usage": "ocx link add <alias> [--expect-fingerprint SHA256:…] [--proxy-command <cmd> --ssh-user <user> --ssh-port <port> [--ssh-identity-file <path>]] [--exclusive] [--operation-id <id>] [--require-ephemeral] [--json]","details": ["Requires loopback admin authority on the Home. Without a fingerprint, requires a TTY and explicit yes after showing the offered fingerprint. Never prints the link key.","Preflights bound Child restart support and curl, connects, restarts once and verifies a fresh authenticated catalog relay before success. Post-connect failures can leave Child config; the failure names the attempt's link id. Before retrying, on a full install run ocx disconnect --expect-link <id> and, if it disconnected, ocx restart. A lightweight Child has no ocx: run its planted ocx-child's detach --expect-link <id> instead (~/.cache/opencodex/bin/ocx-child; in Command Prompt on Windows %LOCALAPPDATA%\\opencodex\\bin\\ocx-child.exe, or %USERPROFILE%\\.cache\\opencodex\\bin\\ocx-child.exe where LOCALAPPDATA is not set; a copy placed by hand in ~/.local/bin, or %USERPROFILE%\\.local\\bin on Windows; none need be on PATH). Either acts only while the Child belongs to that link. A build older than --expect-link refuses it before it acts: then leave a lightweight Child as it is, and on a full install run ocx disconnect and ocx restart only if ocx connect status --json shows that id, right after that check, and otherwise leave it as it is."]},
40
40
  {
41
41
  command: ["link","port"],
42
42
  summary: "Allocate a free loopback port for a remote home link.",
@@ -247,10 +247,15 @@ export const CAPABILITIES: readonly Capability[] = [
247
247
  { name: "--version", value: "string", summary: "Select an exact version for a plan or apply." },
248
248
  { name: "--expect-plan", value: "string", summary: "Require the apply plan to match this planToken." },
249
249
  { name: "--not-after", value: "string", summary: "Refuse mutation after this Unix millisecond deadline." },
250
+ { name: "--desktop", value: "boolean", summary: "Update a Windows Desktop installation headlessly (signature-verified MSI)." },
251
+ { name: "--check", value: "boolean", summary: "With --desktop, report the published and serving versions without installing." },
250
252
  ],
251
253
  mutates: true,
252
254
  json: "envelope",
253
- details: ["Orchestrated exit codes: 0 verified or up-to-date; 10 refused; 11 previous version verified; 12 uncertain; 64 usage."],
255
+ details: [
256
+ "Orchestrated exit codes: 0 verified or up-to-date; 10 refused; 11 previous version verified; 12 uncertain; 64 usage.",
257
+ "--desktop exit codes: 0 done or up to date; 1 nothing installed; 2 old runtime still serving or reboot pending; 3 installer uncertain; 64 usage.",
258
+ ],
254
259
  },
255
260
  {
256
261
  command: ["capabilities"],
@@ -313,11 +318,11 @@ export const CAPABILITIES: readonly Capability[] = [
313
318
  command: ["account","login"],
314
319
  summary: "Log in to an OAuth provider; Kiro can add a native device account.",
315
320
  routes: [{"method":"POST","path":"/api/oauth/login"},{"method":"GET","path":"/api/oauth/status"},{"method":"POST","path":"/api/oauth/login/code"},{"method":"POST","path":"/api/codex-auth/login"},{"method":"GET","path":"/api/codex-auth/login-status"},{"method":"POST","path":"/api/codex-auth/login/code"}],
316
- flags: [{"name":"--id","value":"string","summary":"Account ID; provider OAuth requires --reauth when supplied."},{"name":"--reauth","value":"boolean","summary":"Reauthenticate an existing account."},{"name":"--device","value":"boolean","summary":"Codex device flow or xAI device authorization; a no-op for already-device-native kimi, nous and github-copilot."},{"name":"--method","value":"string","summary":"Kiro only: builder-id, google or github; add-only and incompatible with --reauth, --id, --device or --code."},{"name":"--code","value":"string","summary":"Use - to read authorization material from stdin."},{"name":"--no-wait","value":"boolean","summary":"Return after flow start."},{"name":"--json","value":"boolean","summary":"Emit the command result as JSON; xAI --device requires --no-wait."},{"name":"--open-browser","value":"string","summary":"on or off for browser-capable login; rejected for explicit/native device flows."},{"name":"--add-account","value":"string","summary":"Fresh generic OAuth login only: on forces a fresh flow, off permits existing import preference. Not supported with reauth/Codex/Kiro method."}],
321
+ flags: [{"name":"--id","value":"string","summary":"Account ID; provider OAuth requires --reauth when supplied."},{"name":"--reauth","value":"boolean","summary":"Reauthenticate an existing account."},{"name":"--device","value":"boolean","summary":"Codex device flow or xAI device authorization; a no-op for already-device-native kimi, nous and github-copilot."},{"name":"--method","value":"string","summary":"Kiro only: builder-id, google or github; add-only and incompatible with --reauth, --id, --device or --code."},{"name":"--code","value":"string","summary":"Use - to read authorization material from stdin."},{"name":"--no-wait","value":"boolean","summary":"Return after flow start."},{"name":"--json","value":"boolean","summary":"Emit the command result as JSON; xAI --device requires --no-wait."},{"name":"--open-browser","value":"string","summary":"on or off for browser-capable login; rejected for explicit/native device flows."},{"name":"--add-account","value":"string","summary":"Fresh generic OAuth login only: on forces a fresh flow, off permits existing import preference. Not supported with reauth/Codex/Kiro method."},{"name":"--accept-antigravity-risk","value":"boolean","summary":"google-antigravity only: accept the Google account-ban risk without the interactive y/N prompt."}],
317
322
  mutates: true,
318
323
  json: "payload",
319
- usage: "ocx account login <provider> [--id <account-id>] [--reauth] [--device] [--method <builder-id|google|github>] [--code -] [--no-wait] [--open-browser <on|off>] [--add-account <on|off>] [--json]",
320
- details: ["openai, codex and chatgpt address the Codex pool. Native main uses the separate account main reauth flow.","Login is a human authorization handoff. Codes, verification material and credentials must not be copied into agent transcripts. Legacy argv code input warns about exposure; use stdin.","No --live flag is implemented. Provider OAuth --id requires --reauth; --method is Kiro add-only.","Omitted options preserve each flow's existing defaults. Explicit browser flags are refused for Codex device, known native-device providers and native Kiro method; add-account is refused for reauth/Codex/Kiro method.","Start/code/poll are pinned; human verification remains required. Only public handoff/flow/state fields are printed. Completed-but-validation/catalog-pending outcomes remain visible and nonzero."],
324
+ usage: "ocx account login <provider> [--id <account-id>] [--reauth] [--device] [--method <builder-id|google|github>] [--code -] [--no-wait] [--open-browser <on|off>] [--add-account <on|off>] [--accept-antigravity-risk] [--json]",
325
+ details: ["openai, codex and chatgpt address the Codex pool. Native main uses the separate account main reauth flow.","google-antigravity (login and reauth) prints an account-ban warning and needs a y answer on a terminal or --accept-antigravity-risk; otherwise it is refused before any request. Agent-driven runs are refused even with the flag (AGENTS_INSTALL.md).","Login is a human authorization handoff. Codes, verification material and credentials must not be copied into agent transcripts. Legacy argv code input warns about exposure; use stdin.","No --live flag is implemented. Provider OAuth --id requires --reauth; --method is Kiro add-only.","Omitted options preserve each flow's existing defaults. Explicit browser flags are refused for Codex device, known native-device providers and native Kiro method; add-account is refused for reauth/Codex/Kiro method.","Start/code/poll are pinned; human verification remains required. Only public handoff/flow/state fields are printed. Completed-but-validation/catalog-pending outcomes remain visible and nonzero."],
321
326
  },
322
327
  {
323
328
  command: ["account","history"],
@@ -439,9 +439,9 @@ export const OBSERVE_SYSTEM_CAPABILITIES: readonly Capability[] = [
439
439
  {
440
440
  command: ["system","settings"],
441
441
  summary: "Read or update supported runtime settings.",
442
- usage: "ocx system settings [--auto-start <on|off>] [--stream-mode <auto|legacy-tee|eager-relay>] [--desktop-authless <on|off>] [--client-compaction <on|off>] [--show-codex-credits <on|off>] [--account-picker <on|off>] [--main-account-hard-lock <on|off>] [--ultra-fast-tier <on|off>] [--fast-rows <on|off>] [--json]",
442
+ usage: "ocx system settings [--auto-start <on|off>] [--stream-mode <auto|legacy-tee|eager-relay>] [--desktop-authless <on|off>] [--client-compaction <on|off>] [--show-codex-credits <on|off>] [--account-picker <on|off>] [--main-account-hard-lock <on|off>] [--ultra-fast-tier <on|off>] [--fast-rows <on|off>] [--reserve <on|off>] [--json]",
443
443
  routes: [{"method":"GET","path":"/api/settings"},{"method":"PUT","path":"/api/settings"}],
444
- flags: [{"name":"--auto-start","value":"string","summary":"on | off for Codex autostart."},{"name":"--stream-mode","value":"string","summary":"auto | legacy-tee | eager-relay."},{"name":"--desktop-authless","value":"string","summary":"on | off for Codex Desktop authless."},{"name":"--client-compaction","value":"string","summary":"on | off for native replay portability; summaries may consume provider quota."},{"name":"--json","value":"boolean","summary":"Emit the result as JSON."},{"name":"--show-codex-credits","value":"string","summary":"on/off display preference only; never paid-credit permission."},{"name":"--account-picker","value":"string","summary":"on/off Codex account picker visibility."},{"name":"--main-account-hard-lock","value":"string","summary":"on/off routing ownership policy; does not rotate native login."},{"name":"--ultra-fast-tier","value":"string","summary":"on/off routing tier; confirmed by same-target read-back."},{"name":"--fast-rows","value":"string","summary":"on/off Fast model rows, separate from provider Fast."}],
444
+ flags: [{"name":"--auto-start","value":"string","summary":"on | off for Codex autostart."},{"name":"--stream-mode","value":"string","summary":"auto | legacy-tee | eager-relay."},{"name":"--desktop-authless","value":"string","summary":"on | off for Codex Desktop authless."},{"name":"--client-compaction","value":"string","summary":"on | off for native replay portability; summaries may consume provider quota."},{"name":"--json","value":"boolean","summary":"Emit the result as JSON."},{"name":"--show-codex-credits","value":"string","summary":"on/off display preference only; never paid-credit permission."},{"name":"--account-picker","value":"string","summary":"on/off Codex account picker visibility."},{"name":"--main-account-hard-lock","value":"string","summary":"on/off routing ownership policy; does not rotate native login."},{"name":"--ultra-fast-tier","value":"string","summary":"on/off routing tier; confirmed by same-target read-back."},{"name":"--fast-rows","value":"string","summary":"on/off Fast model rows, separate from provider Fast."},{"name":"--reserve","value":"string","summary":"on/off Luna Reserve compatibility; independent of desktop authless, grants no entitlement."}],
445
445
  mutates: true,
446
446
  json: "envelope",
447
447
  details: ["Mixed read/write: no setting flags reads; setting flags write only submitted fields. Stored, effective and config-apply states can differ.","New-option writes use narrow fields and actual observed values. ultraFastTier is read back because the PUT response omits it; missing/mismatching evidence stays saved-but-unverified and nonzero.","catalogRefreshPending is not a full catalog disposition. Native apply can remain deferred/refused separately. Old no-new-option settings output remains compatible."],
package/src/cli/claude.ts CHANGED
@@ -41,9 +41,9 @@ import { withoutSupervisorMarkers } from "../lib/supervisor-markers";
41
41
 
42
42
  /**
43
43
  * The environment of the detached `ocx start` that `ocx claude` launches (the spawn adds the runtime
44
- * provenance stamp): an ordinary owner. It
45
- * carries OCX_SERVICE=1 but no service manager's marker, which is how a restart tells it apart from
46
- * a manager-launched process (src/client/runtime-restart.ts classifyClientRestartSupervisor).
44
+ * provenance stamp): an ordinary owner. It carries OCX_SERVICE=1 but no service manager's marker, so a
45
+ * manager-launched process is told apart from it; a client runtime cannot tell it from a service registered before
46
+ * the marker existed, and its restart is refused as legacy-flag (src/client/runtime-restart.ts, #8545).
47
47
  */
48
48
  export function claudeProxyStartEnv(base: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {
49
49
  return withoutSupervisorMarkers(withoutSiblingMarker({ ...base, OCX_SERVICE: "1" }));
@@ -5,10 +5,14 @@
5
5
  * therefore restarts that runtime itself (the same restart as `ocx restart`, which a disconnected
6
6
  * client runtime hands to whichever owner holds it), bound to the runtime generation it observed,
7
7
  * and exits 0 only when no client runtime remained or a live standalone runtime answers afterwards.
8
- * Every other outcome exits 1, so a Home-driven leave stops before its own `ocx restart`.
8
+ * Every other outcome exits 1, so a Home-driven leave stops before its own `ocx restart`. One
9
+ * exception keeps the runtime on purpose: a record stating `legacy-flag` (only a bare OCX_SERVICE=1, so
10
+ * its owner cannot be proven; #8545) gets no restart request and exits 0 with the re-register advice,
11
+ * because the disconnect itself completed and a later `ocx restart` refuses it with the same advice.
9
12
  */
10
13
  import type { ProxyRestartIo, ProxyRestartLive, ProxyRestartRequestOutcome } from "./tray-proxy";
11
- import { RESTART_OWNERS, type RestartOwner } from "../client/runtime-restart";
14
+ import { LEGACY_FLAG_RESTART_OWNER, RESTART_OWNERS, type RestartOwner } from "../client/runtime-restart";
15
+ import { LEGACY_FLAG_OWNER_ADVICE } from "./restart-failure";
12
16
 
13
17
  function isHandledRestartOwner(value: string | undefined): value is RestartOwner {
14
18
  return value !== undefined && (RESTART_OWNERS as readonly string[]).includes(value);
@@ -24,7 +28,7 @@ export interface RuntimeGeneration {
24
28
  port: number;
25
29
  hostname?: string;
26
30
  attestationSecret: string;
27
- /** The owner the runtime classified from positive evidence; absent for a bare flag or an older runtime. */
31
+ /** The owner the runtime classified from positive evidence, legacy-flag for a bare flag; absent for an older runtime. */
28
32
  restartOwner?: string;
29
33
  }
30
34
 
@@ -127,10 +131,16 @@ export async function restartRuntimeAfterDisconnect(deps: DisconnectRuntimeDeps)
127
131
  if (client && !target) {
128
132
  return fail(`Disconnected, but this machine could not identify the running client runtime${client.pid ? ` (pid ${client.pid})` : ""}: its runtime record is missing or names another process, so it was not restarted.`, { kind: "unknown" });
129
133
  }
134
+ // A bare OCX_SERVICE=1 runtime is kept and nothing is stopped on inference (#8545 owner decision): no
135
+ // restart request, the disconnect's own exit 0, and the advice to re-register the service once.
136
+ if (target?.restartOwner === LEGACY_FLAG_RESTART_OWNER) {
137
+ error(`Disconnected, but the client runtime${client?.pid ? ` (pid ${client.pid})` : ""} was kept and still serves the old connection; nothing was stopped. ${LEGACY_FLAG_OWNER_ADVICE}`);
138
+ return 0;
139
+ }
130
140
  // Only a record that states an owner this step handles (written by a runtime with this change:
131
- // the desktop app, a service manager with a current marker, or no supervisor) is restarted. Any
132
- // other record, a bare OCX_SERVICE=1 runtime or one started before this change, is left exactly
133
- // as origin/dev's `ocx disconnect` left it: no restart request, the disconnect's own exit 0.
141
+ // the desktop app, a service manager with a current marker, or no supervisor) is restarted. A
142
+ // record from a runtime started before restartOwner existed, or naming a later value, is left
143
+ // exactly as origin/dev's `ocx disconnect` left it: no restart request, the disconnect's own exit 0.
134
144
  if (target && !isHandledRestartOwner(target.restartOwner)) return 0;
135
145
  const before = deps.connectionState();
136
146
  if (before.kind !== "disconnected") {
@@ -387,6 +387,7 @@ const commandRunners: Record<string, CommandRunner> = {
387
387
  // It is deliberately not `--code`: that name carries a secret value everywhere else in the
388
388
  // CLI (`ocx account login <provider> --code <value>`) and its operand is scrubbed from stderr.
389
389
  const codeMode = loginArgs.includes("--headless");
390
+ const acceptAntigravityRisk = loginArgs.includes("--accept-antigravity-risk");
390
391
  const positional = loginArgs.filter(arg => !arg.startsWith("--"));
391
392
  // 'ocx login codex' is the command people type first, and until now it answered with
392
393
  // the full provider wall because the Codex pool lives behind 'ocx account login'.
@@ -407,7 +408,7 @@ const commandRunners: Record<string, CommandRunner> = {
407
408
  return code ?? 1;
408
409
  }
409
410
  const { handleLogin } = await import("../oauth/login-cli");
410
- await handleLogin(positional[0], {}, { codeMode });
411
+ await handleLogin(positional[0], {}, { codeMode, acceptAntigravityRisk });
411
412
  return 0;
412
413
  },
413
414
  logout: async deps => {
@@ -650,6 +651,11 @@ const commandRunners: Record<string, CommandRunner> = {
650
651
  return 0;
651
652
  },
652
653
  update: async deps => {
654
+ // #8246: the headless Windows Desktop updater has its own grammar (including --json) and never
655
+ // reaches the package or orchestrated updater.
656
+ if (deps.args.slice(1).includes("--desktop") && !hasHelpFlag(deps.args.slice(1))) {
657
+ return (await import("../desktop-update/cli")).runHeadlessDesktopUpdateCommand(deps.args.slice(1));
658
+ }
653
659
  const { isOrchestratedUpdateArgv, parseOrchestratedChildArgs } = await import("../update/orchestrated-arguments.mjs");
654
660
  if (process.env.OCX_UPDATE_ORCHESTRATED_CHILD === "1" && deps.args.slice(1).some(arg => /^--orchestrated-(expect|result)(?:=|$)/.test(arg))) {
655
661
  const child = parseOrchestratedChildArgs(deps.args.slice(1), process.env);
package/src/cli/index.ts CHANGED
@@ -50,7 +50,7 @@ import {
50
50
  runCodexHistoryJob,
51
51
  } from "../codex/history-job";
52
52
  import { findCrossHomeOwner, markCrossHomeSibling, markLiveHomeSibling } from "./cross-home-owner";
53
- import { inspectClientRotationRecoveryGate, readClientConnectionState } from "../client/state";
53
+ import { clientStartupRefusalMessage, inspectClientRotationRecoveryGate, readClientConnectionState } from "../client/state";
54
54
  import {
55
55
  codexAutoStartEnabled,
56
56
  getConfigDir,
@@ -489,7 +489,7 @@ async function handleStart(options: { block?: boolean } = {}) {
489
489
  const rotationGate = inspectClientRotationRecoveryGate(clientState);
490
490
  if (clientState.kind === "connected") {
491
491
  if (rotationGate.kind === "recovery-required" || rotationGate.kind === "unsafe") {
492
- throw new Error(`client startup refused: ${rotationGate.reason}`);
492
+ throw new Error(clientStartupRefusalMessage(rotationGate.reason));
493
493
  }
494
494
  const { startClientRuntime } = await import("../client/runtime");
495
495
  // Same lease-held owner recheck as the server path below: this branch binds and publishes too.
@@ -11,7 +11,7 @@
11
11
  import type { HomeCodexSettingsRecord } from "../client/link-home";
12
12
  import { findLiveProxy, probeHostname, type LiveProxy } from "../server/proxy-liveness";
13
13
  import type { ProxyRestartStartOutcome } from "./tray-proxy";
14
- import type { RestartSupervisor } from "./restart-failure";
14
+ import { LEGACY_FLAG_OWNER_ADVICE, type RestartSupervisor } from "./restart-failure";
15
15
 
16
16
  export type ApplyRestartOutcome =
17
17
  | { kind: "current" }
@@ -73,7 +73,9 @@ export function applyRestartMessage(outcome: ApplyRestartOutcome): string {
73
73
  case "restarted": return "Client runtime restarted after applying the Home's settings.";
74
74
  case "deferred-supervisor": return outcome.supervisor === "desktop"
75
75
  ? "Client runtime restart deferred; the settings take effect when OpenCodex Desktop restarts it. Use Quit in the OpenCodex tray menu, then reopen OpenCodex."
76
- : "Client runtime restart deferred; the settings take effect when the background service restarts it. Run `ocx service restart`.";
76
+ : outcome.supervisor === "legacy-flag"
77
+ ? `Client runtime restart deferred; nothing was stopped, and the settings take effect when the runtime restarts. ${LEGACY_FLAG_OWNER_ADVICE}`
78
+ : "Client runtime restart deferred; the settings take effect when the background service restarts it. Run `ocx service restart`.";
77
79
  case "failed": return "The client runtime restart did not complete; the previous runtime keeps serving. If a background service or the desktop app owns it, restart it there; otherwise retry with 'ocx restart' or 'ocx sync'.";
78
80
  }
79
81
  }
@@ -76,7 +76,10 @@ export async function runLinkRoutes(args: string[], deps: LinkCliDeps, request:
76
76
  const code = error.body.error.code;
77
77
  const cause = error.body.error.cause;
78
78
  const known = typeof cause === "string" && ROUTE_CAUSES.has(cause) ? " (" + cause + ")" : "";
79
- const note = code === "routes_stored_reload_failed" ? "; the routes were stored (ocx link routes --link-id " + linkId + " reads them), restart the proxy to apply them" : "";
79
+ const note = code === "routes_stored_reload_failed" ? "; the routes were stored (ocx link routes --link-id " + linkId + " reads them), restart the proxy to apply them"
80
+ // An edit now would leave the removal's copy of the record stale and the link unremovable (#8678).
81
+ : code === "link_retirement_pending" ? "; an unfinished removal holds this link, so its routes cannot change: finish that removal by repeating the revoke that started it (ocx link operations --json shows each entry's linkId), or end it with ocx link revoke --link-id " + linkId + " --force --yes without --operation-id"
82
+ : "";
80
83
  throw new RuntimeApiError("Link routes request refused (" + error.status + "): " + code + known + note, error.status, error.body);
81
84
  }
82
85
  throw error;
package/src/cli/link.ts CHANGED
@@ -698,13 +698,14 @@ const NEXT_STEP: Record<string, string> = {
698
698
  // A resumed owner can meet the same live write failure again and keep its receipt, so a repeat proves nothing: the same id after
699
699
  // the fix, and a new id only through link_retirement_owned's guidance if one is tried.
700
700
  operation_journal_failed: "The journal could not record a step: fix what keeps it from being written (disk space, permissions), then repeat the revoke with the same operation id. If it keeps answering operation_journal_failed, a new operation id can be tried; if that answers link_retirement_owned, this id may still own the removal: follow that answer",
701
- // A stale retirement receipt (the record was edited after a removal claimed it, for example by ocx link routes, which does not
702
- // check for a receipt: #8678) answers link_changed to every revoke, this id's resume included, until the record matches the
703
- // receipt's copy again. A claim that met a changed record (no receipt for this id) is journalled, so this id replays it while a
701
+ // A stale retirement receipt (the record was edited after a removal claimed it) answers link_changed to every revoke, this id's
702
+ // resume included, until the record matches the receipt's copy again. A current Home refuses a route edit while a receipt is
703
+ // outstanding (link_retirement_pending, #8678), so only an older Home's ocx link routes, which did not check, or an edit by
704
+ // hand leaves one stale. A claim that met a changed record (no receipt for this id) is journalled, so this id replays it while a
704
705
  // new id reads the record afresh; a commit that met one leaves this id's receipt, so its repeat resumes the removal and meets
705
706
  // the same comparison. In one runtime a revoke and a route edit hold the same Child-job reservation, so the code never proves
706
707
  // that the link changed while this revoke ran.
707
- link_changed: "The link, or the record of its unfinished removal, no longer matches what this removal started from: read ocx link status, then repeat the revoke with the same operation id. If it answers link_changed again, the link may have been edited after its removal began (for example with ocx link routes). A new operation id can remove it only when no unfinished removal of this link remains; while one remains, no revoke finishes it until the link matches that removal's copy again",
708
+ link_changed: "The link, or the record of its unfinished removal, no longer matches what this removal started from: read ocx link status, then repeat the revoke with the same operation id. If it answers link_changed again, the link was edited after its removal began, by ocx link routes on an older Home that did not refuse route edits during a removal or by hand. A new operation id can remove it only when no unfinished removal of this link remains; while one remains, no revoke finishes it until the link matches that removal's copy again",
708
709
  };
709
710
 
710
711
  /**
@@ -1,4 +1,5 @@
1
1
  import { isValidProviderName } from "../config/provider-name";
2
+ import { oauthCredentialSiblingsOf, oauthCredentialSlot } from "../oauth/credential-siblings";
2
3
  import { runCatalogAction } from "./catalog-command-result";
3
4
  import { CliUsageError, printData, runtimeBaseUrl, runtimeRequest, takeFlag, type RuntimeApiDeps } from "./runtime-api";
4
5
 
@@ -7,6 +8,20 @@ export interface LogoutCommandDeps extends RuntimeApiDeps {
7
8
  removeCredential?: (provider: string) => Promise<"removed" | "not-found">;
8
9
  }
9
10
 
11
+ /**
12
+ * A login shared by several provider rows (#8087: kimi and kimi-responses). Logging out of any of
13
+ * them removes the active account of the one shared slot, so the result names every row it reaches.
14
+ */
15
+ function sharedLogin(provider: string): { slot: string; rows: string[] } | null {
16
+ const slot = oauthCredentialSlot(provider);
17
+ const rows = [slot, ...oauthCredentialSiblingsOf(slot)];
18
+ return rows.length > 1 ? { slot, rows } : null;
19
+ }
20
+
21
+ function sharedLoginLine(shared: { slot: string; rows: string[] }): string {
22
+ return `This removed the active account of the shared ${shared.slot} login, so the ${shared.rows.join(" and ")} rows are both signed out of it. Another stored ${shared.slot} account, if any, is now active for both; neither row uses it while it is paused, and if it needs re-login, log in to it again.`;
23
+ }
24
+
10
25
  /** Explicit target selection precedes all credential access; never fall back between targets. */
11
26
  export async function handleLogoutCommand(argv: string[], deps: LogoutCommandDeps = {}): Promise<number> {
12
27
  return runCatalogAction(async () => {
@@ -17,9 +32,11 @@ export async function handleLogoutCommand(argv: string[], deps: LogoutCommandDep
17
32
  if (!provider || !isValidProviderName(provider) || args.length) {
18
33
  throw new CliUsageError("Expected one provider and no unknown or repeated options.", "Usage: ocx logout <provider> [--live] [--json]");
19
34
  }
35
+ const shared = sharedLogin(provider);
36
+ const sharedFields = shared ? { credentialSlot: shared.slot, affectedRows: shared.rows } : {};
20
37
  if (live) {
21
38
  const { isPublicOAuthProvider } = await import("../oauth");
22
- if (!isPublicOAuthProvider(provider)) throw new CliUsageError("Live logout requires a public OAuth provider; Codex and native-main logout are not supported.");
39
+ if (!isPublicOAuthProvider(oauthCredentialSlot(provider))) throw new CliUsageError("Live logout requires a public OAuth provider; Codex and native-main logout are not supported.");
23
40
  const pinned = { ...deps, baseUrl: await runtimeBaseUrl(deps) };
24
41
  const data = await runtimeRequest<unknown>(`/api/oauth/logout?provider=${encodeURIComponent(provider)}`, {
25
42
  method: "POST", redirect: "error",
@@ -27,18 +44,20 @@ export async function handleLogoutCommand(argv: string[], deps: LogoutCommandDep
27
44
  if (!data || typeof data !== "object" || Array.isArray(data) || (data as Record<string, unknown>).success !== true) {
28
45
  throw new Error("Unverified logout result");
29
46
  }
30
- printData({ schemaVersion: 1, success: true, provider, live: true }, json, [`Logged out of ${provider} on the selected proxy.`]);
47
+ printData({ schemaVersion: 1, success: true, provider, live: true, ...sharedFields }, json,
48
+ [`Logged out of ${provider} on the selected proxy.`, ...(shared ? [sharedLoginLine(shared)] : [])]);
31
49
  return 0;
32
50
  }
33
51
  const remove = deps.removeCredential ?? (await import("../oauth/store")).removeCredential;
34
- const outcome = await remove(provider);
52
+ const outcome = await remove(oauthCredentialSlot(provider));
35
53
  if (outcome === "not-found") {
36
54
  if (json) printData({ schemaVersion: 1, ok: false, provider, removed: false, reason: "not_found" }, true);
37
55
  else console.error(`No stored credential for '${provider}'.`);
38
56
  return 4;
39
57
  }
40
58
  if (outcome !== "removed") throw new Error("Unverified local logout result");
41
- printData({ schemaVersion: 1, ok: true, provider, removed: true }, json, [`Logged out of ${provider}.`]);
59
+ printData({ schemaVersion: 1, ok: true, provider, removed: true, ...sharedFields }, json,
60
+ [`Logged out of ${provider}.`, ...(shared ? [sharedLoginLine(shared)] : [])]);
42
61
  return 0;
43
62
  });
44
63
  }
@@ -8,6 +8,9 @@ export function skipsCodexShimAutoRestore(command: string | undefined, args: str
8
8
  // Reading the bounded link diagnostics file must not repair, harden or create anything first.
9
9
  if (command === "link" && args[1] === "diagnostics") return true;
10
10
  if (command === "update" && isOrchestratedUpdateArgv(args)) return true;
11
+ // The headless Desktop updater validates its installation before anything changes; with or
12
+ // without --json it must not repair a shim first.
13
+ if (command === "update" && args.includes("--desktop")) return true;
11
14
  if (command === "sync") return true;
12
15
  if (command === "status" || command === "doctor") return true;
13
16
  // Explicit orphan-token recovery must not mutate Codex before its guards run.
@@ -16,6 +16,7 @@ import { hasHelpFlag, printSubcommandUsage } from "./help";
16
16
  import { getProviderRegistryEntry, PROVIDER_REGISTRY } from "../providers/registry";
17
17
  import { providerConfigSeed } from "../providers/derive";
18
18
  import { assertAnthropicInstanceLoginConfig } from "../oauth/store-anthropic-instance";
19
+ import { oauthCredentialSlot } from "../oauth/credential-siblings";
19
20
  import { dropProviderCustomModels } from "../providers/provider-id-rewrite";
20
21
  import { cleanupRemovedGcpCredentials, commitProviderGcpCredentialRemoval, providerGcpCredentialMarkers } from "../providers/gcp-credential-cleanup";
21
22
  import { providerCredentialInputError } from "../providers/api-keys";
@@ -281,7 +282,7 @@ async function handleAdd(args: string[], deps: ProviderCommandDeps): Promise<voi
281
282
  if ((authMode ?? registryEntry.authKind) === "forward") {
282
283
  console.warn(`Warning: provider "${name}" uses ChatGPT login (forward auth); --api-key is ignored.`);
283
284
  } else if ((authMode ?? registryEntry.authKind) === "oauth") {
284
- console.warn(`Warning: provider "${name}" uses OAuth auth; --api-key is ignored. Run: ocx login ${name}`);
285
+ console.warn(`Warning: provider "${name}" uses OAuth auth; --api-key is ignored. Run: ocx login ${oauthCredentialSlot(name)}`);
285
286
  } else {
286
287
  provConfig.apiKey = apiKey;
287
288
  }
@@ -452,7 +453,7 @@ async function handleAdd(args: string[], deps: ProviderCommandDeps): Promise<voi
452
453
  for (const line of modelSelectionGuidance(name)) console.log(line);
453
454
  if (setDefault) console.log(` Set as default provider.`);
454
455
  if (registryEntry?.authKind === "oauth") {
455
- console.log(` Authenticate with: ocx login ${name}`);
456
+ console.log(` Authenticate with: ocx login ${oauthCredentialSlot(name)}`);
456
457
  }
457
458
  if (registryEntry?.authKind === "key" && !apiKey) {
458
459
  const envKey = `${name.toUpperCase().replace(/[^A-Z0-9]+/g, "_")}_API_KEY`;
@@ -255,11 +255,12 @@ export const CLI_COMMANDS: CliCommandEntry[] = [
255
255
  },
256
256
  {
257
257
  name: "login",
258
- usage: "ocx login <provider> [--headless]",
258
+ usage: "ocx login <provider> [--headless] [--accept-antigravity-risk]",
259
259
  summary: "OAuth or API-key login for a provider.",
260
260
  details: [
261
261
  "--headless (anthropic, anthropic2): no browser and no local port; approve in any browser and paste the displayed code.",
262
262
  "--headless (xai): device authorization instead of the loopback callback; no local port, confirm the printed short code in any browser, nothing to paste.",
263
+ "google-antigravity: Google can disable the whole Google account for this sign-in. The warning always prints; a terminal must answer y, and a non-interactive run needs --accept-antigravity-risk or is refused. Runs driven by a coding agent or CI are always refused.",
263
264
  "Codex/ChatGPT: ocx login codex runs the Codex account-pool login (same flow as ocx account login codex).",
264
265
  "That one needs a running proxy; the OAuth and API-key providers log in locally.",
265
266
  "'chatgpt' and 'openai' are the same route; an OpenAI platform API key is 'ocx login openai-apikey'.",
@@ -310,11 +311,13 @@ export const CLI_COMMANDS: CliCommandEntry[] = [
310
311
  },
311
312
  {
312
313
  name: "update",
313
- usage: "ocx update [--tag latest|preview] | --plan --json [--tag latest|preview | --version <version>] | --yes --json [--tag latest|preview | --version <version>] [--expect-plan <token>] [--not-after <unix-ms>]",
314
+ usage: "ocx update [--tag latest|preview] | --plan --json [--tag latest|preview | --version <version>] | --yes --json [--tag latest|preview | --version <version>] [--expect-plan <token>] [--not-after <unix-ms>] | --desktop [--check] [--json]",
314
315
  summary: "Update opencodex. Preview installs stay on the preview tag unless overridden.",
315
316
  details: [
316
317
  "--plan --json previews an orchestrated update; --yes --json applies it. --expect-plan binds apply to the returned planToken; --not-after sets a Unix millisecond mutation deadline.",
317
318
  "Orchestrated exit codes: 0 verified or up-to-date; 10 refused; 11 failed with previous version verified; 12 unverified or still running; 64 invalid usage.",
319
+ "--desktop updates a Windows OpenCodex Desktop installation without its window: it verifies the published MSI with the app's updater key, installs it silently and restarts the runtime that still serves the old version. Run it with that installation's ocx.exe from an elevated terminal. --check only reports.",
320
+ "Desktop exit codes: 0 done or up to date; 1 nothing installed; 2 installed but the old runtime still serves (or a reboot is pending); 3 installer outcome uncertain; 64 invalid usage or not a Desktop installation.",
318
321
  ],
319
322
  },
320
323
  {