import { type ConversationAgentRunUsage, type ConversationRunProjection } from "./durable.js"; import { ConversationRunEventEncoder } from "./run-events.js"; import { type InvokeAgentChildRunProgressEvent, type InvokeAgentChildRunProgressInput } from "../child-run/invoke-agent-child-runs.js"; import type { ChatStreamEvent } from "../../chat/protocol.js"; import type { HostedChildLifecycleAdapter } from "../hosted/child-lifecycle.js"; import type { HostedLifecycleAdapter, HostedLifecycleTerminalState } from "../hosted/lifecycle.js"; /** Input payload for conversation hosted lifecycle finalize. */ export interface ConversationHostedLifecycleFinalizeInput { model: string; provider: string; usage?: ConversationAgentRunUsage; terminalErrorCode?: string | null; terminalErrorMessage?: string | null; } /** Options accepted by create conversation hosted lifecycle adapter. */ export interface CreateConversationHostedLifecycleAdapterOptions { authToken: string; apiUrl: string; startRun: (input: { abortSignal: AbortSignal; }) => Promise | ConversationRunProjection; mapChunkToEvents?: (chunk: TChunk, run: ConversationRunProjection) => Promise | readonly unknown[] | unknown[]; resolveFinalizeInput: (input: { run: ConversationRunProjection; terminalState: HostedLifecycleTerminalState; }) => Promise | ConversationHostedLifecycleFinalizeInput; } /** Create conversation hosted lifecycle adapter. */ export declare function createConversationHostedLifecycleAdapter(options: CreateConversationHostedLifecycleAdapterOptions): HostedLifecycleAdapter; /** Create conversation hosted stream lifecycle adapter. */ export declare function createConversationHostedStreamLifecycleAdapter(options: Omit, "mapChunkToEvents"> & { /** Encoder to reuse for the run. Defaults to a clocked run-scoped encoder. */ encoder?: ConversationRunEventEncoder; }): HostedLifecycleAdapter; /** Context for conversation child lifecycle. */ export interface ConversationChildLifecycleContext { authToken: string; apiUrl: string; parentConversationId: string; parentRunId: string; projectId?: string | null; publishParentRunEvents?: (events: InvokeAgentChildRunProgressEvent[]) => Promise | void; progress: Omit; model: string; provider: string; } /** Create conversation child lifecycle adapter. */ export declare function createConversationChildLifecycleAdapter(ctx: ConversationChildLifecycleContext): HostedChildLifecycleAdapter; //# sourceMappingURL=hosted-lifecycle.d.ts.map