/** * `.claude/settings.json` — the one line that makes the browser reload when the agent stops. * * `bitmagic dev` reloads on its own once writes go quiet, which is right for a human saving a file * and a guess for an agent, because an agent pauses to think and a long enough pause reads as * "finished". Claude Code's `Stop` hook removes the guess: it fires exactly once, when the turn * ends, and running `bitmagic reload` there means the creator sees the finished work rather than a * frame from the middle of it. * * ── Why this file is merged and not rendered ───────────────────────────────────────────────── * * Every other file the CLI ships into `.claude/` is in PLATFORM_GENERATED_FILES, which `upgrade` * overwrites wholesale — correct for a skill that documents the CLI, since a stale copy is worse * than a lost edit. `settings.json` is the opposite: it is where a creator puts their permissions, * their env, their own hooks. Overwriting it would delete work that was never ours, so `upgrade` * adds our hook to whatever is there and touches nothing else, in the same read-modify-write shape * `bitmagic.json` already uses. * * Anything that cannot be merged confidently is left alone entirely. A creator with a hand-written * settings file that we cannot parse keeps their file; they lose auto-reload-on-stop, which the * watcher in `editor/watch.ts` mostly covers anyway. */ export declare const CLAUDE_SETTINGS_FILE = ".claude/settings.json"; /** What the hook runs. One definition, so the scaffold and the merge cannot disagree. */ export declare const RELOAD_HOOK_COMMAND = "bitmagic reload"; export interface ReloadHookMerge { /** The text to write, or null to leave the file exactly as it is. */ contents: string | null; /** Present only when `contents` is null *because* the file could not be merged. */ skipped?: string; } /** * The settings a project with no `.claude/settings.json` at all gets. * * Note the asymmetry with `mergeReloadHook` below: an existing settings file gains the Stop hook * and nothing else. Permissions are the creator's own security posture, and adding entries to a * file they already own is a different kind of act from seeding one that does not exist yet. */ export declare function renderClaudeSettings(): string; /** * Add the Stop hook to an existing settings file, preserving everything else in it. * * `existing` is the file's text, or undefined when there is no file. Returns `contents: null` when * there is nothing to do — the hook is already there, or the file is not something we can safely * rewrite. */ export declare function mergeReloadHook(existing: string | undefined): ReloadHookMerge;