@indigoai-us/hq-cli 5.345.219 → 5.345.221

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 (199) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/dist/command-catalog.generated.d.ts +169 -3
  3. package/dist/command-catalog.generated.js +206 -3
  4. package/dist/commands/auth.js +4 -1
  5. package/dist/commands/bot-runtime.d.ts +18 -5
  6. package/dist/commands/bot-runtime.js +29 -12
  7. package/dist/commands/bot.d.ts +85 -0
  8. package/dist/commands/bot.js +245 -16
  9. package/dist/commands/cloud.d.ts +16 -0
  10. package/dist/commands/cloud.js +112 -102
  11. package/dist/commands/core-checkpoint-native.d.ts +13 -0
  12. package/dist/commands/core-checkpoint-native.js +167 -52
  13. package/dist/commands/core-hook-registration-plan.js +5 -4
  14. package/dist/commands/core-stop-autosave.d.ts +21 -0
  15. package/dist/commands/core-stop-autosave.js +300 -0
  16. package/dist/commands/core.js +2 -0
  17. package/dist/commands/daemon.d.ts +5 -0
  18. package/dist/commands/daemon.js +52 -9
  19. package/dist/commands/doctor-usage.d.ts +5 -0
  20. package/dist/commands/doctor-usage.js +25 -0
  21. package/dist/commands/env.d.ts +49 -4
  22. package/dist/commands/env.js +355 -5
  23. package/dist/commands/integrations.js +84 -3
  24. package/dist/commands/lanes-shared.d.ts +3 -0
  25. package/dist/commands/lanes.d.ts +3 -0
  26. package/dist/commands/lanes.js +87 -3
  27. package/dist/commands/packs.js +23 -0
  28. package/dist/commands/pkg-update.d.ts +6 -0
  29. package/dist/commands/pkg-update.js +15 -7
  30. package/dist/commands/run.js +55 -45
  31. package/dist/commands/sources.js +4 -3
  32. package/dist/commands/sync-core.d.ts +1 -0
  33. package/dist/commands/sync-core.js +77 -3
  34. package/dist/commands/whoami.js +96 -80
  35. package/dist/lib/bot/config.d.ts +17 -0
  36. package/dist/lib/bot/config.js +13 -0
  37. package/dist/lib/bot/fleet-cron.js +29 -4
  38. package/dist/lib/bot/fleet-local.d.ts +30 -2
  39. package/dist/lib/bot/fleet-local.js +60 -1
  40. package/dist/lib/bot/grok-login-scope.d.ts +36 -0
  41. package/dist/lib/bot/grok-login-scope.js +93 -0
  42. package/dist/lib/bot/inflight.d.ts +9 -0
  43. package/dist/lib/bot/jobs/hot-signal-sync.d.ts +51 -0
  44. package/dist/lib/bot/jobs/hot-signal-sync.js +90 -9
  45. package/dist/lib/bot/legacy-provider-login.d.ts +32 -9
  46. package/dist/lib/bot/legacy-provider-login.js +28 -22
  47. package/dist/lib/bot/run.d.ts +29 -5
  48. package/dist/lib/bot/run.js +203 -1
  49. package/dist/lib/bot/runtime-sign-in-check.js +6 -1
  50. package/dist/lib/bot/runtime-sign-in.d.ts +2 -0
  51. package/dist/lib/bot/signals-try-now.d.ts +76 -0
  52. package/dist/lib/bot/signals-try-now.js +111 -0
  53. package/dist/lib/capacity/collectors/claude-oauth.d.ts +22 -3
  54. package/dist/lib/capacity/collectors/claude-oauth.js +78 -22
  55. package/dist/lib/capacity/scheduler.d.ts +8 -0
  56. package/dist/lib/capacity/scheduler.js +5 -2
  57. package/dist/lib/core-utils/sentry-report.js +2 -0
  58. package/dist/lib/daemon/machine-checks.d.ts +22 -1
  59. package/dist/lib/daemon/machine-checks.js +54 -12
  60. package/dist/lib/daemon/run.js +71 -8
  61. package/dist/lib/daemon/runtime-notifications.d.ts +7 -0
  62. package/dist/lib/daemon/runtime-notifications.js +50 -0
  63. package/dist/lib/daemon/stop-autosave-lock.d.ts +19 -0
  64. package/dist/lib/daemon/stop-autosave-lock.js +166 -0
  65. package/dist/lib/daemon/stop-autosave.d.ts +28 -0
  66. package/dist/lib/daemon/stop-autosave.js +111 -0
  67. package/dist/lib/daemon/stop-diagnostics.d.ts +11 -0
  68. package/dist/lib/daemon/stop-diagnostics.js +136 -0
  69. package/dist/lib/daemon/stop-job-executor.d.ts +19 -0
  70. package/dist/lib/daemon/stop-job-executor.js +126 -0
  71. package/dist/lib/daemon/stop-jobs.d.ts +93 -0
  72. package/dist/lib/daemon/stop-jobs.js +599 -0
  73. package/dist/lib/doctor/checks/fleet-hook-core.d.ts +9 -1
  74. package/dist/lib/doctor/checks/fleet-hook-core.js +39 -15
  75. package/dist/lib/doctor/checks/host-core.js +1 -1
  76. package/dist/lib/environment/access-probes.d.ts +234 -0
  77. package/dist/lib/environment/access-probes.js +918 -0
  78. package/dist/lib/environment/profile.d.ts +15 -2
  79. package/dist/lib/environment/profile.js +55 -20
  80. package/dist/lib/environment/rfc3339.d.ts +8 -0
  81. package/dist/lib/environment/rfc3339.js +26 -0
  82. package/dist/lib/environment/work-requirements.d.ts +169 -0
  83. package/dist/lib/environment/work-requirements.js +389 -0
  84. package/dist/lib/hook-engine/coverage.d.ts +137 -7
  85. package/dist/lib/hook-engine/coverage.js +1424 -4
  86. package/dist/lib/hook-engine/fleet-registration.d.ts +17 -5
  87. package/dist/lib/hook-engine/fleet-registration.js +53 -17
  88. package/dist/lib/hook-engine/git-stop-config.json +513 -0
  89. package/dist/lib/hook-engine/native-stop-compatibility.json +311 -0
  90. package/dist/lib/hook-engine/reconcile.js +2 -2
  91. package/dist/lib/hot-channels/alert.d.ts +10 -1
  92. package/dist/lib/hot-channels/alert.js +38 -8
  93. package/dist/lib/hot-channels/signals-claude-login.d.ts +53 -0
  94. package/dist/lib/hot-channels/signals-claude-login.js +96 -0
  95. package/dist/lib/hot-channels/signals-pass.d.ts +143 -17
  96. package/dist/lib/hot-channels/signals-pass.js +324 -17
  97. package/dist/lib/hot-channels/signals-runtime.d.ts +30 -0
  98. package/dist/lib/hot-channels/signals-runtime.js +82 -0
  99. package/dist/lib/install/hook-target.js +1 -1
  100. package/dist/lib/lanes/host-capacity.d.ts +26 -2
  101. package/dist/lib/lanes/host-capacity.js +17 -2
  102. package/dist/lib/lanes/host-compute.d.ts +90 -0
  103. package/dist/lib/lanes/host-compute.js +185 -0
  104. package/dist/lib/lanes/index.d.ts +2 -0
  105. package/dist/lib/lanes/index.js +1 -0
  106. package/dist/lib/lanes/reconcile.js +22 -1
  107. package/dist/lib/lanes/resource-usage.d.ts +155 -0
  108. package/dist/lib/lanes/resource-usage.js +589 -0
  109. package/dist/lib/lanes/run-size.d.ts +46 -0
  110. package/dist/lib/lanes/run-size.js +197 -0
  111. package/dist/lib/lanes/store.js +27 -0
  112. package/dist/lib/lanes/throttle.d.ts +36 -1
  113. package/dist/lib/lanes/throttle.js +47 -10
  114. package/dist/lib/lanes/types.d.ts +40 -0
  115. package/dist/lib/lanes/types.js +2 -2
  116. package/dist/lib/lanes/watcher.js +13 -4
  117. package/dist/lib/lanes/worker-process.d.ts +25 -2
  118. package/dist/lib/lanes/worker-process.js +71 -19
  119. package/dist/lib/placement/match.d.ts +192 -0
  120. package/dist/lib/placement/match.js +667 -0
  121. package/dist/lib/safe-store.d.ts +14 -0
  122. package/dist/lib/safe-store.js +77 -4
  123. package/dist/lib/search-index/index.d.ts +88 -4
  124. package/dist/lib/search-index/index.js +299 -25
  125. package/dist/lib/search-index/max-doc-bytes.d.ts +17 -6
  126. package/dist/lib/search-index/max-doc-bytes.js +48 -23
  127. package/dist/lib/signals/codex-lockdown.d.ts +79 -0
  128. package/dist/lib/signals/codex-lockdown.js +271 -0
  129. package/dist/lib/signals/codex-login.d.ts +37 -0
  130. package/dist/lib/signals/codex-login.js +83 -0
  131. package/dist/lib/signals/engine.d.ts +28 -0
  132. package/dist/lib/signals/engine.js +77 -0
  133. package/dist/lib/signals/reply.d.ts +48 -0
  134. package/dist/lib/signals/reply.js +94 -12
  135. package/dist/lib/signals/run-record.js +6 -1
  136. package/dist/lib/signals/settings.d.ts +5 -0
  137. package/dist/lib/signals/settings.js +2 -0
  138. package/dist/lib/signals/steps/adapters.js +6 -0
  139. package/dist/lib/signals/steps/extract.d.ts +135 -12
  140. package/dist/lib/signals/steps/extract.js +416 -84
  141. package/dist/lib/signals/steps/types.d.ts +21 -0
  142. package/dist/lib/sync-core/engine-home.d.ts +41 -2
  143. package/dist/lib/sync-core/engine-home.js +132 -19
  144. package/dist/lib/sync-core/reconcile.js +1 -1
  145. package/dist/lib/sync-core/release-compare.d.ts +7 -0
  146. package/dist/lib/sync-core/release-compare.js +16 -0
  147. package/dist/lib/sync-core/release.d.ts +2 -1
  148. package/dist/lib/sync-core/release.js +2 -10
  149. package/dist/lib/sync-core/rollout-state.d.ts +2 -1
  150. package/dist/lib/sync-core/rollout-state.js +5 -2
  151. package/dist/lib/sync-core/vault-uid.d.ts +2 -0
  152. package/dist/lib/sync-core/vault-uid.js +4 -0
  153. package/dist/run/schema-env-overrides.d.ts +24 -0
  154. package/dist/run/schema-env-overrides.js +72 -0
  155. package/dist/schemas/hq-work-requirements.v1.schema.json +145 -0
  156. package/dist/utils/auth-session-check.d.ts +16 -0
  157. package/dist/utils/auth-session-check.js +16 -0
  158. package/dist/utils/client-health-contract.d.ts +6 -0
  159. package/dist/utils/client-health-contract.js +13 -0
  160. package/dist/utils/client-health.d.ts +7 -0
  161. package/dist/utils/client-health.js +22 -1
  162. package/dist/utils/command-usage.d.ts +40 -0
  163. package/dist/utils/command-usage.js +61 -0
  164. package/dist/utils/duplicate-command-usage.d.ts +72 -0
  165. package/dist/utils/duplicate-command-usage.js +125 -0
  166. package/dist/utils/host-registration.d.ts +1 -1
  167. package/dist/utils/host-registration.js +6 -1
  168. package/dist/utils/resident-package-preload.js +4 -0
  169. package/dist/utils/sentry-fingerprint.js +9 -0
  170. package/dist/utils/windows-bash.d.ts +2 -0
  171. package/dist/utils/windows-bash.js +2 -1
  172. package/package.json +15 -10
  173. package/scripts/bench-core-compare.mjs +313 -0
  174. package/scripts/bench-core.mjs +399 -12
  175. package/scripts/check-function-manifest.mjs +121 -7
  176. package/dist/commands/__fixtures__/access-vault.d.ts +0 -95
  177. package/dist/commands/__fixtures__/access-vault.js +0 -166
  178. package/dist/commands/__fixtures__/make-tar.d.ts +0 -38
  179. package/dist/commands/__fixtures__/make-tar.js +0 -102
  180. package/dist/commands/secrets-public-types.test-d.d.ts +0 -2
  181. package/dist/commands/secrets-public-types.test-d.js +0 -18
  182. package/dist/lib/decisions/fixtures/us001.d.ts +0 -137
  183. package/dist/lib/decisions/fixtures/us001.js +0 -21
  184. package/dist/lib/doctor/__testing__/fake-hq-tree.d.ts +0 -226
  185. package/dist/lib/doctor/__testing__/fake-hq-tree.js +0 -408
  186. package/dist/lib/doctor/__testing__/run-doctor.d.ts +0 -8
  187. package/dist/lib/doctor/__testing__/run-doctor.js +0 -69
  188. package/dist/lib/fingerprint/fixtures.d.ts +0 -19
  189. package/dist/lib/fingerprint/fixtures.js +0 -61
  190. package/dist/lib/hot-channels/adapters/__fixtures__/dummy.d.ts +0 -33
  191. package/dist/lib/hot-channels/adapters/__fixtures__/dummy.js +0 -53
  192. package/dist/lib/hot-channels/adapters/__fixtures__/meeting-providers.d.ts +0 -38
  193. package/dist/lib/hot-channels/adapters/__fixtures__/meeting-providers.js +0 -64
  194. package/dist/lib/mesh/live/daemon/mqtt-events.test-d.d.ts +0 -2
  195. package/dist/lib/mesh/live/daemon/mqtt-events.test-d.js +0 -10
  196. package/dist/lib/test-utils/isolated-flag-company-context.d.ts +0 -3
  197. package/dist/lib/test-utils/isolated-flag-company-context.js +0 -18
  198. package/scripts/hook-engine-manifest.mjs +0 -22
  199. package/scripts/mesh-daemon-if-stale.mjs +0 -20
