export interface GlobalInstructionTarget { /** Display label used in CLI output (e.g. "~/.claude/CLAUDE.md"). */ label: string; /** Absolute path the file lives at. */ path: string; } /** * Build the canonical list of global agent-instruction targets relative * to a home directory. Exported so tests can override `homedir` cheaply. */ export declare function globalInstructionTargets(home?: string): GlobalInstructionTarget[]; export type GlobalWriteAction = { action: "skip"; label: string; path: string; reason: "already-present"; } | { action: "append"; label: string; path: string; } | { action: "create"; label: string; path: string; }; /** * Decide-and-execute the SVERKLO_SNIPPET write at a single global target. * Idempotent: skip if the file already contains the snippet (literal * sentinel OR `## Sverklo` heading). Creates the parent directory only * when we're about to create the file — never opportunistically. */ export declare function writeGlobalInstructionsTo(target: GlobalInstructionTarget): GlobalWriteAction; /** * Per-project: add `.sverklo/` to the target project's `.gitignore`. * Mirrors the logic in `initProject()` (Section 1.7) but extracted so * `initGlobal()` can call it without dragging the rest of the kitchen-sink * init alongside. Returns an action label for CLI output. * * Behavior matches `initProject` exactly: * - existing .gitignore + entry already covered -> "already" * - existing .gitignore + missing entry -> "added" * - no .gitignore but .git/ exists -> "created" * - no .git/ at all -> "no-git" (no-op) */ export type GitignoreAction = "already" | "added" | "created" | "no-git"; export declare function addSverkloToGitignore(projectPath: string): GitignoreAction; export interface InitGlobalOptions { /** Optional override for `homedir()`. Tests use this; CLI does not. */ home?: string; /** Forward to `importExistingMemories` — mirrors `initProject`'s flag. */ mineChats?: boolean; } export interface InitGlobalResult { globalWrites: GlobalWriteAction[]; registered: { name: string; path: string; }; gitignore: GitignoreAction; memoryImport: { imported: number; skipped: number; sources: string[]; } | { skipped: "no-model"; } | { skipped: "error"; error: string; }; } /** * Issue #72 — one-time-per-machine setup + lightweight per-project bits. * * Steps (all idempotent): * 1. Write SVERKLO_SNIPPET to global agent-instruction locations * (one-time per machine; subsequent calls skip these). * 2. registerRepo(deriveRepoName(targetPath), targetPath) * 3. Add `.sverklo/` to target project's `.gitignore` * 4. importExistingMemories(targetPath) * * Explicitly NOT done (vs `initProject`): * - No project `.mcp.json` * - No project AGENTS.md / CLAUDE.md / .cursorrules writes * - No `.claude/settings.local.json` * - No skill install * - No `~/.codex/config.toml`, `~/.copilot/mcp-config.json`, * `~/.gemini/antigravity/mcp_config.json` writes * - No doctor run */ export declare function initGlobal(targetPath: string, options?: InitGlobalOptions): Promise;