/** * Multi-source skill path resolver for CAAMP integration. * Ported from lib/skills/skill-paths.sh * * Resolves skills, protocols, and shared resources from multiple locations. * Supports CAAMP canonical paths, project-embedded paths, and explicit overrides. * * Priority order: * 1. CLEO_SKILL_PATH entries (explicit overrides, highest priority) * 2. Source-determined paths based on CLEO_SKILL_SOURCE * * @task T4552 * @epic T4545 */ /** Source type classification for a skill directory. */ export type SkillSourceType = 'embedded' | 'caamp' | 'project-link' | 'global-link'; /** Skill source mode. */ export type SkillSourceMode = 'auto' | 'caamp' | 'embedded'; /** Search path entry with its origin. */ export interface SkillSearchPath { path: string; origin: 'override' | 'caamp' | 'embedded'; } /** * A resolved skill directory and where it came from. `bundled` means the * skill is not installed anywhere and was read from `@cleocode/skills`. * * @task T12646 */ export interface ResolvedSkillLocation { /** Real path of the skill directory. */ path: string; /** Search-path origin, or `bundled` for the package fallback. */ origin: SkillSearchPath['origin'] | 'bundled'; } /** * Get ordered skill search paths based on configuration. * * Priority: * 1. CLEO_SKILL_PATH entries (colon-separated, explicit overrides) * 2. Source-determined paths based on CLEO_SKILL_SOURCE * * CLEO_SKILL_SOURCE modes: * - auto: CAAMP canonical + embedded (default) * - caamp: CAAMP canonical only * - embedded: Project embedded only * * @task T4552 */ export declare function getSkillSearchPaths(projectRoot?: string): SkillSearchPath[]; /** * Resolve a skill directory containing SKILL.md, with its origin. * Searches all paths from getSkillSearchPaths() in priority order; first * match wins. * * When no search path holds the skill and `CLEO_SKILL_SOURCE` is `auto` (the * default), falls back to the copy bundled in `@cleocode/skills` with origin * `bundled`, so a spawn prompt can read a protocol it names even when install * selection left it out of the data dir. `caamp` and `embedded` never fall * back (T12646). * * @task T4552 * @task T12646 */ export declare function resolveSkillLocation(skillName: string, projectRoot?: string): ResolvedSkillLocation | null; /** * Resolve a skill directory containing SKILL.md — the path of * {@link resolveSkillLocation}, including its bundled fallback. * * @task T4552 * @task T12646 */ export declare function resolveSkillPath(skillName: string, projectRoot?: string): string | null; /** * Resolve a protocol .md file. * * Search order: * 1. `/src/validation/protocols/protocols-markdown/{name}.md` * (canonical location, where the markdown lives in this monorepo) * 2. `/protocols/{name}.md` for each registered skill base path * (project-local protocol overrides) * * @task T4552 * @task T260 — drop dead Strategy B paths, point at the real protocols-markdown dir */ export declare function resolveProtocolPath(protocolName: string, projectRoot?: string): string | null; /** * Resolve a shared resource .md file. * * Search order per base path: `{base}/_shared/{resource_name}.md`. The * `_shared/` directory is the canonical location in `@cleocode/skills`. * * @task T4552 * @task T260 — drop dead Strategy B path */ export declare function resolveSharedPath(resourceName: string, projectRoot?: string): string | null; /** * Classify the source of a skill directory. * * Determines where a skill directory lives in the search hierarchy: * - "embedded": Within the project's skills/ directory * - "caamp": Within the CAAMP canonical directory (~/.agents/skills) * - "project-link": Symlink pointing to project directory * - "global-link": Symlink pointing to CAAMP or external location * * @task T4552 */ export declare function getSkillSourceType(skillDir: string, projectRoot?: string): SkillSourceType | null; //# sourceMappingURL=skill-paths.d.ts.map