/** * Shared filesystem walker for skill sources. * * Sits below the per-source-type walkers in `./project.ts`, `./user.ts`, * etc. Each `SKILL.md` discovered yields a `WalkedSkill` carrying: * * - `dirPath` — absolute path to the skill's directory. * - `skillFilePath` — absolute path to the `SKILL.md`. * - `mtimeMs` — modification time of `SKILL.md` for slim-index ordering. * * Per `skills-edge-cases.md` §1.9 / §1.10 symlinks are bounded: * * - Symlink resolution count per skill is capped at `SYMLINK_HOP_CAP`. * - A symlink resolving outside the skill directory's tree is rejected * before any read. * * The walker never reads `SKILL.md` body content — it surfaces existence * + mtime only. The parser (`../parser.ts`) handles the actual read. */ /** Per-skill symlink-resolution cap. Mirrors POSIX `O_NOFOLLOW`-style behavior. */ export declare const SYMLINK_HOP_CAP = 8; export interface WalkedSkill { readonly dirPath: string; readonly skillFilePath: string; readonly mtimeMs: number; /** * File size in bytes from `fs.stat`. The manager enforces the * `SKILL_FILE_HARD_BYTES` cap before `fs.readFile` to defend against * unbounded reads of third-party SKILL.md files. */ readonly size: number; } /** * Walk a single directory non-recursively and return every immediate * sub-directory that contains a `SKILL.md` (or `skill.md`) file. The * walker treats each subdirectory as one skill — supporting files * (`reference.md`, `scripts/`, `assets/`) ride along but aren't surfaced * by this walker. * * Errors thrown by the underlying `readdir` are propagated to the caller * so the source-type walker can attach `sdk.skill.error` events with the * source identity. */ export declare function findSkillDirectories(root: string): Promise; /** * Variant for sources whose root layout is "directory contains many * subdirectories AND each subdirectory may itself contain skill * subdirectories" — e.g. a glob expansion like `plugins/*\/skills`. The * walker does NOT recurse arbitrarily deep; it probes exactly one level * down from each immediate child. * * Pragmatically: if `root/foo/SKILL.md` exists, `foo` is a skill; * otherwise the walker checks `root/foo/skills/` (legacy plugin layout). */ export declare function findSkillDirectoriesWithLegacyPluginLayout(root: string): Promise; /** * Walk a path with symlink-resolution and return its canonical absolute * form, or `null` if the path doesn't exist or cannot be canonicalised. */ export declare function safeRealPath(p: string): Promise; /** * Walk upward from `cwd` looking for ancestor directories that contain a * `` directory (typically `.qodo/skills` for the project source). * Returns the matching ancestor paths in nearest-first order. Caller * applies the precedence rule for ties. */ export declare function walkAncestors(cwd: string, segment: string): Promise; //# sourceMappingURL=walk.d.ts.map