/** * Skill discovery algorithm (3-phase: direct match, priority scan, recursive fallback). * * The `skillsInDir` function is used by source providers (local, git-hosting) * to discover skills within a directory structure. * * @experimental This API is unstable and may change without notice. */ import * as FileSystem from "effect/FileSystem"; import * as Path from "effect/Path"; import type { Skill } from "../../../skills/types.js"; import * as Effect from "effect/Effect"; import * as Option from "effect/Option"; import { type AppError } from "../../../app-error/index.js"; /** * A discovered skill — intermediate result from directory scanning. * * Does not carry source, version, or gitTreeSha — the caller (provider) * enriches with those after discovery. */ export interface DiscoveredSkill { readonly type: "skill"; readonly skill: Skill; /** file:// URL to the skill directory */ readonly location: string; } /** * Options controlling discovery behavior. */ export interface DiscoveryOptions { /** Exhaustive recursive search even if root skill found */ readonly fullDepth: boolean; /** Include skills with metadata.internal: "true" */ readonly includeInternal: boolean; } /** * Derive the full Phase 2 priority directory list. * * Composition: * 1. `.` (searchPath root) — always first, highest priority * 2. Non-agent static dirs: skills, skills/.curated, skills/.experimental, skills/.system * 3. Agent dirs: unique primary and additional read paths from the AgentDescriptor registry */ export declare const getPriorityDirectories: () => ReadonlyArray; /** * Discover skills in a directory using a 3-phase algorithm: * * Phase 1 — Direct match: check if search root itself contains SKILL.md * Phase 2 — Priority directory scan: scan well-known directories one level deep * Phase 3 — Recursive fallback: bounded DFS when prior phases find nothing or fullDepth is true * * Skills are deduplicated by name (first-found wins). Internal skills are * filtered unless opted in. * * @experimental This API is unstable and may change without notice. */ export declare const skillsInDir: (basePath: string, subPath: Option.Option, options: DiscoveryOptions) => Effect.Effect, AppError, FileSystem.FileSystem | Path.Path>; //# sourceMappingURL=skills.d.ts.map