import "@radix-ui/react-primitive"; import { StandardSchemaV1 } from "@standard-schema/spec"; import "radix-ui"; import { ComponentType, ReactNode } from "react"; import "react-textarea-autosize"; import { ZodType } from "zod"; import "zustand"; declare const ALERT_TONES: readonly [ "info", "success", "warning", "danger" ]; declare const ALIGNS: readonly [ "start", "center", "end" ]; interface Action { readonly type: string; readonly [payload: string]: unknown; } type ActionDispatchContext = { readonly payload: Action; }; type ActionHandler = (ctx: ActionDispatchContext) => unknown | Promise; type ActionRegistry = { dispatch(action: Action): unknown; has(type: string): boolean; }; type AlertTone = (typeof ALERT_TONES)[number]; type Align = (typeof ALIGNS)[number]; type AncestorsOf = K extends Seen ? never : ParentOf extends never ? never : ParentOf | AncestorsOf, Seen | K>; 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; }; 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 AsyncIterableStream = AsyncIterable & ReadableStream; declare const BUTTON_STYLES: readonly [ "primary", "secondary", "outline", "ghost", "danger" ]; type BackendDefaultMetadata = { unstable_backendDefault?: { parameters?: boolean; }; }; type BackendTool = Record, TResult = unknown> = ToolBase & { type: "backend"; description?: undefined; parameters?: undefined; disabled?: undefined; execute?: undefined; toModelOutput?: undefined; experimental_onSchemaValidationError?: undefined; providerOptions?: undefined; }; type BaseAttachment = { id: string; type: "image" | "document" | "file" | (string & {}); name: string; contentType?: string | undefined; file?: File; content?: ThreadUserMessagePart[]; }; 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"]; }; type ButtonStyle = (typeof BUTTON_STYLES)[number]; declare const COLORS: readonly [ "emphasis", "secondary", "alpha-70", "white", "white-70", "white-50" ]; 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 ClientSchemas = keyof ScopeRegistry extends never ? { "ERROR: No clients were defined": ClientError<"ERROR: No clients were defined">; } : { [K in keyof ScopeRegistry]: ValidateClient; }; type Color = (typeof COLORS)[number]; type CompleteAttachment = BaseAttachment & { status: CompleteAttachmentStatus; content: ThreadUserMessagePart[]; }; type CompleteAttachmentStatus = { type: "complete"; }; type DataMessagePart = { readonly type: "data"; readonly name: string; readonly data: T; }; type DeepPartial = T extends readonly any[] ? readonly DeepPartial[] : T extends { [key: string]: any; } ? { readonly [K in keyof T]?: DeepPartial; } : T; interface DevToolsApiEntry { api: Partial; logs: EventLog[]; } interface DevToolsHook { apis: Map; nextId: number; listeners: Set<(apiId: number) => void>; } interface EventLog { time: Date; event: string; data: unknown; } type EventSource = T extends `${infer Source}.${string}` ? Source : never; type FileMessagePart = { readonly type: "file"; readonly filename?: string; readonly data: string; readonly mimeType: string; readonly parentId?: string; }; 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 GenerativeUIAction = Action; type GenerativeUIComponent

