import { type ConversationRunProjection } from "./durable.js"; import type { HostedLifecycleTerminalState } from "../hosted/lifecycle.js"; /** Input payload for conversation hosted terminal state. */ export interface ConversationHostedTerminalStateInput { status: HostedLifecycleTerminalState["status"]; metadata?: HostedLifecycleTerminalState["metadata"]; terminalErrorCode?: string | null; terminalErrorMessage?: string | null; } /** Shared conversation hosted stream error terminal error code value. */ export declare const CONVERSATION_HOSTED_STREAM_ERROR_TERMINAL_ERROR_CODE = "STREAM_ERROR"; /** Shared conversation hosted aborted terminal error code value. */ export declare const CONVERSATION_HOSTED_ABORTED_TERMINAL_ERROR_CODE = "ABORTED"; /** Shared conversation hosted incomplete tool calls terminal error code value. */ export declare const CONVERSATION_HOSTED_INCOMPLETE_TOOL_CALLS_TERMINAL_ERROR_CODE = "INCOMPLETE_TOOL_CALLS"; /** Input payload for resolve conversation hosted terminal state. */ export interface ResolveConversationHostedTerminalStateInput { isAborted: boolean; hasIncompleteToolParts: boolean; abortedTerminalErrorMessage?: string; incompleteToolCallsTerminalErrorMessage?: string; } /** Public API contract for conversation hosted terminal state resolution. */ export type ConversationHostedTerminalStateResolution = Pick; /** State for resolve conversation hosted terminal. */ export declare function resolveConversationHostedTerminalState(input: ResolveConversationHostedTerminalStateInput): ConversationHostedTerminalStateResolution; /** State for resolve conversation hosted stream error. */ export declare function resolveConversationHostedStreamErrorState(error: unknown): ConversationHostedTerminalStateResolution; /** Public API contract for conversation hosted terminal runtime adapter. */ export interface ConversationHostedTerminalRuntimeAdapter { terminal: Pick; } /** Options accepted by conversation hosted terminal state dispatch. */ export interface DispatchConversationHostedTerminalStateOptions { /** * Skip the durable run completion call while still reporting the terminal state * locally. Set only when the run is already known to be terminal server-side, so * completing it could never succeed. */ skipDurableRunFinalization?: boolean; } /** State for dispatch conversation hosted terminal. */ export declare function dispatchConversationHostedTerminalState(adapter: ConversationHostedTerminalRuntimeAdapter, state: ConversationHostedTerminalStateInput, options?: DispatchConversationHostedTerminalStateOptions): Promise; /** State for dispatch conversation hosted stream error. */ export declare function dispatchConversationHostedStreamErrorState(adapter: ConversationHostedTerminalRuntimeAdapter, error: unknown, options?: DispatchConversationHostedTerminalStateOptions): Promise; /** Options accepted by create conversation hosted terminal adapter. */ export interface CreateConversationHostedTerminalAdapterOptions { authToken: string; apiUrl: string; run: ConversationRunProjection | null; fallbackModelId: string; resolveProvider: (modelId: string) => string; onTerminalState?: (terminalState: HostedLifecycleTerminalState) => Promise | void; } /** Public API contract for conversation hosted terminal adapter. */ export interface ConversationHostedTerminalAdapter { toTerminalState: (state: ConversationHostedTerminalStateInput) => HostedLifecycleTerminalState; finalizeRun: (terminalState: HostedLifecycleTerminalState) => Promise; cancelRun: (terminalState: HostedLifecycleTerminalState) => Promise; onTerminalState: (terminalState: HostedLifecycleTerminalState) => Promise; dispatch: (state: ConversationHostedTerminalStateInput) => Promise; } /** State for to conversation hosted terminal. */ export declare function toConversationHostedTerminalState(input: { fallbackModelId: string; state: ConversationHostedTerminalStateInput; }): HostedLifecycleTerminalState; /** Create conversation hosted terminal adapter. */ export declare function createConversationHostedTerminalAdapter(options: CreateConversationHostedTerminalAdapterOptions): ConversationHostedTerminalAdapter; //# sourceMappingURL=hosted-terminal.d.ts.map