/** * Durable store of owner decisions (specs/2026-10-01-decision-cards.md ยง1). * * One JSON file under CREWLY_HOME with a monotonically increasing id * counter, so `D-7` is never reused. All writes are serialised and atomic. * Settled decisions are pruned after {@link DECISION_CONSTANTS.RESOLVED_KEEP_MS}. * * @module services/decisions/decision-store */ import type { OwnerDecision } from '../../types/decision.types.js'; /** Statuses still in front of the owner. */ export declare const PENDING_DECISION_STATUSES: ReadonlySet; /** * Persistent decision store. */ export declare class DecisionStore { private readonly filePath; private readonly now; private data; private chain; /** * @param filePath - JSON file * @param now - Clock (tests) */ constructor(filePath: string, now?: () => Date); /** * Store under a CREWLY_HOME. * * @param crewlyHome - CREWLY_HOME * @returns The store */ static inHome(crewlyHome: string): DecisionStore; /** * Add a decision, assigning its id. * * @param draft - Decision without id/timestamps * @returns The stored decision */ create(draft: Omit): Promise; /** * Change a decision under the write lock. * * @param id - Decision id * @param fn - Returns the patch, or null to leave it alone * @returns The updated decision, or null when missing / unchanged */ update(id: string, fn: (d: OwnerDecision) => Partial | null): Promise; /** * One decision. * * @param id - Decision id * @returns Copy, or null */ get(id: string): Promise; /** * All decisions, newest first, optionally filtered. * * @param filter - Predicate * @returns Copies */ list(filter?: (d: OwnerDecision) => boolean): Promise; /** * The open decision whose card is this message (or whose thread this is). * * @param slackChannelId - Channel * @param ts - Card ts or thread ts * @returns Decision, or null */ findByCard(slackChannelId: string, ts: string): Promise; /** * Drop settled decisions older than the keep window. * * @returns How many were dropped */ prune(): Promise; private load; private save; private serial; } //# sourceMappingURL=decision-store.d.ts.map