import type { IsoDate } from './dates.js'; import { type Occasion, type OccasionAckSource, type OccasionAcknowledgement, type OpenItem } from './types.js'; export type { OccasionAckSource } from './types.js'; export { OCCASION_ACK_SOURCES, isOccasionAckSource } from './types.js'; /** The narrow slice of the state store this path writes through. */ export interface AcknowledgeStore { recordAnswer(entry: OccasionAcknowledgement): Promise; openItem(id: string): Promise; putOpenItem(item: OpenItem): Promise; } export interface AcknowledgeInput { readonly occasion: Occasion; readonly occurrence: IsoDate; readonly now: number; readonly source: OccasionAckSource; } /** What an acknowledgement did, in terms a surface can say back to the owner. */ export interface AcknowledgeOutcome { readonly occasionId: string; readonly occurrence: IsoDate; readonly source: OccasionAckSource; /** True when an open item existed and was quieted rather than created. */ readonly quietedExisting: boolean; } /** * Record that the owner has this occurrence in hand. * * Two writes, in this order and for this reason. The answer goes down first * because it is what the sweep reads: if the process died between the two, the * push would already be muted and the worst outcome would be an open item that * is quiet but not marked spent, quiet either way. The other order could leave * the owner acknowledged in their own mind and pushed at by the machine, which is the * failure this file exists to end. * * The open item is marked as having served both boundaries as well as being * answered. Belt and braces on purpose: the mute then survives an * acknowledgement being reaped early, and a surface reading only the item can * still see that it will not speak. */ export declare function acknowledgeOccurrence(store: AcknowledgeStore, input: AcknowledgeInput): Promise; /** * What to say back when an acknowledgement lands. * * Names the occasion and states BOTH halves, this one is quiet, everything * else still runs. The second half is not filler. When the owner complained * about being reminded of their own birthday hourly, the answer was to switch * the whole feature off, which also switched off their wife's birthday; a reply that says * what was silenced and what was not is how that stays visible at the moment it * happens rather than being discovered in November. */ export declare function acknowledgementReply(occasionTitle: string): string; //# sourceMappingURL=acknowledge.d.ts.map