@indigoai-us/hq-cli 5.345.85 → 5.345.87

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/command-catalog.generated.d.ts +42 -1
  3. package/dist/command-catalog.generated.js +51 -1
  4. package/dist/command-registration-plan.d.ts +6 -0
  5. package/dist/command-registration-plan.js +1 -0
  6. package/dist/commands/bot.d.ts +60 -12
  7. package/dist/commands/bot.js +349 -98
  8. package/dist/commands/scan.d.ts +23 -0
  9. package/dist/commands/scan.js +59 -0
  10. package/dist/commands/storage-core.d.ts +2 -0
  11. package/dist/commands/storage-core.js +12 -1
  12. package/dist/commands/storage-offload.d.ts +10 -0
  13. package/dist/commands/storage-offload.js +4 -0
  14. package/dist/commands/storage.d.ts +6 -0
  15. package/dist/commands/storage.js +25 -6
  16. package/dist/lib/bot/api.d.ts +15 -0
  17. package/dist/lib/bot/api.js +11 -0
  18. package/dist/lib/bot/config.d.ts +6 -0
  19. package/dist/lib/bot/display-name.d.ts +64 -0
  20. package/dist/lib/bot/display-name.js +117 -0
  21. package/dist/lib/bot/index.d.ts +2 -0
  22. package/dist/lib/bot/index.js +2 -0
  23. package/dist/lib/bot/lock.d.ts +84 -0
  24. package/dist/lib/bot/lock.js +313 -0
  25. package/dist/lib/secret-scan/detect.d.ts +27 -0
  26. package/dist/lib/secret-scan/detect.js +129 -0
  27. package/dist/lib/secret-scan/gitleaks-rules.generated.d.ts +6 -0
  28. package/dist/lib/secret-scan/gitleaks-rules.generated.js +3602 -0
  29. package/dist/lib/secret-scan/go-regex.d.ts +22 -0
  30. package/dist/lib/secret-scan/go-regex.js +250 -0
  31. package/dist/lib/secret-scan/rules.d.ts +31 -0
  32. package/dist/lib/secret-scan/rules.js +84 -0
  33. package/dist/lib/secret-scan/staged.d.ts +17 -0
  34. package/dist/lib/secret-scan/staged.js +112 -0
  35. package/dist/lib/secret-scan/types.d.ts +34 -0
  36. package/dist/lib/secret-scan/types.js +3 -0
  37. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,36 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.345.87] — 2026-10-11
6
+ - `hq bot create setup` no longer fails when HQ's assistant is already on this
7
+ computer. It answers `ok` with `outcome` `existing`, `adopted` or `created`,
8
+ and applies `--display-name`, `--intro` and `--kickoff` when it brings the
9
+ assistant back from HQ (the intro and kickoff are kept on this computer;
10
+ only the name is saved in HQ). The name goes through the new name route, or
11
+ stays on this computer when the server does not have that route yet.
12
+ `create`, `adopt`, `restore`, `rm` and `set` now take a per-bot lock, so two
13
+ of them for the same bot run one after the other instead of racing (a lock
14
+ left by a crashed command is reclaimed). `hq bot list`, `list --remote` and
15
+ `restore` report each bot's `displayName` (never its handle) and `role`
16
+ (`assistant` for HQ's setup assistant).
17
+ - New `hq bot set <name> --display-name <name> [--json]` renames a bot. The
18
+ name is saved in HQ (the bot's name, profile and saved settings together),
19
+ then on this computer, and a running bot restarts so it introduces itself by
20
+ the new name. A stopped bot stays stopped. When the server does not have the
21
+ name route yet, the name is kept on this computer (`nameSaved: "local-only"`);
22
+ if HQ refuses the name, nothing changes.
23
+ - `hq storage offload` no longer repeats "Nothing was uploaded or changed." when linked worktrees still use every old file version.
24
+ - A refused `hq storage prune --json` now includes a plain `message` in `local`, the same as offload's refusal. Existing fields are unchanged.
25
+ - A dry run of `hq storage prune` or `hq storage offload` that predicts a refusal now exits 0 instead of 4 or 5. The JSON still reports `refused` and `message`, and an offload dry run also reports `history.would_refuse` (`code`, `message`, `holders`), which is `null` when a real run would go ahead. A real run that refuses still exits 4 (nothing to free) or 5 (precondition).
26
+
27
+ ## [5.345.86] — 2026-10-11
28
+ - New `hq scan secrets`: an offline secret scanner for the pre-commit gate. It
29
+ checks the staged changes (or given files) against the gitleaks default rule
30
+ set, vendored from gitleaks v8.30.1 under its MIT license, plus HQ's own
31
+ token patterns. It needs no network, account or API quota, and reports the
32
+ rule, file and line without printing the value. Exit codes: 0 clean, 1
33
+ possible secret, 2 the scan could not run.
34
+
5
35
  ## [5.345.85] — 2026-10-11
6
36
  - Session-start orphan reports and reap leases are keyed by HQ root, report ended-session waiting lanes, and surface the latest completed orphan count in startup context even after a skipped sweep. `hq lanes reap --legacy` also identifies abandoned legacy conduct pool loops and only stops verified process identities when `--stop --reason` is supplied.
7
37
 
@@ -5375,6 +5375,43 @@ export declare const COMMAND_CATALOG: readonly [{
5375
5375
  }];
5376
5376
  readonly subcommands: readonly [];
5377
5377
  }];
