@indigoai-us/hq-cli 5.345.211 → 5.345.212
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 +39 -0
- package/dist/command-catalog.generated.d.ts +28 -0
- package/dist/command-catalog.generated.js +34 -0
- package/dist/command-registration-plan.d.ts +15 -0
- package/dist/command-registration-plan.js +20 -1
- package/dist/commands/agents.js +6 -1
- package/dist/commands/billing.js +17 -4
- package/dist/commands/bot-runtime.d.ts +21 -2
- package/dist/commands/bot-runtime.js +54 -9
- package/dist/commands/bot.d.ts +13 -0
- package/dist/commands/bot.js +142 -12
- package/dist/commands/daemon.js +60 -5
- package/dist/commands/files.js +2 -2
- package/dist/commands/integrations-api.d.ts +11 -0
- package/dist/commands/integrations-connect.d.ts +2 -0
- package/dist/commands/integrations-connect.js +17 -5
- package/dist/commands/integrations-core.d.ts +1 -1
- package/dist/commands/integrations-core.js +18 -10
- package/dist/commands/integrations.js +1 -1
- package/dist/commands/lanes.js +34 -16
- package/dist/commands/whoami.js +7 -6
- package/dist/lazy-commands.js +4 -1
- package/dist/lib/billing/usage-only.d.ts +4 -1
- package/dist/lib/billing/usage-only.js +7 -2
- package/dist/lib/bot/api.d.ts +1 -1
- package/dist/lib/bot/config.js +2 -1
- package/dist/lib/bot/fleet-daemon.d.ts +4 -0
- package/dist/lib/bot/fleet-daemon.js +12 -1
- package/dist/lib/bot/fleet-download.d.ts +6 -0
- package/dist/lib/bot/fleet-download.js +128 -3
- package/dist/lib/bot/fleet-local.d.ts +38 -1
- package/dist/lib/bot/fleet-local.js +239 -26
- package/dist/lib/bot/install-progress.d.ts +28 -0
- package/dist/lib/bot/install-progress.js +185 -0
- package/dist/lib/bot/legacy-provider-login.d.ts +22 -1
- package/dist/lib/bot/legacy-provider-login.js +67 -9
- package/dist/lib/bot/prompt.d.ts +1 -0
- package/dist/lib/bot/prompt.js +3 -2
- package/dist/lib/bot/readiness.d.ts +68 -0
- package/dist/lib/bot/readiness.js +145 -0
- package/dist/lib/bot/run.d.ts +2 -0
- package/dist/lib/bot/run.js +6 -3
- package/dist/lib/bot/scaffold.d.ts +6 -3
- package/dist/lib/bot/scaffold.js +18 -12
- package/dist/lib/capacity/ledger.d.ts +7 -0
- package/dist/lib/capacity/ledger.js +31 -1
- package/dist/lib/capacity/project.d.ts +1 -1
- package/dist/lib/capacity/project.js +13 -4
- package/dist/lib/capacity/route.d.ts +10 -0
- package/dist/lib/capacity/route.js +16 -0
- package/dist/lib/daemon/install.d.ts +15 -0
- package/dist/lib/daemon/install.js +31 -0
- package/dist/lib/daemon/migrate.js +29 -4
- package/dist/lib/daemon/run.d.ts +1 -0
- package/dist/lib/daemon/run.js +6 -1
- package/dist/lib/daemon/supervisor.d.ts +1 -0
- package/dist/lib/daemon/supervisor.js +5 -3
- package/dist/lib/doctor/__testing__/run-doctor.js +4 -0
- package/dist/lib/doctor/checks/jq.d.ts +27 -0
- package/dist/lib/doctor/checks/jq.js +82 -0
- package/dist/lib/doctor/registry.js +4 -0
- package/dist/lib/flag-snapshot-file.js +36 -8
- package/dist/lib/install/codex-targets.d.ts +52 -1
- package/dist/lib/install/codex-targets.js +77 -2
- package/dist/lib/lanes/monitor.d.ts +4 -1
- package/dist/lib/lanes/monitor.js +47 -10
- package/dist/lib/lanes/spawn.js +8 -1
- package/dist/lib/lanes/watch.js +31 -0
- package/dist/lib/onboarding/checkpoint.d.ts +6 -0
- package/dist/lib/onboarding/checkpoint.js +6 -0
- package/dist/lib/onboarding/orchestrator.d.ts +3 -1
- package/dist/lib/onboarding/orchestrator.js +62 -9
- package/dist/lib/onboarding/types.d.ts +8 -0
- package/dist/lib/work-context/organize.d.ts +23 -1
- package/dist/lib/work-context/organize.js +25 -3
- package/dist/lib/work-context/reconcile.js +3 -2
- package/dist/secrets-env-action.js +7 -5
- package/dist/startup-registration.js +7 -2
- package/dist/utils/billing-gate.d.ts +12 -16
- package/dist/utils/billing-gate.js +17 -18
- package/dist/utils/install-tree-torn.d.ts +22 -4
- package/dist/utils/install-tree-torn.js +24 -0
- package/dist/utils/registration-plan-error.d.ts +22 -0
- package/dist/utils/registration-plan-error.js +27 -0
- package/dist/utils/sentry-fingerprint.js +3 -0
- package/dist/utils/unauthorized-error.d.ts +36 -0
- package/dist/utils/unauthorized-error.js +105 -0
- package/dist/utils/vault-api.js +7 -5
- package/package.json +7 -7
- package/scripts/install-hook-engine.mjs +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [5.345.212] — 2026-11-10
|
|
6
|
+
- `hq whoami --company <slug> --json` no longer prints the cached sign-in ID token. Since v5.276.0 the JSON carried it as `planLimits.idToken`, so a hook or agent that captured the output also captured the token. `planLimits` is now `{ status }` or `null`; nothing else in the output changed.
|
|
7
|
+
- Billing copy for usage pricing now quotes the pricing feed. The agent box refusal adds the agent-run price ("plus $0.05 per agent run"). `hq billing status` with no card on usage pricing says HQ asks for a card once usage this month passes the included amount; a member is told to ask an owner or admin to add a card. A usage-pricing company whose box is blocked for lack of a card is told "A card is needed before HQ creates this box." Legacy flat-plan companies see the same text as before. The unused legacy `AGENT_PRICE_CENTS` and `OUTPOST_PRICE_CENTS` constants are removed.
|
|
8
|
+
- Report whether a local bot is ready to chat: `hq bot list --json` and `hq bot status --json` add `readiness` (creating, installing, starting, ready, offline), `ready` and `readyAt`, read from the gateway's `gateway_state.json`, and `hq bot list` shows "starting" until the bot is ready. `hq bot create` reports its four setup steps (as JSON lines with `--json --progress`) and returns at Ready to chat or after `--ready-timeout` seconds (default 300) with a clear message. `hq bot runtime status --json` adds `installed` and the setup estimate ("about 5 minutes" without the runtime, "about a minute" with it). The `hq bot run` heartbeat carries `ready` and `readyAt`. `hq bot runtime install` and the daemon's Fleet bot update read a local release pointer from `HQ_FLEET_RELEASE_POINTER_FILE`, with `file://` asset links, for testing a locally built release.
|
|
9
|
+
- A Fleet bot installed from a prerelease, such as a locally built release, no longer reads back as a legacy bot. Before this fix, hq daemon ran it under the legacy runner, which stopped its gateway seconds into setup, and `hq bot start` registered the runtime's own login item. `hq bot create` now reports a bot whose gateway stopped before it was ready as `offline`. On a Mac with hq daemon, moving a legacy bot to the HQ Fleet Runtime goes through the daemon instead of the runtime's login item.
|
|
10
|
+
- On a Mac with hq daemon, a restarted HQ Fleet bot no longer reads as ready for the seconds before its new gateway writes its own state: the daemon clears the `ready` signal the previous gateway left in `gateway_state.json` before it starts the new gateway.
|
|
11
|
+
- On a Mac with hq daemon, `hq bot create` no longer reports a new bot as stopped while it is still starting: the bot stays held until create asks the daemon to start it, so the daemon no longer starts its gateway on its own and then restarts it at create's request, and a restart request for a held unit re-reads the plan and starts it right away.
|
|
12
|
+
- A bot created with a display name introduces itself by that name: the default hello and the scaffolded `persona.md`, `worker.yaml` name and memory README use the display name, with the handle kept for `hq bot` commands. A bot without one keeps its handle, and a custom `--intro` is sent verbatim.
|
|
13
|
+
- `hq bot runtime install --json` and `hq bot create --json --progress` add `{"event":"install"}` lines with the install phase (download, verify, prepare, unpack, environment, done), bytes downloaded and total, and a 0 to 1 fraction for the whole install, at most about four a second, for a progress bar. Install messages no longer name release files.
|
|
14
|
+
- The runtime's release files download at the same time, and a large one downloads as eight parallel byte ranges when storage allows it, continuing each range where it stopped on the next try. `hq bot create` checks for its bot's ready signal, and hq daemon for start requests, every 250 ms instead of every second.
|
|
15
|
+
- On a Mac with hq daemon, signing in a new Grok or Codex bot with `hq bot auth` starts its gateway once, through the daemon, the way a Claude bot starts. It no longer installs the bot's own login item and starts a gateway the daemon then stops and starts again, which cost about half a minute.
|
|
16
|
+
- `hq bot auth-status --provider <chatgpt|grok> --json` prints `{ "signedIn": true|false }`: whether a Fleet bot created now would sign in from a login already on this computer (the Codex CLI login for ChatGPT, another Fleet bot's Grok login for Grok) instead of asking for its own.
|
|
17
|
+
- A new Grok bot reuses the Grok CLI login in `~/.grok/auth.json` (the HQ Fleet client's record with a refresh token) when its HQ Fleet Local release is 0.4.31-local.13 or newer; `hq bot auth-status --provider grok` and the legacy-move check count it. Without that login the device sign-in is unchanged.
|
|
18
|
+
- `hq bot auth --json` prints the helper's `{"event":"auth","phase":"device-code",...}` line on stdout as soon as the Grok device code is ready (helper 0.4.31-local.13 or newer).
|
|
19
|
+
- Local bots now install HQ Fleet Local 0.4.31 on HQ Fleet Runtime main 398523c9.
|
|
20
|
+
This release shares the Grok CLI login (`<GROK_HOME>/auth.json`, else
|
|
21
|
+
`~/.grok/auth.json`) with a new Grok bot, so `hq bot auth` signs it in without a
|
|
22
|
+
second device-code sign-in, and `hq bot auth --json` prints the device-code line
|
|
23
|
+
when one is still needed. Installed bots move to 0.4.31 at the daemon's next
|
|
24
|
+
update pass.
|
|
25
|
+
- `hq capacity` no longer shows a provider as `ok` when it has no limit rows. After `hq capacity login grok --account <label>`, a Grok billing response the parser could not map (or an HTTP error) was recorded against that account only, so Grok read `ok` with an empty limits table and the error was dropped (feedback_601a961f). A provider or account with no mapped limits now reads `unknown`. Each account carries its newest parse or HTTP error until its next good read clears it, and the provider's last error shows it only for an account that is in the table.
|
|
26
|
+
- Codex: the `hq install --global --runtime codex` entries in `~/.codex/hooks.json` now claim each hook event once, so inside an HQ root the HQ hooks run once per event instead of twice once the hq-core Codex adapter claims too (hq-core-staging companion change). Both registrations stay. Each run claims the event with an atomic directory under `~/.hq/state/codex-hook-claims`, keyed on the real HQ root, the Codex process and the exact payload. The first run does the full work. A second run of the same event within 10 seconds exits 0 with no output. Markers are pruned after 2 minutes. When anything is missing (`HOME`, the hook target, a writable claim directory), the entry runs without claiming, so an event never ends up with no hook. Windows (`commandWindows`) still runs both. Re-run `hq install --global --runtime codex` to update an existing install (feedback_bf4df70e, feedback_d69d01c0).
|
|
27
|
+
- `hq daemon install` now takes over the older Work Mesh unit (`ai.getindigo.hq-mesh-daemon` on macOS, `hq-mesh-daemon.service` or the mesh scheduled task elsewhere) once a running daemon holds its lock. It stops the old unit and moves its definition aside, the same way `hq daemon migrate --apply` does, so the two no longer run side by side. On macOS and Linux the install waits up to 10 seconds for that lock, because launchd and systemd report the unit loaded even when the daemon crash-loops. If no live daemon appears, the old unit keeps running and the install prints a warning. A takeover that fails also leaves the old unit running with a warning. `hq daemon uninstall --restore-legacy` gives the old unit back, and plain `hq daemon uninstall` now says so when it leaves taken-over units behind. A second takeover of the same unit keeps the first saved definition and its single record entry, and moves the new definition to a timestamped file next to it. Other older units are still only listed until `hq daemon migrate --apply` (feedback_c85ad51b).
|
|
28
|
+
- Added (doctor, install): `hq doctor` now checks that jq is on PATH and prints its version, and reports a missing jq as a failure with an install command for the platform. On Windows, `npm install -g @indigoai-us/hq-cli` prints one warning when jq is not on PATH: "Install jq (Windows: winget install jqlang.jq) and open a new terminal; HQ hooks block tool calls until jq is on PATH." The install never fails over it and does not install jq. HQ hooks need jq to parse every hook call.
|
|
29
|
+
- The local flag snapshot can now store the mode strings `"off"`, `"shadow"` and `"on"` for `hook-engine-port-<hook-id>` flags, and the CLI still reads such a snapshot. Before, the writer kept only true and false. This is groundwork with no visible change yet: the flag service and `@indigoai-us/hq-flags-client` 0.2.0 still accept only boolean values, so a mode string cannot arrive until they do. Other flags keep booleans only, and CLI flag checks still see only boolean values.
|
|
30
|
+
- `hq lanes create --account auto` no longer refuses when there is no capacity reading to route on (feedback_9e444a9f, feedback_86552798). With no capacity ledger yet it failed with `capacity_unavailable` ("run hq capacity enable"), and with a fresh ledger that had no reading for any lane account it failed with `no_account_with_room`, while the same command without `--account` worked. In both cases it now chooses the account as if `--account` were omitted and records why in `account_pick`. A refusal still stands when any lane account has a reading that shows it used up, signed out, usage-only or a day old, and the one-time refresh from feedback_94446741 still runs first.
|
|
31
|
+
- A lane waiting on a long nested run no longer looks silent (feedback_86552798). `hq lanes watch`, the command a senior session keeps under Monitor, now prints a line when the lane watcher marks a running lane stalled (with the time and reason), when it starts progressing again, and for each progress event the watcher records, so a run longer than a Monitor window reads as progress or as a plain stall. The lane brief rule that forbids ending a turn while a background process runs now covers subagents and nested runs too: wait for them before writing the envelope, wait in windows shorter than the 30-minute Monitor limit with one progress line per window, and write a blocked envelope naming a nested run that cannot finish.
|
|
32
|
+
- `hq lanes ...` no longer fails with "No registration plan for 'lanes'" when hq-cli updates itself while the command starts (seen on an Outpost moving from 5.345.208 to a release with `hq runners`). The command registration plan now resolves every top-level alias (`lanes`, `master-sync`) to the command it belongs to, and a test checks that every command name and alias in the command catalog has a plan. A "No registration plan" error during command registration is now treated as a torn install: hq waits for the install to settle and re-runs the command once from the updated install, the same recovery used when a module fails to load mid-update, so a root that a newer release removed no longer reaches the user or Sentry as a raw error. Sentry HQ-CLI-GM, feedback 05f34e58.
|
|
33
|
+
- `hq lanes monitor-check` now counts a Monitor armed as `HQ_ROOT=<hq root> hq lanes watch <lane-id>...` (or `hq runners watch`). A senior session whose cwd is a repo outside the HQ tree could not use bare `hq lanes watch`, which cannot find the HQ root from there, and the gate rejected every other command shape, so the Stop hook kept blocking. One leading `HQ_ROOT=` assignment (bare, single- or double-quoted) is accepted. Its value may hold only path characters (letters, digits, `/ . _ - ~`, and spaces inside quotes), so a value with `$`, backticks, `\`, `;`, `|`, `&`, `<`, `>` or `#` is not counted, and any other prefix still is not either. The gate splits words only on spaces and tabs, as a shell does, and does not count a command that contains any character outside printable ASCII and tab (such as a no-break space, vertical tab, form feed, carriage return or an inner newline). The reminder text names the form. (feedback_b6b59676)
|
|
34
|
+
- Work Mesh project decisions now offer only the session's own project. The server lists the company's most active projects with no repo or folder match, so a session with no project context was asked to bind to an unrelated project's stories. Bind options are now limited to the session's bound project, project hint and local project candidates; a session with none gets only "Create new project" and "Leave untracked" (feedback_f81b23c2).
|
|
35
|
+
- `hq onboard resume` no longer accepts an invite that another sign-in left on this machine. A join run now saves its invite token only after the person step, together with the person it was saved for, and marks the checkpoint with a format version. Resume only accepts a token saved for the caller's own person. An unbound token in a current checkpoint is never used. In a checkpoint from an older CLI, an unbound token counts only when its saved person belongs to the caller. Any other saved token is dropped, and resume asks you to run `hq onboard join <token>` with your own invite. A join that stops before the person step leaves the earlier token and its binding unchanged. When the person step replaces the saved person, it drops the saved token in the same write, so the new person's resume never inherits it. A token you pass to `hq onboard join` yourself is still accepted (feedback_a169f6dc, follow-up to the review of #2516).
|
|
36
|
+
- A company Outpost job that gets HTTP 401 from HQ no longer tells it to "Run `hq login`", which an Outpost cannot do. It now says HQ rejected the Outpost's identity, shows the server's code (for example `OUTPOST_PRINCIPAL_INVALID`) and the Outpost uid, and gives the recovery: re-run the job, then a company owner or admin runs `hq outposts status` and `hq outposts refresh-config`. Agent boxes and other machine identities get a matching message that points at their machine credentials. People on a laptop still see the `hq login` message. (feedback_dfc0bb49)
|
|
37
|
+
- `hq integrations reconnect --connection <id>` re-keys the connection you
|
|
38
|
+
named, for a pasted key and for a browser sign-in. A legacy shared
|
|
39
|
+
connection reconnects as a company connection, so a new key no longer lands
|
|
40
|
+
on a personal connection while the shared one stays expired. Full pinning to
|
|
41
|
+
the named connection needs hq-pro #5460; older servers still place a legacy
|
|
42
|
+
row by company scope. (feedback_a79e0c89)
|
|
43
|
+
|
|
5
44
|
## [5.345.211] — 2026-11-10
|
|
6
45
|
- `hq integrations connect` now cleans a pasted API key before sending it: it trims the ends and joins a key wrapped across lines. A key with a smart quote or another character that can't be sent stops with a plain message instead of failing on the server.
|
|
7
46
|
- On computers using the new sync engine, its vaults no longer stop and restart every 15 to 60 seconds while another sync runner, such as the HQ desktop app's, holds the sync lock. The engine now runs a vault only when that runner was started after the vault's old-sync switch was turned off and 10 minutes have passed since the switch. If the runner was started before the switch, or the daemon cannot read when it started, the engine waits and says why.
|
|
@@ -19357,6 +19357,14 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
19357
19357
|
readonly flags: "--no-start";
|
|
19358
19358
|
readonly description: "Create without starting";
|
|
19359
19359
|
readonly hidden: false;
|
|
19360
|
+
}, {
|
|
19361
|
+
readonly flags: "--ready-timeout <seconds>";
|
|
19362
|
+
readonly description: "How long to wait for the bot to be ready to chat before returning (default 300)";
|
|
19363
|
+
readonly hidden: false;
|
|
19364
|
+
}, {
|
|
19365
|
+
readonly flags: "--progress";
|
|
19366
|
+
readonly description: "With --json: print each setup step and download progress as one JSON line before the final document";
|
|
19367
|
+
readonly hidden: false;
|
|
19360
19368
|
}, {
|
|
19361
19369
|
readonly flags: "--json";
|
|
19362
19370
|
readonly description: "Print machine-readable JSON";
|
|
@@ -19628,6 +19636,26 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
19628
19636
|
readonly hidden: false;
|
|
19629
19637
|
}];
|
|
19630
19638
|
readonly subcommands: readonly [];
|
|
19639
|
+
}, {
|
|
19640
|
+
readonly name: "auth-status";
|
|
19641
|
+
readonly description: "Say whether a Fleet bot created now would need its own ChatGPT or Grok sign-in, or reuse a login already on this computer";
|
|
19642
|
+
readonly aliases: readonly [];
|
|
19643
|
+
readonly hidden: false;
|
|
19644
|
+
readonly helpOption: true;
|
|
19645
|
+
readonly helpCommand: false;
|
|
19646
|
+
readonly usage: "[options]";
|
|
19647
|
+
readonly helpText: readonly [];
|
|
19648
|
+
readonly arguments: readonly [];
|
|
19649
|
+
readonly options: readonly [{
|
|
19650
|
+
readonly flags: "--provider <provider>";
|
|
19651
|
+
readonly description: "Provider: chatgpt or grok";
|
|
19652
|
+
readonly hidden: false;
|
|
19653
|
+
}, {
|
|
19654
|
+
readonly flags: "--json";
|
|
19655
|
+
readonly description: "Print machine-readable JSON: { signedIn }";
|
|
19656
|
+
readonly hidden: false;
|
|
19657
|
+
}];
|
|
19658
|
+
readonly subcommands: readonly [];
|
|
19631
19659
|
}, {
|
|
19632
19660
|
readonly name: "logs";
|
|
19633
19661
|
readonly description: "Show the bot's log";
|
|
@@ -23600,6 +23600,16 @@ export const COMMAND_CATALOG = [
|
|
|
23600
23600
|
"description": "Create without starting",
|
|
23601
23601
|
"hidden": false
|
|
23602
23602
|
},
|
|
23603
|
+
{
|
|
23604
|
+
"flags": "--ready-timeout <seconds>",
|
|
23605
|
+
"description": "How long to wait for the bot to be ready to chat before returning (default 300)",
|
|
23606
|
+
"hidden": false
|
|
23607
|
+
},
|
|
23608
|
+
{
|
|
23609
|
+
"flags": "--progress",
|
|
23610
|
+
"description": "With --json: print each setup step and download progress as one JSON line before the final document",
|
|
23611
|
+
"hidden": false
|
|
23612
|
+
},
|
|
23603
23613
|
{
|
|
23604
23614
|
"flags": "--json",
|
|
23605
23615
|
"description": "Print machine-readable JSON",
|
|
@@ -23934,6 +23944,30 @@ export const COMMAND_CATALOG = [
|
|
|
23934
23944
|
],
|
|
23935
23945
|
"subcommands": []
|
|
23936
23946
|
},
|
|
23947
|
+
{
|
|
23948
|
+
"name": "auth-status",
|
|
23949
|
+
"description": "Say whether a Fleet bot created now would need its own ChatGPT or Grok sign-in, or reuse a login already on this computer",
|
|
23950
|
+
"aliases": [],
|
|
23951
|
+
"hidden": false,
|
|
23952
|
+
"helpOption": true,
|
|
23953
|
+
"helpCommand": false,
|
|
23954
|
+
"usage": "[options]",
|
|
23955
|
+
"helpText": [],
|
|
23956
|
+
"arguments": [],
|
|
23957
|
+
"options": [
|
|
23958
|
+
{
|
|
23959
|
+
"flags": "--provider <provider>",
|
|
23960
|
+
"description": "Provider: chatgpt or grok",
|
|
23961
|
+
"hidden": false
|
|
23962
|
+
},
|
|
23963
|
+
{
|
|
23964
|
+
"flags": "--json",
|
|
23965
|
+
"description": "Print machine-readable JSON: { signedIn }",
|
|
23966
|
+
"hidden": false
|
|
23967
|
+
}
|
|
23968
|
+
],
|
|
23969
|
+
"subcommands": []
|
|
23970
|
+
},
|
|
23937
23971
|
{
|
|
23938
23972
|
"name": "logs",
|
|
23939
23973
|
"description": "Show the bot's log",
|
|
@@ -590,5 +590,20 @@ export declare const REGISTRATION_PLAN: readonly [{
|
|
|
590
590
|
readonly exportName: "registerListingsCommand";
|
|
591
591
|
}];
|
|
592
592
|
export declare function registerAllCommands(program: Command): Promise<void>;
|
|
593
|
+
/**
|
|
594
|
+
* Every top-level alias in the generated command catalog, mapped to the plan
|
|
595
|
+
* root that registers it. registerCommandRoot resolves through this map so a
|
|
596
|
+
* caller that passes an alias still finds the plan.
|
|
597
|
+
*
|
|
598
|
+
* This matters when an install is replaced while `hq` starts (self-update on an
|
|
599
|
+
* Outpost): the running process has already loaded the OLD command catalog, so
|
|
600
|
+
* its lazy loader asks for the old root name, but this module is imported from
|
|
601
|
+
* the NEW tree. When a root is renamed and its old name kept as an alias (hq
|
|
602
|
+
* lanes -> hq runners, hq-cli #2490), the old name must still reach the new
|
|
603
|
+
* plan (Sentry HQ-CLI-GM). The map lives here, not in the catalog, because the
|
|
604
|
+
* catalog module is already cached from the old tree in that case.
|
|
605
|
+
* lazy-registration-parity.test.ts keeps this map equal to the catalog.
|
|
606
|
+
*/
|
|
607
|
+
export declare const ROOT_ALIASES: ReadonlyMap<string, string>;
|
|
593
608
|
export declare function registerCommandRoot(program: Command, root: string): Promise<boolean>;
|
|
594
609
|
//# sourceMappingURL=command-registration-plan.d.ts.map
|
|
@@ -147,8 +147,27 @@ async function executePlan(program, steps) {
|
|
|
147
147
|
export async function registerAllCommands(program) {
|
|
148
148
|
await executePlan(program, REGISTRATION_PLAN);
|
|
149
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Every top-level alias in the generated command catalog, mapped to the plan
|
|
152
|
+
* root that registers it. registerCommandRoot resolves through this map so a
|
|
153
|
+
* caller that passes an alias still finds the plan.
|
|
154
|
+
*
|
|
155
|
+
* This matters when an install is replaced while `hq` starts (self-update on an
|
|
156
|
+
* Outpost): the running process has already loaded the OLD command catalog, so
|
|
157
|
+
* its lazy loader asks for the old root name, but this module is imported from
|
|
158
|
+
* the NEW tree. When a root is renamed and its old name kept as an alias (hq
|
|
159
|
+
* lanes -> hq runners, hq-cli #2490), the old name must still reach the new
|
|
160
|
+
* plan (Sentry HQ-CLI-GM). The map lives here, not in the catalog, because the
|
|
161
|
+
* catalog module is already cached from the old tree in that case.
|
|
162
|
+
* lazy-registration-parity.test.ts keeps this map equal to the catalog.
|
|
163
|
+
*/
|
|
164
|
+
export const ROOT_ALIASES = new Map([
|
|
165
|
+
["master-sync", "reindex"],
|
|
166
|
+
["lanes", "runners"],
|
|
167
|
+
]);
|
|
150
168
|
export async function registerCommandRoot(program, root) {
|
|
151
|
-
const
|
|
169
|
+
const planRoot = ROOT_ALIASES.get(root) ?? root;
|
|
170
|
+
const steps = REGISTRATION_PLAN.filter((step) => step.root === planRoot);
|
|
152
171
|
if (steps.length === 0)
|
|
153
172
|
return false;
|
|
154
173
|
await executePlan(program, steps);
|
package/dist/commands/agents.js
CHANGED
|
@@ -1694,7 +1694,12 @@ export function registerAgentsCommand(program) {
|
|
|
1694
1694
|
if (err instanceof AgentsHttpError &&
|
|
1695
1695
|
err.status === 402 &&
|
|
1696
1696
|
err.billing) {
|
|
1697
|
-
|
|
1697
|
+
// US-034: the plan picks the sentence. Asked after the link is
|
|
1698
|
+
// minted and bounded like the 403 path: at most 3 s, then legacy copy.
|
|
1699
|
+
await surfaceBillingBlocked(token, err.billing, err.message, async () => isUsageOnly(await fetchCompanyPricingPlan(token, companyUid, {
|
|
1700
|
+
timeoutMs: 2000,
|
|
1701
|
+
deadlineMs: 3000,
|
|
1702
|
+
}).catch(() => null)));
|
|
1698
1703
|
process.exit(1);
|
|
1699
1704
|
}
|
|
1700
1705
|
throw err;
|
package/dist/commands/billing.js
CHANGED
|
@@ -31,7 +31,7 @@ import { mintPaymentLink } from "../utils/billing-gate.js";
|
|
|
31
31
|
import { openUsageSwitch } from "../utils/team-upgrade.js";
|
|
32
32
|
import { registerBillingSponsorCommands } from "./billing-sponsor.js";
|
|
33
33
|
import { fetchCompanyPricingPlan, isUsageOnly, pricingPlanFromBody, readBillingState, usageOnlyUpgradeLines, } from "../lib/billing/usage-only.js";
|
|
34
|
-
import { fetchUsageCard } from "../lib/billing/usage-card.js";
|
|
34
|
+
import { fetchUsageCard, formatCardUsd } from "../lib/billing/usage-card.js";
|
|
35
35
|
import { accountStatusLines } from "../lib/billing/billing-status-lines.js";
|
|
36
36
|
import { registerBillingUsageCommand } from "./billing-usage.js";
|
|
37
37
|
const CHARGED_ON = {
|
|
@@ -202,18 +202,31 @@ export function registerBillingCommand(program) {
|
|
|
202
202
|
(scheduled.phase === "preview" ? " (preview window open)." : "."));
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
+
const state = readBillingState(summary);
|
|
206
|
+
const onUsage = !!state && (state.kind === "usage" || state.kind === "usage-trial");
|
|
207
|
+
const card = onUsage ? (await fetchUsageCard()).card : null;
|
|
205
208
|
const pm = summary.defaultPaymentMethod;
|
|
206
209
|
if (pm?.present) {
|
|
207
210
|
const detail = pm.brand && pm.last4 ? `${pm.brand} ••••${pm.last4}` : "on file";
|
|
208
211
|
console.log(`${chalk.bold("Card")}: ${detail}`);
|
|
209
212
|
}
|
|
213
|
+
else if (state && card && state.view !== "full") {
|
|
214
|
+
// US-034: a member cannot add the company card (hq-pro's org card
|
|
215
|
+
// capture is owner or admin only), and the member view carries no
|
|
216
|
+
// money figures.
|
|
217
|
+
console.log(`${chalk.bold("Card")}: ${chalk.yellow("no card on file")} — ask an owner or admin to add a card.`);
|
|
218
|
+
}
|
|
219
|
+
else if (state && card) {
|
|
220
|
+
// US-034: usage pricing asks for a card past the included usage.
|
|
221
|
+
console.log(`${chalk.bold("Card")}: ${chalk.yellow("no card on file")} — ` +
|
|
222
|
+
`HQ asks for a card once usage this month passes ${formatCardUsd(card.includedUsd)}. ` +
|
|
223
|
+
"Hosted boxes bill to a card; add one with `hq billing checkout`.");
|
|
224
|
+
}
|
|
210
225
|
else {
|
|
211
226
|
console.log(`${chalk.bold("Card")}: ${chalk.yellow("no card on file")} — ` +
|
|
212
227
|
`run \`hq billing checkout\` to add one before provisioning paid resources.`);
|
|
213
228
|
}
|
|
214
|
-
|
|
215
|
-
if (state && (state.kind === "usage" || state.kind === "usage-trial")) {
|
|
216
|
-
const { card } = await fetchUsageCard();
|
|
229
|
+
if (state && card) {
|
|
217
230
|
for (const line of accountStatusLines(state, card))
|
|
218
231
|
console.log(line);
|
|
219
232
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { type FleetInstallProgress, type FleetInstallProgressListener, type FleetLocalTargetRelease } from "../lib/bot/fleet-local.js";
|
|
1
|
+
import { fleetRuntimeReady, type FleetInstallProgress, type FleetInstallProgressListener, type FleetLocalTargetRelease } from "../lib/bot/fleet-local.js";
|
|
2
|
+
import { installedFleetPython } from "../lib/bot/fleet-python.js";
|
|
3
|
+
import { type FleetSignInHereDeps, type FleetSignInProvider } from "../lib/bot/legacy-provider-login.js";
|
|
2
4
|
export type FleetProgressMode = "text" | "json" | "silent";
|
|
3
5
|
interface ProgressOutput {
|
|
4
6
|
write(text: string): void;
|
|
@@ -14,6 +16,8 @@ export declare function describeFleetInstallPhase(event: FleetInstallProgress):
|
|
|
14
16
|
export declare function fleetInstallProgressReporter(mode: FleetProgressMode, output?: ProgressOutput, stdout?: (line: string) => void): FleetInstallProgressListener;
|
|
15
17
|
export interface FleetRuntimeStatus {
|
|
16
18
|
ready: boolean;
|
|
19
|
+
installed: boolean;
|
|
20
|
+
estimate: string;
|
|
17
21
|
release: {
|
|
18
22
|
version: string;
|
|
19
23
|
source: FleetLocalTargetRelease["source"];
|
|
@@ -24,12 +28,27 @@ export interface FleetRuntimeStatus {
|
|
|
24
28
|
runtime: boolean;
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
|
-
export
|
|
31
|
+
export interface FleetRuntimeStatusDeps {
|
|
32
|
+
target?: FleetLocalTargetRelease;
|
|
33
|
+
distributionInstalled?: (release: FleetLocalTargetRelease["release"]) => boolean;
|
|
34
|
+
python?: () => ReturnType<typeof installedFleetPython>;
|
|
35
|
+
runtimeReady?: typeof fleetRuntimeReady;
|
|
36
|
+
}
|
|
37
|
+
export declare function fleetRuntimeStatus(deps?: FleetRuntimeStatusDeps): Promise<FleetRuntimeStatus>;
|
|
28
38
|
export declare function runBotRuntimeInstall(opts: {
|
|
29
39
|
json?: boolean;
|
|
30
40
|
}): Promise<void>;
|
|
31
41
|
export declare function runBotRuntimeStatus(opts: {
|
|
32
42
|
json?: boolean;
|
|
33
43
|
}): Promise<void>;
|
|
44
|
+
export declare function parseFleetSignInProvider(value: string): FleetSignInProvider;
|
|
45
|
+
export declare function runBotAuthStatus(opts: {
|
|
46
|
+
provider: string;
|
|
47
|
+
json?: boolean;
|
|
48
|
+
}, deps?: FleetSignInHereDeps & {
|
|
49
|
+
target?: () => Promise<FleetLocalTargetRelease>;
|
|
50
|
+
}): Promise<{
|
|
51
|
+
signedIn: boolean;
|
|
52
|
+
}>;
|
|
34
53
|
export {};
|
|
35
54
|
//# sourceMappingURL=bot-runtime.d.ts.map
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
|
-
import { ensureFleetRuntimeInstalled, fleetLocalDistributionInstalled, fleetRuntimeReady, installTargetFleetLocalDistribution, resolveFleetLocalTargetRelease, } from "../lib/bot/fleet-local.js";
|
|
2
|
+
import { ensureFleetRuntimeInstalled, fleetLocalDistributionInstalled, fleetReleaseImportsGrokCli, fleetRuntimeReady, installTargetFleetLocalDistribution, resolveFleetLocalTargetRelease, } from "../lib/bot/fleet-local.js";
|
|
3
3
|
import { installedFleetPython } from "../lib/bot/fleet-python.js";
|
|
4
|
+
import { createInstallProgressTracker } from "../lib/bot/install-progress.js";
|
|
5
|
+
import { botCreateEstimate } from "../lib/bot/readiness.js";
|
|
6
|
+
import { fleetSignInReusableHere } from "../lib/bot/legacy-provider-login.js";
|
|
4
7
|
function megabytes(bytes) {
|
|
5
8
|
return `${(bytes / 1_048_576).toFixed(1)} MB`;
|
|
6
9
|
}
|
|
7
10
|
/** The sentence for a phase, for people. */
|
|
8
11
|
export function describeFleetInstallPhase(event) {
|
|
9
12
|
switch (event.phase) {
|
|
13
|
+
case "download-start":
|
|
14
|
+
return "Downloading the HQ Fleet Runtime";
|
|
10
15
|
case "download": {
|
|
11
|
-
const name = event.file.startsWith("hq-fleet-runtime-") ? "the HQ Fleet Runtime" :
|
|
16
|
+
const name = event.file.startsWith("hq-fleet-runtime-") ? "the HQ Fleet Runtime" : "the HQ Fleet Runtime's release files";
|
|
12
17
|
if (event.total === null)
|
|
13
18
|
return `Downloading ${name}: ${megabytes(event.received)}`;
|
|
14
19
|
const percent = Math.min(100, Math.floor((event.received / Math.max(event.total, 1)) * 100));
|
|
@@ -17,7 +22,7 @@ export function describeFleetInstallPhase(event) {
|
|
|
17
22
|
case "verify":
|
|
18
23
|
return "Checking the download against its signed release";
|
|
19
24
|
case "python":
|
|
20
|
-
return "Preparing the runtime's
|
|
25
|
+
return "Preparing the runtime's core components";
|
|
21
26
|
case "extract":
|
|
22
27
|
return "Unpacking the runtime";
|
|
23
28
|
case "environment":
|
|
@@ -39,7 +44,11 @@ export function fleetInstallProgressReporter(mode, output = { write: (text) => {
|
|
|
39
44
|
if (mode === "silent")
|
|
40
45
|
return () => undefined;
|
|
41
46
|
if (mode === "json") {
|
|
47
|
+
const install = createInstallProgressTracker((line) => stdout(JSON.stringify(line)));
|
|
42
48
|
return (event) => {
|
|
49
|
+
install(event);
|
|
50
|
+
if (event.phase === "download-start")
|
|
51
|
+
return;
|
|
43
52
|
const percent = event.phase === "download" && event.total !== null
|
|
44
53
|
? Math.min(100, Math.floor((event.received / Math.max(event.total, 1)) * 100))
|
|
45
54
|
: null;
|
|
@@ -49,6 +58,10 @@ export function fleetInstallProgressReporter(mode, output = { write: (text) => {
|
|
|
49
58
|
let lastTenth = -1;
|
|
50
59
|
let lineOpen = false;
|
|
51
60
|
return (event) => {
|
|
61
|
+
if (event.phase === "download-start")
|
|
62
|
+
return;
|
|
63
|
+
if (event.phase === "download" && !event.file.startsWith("hq-fleet-runtime-"))
|
|
64
|
+
return;
|
|
52
65
|
const text = describeFleetInstallPhase(event);
|
|
53
66
|
if (event.phase === "download" && event.total !== null) {
|
|
54
67
|
const tenth = Math.floor((event.received / Math.max(event.total, 1)) * 10);
|
|
@@ -70,13 +83,16 @@ export function fleetInstallProgressReporter(mode, output = { write: (text) => {
|
|
|
70
83
|
output.write(`${text}\n`);
|
|
71
84
|
};
|
|
72
85
|
}
|
|
73
|
-
export async function fleetRuntimeStatus() {
|
|
74
|
-
const target = await resolveFleetLocalTargetRelease();
|
|
75
|
-
const distribution = fleetLocalDistributionInstalled(target.release);
|
|
76
|
-
const python = installedFleetPython();
|
|
77
|
-
const runtime = distribution && python ? fleetRuntimeReady({ release: target.release }, { python }) : false;
|
|
86
|
+
export async function fleetRuntimeStatus(deps = {}) {
|
|
87
|
+
const target = deps.target ?? await resolveFleetLocalTargetRelease();
|
|
88
|
+
const distribution = (deps.distributionInstalled ?? fleetLocalDistributionInstalled)(target.release);
|
|
89
|
+
const python = (deps.python ?? installedFleetPython)();
|
|
90
|
+
const runtime = distribution && python ? (deps.runtimeReady ?? fleetRuntimeReady)({ release: target.release }, { python }) : false;
|
|
91
|
+
const installed = distribution && python !== null && runtime;
|
|
78
92
|
return {
|
|
79
|
-
ready:
|
|
93
|
+
ready: installed,
|
|
94
|
+
installed,
|
|
95
|
+
estimate: botCreateEstimate(installed),
|
|
80
96
|
release: { version: target.release.version, source: target.source },
|
|
81
97
|
steps: { distribution, python: python !== null, runtime },
|
|
82
98
|
};
|
|
@@ -109,7 +125,36 @@ export async function runBotRuntimeStatus(opts) {
|
|
|
109
125
|
console.log(` download: ${mark(current.steps.distribution)}`);
|
|
110
126
|
console.log(` python: ${mark(current.steps.python)}`);
|
|
111
127
|
console.log(` environment: ${mark(current.steps.runtime)}`);
|
|
128
|
+
console.log(` creating a bot takes ${current.estimate}`);
|
|
112
129
|
if (!current.ready)
|
|
113
130
|
console.log(chalk.dim(" Run `hq bot runtime install` to get it ready before creating a bot."));
|
|
114
131
|
}
|
|
132
|
+
export function parseFleetSignInProvider(value) {
|
|
133
|
+
const provider = value.trim().toLowerCase();
|
|
134
|
+
if (provider === "chatgpt" || provider === "grok")
|
|
135
|
+
return provider;
|
|
136
|
+
throw Object.assign(new Error(`--provider must be chatgpt or grok, not ${value}.`), { expected: true });
|
|
137
|
+
}
|
|
138
|
+
export async function runBotAuthStatus(opts, deps = {}) {
|
|
139
|
+
const provider = parseFleetSignInProvider(opts.provider);
|
|
140
|
+
let grokCliImport = deps.grokCliImport;
|
|
141
|
+
if (provider === "grok" && grokCliImport === undefined) {
|
|
142
|
+
try {
|
|
143
|
+
grokCliImport = fleetReleaseImportsGrokCli((await (deps.target ?? (() => resolveFleetLocalTargetRelease()))()).release.version);
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
grokCliImport = false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const signedIn = fleetSignInReusableHere(provider, { ...deps, ...(grokCliImport !== undefined ? { grokCliImport } : {}) }).readable;
|
|
150
|
+
if (opts.json) {
|
|
151
|
+
console.log(JSON.stringify({ signedIn }));
|
|
152
|
+
return { signedIn };
|
|
153
|
+
}
|
|
154
|
+
const name = provider === "grok" ? "Grok" : "ChatGPT";
|
|
155
|
+
console.log(signedIn
|
|
156
|
+
? `A new ${name} bot signs in with the ${name} login already on this computer.`
|
|
157
|
+
: `A new ${name} bot needs its own ${name} sign-in (hq bot auth).`);
|
|
158
|
+
return { signedIn };
|
|
159
|
+
}
|
|
115
160
|
//# sourceMappingURL=bot-runtime.js.map
|
package/dist/commands/bot.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { type LegacyMoveState, type LegacyProviderLoginProbe } from "../lib/bot/legacy-convert.js";
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
import { type ExecutiveBot } from "../lib/bot/executive.js";
|
|
4
|
+
import { waitForGatewayReady, type BotReadiness, type ReadyWaitResult } from "../lib/bot/readiness.js";
|
|
4
5
|
import { type RuntimeSignInCheck, type RuntimeSignInIssue } from "../lib/bot/runtime-sign-in.js";
|
|
5
6
|
import { type ClaudeLoginCheck } from "../lib/bot/claude-login.js";
|
|
6
7
|
import type { BotStatusFile } from "../lib/bot/status.js";
|
|
7
8
|
import { probeBotRuntime, type RuntimeProbeResult } from "../lib/bot/probe.js";
|
|
8
9
|
import { type SpawnInteractive } from "../lib/bot/runtime-auth.js";
|
|
9
10
|
import { type BotLocalConfig, type MyLocalBot, type BotKind, type BotMemoryMode, type BotNotRunnableReason, type RuntimeCrash, type BotConfig, type BotRuntimeId, type LaunchctlExec, HQ_FLEET_RUNTIME_ENGINE_ID, type BotRole } from "../lib/bot/index.js";
|
|
11
|
+
import { fleetRuntimeStatus } from "./bot-runtime.js";
|
|
12
|
+
import { ensureFleetRuntimeInstalled } from "../lib/bot/fleet-local.js";
|
|
10
13
|
/** Real launchctl; every failure is a non-ok result, never a throw. */
|
|
11
14
|
export declare const defaultLaunchctl: LaunchctlExec;
|
|
12
15
|
/** The desktop app creates HQ's setup bot under this name, always from the `setup` worker. */
|
|
@@ -27,6 +30,9 @@ export interface BotRow {
|
|
|
27
30
|
/** True when no thinking level was picked (running the default). */
|
|
28
31
|
effortIsDefault: boolean;
|
|
29
32
|
state: string;
|
|
33
|
+
readiness: BotReadiness;
|
|
34
|
+
ready: boolean;
|
|
35
|
+
readyAt: string | null;
|
|
30
36
|
pid: number | null;
|
|
31
37
|
processAlive: boolean;
|
|
32
38
|
hosting: "local" | "cloud";
|
|
@@ -206,6 +212,9 @@ export declare const legacyConvertSeams: {
|
|
|
206
212
|
export declare const botCreateSeams: {
|
|
207
213
|
/** The Claude Code login read the way the HQ Fleet Runtime reads it. */
|
|
208
214
|
claudeLogin: () => ClaudeLoginCheck;
|
|
215
|
+
runtimeStatus: typeof fleetRuntimeStatus;
|
|
216
|
+
installRuntime: typeof ensureFleetRuntimeInstalled;
|
|
217
|
+
waitForReady: typeof waitForGatewayReady;
|
|
209
218
|
};
|
|
210
219
|
export declare const botStopSeams: {
|
|
211
220
|
/** True when this process runs inside the bot process `botPid` (one of its turns). */
|
|
@@ -248,6 +257,8 @@ export interface BotCreateOptions {
|
|
|
248
257
|
memory?: string;
|
|
249
258
|
kind?: string;
|
|
250
259
|
company?: string[];
|
|
260
|
+
progress?: boolean;
|
|
261
|
+
readyTimeout?: string;
|
|
251
262
|
}
|
|
252
263
|
/**
|
|
253
264
|
* Which way `hq bot create` went. For HQ's setup assistant all three are a
|
|
@@ -261,6 +272,8 @@ export type BotCreateOutcome = "existing" | "adopted" | "created";
|
|
|
261
272
|
* its half-written folder.
|
|
262
273
|
*/
|
|
263
274
|
export declare function runBotCreate(nameArg: string, opts: BotCreateOptions): Promise<void>;
|
|
275
|
+
export declare function parseReadyTimeoutSeconds(value: string | number | undefined): number;
|
|
276
|
+
export declare function createReadyMessage(name: string, readiness: BotReadiness, wait: ReadyWaitResult | null, timeoutMs: number): string | null;
|
|
264
277
|
export declare function runBotCompanies(nameArg: string, opts: {
|
|
265
278
|
add?: string[];
|
|
266
279
|
remove?: string[];
|