import { type FileSystem } from "@davidsouther/jiffies/lib/cjs/fs.js"; import type { EngineDebug, Message } from "../engine/index.js"; import type { Tool } from "../engine/tool.js"; import type { MCPClient, MCPConfig } from "../mcp.js"; import { type PromiseWithResolvers } from "../util.js"; export declare const EXTENSION = ".ailly.md"; export interface Content { path: string; outPath: string; name: string; prompt: string; response?: string; responseStream?: PromiseWithResolvers>; context: Context; meta?: ContentMeta; } export interface Context { view: false | View; system?: System[]; predecessor?: string; folder?: string[]; augment?: { score: number; content: string; name: string; }[]; edit?: { start: number; end: number; file: string; } | { after: number; file: string; }; mcpClient?: MCPClient; } export interface ContentMeta { root?: string; out?: string; text?: string; context?: "conversation" | "folder" | "none"; parent?: "root" | "always" | "never"; continue?: boolean; messages?: Message[]; skip?: boolean; skipHead?: boolean; isolated?: boolean; combined?: boolean; debug?: EngineDebug; view?: false | View; prompt?: string; temperature?: number; maxTokens?: number; tools?: Tool[]; mcp?: MCPConfig; } export type AillyEditReplace = { start: number; end: number; file: string; }; export type AillyEditInsert = { after: number; file: string; }; export type AillyEdit = AillyEditReplace | AillyEditInsert; export declare const isAillyEditReplace: (edit: AillyEdit) => edit is AillyEditReplace; export type Value = string | number | boolean; export interface View extends Record { } export interface System { content: string; view: false | View; } export type Ordering = { id: string; type: "prompt" | "response"; } | { id: string; type: "system"; } | { type: "ignore"; }; export declare const splitOrderedName: (name: string) => Ordering; /** * 1. When the file is .aillyrc.md * 1. Parse it into [matter, prompt] * 2. Use matter as the meta data base, and put prompt in the system messages. * 2. When the file name is `.` (but not `..ailly`) * 1. Read ..ailly as the response * 1. Write the output to `..ailly` * 3. If it is a folder * 1. Find all files that are not denied by .gitignore * 2. Apply the above logic. * @param fs the file system abstraction. * @param system the system message chain. * @param meta current head matter & settings. * @param depth maximum depth to load. `1` loads only the cwd; 0 or negative loads no content. * @returns */ export declare function loadContent(fs: FileSystem, parent?: { system?: System[]; meta?: ContentMeta; }, depth?: number): Promise>; export declare function loadAillyRc(fs: FileSystem, system: System[], meta: ContentMeta): Promise<[System[], ContentMeta]>; /** * Create a "synthetic" Content block with path "/dev/stdout" to serve as the Content root * for this Ailly call to the LLM. */ export declare function makeCLIContent({ prompt, argContext, argSystem, context, root, edit, view, isolated, }: { prompt: string; argContext: "none" | "folder" | "conversation"; argSystem?: string; context: Record; root?: string; edit?: AillyEdit | undefined; view?: View; isolated?: boolean; }): Content; /** The responseStream is for coordinating generation, not writing, of content. */ export type WritableContent = Omit & Partial>; export declare function writeContent(fs: FileSystem, content: WritableContent[], options?: { clean?: boolean; }): Promise; //# sourceMappingURL=content.d.ts.map