/** * Skill Selector Module - Two-Step LLM Skill Selection * * Purpose: * Implements the lightweight LLM call that selects the best matching skill for a * user message. This is Step 1 of the two-step skill flow: * Step 1: selectSkillForMessage() → skill name or null * Step 2: buildSkillAugmentedMessage() → injects SKILL.md content into user message * * Features: * - Lightweight LLM call for skill selection from metadata list * - Structured prompt template for consistent selection behavior * - Edge case handling: no skills installed, invalid LLM response, LLM errors * - World's configured LLM provider/model used for selection call * - Fast path: skips selection when no skills are installed * - Skill content injection into user message (NOT system prompt) * * Notes: * - Skills are NOT tool calls — they follow the Anthropic Agent Skills Protocol * - Selection uses a separate lightweight LLM call before the main response call * - Selected skill content is injected into the user message, never the system prompt * - This module is application-side; the LLM never accesses the filesystem directly * * Recent Changes: * - 2026-02-09: Initial implementation for world-level skills system */ import type { World, Agent, SkillMetadata, LLMResponse } from './types.js'; /** * Build the structured prompt for skill selection. * The LLM receives skill metadata (names + descriptions) and the user's message, * then returns the best matching skill name or "none". */ declare function buildSelectionPrompt(skills: SkillMetadata[], userMessage: string): string; /** * Select the best matching skill for a user message using a lightweight LLM call. * * This is Step 1 of the two-step skill flow. It loads the skill metadata list, * makes a lightweight LLM call to select the best match, and returns the skill name. * * @param world - World instance (provides LLM config and world ID) * @param agent - Agent instance (provides LLM provider/model for selection call) * @param userMessage - The user's message to match against skills * @returns Selected skill name, or null if no skill matches */ export declare function selectSkillForMessage(world: World, agent: Agent, userMessage: string): Promise; /** * Parse the LLM's selection response to extract a valid skill name. * Returns null if the response is "none" or doesn't match any installed skill. */ declare function parseSelectionResponse(response: LLMResponse, skills: SkillMetadata[]): string | null; /** * Build a user message augmented with skill instructions. * * This is Step 2 of the two-step skill flow. If a skill was selected, * the application reads the SKILL.md content and wraps it around the * user's original message. * * @param worldId - World ID to locate skill files * @param skillName - Selected skill name (from Step 1) * @param originalMessage - The user's original message content * @returns Augmented message content with skill instructions, or original message if skill not found */ export declare function buildSkillAugmentedMessage(worldId: string, skillName: string, originalMessage: string): Promise; export { buildSelectionPrompt, parseSelectionResponse }; //# sourceMappingURL=skill-selector.d.ts.map