export type InboxEntryState = "pending" | "completed" | "failed" | "cancelled";
export interface InboxEntrySource {
    type: "trigger" | "manual_api" | "manual_ui";
    /** Set when source.type === "trigger". The trigger id from PersistedStaff.triggers[].id. */
    triggerId?: string;
    /** Optional caller identifier for manual_api / manual_ui sources (e.g. user id, integration name). */
    actorId?: string;
}
export interface InboxEntry {
    id: string;
    staffId: string;
    source: InboxEntrySource;
    title: string;
    prompt: string;
    context?: string;
    state: InboxEntryState;
    createdAt: number;
    completedAt?: number;
    result?: string;
    error?: string;
}
/**
 * Per-staff JSON-file store of inbox entries.
 *
 * Persistence layout: `<stateDir>/inbox/<staffId>.json` — one file per staff,
 * containing a JSON object `{ staffId, entries: InboxEntry[] }` with entries
 * in insertion (FIFO) order.
 *
 * Loads are lazy: a staff's file is read on first access and cached in
 * memory. Writes flush the full file synchronously. The class mirrors
 * `StaffStore` semantics (synchronous fs, no migrations) so that the store
 * is safe to use from any code path that already deals with `StaffStore`.
 */
export declare class InboxStore {
    private readonly inboxDir;
    /** staffId → entries (in-memory cache; populated on first access). */
    private byStaff;
    /** Marks the per-staff files we have already attempted to load. */
    private loaded;
    constructor(stateDir: string);
    private fileFor;
    private ensureLoaded;
    private save;
    /** Insert or replace an entry. Last-writer-wins on id collision. */
    put(entry: InboxEntry): void;
    get(staffId: string, entryId: string): InboxEntry | undefined;
    /** All entries for a staff, in FIFO (insertion) order. */
    list(staffId: string): InboxEntry[];
    listPending(staffId: string): InboxEntry[];
    /**
     * Apply a shallow patch to an entry. `id`, `staffId` and `createdAt` are
     * immutable. Undefined values in `updates` are skipped; explicit `null`
     * deletes the field. Returns false if the entry doesn't exist.
     */
    update(staffId: string, entryId: string, updates: Partial<Omit<InboxEntry, "id" | "staffId" | "createdAt">>): boolean;
    remove(staffId: string, entryId: string): boolean;
    /** Wipe the entire inbox for a staff (used when a staff is deleted). */
    removeAll(staffId: string): void;
}
//# sourceMappingURL=inbox-store.d.ts.map