/** Public surface of a finished slice. */ export interface SliceContract { readonly sliceId: string; readonly sessionId: string; readonly completedAt: string; /** Public exports (function / class / const / var names). */ readonly exports: readonly string[]; /** Public type names. */ readonly types: readonly string[]; /** Public function / method signatures, e.g. `"validateDag(dag: SliceDag): void"`. */ readonly publicSignatures: readonly string[]; /** Optional: which downstream slice IDs the contract is broadcast-ready for. */ readonly broadcastTo?: readonly string[]; /** SHA-256 hash of the contract payload (key-sorted, JSON-canonicalized). */ readonly contractHash: string; } export type WriteContractInput = Omit & { readonly completedAt?: string; }; /** Thrown when contract IO fails. */ export declare class ContractStoreError extends Error { readonly code: "CONTRACT_STORE_ERROR"; constructor(message: string); } export declare const CONTRACT_TTL_DAYS = 30; /** * (older than CONTRACT_TTL_DAYS or already GC'd)? Mirrors * `isOrphanChannel` and `isOrphanDispatchRecord` so a future * `peaks sub-agent cleanup` umbrella can run all three sweeps * (shared channel + dispatch record + contract) in one pass. */ export declare function isOrphanContract(opts: { projectRoot: string; sessionId: string; sliceId: string; now?: Date; }): boolean; /** Resolve the contracts directory for a session. */ export declare function contractsDir(projectRoot: string, sessionId: string): string; /** Resolve a single contract file path. */ export declare function contractPath(projectRoot: string, sessionId: string, sliceId: string): string; /** Hash a contract payload. */ export declare function hashContract(c: WriteContractInput | SliceContract): string; /** * Persist a slice's public contract. Returns the absolute path on disk. * Idempotent: re-writing the same contract overwrites in place. */ export declare function writeContract(projectRoot: string, sessionId: string, input: WriteContractInput): { path: string; contract: SliceContract; }; /** Read a contract from disk. Returns null if missing. */ export declare function readContract(projectRoot: string, sessionId: string, sliceId: string): SliceContract | null; /** List all contracts for a session. */ export declare function listContracts(projectRoot: string, sessionId: string): readonly SliceContract[]; /** * Format a prompt-injection block from a set of contracts. The block is a * stable, human-readable summary suitable for splicing into a downstream * slice's dispatch prompt. */ export declare function formatContractInjection(contracts: readonly SliceContract[]): string;