@indigoai-us/hq-cli 5.345.215 → 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 (135) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/README.md +45 -0
  3. package/assets/scaffold/core/scripts/lib/epochrealtime.sh +30 -0
  4. package/assets/scaffold/core/scripts/lib/work-mesh-enqueue.sh +12 -5
  5. package/dist/command-catalog.generated.d.ts +59 -4
  6. package/dist/command-catalog.generated.js +74 -4
  7. package/dist/command-help.js +3 -1
  8. package/dist/command-registration-plan.d.ts +6 -0
  9. package/dist/command-registration-plan.js +1 -0
  10. package/dist/commands/auth.d.ts +1 -1
  11. package/dist/commands/auth.js +11 -52
  12. package/dist/commands/bot.js +11 -4
  13. package/dist/commands/cloud-demote.d.ts +19 -4
  14. package/dist/commands/cloud-demote.js +85 -12
  15. package/dist/commands/cloud-provision.d.ts +5 -1
  16. package/dist/commands/cloud-provision.js +6 -2
  17. package/dist/commands/cloud.d.ts +36 -0
  18. package/dist/commands/cloud.js +109 -26
  19. package/dist/commands/core.js +1 -0
  20. package/dist/commands/daemon.js +4 -1
  21. package/dist/commands/dm.js +7 -0
  22. package/dist/commands/doctor-usage.d.ts +8 -0
  23. package/dist/commands/doctor-usage.js +20 -0
  24. package/dist/commands/doctor.js +7 -1
  25. package/dist/commands/env.d.ts +18 -0
  26. package/dist/commands/env.js +82 -0
  27. package/dist/commands/install-global.js +2 -2
  28. package/dist/commands/lanes.js +100 -24
  29. package/dist/commands/logout.d.ts +7 -0
  30. package/dist/commands/logout.js +41 -34
  31. package/dist/commands/sources.d.ts +8 -2
  32. package/dist/commands/sources.js +65 -9
  33. package/dist/commands/whoami.js +26 -1
  34. package/dist/data/command-states.json +15 -0
  35. package/dist/index.js +52 -4
  36. package/dist/lazy-commands.js +2 -1
  37. package/dist/lib/anywhere-person-setting.d.ts +2 -0
  38. package/dist/lib/anywhere-person-setting.js +6 -3
  39. package/dist/lib/billing/usage-card.d.ts +25 -4
  40. package/dist/lib/billing/usage-card.js +76 -9
  41. package/dist/lib/billing/usage-cost.d.ts +3 -3
  42. package/dist/lib/billing/usage-cost.js +35 -13
  43. package/dist/lib/billing/usage-only.js +4 -2
  44. package/dist/lib/billing/usage-rate-card.d.ts +2 -2
  45. package/dist/lib/billing/usage-rate-card.js +3 -0
  46. package/dist/lib/bot/fleet-cron.js +93 -6
  47. package/dist/lib/bot/inflight.d.ts +9 -0
  48. package/dist/lib/bot/inflight.js +10 -0
  49. package/dist/lib/bot/jobs/hot-signal-sync.js +12 -1
  50. package/dist/lib/bot/runtime/grok-acp.d.ts +1 -0
  51. package/dist/lib/bot/runtime/grok-acp.js +26 -11
  52. package/dist/lib/bot/runtime/grok.js +1 -1
  53. package/dist/lib/daemon/flag-monitor.d.ts +8 -0
  54. package/dist/lib/daemon/flag-monitor.js +17 -6
  55. package/dist/lib/daemon/flag.d.ts +65 -1
  56. package/dist/lib/daemon/flag.js +190 -40
  57. package/dist/lib/daemon/ops/policy.js +62 -5
  58. package/dist/lib/daemon/paths.d.ts +72 -2
  59. package/dist/lib/daemon/paths.js +154 -3
  60. package/dist/lib/daemon/run.js +25 -20
  61. package/dist/lib/daemon/selfcheck.d.ts +22 -0
  62. package/dist/lib/daemon/selfcheck.js +40 -1
  63. package/dist/lib/daemon/server.d.ts +3 -1
  64. package/dist/lib/daemon/server.js +7 -22
  65. package/dist/lib/daemon/state-file-switch.d.ts +57 -0
  66. package/dist/lib/daemon/state-file-switch.js +88 -0
  67. package/dist/lib/daemon/state-file.d.ts +198 -0
  68. package/dist/lib/daemon/state-file.js +419 -0
  69. package/dist/lib/daemon/timed-flag-monitors.d.ts +47 -0
  70. package/dist/lib/daemon/timed-flag-monitors.js +75 -0
  71. package/dist/lib/doctor/checks/host-core.d.ts +50 -0
  72. package/dist/lib/doctor/checks/host-core.js +269 -0
  73. package/dist/lib/doctor/checks/replay-recorder.d.ts +39 -0
  74. package/dist/lib/doctor/checks/replay-recorder.js +261 -0
  75. package/dist/lib/doctor/registry.js +4 -0
  76. package/dist/lib/environment/profile.d.ts +239 -0
  77. package/dist/lib/environment/profile.js +251 -0
  78. package/dist/lib/hook-engine/reconcile.js +39 -13
  79. package/dist/lib/hook-engine/registration.d.ts +9 -0
  80. package/dist/lib/hook-engine/registration.js +19 -0
  81. package/dist/lib/hot-channels/adapters/slack.d.ts +21 -5
  82. package/dist/lib/hot-channels/adapters/slack.js +64 -21
  83. package/dist/lib/hot-channels/alert.d.ts +2 -0
  84. package/dist/lib/hot-channels/alert.js +8 -1
  85. package/dist/lib/hot-channels/contract.d.ts +12 -0
  86. package/dist/lib/hot-channels/contract.js +7 -0
  87. package/dist/lib/hot-channels/loop.js +1 -0
  88. package/dist/lib/hot-channels/run.d.ts +6 -0
  89. package/dist/lib/hot-channels/run.js +4 -0
  90. package/dist/lib/hot-channels/signals-pass.d.ts +64 -1
  91. package/dist/lib/hot-channels/signals-pass.js +21 -49
  92. package/dist/lib/install/claude-targets.d.ts +12 -1
  93. package/dist/lib/install/claude-targets.js +57 -5
  94. package/dist/lib/install/codex-targets.d.ts +2 -2
  95. package/dist/lib/install/codex-targets.js +36 -6
  96. package/dist/lib/install/hook-target.d.ts +3 -0
  97. package/dist/lib/install/hook-target.js +11 -0
  98. package/dist/lib/lanes/canonical-host.d.ts +35 -0
  99. package/dist/lib/lanes/canonical-host.js +65 -0
  100. package/dist/lib/lanes/host-capacity.d.ts +30 -0
  101. package/dist/lib/lanes/host-capacity.js +29 -3
  102. package/dist/lib/mesh/live/daemon/run.d.ts +2 -0
  103. package/dist/lib/mesh/live/daemon/run.js +5 -2
  104. package/dist/lib/mesh/live/flush.d.ts +5 -1
  105. package/dist/lib/mesh/live/flush.js +12 -6
  106. package/dist/lib/mesh/live/reporting-privacy.d.ts +32 -0
  107. package/dist/lib/mesh/live/reporting-privacy.js +56 -1
  108. package/dist/lib/mesh/live/spool.d.ts +7 -0
  109. package/dist/lib/mesh/live/spool.js +25 -0
  110. package/dist/lib/person-setting-cache.d.ts +38 -0
  111. package/dist/lib/person-setting-cache.js +98 -0
  112. package/dist/lib/safe-store.d.ts +245 -0
  113. package/dist/lib/safe-store.js +777 -0
  114. package/dist/lib/signals/engine.d.ts +29 -2
  115. package/dist/lib/signals/engine.js +103 -4
  116. package/dist/lib/signals/reply.js +73 -18
  117. package/dist/lib/signals/steps/adapters.js +7 -2
  118. package/dist/lib/signals/steps/extract.d.ts +13 -0
  119. package/dist/lib/signals/steps/extract.js +84 -4
  120. package/dist/main.js +46 -3
  121. package/dist/schemas/hq-environment-profile.v1.schema.json +438 -0
  122. package/dist/utils/auth-expiry.d.ts +8 -0
  123. package/dist/utils/auth-expiry.js +53 -0
  124. package/dist/utils/cli-telemetry.d.ts +21 -0
  125. package/dist/utils/cli-telemetry.js +34 -0
  126. package/dist/utils/command-usage.d.ts +275 -0
  127. package/dist/utils/command-usage.js +797 -0
  128. package/dist/utils/hook-trust.d.ts +7 -0
  129. package/dist/utils/hook-trust.js +31 -4
  130. package/dist/utils/host-registration.d.ts +126 -0
  131. package/dist/utils/host-registration.js +378 -0
  132. package/dist/utils/resident-package-preload.js +2 -0
  133. package/package.json +10 -8
  134. package/scripts/bench-core.mjs +1096 -0
  135. package/scripts/check-function-manifest.mjs +702 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,147 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.345.217] — 2026-11-14
