import type { StoredMessage } from './client-wire.js';
/**
 * A sub-agent the conversation started and did not wait for. The chat is free while it works, so a
 * client has to be able to say what is still running and to show the answer when it lands — neither
 * of which the turn that started it can report, because that turn is over.
 */
export interface BackgroundRun {
    /** The run doing the work. Also what stamps the message it eventually posts. */
    runId: string;
    /** The agent working on it. */
    agent: string;
    /** The `agent`-kind call that started it — what a UI keys its card off. */
    toolCallId: string;
    toolName: string;
    /**
     * `delivered` the moment the thread holds a message stamped with this run. A run that FAILED
     * reads as delivered too: it posts a message saying so, which is the point — there is no third
     * state a reader could act on differently, and "running" for ever is the state to avoid.
     */
    status: 'running' | 'delivered';
    /** The message it posted, once it did. */
    message?: StoredMessage;
}
/**
 * Every sub-agent this thread started in the background, and whether each has reported back.
 *
 * Derived from the transcript rather than tracked in session state, so it survives a reload and a
 * second tab: the receipt is a persisted tool result, and the answer is a persisted message stamped
 * with the run that wrote it. Nothing here needs a live connection to be true.
 */
export declare function backgroundRunsFromThread(messages: readonly StoredMessage[]): BackgroundRun[];
//# sourceMappingURL=background-runs.d.ts.map