@indigoai-us/hq-cli 5.345.217 → 5.345.219
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 +105 -0
- package/README.md +1 -1
- package/assets/bot-workers/setup/skills/add-a-pack.md +3 -3
- package/assets/scaffold/core/scripts/hq-session.sh +4 -0
- package/dist/command-catalog.generated.d.ts +69 -0
- package/dist/command-catalog.generated.js +83 -0
- package/dist/commands/agents.d.ts +22 -0
- package/dist/commands/agents.js +92 -1
- package/dist/commands/cloud.d.ts +1 -1
- package/dist/commands/cloud.js +1 -1
- package/dist/commands/core-hook-registration-plan.d.ts +8 -0
- package/dist/commands/core-hook-registration-plan.js +21 -0
- package/dist/commands/core-hq-session-native.js +3 -0
- package/dist/commands/core.js +9 -0
- package/dist/commands/doctor.js +4 -0
- package/dist/commands/install-global.js +1 -1
- package/dist/commands/lanes-shared.d.ts +2 -0
- package/dist/commands/lanes-watch.js +28 -1
- package/dist/commands/lanes.d.ts +2 -0
- package/dist/commands/lanes.js +99 -9
- 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/reindex.js +6 -0
- package/dist/commands/sync-narrow.js +1 -1
- package/dist/commands/team-sync.js +1 -1
- package/dist/data/command-states.json +8 -1
- package/dist/index.js +8 -0
- package/dist/lib/anywhere-person-setting.d.ts +2 -2
- package/dist/lib/anywhere-person-setting.js +2 -2
- package/dist/lib/billing/usage-cost.js +5 -2
- package/dist/lib/bot/pack-link.d.ts +2 -2
- package/dist/lib/bot/pack-link.js +2 -2
- package/dist/lib/daemon/anywhere-listener.d.ts +33 -1
- package/dist/lib/daemon/anywhere-listener.js +86 -4
- package/dist/lib/daemon/hook-env.d.ts +32 -0
- package/dist/lib/daemon/hook-env.js +51 -0
- package/dist/lib/daemon/machine-check-owner.d.ts +21 -0
- package/dist/lib/daemon/machine-check-owner.js +95 -0
- package/dist/lib/daemon/machine-check-registration.d.ts +4 -0
- package/dist/lib/daemon/machine-check-registration.js +64 -0
- package/dist/lib/daemon/machine-checks.d.ts +144 -0
- package/dist/lib/daemon/machine-checks.js +412 -0
- package/dist/lib/daemon/ops/policy.js +5 -3
- package/dist/lib/daemon/run.js +37 -5
- package/dist/lib/daemon/server.d.ts +2 -0
- package/dist/lib/daemon/server.js +6 -0
- package/dist/lib/daemon/state-file.d.ts +12 -1
- package/dist/lib/daemon/state-file.js +23 -1
- package/dist/lib/doctor/checks/fleet-hook-core.d.ts +4 -0
- package/dist/lib/doctor/checks/fleet-hook-core.js +103 -0
- package/dist/lib/doctor/checks/host-core.d.ts +2 -0
- package/dist/lib/doctor/checks/host-core.js +81 -11
- package/dist/lib/doctor/checks/machine-checks.d.ts +16 -0
- package/dist/lib/doctor/checks/machine-checks.js +103 -0
- package/dist/lib/doctor/checks/sync-runtime.js +3 -3
- package/dist/lib/doctor/registry.js +4 -0
- package/dist/lib/doctor/types.d.ts +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.js +4 -16
- package/dist/lib/hook-engine/canary-gate.d.ts +64 -0
- package/dist/lib/hook-engine/canary-gate.js +147 -0
- package/dist/lib/hook-engine/coverage.d.ts +15 -0
- package/dist/lib/hook-engine/coverage.js +130 -0
- package/dist/lib/hook-engine/fleet-registration.d.ts +30 -0
- package/dist/lib/hook-engine/fleet-registration.js +132 -0
- package/dist/lib/hook-engine/reconcile.js +297 -116
- package/dist/lib/hook-engine/registration-identity.d.ts +33 -0
- package/dist/lib/hook-engine/registration-identity.js +97 -0
- package/dist/lib/hook-engine/registration.d.ts +1 -23
- package/dist/lib/hook-engine/registration.js +1 -52
- package/dist/lib/hook-engine/resolve.d.ts +2 -0
- package/dist/lib/hook-engine/resolve.js +7 -3
- package/dist/lib/install/claude-targets.js +28 -15
- package/dist/lib/install/codex-pack-contributions.js +1 -1
- package/dist/lib/install/codex-targets.js +24 -11
- package/dist/lib/install/hook-target.d.ts +2 -2
- package/dist/lib/install/hook-target.js +7 -5
- package/dist/lib/lanes/canonical-host.d.ts +8 -1
- package/dist/lib/lanes/canonical-host.js +9 -3
- package/dist/lib/lanes/machine-identity.d.ts +15 -0
- package/dist/lib/lanes/machine-identity.js +26 -0
- package/dist/lib/lanes/spawn.js +17 -3
- 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/main.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/callback-port-busy.d.ts +1 -1
- package/dist/utils/callback-port-busy.js +4 -4
- package/dist/utils/core-next-flag.d.ts +4 -0
- package/dist/utils/core-next-flag.js +22 -0
- package/dist/utils/core-next-kill.d.ts +16 -0
- package/dist/utils/core-next-kill.js +35 -0
- package/dist/utils/hook-trust.js +4 -1
- package/dist/utils/host-registration.d.ts +80 -17
- package/dist/utils/host-registration.js +194 -47
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,111 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [5.345.219] — 2026-11-15
|
|
6
|
+
- Add `hq agents create-external` so an admin can mint an external bot and
|
|
7
|
+
a one-time enrollment code from the CLI. Console Add bot is hosted-only
|
|
8
|
+
and no longer exposes this path.
|
|
9
|
+
- Reduced test time spent waiting for mocked bot readiness and lane-lock deadlines. Added coverage-provider and slow-file timings to CI output so test execution, worker shutdown, coverage generation, and report writing can be distinguished.
|
|
10
|
+
- The twelve machine checks that ran on every session start or prompt (HQ update, client health, stale model pin, desktop bridge health, review base repair, welcome brief, vault access refresh, setup completeness, fingerprint hooks, agent-browser presence, and the hq CLI and HQ desktop install checks) can now run on the daemon's schedule instead: about a minute after the daemon starts and then hourly, never closer than 15 minutes apart, one at a time, each with its own time limit. The schedule runs when the new hook core (`core.next`) is on for this machine, read at each run so a change takes effect without a daemon restart, and stays off whenever a switch that sends the machine back to the old core is set: `HQ_CORE_NEXT` set to `off`, `0`, `false` or `no`, `HQ_HOOK_ENGINE=off`, or a `~/.hq/state/core-next.off` or `~/.hq/hook-engine.off` file. A script is run only when it is a regular file inside the HQ root with one link, owned by the user and not writable by group or others, in folders that pass the same rules; anything else is reported as not installed or refused and is not run. The results are written owner-only to `~/.hq/daemon/machine-checks.json` and carried into the daemon's state file with each finding's full text and a fingerprint. The hook engine shows each new finding once, at a session start, with no process and no network call, and records what it showed in an owner-only ledger. A finding is recorded as shown only once it is in the session's context; a finding cut or dropped to fit the host's limit is shown at a later start. `hq doctor --only machine-checks` runs the same checks on demand with no daemon (`--verbose` and `--json` include the full text), and a doctor started from inside a check does not start them again.
|
|
11
|
+
|
|
12
|
+
- The legacy dispatcher transfers checks only when this host has a native SessionStart registered for the daemon's HQ root, core.next is enabled, the daemon heartbeat is fresh, and scheduled results exist. The schedule stays dormant without a native SessionStart. Ordinary doctor calls show cached results and their age; only `--only machine-checks` runs repair-capable scripts, with a warning. Findings are recorded as shown only after stdout is written and flushed successfully.
|
|
13
|
+
|
|
14
|
+
- Keep offline machine-check registration and kill-switch queries independent of hook installation metadata so bundled daemon startup and restart work outside the CLI source layout.
|
|
15
|
+
- Isolate launcher and probe test subprocesses from the developer's HQ environment, home, caches and working directory while preserving each test's explicit fixture settings.
|
|
16
|
+
- The host canary (`scripts/host-canary.mjs`) now passes `HQ_FLAG_CORE_NEXT` and the core.next kill switches to the host and its hooks, runs `hq reindex` on its disposable HQ root first (a failed reindex fails the run), and records which command answered each hook, with a per-event `path: shell`, `path: native`, or `path: native+shell` line.
|
|
17
|
+
- New test-only `--fake-full-coverage` mode points that reindex at a stand-in engine that claims every hook, so a canary run can prove the new hook core is actually called.
|
|
18
|
+
- Codex hooks in the host canary are the tracked `.codex/config.toml` registration (parsed; a parse error or missing tool hooks fails the host, as before) combined per event with the `hooks.json` files `hq reindex` rewrites (the user-scope `$CODEX_HOME/hooks.json`, seeded first with what `hq install` writes, and the root's `.codex/hooks.json`). An event where both a shell and a new-core registration run prints `path: native+shell`, so with `--fake-full-coverage` Codex shows `native+shell` because config.toml still runs the shell adapter.
|
|
19
|
+
- Fix the native credential guard being looser than bash on Linux for the hq-core 16.0.46 and #1926 guard versions: in a UTF-8 locale, glibc's regex matches a long-s (U+017F) look-alike against `s`, so bash blocks python3 code that names `.aw<long-s>/credentials` and native now blocks it too. Fold revisions and macOS are unchanged.
|
|
20
|
+
- Make the credential-guard fold tests probe the disk (case-insensitive or not) and bash's own case matching at run time, so the 16.0.46 expectations hold on Linux and stay exactly as before on macOS. Add Linux regression rows.
|
|
21
|
+
- The native detect-secrets port now shortens values in jq's join error the way the installed jq does (jq 1.7.x, 1.8.0/1.8.1, 1.8.2), chosen from `jq --version`; unknown versions use the 1.8.2 style. The verdict is unchanged.
|
|
22
|
+
- `hq-hook` on Linux now answers like the bash it replaces in two cases. The native credential guard no longer reads the no-break space U+00A0 (or U+2007, U+202F) as a word break in a UTF-8 locale, since glibc does not, so `xargs "git<U+00A0>show"` is allowed as bash allows it instead of blocked. The deterministic gate hands a macOS bash 3.2 capture in a multibyte locale other than UTF-8 (eucJP and the like) back to bash off macOS instead of answering it. The delivery-regex parity test compares non-ASCII policy lines only in the C locale off macOS, where awk multibyte decoding is not ported by design.
|
|
23
|
+
- `hq-hook dispatch` now blocks a tool call when a PreToolUse hook registry safety guard (`"safety": true`) points at a script that is missing, as master-hook.sh does. It exits 2 with `BLOCKED: a required HQ safety check is missing (<id>). Run hq rescue from a terminal (or re-run /update-hq) to repair it, then retry.` Before, a missing safety script was skipped and the tool call ran unchecked; only `fail_closed` rows blocked. A guard marked both `safety` and `fail_closed` gets the new message. Missing scripts on other events, and missing non-safety rows without `fail_closed`, are still skipped (owner decision, 2026-11-10).
|
|
24
|
+
- The protect-core test corpus from the closed native port (#2430) now runs against the US-010 path rule table: 100 observed file tool calls and 12 symlinked-cwd relative writes, each under every project and PWD spelling. Tests only; hook behaviour is unchanged.
|
|
25
|
+
- `hq-hook run --host <host> Stop` reads the caller's token file (`~/.hq/cognito-tokens.json` or `HQ_COGNITO_TOKENS_FILE`) as the old checkpoint gate read it: through links, with no folder or file mode check, as a regular file only. Before, a group-writable `~/.hq` or token file, a linked `~/.hq`, a token file with a second hard link, or an override file in a shared folder left the caller's email unknown and silently skipped the opt-in company-scope gate. A folder or FIFO in the token file's place now applies the scope gate as for an in-scope caller, with one stderr line. The PreCompact banner reads today's journal `INDEX.md` the same way, so a linked HQ root or a umask-002 journal folder no longer drops it. No host registration calls `hq-hook run` yet, so hook behavior is unchanged.
|
|
26
|
+
- Fix the hq-hook Windows build and Clippy run that failed the v5.345.218 tag build: a Windows-only test was missing the new `stop_deliverable` field, `scope_bash` tests used Unix-only file APIs, and several test helpers used only by Unix tests were reported as dead code on Windows. Also clear two Clippy errors in the native grep/sed code that failed Windows and Linux (a test-only `compile` reported as never used, and a needless deref). No behaviour change.
|
|
27
|
+
- CI: hq-hook pull requests now run Clippy for the x86_64-pc-windows-msvc target on the Linux runner, so Windows-only compile and lint breaks fail the PR instead of the release tag build. ring's C build uses stub compiler and archiver scripts in scripts/ci because Clippy never links.
|
|
28
|
+
- Fix two Windows clippy lints in hq-hook (a redundant `return` in the injector's scope-cache clock, and items after the test module in the plans-dir port) that failed the v5.345.216 tag build. No behaviour change.
|
|
29
|
+
- The native detect-secrets port now shortens values in jq's join error the jq 1.6 way on hosts whose `jq --version` is 1.6 (for example Ubuntu 22.04): 11 bytes, then `...`, the same as jq 1.7.x. Before, jq 1.6 fell back to the 1.8.2 style. Unknown versions still use the 1.8.2 style. The verdict is unchanged.
|
|
30
|
+
- hq-hook's collation tests now pass on macOS 15.7.7, which orders characters that older macOS collated equal under en_US.UTF-8 and ja_JP.UTF-8. The image-context-guard tests ask the host's awk which ledger paths tie and require bash to treat exactly those as already seen, with at least the old number of collisions, adding `LC_COLLATE=kk_KZ.PT154` cases that still tie. The glob tie tests choose a locale that ties on the host: en_US.UTF-8 where it still does, otherwise kk_KZ.PT154. A new test checks the untied en_US.UTF-8 order against both bashes. The hook's behavior is unchanged.
|
|
31
|
+
- The native Stop check now does what the `40-auto-acl-share-suggestion.sh` and `50-after-turn-suggestions.sh` hooks did: the share-suggestion reminder and the after-turn suggestions, with the same first-turn note and saved state. Neither can block a Stop. Claude Code gets plain text, Codex gets a `systemMessage`, and Grok and Fleet get nothing, matching the old hooks.
|
|
32
|
+
- `hq-hook capabilities` now lists both hooks as covered for Stop. Stop still runs on the old dispatcher until the remaining Stop hooks are ported.
|
|
33
|
+
- Check credential reads natively through the optional hook entrypoint, including Git history, without shell or helper subprocesses. Refuse unsupported Git inputs and argv forms, and include untracked stash files in credential checks.
|
|
34
|
+
- In a repository with replacement refs (`git replace`) or a grafts file, history reads are refused natively, because the guard cannot model that history. Staged changes (`git diff --cached`) and commits that only a linked worktree's HEAD reaches are checked too.
|
|
35
|
+
- The native Stop check now runs the lanes Monitor gate and delivers linked-session messages at Stop, the way `lanes-senior-monitor-stop-gate` and the Stop half of `conduct-lanes-link-deliver` did. Each calls `hq lanes` with a hard time limit that also stays inside the hook's time budget.
|
|
36
|
+
- A Claude Code Stop whose hook input cannot be read is now refused with the lanes gate's message, as the shell gate refused it. Before, it was let through.
|
|
37
|
+
- Run validate-policy-frontmatter natively, with the same allow and deny messages as the pinned shell and no child processes on the PreToolUse path. Inputs the port does not model (non-UTF-8 or NUL payloads, Windows policy writes, hq launchers it cannot read the version of) are blocked with a one-line message instead of being handed back to bash.
|
|
38
|
+
- Reduce test-suite waiting by advancing lock retry clocks in focused command tests and sharing per-case signed-out CLI fixtures. Preserve assertions and process isolation. Add coverage lifecycle timing markers so CI reports the gap between the last test, coverage generation, report writing and shutdown.
|
|
39
|
+
- One host id per machine, the remaining writers and readers. A lane created with `--runner subagent` now records the same stable host id as a worker lane on that machine (the id in `~/.hq/lane-host.json`), where it used to record the hostname. When that file cannot be created or updated, the lane is still created and records the id already on disk, or the hostname when there is none; when the file is not valid, it records the hostname. Placement, Claude account balancing and the local `host_capacity` entry of `hq runners list --json` now count the lanes that lane admission treats as running on this machine, so a lane written under the machine's old hostname id is counted with the lanes written under its stable id, and on a machine that is not an Outpost `hq runners list` and `hq runners capacity` print the same local counts. Fixed: resuming or messaging a Claude lane written under an older id of this machine failed with `claude_account_balance_target_host_unavailable`; `hq lanes watch` failed with `watch_account_host_unavailable` for a lane that carries an earlier hostname of this machine; and account repair at spawn ignored this machine's lanes written under its other ids. On an Outpost, `hq runners capacity --json` also lists the EC2 instance id in `host.aliases` when a lane record of the last 30 days carries it as its origin; the id is read from a local file, with no network call. Counting on an Outpost is unchanged, no lane record is rewritten, and `host.id` is unchanged.
|
|
40
|
+
- `hq-hook` now records three early exits when the replay recorder is on, each with an `exit_reason`: the new core is off and the old dispatcher cannot start (`core-off-no-dispatcher`), an unusable command line (`unusable-command-line`), and an unreadable payload (`unreadable-payload`). Nothing is recorded while the recorder is off. These records do not keep the payload. Fleet hosts are recorded as `local-bot` and `fleet-session`, as in other records. Recording cannot change the hook's answer or exit code. The hook waits at most 2 seconds for the record, the same deadline as `hq-hook record`, so a store lock held by another process or a stalled disk cannot keep the hook from exiting with its answer.
|
|
41
|
+
- `hq-hook` no longer holds an early exit past the host's time budget while it records the exit. The wait for the record is now capped at 2 seconds or the time left in the host's budget for the call, whichever is shorter (for Grok Build, 4 seconds by default), so a store lock held by another process or a stalled disk cannot keep the hook running until the host stops waiting and lets the call through. With no budget left, nothing is recorded. A recorder panic prints nothing.
|
|
42
|
+
- The daemon's hqd listener no longer re-checks HQ Anywhere every 60 seconds:
|
|
43
|
+
it checks when the daemon's shared flag read changes the HQ Anywhere answer
|
|
44
|
+
or the running hqd server's gate changes, with a 10-minute fallback check
|
|
45
|
+
for a missed event.
|
|
46
|
+
- Added tests that the hqd server reports each runtime-gate change to `onRuntimeChange` (and still revokes the login when that observer throws), and that the HQ Anywhere listener unsubscribes from daemon events on `close()`.
|
|
47
|
+
- The native hook engine can now answer two more Bash guards itself, the environment-dump guard and the secret detector, with the same decisions and messages as the shell versions and without starting a process. Both stay off until their engine flags are turned on.
|
|
48
|
+
- Tighten the US-014 injector fixture guard: `setup` and the guard now share one
|
|
49
|
+
list of copied reference and policy folders, a macOS `.DS_Store` no longer
|
|
50
|
+
fails the count locally, and the guard is renamed and split so the two
|
|
51
|
+
sequence files the differential run reads are counted apart from the four
|
|
52
|
+
records it does not read.
|
|
53
|
+
- Guard the US-014 injector corpus so a sign-off run fails unless it compares
|
|
54
|
+
all 76 sequences and 246 events with the Bash injector, and every one of the
|
|
55
|
+
3,075 injector fixture files is a policy, reference or harness file it uses.
|
|
56
|
+
- The US-015 conditional ledger now records a caller token file over the 1 MiB cap with an out-of-domain email, or none, as an old allow that becomes a block for an unbound session, and its token-file reason no longer lists layouts the gate now reads. A new `hq-hook` test reads every story's `conditional-differences.yaml` and `side-effect-differences.yaml` with the replay harness's own parser, checks the ledger shape, and fails on any block-to-allow entry outside a frozen list of ten existing US-015 ids. Tests only; hook behavior is unchanged.
|
|
57
|
+
- The native Stop check now fails closed where a refused state file or a
|
|
58
|
+
size cap hides what the old shell hooks saw. A refused checkpoint-gate
|
|
59
|
+
state folder or file (a link, a FIFO, a hard link, or a file others can
|
|
60
|
+
write) no longer lets the Stop through: the gate runs without that file,
|
|
61
|
+
still blocks, and says why. When it can neither read nor write its
|
|
62
|
+
block counter, or cannot keep its nudge file, the gate blocks at most
|
|
63
|
+
once per stop cycle: the Stop that follows a block (`stop_hook_active`)
|
|
64
|
+
goes through, so it cannot block forever. A counter it cannot read but
|
|
65
|
+
can still replace (mode 000) is rewritten and counts to three as before.
|
|
66
|
+
When the last 400 transcript lines pass the 16 MiB tail cap before the
|
|
67
|
+
turn's first message, the gate blocks as for a turn with no checkpoint,
|
|
68
|
+
at most three times in a row. When the newest reply lies past the 64 MiB scan
|
|
69
|
+
cap, the capability-link and humanize checks block once and ask for the
|
|
70
|
+
reply again. This applies where the opt-in `core.next` registration
|
|
71
|
+
routes Stop to `hq-hook run`; Windows stays on the shell Stop hook.
|
|
72
|
+
- On Grok, the native Stop check now works out whether a Stop can carry a lanes message from the Stop itself. Before, a `HQ_STOP_DECISION_DELIVERABLE` value inherited from the parent process could reach `hq lanes link _deliver`. An inherited `0` then kept the message queue on an end-of-turn Stop that should have delivered it.
|
|
73
|
+
- With a group-writable HQ folder (umask 0002), the share-suggestion reminder and the "turn off these nudges" note now show once, as the shell hooks show them. Before, they came back on every Stop. hq-hook still writes no state into such folders. It keeps the "shown" note in its own private folder instead and says once a session which folders to fix.
|
|
74
|
+
- The host canary now fails a normal Codex run when the tracked `.codex/config.toml` hooks are broken. Each Codex record carries `source` (`config.toml`, `hooks.json:user`, or `hooks.json:root`), and the allow, deny and token checks read only the `config.toml` records, so the user-scope `hooks.json` entry the canary seeds can no longer pass the run for a `config.toml` that points at a missing adapter. Those errors start with `config.toml hooks:`. `--fake-full-coverage` still reads every record.
|
|
75
|
+
- With `core.next` on, `hq reindex` and `hq install` move a host's hook events (Claude Code, Codex, Grok Build) to the new hook core only when a current host canary passed for that host: `~/.hq/state/host-canary.json` must hold a passing standard run under seven days old for the same hq-hook version and the same hq-core gate (SHA-256 of the root's `.claude/hooks/policy-enforcement-gate.sh`). Otherwise that host keeps its old registrations and reindex prints one warning saying why. Windows stays on the old registrations.
|
|
76
|
+
- `scripts/host-canary.mjs` now writes that record after a standard run (`--record <file>` to choose the file). Each host's entry holds only pass or fail, the time, the hq-hook version and the gate hash: no paths, prompts, payloads or output. `--fake-full-coverage` and the diagnostic probes do not write it.
|
|
77
|
+
- New `scripts/require-canary.mjs --hq-root <checkout>` exits non-zero, naming the reason per host, unless every host has a current passing canary. Flip and deletion work runs it first.
|
|
78
|
+
- New override `hq reindex --skip-host-canary-gate` (or `HQ_SKIP_HOST_CANARY_GATE=1`) switches without a passing canary and prints a warning naming what it bypassed.
|
|
79
|
+
- Fix the new hook core refusing every shell tool call on hq-core v16.0.48-beta.68 ("policy-enforcement-gate.sh is not a version the port reproduces"). hq-hook now pins beta.68's gate (`6005f231`, `gate::Revision::Core16_0_48Beta68`) and its `hook-lib.sh` (`c3eb950f`), and reproduces what the gate added. Refusals label each required skill with the prompt words that set it or "required by a matched policy". The state records `skillTriggers` and `policySkills`. A command whose only send is one `hq dm` to one email or `prs_`/`agt_` uid is no longer held to a work-broadcast requirement the prompt set; its literal body still goes to the delivery gates. A command holding a blank outside ASCII (for example a no-break space) is never exempt, because node may read it as a DM or not depending on where its stdin chunks break; the work-broadcast requirement stays, and its body is never trusted. An input the port cannot settle exactly is denied natively. An unknown gate is still refused.
|
|
80
|
+
- Add the beta.68 gate fixture and run the full gate differential suite against the real beta.68 bash gate, with new scenarios for the labels, the prompt words and the one-person DM exemption, compared on every pinned gate.
|
|
81
|
+
- Added a shared, coverage-gated fleet-local registration plan and validated doctor reporting, with exact adapter handback when a core kill switch is set. Fleet planning and doctor inspection use the same pinned-copy integrity check as desktop reindex. Unsupported agents-v2 registrations fail doctor and are not advertised. Coverage claims remain unchanged.
|
|
82
|
+
|
|
83
|
+
## [5.345.218] — 2026-11-14
|
|
84
|
+
|
|
85
|
+
- `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).
|
|
86
|
+
|
|
87
|
+
- Simplified equivalent policy-selection and session-scope conditions for Clippy 1.95 without changing their behavior or lint settings.
|
|
88
|
+
- `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.
|
|
89
|
+
- Fixed an intermittent MCP worker test failure by publishing its completed capture file atomically.
|
|
90
|
+
- The seven staff commands are now marked as being retired in the command
|
|
91
|
+
table: `hq staff reset-test-account`, `hq staff test-account add`,
|
|
92
|
+
`hq staff test-account remove`, `hq staff test-account list`,
|
|
93
|
+
`hq staff listings queue`, `hq staff listings approve` and
|
|
94
|
+
`hq staff listings reject`. They only ever worked for an HQ staff sign-in.
|
|
95
|
+
The retiring gate is switched off, so nothing changes: each one runs as
|
|
96
|
+
before, prints no notice, and is still listed by `hq staff --help`. The mark
|
|
97
|
+
names the staff-only hq-staff script outside the public CLI as the
|
|
98
|
+
replacement, for when the gate is switched back on.
|
|
99
|
+
- 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.
|
|
100
|
+
- 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.
|
|
101
|
+
- 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.
|
|
102
|
+
- 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.
|
|
103
|
+
- `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.
|
|
104
|
+
- 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.
|
|
105
|
+
- 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.
|
|
106
|
+
- Require approval before editing replay evidence in hq-cli checkouts, worktrees, or the local recorder store.
|
|
107
|
+
- 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`.
|
|
108
|
+
- 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.
|
|
109
|
+
|
|
5
110
|
## [5.345.217] — 2026-11-14
|
|
6
111
|
|
|
7
112
|
- 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.
|
package/README.md
CHANGED
|
@@ -213,7 +213,7 @@ it is added to an agent's context.
|
|
|
213
213
|
|
|
214
214
|
### Sign in without opening a browser
|
|
215
215
|
|
|
216
|
-
Run `hq login --no-browser`
|
|
216
|
+
Run `hq login --no-browser` to print a sign-in
|
|
217
217
|
URL and wait for completion. Open the URL in your browser. HQ also uses this
|
|
218
218
|
mode in CI and on Linux without DISPLAY or WAYLAND_DISPLAY. Existing cached
|
|
219
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
|
|
@@ -6823,6 +6823,10 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
6823
6823
|
readonly flags: "--lock-timeout <seconds>";
|
|
6824
6824
|
readonly description: "Bound the wait for the per-root operation lock (seconds). 0 = refuse immediately; omitted = wait indefinitely (the interactive default). --from-hook implies 0; an explicit --lock-timeout wins.";
|
|
6825
6825
|
readonly hidden: false;
|
|
6826
|
+
}, {
|
|
6827
|
+
readonly flags: "--skip-host-canary-gate";
|
|
6828
|
+
readonly description: "Bypass the host canary gate (hq-core-rust US-019): with core.next on, switch Claude Code, Codex and Grok Build hook events to the new core even when no current passing host canary exists for this hq-hook version and HQ root. Prints a warning. Same as HQ_SKIP_HOST_CANARY_GATE=1.";
|
|
6829
|
+
readonly hidden: false;
|
|
6826
6830
|
}];
|
|
6827
6831
|
readonly subcommands: readonly [];
|
|
6828
6832
|
}, {
|
|
@@ -7880,6 +7884,39 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
7880
7884
|
readonly hidden: false;
|
|
7881
7885
|
}];
|
|
7882
7886
|
readonly subcommands: readonly [];
|
|
7887
|
+
}, {
|
|
7888
|
+
readonly name: "create-external";
|
|
7889
|
+
readonly description: "Create an external bot and print a one-time enrollment code";
|
|
7890
|
+
readonly aliases: readonly [];
|
|
7891
|
+
readonly hidden: false;
|
|
7892
|
+
readonly helpOption: true;
|
|
7893
|
+
readonly helpCommand: false;
|
|
7894
|
+
readonly usage: "[options] <name>";
|
|
7895
|
+
readonly helpText: readonly [];
|
|
7896
|
+
readonly arguments: readonly [{
|
|
7897
|
+
readonly name: "name";
|
|
7898
|
+
readonly required: true;
|
|
7899
|
+
readonly variadic: false;
|
|
7900
|
+
readonly description: "";
|
|
7901
|
+
}];
|
|
7902
|
+
readonly options: readonly [{
|
|
7903
|
+
readonly flags: "--company <slug>";
|
|
7904
|
+
readonly description: "Company slug (resolves to companyUid)";
|
|
7905
|
+
readonly hidden: false;
|
|
7906
|
+
}, {
|
|
7907
|
+
readonly flags: "--framework <framework>";
|
|
7908
|
+
readonly description: "Bot framework: grokbot, openclaw, or mcp";
|
|
7909
|
+
readonly hidden: false;
|
|
7910
|
+
}, {
|
|
7911
|
+
readonly flags: "--role <role>";
|
|
7912
|
+
readonly description: "Membership role: member (default) or admin";
|
|
7913
|
+
readonly hidden: false;
|
|
7914
|
+
}, {
|
|
7915
|
+
readonly flags: "--json";
|
|
7916
|
+
readonly description: "Emit raw JSON (code included — pipe carefully)";
|
|
7917
|
+
readonly hidden: false;
|
|
7918
|
+
}];
|
|
7919
|
+
readonly subcommands: readonly [];
|
|
7883
7920
|
}, {
|
|
7884
7921
|
readonly name: "rotate";
|
|
7885
7922
|
readonly description: "Issue a fresh enrollment code for an external agent (old secret + host key stop minting)";
|
|
@@ -9643,6 +9680,18 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
9643
9680
|
readonly hidden: true;
|
|
9644
9681
|
}];
|
|
9645
9682
|
readonly subcommands: readonly [{
|
|
9683
|
+
readonly name: "machine-check-owner";
|
|
9684
|
+
readonly description: "Report the offline owner of the twelve scheduled machine checks";
|
|
9685
|
+
readonly aliases: readonly [];
|
|
9686
|
+
readonly hidden: false;
|
|
9687
|
+
readonly helpOption: true;
|
|
9688
|
+
readonly helpCommand: false;
|
|
9689
|
+
readonly usage: "[options]";
|
|
9690
|
+
readonly helpText: readonly [];
|
|
9691
|
+
readonly arguments: readonly [];
|
|
9692
|
+
readonly options: readonly [];
|
|
9693
|
+
readonly subcommands: readonly [];
|
|
9694
|
+
}, {
|
|
9646
9695
|
readonly name: "checkpoint";
|
|
9647
9696
|
readonly description: "Record an end-of-turn checkpoint and start HQ maintenance";
|
|
9648
9697
|
readonly aliases: readonly [];
|
|
@@ -9755,6 +9804,26 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
9755
9804
|
readonly hidden: false;
|
|
9756
9805
|
}];
|
|
9757
9806
|
readonly subcommands: readonly [];
|
|
9807
|
+
}, {
|
|
9808
|
+
readonly name: "hook-registration-plan";
|
|
9809
|
+
readonly description: "Print the offline fleet hook registration plan without changing the installation";
|
|
9810
|
+
readonly aliases: readonly [];
|
|
9811
|
+
readonly hidden: false;
|
|
9812
|
+
readonly helpOption: true;
|
|
9813
|
+
readonly helpCommand: false;
|
|
9814
|
+
readonly usage: "[options]";
|
|
9815
|
+
readonly helpText: readonly [];
|
|
9816
|
+
readonly arguments: readonly [];
|
|
9817
|
+
readonly options: readonly [{
|
|
9818
|
+
readonly flags: "--host <host>";
|
|
9819
|
+
readonly description: "Registration host";
|
|
9820
|
+
readonly hidden: false;
|
|
9821
|
+
}, {
|
|
9822
|
+
readonly flags: "--json";
|
|
9823
|
+
readonly description: "Print JSON";
|
|
9824
|
+
readonly hidden: false;
|
|
9825
|
+
}];
|
|
9826
|
+
readonly subcommands: readonly [];
|
|
9758
9827
|
}, {
|
|
9759
9828
|
readonly name: "hook-engine-path";
|
|
9760
9829
|
readonly description: "Print the offline, version-pinned native hook engine path";
|
|
@@ -8321,6 +8321,11 @@ export const COMMAND_CATALOG = [
|
|
|
8321
8321
|
"flags": "--lock-timeout <seconds>",
|
|
8322
8322
|
"description": "Bound the wait for the per-root operation lock (seconds). 0 = refuse immediately; omitted = wait indefinitely (the interactive default). --from-hook implies 0; an explicit --lock-timeout wins.",
|
|
8323
8323
|
"hidden": false
|
|
8324
|
+
},
|
|
8325
|
+
{
|
|
8326
|
+
"flags": "--skip-host-canary-gate",
|
|
8327
|
+
"description": "Bypass the host canary gate (hq-core-rust US-019): with core.next on, switch Claude Code, Codex and Grok Build hook events to the new core even when no current passing host canary exists for this hq-hook version and HQ root. Prints a warning. Same as HQ_SKIP_HOST_CANARY_GATE=1.",
|
|
8328
|
+
"hidden": false
|
|
8324
8329
|
}
|
|
8325
8330
|
],
|
|
8326
8331
|
"subcommands": []
|
|
@@ -9631,6 +9636,47 @@ export const COMMAND_CATALOG = [
|
|
|
9631
9636
|
],
|
|
9632
9637
|
"subcommands": []
|
|
9633
9638
|
},
|
|
9639
|
+
{
|
|
9640
|
+
"name": "create-external",
|
|
9641
|
+
"description": "Create an external bot and print a one-time enrollment code",
|
|
9642
|
+
"aliases": [],
|
|
9643
|
+
"hidden": false,
|
|
9644
|
+
"helpOption": true,
|
|
9645
|
+
"helpCommand": false,
|
|
9646
|
+
"usage": "[options] <name>",
|
|
9647
|
+
"helpText": [],
|
|
9648
|
+
"arguments": [
|
|
9649
|
+
{
|
|
9650
|
+
"name": "name",
|
|
9651
|
+
"required": true,
|
|
9652
|
+
"variadic": false,
|
|
9653
|
+
"description": ""
|
|
9654
|
+
}
|
|
9655
|
+
],
|
|
9656
|
+
"options": [
|
|
9657
|
+
{
|
|
9658
|
+
"flags": "--company <slug>",
|
|
9659
|
+
"description": "Company slug (resolves to companyUid)",
|
|
9660
|
+
"hidden": false
|
|
9661
|
+
},
|
|
9662
|
+
{
|
|
9663
|
+
"flags": "--framework <framework>",
|
|
9664
|
+
"description": "Bot framework: grokbot, openclaw, or mcp",
|
|
9665
|
+
"hidden": false
|
|
9666
|
+
},
|
|
9667
|
+
{
|
|
9668
|
+
"flags": "--role <role>",
|
|
9669
|
+
"description": "Membership role: member (default) or admin",
|
|
9670
|
+
"hidden": false
|
|
9671
|
+
},
|
|
9672
|
+
{
|
|
9673
|
+
"flags": "--json",
|
|
9674
|
+
"description": "Emit raw JSON (code included — pipe carefully)",
|
|
9675
|
+
"hidden": false
|
|
9676
|
+
}
|
|
9677
|
+
],
|
|
9678
|
+
"subcommands": []
|
|
9679
|
+
},
|
|
9634
9680
|
{
|
|
9635
9681
|
"name": "rotate",
|
|
9636
9682
|
"description": "Issue a fresh enrollment code for an external agent (old secret + host key stop minting)",
|
|
@@ -11788,6 +11834,19 @@ export const COMMAND_CATALOG = [
|
|
|
11788
11834
|
}
|
|
11789
11835
|
],
|
|
11790
11836
|
"subcommands": [
|
|
11837
|
+
{
|
|
11838
|
+
"name": "machine-check-owner",
|
|
11839
|
+
"description": "Report the offline owner of the twelve scheduled machine checks",
|
|
11840
|
+
"aliases": [],
|
|
11841
|
+
"hidden": false,
|
|
11842
|
+
"helpOption": true,
|
|
11843
|
+
"helpCommand": false,
|
|
11844
|
+
"usage": "[options]",
|
|
11845
|
+
"helpText": [],
|
|
11846
|
+
"arguments": [],
|
|
11847
|
+
"options": [],
|
|
11848
|
+
"subcommands": []
|
|
11849
|
+
},
|
|
11791
11850
|
{
|
|
11792
11851
|
"name": "checkpoint",
|
|
11793
11852
|
"description": "Record an end-of-turn checkpoint and start HQ maintenance",
|
|
@@ -11926,6 +11985,30 @@ export const COMMAND_CATALOG = [
|
|
|
11926
11985
|
],
|
|
11927
11986
|
"subcommands": []
|
|
11928
11987
|
},
|
|
11988
|
+
{
|
|
11989
|
+
"name": "hook-registration-plan",
|
|
11990
|
+
"description": "Print the offline fleet hook registration plan without changing the installation",
|
|
11991
|
+
"aliases": [],
|
|
11992
|
+
"hidden": false,
|
|
11993
|
+
"helpOption": true,
|
|
11994
|
+
"helpCommand": false,
|
|
11995
|
+
"usage": "[options]",
|
|
11996
|
+
"helpText": [],
|
|
11997
|
+
"arguments": [],
|
|
11998
|
+
"options": [
|
|
11999
|
+
{
|
|
12000
|
+
"flags": "--host <host>",
|
|
12001
|
+
"description": "Registration host",
|
|
12002
|
+
"hidden": false
|
|
12003
|
+
},
|
|
12004
|
+
{
|
|
12005
|
+
"flags": "--json",
|
|
12006
|
+
"description": "Print JSON",
|
|
12007
|
+
"hidden": false
|
|
12008
|
+
}
|
|
12009
|
+
],
|
|
12010
|
+
"subcommands": []
|
|
12011
|
+
},
|
|
11929
12012
|
{
|
|
11930
12013
|
"name": "hook-engine-path",
|
|
11931
12014
|
"description": "Print the offline, version-pinned native hook engine path",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* hq agents start|stop <uid> — EC2 start/stop
|
|
16
16
|
* hq agents retry <uid> — resume setup from first non-done step
|
|
17
17
|
* hq agents rm <uid> --yes — deprovision (destructive; flag-guarded)
|
|
18
|
+
* hq agents create-external <name> — mint an external agent + one-time enroll code
|
|
18
19
|
* hq agents rotate <uid> — new enrollment code for an external agent
|
|
19
20
|
* hq agents revoke <uid> --yes — revoke an external agent (--remove deletes it)
|
|
20
21
|
* hq agents jobs list <uid> — off-box job roster (schedule + rate)
|
|
@@ -489,6 +490,25 @@ export interface RotateAgentResult {
|
|
|
489
490
|
agentUid: string;
|
|
490
491
|
enrollment: EnrollmentIssue;
|
|
491
492
|
}
|
|
493
|
+
export declare const VALID_EXTERNAL_FRAMEWORKS: Set<string>;
|
|
494
|
+
export declare const VALID_EXTERNAL_MEMBERSHIP_ROLES: Set<string>;
|
|
495
|
+
export interface CreateExternalAgentInput {
|
|
496
|
+
name: string;
|
|
497
|
+
framework: string;
|
|
498
|
+
membershipRole?: string;
|
|
499
|
+
}
|
|
500
|
+
export interface CreateExternalAgentResult {
|
|
501
|
+
agentUid: string;
|
|
502
|
+
agentEmail: string;
|
|
503
|
+
framework: string;
|
|
504
|
+
enrollment: EnrollmentIssue;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* POST /v1/companies/{companyUid}/agents/external — admin mint of an external
|
|
508
|
+
* bot. Returns the one-time enrollment code exactly once (api-contract v1).
|
|
509
|
+
* Console Add bot no longer exposes this path (feedback_6e5798b3).
|
|
510
|
+
*/
|
|
511
|
+
export declare function createExternalAgent(token: string, companyUid: string, input: CreateExternalAgentInput): Promise<CreateExternalAgentResult>;
|
|
492
512
|
/**
|
|
493
513
|
* POST /v1/agents/{uid}/rotate — invalidate the current secret and host key
|
|
494
514
|
* and issue a fresh one-time enrollment code (returned exactly once).
|
|
@@ -503,6 +523,8 @@ export declare function groupEnrollmentCode(code: string): string;
|
|
|
503
523
|
export declare function revokeAgent(token: string, agentUid: string, remove: boolean): Promise<{
|
|
504
524
|
removed: boolean;
|
|
505
525
|
}>;
|
|
526
|
+
/** Lines printed after create-external: the code is shown once and never stored. */
|
|
527
|
+
export declare function formatCreateExternalOutput(result: CreateExternalAgentResult): string[];
|
|
506
528
|
/** Lines printed after a rotate: the code is shown once and never stored. */
|
|
507
529
|
export declare function formatRotateOutput(result: RotateAgentResult): string[];
|
|
508
530
|
export declare function registerAgentsCommand(program: Command): void;
|
package/dist/commands/agents.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* hq agents start|stop <uid> — EC2 start/stop
|
|
16
16
|
* hq agents retry <uid> — resume setup from first non-done step
|
|
17
17
|
* hq agents rm <uid> --yes — deprovision (destructive; flag-guarded)
|
|
18
|
+
* hq agents create-external <name> — mint an external agent + one-time enroll code
|
|
18
19
|
* hq agents rotate <uid> — new enrollment code for an external agent
|
|
19
20
|
* hq agents revoke <uid> --yes — revoke an external agent (--remove deletes it)
|
|
20
21
|
* hq agents jobs list <uid> — off-box job roster (schedule + rate)
|
|
@@ -1272,6 +1273,48 @@ export function waitForAgentMessageWithPackageLease(waitForReply, leaseOptions =
|
|
|
1272
1273
|
function sleep(ms) {
|
|
1273
1274
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1274
1275
|
}
|
|
1276
|
+
export const VALID_EXTERNAL_FRAMEWORKS = new Set([
|
|
1277
|
+
"grokbot",
|
|
1278
|
+
"openclaw",
|
|
1279
|
+
"mcp",
|
|
1280
|
+
]);
|
|
1281
|
+
export const VALID_EXTERNAL_MEMBERSHIP_ROLES = new Set(["member", "admin"]);
|
|
1282
|
+
/**
|
|
1283
|
+
* POST /v1/companies/{companyUid}/agents/external — admin mint of an external
|
|
1284
|
+
* bot. Returns the one-time enrollment code exactly once (api-contract v1).
|
|
1285
|
+
* Console Add bot no longer exposes this path (feedback_6e5798b3).
|
|
1286
|
+
*/
|
|
1287
|
+
export async function createExternalAgent(token, companyUid, input) {
|
|
1288
|
+
const body = {
|
|
1289
|
+
name: input.name,
|
|
1290
|
+
framework: input.framework,
|
|
1291
|
+
};
|
|
1292
|
+
if (input.membershipRole)
|
|
1293
|
+
body.membershipRole = input.membershipRole;
|
|
1294
|
+
const data = await agentsRequest({
|
|
1295
|
+
token,
|
|
1296
|
+
path: `/v1/companies/${encodeURIComponent(companyUid)}/agents/external`,
|
|
1297
|
+
method: "POST",
|
|
1298
|
+
body,
|
|
1299
|
+
});
|
|
1300
|
+
const e = data.enrollment ?? {};
|
|
1301
|
+
if (typeof e.code !== "string" || !e.code) {
|
|
1302
|
+
throw new AgentsHttpError(502, "create-external succeeded but the response carried no enrollment code");
|
|
1303
|
+
}
|
|
1304
|
+
if (typeof data.agentUid !== "string" || !data.agentUid) {
|
|
1305
|
+
throw new AgentsHttpError(502, "create-external succeeded but the response carried no agentUid");
|
|
1306
|
+
}
|
|
1307
|
+
return {
|
|
1308
|
+
agentUid: data.agentUid,
|
|
1309
|
+
agentEmail: typeof data.agentEmail === "string" ? data.agentEmail : "",
|
|
1310
|
+
framework: typeof data.framework === "string" ? data.framework : input.framework,
|
|
1311
|
+
enrollment: {
|
|
1312
|
+
code: e.code,
|
|
1313
|
+
expiresAt: typeof e.expiresAt === "string" ? e.expiresAt : "",
|
|
1314
|
+
enrollmentId: typeof e.enrollmentId === "string" ? e.enrollmentId : "",
|
|
1315
|
+
},
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1275
1318
|
/**
|
|
1276
1319
|
* POST /v1/agents/{uid}/rotate — invalidate the current secret and host key
|
|
1277
1320
|
* and issue a fresh one-time enrollment code (returned exactly once).
|
|
@@ -1313,6 +1356,20 @@ export async function revokeAgent(token, agentUid, remove) {
|
|
|
1313
1356
|
});
|
|
1314
1357
|
return { removed: data.removed === true || remove };
|
|
1315
1358
|
}
|
|
1359
|
+
/** Lines printed after create-external: the code is shown once and never stored. */
|
|
1360
|
+
export function formatCreateExternalOutput(result) {
|
|
1361
|
+
const lines = [
|
|
1362
|
+
`Created external agent ${result.agentUid}${result.agentEmail ? ` (${result.agentEmail})` : ""}.`,
|
|
1363
|
+
` framework: ${result.framework}`,
|
|
1364
|
+
"",
|
|
1365
|
+
` enrollment code: ${groupEnrollmentCode(result.enrollment.code)}`,
|
|
1366
|
+
];
|
|
1367
|
+
if (result.enrollment.expiresAt) {
|
|
1368
|
+
lines.push(` expires: ${result.enrollment.expiresAt} (15 minutes)`);
|
|
1369
|
+
}
|
|
1370
|
+
lines.push("", "Shown once. On the agent's host run:", ` hq agent enroll ${groupEnrollmentCode(result.enrollment.code)}`, " hq agent probe");
|
|
1371
|
+
return lines;
|
|
1372
|
+
}
|
|
1316
1373
|
/** Lines printed after a rotate: the code is shown once and never stored. */
|
|
1317
1374
|
export function formatRotateOutput(result) {
|
|
1318
1375
|
const lines = [
|
|
@@ -1383,10 +1440,11 @@ export function registerAgentsCommand(program) {
|
|
|
1383
1440
|
// `/v1/keys/agents/{uid}/terminal` route, so machine keys fail closed.
|
|
1384
1441
|
terminal: { capability: "agents:use", routeAvailable: false },
|
|
1385
1442
|
// External-agent lifecycle is an admin action on the JWT-only
|
|
1386
|
-
// /
|
|
1443
|
+
// create-external / rotate / revoke routes (api-contract v1); no keyed
|
|
1387
1444
|
// parallel exists, so machine keys fail closed here too.
|
|
1388
1445
|
rotate: { capability: "agents:use", routeAvailable: false },
|
|
1389
1446
|
revoke: { capability: "agents:use", routeAvailable: false },
|
|
1447
|
+
"create-external": { capability: "agents:use", routeAvailable: false },
|
|
1390
1448
|
},
|
|
1391
1449
|
});
|
|
1392
1450
|
// `--company` may live on the group or the subcommand; the subcommand value
|
|
@@ -2137,6 +2195,39 @@ export function registerAgentsCommand(program) {
|
|
|
2137
2195
|
fail(err);
|
|
2138
2196
|
}
|
|
2139
2197
|
});
|
|
2198
|
+
agents
|
|
2199
|
+
.command("create-external <name>")
|
|
2200
|
+
.description("Create an external bot and print a one-time enrollment code")
|
|
2201
|
+
.option("--company <slug>", "Company slug (resolves to companyUid)")
|
|
2202
|
+
.option("--framework <framework>", "Bot framework: grokbot, openclaw, or mcp")
|
|
2203
|
+
.option("--role <role>", "Membership role: member (default) or admin")
|
|
2204
|
+
.option("--json", "Emit raw JSON (code included — pipe carefully)")
|
|
2205
|
+
.action(async function (name, opts) {
|
|
2206
|
+
const framework = parseEnumOption(opts.framework, VALID_EXTERNAL_FRAMEWORKS, "--framework");
|
|
2207
|
+
if (!framework) {
|
|
2208
|
+
console.error(chalk.red("--framework is required: grokbot, openclaw, or mcp"));
|
|
2209
|
+
process.exit(1);
|
|
2210
|
+
}
|
|
2211
|
+
const membershipRole = parseEnumOption(opts.role, VALID_EXTERNAL_MEMBERSHIP_ROLES, "--role");
|
|
2212
|
+
try {
|
|
2213
|
+
const token = (await resolveVaultCredential()).token;
|
|
2214
|
+
const companyUid = await getCompanyUid(token, companyOf(this));
|
|
2215
|
+
const result = await createExternalAgent(token, companyUid, {
|
|
2216
|
+
name,
|
|
2217
|
+
framework,
|
|
2218
|
+
...(membershipRole ? { membershipRole } : {}),
|
|
2219
|
+
});
|
|
2220
|
+
if (opts.json) {
|
|
2221
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2222
|
+
return;
|
|
2223
|
+
}
|
|
2224
|
+
for (const line of formatCreateExternalOutput(result))
|
|
2225
|
+
console.log(line);
|
|
2226
|
+
}
|
|
2227
|
+
catch (err) {
|
|
2228
|
+
fail(err);
|
|
2229
|
+
}
|
|
2230
|
+
});
|
|
2140
2231
|
agents
|
|
2141
2232
|
.command("rotate <agentUid>")
|
|
2142
2233
|
.description("Issue a fresh enrollment code for an external agent (old secret + host key stop minting)")
|
package/dist/commands/cloud.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ export declare class SyncSessionExpiredError extends Error {
|
|
|
60
60
|
constructor(kind: "reauth" | "unavailable", reason?: string | undefined);
|
|
61
61
|
}
|
|
62
62
|
/** Shown when the vault rejected the session even after a forced refresh. */
|
|
63
|
-
export declare const SYNC_SESSION_REJECTED_MESSAGE = "The HQ server rejected your session even after it was refreshed, so the saved sign-in is no longer accepted. `hq
|
|
63
|
+
export declare const SYNC_SESSION_REJECTED_MESSAGE = "The HQ server rejected your session even after it was refreshed, so the saved sign-in is no longer accepted. `hq whoami` only checks the saved expiry, not the server. Run `hq login`, then rerun the sync.";
|
|
64
64
|
/** Reason text when token acquisition does not settle within the bound. */
|
|
65
65
|
export declare const SYNC_TOKEN_TIMEOUT_REASON = "timed out waiting for the sign-in service";
|
|
66
66
|
/** Longest a single token acquisition or refresh may take before the sync fails. */
|
package/dist/commands/cloud.js
CHANGED
|
@@ -91,7 +91,7 @@ export class SyncSessionExpiredError extends Error {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
/** Shown when the vault rejected the session even after a forced refresh. */
|
|
94
|
-
export const SYNC_SESSION_REJECTED_MESSAGE = "The HQ server rejected your session even after it was refreshed, so the saved sign-in is no longer accepted. `hq
|
|
94
|
+
export const SYNC_SESSION_REJECTED_MESSAGE = "The HQ server rejected your session even after it was refreshed, so the saved sign-in is no longer accepted. `hq whoami` only checks the saved expiry, not the server. Run `hq login`, then rerun the sync.";
|
|
95
95
|
/** Reason text when token acquisition does not settle within the bound. */
|
|
96
96
|
export const SYNC_TOKEN_TIMEOUT_REASON = "timed out waiting for the sign-in service";
|
|
97
97
|
/** Longest a single token acquisition or refresh may take before the sync fails. */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import { type FleetPlanOptions } from '../lib/hook-engine/fleet-registration.js';
|
|
3
|
+
export declare function registerCoreHookRegistrationPlan(core: Command, runtime?: {
|
|
4
|
+
readInput?: () => string;
|
|
5
|
+
writeOutput?: (value: string) => void;
|
|
6
|
+
planOptions?: FleetPlanOptions;
|
|
7
|
+
}): void;
|
|
8
|
+
//# sourceMappingURL=core-hook-registration-plan.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as os from 'node:os';
|
|
3
|
+
import { fleetRegistrationPlan } from '../lib/hook-engine/fleet-registration.js';
|
|
4
|
+
import { describeCoreCommand } from './core-command-catalog.js';
|
|
5
|
+
export function registerCoreHookRegistrationPlan(core, runtime = {}) {
|
|
6
|
+
const command = core.command('hook-registration-plan')
|
|
7
|
+
.description('Print the offline fleet hook registration plan without changing the installation')
|
|
8
|
+
.requiredOption('--host <host>', 'Registration host')
|
|
9
|
+
.option('--json', 'Print JSON')
|
|
10
|
+
.action((options, command) => {
|
|
11
|
+
if (options.host !== 'fleet-local')
|
|
12
|
+
throw new Error('Only fleet-local registration is supported');
|
|
13
|
+
const root = command.optsWithGlobals().hqRoot;
|
|
14
|
+
if (!root)
|
|
15
|
+
throw new Error('--hq-root is required');
|
|
16
|
+
const fallbacks = JSON.parse((runtime.readInput ?? (() => fs.readFileSync(0, 'utf8')))());
|
|
17
|
+
(runtime.writeOutput ?? console.log)(JSON.stringify(fleetRegistrationPlan(root, fallbacks, runtime.planOptions ?? { home: process.env.HOME ?? os.homedir() })));
|
|
18
|
+
});
|
|
19
|
+
describeCoreCommand(command, { execution: 'native', root: 'live' });
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=core-hook-registration-plan.js.map
|