import type { ThinkingLevel } from "@caupulican/pi-agent-core"; import type { ResourceDiagnostic } from "./diagnostics.ts"; import { type SourceInfo } from "./source-info.ts"; /** Discovery retains only this bounded metadata prefix, never the whole skill body. */ export declare const MAX_SKILL_FRONTMATTER_BYTES: number; export declare const MAX_SKILL_NAME_LENGTH = 64; /** Max description length per spec */ export declare const MAX_SKILL_DESCRIPTION_LENGTH = 1024; export interface SkillFrontmatter { name?: string; description?: string; "disable-model-invocation"?: boolean; /** Optional thinking-level hint (R1 follow-up); see Skill.thinking. */ thinking?: string; /** Reflection-generated skill marker used by the curator. */ promoted?: boolean; [key: string]: unknown; } export interface Skill { name: string; description: string; filePath: string; baseDir: string; sourceInfo: SourceInfo; disableModelInvocation: boolean; promoted?: boolean; /** * Optional thinking-level hint parsed from frontmatter (R1 follow-up: skill-surfaced thinking * governance, alongside resource-profile thinking). Core only parses and surfaces this value — * nothing in pi-adaptative core applies it to a session's thinking level yet. Unlike an active * resource profile (a persistent "situation", see settings-manager.ts's activeResourceProfile) * or a routed turn (bracketed by a try/finally swap/restore, see agent-session.ts's * _runAgentPromptWithModelRouter), a skill has no session-lifecycle hook marking when it starts * or stops governing a turn, so applying this is left to the consumer (e.g. a skill-router * extension) via the existing ctx.setThinkingLevel() extension API. */ thinking?: ThinkingLevel; } export interface LoadSkillsResult { skills: Skill[]; diagnostics: ResourceDiagnostic[]; } /** * Validate skill name per Agent Skills spec. * Returns array of validation error messages (empty if valid). */ export declare function validateSkillName(name: string): string[]; export interface LoadSkillsFromDirOptions { /** Directory to scan for skills */ dir: string; /** Source identifier for these skills */ source: string; /** Profile UAC gate: when provided, files it denies are never read from disk. */ isPathAllowed?: (path: string) => boolean; } /** * Read one stable, bounded frontmatter prefix. The closing delimiter ends the read, so discovery * cost depends on metadata size, never body size. Unterminated metadata fails at the explicit cap. */ export declare function readSkillFrontmatterFile(filePath: string): string; /** * Load skills from a directory. * * Discovery rules: * - if a directory contains SKILL.md, treat it as a skill root and do not recurse further * - otherwise, load direct .md children in the root * - recurse into subdirectories to find SKILL.md */ export declare function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult; export interface LoadSkillsOptions { /** Working directory for project-local skills. */ cwd: string; /** Agent config directory for global skills. */ agentDir: string; /** Explicit skill paths (files or directories) */ skillPaths: string[]; /** Include default skills directories. */ includeDefaults: boolean; /** Profile UAC gate: when provided, files it denies are never read from disk. */ isPathAllowed?: (path: string) => boolean; } /** * Load skills from all configured locations. * Returns skills and any validation diagnostics. */ export declare function loadSkills(options: LoadSkillsOptions): LoadSkillsResult; //# sourceMappingURL=skills.d.ts.map