import { type HistoricalToolInputRetentionOptions } from "../../chat/message-prep.js"; import type { ChatUiMessage } from "../../chat/types.js"; import type { AgUiResumeValue } from "../ag-ui/tool-shared.js"; import type { DetachedRunTracker } from "../service/detached-run-tracker.js"; import type { ParsedHostedChatRequest } from "./chat-request-parser.js"; /** Public API contract for hosted durable run setup error status code. */ export type HostedDurableRunSetupErrorStatusCode = 400 | 402 | 403 | 404 | 408 | 413 | 429 | 500 | 501 | 502 | 503; /** Public API contract for hosted durable run accepted. */ export type HostedDurableRunAccepted = { accepted: boolean; duplicate: boolean; }; /** Response payload for hosted durable run auth error. */ export type HostedDurableRunAuthErrorResponse = { errorCode: string; statusCode: number; metadata?: Record; }; /** Public API contract for hosted durable run logger. */ export type HostedDurableRunLogger = { debug?: (message: string, metadata?: Record) => void; warn?: (message: string, metadata?: Record) => void; error(message: string, metadata?: Record): void; }; /** Input delivered to a hosted durable-run starter after request isolation. */ export type HostedDurableRunStartExecutionInput = { execution: TExecution; abortSignal: AbortSignal; /** Required application-facing request clone with internal control headers removed. */ rawRequest: Request; }; /** Input payload for hosted durable run start cleanup. */ export type HostedDurableRunStartCleanupInput = { execution: TExecution; runId: string; conversationId: string; }; /** Input payload for execute hosted durable chat run. */ export type ExecuteHostedDurableChatRunInput = { req: ParsedHostedChatRequest; rawRequest: Request; requestOrCtx?: unknown; tracker: DetachedRunTracker; prepareExecution: (req: ParsedHostedChatRequest) => Promise; startDetachedExecution: (input: HostedDurableRunStartExecutionInput) => Promise; cleanupExecution?: (input: HostedDurableRunStartCleanupInput) => Promise; resolveAuthError?: (error: unknown) => HostedDurableRunAuthErrorResponse | null | undefined; logger?: HostedDurableRunLogger; }; /** Response payload for resolve hosted durable run setup error. */ export declare function resolveHostedDurableRunSetupErrorResponse(input: { code: string; status?: number; originalError: unknown; }): { errorCode: string; statusCode: HostedDurableRunSetupErrorStatusCode; }; declare function parseAcceptedDetachedStartResponse(response: Response): Promise; /** Prepare durable detached-start messages without carrying completed large historical tool inputs. */ export declare function prepareDetachedStartMessages(messages: ChatUiMessage[], options?: { historicalToolInputRetention?: HistoricalToolInputRetentionOptions; }): ChatUiMessage[]; /** Test-only internals for durable chat run start behavior. */ export declare const durableChatRunStartInternals: { parseAcceptedDetachedStartResponse: typeof parseAcceptedDetachedStartResponse; }; /** Execute hosted durable chat run. */ export declare function executeHostedDurableChatRun(input: ExecuteHostedDurableChatRunInput): Promise; export {}; //# sourceMappingURL=durable-chat-run-start.d.ts.map