import { StandardSchemaV1 } from "@standard-schema/spec"; import React, { ComponentType, FC, PropsWithChildren, ReactElement, ReactNode } from "react"; import { FlatList, FlatListProps, PressableProps, TextInputProps, TextProps, ViewProps } from "react-native"; declare const ActionBarCopy: (_param0: ActionBarCopyProps) => import("react").JSX.Element; type ActionBarCopyProps = Omit & UseActionBarCopyOptions & { children: ReactNode | ((props: { isCopied: boolean; }) => ReactNode); }; declare const ActionBarEdit: (_param1: ActionBarEditProps) => import("react").JSX.Element; type ActionBarEditProps = Omit & { children: ReactNode; }; declare const ActionBarFeedbackNegative: (_param2: ActionBarFeedbackNegativeProps) => import("react").JSX.Element; type ActionBarFeedbackNegativeProps = Omit & { children: ReactNode | ((props: { isSubmitted: boolean; }) => ReactNode); }; declare const ActionBarFeedbackPositive: (_param3: ActionBarFeedbackPositiveProps) => import("react").JSX.Element; type ActionBarFeedbackPositiveProps = Omit & { children: ReactNode | ((props: { isSubmitted: boolean; }) => ReactNode); }; declare const ActionBarReload: (_param4: ActionBarReloadProps) => import("react").JSX.Element; type ActionBarReloadProps = Omit & { children: ReactNode; }; type AddToolResultOptions = { messageId: string; toolName: string; toolCallId: string; result: ReadonlyJSONValue; isError: boolean; artifact?: ReadonlyJSONValue | undefined; modelContent?: readonly ToolModelContentPart[] | undefined; }; type AncestorsOf = K extends Seen ? never : ParentOf extends never ? never : ParentOf | AncestorsOf, Seen | K>; type AppendMessage = Omit & { parentId: string | null; sourceId: string | null; runConfig: RunConfig | undefined; startRun?: boolean | undefined; steer?: boolean | undefined; }; type AsNumber = K extends `${infer N extends number}` ? N | K : never; type AssistantClient = { [K in ClientNames]: AssistantClientAccessor; } & { subscribe(listener: () => void): Unsubscribe; on(selector: AssistantEventSelector, callback: AssistantEventCallback): Unsubscribe; }; type AssistantClientAccessor = (() => ClientSchemas[K]["methods"]) & (ClientMeta | { source: "root"; query: Record; } | { source: null; query: null; }) & { name: K; }; declare class AssistantCloud { readonly threads: AssistantCloudThreads; readonly auth: { tokens: AssistantCloudAuthTokens; }; readonly runs: AssistantCloudRuns; readonly files: AssistantCloudFiles; readonly telemetry: AssistantCloudTelemetryConfig; constructor(config: AssistantCloudConfig); } declare class AssistantCloudAPI { _auth: AssistantCloudAuthStrategy; _baseUrl: string; constructor(config: AssistantCloudConfig); initializeAuth(): Promise; makeRawRequest(endpoint: string, options?: MakeRequestOptions): Promise; makeRequest(endpoint: string, options?: MakeRequestOptions): Promise; } type AssistantCloudAuthStrategy = { readonly strategy: "anon" | "api-key" | "jwt"; getAuthHeaders(): Promise | false>; readAuthHeaders(headers: Headers): void; }; declare class AssistantCloudAuthTokens { private cloud; constructor(cloud: AssistantCloudAPI); create(): Promise; } type AssistantCloudAuthTokensCreateResponse = { token: string; }; type AssistantCloudConfig = ({ baseUrl: string; authToken: () => Promise; } | { baseUrl?: string; apiKey: string; userId: string; workspaceId: string; } | { baseUrl: string; anonymous: true; }) & { telemetry?: boolean | AssistantCloudTelemetryConfig; }; declare class AssistantCloudFiles { private cloud; constructor(cloud: AssistantCloudAPI); pdfToImages(body: PdfToImagesRequestBody): Promise; generatePresignedUploadUrl(body: GeneratePresignedUploadUrlRequestBody): Promise; } type AssistantCloudMessageCreateResponse = { message_id: string; }; type AssistantCloudRunReport = { thread_id: string; status: "completed" | "error" | "incomplete"; total_steps?: number; tool_calls?: ReportToolCall[]; steps?: { input_tokens?: number; output_tokens?: number; reasoning_tokens?: number; cached_input_tokens?: number; tool_calls?: ReportToolCall[]; start_ms?: number; end_ms?: number; }[]; input_tokens?: number; output_tokens?: number; reasoning_tokens?: number; cached_input_tokens?: number; model_id?: string; provider_type?: string; duration_ms?: number; output_text?: string; metadata?: Record; }; declare class AssistantCloudRuns { private cloud; constructor(cloud: AssistantCloudAPI); __internal_getAssistantOptions(assistantId: string): { api: string; headers: () => Promise<{ Accept: string; }>; body: { assistant_id: string; response_format: string; thread_id: string; }; }; stream(body: AssistantCloudRunsStreamBody): Promise; report(body: AssistantCloudRunReport): Promise<{ run_id: string; }>; } type AssistantCloudRunsStreamBody = { thread_id: string; assistant_id: "system/thread_title"; messages: readonly unknown[]; }; type AssistantCloudTelemetryConfig = { enabled?: boolean; beforeReport?: (report: AssistantCloudRunReport) => AssistantCloudRunReport | null; }; type AssistantCloudThreadMessageCreateBody = { parent_id: string | null; format: "aui/v0" | string; content: ReadonlyJSONObject; }; type AssistantCloudThreadMessageListQuery = { format?: string; }; type AssistantCloudThreadMessageListResponse = { messages: CloudMessage[]; }; type AssistantCloudThreadMessageUpdateBody = { content: ReadonlyJSONObject; }; declare class AssistantCloudThreadMessages { private cloud; constructor(cloud: AssistantCloudAPI); list(threadId: string, query?: AssistantCloudThreadMessageListQuery): Promise; create(threadId: string, body: AssistantCloudThreadMessageCreateBody): Promise; update(threadId: string, messageId: string, body: AssistantCloudThreadMessageUpdateBody): Promise; } declare class AssistantCloudThreads { private cloud; readonly messages: AssistantCloudThreadMessages; constructor(cloud: AssistantCloudAPI); list(query?: AssistantCloudThreadsListQuery): Promise; get(threadId: string): Promise; create(body: AssistantCloudThreadsCreateBody): Promise; update(threadId: string, body: AssistantCloudThreadsUpdateBody): Promise; delete(threadId: string): Promise; } type AssistantCloudThreadsCreateBody = { title?: string | undefined; last_message_at: Date; metadata?: unknown | undefined; external_id?: string | undefined; }; type AssistantCloudThreadsCreateResponse = { thread_id: string; }; type AssistantCloudThreadsListQuery = { is_archived?: boolean; limit?: number; after?: string; }; type AssistantCloudThreadsListResponse = { threads: CloudThread[]; }; type AssistantCloudThreadsUpdateBody = { title?: string | undefined; last_message_at?: Date | undefined; metadata?: unknown | undefined; is_archived?: boolean | undefined; }; type AssistantContextConfig = { getContext: () => string; disabled?: boolean | undefined; }; type AssistantDataUI = FC & { unstable_data: AssistantDataUIProps; }; type AssistantDataUIProps = { name: string; render: DataMessagePartComponent; }; type AssistantEventCallback = (payload: AssistantEventPayload[TEvent]) => void; type AssistantEventName = keyof AssistantEventPayload; type AssistantEventPayload = ClientEventMap & { "*": WildcardPayload; }; type AssistantEventScope = "*" | EventSource | (EventSource extends ClientNames ? AncestorsOf> : never); type AssistantEventSelector = TEvent | { scope: AssistantEventScope; event: TEvent; }; type AssistantInstructionsConfig = { disabled?: boolean | undefined; instruction: string; }; type AssistantInteractableProps = { description: string; stateSchema: InteractableStateSchema; initialState: unknown; id?: string; selected?: boolean; }; type AssistantRuntime = { readonly threads: ThreadListRuntime; readonly thread: ThreadRuntime; registerModelContextProvider(provider: ModelContextProvider): Unsubscribe$1; }; type AssistantRuntimeCore = { readonly threads: ThreadListRuntimeCore; registerModelContextProvider: (provider: ModelContextProvider) => Unsubscribe$1; getModelContextProvider: () => ModelContextProvider; readonly RenderComponent?: ((...args: any[]) => unknown) | undefined; }; declare class AssistantRuntimeImpl implements AssistantRuntime { private readonly _core; readonly threads: ThreadListRuntimeImpl; readonly _thread: ThreadRuntime; constructor(_core: AssistantRuntimeCore); protected __internal_bindMethods(): void; get thread(): ThreadRuntime; registerModelContextProvider(provider: ModelContextProvider): Unsubscribe$1; } declare const AssistantRuntimeProvider: import("react").MemoExoticComponent<(_param5: { runtime: AssistantRuntime; aui?: AssistantClient | null; children: ReactNode; }) => import("react").JSX.Element>; type AssistantState = { [K in ClientNames]: ClientSchemas[K]["methods"] extends { getState: () => infer S; } ? S : never; }; type AssistantStream = ReadableStream; declare const AssistantStream: { toResponse(stream: AssistantStream, transformer: AssistantStreamEncoder): Response; fromResponse(response: Response, transformer: ReadableWritablePair>): ReadableStream; toByteStream(stream: AssistantStream, transformer: ReadableWritablePair, AssistantStreamChunk>): ReadableStream>; fromByteStream(readable: ReadableStream>, transformer: ReadableWritablePair>): ReadableStream; }; type AssistantStreamChunk = { readonly path: readonly number[]; } & ({ readonly type: "part-start"; readonly part: PartInit; } | { readonly type: "part-finish"; } | { readonly type: "tool-call-args-text-finish"; } | { readonly type: "text-delta"; readonly textDelta: string; } | { readonly type: "annotations"; readonly annotations: ReadonlyJSONValue[]; } | { readonly type: "data"; readonly data: ReadonlyJSONValue[]; } | { readonly type: "step-start"; readonly messageId: string; } | { readonly type: "step-finish"; readonly finishReason: "content-filter" | "error" | "length" | "other" | "stop" | "tool-calls" | "unknown"; readonly usage: { readonly inputTokens: number; readonly outputTokens: number; }; readonly isContinued: boolean; } | { readonly type: "message-finish"; readonly finishReason: "content-filter" | "error" | "length" | "other" | "stop" | "tool-calls" | "unknown"; readonly usage: { readonly inputTokens: number; readonly outputTokens: number; }; } | { readonly type: "result"; readonly artifact?: ReadonlyJSONValue; readonly result: ReadonlyJSONValue; readonly isError: boolean; readonly modelContent?: readonly ToolModelContentPart[]; readonly messages?: ReadonlyJSONValue; } | { readonly type: "error"; readonly error: string; } | { readonly type: "update-state"; readonly operations: ObjectStreamOperation[]; }); type AssistantStreamEncoder = ReadableWritablePair, AssistantStreamChunk> & { headers?: Headers; }; type AssistantTool = FC & { unstable_tool: AssistantToolProps; }; type AssistantToolProps, TResult> = AssistantToolProps$1 & { render?: ToolCallMessagePartComponent | undefined; renderText?: ToolCallText | undefined; }; type AssistantToolProps$1, TResult> = Tool & { toolName: string; render?: unknown; }; type AssistantToolUI = FC & { unstable_tool: AssistantToolUIProps; }; type AssistantToolUIProps = { toolName: string; render: ToolCallMessagePartComponent; display?: "inline" | "standalone"; }; type AsyncIterableStream = AsyncIterable & ReadableStream; type Attachment = PendingAttachment | CompleteAttachment; type AttachmentAdapter = { accept: string; add(state: { file: File; }): Promise | AsyncGenerator; remove(attachment: Attachment): Promise; send(attachment: PendingAttachment): Promise; }; type AttachmentAddErrorEvent = { readonly reason: AttachmentAddErrorReason; readonly message: string; readonly attachmentId?: string; readonly error?: Error; }; type AttachmentAddErrorReason = "adapter-error" | "no-adapter" | "not-accepted"; declare const AttachmentName: FC; type AttachmentNameProps = TextProps; declare const AttachmentRemove: (_param6: AttachmentRemoveProps) => import("react").JSX.Element; type AttachmentRemoveProps = Omit & { children: ReactNode; }; declare const AttachmentRoot: (_param7: AttachmentRootProps) => import("react").JSX.Element; type AttachmentRootProps = ViewProps & { children: ReactNode; }; type AttachmentRuntime = { readonly path: AttachmentRuntimePath & { attachmentSource: TSource; }; readonly source: TSource; getState(): AttachmentState$1 & { source: TSource; }; remove(): Promise; subscribe(callback: () => void): Unsubscribe$1; }; declare abstract class AttachmentRuntimeImpl implements AttachmentRuntime { private _core; get path(): AttachmentRuntimePath & { attachmentSource: Source; }; abstract get source(): Source; constructor(_core: AttachmentSnapshotBinding); protected __internal_bindMethods(): void; getState(): AttachmentState$1 & { source: Source; }; abstract remove(): Promise; subscribe(callback: () => void): Unsubscribe$1; } type AttachmentRuntimePath = ((MessageRuntimePath & { readonly attachmentSource: "edit-composer" | "message"; }) | (ThreadRuntimePath & { readonly attachmentSource: "thread-composer"; })) & { readonly attachmentSelector: { readonly type: "index"; readonly index: number; } | { readonly type: "index"; readonly index: number; } | { readonly type: "index"; readonly index: number; }; }; type AttachmentRuntimeSource = AttachmentState$1["source"]; type AttachmentSnapshotBinding = SubscribableWithState; type AttachmentState = Attachment; type AttachmentState$1 = ThreadComposerAttachmentState | EditComposerAttachmentState | MessageAttachmentState; declare const AttachmentThumb: FC; type AttachmentThumbProps = TextProps; declare namespace AuiIf { type Props = PropsWithChildren<{ condition: AuiIf.Condition; }>; type Condition = (state: AssistantState) => boolean; } declare const AuiIf: FC; declare const AuiProvider: (_param8: { value: AssistantClient; children: React.ReactNode; }) => React.ReactElement; type AuiToolOverride = Record, TResult = unknown> = Partial>; type AuiToolOverrides = Record>; type BackendTool = Record, TResult = unknown> = ToolBase & { type: "backend"; description?: undefined; parameters?: undefined; disabled?: undefined; execute?: undefined; toModelOutput?: undefined; experimental_onSchemaValidationError?: undefined; providerOptions?: undefined; }; type BackendToolDeclaration = Record, TResult = unknown> = ToolBase & { type: "backend"; description?: string | undefined; parameters?: StandardSchemaV1 | JSONSchema7 | undefined; disabled?: boolean; execute?: ToolExecuteFunction; toModelOutput?: ToolModelOutputFunction; experimental_onSchemaValidationError?: OnSchemaValidationErrorFunction; providerOptions?: ProviderOptions; }; declare abstract class BaseAssistantRuntimeCore implements AssistantRuntimeCore { protected readonly _contextProvider: CompositeContextProvider; abstract get threads(): ThreadListRuntimeCore; registerModelContextProvider(provider: ModelContextProvider): Unsubscribe$1; getModelContextProvider(): ModelContextProvider; } type BaseAttachment = { id: string; type: "image" | "document" | "file" | (string & {}); name: string; contentType?: string | undefined; file?: File; content?: ThreadUserMessagePart[]; }; declare abstract class BaseComposerRuntimeCore extends BaseSubscribable implements ComposerRuntimeCore { readonly isEditing = true; protected abstract getAttachmentAdapter(): AttachmentAdapter | undefined; protected abstract getDictationAdapter(): DictationAdapter | undefined; protected enrichWithComposerMetadata; }; }>(message: T, composerMetadata: Record | undefined): T; get attachmentAccept(): string; private _attachments; get attachments(): readonly Attachment[]; protected setAttachments(value: readonly Attachment[]): void; abstract get canCancel(): boolean; abstract get canSend(): boolean; get isEmpty(): boolean; private _text; get text(): string; private _role; get role(): "assistant" | "system" | "user"; private _runConfig; get runConfig(): RunConfig; private _quote; get quote(): QuoteInfo | undefined; setQuote(quote: QuoteInfo | undefined): void; setText(value: string): void; setRole(role: MessageRole): void; setRunConfig(runConfig: RunConfig): void; private _emptyTextAndAttachments; private _onClearAttachments; reset(): Promise; clearAttachments(): Promise; send(options?: SendOptions): Promise; cancel(): void; get queue(): readonly QueueItemState[]; steerQueueItem(_queueItemId: string): void; removeQueueItem(_queueItemId: string): void; protected abstract handleSend(message: Omit, options?: SendOptions): void; protected abstract handleCancel(): void; addAttachment(fileOrAttachment: File | CreateAttachment): Promise; private _safeEmitAttachmentAddError; removeAttachment(attachmentId: string): Promise; private _dictation; private _dictationSession; private _dictationUnsubscribes; private _dictationBaseText; private _currentInterimText; private _dictationSessionIdCounter; private _activeDictationSessionId; private _isCleaningDictation; get dictation(): DictationState | undefined; private _isActiveSession; startDictation(): void; stopDictation(): void; private _cleanupDictation; private _eventSubscribers; protected _notifyEventSubscribers(event: E, payload: ComposerRuntimeEventPayload[E]): void; unstable_on(event: E, callback: ComposerRuntimeEventCallback): () => void; } type BaseComposerState = { readonly canCancel: boolean; readonly canSend: boolean; readonly isEditing: boolean; readonly isEmpty: boolean; readonly text: string; readonly role: MessageRole; readonly attachments: readonly Attachment[]; readonly runConfig: RunConfig; readonly attachmentAccept: string; readonly dictation: DictationState | undefined; readonly quote: QuoteInfo | undefined; readonly queue: readonly QueueItemState[]; }; declare class BaseSubscribable { private _subscribers; subscribe(callback: () => void): Unsubscribe$1; waitForUpdate(): Promise; protected _notifySubscribers(): void; } type BaseThreadMessage = { readonly status?: ThreadAssistantMessage["status"]; readonly metadata: { readonly unstable_state?: ReadonlyJSONValue; readonly unstable_annotations?: readonly ReadonlyJSONValue[]; readonly unstable_data?: readonly ReadonlyJSONValue[]; readonly steps?: readonly ThreadStep[]; readonly submittedFeedback?: { readonly type: "negative" | "positive"; }; readonly timing?: MessageTiming; readonly isOptimistic?: boolean; readonly custom: Record; }; readonly attachments?: ThreadUserMessage["attachments"]; }; declare const BranchPickerCount: (props: BranchPickerCountProps) => import("react").JSX.Element; type BranchPickerCountProps = TextProps; declare const BranchPickerNext: (_param9: BranchPickerNextProps) => import("react").JSX.Element; type BranchPickerNextProps = Omit & { children: ReactNode; }; declare const BranchPickerNumber: (props: BranchPickerNumberProps) => import("react").JSX.Element; type BranchPickerNumberProps = TextProps; declare const BranchPickerPrevious: (_param10: BranchPickerPreviousProps) => import("react").JSX.Element; type BranchPickerPreviousProps = Omit & { children: ReactNode; }; declare const ChainOfThoughtAccordionTrigger: (_param11: ChainOfThoughtAccordionTriggerProps) => import("react").JSX.Element; type ChainOfThoughtAccordionTriggerProps = Omit & { children: ReactNode; }; declare const ChainOfThoughtByIndicesProvider: FC>; declare const ChainOfThoughtClient: Resource, [ { parts: readonly ChainOfThoughtPart[]; getMessagePart: (selector: { index: number; }) => PartMethods; } ]>; type ChainOfThoughtPart = Extract; declare const ChainOfThoughtPartByIndexProvider: FC>; type ChainOfThoughtPartsComponentConfig = { Reasoning?: ReasoningMessagePartComponent | undefined; tools?: { Fallback?: ToolCallMessagePartComponent | undefined; }; Layout?: ComponentType | undefined; }; declare namespace ChainOfThoughtPrimitiveParts { type Props = { components?: ChainOfThoughtPartsComponentConfig; children?: never; } | { children: (value: { part: PartState; }) => ReactNode; components?: never; }; } declare const ChainOfThoughtPrimitiveParts: FC; declare const ChainOfThoughtRoot: (_param12: ChainOfThoughtRootProps) => import("react").JSX.Element; type ChainOfThoughtRootProps = ViewProps & { children: ReactNode; }; type ChatModelAdapter = { run(options: ChatModelRunOptions): Promise | AsyncGenerator; }; type ChatModelRunOptions = { readonly messages: readonly ThreadMessage[]; readonly runConfig: RunConfig; readonly abortSignal: AbortSignal; readonly context: ModelContext$1; readonly unstable_assistantMessageId?: string | undefined; readonly unstable_threadId?: string | undefined; readonly unstable_parentId?: string | null | undefined; unstable_getMessage(): ThreadMessage; }; type ChatModelRunResult = { readonly content?: readonly ThreadAssistantMessagePart[] | undefined; readonly status?: MessageStatus | undefined; readonly metadata?: { readonly unstable_state?: ReadonlyJSONValue; readonly unstable_annotations?: readonly ReadonlyJSONValue[] | undefined; readonly unstable_data?: readonly ReadonlyJSONValue[] | undefined; readonly steps?: readonly ThreadStep[] | undefined; readonly timing?: MessageTiming | undefined; readonly custom?: Record | undefined; }; }; type ClientElement = ResourceElement>; type ClientError = { methods: Record E>; meta: { source: ClientNames; query: Record; }; events: Record<`${E}.`, E>; }; type ClientEventMap = UnionToIntersection<{ [K in ClientNames]: ClientEvents; }[ClientNames]>; type ClientEvents = "events" extends keyof ClientSchemas[K] ? ClientSchemas[K]["events"] extends ClientEventsType ? ClientSchemas[K]["events"] : never : never; type ClientEventsType = Record<`${K}.${string}`, unknown>; type ClientMeta = "meta" extends keyof ClientSchemas[K] ? Pick : never; type ClientMetaType = { source: ClientNames; query: Record; }; interface ClientMethods { [key: string | symbol]: (...args: any[]) => any; } type ClientNames = keyof ClientSchemas extends (infer U) ? U : never; type ClientOutput = ClientSchemas[K]["methods"] & ClientMethods; type ClientSchemas = keyof ScopeRegistry extends never ? { "ERROR: No clients were defined": ClientError<"ERROR: No clients were defined">; } : { [K in keyof ScopeRegistry]: ValidateClient; }; type CloudMessage = { id: string; parent_id: string | null; height: number; created_at: Date; updated_at: Date; format: "aui/v0" | string; content: ReadonlyJSONObject; }; type CloudThread = { title: string; last_message_at: Date; metadata: unknown; external_id: string | null; id: string; project_id: string; created_at: Date; updated_at: Date; workspace_id: string; is_archived: boolean; }; type CompleteAttachment = BaseAttachment & { status: CompleteAttachmentStatus; content: ThreadUserMessagePart[]; }; type CompleteAttachmentStatus = { type: "complete"; }; declare const ComposerAddAttachment: (_param13: ComposerAddAttachmentProps) => import("react").JSX.Element; type ComposerAddAttachmentProps = Omit & { children: ReactNode; }; declare const ComposerAttachmentByIndex: import("react").FC; declare const ComposerAttachmentByIndexProvider: FC>; declare abstract class ComposerAttachmentRuntime extends AttachmentRuntimeImpl { private _composerApi; constructor(core: AttachmentSnapshotBinding, _composerApi: ComposerRuntimeCoreBinding); remove(): Promise; } declare const ComposerAttachments: import("react").FC; type ComposerAttachmentsComponentConfig = { Image?: ComponentType | undefined; Document?: ComponentType | undefined; File?: ComponentType | undefined; Attachment?: ComponentType | undefined; }; declare const ComposerCancel: (_param14: ComposerCancelProps) => import("react").JSX.Element; type ComposerCancelProps = Omit & { children: ReactNode; }; type ComposerIfFilters = { editing: boolean | undefined; dictation: boolean | undefined; }; declare const ComposerInput: (_param15: ComposerInputProps) => import("react").JSX.Element; type ComposerInputProps = Omit & { submitMode?: "enter" | "none"; }; declare namespace ComposerPrimitiveAttachmentByIndex { type Props = { index: number; components?: ComposerAttachmentsComponentConfig; }; } declare const ComposerPrimitiveAttachmentByIndex: FC; declare namespace ComposerPrimitiveAttachments { type Props = { components: ComposerAttachmentsComponentConfig; children?: never; } | { children: (value: { attachment: Attachment; }) => ReactNode; components?: never; }; } declare const ComposerPrimitiveAttachments: FC; declare namespace ComposerPrimitiveIf { type Props = PropsWithChildren; } declare const ComposerPrimitiveIf: FC; declare const ComposerRoot: (_param16: ComposerRootProps) => import("react").JSX.Element; type ComposerRootProps = ViewProps & { children: ReactNode; }; type ComposerRuntime = { readonly path: ComposerRuntimePath; readonly type: "edit" | "thread"; getState(): ComposerState$1; addAttachment(fileOrAttachment: File | CreateAttachment): Promise; setText(text: string): void; setRole(role: MessageRole): void; setRunConfig(runConfig: RunConfig): void; reset(): Promise; clearAttachments(): Promise; send(options?: SendOptions): void; cancel(): void; steerQueueItem(queueItemId: string): void; removeQueueItem(queueItemId: string): void; subscribe(callback: () => void): Unsubscribe$1; getAttachmentByIndex(idx: number): AttachmentRuntime; startDictation(): void; stopDictation(): void; setQuote(quote: QuoteInfo | undefined): void; unstable_on(event: E, callback: ComposerRuntimeEventCallback): Unsubscribe$1; }; type ComposerRuntimeCore = Readonly<{ isEditing: boolean; canCancel: boolean; canSend: boolean; isEmpty: boolean; attachments: readonly Attachment[]; attachmentAccept: string; addAttachment: (fileOrAttachment: File | CreateAttachment) => Promise; removeAttachment: (attachmentId: string) => Promise; text: string; setText: (value: string) => void; role: MessageRole; setRole: (role: MessageRole) => void; runConfig: RunConfig; setRunConfig: (runConfig: RunConfig) => void; quote: QuoteInfo | undefined; setQuote: (quote: QuoteInfo | undefined) => void; reset: () => Promise; clearAttachments: () => Promise; send: (options?: SendOptions) => void; cancel: () => void; queue: readonly QueueItemState[]; steerQueueItem: (queueItemId: string) => void; removeQueueItem: (queueItemId: string) => void; dictation: DictationState | undefined; startDictation: () => void; stopDictation: () => void; subscribe: (callback: () => void) => Unsubscribe$1; unstable_on: (event: E, callback: ComposerRuntimeEventCallback) => Unsubscribe$1; }>; type ComposerRuntimeCoreBinding = SubscribableWithState; type ComposerRuntimeEventCallback = (payload: ComposerRuntimeEventPayload[E]) => void; type ComposerRuntimeEventPayload = { send: Record; attachmentAdd: Record; attachmentAddError: AttachmentAddErrorEvent; }; type ComposerRuntimeEventType = keyof ComposerRuntimeEventPayload; declare abstract class ComposerRuntimeImpl implements ComposerRuntime { protected _core: ComposerRuntimeCoreBinding; get path(): ComposerRuntimePath; abstract get type(): "edit" | "thread"; constructor(_core: ComposerRuntimeCoreBinding); protected __internal_bindMethods(): void; abstract getState(): ComposerState$1; setText(text: string): void; setRunConfig(runConfig: RunConfig): void; addAttachment(fileOrAttachment: File | CreateAttachment): Promise; reset(): Promise; clearAttachments(): Promise; send(options?: SendOptions): void; cancel(): void; steerQueueItem(queueItemId: string): void; removeQueueItem(queueItemId: string): void; setRole(role: MessageRole): void; startDictation(): void; stopDictation(): void; setQuote(quote: QuoteInfo | undefined): void; subscribe(callback: () => void): Unsubscribe$1; private _eventSubscriptionSubjects; unstable_on(event: E, callback: ComposerRuntimeEventCallback): Unsubscribe$1; abstract getAttachmentByIndex(idx: number): AttachmentRuntime; } type ComposerRuntimePath = (ThreadRuntimePath & { readonly composerSource: "thread"; }) | (MessageRuntimePath & { readonly composerSource: "edit"; }); declare const ComposerSend: (_param17: ComposerSendProps) => import("react").JSX.Element; type ComposerSendProps = Omit & { children: ReactNode; }; type ComposerState = { readonly text: string; readonly role: MessageRole; readonly attachments: readonly Attachment[]; readonly runConfig: RunConfig; readonly isEditing: boolean; readonly canCancel: boolean; readonly canSend: boolean; readonly attachmentAccept: string; readonly isEmpty: boolean; readonly type: "edit" | "thread"; readonly dictation: DictationState | undefined; readonly quote: QuoteInfo | undefined; readonly queue: readonly QueueItemState[]; }; type ComposerState$1 = ThreadComposerState | EditComposerState; declare class CompositeAttachmentAdapter implements AttachmentAdapter { private _adapters; accept: string; constructor(adapters: AttachmentAdapter[]); add(state: { file: File; }): Promise | AsyncGenerator; send(attachment: PendingAttachment): Promise; remove(attachment: Attachment): Promise; } declare class CompositeContextProvider implements ModelContextProvider { private _providers; getModelContext(): ModelContext$1; registerModelContextProvider(provider: ModelContextProvider): () => void; private _subscribers; notifySubscribers(): void; subscribe(callback: () => void): () => void; } type CreateAppendMessage = string | { parentId?: string | null | undefined; sourceId?: string | null | undefined; role?: AppendMessage["role"] | undefined; content: AppendMessage["content"]; attachments?: AppendMessage["attachments"] | undefined; metadata?: AppendMessage["metadata"] | undefined; createdAt?: Date | undefined; runConfig?: AppendMessage["runConfig"] | undefined; startRun?: boolean | undefined; }; type CreateAttachment = { id?: string; type?: "image" | "document" | "file" | (string & {}); name: string; contentType?: string; content: ThreadUserMessagePart[]; }; type CreateResumeRunConfig = CreateStartRunConfig & { stream?: (options: ChatModelRunOptions) => AsyncGenerator; }; type CreateStartRunConfig = { parentId: string | null; sourceId?: string | null | undefined; runConfig?: RunConfig | undefined; }; type DataMessagePart = { readonly type: "data"; readonly name: string; readonly data: T; }; type DataMessagePartComponent = ComponentType>; type DataMessagePartProps = MessagePartState & DataMessagePart; type DataPrefixedPart = { readonly type: `data-${string}`; readonly data: any; }; declare const DataRenderers: Resource, [ ]>; type DeepPartial = T extends readonly any[] ? readonly DeepPartial[] : T extends { [key: string]: any; } ? { readonly [K in keyof T]?: DeepPartial; } : T; declare class DefaultThreadComposerRuntimeCore extends BaseComposerRuntimeCore implements ThreadComposerRuntimeCore { private runtime; private _canCancel; get canCancel(): boolean; get canSend(): boolean; get queue(): readonly QueueItemState[]; steerQueueItem(queueItemId: string): void; removeQueueItem(queueItemId: string): void; protected getAttachmentAdapter(): AttachmentAdapter | undefined; protected getDictationAdapter(): DictationAdapter | undefined; constructor(runtime: Omit & { adapters?: { attachments?: AttachmentAdapter | undefined; dictation?: DictationAdapter | undefined; } | undefined; }); connect(): Unsubscribe$1; handleSend(message: Omit, options?: SendOptions): Promise; handleCancel(): Promise; } declare const Derived: (_config: Derived.Props) => ResourceElement ]>; declare namespace Derived { type Props = { get: (client: AssistantClient) => ReturnType>; } & ClientMeta; } type DerivedElement = ResourceElement ]>; declare namespace DictationAdapter { type Status = { type: "running" | "starting"; } | { type: "ended"; reason: "cancelled" | "error" | "stopped"; }; type Result = { transcript: string; isFinal?: boolean; }; type Session = { status: Status; stop: () => Promise; cancel: () => void; onSpeechStart: (callback: () => void) => Unsubscribe$1; onSpeechEnd: (callback: (result: Result) => void) => Unsubscribe$1; onSpeech: (callback: (result: Result) => void) => Unsubscribe$1; }; } type DictationAdapter = { listen: () => DictationAdapter.Session; disableInputDuringDictation?: boolean; }; type DictationState = { readonly status: DictationAdapter.Status; readonly transcript?: string; readonly inputDisabled?: boolean; }; declare class EditComposerAttachmentRuntimeImpl extends ComposerAttachmentRuntime<"edit-composer"> { get source(): "edit-composer"; } type EditComposerAttachmentState = Attachment & { readonly source: "edit-composer"; }; type EditComposerRuntime = Omit & { readonly path: ComposerRuntimePath & { composerSource: "edit"; }; readonly type: "edit"; getState(): EditComposerState; beginEdit(): void; getAttachmentByIndex(idx: number): AttachmentRuntime & { source: "edit-composer"; }; }; type EditComposerRuntimeCore = ComposerRuntimeCore & Readonly<{ parentId: string | null; sourceId: string | null; }>; type EditComposerRuntimeCoreBinding = SubscribableWithState; declare class EditComposerRuntimeImpl extends ComposerRuntimeImpl implements EditComposerRuntime { private _beginEdit; get path(): ComposerRuntimePath & { composerSource: "edit"; }; get type(): "edit"; private _getState; constructor(core: EditComposerRuntimeCoreBinding, _beginEdit: () => void); __internal_bindMethods(): void; getState(): EditComposerState; beginEdit(): void; getAttachmentByIndex(idx: number): EditComposerAttachmentRuntimeImpl; } type EditComposerState = BaseComposerState & { readonly type: "edit"; readonly parentId: string | null; readonly sourceId: string | null; }; type EmptyMessagePartComponent = ComponentType; type EmptyMessagePartProps = { status: MessagePartStatus; }; type EnrichedPartState = (Extract & { readonly toolUI: ReactNode; addResult: ToolCallMessagePartProps["addResult"]; resume: ToolCallMessagePartProps["resume"]; respondToApproval: ToolCallMessagePartProps["respondToApproval"]; }) | (Extract & { readonly dataRendererUI: ReactNode; }) | Exclude; declare const ErrorMessage: { (_param18: ErrorMessageProps): import("react").JSX.Element | null; displayName: string; }; type ErrorMessageProps = TextProps & { children?: ReactNode; }; declare const ErrorRoot: { (_param19: ErrorRootProps): import("react").JSX.Element | null; displayName: string; }; type ErrorRootProps = ViewProps & { children: ReactNode; }; type EventSource = T extends `${infer Source}.${string}` ? Source : never; type ExportedMessageRepository = { headId?: string | null; messages: Array<{ message: ThreadMessage; parentId: string | null; runConfig?: RunConfig; }>; }; declare const ExportedMessageRepository: { fromArray: (messages: readonly ThreadMessageLike[]) => ExportedMessageRepository; fromBranchableArray: (items: readonly { message: ThreadMessageLike; parentId: string | null; }[], options?: { headId?: string | null; }) => ExportedMessageRepository; }; type ExportedMessageRepositoryItem = { message: ThreadMessage; parentId: string | null; runConfig?: RunConfig; }; type FeedbackAdapter = { submit: (feedback: FeedbackAdapterFeedback) => void; }; type FeedbackAdapterFeedback = { message: ThreadMessage; type: "negative" | "positive"; }; type FileMessagePart = { readonly type: "file"; readonly filename?: string; readonly data: string; readonly mimeType: string; readonly parentId?: string; }; type FileMessagePartComponent = ComponentType; type FileMessagePartProps = MessagePartState & FileMessagePart; type FrontendTool = Record, TResult = unknown> = ToolBase & { type: "frontend"; description?: string | undefined; parameters: StandardSchemaV1 | JSONSchema7; disabled?: boolean; execute?: ToolExecuteFunction; toModelOutput?: ToolModelOutputFunction; experimental_onSchemaValidationError?: OnSchemaValidationErrorFunction; providerOptions?: ProviderOptions; }; type GeneratePresignedUploadUrlRequestBody = { filename: string; }; type GeneratePresignedUploadUrlResponse = { success: boolean; signedUrl: string; expiresAt: string; publicUrl: string; }; type GenerativeUIComponentRegistry = Record>; type GenerativeUIMessagePart = { readonly type: "generative-ui"; readonly spec: GenerativeUISpec; readonly id?: string; readonly parentId?: string; }; type GenerativeUINode = string | { readonly component: string; readonly props?: Record; readonly children?: readonly GenerativeUINode[]; readonly key?: string; }; type GenerativeUISpec = { readonly root: GenerativeUINode | readonly GenerativeUINode[]; }; type GenericThreadHistoryAdapter = { load(): Promise>; append(item: MessageFormatItem): Promise; update?(item: MessageFormatItem, localMessageId: string): Promise; delete?(items: MessageFormatItem[]): Promise; reportTelemetry?(items: MessageFormatItem[], options?: { durationMs?: number; stepTimestamps?: { start_ms: number; end_ms: number; }[]; }): void; }; type GroupByContext = { readonly toolUIs?: ToolsState["toolUIs"]; }; type GroupPartType = PartState["type"] | "standalone-tool-call" | "mcp-app"; type HumanTool = Record, TResult = unknown> = ToolBase & { type: "human"; description?: string | undefined; parameters: StandardSchemaV1 | JSONSchema7; disabled?: boolean; display?: "standalone"; execute?: undefined; toModelOutput?: undefined; experimental_onSchemaValidationError?: undefined; providerOptions?: ProviderOptions; }; type ImageMessagePart = { readonly type: "image"; readonly image: string; readonly filename?: string; }; type ImageMessagePartComponent = ComponentType; type ImageMessagePartProps = MessagePartState & ImageMessagePart; declare class InMemoryThreadListAdapter implements RemoteThreadListAdapter { list(): Promise; rename(): Promise; updateCustom(): Promise; archive(): Promise; unarchive(): Promise; delete(): Promise; initialize(threadId: string): Promise; generateTitle(): Promise; fetch(threadId: string): Promise; } type InteractableScope = "app" | "thread"; type InteractableStateSchema = NonNullable["parameters"]>; declare const Interactables: Resource, [ ]>; interface JSONSchema7 { $id?: string | undefined; $ref?: string | undefined; $schema?: JSONSchema7Version | undefined; $comment?: string | undefined; $defs?: { [key: string]: JSONSchema7Definition; } | undefined; type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined; enum?: JSONSchema7Type[] | undefined; const?: JSONSchema7Type | undefined; multipleOf?: number | undefined; maximum?: number | undefined; exclusiveMaximum?: number | undefined; minimum?: number | undefined; exclusiveMinimum?: number | undefined; maxLength?: number | undefined; minLength?: number | undefined; pattern?: string | undefined; items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined; additionalItems?: JSONSchema7Definition | undefined; maxItems?: number | undefined; minItems?: number | undefined; uniqueItems?: boolean | undefined; contains?: JSONSchema7Definition | undefined; maxProperties?: number | undefined; minProperties?: number | undefined; required?: string[] | undefined; properties?: { [key: string]: JSONSchema7Definition; } | undefined; patternProperties?: { [key: string]: JSONSchema7Definition; } | undefined; additionalProperties?: JSONSchema7Definition | undefined; dependencies?: { [key: string]: JSONSchema7Definition | string[]; } | undefined; propertyNames?: JSONSchema7Definition | undefined; if?: JSONSchema7Definition | undefined; then?: JSONSchema7Definition | undefined; else?: JSONSchema7Definition | undefined; allOf?: JSONSchema7Definition[] | undefined; anyOf?: JSONSchema7Definition[] | undefined; oneOf?: JSONSchema7Definition[] | undefined; not?: JSONSchema7Definition | undefined; format?: string | undefined; contentMediaType?: string | undefined; contentEncoding?: string | undefined; definitions?: { [key: string]: JSONSchema7Definition; } | undefined; title?: string | undefined; description?: string | undefined; default?: JSONSchema7Type | undefined; readOnly?: boolean | undefined; writeOnly?: boolean | undefined; examples?: JSONSchema7Type | undefined; } interface JSONSchema7Array extends Array { } type JSONSchema7Definition = JSONSchema7 | boolean; interface JSONSchema7Object { [key: string]: JSONSchema7Type; } type JSONSchema7Type = string | number | boolean | JSONSchema7Object | JSONSchema7Array | null; type JSONSchema7TypeName = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; type JSONSchema7Version = string; type LanguageModelConfig = { apiKey?: string; baseUrl?: string; modelName?: string; reasoningEffort?: string; }; type LanguageModelV1CallSettings = { maxTokens?: number; temperature?: number; topP?: number; presencePenalty?: number; frequencyPenalty?: number; seed?: number; headers?: Record; }; type LocalRuntimeOptions = Omit & { cloud?: AssistantCloud | undefined; initialMessages?: readonly ThreadMessageLike[] | undefined; adapters?: Omit | undefined; }; type LocalRuntimeOptionsBase = { maxSteps?: number | undefined; adapters: { chatModel: ChatModelAdapter; history?: ThreadHistoryAdapter | undefined; attachments?: AttachmentAdapter | undefined; speech?: SpeechSynthesisAdapter | undefined; dictation?: DictationAdapter | undefined; voice?: RealtimeVoiceAdapter | undefined; feedback?: FeedbackAdapter | undefined; suggestion?: SuggestionAdapter | undefined; }; unstable_humanToolNames?: string[] | undefined; unstable_enableMessageQueue?: boolean | undefined; }; type MakeRequestOptions = { method?: "POST" | "PUT" | "DELETE" | undefined; headers?: Record | undefined; query?: Record | undefined; body?: object | undefined; }; type McpAppMetadata = { readonly resourceUri: string; readonly mimeType?: string; readonly visibility?: readonly ("app" | "model")[]; }; type McpAppResourceOutput = { readonly render: ToolCallMessagePartComponent; }; type McpServerConfig = { type: "http" | "sse"; url: string; headers?: Record; redirect?: "error" | "follow"; connectionTimeout?: number | undefined; } | { type: "stdio"; command: string; args?: readonly string[]; env?: Record; cwd?: string; connectionTimeout?: number | undefined; }; type McpTool = ToolBase, unknown> & { type: "mcp"; server: McpServerConfig; description?: undefined; parameters?: undefined; disabled?: boolean; execute?: undefined; toModelOutput?: undefined; experimental_onSchemaValidationError?: undefined; providerOptions?: undefined; }; type McpToolkitDefinition = Record; type McpToolkitEntry = McpServerConfig | { server: McpServerConfig; disabled?: boolean | undefined; prefix?: string | undefined; tools?: Record | undefined; }; type McpToolkitToolConfig = { disabled?: boolean | undefined; }; declare const MessageAttachmentByIndex: import("react").FC; declare const MessageAttachmentByIndexProvider: FC>; declare class MessageAttachmentRuntimeImpl extends AttachmentRuntimeImpl<"message"> { get source(): "message"; remove(): never; } type MessageAttachmentState = CompleteAttachment & { readonly source: "message"; }; declare const MessageAttachments: import("react").FC; type MessageAttachmentsComponentConfig = { Image?: ComponentType | undefined; Document?: ComponentType | undefined; File?: ComponentType | undefined; Attachment?: ComponentType | undefined; }; declare const MessageByIndexProvider: FC>; type MessageCommonProps = { readonly id: string; readonly createdAt: Date; }; type MessageComponents = { Message: ComponentType; EditComposer?: ComponentType | undefined; UserEditComposer?: ComponentType | undefined; AssistantEditComposer?: ComponentType | undefined; SystemEditComposer?: ComponentType | undefined; UserMessage?: ComponentType | undefined; AssistantMessage?: ComponentType | undefined; SystemMessage?: ComponentType | undefined; } | { Message?: ComponentType | undefined; EditComposer?: ComponentType | undefined; UserEditComposer?: ComponentType | undefined; AssistantEditComposer?: ComponentType | undefined; SystemEditComposer?: ComponentType | undefined; UserMessage: ComponentType; AssistantMessage: ComponentType; SystemMessage?: ComponentType | undefined; }; declare const MessageContent: (_param20: MessageContentProps) => import("react").JSX.Element; type MessageContentPart = ThreadUserMessagePart | ThreadAssistantMessagePart; type MessageContentProps = { renderText?: (props: { part: Extract; index: number; }) => ReactElement; renderToolCall?: (props: { part: Extract; index: number; }) => ReactElement; renderImage?: (props: { part: Extract; index: number; }) => ReactElement; renderReasoning?: (props: { part: Extract; index: number; }) => ReactElement; renderSource?: (props: { part: Extract; index: number; }) => ReactElement; renderFile?: (props: { part: Extract; index: number; }) => ReactElement; renderData?: (props: { part: Extract; index: number; }) => ReactElement; }; interface MessageFormatAdapter> { format: string; encode(item: MessageFormatItem): TStorageFormat; decode(stored: MessageStorageEntry): MessageFormatItem; getId(message: TMessage): string; } interface MessageFormatItem { parentId: string | null; message: TMessage; } interface MessageFormatRepository { headId?: string | null; messages: MessageFormatItem[]; } declare const MessageIf: (_param21: MessageIfProps) => import("react").JSX.Element | null; type MessageIfProps = { children: ReactNode; user?: boolean | undefined; assistant?: boolean | undefined; running?: boolean | undefined; last?: boolean | undefined; }; type MessagePartRuntime = { addToolResult(result: any | ToolResponse): void; resumeToolCall(payload: unknown): void; respondToToolApproval(response: ToolApprovalResponse): void; readonly path: MessagePartRuntimePath; getState(): MessagePartState; subscribe(callback: () => void): Unsubscribe$1; }; declare class MessagePartRuntimeImpl implements MessagePartRuntime { private contentBinding; private messageApi?; private threadApi?; get path(): MessagePartRuntimePath; constructor(contentBinding: MessagePartSnapshotBinding, messageApi?: MessageStateBinding | undefined, threadApi?: ThreadRuntimeCoreBinding | undefined); protected __internal_bindMethods(): void; getState(): MessagePartState; addToolResult(result: any | ToolResponse): void; resumeToolCall(payload: unknown): void; respondToToolApproval(response: ToolApprovalResponse): void; subscribe(callback: () => void): Unsubscribe$1; } type MessagePartRuntimePath = MessageRuntimePath & { readonly messagePartSelector: { readonly type: "index"; readonly index: number; } | { readonly type: "toolCallId"; readonly toolCallId: string; }; }; type MessagePartSnapshotBinding = SubscribableWithState; type MessagePartState = (ThreadUserMessagePart | ThreadAssistantMessagePart) & { readonly status: MessagePartStatus | ToolCallMessagePartStatus; }; type MessagePartStatus = { readonly type: "running"; } | { readonly type: "complete"; } | { readonly type: "incomplete"; readonly reason: "cancelled" | "content-filter" | "error" | "length" | "other"; readonly error?: unknown; }; declare namespace MessagePrimitiveAttachmentByIndex { type Props = { index: number; components?: MessageAttachmentsComponentConfig; }; } declare const MessagePrimitiveAttachmentByIndex: FC; declare namespace MessagePrimitiveAttachments { type Props = { components: MessageAttachmentsComponentConfig; children?: never; } | { children: (value: { attachment: CompleteAttachment; }) => ReactNode; components?: never; }; } declare const MessagePrimitiveAttachments: FC; declare namespace MessagePrimitiveGroupedParts { type GroupPart = { readonly type: TKey; readonly status: MessagePartStatus | ToolCallMessagePartStatus; readonly indices: readonly number[]; }; type IndicatorPart = { readonly type: "indicator"; }; type IndicatorMode = "always" | "empty" | "never" | "no-text"; type RenderInfo = { readonly part: GroupPart | EnrichedPartState | IndicatorPart; readonly children: ReactNode; }; type Props = { readonly groupBy: (part: PartState, context: GroupByContext) => readonly TKey[] | null; readonly indicator?: IndicatorMode; readonly children: (info: RenderInfo) => ReactNode; }; } declare const MessagePrimitiveGroupedParts: { (_param22: MessagePrimitiveGroupedParts.Props): ReactNode; displayName: string; }; declare namespace MessagePrimitivePartByIndex { type Props = { index: number; components: MessagePrimitiveParts$1.Props["components"]; }; } declare const MessagePrimitivePartByIndex: FC; declare namespace MessagePrimitiveParts { type Props = MessagePrimitiveParts$1.Props; } declare const MessagePrimitiveParts: FC; declare namespace MessagePrimitiveParts$1 { type DataConfig = { by_name?: Record | undefined; Fallback?: DataMessagePartComponent | undefined; }; type BaseComponents = { Empty?: EmptyMessagePartComponent | undefined; Text?: TextMessagePartComponent | undefined; Source?: SourceMessagePartComponent | undefined; Image?: ImageMessagePartComponent | undefined; File?: FileMessagePartComponent | undefined; Unstable_Audio?: Unstable_AudioMessagePartComponent | undefined; data?: DataConfig | undefined; Quote?: QuoteMessagePartComponent | undefined; generativeUI?: { components: GenerativeUIComponentRegistry; Fallback?: ComponentType<{ component: string; props?: unknown; }> | undefined; } | undefined; }; type ToolsConfig = { by_name?: Record | undefined; Fallback?: ComponentType | undefined; } | { Override: ComponentType; }; type StandardComponents = BaseComponents & { Reasoning?: ReasoningMessagePartComponent | undefined; tools?: ToolsConfig | undefined; ToolGroup?: ComponentType>; ReasoningGroup?: ReasoningGroupComponent; ChainOfThought?: never; }; type ChainOfThoughtComponents = BaseComponents & { ChainOfThought: ComponentType; Reasoning?: never; tools?: never; ToolGroup?: never; ReasoningGroup?: never; }; export type Props = { components?: StandardComponents | ChainOfThoughtComponents | undefined; unstable_showEmptyOnNonTextEnd?: boolean | undefined; children?: never; } | { children: (value: { part: EnrichedPartState; }) => ReactNode; components?: never; unstable_showEmptyOnNonTextEnd?: never; }; export {}; } declare const MessagePrimitiveParts$1: FC; declare class MessageRepository { private messages; private head; private root; private updateLevels; private performOp; private _messages; get headId(): string | null; get canonicalHeadId(): string | null; getMessages(headId?: string): readonly ThreadMessage[]; addOrUpdateMessage(parentId: string | null, message: ThreadMessage): void; getMessage(messageId: string): { parentId: string | null; message: ThreadMessage; index: number; }; deleteMessage(messageId: string, replacementId?: string | null | undefined): void; getBranches(messageId: string): string[]; private evictOffBranchOptimisticMessages; switchToBranch(messageId: string): void; resetHead(messageId: string | null): void; clear(): void; export(): ExportedMessageRepository; import(_param23: ExportedMessageRepository): void; } type MessageRole = ThreadMessage["role"]; declare const MessageRoot: (_param24: MessageRootProps) => import("react").JSX.Element; type MessageRootProps = ViewProps & { children: ReactNode; }; type MessageRuntime = { readonly path: MessageRuntimePath; readonly composer: EditComposerRuntime; getState(): MessageState$1; delete(): void | Promise; reload(config?: ReloadConfig): void; speak(): void; stopSpeaking(): void; submitFeedback(_param25: { type: "positive" | "negative"; }): void; switchToBranch(_param26: { position?: "previous" | "next" | undefined; branchId?: string | undefined; }): void; unstable_getCopyText(): string; subscribe(callback: () => void): Unsubscribe$1; getMessagePartByIndex(idx: number): MessagePartRuntime; getMessagePartByToolCallId(toolCallId: string): MessagePartRuntime; getAttachmentByIndex(idx: number): AttachmentRuntime & { source: "message"; }; }; declare class MessageRuntimeImpl implements MessageRuntime { private _core; private _threadBinding; get path(): MessageRuntimePath; constructor(_core: MessageStateBinding, _threadBinding: ThreadRuntimeCoreBinding); protected __internal_bindMethods(): void; readonly composer: EditComposerRuntimeImpl; private _getEditComposerRuntimeCore; getState(): ThreadMessage & { readonly parentId: string | null; readonly index: number; readonly isLast: boolean; readonly branchNumber: number; readonly branchCount: number; readonly speech: SpeechState | undefined; }; delete(): void | Promise; reload(reloadConfig?: ReloadConfig): void; speak(): void; stopSpeaking(): void; submitFeedback(_param27: { type: "positive" | "negative"; }): void; switchToBranch(_param28: { position?: "previous" | "next" | undefined; branchId?: string | undefined; }): void; unstable_getCopyText(): string; subscribe(callback: () => void): Unsubscribe$1; getMessagePartByIndex(idx: number): MessagePartRuntimeImpl; getMessagePartByToolCallId(toolCallId: string): MessagePartRuntimeImpl; getAttachmentByIndex(idx: number): MessageAttachmentRuntimeImpl; } type MessageRuntimePath = ThreadRuntimePath & { readonly messageSelector: { readonly type: "messageId"; readonly messageId: string; } | { readonly type: "index"; readonly index: number; }; }; type MessageState = ThreadMessage & { readonly parentId: string | null; readonly isLast: boolean; readonly branchNumber: number; readonly branchCount: number; readonly speech: SpeechState | undefined; readonly composer: ComposerState; readonly parts: readonly PartState[]; readonly isCopied: boolean; readonly isHovering: boolean; readonly index: number; }; type MessageState$1 = ThreadMessage & { readonly parentId: string | null; readonly index: number; readonly isLast: boolean; readonly branchNumber: number; readonly branchCount: number; readonly speech: SpeechState | undefined; }; type MessageStateBinding = SubscribableWithState; type MessageStatus = { readonly type: "running"; } | { readonly type: "requires-action"; readonly reason: "interrupt" | "tool-calls"; } | { readonly type: "complete"; readonly reason: "stop" | "unknown"; } | { readonly type: "incomplete"; readonly reason: "cancelled" | "content-filter" | "error" | "length" | "other" | "tool-calls"; readonly error?: ReadonlyJSONValue; }; interface MessageStorageEntry { id: string; parent_id: string | null; format: string; content: TPayload; } type MessageTiming = { readonly streamStartTime: number; readonly firstTokenTime?: number; readonly totalStreamTime?: number; readonly tokenCount?: number; readonly tokensPerSecond?: number; readonly totalChunks: number; readonly toolCallCount: number; }; type MessagesComponentConfig = { Message: ComponentType; EditComposer?: ComponentType | undefined; UserEditComposer?: ComponentType | undefined; AssistantEditComposer?: ComponentType | undefined; SystemEditComposer?: ComponentType | undefined; UserMessage?: ComponentType | undefined; AssistantMessage?: ComponentType | undefined; SystemMessage?: ComponentType | undefined; } | { Message?: ComponentType | undefined; EditComposer?: ComponentType | undefined; UserEditComposer?: ComponentType | undefined; AssistantEditComposer?: ComponentType | undefined; SystemEditComposer?: ComponentType | undefined; UserMessage: ComponentType; AssistantMessage: ComponentType; SystemMessage?: ComponentType | undefined; }; type MessagesContent = { components: MessageComponents; children?: never; } | { children: (value: { message: MessageState$1; }) => ReactNode; components?: never; }; declare const ModelContext: Resource, [ ]>; type ModelContext$1 = { priority?: number | undefined; system?: string | undefined; tools?: Record> | undefined; callSettings?: LanguageModelV1CallSettings | undefined; config?: LanguageModelConfig | undefined; unstable_composerMetadata?: Record | undefined; }; type ModelContextProvider = { getModelContext: () => ModelContext$1; subscribe?: (callback: () => void) => Unsubscribe$1; }; declare class ModelContextRegistry implements ModelContextProvider { private _tools; private _instructions; private _providers; private _subscribers; private _providerUnsubscribes; getModelContext(): ModelContext$1; subscribe(callback: () => void): Unsubscribe$1; private notifySubscribers; addTool, TResult>(tool: AssistantToolProps$1): ModelContextRegistryToolHandle; addInstruction(config: string | AssistantInstructionsConfig): ModelContextRegistryInstructionHandle; addProvider(provider: ModelContextProvider): ModelContextRegistryProviderHandle; } interface ModelContextRegistryInstructionHandle { update(config: string | AssistantInstructionsConfig): void; remove(): void; } interface ModelContextRegistryProviderHandle { remove(): void; } interface ModelContextRegistryToolHandle = any, TResult = any> { update(tool: AssistantToolProps$1): void; remove(): void; } type ObjectKey = keyof T & (string | number); type ObjectStreamOperation = { readonly type: "set"; readonly path: readonly string[]; readonly value: ReadonlyJSONValue; } | { readonly type: "append-text"; readonly path: readonly string[]; readonly value: string; }; type OnSchemaValidationErrorFunction = ToolExecuteFunction; type OverrideOptionalField = undefined extends T[TKey] ? Exclude extends never ? { [K in TKey]?: undefined; } : { [K in TKey]?: TValue | undefined; } : { [K in TKey]: TValue; }; type OverrideToolDeclarationCallbacks, TResult> = Omit & { type?: never; } & ("execute" extends keyof T ? OverrideOptionalField, TResult>> : {}) & ("toModelOutput" extends keyof T ? OverrideOptionalField, NoInfer>> : {}) & ("experimental_onSchemaValidationError" extends keyof T ? OverrideOptionalField NoInfer | Promise>> : {}) & OverrideOptionalField>; type ParentOf = AssistantClientAccessor extends { source: infer S; } ? S extends ClientNames ? S : never : never; declare const PartByIndexProvider: FC>; type PartInit = { readonly type: "reasoning" | "text"; readonly parentId?: string; } | { readonly type: "tool-call"; readonly toolCallId: string; readonly toolName: string; readonly parentId?: string; } | { readonly type: "source"; readonly sourceType: "url"; readonly id: string; readonly url: string; readonly title?: string; readonly parentId?: string; } | { readonly type: "file"; readonly data: string; readonly mimeType: string; readonly parentId?: string; } | { readonly type: "data"; readonly name: string; readonly data: ReadonlyJSONValue; readonly parentId?: string; }; type PartMethods = { getState(): PartState; addToolResult(result: unknown | ToolResponse): void; resumeToolCall(payload: unknown): void; respondToToolApproval(response: ToolApprovalResponse): void; __internal_getRuntime?(): MessagePartRuntime; }; type PartProviderMetadata = { readonly [providerName: string]: ReadonlyJSONObject; }; type PartState = (ThreadUserMessagePart | ThreadAssistantMessagePart) & { readonly status: MessagePartStatus | ToolCallMessagePartStatus; }; type PdfToImagesRequestBody = { file_blob?: string | undefined; file_url?: string | undefined; }; type PdfToImagesResponse = { success: boolean; urls: string[]; message: string; }; type PendingAttachment = BaseAttachment & { status: PendingAttachmentStatus; file: File; }; type PendingAttachmentStatus = { type: "running"; reason: "uploading"; progress: number; } | { type: "requires-action"; reason: "composer-send"; } | { type: "incomplete"; reason: "error" | "upload-paused"; message?: string; }; type PropFieldStatus = "complete" | "streaming"; type ProviderOptions = Record>; type ProviderTool = Record, TResult = unknown> = ToolBase & { type: "provider"; providerId: `${string}.${string}`; parameters?: StandardSchemaV1 | JSONSchema7 | undefined; args: Record; supportsDeferredResults?: boolean; description?: undefined; disabled?: boolean; execute?: undefined; toModelOutput?: undefined; experimental_onSchemaValidationError?: undefined; providerOptions?: ProviderOptions; }; type ProviderToolConfig = Record> = Pick, "args" | "parameters" | "providerId" | "providerOptions" | "supportsDeferredResults">; type ProviderToolDefinition> = Extract, { type: "provider"; }>; type QueueItemState = { readonly id: string; readonly prompt: string; }; type QuoteInfo = { readonly text: string; readonly messageId: string; }; type QuoteMessagePartComponent = ComponentType; type QuoteMessagePartProps = QuoteInfo; type ReadonlyJSONArray = readonly ReadonlyJSONValue[]; type ReadonlyJSONObject = { readonly [key: string]: ReadonlyJSONValue; }; type ReadonlyJSONValue = null | string | number | boolean | ReadonlyJSONObject | ReadonlyJSONArray; declare namespace RealtimeVoiceAdapter { type Status = { type: "running" | "starting"; } | { type: "ended"; reason: "cancelled" | "error" | "finished"; error?: unknown; }; type Mode = "listening" | "speaking"; type TranscriptItem = { role: "assistant" | "user"; text: string; isFinal?: boolean; }; type Session = { status: Status; isMuted: boolean; disconnect: () => void; mute: () => void; unmute: () => void; onStatusChange: (callback: (status: Status) => void) => Unsubscribe$1; onTranscript: (callback: (transcript: TranscriptItem) => void) => Unsubscribe$1; onModeChange: (callback: (mode: Mode) => void) => Unsubscribe$1; onVolumeChange: (callback: (volume: number) => void) => Unsubscribe$1; }; } type RealtimeVoiceAdapter = { connect: (options: { abortSignal?: AbortSignal; }) => RealtimeVoiceAdapter.Session; }; type ReasoningGroupComponent = ComponentType; type ReasoningGroupProps = PropsWithChildren<{ startIndex: number; endIndex: number; }>; type ReasoningMessagePart = { readonly type: "reasoning"; readonly text: string; readonly providerMetadata?: PartProviderMetadata; readonly parentId?: string; }; type ReasoningMessagePartComponent = ComponentType; type ReasoningMessagePartProps = MessagePartState & ReasoningMessagePart; type ReloadConfig = { runConfig?: RunConfig; }; type RemoteThreadInitializeResponse = { remoteId: string; externalId: string | undefined; }; type RemoteThreadListAdapter = { list(params?: RemoteThreadListPageOptions): Promise; rename(remoteId: string, newTitle: string): Promise; updateCustom?(remoteId: string, custom: Record | undefined): Promise; archive(remoteId: string): Promise; unarchive(remoteId: string): Promise; delete(remoteId: string): Promise; initialize(threadId: string): Promise; generateTitle(remoteId: string, unstable_messages: readonly ThreadMessage[]): Promise; fetch(threadId: string): Promise; unstable_Provider?: ComponentType | undefined; }; type RemoteThreadListOptions = { runtimeHook: () => AssistantRuntime; adapter: RemoteThreadListAdapter; initialThreadId?: string | undefined; threadId?: string | undefined; onThreadIdChange?: ((threadId: string | undefined) => void) | undefined; allowNesting?: boolean | undefined; }; type RemoteThreadListPageOptions = { after?: string | undefined; }; type RemoteThreadListResponse = { threads: RemoteThreadMetadata[]; nextCursor?: string | undefined; }; type RemoteThreadMetadata = { readonly status: "archived" | "regular"; readonly remoteId: string; readonly externalId?: string | undefined; readonly title?: string | undefined; readonly lastMessageAt?: Date | undefined; readonly custom?: Record | undefined; }; type ReportToolCall = { tool_name: string; tool_call_id: string; tool_args?: string; tool_result?: string; tool_source?: "backend" | "frontend" | "mcp"; start_ms?: number; end_ms?: number; sampling_calls?: SamplingCallData[]; }; type RequireAtLeastOne = Pick> & { [K in Keys]-?: Required> & Partial>>; }[Keys]; type Resource = (...args: A) => ResourceElement; type ResourceElement = { readonly hook: (...args: A) => R; readonly args: Readonly; readonly key?: string | number; readonly deps?: readonly unknown[]; }; type RespondToToolApprovalOptions = { approvalId: string; approved: boolean; optionId?: string; reason?: string; }; type ResumeRunConfig = StartRunConfig & { stream?: (options: ChatModelRunOptions) => AsyncGenerator; }; type ResumeToolCallOptions = { toolCallId: string; payload: unknown; }; type RunConfig = { readonly custom?: Record; }; declare namespace RuntimeAdapterProvider { type Props = { adapters: RuntimeAdapters; children: ReactNode; }; } declare const RuntimeAdapterProvider: FC; type RuntimeAdapters = { modelContext?: ModelContextProvider | undefined; history?: ThreadHistoryAdapter | undefined; attachments?: AttachmentAdapter | undefined; }; type RuntimeCapabilities = { readonly switchToBranch: boolean; readonly switchBranchDuringRun: boolean; readonly edit: boolean; readonly reload: boolean; readonly delete: boolean; readonly cancel: boolean; readonly unstable_copy: boolean; readonly speech: boolean; readonly dictation: boolean; readonly voice: boolean; readonly attachments: boolean; readonly feedback: boolean; readonly queue: boolean; }; type SamplingCallData = { model_id?: string; input_tokens?: number; output_tokens?: number; reasoning_tokens?: number; cached_input_tokens?: number; duration_ms?: number; }; interface ScopeRegistry { [key: string]: { methods: any; meta?: any; events?: any }; } type SendOptions = { startRun?: boolean; steer?: boolean; }; declare class SimpleImageAttachmentAdapter implements AttachmentAdapter { accept: string; add(state: { file: File; }): Promise; send(attachment: PendingAttachment): Promise; remove(): Promise; } declare class SimpleTextAttachmentAdapter implements AttachmentAdapter { accept: string; add(state: { file: File; }): Promise; send(attachment: PendingAttachment): Promise; remove(): Promise; } type SnapshotCarrierMessage = { role: string; metadata?: unknown; content?: readonly unknown[] | undefined; }; type SourceMessagePart = { readonly type: "source"; readonly sourceType: "url"; readonly id: string; readonly url: string; readonly title?: string; readonly providerMetadata?: SourceProviderMetadata; readonly parentId?: string; } | { readonly type: "source"; readonly sourceType: "document"; readonly id: string; readonly url?: undefined; readonly title: string; readonly mediaType: string; readonly filename?: string; readonly providerMetadata?: SourceProviderMetadata; readonly parentId?: string; }; type SourceMessagePartComponent = ComponentType; type SourceMessagePartProps = MessagePartState & SourceMessagePart; type SourceProviderMetadata = PartProviderMetadata; interface SpeechRecognitionConstructor { new (): SpeechRecognitionInstance; } interface SpeechRecognitionInstance extends EventTarget { lang: string; continuous: boolean; interimResults: boolean; start(): void; stop(): void; abort(): void; } type SpeechState = { readonly messageId: string; readonly status: SpeechSynthesisAdapter.Status; }; declare namespace SpeechSynthesisAdapter { type Status = { type: "running" | "starting"; } | { type: "ended"; reason: "cancelled" | "error" | "finished"; error?: unknown; }; type Utterance = { status: Status; cancel: () => void; subscribe: (callback: () => void) => Unsubscribe$1; }; } type SpeechSynthesisAdapter = { speak: (text: string) => SpeechSynthesisAdapter.Utterance; }; type StartRunConfig = { parentId: string | null; sourceId: string | null; runConfig: RunConfig; }; type StateUpdater = TState | ((prev: TState) => TState); type StateUpdater$1 = TState | ((prev: TState) => TState); type SubmitFeedbackOptions = { messageId: string; type: "negative" | "positive"; }; type Subscribable = { subscribe: (callback: () => void) => Unsubscribe$1; }; type SubscribableWithState = Subscribable & { path: TPath; getState: () => TState; }; type SuggestionAdapter = { generate: (options: SuggestionAdapterGenerateOptions) => Promise | AsyncGenerator; }; type SuggestionAdapterGenerateOptions = { messages: readonly ThreadMessage[]; }; declare const SuggestionByIndexProvider: FC; type SuggestionByIndexProviderProps = PropsWithChildren<{ index: number; }>; type SuggestionConfig = string | { title: string; label: string; prompt: string; }; declare const SuggestionDescription: (_param29: SuggestionDescriptionProps) => import("react").JSX.Element; type SuggestionDescriptionProps = TextProps & { children?: ReactNode; }; type SuggestionState = { title: string; label: string; prompt: string; }; declare const SuggestionTitle: (_param30: SuggestionTitleProps) => import("react").JSX.Element; type SuggestionTitleProps = TextProps & { children?: ReactNode; }; declare const SuggestionTrigger: (_param31: SuggestionTriggerProps) => import("react").JSX.Element; type SuggestionTriggerProps = Omit & { children: ReactNode; send?: boolean | undefined; clearComposer?: boolean | undefined; }; declare const Suggestions: Resource, [ suggestions?: SuggestionConfig[] | undefined ]>; type SuggestionsComponentConfig = { Suggestion: ComponentType; }; declare const TOOL_RESPONSE_SYMBOL: unique symbol; type TextMessagePart = { readonly type: "text"; readonly text: string; readonly providerMetadata?: PartProviderMetadata; readonly parentId?: string; }; type TextMessagePartComponent = ComponentType; type TextMessagePartProps = MessagePartState & TextMessagePart; declare const TextMessagePartProvider: FC>; type ThreadAssistantMessage = MessageCommonProps & { readonly role: "assistant"; readonly content: readonly ThreadAssistantMessagePart[]; readonly status: MessageStatus; readonly metadata: { readonly unstable_state: ReadonlyJSONValue; readonly unstable_annotations: readonly ReadonlyJSONValue[]; readonly unstable_data: readonly ReadonlyJSONValue[]; readonly steps: readonly ThreadStep[]; readonly submittedFeedback?: { readonly type: "negative" | "positive"; }; readonly timing?: MessageTiming; readonly isOptimistic?: boolean; readonly custom: Record; }; }; type ThreadAssistantMessagePart = TextMessagePart | ReasoningMessagePart | ToolCallMessagePart | SourceMessagePart | FileMessagePart | ImageMessagePart | DataMessagePart | GenerativeUIMessagePart; declare class ThreadComposerAttachmentRuntimeImpl extends ComposerAttachmentRuntime<"thread-composer"> { get source(): "thread-composer"; } type ThreadComposerAttachmentState = Attachment & { readonly source: "thread-composer"; }; type ThreadComposerRuntime = Omit & { readonly path: ComposerRuntimePath & { composerSource: "thread"; }; readonly type: "thread"; getState(): ThreadComposerState; getAttachmentByIndex(idx: number): AttachmentRuntime & { source: "thread-composer"; }; }; type ThreadComposerRuntimeCore = ComposerRuntimeCore; type ThreadComposerRuntimeCoreBinding = SubscribableWithState; declare class ThreadComposerRuntimeImpl extends ComposerRuntimeImpl implements ThreadComposerRuntime { get path(): ComposerRuntimePath & { composerSource: "thread"; }; get type(): "thread"; private _getState; constructor(core: ThreadComposerRuntimeCoreBinding); getState(): ThreadComposerState; getAttachmentByIndex(idx: number): ThreadComposerAttachmentRuntimeImpl; } type ThreadComposerState = BaseComposerState & { readonly type: "thread"; }; declare const ThreadEmpty: (_param32: ThreadEmptyProps) => import("react").JSX.Element | null; type ThreadEmptyProps = { children: ReactNode; }; type ThreadHistoryAdapter = { load(): Promise; resume?(options: ChatModelRunOptions): AsyncGenerator; append(item: ExportedMessageRepositoryItem): Promise; delete?(items: ExportedMessageRepositoryItem[]): Promise; withFormat?>(formatAdapter: MessageFormatAdapter): GenericThreadHistoryAdapter; }; declare const ThreadIf: (_param33: ThreadIfProps) => import("react").JSX.Element | null; type ThreadIfProps = { children: ReactNode; empty?: boolean | undefined; running?: boolean | undefined; }; declare const ThreadListItemArchive: (_param34: ThreadListItemArchiveProps) => import("react").JSX.Element; type ThreadListItemArchiveProps = Omit & { children: ReactNode; }; declare const ThreadListItemByIndexProvider: FC>; type ThreadListItemCoreState = { readonly id: string; readonly remoteId: string | undefined; readonly externalId: string | undefined; readonly status: ThreadListItemStatus; readonly title?: string | undefined; readonly lastMessageAt?: Date | undefined; readonly custom?: Record | undefined; readonly runtime?: ThreadRuntimeCore | undefined; }; declare const ThreadListItemDelete: (_param35: ThreadListItemDeleteProps) => import("react").JSX.Element; type ThreadListItemDeleteProps = Omit & { children: ReactNode; }; type ThreadListItemEventCallback = (payload: ThreadListItemEventPayload[E]) => void; type ThreadListItemEventPayload = { switchedTo: Record; switchedAway: Record; }; type ThreadListItemEventType = keyof ThreadListItemEventPayload; declare namespace ThreadListItemPrimitiveTitle { type Props = { fallback?: ReactNode; }; } declare const ThreadListItemPrimitiveTitle: FC; declare const ThreadListItemRoot: (_param36: ThreadListItemRootProps) => import("react").JSX.Element; type ThreadListItemRootProps = ViewProps & { children: ReactNode; }; type ThreadListItemRuntime = { readonly path: ThreadListItemRuntimePath; getState(): ThreadListItemState$1; initialize(): Promise<{ remoteId: string; externalId: string | undefined; }>; generateTitle(): Promise; switchTo(options?: { unarchive?: boolean; }): Promise; rename(newTitle: string): Promise; updateCustom(custom: Record | undefined): Promise; archive(): Promise; unarchive(): Promise; delete(): Promise; detach(): void; subscribe(callback: () => void): Unsubscribe$1; unstable_on(event: E, callback: ThreadListItemEventCallback): Unsubscribe$1; __internal_getRuntime(): ThreadListItemRuntime; }; type ThreadListItemRuntimeBinding = SubscribableWithState; declare class ThreadListItemRuntimeImpl implements ThreadListItemRuntime { private _core; private _threadListBinding; get path(): ThreadListItemRuntimePath; constructor(_core: ThreadListItemStateBinding, _threadListBinding: ThreadListRuntimeCoreBinding); protected __internal_bindMethods(): void; getState(): ThreadListItemState$1; switchTo(options?: { unarchive?: boolean; }): Promise; rename(newTitle: string): Promise; updateCustom(custom: Record | undefined): Promise; archive(): Promise; unarchive(): Promise; delete(): Promise; initialize(): Promise<{ remoteId: string; externalId: string | undefined; }>; generateTitle(): Promise; unstable_on(event: E, callback: ThreadListItemEventCallback): Unsubscribe$1; subscribe(callback: () => void): Unsubscribe$1; detach(): void; __internal_getRuntime(): ThreadListItemRuntime; } type ThreadListItemRuntimePath = { readonly ref: string; readonly threadSelector: { readonly type: "main"; } | { readonly type: "index"; readonly index: number; } | { readonly type: "archiveIndex"; readonly index: number; } | { readonly type: "threadId"; readonly threadId: string; }; }; declare const ThreadListItemRuntimeProvider: FC>; type ThreadListItemState = { readonly id: string; readonly remoteId: string | undefined; readonly externalId: string | undefined; readonly title?: string | undefined; readonly lastMessageAt?: Date | undefined; readonly status: ThreadListItemStatus; readonly custom?: Record | undefined; }; type ThreadListItemState$1 = { readonly isMain: boolean; readonly id: string; readonly remoteId: string | undefined; readonly externalId: string | undefined; readonly status: ThreadListItemStatus; readonly title?: string | undefined; readonly lastMessageAt?: Date | undefined; readonly custom?: Record | undefined; }; type ThreadListItemStateBinding = SubscribableWithState; type ThreadListItemStatus = "archived" | "deleted" | "new" | "regular"; declare const ThreadListItemTrigger: (_param37: ThreadListItemTriggerProps) => import("react").JSX.Element; type ThreadListItemTriggerProps = Omit & { children: ReactNode; }; declare const ThreadListItemUnarchive: (_param38: ThreadListItemUnarchiveProps) => import("react").JSX.Element; type ThreadListItemUnarchiveProps = Omit & { children: ReactNode; }; declare const ThreadListItems: (_param39: ThreadListItemsProps) => import("react").JSX.Element; type ThreadListItemsProps = Omit, "data" | "renderItem"> & { renderItem: (props: { threadId: string; index: number; }) => ReactElement; }; declare const ThreadListNew: (_param40: ThreadListNewProps) => import("react").JSX.Element; type ThreadListNewProps = Omit & { children: ReactNode; }; declare const ThreadListRoot: (_param41: ThreadListRootProps) => import("react").JSX.Element; type ThreadListRootProps = ViewProps & { children: ReactNode; }; type ThreadListRuntime = { getState(): ThreadListState; subscribe(callback: () => void): Unsubscribe$1; readonly main: ThreadRuntime; getById(threadId: string): ThreadRuntime; readonly mainItem: ThreadListItemRuntime; getItemById(threadId: string): ThreadListItemRuntime; getItemByIndex(idx: number): ThreadListItemRuntime; getArchivedItemByIndex(idx: number): ThreadListItemRuntime; switchToThread(threadId: string, options?: { unarchive?: boolean; }): Promise; switchToNewThread(): Promise; getLoadThreadsPromise(): Promise; reload(): Promise; loadMore(): Promise; }; type ThreadListRuntimeCore = { readonly isLoading: boolean; readonly isLoadingMore?: boolean; readonly hasMore?: boolean; mainThreadId: string; newThreadId: string | undefined; threadIds: readonly string[]; archivedThreadIds: readonly string[]; readonly threadItems: Readonly>; getMainThreadRuntimeCore(): ThreadRuntimeCore; getThreadRuntimeCore(threadId: string): ThreadRuntimeCore; getItemById(threadId: string): ThreadListItemCoreState | undefined; switchToThread(threadId: string, options?: { unarchive?: boolean; }): Promise; switchToNewThread(): Promise; getLoadThreadsPromise(): Promise; reload?(): Promise; loadMore?(): Promise; detach(threadId: string): Promise; rename(threadId: string, newTitle: string): Promise; updateCustom?(threadId: string, custom: Record | undefined): Promise; archive(threadId: string): Promise; unarchive(threadId: string): Promise; delete(threadId: string): Promise; initialize(threadId: string): Promise<{ remoteId: string; externalId: string | undefined; }>; generateTitle(threadId: string): Promise; subscribe(callback: () => void): Unsubscribe$1; }; type ThreadListRuntimeCoreBinding = ThreadListRuntimeCore; declare class ThreadListRuntimeImpl implements ThreadListRuntime { private _core; private _runtimeFactory; private _getState; constructor(_core: ThreadListRuntimeCoreBinding, _runtimeFactory?: new (binding: ThreadRuntimeCoreBinding, threadListItemBinding: ThreadListItemRuntimeBinding) => ThreadRuntime); protected __internal_bindMethods(): void; switchToThread(threadId: string, options?: { unarchive?: boolean; }): Promise; switchToNewThread(): Promise; getLoadThreadsPromise(): Promise; reload(): Promise; loadMore(): Promise; getState(): ThreadListState; subscribe(callback: () => void): Unsubscribe$1; private _mainThreadListItemRuntime; readonly main: ThreadRuntime; get mainItem(): ThreadListItemRuntimeImpl; getById(threadId: string): ThreadRuntime; getItemByIndex(idx: number): ThreadListItemRuntimeImpl; getArchivedItemByIndex(idx: number): ThreadListItemRuntimeImpl; getItemById(threadId: string): ThreadListItemRuntimeImpl; } type ThreadListState = { readonly mainThreadId: string; readonly newThreadId: string | undefined; readonly threadIds: readonly string[]; readonly archivedThreadIds: readonly string[]; readonly isLoading: boolean; readonly isLoadingMore: boolean; readonly hasMore: boolean; readonly threadItems: Readonly>>; }; type ThreadMessage = BaseThreadMessage & (ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage); type ThreadMessageLike = { readonly role: "assistant" | "system" | "user"; readonly content: string | readonly (TextMessagePart | ReasoningMessagePart | SourceMessagePart | ImageMessagePart | FileMessagePart | DataMessagePart | GenerativeUIMessagePart | Unstable_AudioMessagePart | DataPrefixedPart | { readonly type: "tool-call"; readonly toolCallId?: string; readonly toolName: string; readonly args?: ReadonlyJSONObject; readonly argsText?: string; readonly artifact?: any; readonly result?: any | undefined; readonly isError?: boolean | undefined; readonly parentId?: string | undefined; readonly messages?: readonly ThreadMessage[] | undefined; readonly interrupt?: { type: "human"; payload: unknown; }; readonly timing?: ToolCallTiming; readonly providerMetadata?: PartProviderMetadata; readonly approval?: { readonly id: string; readonly approved?: boolean; readonly reason?: string; readonly isAutomatic?: boolean; readonly options?: readonly ToolApprovalOption[]; readonly optionId?: string; readonly resolution?: "cancelled" | "expired"; }; })[]; readonly id?: string | undefined; readonly createdAt?: Date | undefined; readonly status?: MessageStatus | undefined; readonly attachments?: readonly (Omit & { readonly content: readonly (ThreadUserMessagePart | DataPrefixedPart)[]; })[] | undefined; readonly metadata?: { readonly unstable_state?: ReadonlyJSONValue; readonly unstable_annotations?: readonly ReadonlyJSONValue[] | undefined; readonly unstable_data?: readonly ReadonlyJSONValue[] | undefined; readonly steps?: readonly ThreadStep[] | undefined; readonly timing?: MessageTiming | undefined; readonly submittedFeedback?: { readonly type: "negative" | "positive"; }; readonly isOptimistic?: boolean | undefined; readonly custom?: Record | undefined; } | undefined; }; declare const ThreadMessages: import("react").ForwardRefExoticComponent>>; type ThreadMessagesProps = Omit, "children" | "data" | "renderItem"> & MessagesContent; declare namespace ThreadPrimitiveMessageByIndex { type Props = { index: number; components: MessagesComponentConfig; }; } declare const ThreadPrimitiveMessageByIndex: FC; declare namespace ThreadPrimitiveSuggestionByIndex { type Props = { index: number; components: SuggestionsComponentConfig; }; } declare const ThreadPrimitiveSuggestionByIndex: FC; declare namespace ThreadPrimitiveSuggestions { type Props = { components: SuggestionsComponentConfig; children?: never; } | { children: (value: { suggestion: SuggestionState; }) => ReactNode; components?: never; }; } declare const ThreadPrimitiveSuggestions: import("react").NamedExoticComponent; declare namespace ThreadPrimitiveUnstable_MessageById { type Props = { messageId: string; components: MessagesComponentConfig; }; } declare const ThreadPrimitiveUnstable_MessageById: FC; declare const ThreadRoot: (_param42: ThreadRootProps) => import("react").JSX.Element; type ThreadRootProps = ViewProps & { children: ReactNode; }; type ThreadRuntime = { readonly path: ThreadRuntimePath; readonly composer: ThreadComposerRuntime; getState(): ThreadState; append(message: CreateAppendMessage): void; deleteMessage(messageId: string): void | Promise; startRun(config: CreateStartRunConfig): void; resumeRun(config: CreateResumeRunConfig): void; exportExternalState(): any; importExternalState(state: any): void; subscribe(callback: () => void): Unsubscribe$1; cancelRun(): void; getModelContext(): ModelContext$1; export(): ExportedMessageRepository; import(repository: ExportedMessageRepository): void; reset(initialMessages?: readonly ThreadMessageLike[]): void; getMessageByIndex(idx: number): MessageRuntime; getMessageById(messageId: string): MessageRuntime; stopSpeaking(): void; connectVoice(): void; disconnectVoice(): void; getVoiceVolume(): number; subscribeVoiceVolume(callback: () => void): Unsubscribe$1; muteVoice(): void; unmuteVoice(): void; unstable_on(event: E, callback: ThreadRuntimeEventCallback): Unsubscribe$1; }; type ThreadRuntimeCore = Readonly<{ getMessageById: (messageId: string) => { parentId: string | null; message: ThreadMessage; index: number; } | undefined; getBranches: (messageId: string) => readonly string[]; switchToBranch: (branchId: string) => void; append: (message: AppendMessage) => void; deleteMessage: (messageId: string) => void | Promise; startRun: (config: StartRunConfig) => void; resumeRun: (config: ResumeRunConfig) => void; cancelRun: () => void; addToolResult: (options: AddToolResultOptions) => void; resumeToolCall: (options: ResumeToolCallOptions) => void; respondToToolApproval: (options: RespondToToolApprovalOptions) => void; speak: (messageId: string) => void; stopSpeaking: () => void; connectVoice: () => void; disconnectVoice: () => void; muteVoice: () => void; unmuteVoice: () => void; submitFeedback: (feedback: SubmitFeedbackOptions) => void; getModelContext: () => ModelContext$1; composer: ThreadComposerRuntimeCore; getEditComposer: (messageId: string) => EditComposerRuntimeCore | undefined; beginEdit: (messageId: string) => void; getQueueItems?: () => readonly QueueItemState[]; steerQueueItem?: (queueItemId: string) => void; removeQueueItem?: (queueItemId: string) => void; speech: SpeechState | undefined; voice: VoiceSessionState | undefined; capabilities: Readonly; isDisabled: boolean; isSendDisabled: boolean; isLoading: boolean; isRunning?: boolean | undefined; messages: readonly ThreadMessage[]; state: ReadonlyJSONValue; suggestions: readonly ThreadSuggestion$1[]; extras: unknown; subscribe: (callback: () => void) => Unsubscribe$1; getVoiceVolume: () => number; subscribeVoiceVolume: (callback: () => void) => Unsubscribe$1; import(repository: ExportedMessageRepository): void; export(): ExportedMessageRepository; exportExternalState(): any; importExternalState(state: any): void; reset(initialMessages?: readonly ThreadMessageLike[]): void; unstable_on(event: E, callback: ThreadRuntimeEventCallback): Unsubscribe$1; }>; type ThreadRuntimeCoreBinding = SubscribableWithState & { outerSubscribe(callback: () => void): Unsubscribe$1; }; type ThreadRuntimeEventCallback = (payload: ThreadRuntimeEventPayload[E]) => void; type ThreadRuntimeEventPayload = { runStart: Record; runEnd: Record; initialize: Record; modelContextUpdate: Record; }; type ThreadRuntimeEventType = keyof ThreadRuntimeEventPayload; declare class ThreadRuntimeImpl implements ThreadRuntime { get path(): ThreadRuntimePath; get __internal_threadBinding(): Subscribable & { path: ThreadRuntimePath; getState: () => Readonly<{ getMessageById: (messageId: string) => { parentId: string | null; message: ThreadMessage; index: number; } | undefined; getBranches: (messageId: string) => readonly string[]; switchToBranch: (branchId: string) => void; append: (message: AppendMessage) => void; deleteMessage: (messageId: string) => void | Promise; startRun: (config: StartRunConfig) => void; resumeRun: (config: ResumeRunConfig) => void; cancelRun: () => void; addToolResult: (options: AddToolResultOptions) => void; resumeToolCall: (options: ResumeToolCallOptions) => void; respondToToolApproval: (options: RespondToToolApprovalOptions) => void; speak: (messageId: string) => void; stopSpeaking: () => void; connectVoice: () => void; disconnectVoice: () => void; muteVoice: () => void; unmuteVoice: () => void; submitFeedback: (feedback: SubmitFeedbackOptions) => void; getModelContext: () => ModelContext$1; composer: Readonly<{ isEditing: boolean; canCancel: boolean; canSend: boolean; isEmpty: boolean; attachments: readonly Attachment[]; attachmentAccept: string; addAttachment: (fileOrAttachment: File | CreateAttachment) => Promise; removeAttachment: (attachmentId: string) => Promise; text: string; setText: (value: string) => void; role: MessageRole; setRole: (role: MessageRole) => void; runConfig: RunConfig; setRunConfig: (runConfig: RunConfig) => void; quote: QuoteInfo | undefined; setQuote: (quote: QuoteInfo | undefined) => void; reset: () => Promise; clearAttachments: () => Promise; send: (options?: SendOptions) => void; cancel: () => void; queue: readonly QueueItemState[]; steerQueueItem: (queueItemId: string) => void; removeQueueItem: (queueItemId: string) => void; dictation: DictationState | undefined; startDictation: () => void; stopDictation: () => void; subscribe: (callback: () => void) => Unsubscribe$1; unstable_on: (event: E, callback: ComposerRuntimeEventCallback) => Unsubscribe$1; }>; getEditComposer: (messageId: string) => EditComposerRuntimeCore | undefined; beginEdit: (messageId: string) => void; getQueueItems?: () => readonly QueueItemState[]; steerQueueItem?: (queueItemId: string) => void; removeQueueItem?: (queueItemId: string) => void; speech: SpeechState | undefined; voice: VoiceSessionState | undefined; capabilities: Readonly; isDisabled: boolean; isSendDisabled: boolean; isLoading: boolean; isRunning?: boolean | undefined; messages: readonly ThreadMessage[]; state: ReadonlyJSONValue; suggestions: readonly ThreadSuggestion$1[]; extras: unknown; subscribe: (callback: () => void) => Unsubscribe$1; getVoiceVolume: () => number; subscribeVoiceVolume: (callback: () => void) => Unsubscribe$1; import(repository: ExportedMessageRepository): void; export(): ExportedMessageRepository; exportExternalState(): any; importExternalState(state: any): void; reset(initialMessages?: readonly ThreadMessageLike[]): void; unstable_on(event: E, callback: ThreadRuntimeEventCallback): Unsubscribe$1; }>; } & { outerSubscribe(callback: () => void): Unsubscribe$1; } & { getStateState(): ThreadState; }; private readonly _threadBinding; constructor(threadBinding: ThreadRuntimeCoreBinding, threadListItemBinding: ThreadListItemRuntimeBinding); protected __internal_bindMethods(): void; readonly composer: ThreadComposerRuntimeImpl; getState(): ThreadState; append(message: CreateAppendMessage): void; deleteMessage(messageId: string): void | Promise; subscribe(callback: () => void): Unsubscribe$1; getModelContext(): ModelContext$1; startRun(config: CreateStartRunConfig): void; resumeRun(config: CreateResumeRunConfig): void; exportExternalState(): any; importExternalState(state: any): void; cancelRun(): void; stopSpeaking(): void; connectVoice(): void; disconnectVoice(): void; getVoiceVolume(): number; subscribeVoiceVolume(callback: () => void): Unsubscribe$1; muteVoice(): void; unmuteVoice(): void; export(): ExportedMessageRepository; import(data: ExportedMessageRepository): void; reset(initialMessages?: readonly ThreadMessageLike[]): void; getMessageByIndex(idx: number): MessageRuntimeImpl; getMessageById(messageId: string): MessageRuntimeImpl; private _getMessageRuntime; private _eventSubscriptionSubjects; unstable_on(event: E, callback: ThreadRuntimeEventCallback): Unsubscribe$1; } type ThreadRuntimePath = { readonly ref: string; readonly threadSelector: { readonly type: "main"; } | { readonly type: "threadId"; readonly threadId: string; }; }; type ThreadState = { readonly threadId: string; readonly metadata: ThreadListItemState$1; readonly isDisabled: boolean; readonly isLoading: boolean; readonly isRunning: boolean; readonly capabilities: RuntimeCapabilities; readonly messages: readonly ThreadMessage[]; readonly state: ReadonlyJSONValue; readonly suggestions: readonly ThreadSuggestion$1[]; readonly extras: unknown; readonly speech: SpeechState | undefined; readonly voice: VoiceSessionState | undefined; }; type ThreadState$1 = { readonly isEmpty: boolean; readonly isDisabled: boolean; readonly isLoading: boolean; readonly isRunning: boolean; readonly capabilities: RuntimeCapabilities; readonly messages: readonly MessageState[]; readonly state: ReadonlyJSONValue; readonly suggestions: readonly ThreadSuggestion$1[]; readonly extras: unknown; readonly speech: SpeechState | undefined; readonly voice: VoiceSessionState | undefined; readonly composer: ComposerState; }; type ThreadStep = { readonly messageId?: string; readonly usage?: { readonly inputTokens: number; readonly outputTokens: number; } | undefined; }; declare const ThreadSuggestion: (_param43: ThreadSuggestionProps) => import("react").JSX.Element; type ThreadSuggestion$1 = { prompt: string; }; type ThreadSuggestionProps = Omit & { children: ReactNode; prompt: string; send?: boolean | undefined; clearComposer?: boolean | undefined; }; type ThreadSystemMessage = MessageCommonProps & { readonly role: "system"; readonly content: readonly [ TextMessagePart ]; readonly metadata: { readonly unstable_state?: undefined; readonly unstable_annotations?: undefined; readonly unstable_data?: undefined; readonly steps?: undefined; readonly submittedFeedback?: undefined; readonly timing?: undefined; readonly custom: Record; }; }; type ThreadUserMessage = MessageCommonProps & { readonly role: "user"; readonly content: readonly ThreadUserMessagePart[]; readonly attachments: readonly CompleteAttachment[]; readonly metadata: { readonly unstable_state?: undefined; readonly unstable_annotations?: undefined; readonly unstable_data?: undefined; readonly steps?: undefined; readonly submittedFeedback?: undefined; readonly timing?: undefined; readonly custom: Record; }; }; type ThreadUserMessagePart = TextMessagePart | ImageMessagePart | FileMessagePart | DataMessagePart | Unstable_AudioMessagePart; type ThreadsState = { readonly mainThreadId: string; readonly newThreadId: string | null; readonly isLoading: boolean; readonly isLoadingMore: boolean; readonly hasMore: boolean; readonly threadIds: readonly string[]; readonly archivedThreadIds: readonly string[]; readonly threadItems: readonly ThreadListItemState[]; readonly main: ThreadState$1; }; type Tool = Record, TResult = unknown> = FrontendTool | BackendTool | HumanTool | ProviderTool | McpTool | ToolWithoutType; type ToolApprovalOption = { readonly id: string; readonly kind: ToolApprovalOptionKind | (string & {}); readonly label?: string; readonly description?: string; readonly grants?: readonly string[]; readonly confirm?: boolean | { title?: string; description?: string; }; }; type ToolApprovalOptionKind = "allow-always" | "allow-once" | "reject-always" | "reject-once"; type ToolApprovalResponse = { readonly approved: boolean; readonly reason?: string; } | { readonly optionId: string; readonly reason?: string; } | { readonly approved: boolean; readonly optionId: string; readonly reason?: string; }; type ToolArgsStatus = Record> = { status: "complete" | "incomplete" | "requires-action" | "running"; propStatus: Partial>; }; type ToolBase = Record, TResult = unknown> = { streamCall?: ToolStreamCallFunction; display?: ToolDisplay; }; interface ToolCallArgsReader> { get>(...fieldPath: PathT): Promise>; streamValues>(...fieldPath: PathT): AsyncIterableStream>>; streamText>(...fieldPath: PathT): TypeAtPath extends string & (infer U) ? AsyncIterableStream : never; forEach>(...fieldPath: PathT): NonNullable> extends Array ? AsyncIterableStream : never; } type ToolCallCompleteText, TResult> = ReactNode | ((options: { args: TArgs; result: TResult | undefined; }) => ReactNode); type ToolCallMessagePart = { readonly type: "tool-call"; readonly toolCallId: string; readonly toolName: string; readonly args: TArgs; readonly result?: TResult | undefined; readonly isError?: boolean | undefined; readonly argsText: string; readonly artifact?: unknown; readonly timing?: ToolCallTiming; readonly mcp?: ToolCallMessagePartMcpMetadata; readonly providerMetadata?: PartProviderMetadata; readonly modelContent?: readonly ToolModelContentPart[] | undefined; readonly interrupt?: { type: "human"; payload: unknown; }; readonly approval?: { readonly id: string; readonly approved?: boolean; readonly reason?: string; readonly isAutomatic?: boolean; readonly options?: readonly ToolApprovalOption[]; readonly optionId?: string; readonly resolution?: "cancelled" | "expired"; }; readonly parentId?: string; readonly messages?: readonly ThreadMessage[]; }; type ToolCallMessagePartComponent = ComponentType>; type ToolCallMessagePartMcpMetadata = { readonly app?: McpAppMetadata; }; type ToolCallMessagePartProps = MessagePartState & ToolCallMessagePart & { addResult: (result: TResult | ToolResponse) => void; resume: (payload: unknown) => void; respondToApproval: (response: ToolApprovalResponse) => void; }; type ToolCallMessagePartStatus = { readonly type: "requires-action"; readonly reason: "interrupt"; } | MessagePartStatus; interface ToolCallReader = Record, TResult = unknown> { args: ToolCallArgsReader; response: ToolCallResponseReader; result: { get: () => Promise; }; } interface ToolCallResponseReader { get: () => Promise>; } type ToolCallRunningText> = ReactNode | ((options: { args: TArgs; }) => ReactNode); type ToolCallText, TResult> = { running: ToolCallRunningText; complete?: ToolCallCompleteText | undefined; } | { running?: ToolCallRunningText | undefined; complete: ToolCallCompleteText; }; type ToolCallTiming = { readonly startedAt: number; readonly completedAt?: number; }; type ToolDeclaration = Record, TResult = unknown> = FrontendTool | BackendToolDeclaration | HumanTool | ProviderTool | McpTool | ToolWithoutType; type ToolDefinition = Record, TResult = unknown> = WithRender, TArgs, TResult>; type ToolDisplay = "inline" | "standalone"; type ToolExecute, TResult> = (args: TArgs, context: ToolExecuteContext) => TResult | Promise; type ToolExecuteContext = Parameters>[1]; type ToolExecuteFunction = (args: TArgs, context: ToolExecutionContext) => TResult | Promise; type ToolExecutionContext = { toolCallId: string; abortSignal: AbortSignal; human: (payload: unknown) => Promise; }; type ToolModelContentPart = { readonly type: "text"; readonly text: string; } | { readonly type: "file"; readonly data: string; readonly mediaType: string; readonly filename?: string; }; type ToolModelOutputFunction = (options: { toolCallId: string; input: TArgs; output: TResult; }) => readonly ToolModelContentPart[] | Promise; type ToolParameters> = ToolDeclaration["parameters"]; type ToolRegistration = { readonly render: ToolCallMessagePartComponent; readonly standalone: boolean; }; declare class ToolResponse { get [TOOL_RESPONSE_SYMBOL](): boolean; readonly artifact?: ReadonlyJSONValue; readonly result: TResult; readonly isError: boolean; readonly modelContent?: readonly ToolModelContentPart[]; readonly messages?: ReadonlyJSONValue; constructor(options: ToolResponseLike); static [Symbol.hasInstance](obj: unknown): obj is ToolResponse; static toResponse(result: any | ToolResponse): ToolResponse; } type ToolResponseLike = { result: TResult; artifact?: ReadonlyJSONValue | undefined; isError?: boolean | undefined; modelContent?: readonly ToolModelContentPart[] | undefined; messages?: ReadonlyJSONValue | undefined; }; type ToolStreamCall, TResult> = (reader: ToolCallReader, context: ToolExecuteContext) => void; type ToolStreamCallFunction = Record, TResult = unknown> = (reader: ToolCallReader, context: ToolExecutionContext) => void; type ToolWithoutType = Record, TResult = unknown> = (Omit, "type"> | Omit, "type"> | Omit, "type"> | Omit, "type">) & { type?: undefined; }; type Toolkit = Record>; type ToolkitDefinition; } = Record, TResultByName extends { [K in keyof TArgsByName]: unknown; } = { [K in keyof TArgsByName]: any; }> = { [K in keyof TArgsByName]: ToolkitDefinitionEntry; }; type ToolkitDefinitionEntry = Record, TResult = unknown> = ToolkitDefinitionInput | ToolDefinition; type ToolkitDefinitionEntryWithParameters = Record, TResult = unknown> = ToolkitDefinitionInput & { parameters: NonNullable>; }; type ToolkitDefinitionInput, TResult> = WithRender extends (infer T) ? T extends { streamCall?: unknown; } ? OverrideToolDeclarationCallbacks : never : never, TArgs, TResult>; declare const Tools: Resource, [ { toolkit?: Toolkit; mcpApp?: ResourceElement | undefined; } ]>; type ToolsState = { toolUIs: Record; mcpApp?: McpAppResourceOutput | undefined; tools: Record; }; type TupleIndex = Exclude; type TypeAtPath = P extends [ infer Head, ...infer Rest ] ? Head extends keyof T ? TypeAtPath : never : T; type TypePath = [ ] | (0 extends 1 & T ? any[] : T extends object ? T extends readonly any[] ? number extends T["length"] ? { [K in TupleIndex]: [ AsNumber, ...TypePath ]; }[TupleIndex] : [ number, ...TypePath ] : { [K in ObjectKey]: [ K, ...TypePath ]; }[ObjectKey] : [ ]); type UnionToIntersection = (U extends unknown ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never; type Unstable_AudioMessagePart = { readonly type: "audio"; readonly audio: { readonly data: string; readonly format: "mp3" | "wav"; }; }; type Unstable_AudioMessagePartComponent = ComponentType; type Unstable_AudioMessagePartProps = MessagePartState & Unstable_AudioMessagePart; type Unstable_InferInteractableState = TSchema extends { "~standard": { types?: { output: infer TOutput; } | undefined; }; } ? TOutput : unknown; type Unstable_InteractableConfig = { description: string; stateSchema: TSchema; initialState: Unstable_InferInteractableState; id?: string | undefined; updateRender?: ToolCallMessagePartComponent | undefined; }; type Unstable_InteractableDefinition = { id: string; name: string; description: string; stateSchema: Unstable_InteractableStateSchema; state: unknown; initialState: unknown; scope?: InteractableScope | undefined; }; type Unstable_InteractablePersistedState = Record; type Unstable_InteractablePersistenceAdapter = { save(state: Unstable_InteractablePersistedState): void | Promise; load?(): Unstable_InteractablePersistedState | null | undefined | Promise; }; type Unstable_InteractablePersistenceStatus = { isPending: boolean; error: unknown; }; type Unstable_InteractableRegistration = { id: string; name: string; description: string; stateSchema: Unstable_InteractableStateSchema; initialState: unknown; updateRender?: ToolCallMessagePartComponent | undefined; }; type Unstable_InteractableSnapshotEntry = { id: string; name: string; state: unknown; partial?: boolean | undefined; }; type Unstable_InteractableStateSchema = NonNullable["parameters"]>; type Unstable_InteractableToolConfig = { description: string; stateSchema: TSchema; render: (props: Unstable_InteractableToolRenderProps>) => ReactNode; }; type Unstable_InteractableToolRenderProps = { state: TState; setState: (updater: TState | ((prev: TState) => TState)) => void; version: Unstable_InteractableVersionInfo | undefined; id: string; streaming: boolean; }; type Unstable_InteractableVersion = { state: unknown; origin: "create" | "update" | "user-edit"; toolCallId?: string | undefined; }; type Unstable_InteractableVersionInfo = { state: TState; isLatest: boolean; restore: () => void; }; type Unstable_InteractablesClientSchema = { methods: Unstable_InteractablesMethods; }; type Unstable_InteractablesConfig = { persistence?: Unstable_InteractablePersistenceAdapter | undefined; }; type Unstable_InteractablesMethods = { getState(): Unstable_InteractablesState; register(def: Unstable_InteractableRegistration): Unsubscribe$1; setState(id: string, updater: (prev: unknown) => unknown): void; exportState(): Unstable_InteractablePersistedState; importState(saved: Unstable_InteractablePersistedState): void; setPersistenceAdapter(adapter: Unstable_InteractablePersistenceAdapter | undefined): void; flush(): Promise; }; type Unstable_InteractablesState = { definitions: Record; persistence: Record; }; type Unsubscribe = () => void; type Unsubscribe$1 = () => void; type UseActionBarCopyOptions = { copiedDuration?: number | undefined; copyToClipboard?: ((text: string) => void | Promise) | undefined; }; type UseComposerIfProps = RequireAtLeastOne; type ValidateClient = ScopeRegistry[K] extends { methods: ClientMethods; } ? "meta" extends keyof ScopeRegistry[K] ? ScopeRegistry[K]["meta"] extends ClientMetaType ? "events" extends keyof ScopeRegistry[K] ? ScopeRegistry[K]["events"] extends ClientEventsType ? ScopeRegistry[K] : ClientError<`ERROR: ${K & string} has invalid events type`> : ScopeRegistry[K] : ClientError<`ERROR: ${K & string} has invalid meta type`> : "events" extends keyof ScopeRegistry[K] ? ScopeRegistry[K]["events"] extends ClientEventsType ? ScopeRegistry[K] : ClientError<`ERROR: ${K & string} has invalid events type`> : ScopeRegistry[K] : ClientError<`ERROR: ${K & string} has invalid methods type`>; type VoiceSessionControls = { disconnect: () => void; mute: () => void; unmute: () => void; }; type VoiceSessionHelpers = { setStatus: (status: RealtimeVoiceAdapter.Status) => void; end: (reason: "cancelled" | "error" | "finished", error?: unknown) => void; emitTranscript: (item: RealtimeVoiceAdapter.TranscriptItem) => void; emitMode: (mode: RealtimeVoiceAdapter.Mode) => void; emitVolume: (volume: number) => void; isDisposed: () => boolean; }; type VoiceSessionState = { readonly status: RealtimeVoiceAdapter.Status; readonly isMuted: boolean; readonly mode: RealtimeVoiceAdapter.Mode; }; type WildcardPayload = { [K in keyof ClientEventMap]: { event: K; payload: ClientEventMap[K]; }; }[Extract]; type WithRender, TResult> = T extends { type: "frontend" | "human"; } ? T & (T extends { type: "frontend"; } ? { render: ToolCallMessagePartComponent; } | { render?: ToolCallMessagePartComponent; renderText: ToolCallText; } : { render: ToolCallMessagePartComponent; }) : T & { render?: ToolCallMessagePartComponent | undefined; renderText?: ToolCallText | undefined; }; declare namespace actionBar_d_exports { export { ActionBarCopy as Copy, ActionBarCopyProps as CopyProps, ActionBarEdit as Edit, ActionBarEditProps as EditProps, ActionBarFeedbackNegative as FeedbackNegative, ActionBarFeedbackNegativeProps as FeedbackNegativeProps, ActionBarFeedbackPositive as FeedbackPositive, ActionBarFeedbackPositiveProps as FeedbackPositiveProps, ActionBarReload as Reload, ActionBarReloadProps as ReloadProps }; } declare namespace attachment_d_exports { export { AttachmentName as Name, AttachmentNameProps as NameProps, AttachmentRemove as Remove, AttachmentRemoveProps as RemoveProps, AttachmentRoot as Root, AttachmentRootProps as RootProps, AttachmentThumb as Thumb, AttachmentThumbProps as ThumbProps }; } declare namespace branchPicker_d_exports { export { BranchPickerCount as Count, BranchPickerCountProps as CountProps, BranchPickerNext as Next, BranchPickerNextProps as NextProps, BranchPickerNumber as Number, BranchPickerNumberProps as NumberProps, BranchPickerPrevious as Previous, BranchPickerPreviousProps as PreviousProps }; } declare namespace chainOfThought_d_exports { export { ChainOfThoughtAccordionTrigger as AccordionTrigger, ChainOfThoughtAccordionTriggerProps as AccordionTriggerProps, ChainOfThoughtPrimitiveParts as Parts, ChainOfThoughtRoot as Root, ChainOfThoughtRootProps as RootProps }; } declare namespace composer_d_exports { export { ComposerAddAttachment as AddAttachment, ComposerAddAttachmentProps as AddAttachmentProps, ComposerAttachmentByIndex as AttachmentByIndex, ComposerAttachments as Attachments, ComposerCancel as Cancel, ComposerCancelProps as CancelProps, ComposerPrimitiveIf as If, ComposerInput as Input, ComposerInputProps as InputProps, ComposerRoot as Root, ComposerRootProps as RootProps, ComposerSend as Send, ComposerSendProps as SendProps }; } declare function createVoiceSession(options: { abortSignal?: AbortSignal; }, setup: (helpers: VoiceSessionHelpers) => Promise): RealtimeVoiceAdapter.Session; declare function defineMcpToolkit(definition: McpToolkitDefinition): Toolkit; declare function defineToolkit; }, TResultByName extends { [K in keyof TArgsByName]: unknown; } = { [K in keyof TArgsByName]: any; }>(_definition: { [K in keyof TArgsByName]: ToolkitDefinitionEntryWithParameters; }): Toolkit & { [K in keyof TArgsByName]: ToolkitDefinitionEntryWithParameters; }; declare function defineToolkit(_definition: TDefinition): Toolkit & TDefinition; declare function externalTool(): never; declare const fromThreadMessageLike: (like: ThreadMessageLike, fallbackId: string, fallbackStatus: MessageStatus) => ThreadMessage; declare const generateId: (size?: number) => string; declare const getAutoStatus: (isLast: boolean, isRunning: boolean, hasInterruptedToolCalls: boolean, hasPendingToolCalls: boolean, error?: ReadonlyJSONValue) => MessageStatus; declare global { interface Window { SpeechRecognition?: SpeechRecognitionConstructor; webkitSpeechRecognition?: SpeechRecognitionConstructor; } } declare const groupPartByType: (map: Partial>>) => ((part: PartState, context?: GroupByContext) => readonly TKey[]); declare const hitl: typeof humanTool; declare const hitlTool: typeof humanTool; declare function humanTool(): never; declare namespace entry_root_exports { export { actionBar_d_exports as ActionBarPrimitive, AppendMessage, AssistantClient, AssistantContextConfig, AssistantDataUI, AssistantDataUIProps, AssistantEventCallback, AssistantEventName, AssistantEventPayload, AssistantEventScope, AssistantEventSelector, AssistantInteractableProps, AssistantRuntime, AssistantRuntimeProvider, AssistantState, AssistantTool, AssistantToolProps, AssistantToolUI, AssistantToolUIProps, Attachment, AttachmentAdapter, attachment_d_exports as AttachmentPrimitive, AttachmentRuntime, AttachmentState, AuiIf, AuiProvider, branchPicker_d_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, ChainOfThoughtPartByIndexProvider, chainOfThought_d_exports as ChainOfThoughtPrimitive, ChatModelAdapter, ChatModelRunOptions, ChatModelRunResult, CompleteAttachment, ComposerAttachmentByIndexProvider, composer_d_exports as ComposerPrimitive, ComposerRuntime, ComposerState, CompositeAttachmentAdapter, CreateAttachment, DataMessagePart, DataMessagePartComponent, DataMessagePartProps, DataRenderers, EditComposerRuntime, EmptyMessagePartComponent, EmptyMessagePartProps, index_d_exports$1 as ErrorPrimitive, ExportedMessageRepository, ExportedMessageRepositoryItem, FeedbackAdapter, FileMessagePart, FileMessagePartComponent, FileMessagePartProps, GroupByContext, ImageMessagePart, ImageMessagePartComponent, ImageMessagePartProps, InMemoryThreadListAdapter, Interactables, LanguageModelConfig, LanguageModelV1CallSettings, LocalRuntimeOptions, McpToolkitDefinition, McpToolkitEntry, McpToolkitToolConfig, MessageAttachmentByIndexProvider, MessageByIndexProvider, message_d_exports as MessagePrimitive, MessageRole, MessageRuntime, MessageState, MessageStatus, ModelContext$1 as ModelContext, ModelContext as ModelContextClient, ModelContextProvider, ModelContextRegistry, ModelContextRegistryInstructionHandle, ModelContextRegistryProviderHandle, ModelContextRegistryToolHandle, PartByIndexProvider, PendingAttachment, ProviderToolConfig, RealtimeVoiceAdapter, ReasoningGroupComponent, ReasoningGroupProps, ReasoningMessagePart, ReasoningMessagePartComponent, ReasoningMessagePartProps, RemoteThreadListAdapter, RemoteThreadListOptions, RespondToToolApprovalOptions, RunConfig, RuntimeAdapterProvider, RuntimeAdapters, RuntimeCapabilities, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SourceMessagePart, SourceMessagePartComponent, SourceMessagePartProps, SuggestionAdapter, SuggestionByIndexProvider, SuggestionConfig, suggestion_d_exports as SuggestionPrimitive, Suggestions, TextMessagePart, TextMessagePartComponent, TextMessagePartProps, TextMessagePartProvider, ThreadAssistantMessage, ThreadAssistantMessagePart, ThreadComposerRuntime, ThreadHistoryAdapter, ThreadListItemByIndexProvider, threadListItem_d_exports as ThreadListItemPrimitive, ThreadListItemRuntime, ThreadListItemRuntimeProvider, ThreadListItemState, threadList_d_exports as ThreadListPrimitive, ThreadListRuntime, ThreadMessage, ThreadMessageLike, thread_d_exports as ThreadPrimitive, ThreadRuntime, ThreadState$1 as ThreadState, ThreadSystemMessage, ThreadUserMessage, ThreadUserMessagePart, ThreadsState, Tool, ToolApprovalOption, ToolApprovalOptionKind, ToolApprovalResponse, ToolArgsStatus, ToolCallMessagePart, ToolCallMessagePartComponent, ToolCallMessagePartProps, ToolCallText, ToolCallTiming, ToolDefinition, ToolModelContentPart, Toolkit, ToolkitDefinition, ToolkitDefinitionEntry, Tools, Unstable_AudioMessagePart, Unstable_AudioMessagePartComponent, Unstable_AudioMessagePartProps, Unstable_InferInteractableState, Unstable_InteractableConfig, Unstable_InteractableDefinition, Unstable_InteractablePersistedState, Unstable_InteractablePersistenceAdapter, Unstable_InteractablePersistenceStatus, Unstable_InteractableRegistration, Unstable_InteractableSnapshotEntry, Unstable_InteractableStateSchema, Unstable_InteractableToolConfig, Unstable_InteractableToolRenderProps, Unstable_InteractableVersion, Unstable_InteractableVersionInfo, Unstable_InteractablesClientSchema, Unstable_InteractablesConfig, Unstable_InteractablesMethods, Unstable_InteractablesState, Unsubscribe$1 as Unsubscribe, VoiceSessionControls, VoiceSessionHelpers, createVoiceSession, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, mergeModelContexts, providerTool, stubTool, tool, unstable_Interactables, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useInlineRender, useInteractableState, useLocalRuntime, useRemoteThreadListRuntime, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume }; } declare namespace index_d_exports$1 { export { ErrorMessage as Message, ErrorMessageProps as MessageProps, ErrorRoot as Root, ErrorRootProps as RootProps }; } declare namespace entry_internal_exports { export { AssistantRuntimeImpl, BaseAssistantRuntimeCore, CompositeContextProvider, DefaultThreadComposerRuntimeCore, MessageRepository, ThreadListItemRuntimeBinding, ThreadListRuntimeCore, ThreadRuntimeCore, ThreadRuntimeCoreBinding, ThreadRuntimeImpl, getAutoStatus }; } declare const makeAssistantDataUI: (dataUI: AssistantDataUIProps) => AssistantDataUI; declare const makeAssistantTool: , TResult>(tool: AssistantToolProps) => AssistantTool; declare const makeAssistantToolUI: (tool: AssistantToolUIProps) => AssistantToolUI; declare const mergeModelContexts: (configSet: Set) => ModelContext$1; declare namespace message_d_exports { export { MessageAttachmentByIndex as AttachmentByIndex, MessageAttachments as Attachments, MessageContent as Content, MessageContentProps as ContentProps, MessagePrimitiveGroupedParts as GroupedParts, MessageIf as If, MessageIfProps as IfProps, MessagePrimitivePartByIndex as PartByIndex, MessagePrimitiveParts as Parts, MessageRoot as Root, MessageRootProps as RootProps }; } declare function providerTool(_config: ProviderToolConfig): never; declare function stubTool(): never; declare namespace suggestion_d_exports { export { SuggestionDescription as Description, SuggestionDescriptionProps as DescriptionProps, SuggestionTitle as Title, SuggestionTitleProps as TitleProps, SuggestionTrigger as Trigger, SuggestionTriggerProps as TriggerProps }; } declare namespace threadListItem_d_exports { export { ThreadListItemArchive as Archive, ThreadListItemArchiveProps as ArchiveProps, ThreadListItemDelete as Delete, ThreadListItemDeleteProps as DeleteProps, ThreadListItemRoot as Root, ThreadListItemRootProps as RootProps, ThreadListItemPrimitiveTitle as Title, ThreadListItemTrigger as Trigger, ThreadListItemTriggerProps as TriggerProps, ThreadListItemUnarchive as Unarchive, ThreadListItemUnarchiveProps as UnarchiveProps }; } declare namespace threadList_d_exports { export { ThreadListItems as Items, ThreadListItemsProps as ItemsProps, ThreadListNew as New, ThreadListNewProps as NewProps, ThreadListRoot as Root, ThreadListRootProps as RootProps }; } declare namespace thread_d_exports { export { ThreadEmpty as Empty, ThreadEmptyProps as EmptyProps, ThreadIf as If, ThreadIfProps as IfProps, ThreadPrimitiveMessageByIndex as MessageByIndex, ThreadMessages as Messages, ThreadMessagesProps as MessagesProps, ThreadRoot as Root, ThreadRootProps as RootProps, ThreadSuggestion as Suggestion, ThreadPrimitiveSuggestionByIndex as SuggestionByIndex, ThreadSuggestionProps as SuggestionProps, ThreadPrimitiveSuggestions as Suggestions, ThreadPrimitiveUnstable_MessageById as Unstable_MessageById }; } declare function tool, TResult = any>(tool: Tool): Tool; declare const unstable_Interactables: Resource, [ (Unstable_InteractablesConfig | undefined)? ]>; declare function unstable_formatInteractableSnapshot(entry: Unstable_InteractableSnapshotEntry): string; declare function unstable_getInteractableSnapshots(message: { metadata?: unknown; }): Unstable_InteractableSnapshotEntry[] | undefined; declare function unstable_getInteractableVersions(messages: readonly SnapshotCarrierMessage[], id: string, name: string): Unstable_InteractableVersion[]; declare const unstable_interactableTool: (config: Unstable_InteractableToolConfig) => ToolDefinition, { success: true; }>; declare const unstable_useInteractable: (name: string, config: Unstable_InteractableConfig) => readonly [ Unstable_InferInteractableState, { id: string; version: Unstable_InteractableVersionInfo> | undefined; setState: (updater: Unstable_InferInteractableState | ((prev: Unstable_InferInteractableState) => Unstable_InferInteractableState)) => void; isPending: boolean; error: unknown; flush: () => Promise; } ]; declare const unstable_useInteractableState: (id: string) => [ TState | undefined, { setState: (updater: StateUpdater) => void; isPending: boolean; error: unknown; flush: () => Promise; } ]; declare const unstable_useInteractableVersions: (id: string, name: string) => (Omit & { state: TState; restore: () => void; })[]; declare const unstable_useThreadMessageIds: () => readonly string[]; declare const useAssistantContext: (config: AssistantContextConfig) => void; declare const useAssistantDataUI: (dataUI: AssistantDataUIProps | null) => void; declare const useAssistantInstructions: (config: string | AssistantInstructionsConfig) => void; declare const useAssistantInteractable: (name: string, config: AssistantInteractableProps) => string; declare const useAssistantTool: , TResult>(tool: AssistantToolProps) => void; declare const useAssistantToolUI: (tool: AssistantToolUIProps | null) => void; declare namespace useAui { type Props = { [K in ClientNames]?: ClientElement | DerivedElement; }; } declare function useAui(): AssistantClient; declare function useAui(clients: useAui.Props): AssistantClient; declare function useAui(clients: useAui.Props, config: { parent: null | AssistantClient; }): AssistantClient; declare const useAuiEvent: (selector: AssistantEventSelector, callback: AssistantEventCallback) => void; declare const useAuiState: (selector: (state: AssistantState) => T) => T; declare function useAuiToolOverrides(overrides: AuiToolOverrides): void; declare const useInlineRender: (toolUI: FC>) => FC>; declare const useInteractableState: (id: string, fallback: TState) => [ TState, { setState: (updater: StateUpdater$1) => void; setSelected: (selected: boolean) => void; isPending: boolean; error: unknown; flush: () => Promise; } ]; declare const useLocalRuntime: (chatModel: ChatModelAdapter, _param44?: LocalRuntimeOptions) => AssistantRuntime; declare const useRemoteThreadListRuntime: (options: RemoteThreadListOptions) => AssistantRuntime; declare const useRuntimeAdapters: () => RuntimeAdapters | null; declare const useToolArgsStatus: = Record>() => ToolArgsStatus; declare const useVoiceControls: () => { connect: () => void; disconnect: () => void; mute: () => void; unmute: () => void; }; declare const useVoiceState: () => VoiceSessionState | undefined; declare const useVoiceVolume: () => number; export { entry_internal_exports as entry_internal, entry_root_exports as entry_root };