@wallavi/widget 1.7.0 → 1.7.1
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.mts +80 -4
- package/dist/index.d.ts +80 -4
- package/dist/index.js +1670 -536
- package/dist/index.mjs +1669 -538
- package/dist/styles.css +1 -0
- package/package.json +11 -8
package/dist/index.d.mts
CHANGED
|
@@ -86,6 +86,15 @@ interface CustomBackend {
|
|
|
86
86
|
onClick: () => Promise<void>;
|
|
87
87
|
loading?: boolean;
|
|
88
88
|
};
|
|
89
|
+
voiceCall?: {
|
|
90
|
+
active: boolean;
|
|
91
|
+
token: string | null;
|
|
92
|
+
serverUrl: string | null;
|
|
93
|
+
start: () => Promise<void>;
|
|
94
|
+
stop: () => void;
|
|
95
|
+
loading: boolean;
|
|
96
|
+
error: string | null;
|
|
97
|
+
};
|
|
89
98
|
}
|
|
90
99
|
interface ChatWidgetConfig {
|
|
91
100
|
agentId: string;
|
|
@@ -116,6 +125,7 @@ interface ChatWidgetConfig {
|
|
|
116
125
|
*/
|
|
117
126
|
hideCloseButton?: boolean;
|
|
118
127
|
source?: string;
|
|
128
|
+
envId?: string;
|
|
119
129
|
userContext?: UserContext;
|
|
120
130
|
/** Per-session tool overrides used by Playground (not persisted) */
|
|
121
131
|
playgroundOverrides?: {
|
|
@@ -143,6 +153,8 @@ interface ChatWidgetConfig {
|
|
|
143
153
|
enableAttachments?: boolean;
|
|
144
154
|
/** When set, bypasses Wallavi AI and routes messages through this backend instead. */
|
|
145
155
|
customBackend?: CustomBackend;
|
|
156
|
+
/** Callback fired when a debug-trace event arrives from the pipeline. Only emitted for source="playground". */
|
|
157
|
+
onDebugTrace?: (trace: Record<string, unknown>) => void;
|
|
146
158
|
}
|
|
147
159
|
interface ChatWidgetProps extends ChatWidgetConfig {
|
|
148
160
|
className?: string;
|
|
@@ -263,11 +275,12 @@ interface BubbleWidgetProps extends Partial<ChatWidgetConfig> {
|
|
|
263
275
|
}
|
|
264
276
|
declare function BubbleWidget({ inboxToken, supportApiBase, requestHumanLabel, returnToAiLabel, position: positionProp, width: widthProp, height: heightProp, expandedWidth, expandedHeight, keyboardShortcut: keyboardShortcutProp, shortcutKey, autoOpen: autoOpenProp, bubbleIconUrl: bubbleIconUrlProp, bubbleSize: bubbleSizeProp, panelClassName, autoConfig, hideBubble, isOpen: isOpenProp, onOpenChange, ...chatProps }: BubbleWidgetProps): react_jsx_runtime.JSX.Element;
|
|
265
277
|
|
|
266
|
-
declare function ChatWidget({ agentId, workspaceId, agentName, displayName, profilePicture, userMessageColor, initialMessages, suggestedMessages, messagePlaceholder, watermark, watermarkLogoUrl, footer, theme, showThinking, regenerateMessage, persist, onNavigate, hideCloseButton, source, userContext, playgroundOverrides, enableVoice, voiceAutoSend, enableAttachments, customBackend, className, onClose, onReset, onExpand, expanded, embedded, }: ChatWidgetProps): react_jsx_runtime.JSX.Element;
|
|
278
|
+
declare function ChatWidget({ agentId, workspaceId, agentName, displayName, profilePicture, userMessageColor, initialMessages, suggestedMessages, messagePlaceholder, watermark, watermarkLogoUrl, footer, theme, showThinking, regenerateMessage, persist, onNavigate, hideCloseButton, source, userContext, playgroundOverrides, enableVoice, voiceAutoSend, enableAttachments, customBackend, className, onClose, onReset, onExpand, expanded, embedded, envId, onDebugTrace, }: ChatWidgetProps): react_jsx_runtime.JSX.Element;
|
|
267
279
|
|
|
268
280
|
interface UseChatOptions {
|
|
269
281
|
agentId: string;
|
|
270
282
|
workspaceId?: string;
|
|
283
|
+
envId?: string;
|
|
271
284
|
source?: string;
|
|
272
285
|
userContext?: UserContext;
|
|
273
286
|
persist?: boolean;
|
|
@@ -291,8 +304,71 @@ interface UseChatReturn {
|
|
|
291
304
|
regenerate: () => Promise<void>;
|
|
292
305
|
reset: () => void;
|
|
293
306
|
selectPickerOption: (pickerId: string, paramName: string, value: string, label: string) => Promise<void>;
|
|
307
|
+
/** Pipeline debug traces — only populated when source="playground" */
|
|
308
|
+
debugTraces: DebugTrace[];
|
|
309
|
+
voiceCall?: {
|
|
310
|
+
active: boolean;
|
|
311
|
+
token: string | null;
|
|
312
|
+
serverUrl: string | null;
|
|
313
|
+
start: () => Promise<void>;
|
|
314
|
+
stop: () => void;
|
|
315
|
+
loading: boolean;
|
|
316
|
+
error: string | null;
|
|
317
|
+
};
|
|
294
318
|
}
|
|
295
|
-
|
|
319
|
+
/** Structured pipeline execution data emitted per-turn from the backend */
|
|
320
|
+
interface DebugTrace {
|
|
321
|
+
threadId: string;
|
|
322
|
+
agentId: string;
|
|
323
|
+
sessionId: string;
|
|
324
|
+
turn: number;
|
|
325
|
+
timestamp: number;
|
|
326
|
+
durationMs: number;
|
|
327
|
+
userMessage: string;
|
|
328
|
+
assistantResponse: string;
|
|
329
|
+
router: {
|
|
330
|
+
intent: string;
|
|
331
|
+
capability: string;
|
|
332
|
+
complexity?: string;
|
|
333
|
+
};
|
|
334
|
+
tools: {
|
|
335
|
+
available: number;
|
|
336
|
+
selected: number;
|
|
337
|
+
executed: string[];
|
|
338
|
+
targetTool?: string;
|
|
339
|
+
selectedNames?: string[];
|
|
340
|
+
};
|
|
341
|
+
params: {
|
|
342
|
+
available: Record<string, string>;
|
|
343
|
+
missing: string[];
|
|
344
|
+
};
|
|
345
|
+
provider: {
|
|
346
|
+
name: string;
|
|
347
|
+
model: string;
|
|
348
|
+
fallbackCount: number;
|
|
349
|
+
};
|
|
350
|
+
tokens: {
|
|
351
|
+
input: number;
|
|
352
|
+
output: number;
|
|
353
|
+
total: number;
|
|
354
|
+
};
|
|
355
|
+
executionStatus: string;
|
|
356
|
+
flags: string[];
|
|
357
|
+
}
|
|
358
|
+
declare function useChat({ agentId, workspaceId, envId, source, userContext, persist, onNavigate, playgroundOverrides, customBackend, }: UseChatOptions): UseChatReturn;
|
|
359
|
+
|
|
360
|
+
declare function PlanCard({ part, onSend, disabled, }: {
|
|
361
|
+
part: PlanPart;
|
|
362
|
+
onSend?: (text: string) => void;
|
|
363
|
+
disabled?: boolean;
|
|
364
|
+
}): react_jsx_runtime.JSX.Element;
|
|
365
|
+
|
|
366
|
+
declare function ToolCallBadge({ part }: {
|
|
367
|
+
part: ToolPart;
|
|
368
|
+
}): react_jsx_runtime.JSX.Element;
|
|
369
|
+
declare function ReasoningBlock({ text }: {
|
|
370
|
+
text: string;
|
|
371
|
+
}): react_jsx_runtime.JSX.Element;
|
|
296
372
|
|
|
297
373
|
interface UseSupportChatOptions {
|
|
298
374
|
/** Inbox token from Wallavi Support dashboard. */
|
|
@@ -332,7 +408,7 @@ interface UseVoiceReturn {
|
|
|
332
408
|
start: () => Promise<void>;
|
|
333
409
|
stop: () => void;
|
|
334
410
|
}
|
|
335
|
-
declare function useVoice({ agentId, apiUrl, onTranscript, onError }: UseVoiceOptions): UseVoiceReturn;
|
|
411
|
+
declare function useVoice({ agentId, apiUrl, onTranscript, onError, }: UseVoiceOptions): UseVoiceReturn;
|
|
336
412
|
|
|
337
413
|
interface UseAttachmentsOptions {
|
|
338
414
|
agentId: string;
|
|
@@ -354,4 +430,4 @@ interface UseAttachmentsReturn {
|
|
|
354
430
|
}
|
|
355
431
|
declare function useAttachments({ agentId, apiUrl, maxFiles, }: UseAttachmentsOptions): UseAttachmentsReturn;
|
|
356
432
|
|
|
357
|
-
export { type Attachment, type AttachmentContentType, type AttachmentPayload, type AttachmentStatus, BubbleWidget, type BubbleWidgetProps, ChatWidget, type ChatWidgetConfig, type ChatWidgetProps, type CustomBackend, type Message, type MessagePart, type PageContext, type ToolPart, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseSupportChatOptions, type UseVoiceOptions, type UseVoiceReturn, type UserContext, type VoiceState, formatToolName, getContrastColor, useAttachments, useChat, useSupportChat, useVoice };
|
|
433
|
+
export { type Attachment, type AttachmentContentType, type AttachmentPayload, type AttachmentStatus, BubbleWidget, type BubbleWidgetProps, ChatWidget, type ChatWidgetConfig, type ChatWidgetProps, type CustomBackend, type DebugTrace, type Message, type MessagePart, type PageContext, PlanCard, type PlanPart, ReasoningBlock, ToolCallBadge, type ToolPart, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseChatOptions, type UseChatReturn, type UseSupportChatOptions, type UseVoiceOptions, type UseVoiceReturn, type UserContext, type VoiceState, formatToolName, getContrastColor, useAttachments, useChat, useSupportChat, useVoice };
|
package/dist/index.d.ts
CHANGED
|
@@ -86,6 +86,15 @@ interface CustomBackend {
|
|
|
86
86
|
onClick: () => Promise<void>;
|
|
87
87
|
loading?: boolean;
|
|
88
88
|
};
|
|
89
|
+
voiceCall?: {
|
|
90
|
+
active: boolean;
|
|
91
|
+
token: string | null;
|
|
92
|
+
serverUrl: string | null;
|
|
93
|
+
start: () => Promise<void>;
|
|
94
|
+
stop: () => void;
|
|
95
|
+
loading: boolean;
|
|
96
|
+
error: string | null;
|
|
97
|
+
};
|
|
89
98
|
}
|
|
90
99
|
interface ChatWidgetConfig {
|
|
91
100
|
agentId: string;
|
|
@@ -116,6 +125,7 @@ interface ChatWidgetConfig {
|
|
|
116
125
|
*/
|
|
117
126
|
hideCloseButton?: boolean;
|
|
118
127
|
source?: string;
|
|
128
|
+
envId?: string;
|
|
119
129
|
userContext?: UserContext;
|
|
120
130
|
/** Per-session tool overrides used by Playground (not persisted) */
|
|
121
131
|
playgroundOverrides?: {
|
|
@@ -143,6 +153,8 @@ interface ChatWidgetConfig {
|
|
|
143
153
|
enableAttachments?: boolean;
|
|
144
154
|
/** When set, bypasses Wallavi AI and routes messages through this backend instead. */
|
|
145
155
|
customBackend?: CustomBackend;
|
|
156
|
+
/** Callback fired when a debug-trace event arrives from the pipeline. Only emitted for source="playground". */
|
|
157
|
+
onDebugTrace?: (trace: Record<string, unknown>) => void;
|
|
146
158
|
}
|
|
147
159
|
interface ChatWidgetProps extends ChatWidgetConfig {
|
|
148
160
|
className?: string;
|
|
@@ -263,11 +275,12 @@ interface BubbleWidgetProps extends Partial<ChatWidgetConfig> {
|
|
|
263
275
|
}
|
|
264
276
|
declare function BubbleWidget({ inboxToken, supportApiBase, requestHumanLabel, returnToAiLabel, position: positionProp, width: widthProp, height: heightProp, expandedWidth, expandedHeight, keyboardShortcut: keyboardShortcutProp, shortcutKey, autoOpen: autoOpenProp, bubbleIconUrl: bubbleIconUrlProp, bubbleSize: bubbleSizeProp, panelClassName, autoConfig, hideBubble, isOpen: isOpenProp, onOpenChange, ...chatProps }: BubbleWidgetProps): react_jsx_runtime.JSX.Element;
|
|
265
277
|
|
|
266
|
-
declare function ChatWidget({ agentId, workspaceId, agentName, displayName, profilePicture, userMessageColor, initialMessages, suggestedMessages, messagePlaceholder, watermark, watermarkLogoUrl, footer, theme, showThinking, regenerateMessage, persist, onNavigate, hideCloseButton, source, userContext, playgroundOverrides, enableVoice, voiceAutoSend, enableAttachments, customBackend, className, onClose, onReset, onExpand, expanded, embedded, }: ChatWidgetProps): react_jsx_runtime.JSX.Element;
|
|
278
|
+
declare function ChatWidget({ agentId, workspaceId, agentName, displayName, profilePicture, userMessageColor, initialMessages, suggestedMessages, messagePlaceholder, watermark, watermarkLogoUrl, footer, theme, showThinking, regenerateMessage, persist, onNavigate, hideCloseButton, source, userContext, playgroundOverrides, enableVoice, voiceAutoSend, enableAttachments, customBackend, className, onClose, onReset, onExpand, expanded, embedded, envId, onDebugTrace, }: ChatWidgetProps): react_jsx_runtime.JSX.Element;
|
|
267
279
|
|
|
268
280
|
interface UseChatOptions {
|
|
269
281
|
agentId: string;
|
|
270
282
|
workspaceId?: string;
|
|
283
|
+
envId?: string;
|
|
271
284
|
source?: string;
|
|
272
285
|
userContext?: UserContext;
|
|
273
286
|
persist?: boolean;
|
|
@@ -291,8 +304,71 @@ interface UseChatReturn {
|
|
|
291
304
|
regenerate: () => Promise<void>;
|
|
292
305
|
reset: () => void;
|
|
293
306
|
selectPickerOption: (pickerId: string, paramName: string, value: string, label: string) => Promise<void>;
|
|
307
|
+
/** Pipeline debug traces — only populated when source="playground" */
|
|
308
|
+
debugTraces: DebugTrace[];
|
|
309
|
+
voiceCall?: {
|
|
310
|
+
active: boolean;
|
|
311
|
+
token: string | null;
|
|
312
|
+
serverUrl: string | null;
|
|
313
|
+
start: () => Promise<void>;
|
|
314
|
+
stop: () => void;
|
|
315
|
+
loading: boolean;
|
|
316
|
+
error: string | null;
|
|
317
|
+
};
|
|
294
318
|
}
|
|
295
|
-
|
|
319
|
+
/** Structured pipeline execution data emitted per-turn from the backend */
|
|
320
|
+
interface DebugTrace {
|
|
321
|
+
threadId: string;
|
|
322
|
+
agentId: string;
|
|
323
|
+
sessionId: string;
|
|
324
|
+
turn: number;
|
|
325
|
+
timestamp: number;
|
|
326
|
+
durationMs: number;
|
|
327
|
+
userMessage: string;
|
|
328
|
+
assistantResponse: string;
|
|
329
|
+
router: {
|
|
330
|
+
intent: string;
|
|
331
|
+
capability: string;
|
|
332
|
+
complexity?: string;
|
|
333
|
+
};
|
|
334
|
+
tools: {
|
|
335
|
+
available: number;
|
|
336
|
+
selected: number;
|
|
337
|
+
executed: string[];
|
|
338
|
+
targetTool?: string;
|
|
339
|
+
selectedNames?: string[];
|
|
340
|
+
};
|
|
341
|
+
params: {
|
|
342
|
+
available: Record<string, string>;
|
|
343
|
+
missing: string[];
|
|
344
|
+
};
|
|
345
|
+
provider: {
|
|
346
|
+
name: string;
|
|
347
|
+
model: string;
|
|
348
|
+
fallbackCount: number;
|
|
349
|
+
};
|
|
350
|
+
tokens: {
|
|
351
|
+
input: number;
|
|
352
|
+
output: number;
|
|
353
|
+
total: number;
|
|
354
|
+
};
|
|
355
|
+
executionStatus: string;
|
|
356
|
+
flags: string[];
|
|
357
|
+
}
|
|
358
|
+
declare function useChat({ agentId, workspaceId, envId, source, userContext, persist, onNavigate, playgroundOverrides, customBackend, }: UseChatOptions): UseChatReturn;
|
|
359
|
+
|
|
360
|
+
declare function PlanCard({ part, onSend, disabled, }: {
|
|
361
|
+
part: PlanPart;
|
|
362
|
+
onSend?: (text: string) => void;
|
|
363
|
+
disabled?: boolean;
|
|
364
|
+
}): react_jsx_runtime.JSX.Element;
|
|
365
|
+
|
|
366
|
+
declare function ToolCallBadge({ part }: {
|
|
367
|
+
part: ToolPart;
|
|
368
|
+
}): react_jsx_runtime.JSX.Element;
|
|
369
|
+
declare function ReasoningBlock({ text }: {
|
|
370
|
+
text: string;
|
|
371
|
+
}): react_jsx_runtime.JSX.Element;
|
|
296
372
|
|
|
297
373
|
interface UseSupportChatOptions {
|
|
298
374
|
/** Inbox token from Wallavi Support dashboard. */
|
|
@@ -332,7 +408,7 @@ interface UseVoiceReturn {
|
|
|
332
408
|
start: () => Promise<void>;
|
|
333
409
|
stop: () => void;
|
|
334
410
|
}
|
|
335
|
-
declare function useVoice({ agentId, apiUrl, onTranscript, onError }: UseVoiceOptions): UseVoiceReturn;
|
|
411
|
+
declare function useVoice({ agentId, apiUrl, onTranscript, onError, }: UseVoiceOptions): UseVoiceReturn;
|
|
336
412
|
|
|
337
413
|
interface UseAttachmentsOptions {
|
|
338
414
|
agentId: string;
|
|
@@ -354,4 +430,4 @@ interface UseAttachmentsReturn {
|
|
|
354
430
|
}
|
|
355
431
|
declare function useAttachments({ agentId, apiUrl, maxFiles, }: UseAttachmentsOptions): UseAttachmentsReturn;
|
|
356
432
|
|
|
357
|
-
export { type Attachment, type AttachmentContentType, type AttachmentPayload, type AttachmentStatus, BubbleWidget, type BubbleWidgetProps, ChatWidget, type ChatWidgetConfig, type ChatWidgetProps, type CustomBackend, type Message, type MessagePart, type PageContext, type ToolPart, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseSupportChatOptions, type UseVoiceOptions, type UseVoiceReturn, type UserContext, type VoiceState, formatToolName, getContrastColor, useAttachments, useChat, useSupportChat, useVoice };
|
|
433
|
+
export { type Attachment, type AttachmentContentType, type AttachmentPayload, type AttachmentStatus, BubbleWidget, type BubbleWidgetProps, ChatWidget, type ChatWidgetConfig, type ChatWidgetProps, type CustomBackend, type DebugTrace, type Message, type MessagePart, type PageContext, PlanCard, type PlanPart, ReasoningBlock, ToolCallBadge, type ToolPart, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseChatOptions, type UseChatReturn, type UseSupportChatOptions, type UseVoiceOptions, type UseVoiceReturn, type UserContext, type VoiceState, formatToolName, getContrastColor, useAttachments, useChat, useSupportChat, useVoice };
|