@ensembleapp/client-sdk 0.0.28 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import React$1 from 'react';
2
2
  import * as ai from 'ai';
3
3
  import { UIMessage } from 'ai';
4
- import z, { AnyZodObject } from 'zod';
5
- import React$1 from 'react';
4
+ import z, { ZodObject } from 'zod';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { ClassValue } from 'clsx';
7
7
 
8
8
  /** Derived part type from UIMessage */
@@ -143,7 +143,7 @@ type EnrichmentResult<TData = unknown> = {
143
143
 
144
144
  /** Enriched results keyed by enrichment name */
145
145
  type EnrichedResults<T = unknown> = Record<string, EnrichmentResult<T>>;
146
- interface UIWidgetDefinition<TSchema extends AnyZodObject = AnyZodObject, TEnriched extends EnrichedResults = EnrichedResults> {
146
+ interface UIWidgetDefinition<TSchema extends ZodObject<any> = ZodObject<any>, TEnriched extends EnrichedResults = EnrichedResults> {
147
147
  widgetType: string;
148
148
  schema: TSchema;
149
149
  /**
@@ -166,7 +166,7 @@ interface UIWidgetDefinition<TSchema extends AnyZodObject = AnyZodObject, TEnric
166
166
  */
167
167
  render(payload: z.infer<TSchema>, enriched: TEnriched): unknown;
168
168
  }
169
- declare const createWidget: <TSchema extends AnyZodObject, TEnriched extends EnrichedResults = EnrichedResults>({ widgetType, schema, enrich, render, }: UIWidgetDefinition<TSchema, TEnriched>) => UIWidgetDefinition<TSchema, TEnriched>;
169
+ declare const createWidget: <TSchema extends ZodObject<any>, TEnriched extends EnrichedResults = EnrichedResults>({ widgetType, schema, enrich, render, }: UIWidgetDefinition<TSchema, TEnriched>) => UIWidgetDefinition<TSchema, TEnriched>;
170
170
 
171
171
  type DisplayMode = 'full' | 'brief';
172
172
 
@@ -207,6 +207,11 @@ interface ChatWidgetFeedbackOptions {
207
207
  /** Require comment when giving negative feedback. Default: false */
208
208
  requireCommentForNegative?: boolean;
209
209
  }
210
+ /** Handle exposed by ChatWidget ref for programmatic control */
211
+ interface ChatWidgetHandle {
212
+ /** Send a message programmatically */
213
+ sendMessage: (message: string) => void;
214
+ }
210
215
  interface ChatWidgetConfig extends UseChatConfig {
211
216
  /** Title for the Chat window */
212
217
  title?: string;
@@ -228,7 +233,7 @@ interface ChatWidgetConfig extends UseChatConfig {
228
233
  /** Feedback options for assistant messages. Enabled by default. */
229
234
  feedback?: ChatWidgetFeedbackOptions;
230
235
  }
231
- declare function ChatWidget({ api, threadId, agentId, agentVersion, agentExecutionId, dataContext, displayMode, onError, onAuthError, onFinish, onMessage, title, initialAssistantMessage, initialUserMessage, inputPlaceholder, className, styles: styleProps, voice, speechToText, widgets, feedback, }: ChatWidgetConfig): react_jsx_runtime.JSX.Element;
236
+ declare const ChatWidget: React$1.ForwardRefExoticComponent<ChatWidgetConfig & React$1.RefAttributes<ChatWidgetHandle>>;
232
237
 
233
238
  interface PopupAnchorConfig {
234
239
  enabled?: boolean;
@@ -381,4 +386,4 @@ declare const getVendorCardsWidget: (isProd?: boolean) => UIWidgetDefinition[];
381
386
 
382
387
  declare function cn(...inputs: ClassValue[]): string;
383
388
 
384
- export { type AgentVersion, type ApiConfig, BriefRenderer, type ChatMessage, type ChatMessageSection, ChatWidget, type ChatWidgetFeedbackOptions, type ChatWidgetConfig as ChatWidgetProps, type ChatWidgetSpeechToTextOptions, type ChatWidgetStyles, type ChatWidgetVoiceOptions, type DisplayMode, type EmbeddableChatWidgetConfig, type EnrichedResults, type FeedbackRating, type FeedbackState, FullRenderer, type MessageFeedback, type PopupAnchorConfig, PopupChatWidget, type PopupChatWidgetProps, type RendererProps, type SubmitFeedbackParams, TagGroupDisplay, type TagGroupDisplayProps, ToolCallDisplay, type ToolCallDisplayProps, type ToolPart, type UIMessagePart, type UIWidgetDefinition, type UseChatConfig, type UseFeedbackConfig, type WidgetEnrichConfig, cn, createWidget, defaultChatWidgets, getVendorCardsWidget, registerChatWidgets, useChat, useFeedback };
389
+ export { type AgentVersion, type ApiConfig, BriefRenderer, type ChatMessage, type ChatMessageSection, ChatWidget, type ChatWidgetFeedbackOptions, type ChatWidgetHandle, type ChatWidgetConfig as ChatWidgetProps, type ChatWidgetSpeechToTextOptions, type ChatWidgetStyles, type ChatWidgetVoiceOptions, type DisplayMode, type EmbeddableChatWidgetConfig, type EnrichedResults, type FeedbackRating, type FeedbackState, FullRenderer, type MessageFeedback, type PopupAnchorConfig, PopupChatWidget, type PopupChatWidgetProps, type RendererProps, type SubmitFeedbackParams, TagGroupDisplay, type TagGroupDisplayProps, ToolCallDisplay, type ToolCallDisplayProps, type ToolPart, type UIMessagePart, type UIWidgetDefinition, type UseChatConfig, type UseFeedbackConfig, type WidgetEnrichConfig, cn, createWidget, defaultChatWidgets, getVendorCardsWidget, registerChatWidgets, useChat, useFeedback };