/** * Skill Loader and Detection Utilities * * Provides utilities for loading skills programmatically and detecting * which skill is relevant for a given user message. * * @module skills/loader */ import type { BuildPromptOptions, BuildPromptResult, LagoonSkill, SkillDetectionResult, SkillLoadOptions, SkillRegistry } from './types.js'; /** * Detect which skill is most relevant for a user message * * @param message - User message to analyze * @returns Detection result with skill, confidence, and matched triggers * * @example * ```typescript * const result = detectSkill("I'm new to DeFi, where should I start?"); * if (result.skill && result.confidence > 0.5) { * systemPrompt += result.skill.instructions; * } * ``` */ export declare function detectSkill(message: string): SkillDetectionResult; /** * Get a skill by name * * @param name - Skill name (e.g., 'lagoon-onboarding') * @returns The skill or undefined if not found */ export declare function getSkill(name: string): LagoonSkill | undefined; /** * Get all skills, optionally filtered by options * * @param options - Filter options * @returns Array of matching skills */ export declare function getSkills(options?: SkillLoadOptions): LagoonSkill[]; /** * Get skill content formatted for system prompt injection * * @param name - Skill name * @param options - Load options * @returns Formatted skill content or empty string if not found * * @example * ```typescript * const skillPrompt = getSkillPrompt('lagoon-onboarding', { * includeResources: true * }); * const systemPrompt = basePrompt + skillPrompt; * ``` */ export declare function getSkillPrompt(name: string, options?: SkillLoadOptions): string; /** * Get all skill names * * @returns Array of skill names */ export declare function getSkillNames(): string[]; /** * Get skill metadata for all skills (lightweight) * * @returns Array of skill metadata with name and description */ export declare function getSkillCatalog(): Array<{ name: string; description: string; audience: string; category: string; estimatedTokens: number; }>; /** * Create a skill registry instance * * @returns SkillRegistry implementation */ export declare function createSkillRegistry(): SkillRegistry; /** * Default skill registry instance */ export declare const skillRegistry: SkillRegistry; /** * Build a skill-aware system prompt for Claude API integration * * This is the main helper function for backend integrations. It automatically * detects relevant skills based on user message and injects them into the * system prompt. * * @param baseSystemPrompt - Your base system prompt * @param userMessage - The user's message to analyze for skill triggers * @param options - Configuration options * @returns Result with complete system prompt and detection metadata * * @example * ```typescript * import { buildSkillAwarePrompt } from '@lagoon-protocol/lagoon-mcp/skills'; * * // In your Claude API handler: * const { systemPrompt, detectedSkill, tokensAdded } = buildSkillAwarePrompt( * "You are a Lagoon vault assistant...", * userMessage, * { confidenceThreshold: 0.5 } * ); * * const response = await claude.messages.create({ * model: 'claude-sonnet-4-20250514', * system: systemPrompt, * tools: mcpTools, * messages: [{ role: 'user', content: userMessage }] * }); * * // Log skill usage for analytics * if (detectedSkill) { * console.log(`Skill activated: ${detectedSkill} (+${tokensAdded} tokens)`); * } * ``` */ export declare function buildSkillAwarePrompt(baseSystemPrompt: string, userMessage: string, options?: BuildPromptOptions): BuildPromptResult; //# sourceMappingURL=loader.d.ts.map