@blundergoat/goat-flow
Version:
AI coding agent harness and local dashboard for Claude Code, OpenAI Codex, Google Antigravity, and GitHub Copilot - setup audits, guardrails, structured skills, deny hooks, and persistent learning loops.
55 lines • 3.05 kB
TypeScript
/**
* Reads each agent's hook config and reports which goat-flow guard hooks are
* registered, normalizing the many per-agent settings shapes (Claude, Antigravity,
* and others) into simple registered/path facts the audit can compare.
*
* Parsing is deliberately defensive: unknown agents, missing hook objects, and
* malformed entries resolve to "not registered" rather than throwing, because a
* fact extractor must survive any settings file a user hands it. Antigravity is
* special-cased - its deny hook lives in a top-level keyed definition with its own
* enabled flag, not under the shared `hooks` object.
*/
import type { AgentProfile, ReadonlyFS } from "../../types.js";
/**
* Resolve the parsed hook config for one agent, reusing the already-parsed
* settings file when the agent stores hooks there and only reading a separate
* file otherwise - this avoids parsing the same file twice.
*
* @param fs - read-only filesystem adapter used only when hooks live in a separate file
* @param agent - agent profile naming its settings and hook-config files
* @param settingsParsed - already-parsed settings content, reused when it doubles as the hook config
* @param settingsValid - whether that pre-parsed settings content parsed successfully
* @returns the parsed hook config and its validity; both default to null/false when the agent declares no hook file
*/
export declare function readHookConfig(fs: ReadonlyFS, agent: AgentProfile, settingsParsed: unknown, settingsValid: boolean): {
parsed: unknown;
valid: boolean;
};
/**
* Report whether the agent's post-turn (learning-loop) hook is registered and
* which script it points at. Returns the not-registered shape for agents that
* declare no hook events or whose config has no usable `hooks` object.
*
* @param agent - agent profile naming its post-turn hook event, if any
* @param hookConfigParsed - parsed hook config from readHookConfig, or null/invalid content
* @returns post-turn registration flag and resolved script path; path is null when not registered
*/
export declare function buildHookRegistration(agent: AgentProfile, hookConfigParsed: unknown): {
postTurnRegistered: boolean;
postTurnRegisteredPath: string | null;
};
/**
* Report whether the dangerous-command deny guard is registered as a pre-tool
* hook, and its script path. Antigravity is handled separately because its deny
* hook is a top-level keyed definition with its own `enabled` flag, so an
* explicit `enabled: false` there counts as not registered.
*
* @param agent - agent profile naming its pre-tool hook event and identifying Antigravity
* @param hookConfigParsed - parsed hook config from readHookConfig, or null/invalid content
* @returns deny registration flag and resolved script path; path is null when not registered or disabled
*/
export declare function buildDenyRegistration(agent: AgentProfile, hookConfigParsed: unknown): {
denyIsRegistered: boolean;
denyRegisteredPath: string | null;
};
//# sourceMappingURL=hook-registration.d.ts.map