import { type ConversationRootRunContext, type ConversationRootRunDescriptor } from "./root-run-context.js"; import { persistLatestConversationUserMessage } from "./bootstrap.js"; import { type ConversationRunChunkMirror, type HostedConversationRunChunkMirrorInstrumentation } from "./run-chunk-mirror.js"; import { type ConversationRunEvent } from "./run-events.js"; import type { ConversationRunProjection } from "./durable.js"; import type { ChatUiMessage } from "../../chat/types.js"; /** Public API contract for conversation root run lifecycle. */ export interface ConversationRootRunLifecycle extends ConversationRootRunContext { mirror: TMirror | null; } /** Options accepted by prepare conversation root run lifecycle. */ export interface PrepareConversationRootRunLifecycleOptions { startRun: (input: { abortSignal: AbortSignal; }) => Promise<{ run: ConversationRunProjection | null; }> | { run: ConversationRunProjection | null; }; parentRunId?: string; parentMessageId?: string; appendParentRunEvents?: ((events: unknown[]) => Promise | void) | undefined; createMirror?: (run: ConversationRunProjection) => Promise | TMirror; } /** Prepare conversation root run lifecycle. */ export declare function prepareConversationRootRunLifecycle(input: PrepareConversationRootRunLifecycleOptions, options: { abortSignal: AbortSignal; }): Promise>; /** State for hosted conversation root run. */ export interface HostedConversationRootRunState { runId: string; conversationId: string; messageId: string; latestEventId: number; latestExternalEventSequence: number; } /** Context for hosted conversation root run. */ export interface HostedConversationRootRunContext { durableRootRun: HostedConversationRootRunState | null; durableRunMirror: ConversationRunChunkMirror | null; /** Mirror authorized for private checkpoint events, when a service token was verified. */ privateDurableRunMirror: ConversationRunChunkMirror | null; effectiveParentRunId?: string; effectiveParentMessageId?: string; publishParentRunEvents?: (events: ConversationRunEvent[]) => Promise; } /** * Input for hosted root-run preparation. * * Exact-root event-writer authority is supplied only by the framework's * bounded capability scope; this input does not accept raw writer tokens. */ export interface PrepareHostedConversationRootRunContextInput { authToken: string; apiUrl: string; conversationId?: string; projectId?: string | null; branchId?: string | null; agentId: string; implementationKind?: string | null; messages: ChatUiMessage[]; parentRunId?: string; parentMessageId?: string; providedRun?: ConversationRootRunDescriptor; persistLatestUserMessageBeforeRun: boolean; persistLatestUserMessageOperation?: string; missingUserMessageErrorMessage?: string; onPersistLatestUserMessageFailure?: Parameters[0]["onFailure"]; instrumentation?: HostedConversationRunChunkMirrorInstrumentation; } /** Context for prepare hosted conversation root run. */ export declare function prepareHostedConversationRootRunContext(input: PrepareHostedConversationRootRunContextInput, options: { abortSignal: AbortSignal; }): Promise; //# sourceMappingURL=root-run-lifecycle.d.ts.map