@@ -625,6 +625,11 @@ export const COMMAND_CATALOG = [
625
625
  "flags": "--branch",
626
626
  "description": "Follow the source branch instead of SHA-pinning",
627
627
  "hidden": false
628
+ },
629
+ {
630
+ "flags": "--registry",
631
+ "description": "Update installed registry packages instead (same as `hq packages update [slug]`; [name] is the package slug)",
632
+ "hidden": false
628
633
  }
629
634
  ],
630
635
  "subcommands": []
@@ -791,6 +796,11 @@ export const COMMAND_CATALOG = [
791
796
  "flags": "--branch",
792
797
  "description": "Follow the source branch instead of SHA-pinning",
793
798
  "hidden": false
799
+ },
800
+ {
801
+ "flags": "--registry",
802
+ "description": "Update installed registry packages instead (same as `hq packages update [slug]`; [name] is the package slug)",
803
+ "hidden": false
794
804
  }
795
805
  ],
796
806
  "subcommands": []
@@ -1759,6 +1769,11 @@ export const COMMAND_CATALOG = [
1759
1769
  "flags": "--company <slug>",
1760
1770
  "description": "Also report this company's billing and usage notice",
1761
1771
  "hidden": false
1772
+ },
1773
+ {
1774
+ "flags": "--check",
1775
+ "description": "Exit 1 when there is no usable session, like `hq auth status`",
1776
+ "hidden": false
1762
1777
  }
