/** * What the server is doing while it cannot answer yet. * * A first start with an empty database indexes the whole packages directory * before `dbReady` resolves, and that is tens of minutes on a real install. * Every symbol-backed tool called meanwhile is answered with "still loading, * retry" — and until this module existed that sentence was all there was, the * same characters on the first attempt and on the twentieth, with no way for a * user to tell a build that is progressing from a server that has died. The * startup path publishes its phase here and the tool handler reads it, so the * wait says where it has got to and roughly what is left. * * Deliberately a module-level singleton rather than something on the context: * the writer is a worker-message handler in the startup sequence and the reader * is the tool dispatcher, and threading a channel between those two would touch * every layer in between to carry a string. */ import type { IndexProgress } from '../metadata/symbolIndex.js'; interface StartupIndexState { progress: IndexProgress; /** When this phase was entered — the basis for "N min in". */ at: number; /** When the build itself started, so elapsed survives a phase change. */ startedAt: number; } /** Note that a first-start index build has begun (before its first phase lands). */ export declare function startupIndexBegan(now?: number): void; /** Record the phase the build has reached. */ export declare function setStartupIndexProgress(progress: IndexProgress, now?: number): void; /** * Forget the build. Called on success AND on failure: a stale phase outliving * the build it described would make the next "still loading" answer — which * would then be about something else entirely — cite a model that finished * indexing minutes ago. */ export declare function clearStartupIndexProgress(): void; /** The raw state, for tests and for callers that want to render it themselves. */ export declare function getStartupIndexProgress(): Readonly | null; /** * The whole answer a tool gets when it gave up waiting for the database. * * Lives here rather than in the dispatcher because the wording is a function of * the startup state this module owns — and because the dispatcher's job is to * route, which a layering test enforces by line count. */ export declare function describeDbWait(toolName: string, now?: number): string; /** * One sentence describing the build in flight, or null when none is. * * Says elapsed time rather than an estimate to completion. The models are * indexed largest-first and differ by two orders of magnitude in size, so * "3 of 32 models" is not 9 % of the work and any percentage derived from it * would be a confident lie — the honest signal is that the count keeps moving. */ export declare function describeStartupIndex(now?: number): string | null; export {}; //# sourceMappingURL=startupProgress.d.ts.map