@voxket-ai/voxket-live 1.0.143 → 1.0.145
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 +1 -141
- package/dist/components/widget.d.ts +0 -1
- package/dist/core/client.d.ts +2 -16
- package/dist/index.cjs +189 -70
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7827 -7663
- package/dist/lib/portal-manager.d.ts +86 -0
- package/dist/types/core.d.ts +0 -2
- package/package.json +1 -2
- package/dist/components/chat/attachment-message.d.ts +0 -9
- package/dist/components/chat/chat-input-panel.d.ts +0 -11
- package/dist/components/chat/chat-message.d.ts +0 -10
- package/dist/components/chat/default-views.d.ts +0 -5
- package/dist/components/chat/markdown-utils.d.ts +0 -5
- package/dist/components/chat/streaming-text.d.ts +0 -8
- package/dist/components/chat/thinking-indicator.d.ts +0 -6
- package/dist/components/chat/tool-execution-indicator.d.ts +0 -8
- package/dist/components/deep-analysis.d.ts +0 -17
- package/dist/examples/test-visualization-event.d.ts +0 -18
- package/dist/examples/visualization-view.d.ts +0 -8
- package/dist/hooks/chat-hooks.d.ts +0 -39
- package/dist/types/tools.d.ts +0 -23
package/README.md
CHANGED
|
@@ -357,122 +357,6 @@ client.on('connection.error', (error) => {
|
|
|
357
357
|
});
|
|
358
358
|
```
|
|
359
359
|
|
|
360
|
-
## 🔔 **Custom Event System**
|
|
361
|
-
|
|
362
|
-
### 📡 **Register Event Emitters**
|
|
363
|
-
|
|
364
|
-
Register custom event emitters to listen for LiveKit text stream topics:
|
|
365
|
-
|
|
366
|
-
```typescript
|
|
367
|
-
import { VoxketClient } from '@voxket-ai/voxket-live';
|
|
368
|
-
|
|
369
|
-
const client = new VoxketClient(config);
|
|
370
|
-
|
|
371
|
-
// Register an event emitter for custom events
|
|
372
|
-
client.registerEventEmitter('custom_event_topic', (data) => {
|
|
373
|
-
console.log('Custom event received:', data);
|
|
374
|
-
// Handle your custom business logic
|
|
375
|
-
handleCustomEvent(data);
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
// Register multiple event emitters
|
|
379
|
-
client.registerEventEmitter('user_action', (actionData) => {
|
|
380
|
-
console.log('User action:', actionData);
|
|
381
|
-
analytics.track('user_action', actionData);
|
|
382
|
-
});
|
|
383
|
-
|
|
384
|
-
client.registerEventEmitter('system_notification', (notification) => {
|
|
385
|
-
showNotification(notification);
|
|
386
|
-
});
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
### 🎯 **Event Listener Registration**
|
|
390
|
-
|
|
391
|
-
Register event listeners for any SDK events with automatic cleanup:
|
|
392
|
-
|
|
393
|
-
```typescript
|
|
394
|
-
// Register event listeners with automatic unsubscribe
|
|
395
|
-
const unsubscribe = client.registerEventListener('chat.message.received', (message) => {
|
|
396
|
-
console.log('New message:', message);
|
|
397
|
-
updateUI(message);
|
|
398
|
-
});
|
|
399
|
-
|
|
400
|
-
// Manual cleanup when needed
|
|
401
|
-
unsubscribe();
|
|
402
|
-
|
|
403
|
-
// Register multiple listeners
|
|
404
|
-
client.registerEventListener('connection.connected', () => {
|
|
405
|
-
console.log('Connected to Voxket!');
|
|
406
|
-
updateConnectionStatus('connected');
|
|
407
|
-
});
|
|
408
|
-
|
|
409
|
-
client.registerEventListener('agent.thinking', () => {
|
|
410
|
-
showTypingIndicator();
|
|
411
|
-
});
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
### 🏢 **Business Integration Examples**
|
|
415
|
-
|
|
416
|
-
#### **Real-time Notifications**
|
|
417
|
-
```typescript
|
|
418
|
-
// Listen for agent-triggered notifications
|
|
419
|
-
client.registerEventEmitter('agent_notification', (data) => {
|
|
420
|
-
// Show toast notification
|
|
421
|
-
showToast({
|
|
422
|
-
title: data.title,
|
|
423
|
-
message: data.message,
|
|
424
|
-
type: data.type
|
|
425
|
-
});
|
|
426
|
-
});
|
|
427
|
-
|
|
428
|
-
// Listen for system updates
|
|
429
|
-
client.registerEventEmitter('system_update', (updateInfo) => {
|
|
430
|
-
if (updateInfo.type === 'maintenance') {
|
|
431
|
-
showMaintenanceWarning(updateInfo.schedule);
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
```
|
|
435
|
-
|
|
436
|
-
#### **Custom Analytics Integration**
|
|
437
|
-
```typescript
|
|
438
|
-
// Track custom business events
|
|
439
|
-
client.registerEventEmitter('business_event', (eventData) => {
|
|
440
|
-
// Send to your analytics platform
|
|
441
|
-
analytics.track(eventData.event_name, {
|
|
442
|
-
...eventData.properties,
|
|
443
|
-
timestamp: new Date().toISOString(),
|
|
444
|
-
session_id: client.getCurrentSession()?.id
|
|
445
|
-
});
|
|
446
|
-
});
|
|
447
|
-
|
|
448
|
-
// Example: Track user interactions
|
|
449
|
-
client.registerEventEmitter('user_interaction', (interaction) => {
|
|
450
|
-
mixpanel.track('Voxket User Interaction', {
|
|
451
|
-
interaction_type: interaction.type,
|
|
452
|
-
interaction_data: interaction.data,
|
|
453
|
-
user_id: getCurrentUserId()
|
|
454
|
-
});
|
|
455
|
-
});
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
#### **Workflow Automation**
|
|
459
|
-
```typescript
|
|
460
|
-
// Trigger business workflows
|
|
461
|
-
client.registerEventEmitter('workflow_trigger', (workflowData) => {
|
|
462
|
-
switch (workflowData.workflow_type) {
|
|
463
|
-
case 'lead_qualification':
|
|
464
|
-
triggerLeadQualificationWorkflow(workflowData.lead_data);
|
|
465
|
-
break;
|
|
466
|
-
case 'support_escalation':
|
|
467
|
-
escalateToHumanAgent(workflowData.ticket_data);
|
|
468
|
-
break;
|
|
469
|
-
case 'appointment_booking':
|
|
470
|
-
processAppointmentRequest(workflowData.appointment_data);
|
|
471
|
-
break;
|
|
472
|
-
}
|
|
473
|
-
});
|
|
474
|
-
```
|
|
475
|
-
|
|
476
360
|
### 💬 **Chat & Messaging Events**
|
|
477
361
|
|
|
478
362
|
```javascript
|
|
@@ -882,31 +766,7 @@ await client.setAudioInputDevice(deviceId);
|
|
|
882
766
|
await client.setVideoInputDevice(deviceId);
|
|
883
767
|
```
|
|
884
768
|
|
|
885
|
-
###
|
|
886
|
-
|
|
887
|
-
```typescript
|
|
888
|
-
// Register custom event emitter
|
|
889
|
-
client.registerEventEmitter(
|
|
890
|
-
topic: string,
|
|
891
|
-
handler: (data: string) => void
|
|
892
|
-
): void
|
|
893
|
-
|
|
894
|
-
// Register event listener with cleanup
|
|
895
|
-
client.registerEventListener<K extends keyof VoxketEvents>(
|
|
896
|
-
eventName: K,
|
|
897
|
-
callback: (data: any) => void
|
|
898
|
-
): () => void
|
|
899
|
-
|
|
900
|
-
// Example usage
|
|
901
|
-
const unsubscribe = client.registerEventListener('chat.message.received', (msg) => {
|
|
902
|
-
console.log('Message:', msg);
|
|
903
|
-
});
|
|
904
|
-
|
|
905
|
-
// Cleanup
|
|
906
|
-
unsubscribe();
|
|
907
|
-
```
|
|
908
|
-
|
|
909
|
-
### �👥 **Participant Management**
|
|
769
|
+
### 👥 **Participant Management**
|
|
910
770
|
|
|
911
771
|
```typescript
|
|
912
772
|
// Get participants
|
|
@@ -33,7 +33,6 @@ export interface VoxketWidgetProps {
|
|
|
33
33
|
onPopupToggle?: (isOpen: boolean) => void;
|
|
34
34
|
onDisplayTypeChange?: (displayType: DisplayType) => void;
|
|
35
35
|
voxketClient?: VoxketClient;
|
|
36
|
-
participantMetadata?: Record<string, any>;
|
|
37
36
|
}
|
|
38
37
|
declare function WrappedWidget(props: VoxketWidgetProps & {
|
|
39
38
|
prompts?: string[];
|
package/dist/core/client.d.ts
CHANGED
|
@@ -37,14 +37,11 @@ export interface RenderUIOptions {
|
|
|
37
37
|
welcomeTitle?: string;
|
|
38
38
|
welcomeSubTitle?: string;
|
|
39
39
|
loadingText?: string;
|
|
40
|
-
/** Participant metadata to be sent with session creation */
|
|
41
|
-
participantMetadata?: Record<string, any>;
|
|
42
40
|
}
|
|
43
41
|
export interface VoxketClientConfig extends VoxketConfig {
|
|
44
42
|
agentId?: string;
|
|
45
43
|
participantName?: string;
|
|
46
44
|
modalities?: SessionModality[];
|
|
47
|
-
participantMetadata?: Record<string, any>;
|
|
48
45
|
onConnected?: () => void;
|
|
49
46
|
onDisconnected?: (reason?: string) => void;
|
|
50
47
|
onError?: (error: Error) => void;
|
|
@@ -77,13 +74,13 @@ export declare class VoxketClient extends VoxketEventEmitter<VoxketEvents & RpcE
|
|
|
77
74
|
private initializeClient;
|
|
78
75
|
private setupRoomEventListeners;
|
|
79
76
|
private setupTextStreamHandlers;
|
|
80
|
-
fetchConnectionDetails(agentId?: string, participantName?: string, modalities?: SessionModality[]
|
|
77
|
+
fetchConnectionDetails(agentId?: string, participantName?: string, modalities?: SessionModality[]): Promise<{
|
|
81
78
|
serverUrl: string;
|
|
82
79
|
participantToken: string;
|
|
83
80
|
voxketSessionId: string;
|
|
84
81
|
agentInfo?: AgentInfo;
|
|
85
82
|
}>;
|
|
86
|
-
connect(agentId?: string, participantName?: string, modalities?: SessionModality[]
|
|
83
|
+
connect(agentId?: string, participantName?: string, modalities?: SessionModality[]): Promise<{
|
|
87
84
|
serverUrl: string;
|
|
88
85
|
participantToken: string;
|
|
89
86
|
voxketSessionId: string;
|
|
@@ -95,7 +92,6 @@ export declare class VoxketClient extends VoxketEventEmitter<VoxketEvents & RpcE
|
|
|
95
92
|
participantName?: string;
|
|
96
93
|
modalities?: SessionModality[];
|
|
97
94
|
metadata?: Record<string, any>;
|
|
98
|
-
participantMetadata?: Record<string, any>;
|
|
99
95
|
}): Promise<VoxketSession>;
|
|
100
96
|
endSession(): Promise<SessionMetrics | null>;
|
|
101
97
|
getCurrentSession(): VoxketSession | null;
|
|
@@ -219,16 +215,6 @@ export declare class VoxketClient extends VoxketEventEmitter<VoxketEvents & RpcE
|
|
|
219
215
|
* Unregister an RPC method
|
|
220
216
|
*/
|
|
221
217
|
unregisterRpcMethod(methodName: string): void;
|
|
222
|
-
/**
|
|
223
|
-
* Set participant metadata that will be sent with session creation requests.
|
|
224
|
-
* This is useful for passing business-specific user information to the API.
|
|
225
|
-
* @param metadata Object containing participant metadata (e.g., userId, customerType, etc.)
|
|
226
|
-
*/
|
|
227
|
-
setParticipantMetadata(metadata: Record<string, any>): void;
|
|
228
|
-
/**
|
|
229
|
-
* Get the current participant metadata
|
|
230
|
-
*/
|
|
231
|
-
getParticipantMetadata(): Record<string, any> | undefined;
|
|
232
218
|
/**
|
|
233
219
|
* Register a custom event listener for VoxketClient events.
|
|
234
220
|
* This is a business-friendly alias for the inherited `on` method.
|