1763
1778
  ],
1764
1779
  "subcommands": []
@@ -11985,6 +12000,25 @@ export const COMMAND_CATALOG = [
11985
12000
  ],
11986
12001
  "subcommands": []
11987
12002
  },
12003
+ {
12004
+ "name": "stop-autosave",
12005
+ "description": "Drain the typed Stop autosave job",
12006
+ "aliases": [],
12007
+ "hidden": false,
12008
+ "helpOption": true,
12009
+ "helpCommand": false,
12010
+ "usage": "[options]",
12011
+ "helpText": [],
12012
+ "arguments": [],
12013
+ "options": [
12014
+ {
12015
+ "flags": "--session-id <id>",
12016
+ "description": "",
12017
+ "hidden": false
12018
+ }
12019
+ ],
12020
+ "subcommands": []
12021
+ },
11988
12022
  {
11989
12023
  "name": "hook-registration-plan",
11990
12024
  "description": "Print the offline fleet hook registration plan without changing the installation",
@@ -15079,6 +15113,94 @@ export const COMMAND_CATALOG = [
15079
15113
  }
15080
15114
  ],
15081
15115
  "subcommands": []
15116
+ },
15117
+ {
15118
+ "name": "probe",
15119
+ "description": "Run access probes by name and print them as hq-environment-profile.v1 readings.access entries: company vault grant, repos, secrets (exists by HEAD, and resolvable inside hq secrets exec; the value is never printed or stored), integrations and local data (exit 1 when a probe does not pass)",
15120
+ "aliases": [],
15121
+ "hidden": false,
15122
+ "helpOption": true,
15123
+ "helpCommand": false,
15124
+ "usage": "[options]",
15125
+ "helpText": [],
15126
+ "arguments": [],
15127
+ "options": [
15128
+ {
15129
+ "flags": "--company <slug>",
15130
+ "description": "Company whose vault, secrets and integrations are probed (required)",
15131
+ "hidden": false
15132
+ },
15133
+ {
15134
+ "flags": "--repo <name>",
15135
+ "description": "Checkout name under repos/private or repos/public; its origin must answer git ls-remote (repeatable, comma-separated)",
15136
+ "hidden": false
15137
+ },
15138
+ {
15139
+ "flags": "--secret <NAME>",
15140
+ "description": "Secret name to probe: exists, then resolvable by this identity (repeatable, comma-separated)",
15141
+ "hidden": false
15142
+ },
15143
+ {
15144
+ "flags": "--integration <slug>",
15145
+ "description": "App that must be connected and shared with this identity (repeatable, comma-separated)",
15146
+ "hidden": false
15147
+ },
15148
+ {
15149
+ "flags": "--data <path>",
15150
+ "description": "Path relative to the HQ root that must be present and not empty (repeatable, comma-separated)",
15151
+ "hidden": false
15152
+ },
15153
+ {
15154
+ "flags": "--agent",
15155
+ "description": "Also run hq agent probe (identity, vault, presence, DMs); it sends a self-DM and reports to the console",
15156
+ "hidden": false
15157
+ },
15158
+ {
15159
+ "flags": "--write-profile <file>",
15160
+ "description": "Store the readings in this profile's readings.access, replacing entries with the same names; the profile must validate afterwards",
15161
+ "hidden": false
15162
+ },
15163
+ {
15164
+ "flags": "--json",
15165
+ "description": "Print the result as JSON",
15166
+ "hidden": false
15167
+ }
15168
+ ],
15169
+ "subcommands": []
15170
+ },
15171
+ {
15172
+ "name": "match",
15173
+ "description": "First ranking of environments for one piece of work: rules R1-R9 with one reason per rejection, then scores (read-only; not a placement, the conductor engine chooses)",
15174
+ "aliases": [],
15175
+ "hidden": false,
15176
+ "helpOption": true,
15177
+ "helpCommand": false,
15178
+ "usage": "[options]",
15179
+ "helpText": [],
15180
+ "arguments": [],
15181
+ "options": [
15182
+ {
15183
+ "flags": "--requirements <file>",
15184
+ "description": "hq-work-requirements.v1 JSON file",
15185
+ "hidden": false
15186
+ },
15187
+ {
15188
+ "flags": "--profiles <dir>",
15189
+ "description": "Directory of hq-environment-profile.v1 JSON files (every *.json in it, not recursive)",
15190
+ "hidden": false
15191
+ },
15192
+ {
15193
+ "flags": "--now <date-time>",
15194
+ "description": "Match time every reading is aged against (RFC 3339; default: the current time)",
15195
+ "hidden": false
15196
+ },
15197
+ {
15198
+ "flags": "--json",
15199
+ "description": "Print the result as JSON",
15200
+ "hidden": false
15201
+ }
15202
+ ],
15203
+ "subcommands": []
15082
15204
  }
