/** * hook-install.ts — SessionStart memory-pack hook auto-install. * * Deferred from KF-B (docs/hooks/memory-pack.md shipped the manual-install * recipe; this wires it into `astramem-local init`). Installs the * platform-appropriate one-liner into the user's global Claude Code settings * (`~/.claude/settings.json` by default, injectable via `settingsPath` for * tests and callers that target a project-local settings file instead). * * Read-modify-write: parses existing JSON, appends one SessionStart hook * block, and writes the whole object back — every other key (and every other * hook) survives untouched. Idempotent: detects an already-installed * astramem hook by the `/recall/pack` marker substring in any existing * SessionStart command and skips re-inserting it. */ /** Marker substring used to detect an already-installed astramem hook (idempotency). */ export declare const HOOK_MARKER = "/recall/pack"; /** Default target: `~/.claude/settings.json` (global, matches docs/hooks/memory-pack.md). */ export declare function defaultSettingsPath(): string; /** * Build the platform-appropriate SessionStart hook one-liner from * docs/hooks/memory-pack.md, with the daemon port filled in. * * Uses `MEMORY_BEARER` (the env var `astramem-local init` actually persists * to the user's shell — see src/config/persist-envs.ts and the `.mcp.json` * wiring in README.md), not the doc's original `ASTRAMEM_TOKEN` placeholder. */ export declare function buildHookCommand(port: number): string; export interface InstallHookOptions { /** Daemon port to bake into the hook URL. */ port: number; /** Injectable target path — defaults to defaultSettingsPath(). */ settingsPath?: string; } export type InstallHookOutcome = 'installed' | 'already-installed'; export interface InstallHookResult { outcome: InstallHookOutcome; settingsPath: string; } /** * Install the SessionStart memory-pack hook into `opts.settingsPath` * (default `~/.claude/settings.json`). Preserves all existing content; * idempotent against repeated calls. */ export declare function installMemoryPackHook(opts: InstallHookOptions): InstallHookResult;