@indigoai-us/hq-cli 5.345.220 → 5.345.221

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 (138) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/dist/command-catalog.generated.d.ts +144 -2
  3. package/dist/command-catalog.generated.js +175 -2
  4. package/dist/commands/auth.js +4 -1
  5. package/dist/commands/bot-runtime.d.ts +18 -5
  6. package/dist/commands/bot-runtime.js +29 -12
  7. package/dist/commands/bot.d.ts +39 -2
  8. package/dist/commands/bot.js +140 -11
  9. package/dist/commands/core-stop-autosave.d.ts +21 -0
  10. package/dist/commands/core-stop-autosave.js +300 -0
  11. package/dist/commands/core.js +2 -0
  12. package/dist/commands/daemon.d.ts +5 -0
  13. package/dist/commands/daemon.js +31 -7
  14. package/dist/commands/doctor-usage.d.ts +5 -0
  15. package/dist/commands/doctor-usage.js +25 -0
  16. package/dist/commands/env.d.ts +49 -4
  17. package/dist/commands/env.js +355 -5
  18. package/dist/commands/lanes-shared.d.ts +3 -0
  19. package/dist/commands/lanes.d.ts +3 -0
  20. package/dist/commands/lanes.js +87 -3
  21. package/dist/commands/sources.js +3 -3
  22. package/dist/commands/sync-core.d.ts +1 -0
  23. package/dist/commands/sync-core.js +77 -3
  24. package/dist/commands/whoami.js +96 -80
  25. package/dist/lib/bot/config.d.ts +17 -0
  26. package/dist/lib/bot/config.js +13 -0
  27. package/dist/lib/bot/fleet-cron.js +24 -2
  28. package/dist/lib/bot/fleet-local.d.ts +30 -2
  29. package/dist/lib/bot/fleet-local.js +60 -1
  30. package/dist/lib/bot/grok-login-scope.d.ts +36 -0
  31. package/dist/lib/bot/grok-login-scope.js +93 -0
  32. package/dist/lib/bot/legacy-provider-login.d.ts +32 -9
  33. package/dist/lib/bot/legacy-provider-login.js +28 -22
  34. package/dist/lib/bot/runtime-sign-in-check.js +6 -1
  35. package/dist/lib/bot/runtime-sign-in.d.ts +2 -0
  36. package/dist/lib/core-utils/sentry-report.js +2 -0
  37. package/dist/lib/daemon/machine-checks.d.ts +22 -1
  38. package/dist/lib/daemon/machine-checks.js +54 -12
  39. package/dist/lib/daemon/run.js +66 -8
  40. package/dist/lib/daemon/stop-autosave-lock.d.ts +19 -0
  41. package/dist/lib/daemon/stop-autosave-lock.js +166 -0
  42. package/dist/lib/daemon/stop-autosave.d.ts +28 -0
  43. package/dist/lib/daemon/stop-autosave.js +111 -0
  44. package/dist/lib/daemon/stop-diagnostics.d.ts +11 -0
  45. package/dist/lib/daemon/stop-diagnostics.js +136 -0
  46. package/dist/lib/daemon/stop-job-executor.d.ts +19 -0
  47. package/dist/lib/daemon/stop-job-executor.js +126 -0
  48. package/dist/lib/daemon/stop-jobs.d.ts +93 -0
  49. package/dist/lib/daemon/stop-jobs.js +599 -0
  50. package/dist/lib/doctor/checks/fleet-hook-core.js +1 -1
  51. package/dist/lib/doctor/checks/host-core.js +1 -1
  52. package/dist/lib/environment/access-probes.d.ts +234 -0
  53. package/dist/lib/environment/access-probes.js +918 -0
  54. package/dist/lib/environment/profile.d.ts +15 -2
  55. package/dist/lib/environment/profile.js +55 -20
  56. package/dist/lib/environment/rfc3339.d.ts +8 -0
  57. package/dist/lib/environment/rfc3339.js +26 -0
  58. package/dist/lib/environment/work-requirements.d.ts +169 -0
  59. package/dist/lib/environment/work-requirements.js +389 -0
  60. package/dist/lib/hook-engine/coverage.d.ts +137 -7
  61. package/dist/lib/hook-engine/coverage.js +1424 -4
  62. package/dist/lib/hook-engine/fleet-registration.js +2 -2
  63. package/dist/lib/hook-engine/git-stop-config.json +513 -0
  64. package/dist/lib/hook-engine/native-stop-compatibility.json +311 -0
  65. package/dist/lib/hook-engine/reconcile.js +2 -2
  66. package/dist/lib/hot-channels/alert.d.ts +2 -2
  67. package/dist/lib/hot-channels/alert.js +8 -5
  68. package/dist/lib/hot-channels/signals-pass.d.ts +126 -17
  69. package/dist/lib/hot-channels/signals-pass.js +296 -17
  70. package/dist/lib/hot-channels/signals-runtime.d.ts +30 -0
  71. package/dist/lib/hot-channels/signals-runtime.js +82 -0
  72. package/dist/lib/install/hook-target.js +1 -1
  73. package/dist/lib/lanes/host-capacity.d.ts +26 -2
  74. package/dist/lib/lanes/host-capacity.js +17 -2
  75. package/dist/lib/lanes/host-compute.d.ts +90 -0
  76. package/dist/lib/lanes/host-compute.js +185 -0
  77. package/dist/lib/lanes/index.d.ts +2 -0
  78. package/dist/lib/lanes/index.js +1 -0
  79. package/dist/lib/lanes/reconcile.js +22 -1
  80. package/dist/lib/lanes/resource-usage.d.ts +155 -0
  81. package/dist/lib/lanes/resource-usage.js +589 -0
  82. package/dist/lib/lanes/run-size.d.ts +46 -0
  83. package/dist/lib/lanes/run-size.js +197 -0
  84. package/dist/lib/lanes/store.js +27 -0
  85. package/dist/lib/lanes/throttle.d.ts +36 -1
  86. package/dist/lib/lanes/throttle.js +47 -10
  87. package/dist/lib/lanes/types.d.ts +40 -0
  88. package/dist/lib/lanes/types.js +2 -2
  89. package/dist/lib/lanes/watcher.js +13 -4
  90. package/dist/lib/lanes/worker-process.d.ts +25 -2
  91. package/dist/lib/lanes/worker-process.js +71 -19
  92. package/dist/lib/placement/match.d.ts +192 -0
  93. package/dist/lib/placement/match.js +667 -0
  94. package/dist/lib/safe-store.d.ts +14 -0
  95. package/dist/lib/safe-store.js +77 -4
  96. package/dist/lib/search-index/index.d.ts +88 -4
  97. package/dist/lib/search-index/index.js +288 -24
  98. package/dist/lib/search-index/max-doc-bytes.d.ts +17 -6
  99. package/dist/lib/search-index/max-doc-bytes.js +48 -23
  100. package/dist/lib/signals/codex-lockdown.d.ts +79 -0
  101. package/dist/lib/signals/codex-lockdown.js +271 -0
  102. package/dist/lib/signals/codex-login.d.ts +37 -0
  103. package/dist/lib/signals/codex-login.js +83 -0
  104. package/dist/lib/signals/engine.d.ts +27 -0
  105. package/dist/lib/signals/engine.js +70 -0
  106. package/dist/lib/signals/reply.js +22 -1
  107. package/dist/lib/signals/run-record.js +6 -1
  108. package/dist/lib/signals/settings.d.ts +5 -0
  109. package/dist/lib/signals/settings.js +2 -0
  110. package/dist/lib/signals/steps/extract.d.ts +85 -9
  111. package/dist/lib/signals/steps/extract.js +317 -68
  112. package/dist/lib/signals/steps/types.d.ts +2 -0
  113. package/dist/lib/sync-core/engine-home.d.ts +35 -1
  114. package/dist/lib/sync-core/engine-home.js +119 -16
  115. package/dist/lib/sync-core/rollout-state.d.ts +2 -1
  116. package/dist/lib/sync-core/rollout-state.js +5 -2
  117. package/dist/lib/sync-core/vault-uid.d.ts +2 -0
  118. package/dist/lib/sync-core/vault-uid.js +4 -0
  119. package/dist/schemas/hq-work-requirements.v1.schema.json +145 -0
  120. package/dist/utils/auth-session-check.d.ts +16 -0
  121. package/dist/utils/auth-session-check.js +16 -0
  122. package/dist/utils/client-health-contract.d.ts +6 -0
  123. package/dist/utils/client-health-contract.js +13 -0
  124. package/dist/utils/client-health.d.ts +7 -0
  125. package/dist/utils/client-health.js +22 -1
  126. package/dist/utils/command-usage.d.ts +40 -0
  127. package/dist/utils/command-usage.js +61 -0
  128. package/dist/utils/duplicate-command-usage.d.ts +72 -0
  129. package/dist/utils/duplicate-command-usage.js +125 -0
  130. package/dist/utils/host-registration.js +2 -1
  131. package/dist/utils/resident-package-preload.js +4 -0
  132. package/dist/utils/sentry-fingerprint.js +9 -0
  133. package/dist/utils/windows-bash.d.ts +2 -0
  134. package/dist/utils/windows-bash.js +2 -1
  135. package/package.json +9 -8
  136. package/scripts/bench-core-compare.mjs +313 -0
  137. package/scripts/bench-core.mjs +399 -12
  138. package/scripts/check-function-manifest.mjs +116 -3
