@indigoai-us/hq-cli 5.345.215 → 5.345.218
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.
- package/CHANGELOG.md +168 -0
- package/README.md +46 -1
- package/assets/bot-workers/setup/skills/add-a-pack.md +3 -3
- package/assets/scaffold/core/scripts/hq-session.sh +4 -0
- package/assets/scaffold/core/scripts/lib/epochrealtime.sh +30 -0
- package/assets/scaffold/core/scripts/lib/work-mesh-enqueue.sh +12 -5
- package/dist/command-catalog.generated.d.ts +59 -4
- package/dist/command-catalog.generated.js +74 -4
- package/dist/command-help.js +3 -1
- package/dist/command-registration-plan.d.ts +6 -0
- package/dist/command-registration-plan.js +1 -0
- package/dist/commands/auth.d.ts +1 -1
- package/dist/commands/auth.js +11 -52
- package/dist/commands/bot.js +11 -4
- package/dist/commands/cloud-demote.d.ts +19 -4
- package/dist/commands/cloud-demote.js +85 -12
- package/dist/commands/cloud-provision.d.ts +5 -1
- package/dist/commands/cloud-provision.js +6 -2
- package/dist/commands/cloud.d.ts +37 -1
- package/dist/commands/cloud.js +110 -27
- package/dist/commands/core-hq-session-native.js +3 -0
- package/dist/commands/core.js +1 -0
- package/dist/commands/daemon.js +4 -1
- package/dist/commands/dm.js +7 -0
- package/dist/commands/doctor-usage.d.ts +8 -0
- package/dist/commands/doctor-usage.js +20 -0
- package/dist/commands/doctor.js +7 -1
- package/dist/commands/env.d.ts +18 -0
- package/dist/commands/env.js +82 -0
- package/dist/commands/install-global.js +3 -3
- package/dist/commands/lanes.js +100 -24
- package/dist/commands/logout.d.ts +7 -0
- package/dist/commands/logout.js +41 -34
- package/dist/commands/members.js +1 -1
- package/dist/commands/pack-start-bot.d.ts +1 -1
- package/dist/commands/pack-start-bot.js +2 -2
- package/dist/commands/pkg-update.js +1 -1
- package/dist/commands/sources.d.ts +8 -2
- package/dist/commands/sources.js +65 -9
- package/dist/commands/sync-narrow.js +1 -1
- package/dist/commands/team-sync.js +1 -1
- package/dist/commands/whoami.js +26 -1
- package/dist/data/command-states.json +22 -0
- package/dist/index.js +52 -4
- package/dist/lazy-commands.js +2 -1
- package/dist/lib/anywhere-person-setting.d.ts +2 -0
- package/dist/lib/anywhere-person-setting.js +6 -3
- package/dist/lib/billing/usage-card.d.ts +25 -4
- package/dist/lib/billing/usage-card.js +76 -9
- package/dist/lib/billing/usage-cost.d.ts +3 -3
- package/dist/lib/billing/usage-cost.js +40 -15
- package/dist/lib/billing/usage-only.js +4 -2
- package/dist/lib/billing/usage-rate-card.d.ts +2 -2
- package/dist/lib/billing/usage-rate-card.js +3 -0
- package/dist/lib/bot/fleet-cron.js +93 -6
- package/dist/lib/bot/inflight.d.ts +9 -0
- package/dist/lib/bot/inflight.js +10 -0
- package/dist/lib/bot/jobs/hot-signal-sync.js +12 -1
- package/dist/lib/bot/pack-link.d.ts +2 -2
- package/dist/lib/bot/pack-link.js +2 -2
- package/dist/lib/bot/runtime/grok-acp.d.ts +1 -0
- package/dist/lib/bot/runtime/grok-acp.js +26 -11
- package/dist/lib/bot/runtime/grok.js +1 -1
- package/dist/lib/daemon/flag-monitor.d.ts +8 -0
- package/dist/lib/daemon/flag-monitor.js +17 -6
- package/dist/lib/daemon/flag.d.ts +65 -1
- package/dist/lib/daemon/flag.js +190 -40
- package/dist/lib/daemon/hook-env.d.ts +32 -0
- package/dist/lib/daemon/hook-env.js +51 -0
- package/dist/lib/daemon/ops/policy.js +67 -8
- package/dist/lib/daemon/paths.d.ts +72 -2
- package/dist/lib/daemon/paths.js +154 -3
- package/dist/lib/daemon/run.js +32 -21
- package/dist/lib/daemon/selfcheck.d.ts +22 -0
- package/dist/lib/daemon/selfcheck.js +40 -1
- package/dist/lib/daemon/server.d.ts +3 -1
- package/dist/lib/daemon/server.js +7 -22
- package/dist/lib/daemon/state-file-switch.d.ts +57 -0
- package/dist/lib/daemon/state-file-switch.js +88 -0
- package/dist/lib/daemon/state-file.d.ts +198 -0
- package/dist/lib/daemon/state-file.js +419 -0
- package/dist/lib/daemon/timed-flag-monitors.d.ts +47 -0
- package/dist/lib/daemon/timed-flag-monitors.js +75 -0
- package/dist/lib/doctor/checks/host-core.d.ts +52 -0
- package/dist/lib/doctor/checks/host-core.js +337 -0
- package/dist/lib/doctor/checks/replay-recorder.d.ts +39 -0
- package/dist/lib/doctor/checks/replay-recorder.js +261 -0
- package/dist/lib/doctor/checks/sync-runtime.js +3 -3
- package/dist/lib/doctor/registry.js +4 -0
- package/dist/lib/environment/credential-shapes.d.ts +61 -0
- package/dist/lib/environment/credential-shapes.js +333 -0
- package/dist/lib/environment/profile.d.ts +239 -0
- package/dist/lib/environment/profile.js +239 -0
- package/dist/lib/hook-engine/coverage.d.ts +13 -0
- package/dist/lib/hook-engine/coverage.js +124 -0
- package/dist/lib/hook-engine/reconcile.js +300 -94
- package/dist/lib/hook-engine/registration.d.ts +17 -1
- package/dist/lib/hook-engine/registration.js +62 -7
- package/dist/lib/hot-channels/adapters/slack.d.ts +21 -5
- package/dist/lib/hot-channels/adapters/slack.js +64 -21
- package/dist/lib/hot-channels/alert.d.ts +2 -0
- package/dist/lib/hot-channels/alert.js +8 -1
- package/dist/lib/hot-channels/contract.d.ts +12 -0
- package/dist/lib/hot-channels/contract.js +7 -0
- package/dist/lib/hot-channels/loop.js +1 -0
- package/dist/lib/hot-channels/run.d.ts +6 -0
- package/dist/lib/hot-channels/run.js +4 -0
- package/dist/lib/hot-channels/signals-pass.d.ts +64 -1
- package/dist/lib/hot-channels/signals-pass.js +21 -49
- package/dist/lib/install/claude-targets.d.ts +12 -1
- package/dist/lib/install/claude-targets.js +70 -5
- package/dist/lib/install/codex-pack-contributions.js +1 -1
- package/dist/lib/install/codex-targets.d.ts +2 -2
- package/dist/lib/install/codex-targets.js +48 -5
- package/dist/lib/install/hook-target.d.ts +4 -1
- package/dist/lib/install/hook-target.js +14 -1
- package/dist/lib/lanes/canonical-host.d.ts +35 -0
- package/dist/lib/lanes/canonical-host.js +65 -0
- package/dist/lib/lanes/host-capacity.d.ts +30 -0
- package/dist/lib/lanes/host-capacity.js +29 -3
- package/dist/lib/mesh/live/daemon/run.d.ts +2 -0
- package/dist/lib/mesh/live/daemon/run.js +5 -2
- package/dist/lib/mesh/live/flush.d.ts +5 -1
- package/dist/lib/mesh/live/flush.js +12 -6
- package/dist/lib/mesh/live/reporting-privacy.d.ts +32 -0
- package/dist/lib/mesh/live/reporting-privacy.js +56 -1
- package/dist/lib/mesh/live/spool.d.ts +7 -0
- package/dist/lib/mesh/live/spool.js +25 -0
- package/dist/lib/packages/setup-block.d.ts +2 -2
- package/dist/lib/packages/setup-block.js +2 -2
- package/dist/lib/packages/start-bot.d.ts +1 -1
- package/dist/lib/packages/start-bot.js +1 -1
- package/dist/lib/person-setting-cache.d.ts +38 -0
- package/dist/lib/person-setting-cache.js +98 -0
- package/dist/lib/safe-store.d.ts +245 -0
- package/dist/lib/safe-store.js +777 -0
- package/dist/lib/signals/engine.d.ts +29 -2
- package/dist/lib/signals/engine.js +103 -4
- package/dist/lib/signals/reply.js +73 -18
- package/dist/lib/signals/steps/adapters.js +7 -2
- package/dist/lib/signals/steps/extract.d.ts +13 -0
- package/dist/lib/signals/steps/extract.js +84 -4
- package/dist/main.js +47 -4
- package/dist/schemas/hq-environment-profile.v1.schema.json +438 -0
- package/dist/types.d.ts +1 -1
- package/dist/utils/auth-expiry.d.ts +8 -0
- package/dist/utils/auth-expiry.js +53 -0
- package/dist/utils/callback-port-busy.d.ts +1 -1
- package/dist/utils/callback-port-busy.js +4 -4
- package/dist/utils/cli-telemetry.d.ts +21 -0
- package/dist/utils/cli-telemetry.js +34 -0
- package/dist/utils/command-usage.d.ts +275 -0
- package/dist/utils/command-usage.js +797 -0
- package/dist/utils/hook-trust.d.ts +7 -0
- package/dist/utils/hook-trust.js +34 -4
- package/dist/utils/host-registration.d.ts +179 -0
- package/dist/utils/host-registration.js +505 -0
- package/dist/utils/resident-package-preload.js +2 -0
- package/package.json +10 -8
- package/scripts/bench-core.mjs +1096 -0
- package/scripts/check-function-manifest.mjs +702 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,174 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [5.345.218] — 2026-11-14
|
|
6
|
+
|
|
7
|
+
- `hq-session add company <slug>` with a slug that has no folder now says which folder it looked for (`companies/<slug>/`, with the full path) and what to do next: run `ls companies/` and pass the exact folder name, or create the company with `/newcompany`. It used to say the slug "must use the exact real directory name". Follow-up for feedback ec3775c2, finding 2 (finding 1, demote after retire, was fixed in #2621).
|
|
8
|
+
|
|
9
|
+
- Simplified equivalent policy-selection and session-scope conditions for Clippy 1.95 without changing their behavior or lint settings.
|
|
10
|
+
- `hq env validate` no longer slows down on long text: the check for credential-shaped strings now applies the shared secret patterns to bounded windows of each string (a 320 KB note took 29 s; a 1 MB note now validates in under half a second). It rejects everything those patterns reject, except three kinds of ordinary text that are now accepted: a sentence that names the Slack token prefix, an `Authorization` header followed by a secret's NAME in upper snake case, and a host name that starts with `sk-` and ends in a known suffix (in notes or in aliases). These exemptions fail closed, so some ordinary text is still rejected. A string that holds a private-key header line is always rejected; describe the key type in words instead. A URL with an inline password (`scheme://user:password@host`, including an empty user name) is now rejected.
|
|
11
|
+
- Fixed an intermittent MCP worker test failure by publishing its completed capture file atomically.
|
|
12
|
+
- The seven staff commands are now marked as being retired in the command
|
|
13
|
+
table: `hq staff reset-test-account`, `hq staff test-account add`,
|
|
14
|
+
`hq staff test-account remove`, `hq staff test-account list`,
|
|
15
|
+
`hq staff listings queue`, `hq staff listings approve` and
|
|
16
|
+
`hq staff listings reject`. They only ever worked for an HQ staff sign-in.
|
|
17
|
+
The retiring gate is switched off, so nothing changes: each one runs as
|
|
18
|
+
before, prints no notice, and is still listed by `hq staff --help`. The mark
|
|
19
|
+
names the staff-only hq-staff script outside the public CLI as the
|
|
20
|
+
replacement, for when the gate is switched back on.
|
|
21
|
+
- When the enforcement gate's state folder, or a `workspace/` or `workspace/orchestrator/` above it, can be written by group or other (as a clone under umask 0002 leaves them), the gate still reads its gate facts there, so a call gated on a missing fact is blocked as before, and because a fact can no longer be recorded there it stays blocked until the folder is fixed. The required skills and briefs a prompt sets, and the receipts a tool result records, cannot be kept between events there, so the gate denies outbound calls natively (exit 2), on both `hq-hook run` and the bridged ports.
|
|
22
|
+
- This deny covers every outbound call the gate checks, including when no policy sets a required skill or brief: on such a tree `hq dm`, Slack, `git push` and other outbound calls are refused until the folder is fixed. Each denied call prints one stderr line that names the folder or folders, escaped, and gives the fix (`chmod go-w` on them). The native path also names such folders with the fix in one stderr line per session.
|
|
23
|
+
- This replaces what the earlier `hq-hook run` policy-injection entry says about such folders: the native path still names them with the fix, but it no longer allows every call over them, and the outbound deny above applies.
|
|
24
|
+
- Match the jq on PATH when the native policy gate reports a jq index error: the wording is read from jq's own error instead of its version number, since Ubuntu 26.04's jq 1.8.1 keeps the 1.7 wording.
|
|
25
|
+
- `hq-hook run --host <host> <Event>` now injects policies natively through the `policy-injection` evaluator, the only policy injector on that path; it starts no shell hook, awk or Node program. Context goes out only on events whose context the host passes to the model (Claude Code and Codex: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse; Grok Build: PostToolUse; fleet runtimes: session start and pre-LLM call). On other events the reminder is held and returned with the next delivered event, and a policy is recorded as shown only once its text was returned. Policy text has the chain's first context priority. The enforcement gate runs with its real state on this path and gives the same blocks and context as the bridged port. No host registration calls `hq-hook run` yet.
|
|
26
|
+
- The policy injector's state files (session ledgers and their locks, held reminders, the enforcement list, emit statistics, the scope flag cache) and the enforcement gate's state (`workspace/orchestrator/policy-enforcement`: the session state, policy list, pass stamp and lock; and its gate facts, proofs and override tokens under `workspace/orchestrator/hook-state`) now go through the shared store in `crates/hq-hook/src/host/store.rs`: no link is followed, files must be regular with one link and owned by the account, folders must be owned by the account with no group or other write bit, and deletes and renames run inside the checked folder handle. This also applies to the existing `inject-policy-on-trigger` and `policy-enforcement-gate` ports that `master-hook.sh` can bridge, and closes the write through a link planted at the gate's state folder that those ports could make on main. A gate state path the store refuses (a link, a second name, a FIFO, another account's path) denies the call natively (exit 2) with one stderr line naming it, on every call: the gate never allows because it could not read its state. A state folder or file that group or other can write (for example one made under umask 0002) is never written: nothing is recorded there and reminders may repeat, but the enforcement gate still reads its state and facts there and blocks a missing required fact as before. The native path names such folders, escaped, with the fix in words in one stderr line per session, and never blocks a call over it. On Windows and other non-Unix systems the store is off until US-022: both ports deny every call, before any hand-back case, with one stderr line naming the hook-engine-port flag to turn off and never hand a call back to bash, and the `hq-hook run` policy evaluator refuses UserPromptSubmit and PreToolUse with one line. Windows stays on the shell hooks.
|
|
27
|
+
- Fix `policy.check` denying every company path with "This call has an invalid agent_id" when the daemon's environment held hook fields from another call. The daemon no longer passes any `HQ_HOOK_*` variable to the hook scripts it runs, and `hq daemon run` drops them from its own environment at startup.
|
|
28
|
+
- Require approval before editing replay evidence in hq-cli checkouts, worktrees, or the local recorder store.
|
|
29
|
+
- Fixed: for people with the `core.next` flag on, `hq reindex` replaced the HQ end-of-turn (Stop) hook with the new hook core, although the new core does only part of that event. Several end-of-turn hooks stopped running, among them the lanes monitor gate, linked-session message delivery, pattern capture, the autosave sweep, and the share and after-turn suggestions. Switching back with `~/.hq/state/core-next.off`, `HQ_CORE_NEXT=off`, `HQ_FLAG_CORE_NEXT=false` or the flag turned off did not undo it. Now an event moves to the new core on Claude Code, Codex or Grok Build only when the new core does every hook the old dispatcher runs for that event in your HQ folder. The hook list is read from the folder and compared with what the installed engine reports. Every other event, including Stop today, stays on the old dispatcher with no new-core entry, so no hook runs twice. Switching off removes the new-core entries and restores the registrations exactly as they were, including a Stop entry that an HQ settings update had moved into `.claude/settings.local.json`; the next `hq reindex` repairs a folder that was already switched. `hq reindex` reports a `.claude/settings.local.json` it cannot parse or that is a link instead of changing it. `hq doctor` now fails a new-core entry that runs beside the old one, one whose event has a hook the new core does not do (for example a hook added after the switch), and one still registered while the kill switch is on. It also says that `HQ_CORE_NEXT` set only in an app's environment is read by the hook engine and not by `hq reindex`.
|
|
30
|
+
- Fixed CLI guidance and generated pack-install commands to use the owning sign-in, daemon sync, and content-pack commands. Existing duplicate compatibility and retirement behavior is unchanged.
|
|
31
|
+
|
|
32
|
+
## [5.345.217] — 2026-11-14
|
|
33
|
+
|
|
34
|
+
- 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.
|
|
35
|
+
|
|
36
|
+
- `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.
|
|
37
|
+
- The local command count no longer follows a link at
|
|
38
|
+
`~/.hq/command-usage/usage.tsv` and no longer waits on a named pipe there.
|
|
39
|
+
When that path is a link (symbolic or hard), a pipe, or a folder, or the
|
|
40
|
+
folder is a link, belongs to another user, or is writable by others, no
|
|
41
|
+
count is kept and the command runs as it would otherwise.
|
|
42
|
+
- An existing `~/.hq/command-usage` folder of yours that only you can write to
|
|
43
|
+
(for example mode 0755) is changed to mode 0700 the next time `hq` counts a
|
|
44
|
+
run. A folder that the group or others can write to is left as it is, and no
|
|
45
|
+
count is kept in it.
|
|
46
|
+
- `--i-still-use-this` is read only before the command's own arguments
|
|
47
|
+
(`hq old thing --i-still-use-this`). In `hq run tool --i-still-use-this` the
|
|
48
|
+
flag now belongs to `tool`.
|
|
49
|
+
- An installed `hq` ignores the test-only variable that names another command
|
|
50
|
+
states table, so the environment cannot switch the retiring-command gate off.
|
|
51
|
+
- 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).
|
|
52
|
+
- 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.
|
|
53
|
+
- `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`.
|
|
54
|
+
- `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.
|
|
55
|
+
- 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.
|
|
56
|
+
- `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.
|
|
57
|
+
- 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.
|
|
58
|
+
- 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.
|
|
59
|
+
- 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.
|
|
60
|
+
- `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.
|
|
61
|
+
- 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.
|
|
62
|
+
- 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.
|
|
63
|
+
- 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.
|
|
64
|
+
- 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.
|
|
65
|
+
- block-hq-glob: searched paths outside ASCII are now compared natively instead of always starting git.
|
|
66
|
+
- 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.
|
|
67
|
+
- block-hq-glob: on Windows, the `nul` value MSYS passes for `BASH_ENV=/dev/null` no longer hands every bridged call back to bash.
|
|
68
|
+
- 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.
|
|
69
|
+
- The host canary uses the CLI’s shared safe-store implementation for evidence files, bundled for standalone Node 20 and 22 hook callbacks.
|
|
70
|
+
- 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.
|
|
71
|
+
- 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.
|
|
72
|
+
- 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.
|
|
73
|
+
- 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.
|
|
74
|
+
- `hq-hook record` can record hook events on a trial machine: when the flag
|
|
75
|
+
`core.replay-recorder` is on for the person or machine, each event's payload
|
|
76
|
+
and the hook answer are redacted and appended to a size-capped store under
|
|
77
|
+
`~/.hq/replay-recorder`. It is off by default; `HQ_REPLAY_RECORDER` set to
|
|
78
|
+
`off`, `0`, `false`, `no` or `disabled`, or `~/.hq/replay-recorder.off`,
|
|
79
|
+
turns it off. It records on macOS and Linux only; on Windows it records
|
|
80
|
+
nothing for now. `hq doctor` shows whether it is on and how much it holds.
|
|
81
|
+
- `hq` now keeps a local count of the commands you run, in
|
|
82
|
+
`~/.hq/command-usage/usage.tsv`: the date and the command name of each run,
|
|
83
|
+
never arguments or values. The file is never sent, synced, or attached to
|
|
84
|
+
feedback, so `HQ_TELEMETRY=0` does not turn it off; it is kept to about
|
|
85
|
+
512 KiB and 30 days. `hq doctor usage` (and `--json`) shows the counts, and a
|
|
86
|
+
one-time notice on the first interactive run says what is stored.
|
|
87
|
+
- A command that is being retired no longer runs: it prints what replaced it
|
|
88
|
+
and exits non-zero. Add `--i-still-use-this` after the command name to run it
|
|
89
|
+
anyway; those runs are counted apart. No command is marked as retiring in
|
|
90
|
+
this release.
|
|
91
|
+
- `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.
|
|
92
|
+
- Six commands are now marked as being retired: `hq crm entity list`,
|
|
93
|
+
`hq crm entity get`, `hq report promote`, `hq report discard-draft`,
|
|
94
|
+
`hq report access` and `hq report templates`. Run without a flag, each one
|
|
95
|
+
prints `"<command>" is being retired and did not run. No replacement is
|
|
96
|
+
listed.` and exits non-zero without doing anything. To run one anyway, add
|
|
97
|
+
`--i-still-use-this` after the command name, for example
|
|
98
|
+
`hq report access <reportId> --mode company --i-still-use-this`; it then
|
|
99
|
+
works as before and the run is counted apart in `hq doctor usage`. Nothing
|
|
100
|
+
is deleted in this release, and `hq --help` still lists the commands.
|
|
101
|
+
- `hq crm entity upsert`, `hq report get`, `hq report publish`,
|
|
102
|
+
`hq report adopt` and `hq report decommission` are unchanged: the CRM pack
|
|
103
|
+
and scheduled report jobs still run them. `hq db`, `hq team-sync`,
|
|
104
|
+
`hq modules` and `hq deploy` are unchanged.
|
|
105
|
+
- `hq auth logout` now signs out the same way as `hq logout`: it ends the
|
|
106
|
+
session on the HQ server (the refresh token is revoked) and then deletes the
|
|
107
|
+
local tokens. Before, it only deleted the local file. If the server cannot be
|
|
108
|
+
reached, both commands still delete the local tokens and say the session
|
|
109
|
+
could not be ended everywhere.
|
|
110
|
+
- `hq whoami` now also shows what `hq auth status` showed: whether the session
|
|
111
|
+
is valid or about to expire, when it expires, and the token source.
|
|
112
|
+
`hq whoami --json` adds `sessionExpiresAt` and `sessionExpiring`.
|
|
113
|
+
- `hq packages packs list`, `hq packages packs update`,
|
|
114
|
+
`hq packages packs uninstall` and `hq packages remove` are being retired.
|
|
115
|
+
They no longer run and instead name the command to use: `hq packs list`,
|
|
116
|
+
`hq packs update`, `hq packs uninstall` or `hq remove`. Add
|
|
117
|
+
`--i-still-use-this` after the command name to run one anyway.
|
|
118
|
+
- `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`.
|
|
119
|
+
- `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.
|
|
120
|
+
- `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.
|
|
121
|
+
- `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.
|
|
122
|
+
- `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.
|
|
123
|
+
- `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.
|
|
124
|
+
- 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.
|
|
125
|
+
- 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.
|
|
126
|
+
- `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.
|
|
127
|
+
- HQ MCP calls and gateway calls now show as "$0.10 per 100 calls". The
|
|
128
|
+
bundled price card matches the live feed, at $0.001 a call for both. A
|
|
129
|
+
price under one cent no longer prints as $0.00.
|
|
130
|
+
- 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.
|
|
131
|
+
- `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`).
|
|
132
|
+
- 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.
|
|
133
|
+
- The Work Mesh Live daemon no longer asks the server for your HQ Anywhere
|
|
134
|
+
setting every 10 seconds. It makes no request while there is nothing to
|
|
135
|
+
send, reads the setting once when it first has something to send, and reads
|
|
136
|
+
it again when your sign-in or the local HQ Anywhere state changes, or after
|
|
137
|
+
15 minutes. If the setting cannot be read, nothing is reported.
|
|
138
|
+
- `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.
|
|
139
|
+
- 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.
|
|
140
|
+
- `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.
|
|
141
|
+
- The retiring-command refusal and its notice, described in other notes for
|
|
142
|
+
this release, are switched off before shipping. No command is refused or
|
|
143
|
+
warned about for being retired. The ten commands marked `retiring`
|
|
144
|
+
(`hq crm entity list`, `hq crm entity get`, `hq report access`,
|
|
145
|
+
`hq report discard-draft`, `hq report promote`, `hq report templates`,
|
|
146
|
+
`hq packages packs list`, `hq packages packs update`,
|
|
147
|
+
`hq packages packs uninstall` and `hq packages remove`) behave as they did
|
|
148
|
+
in 5.345.215.
|
|
149
|
+
- `--i-still-use-this` is accepted. Its only effect is that the run is counted
|
|
150
|
+
apart in `hq doctor usage`.
|
|
151
|
+
- The local command count (`hq doctor usage`) and the list of commands marked
|
|
152
|
+
`retiring` stay in place.
|
|
153
|
+
- Adds an internal module, `src/lib/safe-store.ts`, that the local stores
|
|
154
|
+
`hq` keeps under your home folder will use to read and write their files.
|
|
155
|
+
It holds the store folder open, refuses a folder or file that a link, a
|
|
156
|
+
pipe, another user or a group- or world-writable mode could redirect, and
|
|
157
|
+
refuses an operation when the folder was replaced while it ran. No store
|
|
158
|
+
uses it yet, so nothing changes in this release.
|
|
159
|
+
- `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.
|
|
160
|
+
- 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.
|
|
161
|
+
- `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`).
|
|
162
|
+
- 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.
|
|
163
|
+
- 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.
|
|
164
|
+
- `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.
|
|
165
|
+
- 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.
|
|
166
|
+
- 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.
|
|
167
|
+
- `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.
|
|
168
|
+
- 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.
|
|
169
|
+
- 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.
|
|
170
|
+
- `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.
|
|
171
|
+
- 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.
|
|
172
|
+
|
|
5
173
|
## [5.345.215] — 2026-11-12
|
|
6
174
|
|
|
7
175
|
- `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
|
|
@@ -168,7 +213,7 @@ it is added to an agent's context.
|
|
|
168
213
|
|
|
169
214
|
### Sign in without opening a browser
|
|
170
215
|
|
|
171
|
-
Run `hq login --no-browser`
|
|
216
|
+
Run `hq login --no-browser` to print a sign-in
|
|
172
217
|
URL and wait for completion. Open the URL in your browser. HQ also uses this
|
|
173
218
|
mode in CI and on Linux without DISPLAY or WAYLAND_DISPLAY. Existing cached
|
|
174
219
|
sessions are reused.
|
|
@@ -6,7 +6,7 @@ description: Recognize a content pack the person pastes or names (a hqforwork.co
|
|
|
6
6
|
# Adding a pack from the chat
|
|
7
7
|
|
|
8
8
|
A pack is a bundle of workers, knowledge and a setup bot that HQ installs with
|
|
9
|
-
`hq
|
|
9
|
+
`hq install`. People arrive with one in three ways: they paste a link
|
|
10
10
|
from a pack page, they type the pack's name, or they drop a folder path. You add
|
|
11
11
|
it without them leaving this conversation, and you end by introducing the bot
|
|
12
12
|
the pack brings. This skill only adds that; nothing else about how you run setup
|
|
@@ -38,7 +38,7 @@ ordinary conversation ("my co-founder is joining" is not a pack).
|
|
|
38
38
|
|
|
39
39
|
### The catalog
|
|
40
40
|
|
|
41
|
-
The catalog is what `hq
|
|
41
|
+
The catalog is what `hq packs list` prints under "Available (curated)": each
|
|
42
42
|
line is an install source like `github:indigoai-us/hq-packages#packages/hq-pack-design-styles`
|
|
43
43
|
with a description. The slug is the last segment without `hq-pack-`; the display
|
|
44
44
|
name is the slug in title case (`design-styles` is "Design Styles") unless the
|
|
@@ -72,7 +72,7 @@ conversation unless they bring it up.
|
|
|
72
72
|
|
|
73
73
|
Run, from the HQ root:
|
|
74
74
|
|
|
75
|
-
hq
|
|
75
|
+
hq install {slug-or-path} --start-bot
|
|
76
76
|
|
|
77
77
|
`{slug-or-path}` is the slug (`sample-kit`), or the local path when the message
|
|
78
78
|
carried one. Quote a path with spaces. Wait for it to finish; it can take a
|
|
@@ -198,6 +198,10 @@ validate_company_slug() {
|
|
|
198
198
|
local slug="${1:-}"
|
|
199
199
|
case "$slug" in ''|*[!a-zA-Z0-9_-]*) echo "hq-session: invalid company_slug: '$slug' (allowed characters: A-Z a-z 0-9 - _)" >&2; return 1 ;; esac
|
|
200
200
|
[ "$slug" != personal ] || { echo "hq-session: personal cannot be combined with a company" >&2; return 1; }
|
|
201
|
+
if [ ! -e "$REPO_ROOT/companies/$slug" ] && [ ! -L "$REPO_ROOT/companies/$slug" ] && ! hq_session_has_case_alias "$REPO_ROOT" "$slug"; then
|
|
202
|
+
echo "hq-session: no company directory at companies/$slug/ (looked for $REPO_ROOT/companies/$slug/). Run ls companies/ and pass the exact directory name, or create the company first with /newcompany." >&2
|
|
203
|
+
return 1
|
|
204
|
+
fi
|
|
201
205
|
if [ -L "$REPO_ROOT/companies/$slug" ] || ! hq_session_has_exact_company_dir "$REPO_ROOT" "$slug" || hq_session_has_case_alias "$REPO_ROOT" "$slug"; then
|
|
202
206
|
echo "hq-session: company_slug must use the exact real directory name: '$slug'" >&2
|
|
203
207
|
return 1
|
|
@@ -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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
|
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: "
|
|
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
|
|
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": "
|
|
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",
|
package/dist/command-help.js
CHANGED
|
@@ -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);
|