= { description: string; properties: ZodType

; streamProperties: boolean | undefined; render: (props: StreamingRenderProps

) => ReactNode; } | { description: string; properties: ZodType

; streamProperties?: false | undefined; render: (props: StaticRenderProps

) => ReactNode; }; type GenerativeUIDispatch = (action: Action) => unknown; type GenerativeUIElement = NormalizedUIElement; type GenerativeUILibrary = 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 GenerativeUINode$1 = GenerativeUIElement | string | number | boolean | null | undefined | GenerativeUINode$1[]; type GenerativeUIProps = NormalizedUIElement["props"]; type GenerativeUIRenderContext = { status: GenerativeUIStatus; dispatch?: GenerativeUIDispatch; }; type GenerativeUISpec = { readonly root: GenerativeUINode | readonly GenerativeUINode[]; }; type GenerativeUIStatus = "done" | "streaming"; 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; }; declare const IMAGE_SIZE_TOKENS: readonly [ "sm", "md", "lg" ]; type ImageMessagePart = { readonly type: "image"; readonly image: string; readonly filename?: string; }; type ImageSize = (typeof IMAGE_SIZE_TOKENS)[number] | number; declare class JSONGenerativeUI { private readonly parameters; constructor(options: JSONGenerativeUIOptions); present(options?: PresentToolOptions): PresentTool; promptUser(): PromptUserTool; } declare class JSONGenerativeUI$1 { private readonly library; private readonly parameters; private readonly actions; constructor(options: JSONGenerativeUIOptions); private readonly render; present(options?: PresentToolOptions): PresentTool; promptUser(): PromptUserTool; } type JSONGenerativeUIOptions = { library: GenerativeUILibrary; actions?: ActionRegistry; }; 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 JSONSchema7$1 { $id?: string | undefined; $ref?: string | undefined; $schema?: JSONSchema7Version$1 | undefined; $comment?: string | undefined; $defs?: { [key: string]: JSONSchema7Definition$1; } | undefined; type?: JSONSchema7TypeName$1 | JSONSchema7TypeName$1[] | undefined; enum?: JSONSchema7Type$1[] | undefined; const?: JSONSchema7Type$1 | 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$1 | JSONSchema7Definition$1[] | undefined; additionalItems?: JSONSchema7Definition$1 | undefined; maxItems?: number | undefined; minItems?: number | undefined; uniqueItems?: boolean | undefined; contains?: JSONSchema7Definition$1 | undefined; maxProperties?: number | undefined; minProperties?: number | undefined; required?: string[] | undefined; properties?: { [key: string]: JSONSchema7Definition$1; } | undefined; patternProperties?: { [key: string]: JSONSchema7Definition$1; } | undefined; additionalProperties?: JSONSchema7Definition$1 | undefined; dependencies?: { [key: string]: JSONSchema7Definition$1 | string[]; } | undefined; propertyNames?: JSONSchema7Definition$1 | undefined; if?: JSONSchema7Definition$1 | undefined; then?: JSONSchema7Definition$1 | undefined; else?: JSONSchema7Definition$1 | undefined; allOf?: JSONSchema7Definition$1[] | undefined; anyOf?: JSONSchema7Definition$1[] | undefined; oneOf?: JSONSchema7Definition$1[] | undefined; not?: JSONSchema7Definition$1 | undefined; format?: string | undefined; contentMediaType?: string | undefined; contentEncoding?: string | undefined; definitions?: { [key: string]: JSONSchema7Definition$1; } | undefined; title?: string | undefined; description?: string | undefined; default?: JSONSchema7Type$1 | undefined; readOnly?: boolean | undefined; writeOnly?: boolean | undefined; examples?: JSONSchema7Type$1 | undefined; } interface JSONSchema7Array extends Array { } interface JSONSchema7Array$1 extends Array { } type JSONSchema7Definition = JSONSchema7 | boolean; type JSONSchema7Definition$1 = JSONSchema7$1 | boolean; interface JSONSchema7Object { [key: string]: JSONSchema7Type; } interface JSONSchema7Object$1 { [key: string]: JSONSchema7Type$1; } type JSONSchema7Type = string | number | boolean | JSONSchema7Object | JSONSchema7Array | null; type JSONSchema7Type$1 = string | number | boolean | JSONSchema7Object$1 | JSONSchema7Array$1 | null; type JSONSchema7TypeName = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; type JSONSchema7TypeName$1 = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; type JSONSchema7Version = string; type JSONSchema7Version$1 = string; declare const JUSTIFIES: readonly [ "start", "center", "end", "between" ]; type Justify = (typeof JUSTIFIES)[number]; interface LegacyComponentNode { readonly component: string; readonly props?: Record; readonly children?: UIChildren; readonly key?: string; } type McpAppMetadata = { readonly resourceUri: string; readonly mimeType?: string; readonly visibility?: readonly ("app" | "model")[]; }; 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 MessageCommonProps = { readonly id: string; readonly createdAt: Date; }; 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; }; 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; }; type MessageTiming = { readonly streamStartTime: number; readonly firstTokenTime?: number; readonly totalStreamTime?: number; readonly tokenCount?: number; readonly tokensPerSecond?: number; readonly totalChunks: number; readonly toolCallCount: number; }; interface NormalizedUIElement { readonly type: string; readonly props: Readonly>; readonly children?: NormalizedUINode | undefined; readonly key?: string | number | undefined; readonly action?: Action | undefined; } type NormalizedUINode = string | number | readonly NormalizedUINode[] | NormalizedUIElement | null; type ObjectKey = keyof T & (string | number); type OnSchemaValidationErrorFunction = ToolExecuteFunction; type ParentOf = AssistantClientAccessor extends { source: infer S; } ? S extends ClientNames ? S : never : never; type PartProviderMetadata = { readonly [providerName: string]: ReadonlyJSONObject; }; type PresentTool = ToolDefinition, Record> & BackendDefaultMetadata; type PresentToolOptions = { display?: "standalone"; }; type PromptUserTool = ToolDefinition, unknown> & BackendDefaultMetadata; 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 ReadonlyJSONArray = readonly ReadonlyJSONValue[]; type ReadonlyJSONObject = { readonly [key: string]: ReadonlyJSONValue; }; type ReadonlyJSONValue = null | string | number | boolean | ReadonlyJSONObject | ReadonlyJSONArray; type ReasoningMessagePart = { readonly type: "reasoning"; readonly text: string; readonly providerMetadata?: PartProviderMetadata; readonly parentId?: string; }; interface ScopeRegistry { [key: string]: { methods: any; meta?: any; events?: any }; } 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 SourceProviderMetadata = PartProviderMetadata; interface SpeechRecognitionConstructor { new (): SpeechRecognitionInstance; } interface SpeechRecognitionInstance extends EventTarget { lang: string; continuous: boolean; interimResults: boolean; start(): void; stop(): void; abort(): void; } type StaticRenderProps

