@indigoai-us/hq-cli 5.345.264 → 5.345.268
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 +77 -0
- package/assets/scaffold/core/scripts/hq-delegate-grant.sh +4 -48
- package/assets/scaffold/core/scripts/hq-delegate-secrets.sh +16 -10
- package/assets/scaffold/core/scripts/hq-delegate-send.sh +17 -1
- package/contracts/host-canary-release.json +7 -7
- package/dist/command-catalog.generated.d.ts +30 -1
- package/dist/command-catalog.generated.js +37 -1
- package/dist/commands/core-delegate-w1b.js +21 -40
- package/dist/commands/core-delegate.js +11 -8
- package/dist/commands/core-job-notify-native.d.ts +6 -0
- package/dist/commands/core-job-notify-native.js +64 -4
- package/dist/commands/core-jobs-native.js +3 -16
- package/dist/commands/files-browse.d.ts +83 -4
- package/dist/commands/files-browse.js +404 -54
- package/dist/commands/groups.js +2 -2
- package/dist/commands/install-global.js +54 -17
- package/dist/commands/skill.js +15 -0
- package/dist/lib/agent-kit/mcp/tools.js +2 -2
- package/dist/lib/agent-kit/skills.js +12 -6
- package/dist/lib/daemon/machine-check-owner.js +1 -1
- package/dist/lib/daemon/machine-checks.d.ts +3 -11
- package/dist/lib/daemon/machine-checks.js +4 -15
- package/dist/lib/daemon/merge-sections.d.ts +44 -9
- package/dist/lib/daemon/merge-sections.js +234 -37
- package/dist/lib/daemon/run.js +1 -0
- package/dist/lib/doctor/checks/antigravity-wiring.js +20 -4
- package/dist/lib/doctor/checks/codex-wiring.d.ts +4 -2
- package/dist/lib/doctor/checks/codex-wiring.js +70 -13
- package/dist/lib/doctor/checks/fleet-hook-core.d.ts +4 -4
- package/dist/lib/doctor/checks/fleet-hook-core.js +5 -10
- package/dist/lib/doctor/checks/grok-wiring.js +38 -0
- package/dist/lib/doctor/checks/hook-engine.js +0 -2
- package/dist/lib/doctor/checks/host-core.d.ts +1 -1
- package/dist/lib/doctor/checks/host-core.js +17 -42
- package/dist/lib/doctor/fix/process-identity.d.ts +2 -0
- package/dist/lib/doctor/fix/process-identity.js +5 -2
- package/dist/lib/hook-engine/coverage.d.ts +10 -1
- package/dist/lib/hook-engine/coverage.js +76 -9
- package/dist/lib/hook-engine/fleet-registration.js +7 -4
- package/dist/lib/hook-engine/native-precompact-compatibility.json +8 -1
- package/dist/lib/hook-engine/native-stop-compatibility.json +30 -11
- package/dist/lib/hook-engine/reconcile.d.ts +10 -1
- package/dist/lib/hook-engine/reconcile.js +351 -44
- package/dist/lib/hook-engine/stable-gate.d.ts +43 -0
- package/dist/lib/hook-engine/stable-gate.js +276 -0
- package/dist/lib/hot-channels/fleet-complete.js +2 -2
- package/dist/lib/install/antigravity-targets.js +2 -1
- package/dist/lib/install/claude-targets.d.ts +6 -6
- package/dist/lib/install/claude-targets.js +13 -9
- package/dist/lib/install/codex-targets.d.ts +4 -4
- package/dist/lib/install/codex-targets.js +26 -16
- package/dist/lib/install/hook-target.d.ts +23 -2
- package/dist/lib/install/hook-target.js +89 -16
- package/dist/lib/outpost-identity-env.d.ts +18 -0
- package/dist/lib/outpost-identity-env.js +29 -0
- package/dist/lib/signals/reply.js +25 -5
- package/dist/lib/signals/steps/extract.d.ts +28 -4
- package/dist/lib/signals/steps/extract.js +158 -10
- package/dist/lib/sync-core/release.d.ts +1 -1
- package/dist/lib/sync-core/release.js +2 -2
- package/dist/utils/core-next-kill.d.ts +2 -15
- package/dist/utils/core-next-kill.js +5 -36
- package/dist/utils/hook-engine-rollup.js +0 -1
- package/dist/utils/hook-trust.d.ts +2 -0
- package/dist/utils/hook-trust.js +156 -13
- package/dist/utils/host-registration.d.ts +158 -4
- package/dist/utils/host-registration.js +500 -17
- package/package.json +7 -7
|
@@ -34,6 +34,32 @@ const GROK_BRIDGE_FILES = ["hq-hq-bridge.sh", "hq-hq-bridge.json"];
|
|
|
34
34
|
export function checkGrokWiring(context, options = {}) {
|
|
35
35
|
const grokDir = path.join(context.hqRoot, ".grok", "hooks");
|
|
36
36
|
const bridgeDir = options.bridgeDir ?? path.join(os.homedir(), ".grok", "hooks");
|
|
37
|
+
const nativeBridge = nativeBridgeEvents(bridgeDir);
|
|
38
|
+
const legacyAbsent = !fileState(path.join(grokDir, "hq-grok.json")).present &&
|
|
39
|
+
!fileState(path.join(grokDir, "hq-grok-hook-adapter.sh")).present;
|
|
40
|
+
if (legacyAbsent && nativeBridge !== null) {
|
|
41
|
+
return [
|
|
42
|
+
{
|
|
43
|
+
status: "NA",
|
|
44
|
+
checkId: "hooks.grok.scope",
|
|
45
|
+
target: "grok",
|
|
46
|
+
message: "Grok hook checks are wiring only (registration, native bridge presence); live Grok hook execution is verified only when the doctor runs under the Grok host.",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
status: "PASS",
|
|
50
|
+
checkId: "hooks.grok.registration",
|
|
51
|
+
target: path.join(bridgeDir, "hq-hq-bridge.json"),
|
|
52
|
+
message: `User-global Grok bridge registers native hq-hook across ${nativeBridge} event${nativeBridge === 1 ? "" : "s"}.`,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
status: "PASS",
|
|
56
|
+
checkId: "hooks.grok.adapter",
|
|
57
|
+
target: path.join(bridgeDir, "hq-hq-bridge.json"),
|
|
58
|
+
message: "Grok routes directly through native hq-hook (no bash adapter required).",
|
|
59
|
+
},
|
|
60
|
+
checkBridge(bridgeDir),
|
|
61
|
+
];
|
|
62
|
+
}
|
|
37
63
|
return [
|
|
38
64
|
{
|
|
39
65
|
status: "NA",
|
|
@@ -46,6 +72,18 @@ export function checkGrokWiring(context, options = {}) {
|
|
|
46
72
|
checkBridge(bridgeDir),
|
|
47
73
|
];
|
|
48
74
|
}
|
|
75
|
+
function nativeBridgeEvents(bridgeDir) {
|
|
76
|
+
try {
|
|
77
|
+
const raw = fs.readFileSync(path.join(bridgeDir, "hq-hq-bridge.json"), "utf8");
|
|
78
|
+
const parsed = JSON.parse(raw);
|
|
79
|
+
const commands = collectCommands(parsed);
|
|
80
|
+
const native = commands.filter((command) => command.includes("hq-hook") && command.includes("--host") && command.includes("grok"));
|
|
81
|
+
return native.length > 0 ? native.length : null;
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
49
87
|
function checkRegistration(registrationPath) {
|
|
50
88
|
let raw;
|
|
51
89
|
try {
|
|
@@ -17,8 +17,6 @@ function pathPresent(filePath) {
|
|
|
17
17
|
function isStrictModeActive(env) {
|
|
18
18
|
const engineEnv = env.HQ_HOOK_ENGINE?.trim().toLowerCase();
|
|
19
19
|
const home = env.HOME || env.USERPROFILE || homedir();
|
|
20
|
-
if (engineEnv === 'off' || pathPresent(join(home, '.hq', 'hook-engine.off')))
|
|
21
|
-
return false;
|
|
22
20
|
if (engineEnv === 'strict')
|
|
23
21
|
return true;
|
|
24
22
|
return pathPresent(join(home, '.hq', 'hook-engine.strict'));
|
|
@@ -38,7 +38,7 @@ export interface EventCore {
|
|
|
38
38
|
* fix. With the flag on, an event left on the old dispatcher says why.
|
|
39
39
|
*/
|
|
40
40
|
export declare function hostCoreResults(root: string, options?: HostCoreOptions): CheckResult[];
|
|
41
|
-
/** Flag
|
|
41
|
+
/** Flag state, shown once. */
|
|
42
42
|
export declare function coreSwitchResult(options?: HostCoreOptions): CheckResult;
|
|
43
43
|
/** The family `hq doctor` prints. */
|
|
44
44
|
export declare function hostCoreFamily(context: CheckContext, options?: HostCoreOptions): Promise<FamilyRun>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `hq doctor`: which core each host on this machine is using, per event, and
|
|
3
|
-
* why (hq-core-rust US-017). Reads the registration files `hq reindex` writes
|
|
4
|
-
* and
|
|
3
|
+
* why (hq-core-rust US-017). Reads the registration files `hq reindex` writes,
|
|
4
|
+
* and writes nothing. When an event is registered to the
|
|
5
5
|
* new core, or the flag is on, it starts the engine once (`--version` and
|
|
6
6
|
* `capabilities --json`) to see which evaluators it has. An event registered
|
|
7
7
|
* to a new core that is missing, does not run, or lacks the event's guards is
|
|
@@ -14,9 +14,9 @@ import { jsonFormat } from '../../../commands/mcp-registration.js';
|
|
|
14
14
|
import { CORE_NEXT_LINK, isCoreNextEntry, isNativeEntry } from '../../hook-engine/registration.js';
|
|
15
15
|
import { isAdapterEntry } from '../../install/codex-targets.js';
|
|
16
16
|
import { antigravityEventEntries, antigravityTargets } from '../../install/antigravity-targets.js';
|
|
17
|
-
import { claudeProjectAdapterHold, uncoveredHooks } from '../../hook-engine/coverage.js';
|
|
17
|
+
import { claudeProjectAdapterHold, stopCompatibilityHold, uncoveredHooks } from '../../hook-engine/coverage.js';
|
|
18
18
|
import { masterHookPath, shimPath } from '../../install/claude-targets.js';
|
|
19
|
-
import { CORE_NEXT_FLAG,
|
|
19
|
+
import { CORE_NEXT_FLAG, REQUIRED_EVALUATORS, STABLE_LINK_NAME, coreNextEnabled, coreNextTargetFor, missingEvaluators, probeEngine, } from '../../../utils/host-registration.js';
|
|
20
20
|
import { fleetHookCoreResults } from './fleet-hook-core.js';
|
|
21
21
|
import { HOOKS_FAMILY_ID } from '../registry.js';
|
|
22
22
|
export const HOST_CORE_FAMILY_ID = 'host-core';
|
|
@@ -109,7 +109,6 @@ export function hostCoreResults(root, options = {}) {
|
|
|
109
109
|
const platform = options.platform ?? process.platform;
|
|
110
110
|
const probe = options.probe ?? probeEngine;
|
|
111
111
|
const flagOn = coreNextEnabled(env);
|
|
112
|
-
const killedBy = coreNextKillReason(home, env);
|
|
113
112
|
const probed = new Map();
|
|
114
113
|
const capabilities = (engine) => {
|
|
115
114
|
let found = probed.get(engine);
|
|
@@ -144,7 +143,9 @@ export function hostCoreResults(root, options = {}) {
|
|
|
144
143
|
return { status: 'PASS', reason: `the new core has ${REQUIRED_EVALUATORS[event].join(', ')}` };
|
|
145
144
|
};
|
|
146
145
|
/** Old-dispatcher hooks for `event` on `host` that the engine's report does not cover. */
|
|
147
|
-
const uncovered = (caps, host, event) => host === 'antigravity'
|
|
146
|
+
const uncovered = (caps, host, event) => host === 'antigravity'
|
|
147
|
+
? (event === 'Stop' ? (() => { const hold = stopCompatibilityHold(root, env); return hold ? [`(native Stop compatibility: ${hold})`] : []; })() : [])
|
|
148
|
+
: uncoveredHooks(root, host, event, caps.covers, env);
|
|
148
149
|
const listed = (hooks) => (hooks.length > 6 ? `${hooks.slice(0, 6).join(', ')} and ${hooks.length - 6} more` : hooks.join(', '));
|
|
149
150
|
/**
|
|
150
151
|
* Why an event of `<root>/.claude/settings.json` stays on master-hook.sh for
|
|
@@ -159,8 +160,6 @@ export function hostCoreResults(root, options = {}) {
|
|
|
159
160
|
const oldCore = (event, host, scope) => {
|
|
160
161
|
if (!flagOn)
|
|
161
162
|
return { status: 'PASS', reason: `flag ${CORE_NEXT_FLAG} is off` };
|
|
162
|
-
if (killedBy)
|
|
163
|
-
return { status: 'PASS', reason: `the kill switch is on (${killedBy})` };
|
|
164
163
|
if (platform === 'win32')
|
|
165
164
|
return { status: 'PASS', reason: 'Windows keeps the old registration until US-022' };
|
|
166
165
|
if (!REQUIRED_EVALUATORS[event])
|
|
@@ -237,11 +236,8 @@ export function hostCoreResults(root, options = {}) {
|
|
|
237
236
|
// the engine must do every hook the old dispatcher runs for it here.
|
|
238
237
|
const shell = kinds.filter((k) => k !== 'new-core');
|
|
239
238
|
let verdict;
|
|
240
|
-
if (
|
|
241
|
-
verdict = { status: 'FAIL', reason: `the
|
|
242
|
-
}
|
|
243
|
-
else if (shell.length > 0) {
|
|
244
|
-
verdict = { status: 'FAIL', reason: `registered to the new core beside the ${shell.map((k) => label(k, target.host)).join(', ')}, so both run and the kill switch would run the old dispatcher twice` };
|
|
239
|
+
if (shell.length > 0) {
|
|
240
|
+
verdict = { status: 'FAIL', reason: `registered to the new core beside the ${shell.map((k) => label(k, target.host)).join(', ')}, so both run` };
|
|
245
241
|
}
|
|
246
242
|
else if (all.filter((k) => k === 'new-core').length > 1) {
|
|
247
243
|
verdict = { status: 'WARN', reason: 'registered to the new core more than once, so its checks run twice' };
|
|
@@ -251,8 +247,11 @@ export function hostCoreResults(root, options = {}) {
|
|
|
251
247
|
verdict = newCore(event, engine);
|
|
252
248
|
const caps = verdict.status === 'PASS' && engine ? capabilities(engine) : undefined;
|
|
253
249
|
const left = caps && !(caps instanceof Error) ? uncovered(caps, target.host, event) : [];
|
|
254
|
-
if (left.length > 0)
|
|
255
|
-
verdict =
|
|
250
|
+
if (left.length > 0) {
|
|
251
|
+
verdict = target.host === 'antigravity'
|
|
252
|
+
? { status: 'FAIL', reason: `the new core does not cover ${listed(left)}, so Stop refuses every turn; run hq reindex to remove the Stop registration` }
|
|
253
|
+
: { status: 'FAIL', reason: `the new core does not cover ${listed(left)}, so they do not run; run hq reindex to put this event back on the old dispatcher` };
|
|
254
|
+
}
|
|
256
255
|
const held = verdict.status === 'PASS' && caps && !(caps instanceof Error) && target.host === 'claude' && target.scope === 'project' ? adapterHold(caps, event) : null;
|
|
257
256
|
if (held)
|
|
258
257
|
verdict = { status: 'FAIL', reason: `registered to the new core while ${held}, so that adapter finds no master record for it; run hq reindex to put this event back on master-hook.sh` };
|
|
@@ -294,7 +293,7 @@ export function hostCoreResults(root, options = {}) {
|
|
|
294
293
|
message: `${target.host} (${target.scope}): ${summary}`,
|
|
295
294
|
details: { ...(cores.length === 1 ? { core: cores[0] } : {}), cores, events },
|
|
296
295
|
...(failed.length > 0
|
|
297
|
-
? { remediation: `Run hq reindex: it puts ${failed.join(', ')} back on the old dispatcher when the new core cannot take them, or repairs the ${STABLE_LINK_NAME} link. It also puts an event back on the old dispatcher when the new core no longer covers every hook the old dispatcher runs for it
|
|
296
|
+
? { remediation: `Run hq reindex: it puts ${failed.join(', ')} back on the old dispatcher when the new core cannot take them, or repairs the ${STABLE_LINK_NAME} link. It also puts an event back on the old dispatcher when the new core no longer covers every hook the old dispatcher runs for it and leaves one registration per event. Until then those events run no HQ hook, a new core without their guards, hooks twice, or none of the hooks the new core does not cover.` }
|
|
298
297
|
: mixed.length > 0
|
|
299
298
|
? { remediation: 'Run hq reindex to leave one HQ registration per event.' }
|
|
300
299
|
: {}),
|
|
@@ -311,36 +310,12 @@ function eventEntries(doc, host) {
|
|
|
311
310
|
return [];
|
|
312
311
|
return Object.entries(hooks).map(([event, groups]) => [event, hookEntries({ hooks: { [event]: groups } })]);
|
|
313
312
|
}
|
|
314
|
-
/** Flag
|
|
313
|
+
/** Flag state, shown once. */
|
|
315
314
|
export function coreSwitchResult(options = {}) {
|
|
316
315
|
const env = options.env ?? process.env;
|
|
317
|
-
const home = options.home ?? env.HOME ?? os.homedir();
|
|
318
316
|
const on = coreNextEnabled(env);
|
|
319
|
-
const killedBy = [
|
|
320
|
-
/^(off|0|false|no)$/i.test((env[CORE_NEXT_KILL_ENV] ?? '').trim()) ? `${CORE_NEXT_KILL_ENV}=${env[CORE_NEXT_KILL_ENV]}` : '',
|
|
321
|
-
/^off$/i.test((env[ENGINE_KILL_ENV] ?? '').trim()) ? `${ENGINE_KILL_ENV}=${env[ENGINE_KILL_ENV]}` : '',
|
|
322
|
-
exists(path.join(home, CORE_NEXT_KILL_FILE)) ? path.join(home, CORE_NEXT_KILL_FILE) : '',
|
|
323
|
-
exists(path.join(home, ENGINE_KILL_FILE)) ? path.join(home, ENGINE_KILL_FILE) : '',
|
|
324
|
-
].filter(Boolean);
|
|
325
317
|
const flag = `flag ${CORE_NEXT_FLAG} is ${on ? 'on' : 'off'}`;
|
|
326
|
-
|
|
327
|
-
? `; kill switch on (${killedBy.join(', ')}): new-core registrations hand each event to the old dispatcher, and hq reindex removes them`
|
|
328
|
-
: '';
|
|
329
|
-
// The engine reads the kill switch from each hook's own environment; this
|
|
330
|
-
// check and hq reindex read it from theirs.
|
|
331
|
-
const hostEnv = on || killedBy.length
|
|
332
|
-
? `. ${CORE_NEXT_KILL_ENV} or ${ENGINE_KILL_ENV} set only in a host's environment (for example Claude Code settings env) is honored by the engine at run time only; hq reindex and this check do not see it, so use the file ${path.join('~', CORE_NEXT_KILL_FILE)} to switch the registrations back`
|
|
333
|
-
: '';
|
|
334
|
-
return { status: 'PASS', checkId: 'host-core:switch', message: `${flag}${kill}${hostEnv}`, details: { flag: on, killSwitch: killedBy } };
|
|
335
|
-
}
|
|
336
|
-
function exists(file) {
|
|
337
|
-
try {
|
|
338
|
-
fs.lstatSync(file);
|
|
339
|
-
return true;
|
|
340
|
-
}
|
|
341
|
-
catch {
|
|
342
|
-
return false;
|
|
343
|
-
}
|
|
318
|
+
return { status: 'PASS', checkId: 'host-core:switch', message: flag, details: { flag: on } };
|
|
344
319
|
}
|
|
345
320
|
/** The family `hq doctor` prints. */
|
|
346
321
|
export async function hostCoreFamily(context, options = {}) {
|
|
@@ -24,6 +24,8 @@ export declare function lastProcessStartFailure(): ProcessStartFailure | null;
|
|
|
24
24
|
export declare function resetProcessStartTimeCache(): void;
|
|
25
25
|
/** The fixed POSIX locations of `ps`, tried in order. */
|
|
26
26
|
export declare const POSIX_PS_PATHS: readonly string[];
|
|
27
|
+
/** Timeout for the Windows PowerShell process-start-time probe (cold CLR start can exceed 10s under load). */
|
|
28
|
+
export declare const WINDOWS_PROCESS_START_TIMEOUT_MS = 30000;
|
|
27
29
|
/**
|
|
28
30
|
* The absolute path of the system tool that reads a process start time, found
|
|
29
31
|
* at a fixed location and never through PATH, so the answer is the same on
|
|
@@ -18,6 +18,8 @@ export function resetProcessStartTimeCache() {
|
|
|
18
18
|
}
|
|
19
19
|
/** The fixed POSIX locations of `ps`, tried in order. */
|
|
20
20
|
export const POSIX_PS_PATHS = ["/bin/ps", "/usr/bin/ps"];
|
|
21
|
+
/** Timeout for the Windows PowerShell process-start-time probe (cold CLR start can exceed 10s under load). */
|
|
22
|
+
export const WINDOWS_PROCESS_START_TIMEOUT_MS = 30_000;
|
|
21
23
|
function defaultIsExecutable(platform) {
|
|
22
24
|
return (file) => {
|
|
23
25
|
try {
|
|
@@ -85,11 +87,12 @@ export function processStartTime(pid, probe = {}) {
|
|
|
85
87
|
try {
|
|
86
88
|
const result = platform === "win32"
|
|
87
89
|
? runSpawn(tool, [
|
|
90
|
+
"-NoLogo",
|
|
88
91
|
"-NoProfile",
|
|
89
92
|
"-NonInteractive",
|
|
90
93
|
"-Command",
|
|
91
|
-
`(
|
|
92
|
-
], { encoding: "utf8", timeout:
|
|
94
|
+
`[System.Diagnostics.Process]::GetProcessById(${pid}).StartTime.ToUniversalTime().ToString('o')`,
|
|
95
|
+
], { encoding: "utf8", timeout: WINDOWS_PROCESS_START_TIMEOUT_MS, windowsHide: true })
|
|
93
96
|
: runSpawn(tool, ["-o", "lstart=", "-p", String(pid)], { encoding: "utf8", timeout: 5_000 });
|
|
94
97
|
const text = (result.stdout ?? "").trim();
|
|
95
98
|
if (result.status === 0 && text) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CoreNextHost, type CoreNextTarget } from '../../utils/host-registration.js';
|
|
2
2
|
/** Stands for the hook list when it cannot be read; never covered. */
|
|
3
3
|
export declare const UNREADABLE = "(the old dispatcher hook list could not be read)";
|
|
4
4
|
/** One item of a Git config file as git 2.50 reads it: a section header, or a variable under the last one. */
|
|
@@ -166,6 +166,15 @@ export declare function coversKey(key: string): {
|
|
|
166
166
|
* order, each id once. The same as covers_hosts.rs `claims_on`.
|
|
167
167
|
*/
|
|
168
168
|
export declare function coveredOn(covers: Readonly<Record<string, readonly string[]>> | undefined, event: string, host: CoreNextHost): string[];
|
|
169
|
+
/**
|
|
170
|
+
* True for a post-US-027 native-only HQ root, keyed on the core version
|
|
171
|
+
* declared in `core/core.yaml` (`hookDispatcherVersion >= 2` or `hqVersion`
|
|
172
|
+
* major `>= 17`) rather than on the absence of retired files on disk (which
|
|
173
|
+
* `hq rescue` may leave behind before cleanup). `hq reindex` still enforces
|
|
174
|
+
* `shellHooks` against `COVERS` for custom hooks, but skips sha256 pin holds
|
|
175
|
+
* for deleted bash dispatchers and adapters.
|
|
176
|
+
*/
|
|
177
|
+
export declare function isNativeOnlyCoreRoot(root: string): boolean;
|
|
169
178
|
/** The old dispatcher's hooks for `event` on `host` that the engine does not cover. */
|
|
170
179
|
export declare function uncoveredHooks(root: string, host: CoreNextHost, event: string, covers: Readonly<Record<string, readonly string[]>> | undefined, env?: NodeJS.ProcessEnv): string[];
|
|
171
180
|
/**
|
|
@@ -26,15 +26,28 @@
|
|
|
26
26
|
import { createHash } from 'node:crypto';
|
|
27
27
|
import * as fs from 'node:fs';
|
|
28
28
|
import * as path from 'node:path';
|
|
29
|
+
import { isShippedPortableClaudeCommand } from '../../utils/host-registration.js';
|
|
29
30
|
import { isCoreNextEntry } from './registration.js';
|
|
30
31
|
import { CLASSIFYING_ADAPTER_CORE_SHA256, RELEASED_CLASSIFYING_ADAPTER_CORE_SHA256 } from './adapter-core-pin.js';
|
|
32
|
+
const CRATE_POLICY_FALLBACKS = {
|
|
33
|
+
'native-precompact-compatibility.json': '../../../crates/hq-hook/src/stop/precompact/native-precompact-compatibility.json',
|
|
34
|
+
};
|
|
31
35
|
/**
|
|
32
36
|
* Read a policy file that ships beside this module (src/ and dist/ alike; scripts/copy-schemas.mjs copies
|
|
33
37
|
* them to dist/). Not a JSON import: import attributes need Node 20.10, and `engines` allows Node 20.0, where
|
|
34
38
|
* the attribute syntax is a SyntaxError that stops the whole CLI from loading (Sentry HQ-CLI-HZ).
|
|
35
39
|
*/
|
|
36
40
|
function readPolicy(name) {
|
|
37
|
-
|
|
41
|
+
const local = new URL(`./${name}`, import.meta.url);
|
|
42
|
+
if (fs.existsSync(local))
|
|
43
|
+
return JSON.parse(fs.readFileSync(local, 'utf8'));
|
|
44
|
+
const fallback = CRATE_POLICY_FALLBACKS[name];
|
|
45
|
+
if (fallback) {
|
|
46
|
+
const crateCopy = new URL(fallback, import.meta.url);
|
|
47
|
+
if (fs.existsSync(crateCopy))
|
|
48
|
+
return JSON.parse(fs.readFileSync(crateCopy, 'utf8'));
|
|
49
|
+
}
|
|
50
|
+
return JSON.parse(fs.readFileSync(local, 'utf8'));
|
|
38
51
|
}
|
|
39
52
|
const stopCompatibility = readPolicy('native-stop-compatibility.json');
|
|
40
53
|
const gitStopConfig = readPolicy('git-stop-config.json');
|
|
@@ -1547,9 +1560,12 @@ export function shellHooks(root, host, event) {
|
|
|
1547
1560
|
for (const group of Array.isArray(registered) ? registered : []) {
|
|
1548
1561
|
for (const entry of Array.isArray(group?.hooks) ? group.hooks : []) {
|
|
1549
1562
|
const command = entry?.command;
|
|
1550
|
-
// HQ's own entry for the event (master-hook,
|
|
1551
|
-
// new-core entry that took its place) is the dispatcher counted above.
|
|
1552
|
-
if (typeof command !== 'string'
|
|
1563
|
+
// HQ's own entry for the event (master-hook, shipped portable hq-hook,
|
|
1564
|
+
// or the Claude Code new-core entry that took its place) is the dispatcher counted above.
|
|
1565
|
+
if (typeof command !== 'string'
|
|
1566
|
+
|| command.includes('master-hook.sh')
|
|
1567
|
+
|| (!Array.isArray(entry.args) && isShippedPortableClaudeCommand(command, event))
|
|
1568
|
+
|| isCoreNextEntry(entry, root))
|
|
1553
1569
|
continue;
|
|
1554
1570
|
out.push(`settings:${command}`);
|
|
1555
1571
|
}
|
|
@@ -1674,6 +1690,55 @@ export function coveredOn(covers, event, host) {
|
|
|
1674
1690
|
}
|
|
1675
1691
|
return out;
|
|
1676
1692
|
}
|
|
1693
|
+
function coreYamlU32(text, key) {
|
|
1694
|
+
for (const raw of text.split(/\r?\n/)) {
|
|
1695
|
+
const line = raw.split('#')[0]?.trim() ?? '';
|
|
1696
|
+
if (!line.startsWith(`${key}:`))
|
|
1697
|
+
continue;
|
|
1698
|
+
const val = line.slice(key.length + 1).trim().replace(/^["']|["']$/g, '');
|
|
1699
|
+
if (/^\d+$/.test(val))
|
|
1700
|
+
return Number.parseInt(val, 10);
|
|
1701
|
+
}
|
|
1702
|
+
return null;
|
|
1703
|
+
}
|
|
1704
|
+
function coreYamlHqMajor(text) {
|
|
1705
|
+
for (const raw of text.split(/\r?\n/)) {
|
|
1706
|
+
const line = raw.split('#')[0]?.trim() ?? '';
|
|
1707
|
+
if (!line.startsWith('hqVersion:'))
|
|
1708
|
+
continue;
|
|
1709
|
+
const val = line.slice('hqVersion:'.length).trim().replace(/^["']|["']$/g, '').replace(/^v/, '');
|
|
1710
|
+
const match = /^(\d+)\./.exec(val);
|
|
1711
|
+
if (match)
|
|
1712
|
+
return Number.parseInt(match[1], 10);
|
|
1713
|
+
}
|
|
1714
|
+
return null;
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* True for a post-US-027 native-only HQ root, keyed on the core version
|
|
1718
|
+
* declared in `core/core.yaml` (`hookDispatcherVersion >= 2` or `hqVersion`
|
|
1719
|
+
* major `>= 17`) rather than on the absence of retired files on disk (which
|
|
1720
|
+
* `hq rescue` may leave behind before cleanup). `hq reindex` still enforces
|
|
1721
|
+
* `shellHooks` against `COVERS` for custom hooks, but skips sha256 pin holds
|
|
1722
|
+
* for deleted bash dispatchers and adapters.
|
|
1723
|
+
*/
|
|
1724
|
+
export function isNativeOnlyCoreRoot(root) {
|
|
1725
|
+
const coreYamlPath = path.join(root, 'core', 'core.yaml');
|
|
1726
|
+
if (!regularFile(coreYamlPath) || !regularFile(path.join(root, '.claude', 'hooks', 'hook-registry.json'))) {
|
|
1727
|
+
return false;
|
|
1728
|
+
}
|
|
1729
|
+
let text;
|
|
1730
|
+
try {
|
|
1731
|
+
text = fs.readFileSync(coreYamlPath, 'utf8');
|
|
1732
|
+
}
|
|
1733
|
+
catch {
|
|
1734
|
+
return false;
|
|
1735
|
+
}
|
|
1736
|
+
const dispatcherVersion = coreYamlU32(text, 'hookDispatcherVersion');
|
|
1737
|
+
if (dispatcherVersion !== null && dispatcherVersion >= 2)
|
|
1738
|
+
return true;
|
|
1739
|
+
const major = coreYamlHqMajor(text);
|
|
1740
|
+
return major !== null && major >= 17;
|
|
1741
|
+
}
|
|
1677
1742
|
/** The old dispatcher's hooks for `event` on `host` that the engine does not cover. */
|
|
1678
1743
|
export function uncoveredHooks(root, host, event, covers, env = process.env) {
|
|
1679
1744
|
const hooks = shellHooks(root, host, event);
|
|
@@ -1681,6 +1746,8 @@ export function uncoveredHooks(root, host, event, covers, env = process.env) {
|
|
|
1681
1746
|
return [UNREADABLE];
|
|
1682
1747
|
const covered = coveredOn(covers, event, host);
|
|
1683
1748
|
const missing = hooks.filter((hook) => !covered.some((claim) => claimCovers(claim, hook)));
|
|
1749
|
+
if (isNativeOnlyCoreRoot(root))
|
|
1750
|
+
return missing;
|
|
1684
1751
|
if (event === 'Stop' && covered.includes('master-hook:Stop')) {
|
|
1685
1752
|
const hold = stopCompatibilityHold(root, env);
|
|
1686
1753
|
if (hold)
|
|
@@ -1854,7 +1921,7 @@ export const SESSION_START_PINS = [
|
|
|
1854
1921
|
['core/scripts/hqd-hook-flag-cache-lib.sh', ['061d264460408e9eaf43fdf0fdde662c906a9a7dacb4e7a591e684bca28c138a']],
|
|
1855
1922
|
['core/scripts/hq-session.sh', ['db701162f71b53fd2188974d2f46c58250593dde1252d65b36e6d02b9a765fe7', '02a37c5dbf4fb5af27cc64d0f271121e990758b757a479f60e9ce099f4d65ded', 'd4d4aef60ff8b095e3abcc817598f376d3c2de8d59758c3ed6dd40d4aa4b11fb']],
|
|
1856
1923
|
['core/scripts/lib/session-id.sh', ['2ebbc50893c7c601a111b9e8f9945afeac88f552d7caeec09c4096f4c27a833d', 'd6a04155571ec53edd853878cebaba5a5bab93801a73e356499440c1cd009c71']],
|
|
1857
|
-
['core/scripts/lib/session-scope-capability.sh', ['388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead']],
|
|
1924
|
+
['core/scripts/lib/session-scope-capability.sh', ['388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead', '498ffa6e4342c79eecb0c1fddec56ba03e169bb627b2da8f8ef2f09f55954b38']],
|
|
1858
1925
|
['core/scripts/resolve-company.sh', ['00d6fa069f574a86087c77daa44887a2617446d4300d5daebecc9bfb5d81abe7']],
|
|
1859
1926
|
];
|
|
1860
1927
|
/**
|
|
@@ -1956,7 +2023,7 @@ export const FLEET_LOCAL_PRE_TOOL_USE_PINS = [
|
|
|
1956
2023
|
],
|
|
1957
2024
|
missing: 'allowed',
|
|
1958
2025
|
},
|
|
1959
|
-
{ relative: 'core/scripts/lib/session-scope-capability.sh', accepted: ['388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead'], missing: 'allowed' },
|
|
2026
|
+
{ relative: 'core/scripts/lib/session-scope-capability.sh', accepted: ['388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead', '498ffa6e4342c79eecb0c1fddec56ba03e169bb627b2da8f8ef2f09f55954b38'], missing: 'allowed' },
|
|
1960
2027
|
];
|
|
1961
2028
|
/**
|
|
1962
2029
|
* Why fleet-local PreToolUse must stay on the shell adapter in `root`: a present file of
|
|
@@ -2196,7 +2263,7 @@ export const PRE_TOOL_USE_DISPATCHER_PINS = [
|
|
|
2196
2263
|
{ relative: 'core/scripts/lib/epochrealtime.sh', accepted: ['4c9205520dba31533c95eea145f6068ba626885c342c2aa1f232a7237d046cdf'] },
|
|
2197
2264
|
{ relative: 'core/scripts/lib/perl-child-locale.sh', accepted: ['18e6b9d0e22874eea00ecc868b4dcfebbc3bb42434d8d0c81b20baec1194df2e'] },
|
|
2198
2265
|
{ relative: 'core/scripts/lib/session-id.sh', accepted: ['2ebbc50893c7c601a111b9e8f9945afeac88f552d7caeec09c4096f4c27a833d', 'd6a04155571ec53edd853878cebaba5a5bab93801a73e356499440c1cd009c71'] },
|
|
2199
|
-
{ relative: 'core/scripts/lib/session-scope-capability.sh', accepted: ['388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead'] },
|
|
2266
|
+
{ relative: 'core/scripts/lib/session-scope-capability.sh', accepted: ['388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead', '498ffa6e4342c79eecb0c1fddec56ba03e169bb627b2da8f8ef2f09f55954b38'] },
|
|
2200
2267
|
{ relative: 'core/scripts/resolve-hq-root.sh', accepted: ['188e99c7c60bc9909290a666d6f3b93387ae6cf68f2eeb41fd24c2dea62a5240'] },
|
|
2201
2268
|
];
|
|
2202
2269
|
/**
|
|
@@ -2617,7 +2684,7 @@ export const PROMPT_COMPANY_BIND_PINS = [
|
|
|
2617
2684
|
},
|
|
2618
2685
|
{ relative: 'core/scripts/hq-session.sh', accepted: ['db701162f71b53fd2188974d2f46c58250593dde1252d65b36e6d02b9a765fe7', '02a37c5dbf4fb5af27cc64d0f271121e990758b757a479f60e9ce099f4d65ded', 'd4d4aef60ff8b095e3abcc817598f376d3c2de8d59758c3ed6dd40d4aa4b11fb'] },
|
|
2619
2686
|
{ relative: 'core/scripts/lib/session-id.sh', accepted: ['2ebbc50893c7c601a111b9e8f9945afeac88f552d7caeec09c4096f4c27a833d', 'd6a04155571ec53edd853878cebaba5a5bab93801a73e356499440c1cd009c71'] },
|
|
2620
|
-
{ relative: 'core/scripts/lib/session-scope-capability.sh', accepted: ['388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead'] },
|
|
2687
|
+
{ relative: 'core/scripts/lib/session-scope-capability.sh', accepted: ['388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead', '498ffa6e4342c79eecb0c1fddec56ba03e169bb627b2da8f8ef2f09f55954b38'] },
|
|
2621
2688
|
];
|
|
2622
2689
|
/**
|
|
2623
2690
|
* Why UserPromptSubmit must stay on the shell registration in `root`: the native
|
|
@@ -2720,7 +2787,7 @@ export function postToolUseAdapterHold(root, host) {
|
|
|
2720
2787
|
return null;
|
|
2721
2788
|
}
|
|
2722
2789
|
/** The session-scope-capability.sh master-hook's Task-agent pin is modelled on (crates/hq-hook/src/scope/session.rs `SUBAGENT_PIN_LIB_SHA256`). */
|
|
2723
|
-
export const SUBAGENT_SCOPE_LIBRARY = { relative: 'core/scripts/lib/session-scope-capability.sh', accepted: ['388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead'] };
|
|
2790
|
+
export const SUBAGENT_SCOPE_LIBRARY = { relative: 'core/scripts/lib/session-scope-capability.sh', accepted: ['388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead', '498ffa6e4342c79eecb0c1fddec56ba03e169bb627b2da8f8ef2f09f55954b38'] };
|
|
2724
2791
|
/**
|
|
2725
2792
|
* Why SubagentStart or SubagentStop (`event`) must stay on the shell registration in `root`: the
|
|
2726
2793
|
* native master work (crates/hq-hook/src/lifecycle_master.rs `begin`) refuses every such event that
|
|
@@ -13,7 +13,7 @@ import * as fs from 'node:fs';
|
|
|
13
13
|
import * as path from 'node:path';
|
|
14
14
|
import { checkStableEngine, coreNextOffReason, capableEvents, probeEngine, missingEvaluators, resolveCoreNextEngine } from '../../utils/host-registration.js';
|
|
15
15
|
import { verifyHookEngine } from './resolve.js';
|
|
16
|
-
import { forHost, uncoveredHooks } from './coverage.js';
|
|
16
|
+
import { forHost, isNativeOnlyCoreRoot, uncoveredHooks } from './coverage.js';
|
|
17
17
|
import { quotePosix } from './registration.js';
|
|
18
18
|
export const FLEET_EVENTS = { pre_tool_call: 'PreToolUse', post_tool_call: 'PostToolUse', pre_llm_call: 'UserPromptSubmit', on_session_start: 'SessionStart', pre_verify: 'Stop', on_session_finalize: 'SessionEnd', subagent_stop: 'SubagentStop' };
|
|
19
19
|
/** Literal POSIX argv only. Never expands variables or executes shell syntax. */
|
|
@@ -171,15 +171,18 @@ export function fleetRegistrationPlan(root, fallbacks, options) {
|
|
|
171
171
|
caps = undefined;
|
|
172
172
|
}
|
|
173
173
|
const target = caps ? forHost({ coreNext: engine, events: capableEvents(caps), covers: caps.covers }, root, host, env) : null;
|
|
174
|
+
const nativeOnly = isNativeOnlyCoreRoot(root);
|
|
174
175
|
const events = {};
|
|
175
176
|
for (const [event, canonical] of Object.entries(FLEET_EVENTS)) {
|
|
176
177
|
const fallback = fallbacks[event] ?? [];
|
|
177
178
|
if (!Array.isArray(fallback) || !fallback.every(arg => typeof arg === 'string'))
|
|
178
179
|
throw new Error(`${event}: fallback must be an argv vector`);
|
|
179
|
-
const problem = fallbackProblem(fallback, host, event);
|
|
180
|
+
const problem = nativeOnly && fallback.length === 0 ? null : fallbackProblem(fallback, host, event);
|
|
180
181
|
const covered = !reason && !problem && target?.events.includes(canonical);
|
|
181
|
-
const nativeArgv =
|
|
182
|
-
|
|
182
|
+
const nativeArgv = fallback.length > 0
|
|
183
|
+
? [engine, 'run', '--host', host, event, '--hq-root', root, '--fleet-fallback', JSON.stringify(fallback)]
|
|
184
|
+
: [engine, 'run', '--host', host, event, '--hq-root', root];
|
|
185
|
+
const handBack = covered && caps && fallback.length > 0 ? engineHandBack(caps, nativeArgv, env, options.handBackQuery) : null;
|
|
183
186
|
const native = covered && !handBack;
|
|
184
187
|
const argv = native ? nativeArgv : fallback;
|
|
185
188
|
const why = native ? 'complete evaluator and hook coverage' : handBack ?? reason ?? problem ?? (caps && missingEvaluators(caps, canonical)?.length ? 'required evaluators are missing' : `uncovered hooks: ${uncoveredHooks(root, host, canonical, caps?.covers, env).join(', ')}`);
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"1b082635f2166ca668fe8f8ad180e1c8dc6e3517f5657beece68056200219350",
|
|
22
22
|
"5a74d090475b7112f1013f1f11b777dd9cff9032608030d3ab004e56567b5b3d",
|
|
23
23
|
"7ac8365fa95474b2003caa1ff8bed07c88e18abc4d4cbae041f0249dd826a70c",
|
|
24
|
+
"825dd3fbbe6ddbf699d2cc50fb313313dc286e06255904cb5c14c2f99c3eb51f",
|
|
24
25
|
"afdc525b83ad443ca3cbafd650746599f702748b9d01e1e6c34f747fb5e098ae",
|
|
25
26
|
"bc8ddf7a648832db6314a989a7c26355f59909cbbcb001c553c6150f072623e8",
|
|
26
27
|
"ca4f0c5cf4c1de34e90f8e3e3114a025958fa78905c569b3a780cca0506e71f8",
|
|
@@ -160,6 +161,7 @@
|
|
|
160
161
|
],
|
|
161
162
|
".claude/hooks/hook-timeout-probe.sh": [
|
|
162
163
|
"167003cbe1207144572365d78dbca4e285d5889885d1332b99c58081035c24be",
|
|
164
|
+
"3529d40c72f5da406ec324f5a37546ce8755da4f0889dacfdb496c7adb3bd2e7",
|
|
163
165
|
"3c5716f75fa21f238e19ff82f57181dbd1501e7bf2b0628416173ca694ab2e5d",
|
|
164
166
|
"3c72f4b8610beabbd43f96cad1752e50f94a91ed9f7706bbd91ed85c106e2faf",
|
|
165
167
|
"51762806ca5d2cef64c654c3b8a19a92abc95e69da19e4e5156dc43ad0f7bda3",
|
|
@@ -208,6 +210,7 @@
|
|
|
208
210
|
"baae190dc352bc85e1d452027d46b7a0703f8dc56a9c496adedbd7a767b3c8ce",
|
|
209
211
|
"cb03a3e05f90ab95c5152c29ea6361528d63d1e3eb66aea11df80dfac3d41d61",
|
|
210
212
|
"d89b30e5c8017b68db1d093c91dd9aa6a00605855a3eb94fc311b8f729e13833",
|
|
213
|
+
"da5296ec24dece22b694c406d5a5a4aa53b0491110c4fd1779ed25d9ea2daebe",
|
|
211
214
|
"e6d7b86b58a0d325938817d4318a6fbebdcd153ce680398514451c6684f781b0",
|
|
212
215
|
"e750ab8b96cefcac007088f1fb583ff56af8a1169666656518b862296a149f0c",
|
|
213
216
|
"e8f2f3d22d44b1909e3b1fe9e10d023d273bc2f856ded9fea76b6f3a9c52f9c2",
|
|
@@ -296,7 +299,8 @@
|
|
|
296
299
|
"e2286d05303df29a656ea71ed160385d669c4e47c1dc168c349d660e18a17dc2",
|
|
297
300
|
"efc23d2ccbfad6b70580617a7f5bb4e1e314a41bcee5c5a251c094b54cd07fbc",
|
|
298
301
|
"f8591f1728b4ec848fd3455032c09dcd66a1e7813a7910c99b0cae3f7fcf96d0",
|
|
299
|
-
"f8f2e3dd853332fd009bb0836c81c717a2892ed71ee94150427290dd4c8ab57f"
|
|
302
|
+
"f8f2e3dd853332fd009bb0836c81c717a2892ed71ee94150427290dd4c8ab57f",
|
|
303
|
+
"fab0ada24e4ac09e05eb5293a795f7f2bde4d58b47ac5112bfc8a5ad4900eda5"
|
|
300
304
|
],
|
|
301
305
|
"core/scripts/lib/session-scope-capability.sh": [
|
|
302
306
|
"038670d6973a1dc14da63b742a7c90c47a032916e8c8d072147456977da1a298",
|
|
@@ -305,6 +309,7 @@
|
|
|
305
309
|
"148375c67f8cc7d059f6eb36ec507f8f3f3cb05cad2f81229748fb20af21755b",
|
|
306
310
|
"3194d664e3840dcbf48a2d5681feb7cd299bd6f60d296337c70d8042d60886c2",
|
|
307
311
|
"388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead",
|
|
312
|
+
"498ffa6e4342c79eecb0c1fddec56ba03e169bb627b2da8f8ef2f09f55954b38",
|
|
308
313
|
"5d4c619a55db0de6ff210a3aa0e99aa92fb5795a3290dcfcafc141e3ad3894b6",
|
|
309
314
|
"743d9438922f0bcc29f09b38f159b4fd686cc2ba15390602ef7b7f1d8db9ac26",
|
|
310
315
|
"9ea044084200e5f2d1f47477ffeaf591a87b406e9bf48c8fd6e24c551c799fc1",
|
|
@@ -342,6 +347,7 @@
|
|
|
342
347
|
"1ca40fbd5a58474ab801384becdd5c58340adf8d5c678d41fd7b867aa06136c4",
|
|
343
348
|
"1e38462b0ee9075da598da7bf8589238bf4884b8433ee391f1278ea82f8fe8dc",
|
|
344
349
|
"3017517bbcd618be5162c621105c229aeba66fea1c39f6dd744416029f0448b5",
|
|
350
|
+
"32c5c8d50cae02e8850bf08bfbd7ff4b614fa178902b27dfb342ac210a9ef7ab",
|
|
345
351
|
"5f116978283ba812ba72290736af767dbf41e9b80f7985d919f23d185c4eb17d",
|
|
346
352
|
"70d56899659145c75024138919043b8f0a77c1ec6c3949ae97f66a5cbf582e4b",
|
|
347
353
|
"81197d6c024845d955acab7d9a0a74e5a1a2fb54e3cfbd95f0bc15d846b4e3f6",
|
|
@@ -370,6 +376,7 @@
|
|
|
370
376
|
"8e54096bce6e3f2017e70264bef2e94c08024f26c6d917fc7c0ff285d50c36c4",
|
|
371
377
|
"ab289ac0af680fe3bcacb110302ca8b998bdc33c6f94321d42bd04a344163eed",
|
|
372
378
|
"c96c7c92dd4986de20a889e04a64aebe876791fbb5189beabbf6a2c14e6b435b",
|
|
379
|
+
"d1d7e7d0231131afc1a49547018207e9bf4df03808aca3fda8f25fedade15b2f",
|
|
373
380
|
"e15d5d0f94824748d0ab9ceff10c6c4e2a853cd7ed2452bf9e97f11efcb1c823",
|
|
374
381
|
"fb798116f1428e3c9a613947930874572c8556287d54470343ee33e6d9fa7854"
|
|
375
382
|
],
|
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
"f2d442586a1d09ddd79cb259253a773192fc17763d7cc6c1b586a86d4d7df787"
|
|
64
64
|
],
|
|
65
65
|
".claude/hooks/hq-autocommit-bash-sweep.sh": [
|
|
66
|
-
"01b9669c41dcdb438295aea52545ec9306b8ed8c83c30c7560798bdc06b50aed"
|
|
66
|
+
"01b9669c41dcdb438295aea52545ec9306b8ed8c83c30c7560798bdc06b50aed",
|
|
67
|
+
"4c3c104f2e22680f9cb0be442e44daba06c0c3c0aaf4918e87c73a06ec13a117"
|
|
67
68
|
],
|
|
68
69
|
".claude/hooks/checkpoint-stop-gate.sh": [
|
|
69
70
|
"1fc121ad2d0d3acfd13c8daee9215013d9a01bd1856aa716154739f18506c3ce"
|
|
@@ -100,14 +101,17 @@
|
|
|
100
101
|
"b373b582a906b0993a3ce56aa43c1ef0aec6668a6b7e150d59ef3214b7d65b70"
|
|
101
102
|
],
|
|
102
103
|
".claude/hooks/hq-autocommit-bash-flag.cjs": [
|
|
103
|
-
"419c65157c0167473ace808bacc7cb5902afa4336f8281f7e7f9c228d74a77a4"
|
|
104
|
+
"419c65157c0167473ace808bacc7cb5902afa4336f8281f7e7f9c228d74a77a4",
|
|
105
|
+
"absent"
|
|
104
106
|
],
|
|
105
107
|
".claude/hooks/hq-autocommit-failure-context-flag.cjs": [
|
|
106
|
-
"9e6fa4930830624fd588241b24315f6e6b5f3ae6778e8f61020bf237490ac30c"
|
|
108
|
+
"9e6fa4930830624fd588241b24315f6e6b5f3ae6778e8f61020bf237490ac30c",
|
|
109
|
+
"absent"
|
|
107
110
|
],
|
|
108
111
|
".claude/hooks/hq-autocommit.sh": [
|
|
109
112
|
"f7c01bc6de7f79e51eedc9806a7c903fdf0947e540ba226d1b37fc3667919304",
|
|
110
|
-
"66f5c09b16364e07c659c22d0b6c5519a05894918ea9d0749340023c00e231c2"
|
|
113
|
+
"66f5c09b16364e07c659c22d0b6c5519a05894918ea9d0749340023c00e231c2",
|
|
114
|
+
"dffe923274db253856fa34045e2aae5f58271f3d11202341ba7c22f2c368e04a"
|
|
111
115
|
],
|
|
112
116
|
".claude/hooks/lib/parse-estimates.pl": [
|
|
113
117
|
"absent"
|
|
@@ -116,7 +120,8 @@
|
|
|
116
120
|
"e7ae5c522075b8535672fc2c8642c220282aa5cd91a19accc1072aff304be63e"
|
|
117
121
|
],
|
|
118
122
|
".codex/hooks/codex-explicit-path-flag.cjs": [
|
|
119
|
-
"85e3c00b1f879bfc695c32714129d00554674bce7a139c4386d07f01a63ef83f"
|
|
123
|
+
"85e3c00b1f879bfc695c32714129d00554674bce7a139c4386d07f01a63ef83f",
|
|
124
|
+
"absent"
|
|
120
125
|
],
|
|
121
126
|
"core/hooks/SessionStart/35-work-mesh-session-start.sh": [
|
|
122
127
|
"865e5855c72c5ac0d503efbbc095a2d2835396418a12b20fa0ce3bd2f66d8d27",
|
|
@@ -124,7 +129,8 @@
|
|
|
124
129
|
"4ab85c27d7b78c7a4ccbf76b4f7e3e3ca6b4fdf14f09a63aac49d0c4dc44c8f1"
|
|
125
130
|
],
|
|
126
131
|
"core/scripts/board-project-id.sh": [
|
|
127
|
-
"b3c80668460c556267b06a0869e41e0088963ba2a709ac459d14bb8bd08252a7"
|
|
132
|
+
"b3c80668460c556267b06a0869e41e0088963ba2a709ac459d14bb8bd08252a7",
|
|
133
|
+
"6f623e9ba4886d35df2c9cd28414bb9fe5ddfa40fdefc456414aa9f68c7f3add"
|
|
128
134
|
],
|
|
129
135
|
"core/scripts/conduct-runner-resolve.sh": [
|
|
130
136
|
"1510f360bb6773206fb2bd2d07091c15c1018ee1910f992e60fa7df6d49c845b",
|
|
@@ -155,7 +161,8 @@
|
|
|
155
161
|
"core/scripts/hq-session.sh": [
|
|
156
162
|
"db701162f71b53fd2188974d2f46c58250593dde1252d65b36e6d02b9a765fe7",
|
|
157
163
|
"a0dd3e603c201150e6f2bf4de9f2d01c822978dcf40b3ed03a547a8f070da2de",
|
|
158
|
-
"e686c5a5a477d2640c4056122223d1cbf85e71c5dce965776c15dfee86232c6b"
|
|
164
|
+
"e686c5a5a477d2640c4056122223d1cbf85e71c5dce965776c15dfee86232c6b",
|
|
165
|
+
"02a37c5dbf4fb5af27cc64d0f271121e990758b757a479f60e9ce099f4d65ded"
|
|
159
166
|
],
|
|
160
167
|
"core/scripts/hqd-hook-flag-cache-lib.sh": [
|
|
161
168
|
"061d264460408e9eaf43fdf0fdde662c906a9a7dacb4e7a591e684bca28c138a"
|
|
@@ -189,7 +196,8 @@
|
|
|
189
196
|
"d6a04155571ec53edd853878cebaba5a5bab93801a73e356499440c1cd009c71"
|
|
190
197
|
],
|
|
191
198
|
"core/scripts/lib/session-scope-capability.sh": [
|
|
192
|
-
"388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead"
|
|
199
|
+
"388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead",
|
|
200
|
+
"498ffa6e4342c79eecb0c1fddec56ba03e169bb627b2da8f8ef2f09f55954b38"
|
|
193
201
|
],
|
|
194
202
|
"core/scripts/lib/transcript-tail.sh": [
|
|
195
203
|
"73eadafdd8e7c375bd12383947ac73c43e7dfe79b29e6553da1cb5b2746bb217"
|
|
@@ -209,6 +217,11 @@
|
|
|
209
217
|
"fdce833824a8e387a50f0dd3020f5c5c0535af6372242e391ab99518d2fa5fc4",
|
|
210
218
|
"b65670de9a5aa063f88694fb1cf44239725f0e71bd6245972aa093ef31f09114"
|
|
211
219
|
],
|
|
220
|
+
"core/scripts/setup-path-flag.cjs": [
|
|
221
|
+
"absent",
|
|
222
|
+
"7eb46bbcfeab9cf66a276c2ab2f0e452685e31c98c3d2a9c7f10a165509bee3d",
|
|
223
|
+
"c75e44c353549338dd09d76f5db7b71a3cdf076926b6dd36e55d1a8e59e54c8a"
|
|
224
|
+
],
|
|
212
225
|
"core/scripts/share-suggestion-state.sh": [
|
|
213
226
|
"d2a8ba30f7650b89f0ed221f840ef2c8e731b9df35d57e0f4576feadad6f7597"
|
|
214
227
|
]
|
|
@@ -217,7 +230,8 @@
|
|
|
217
230
|
".claude/hooks/hq-autocommit-bash-sweep.sh": [
|
|
218
231
|
".claude/hooks/hq-autocommit-bash-flag.cjs",
|
|
219
232
|
".claude/hooks/hq-autocommit.sh",
|
|
220
|
-
"core/scripts/lib/hook-stop-async.sh"
|
|
233
|
+
"core/scripts/lib/hook-stop-async.sh",
|
|
234
|
+
"core/scripts/setup-path-flag.cjs"
|
|
221
235
|
],
|
|
222
236
|
".claude/hooks/checkpoint-stop-gate.sh": [
|
|
223
237
|
"core/scripts/hq-hidden-run.sh"
|
|
@@ -260,7 +274,8 @@
|
|
|
260
274
|
"core/scripts/lib/work-mesh-enqueue.sh"
|
|
261
275
|
],
|
|
262
276
|
".claude/hooks/hq-autocommit.sh": [
|
|
263
|
-
".claude/hooks/hq-autocommit-failure-context-flag.cjs"
|
|
277
|
+
".claude/hooks/hq-autocommit-failure-context-flag.cjs",
|
|
278
|
+
"core/scripts/setup-path-flag.cjs"
|
|
264
279
|
],
|
|
265
280
|
".claude/hooks/hq-autocommit-bash-flag.cjs": [
|
|
266
281
|
"core/scripts/hq-session.sh"
|
|
@@ -306,7 +321,11 @@
|
|
|
306
321
|
],
|
|
307
322
|
"core/scripts/lib/session-scope-capability.sh": [
|
|
308
323
|
".codex/hooks/codex-explicit-path-flag.cjs",
|
|
309
|
-
"core/scripts/hqd-hook-flag-cache-lib.sh"
|
|
324
|
+
"core/scripts/hqd-hook-flag-cache-lib.sh",
|
|
325
|
+
"core/scripts/setup-path-flag.cjs"
|
|
326
|
+
],
|
|
327
|
+
"core/scripts/setup-path-flag.cjs": [
|
|
328
|
+
"core/scripts/hq-session.sh"
|
|
310
329
|
],
|
|
311
330
|
"core/scripts/lib/work-mesh-enqueue.sh": [
|
|
312
331
|
"core/scripts/lib/epochrealtime.sh"
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/** Every Claude Code project event that shipped a master-hook.sh entry in `.claude/settings.json`. */
|
|
2
|
+
export declare const PROJECT_CLAUDE_HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PreCompact", "Stop", "SessionStart", "UserPromptSubmit", "Notification", "SubagentStart", "SubagentStop", "SessionEnd"];
|
|
3
|
+
/** Every Codex project event that shipped a `[[hooks.<Event>]]` block in `.codex/config.toml`. */
|
|
4
|
+
export declare const PROJECT_CODEX_HOOK_EVENTS: ReadonlyArray<{
|
|
5
|
+
event: string;
|
|
6
|
+
matcher?: string;
|
|
7
|
+
timeout: number;
|
|
8
|
+
statusMessage: string;
|
|
9
|
+
}>;
|
|
1
10
|
export interface ReconcileResult {
|
|
2
11
|
/** Codex user-scope trust keys for the HQ entries in the global hooks.json. */
|
|
3
12
|
codexUserKeys: string[];
|
|
@@ -5,5 +14,5 @@ export interface ReconcileResult {
|
|
|
5
14
|
failures: string[];
|
|
6
15
|
}
|
|
7
16
|
/** Reconcile existing registrations only; reindex must not install a runtime. */
|
|
8
|
-
export declare function reconcileHookRegistrations(root: string, home?: string, env?: NodeJS.ProcessEnv, daemonInstalled?: boolean): ReconcileResult;
|
|
17
|
+
export declare function reconcileHookRegistrations(root: string, home?: string, env?: NodeJS.ProcessEnv, daemonInstalled?: boolean, platform?: NodeJS.Platform): ReconcileResult;
|
|
9
18
|
//# sourceMappingURL=reconcile.d.ts.map
|