15083
15205
  ]
15084
15206
  },
@@ -15180,6 +15302,16 @@ export const COMMAND_CATALOG = [
15180
15302
  "flags": "--json",
15181
15303
  "description": "Emit the counts as JSON.",
15182
15304
  "hidden": false
15305
+ },
15306
+ {
15307
+ "flags": "--duplicates",
15308
+ "description": "List only the duplicate commands and their runs in the window; exit 0 when none ran, 1 when one did, 2 when the count cannot be read.",
15309
+ "hidden": false
15310
+ },
15311
+ {
15312
+ "flags": "--since <window>",
15313
+ "description": "Window for --duplicates: Nh or Nd, at most 29d (default 1d). Counts are per UTC date, so whole dates are counted.",
15314
+ "hidden": false
15183
15315
  }
15184
15316
  ],
15185
15317
  "subcommands": []
@@ -23153,7 +23285,7 @@ export const COMMAND_CATALOG = [
23153
23285
  },
23154
23286
  {
23155
23287
  "name": "status",
23156
- "description": "Show sync ownership, heartbeat, last pass and log path",
23288
+ "description": "Show sync ownership, heartbeat, last pass and log path (--local: the local sync journal summary)",
23157
23289
  "aliases": [],
23158
23290
  "hidden": false,
23159
23291
  "helpOption": true,
@@ -23166,6 +23298,26 @@ export const COMMAND_CATALOG = [
23166
23298
  "flags": "--json",
23167
23299
  "description": "Print machine-readable JSON",
23168
23300
  "hidden": false
23301
+ },
23302
+ {
23303
+ "flags": "--local",
23304
+ "description": "Show the local sync journal summary (what `hq sync status` prints) instead of the daemon's state",
23305
+ "hidden": false
23306
+ },
23307
+ {
23308
+ "flags": "--hq-root <path>",
23309
+ "description": "With --local: local HQ tree root",
23310
+ "hidden": false
23311
+ },
23312
+ {
23313
+ "flags": "--company <slug>",
23314
+ "description": "With --local: show only this company's journal (company slug)",
23315
+ "hidden": false
23316
+ },
23317
+ {
23318
+ "flags": "--all",
23319
+ "description": "With --local: list every local-only file instead of the first 20 per company",
23320
+ "hidden": false
23169
23321
  }
23170
23322
  ],
23171
23323
  "subcommands": []
