import type { ToolInvocation } from '@variance-authority/mcp/tools'; import type { Help } from '@variance-authority/package/help'; /** Whether a file last written at `mtimeMs` was written after a read that began at `since`, as `movedSince` in sense compares one. */ export declare function writtenSince(mtimeMs: number, since: number): boolean; /** * Whether the files an answer rests on changed after the generation it comes * from began its read, so that it goes to {@link caughtUp} to be asked again: * a file gone, or an mtime after that read began, as `movedSince` in sense * compares one. A refresh limited to a list, made during the request that began * at `started`, keeps the time of the read it refreshed and is taken at its word, * so it is not looked at; any other generation is, the one read whole during the * request as well. A question its tool refuses rests on what it rested on in * `before`, the generation it was answered from; with none it has nothing to look at. */ export declare function outlived(asked: string | undefined, help: Help, input: Readonly>, invocation: ToolInvocation & { readonly root: string; }, started: number, before?: Help): Promise; /** * What a source question does before an answer {@link outlived} found changed * is believed, on `variance serve` and this package's server, which hold a * generation across requests. A refusal, and a name not found, is not brought here: it answers * from the generation it was refused from, whose date line says when the checkout * was not compared with it, and keeping that generation fresh is `variance index`'s * job. `answeredAt` is the generation the answer came from. `again` reads a * generation made now and asks once more, and `still` looks once at what that * read gave, or with no subject at the generation `answeredAt` dates, when it * was made during the question and is not read again. Undefined when * nothing it read can have lagged the checkout, so the answer stands. */ export declare function caughtUp(answeredAt: string | undefined, started: number, again: () => Promise, still?: (subject?: Answer) => Promise): Promise | undefined>; /** * Whether the generation dated `at` was made before the question that began at * `started`. A found answer from it is looked at again when `outlived`; a * refusal from it is not read again, and says so in its date line. */ export declare function madeBefore(at: string | undefined, started: number): boolean; /** * What {@link caughtUp} asked again, and what an answer it could not bring up to date says. * The shape is the one `serve` from `@variance-authority/mcp` takes back from * its `again` hook, so a server hands it on as it is. */ export interface CaughtUp { /** What the question was asked again of, brought up to date; absent when nothing could be read. */ readonly subject?: Answer; /** The date line of an answer that could not be read again, saying why; a found answer's own date line says it from `unseen`. */ readonly footer?: string; /** Why the checkout was not compared with the answer, for its date line; when no `subject` came back, `footer` opens with that line. */ readonly unseen?: string; } /** * The line under an answer that found nothing: the date of the generation it * was read from (`at`), saying the checkout was not compared with it when * `unseen` says so, or `caught` says why it could not be. */ export declare function foundNothingFooter(caught: CaughtUp | undefined, at: string | undefined, unseen: boolean): string | undefined; /** * The line under any other refusal, which carries a date only when the checkout * was not compared with what it came from (`unseen`), as {@link foundNothingFooter} words it. */ export declare function refusalFooter(at: string | undefined, unseen: boolean): string | undefined; /** * The answer a question gives when what it threw is a {@link FoundNothing}, for * every surface that asks one — `variance ask`, `variance serve`, and this * package's binary and server — so a name nothing declares reads the same on * each: what was read and found nothing, then {@link foundNothingFooter}'s * line. Undefined for any other throw, which stays a refusal. */ export declare function foundNothingAnswer(thrown: unknown, caught: CaughtUp | undefined, at: string | undefined, unseen: boolean): string | undefined; /** * The line that dates a source answer. A generation read without comparing it * with the checkout says so, since a name missing from it may only be newer; * `unseen` as a sentence is why a comparison that was asked for was not made. */ export declare function snapshotLine(at: string, unseen: boolean | string): string; //# sourceMappingURL=caught-up.d.ts.map