/** * LLM-powered deep scan — sends suspicious code to an LLM API for * semantic analysis of IDOR, business logic, race conditions, and * other issues that pattern-matching alone cannot detect. * * Uses native fetch — no extra dependencies. */ export interface DeepScanFinding { type: string; severity: "critical" | "high" | "medium" | "low"; description: string; location: string; fix: string; } export type DeepScanFocus = "all" | "idor" | "business-logic" | "auth-bypass" | "race-condition"; export type DeepScanModel = "haiku" | "sonnet"; export declare const MODEL_IDS: Record; export declare const DEFAULT_MAX_BYTES = 10000; /** * Build a structured prompt for the LLM to analyze code. */ export declare function buildDeepScanPrompt(code: string, language: string, existingFindings: string[], focus?: DeepScanFocus): string; /** * Parse LLM response into structured findings. * Handles raw JSON, JSON in markdown code blocks, and malformed responses. */ export declare function parseDeepScanResult(response: string): DeepScanFinding[]; /** * Format deep scan findings as markdown or JSON. */ export declare function formatDeepScanFindings(findings: DeepScanFinding[], format: "markdown" | "json"): string; export interface CallLLMOptions { model?: DeepScanModel; maxBytes?: number; } /** * Call an LLM API for deep analysis. Uses native fetch. * Supports Anthropic (ANTHROPIC_API_KEY) or OpenAI (OPENAI_API_KEY). * Returns null if no API key is available. * * Defaults to Haiku 4.5 for cost; pass `model: "sonnet"` for higher-quality analysis. * `maxBytes` truncates the prompt to keep cost bounded (default 10 KB). */ export declare function callLLM(prompt: string, options?: CallLLMOptions): Promise;