@waniwani/sdk 0.11.13 → 0.11.15
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/README.md +58 -58
- package/dist/chat/embed.js +1 -1
- package/dist/chat/embed.js.map +1 -1
- package/dist/chat/index.d.ts +6 -18
- package/dist/chat/index.js +8 -8
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/styles.css +1 -1
- package/dist/chunk-BZRGY3DY.js +8 -0
- package/dist/chunk-BZRGY3DY.js.map +1 -0
- package/dist/chunk-F4KBGLBK.js +2 -0
- package/dist/chunk-F4KBGLBK.js.map +1 -0
- package/dist/internal/index.d.ts +52 -0
- package/dist/internal/index.js +2 -0
- package/dist/internal/index.js.map +1 -0
- package/dist/legacy/index.d.ts +790 -1
- package/dist/legacy/index.js +68 -1
- package/dist/legacy/index.js.map +1 -1
- package/dist/mcp-apps-client-GGRBZ3XV.js +2 -0
- package/dist/mcp-apps-client-GGRBZ3XV.js.map +1 -0
- package/dist/openai-client-URAITCJJ.js +4 -0
- package/dist/openai-client-URAITCJJ.js.map +1 -0
- package/dist/platform-3OQJPJOZ.js +2 -0
- package/dist/platform-3OQJPJOZ.js.map +1 -0
- package/package.json +6 -1
package/dist/chat/index.d.ts
CHANGED
|
@@ -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) */
|
|
@@ -141,16 +141,6 @@ interface ChatBaseProps {
|
|
|
141
141
|
/** Fired whenever the active thread changes (new chat, switch, delete). */
|
|
142
142
|
onThreadChange?: (threadId: string) => void;
|
|
143
143
|
}
|
|
144
|
-
interface ChatBarProps extends ChatBaseProps {
|
|
145
|
-
/** Chat bar width in pixels. Defaults to 600. */
|
|
146
|
-
width?: number;
|
|
147
|
-
/** Width of the expanded card in pixels. Defaults to width × 1.2. */
|
|
148
|
-
expandedWidth?: number;
|
|
149
|
-
/** Max height of the expanded messages panel in pixels. Defaults to 400. */
|
|
150
|
-
expandedHeight?: number;
|
|
151
|
-
/** Title shown in the header when expanded. Defaults to "Assistant". */
|
|
152
|
-
title?: string;
|
|
153
|
-
}
|
|
154
144
|
/**
|
|
155
145
|
* MCP Apps configuration for {@link ChatEmbedProps}.
|
|
156
146
|
*
|
|
@@ -182,8 +172,8 @@ type CallToolHandler = (params: {
|
|
|
182
172
|
/**
|
|
183
173
|
* Standalone, borderless chat component designed for embedding into existing pages.
|
|
184
174
|
*
|
|
185
|
-
* Unlike {@link ChatCardProps}
|
|
186
|
-
*
|
|
175
|
+
* Unlike {@link ChatCardProps}, ChatEmbed does **not** rely on the WaniWani
|
|
176
|
+
* hosted backend. It does not fetch `/config` or call `/tool` — you bring
|
|
187
177
|
* your own `api` endpoint.
|
|
188
178
|
*
|
|
189
179
|
* The component fills its parent container (`width: 100%; height: 100%`) with no
|
|
@@ -226,6 +216,7 @@ interface ChatEmbedProps extends Omit<ChatBaseProps, "api" | "onCallTool"> {
|
|
|
226
216
|
/** Extra React node rendered in the sticky header, right of the title. */
|
|
227
217
|
headerActions?: React.ReactNode;
|
|
228
218
|
}
|
|
219
|
+
/** @deprecated Use `ChatEmbed` for new code. `ChatCard` is preserved for back-compat only. */
|
|
229
220
|
interface ChatCardProps extends ChatBaseProps {
|
|
230
221
|
/** Title shown in the card header. Defaults to "Assistant". */
|
|
231
222
|
title?: string;
|
|
@@ -255,10 +246,6 @@ interface ChatHandle {
|
|
|
255
246
|
/** Current chat messages */
|
|
256
247
|
messages: ai.UIMessage[];
|
|
257
248
|
}
|
|
258
|
-
/** @deprecated Use ChatBarProps instead */
|
|
259
|
-
type ChatWidgetProps = ChatBarProps;
|
|
260
|
-
|
|
261
|
-
declare const ChatBar: react.ForwardRefExoticComponent<ChatBarProps & react.RefAttributes<ChatHandle>>;
|
|
262
249
|
|
|
263
250
|
type ModelContextContentBlock = ContentBlock;
|
|
264
251
|
type ModelContextUpdate = {
|
|
@@ -330,6 +317,7 @@ interface McpAppFrameProps {
|
|
|
330
317
|
}
|
|
331
318
|
declare function McpAppFrame({ resourceUri, toolInput, toolResult, resourceEndpoint, chatSessionId, isDark, className, autoHeight, onOpenLink, onFollowUp, onCallTool, onDisplayModeChange, isFullscreen, toolDefinitions, }: McpAppFrameProps): react_jsx_runtime.JSX.Element;
|
|
332
319
|
|
|
320
|
+
/** @deprecated Use `ChatEmbed` for new code. `ChatCard` is preserved for back-compat only. */
|
|
333
321
|
declare const ChatCard: react.ForwardRefExoticComponent<ChatCardProps & react.RefAttributes<ChatHandle>>;
|
|
334
322
|
|
|
335
323
|
/**
|
|
@@ -351,4 +339,4 @@ declare const DARK_THEME: ChatTheme;
|
|
|
351
339
|
declare function mergeTheme(userTheme?: ChatTheme): Required<ChatTheme>;
|
|
352
340
|
declare function themeToCSSProperties(theme: Required<ChatTheme>): Record<string, string>;
|
|
353
341
|
|
|
354
|
-
export {
|
|
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 };
|