/** * Inference layer shared by typebulb.com and the CLI (TB-Inference.md): the prompt template, * the LLM-output JSON sanitizer, and the `#tb=` result encoding. Single-sourced here so the two * surfaces may differ in UX but never in what is sent, how output is repaired, or how a result * is encoded for sharing. */ export interface InferenceScriptContent { /** Inference instructions (markdown) */ infer?: string; /** Example insight output (JSON string) */ insight?: string; /** Script code that will consume the output */ code?: string; } /** * Build the inference prompt from script content and data */ export declare function buildInferencePrompt(script: InferenceScriptContent, data: string[]): string; export interface SanitizeResult { parsed: unknown | null; json: string; fixesApplied: string[]; } /** * Attempt to parse JSON, applying conservative fixes for common LLM errors */ export declare function sanitizeJsonOutput(content: string): SanitizeResult; /** The result of an inference run: the AI's insight plus the data it analyzed */ export interface InferenceResult { insight: unknown; insightJson: string; data: string[]; } /** Encode result to URL hash. Returns "#tb=1:..." or empty string if too large. */ export declare function encodeToHash(result: InferenceResult): string; /** Decode result from URL hash. Returns null if no result or decode fails. */ export declare function decodeFromHash(hash: string): InferenceResult | null; /** Check if hash contains a tb= fragment (for error detection) */ export declare function hashContainsTb(hash: string): boolean; //# sourceMappingURL=inference.d.ts.map