/** * Scrubbers for structured config files during `trellis uninstall`. * * Each scrubber takes the file content (and any context it needs) and returns * `{ content, fullyEmpty }`: * - `content` is the post-scrub text to write back if the file should remain. * - `fullyEmpty` is true when, after stripping every trellis-managed value, * nothing meaningful is left. The caller deletes the file in that case. * * Manifest path matching (for hooks.json scrubbers) uses substring containment * on the resolved `command` string. The leading `python3 ` / `python ` prefix * does not matter — we just look for the manifest-relative file path. */ export interface ScrubResult { content: string; fullyEmpty: boolean; } /** * Scrub a hooks-shaped settings JSON file. * * `mode = "nested"` → `hooks.{Event}.[ {matcher?, hooks: [ {command,...} ]} ]` * `mode = "flat"` → `hooks.{Event}.[ {command,...} ]` * * Strips every entry whose command references a path in `deletedPaths`, * then bottom-up cleans empty containers (matcher block, event array, hooks * object). Any user-defined keys outside `hooks` (e.g. `env`, `model`, * `permissions`, `version`) are preserved verbatim. */ export declare function scrubHooksJson(content: string, deletedPaths: readonly string[], mode: "nested" | "flat"): ScrubResult; /** * Scrub `.opencode/package.json`: * - remove `dependencies["@opencode-ai/plugin"]` * - if `dependencies` ends up empty → drop the field * - fully empty when nothing is left in the object */ export declare function scrubOpencodePackageJson(content: string): ScrubResult; /** * Scrub `.pi/settings.json`: * - drop `enableSkillCommands` (trellis-flagged) * - remove trellis entries from `extensions`/`skills`/`prompts` arrays * - remove trellis-managed `packages["npm:pi-subagents"]` isolation override * - drop arrays that become empty */ export declare function scrubPiSettings(content: string): ScrubResult; /** * Scrub `.codex/config.toml`. * * The current trellis-emitted file has two distinct chunks: * 1. The line `project_doc_fallback_filenames = ["AGENTS.md"]` * 2. A multi-line comment block that begins with the marker * `# NOTE: Trellis's SessionStart + UserPromptSubmit hooks require opt-in.` * and continues through `# be injected into Codex sessions.` * * Plus the leading "Project-scoped Codex defaults" header comments. * * Strategy: line-based removal. We strip: * - the `project_doc_fallback_filenames = ...` line * - any line that is *only* a comment introduced by trellis (the entire file * as shipped is comments + that one assignment) * - blank lines that surrounded those removals * * If the user added their own non-trellis lines, they are preserved as-is. * "Fully empty" = post-scrub content has no non-whitespace characters. */ export declare function scrubCodexConfigToml(content: string): ScrubResult; //# sourceMappingURL=uninstall-scrubbers.d.ts.map