/** * Skill discovery and directory scanning. * * Python parity with praisonaiagents/skills/discovery.py and the lazy * `load_skill` defined in praisonaiagents/skills/__init__.py. */ import { type Skill, type SkillProperties } from './index'; /** * A declarative remote skill source. Mirrors the shapes accepted by Python's * `discover_skills(sources=...)` (discovery.py:80): a URL string, a * `{url, ref}` object, or an object implementing `fetch(cacheDir)` that * returns local directories holding fetched skills. */ export type RemoteSkillSource = string | { url: string; ref?: string; } | { fetch: (cacheDir: string) => Iterable | Promise>; }; /** * Get default skill directory locations. * * Python: praisonaiagents/skills/discovery.py:14 `get_default_skill_dirs()`. * Returns existing directories in precedence order (high to low): * 1. Project: ./.praisonai/skills/ or ./.claude/skills/ (plus ancestors) * 2. User: ~/.praisonai/skills/ * 3. Remote skill cache (`/remote-skills//current`) * 4. System: /etc/praison/skills/ (admin-managed) * * @returns List of existing skill directories */ export declare function getDefaultSkillDirs(): string[]; /** * Discover all valid skills in the given directories. * * Python: praisonaiagents/skills/discovery.py:77 * `discover_skills(skill_dirs=None, include_defaults=True, sources=None)`. * Metadata is read through `SkillLoader.loadMetadata` (Level 1 only). * Invalid skills are skipped with a warning; when two skills share a name the * earlier (higher-precedence) entry wins. * * @param skillDirs Directory paths to scan. Each directory should contain * skill subdirectories (or itself be a single skill). * @param includeDefaults Whether to include the default skill directories * @param sources Optional declarative remote skill sources, scanned after * local directories (lowest precedence; never breaks local discovery) * @returns SkillProperties for every valid skill found */ export declare function discoverSkills(skillDirs?: string[], includeDefaults?: boolean, sources?: RemoteSkillSource[]): Promise; /** * Discover a single skill from a directory path. * * Python: praisonaiagents/skills/discovery.py:166 `discover_skill(skill_path)`. * * @param skillPath Path to a skill directory * @returns SkillProperties if valid, undefined otherwise */ export declare function discoverSkill(skillPath: string): Promise; /** * Load a skill (metadata + activated instructions) by name, searching the * provided or default skill directories. * * Python: praisonaiagents/skills/__init__.py:166 * `load_skill(skill_name, skill_dirs=None)` (lazily defined in `__getattr__`). * * TS extension: `skillName` may also be a path to a skill directory (or its * SKILL.md). A bare name that is not found resolves to `undefined` as in * Python; an explicit path that does not exist or has no SKILL.md throws. * * @param skillName Skill name (frontmatter `name`) or a skill directory path * @param skillDirs Directories to search before the defaults * @returns The loaded skill, or undefined when no skill has that name */ export declare function loadSkill(skillName: string, skillDirs?: string[]): Promise;