6
+
7
+ - Windows Grok ACP bots (Grok 1.0.77) no longer split each reply into one-word messages, fail permission and terminal RPC, drop resumed chats that omit `sessionId`, or die on `--no-subagents` (`feedback_0af4d198`). MCP OAuth crashes, Windows daemon self-restart, and cross-machine bot credential theft are unchanged.
8
+
9
+ - `scripts/bench-core.mjs` refuses a linked git worktree as `--root` for the old or selected core, since the old core exits 2 on every event there, and a hook that exits nonzero is reported with the first line of its stderr.
10
+ - The local command count no longer follows a link at
11
+ `~/.hq/command-usage/usage.tsv` and no longer waits on a named pipe there.
12
+ When that path is a link (symbolic or hard), a pipe, or a folder, or the
13
+ folder is a link, belongs to another user, or is writable by others, no
14
+ count is kept and the command runs as it would otherwise.
15
+ - An existing `~/.hq/command-usage` folder of yours that only you can write to
16
+ (for example mode 0755) is changed to mode 0700 the next time `hq` counts a
17
+ run. A folder that the group or others can write to is left as it is, and no
18
+ count is kept in it.
19
+ - `--i-still-use-this` is read only before the command's own arguments
20
+ (`hq old thing --i-still-use-this`). In `hq run tool --i-still-use-this` the
21
+ flag now belongs to `tool`.
22
+ - An installed `hq` ignores the test-only variable that names another command
23
+ states table, so the environment cannot switch the retiring-command gate off.
24
+ - The daemon state file (`~/.hq/daemon/hq-state.json`) is now behind a switch that is on by default, so nothing changes unless it is turned off. To turn it off on one machine, set `HQ_FLAG_DAEMON_STATE_FILE=false` in the daemon's and the hooks' environment or create the file `~/.hq/daemon-state-file.off`; the flag `daemon-state-file` set to `false` turns it off too. While it is off the daemon writes no state file and no self-check result for it, and removes its own previous state file once (only a regular file of the user's in a private daemon folder; a link is never followed). The hook engine then reads flags from the flag snapshot only, as it did before the state file. A daemon folder that is a symlink or belongs to another user no longer stops the daemon from starting; other daemon folders (requests, bundle stages, logs) are still refused when they cannot be made private. If the switch is turned off only by the server flag and the old file could not be removed, hooks keep reading that file until it expires (at most 11 minutes).
25
+ - The daemon now keeps a state file (`~/.hq/daemon/hq-state.json`, owner-only) that hooks can read instead of starting Node or calling the network. It holds the flag values the registry returned for the daemon's scope, the vault access list (company, role, granted paths and their permission) and the latest machine-check results, and it states its own maximum age (10 minutes). It is rewritten atomically from each flag registry answer the daemon's timed flag monitors already share, so it adds no registry request and no delay to a kill switch; when the daemon is signed out or the registry cannot be reached the file carries no flag values. The hook engine reads it with no process and no network call, alongside the existing flag snapshot, which is unchanged; a missing, stale, truncated or future-dated file is ignored, so guards keep working and flag-gated extras use their defaults. On macOS and Linux the engine reads the file only from the default daemon folder: it opens that folder without following a symlink, opens the file relative to it without following a symlink, and reads it only when the folder and the file belong to the user and are not writable by group or others and the file is a regular file with one link. On Windows the engine does not read the state file yet and uses the flag snapshot.
26
+ - `hq cloud demote company` now works right after `hq cloud retire company` without `--force`. hq-pro hides a retired company from the by-slug lookup and answers `GET /entity/{uid}` with 404, so on a by-slug miss demote reads the uid and slug from the company's own `.hq/config.json` and treats a 404 for that uid as retired or gone. The JSON result's `cloud_check` field names the 404. A 403, 5xx or network error, a live entity, a missing local uid, or a config slug that differs still refuses, and every refusal names `--force`.
27
+ - `hq dm` (send, inbox, thread, channel, requests and the rest) now stops straight away with a clear message when `HQ_API_KEY` is set, instead of opening a browser sign-in and hanging. The DM service has no API-key route, so run `hq login` once and unset `HQ_API_KEY` to send a DM.
28
+ - New `hq env validate <file>` checks an environment profile against the new `hq-environment-profile.v1` schema (`src/schemas/hq-environment-profile.v1.schema.json`). A profile describes one place that can do work (this machine, an Outpost, a MicroVM template) as a declared part and a set of readings that each carry `observed_at` and `ttl_seconds`. Every login in a profile records its owning business and its holder: a login the owner holds is listed with its label whichever of the owner's businesses owns it, and a login held by another person is listed by existence only. A login is marked `usable` only when the owner holds it and it is enabled and signed in. `room.availability` takes the same words `hq capacity available` emits. A string shaped like a credential is rejected anywhere in a profile. The command is read-only, needs no sign-in, exits 1 when the file is rejected, lists at most 100 issues, reads files up to 5 MB, and refuses any other `schema_version` by name. Nothing writes or reads a profile yet; `--json` prints the result for scripts.
29
+ - `hq lanes create` no longer fails with a stale `laneVersion` HTTP 400 after the worker has started. The 400 comes from the Work Mesh `lane_started` event append (`lane.laneVersion is stale`); the CLI now re-reads the lane and retries that one event once, using the fresh version. The worker is already running at that point, so any remaining Work Mesh failure (stale after the retry, a failed `lane_started` event, a failed lane registration, a failed story status patch) returns `ok: true` with a `story_warning` that starts with `Lane <id> is RUNNING (do not re-run create)` and names what did not sync plus the manual `hq mesh story ... --status in_progress` fix. A non-zero exit is avoided so a conductor does not retry and start a second worker.
30
+ - Fix three failures in the all-platform hq-hook workflow: the native block-hq-glob hook now words a missing tool interpreter like bash 5.2 on Linux ("cannot execute: required file not found"), and two tests no longer assume a jq version (post_tool_use_records_receipts_and_proofs) or that C:\a is absent (folder_paths_follow_cygwin). Feedback 983159de.
31
+ - On Linux with GNU awk, the native policy hooks now read prompts and policy files that have text outside ASCII in a UTF-8 locale, as gawk does, instead of returning those calls to the bash hook. Other Linux awks (mawk, busybox) are unchanged. The hq-hook crate also passes `cargo fmt --check` and clippy on stable Rust 1.100 again.
32
+ - The hq-hook store code no longer fails clippy's `unnecessary_cast` check on Linux: the sticky-bit mode checks use a `u32` constant instead of casting `libc::S_ISVTX`, whose type is `u32` on Linux and `u16` on macOS. No behavior change.
33
+ - `hq bot list` and `hq bot status` now report an HQ Fleet Runtime bot as answering while its gateway is running a turn, so the desktop app keeps the bot's working line up on turns longer than two minutes. The start time stays empty for these bots.
34
+ - Adds `scripts/check-function-manifest.mjs`, the check for the HQ function manifest (`core/functions.yaml` in hq-core): it fails when a function has two owners, when a command, daemon file, hook or core script exists that the manifest does not list, or when something still names a retiring or removed function. The script ships in the package so the hq-core pull request job can run it; no `hq` command changes.
35
+ - A resumed Grok bot chat on Windows now posts only the new reply. Before, the earlier conversation that Grok replays when it loads a saved session could be posted ahead of the new answer.
36
+ - Adds `scripts/bench-core.mjs`, the speed gate for the HQ hook core. It measures the time HQ adds to one tool call and to one prompt for Claude Code, Codex and Grok Build, for the old bash core, `hq-hook run`, or whatever the host's registration runs, and reports pass or fail against 150 ms per tool call and 300 ms per prompt. Cores are run in alternating order, each result keeps its median, spread and the load average, and a slow result taken under heavy load is reported as not decidable. It needs only Node, writes a JSON and a text report, and ships in the package so a bot box can run it over SSH. No `hq` command changes.
37
+ - block-hq-glob: the Rust hook works out `git rev-parse --show-toplevel` itself, following git's repository discovery, config checks and ownership check, and starts git only for shapes it cannot prove.
38
+ - block-hq-glob: searched paths outside ASCII are now compared natively instead of always starting git.
39
+ - block-hq-glob: a non-empty BASH_ENV other than /dev/null hands the call back to bash, and six more GIT_* variables that cannot change the toplevel no longer force git.
40
+ - block-hq-glob: on Windows, the `nul` value MSYS passes for `BASH_ENV=/dev/null` no longer hands every bridged call back to bash.
41
+ - block-hq-glob: config values that older git releases (2.39, 2.43) die on, and `core.whitespace` values with a rule git may read as tab-in-indent (including shortened names such as `tab`), are left to the installed git instead of being answered natively.
42
+ - The host canary uses the CLI’s shared safe-store implementation for evidence files, bundled for standalone Node 20 and 22 hook callbacks.
43
+ - Add a scripted host canary that checks an allowed call, a denied protected write, and policy injection against disposable HQ snapshots, and fails when a requested host cannot be verified.
44
+ - A daily hot-channel sync that fails without an error line no longer alerts "gave no reason". The alert says whether hq printed nothing or printed output with no error, and for an empty run the log records the command the job ran. `hq sources` commands name an error that has no message by its class, code and cause instead of printing a bare cross.
45
+ - With `cli.bot-signals-engine-job` off, a daily hot-channel sync whose signals step fails now sends the owner a direct message. The message names the channels affected, the cause, one fix step and the log. Before, the alert went only to the job's log because the sync still exited 0. A run that lands sources and finds no signals without an error still goes only to the log. The job alert also names Claude usage limits, unreadable Claude replies and other Claude errors with their own fix steps.
46
+ - Flag `core.next` (off by default) makes `hq reindex` register Claude Code, Codex and Grok Build hooks as a direct call of `hq-hook run --host <host> <Event>` through a release-stable path, so Codex keeps trusting the hooks across releases. An event switches only when the engine reports (`hq-hook capabilities --json`) every evaluator that event needs; every other event, and every event on Windows, keeps the old registration. `HQ_CORE_NEXT=off` or the file `~/.hq/state/core-next.off` sends the next event to the old dispatcher without a reinstall, and `hq doctor` shows which core each host uses per event and why. With the flag off, registrations are unchanged.
47
+ - `hq-hook record` can record hook events on a trial machine: when the flag
48
+ `core.replay-recorder` is on for the person or machine, each event's payload
49
+ and the hook answer are redacted and appended to a size-capped store under
50
+ `~/.hq/replay-recorder`. It is off by default; `HQ_REPLAY_RECORDER` set to
51
+ `off`, `0`, `false`, `no` or `disabled`, or `~/.hq/replay-recorder.off`,
52
+ turns it off. It records on macOS and Linux only; on Windows it records
53
+ nothing for now. `hq doctor` shows whether it is on and how much it holds.
54
+ - `hq` now keeps a local count of the commands you run, in
55
+ `~/.hq/command-usage/usage.tsv`: the date and the command name of each run,
56
+ never arguments or values. The file is never sent, synced, or attached to
57
+ feedback, so `HQ_TELEMETRY=0` does not turn it off; it is kept to about
58
+ 512 KiB and 30 days. `hq doctor usage` (and `--json`) shows the counts, and a
59
+ one-time notice on the first interactive run says what is stored.
60
+ - A command that is being retired no longer runs: it prints what replaced it
61
+ and exits non-zero. Add `--i-still-use-this` after the command name to run it
62
+ anyway; those runs are counted apart. No command is marked as retiring in
63
+ this release.
64
+ - `scripts/replay-harness.mjs` runs the old hook core and the new one on the same events and compares the decision, the block reason class and the injected policies. It runs the existing corpora first, then the old core against itself to leave out events that are not repeatable, then old against new. A difference passes only when `replay/intended-differences.yaml` (or a story's own list) names it with a reason. The ledger and the replay files have a code owner. Nothing that runs for users changes.
65
+ - Six commands are now marked as being retired: `hq crm entity list`,
66
+ `hq crm entity get`, `hq report promote`, `hq report discard-draft`,
67
+ `hq report access` and `hq report templates`. Run without a flag, each one
68
+ prints `"<command>" is being retired and did not run. No replacement is
69
+ listed.` and exits non-zero without doing anything. To run one anyway, add
70
+ `--i-still-use-this` after the command name, for example
71
+ `hq report access <reportId> --mode company --i-still-use-this`; it then
72
+ works as before and the run is counted apart in `hq doctor usage`. Nothing
73
+ is deleted in this release, and `hq --help` still lists the commands.
74
+ - `hq crm entity upsert`, `hq report get`, `hq report publish`,
75
+ `hq report adopt` and `hq report decommission` are unchanged: the CRM pack
76
+ and scheduled report jobs still run them. `hq db`, `hq team-sync`,
77
+ `hq modules` and `hq deploy` are unchanged.
78
+ - `hq auth logout` now signs out the same way as `hq logout`: it ends the
79
+ session on the HQ server (the refresh token is revoked) and then deletes the
80
+ local tokens. Before, it only deleted the local file. If the server cannot be
81
+ reached, both commands still delete the local tokens and say the session
82
+ could not be ended everywhere.
83
+ - `hq whoami` now also shows what `hq auth status` showed: whether the session
84
+ is valid or about to expire, when it expires, and the token source.
85
+ `hq whoami --json` adds `sessionExpiresAt` and `sessionExpiring`.
86
+ - `hq packages packs list`, `hq packages packs update`,
87
+ `hq packages packs uninstall` and `hq packages remove` are being retired.
88
+ They no longer run and instead name the command to use: `hq packs list`,
89
+ `hq packs update`, `hq packs uninstall` or `hq remove`. Add
90
+ `--i-still-use-this` after the command name to run one anyway.
91
+ - `hq-hook run` now carries the company scope guard as a native evaluator (`company-scope`, slot 2) for Read, Write, Edit, MultiEdit, NotebookEdit, Grep, Glob and Bash. Bash commands are read by a shell reader in Rust instead of starting `mandatory-scope-authorizer.sh`, and the cross-company settings warning comes from the same evaluator. The guard writes no session store files, reads the multi-company flag cache only (a miss counts as off), and refuses a command it cannot read. It refuses some commands the bash guard allows; the list is in `crates/hq-hook/tests/fixtures/US-012/intended-differences.yaml`.
92
+ - `hq-hook run --host` refuses an agent's prompt or compaction it cannot evaluate. When a payload names an agent, or cannot be read at all, and the program has no verdict (unreadable payload, wrong event, panic, time budget, unusable command line, or an evaluator in the chain that panics or overruns), UserPromptSubmit and PreCompact are refused on Claude Code and Codex, and UserPromptSubmit on Grok Build. SubagentStart cannot be refused on any host; the tool call that starts the agent and every tool call inside it already fail closed. No registration calls `run` yet, so hook behavior is unchanged.
93
+ - `hq-hook run --host <host> <Event>` now asks one ordered chain of evaluators, listed in `crates/hq-hook/src/host/registry.rs`. The chain stops at the first refusal, keeps an ask unless a later evaluator refuses, merges added context under the host's size limit by a stated priority, and refuses a tool call when an evaluator panics or passes the time budget. `hq-hook run --list-evaluators` prints the registered evaluators. The list is empty in this change, so hook behavior is unchanged.
94
+ - `hq-hook run --host <claude|codex|grok|fleet-local|agents-v2> <Event>` is a new native entry point for every host. It reads the host's hook payload into one event model and writes the answer in that host's format, exit code and size limit. It starts no bash, Node or jq process, refuses a tool call when it cannot read the payload or passes its time budget, and recognises the same registration loaded twice without leaving a file per event. No registration calls it yet and no guard is wired to it, so hook behavior is unchanged.
95
+ - `hq-hook run --host <host> Stop` and `PreCompact` now run one native check. At Stop it reads the transcript tail once and applies the checkpoint gate, the capability-link, final-message link-placement and humanize-before-send checks in the old order (first block wins), and appends the Work Mesh `turn_end` line to `~/.hq/work-mesh/spool.jsonl` itself. At an automatic compaction it prints one banner with one first action (`/checkpoint`). It starts no process. Its state files are opened relative to a held folder and refuse links, FIFOs, extra hard links and files others can write. No host registration calls `hq-hook run` yet, so hook behavior is unchanged.
96
+ - `hq-hook dispatch` now blocks when a hook registry safety guard (`"safety": true`) ends without a verdict, as master-hook.sh does. A safety guard allows only with exit 0, and exit 2 stays its own block. A guard killed by a signal exits 2 with `guard crashed, blocked: <id> was killed by signal 11 (SIGSEGV, exit 139), so this tool call was not checked.`; a timeout blocks with `guard timed out, blocked`; exit 1 and any other code block with `guard failed, blocked: <id> exited <n> without a verdict`. Exit 1 blocking is an owner decision (2026-11-10): a guard's internal error exits 1 under bash 5 but 127 under bash 3.2. Non-safety hooks keep exit 1 as a non-blocking hook error, and a guard marked both `safety` and `fail_closed` gets the safety message. Before, the engine did not read `safety`, so a guard that crashed with exit 139 was passed on and the host ran the tool call. The hook index carries the new field (index format 4; a format-3 row is rejected), and `hq-hook index registry` still prints the 11 fields it printed before. A new pull-request workflow (`hq-hook-pr.yml`) runs the crate's tests on Linux when `crates/hq-hook` changes.
97
+ - The native company scope guard in `hq-hook run` finds its HQ root as the bash guard does: the registration's `--hq-root` first, then `CLAUDE_PROJECT_DIR`, then the HQ installation the `hq-hook` binary sits in, then the working directory. It no longer reads `HQ_ROOT`. `hq-hook run --host` takes `--hq-root` for every host, the Fleet hosts included. Without a root it can trust (no `--hq-root`, no usable `CLAUDE_PROJECT_DIR`, no installation around the binary, and a working directory outside HQ) it refuses every Bash call, saying `--hq-root` is required, and refuses a Read, Write, Edit, Glob or Grep whose target or search folder is in an HQ tree or holds one below it. `hq reindex` always passes `--hq-root`, so installed registrations are unaffected. Its refusal for a call it cannot decide is one line. `scripts/replay-harness.mjs` runs the new core with `--hq-root` (its working copy, or a stand-in HQ tree). Correction to the earlier entry for the native guard: it does write one session store file, the capability a subagent inherits from its parent, as the bash guard does.
98
+ - The native Stop check (`hq-hook run --host <host> Stop`) now queues the five background jobs the old Stop path started as processes: the checkpoint after a turn that already replied, the Codex heartbeat checkpoint, the company checkpoint-setting refresh, the Codex eligibility probe and the Bash autosave sweep. Each becomes one line in `~/.hq/daemon/jobs/stop-jobs.jsonl` with the old argv, working directory and allowlisted environment, written only on the Stops where the old path started the job. Nothing runs these lines yet; the `hq daemon` drain is a follow-up. A refused queue drops the line and prints one stderr line. It never blocks a Stop. No host registration calls `hq-hook run` yet, so hook behavior is unchanged.
99
+ - `hq-hook`'s file store (`crates/hq-hook/src/host/store.rs`) no longer follows a link placed at any folder above a store file. It used to check only the file's own folder, so a link at a higher folder (for example `~/.hq` or `~/.hq/state`, or `workspace/orchestrator` for the callers that keep policy and image state) redirected the duplicate-event ledger and the engine log, and created folders, behind it. The folder is now opened by walking its path from `/` one folder at a time without following a link; only a link root owns, on a path of folders root alone may write (`/var` and `/tmp` on macOS), is followed, and no link is followed past a folder others may write (root's sticky `/tmp` included). Every folder above must belong to root or to this account and not be writable by others (root's sticky `/tmp` aside). A refused path drops the log line or leaves the ledger unavailable, as before; no hook answer changes. When a folder on the ledger's or the engine log's path can be written by group or other, as umask 0002 leaves `~/.hq`, `hq-hook run` names the folder (escaped, never as a command) and the fix in words in one stderr line, once per session, on an allowed call only.
100
+ - HQ MCP calls and gateway calls now show as "$0.10 per 100 calls". The
101
+ bundled price card matches the live feed, at $0.001 a call for both. A
102
+ price under one cent no longer prints as $0.00.
103
+ - HQ Native delivery tests (not used by any `hq` command): the delivery gate now runs build and test through the macOS worker over the local network connection, adds a check that a cut-off worker's claim expires and is picked up again without a restart, and gains a developer-only script to run the gate live on one Mac. The live run itself still waits on the owner's approval.
104
+ - `hq session add company` now widens the daemon's check lock too. After adding a company, later reads of that company are no longer blocked as locked to the original one (`feedback_a4a04ca0`, `feedback_cf07aef6`).
105
+ - The daemon's five timed flag monitors (four kill switches and the HQ Anywhere runtime gate) now share one flag registry request per 30-second tick instead of making one each. A signed-in machine running the daemon all day drops from 14,400 to 2,880 of these requests per day. A kill switch still applies on the next tick, and a failed read still returns each flag to its existing default. A new test runs the monitors through a simulated idle hour and fails when their server requests go over a stated budget.
106
+ - The Work Mesh Live daemon no longer asks the server for your HQ Anywhere
107
+ setting every 10 seconds. It makes no request while there is nothing to
108
+ send, reads the setting once when it first has something to send, and reads
109
+ it again when your sign-in or the local HQ Anywhere state changes, or after
110
+ 15 minutes. If the setting cannot be read, nothing is reported.
111
+ - `hq runners capacity --json` now prints `host.aliases`: the other ids this machine is recorded under. `host.id` is unchanged (the Outpost id from `/etc/outpost/outpost-id` on an Outpost, the stable id from `~/.hq/lane-host.json` elsewhere). The aliases are the hostnames in `~/.hq/lane-host.json`, the current hostname, and any host id from a lane record of the last 30 days that refers to this machine. The list is printed on every machine, and in the `host_capacity` entries of `hq runners list --json` for an Outpost that reports it. It is for reading and never decides which lanes count. On a machine that is not an Outpost, the same command now counts the lanes that lane admission already treats as running on this machine. Before, a lane stamped with the machine's old hostname id was listed under `queued_lanes` and left out of the `running` and `queued` counts. Counting on an Outpost is unchanged. No record is rewritten, and a snapshot from an older CLI without `host.aliases` still parses.
112
+ - Add declarative path and search checks to the optional native hook entrypoint, with legacy root selection, scoped Glob checks across symlinked roots, rule listing, and explicit approval rules for protected artifacts.
113
+ - `hq sync push`, `hq sync push --all` and `hq sync now` now describe skipped files in plain words everywhere, for example "2 already up to date, 1 merged with the cloud copy, 1 held for the next pass", instead of a bare "N skipped". Conflicts, broken links and skips that need a look are grouped as "N skipped (...)", with any skips the CLI cannot attribute named "N other" inside the group (for example "3 skipped (2 conflicts, 1 other)"), and the company line shows a warning mark for them. When every skip is unattributed the line stays a plain "N skipped" and does not turn yellow.
114
+ - The retiring-command refusal and its notice, described in other notes for
115
+ this release, are switched off before shipping. No command is refused or
116
+ warned about for being retired. The ten commands marked `retiring`
117
+ (`hq crm entity list`, `hq crm entity get`, `hq report access`,
118
+ `hq report discard-draft`, `hq report promote`, `hq report templates`,
119
+ `hq packages packs list`, `hq packages packs update`,
120
+ `hq packages packs uninstall` and `hq packages remove`) behave as they did
121
+ in 5.345.215.
122
+ - `--i-still-use-this` is accepted. Its only effect is that the run is counted
123
+ apart in `hq doctor usage`.
124
+ - The local command count (`hq doctor usage`) and the list of commands marked
125
+ `retiring` stay in place.
126
+ - Adds an internal module, `src/lib/safe-store.ts`, that the local stores
127
+ `hq` keeps under your home folder will use to read and write their files.
128
+ It holds the store folder open, refuses a folder or file that a link, a
129
+ pipe, another user or a group- or world-writable mode could redirect, and
130
+ refuses an operation when the folder was replaced while it ran. No store
131
+ uses it yet, so nothing changes in this release.
132
+ - `hq signals run --trigger job` on a day the job already ran now marks the day's run record with `alreadyRanToday: true` instead of only reporting it in memory. The record keeps the earlier run's outcome, a dry run writes nothing, and a later chat or manual run writes a fresh record as before.
133
+ - A signals run that stops at its spend cap no longer tells the member "This looks temporary." The reply names the source it stopped at and the cap, and says how to raise the cap for one run: `hq signals run --company <slug> --max-budget-usd <amount>`. When another step also had a problem, the reply keeps that step's guidance and adds the spend-cap line after it.
134
+ - `hq sources signals` no longer skips the remaining channels after one channel's signals pass fails, and its count now includes the signals a failed channel wrote before it failed. The report lists each failed channel (`failedChannels` in `--json`).
135
+ - Incremental signal extraction: when the run stops between two sources because the budget left is below the last source's cost (or is used up), the run record now names the source it did not start under `detail.budgetStoppedAt`. Before, only a stop inside a source was named. In both cases the field names the first source left unfinished, which the next run takes first.
136
+ - Incremental signal extraction: when Claude stops the turn at its budget cap the step now returns `budget-exceeded` and leaves the cursor in place. Before, it failed with a message to check the login.
137
+ - `hq signals run`: signal candidates with no citation marker in the body are now counted in the run record under `detail.uncitedCandidates`, with their sources under `detail.uncitedSources`. Nothing is rejected or left unprocessed for a missing citation. Entity candidates are not counted.
138
+ - The hot-channel sync's signals step uses Claude Code. When Claude Code is not installed or not signed in and your main bot runs on Codex, the step now fails with the code `claude-logged-out-codex-bot` and says to sign in to Claude Code on this computer (`claude auth login`). The owner's alert and the job's direct message say the same. When the main bot runs on Claude, the message is the same as before.
139
+ - The bot's hot-signal-sync job (signals engine path) now checks yesterday's and today's run records before each fire and each automatic retry, so a morning run that hung is reported at the next morning's fire at the latest. A record still `running` with no live run lock (its process is gone, it holds no lock, or the lock is more than 3 hours old), or a `failed` record, that landed sources and produced no signals sends the owner the same signals-failure DM the end-of-run check sends, with the same hourly dedupe. One stopped run is alerted at most once.
140
+ - `hq signals run --trigger job`: when marking the day's run record `alreadyRanToday` fails, the error is logged and the earlier run's record is left as it was, instead of being replaced by a failed record.
141
+ - A hot-channel sync that fails only because of a rate limit (Slack's `app_rate_limited`, or a Linear, Attio or Gmail 429 after every retry) is now recorded as temporary in the signals run record, so the run keeps its automatic retry and the reply says it looks temporary.
142
+ - The Slack hot-channel sync no longer fails forever on an old Slack rate-limit marker. A marker whose newest pause is an hour old counts as resolved, and a marker dated in the future or with no readable time no longer blocks the sync. Before, a company that sent no later Slack event kept the marker open and every Slack sync failed as a temporary rate limit.
143
+ - `hq sources sync` has a new `--trigger` option (`scheduled` or `on-demand`, default `on-demand`) that sets the trigger its run-ledger lines record. With `cli.bot-signals-engine-job` off, the daily hot-signal-sync job now passes `--trigger scheduled`, so `hq sources runs` shows its runs as scheduled instead of on-demand. If the job runs an older hq that has no `--trigger` option, it runs the sync again without it.
144
+ - The bundled Work Mesh hook helper `core/scripts/lib/work-mesh-enqueue.sh` now builds event ids correctly under comma-decimal locales (de_DE, fr_FR, ar_EG). It split `EPOCHREALTIME` on a dot, so under those locales an event id had a wrong time part or the helper exited with "value too great for base", and the hook event was dropped. The scaffold now carries hq-core-staging's `lib/epochrealtime.sh` (`hq_epochrealtime_parse`), which the helper sources, and the freshness manifest pins both files to hq-core-staging 31cd5f3b3 (PR #1922). This change and hq-core-staging #1922 must land together.
145
+
5
146
  ## [5.345.215] — 2026-11-12
6
147
 
7
148
  - `hq sync held` and the `hq sync push` hold notice no longer say another account was signed in. A first install on a new computer also holds uploads until `hq sync release-held`; that used to read as a security scare (feedback_baa82c96). The hold itself is unchanged.
package/README.md CHANGED
@@ -142,6 +142,51 @@ timeout knob and is unchanged.
142
142
  The same kill switch and event shape should be documented on hqforwork.com
143
143
  when that site's telemetry page is added (indigo-marketing; not this repo).
144
144
 
145
+ ### Local command count
146
+
147
+ Separately from telemetry, `hq` keeps a count of the commands you run in
148
+ `~/.hq/command-usage/usage.tsv` on this computer. Each run adds one line with
149
+ the date (UTC) and the command name, for example `secrets env`. Arguments, flag
150
+ values, file paths, company names, the working directory, and environment
151
+ values are never written. The count is used to see which commands are still in
152
+ use before one is removed.
153
+
154
+ The file is never sent, synced, or attached to `hq feedback`, so
155
+ `HQ_TELEMETRY=0` does not turn it off. It is kept to about 512 KiB: runs are
156
+ folded into one line per day and command, and days older than 30 days are
157
+ dropped. Nothing is written when `~/.hq` does not exist. Nothing is written
158
+ either when `usage.tsv` is a link (symbolic or hard), a named pipe, or a
159
+ folder, or when `~/.hq/command-usage` is a link, belongs to another user, or
160
+ can be written by the group or others; the command runs as it would otherwise.
161
+
162
+ `NODE_ENV=test` (or `VITEST=true`) marks a test run, and a test run never
163
+ writes to `~/.hq/command-usage`. If your shell sets `NODE_ENV=test`, `hq` keeps
164
+ no count. An installed `hq` ignores the test-only variables that name another
165
+ command table.
166
+
167
+ ```bash
168
+ hq doctor usage # counts per command for the last 30 days
169
+ hq doctor usage --json
170
+ rm -rf ~/.hq/command-usage # clear it
171
+ ```
172
+
173
+ The first interactive run that is not `--json` prints this line once on stderr
174
+ and records that it was shown under `~/.hq/cli-command-usage-disclosed-v1`:
175
+
176
+ ```
177
+ HQ keeps a count of the commands you run in ~/.hq/command-usage on this computer (the command name and the date of each run, never arguments, file contents, or secrets). It is never sent anywhere, so HQ_TELEMETRY=0 does not turn it off. Run `hq doctor usage` to see it; delete that folder to clear it.
178
+ ```
179
+
180
+ No command is being retired right now. Some commands are marked `retiring` in
181
+ the CLI's command table, but the retiring-command gate is switched off: every
182
+ command runs as before, with no notice and no change to its exit code.
183
+ `--i-still-use-this` is still accepted so scripts that pass it keep working.
184
+ Written directly after the command name, before the command's own arguments
185
+ (`hq old thing --i-still-use-this`), hq takes it out and the run of a marked
186
+ command is counted apart in `hq doctor usage`; it has no other effect. A flag
187
+ written after the command's first argument or after `--` belongs to that
188
+ command: `hq run tool --i-still-use-this` hands it to `tool`.
189
+
145
190
  ## Monitors
146
191
 
147
192
  `hq monitor` runs a command in the background and sends its stdout lines to the
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env bash
2
+ # hq-core: public
3
+ # epochrealtime.sh — locale-proof parse of a bash $EPOCHREALTIME string.
4
+ #
5
+ # Sourced by work-mesh-enqueue.sh, hook-adapter-core.sh and hook-stop-async.sh.
6
+ # Bash prints EPOCHREALTIME with the locale decimal separator: "." under C,
7
+ # "," under de_DE or fr_FR, a multibyte character under ar_EG. The parse
8
+ # below never looks at the separator: the seconds are the leading digits and
9
+ # the fraction is every digit after them.
10
+ #
11
+ # hq_epochrealtime_parse "12,345678" || fallback
12
+ # # HQ_EPOCH_MS = 12345 (seconds + first 3 fraction digits)
13
+ # # HQ_EPOCH_DIGITS = 12345678 (seconds + whole fraction)
14
+ #
15
+ # Sets variables instead of printing so callers need no command substitution.
16
+ # Returns 1, with both variables empty, when the string has no leading digits.
17
+ # shellcheck disable=SC2034 # HQ_EPOCH_* are read by the sourcing callers
18
+ hq_epochrealtime_parse() {
19
+ local s="${1-}" seconds fraction
20
+ HQ_EPOCH_MS=""
21
+ HQ_EPOCH_DIGITS=""
22
+ seconds="${s%%[![:digit:]]*}"
23
+ [ -n "$seconds" ] || return 1
24
+ fraction="${s#"$seconds"}"
25
+ fraction="${fraction//[![:digit:]]/}"
26
+ HQ_EPOCH_DIGITS="${seconds}${fraction}"
27
+ fraction="${fraction}000"
28
+ HQ_EPOCH_MS="${seconds}${fraction:0:3}"
29
+ return 0
30
+ }
@@ -21,6 +21,9 @@
21
21
  # [--cwd P] [--hq-root P] [--company-slug S] [--project P] [--task T] \
22
22
  # [--tool-writes N] [--spool PATH]
23
23
 
24
+ # shellcheck source=core/scripts/lib/epochrealtime.sh
25
+ . "${BASH_SOURCE[0]%/*}/epochrealtime.sh" 2>/dev/null || true
26
+
24
27
  # Crockford base32 alphabet (ULID) — no I L O U
25
28
  _WORK_MESH_CROCKFORD='0123456789ABCDEFGHJKMNPQRSTVWXYZ'
26
29
 
@@ -68,11 +71,15 @@ work_mesh_ulid() {
68
71
  local -i i rem val
69
72
 
70
73
  if [[ -n "${EPOCHREALTIME-}" ]]; then
71
- local sec=${EPOCHREALTIME%.*}
72
- local frac=${EPOCHREALTIME#*.}000
73
- frac=${frac:0:3}
74
- now_ms=$((10#$sec * 1000 + 10#$frac))
75
- else
74
+ # EPOCHREALTIME uses the locale decimal separator ("," under de_DE, a
75
+ # multibyte character under ar_EG, ...); hq_epochrealtime_parse does not
76
+ # depend on the separator.
77
+ if command -v hq_epochrealtime_parse >/dev/null 2>&1 \
78
+ && hq_epochrealtime_parse "$EPOCHREALTIME"; then
79
+ now_ms=$((10#$HQ_EPOCH_MS))
80
+ fi
81
+ fi
82
+ if [[ -z "${now_ms-}" ]]; then
76
83
  now_ms=$(date +%s%3N 2>/dev/null || true)
77
84
  case "$now_ms" in
78
85
  ""|*[!0-9]*)
@@ -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>)";
@@ -12292,6 +12298,39 @@ export declare const COMMAND_CATALOG: readonly [{
12292
12298
  readonly subcommands: readonly [];
12293
12299
  }];
12294
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
+ }];
12295
12334
  }, {
12296
12335
  readonly name: "doctor";
12297
12336
  readonly description: "Verify HQ hook wiring, runtimes, and connection health (read-only; integrations uses one control-plane inventory read).";
@@ -12299,7 +12338,7 @@ export declare const COMMAND_CATALOG: readonly [{
12299
12338
  readonly hidden: false;
12300
12339
  readonly helpOption: true;
12301
12340
  readonly helpCommand: false;
12302
- readonly usage: "[options]";
12341
+ readonly usage: "[options] [command]";
12303
12342
  readonly helpText: readonly [];
12304
12343
  readonly arguments: readonly [];
12305
12344
  readonly options: readonly [{
@@ -12359,7 +12398,23 @@ export declare const COMMAND_CATALOG: readonly [{
12359
12398
  readonly description: "Let --fix run despite uncommitted changes under .claude/, .codex/, or .grok/.";
12360
12399
  readonly hidden: false;
12361
12400
  }];
12362
- 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
+ }];
12363
12418
  }, {
12364
12419
  readonly name: "mesh";
12365
12420
  readonly description: "Work mesh — register project work, report progress, and warm ~/.hq/work-mesh/cache";
@@ -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>)",
@@ -14949,6 +14959,46 @@ export const COMMAND_CATALOG = [
14949
14959
  }
14950
14960
  ]
14951
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
+ },
14952
15002
  {
14953
15003
  "name": "doctor",
14954
15004
  "description": "Verify HQ hook wiring, runtimes, and connection health (read-only; integrations uses one control-plane inventory read).",
@@ -14956,7 +15006,7 @@ export const COMMAND_CATALOG = [
14956
15006
  "hidden": false,
14957
15007
  "helpOption": true,
14958
15008
  "helpCommand": false,
14959
- "usage": "[options]",
15009
+ "usage": "[options] [command]",
14960
15010
  "helpText": [],
14961
15011
  "arguments": [],
14962
15012
  "options": [
@@ -15031,7 +15081,27 @@ export const COMMAND_CATALOG = [
15031
15081
  "hidden": false
15032
15082
  }
15033
15083
  ],
15034
- "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
+ ]
15035
15105
  },
15036
15106
  {
15037
15107
  "name": "mesh",
@@ -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