/** * Turning `@path` in a message into the file itself. * * Referencing a file has to mean something by the time the model reads the message. Two ways to make * it mean something: * * - leave the path in the text and let the model call `read_files` — cheap, and costs a round trip; * - put the content in the message — one turn, and spends the tokens whether they were needed. * * KONECK does the second, and the picker shows what it will cost before the reference is made, which * is what makes the choice a choice rather than a surprise. The number beside the filename in the * dropdown is this. Nothing here decides on anybody's behalf that a file is too large to include: * the size is stated up front and the person picking is the one who knows whether it is worth it. * * A directory becomes its listing rather than its contents, which is not a limit but a different * thing being asked for — `@src` means "here is what is in src", and twenty files pasted end to end * is not that. */ /** One thing the message referred to, and what came of looking for it. */ export interface Resolved { /** As written, without the @. */ ref: string; kind: 'file' | 'dir' | 'missing' | 'binary' | 'unreadable'; /** The text to give the model: the file, or the listing. */ content?: string; /** Why nothing was included, when nothing was. */ note?: string; } /** * The references in a draft. * * `@` counts only at a word boundary, matching the picker's own rule, so an email address and an npm * scope in a sentence are left alone. Trailing punctuation is dropped because people write "look at * @src/engine.ts, it's the loop" and the comma is not part of the name. */ export declare function referencesIn(text: string): string[]; /** * How many lines a body actually has. * * Splitting on the newline and taking the length counts one too many for any file that ends in one, * which is nearly all of them: "one\ntwo\n" splits into three pieces and is two lines. It said * 3 lines for a 2-line file until a test insisted on the number. */ export declare function linesIn(content: string): number; /** * Reads one reference. * * A reference that does not resolve is reported rather than dropped: silently ignoring `@src/engien.ts` * leaves somebody wondering why the model never mentioned the file they attached, and a one-line * "no such path" in the message answers that immediately. */ export declare function resolveOne(cwd: string, ref: string): Promise; /** * The message with everything it referred to attached beneath it. * * Beneath rather than inline, so the sentence a person wrote stays the sentence the model reads * first. The blocks are fenced with a name and a line count because a model given eight hundred * unlabelled lines cannot cite where anything came from. */ export declare function attachReferences(cwd: string, text: string): Promise<{ text: string; attached: Resolved[]; }>; //# sourceMappingURL=mention-resolve.d.ts.map