import type { AgentChatEvent } from "./types.js"; type ConnectionRequired = Extract; /** A connection request's message, plus who can unblock it when that is known. */ export declare function connectionRequiredMessage(message: string, reason: ConnectionRequired["reason"]): string; export interface ThreadConnectionRequest { request: ConnectionRequired; /** How many of the thread's newer runs came after the one that asked. */ runsAgo: number; } /** * The connection requests among a thread's recent runs for one organization * (`null` for none), newest first. Provider connections are per organization * and a thread can be reused across them, so another org's request is neither * a note nor a slot in the window. The turn's initiator row is the only record * of a run's org, so a run without one has no provable org and is left out. * Throws when the ledger can't be read. */ export declare function readThreadConnectionRequests(threadId: string, options: { orgId: string | null; excludeRunId?: string; }): Promise; export type PriorConnectionNote = { status: "none"; } | { status: "connected"; } | { status: "blocked"; note: string; } | { status: "unreadable"; error: string; }; /** The context note a resolved state adds to the turn, or "" when it adds none. */ export declare function priorConnectionContextNote(prior: PriorConnectionNote): string; /** * The note that keeps a thread's next run from retrying a provider whose * connection request ended an earlier run in the same organization. A request * drops out once a workspace connection for that provider is available again, * or, when nothing can re-check it, after a couple of runs. A ledger that can't * be read in time is reported rather than read as "no request". */ export declare function resolvePriorConnectionNote(input: { threadId: string; /** The current run's organization; `null` when it has none. */ orgId: string | null; appId?: string; excludeRunId?: string; timeoutMs?: number; }): Promise; export {};