import type { GuideDiscoveryRoot, GuideFileFormat } from '@auden.to/protocol'; export type DiscoveredSkillMember = { /** Path relative to the skill's directory (posix separators). */ path: string; rawContent: string; lastModified: number; contentHash: string; }; export type DiscoveredGuideFile = { /** Absolute path on disk. Used for reading and as a stable dedupe key. */ absolutePath: string; /** Path emitted in the import payload — relative to the discovery root. */ payloadPath: string; /** * Which root `payloadPath` is relative to. Part of the server's resolution * key, because `.claude/skills` is scanned under both roots and the two * scans emit identical relative paths for a skill present in each. */ root: GuideDiscoveryRoot; /** Path shown to the user in the preview list. */ displayPath: string; format: GuideFileFormat; rawContent: string; lastModified: number; contentHash: string; /** * Present only on `skill-md` files: the skill directory's other files * (scripts/, references/, assets/, supporting docs), paths relative to the * skill directory. `[]` means the skill has no member files — the server * treats the array as the authoritative member list, so it must always be * set when the directory was actually scanned. */ members?: DiscoveredSkillMember[]; /** * Member files that were found but not importable: binary or non-UTF-8 * content, oversized, unreadable, or beyond the per-skill cap. Set (with * `members` left undefined) even when the skipped list overflows the * payload cap and member sync is withheld for safety. */ membersSkipped?: number; /** * Skill-relative paths of the skipped files, sent alongside `members` so * the server preserves (rather than removes) their previously synced rows. */ membersSkippedPaths?: string[]; }; export type DiscoverOptions = { /** Project root to scan. Defaults to process.cwd(). */ cwd?: string; /** * When true, also scan `~/.claude/CLAUDE.md`. Defaults to `os.homedir()` * when `homedir` is not supplied. */ global?: boolean; /** Override the home directory. Primarily for tests. */ homedir?: string; /** * Expand each skill's member files (scripts/, references/, assets/) into * `members`. Defaults to true — import needs them, and a caller that forgets * this flag must get import's behaviour, not a silently thinner payload. * * Pass `false` when the caller keeps nothing but the guide files themselves: * expansion lstats, reads, UTF-8-validates and hashes up to * `MAX_SKILL_MEMBER_FILES` files per skill, which is real per-turn I/O for * `collectRuleManifest` (`manifest.ts`) and produces data it discards. The * discovered *guide files* are identical either way — only `members`, * `membersSkipped` and `membersSkippedPaths` are left unset — so this is one * walker with two depths, not a second walker that can drift from this one. */ includeSkillMembers?: boolean; }; /** * Discover supported guide files relative to the project root, optionally * extending the scan to global config locations under the user's homedir. * * The function is intentionally narrow: it walks only the known roots listed * above. It never crawls the broader filesystem. */ export declare function discoverGuideFiles(options?: DiscoverOptions): Promise; //# sourceMappingURL=discover.d.ts.map