@@ -23303,9 +23455,28 @@ export const COMMAND_CATALOG = [
23303
23455
  "arguments": [],
23304
23456
  "options": [],
23305
23457
  "subcommands": [
23458
+ {
23459
+ "name": "list",
23460
+ "description": "List every membership's company and current sync mode (same table as `hq sync mode --show`)",
23461
+ "aliases": [],
23462
+ "hidden": false,
23463
+ "helpOption": true,
23464
+ "helpCommand": false,
23465
+ "usage": "[options]",
23466
+ "helpText": [],
23467
+ "arguments": [],
23468
+ "options": [
23469
+ {
23470
+ "flags": "--json",
23471
+ "description": "Print machine-readable JSON",
23472
+ "hidden": false
23473
+ }
23474
+ ],
23475
+ "subcommands": []
23476
+ },
23306
23477
  {
23307
23478
  "name": "get",
23308
- "description": "Read a company's current all/shared sync mode",
23479
+ "description": "Read a company's current sync mode",
23309
23480
  "aliases": [],
23310
23481
  "hidden": false,
23311
23482
  "helpOption": true,
@@ -23331,7 +23502,7 @@ export const COMMAND_CATALOG = [
23331
23502
  },
23332
23503
  {
23333
23504
  "name": "set",
23334
- "description": "Set a company's sync mode to all or shared",
23505
+ "description": "Set a company's sync mode to shared, all or custom",
23335
23506
  "aliases": [],
23336
23507
  "hidden": false,
23337
23508
  "helpOption": true,
@@ -23353,6 +23524,11 @@ export const COMMAND_CATALOG = [
23353
23524
  }
23354
23525
  ],
23355
23526
  "options": [
23527
+ {
23528
+ "flags": "--paths <csv>",
23529
+ "description": "Comma-separated allowed prefixes (required when mode is 'custom')",
23530
+ "hidden": false
23531
+ },
23356
23532
  {
23357
23533
  "flags": "--json",
23358
23534
  "description": "Print machine-readable JSON",
@@ -24617,6 +24793,17 @@ export const COMMAND_CATALOG = [
24617
24793
  "description": "Brain: claude, codex (or chatgpt) or grok",
24618
24794
  "hidden": false
24619
24795
  },
24796
+ {
24797
+ "flags": "--kind <kind>",
24798
+ "description": "The bot the answer is for: personal (default) or company",
24799
+ "hidden": false
24800
+ },
24801
+ {
24802
+ "flags": "--company <slug>",
24803
+ "description": "The company of a company bot (repeatable); a Grok login is reused only within one company",
24804
+ "hidden": false,
24805
+ "defaultValue": []
24806
+ },
24620
24807
  {
24621
24808
  "flags": "--json",
24622
24809
  "description": "Print machine-readable JSON: { provider, signedIn, source }",
@@ -24641,6 +24828,17 @@ export const COMMAND_CATALOG = [
24641
24828
  "description": "Brain: codex (or chatgpt) or grok",
24642
24829
  "hidden": false
24643
24830
  },
24831
+ {
24832
+ "flags": "--kind <kind>",
24833
+ "description": "The bot the sign-in is for: personal (default) or company",
24834
+ "hidden": false
24835
+ },
24836
+ {
24837
+ "flags": "--company <slug>",
24838
+ "description": "The company of a company bot (repeatable)",
24839
+ "hidden": false,
24840
+ "defaultValue": []
24841
+ },
24644
24842
  {
24645
24843
  "flags": "--json",
24646
24844
  "description": "Print one JSON line per event (device code, messages) and a final result",
@@ -24785,6 +24983,11 @@ export const COMMAND_CATALOG = [
24785
24983
  "description": "Thinking level (claude low|medium|high|xhigh|max; codex minimal|low|medium|high|xhigh; grok low|medium|high|xhigh), or default (medium)",
24786
24984
  "hidden": false
24787
24985
  },
24986
+ {
24987
+ "flags": "--signals-runtime <bot|claude>",
24988
+ "description": "Where hot-channel signals run: bot (the Executive Codex bot's own Codex) or claude (Claude Code, the default). Set on the Executive bot; local to this computer, from the next sync",
24989
+ "hidden": false
24990
+ },
24788
24991
  {
24789
24992
  "flags": "--json",
24790
24993
  "description": "Print machine-readable JSON",
@@ -18,6 +18,7 @@
18
18
  */
19
19
  import { loginWithBrowserPreference } from "../utils/login-browser.js";
20
20
  import { formatAuthExpiry } from "../utils/auth-expiry.js";
21
+ import { authStatusExitCode } from "../utils/auth-session-check.js";
21
22
  import { releaseCurrentPackageUseLease, releasePackageUseLeaseAfterResidentPreload } from "../utils/package-use-lease.js";
22
23
  import { preloadResidentPackageModules, reportResidentPackagePreloadFailure } from "../utils/resident-package-preload.js";
23
24
  import * as fs from "node:fs";
@@ -414,6 +415,8 @@ export function registerAuthCommands(program) {
414
415
  // machine cache was valid, and could show a stale person session as the
415
416
  // machine one.
416
417
  const cached = machine ? loadMachineCachedTokens() : loadCachedTokens();
418
+ // Shared with `hq whoami --check`, so both give the same exit status.
419
+ const exitCode = authStatusExitCode({ tokenSource, cached });
417
420
  if (!cached) {
418
421
  if (machine) {
419
422
  // No cached session yet, but machine creds mint one on demand —
@@ -424,7 +427,7 @@ export function registerAuthCommands(program) {
424
427
  }
425
428
  console.log(chalk.yellow("No cached HQ session — run `hq login`"));
426
429
  console.log(chalk.dim(`token source: ${tokenSource}`));
427
- process.exit(1);
430
+ process.exit(exitCode);
428
431
  }
429
432
  const claims = peekIdToken(cached.idToken);
430
433
  const who = machine
@@ -1,8 +1,7 @@
1
1
  import { type ClaudeLoginCheck } from "../lib/bot/claude-login.js";
2
2
  import { fleetRuntimeReady, type FleetInstallProgress, type FleetInstallProgressListener, type FleetLocalTargetRelease } from "../lib/bot/fleet-local.js";
3
3
  import { installedFleetPython } from "../lib/bot/fleet-python.js";
4
- import { type FleetSignInHereDeps, type FleetSignInProvider } from "../lib/bot/legacy-provider-login.js";
5
- import type { LegacyProviderLogin } from "../lib/bot/legacy-convert.js";
4
+ import { type BotLoginScope, type FleetSignInHereDeps, type FleetSignInProvider, type GrokLoginProbeAsyncDeps, type GrokSiblingLogin } from "../lib/bot/legacy-provider-login.js";
6
5
  export type FleetProgressMode = "text" | "json" | "silent";
7
6
  interface ProgressOutput {
8
7
  write(text: string): void;
@@ -48,19 +47,33 @@ export interface BrainSignInStatus {
48
47
  provider: BrainProvider;
49
48
  signedIn: boolean;
50
49
  source: BrainLoginSource | null;
50
+ /**
51
+ * Grok only: another bot on this computer holds, or may hold, a Grok
52
+ * sign-in of a different or unknown company, so none is reused. The text
53
+ * says which.
54
+ */
55
+ blocked?: string;
51
56
  }
52
57
  export interface BrainSignInDeps extends FleetSignInHereDeps {
53
58
  target?: () => Promise<FleetLocalTargetRelease>;
54
59
  claudeLogin?: () => ClaudeLoginCheck;
55
- grokSiblings?: () => Promise<LegacyProviderLogin>;
60
+ grokSiblings?: () => Promise<GrokSiblingLogin>;
61
+ /** Seams for the scan of the other Fleet bots' Grok sign-ins. */
62
+ grokProbe?: GrokLoginProbeAsyncDeps;
56
63
  }
57
64
  export declare function parseBrainProvider(value: string): BrainProvider;
58
65
  export declare function parseFleetSignInProvider(value: string): FleetSignInProvider;
59
66
  export declare function brainSignInStatus(provider: BrainProvider, deps?: BrainSignInDeps): Promise<BrainSignInStatus>;
67
+ /** Which bot auth-status and sign-in answer for: a company bot of --company, else a personal bot, as create defaults. */
68
+ export interface BrainScopeOptions {
69
+ kind?: string;
70
+ company?: string[];
71
+ }
72
+ export declare function brainLoginScope(opts: BrainScopeOptions): BotLoginScope;
60
73
  export declare function runBotAuthStatus(opts: {
61
74
  provider: string;
62
75
  json?: boolean;
63
- }, deps?: BrainSignInDeps): Promise<(BrainSignInStatus & {
76
+ } & BrainScopeOptions, deps?: BrainSignInDeps): Promise<(BrainSignInStatus & {
64
77
  ok: true;
65
78
  }) | {
66
79
  ok: false;
@@ -87,7 +100,7 @@ export declare function runBotSignIn(opts: {
87
100
  provider: string;
88
101
  json?: boolean;
89
102
  browser?: boolean;
90
- }, deps?: BotSignInDeps): Promise<BrainSignInStatus & {
103
+ } & BrainScopeOptions, rawDeps?: BotSignInDeps): Promise<BrainSignInStatus & {
91
104
  ok: boolean;
92
105
  reason?: string;
93
106
  }>;
@@ -1,6 +1,5 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import * as fs from "node:fs";
3
- import * as os from "node:os";
4
3
  import * as path from "node:path";
5
4
  import { stripVTControlCharacters } from "node:util";
6
5
  import chalk from "chalk";
@@ -11,7 +10,8 @@ import { cachedFleetLocalTargetRelease, ensureFleetRuntimeInstalled, fleetLocalD
11
10
  import { installedFleetPython } from "../lib/bot/fleet-python.js";
12
11
  import { createInstallProgressTracker } from "../lib/bot/install-progress.js";
13
12
  import { botCreateEstimate } from "../lib/bot/readiness.js";
14
- import { fleetSignInReusableHere, grokCliLoginReadable, grokLoginReadableHereAsync, } from "../lib/bot/legacy-provider-login.js";
13
+ import { fleetSignInReusableHere, grokLoginReadableHereAsync, newBotLoginScope, } from "../lib/bot/legacy-provider-login.js";
14
+ import { normalizeBotCompanies } from "../lib/bot/config.js";
15
15
  function megabytes(bytes) {
16
16
  return `${(bytes / 1_048_576).toFixed(1)} MB`;
17
17
  }
@@ -182,20 +182,29 @@ export async function brainSignInStatus(provider, deps = {}) {
182
182
  }
183
183
  let grok = deps.grok;
184
184
  if (provider === "grok" && !grok) {
185
- const cli = (deps.grokCli ?? (() => grokCliLoginReadable(deps.homedir ?? os.homedir(), deps.env ?? process.env)))();
186
- if (!(grokCliImport && cli.readable)) {
187
- const siblings = await (deps.grokSiblings ?? (() => grokLoginReadableHereAsync("")))();
188
- grok = () => siblings;
189
- }
185
+ // Always asked, even with a Grok CLI login: the helper copies another bot's login before it reads the Grok CLI's.
186
+ const siblings = await (deps.grokSiblings ?? (() => grokLoginReadableHereAsync("", { ...deps.grokProbe, scope: deps.scope ?? null })))();
187
+ grok = () => siblings;
190
188
  }
191
- const { target: _target, claudeLogin: _claudeLogin, grokSiblings: _grokSiblings, ...hereDeps } = deps;
189
+ const { target: _target, claudeLogin: _claudeLogin, grokSiblings: _grokSiblings, grokProbe: _grokProbe, ...hereDeps } = deps;
192
190
  const login = fleetSignInReusableHere(provider, { ...hereDeps, ...(grok ? { grok } : {}), ...(grokCliImport !== undefined ? { grokCliImport } : {}) });
193
191
  if (!login.readable)
194
- return { provider, signedIn: false, source: null };
192
+ return { provider, signedIn: false, source: null, ...(login.blocked ? { blocked: login.detail } : {}) };
195
193
  const source = provider === "chatgpt" ? "codex-cli" : login.detail.startsWith("Grok CLI login") ? "grok-cli" : "fleet-bot";
196
194
  return { provider, signedIn: true, source };
197
195
  }
198
196
  const BRAIN_NAMES = { claude: "Claude", chatgpt: "ChatGPT", grok: "Grok" };
197
+ export function brainLoginScope(opts) {
198
+ const kind = opts.kind?.trim().toLowerCase();
199
+ if (kind !== undefined && kind !== "personal" && kind !== "company") {
200
+ throw Object.assign(new Error(`--kind must be personal or company, not ${opts.kind}.`), { expected: true });
201
+ }
202
+ const companies = normalizeBotCompanies(opts.company);
203
+ if (kind === "personal" && companies.length) {
204
+ throw Object.assign(new Error("--company only applies to a company bot; drop it or use --kind company."), { expected: true });
205
+ }
206
+ return newBotLoginScope(kind === "company" || companies.length ? "company" : "personal", companies);
207
+ }
199
208
  export async function runBotAuthStatus(opts, deps = {}) {
200
209
  let provider;
201
210
  try {
@@ -209,7 +218,7 @@ export async function runBotAuthStatus(opts, deps = {}) {
209
218
  process.exitCode = 1;
210
219
  return failure;
211
220
  }
212
- const status = { ...(await brainSignInStatus(provider, deps)), ok: true };
221
+ const status = { ...(await brainSignInStatus(provider, { scope: brainLoginScope(opts), ...deps })), ok: true };
213
222
  if (opts.json) {
214
223
  console.log(JSON.stringify(status));
215
224
  return status;
@@ -217,7 +226,9 @@ export async function runBotAuthStatus(opts, deps = {}) {
217
226
  const name = BRAIN_NAMES[status.provider];
218
227
  console.log(status.signedIn
219
228
  ? `A new ${name} bot signs in with the ${name} login already on this computer.`
220
- : `A new ${name} bot needs a ${name} sign-in first (hq bot sign-in --provider ${status.provider}).`);
229
+ : status.blocked
230
+ ? `A new ${name} bot cannot reuse a ${name} login on this computer: ${status.blocked}.`
231
+ : `A new ${name} bot needs a ${name} sign-in first (hq bot sign-in --provider ${status.provider}).`);
221
232
  return status;
222
233
  }
223
234
  function onTerminate(cancel) {
@@ -302,8 +313,9 @@ function forEachLine(stream, onLine) {
302
313
  stream.on("error", () => resolve());
303
314
  });
304
315
  }
305
- export async function runBotSignIn(opts, deps = {}) {
316
+ export async function runBotSignIn(opts, rawDeps = {}) {
306
317
  const brain = parseBrainProvider(opts.provider);
318
+ const deps = { scope: brainLoginScope(opts), ...rawDeps };
307
319
  const emit = deps.emit ?? ((line) => { process.stdout.write(`${line}\n`); });
308
320
  const write = deps.write ?? ((text) => { process.stderr.write(text); });
309
321
  const finish = (result) => {
@@ -321,6 +333,11 @@ export async function runBotSignIn(opts, deps = {}) {
321
333
  const before = await brainSignInStatus(brain, deps);
322
334
  if (before.signedIn)
323
335
  return finish({ ...before, ok: true });
336
+ if (before.blocked) {
337
+ // A Grok CLI login would not help: the helper copies the other bot's login first.
338
+ process.exitCode = 1;
339
+ return finish({ ...before, ok: false, reason: "grok-login-held-back" });
340
+ }
324
341
  const { cli, browser, device } = BRAIN_SIGN_IN_CLI[brain];
325
342
  const args = opts.browser === false ? device : browser;
326
343
  const executable = (deps.findCli ?? ((name) => findCliOnPath(name)))(cli);
@@ -1,4 +1,7 @@
1
1
  import { type LegacyMoveState, type LegacyProviderLoginProbe } from "../lib/bot/legacy-convert.js";
2
+ import { type GrokSiblingLogin } from "../lib/bot/legacy-provider-login.js";
3
+ import { type BotSignalsRuntimeSetting } from "../lib/bot/config.js";
4
+ import { type ClaudeLoginNow, type SignalsClaudeLogin } from "../lib/hot-channels/signals-claude-login.js";
2
5
  import { Command } from "commander";
3
6
  import { type ExecutiveBot } from "../lib/bot/executive.js";
4
7
  import { waitForGatewayReady, type BotReadiness, type ReadyWaitResult } from "../lib/bot/readiness.js";
@@ -70,6 +73,26 @@ export interface BotRow {
70
73
  runtimeSignedIn: boolean | null;
71
74
  /** The terminal command that signs the bot's coding tool in on this computer. */
72
75
  signInCommand: string;
76
+ /**
77
+ * The Claude Code login the hot-channel signals pass needs, which can differ
78
+ * from the bot's own runtime login (a Codex bot runs signals on Claude Code
79
+ * until it opts in with `hq bot set <name> --signals-runtime bot`). Only for
80
+ * a bot with the hot-signal-sync job whose signals run on Claude Code; null
81
+ * otherwise, including a Codex bot whose signals run on Codex.
82
+ */
83
+ signalsClaudeSignIn: SignalsClaudeSignIn | null;
84
+ /**
85
+ * The tool the hot-channel signals pass runs on for this bot: "claude", or
86
+ * "codex" for a Codex bot that opted in (its sign-in is `runtimeSignedIn`).
87
+ * Null for a bot without the hot-signal-sync job.
88
+ */
89
+ signalsRuntime: "claude" | "codex" | null;
90
+ /**
91
+ * When `signalsRuntime` is "codex": the CODEX_HOME the pass uses, from the
92
+ * same function the pass reads (signalsCodexLogin), so status and pass name
93
+ * one login. Null otherwise, or when that login is not usable.
94
+ */
95
+ signalsCodexHome: string | null;
73
96
  /**
74
97
  * Set when the bot cannot run until its model provider is signed in, on any
75
98
  * engine: a Fleet bot never signed in or whose last turn failed on auth, a
@@ -161,6 +184,58 @@ export declare function ownerSignInAllowed(): boolean;
161
184
  * sign-out, and the next start checks afresh.
162
185
  */
163
186
  export declare function runtimeSignedIn(status: Pick<BotStatusFile, "runtimeSignIn" | "runtimeSignInCheck"> | null | undefined, processAlive: boolean): boolean | null;
187
+ export interface SignalsClaudeSignIn {
188
+ /** The companies this bot runs the hot-signal-sync job for. */
189
+ companies: string[];
190
+ /**
191
+ * Whether Claude Code is signed in for signals: the live check when it
192
+ * answered, else what the last signals pass saw; null when neither knows.
193
+ */
194
+ signedIn: boolean | null;
195
+ /** Where `signedIn` came from. */
196
+ basis: "live" | "last-signals-pass" | "none";
197
+ /** This status call's `claude auth status` (once per call); null when it was not run. */
198
+ liveCheck: ClaudeLoginNow | null;
199
+ /** What the last signals pass saw (secondary context); null when none was recorded. */
200
+ lastSignalsPass: {
201
+ signedIn: boolean;
202
+ checkedAt: string;
203
+ signedOutSince: string | null;
204
+ } | null;
205
+ /** The last signals pass's record time; kept with `source` and `signedOutSince` for older readers. */
206
+ checkedAt: string | null;
207
+ source: SignalsClaudeLogin["source"] | null;
208
+ /** While the last signals pass saw it signed out: since when. */
209
+ signedOutSince: string | null;
210
+ /** Set when Claude is signed in now but the last signals pass failed signed out. */
211
+ queuedDocsHint: string | null;
212
+ /** Where to sign in: the HQ app first, the terminal command as the fallback. */
213
+ fix: string;
214
+ command: string;
215
+ }
216
+ /** The live check `hq bot status` / `list` run once per call. Tests replace it. */
217
+ export declare const signalsClaudeSeams: {
218
+ check: () => Promise<ClaudeLoginNow>;
219
+ };
220
+ /**
221
+ * `signalsClaudeSignIn` for a row, for a bot with the hot-signal-sync job:
222
+ * the live check when given and it answered, the last signals pass's record
223
+ * as secondary context and as the fallback. Never runs `claude` itself.
224
+ */
225
+ export declare function signalsClaudeSignInFor(dir: string, fleet: boolean, record?: SignalsClaudeLogin | null, live?: ClaudeLoginNow | null): SignalsClaudeSignIn | null;
226
+ /** The status lines for the Claude Code login signals needs: the answer first, the last signals pass as context. */
227
+ export declare function signalsClaudeSignInLines(s: SignalsClaudeSignIn): string[];
228
+ /**
229
+ * The tool the signals pass runs on for a bot with the hot-signal-sync job
230
+ * (null without the job): the Executive bot's choice, as in the pass.
231
+ */
232
+ export declare function signalsRuntimeFor(dir: string, fleet: boolean): "claude" | "codex" | null;
233
+ /** The Codex login the pass uses when signals run on Codex (signalsCodexLogin), else null. */
234
+ export declare function signalsCodexHomeFor(dir: string, fleet: boolean): string | null;
235
+ /** Why the Executive bot's Codex login cannot run signals, when signals are set to run on it; else null. */
236
+ export declare function signalsCodexRefusalFor(dir: string, fleet: boolean): string | null;
237
+ /** The status line for a bot whose signals run on its own Codex: the bot's own sign-in answer. */
238
+ export declare function signalsCodexRuntimeLine(companies: readonly string[], runtimeSignedIn: boolean | null): string;
164
239
  export interface BrainSignIn {
165
240
  provider: BotRuntimeId;
166
241
  needed: true;
@@ -208,6 +283,8 @@ export declare const botCreateSeams: {
208
283
  claudeLogin: () => ClaudeLoginCheck;
209
284
  brainSignIn: typeof brainSignInStatus;
210
285
  importBrainLogin: (agentUid: string, runtime: "codex" | "grok") => void;
286
+ /** The same question the helper call asks itself: would a Grok account sign-in for this bot copy a login it may not share? */
287
+ grokSiblingLogin: (config: BotConfig) => GrokSiblingLogin;
211
288
  runtimeStatus: typeof fleetRuntimeStatus;
212
289
  installRuntime: typeof ensureFleetRuntimeInstalled;
213
290
  waitForReady: typeof waitForGatewayReady;
@@ -311,6 +388,8 @@ export interface BotSetOptions {
311
388
  model?: string;
312
389
  effort?: string;
313
390
  displayName?: string;
391
+ /** "bot": a Codex bot runs hot-channel signals on its own Codex; "claude" (the default): on Claude Code. */
392
+ signalsRuntime?: string;
314
393
  json?: boolean;
315
394
  }
316
395
  export interface BotSetDeps {
@@ -334,6 +413,12 @@ export interface BotSetDeps {
334
413
  };
335
414
  }
336
415
  export declare function runBotSet(nameArg: string, opts: BotSetOptions, deps?: BotSetDeps): Promise<void>;
416
+ /**
417
+ * `--signals-runtime`: "bot" only for a Codex bot (a Claude bot already runs
418
+ * signals on Claude Code, and Grok has no isolated signals call yet);
419
+ * "claude" for any bot.
420
+ */
421
+ export declare function validateSignalsRuntimeSetting(runtime: BotRuntimeId, value: string): BotSignalsRuntimeSetting;
337
422
  /** switch-account's test turn: short, so probe, stop, start and a rollback fit the desktop's 5-minute budget. */
338
423
  export declare const SWITCH_ACCOUNT_PROBE_TIMEOUT_MS = 60000;
339
424
  export interface BotSwitchAccountOptions {