import { type ConversationRunProjection } from "../conversation/durable.js"; /** Public API contract for hosted child run identifiers. */ export interface HostedChildRunIdentifiers { childConversationId: string; childRunId: string; childMessageId: string; latestEventId: number; latestExternalEventSequence: number; } type HostedConversationRunStatus = ConversationRunProjection["status"]; /** Shared hosted child terminal error codes value. */ export declare const hostedChildTerminalErrorCodes: Readonly<{ cancelled: "DURABLE_CHILD_CANCELLED"; failed: "DURABLE_CHILD_FAILED"; completedExternally: "DURABLE_CHILD_COMPLETED_EXTERNALLY"; }>; /** Public API contract for a code is a hosted child terminal error. */ export type HostedChildTerminalErrorCode = (typeof hostedChildTerminalErrorCodes)[keyof typeof hostedChildTerminalErrorCodes]; /** Check whether a code is a hosted child terminal error. */ export declare function isHostedChildTerminalErrorCode(value: unknown): value is HostedChildTerminalErrorCode; /** Public API contract for hosted child same turn retry block signal. */ export interface HostedChildSameTurnRetryBlockSignal { terminalErrorCode?: string | null; terminalErrorMessage?: string | null; } /** Should block hosted child same turn retry helper. */ export declare function shouldBlockHostedChildSameTurnRetry(result: unknown): result is HostedChildSameTurnRetryBlockSignal; /** Public API contract for hosted child terminal status. */ export type HostedChildTerminalStatus = Extract; /** Error shape for hosted child terminal state. */ export declare class HostedChildTerminalStateError extends Error { readonly status: HostedChildTerminalStatus; readonly identifiers: HostedChildRunIdentifiers; constructor(status: HostedChildTerminalStatus, identifiers: HostedChildRunIdentifiers); } /** Resolves a code is a hosted child terminal error. */ export declare function resolveHostedChildTerminalErrorCode(status: HostedChildTerminalStatus): HostedChildTerminalErrorCode; /** Input payload for monitor hosted child run status. */ export interface MonitorHostedChildRunStatusInput { authToken: string; apiUrl: string; identifiers: HostedChildRunIdentifiers; abortSignal?: AbortSignal; pollIntervalMs: number; onTerminal: (error: HostedChildTerminalStateError) => void; /** Called when a poll attempt fails; receives the error and consecutive failure count. */ onMonitoringError?: (error: unknown, consecutiveFailures: number) => void; /** Called when repeated poll failures stop the monitor without observing a terminal run. */ onMonitoringExhausted?: (error: Error) => void; } /** Monitor hosted child run status helper. */ export declare function monitorHostedChildRunStatus(input: MonitorHostedChildRunStatusInput): Promise; export {}; //# sourceMappingURL=child-status.d.ts.map