/** Single terminal-event owner for a runtime run and its asynchronous work. */ import type { ActionResult } from "../types/components.js"; import type { EffectReceipt } from "../types/effects.js"; import type { Memory } from "../types/memory.js"; import type { TurnOutcome } from "../types/message-service.js"; import type { UUID } from "../types/primitives.js"; import type { IAgentRuntime } from "../types/runtime.js"; import type { RoomHandlerLease } from "./room-handler-queue.js"; /** * Owns asynchronous continuations whose provider, model, or database-trajectory * captures belong to one message-service run. Delivery returns as soon as the * visible result is ready; the detached terminal waits for this set to quiesce, * then emits exactly one `RUN_ENDED` event. File-recorder finalization and * bounded inference-timing persistence are diagnostic-only and intentionally * drain independently. A run-owned task may not join after terminalization is * requested. */ export declare class RunTerminalOwner { private readonly runtime; private readonly runId; private readonly message; private readonly startTime; private readonly roomHandlerLease?; private readonly pending; private settledEffects; /** Capture handler settlement before host callbacks or reply generation can fail. */ recordActionResult(result: ActionResult): void; get effects(): readonly EffectReceipt[]; private terminalRequest; private terminalTask; constructor(runtime: IAgentRuntime, runId: UUID, message: Memory, startTime: number, roomHandlerLease?: RoomHandlerLease | undefined); track(label: string, task: () => Promise): Promise; adopt(label: string, task: Promise): Promise; /** Evidence extraction must observe the connector's settled persisted reply, * including delivery receipts/callback history, not its provisional row. */ trackAfterDelivery(label: string, task: () => Promise): Promise; request(outcome: TurnOutcome, error?: unknown): Promise; }