UNPKG

editcodewithai

Version:
15 lines (14 loc) 989 B
import type { PerformAiEditParams, PerformAiEditResult } from "./types"; import { PROMPT_TEMPLATE_VERSION, assembleFullPrompt, FORMAT_INSTRUCTIONS } from "./prompt"; import { getGenerationMetadata } from "./metadata"; import { prepareFilesForPrompt, mergeFileChanges, parseDiffs, applyDiffs, parseDiffFenced, parseUdiffs, applyUdiffs } from "./fileUtils"; export type { LlmFunction, PerformAiEditParams, PerformAiEditResult, EditFormat, } from "./types"; export { FORMAT_INSTRUCTIONS, mergeFileChanges, prepareFilesForPrompt, parseDiffs, applyDiffs, parseDiffFenced, parseUdiffs, applyUdiffs, assembleFullPrompt, getGenerationMetadata, PROMPT_TEMPLATE_VERSION, }; /** * Core AI logic for: * - Building the prompt (including context) * - Calling the provided LLM function * - Parsing and merging file changes * - Retrieving cost metadata */ export declare function performAiEdit({ prompt, files, llmFunction, apiKey, editFormat, }: PerformAiEditParams): Promise<PerformAiEditResult>;