@indigoai-us/hq-cli 5.345.211 → 5.345.212-beta.0

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 CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.345.212-beta.0] — 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
+ - 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.
8
+ - 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.
9
+ - 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.
10
+ - 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.
11
+ - 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.
12
+ - `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.
13
+ - 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.
14
+ - 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.
15
+ - `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.
16
+ - 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.
17
+ - `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).
18
+ - Local bots now install HQ Fleet Local 0.4.31 on HQ Fleet Runtime main 398523c9.
19
+ This release shares the Grok CLI login (`<GROK_HOME>/auth.json`, else
20
+ `~/.grok/auth.json`) with a new Grok bot, so `hq bot auth` signs it in without a
21
+ second device-code sign-in, and `hq bot auth --json` prints the device-code line
22
+ when one is still needed. Installed bots move to 0.4.31 at the daemon's next
23
+ update pass.
24
+
5
25
  ## [5.345.211] — 2026-11-10
6
26
  - `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
27
  - 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",
@@ -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 declare function fleetRuntimeStatus(): Promise<FleetRuntimeStatus>;
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" : event.file;
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 private Python";
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: distribution && python !== null && runtime,
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
@@ -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[];