/** * `peaks sub-agent-dispatch-guard` — G9.5 / RL-30 strict hook-only atom. * * This is the **second-layer** gate (PreToolUse hook) for the G9 forced * compression threshold. It re-validates the prompt size against the * threshold table in `src/services/context/threshold.ts` and returns * `{allow: true/false, reason, suggest}` JSON to the LLM platform. * * **NO `--force` flag is exposed at this layer** (RL-30 strict). The * hook is the strictest layer in the G9 chain. If the CLI is bypassed * (e.g. a user manually invokes the dispatch CLI with `--force` to * override the 80% threshold), the hook catches it and returns * `{allow: false}` regardless. * * This atom is **hidden from `peaks --help`** per dev-preference * "skill-first / CLI-auxiliary" + PB-2 byte-stable. It is registered * via the LLM platform's PreToolUse hook chain (e.g. Claude Code's * `settings.json` `PreToolUse` array) and is not a user-facing command. * * The `peaks hooks install` command reads `IdeAdapter.promptSizeAware` * to decide whether to register this hook for a given IDE. */ import type { Command } from 'commander'; import { type ContextGuardDecision } from '../../services/context/context-guard.js'; export declare const HOOK_GUARD_RESULT_TYPE: "peaks-hook-guard/v1"; export interface HookGuardResult { readonly schema: typeof HOOK_GUARD_RESULT_TYPE; readonly allow: boolean; readonly code: ContextGuardDecision['code']; readonly reason: string; readonly suggest: string | null; readonly tier: ContextGuardDecision['evaluation']['tier']; readonly ratio: number; readonly bytesUsed: number; readonly capacityBytes: number; readonly warnings: readonly string[]; } /** * Build the hook-guard result for a given prompt size. Pure function; * no IO. The CLI atom (registered below) calls this and prints JSON. * * Even if the caller passes `force = true` in the input (it shouldn't — * the hook CLI doesn't expose that flag), this function ignores it * and treats the prompt as if no override were available. This is the * RL-30 strict semantics. */ export declare function evaluateHookGuard(promptSize: number): HookGuardResult; /** * Register the `peaks sub-agent-dispatch-guard` command. Intentionally * NOT registered in the main `peaks --help` quickstart (dev-preference * PB-2 byte-stable). The caller (the `peaks hooks install` flow) calls * this directly via the imported function; the CLI registration in * `src/cli/index.ts` uses a hidden command (no `description`, no help). */ export declare function registerSubAgentDispatchGuard(program: Command): void;