/** * Slice 2.0.1-bug3-fact-forcing-bypass — pure-data template for the * consumer-project `.claude/settings.local.json` file. * * The template is a PreToolUse hook allow-list that bypasses the * Claude Code [Fact-Forcing Gate] for tool calls whose paths target * the peaks-managed `.peaks/` workspace. Without this bypass, * `peaks workspace init` (Step 0 of every peaks-solo session) is * unrunnable in a consumer project because the gate blocks the very * first Write. * * The template is a pure-data function (no filesystem, no clock) so * it can be unit-tested in isolation and so the on-disk file matches * the in-memory template byte-for-byte. * * One matcher is emitted: * 1. `Write|Edit|MultiEdit` — a node one-liner that path-matches * `.peaks/_runtime/` and `.peaks/_runtime//`. Exits 0 (allow) * for those paths, non-zero (deny → fall through to gate) for * everything else. * * The previous `Bash` matcher (which whitelisted a fixed `peaks * ` prefix) was removed in TEMPLATE_VERSION 1.2.0. The * [Fact-Forcing Gate] is an Edit/Write concern (it forces the LLM * to quote user instructions before any file write), and the Bash * matcher was emitting `process.exit(1)` with no stderr on every * non-peaks Bash call — a non-blocking "No stderr output" noise * decoration in the Claude Code UI even though the underlying tool * call still proceeded. Bash command enforcement is now owned by * `peaks gate enforce`, which `peaks hooks install` injects into the * consumer project's `.claude/settings.json` and which exits 0 * silently for any command not guarded by a registered SOP gate. */ export declare const CLAUDE_SETTINGS_LOCAL_FILENAME = ".claude/settings.local.json"; /** * Informational version of the offline template shape. Bumped when the * template's hooks tree (matchers, allow-list content, wrapper format) * changes in a way that should trigger a refresh of stale on-disk * copies. The comparator (`templateContentMatches`) is the source of * truth for refresh decisions — this constant exists so a developer * reading the diff can correlate a template change with a deliberate * bump. Future work may write a version-marker file to short-circuit * the comparator; for now the constant is informational only. * * History: * 1.0.0 — initial template with `Write|Edit|MultiEdit` and `Bash` * matchers (slice 2.0.1-bug3-fact-forcing-bypass) * 1.1.0 — added `node -e "..."` wrapper contract * (slice fix-claude-settings-template-hook-node-wrapper) * 1.2.0 — removed the `Bash` matcher; Edit/Write fact-forcing * bypass is the only emit. Bash enforcement is owned by * `peaks gate enforce` in `settings.json`. */ export declare const TEMPLATE_VERSION = "1.2.0"; /** * Compare two serialized template strings for semantic equivalence. * * Returns `true` iff both strings parse to objects whose * `hooks.PreToolUse` arrays are structurally identical (same length; * each entry's `matcher`, `hooks[].type`, `hooks[].command` match). * * Returns `false` on any `JSON.parse` error, shape mismatch, or * missing `hooks.PreToolUse`. Whitespace and key order do NOT affect * the result — the comparison is on the parsed AST, not on bytes. * * This is the comparator `initWorkspace` uses to decide whether to * refresh a stale `.peaks/.claude-settings-template.json` on disk. */ export declare function templateContentMatches(generated: string, onDisk: string): boolean; type ClaudeHookCommand = { type: 'command'; command: string; }; type ClaudePreToolUseEntry = { matcher: string; hooks: ClaudeHookCommand[]; }; type ClaudeSettingsLocal = { hooks: { PreToolUse: ClaudePreToolUseEntry[]; }; }; /** * Build the full template object. The shape is the subset of Claude * Code's `.claude/settings.local.json` schema that PreToolUse hooks * need — we do not emit the `permissions` block because the fact- * forcing gate is a core feature that PreToolUse hooks can short- * circuit but that the `permissions` block cannot. * * As of TEMPLATE_VERSION 1.2.0, only the `Write|Edit|MultiEdit` * matcher is emitted. Bash command enforcement is the responsibility * of `peaks gate enforce`, which `peaks hooks install` injects into * `.claude/settings.json` (not `.claude/settings.local.json`). */ export declare function buildClaudeSettingsLocalJson(): ClaudeSettingsLocal; export {};