= P & { children?: ReactNode; $status: "done"; $action?: Action; $dispatch?: GenerativeUIDispatch; }; type StreamingRenderProps

= (Partial

& { children?: ReactNode; $status: "streaming"; $action?: Action; $dispatch?: GenerativeUIDispatch; }) | (P & { children?: ReactNode; $status: "done"; $action?: Action; $dispatch?: GenerativeUIDispatch; }); declare const TEXT_SIZES: readonly [ "sm", "md", "lg", "xl", "2xl", "3xl" ]; declare const TOOL_RESPONSE_SYMBOL: unique symbol; declare const TYPE_KEY = "$type"; type TextMessagePart = { readonly type: "text"; readonly text: string; readonly providerMetadata?: PartProviderMetadata; readonly parentId?: string; }; type TextSize = (typeof TEXT_SIZES)[number]; 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; type ThreadMessage = BaseThreadMessage & (ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage); type ThreadStep = { readonly messageId?: string; readonly usage?: { readonly inputTokens: number; readonly outputTokens: number; } | 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 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 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 ToolDefinition = Record, TResult = unknown> = WithRender, TArgs, TResult>; type ToolDisplay = "inline" | "standalone"; 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; 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 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 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 UIChildren = UINode | readonly UINode[]; interface UIElement { readonly $type: string; readonly $key?: string | number; readonly children?: UIChildren; readonly $action?: Action; readonly [prop: string]: unknown; } type UINode = string | number | UIElement | LegacyComponentNode; type UISpec = UINode | readonly UINode[]; 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 Unsubscribe = () => void; 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`>; declare const WEIGHTS: readonly [ "normal", "medium", "semibold", "bold" ]; type Weight = (typeof WEIGHTS)[number]; 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 function buildPresentParameters(library: GenerativeUILibrary): JSONSchema7$1; declare function createActionRegistry(handlers: Readonly>): ActionRegistry; declare const defaultGenerativeUILibrary: GenerativeUILibrary; declare function defineGenerativeComponents(_library: GenerativeUILibrary): GenerativeUILibrary; declare const emptyActionRegistry: ActionRegistry; declare function generativeUIToJSX(node: unknown): string; declare global { interface Window { SpeechRecognition?: SpeechRecognitionConstructor; webkitSpeechRecognition?: SpeechRecognitionConstructor; } } declare global { interface Window { __ASSISTANT_UI_DEVTOOLS_HOOK__?: any; } } declare namespace entry_root_default_exports { export { ALERT_TONES, ALIGNS, Action, ActionDispatchContext, ActionHandler, ActionRegistry, AlertTone, Align, BUTTON_STYLES, ButtonStyle, COLORS, Color, GenerativeUIAction, GenerativeUIComponent, GenerativeUIDispatch, GenerativeUIElement, GenerativeUILibrary, GenerativeUINode$1 as GenerativeUINode, GenerativeUIProps, GenerativeUIRenderContext, GenerativeUIStatus, IMAGE_SIZE_TOKENS, ImageSize, JSONGenerativeUI$1 as JSONGenerativeUI, JSONGenerativeUIOptions, JUSTIFIES, Justify, LegacyComponentNode, NormalizedUIElement, NormalizedUINode, PresentTool, PresentToolOptions, PromptUserTool, TEXT_SIZES, TYPE_KEY, TextSize, UIChildren, UIElement, UINode, UISpec, WEIGHTS, Weight, buildPresentParameters, createActionRegistry, defaultGenerativeUILibrary, defineGenerativeComponents, emptyActionRegistry, generativeUIToJSX, normalizeSpec, normalizeUINode, renderGenerativeUI }; } declare namespace entry_root_react_server_exports { export { ALERT_TONES, ALIGNS, Action, ActionDispatchContext, ActionHandler, ActionRegistry, AlertTone, Align, BUTTON_STYLES, ButtonStyle, COLORS, Color, GenerativeUIAction, GenerativeUIComponent, GenerativeUIDispatch, GenerativeUIElement, GenerativeUILibrary, GenerativeUINode$1 as GenerativeUINode, GenerativeUIProps, GenerativeUIRenderContext, GenerativeUIStatus, IMAGE_SIZE_TOKENS, ImageSize, JSONGenerativeUI, JSONGenerativeUIOptions, JUSTIFIES, Justify, LegacyComponentNode, NormalizedUIElement, NormalizedUINode, PresentTool, PresentToolOptions, PromptUserTool, TEXT_SIZES, TYPE_KEY, TextSize, UIChildren, UIElement, UINode, UISpec, WEIGHTS, Weight, buildPresentParameters, createActionRegistry, defaultGenerativeUILibrary, defineGenerativeComponents, emptyActionRegistry, generativeUIToJSX, normalizeSpec, normalizeUINode, renderGenerativeUI }; } declare namespace entry_ir_exports { export { ALERT_TONES, ALIGNS, Action, AlertTone, Align, BUTTON_STYLES, ButtonStyle, COLORS, Color, IMAGE_SIZE_TOKENS, ImageSize, JUSTIFIES, Justify, LegacyComponentNode, NormalizedUIElement, NormalizedUINode, TEXT_SIZES, TextSize, UIChildren, UIElement, UINode, UISpec, WEIGHTS, Weight, normalizeSpec, normalizeUINode }; } declare function normalizeSpec(spec: UISpec): { readonly root: NormalizedUINode | readonly NormalizedUINode[]; }; declare function normalizeUINode(node: unknown, partialPath?: readonly string[] | undefined, depth?: number): NormalizedUINode; declare function renderGenerativeUI(node: unknown, library: GenerativeUILibrary, context?: GenerativeUIRenderContext): ReactNode; export { entry_ir_exports as entry_ir, entry_root_default_exports as entry_root_default, entry_root_react_server_exports as entry_root_react_server };