import type { CompletionDispatchDurability } from "../completion-outbox/coordinator.ts"; import type { CompletionDispatchSeed, CompletionKind, CompletionReplyTarget, CompletionTarget } from "../public/v1/completion-durability.ts"; export interface ParallelCompletionCoordinator { beginDispatch(seed: CompletionDispatchSeed): Promise; requireNotification(input: { dispatchId: string; reservationId: string; kind: CompletionKind; requiredAt: number; }): Promise; abandon(seed: CompletionDispatchSeed, reason: string): Promise; settleForeground(seed: CompletionDispatchSeed): Promise; } export interface ParallelCompletionSeedOptions { parentDispatchId: string; taskCorrelationIds: readonly string[]; originCwd: string; createdAt?: number; reservationId?: () => string; } export interface ParallelCompletionAdmissionOptions extends ParallelCompletionSeedOptions { target: CompletionTarget; replyTarget: CompletionReplyTarget; coordinator: ParallelCompletionCoordinator; } export interface ParallelCompletionSnapshot { total: number; ready: number; failed: number; remaining: number; } export interface ParallelCompletionDelivery { correlationId: string; value: T; snapshot: ParallelCompletionSnapshot; } type ParallelCompletionState = "buffering" | "activating" | "active" | "foreground" | "abandoned"; export declare class ParallelCompletionController { #private; private constructor(); static nonDurable(options: ParallelCompletionSeedOptions): ParallelCompletionController; static admit(options: ParallelCompletionAdmissionOptions): Promise>; get durable(): boolean; get state(): ParallelCompletionState; seedFor(correlationId: string): CompletionDispatchSeed | undefined; completionIdentity(correlationId: string): Pick | undefined; record(correlationId: string, value: T, failed: boolean): ParallelCompletionDelivery | undefined; activateNotifications(kind?: CompletionKind): Promise[]>; retry(correlationId: string): ParallelCompletionDelivery | undefined; finishDelivery(correlationId: string, delivered: boolean): void; settleForeground(): Promise; abandon(reason: string): Promise; snapshot(): ParallelCompletionSnapshot; } export declare function formatParallelCompletionStatus(snapshot: ParallelCompletionSnapshot): string; export declare function formatParallelCompletionMessage(input: { label: string; correlationId: string; resourceUri: `agent://${string}`; resultSummary: string; snapshot: ParallelCompletionSnapshot; maxBytes?: number; }): string; export {};