/** * Shared skill resolution helpers for pi-skills-mention. */ import type { ParsedSkillBlock, Skill } from "@earendil-works/pi-coding-agent"; /** A skill that is mention-addressable by name. */ export interface MentionSkill { name: string; filePath: string; baseDir: string; } /** * Read a skill's SKILL.md, stripped of frontmatter, trimmed. * Throws if the file cannot be read. */ export declare function readSkillBody(skill: MentionSkill): string; /** * Build the `` block pi injects for a `$name` mention — mirrors the * format `AgentSession._expandSkillCommand` uses, so downstream parsing of * skill blocks (collapsible rendering, etc.) keeps working. * * Throws if the SKILL.md cannot be read. */ export declare function buildSkillBlock(skill: MentionSkill): string; export interface InlineSkillsContent { /** Full text injected into the model context. */ content: string; /** Parsed blocks, used for the TUI renderer and session dedupe. */ blocks: ParsedSkillBlock[]; } /** * Build the `` context message for a set of skills: one * `` block per skill, wrapped in an explicit "already loaded" * marker so the model does not re-read the skill files. */ export declare function buildInlineSkillsContent(skills: MentionSkill[]): InlineSkillsContent; /** * Index a set of loaded skills keyed by their `name`. Skills without a name * are skipped. `baseDir` falls back to the parent of `filePath`. */ export declare function indexSkills(skills: readonly Skill[] | undefined): Map;