import type { ProjectContextManager } from "./project-context-manager.js";
import type { StaffManager } from "./staff-manager.js";
import type { InboxNudger } from "./inbox-nudger.js";
import type { InboxEntry, InboxEntryState, InboxEntrySource } from "./inbox-store.js";
export type { InboxEntry, InboxEntryState, InboxEntrySource } from "./inbox-store.js";
/**
 * Facade over per-project `InboxStore`s. Provides a single point for
 * server.ts / REST handlers / inbox-tool extension code to enqueue work,
 * transition state, prune, and list — without having to know which
 * project's store actually owns a given staff record.
 *
 * Side effects per mutation:
 *  - Persists to the underlying `InboxStore` (synchronous JSON write).
 *  - Broadcasts a WS event via the injected `broadcastToAll`:
 *      "inbox.entry.added" | "inbox.entry.updated" | "inbox.entry.removed".
 *  - `enqueue` additionally calls `nudger.poke(staffId)` so an idle staff
 *    session is woken on the next tick (or earlier — `poke` schedules a
 *    one-shot tickOne on the next microtask).
 *
 * The nudger is wired in via `setNudger` after both objects are
 * constructed, breaking the construction-time cycle between
 * `InboxManager` and `InboxNudger`.
 */
export declare class InboxManager {
    private nudger;
    private readonly pcm;
    /** Held for API parity with the design doc; reserved for higher-layer lookups. */
    private readonly staffManager;
    private readonly broadcastToAll;
    constructor(pcm: ProjectContextManager, staffManager: StaffManager, broadcastToAll: (event: unknown) => void);
    /**
     * Look up the staff record across all projects. Equivalent to
     * `staffManager.getStaff` but kept here so InboxManager can be unit-tested
     * with a thin PCM-only mock that doesn't require a full StaffManager.
     */
    hasStaff(staffId: string): boolean;
    setNudger(nudger: InboxNudger): void;
    private resolveStore;
    /**
     * Append a new entry. The returned entry has `id`, `createdAt` and
     * `state: "pending"` populated. Throws if no staff record with the
     * given id can be found across any project.
     */
    enqueue(staffId: string, input: {
        title: string;
        prompt: string;
        context?: string;
        source: InboxEntrySource;
    }): InboxEntry;
    listForStaff(staffId: string, state?: InboxEntryState, limit?: number): InboxEntry[];
    /**
     * Mark an entry as completed. The entry must currently be in the
     * `pending` state — calls with any other state throw. Sets
     * `completedAt` and (optionally) `result`.
     */
    transitionToCompleted(staffId: string, entryId: string, summary?: string): InboxEntry;
    /**
     * Move a pending entry to one of the non-success terminal states
     * (`failed` or `cancelled`). The required `reason` is stored on
     * `entry.error` for UI/audit. Throws if the entry isn't currently
     * pending.
     */
    transitionToTerminal(staffId: string, entryId: string, outcome: Exclude<InboxEntryState, "pending" | "completed">, reason: string): InboxEntry;
    /** Manual prune from the UI / DELETE endpoint. Returns false if no entry matched. */
    remove(staffId: string, entryId: string): boolean;
    /**
     * Wipe the entire inbox for a staff (used by `StaffManager.deleteStaff`).
     * Resolves the owning store via `resolveStore`; falls back to a scan of
     * every project's `inboxStore` when the staff record has already been
     * removed from `staffStore` (e.g. delete order is `staffStore.remove`
     * before `inboxManager.removeAll`). No WS event — clients learn via the
     * staff deletion broadcast.
     */
    removeAll(staffId: string): void;
}
//# sourceMappingURL=inbox-manager.d.ts.map