@indigoai-us/hq-cli 5.345.215-beta.0 → 5.345.217

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 (241) hide show
  1. package/CHANGELOG.md +206 -1
  2. package/README.md +45 -0
  3. package/assets/scaffold/core/scripts/hq-delegate-verify.sh +5 -2
  4. package/assets/scaffold/core/scripts/lib/epochrealtime.sh +30 -0
  5. package/assets/scaffold/core/scripts/lib/work-mesh-enqueue.sh +12 -5
  6. package/dist/command-catalog.generated.d.ts +105 -10
  7. package/dist/command-catalog.generated.js +127 -10
  8. package/dist/command-help.js +3 -1
  9. package/dist/command-registration-plan.d.ts +6 -0
  10. package/dist/command-registration-plan.js +1 -0
  11. package/dist/commands/auth.d.ts +1 -1
  12. package/dist/commands/auth.js +11 -52
  13. package/dist/commands/bot.js +75 -10
  14. package/dist/commands/capacity.d.ts +4 -1
  15. package/dist/commands/capacity.js +46 -10
  16. package/dist/commands/cloud-demote.d.ts +19 -4
  17. package/dist/commands/cloud-demote.js +85 -12
  18. package/dist/commands/cloud-provision.d.ts +5 -1
  19. package/dist/commands/cloud-provision.js +6 -2
  20. package/dist/commands/cloud.d.ts +36 -0
  21. package/dist/commands/cloud.js +110 -27
  22. package/dist/commands/core-delegate-w1b.js +15 -1
  23. package/dist/commands/core-policy.js +67 -8
  24. package/dist/commands/core.js +1 -0
  25. package/dist/commands/daemon.js +9 -1
  26. package/dist/commands/dm.js +7 -0
  27. package/dist/commands/doctor-usage.d.ts +8 -0
  28. package/dist/commands/doctor-usage.js +20 -0
  29. package/dist/commands/doctor.js +7 -1
  30. package/dist/commands/env.d.ts +18 -0
  31. package/dist/commands/env.js +82 -0
  32. package/dist/commands/files-browse.d.ts +11 -4
  33. package/dist/commands/files-browse.js +21 -4
  34. package/dist/commands/files.d.ts +1 -1
  35. package/dist/commands/files.js +25 -11
  36. package/dist/commands/install-global.js +2 -2
  37. package/dist/commands/integrations-auth-rules.d.ts +27 -0
  38. package/dist/commands/integrations-auth-rules.js +79 -0
  39. package/dist/commands/integrations-import.js +124 -12
  40. package/dist/commands/lanes.js +102 -26
  41. package/dist/commands/logout.d.ts +7 -0
  42. package/dist/commands/logout.js +41 -34
  43. package/dist/commands/mesh.d.ts +2 -0
  44. package/dist/commands/mesh.js +60 -35
  45. package/dist/commands/sources.d.ts +8 -2
  46. package/dist/commands/sources.js +65 -9
  47. package/dist/commands/sync-held.js +5 -2
  48. package/dist/commands/whoami.js +26 -1
  49. package/dist/data/command-states.json +15 -0
  50. package/dist/index.js +52 -4
  51. package/dist/lazy-commands.js +5 -6
  52. package/dist/lib/anywhere-person-setting.d.ts +2 -0
  53. package/dist/lib/anywhere-person-setting.js +6 -3
  54. package/dist/lib/billing/usage-card.d.ts +25 -4
  55. package/dist/lib/billing/usage-card.js +76 -9
  56. package/dist/lib/billing/usage-cost.d.ts +3 -3
  57. package/dist/lib/billing/usage-cost.js +35 -13
  58. package/dist/lib/billing/usage-only.js +4 -2
  59. package/dist/lib/billing/usage-rate-card.d.ts +2 -2
  60. package/dist/lib/billing/usage-rate-card.js +3 -0
  61. package/dist/lib/bot/fleet-cron.d.ts +8 -0
  62. package/dist/lib/bot/fleet-cron.js +126 -7
  63. package/dist/lib/bot/fleet-daemon.d.ts +46 -0
  64. package/dist/lib/bot/fleet-daemon.js +99 -1
  65. package/dist/lib/bot/inflight.d.ts +9 -0
  66. package/dist/lib/bot/inflight.js +10 -0
  67. package/dist/lib/bot/jobs/hot-signal-sync.js +12 -1
  68. package/dist/lib/bot/probe.js +7 -1
  69. package/dist/lib/bot/run.js +20 -1
  70. package/dist/lib/bot/runtime/codex.js +1 -1
  71. package/dist/lib/bot/runtime/grok-acp.d.ts +6 -1
  72. package/dist/lib/bot/runtime/grok-acp.js +32 -14
  73. package/dist/lib/bot/runtime/grok.js +1 -1
  74. package/dist/lib/bot/runtime/index.js +19 -9
  75. package/dist/lib/bot/runtime/messages-stream.js +2 -2
  76. package/dist/lib/bot/runtime/types.d.ts +15 -0
  77. package/dist/lib/bot/runtime/types.js +9 -0
  78. package/dist/lib/bot/runtime-failure.d.ts +23 -0
  79. package/dist/lib/bot/runtime-failure.js +43 -1
  80. package/dist/lib/capacity/accounts.d.ts +8 -0
  81. package/dist/lib/capacity/accounts.js +19 -0
  82. package/dist/lib/capacity/available.d.ts +154 -0
  83. package/dist/lib/capacity/available.js +905 -0
  84. package/dist/lib/capacity/codex-availability.d.ts +14 -1
  85. package/dist/lib/capacity/codex-availability.js +26 -1
  86. package/dist/lib/capacity/collectors/claude-oauth.d.ts +29 -2
  87. package/dist/lib/capacity/collectors/claude-oauth.js +104 -7
  88. package/dist/lib/capacity/collectors/codex.js +10 -7
  89. package/dist/lib/capacity/ledger.d.ts +37 -1
  90. package/dist/lib/capacity/ledger.js +207 -30
  91. package/dist/lib/capacity/project.d.ts +26 -0
  92. package/dist/lib/capacity/project.js +137 -8
  93. package/dist/lib/capacity/refusal-rows.d.ts +31 -0
  94. package/dist/lib/capacity/refusal-rows.js +61 -0
  95. package/dist/lib/capacity/refusal.d.ts +53 -2
  96. package/dist/lib/capacity/refusal.js +284 -65
  97. package/dist/lib/capacity/route.js +46 -11
  98. package/dist/lib/capacity/widget.d.ts +12 -1
  99. package/dist/lib/capacity/widget.js +91 -3
  100. package/dist/lib/daemon/flag-monitor.d.ts +8 -0
  101. package/dist/lib/daemon/flag-monitor.js +17 -6
  102. package/dist/lib/daemon/flag.d.ts +65 -1
  103. package/dist/lib/daemon/flag.js +190 -40
  104. package/dist/lib/daemon/ops/policy.js +62 -5
  105. package/dist/lib/daemon/paths.d.ts +72 -2
  106. package/dist/lib/daemon/paths.js +154 -3
  107. package/dist/lib/daemon/resolver.d.ts +2 -0
  108. package/dist/lib/daemon/resolver.js +3 -0
  109. package/dist/lib/daemon/run.d.ts +9 -0
  110. package/dist/lib/daemon/run.js +79 -21
  111. package/dist/lib/daemon/selfcheck.d.ts +22 -0
  112. package/dist/lib/daemon/selfcheck.js +40 -1
  113. package/dist/lib/daemon/server.d.ts +5 -1
  114. package/dist/lib/daemon/server.js +17 -23
  115. package/dist/lib/daemon/state-file-switch.d.ts +57 -0
  116. package/dist/lib/daemon/state-file-switch.js +88 -0
  117. package/dist/lib/daemon/state-file.d.ts +198 -0
  118. package/dist/lib/daemon/state-file.js +419 -0
  119. package/dist/lib/daemon/tcc-eperm.d.ts +153 -0
  120. package/dist/lib/daemon/tcc-eperm.js +310 -0
  121. package/dist/lib/daemon/timed-flag-monitors.d.ts +47 -0
  122. package/dist/lib/daemon/timed-flag-monitors.js +75 -0
  123. package/dist/lib/delivery/admission.d.ts +86 -0
  124. package/dist/lib/delivery/admission.js +148 -0
  125. package/dist/lib/delivery/artifacts.d.ts +7 -1
  126. package/dist/lib/delivery/artifacts.js +29 -10
  127. package/dist/lib/delivery/attempt-id.d.ts +13 -0
  128. package/dist/lib/delivery/attempt-id.js +16 -0
  129. package/dist/lib/delivery/disposable-target.d.ts +42 -0
  130. package/dist/lib/delivery/disposable-target.js +111 -0
  131. package/dist/lib/delivery/effects.d.ts +136 -0
  132. package/dist/lib/delivery/effects.js +541 -0
  133. package/dist/lib/delivery/enrollment.d.ts +21 -17
  134. package/dist/lib/delivery/enrollment.js +83 -5
  135. package/dist/lib/delivery/escalations.d.ts +51 -0
  136. package/dist/lib/delivery/escalations.js +60 -0
  137. package/dist/lib/delivery/lease.d.ts +80 -0
  138. package/dist/lib/delivery/lease.js +134 -0
  139. package/dist/lib/delivery/migrations.d.ts +120 -4
  140. package/dist/lib/delivery/migrations.js +215 -15
  141. package/dist/lib/delivery/mqtt.d.ts +2 -0
  142. package/dist/lib/delivery/mqtt.js +7 -0
  143. package/dist/lib/delivery/reconciler.d.ts +65 -1
  144. package/dist/lib/delivery/reconciler.js +224 -13
  145. package/dist/lib/delivery/rpc/client.d.ts +22 -0
  146. package/dist/lib/delivery/rpc/client.js +159 -0
  147. package/dist/lib/delivery/rpc/port.d.ts +40 -0
  148. package/dist/lib/delivery/rpc/port.js +16 -0
  149. package/dist/lib/delivery/rpc/server.d.ts +30 -0
  150. package/dist/lib/delivery/rpc/server.js +205 -0
  151. package/dist/lib/delivery/rpc/wire.d.ts +85 -0
  152. package/dist/lib/delivery/rpc/wire.js +143 -0
  153. package/dist/lib/delivery/store.d.ts +2 -0
  154. package/dist/lib/delivery/store.js +4 -0
  155. package/dist/lib/delivery/windows-service-install.d.ts +262 -0
  156. package/dist/lib/delivery/windows-service-install.js +892 -0
  157. package/dist/lib/delivery/workers/macos.d.ts +16 -1
  158. package/dist/lib/delivery/workers/macos.js +54 -12
  159. package/dist/lib/delivery/workers/windows-service-live.d.ts +121 -0
  160. package/dist/lib/delivery/workers/windows-service-live.js +711 -0
  161. package/dist/lib/delivery/workers/windows-service-runner.d.ts +33 -0
  162. package/dist/lib/delivery/workers/windows-service-runner.js +82 -0
  163. package/dist/lib/delivery/workers/windows-service.d.ts +140 -0
  164. package/dist/lib/delivery/workers/windows-service.js +584 -0
  165. package/dist/lib/delivery/workers/windows.d.ts +32 -22
  166. package/dist/lib/delivery/workers/windows.js +50 -64
  167. package/dist/lib/doctor/checks/host-core.d.ts +50 -0
  168. package/dist/lib/doctor/checks/host-core.js +269 -0
  169. package/dist/lib/doctor/checks/replay-recorder.d.ts +39 -0
  170. package/dist/lib/doctor/checks/replay-recorder.js +261 -0
  171. package/dist/lib/doctor/registry.js +4 -0
  172. package/dist/lib/environment/profile.d.ts +239 -0
  173. package/dist/lib/environment/profile.js +251 -0
  174. package/dist/lib/hook-engine/reconcile.js +39 -13
  175. package/dist/lib/hook-engine/registration.d.ts +9 -0
  176. package/dist/lib/hook-engine/registration.js +19 -0
  177. package/dist/lib/hot-channels/adapters/meetings.d.ts +15 -0
  178. package/dist/lib/hot-channels/adapters/meetings.js +36 -3
  179. package/dist/lib/hot-channels/adapters/slack.d.ts +21 -5
  180. package/dist/lib/hot-channels/adapters/slack.js +64 -21
  181. package/dist/lib/hot-channels/alert.d.ts +2 -0
  182. package/dist/lib/hot-channels/alert.js +8 -1
  183. package/dist/lib/hot-channels/contract.d.ts +12 -0
  184. package/dist/lib/hot-channels/contract.js +7 -0
  185. package/dist/lib/hot-channels/loop.js +1 -0
  186. package/dist/lib/hot-channels/run.d.ts +6 -0
  187. package/dist/lib/hot-channels/run.js +4 -0
  188. package/dist/lib/hot-channels/signals-pass.d.ts +74 -1
  189. package/dist/lib/hot-channels/signals-pass.js +82 -41
  190. package/dist/lib/hot-channels/signals-redo.js +10 -2
  191. package/dist/lib/install/claude-targets.d.ts +12 -1
  192. package/dist/lib/install/claude-targets.js +57 -5
  193. package/dist/lib/install/codex-targets.d.ts +2 -2
  194. package/dist/lib/install/codex-targets.js +36 -6
  195. package/dist/lib/install/hook-target.d.ts +3 -0
  196. package/dist/lib/install/hook-target.js +11 -0
  197. package/dist/lib/lanes/canonical-host.d.ts +35 -0
  198. package/dist/lib/lanes/canonical-host.js +65 -0
  199. package/dist/lib/lanes/host-capacity.d.ts +30 -0
  200. package/dist/lib/lanes/host-capacity.js +29 -3
  201. package/dist/lib/lanes/watcher.js +35 -0
  202. package/dist/lib/mesh/live/daemon/run.d.ts +2 -0
  203. package/dist/lib/mesh/live/daemon/run.js +5 -2
  204. package/dist/lib/mesh/live/flush.d.ts +5 -1
  205. package/dist/lib/mesh/live/flush.js +12 -6
  206. package/dist/lib/mesh/live/reporting-privacy.d.ts +32 -0
  207. package/dist/lib/mesh/live/reporting-privacy.js +56 -1
  208. package/dist/lib/mesh/live/spool.d.ts +7 -0
  209. package/dist/lib/mesh/live/spool.js +25 -0
  210. package/dist/lib/person-setting-cache.d.ts +38 -0
  211. package/dist/lib/person-setting-cache.js +98 -0
  212. package/dist/lib/safe-store.d.ts +245 -0
  213. package/dist/lib/safe-store.js +777 -0
  214. package/dist/lib/signals/engine.d.ts +29 -2
  215. package/dist/lib/signals/engine.js +103 -4
  216. package/dist/lib/signals/reply.js +73 -18
  217. package/dist/lib/signals/steps/adapters.js +7 -2
  218. package/dist/lib/signals/steps/extract.d.ts +13 -0
  219. package/dist/lib/signals/steps/extract.js +122 -6
  220. package/dist/main.js +46 -3
  221. package/dist/schemas/hq-available-ai.v1.schema.json +76 -0
  222. package/dist/schemas/hq-environment-profile.v1.schema.json +438 -0
  223. package/dist/utils/auth-expiry.d.ts +8 -0
  224. package/dist/utils/auth-expiry.js +53 -0
  225. package/dist/utils/catalog-runtime-paths.d.ts +34 -0
  226. package/dist/utils/catalog-runtime-paths.js +53 -0
  227. package/dist/utils/cli-telemetry.d.ts +21 -0
  228. package/dist/utils/cli-telemetry.js +34 -0
  229. package/dist/utils/command-usage.d.ts +275 -0
  230. package/dist/utils/command-usage.js +797 -0
  231. package/dist/utils/files-browse-acl.js +1 -1
  232. package/dist/utils/hook-trust.d.ts +7 -0
  233. package/dist/utils/hook-trust.js +31 -4
  234. package/dist/utils/host-registration.d.ts +126 -0
  235. package/dist/utils/host-registration.js +378 -0
  236. package/dist/utils/resident-package-preload.js +2 -0
  237. package/package.json +10 -8
  238. package/scripts/bench-core.mjs +1096 -0
  239. package/scripts/check-function-manifest.mjs +702 -0
  240. package/dist/lib/delivery/workers/windows-boundary.d.ts +0 -453
  241. package/dist/lib/delivery/workers/windows-boundary.js +0 -693
