import type { FileWriter } from '../services/file-writer.js'; /** * Per-profile managed-block marker prefix each target writes ahead of a profile id, e.g. * `claude-profile-` → marker ``. * The id that follows the prefix is what cleanup keys on — never the file's basename — so this works * even where the on-disk name does not equal the profile id (e.g. Agentforce's `NN-.md`). */ export type ProfileMarkerPrefix = `${string}-profile-`; /** Builds the per-profile block-start marker a target writes for `profileId`. */ export declare function profileRuleMarker(markerPrefix: ProfileMarkerPrefix, profileId: string): string; export type RemoveOrphanedProfileRulesOptions = { /** Profile ids whose per-profile rule files must be KEPT (the current selection). */ keepIds: ReadonlySet; /** Per-profile marker prefix this target emits (e.g. `claude-profile-`, `cursor-profile-`). */ markerPrefix: ProfileMarkerPrefix; /** File extension to scan, including the dot (e.g. `.md`, `.mdc`). */ fileExt: string; /** Writer used to remove orphans; only ever called for marker-bearing plugin files. */ writer: FileWriter; /** * Basenames written THIS run that must be KEPT regardless of their profile id. Needed where a * target's filename can change while its id stays selected — e.g. Agentforce re-indexes numbered * files (`02-ta.md` → `03-ta.md`), leaving a stale duplicate that the id keep-set alone would not * remove. When set, a file is kept iff its basename is in `keepFiles`; when omitted, the id-based * keep applies. */ keepFiles?: ReadonlySet; }; /** * Target-agnostic sweep of orphaned per-profile rule files left in `dir` after a profile is * deselected, renamed, relocated, or re-indexed. A file is removed ONLY when it carries this * target's `` managed-block marker AND it is not in the keep set: * - by default, kept when its `` is in `keepIds`; * - when `keepFiles` is provided, kept when its basename is in `keepFiles` (id-independent). * * SAFETY (non-negotiable): a file with no per-profile marker is NEVER touched — that covers the * user's own rules and the target's legitimate non-profile generated files (which carry a different * marker id, e.g. `sub-agent-protocol`, `doc-sync-skill`). Matching is marker-id-based, not * basename-based, so it also catches Agentforce's numbered `NN-.md` orphans whose basename * never equals the profile id. */ export declare function removeOrphanedProfileRules(dir: string, opts: RemoveOrphanedProfileRulesOptions): void;