/** * SkillKit Runtime Executor * ======================== * The REAL execution engine. Connects the SKILL.md parser to the ModelRouter * and executes skills with actual AI models via Vercel AI SDK. * * Security: 3-layer defense * L1: SkillGuard pattern scan (52+ patterns, 11 categories) * L2: Community blocklist (SHA-256 hash check against known malicious skills) * L3: ProcessSandbox isolation (auto-enabled for untrusted skills) * * NO SIMULATION. NO FAKE RESULTS. REAL AI EXECUTION. */ import { type SecurityReport } from '../guard/index.js'; export interface ExecutionContext { content: string; input: string; model?: string; provider?: string; channel?: 'whatsapp' | 'telegram' | 'discord' | 'slack'; verbose?: boolean; stream?: boolean; timeout?: number; skipScan?: boolean; } export interface ExecutionResult { output: string; tokenUsage?: { input: number; output: number; total: number; }; model: string; provider: string; executedAt: string; duration: number; securityReport?: SecurityReport; } export interface ScanResult { score: number; threats: Array<{ severity: string; description: string; line?: number; }>; status: 'APPROVED' | 'REVIEW_REQUIRED' | 'BLOCKED'; scannedAt: string; /** SHA-256 hash of skill content — used for community blocklist */ hash?: string; /** True if skill should be executed in sandbox for safety */ sandboxRecommended?: boolean; } /** * SHA-256 hash of a skill's content — used for community blocklist lookups. * This is how the community collectively protects against malicious skills. */ declare function hashSkillContent(content: string): string; /** * Check a skill against the community blocklist. * Returns true if the skill hash is known-malicious. */ declare function isBlocklisted(content: string): Promise<{ blocked: boolean; hash: string; }>; /** * Report a malicious skill hash to the local blocklist. * The local blocklist accumulates hashes and can be shared with the community. */ declare function reportMaliciousSkill(hash: string): Promise; export { reportMaliciousSkill, isBlocklisted, hashSkillContent }; /** * Load a skill from: file path → local registry → error */ export declare function loadSkill(skillRef: string): Promise; /** * Scan a skill for security threats. * * 3-layer security: * L1: SkillGuard pattern matching (52+ patterns across 11 threat categories) * L2: Community blocklist check (SHA-256 hash against known-malicious skills) * L3: Sandbox recommendation (auto-suggested if REVIEW_REQUIRED) */ export declare function scanSkill(skillPathOrContent: string): Promise; /** * Execute a skill with a REAL AI model via Vercel AI SDK. * * Flow: * 1. Parse SKILL.md → SkillDefinition * 2. Build optimized system prompt from skill definition * 3. Route to correct model provider via ModelRouter * 4. Call generateText() or streamText() from Vercel AI SDK * 5. Return real AI response with token counts */ export declare function executeSkill(context: ExecutionContext): Promise; //# sourceMappingURL=executor.d.ts.map