@@ -27,6 +27,13 @@
27
27
  * is kept until the next one, so the folder holds about twice the compaction
28
28
  * threshold at most (about 512 KiB).
29
29
  *
30
+ * Time: each line carries its UTC date and nothing finer, so a window is
31
+ * answered in whole UTC dates. `hq doctor usage --duplicates --since <d>`
32
+ * (utils/duplicate-command-usage.ts) counts every date the window touches,
33
+ * which can only count more runs than the exact window holds, never fewer.
34
+ * The format is unchanged by that check; {@link readCommandUsageEntries}
35
+ * reads the same lines and tells an unreadable folder apart from a zero.
36
+ *
30
37
  * Every read and write of the usage folder goes through the shared store
31
38
  * helper (`src/lib/safe-store.ts`): the folder is held open and checked by its
32
39
  * descriptor, files are opened without following a link and without blocking,
@@ -794,4 +801,58 @@ export function renderCommandUsageText(report) {
794
801
  }
795
802
  return `${lines.join("\n")}\n`;
796
803
  }
804
+ /**
805
+ * Every counted line the store still keeps (up to
806
+ * {@link COMMAND_USAGE_WINDOW_DAYS} UTC dates), merged across the live file
807
+ * and the not-yet-folded part of each rotated file, as {@link readCommandUsage}
808
+ * reads them. Unlike that report, a folder or file that cannot be read is
809
+ * returned as `ok: false` instead of as an empty count.
810
+ */
811
+ export function readCommandUsageEntries(options = {}) {
812
+ const dir = options.dir === undefined ? commandUsageDir(options.env) : options.dir;
813
+ if (!dir)
814
+ return { ok: false, file: null, reason: "this run keeps no count" };
815
+ const file = path.join(dir, COMMAND_USAGE_FILENAME);
816
+ try {
817
+ const opened = openStoreDir(dir, { at: options.at });
818
+ if (!opened.ok)
819
+ return { ok: false, file, reason: opened.code };
820
+ const store = opened.value;
821
+ try {
822
+ const listed = store.list();
823
+ if (!listed.ok)
824
+ return { ok: false, file, reason: listed.code };
825
+ const sources = [];
826
+ for (const name of listed.value) {
827
+ const rotated = ROTATED_FILE_PATTERN.exec(name);
828
+ if (!rotated && name !== COMMAND_USAGE_FILENAME)
829
+ continue;
830
+ const read = store.read(name, { maxBytes: USAGE_READ_MAX_BYTES });
831
+ if (read.ok)
832
+ sources.push({ id: rotated ? rotated[1] : null, name, bytes: read.value });
833
+ // Compaction may remove a rotated file after we read the live file
834
+ // but before its tail was folded into that snapshot. A missing file,
835
+ // like any other read refusal, therefore leaves the count unknown.
836
+ else
837
+ return { ok: false, file, reason: `${name}: ${read.code}` };
838
+ }
839
+ const entries = [];
840
+ for (const [key, count] of collectTotals(sources, mergedOffsets(sources))) {
841
+ const [date, code, command] = key.split("\t");
842
+ entries.push({ date, kind: CODE_KIND[code], command, count });
843
+ }
844
+ return { ok: true, file, entries };
845
+ }
846
+ finally {
847
+ store.close();
848
+ }
849
+ }
850
+ catch (error) {
851
+ return { ok: false, file, reason: error instanceof Error ? error.message : "read failed" };
852
+ }
853
+ }
854
+ /** The UTC date (`YYYY-MM-DD`) of an epoch-millisecond time, as the usage store writes it. */
855
+ export function usageDateOf(epochMs) {
856
+ return utcDate(epochMs);
857
+ }
797
858
  //# sourceMappingURL=command-usage.js.map
