/** * Ask Cleo Nexus, read-only, whether it holds ANY history of a project: a * checkpoint or a journal segment from any device (T13231). `cleo doctor * row-identity --refill` needs this answer before re-deriving the row identity * of a Nexus-linked store: a uid in the cloud must never be rewritten locally. * * Every linked origin is asked with this machine's device credential. Nothing * is written, locally or remotely: no lease, no key minting, no replica bind. * * @task T13231 * @module cloud/nexus-project-history */ import type { RowIdentityNexusAnswer } from '@cleocode/contracts'; import { type ResponseSchema } from './http.js'; import { type NexusVaultOptions } from './nexus-vault-keys.js'; /** * The read-only slice of a vault connection the probe needs: a request whose * failure stays a raw {@link NexusError}, so the probe can tell the server's * "stream not found" from every other 404. */ export interface NexusStreamReader { raw(method: string, path: string, schema: ResponseSchema): Promise; } /** Opens a reader for one origin; defaults to {@link connectNexusVault}. */ export type NexusStreamReaderFactory = (apiUrl: string) => Promise; /** * What one stream holds: its head and its checkpoint count. Only two answers * count as "nothing": a stream that exists with no checkpoint and head 0, and * the server's explicit "stream not found" for a project the caller can see. * Every other failure, including any other 404, is thrown (the caller treats * it as unknown). * * @param reader - An authenticated reader. * @param streamId - The project's stream. * @returns Checkpoint count and head sequence. * @task T13231 */ export declare function nexusStreamHistory(reader: NexusStreamReader, streamId: string): Promise<{ checkpoints: number; headSeq: number; }>; /** * Ask every origin the project is linked to whether it holds a checkpoint or * a journal segment of the project, from any device. * * @param projectRoot - Project root (its `nexus-link.json` names the origins). * @param options - Connection options, or a reader factory (tests). * @returns One answer per linked origin; an unreadable link entry is an `error` answer. * @task T13231 */ export declare function askNexusProjectHistory(projectRoot: string, options?: NexusVaultOptions & { readerFor?: NexusStreamReaderFactory; }): Promise; //# sourceMappingURL=nexus-project-history.d.ts.map