5378
+ }, {
5379
+ readonly name: "scan";
5380
+ readonly description: "Local, offline scanners";
5381
+ readonly aliases: readonly [];
5382
+ readonly hidden: false;
5383
+ readonly helpOption: true;
5384
+ readonly helpCommand: true;
5385
+ readonly usage: "[options] [command]";
5386
+ readonly helpText: readonly [];
5387
+ readonly arguments: readonly [];
5388
+ readonly options: readonly [];
5389
+ readonly subcommands: readonly [{
5390
+ readonly name: "secrets";
5391
+ readonly description: "Scan staged changes (or files) for secrets; exits 1 on a finding";
5392
+ readonly aliases: readonly [];
5393
+ readonly hidden: false;
5394
+ readonly helpOption: true;
5395
+ readonly helpCommand: false;
5396
+ readonly usage: "[options] [files...]";
5397
+ readonly helpText: readonly [];
5398
+ readonly arguments: readonly [{
5399
+ readonly name: "files";
5400
+ readonly required: false;
5401
+ readonly variadic: true;
5402
+ readonly description: "Scan these files instead of the staged changes";
5403
+ }];
5404
+ readonly options: readonly [{
5405
+ readonly flags: "--staged";
5406
+ readonly description: "Scan the staged changes (default when no files are given)";
5407
+ readonly hidden: false;
5408
+ }, {
5409
+ readonly flags: "--json";
5410
+ readonly description: "Print findings as JSON";
5411
+ readonly hidden: false;
5412
+ }];
5413
+ readonly subcommands: readonly [];
5414
+ }];
5378
5415
  }, {
5379
5416
  readonly name: "reindex";
5380
5417
  readonly description: "Surface namespaced skills, materialize legacy knowledge repos, regenerate the workers registry, and trust HQ hooks for Codex, Grok, and Claude Code";
@@ -15784,7 +15821,7 @@ export declare const COMMAND_CATALOG: readonly [{
15784
15821
  readonly subcommands: readonly [];
15785
15822
  }, {
15786
15823
  readonly name: "set";
15787
- readonly description: "Change the model and thinking level a bot uses (applies from its next message)";
15824
+ readonly description: "Change the model and thinking level a bot uses (applies from its next message), or the name people see for it (saved in HQ; a running bot restarts to use it)";
15788
15825
  readonly aliases: readonly [];
15789
15826
  readonly hidden: false;
15790
15827
  readonly helpOption: true;
@@ -15801,6 +15838,10 @@ export declare const COMMAND_CATALOG: readonly [{
15801
15838
  readonly flags: "--model <model>";
15802
15839
  readonly description: "Model id for the runtime CLI, or default for the CLI's own default";
15803
15840
  readonly hidden: false;
15841
+ }, {
15842
+ readonly flags: "--display-name <name>";
15843
+ readonly description: "The name people see for the bot in HQ (up to 35 chars). The handle stays <name>";
15844
+ readonly hidden: false;
15804
15845
  }, {
15805
15846
  readonly flags: "--effort <level>";
15806
15847
  readonly description: "Thinking level (claude low|medium|high|xhigh|max; codex minimal|low|medium|high|xhigh; grok low|medium|high|xhigh), or default (medium)";
@@ -6535,6 +6535,51 @@ export const COMMAND_CATALOG = [
6535
6535
  }
6536
6536
  ]
6537
6537
  },
6538
+ {
6539
+ "name": "scan",
6540
+ "description": "Local, offline scanners",
6541
+ "aliases": [],
6542
+ "hidden": false,
6543
+ "helpOption": true,
6544
+ "helpCommand": true,
6545
+ "usage": "[options] [command]",
6546
+ "helpText": [],
6547
+ "arguments": [],
6548
+ "options": [],
6549
+ "subcommands": [
6550
+ {
6551
+ "name": "secrets",
6552
+ "description": "Scan staged changes (or files) for secrets; exits 1 on a finding",
6553
+ "aliases": [],
6554
+ "hidden": false,
6555
+ "helpOption": true,
6556
+ "helpCommand": false,
6557
+ "usage": "[options] [files...]",
6558
+ "helpText": [],
6559
+ "arguments": [
6560
+ {
6561
+ "name": "files",
6562
+ "required": false,
6563
+ "variadic": true,
6564
+ "description": "Scan these files instead of the staged changes"
6565
+ }
6566
+ ],
6567
+ "options": [
6568
+ {
6569
+ "flags": "--staged",
6570
+ "description": "Scan the staged changes (default when no files are given)",
6571
+ "hidden": false
6572
+ },
6573
+ {
6574
+ "flags": "--json",
6575
+ "description": "Print findings as JSON",
6576
+ "hidden": false
6577
+ }
6578
+ ],
6579
+ "subcommands": []
6580
+ }
6581
+ ]
6582
+ },
6538
6583
  {
6539
6584
  "name": "reindex",
6540
6585
  "description": "Surface namespaced skills, materialize legacy knowledge repos, regenerate the workers registry, and trust HQ hooks for Codex, Grok, and Claude Code",
@@ -19221,7 +19266,7 @@ export const COMMAND_CATALOG = [
19221
19266
  },
19222
19267
  {
19223
19268
  "name": "set",
19224
- "description": "Change the model and thinking level a bot uses (applies from its next message)",
19269
+ "description": "Change the model and thinking level a bot uses (applies from its next message), or the name people see for it (saved in HQ; a running bot restarts to use it)",
19225
19270
  "aliases": [],
19226
19271
  "hidden": false,
19227
19272
  "helpOption": true,
@@ -19242,6 +19287,11 @@ export const COMMAND_CATALOG = [
19242
19287
  "description": "Model id for the runtime CLI, or default for the CLI's own default",
19243
19288
  "hidden": false
19244
19289
  },
19290
+ {
19291
+ "flags": "--display-name <name>",
19292
+ "description": "The name people see for the bot in HQ (up to 35 chars). The handle stays <name>",
19293
+ "hidden": false
19294
+ },
19245
19295
  {
19246
19296
  "flags": "--effort <level>",
19247
19297
  "description": "Thinking level (claude low|medium|high|xhigh|max; codex minimal|low|medium|high|xhigh; grok low|medium|high|xhigh), or default (medium)",
@@ -358,6 +358,12 @@ export declare const REGISTRATION_PLAN: readonly [{
358
358
  readonly parent: "program";
359
359
  readonly module: "./commands/import-scan.js";
360
360
  readonly exportName: "registerImportCommand";
361
+ }, {
362
+ readonly type: "registrar";
363
+ readonly root: "scan";
364
+ readonly parent: "program";
365
+ readonly module: "./commands/scan.js";
366
+ readonly exportName: "registerScanCommand";
361
367
  }, {
362
368
  readonly type: "registrar";
363
369
  readonly root: "reindex";
@@ -62,6 +62,7 @@ export const REGISTRATION_PLAN = [
62
62
  { type: "registrar", root: "signals", parent: "program", module: "./commands/signals.js", exportName: "registerSignalsCommand" },
63
63
  { type: "registrar", root: "integrations", parent: "program", module: "./commands/integrations.js", exportName: "registerIntegrationsCommand" },
64
64
  { type: "registrar", root: "import", parent: "program", module: "./commands/import-scan.js", exportName: "registerImportCommand" },
65
+ { type: "registrar", root: "scan", parent: "program", module: "./commands/scan.js", exportName: "registerScanCommand" },
65
66
  { type: "registrar", root: "reindex", parent: "program", module: "./commands/reindex.js", exportName: "registerReindexCommand" },
66
67
  { type: "registrar", root: "rescue", parent: "program", module: "./commands/rescue.js", exportName: "registerRescueCommand" },
67
68
  { type: "registrar", root: "mcp", parent: "program", module: "./commands/mcp-status.js", exportName: "registerMcpCommand" },
@@ -1,7 +1,7 @@
1
1
  import { Command } from "commander";
2
2
  import { type RuntimeSignInIssue } from "../lib/bot/runtime-sign-in.js";
3
3
  import { probeBotRuntime, type RuntimeProbeResult } from "../lib/bot/probe.js";
4
- import { type BotLocalConfig, type MyLocalBot, type BotKind, type BotMemoryMode, type BotNotRunnableReason, type BotConfig, type BotRuntimeId, type LaunchctlExec } from "../lib/bot/index.js";
4
+ import { type BotLocalConfig, type MyLocalBot, type BotKind, type BotMemoryMode, type BotNotRunnableReason, type BotConfig, type BotRuntimeId, type LaunchctlExec, type BotRole } from "../lib/bot/index.js";
5
5
  /** Real launchctl; every failure is a non-ok result, never a throw. */
6
6
  export declare const defaultLaunchctl: LaunchctlExec;
7
7
  /** The desktop app creates HQ's setup bot under this name, always from the `setup` worker. */
@@ -61,7 +61,13 @@ export interface BotRow {
61
61
  memory: BotMemoryMode;
62
62
  /** Absolute memory folder. */
63
63
  memoryDir: string;
64
+ /**
65
+ * The name people see: the cloud's name when HQ could be asked, else the
66
+ * copy in bot.json. Never the handle or slug; absent when there is no name.
67
+ */
64
68
  displayName?: string;
69
+ /** "assistant" for HQ's setup assistant, null for every other bot. */
70
+ role: BotRole;
65
71
  intro?: string;
66
72
  kickoff?: string;
67
73
  }
@@ -101,7 +107,7 @@ export declare function resolveCreateKind(opts: {
101
107
  kind: BotKind;
102
108
  companies: string[];
103
109
  };
104
- export declare function runBotCreate(nameArg: string, opts: {
110
+ export interface BotCreateOptions {
105
111
  runtime?: string;
106
112
  model?: string;
107
113
  effort?: string;
@@ -116,7 +122,19 @@ export declare function runBotCreate(nameArg: string, opts: {
116
122
  memory?: string;
117
123
  kind?: string;
118
124
  company?: string[];
119
- }): Promise<void>;
125
+ }
126
+ /**
127
+ * Which way `hq bot create` went. For HQ's setup assistant all three are a
128
+ * success: "existing" (already set up here), "adopted" (brought back from the
129
+ * cloud), "created" (new). Any other bot that already exists here still fails.
130
+ */
131
+ export type BotCreateOutcome = "existing" | "adopted" | "created";
132
+ /**
133
+ * `hq bot create`. Runs under the bot's lock, so a create racing an adopt,
134
+ * restore, rm or set of the same bot waits for it instead of tripping over
135
+ * its half-written folder.
136
+ */
137
+ export declare function runBotCreate(nameArg: string, opts: BotCreateOptions): Promise<void>;
120
138
  export declare function runBotCompanies(nameArg: string, opts: {
121
139
  add?: string[];
122
140
  remove?: string[];
@@ -126,15 +144,27 @@ export declare function runBotWorkers(opts: {
126
144
  json?: boolean;
127
145
  }): Promise<void>;
128
146
  /**
129
- * `hq bot set <name> --model <id|default> --effort <level|default>`: change
130
- * what the bot thinks with. bot.json is re-read on every turn, so the next
131
- * message uses it; no restart.
147
+ * `hq bot set <name> [--model <id|default>] [--effort <level|default>]
148
+ * [--display-name <name>]`: change what the bot thinks with, or the name
149
+ * people see.
150
+ *
151
+ * Model and thinking level live in bot.json, which is re-read on every turn,
152
+ * so the next message uses them; no restart.
153
+ *
154
+ * A name is written to HQ first (PUT /v1/agents/{uid}/display-name: entity
155
+ * name, profile and saved settings together), then to bot.json. A running bot
156
+ * builds its system prompt once at start, so it is restarted to pick the name
157
+ * up; a stopped bot is left stopped. A server without the name route yet keeps
158
+ * the name on this computer only (`nameSaved: "local-only"`); any other refusal
159
+ * from HQ changes nothing and fails.
132
160
  */
133
- export declare function runBotSet(nameArg: string, opts: {
161
+ export interface BotSetOptions {
134
162
  model?: string;
135
163
  effort?: string;
164
+ displayName?: string;
136
165
  json?: boolean;
137
- }): Promise<void>;
166
+ }
167
+ export declare function runBotSet(nameArg: string, opts: BotSetOptions): Promise<void>;
138
168
  /** `hq bot probe`: exit code 0 when the runtime answered, 1 when it did not. */
139
169
  export declare function runBotProbe(opts: {
140
170
  runtime?: string;
@@ -219,16 +249,22 @@ export declare function configFromLocalConfig(input: {
219
249
  hqRoot: string;
220
250
  dir: string;
221
251
  local: BotLocalConfig | null;
222
- overrides?: {
223
- runtime?: BotRuntimeId;
224
- model?: string;
225
- };
252
+ overrides?: BotAdoptOverrides;
226
253
  preserveFirstStart?: boolean;
227
254
  now?: () => Date;
228
255
  }): {
229
256
  config: BotConfig;
230
257
  notes: string[];
231
258
  };
259
+ /** What an adopt may set over the settings the cloud kept for the bot. */
260
+ export interface BotAdoptOverrides {
261
+ runtime?: BotRuntimeId;
262
+ model?: string;
263
+ /** The name for this start (create's --display-name), over yesterday's saved one. */
264
+ displayName?: string;
265
+ intro?: string;
266
+ kickoff?: string;
267
+ }
232
268
  export interface BotAdoptResult {
233
269
  name: string;
234
270
  agentUid: string;
@@ -241,6 +277,10 @@ export interface BotAdoptResult {
241
277
  memoryDir: string;
242
278
  /** True when the cloud had no saved settings and defaults were used. */
243
279
  defaulted: boolean;
280
+ /** The name people see, from the saved settings (or this start's override); null when it has none. */
281
+ displayName: string | null;
282
+ /** "assistant" for HQ's setup assistant, else null. */
283
+ role: BotRole;
244
284
  notes: string[];
245
285
  daemon: string | null;
246
286
  }
@@ -259,6 +299,10 @@ export interface BotRestoreRow {
259
299
  detail: string;
260
300
  /** Present only on a bot skipped because this computer cannot run it. */
261
301
  reason?: BotNotRunnableReason;
302
+ /** The name people see (the cloud's), never the handle or slug; null when it has none. */
303
+ displayName: string | null;
304
+ /** "assistant" for HQ's setup assistant, else null. */
305
+ role: BotRole;
262
306
  }
263
307
  /**
264
308
  * `hq bot restore` — every local bot this account owns that is not set up on
@@ -285,6 +329,10 @@ export interface RemoteBotRow {
285
329
  runnable: boolean;
286
330
  /** Why not, when `runnable` is false: the same vocabulary adopt and restore use. */
287
331
  reason: BotNotRunnableReason | null;
332
+ /** The name people see (the cloud's), never the handle or slug; null when it has none. */
333
+ displayName: string | null;
334
+ /** "assistant" for HQ's setup assistant, else null. */
335
+ role: BotRole;
288
336
  }
289
337
  export declare function registerBotCommand(program: Command): void;
290
338
  //# sourceMappingURL=bot.d.ts.map