@@ -0,0 +1,72 @@
1
+ /**
2
+ * `hq doctor usage --duplicates` — were any of the duplicate command paths
3
+ * run on this computer in a recent window (hq-core-rust US-041)?
4
+ *
5
+ * Each duplicate does what another command already does. The check reads the
6
+ * local usage count (utils/command-usage.ts) and nothing else; it sends
7
+ * nothing.
8
+ *
9
+ * The usage store keeps one UTC date per line and nothing finer, so a window
10
+ * (`--since 12h`, `--since 1d`) is widened to every UTC date it touches. A run
11
+ * up to a day older than the window can therefore be counted; a run inside
12
+ * the window is never missed. The store keeps {@link COMMAND_USAGE_WINDOW_DAYS}
13
+ * dates, so the window is at most {@link MAX_SINCE_HOURS} hours (29 days), the
14
+ * longest whose widened dates are all still kept.
15
+ *
16
+ * A usage folder that is missing or cannot be read safely gives "unknown",
17
+ * never zero.
18
+ */
19
+ import { type CommandStates, type CommandUsageOptions } from "./command-usage.js";
20
+ export interface DuplicateCommand {
21
+ /** The duplicate's command path, by declared names. */
22
+ command: string;
23
+ /** Every path a run of it is counted under: the declared path and its typed alias forms. */
24
+ countedAs: readonly string[];
25
+ /** The command that already does the same work, or null when there is none yet. */
26
+ owner: string | null;
27
+ }
28
+ /**
29
+ * The duplicates of the US-041 PRD (it says "eight" and lists nine paths; all
30
+ * nine are checked). A run is counted under the path as typed, so an alias
31
+ * form (`packages ls`) is listed too; a test holds this list to the command
32
+ * catalog.
33
+ */
34
+ export declare const DUPLICATE_COMMANDS: readonly DuplicateCommand[];
35
+ /** Default window. */
36
+ export declare const DEFAULT_SINCE = "1d";
37
+ /** The longest window, in hours: 29 days, so every widened date is still kept. */
38
+ export declare const MAX_SINCE_HOURS: number;
39
+ /** Hours in `text` (`Nh` or `Nd`, N a whole number from 1), or null when it is not a valid window. */
40
+ export declare function parseSince(text: string): number | null;
41
+ export interface DuplicateUsageRow {
42
+ command: string;
43
+ /** State in `src/data/command-states.json`; `live` when it is not listed. */
44
+ state: string;
45
+ owner: string | null;
46
+ /** Runs in the window (every kind: plain, with the still-use flag, refused), or null when unknown. */
47
+ runs: number | null;
48
+ /** Runs on every date the store still keeps, or null when unknown. */
49
+ keptRuns: number | null;
50
+ }
51
+ export interface DuplicateUsageReport {
52
+ schema: 1;
53
+ since: string;
54
+ /** First and last UTC date counted, inclusive. */
55
+ from: string;
56
+ to: string;
57
+ /** `clear`: no duplicate ran; `used`: at least one ran; `unknown`: the count could not be read. */
58
+ status: "clear" | "used" | "unknown";
59
+ /** Why the count is unknown. */
60
+ reason?: string;
61
+ file: string | null;
62
+ leavesThisComputer: false;
63
+ commands: DuplicateUsageRow[];
64
+ }
65
+ /** Exit status for a report: 0 clear, 1 used, 2 unknown. */
66
+ export declare function duplicateUsageExitCode(report: DuplicateUsageReport): 0 | 1 | 2;
67
+ export declare function readDuplicateUsage(options?: CommandUsageOptions & {
68
+ since?: string;
69
+ states?: CommandStates;
70
+ }): DuplicateUsageReport;
71
+ export declare function renderDuplicateUsageText(report: DuplicateUsageReport): string;
72
+ //# sourceMappingURL=duplicate-command-usage.d.ts.map
@@ -0,0 +1,125 @@
1
+ /**
2
+ * `hq doctor usage --duplicates` — were any of the duplicate command paths
3
+ * run on this computer in a recent window (hq-core-rust US-041)?
4
+ *
5
+ * Each duplicate does what another command already does. The check reads the
6
+ * local usage count (utils/command-usage.ts) and nothing else; it sends
7
+ * nothing.
8
+ *
9
+ * The usage store keeps one UTC date per line and nothing finer, so a window
10
+ * (`--since 12h`, `--since 1d`) is widened to every UTC date it touches. A run
11
+ * up to a day older than the window can therefore be counted; a run inside
12
+ * the window is never missed. The store keeps {@link COMMAND_USAGE_WINDOW_DAYS}
13
+ * dates, so the window is at most {@link MAX_SINCE_HOURS} hours (29 days), the
14
+ * longest whose widened dates are all still kept.
15
+ *
16
+ * A usage folder that is missing or cannot be read safely gives "unknown",
17
+ * never zero.
18
+ */
19
+ import { COMMAND_USAGE_WINDOW_DAYS, loadCommandStates, readCommandUsageEntries, usageDateOf, } from "./command-usage.js";
20
+ /**
21
+ * The duplicates of the US-041 PRD (it says "eight" and lists nine paths; all
22
+ * nine are checked). A run is counted under the path as typed, so an alias
23
+ * form (`packages ls`) is listed too; a test holds this list to the command
24
+ * catalog.
25
+ */
26
+ export const DUPLICATE_COMMANDS = [
27
+ { command: "auth login", countedAs: ["auth login"], owner: "login" },
28
+ { command: "auth logout", countedAs: ["auth logout"], owner: "logout" },
29
+ { command: "auth status", countedAs: ["auth status"], owner: "whoami" },
30
+ { command: "sync status", countedAs: ["sync status"], owner: "daemon sync status" },
31
+ { command: "sync mode", countedAs: ["sync mode"], owner: "daemon sync mode" },
32
+ { command: "packages install", countedAs: ["packages install"], owner: "install" },
33
+ { command: "packages list", countedAs: ["packages list", "packages ls"], owner: "packs list" },
34
+ { command: "packages update", countedAs: ["packages update"], owner: null },
35
+ { command: "packages remove", countedAs: ["packages remove"], owner: "remove" },
36
+ ];
37
+ /** Default window. */
38
+ export const DEFAULT_SINCE = "1d";
39
+ /** The longest window, in hours: 29 days, so every widened date is still kept. */
40
+ export const MAX_SINCE_HOURS = (COMMAND_USAGE_WINDOW_DAYS - 1) * 24;
41
+ const HOUR_MS = 60 * 60 * 1000;
42
+ /** Hours in `text` (`Nh` or `Nd`, N a whole number from 1), or null when it is not a valid window. */
43
+ export function parseSince(text) {
44
+ const match = /^([1-9][0-9]{0,4})([hd])$/.exec(text.trim());
45
+ if (!match)
46
+ return null;
47
+ const hours = Number(match[1]) * (match[2] === "d" ? 24 : 1);
48
+ return hours <= MAX_SINCE_HOURS ? hours : null;
49
+ }
50
+ /** Exit status for a report: 0 clear, 1 used, 2 unknown. */
51
+ export function duplicateUsageExitCode(report) {
52
+ return report.status === "clear" ? 0 : report.status === "used" ? 1 : 2;
53
+ }
54
+ export function readDuplicateUsage(options = {}) {
55
+ const since = options.since ?? DEFAULT_SINCE;
56
+ const hours = parseSince(since);
57
+ if (hours === null)
58
+ throw new RangeError(`invalid window: ${since}`);
59
+ const now = options.now ?? Date.now();
60
+ const from = usageDateOf(now - hours * HOUR_MS);
61
+ const to = usageDateOf(now);
62
+ const states = options.states ?? loadCommandStates(options.env);
63
+ const read = readCommandUsageEntries(options);
64
+ const commands = DUPLICATE_COMMANDS.map((duplicate) => {
65
+ const entry = Object.prototype.hasOwnProperty.call(states, duplicate.command)
66
+ ? states[duplicate.command]
67
+ : undefined;
68
+ const state = entry && typeof entry.state === "string" ? entry.state : "live";
69
+ if (!read.ok)
70
+ return { command: duplicate.command, state, owner: duplicate.owner, runs: null, keptRuns: null };
71
+ let runs = 0;
72
+ let keptRuns = 0;
73
+ for (const line of read.entries) {
74
+ if (!duplicate.countedAs.includes(line.command))
75
+ continue;
76
+ keptRuns += line.count;
77
+ if (line.date >= from && line.date <= to)
78
+ runs += line.count;
79
+ }
80
+ return { command: duplicate.command, state, owner: duplicate.owner, runs, keptRuns };
81
+ });
82
+ const status = !read.ok ? "unknown" : commands.some((row) => (row.runs ?? 0) > 0) ? "used" : "clear";
83
+ return {
84
+ schema: 1,
85
+ since,
86
+ from,
87
+ to,
88
+ status,
89
+ ...(read.ok ? {} : { reason: read.reason }),
90
+ file: read.file,
91
+ leavesThisComputer: false,
92
+ commands,
93
+ };
94
+ }
95
+ export function renderDuplicateUsageText(report) {
96
+ const lines = [
97
+ `Duplicate commands run on this computer in the last ${report.since} (UTC dates ${report.from} to ${report.to})`,
98
+ "",
99
+ ];
100
+ const headers = ["command", "runs", "kept", "state", "use instead"];
101
+ const table = report.commands.map((row) => [
102
+ row.command,
103
+ row.runs === null ? "unknown" : String(row.runs),
104
+ row.keptRuns === null ? "unknown" : String(row.keptRuns),
105
+ row.state,
106
+ row.owner === null ? "(none yet)" : `hq ${row.owner}`,
107
+ ]);
108
+ const widths = headers.map((header, column) => Math.max(header.length, ...table.map((cells) => cells[column].length)));
109
+ const numeric = new Set([1, 2]);
110
+ const format = (cells) => ` ${cells
111
+ .map((cell, column) => (numeric.has(column) ? cell.padStart(widths[column]) : cell.padEnd(widths[column])))
112
+ .join(" ")}`.trimEnd();
113
+ lines.push(format(headers), ...table.map(format), "");
114
+ if (report.status === "unknown") {
115
+ lines.push(`Unknown: the usage count could not be read (${report.reason ?? "unreadable"}${report.file ? `, ${report.file}` : ""}). This is not a zero.`);
116
+ }
117
+ else {
118
+ const used = report.commands.filter((row) => (row.runs ?? 0) > 0).length;
119
+ lines.push(used === 0
120
+ ? `None of the ${report.commands.length} duplicates ran in the window.`
121
+ : `${used} of the ${report.commands.length} duplicates ran in the window.`, `"kept" counts every date the file still keeps (up to ${COMMAND_USAGE_WINDOW_DAYS}). Counts are kept per UTC date, so the window covers each whole date it touches.`);
122
+ }
123
+ return `${lines.join("\n")}\n`;
124
+ }
125
+ //# sourceMappingURL=duplicate-command-usage.js.map
@@ -48,6 +48,7 @@ import * as hookEngineResolve from '../lib/hook-engine/resolve.js';
48
48
  import { launcherRoot, quotePosix, quoteWindows } from '../lib/hook-engine/registration.js';
