import type { LinkType, MemoryKind } from "./constants.js"; /** * The proposal store: on-disk review artifacts for the sleep/dream flow. * Proposals live OUTSIDE the memory corpus, under `/sleeps/` and * `/dreams/`, as user-editable markdown (frontmatter + body). An * agent drafts a proposal; the user may hand-edit the file on disk; approval * flips `status`; apply re-reads the file fresh. Every reader here therefore * re-reads from disk rather than trusting any cached/in-memory value. */ export type ProposalType = "sleep" | "dream-memory" | "dream-link"; export type ProposalStatus = "proposed" | "applied" | "rejected"; export interface ProposalFrontmatter { type: ProposalType; project: string; status: ProposalStatus; /** sleep + dream-memory: target record identity */ kind?: MemoryKind; name?: string; /** sleep: >=2 WORK sources; dream-memory: >=1 inspiration source */ derived_from: string[]; /** dream-link only */ link?: { from: string; to: string; type: LinkType; }; rationale?: string; created_at: string; updated_at: string; } export interface Proposal { frontmatter: ProposalFrontmatter; body: string; filename: string; } /** sleep -> `/sleeps`; dream-memory | dream-link -> `/dreams`. */ export declare function proposalsDir(stateDir: string, type: ProposalType): string; export declare function writeProposal(stateDir: string, fm: Omit, body: string): Promise; export declare function readProposal(stateDir: string, type: ProposalType, filename: string): Promise; export declare function listProposals(stateDir: string, type: ProposalType, status?: ProposalStatus): Promise; export declare function setProposalStatus(stateDir: string, type: ProposalType, filename: string, status: ProposalStatus): Promise; export declare function renderProposalsText(proposals: Proposal[], type: ProposalType): string;