/** * Package-level behavior constants for the Claude Code hook dispatcher. * * Why these are constants, not user config: * * The dogfood-platform model: WE (the package maintainers) decide which * gates run in which mode at any given version. Customers install a * version of this package and get the contract that version ships with. * They do not reason about JSON settings files; they do not flip * advisory-vs-enforce switches; the only knobs they ever touch are * policy declarations (forbiddenCommand, mustConfirm) which describe * their INTENT — we honor that intent automatically. * * When a gate matures (telemetry shows bypass <5%, false-positive <1%, * etc.) the maintainers flip its constant here, bump the package * version, ship. Every customer on the new version gets the new * default. No JSON edits, no migration guides, no confused tickets. * * The one exception is MNEMONIK_BYPASS_HOOKS — that's an emergency * environment-variable escape hatch, not config. It's set per-shell * for one-off legitimate bypasses with required type + detail. */ /** Mode for an agent-behavior nudge gate. */ export type GateMode = 'advisory' | 'enforce' | 'off'; /** Mode for a side-effect handler (no gate semantics). */ export type SideEffectMode = 'on' | 'off'; /** * PreToolUse Edit/Write/NotebookEdit gate. * * Currently advisory: emits a system-reminder nudge with auto-loaded * file_context when the agent is about to edit a file it hasn't grounded * on. Will flip to enforce when telemetry warrants. */ export declare const PRE_EDIT_GATE: GateMode; /** * Kill switch for delivering file memory in PreEdit advisory mode. * The server attaches the file's memory summary to the file_context_required * envelope (d1bcc258d). When true, advisory mode injects that envelope as * additionalContext and ALLOWS the edit. When false, the directive stays * unsatisfied and the edit is DENIED with the envelope as the reason, exactly * as in enforce mode: a directive-class signal is not softened into a nudge by * the host mode (de23c9be2). Flipping this to false therefore makes the * advisory edit gate block, which acceptance criterion 16 in * docs/SYSTEM_REFERENCE.md names as a decided exception. Ships true. */ export declare const PRE_EDIT_ADVISORY_AUTO_FETCH = true; /** * PreToolUse Bash gate (phase 3 simplification, 0.5.x line). * * The dispatcher no longer does its own per-kind policy enforcement. * Server-side /api/v1/hooks/policy-reminder is the single source of * truth for "which policies apply to this action" — the dispatcher * posts the bash command, gets back matched context-triggered policies, * and emits them as additionalContext. * * The only LOCAL gate is the irreducible deny-floor in lib/shellTokens.ts * — three regex patterns for catastrophic commands (rm -rf root/home, * dd to a whole disk, mkfs of a whole disk). That floor exists because * we cannot trust the server to be reachable for machine-bricking * decisions. Everything else (project policies, forbiddenCommand, * mustConfirm, defaultMode) is server-evaluated. * * No FORBIDDEN_GATE / MUST_CONFIRM_GATE knobs anymore: the SERVER * decides whether to advise or deny based on policy.kind. If you need * to flip a kind from advise-style to deny-style, that's a server-side * change, not a client one. */ /** * Stop checkpoint gate (P5). * * Currently advisory: emits a system-reminder nudge when the agent * tries to end its turn after meaningful edits without a checkpoint. * Will flip to enforce when telemetry warrants. */ export declare const STOP_CHECKPOINT_GATE: GateMode; /** * PreToolUse MCP precheck gate — server-side ordering-rule engine verdict * for Mnemonik MCP calls (matcher: `mcp__mnemonik__.*`). See * cursor-hooks.plan.md §16 for the host-agnostic rule taxonomy. * * A deny verdict denies in every mode: the verdict, not this constant, decides * (de23c9be2). The mode governs only ask verdicts: advisory allows the call * and hands the agent the reason; enforce denies so the agent confirms with * the user in chat. */ export declare const PRE_MCP_GATE: GateMode; /** SessionStart bootstrap pre-injection. */ export declare const SESSION_START_BOOTSTRAP: SideEffectMode; /** PreCompact context_snapshot pre-injection. */ export declare const PRE_COMPACT_SNAPSHOT: SideEffectMode; /** SessionEnd fire-and-forget save. */ export declare const SESSION_END_SAVE: SideEffectMode; /** UserPromptSubmit prompt-context inject. */ export declare const USER_PROMPT_CONTEXT: SideEffectMode;