trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
39 lines • 1.34 kB
TypeScript
import type { JournalMeta, RemoteRepoInfo } from '../vcs/oplog-remote.js';
export declare const CHECKPOINT_RETENTION = 8;
export interface LedgerPushPayload {
repoId: string;
previousTail?: string;
tailHash: string;
format: string;
byteLength: number;
lineCount: number;
checkpoint: string;
/** Owner entity id (`identity:<did>`) — ADR 0032. */
owner?: string;
/** Repo slug scoped under the owner. */
name?: string;
}
export type LedgerPushResult = {
ok: true;
meta: JournalMeta;
} | {
ok: false;
reason: 'tail-mismatch';
};
export declare function validateJsonl(raw: string): void;
export declare class LedgerStore {
private readonly dataRoot;
constructor(dataRoot: string);
private repoRoot;
getTail(repoId: string): JournalMeta | null;
getCheckpoint(repoId: string, tailHash: string): string | null;
/** Client checkpoint GET has no repoId — scan repos (matches MemoryRemoteSprite). */
findCheckpointByHash(tailHash: string): string | null;
/** List hosted ledgers for discovery / clone (`GET /v0/ledger/repos`). */
listRepos(): RemoteRepoInfo[];
private readProjectMeta;
private writeProjectMeta;
push(payload: LedgerPushPayload): LedgerPushResult;
private trimCheckpoints;
}
//# sourceMappingURL=ledger-store.d.ts.map