49
49
  import { openStoreDir } from '../lib/safe-store.js';
50
50
  import { SKIP_CANARY_GATE_ENV, checkHostCanary } from '../lib/hook-engine/canary-gate.js';
51
+ import { resolvedUnder } from '../lib/hook-engine/coverage.js';
51
52
  export { CORE_NEXT_FLAG, coreNextEnabled } from './core-next-flag.js';
52
53
  import { CORE_NEXT_FLAG, coreNextEnabled } from './core-next-flag.js';
53
54
  export { coreNextKillReason, CORE_NEXT_KILL_ENV, CORE_NEXT_KILL_FILE, ENGINE_KILL_ENV, ENGINE_KILL_FILE } from './core-next-kill.js';
@@ -316,7 +317,7 @@ export function coreNextTarget(home, env = process.env, options = {}) {
316
317
  const events = capableEvents(caps);
317
318
  if (!events.length)
318
319
  return null;
319
- return { coreNext: stable, events, covers: caps.covers ?? {}, canary: hostCanaryGate(home, env, caps.version, platform, options.warn) };
320
+ return resolvedUnder({ coreNext: stable, events, covers: caps.covers ?? {}, canary: hostCanaryGate(home, env, caps.version, platform, options.warn) }, env);
320
321
  }
321
322
  const warned = new Set();
