UNPKG

agent-team-composer

Version:

Transform README files into GitHub project plans with AI-powered agent teams

60 lines 1.86 kB
import { z } from 'zod'; import Anthropic from '@anthropic-ai/sdk'; interface ExtractionResult<T> { success: boolean; data?: T; error?: string; rawContent?: string; extractionMethod?: string; } export declare class BulletproofJSONExtractor { private static extractionMethods; /** * Main extraction method that tries multiple strategies */ static extract<T>(content: string, schema: z.ZodSchema<T>, context?: string): Promise<ExtractionResult<T>>; /** * Method 1: Standard code block extraction */ private static extractWithCodeBlocks; /** * Method 2: Extract JSON without code blocks */ private static extractWithoutCodeBlocks; /** * Method 3: Clean up common formatting issues */ private static extractWithRegexCleanup; /** * Method 4: Use JSON repair library logic */ private static extractWithJSONRepair; /** * Method 5: Manual character-by-character parsing */ private static extractWithManualParsing; /** * Method 6: Fuzzy matching with structure detection */ private static extractWithFuzzyMatching; /** * Retry with explicit format instructions */ static createRetryPrompt(originalPrompt: string, error: string): string; /** * Log extraction failures for monitoring */ static logFailure(context: string, content: string, error: string): void; } /** * Enhanced LLM response handler with retries and resilience */ export declare class RobustLLMHandler { private static MAX_RETRIES; private static telemetry; private static resilience; static getStructuredResponse<T>(anthropic: Anthropic, prompt: string, schema: z.ZodSchema<T>, context: string): Promise<T>; private static executeWithRetries; } export {}; //# sourceMappingURL=json-extractor.d.ts.map