@@ -1202,7 +1202,7 @@ export declare const COMMAND_CATALOG: readonly [{
1202
1202
  readonly subcommands: readonly [];
1203
1203
  }, {
1204
1204
  readonly name: "held";
1205
- readonly description: "Show uploads held because someone else was signed in on this computer";
1205
+ readonly description: "Show uploads held until you confirm they belong to the signed-in account";
1206
1206
  readonly aliases: readonly [];
1207
1207
  readonly hidden: false;
1208
1208
  readonly helpOption: true;
@@ -1448,7 +1448,7 @@ export declare const COMMAND_CATALOG: readonly [{
1448
1448
  readonly subcommands: readonly [];
1449
1449
  }, {
1450
1450
  readonly name: "whoami";
1451
- readonly description: "Show the currently authenticated user";
1451
+ readonly description: "Show signed-in user and session expiry";
1452
1452
  readonly aliases: readonly [];
1453
1453
  readonly hidden: false;
1454
1454
  readonly helpOption: true;
@@ -1884,7 +1884,7 @@ export declare const COMMAND_CATALOG: readonly [{
1884
1884
  readonly subcommands: readonly [];
1885
1885
  }, {
1886
1886
  readonly name: "logout";
1887
- readonly description: "Clear the cached HQ Cognito session";
1887
+ readonly description: "Same as `hq logout`: end the session on the server and clear cached tokens";
1888
1888
  readonly aliases: readonly [];
1889
1889
  readonly hidden: false;
1890
1890
  readonly helpOption: true;
@@ -5444,6 +5444,12 @@ export declare const COMMAND_CATALOG: readonly [{
5444
5444
  readonly flags: "--json";
5445
5445
  readonly description: "Print the run report as JSON";
5446
5446
  readonly hidden: false;
5447
+ }, {
5448
+ readonly flags: "--trigger <trigger>";
5449
+ readonly description: "What the run ledger records as the trigger; the bot's daily job passes scheduled";
5450
+ readonly hidden: false;
5451
+ readonly choices: readonly ["scheduled", "on-demand"];
5452
+ readonly defaultValue: "on-demand";
5447
5453
  }, {
5448
5454
  readonly flags: "--hq-root <path>";
5449
5455
  readonly description: "Local HQ tree root (default: <runtime-path>)";
@@ -12023,6 +12029,42 @@ export declare const COMMAND_CATALOG: readonly [{
12023
12029
  readonly hidden: false;
12024
12030
  }];
12025
12031
  readonly subcommands: readonly [];
12032
+ }, {
12033
+ readonly name: "available";
12034
+ readonly description: "What AI can run now, as one token-free hq-available-ai.v1 document (read-only; a stale view starts one background read)";
12035
+ readonly aliases: readonly [];
12036
+ readonly hidden: false;
12037
+ readonly helpOption: true;
12038
+ readonly helpCommand: false;
12039
+ readonly usage: "[options]";
12040
+ readonly helpText: readonly [];
12041
+ readonly arguments: readonly [];
12042
+ readonly options: readonly [{
12043
+ readonly flags: "--json";
12044
+ readonly description: "Print the document as JSON";
12045
+ readonly hidden: false;
12046
+ }, {
12047
+ readonly flags: "--fresh";
12048
+ readonly description: "Start a read and wait for it, at most 3 seconds";
12049
+ readonly hidden: false;
12050
+ }, {
12051
+ readonly flags: "--include-other";
12052
+ readonly description: "Also list capacity-only accounts, each with its organization";
12053
+ readonly hidden: false;
12054
+ }];
12055
+ readonly subcommands: readonly [];
12056
+ }, {
12057
+ readonly name: "collect-once";
12058
+ readonly description: "One capacity read, started in the background by hq capacity available";
12059
+ readonly aliases: readonly [];
12060
+ readonly hidden: true;
12061
+ readonly helpOption: true;
12062
+ readonly helpCommand: false;
12063
+ readonly usage: "[options]";
12064
+ readonly helpText: readonly [];
12065
+ readonly arguments: readonly [];
12066
+ readonly options: readonly [];
12067
+ readonly subcommands: readonly [];
12026
12068
  }, {
12027
12069
  readonly name: "route";
12028
12070
  readonly description: "Pick the account with the most capacity for a new lane (read-only; port of boss-route)";
@@ -12115,7 +12157,7 @@ export declare const COMMAND_CATALOG: readonly [{
12115
12157
  readonly subcommands: readonly [];
12116
12158
  }, {
12117
12159
  readonly name: "refusal";
12118
- readonly description: "Record a classified provider rate-limit refusal as an exhausted reading";
12160
+ readonly description: "Record a classified provider refusal as a hold on one named account";
12119
12161
  readonly aliases: readonly [];
12120
12162
  readonly hidden: false;
12121
12163
  readonly helpOption: true;
@@ -12123,7 +12165,7 @@ export declare const COMMAND_CATALOG: readonly [{
12123
12165
  readonly usage: "[options]";
12124
12166
  readonly helpText: readonly [{
12125
12167
  readonly position: "after";
12126
- readonly text: "\nworkflow-runner and /conduct call this after a provider failure has been\nclassified as a rate-limit refusal (policy\nindigo-provider-failures-classified-not-masked-as-timeout). Do not call it\nfor a timeout that was not classified as a rate-limit refusal:\n\n hq capacity ingest refusal --provider <claude|codex|grok> [--limit-id <id>] [--resets-at <iso|epoch>] [--account <hash>]\n\nWhen --limit-id is omitted, the provider's weekly_all limit id in now.json\nis used, or weekly when that view has none. This command does not wire\nthose callers.\n";
12168
+ readonly text: "\nA model-CLI bot's turn, hq bot probe and the lane failure path record their\nown refusals. Run this by hand only for a provider failure that was classified\nas a rate-limit refusal (policy\nindigo-provider-failures-classified-not-masked-as-timeout), never for a\ntimeout that was not:\n\n hq capacity ingest refusal --provider <claude|codex|grok> --account <hash> [--limit-id <id>] [--resets-at <iso|epoch>]\n\n--account is required unless --limit-id names a limit that exactly one account\nhas. A limit id that several accounts share, or neither flag, is a usage error:\nnothing is recorded against a guess, even when the provider has one account.\nThe refusal is a hold beside the account's readings, and never replaces one.\n--limit-id names the limit it is about; without it the refusal claims no\nwindow. The hold ends at --resets-at, at that limit's own reset, or after a\nshort default, or sooner when a newer reading of that limit is below 100%.\n";
12127
12169
  }];
12128
12170
  readonly arguments: readonly [];
12129
12171
  readonly options: readonly [{
@@ -12132,15 +12174,15 @@ export declare const COMMAND_CATALOG: readonly [{
12132
12174
  readonly hidden: false;
12133
12175
  }, {
12134
12176
  readonly flags: "--limit-id <id>";
12135
- readonly description: "Limit to mark; default is the provider's weekly_all id in now.json, else weekly";
12177
+ readonly description: "The account's limit this refusal is about; without it the refusal claims no window";
12136
12178
  readonly hidden: false;
12137
12179
  }, {
12138
12180
  readonly flags: "--resets-at <when>";
12139
- readonly description: "UTC timestamp or epoch when this limit resets";
12181
+ readonly description: "UTC timestamp or epoch when the hold ends";
12140
12182
  readonly hidden: false;
12141
12183
  }, {
12142
12184
  readonly flags: "--account <hash>";
12143
- readonly description: "Hashed account id; default is the account on the chosen limit";
12185
+ readonly description: "Hashed account id of the account that refused. Required unless --limit-id names a limit exactly one account has";
12144
12186
  readonly hidden: false;
12145
12187
  }, {
12146
12188
  readonly flags: "--json";
@@ -12256,6 +12298,39 @@ export declare const COMMAND_CATALOG: readonly [{
12256
12298
  readonly subcommands: readonly [];
12257
12299
  }];
12258
12300
  }];
12301
+ }, {
12302
+ readonly name: "env";
12303
+ readonly description: "Environment profiles: the places that can do work (hq-environment-profile.v1)";
12304
+ readonly aliases: readonly [];
12305
+ readonly hidden: false;
12306
+ readonly helpOption: true;
12307
+ readonly helpCommand: true;
12308
+ readonly usage: "[options] [command]";
12309
+ readonly helpText: readonly [];
12310
+ readonly arguments: readonly [];
12311
+ readonly options: readonly [];
12312
+ readonly subcommands: readonly [{
12313
+ readonly name: "validate";
12314
+ readonly description: "Check an environment profile file against hq-environment-profile.v1 (read-only; exit 1 when it is rejected; files up to 5 MB)";
12315
+ readonly aliases: readonly [];
12316
+ readonly hidden: false;
12317
+ readonly helpOption: true;
12318
+ readonly helpCommand: false;
12319
+ readonly usage: "[options] <file>";
12320
+ readonly helpText: readonly [];
12321
+ readonly arguments: readonly [{
12322
+ readonly name: "file";
12323
+ readonly required: true;
12324
+ readonly variadic: false;
12325
+ readonly description: "Path to a profile JSON file";
12326
+ }];
12327
+ readonly options: readonly [{
12328
+ readonly flags: "--json";
12329
+ readonly description: "Print the result as JSON";
12330
+ readonly hidden: false;
12331
+ }];
12332
+ readonly subcommands: readonly [];
12333
+ }];
12259
12334
  }, {
12260
12335
  readonly name: "doctor";
12261
12336
  readonly description: "Verify HQ hook wiring, runtimes, and connection health (read-only; integrations uses one control-plane inventory read).";
@@ -12263,7 +12338,7 @@ export declare const COMMAND_CATALOG: readonly [{
12263
12338
  readonly hidden: false;
12264
12339
  readonly helpOption: true;
12265
12340
  readonly helpCommand: false;
12266
- readonly usage: "[options]";
12341
+ readonly usage: "[options] [command]";
12267
12342
  readonly helpText: readonly [];
12268
12343
  readonly arguments: readonly [];
12269
12344
  readonly options: readonly [{
@@ -12323,7 +12398,23 @@ export declare const COMMAND_CATALOG: readonly [{
12323
12398
  readonly description: "Let --fix run despite uncommitted changes under .claude/, .codex/, or .grok/.";
12324
12399
  readonly hidden: false;
12325
12400
  }];
12326
- readonly subcommands: readonly [];
12401
+ readonly subcommands: readonly [{
12402
+ readonly name: "usage";
12403
+ readonly description: "Show how many times each command ran on this computer in the last 30 days (a local file that is never sent).";
12404
+ readonly aliases: readonly [];
12405
+ readonly hidden: false;
12406
+ readonly helpOption: true;
12407
+ readonly helpCommand: false;
12408
+ readonly usage: "[options]";
12409
+ readonly helpText: readonly [];
12410
+ readonly arguments: readonly [];
12411
+ readonly options: readonly [{
12412
+ readonly flags: "--json";
12413
+ readonly description: "Emit the counts as JSON.";
12414
+ readonly hidden: false;
12415
+ }];
12416
+ readonly subcommands: readonly [];
12417
+ }];
12327
12418
  }, {
12328
12419
  readonly name: "mesh";
12329
12420
  readonly description: "Work mesh — register project work, report progress, and warm ~/.hq/work-mesh/cache";
@@ -12597,6 +12688,10 @@ export declare const COMMAND_CATALOG: readonly [{
12597
12688
  readonly flags: "--force";
12598
12689
  readonly description: "Take the story even when someone else holds it";
12599
12690
  readonly hidden: false;
12691
+ }, {
12692
+ readonly flags: "--no-ensure";
12693
+ readonly description: "Do not register the project from its local prd.json when the story is not on the Board";
12694
+ readonly hidden: false;
12600
12695
  }, {
12601
12696
  readonly flags: "--company <slug|uid>";
12602
12697
  readonly description: "Company slug or cloud uid";
@@ -1445,7 +1445,7 @@ export const COMMAND_CATALOG = [
1445
1445
  },
1446
1446
  {
1447
1447
  "name": "held",
1448
- "description": "Show uploads held because someone else was signed in on this computer",
1448
+ "description": "Show uploads held until you confirm they belong to the signed-in account",
1449
1449
  "aliases": [],
1450
1450
  "hidden": false,
1451
1451
  "helpOption": true,
@@ -1741,7 +1741,7 @@ export const COMMAND_CATALOG = [
1741
1741
  },
1742
1742
  {
1743
1743
  "name": "whoami",
1744
- "description": "Show the currently authenticated user",
1744
+ "description": "Show signed-in user and session expiry",
1745
1745
  "aliases": [],
1746
1746
  "hidden": false,
1747
1747
  "helpOption": true,
@@ -2263,7 +2263,7 @@ export const COMMAND_CATALOG = [
2263
2263
  },
2264
2264
  {
2265
2265
  "name": "logout",
2266
- "description": "Clear the cached HQ Cognito session",
2266
+ "description": "Same as `hq logout`: end the session on the server and clear cached tokens",
2267
2267
  "aliases": [],
2268
2268
  "hidden": false,
2269
2269
  "helpOption": true,
@@ -6602,6 +6602,16 @@ export const COMMAND_CATALOG = [
6602
6602
  "description": "Print the run report as JSON",
6603
6603
  "hidden": false
6604
6604
  },
6605
+ {
6606
+ "flags": "--trigger <trigger>",
6607
+ "description": "What the run ledger records as the trigger; the bot's daily job passes scheduled",
6608
+ "hidden": false,
6609
+ "choices": [
6610
+ "scheduled",
6611
+ "on-demand"
6612
+ ],
6613
+ "defaultValue": "on-demand"
6614
+ },
6605
6615
  {
6606
6616
  "flags": "--hq-root <path>",
6607
6617
  "description": "Local HQ tree root (default: <runtime-path>)",
@@ -14625,6 +14635,48 @@ export const COMMAND_CATALOG = [
14625
14635
  ],
14626
14636
  "subcommands": []
14627
14637
  },
14638
+ {
14639
+ "name": "available",
14640
+ "description": "What AI can run now, as one token-free hq-available-ai.v1 document (read-only; a stale view starts one background read)",
14641
+ "aliases": [],
14642
+ "hidden": false,
14643
+ "helpOption": true,
14644
+ "helpCommand": false,
14645
+ "usage": "[options]",
14646
+ "helpText": [],
14647
+ "arguments": [],
14648
+ "options": [
14649
+ {
14650
+ "flags": "--json",
14651
+ "description": "Print the document as JSON",
14652
+ "hidden": false
14653
+ },
14654
+ {
14655
+ "flags": "--fresh",
14656
+ "description": "Start a read and wait for it, at most 3 seconds",
14657
+ "hidden": false
14658
+ },
14659
+ {
14660
+ "flags": "--include-other",
14661
+ "description": "Also list capacity-only accounts, each with its organization",
14662
+ "hidden": false
14663
+ }
14664
+ ],
14665
+ "subcommands": []
14666
+ },
14667
+ {
14668
+ "name": "collect-once",
14669
+ "description": "One capacity read, started in the background by hq capacity available",
14670
+ "aliases": [],
14671
+ "hidden": true,
14672
+ "helpOption": true,
14673
+ "helpCommand": false,
14674
+ "usage": "[options]",
14675
+ "helpText": [],
14676
+ "arguments": [],
14677
+ "options": [],
14678
+ "subcommands": []
14679
+ },
14628
14680
  {
14629
14681
  "name": "route",
14630
14682
  "description": "Pick the account with the most capacity for a new lane (read-only; port of boss-route)",
@@ -14730,7 +14782,7 @@ export const COMMAND_CATALOG = [
14730
14782
  },
14731
14783
  {
14732
14784
  "name": "refusal",
14733
- "description": "Record a classified provider rate-limit refusal as an exhausted reading",
14785
+ "description": "Record a classified provider refusal as a hold on one named account",
14734
14786
  "aliases": [],
14735
14787
  "hidden": false,
14736
14788
  "helpOption": true,
@@ -14739,7 +14791,7 @@ export const COMMAND_CATALOG = [
14739
14791
  "helpText": [
14740
14792
  {
14741
14793
  "position": "after",
14742
- "text": "\nworkflow-runner and /conduct call this after a provider failure has been\nclassified as a rate-limit refusal (policy\nindigo-provider-failures-classified-not-masked-as-timeout). Do not call it\nfor a timeout that was not classified as a rate-limit refusal:\n\n hq capacity ingest refusal --provider <claude|codex|grok> [--limit-id <id>] [--resets-at <iso|epoch>] [--account <hash>]\n\nWhen --limit-id is omitted, the provider's weekly_all limit id in now.json\nis used, or weekly when that view has none. This command does not wire\nthose callers.\n"
14794
+ "text": "\nA model-CLI bot's turn, hq bot probe and the lane failure path record their\nown refusals. Run this by hand only for a provider failure that was classified\nas a rate-limit refusal (policy\nindigo-provider-failures-classified-not-masked-as-timeout), never for a\ntimeout that was not:\n\n hq capacity ingest refusal --provider <claude|codex|grok> --account <hash> [--limit-id <id>] [--resets-at <iso|epoch>]\n\n--account is required unless --limit-id names a limit that exactly one account\nhas. A limit id that several accounts share, or neither flag, is a usage error:\nnothing is recorded against a guess, even when the provider has one account.\nThe refusal is a hold beside the account's readings, and never replaces one.\n--limit-id names the limit it is about; without it the refusal claims no\nwindow. The hold ends at --resets-at, at that limit's own reset, or after a\nshort default, or sooner when a newer reading of that limit is below 100%.\n"
14743
14795
  }
14744
14796
  ],
14745
14797
  "arguments": [],
@@ -14751,17 +14803,17 @@ export const COMMAND_CATALOG = [
14751
14803
  },
14752
14804
  {
14753
14805
  "flags": "--limit-id <id>",
14754
- "description": "Limit to mark; default is the provider's weekly_all id in now.json, else weekly",
14806
+ "description": "The account's limit this refusal is about; without it the refusal claims no window",
14755
14807
  "hidden": false
14756
14808
  },
14757
14809
  {
14758
14810
  "flags": "--resets-at <when>",
14759
- "description": "UTC timestamp or epoch when this limit resets",
14811
+ "description": "UTC timestamp or epoch when the hold ends",
14760
14812
  "hidden": false
14761
14813
  },
14762
14814
  {
14763
14815
  "flags": "--account <hash>",
14764
- "description": "Hashed account id; default is the account on the chosen limit",
14816
+ "description": "Hashed account id of the account that refused. Required unless --limit-id names a limit exactly one account has",
14765
14817
  "hidden": false
14766
14818
  },
14767
14819
  {
@@ -14907,6 +14959,46 @@ export const COMMAND_CATALOG = [
14907
14959
  }
14908
14960
  ]
14909
14961
  },
14962
+ {
14963
+ "name": "env",
14964
+ "description": "Environment profiles: the places that can do work (hq-environment-profile.v1)",
14965
+ "aliases": [],
14966
+ "hidden": false,
14967
+ "helpOption": true,
14968
+ "helpCommand": true,
14969
+ "usage": "[options] [command]",
14970
+ "helpText": [],
14971
+ "arguments": [],
14972
+ "options": [],
14973
+ "subcommands": [
14974
+ {
14975
+ "name": "validate",
14976
+ "description": "Check an environment profile file against hq-environment-profile.v1 (read-only; exit 1 when it is rejected; files up to 5 MB)",
14977
+ "aliases": [],
14978
+ "hidden": false,
14979
+ "helpOption": true,
14980
+ "helpCommand": false,
14981
+ "usage": "[options] <file>",
14982
+ "helpText": [],
14983
+ "arguments": [
14984
+ {
14985
+ "name": "file",
14986
+ "required": true,
14987
+ "variadic": false,
14988
+ "description": "Path to a profile JSON file"
14989
+ }
14990
+ ],
14991
+ "options": [
14992
+ {
14993
+ "flags": "--json",
14994
+ "description": "Print the result as JSON",
14995
+ "hidden": false
14996
+ }
14997
+ ],
14998
+ "subcommands": []
14999
+ }
15000
+ ]
15001
+ },
14910
15002
  {
14911
15003
  "name": "doctor",
14912
15004
  "description": "Verify HQ hook wiring, runtimes, and connection health (read-only; integrations uses one control-plane inventory read).",
@@ -14914,7 +15006,7 @@ export const COMMAND_CATALOG = [
14914
15006
  "hidden": false,
14915
15007
  "helpOption": true,
14916
15008
  "helpCommand": false,
14917
- "usage": "[options]",
15009
+ "usage": "[options] [command]",
14918
15010
  "helpText": [],
14919
15011
  "arguments": [],
14920
15012
  "options": [
@@ -14989,7 +15081,27 @@ export const COMMAND_CATALOG = [
14989
15081
  "hidden": false
14990
15082
  }
14991
15083
  ],
14992
- "subcommands": []
15084
+ "subcommands": [
15085
+ {
15086
+ "name": "usage",
15087
+ "description": "Show how many times each command ran on this computer in the last 30 days (a local file that is never sent).",
15088
+ "aliases": [],
15089
+ "hidden": false,
15090
+ "helpOption": true,
15091
+ "helpCommand": false,
15092
+ "usage": "[options]",
15093
+ "helpText": [],
15094
+ "arguments": [],
15095
+ "options": [
15096
+ {
15097
+ "flags": "--json",
15098
+ "description": "Emit the counts as JSON.",
15099
+ "hidden": false
15100
+ }
15101
+ ],
15102
+ "subcommands": []
15103
+ }
15104
+ ]
14993
15105
  },
14994
15106
  {
14995
15107
  "name": "mesh",
@@ -15325,6 +15437,11 @@ export const COMMAND_CATALOG = [
15325
15437
  "description": "Take the story even when someone else holds it",
15326
15438
  "hidden": false
15327
15439
  },
15440
+ {
15441
+ "flags": "--no-ensure",
15442
+ "description": "Do not register the project from its local prd.json when the story is not on the Board",
15443
+ "hidden": false
15444
+ },
15328
15445
  {
15329
15446
  "flags": "--company <slug|uid>",
15330
15447
  "description": "Company slug or cloud uid",
@@ -2,12 +2,14 @@ import { Command } from "commander";
2
2
  import { CLI_VERSION } from "./cli-version.js";
3
3
  import { registerCommandCatalog } from "./lazy-commands.js";
4
4
  import { argvWithoutHelpOnUnknownCommand } from "./unknown-command.js";
5
+ import { STILL_USE_FLAG, STILL_USE_FLAG_DESCRIPTION } from "./utils/command-usage.js";
5
6
  export async function runCommandHelp(argv) {
6
7
  const program = new Command()
7
8
  .name("hq")
8
9
  .description("HQ management CLI — modules, packages, and cloud sync")
9
10
  .version(CLI_VERSION)
10
- .option("--verbose", "Show verbose diagnostics, including SDK runtime warnings");
11
+ .option("--verbose", "Show verbose diagnostics, including SDK runtime warnings")
12
+ .option(STILL_USE_FLAG, STILL_USE_FLAG_DESCRIPTION);
11
13
  registerCommandCatalog(program);
12
14
  const { hideStorageInCatalog } = await import("./lib/storage-feature-flag.js");
13
15
  hideStorageInCatalog(program);
@@ -484,6 +484,12 @@ export declare const REGISTRATION_PLAN: readonly [{
484
484
  readonly parent: "program";
485
485
  readonly module: "./commands/capacity.js";
486
486
  readonly exportName: "registerCapacityCommand";
487
+ }, {
488
+ readonly type: "registrar";
489
+ readonly root: "env";
490
+ readonly parent: "program";
491
+ readonly module: "./commands/env.js";
492
+ readonly exportName: "registerEnvCommand";
487
493
  }, {
488
494
  readonly type: "registrar";
489
495
  readonly root: "doctor";
@@ -83,6 +83,7 @@ export const REGISTRATION_PLAN = [
83
83
  { type: "registrar", root: "library", parent: "program", module: "./commands/library.js", exportName: "registerLibraryCommand" },
84
84
  { type: "registrar", root: "index", parent: "program", module: "./commands/index-cmd.js", exportName: "registerIndexCommand" },
85
85
  { type: "registrar", root: "capacity", parent: "program", module: "./commands/capacity.js", exportName: "registerCapacityCommand" },
86
+ { type: "registrar", root: "env", parent: "program", module: "./commands/env.js", exportName: "registerEnvCommand" },
86
87
  { type: "registrar", root: "doctor", parent: "program", module: "./commands/doctor.js", exportName: "registerDoctorCommand" },
87
88
  { type: "registrar", root: "mesh", parent: "program", module: "./commands/mesh.js", exportName: "registerMeshCommand" },
88
89
  { type: "registrar", root: "runners", parent: "program", module: "./commands/lanes.js", exportName: "registerRunnersCommand" },
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Subcommands:
5
5
  * hq auth login — open the Cognito Hosted UI in the browser and cache tokens
6
- * hq auth logout — clear the cached HQ session
6
+ * hq auth logout — second name for `hq logout` (same sign-out)
7
7
  * hq auth refresh — ensure a valid cached Cognito session (non-interactive)
8
8
  * hq auth status — show whether a valid session is cached + expiry
9
9
  * hq auth machine-session --output <path> — write machine tokens to a private file
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Subcommands:
5
5
  * hq auth login — open the Cognito Hosted UI in the browser and cache tokens
6
- * hq auth logout — clear the cached HQ session
6
+ * hq auth logout — second name for `hq logout` (same sign-out)
7
7
  * hq auth refresh — ensure a valid cached Cognito session (non-interactive)
8
8
  * hq auth status — show whether a valid session is cached + expiry
9
9
  * hq auth machine-session --output <path> — write machine tokens to a private file
@@ -17,13 +17,14 @@
17
17
  * by the deploy + sync skills.
18
18
  */
19
19
  import { loginWithBrowserPreference } from "../utils/login-browser.js";
20
+ import { formatAuthExpiry } from "../utils/auth-expiry.js";
20
21
  import { releaseCurrentPackageUseLease, releasePackageUseLeaseAfterResidentPreload } from "../utils/package-use-lease.js";
21
22
  import { preloadResidentPackageModules, reportResidentPackagePreloadFailure } from "../utils/resident-package-preload.js";
22
23
  import * as fs from "node:fs";
23
24
  import { open, realpath } from "node:fs/promises";
24
25
  import path from "node:path";
25
26
  import chalk from "chalk";
26
- import { clearCachedTokens, loadCachedTokens, isExpiring, loadMachineCreds, isExternalMachineCreds, CognitoAuthError, } from "@indigoai-us/hq-cloud";
27
+ import { loadCachedTokens, isExpiring, loadMachineCreds, isExternalMachineCreds, CognitoAuthError, } from "@indigoai-us/hq-cloud";
27
28
  import { authenticateMachineSession, MachineLoginError } from "../lib/daemon/machine-login.js";
28
29
  import { DEFAULT_COGNITO, refreshCachedSession, resolveCognitoTokenSource, ensureMachineSessionTokens, personTokenCacheFile, machineTokenCacheFile, loadMachineCachedTokens, } from "../utils/cognito-session.js";
29
30
  // Static (node builtins only): a lazy import here would need a resident
@@ -49,44 +50,6 @@ function decodeIdTokenClaims(idToken) {
49
50
  return undefined;
50
51
  }
51
52
  }
52
- function formatAuthExpiry(expiresAt, now = Date.now()) {
53
- const expiresAtMs = typeof expiresAt === "number" ? expiresAt : Date.parse(expiresAt);
54
- const expiresAtDate = new Date(expiresAtMs);
55
- if (!Number.isFinite(expiresAtMs) || Number.isNaN(expiresAtDate.getTime())) {
56
- return String(expiresAt);
57
- }
58
- const remainingMs = expiresAtMs - now;
59
- const absoluteMs = Math.abs(remainingMs);
60
- let unit;
61
- let unitMs;
62
- if (absoluteMs >= 365 * 24 * 60 * 60 * 1_000) {
63
- unit = "year";
64
- unitMs = 365 * 24 * 60 * 60 * 1_000;
65
- }
66
- else if (absoluteMs >= 30 * 24 * 60 * 60 * 1_000) {
67
- unit = "month";
68
- unitMs = 30 * 24 * 60 * 60 * 1_000;
69
- }
70
- else if (absoluteMs >= 24 * 60 * 60 * 1_000) {
71
- unit = "day";
72
- unitMs = 24 * 60 * 60 * 1_000;
73
- }
74
- else if (absoluteMs >= 60 * 60 * 1_000) {
75
- unit = "hour";
76
- unitMs = 60 * 60 * 1_000;
77
- }
78
- else if (absoluteMs >= 60 * 1_000) {
79
- unit = "minute";
80
- unitMs = 60 * 1_000;
81
- }
82
- else {
83
- unit = "second";
84
- unitMs = 1_000;
85
- }
86
- const relative = new Intl.RelativeTimeFormat("en", { numeric: "always" })
87
- .format(Math.round(remainingMs / unitMs), unit);
88
- return expiresAtDate.toISOString() + " (" + relative + ")";
89
- }
90
53
  function peekIdToken(idToken) {
91
54
  const claims = decodeIdTokenClaims(idToken);
92
55
  return {
@@ -311,7 +274,7 @@ export function registerAuthCommands(program) {
311
274
  const existing = loadCachedTokens();
312
275
  if (existing && !isExpiring(existing, 120)) {
313
276
  const who = peekIdToken(existing.idToken).email ?? "cached session";
314
- console.log(chalk.green(`Already signed in (${who}). Run \`hq auth logout\` to switch accounts.`));
277
+ console.log(chalk.green(`Already signed in (${who}). Run \`hq logout\` to switch accounts.`));
315
278
  return;
316
279
  }
317
280
  try {
@@ -360,17 +323,13 @@ export function registerAuthCommands(program) {
360
323
  });
361
324
  authCmd
362
325
  .command("logout")
363
- .description("Clear the cached HQ Cognito session")
326
+ .description("Same as `hq logout`: end the session on the server and clear cached tokens")
364
327
  .action(async () => {
365
- const { clearMcpOAuthCaches } = await import("../lib/daemon/mcp-oauth.js");
366
- clearMcpOAuthCaches();
367
- const existing = loadCachedTokens();
368
- if (!existing) {
369
- console.log(chalk.yellow("No cached HQ session"));
370
- return;
371
- }
372
- clearCachedTokens();
373
- console.log(chalk.green("Signed out — removed ~/.hq/cognito-tokens.json"));
328
+ // Second name for `hq logout`. It signs out exactly as `hq logout` does,
329
+ // so the refresh token is revoked on the server on this path too. It is
330
+ // not marked retiring yet: the shipped /hq-logout skill still runs it.
331
+ const { runLogout } = await import("./logout.js");
332
+ await runLogout();
374
333
  });
375
334
  authCmd
376
335
  .command("keychain")
@@ -463,7 +422,7 @@ export function registerAuthCommands(program) {
463
422
  console.log(chalk.dim(`token source: ${tokenSource}`));
464
423
  return;
465
424
  }
466
- console.log(chalk.yellow("No cached HQ session — run `hq auth login`"));
425
+ console.log(chalk.yellow("No cached HQ session — run `hq login`"));
467
426
  console.log(chalk.dim(`token source: ${tokenSource}`));
468
427
  process.exit(1);
469
428
  }