322
323
  function warnOnce(message, warn) {
@@ -81,6 +81,7 @@ export const RESIDENT_PACKAGE_MODULES = {
81
81
  "../lib/hot-channels/adapters/index.js",
82
82
  "../lib/capacity/collect.js",
83
83
  "../lib/capacity/accounts.js",
84
+ "../lib/core-utils/hook-timeout-debug-context-flag.js",
84
85
  ],
85
86
  "daemon-logs-follow": [],
86
87
  "mesh-daemon": ["../sentry.js", "../lib/doctor/client-health-reason-codes-flag.js", "@indigoai-us/hq-flags-client", "../lib/plan-limit-nag.js", "../utils/plan-gate-error.js", "../utils/deleted-company-notice.js", "open", "../utils/cognito-session.js", "../lib/first-sync-next-step.js", "@indigoai-us/hq-cloud"],
@@ -290,6 +291,9 @@ const LOADERS = {
290
291
  // before it refuses on a stale one.
291
292
  () => import("../lib/capacity/collect.js"),
292
293
  () => import("../lib/capacity/accounts.js"),
294
+ // Native Stop timeout diagnostics report through sentry-report, whose
295
+ // hook-timeout debug-context gate loads this flag module on demand.
296
+ () => import("../lib/core-utils/hook-timeout-debug-context-flag.js"),
293
297
  ],
294
298
  "daemon-logs-follow": [],
295
299
  "mesh-daemon": [
@@ -151,6 +151,15 @@ const KNOWN_ERROR_NAMES = new Set([
151
151
  "QmdStoreUnopenableError",
152
152
  "QmdQueryDocumentError",
153
153
  "QmdModelDownloadError",
154
+ // A damaged SQLite index file. Still captured, so it groups on its own key
155
+ // (HQ-CLI-EJ).
156
+ "QmdStoreCorruptError",
157
+ // Thrown marked expected (the boundary prints the remedy and skips capture),
158
+ // or handled inside reconciliation. Allow-listed defensively, like
159
+ // QmdWorkdirMissingError below (HQ-CLI-EJ, HQ-CLI-GJ).
160
+ "QmdAccessDeniedError",
161
+ "QmdConfigUnwritableError",
162
+ "QmdCollectionPathTakenError",
154
163
  // Shares the `Qmd` prefix the qmd branch keys on. The boundary now SUPPRESSES
155
164
  // capture for this class, so it should never reach a capture route — allow-
156
165
  // listed defensively so a future capture path cannot mint an unbounded group
@@ -1,3 +1,5 @@
1
+ /** System32\bash.exe (WSL) or a WindowsApps alias: never used as Git Bash. */
2
+ export declare function isExcludedWindowsBash(file: string, env: Record<string, string | undefined>): boolean;
1
3
  export declare function resolveWindowsBash(env: Record<string, string | undefined>): {
2
4
  executable?: string;
3
5
  cause: unknown;
@@ -19,7 +19,8 @@ function isWithinWindowsDirectory(file, directory) {
19
19
  return normalizedFile === normalizedDirectory
20
20
  || normalizedFile.startsWith(`${normalizedDirectory}${path.win32.sep}`);
21
21
  }
22
- function isExcludedWindowsBash(file, env) {
22
+ /** System32\bash.exe (WSL) or a WindowsApps alias: never used as Git Bash. */
23
+ export function isExcludedWindowsBash(file, env) {
23
24
  if (path.win32.basename(file).toLowerCase() !== "bash.exe")
24
25
  return false;
25
26
  const windowsDir = envValue(env, "SystemRoot") ?? envValue(env, "WINDIR") ?? "C:\\Windows";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.220",
3
+ "version": "5.345.221",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -29,7 +29,8 @@
29
29
  "contracts",
30
30
  "scripts/install-hook-engine.mjs",
31
31
  "scripts/check-function-manifest.mjs",
32
- "scripts/bench-core.mjs"
32
+ "scripts/bench-core.mjs",
33
+ "scripts/bench-core-compare.mjs"
33
34
  ],
34
35
  "scripts": {
35
36
  "build": "node scripts/generate-dsn.mjs && node scripts/build-flag-registry-worker.mjs && tsc && node scripts/generate-command-catalog.mjs --check && node scripts/copy-schemas.mjs && node scripts/chmod-bins.mjs && node scripts/bundle-sync-runner.mjs",
@@ -123,11 +124,11 @@
123
124
  "*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
124
125
  },
125
126
  "optionalDependencies": {
126
- "@indigoai-us/hq-hook-win32-x64": "5.345.220",
127
- "@indigoai-us/hq-hook-win32-arm64": "5.345.220",
128
- "@indigoai-us/hq-hook-darwin-x64": "5.345.220",
129
- "@indigoai-us/hq-hook-darwin-arm64": "5.345.220",
130
- "@indigoai-us/hq-hook-linux-x64": "5.345.220",
131
- "@indigoai-us/hq-hook-linux-arm64": "5.345.220"
127
+ "@indigoai-us/hq-hook-win32-x64": "5.345.221",
128
+ "@indigoai-us/hq-hook-win32-arm64": "5.345.221",
129
+ "@indigoai-us/hq-hook-darwin-x64": "5.345.221",
130
+ "@indigoai-us/hq-hook-darwin-arm64": "5.345.221",
131
+ "@indigoai-us/hq-hook-linux-x64": "5.345.221",
132
+ "@indigoai-us/hq-hook-linux-arm64": "5.345.221"
132
133
  }
133
134
  }