/** * Agent enforcement logic for PreToolUse blocking. * * Ownership is decided statelessly from the PreToolUse payload: Claude Code * supplies `agent_type` (the editing agent's name) when an edit originates * inside a subagent, and omits it for the main thread. A specialist may edit * only the files it owns; anyone else is blocked from owned files. */ import type { EnforceResult, PreToolUseInput, SubagentHookInput } from './types.js'; /** * Pure, testable enforcement check. * Returns allow if the tool use should proceed, block with agent names if it should be denied. */ export declare function evaluateEnforce(input: PreToolUseInput, projectDir?: string, /** Override for grimoire.json lookup directory (defaults to projectDir). */ configDir?: string): EnforceResult; /** * Entry point for --enforce flag (PreToolUse hook). * Calls evaluateEnforce, writes block message to stdout, and exits. */ export declare function runEnforce(input: PreToolUseInput, logPath?: string): void; /** * Emits telemetry when a subagent is spawned (SubagentStart hook), and injects * the enforced-approach mandate as additionalContext when the agent has * approaches configured in grimoire.json — the sub-agent sees it before its * first prompt. Approaches being configured is the opt-in; no approaches means * exactly the old telemetry-only behavior. */ export declare function runSubagentStart(input: SubagentHookInput, logPath?: string): void; /** * Archives the finished subagent's transcript and emits telemetry * (SubagentStop hook). * * The stop payload omits `agent_type`, so the real type is recovered from the * sub-agent's meta.json (via `resolveAgentType`). A `cwd` is synthesized from * the project dir when the payload lacks one so the transcript can still be * located. Only agents with an editable local definition are tracked: built-ins * (Plan, Explore, general-purpose) and stops we can't attribute are skipped for * both archiving and telemetry — this is what kept the log free of empty * `agent_type` rows. */ export declare function runSubagentStop(input: SubagentHookInput, logPath?: string): void; //# sourceMappingURL=enforce.d.ts.map