UNPKG

@nomyx/assistant

Version:

A powerful assistant library and cli for your AI projects. works with Vertex AI (Claude and Gemini)

42 lines (41 loc) 1.31 kB
import * as estree from 'estree'; export declare class CodeEditor { private fileCache; private workerPool; constructor(options?: { maxCacheSize: number; cacheMaxAge: number; workerCount: number; }); private createWorkerPool; private getWorker; private runWorkerTask; open(filePath: string): Promise<void>; read(filePath: string): Promise<string | null>; write(filePath: string, content: string): Promise<void>; search(pattern: string, options?: { flags: string; }): Promise<{ filePath: string; matches: RegExpMatchArray; }[]>; replace(pattern: string, replacement: string, options?: { flags: string; }): Promise<{ filePath: string; content: string; changesApplied: boolean; }[]>; transform(transformation: (ast: estree.Node) => estree.Node, filePath: string): Promise<void>; diff(filePath: string): Promise<string>; listFiles(directory: string): Promise<string[]>; private generateDiff; format(input: string): Promise<string>; private generateFormattedCode; applyChanges(filePath: string, changes: any): Promise<{ success: boolean; message: string; }>; private applyChangesToContent; close(): Promise<void>; }