/** * Skill Executor * * Executes skills with proper context handling. * Supports forked, inherited, and isolated context modes. */ import type { Logger } from '../observability/logger.js'; import type { SkillDefinition, SkillContext, SkillResult, SkillContextMode } from './types.js'; /** * Executes skills with proper context handling. * Manages context isolation, forking, and inheritance. */ export declare class SkillExecutor { private logger; private defaultContextMode; constructor(logger: Logger, defaultContextMode?: SkillContextMode); /** * Execute a skill with the given context and input. * * @param skill - Skill definition to execute * @param context - Execution context * @param input - Input data for the skill * @returns Execution result */ execute(skill: SkillDefinition, context: SkillContext, input: { prompt?: string; data?: unknown; }): Promise; /** * Create forked context from parent context. * Child context is a deep copy with reference to parent. * * @param parentContext - Parent context to fork from * @returns Forked child context */ forkContext(parentContext: SkillContext): SkillContext; /** * Create isolated context with no parent data. * Only includes session ID for correlation. * * @param sessionId - Session ID to use * @returns Fresh isolated context */ createIsolatedContext(sessionId: string): SkillContext; /** * Create a new context for a session. * * @param sessionId - Optional session ID (generated if not provided) * @returns New skill context */ createContext(sessionId?: string): SkillContext; /** * Prepare execution context based on context mode. * * @param context - Original context * @param mode - Context handling mode * @returns Prepared execution context */ private prepareContext; /** * Build system prompt for skill execution. * Combines skill's system prompt with role information. * * @param skill - Skill definition * @returns Built system prompt */ buildSystemPrompt(skill: SkillDefinition): string; /** * Apply context modifications back to parent context. * Used when inherit mode skill execution completes. * * @param parentContext - Parent context to modify * @param modifications - Modifications to apply */ applyContextModifications(parentContext: SkillContext, modifications: Record): void; /** * Execute the actual skill logic. * This is a placeholder for integration with the provider system. * * @param skill - Skill definition * @param context - Execution context * @param input - Input data * @param systemPrompt - Built system prompt * @returns Skill output */ private executeSkillLogic; /** * Extract context modifications from skill output. * Looks for a specific structure in the output. * * @param output - Skill execution output * @returns Extracted modifications or undefined */ private extractContextModifications; } //# sourceMappingURL=skill-executor.d.ts.map