/** A human's decision on a finding. Persisted; drops the finding from the open inbox. */ export type InboxAction = 'approve' | 'revise' | 'skip'; export declare const INBOX_ACTIONS: InboxAction[]; /** * Finding kind, ordered by urgency (higher = more urgent): * dead (3) — a running loop gone silent, or one reported dead * killed (2) — halted by a brake/budget, or with a pending kill request * completed (1) — finished cleanly; still wants a human glance */ export type FindingKind = 'dead' | 'killed' | 'completed'; /** A loop "lost money" when it spent tokens but landed no accepted change. */ export interface InboxFinding { id: string; loopId: string; repo: string; kind: FindingKind; urgency: number; title: string; reason: string; goal: string; autonomyLevel: string; iteration: number; gateVerdict: string; tokensUsed: number; accepted: number | null; /** true when the loop is terminal, spent tokens, and reported 0 accepted changes. */ noChangesAccepted: boolean; lastHeartbeat: string; } interface AckRecord { action: InboxAction; loopId: string; kind: FindingKind; at: string; } type AckStore = Record; /** * Load the ack store. A corrupt file is quarantined and reported LOUD rather * than silently reset to {} — a silent reset would resurface every finding a * human already triaged. */ export declare function loadAcks(): AckStore; /** * Open findings across every repo, most urgent first (dead > killed > completed), * ties broken by most-recent activity. Findings a human already triaged (there is * an ack for `${loopId}::${kind}`) are resolved and excluded. */ export declare function computeFindings(now?: Date): InboxFinding[]; export interface AckResult { ok: boolean; id?: string; action?: InboxAction; error?: string; } /** Persist a human's decision on a finding. Idempotent (last write wins). */ export declare function ackFinding(id: string, action: InboxAction): AckResult; /** * Morning handoff note: a markdown digest of every loop that reached a terminal * status (completed / halted / dead) in the last 24h — verdicts and token costs, * grouped by outcome. Meant to be read or copied at the start of the day. */ export declare function buildHandoffNote(now?: Date): string; export interface InboxView { findings: InboxFinding[]; handoff: string; counts: { dead: number; killed: number; completed: number; total: number; }; } /** Full inbox payload for the API/view: open findings + handoff note + counts. */ export declare function buildInbox(now?: Date): InboxView; export {};