/**
 * `totem mail` — canonical cross-repo outbox poll (ADR-106 § 3 / ADR-107).
 *
 * Senders write to their own `<repoRoot>/.totem/orchestration/<sender-agent>/outbox/*.md`
 * with `to: <recipient-agent>` (or `to: broadcast`) in the frontmatter.
 * Recipients invoke this command at session-start (typically via a
 * vendor-specific hook in `.claude/hooks/` or `.gemini/hooks/`) to surface
 * unread mail addressed to themselves.
 *
 * SELF_AGENTS resolution flows through `resolveSelfAgents` from
 * `@mmnto/totem` (env > config.json > basename map). Workspace defaults to
 * the parent directory of the calling repo, overridable via the
 * `TOTEM_WORKSPACE` env var or `--workspace` flag.
 *
 * Ports the strategy-side reference implementation
 * (`mmnto-ai/totem-strategy:.claude/hooks/SessionStart.cjs:pollInboundOutboxes`,
 * merged via mmnto-ai/totem-strategy#373) into a cohort-portable command
 * surface per the ADR-107 § Consequences direction.
 */
/** A single piece of mail surfaced by the poll. */
export interface MailEntry {
    /** Outbox-relative filename (e.g. `2026-05-18T1734Z-strategy-claude.md`). */
    file: string;
    /** Repo basename where the outbox lives. */
    repo: string;
    /** Sender agent-id (from frontmatter `from:` or outbox-dir name as fallback). */
    from: string;
    /** Recipient (from frontmatter `to:`, preserved verbatim). */
    to: string;
    /** ISO timestamp from frontmatter `date:`, or null if absent. */
    date: string | null;
    /** Subject line from frontmatter, or `(no subject)` if absent. */
    subject: string;
    /** Absolute path to the outbox file (useful for `--json` consumers). */
    filePath: string;
}
/** Aggregate result of a single poll. */
export interface MailPollResult {
    /** Resolution metadata describing how SELF_AGENTS was determined. */
    selfAgents: {
        agents: string[];
        source: 'env' | 'config' | 'map' | 'none';
    };
    /** Mail addressed to any SELF_AGENT or to `broadcast`, sorted newest-first. */
    mail: MailEntry[];
    /** Total files actually opened during the scan (≤ `MAX_SCAN`). */
    scanned: number;
    /** True iff the scan hit `MAX_SCAN` before exhausting the workspace. */
    truncated: boolean;
    /** Workspace directory walked (absolute). */
    workspace: string;
    /** Per-source repo failure messages — never throws, surfaces via this. */
    warnings: string[];
}
export interface MailCommandOptions {
    /** Emit JSON instead of human-readable text. */
    json?: boolean;
    /** Use the recursive variant of the ADR-106 § 3 glob (default: single-level). */
    recursive?: boolean;
    /** Workspace override (default: `TOTEM_WORKSPACE` env, else parent-of-cwd). */
    workspace?: string;
    /** Repo root override (default: `process.cwd()`). Test injection point. */
    repoRoot?: string;
    /** Env override (default: `process.env`). Test injection point. */
    env?: Record<string, string | undefined>;
}
/**
 * Programmatic entry point. Returns a structured `MailPollResult` for
 * consumers that want to render their own output (hooks, MCP audits,
 * future surfaces). The CLI wrapper calls this then formats the result
 * for human consumption.
 *
 * Never throws — filesystem failures degrade to warnings on the result.
 */
export declare function pollMail(opts?: MailCommandOptions): MailPollResult;
export declare function mailCommand(opts?: MailCommandOptions): Promise<MailPollResult>;
//# sourceMappingURL=mail.d.ts.map