import type { ILLMProvider } from "../../knowledge-book/llm/types.js"; import type { PdfIndex } from "../context-pdfs/types.js"; import type { ContextBundle, EnumEntry, LeafDraft, TagEntry } from "./types.js"; import type { ReuseMatch } from "./reuse.js"; export type BatchEvent = { kind: "start"; } | { kind: "ok"; attempt: number; elapsedMs: number; } | { kind: "retry"; attempt: number; reason: string; } | { kind: "fallback"; reason: string; } | { kind: "reused"; from: string; info: string; }; export type BatchEventHandler = (ev: BatchEvent) => void; type LLMInputAttr = { path: string; action: string; is_leaf: boolean; value_type: string; sample_values: unknown[]; most_common_value?: unknown; observed_in_flows: string[]; is_array_indexed: boolean; openapi: { description?: string; custom?: Record; type?: string; } | null; existing_enums?: EnumEntry[]; existing_tags?: TagEntry[]; existing_leaf?: Record; referenced_in: Array<{ flow: string; action_id: string; kind: string; snippet: string; role?: "read" | "write" | "delete"; gated_by?: string; }>; save_data: Array<{ flow: string; key: string; jsonpath: string; inherited?: boolean; ancestor_jsonpath?: string; }>; session_reads?: Array<{ session_key: string; snippet: string; origin_action?: string; origin_path?: string; origin_flow?: string; }>; gated_writes?: Array<{ snippet: string; gated_by: string; flow: string; action_id: string; }>; cross_flow?: { set_in_generate: boolean; asserted_in_validate: boolean; required_in_requirements: boolean; persisted_key?: string; consumed_across_steps: boolean; }; prior_reviewed?: Array<{ info: string; }>; }; export type DraftItem = { action: string; bundle: ContextBundle; reuse?: ReuseMatch[]; }; export type DraftOptions = { reuseVerbatim?: boolean; }; export declare function draftLeaves(llm: ILLMProvider, items: DraftItem[], onEvent?: BatchEventHandler, opts?: DraftOptions): Promise; export declare function itemToLLMInput(it: DraftItem): LLMInputAttr; export declare function buildPrompt(inputs: LLMInputAttr[], retryReason: string): string; export declare const NO_DATA_SENTINEL = ""; export declare function paraphraseUserDescription(llm: ILLMProvider, args: { path: string; action: string; userText: string; pdfIndex?: PdfIndex; }): Promise; export {}; //# sourceMappingURL=draft.d.ts.map