@indigoai-us/hq-cli 5.345.262 → 5.345.264
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 +69 -0
- package/contracts/host-canary-release.json +7 -7
- package/dist/command-catalog.generated.d.ts +37 -0
- package/dist/command-catalog.generated.js +46 -0
- package/dist/command-registration-plan.d.ts +6 -0
- package/dist/command-registration-plan.js +1 -0
- package/dist/commands/bot.d.ts +2 -0
- package/dist/commands/bot.js +4 -3
- package/dist/commands/core-handoff.js +273 -115
- package/dist/commands/sync-held.d.ts +11 -0
- package/dist/commands/sync-held.js +65 -1
- package/dist/commands/sync-telemetry-report.d.ts +5 -0
- package/dist/commands/sync-telemetry-report.js +239 -0
- package/dist/commands/sync-telemetry.d.ts +47 -0
- package/dist/commands/sync-telemetry.js +309 -0
- package/dist/index.js +107 -43
- package/dist/lib/bot/runnable.d.ts +17 -7
- package/dist/lib/bot/runnable.js +17 -10
- package/dist/lib/capacity/available.js +6 -2
- package/dist/lib/capacity/collectors/claude-oauth.d.ts +10 -256
- package/dist/lib/capacity/collectors/claude-oauth.js +19 -1078
- package/dist/lib/capacity/ledger.d.ts +12 -1
- package/dist/lib/capacity/ledger.js +15 -5
- package/dist/lib/capacity/route.d.ts +2 -0
- package/dist/lib/capacity/route.js +21 -4
- package/dist/lib/capacity/scheduler.js +2 -3
- package/dist/lib/capacity/sign-in.js +4 -4
- package/dist/lib/daemon/ops/skill-command.d.ts +2 -0
- package/dist/lib/daemon/ops/skill-command.js +7 -1
- package/dist/lib/doctor/checks/antigravity-wiring.d.ts +2 -1
- package/dist/lib/doctor/checks/antigravity-wiring.js +59 -3
- package/dist/lib/doctor/checks/hook-engine.d.ts +2 -0
- package/dist/lib/doctor/checks/hook-engine.js +100 -1
- package/dist/lib/doctor/checks/host-core.d.ts +1 -1
- package/dist/lib/doctor/checks/host-core.js +11 -4
- package/dist/lib/hook-engine/coverage.d.ts +19 -10
- package/dist/lib/hook-engine/coverage.js +103 -24
- package/dist/lib/hook-engine/native-precompact-compatibility.json +7 -1
- package/dist/lib/hook-engine/native-stop-compatibility.json +8 -4
- package/dist/lib/hook-engine/reconcile.js +49 -1
- package/dist/lib/install/antigravity-targets.d.ts +22 -0
- package/dist/lib/install/antigravity-targets.js +82 -0
- package/dist/main.js +8 -3
- package/dist/sentry-init.d.ts +7 -1
- package/dist/sentry-init.js +6 -2
- package/dist/sentry.d.ts +7 -0
- package/dist/sentry.js +16 -1
- package/dist/started-version.d.ts +13 -0
- package/dist/started-version.js +34 -0
- package/dist/startup-registration.d.ts +9 -9
- package/dist/startup-registration.js +42 -18
- package/dist/utils/client-health.d.ts +1 -0
- package/dist/utils/client-health.js +54 -11
- package/dist/utils/core-next-kill.d.ts +9 -0
- package/dist/utils/core-next-kill.js +22 -0
- package/dist/utils/delegate-lock.js +19 -1
- package/dist/utils/host-registration.d.ts +4 -2
- package/dist/utils/host-registration.js +55 -7
- package/dist/utils/install-tree-recovery-markers.d.ts +45 -0
- package/dist/utils/install-tree-recovery-markers.js +70 -0
- package/dist/utils/install-tree-torn.d.ts +102 -5
- package/dist/utils/install-tree-torn.js +199 -2
- package/dist/utils/sentry-fingerprint.js +3 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,75 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [5.345.264] — 2026-11-28
|
|
6
|
+
- The nightly fast-route benchmark now prints a timed progress line as it starts each case and phase, so the hour-long run no longer looks hung in the job log.
|
|
7
|
+
- The hq-hook Windows release job now finds the built engine on runners that set `CARGO_TARGET_DIR`.
|
|
8
|
+
- Install `cargo-nextest` and `sccache` in Windows `hq-hook-pr` jobs via a checksum-verified Bash script so self-hosted Windows runners without `pwsh` succeed.
|
|
9
|
+
- Claude Code folder hooks in `hq-hook` now keep plain-text output separate from merged JSON (so plain text ending in a JSON-looking line no longer drops SessionStart or UserPromptSubmit context), fail closed on UserPromptSubmit when a hook process cannot be spawned at all while still warning when a hook runs and exits 126/127, and run their unit and end-to-end tests on Windows as well as Unix.
|
|
10
|
+
- Document the native hook engine architecture, per-event master-hook switching, kill switches, and rollback flow in docs/hook-engine/architecture.md and docs/hook-registration.md.
|
|
11
|
+
- Claimed `master-hook:PreToolUse` natively on `agents-v2` (Unix) with differential parity against `hq-agents-v2` main (`81866ca`) and accepted `hq-core-staging 92f5020b` (`v16.0.52`) `core/scripts/hook-lib.sh` (`436493e3`) in `fleetLocalMergedWriteGuardHold` for `merged-write-guard-shadow` (item 878).
|
|
12
|
+
- On hq-agents-v2 bots running the Rust hook engine, the Indigo company PreToolUse hooks (the hq-core review gate, the Work Mesh overlap reminder and the landing-copy em dash check) are now evaluated natively when their files match a known revision, so their tool calls no longer go to the hook adapter under the bot's hook time limits. An edited or new company hook still runs as a shell script, as before.
|
|
13
|
+
- Run `agents-v2` company `SessionStart` hooks natively through `agents_v2_folder_hooks` inside the `#347` hook budget when they fit, handing back only when over budget.
|
|
14
|
+
- Give the `agents-v2` `on_session_start` hook call the default 5 s plus the time its company `SessionStart` hooks need, so a bot whose company hook has an 8 s limit runs the event natively; tool events keep 5 s.
|
|
15
|
+
- Register Antigravity hooks (`SessionStart`, `PreToolUse`, `PostToolUse`, `Stop`) through the native `hq-hook` engine in `~/.gemini/config/hooks.json` during `hq reindex`, and report Antigravity hook wiring and host-core status in `hq doctor`.
|
|
16
|
+
- feat(hq-hook): port fleet-local helper SessionStart and claim `fleet-local-adapter:SessionStart` (`US-050-B`) alongside `master-hook:SessionStart` (`US-049-B`) under `SessionStart@fleet-local` in `COVERS`
|
|
17
|
+
- Claimed `master-hook:PreToolUse` natively on `fleet-local` (Unix) with differential parity against the hq-fleet-local v0.4.33 adapter on hq-core v16.0.50 and v16.0.52, and accepted the v16.0.51 (`09f5a3e0`) and v16.0.52 (`cf1abd5c`) `core/scripts/lib/hook-adapter-core.sh` in the fleet-local PreToolUse registration hold.
|
|
18
|
+
- Claim `master-hook:SessionStart` on `fleet-local` (`SessionStart@fleet-local`, Unix) in `hq-hook` with `fleet-local-v0.4.33.sh` + `master-hook.sh` parity tests (US-049-B).
|
|
19
|
+
- Port Grok `PreToolUse` onto native `master-hook:PreToolUse` (`pre_tool_use_master.rs`, `core_next.rs`, `coverage.ts`, `expected-uncovered.txt`) with staging-main adapter pins and differential parity tests.
|
|
20
|
+
- hq-hook answers PreToolUse, SessionStart and Codex PostToolUse natively on hq-core v16.0.53-beta trees: it accepts the hqd hook shim from hq-core-staging #2024 and the Codex adapter v16.0.51 to v16.0.53 ship, instead of refusing every such event, and `hq reindex` switches those trees' PreToolUse and SessionStart to the native engine.
|
|
21
|
+
- Fix: recognize hq-core 16.0.52 `core/scripts/hook-lib.sh` (`436493e3`) in `block-agent-secrets-reveal` so strict mode answers natively instead of returning `port-declined`
|
|
22
|
+
- Disable `inject-codex-checkpoint-reprompt` via `HQ_DISABLED_HOOKS` during `scripts/host-canary-injector-parity.mjs` `shadowRoot` replay so Codex `SessionStart` injector parity compares only `inject-policy-on-trigger` without false diffs from `shadowRoot` paths.
|
|
23
|
+
- test(hq-hook): run `credential_entry::detached_binary_uses_the_explicit_registration_root` through `deterministic_host` (`RunClock::Deterministic`) on a detached copy of the test binary so `Host::Grok`'s 4000 ms `GetProcessTimes` budget does not race against Windows Defender scans of a freshly copied `.exe` under Beaker load (item 951)
|
|
24
|
+
- Fix Beaker Windows archive runner hanging until the 600s timeout (`exit 124`, `complete: false`) when a test binary exits cleanly while an orphaned descendant still holds inherited stdout/stderr handles, and stage `target/x86_64-pc-windows-msvc/tmp` for cross-host shards.
|
|
25
|
+
- Install `cargo-nextest` and `sccache` in Windows `hq-hook-pr` jobs via a checksum-verified Bash script so self-hosted Windows runners without `pwsh` succeed.
|
|
26
|
+
- feat(hq-hook): handle `Host::FleetLocal` `SessionStart` natively across the evaluator chain (matching adapter output assembly, skip rules, and library checks), background-mode bots included (non-empty `HQ_FLEET_HOME` with `HQ_FLEET_LOCAL_SESSION_START_BACKGROUND` unset or `1`): claimed registry hooks and `master-hook:SessionStart` run in the foreground instead of the adapter's detached run and 600 s cache (owner-approved difference `us050-c2-fleet-local-session-start-background-foreground`).
|
|
27
|
+
- Internal: make `fleet_merge_hold_parity` hermetic against host `/opt/homebrew/bin` and `/usr/local/bin` binaries when hiding `hq` or `timeout`
|
|
28
|
+
- Surface bounded refusal reasons on stderr and preserve emitted `SessionStart` context on `agents-v2` `on_session_start` in `host::fleet::encode`.
|
|
29
|
+
- Fixed: Restart once and record a counted info event when the installed `hq-cli` package version changes on disk during startup.
|
|
30
|
+
- Shorten >2s real-time test waits in `crates/hq-hook/tests/` (`dispatch`, `session_setup`, `redact_credential_output`, `recorder_early_exits`, `blocking_child_timeout`, `stop_check`) using injected short timeouts and channel synchronization without weakening assertions.
|
|
31
|
+
- Serialize throwaway `git` fixture setup on Windows, disable `core.fsync`, and retry transient `.git/objects/` `Permission denied` AV locks in `prompt_ports_up1.rs` tests.
|
|
32
|
+
- test(hq-hook): run `run_starts_no_interpreter::the_exception_admits_no_other_start` through `deterministic_host` (`RunClock::Deterministic`) so `SessionStart`'s 5 s wall-clock chain budget does not race against slow shared Windows CI hosts (item 968)
|
|
33
|
+
- Match the bash scope check for `date` command substitutions in `hq-hook`: keep literal characters in `date +FORMAT` instead of substituting `0`, treat unknown, backtick, and shadowed `date` forms (function, alias, `PATH`, `hash -p`) as unresolvable, and keep ordinary ISO and dotted timestamp formats allowed in `ssh`/`hq` messages and own-company paths.
|
|
34
|
+
- A machine now keeps one CLI install id when several `hq` commands run at once, so sync health shows one record per machine instead of a new one after each overlap.
|
|
35
|
+
- Fix the hook engine `stable` link staying on the previous engine after a CLI update when `hq` is started through a bin symlink (as on HQ desktop app installs), which left fleet-local events on the shell path and failed fleet profiles in `hq doctor`.
|
|
36
|
+
- Fix: keep Rust hook registrations in place and log loudly to `hook-engine.jsonl` when the host canary gate fails in strict mode (`~/.hq/hook-engine.strict` or `HQ_HOOK_ENGINE=strict`)
|
|
37
|
+
- Keep last-known hook port flags in strict mode when the local flag snapshot is stale, logging a `stale-snapshot` record to `~/.hq/logs/hook-engine.jsonl` and surfacing stale strict-mode snapshots in `hq doctor`.
|
|
38
|
+
- Record the 3 US-046 c9 bounded-parser refusals in `US-010/intended-differences.yaml` (`unbounded-search-unterminated-single-quote`, `unbounded-search-unterminated-substitution`, `unbounded-search-oversized-command`), wire quoted `test:` references for all 6 `block-hq-unbounded-search` ledger rows, drop their baseline exceptions, and add per-case tests for all 9 c9 cases.
|
|
39
|
+
- Pin `bash-arith-subst-guard-lib.sh` `e90d160f` (hq-core 16.0.48–16.0.52) for `enforce-vault-write-access` in `ports.rs` and `core-pins.json`, eliminating strict-miss `script-mismatch` blocks, and add regression tests for all 3 2026-11-19 rollback cases (`60:1959`, `61:942`, `61:968`).
|
|
40
|
+
- Match Bash 5.2 and Bash 5.3+ setlocale warning formatting in `hq-hook` `vault_write` by only appending the `: <strerror>` suffix when the `bash` binary on `PATH` is version 5.3 or newer.
|
|
41
|
+
- Serialize process-spawning tests in `run_starts_no_interpreter.rs` with a test mutex so `the_exception_admits_no_other_start` (1 s `hq --version` limit) never contends with `every_recorded_payload_runs_without_starting_an_interpreter` (54+ `hq-hook` spawns) on loaded Windows runners.
|
|
42
|
+
- Changed: the host canary record shipped with the CLI is refreshed for this release build.
|
|
43
|
+
- Updated missing-jq hook messages to recommend `hq doctor --fix-jq` first.
|
|
44
|
+
- The Rust hook engine's policy frontmatter check now also accepts the hq-cli-floor.sh revision from hq-core-staging #2150 (which adds an optional caller kind parameter while keeping script callers identical).
|
|
45
|
+
- Recognize current `hook-lib.sh` (`436493e3`), `session-id.sh` (`d6a04155`), and `mandatory-scope-authorizer.sh` (`36312275`, PowerShell port from #3993) revisions across `PreToolUse`, `SessionStart`, `UserPromptSubmit`, `Stop`, and `PreCompact` compatibility tables and native ports.
|
|
46
|
+
- Replace substring matching (`is_unknown_revision_reason`) in the native `Stop` unknown-revision path with a typed `stop::compat::CompatError::UnknownRevision` error variant matched directly in `StopCheck::answer_seen` (no behaviour change).
|
|
47
|
+
- `hq sync release-held` run for every scope now clears an upload hold recorded because the computer's identity history could not be proven, and says that it did.
|
|
48
|
+
- Fixed: skip retired `core/hooks/SessionStart/40-conduct-reap.sh` (removed in `hq-core-staging#1253`) in native hook dispatch and coverage checks like `Stop/70-work-mesh-done.sh`, and pin the matching `.claude/hooks/master-hook.sh` revision (`711fb6d2`).
|
|
49
|
+
- Fixed: `hq bot adopt` and `hq bot restore` bring a local company bot back onto this computer when HQ kept no settings for it, instead of calling it a cloud bot and refusing the command that `hq bot status` recommended.
|
|
50
|
+
- Added: `hq sync telemetry` shows sync health, recent errors and usage for a company, read from the HQ server. Company owners and admins can run it; `--json` prints the server response unchanged.
|
|
51
|
+
- Resolve `CARGO_TARGET_TMPDIR` at runtime in `hq-hook` integration tests so relocated test archives use the runner's temp folder.
|
|
52
|
+
- Repin `test/ci/old-path-coverage.test.ts` to the `hq-core-staging@df7fca97a4e8` (`v16.0.53-beta.3`) `hook-registry.json` fixture (`US-046` c5).
|
|
53
|
+
- Read Windows process creation time via `GetProcessTimes` so hook budget calculations use the process's actual start time instead of subtracting the 800 ms unknown-start allowance.
|
|
54
|
+
- Added Windows path handling regression tests for PreToolUse path rules.
|
|
55
|
+
- Append Git for Windows `usr\bin` to the end of `PATH` during `master-hook.sh` hand-off when `awk` is missing from inherited `PATH`, without changing other callers' `PATH`.
|
|
56
|
+
- Improved Windows path normalization and added Windows line-ending, quoting, and path handling test cases for PreToolUse rules.
|
|
57
|
+
|
|
58
|
+
## [5.345.263] — 2026-11-26
|
|
59
|
+
- Fixed: `hq capacity` no longer signs Claude accounts out. The collector used to refresh Claude OAuth tokens itself. Claude refresh tokens are single use, so that refresh raced Claude Code's own refresh, and the loser held a dead token that showed as "signed out: sign-in revoked". The collector now only reads the credential and never posts to the token endpoint or writes the Keychain item or credentials file. An account whose access token has expired shows "expired: refreshes the next time Claude Code is used with this account" until Claude Code renews it. Lanes already start on such an account, because Claude Code renews the token at startup. Grok sign-ins are unchanged.
|
|
60
|
+
|
|
61
|
+
- Fix false refusals in the credential guard's Windows shell-path check on Unix for `date +%H:%M:%S` / `+%Y-%m-%dT%H:%M:%S.000Z` format strings and `\t` escapes inside `awk` programs.
|
|
62
|
+
- fix(delegate): wait for a transiently contended coordination mutex during delegate lock release instead of leaving the lock file behind
|
|
63
|
+
- Use `exec sleep` in `dispatch.rs` timed-out hook test fixtures so parent `bash` cannot race to emit `"Terminated sleep ..."` job-reap notices on Windows stderr.
|
|
64
|
+
- test: prevent detached handoff publish writers from racing differential workspace cleanup in `e2e/handoff-differential.test.ts`
|
|
65
|
+
- Fixed: native `hq core handoff post` now matches `handoff-post.sh` for bound-session `meta.yaml` parsing, single-company ownership on thread metadata and touched file paths, normalizing `company` and `company_slugs` on both the root thread and cleaned mirror copy (instead of hard-linking), and accepting digit-first company slugs.
|
|
66
|
+
- hq-hook: scan each PreToolUse script once in `missing_registered_guards`, skip the duplicate pre-dispatch check inside supervised evaluation children, and run `us012_root_git_codex_grok` parity cases with the deterministic budget clock so loaded Linux CI shards no longer hit the 5000 ms wall-clock cutoff.
|
|
67
|
+
- Changed: the host canary record shipped with the CLI is refreshed for this release build.
|
|
68
|
+
- Add end-to-end tests in `hq-hook` covering a personal PreToolUse hook that times out and refuses, and a personal PreToolUse hook that exits 2 alongside an allowing sibling hook.
|
|
69
|
+
- Hard-link and warm the test sentinel executable in `run_starts_no_interpreter` so cold-start binary scans on Windows do not consume `SessionStart` hook budgets.
|
|
70
|
+
- Test and CI: update the Windows Claude Stop end-to-end checks (`registration::claude_stop_registered_binary_blocks_then_allows_end_of_turn_e2e` and `scripts/ci/windows-stop-e2e-check.mjs`) to write and invoke the exact project and `--global` `core.next` registrations (including `--global` from a foreign folder), and run the check on Beaker on `hook-registration.yml` dispatch.
|
|
71
|
+
- Refuse `master-hook.sh` hand-off in `hq-hook` with a clear error naming the missing tool when `awk` or another required shell utility is absent from `PATH`.
|
|
72
|
+
- Check the original directory components of Windows state-folder listings.
|
|
73
|
+
|
|
5
74
|
## [5.345.262] — 2026-11-26
|
|
6
75
|
- The Windows PR test scope now also runs the end-to-end tests a source module reaches through the hook binary: `command_rules` for `src/rules/`, and `host_run` and `replay` for `src/company_repo.rs`.
|
|
7
76
|
- The native hook engine now runs personal, pack and company folder hooks (`personal/hooks/<Event>`, `core/packages/<pack>/hooks/<Event>`, `companies/<co>/hooks/<Event>`) on Claude Code's PreToolUse, PostToolUse, SessionStart, UserPromptSubmit and SessionEnd, so `hq reindex` no longer keeps those events on `master-hook.sh` just because an HQ has such hooks. Each hook still runs as the script it is, with the same input, environment, order, tool matchers and time limit master-hook gave it. A hook answer the native engine cannot carry, or a guard hook whose result is unknown, refuses the call instead of letting it through.
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "hq.host-canary-release.v1",
|
|
3
|
-
"cliVersion": "5.345.
|
|
3
|
+
"cliVersion": "5.345.264",
|
|
4
4
|
"hosts": {
|
|
5
5
|
"claude": [
|
|
6
6
|
{
|
|
7
7
|
"passed": true,
|
|
8
|
-
"at": "2026-11-
|
|
9
|
-
"engineVersion": "0.3.1+hq.5.345.
|
|
8
|
+
"at": "2026-11-28T04:32:44.941Z",
|
|
9
|
+
"engineVersion": "0.3.1+hq.5.345.264.src.c0de88891c2a260c91d8729c894f215391431984cf0714238a71ba3e27e69ff1",
|
|
10
10
|
"gateSha256": "a2879dfe692233f5953bac86672947bbd82f3c5247292f3efcb80f16c3d2c6b1"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"passed": true,
|
|
14
|
-
"at": "2026-11-
|
|
15
|
-
"engineVersion": "0.3.1+hq.5.345.
|
|
14
|
+
"at": "2026-11-28T04:33:14.276Z",
|
|
15
|
+
"engineVersion": "0.3.1+hq.5.345.264.src.c0de88891c2a260c91d8729c894f215391431984cf0714238a71ba3e27e69ff1",
|
|
16
16
|
"gateSha256": "ca58a94859eae0a345c11c8d9c59303eb76350dc1cf223391037d21979c28718"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"passed": true,
|
|
20
|
-
"at": "2026-11-
|
|
21
|
-
"engineVersion": "0.3.1+hq.5.345.
|
|
20
|
+
"at": "2026-11-28T04:33:55.116Z",
|
|
21
|
+
"engineVersion": "0.3.1+hq.5.345.264.src.c0de88891c2a260c91d8729c894f215391431984cf0714238a71ba3e27e69ff1",
|
|
22
22
|
"gateSha256": "ecdbab7c2e0a1d94eb9c98f15e760390f215bc7115a217ded24b4275322722d2"
|
|
23
23
|
}
|
|
24
24
|
]
|
|
@@ -1260,6 +1260,43 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
1260
1260
|
readonly hidden: false;
|
|
1261
1261
|
}];
|
|
1262
1262
|
readonly subcommands: readonly [];
|
|
1263
|
+
}, {
|
|
1264
|
+
readonly name: "telemetry";
|
|
1265
|
+
readonly description: "Show sync health, errors and usage for a company, read from the HQ server";
|
|
1266
|
+
readonly aliases: readonly [];
|
|
1267
|
+
readonly hidden: false;
|
|
1268
|
+
readonly helpOption: true;
|
|
1269
|
+
readonly helpCommand: false;
|
|
1270
|
+
readonly usage: "[options]";
|
|
1271
|
+
readonly helpText: readonly [{
|
|
1272
|
+
readonly position: "after";
|
|
1273
|
+
readonly text: "\nReads sync health for a company from the HQ server. It changes nothing on this\ncomputer or on the server, and it does not start or stop a sync.\n\nYou must be signed in as a person (hq login) who is an owner or admin of the\ncompany. Agent and machine sign-ins are refused by the server.\n\nViews:\n summary overall health, held files and safety counters\n machines one line per machine, failing machines first\n errors recent sync errors with their codes\n people billed sync use per person\n folders uploads and downloads per folder\n loops paths rewritten on a fixed interval\n ranking companies ranked by sync use (Indigo staff; takes no --company)\n\nA view or section the server does not record yet prints \"not recorded yet\".\n\nExit codes:\n 0 report printed\n 2 bad arguments\n 3 not signed in\n 4 refused by the server\n 5 rate limited\n 6 server or network failure\n\nExamples:\n hq sync telemetry --company acme\n hq sync telemetry --company acme --view machines --window 7d\n hq sync telemetry --company acme --view errors --machine <installId>\n hq sync telemetry --company acme --json\n";
|
|
1274
|
+
}];
|
|
1275
|
+
readonly arguments: readonly [];
|
|
1276
|
+
readonly options: readonly [{
|
|
1277
|
+
readonly flags: "--company <company>";
|
|
1278
|
+
readonly description: "Company slug or cmp_ uid (defaults to the active company, else your only company)";
|
|
1279
|
+
readonly hidden: false;
|
|
1280
|
+
}, {
|
|
1281
|
+
readonly flags: "--view <view>";
|
|
1282
|
+
readonly description: "What to show: summary, machines, errors, people, folders, loops, ranking";
|
|
1283
|
+
readonly hidden: false;
|
|
1284
|
+
readonly defaultValue: "summary";
|
|
1285
|
+
}, {
|
|
1286
|
+
readonly flags: "--window <window>";
|
|
1287
|
+
readonly description: "Time window: 1h, 24h, 7d, 30d";
|
|
1288
|
+
readonly hidden: false;
|
|
1289
|
+
readonly defaultValue: "24h";
|
|
1290
|
+
}, {
|
|
1291
|
+
readonly flags: "--machine <installId>";
|
|
1292
|
+
readonly description: "Limit the report to one machine by its install id";
|
|
1293
|
+
readonly hidden: false;
|
|
1294
|
+
}, {
|
|
1295
|
+
readonly flags: "--json";
|
|
1296
|
+
readonly description: "Print the server response as JSON; failures print one JSON object";
|
|
1297
|
+
readonly hidden: false;
|
|
1298
|
+
}];
|
|
1299
|
+
readonly subcommands: readonly [];
|
|
1263
1300
|
}];
|
|
1264
1301
|
}, {
|
|
1265
1302
|
readonly name: "cloud";
|
|
@@ -1515,6 +1515,52 @@ export const COMMAND_CATALOG = [
|
|
|
1515
1515
|
}
|
|
1516
1516
|
],
|
|
1517
1517
|
"subcommands": []
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
"name": "telemetry",
|
|
1521
|
+
"description": "Show sync health, errors and usage for a company, read from the HQ server",
|
|
1522
|
+
"aliases": [],
|
|
1523
|
+
"hidden": false,
|
|
1524
|
+
"helpOption": true,
|
|
1525
|
+
"helpCommand": false,
|
|
1526
|
+
"usage": "[options]",
|
|
1527
|
+
"helpText": [
|
|
1528
|
+
{
|
|
1529
|
+
"position": "after",
|
|
1530
|
+
"text": "\nReads sync health for a company from the HQ server. It changes nothing on this\ncomputer or on the server, and it does not start or stop a sync.\n\nYou must be signed in as a person (hq login) who is an owner or admin of the\ncompany. Agent and machine sign-ins are refused by the server.\n\nViews:\n summary overall health, held files and safety counters\n machines one line per machine, failing machines first\n errors recent sync errors with their codes\n people billed sync use per person\n folders uploads and downloads per folder\n loops paths rewritten on a fixed interval\n ranking companies ranked by sync use (Indigo staff; takes no --company)\n\nA view or section the server does not record yet prints \"not recorded yet\".\n\nExit codes:\n 0 report printed\n 2 bad arguments\n 3 not signed in\n 4 refused by the server\n 5 rate limited\n 6 server or network failure\n\nExamples:\n hq sync telemetry --company acme\n hq sync telemetry --company acme --view machines --window 7d\n hq sync telemetry --company acme --view errors --machine <installId>\n hq sync telemetry --company acme --json\n"
|
|
1531
|
+
}
|
|
1532
|
+
],
|
|
1533
|
+
"arguments": [],
|
|
1534
|
+
"options": [
|
|
1535
|
+
{
|
|
1536
|
+
"flags": "--company <company>",
|
|
1537
|
+
"description": "Company slug or cmp_ uid (defaults to the active company, else your only company)",
|
|
1538
|
+
"hidden": false
|
|
1539
|
+
},
|
|
1540
|
+
{
|
|
1541
|
+
"flags": "--view <view>",
|
|
1542
|
+
"description": "What to show: summary, machines, errors, people, folders, loops, ranking",
|
|
1543
|
+
"hidden": false,
|
|
1544
|
+
"defaultValue": "summary"
|
|
1545
|
+
},
|
|
1546
|
+
{
|
|
1547
|
+
"flags": "--window <window>",
|
|
1548
|
+
"description": "Time window: 1h, 24h, 7d, 30d",
|
|
1549
|
+
"hidden": false,
|
|
1550
|
+
"defaultValue": "24h"
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
"flags": "--machine <installId>",
|
|
1554
|
+
"description": "Limit the report to one machine by its install id",
|
|
1555
|
+
"hidden": false
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
"flags": "--json",
|
|
1559
|
+
"description": "Print the server response as JSON; failures print one JSON object",
|
|
1560
|
+
"hidden": false
|
|
1561
|
+
}
|
|
1562
|
+
],
|
|
1563
|
+
"subcommands": []
|
|
1518
1564
|
}
|
|
1519
1565
|
]
|
|
1520
1566
|
},
|
|
@@ -141,6 +141,12 @@ export declare const REGISTRATION_PLAN: readonly [{
|
|
|
141
141
|
readonly parent: "sync";
|
|
142
142
|
readonly module: "./commands/sync-held.js";
|
|
143
143
|
readonly exportName: "registerSyncHeldCommands";
|
|
144
|
+
}, {
|
|
145
|
+
readonly type: "registrar";
|
|
146
|
+
readonly root: "sync";
|
|
147
|
+
readonly parent: "sync";
|
|
148
|
+
readonly module: "./commands/sync-telemetry.js";
|
|
149
|
+
readonly exportName: "registerSyncTelemetryCommand";
|
|
144
150
|
}, {
|
|
145
151
|
readonly type: "group";
|
|
146
152
|
readonly root: "cloud";
|
|
@@ -26,6 +26,7 @@ export const REGISTRATION_PLAN = [
|
|
|
26
26
|
{ type: "registrar", root: "sync", parent: "sync", module: "./commands/sync-narrow.js", exportName: "registerSyncNarrowCommand" },
|
|
27
27
|
{ type: "registrar", root: "sync", parent: "sync", module: "./commands/sync-manifest.js", exportName: "registerSyncManifestCommand" },
|
|
28
28
|
{ type: "registrar", root: "sync", parent: "sync", module: "./commands/sync-held.js", exportName: "registerSyncHeldCommands" },
|
|
29
|
+
{ type: "registrar", root: "sync", parent: "sync", module: "./commands/sync-telemetry.js", exportName: "registerSyncTelemetryCommand" },
|
|
29
30
|
{ type: "group", root: "cloud", id: "cloud", name: "cloud", description: "Cloud commands — provision entities and manage cloud-backed companies" },
|
|
30
31
|
{ type: "registrar", root: "cloud", parent: "cloud", module: "./commands/cloud-provision.js", exportName: "registerCloudProvisionCommands" },
|
|
31
32
|
{ type: "registrar", root: "cloud", parent: "cloud", module: "./commands/cloud-retire.js", exportName: "registerCloudRetireCommands" },
|
package/dist/commands/bot.d.ts
CHANGED
|
@@ -569,6 +569,8 @@ export declare function configFromLocalConfig(input: {
|
|
|
569
569
|
hqRoot: string;
|
|
570
570
|
dir: string;
|
|
571
571
|
local: BotLocalConfig | null;
|
|
572
|
+
/** Cloud record kind. Used when saved settings omit `kind`. */
|
|
573
|
+
botKind?: "personal" | "company";
|
|
572
574
|
overrides?: BotAdoptOverrides;
|
|
573
575
|
preserveFirstStart?: boolean;
|
|
574
576
|
now?: () => Date;
|
package/dist/commands/bot.js
CHANGED
|
@@ -90,7 +90,7 @@ import { clearPendingSwitch, recoverPendingSwitchSafely, writePendingSwitch } fr
|
|
|
90
90
|
import { classifyRuntimeFailure, isRuntimeUsageLimit, runtimeFailureReason, usageLimitResetsAt } from "../lib/bot/runtime-failure.js";
|
|
91
91
|
import { PROBE_DEFAULT_TIMEOUT_MS, probeBotRuntime } from "../lib/bot/probe.js";
|
|
92
92
|
import { BOT_LOGIN_RUNTIMES, botAuthEnv, botRuntimeAuth, capacityAccountHome, defaultSpawnBrowserSignIn, describeBotAuth, formatBotAuth, isBotLoginRuntime, restoreBotSessions, setAsideBotSessions, discardHeldBotLogin, holdPreviousBotLogin, restoreHeldBotLogin, signInBotRuntime, signOutBotRuntime, withRuntimeAuth, } from "../lib/bot/runtime-auth.js";
|
|
93
|
-
import { BotApi, BotApiError, BOT_RESTORE_DEFAULTS, buildBotLocalConfig, describeBotLocalConfig, orphanBotRunMessage, parseBotLocalConfig, removeOrphanBotDaemon, botDaemonStatus, botDir, botCredsPath, botLogPath, botsRoot, botTokenStateDir, botWorkerRelDir, buildBotDaemonPaths, createBotLogger, deleteBotCreds, installBotDaemon, repairBotDaemonIfStale, healBotDaemonNodeFromJob, introDmText, isBotMemoryMode, botLocalMemoryDir, botMemoryMode, resolveBotMemoryDir, validateBotIntro, validateBotDisplayName, validateBotKickoff, validateBotEffort, validateBotModel, effectiveBotEffort, BOT_EFFORT_LEVELS, DEFAULT_BOT_EFFORT, BOT_MEMORY_MODES, BOT_KINDS, isBotKind, effectiveBotKind, effectiveBotCompanies, botCompanySlug, normalizeBotCompanies, SETUP_BOT_WORKER_ID, isBotRuntimeId, botRuntimeFromBrainName, localNameForRemoteBot, remoteBotRunnability, isPidAlive, listBotWorkerOptions, patchBotConfig, readBotConfig, readBotCredsIdentity, readBotStatus, patchBotStatus, runtimeCrashSinceStart, resolveBotWorker, runBot, runtimeFor, scaffoldBotMemory, scaffoldBotWorker, startBotDaemon, stopBotDaemon, uninstallBotDaemon, validateBotName, writeBotConfig, writeBotCreds, BOT_RUNTIMES, BOT_INTRO_MAX_CHARS, BOT_DISPLAY_NAME_MAX_CHARS, BOT_KICKOFF_MAX_CHARS, detectBotPlatform, withBotLock, localBotRole, remoteBotRole, remoteBotDisplayName, personFacingName, writeCloudDisplayName, setupSlugFor, ASSISTANT_ROLE, HQ_FLEET_RUNTIME_ENGINE_ID, HQ_FLEET_LOCAL_RELEASE, authenticateFleetLocalBot, bootstrapFleetLocalBot, buildSystemPrompt, controlFleetBot as controlFleetLocalBot, ensureFleetBotDaemon, FleetDaemonStoppedError, fleetBotUnitId, fleetBotsManagedByDaemon, fleetLocalGatewayPid, fleetLocalProfileNeedsAdoption, fleetLocalServiceInstalled, fleetProviderForRuntime, importFleetLocalMachineCredential, importFleetLocalProviderLogin, fleetAuthUsesXaiOauthLogin, xaiOauthLoginHeldBack, xaiOauthLoginRefusal, fleetProviderNeedsSignIn, fleetOwnerCompanies, refreshFleetLocalInstructions, fleetLocalPromotionRuntime, installPinnedFleetLocalDistribution, installTargetFleetLocalDistribution, resolveFleetLocalPointerTarget, resolveFleetLocalTargetRelease, fleetLocalProfileDir, fleetProfileOwnerCompanies, fleetLocalChannels, readFleetLocalGatewayState, readFleetLocalIntroSentAt, readFleetLocalSignInNeeded, readPromptSources, removeFleetLocalBot, } from "../lib/bot/index.js";
|
|
93
|
+
import { BotApi, BotApiError, BOT_RESTORE_DEFAULTS, buildBotLocalConfig, describeBotLocalConfig, orphanBotRunMessage, parseBotLocalConfig, removeOrphanBotDaemon, botDaemonStatus, botDir, botCredsPath, botLogPath, botsRoot, botTokenStateDir, botWorkerRelDir, buildBotDaemonPaths, createBotLogger, deleteBotCreds, installBotDaemon, repairBotDaemonIfStale, healBotDaemonNodeFromJob, introDmText, isBotMemoryMode, botLocalMemoryDir, botMemoryMode, resolveBotMemoryDir, validateBotIntro, validateBotDisplayName, validateBotKickoff, validateBotEffort, validateBotModel, effectiveBotEffort, BOT_EFFORT_LEVELS, DEFAULT_BOT_EFFORT, BOT_MEMORY_MODES, BOT_KINDS, isBotKind, effectiveBotKind, effectiveBotCompanies, botCompanySlug, normalizeBotCompanies, SETUP_BOT_WORKER_ID, isBotRuntimeId, botRuntimeFromBrainName, localNameForRemoteBot, remoteBotRunnability, restoreKindForRecord, isPidAlive, listBotWorkerOptions, patchBotConfig, readBotConfig, readBotCredsIdentity, readBotStatus, patchBotStatus, runtimeCrashSinceStart, resolveBotWorker, runBot, runtimeFor, scaffoldBotMemory, scaffoldBotWorker, startBotDaemon, stopBotDaemon, uninstallBotDaemon, validateBotName, writeBotConfig, writeBotCreds, BOT_RUNTIMES, BOT_INTRO_MAX_CHARS, BOT_DISPLAY_NAME_MAX_CHARS, BOT_KICKOFF_MAX_CHARS, detectBotPlatform, withBotLock, localBotRole, remoteBotRole, remoteBotDisplayName, personFacingName, writeCloudDisplayName, setupSlugFor, ASSISTANT_ROLE, HQ_FLEET_RUNTIME_ENGINE_ID, HQ_FLEET_LOCAL_RELEASE, authenticateFleetLocalBot, bootstrapFleetLocalBot, buildSystemPrompt, controlFleetBot as controlFleetLocalBot, ensureFleetBotDaemon, FleetDaemonStoppedError, fleetBotUnitId, fleetBotsManagedByDaemon, fleetLocalGatewayPid, fleetLocalProfileNeedsAdoption, fleetLocalServiceInstalled, fleetProviderForRuntime, importFleetLocalMachineCredential, importFleetLocalProviderLogin, fleetAuthUsesXaiOauthLogin, xaiOauthLoginHeldBack, xaiOauthLoginRefusal, fleetProviderNeedsSignIn, fleetOwnerCompanies, refreshFleetLocalInstructions, fleetLocalPromotionRuntime, installPinnedFleetLocalDistribution, installTargetFleetLocalDistribution, resolveFleetLocalPointerTarget, resolveFleetLocalTargetRelease, fleetLocalProfileDir, fleetProfileOwnerCompanies, fleetLocalChannels, readFleetLocalGatewayState, readFleetLocalIntroSentAt, readFleetLocalSignInNeeded, readPromptSources, removeFleetLocalBot, } from "../lib/bot/index.js";
|
|
94
94
|
import { gatedInteractiveLogin } from "../utils/interactive-caller.js";
|
|
95
95
|
import { brainSignInStatus, fleetInstallProgressReporter, fleetRuntimeStatus, runBotAuthStatus, runBotRuntimeInstall, runBotRuntimeStatus, runBotSignIn } from "./bot-runtime.js";
|
|
96
96
|
import { ensureFleetRuntimeInstalled } from "../lib/bot/fleet-local.js";
|
|
@@ -3820,7 +3820,7 @@ export function configFromLocalConfig(input) {
|
|
|
3820
3820
|
notes.push(`${name} was created before HQ kept a bot's settings in the cloud, so it comes back on defaults (${describeBotLocalConfig(null)}). Change them with: hq bot set ${name} --model <id> --effort <level>`);
|
|
3821
3821
|
}
|
|
3822
3822
|
const runtime = input.overrides?.runtime ?? local?.runtime ?? BOT_RESTORE_DEFAULTS.runtime;
|
|
3823
|
-
const kind =
|
|
3823
|
+
const kind = restoreKindForRecord({ botKind: input.botKind, localConfig: local });
|
|
3824
3824
|
const memory = local?.memory ?? BOT_RESTORE_DEFAULTS.memory;
|
|
3825
3825
|
const model = input.overrides?.model ?? local?.model;
|
|
3826
3826
|
let effort = local?.effort;
|
|
@@ -3930,6 +3930,7 @@ async function adoptRemoteBotLocked(input) {
|
|
|
3930
3930
|
hqRoot: input.hqRoot,
|
|
3931
3931
|
dir,
|
|
3932
3932
|
local,
|
|
3933
|
+
botKind: bot.botKind,
|
|
3933
3934
|
...(input.overrides ? { overrides: input.overrides } : {}),
|
|
3934
3935
|
...(input.preserveFirstStart ? { preserveFirstStart: true } : {}),
|
|
3935
3936
|
});
|
|
@@ -4218,7 +4219,7 @@ function notRunnableHint(reason) {
|
|
|
4218
4219
|
if (reason === "cloud-compute")
|
|
4219
4220
|
return "runs in the cloud, not on a computer";
|
|
4220
4221
|
if (reason === "company-bot")
|
|
4221
|
-
return "a company bot
|
|
4222
|
+
return "a company bot whose saved settings would run it as personal";
|
|
4222
4223
|
return "not a bot this computer can run";
|
|
4223
4224
|
}
|
|
4224
4225
|
/** `hq bot list --remote` — the local bots this account owns, wherever they live. */
|