import "@radix-ui/react-primitive"; import { StandardSchemaV1 } from "@standard-schema/spec"; import "radix-ui"; import { CSSProperties, ComponentType, ReactNode } from "react"; import "react-textarea-autosize"; import "zustand"; type AncestorsOf = K extends Seen ? never : ParentOf extends never ? never : ParentOf | AncestorsOf, Seen | K>; interface ApiInfo { id: number; state: Record; logs: EventLogEntry[]; modelContext?: SerializedModelContext | undefined; scopes?: unknown; threadSnapshots?: Readonly>; } 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; type BackendTool = Record, TResult = unknown> = ToolBase & { type: "backend"; description?: undefined; parameters?: undefined; disabled?: undefined; execute?: undefined; toModelOutput?: undefined; experimental_onSchemaValidationError?: undefined; providerOptions?: undefined; }; 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 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 DevToolsClient { subscribe(listener: () => void): () => void; getSnapshot(): DevToolsSnapshot; getServerSnapshot?(): DevToolsSnapshot; clearEvents(apiId: number): void; switchToThread?(apiId: number, threadId: string): void | Promise; } interface DevToolsHook { apis: Map; nextId: number; listeners: Set<(apiId: number) => void>; } declare const DevToolsModal: (props?: DevToolsModalProps) => import("react").JSX.Element | null; interface DevToolsModalProps { plugins?: DevToolsPanelPlugin[]; theme?: "dark" | "light" | "system"; client?: DevToolsClient; } declare const DevToolsPanel: (_param0: DevToolsPanelProps) => import("react").JSX.Element; interface DevToolsPanelPlugin { id: string; label: string; order?: number; isAvailable?: (ctx: DevToolsTabContext) => boolean; Component: ComponentType; } interface DevToolsPanelProps { plugins?: DevToolsPanelPlugin[] | undefined; theme?: "dark" | "light"; onClose?: (() => void) | undefined; client?: DevToolsClient | undefined; } interface DevToolsSnapshot { apiIds: number[]; byId: ReadonlyMap; } interface DevToolsTabContext { apiId: number; data: ApiInfo; clearEvents: (apiId: number) => void; theme: "dark" | "light"; selection: string | null; setSelection: (nodeId: string | null) => void; switchToThread?: ((threadId: string) => void | Promise) | undefined; } interface EventLog { time: Date; event: string; data: unknown; } interface EventLogEntry { readonly time: Date; readonly event: string; readonly data: unknown; } type EventSource = T extends `${infer Source}.${string}` ? Source : never; 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 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; }; 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 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 ModelContext = { priority?: number | undefined; system?: string | undefined; tools?: Record> | undefined; callSettings?: LanguageModelV1CallSettings | undefined; config?: LanguageModelConfig | undefined; unstable_composerMetadata?: Record | undefined; }; type NormalizedTool = { name: string; type?: string; description?: string; disabled?: boolean; display?: string; providerId?: string; supportsDeferredResults?: boolean; backendDefault?: unknown; providerOptions?: unknown; providerArgs?: unknown; server?: unknown; parameters?: unknown; }; type ObjectKey = keyof T & (string | number); type OnSchemaValidationErrorFunction = ToolExecuteFunction; type ParentOf = AssistantClientAccessor extends { source: infer S; } ? S extends ClientNames ? S : never : never; 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; interface ScopeRegistry { [key: string]: { methods: any; meta?: any; events?: any }; } interface SerializedModelContext { system?: string; tools?: NormalizedTool[]; callSettings?: Record; config?: Record; } declare const ShadowRoot: (_param1: ShadowRootProps) => import("react").JSX.Element; interface ShadowRootProps { theme: "dark" | "light"; className?: string; style?: CSSProperties; children: ReactNode; } interface SpeechRecognitionConstructor { new (): SpeechRecognitionInstance; } interface SpeechRecognitionInstance extends EventTarget { lang: string; continuous: boolean; interimResults: boolean; start(): void; stop(): void; abort(): void; } declare const TOOL_RESPONSE_SYMBOL: unique symbol; type Tool = Record, TResult = unknown> = FrontendTool | BackendTool | HumanTool | ProviderTool | McpTool | ToolWithoutType; 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; } interface ToolCallReader = Record, TResult = unknown> { args: ToolCallArgsReader; response: ToolCallResponseReader; result: { get: () => Promise; }; } interface ToolCallResponseReader { get: () => Promise>; } 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 UnionToIntersection = (U extends unknown ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never; 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`>; type WildcardPayload = { [K in keyof ClientEventMap]: { event: K; payload: ClientEventMap[K]; }; }[Extract]; declare const builtinPlugins: DevToolsPanelPlugin[]; declare const createDevToolsPlugin: (plugin: DevToolsPanelPlugin) => DevToolsPanelPlugin; declare const createInProcessClient: () => DevToolsClient; declare global { interface Window { SpeechRecognition?: SpeechRecognitionConstructor; webkitSpeechRecognition?: SpeechRecognitionConstructor; } } declare global { interface Window { __ASSISTANT_UI_DEVTOOLS_HOOK__?: any; } } declare const inProcessClient: DevToolsClient; declare namespace entry_root_exports { export { ApiInfo, DevToolsClient, DevToolsModal, DevToolsModalProps, DevToolsPanel, DevToolsPanelPlugin, DevToolsPanelProps, DevToolsSnapshot, DevToolsTabContext, NormalizedTool, SerializedModelContext, ShadowRoot, builtinPlugins, createDevToolsPlugin, createInProcessClient, inProcessClient, normalizeToolList, serializeModelContext }; } declare const normalizeToolList: (value: unknown) => NormalizedTool[]; declare const serializeModelContext: (context: ModelContext | undefined) => SerializedModelContext | undefined; export { entry_root_exports as entry_root };