import { type ProposalBasis } from "./proposals.js"; import { type Entry, type Op, type Suggestion } from "./ops.js"; import { type HandoverPlacement } from "./handover.js"; import type { Board } from "./model.js"; /** A board is one JSONL file under .staves/ in the project. */ export declare class Store { dir: string; constructor(dir: string); file(board: string): string; list(): Promise; /** Whether this board exists at all, so a read can refuse a name nobody wrote rather than * answering about an empty board or quietly creating one. */ has(board: string): Promise; /** When this board last changed *here*. An event log carries the timestamps of the work it * describes, which is not the same thing: a log replayed into a new workspace is new to that * workspace however old its entries are. Listings should order by this, or a board that arrived a * minute ago sorts below everything and reads as missing. */ touchedAt(board: string): Promise; /** Delete only an explicitly named board; callers obtain user confirmation first. */ deleteBoard(board: string): Promise; protected readLog(board: string): Promise<{ entries: Entry[]; revision: number; }>; /** Persistence seam: remote adapters atomically check the captured revision. */ protected writeLog(board: string, entries: Entry[], _revision: number, mode: "append" | "replace"): Promise; entries(board: string): Promise; private memo; board(board: string): Promise; private loadBoard; proposals(board: string): Promise; /** Append ops. `propose` makes them proposals: recorded, not applied until a person accepts. */ private writes; append(board: string, ops: Op[], by: string, propose?: boolean, preconditions?: ProposalBasis[], suggestions?: (Suggestion | undefined)[]): Promise; private appendUnlocked; proposeHandover(board: string, jobId: string, toTrack: string, basis?: string, placement?: HandoverPlacement): Promise<{ plan: import("./handover.js").HandoverPlan; seq: number; }>; /** Undo the last human entry that touched an entity: append a revert to its prior state. Returns the reverted entry or null. */ undo(board: string, by?: string): Promise; /** Redo: undo the last human revert that has not itself been reverted. */ redo(board: string, by?: string): Promise; /** Merge another log of the same board (another machine, another branch). Ops whose basis no longer holds become proposals. Deterministic: sorted by id. */ merge(board: string, other: Entry[]): Promise<{ added: number; demoted: number; }>; /** Return the captured reference, or explicitly label the recoverable legacy reference. */ baseline(board: string): Promise; /** Capture applied state once. Pending proposals do not become design facts. */ branch(base: string, name: string, title: string, baselineName?: string, capturedBy?: string): Promise; watch(cb: () => void): () => void; } /** A checkout is its own project: a nested repository or worktree never inherits its parent's * boards, so the walk searches the directory holding `.git` and then stops there. */ export declare function findStavesDir(start?: string): string;