@indigoai-us/hq-cli 5.345.233 → 5.345.234
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 +7 -0
- package/dist/command-catalog.generated.d.ts +4 -0
- package/dist/command-catalog.generated.js +5 -0
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.js +24 -0
- package/dist/commands/install-global.js +10 -0
- package/dist/lib/hook-engine/coverage.js +50 -0
- package/dist/lib/windows/jq.d.ts +17 -0
- package/dist/lib/windows/jq.js +72 -0
- package/package.json +7 -7
- package/scripts/install-hook-engine.mjs +8 -15
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [5.345.234] — 2026-11-19
|
|
6
|
+
- Recognize the HQ Core 16.0.50 policy injector on platforms with the Rust state store.
|
|
7
|
+
- The native hook engine now claims the old dispatcher's own work on Grok Build's PermissionDenied, PostCompact and PostToolUseFailure events (session bind, duplicate-event check, timeout journal), as it does for Notification, so those three events have no unclaimed hook left in the coverage list. With `HQ_HOOK_TRACE` set, the engine prints the dispatcher's trace lines for them on stderr, which the Grok adapter used to drop. If an HQ has a hook of one of these events that the engine does not run, the native event does none of that work and prints why on stderr; run `hq reindex` to keep the event on the old dispatcher while such a hook exists. `hq reindex` still keeps these events on the old dispatcher until the engine reports `lifecycle-dispatch`.
|
|
8
|
+
- The native hook engine now claims the old dispatcher's own work on Grok Build's StopCancelled and StopFailure events (session bind, duplicate-event check, timeout journal), which the Grok adapter ran as a Stop after its turn-end step, so those two events have no unclaimed hook left in the coverage list. If an HQ has a Stop hook the engine does not run on these events (a Stop folder hook, the turn-end hook included, or another Stop command in `.claude/settings.json`), the native event does none of that work and prints why on stderr. `hq reindex` still keeps these events on the old dispatcher until the engine reports `lifecycle-dispatch`.
|
|
9
|
+
- Fixed Windows hook tests to verify the platform's Bash fallback and read parity ledger entries with either LF or CRLF line endings.
|
|
10
|
+
- Windows HQ installs now provision a checksum-verified jq for hooks. Run `hq doctor --fix-jq` to repair a missing managed copy.
|
|
11
|
+
|
|
5
12
|
## [5.345.233] — 2026-11-19
|
|
6
13
|
- Test: publish the daemon bootstrap lease test's JSON trace atomically.
|
|
7
14
|
- Updates the bundled HQ Cloud to 6.18.113. A company Outpost other than the company's first one now accepts its own sign-in: the box checks the machine token's Outpost id against `HQ_COMPANY_OUTPOST_ID` instead of always expecting the company's first Outpost. Boxes without that variable, or with the first Outpost's id, behave as before.
|
|
@@ -12963,6 +12963,10 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
12963
12963
|
readonly flags: "--fix";
|
|
12964
12964
|
readonly description: "Apply the allowlisted safe repairs (backs up first; read-only without this flag).";
|
|
12965
12965
|
readonly hidden: false;
|
|
12966
|
+
}, {
|
|
12967
|
+
readonly flags: "--fix-jq";
|
|
12968
|
+
readonly description: "Install the verified jq required by HQ hooks on Windows.";
|
|
12969
|
+
readonly hidden: false;
|
|
12966
12970
|
}, {
|
|
12967
12971
|
readonly flags: "--client-health-report";
|
|
12968
12972
|
readonly description: "Resolve the opt-in hq-flags gate used by the client-health report hook.";
|
|
@@ -15765,6 +15765,11 @@ export const COMMAND_CATALOG = [
|
|
|
15765
15765
|
"description": "Apply the allowlisted safe repairs (backs up first; read-only without this flag).",
|
|
15766
15766
|
"hidden": false
|
|
15767
15767
|
},
|
|
15768
|
+
{
|
|
15769
|
+
"flags": "--fix-jq",
|
|
15770
|
+
"description": "Install the verified jq required by HQ hooks on Windows.",
|
|
15771
|
+
"hidden": false
|
|
15772
|
+
},
|
|
15768
15773
|
{
|
|
15769
15774
|
"flags": "--client-health-report",
|
|
15770
15775
|
"description": "Resolve the opt-in hq-flags gate used by the client-health report hook.",
|
|
@@ -133,6 +133,7 @@ export interface DoctorCommandDeps {
|
|
|
133
133
|
sweepTempHomes?: (options: {
|
|
134
134
|
dryRun: boolean;
|
|
135
135
|
}) => TempHomeSweepResult;
|
|
136
|
+
installWindowsJq?: () => Promise<string | undefined>;
|
|
136
137
|
}
|
|
137
138
|
/** Text report for `hq doctor --sweep-temp-homes`. */
|
|
138
139
|
export declare function renderTempHomeSweepText(result: TempHomeSweepResult): string;
|
package/dist/commands/doctor.js
CHANGED
|
@@ -32,6 +32,7 @@ import { DEEP_FAMILY_ID, DEEP_FAMILY_TITLE, runDeepGuardTests, } from "../lib/do
|
|
|
32
32
|
import { PARITY_FAMILY_ID, PARITY_FAMILY_TITLE, runParityReplay, } from "../lib/doctor/deep/parity.js";
|
|
33
33
|
import { applyFixes } from "../lib/doctor/fix/apply.js";
|
|
34
34
|
import { renderDoctorFixJson } from "../lib/doctor/fix/json-output.js";
|
|
35
|
+
import { installWindowsJq } from "../lib/windows/jq.js";
|
|
35
36
|
import { clientHealthCheckStatusEnabled as isActiveCompanyClientHealthCheckStatusEnabled, clientHealthCheckStatusEnabledForCompany, clientHealthReasonCodesEnabled as isActiveCompanyClientHealthReasonCodesEnabled, clientHealthReasonCodesEnabledForCompany, } from "../lib/doctor/client-health-reason-codes-flag.js";
|
|
36
37
|
import { clientHealthCompanyScopeFromCheckId } from "../lib/doctor/checks/sync-health.js";
|
|
37
38
|
import { readCompaniesManifestMap } from "../lib/work-context/repo-remote.js";
|
|
@@ -363,12 +364,35 @@ export function registerDoctorCommand(program, deps = {}) {
|
|
|
363
364
|
.option("--company <slug>", "Company slug for integrations checks (otherwise resolves your single active company).")
|
|
364
365
|
.option("--only <families>", "Run only these comma-separated check families (e.g. hooks). Unknown names are rejected; --json then records the scope.")
|
|
365
366
|
.option("--fix", "Apply the allowlisted safe repairs (backs up first; read-only without this flag).")
|
|
367
|
+
.option("--fix-jq", "Install the verified jq required by HQ hooks on Windows.")
|
|
366
368
|
.addOption(new Option("--client-health-report", "Resolve the opt-in hq-flags gate used by the client-health report hook.").hideHelp())
|
|
367
369
|
.option("--sweep-temp-homes", "Delete idle temp homes (90+ minutes untouched, not in use): tmp.* folders holding .rustup or .cargo, and hq-temp-home.* folders left by the wrapper. Reports GB freed.")
|
|
368
370
|
.option("--dry-run", "With --sweep-temp-homes, list what would be removed and delete nothing.")
|
|
369
371
|
.option("--yes", "Skip the interactive --fix confirmation (non-interactive use).")
|
|
370
372
|
.option("--force", "Let --fix run despite uncommitted changes under .claude/, .codex/, or .grok/.")
|
|
371
373
|
.action(async (opts, command) => {
|
|
374
|
+
if (opts.fixJq === true) {
|
|
375
|
+
if (opts.fix || opts.only !== undefined || opts.sweepTempHomes || opts.dryRun) {
|
|
376
|
+
process.stderr.write("hq doctor --fix-jq must run as a standalone repair.\n");
|
|
377
|
+
process.exitCode = 1;
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
try {
|
|
381
|
+
const target = await (deps.installWindowsJq ?? installWindowsJq)();
|
|
382
|
+
if (!target)
|
|
383
|
+
throw new Error("The managed jq repair is only available on Windows.");
|
|
384
|
+
process.stdout.write(opts.json ? `${JSON.stringify({ target })}\n` : `Verified jq is ready at ${target}.\n`);
|
|
385
|
+
}
|
|
386
|
+
catch (error) {
|
|
387
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
388
|
+
if (opts.json)
|
|
389
|
+
process.stdout.write(`${JSON.stringify({ error: message })}\n`);
|
|
390
|
+
else
|
|
391
|
+
process.stderr.write(`hq doctor --fix-jq: ${message}\n`);
|
|
392
|
+
process.exitCode = 1;
|
|
393
|
+
}
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
372
396
|
// `--sweep-temp-homes` is a second write path with its own fixed
|
|
373
397
|
// scope (idle, unused temp homes in the temp dirs). Like `--fix`,
|
|
374
398
|
// it refuses a family scope it would otherwise ignore, and it does not
|
|
@@ -30,6 +30,7 @@ import { trustCodexUserHooks } from '../utils/hook-trust.js';
|
|
|
30
30
|
import { assertProviderWrappersInstallable, installProviderWrappers, providerWrapperInstallPaths, removeProviderWrappers } from '../lib/install/provider-wrappers.js';
|
|
31
31
|
import { checkShimOnPath, ensureShimOnUserPath, npmShimDir, shimPathWarning } from '../lib/windows/user-path.js';
|
|
32
32
|
import { removeHqCliPs1Shims } from '../lib/windows/ps1-shims.js';
|
|
33
|
+
import { installWindowsJq, WINDOWS_JQ_REPAIR } from '../lib/windows/jq.js';
|
|
33
34
|
import { addAgentsMdBlock, addCodexHooks, classifyLegacySkills, codexAdapterPath, codexCharterSource, codexHookTrustKeys, codexTargets, hasAllCodexHooks, HQ_OWNED_MARKER, LEGACY_BACKUP_NAME, LEGACY_SKILLS_NAME, removeAgentsMdBlock, removeCodexHooks, } from '../lib/install/codex-targets.js';
|
|
34
35
|
import { addClaudeMdBlock, addHqHooks, charterPath, claudeTargets, hasAllHqHooks, HQ_ANYWHERE_PACK, HQ_MCP_SERVER_NAME, hqSkillsSource, lineDiff, masterHookPath, shimPath, removeClaudeMdBlock, removeHqHooks, SKILL_LINK_PREFIX, } from '../lib/install/claude-targets.js';
|
|
35
36
|
export { hookTargetFor, isDaemonInstalled } from '../lib/install/hook-target.js';
|
|
@@ -1207,6 +1208,15 @@ export async function runInstallGlobal(opts) {
|
|
|
1207
1208
|
}
|
|
1208
1209
|
const install = runtime === 'codex' ? installGlobalCodex : installGlobalClaude;
|
|
1209
1210
|
const hqRoot = resolveInstallRoot(opts.hqRoot, { env, cwd: opts.cwd, home: opts.home });
|
|
1211
|
+
if (process.platform === 'win32' && !opts.dryRun) {
|
|
1212
|
+
try {
|
|
1213
|
+
await installWindowsJq({ home: opts.home });
|
|
1214
|
+
}
|
|
1215
|
+
catch (error) {
|
|
1216
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1217
|
+
throw Object.assign(new Error(`Could not install jq for HQ hooks: ${message} Run ${WINDOWS_JQ_REPAIR} and retry.`), { expected: true });
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1210
1220
|
install({
|
|
1211
1221
|
hqRoot,
|
|
1212
1222
|
home: opts.home,
|
|
@@ -1682,8 +1682,58 @@ export function uncoveredHooks(root, host, event, covers, env = process.env) {
|
|
|
1682
1682
|
if (hold)
|
|
1683
1683
|
missing.push(`(native PreCompact compatibility: ${hold})`);
|
|
1684
1684
|
}
|
|
1685
|
+
if (host === 'grok' && GROK_STOP_OBSERVE.has(event) && covered.includes(`master-hook:${event}`)) {
|
|
1686
|
+
for (const hook of grokStopObserveUncovered(root, event, covers))
|
|
1687
|
+
if (!missing.includes(hook))
|
|
1688
|
+
missing.push(hook);
|
|
1689
|
+
}
|
|
1685
1690
|
return missing;
|
|
1686
1691
|
}
|
|
1692
|
+
/** Grok events the adapter dispatched as its settings.json `Stop` entries (lifecycle_master.rs `dispatched`). */
|
|
1693
|
+
const GROK_STOP_OBSERVE = new Set(['StopCancelled', 'StopFailure']);
|
|
1694
|
+
/**
|
|
1695
|
+
* The Stop hooks the old path ran on a Grok StopCancelled or StopFailure that
|
|
1696
|
+
* the claim does not cover, as lifecycle_master.rs `stop_observe_uncovered`
|
|
1697
|
+
* lists them for its guard: with master-hook among the settings.json Stop
|
|
1698
|
+
* entries, every Stop hook (registry rows, folders, other settings commands);
|
|
1699
|
+
* without it, only the other settings.json Stop commands. Covered are the
|
|
1700
|
+
* event's own claims, master-hook:Stop and grok-adapter:Stop, and the Stop
|
|
1701
|
+
* host-set claims for grok. Without this, reindex switches the event and the
|
|
1702
|
+
* native guard refuses every one (US-050 c7, O2 R1).
|
|
1703
|
+
*/
|
|
1704
|
+
function grokStopObserveUncovered(root, event, covers) {
|
|
1705
|
+
const stop = shellHooks(root, 'grok', 'Stop');
|
|
1706
|
+
if (!stop)
|
|
1707
|
+
return [UNREADABLE];
|
|
1708
|
+
let master = 0;
|
|
1709
|
+
try {
|
|
1710
|
+
const settings = JSON.parse(fs.readFileSync(path.join(root, '.claude', 'settings.json'), 'utf8'));
|
|
1711
|
+
const groups = settings?.hooks?.Stop;
|
|
1712
|
+
for (const group of Array.isArray(groups) ? groups : []) {
|
|
1713
|
+
for (const entry of Array.isArray(group?.hooks) ? group.hooks : []) {
|
|
1714
|
+
const command = entry?.command;
|
|
1715
|
+
if (typeof command !== 'string' || !command.includes('master-hook.sh'))
|
|
1716
|
+
continue;
|
|
1717
|
+
master += 1;
|
|
1718
|
+
if (entry.args != null)
|
|
1719
|
+
master += 1;
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
catch {
|
|
1724
|
+
return [UNREADABLE];
|
|
1725
|
+
}
|
|
1726
|
+
// Two master-hook entries, or the exec form: the native guard refuses.
|
|
1727
|
+
if (master > 1)
|
|
1728
|
+
return [`(native Grok ${event}: master-hook Stop entry not modelled)`];
|
|
1729
|
+
const listed = master === 1 ? stop : stop.filter((hook) => hook.startsWith('settings:'));
|
|
1730
|
+
const onHost = {};
|
|
1731
|
+
for (const [key, ids] of Object.entries(covers ?? {}))
|
|
1732
|
+
if (key.includes('@'))
|
|
1733
|
+
onHost[key] = ids;
|
|
1734
|
+
const covered = [...coveredOn(covers, event, 'grok'), 'master-hook:Stop', 'grok-adapter:Stop', ...coveredOn(onHost, 'Stop', 'grok')];
|
|
1735
|
+
return listed.filter((hook) => !covered.some((claim) => claimCovers(claim, hook)));
|
|
1736
|
+
}
|
|
1687
1737
|
/**
|
|
1688
1738
|
* `target` narrowed to the events it covers in full on `host` in this HQ
|
|
1689
1739
|
* root; null when none is covered (every event stays on the old dispatcher),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const WINDOWS_JQ_REPAIR = "hq doctor --fix-jq";
|
|
2
|
+
interface JqAsset {
|
|
3
|
+
name: string;
|
|
4
|
+
sha256: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function windowsJqPath(home?: string): string;
|
|
7
|
+
interface InstallOptions {
|
|
8
|
+
platform?: NodeJS.Platform;
|
|
9
|
+
arch?: NodeJS.Architecture;
|
|
10
|
+
home?: string;
|
|
11
|
+
fetch?: typeof fetch;
|
|
12
|
+
asset?: JqAsset;
|
|
13
|
+
}
|
|
14
|
+
/** The npm lifecycle, global hook setup and doctor use the same Windows installer. */
|
|
15
|
+
export declare function installWindowsJq({ platform, arch, home, fetch: download, asset, }?: InstallOptions): Promise<string | undefined>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=jq.d.ts.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { mkdir, mkdtemp, rename, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
import { dirname, join } from "node:path";
|
|
6
|
+
const version = "1.8.2";
|
|
7
|
+
const release = `https://github.com/jqlang/jq/releases/download/jq-${version}`;
|
|
8
|
+
export const WINDOWS_JQ_REPAIR = "hq doctor --fix-jq";
|
|
9
|
+
// https://github.com/jqlang/jq/releases/tag/jq-1.8.2
|
|
10
|
+
const assets = {
|
|
11
|
+
x64: {
|
|
12
|
+
name: "jq-windows-amd64.exe",
|
|
13
|
+
sha256: "a6fc67fedaf9128a3309a1e2ebb8b986aeccf70122ee46d2cb4849e423f0c627",
|
|
14
|
+
},
|
|
15
|
+
arm64: {
|
|
16
|
+
name: "jq-windows-arm64.exe",
|
|
17
|
+
sha256: "083b5377392bc57cf27052b6d20a2d927770683bca844632901ff38b4b7b0ac7",
|
|
18
|
+
},
|
|
19
|
+
ia32: {
|
|
20
|
+
name: "jq-windows-i386.exe",
|
|
21
|
+
sha256: "a99cb668f95bdd788d9ee20529613b115e5d2a0d7f9127ee6976607e878558ba",
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export function windowsJqPath(home = homedir()) {
|
|
25
|
+
// hq-core-staging #2047 adds this directory to hook PATH when it holds jq.exe.
|
|
26
|
+
return join(home, ".local", "bin", "jq.exe");
|
|
27
|
+
}
|
|
28
|
+
function digest(bytes) {
|
|
29
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
30
|
+
}
|
|
31
|
+
function matchesAsset(file, asset) {
|
|
32
|
+
try {
|
|
33
|
+
return digest(readFileSync(file)) === asset.sha256;
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
if (error.code === "ENOENT")
|
|
37
|
+
return false;
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** The npm lifecycle, global hook setup and doctor use the same Windows installer. */
|
|
42
|
+
export async function installWindowsJq({ platform = process.platform, arch = process.arch, home, fetch: download = fetch, asset = assets[arch], } = {}) {
|
|
43
|
+
if (platform !== "win32")
|
|
44
|
+
return undefined;
|
|
45
|
+
if (!asset)
|
|
46
|
+
throw new Error(`jq has no official Windows build for ${arch}.`);
|
|
47
|
+
const target = windowsJqPath(home);
|
|
48
|
+
if (matchesAsset(target, asset))
|
|
49
|
+
return target;
|
|
50
|
+
const response = await download(`${release}/${asset.name}`, {
|
|
51
|
+
signal: AbortSignal.timeout(20_000),
|
|
52
|
+
});
|
|
53
|
+
if (!response.ok)
|
|
54
|
+
throw new Error(`jq download failed (HTTP ${response.status}).`);
|
|
55
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
56
|
+
if (digest(bytes) !== asset.sha256) {
|
|
57
|
+
throw new Error(`The SHA-256 of ${asset.name} did not match the pinned release checksum.`);
|
|
58
|
+
}
|
|
59
|
+
const dir = dirname(target);
|
|
60
|
+
await mkdir(dir, { recursive: true });
|
|
61
|
+
const staged = await mkdtemp(join(dir, ".hq-jq-"));
|
|
62
|
+
try {
|
|
63
|
+
const file = join(staged, "jq.exe");
|
|
64
|
+
await writeFile(file, bytes, { flag: "wx", mode: 0o755 });
|
|
65
|
+
await rename(file, target);
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
await rm(staged, { recursive: true, force: true });
|
|
69
|
+
}
|
|
70
|
+
return target;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=jq.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indigoai-us/hq-cli",
|
|
3
|
-
"version": "5.345.
|
|
3
|
+
"version": "5.345.234",
|
|
4
4
|
"description": "HQ by Indigo management CLI — modules and cloud sync",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -126,11 +126,11 @@
|
|
|
126
126
|
"*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
|
|
127
127
|
},
|
|
128
128
|
"optionalDependencies": {
|
|
129
|
-
"@indigoai-us/hq-hook-win32-x64": "5.345.
|
|
130
|
-
"@indigoai-us/hq-hook-win32-arm64": "5.345.
|
|
131
|
-
"@indigoai-us/hq-hook-darwin-x64": "5.345.
|
|
132
|
-
"@indigoai-us/hq-hook-darwin-arm64": "5.345.
|
|
133
|
-
"@indigoai-us/hq-hook-linux-x64": "5.345.
|
|
134
|
-
"@indigoai-us/hq-hook-linux-arm64": "5.345.
|
|
129
|
+
"@indigoai-us/hq-hook-win32-x64": "5.345.234",
|
|
130
|
+
"@indigoai-us/hq-hook-win32-arm64": "5.345.234",
|
|
131
|
+
"@indigoai-us/hq-hook-darwin-x64": "5.345.234",
|
|
132
|
+
"@indigoai-us/hq-hook-darwin-arm64": "5.345.234",
|
|
133
|
+
"@indigoai-us/hq-hook-linux-x64": "5.345.234",
|
|
134
|
+
"@indigoai-us/hq-hook-linux-arm64": "5.345.234"
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -24,20 +24,13 @@ try {
|
|
|
24
24
|
} catch (error) {
|
|
25
25
|
console.warn(`HQ PowerShell launcher cleanup skipped: ${error instanceof Error ? error.message : String(error)}. If PowerShell blocks hq, run hq.cmd doctor --fix.`);
|
|
26
26
|
}
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const dirs = (process.env.PATH ?? '').split(';').map(dir => dir.trim().replace(/^"(.*)"$/, '$1')).filter(Boolean);
|
|
36
|
-
// Git Bash runs the hooks: it can run jq.exe but not a jq.cmd or jq.bat.
|
|
37
|
-
if (!dirs.some(dir => existsSync(join(dir, 'jq.exe')))) {
|
|
38
|
-
console.warn('jq not found on PATH. Install jq (Windows: winget install jqlang.jq) and open a new terminal; HQ hooks block tool calls until jq is on PATH.');
|
|
39
|
-
}
|
|
27
|
+
// The CLI stays available for repair if the download fails. The hook's
|
|
28
|
+
// existing refusal still applies whenever it cannot find jq.
|
|
29
|
+
if (process.platform === 'win32') {
|
|
30
|
+
try {
|
|
31
|
+
const { installWindowsJq } = await import('../dist/lib/windows/jq.js');
|
|
32
|
+
await installWindowsJq();
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.warn(`HQ could not install jq: ${error instanceof Error ? error.message : String(error)}. Repair: hq doctor --fix-jq.`);
|
|
40
35
|
}
|
|
41
|
-
} catch {
|
|
42
|
-
// A PATH scan failure must not fail the install.
|
|
43
36
|
}
|