@waniwani/sdk 0.11.12 → 0.11.14

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.
@@ -1,7 +1,7 @@
1
1
  import * as ai from 'ai';
2
- import * as react from 'react';
3
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
3
  import { ContentBlock } from '@modelcontextprotocol/sdk/types.js';
4
+ import * as react from 'react';
5
5
 
6
6
  interface ChatTheme {
7
7
  /** Primary brand color (bubble, send button, user messages) */
@@ -113,6 +113,14 @@ interface ChatBaseProps {
113
113
  * the server-side `WANIWANI_DEBUG` env var.
114
114
  */
115
115
  debug?: boolean;
116
+ /**
117
+ * Show tool call details (request/response panels). When `false`, each
118
+ * tool call renders as a compact indicator so the user can still tell
119
+ * the agent is doing something, but the JSON panels are hidden.
120
+ * MCP App widgets attached to a tool call are always rendered.
121
+ * Defaults to `true`.
122
+ */
123
+ showToolCalls?: boolean;
116
124
  /**
117
125
  * Skip fetching `/config` and `/tools` from the API on mount.
118
126
  * Use when the chat endpoint doesn't serve these routes (e.g. embed widgets
@@ -133,16 +141,6 @@ interface ChatBaseProps {
133
141
  /** Fired whenever the active thread changes (new chat, switch, delete). */
134
142
  onThreadChange?: (threadId: string) => void;
135
143
  }
136
- interface ChatBarProps extends ChatBaseProps {
137
- /** Chat bar width in pixels. Defaults to 600. */
138
- width?: number;
139
- /** Width of the expanded card in pixels. Defaults to width × 1.2. */
140
- expandedWidth?: number;
141
- /** Max height of the expanded messages panel in pixels. Defaults to 400. */
142
- expandedHeight?: number;
143
- /** Title shown in the header when expanded. Defaults to "Assistant". */
144
- title?: string;
145
- }
146
144
  /**
147
145
  * MCP Apps configuration for {@link ChatEmbedProps}.
148
146
  *
@@ -174,8 +172,8 @@ type CallToolHandler = (params: {
174
172
  /**
175
173
  * Standalone, borderless chat component designed for embedding into existing pages.
176
174
  *
177
- * Unlike {@link ChatCardProps} and {@link ChatBarProps}, ChatEmbed does **not** rely on
178
- * the WaniWani hosted backend. It does not fetch `/config` or call `/tool` — you bring
175
+ * Unlike {@link ChatCardProps}, ChatEmbed does **not** rely on the WaniWani
176
+ * hosted backend. It does not fetch `/config` or call `/tool` — you bring
179
177
  * your own `api` endpoint.
180
178
  *
181
179
  * The component fills its parent container (`width: 100%; height: 100%`) with no
@@ -218,6 +216,7 @@ interface ChatEmbedProps extends Omit<ChatBaseProps, "api" | "onCallTool"> {
218
216
  /** Extra React node rendered in the sticky header, right of the title. */
219
217
  headerActions?: React.ReactNode;
220
218
  }
219
+ /** @deprecated Use `ChatEmbed` for new code. `ChatCard` is preserved for back-compat only. */
221
220
  interface ChatCardProps extends ChatBaseProps {
222
221
  /** Title shown in the card header. Defaults to "Assistant". */
223
222
  title?: string;
@@ -247,10 +246,6 @@ interface ChatHandle {
247
246
  /** Current chat messages */
248
247
  messages: ai.UIMessage[];
249
248
  }
250
- /** @deprecated Use ChatBarProps instead */
251
- type ChatWidgetProps = ChatBarProps;
252
-
253
- declare const ChatBar: react.ForwardRefExoticComponent<ChatBarProps & react.RefAttributes<ChatHandle>>;
254
249
 
255
250
  type ModelContextContentBlock = ContentBlock;
256
251
  type ModelContextUpdate = {
@@ -322,6 +317,7 @@ interface McpAppFrameProps {
322
317
  }
323
318
  declare function McpAppFrame({ resourceUri, toolInput, toolResult, resourceEndpoint, chatSessionId, isDark, className, autoHeight, onOpenLink, onFollowUp, onCallTool, onDisplayModeChange, isFullscreen, toolDefinitions, }: McpAppFrameProps): react_jsx_runtime.JSX.Element;
324
319
 
320
+ /** @deprecated Use `ChatEmbed` for new code. `ChatCard` is preserved for back-compat only. */
325
321
  declare const ChatCard: react.ForwardRefExoticComponent<ChatCardProps & react.RefAttributes<ChatHandle>>;
326
322
 
327
323
  /**
@@ -343,4 +339,4 @@ declare const DARK_THEME: ChatTheme;
343
339
  declare function mergeTheme(userTheme?: ChatTheme): Required<ChatTheme>;
344
340
  declare function themeToCSSProperties(theme: Required<ChatTheme>): Record<string, string>;
345
341
 
346
- export { ChatBar, type ChatBarProps, type ChatBaseProps, ChatCard, type ChatCardProps, ChatEmbed, type ChatEmbedMcpConfig, type ChatEmbedProps, type ChatHandle, type ChatTheme, ChatBar as ChatWidget, type ChatWidgetProps, DARK_THEME, DEFAULT_THEME, type McpAppDisplayMode, McpAppFrame, type McpAppFrameProps, type SuggestionsConfig, type WelcomeConfig, mergeTheme, themeToCSSProperties };
342
+ export { type ChatBaseProps, ChatCard, type ChatCardProps, ChatEmbed, type ChatEmbedMcpConfig, type ChatEmbedProps, type ChatHandle, type ChatTheme, DARK_THEME, DEFAULT_THEME, type McpAppDisplayMode, McpAppFrame, type McpAppFrameProps, type SuggestionsConfig, type WelcomeConfig, mergeTheme, themeToCSSProperties };