@voxket-ai/voxket-live 1.1.63 → 1.1.65
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 +149 -0
- package/dist/components/common/welcome.d.ts +2 -2
- package/dist/components/widget.d.ts +2 -2
- package/dist/core/client.d.ts +4 -4
- package/dist/core/connection-manager.d.ts +3 -3
- package/dist/core/ui-renderer.d.ts +2 -2
- package/dist/index.cjs +63 -63
- package/dist/index.css +1 -1
- package/dist/index.js +7039 -6997
- package/dist/types/core.d.ts +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -531,6 +531,155 @@ client.on('transcription.received', (transcription) => {
|
|
|
531
531
|
});
|
|
532
532
|
```
|
|
533
533
|
|
|
534
|
+
---
|
|
535
|
+
|
|
536
|
+
## 📝 **Rich Content & Markdown Support**
|
|
537
|
+
|
|
538
|
+
The Voxket SDK automatically detects and renders rich content in chat messages, including **GitHub Flavored Markdown (GFM)** with full support for tables, links, code blocks, and more.
|
|
539
|
+
|
|
540
|
+
### ✨ **Supported Markdown Features**
|
|
541
|
+
|
|
542
|
+
#### 📋 **Tables with Embedded Links**
|
|
543
|
+
|
|
544
|
+
Agent messages can include formatted tables with clickable links embedded within table cells:
|
|
545
|
+
|
|
546
|
+
```markdown
|
|
547
|
+
| CRA Partner | Registration Link | Description |
|
|
548
|
+
|-------------|-------------------|-------------|
|
|
549
|
+
| **CAMS** | [Click here to register](https://app.camsnps.in/register) | Computer Age Management Services |
|
|
550
|
+
| **KFintech** | [Register now](https://kfintech.com/register) | Widely used platform |
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
**Renders as:**
|
|
554
|
+
|
|
555
|
+
| CRA Partner | Registration Link | Description |
|
|
556
|
+
|-------------|-------------------|-------------|
|
|
557
|
+
| **CAMS** | [Click here to register](https://app.camsnps.in/register) | Computer Age Management Services |
|
|
558
|
+
| **KFintech** | [Register now](https://kfintech.com/register) | Widely used platform |
|
|
559
|
+
|
|
560
|
+
#### 🔗 **Links**
|
|
561
|
+
|
|
562
|
+
```markdown
|
|
563
|
+
Check out [Voxket AI](https://voxket.ai) for more information!
|
|
564
|
+
|
|
565
|
+
Visit https://voxket.ai (auto-linked)
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
**Features:**
|
|
569
|
+
- ✅ Embedded links in text: `[text](url)`
|
|
570
|
+
- ✅ Auto-detection of bare URLs
|
|
571
|
+
- ✅ External link icon indicator
|
|
572
|
+
- ✅ Opens in new tab with `target="_blank"`
|
|
573
|
+
- ✅ Proper security with `rel="noopener noreferrer"`
|
|
574
|
+
|
|
575
|
+
#### 📋 **Lists**
|
|
576
|
+
|
|
577
|
+
```markdown
|
|
578
|
+
**Unordered Lists:**
|
|
579
|
+
- Item one
|
|
580
|
+
- Item two
|
|
581
|
+
- Nested item
|
|
582
|
+
- Another nested item
|
|
583
|
+
|
|
584
|
+
**Ordered Lists:**
|
|
585
|
+
1. First step
|
|
586
|
+
2. Second step
|
|
587
|
+
3. Third step
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
#### 💻 **Code Blocks**
|
|
591
|
+
|
|
592
|
+
````markdown
|
|
593
|
+
Inline code: `const greeting = "Hello"`
|
|
594
|
+
|
|
595
|
+
```javascript
|
|
596
|
+
// Syntax-highlighted code block
|
|
597
|
+
function greet(name) {
|
|
598
|
+
return `Hello, ${name}!`;
|
|
599
|
+
}
|
|
600
|
+
```
|
|
601
|
+
````
|
|
602
|
+
|
|
603
|
+
**Features:**
|
|
604
|
+
- ✅ Syntax highlighting for 180+ languages
|
|
605
|
+
- ✅ Inline code with backticks
|
|
606
|
+
- ✅ Multi-line code blocks with language specification
|
|
607
|
+
- ✅ Theme-aware styling (dark/light modes)
|
|
608
|
+
|
|
609
|
+
#### 📐 **Headings & Formatting**
|
|
610
|
+
|
|
611
|
+
```markdown
|
|
612
|
+
# Heading 1
|
|
613
|
+
## Heading 2
|
|
614
|
+
### Heading 3
|
|
615
|
+
|
|
616
|
+
**Bold text**
|
|
617
|
+
*Italic text*
|
|
618
|
+
~~Strikethrough~~
|
|
619
|
+
|
|
620
|
+
> Blockquote for important information
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
#### 🖼️ **Images**
|
|
624
|
+
|
|
625
|
+
```markdown
|
|
626
|
+

|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
**Features:**
|
|
630
|
+
- ✅ Automatic lazy loading
|
|
631
|
+
- ✅ Responsive sizing
|
|
632
|
+
- ✅ Rounded corners with shadow
|
|
633
|
+
|
|
634
|
+
---
|
|
635
|
+
|
|
636
|
+
### 🎨 **Theming for Rich Content**
|
|
637
|
+
|
|
638
|
+
All markdown elements automatically adapt to your chosen theme:
|
|
639
|
+
|
|
640
|
+
```tsx
|
|
641
|
+
<VoxketWidget
|
|
642
|
+
theme="dark" // Markdown content uses dark theme styling
|
|
643
|
+
// ... other props
|
|
644
|
+
/>
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
**Theme Support:**
|
|
648
|
+
- 🌙 **Dark Mode:** Light text on dark backgrounds, blue links
|
|
649
|
+
- ☀️ **Light Mode:** Dark text on light backgrounds, darker blue links
|
|
650
|
+
- 💎 **Custom Themes:** Markdown inherits your custom theme colors
|
|
651
|
+
|
|
652
|
+
---
|
|
653
|
+
|
|
654
|
+
### 🤖 **Agent-Side Markdown**
|
|
655
|
+
|
|
656
|
+
For AI agents to send markdown content, simply return markdown-formatted text in the agent's response:
|
|
657
|
+
|
|
658
|
+
**Example Agent Response:**
|
|
659
|
+
```json
|
|
660
|
+
{
|
|
661
|
+
"type": "text",
|
|
662
|
+
"content": "Here's the information you requested:\n\n| Feature | Status |\n|---------|--------|\n| Voice | ✅ Available |\n| Chat | ✅ Available |\n\nFor more details, visit [our docs](https://docs.voxket.ai)."
|
|
663
|
+
}
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
The SDK will **automatically detect** markdown patterns and render them appropriately!
|
|
667
|
+
|
|
668
|
+
---
|
|
669
|
+
|
|
670
|
+
### 🔍 **Automatic Detection**
|
|
671
|
+
|
|
672
|
+
The SDK intelligently detects markdown content using multiple strategies:
|
|
673
|
+
|
|
674
|
+
- ✅ Explicit metadata: `{ metadata: { format: 'markdown' } }`
|
|
675
|
+
- ✅ Pattern matching: Headers, lists, tables, code blocks, links
|
|
676
|
+
- ✅ Structure analysis: README-like content, multiple sections
|
|
677
|
+
- ✅ Fallback: Plain text with auto-linked URLs
|
|
678
|
+
|
|
679
|
+
**No configuration needed** - it just works!
|
|
680
|
+
|
|
681
|
+
---
|
|
682
|
+
|
|
534
683
|
### 🤖 **Agent State Events**
|
|
535
684
|
|
|
536
685
|
```javascript
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ThemeType } from '../../styles';
|
|
3
|
-
import {
|
|
3
|
+
import { ModalityValue } from '../../types/core';
|
|
4
4
|
interface WelcomeProps {
|
|
5
5
|
disabled: boolean;
|
|
6
6
|
onStartCall: () => void;
|
|
@@ -15,7 +15,7 @@ interface WelcomeProps {
|
|
|
15
15
|
title?: string;
|
|
16
16
|
subTitle?: string;
|
|
17
17
|
theme?: ThemeType;
|
|
18
|
-
modalities?:
|
|
18
|
+
modalities?: ModalityValue[];
|
|
19
19
|
}
|
|
20
20
|
export declare const Welcome: React.ForwardRefExoticComponent<WelcomeProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
21
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ThemeType } from '../styles';
|
|
2
2
|
import { VoxketClient } from '../core/client';
|
|
3
|
-
import {
|
|
3
|
+
import { VoxketError, ModalityValue } from '../types/core';
|
|
4
4
|
export type DisplayType = 'fullscreen' | 'widget' | 'popup';
|
|
5
5
|
export type PopupPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
6
6
|
export interface VoxketWidgetProps {
|
|
@@ -31,7 +31,7 @@ export interface VoxketWidgetProps {
|
|
|
31
31
|
enableSessionLogging?: boolean;
|
|
32
32
|
onSessionLogsUpdate?: (logs: any[]) => void;
|
|
33
33
|
onSessionMetricsUpdate?: (metrics: any) => void;
|
|
34
|
-
modalities?:
|
|
34
|
+
modalities?: ModalityValue[];
|
|
35
35
|
displayType?: DisplayType;
|
|
36
36
|
showToolExecMessage?: boolean;
|
|
37
37
|
popupPosition?: PopupPosition;
|
package/dist/core/client.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { Room, ConnectionState } from 'livekit-client';
|
|
|
2
2
|
import { VoxketEventEmitter } from './event-emitter';
|
|
3
3
|
import { PluginManager } from '../plugins/plugin-system';
|
|
4
4
|
import { RenderUIOptions } from './ui-renderer';
|
|
5
|
-
import { VoxketConfig, SessionConfig, VoxketSession, VoxketEvents, SessionState, SessionMetrics, AgentInfo, ParticipantInfo, ChatMessage, TranscriptionSegment,
|
|
5
|
+
import { VoxketConfig, SessionConfig, VoxketSession, VoxketEvents, SessionState, SessionMetrics, AgentInfo, ParticipantInfo, ChatMessage, TranscriptionSegment, ModalityValue, VoxketError } from '../types/core';
|
|
6
6
|
import { VoxketInteractiveView, ViewPresentationMode, InteractiveUIState, RpcEvents } from '../types/rpc';
|
|
7
7
|
export interface VoxketClientConfig extends VoxketConfig {
|
|
8
8
|
agentId?: string;
|
|
9
9
|
participantName?: string;
|
|
10
|
-
modalities?:
|
|
10
|
+
modalities?: ModalityValue[];
|
|
11
11
|
participantMetadata?: Record<string, any>;
|
|
12
12
|
onConnected?: () => void;
|
|
13
13
|
onDisconnected?: (reason?: string) => void;
|
|
@@ -54,7 +54,7 @@ export declare class VoxketClient extends VoxketEventEmitter<VoxketEvents & RpcE
|
|
|
54
54
|
* Setup RPC event forwarding from RpcManager
|
|
55
55
|
*/
|
|
56
56
|
private setupRpcEventForwarding;
|
|
57
|
-
connect(agentId?: string, participantName?: string, modalities?:
|
|
57
|
+
connect(agentId?: string, participantName?: string, modalities?: ModalityValue[], participantMetadata?: Record<string, any>): Promise<{
|
|
58
58
|
serverUrl: string;
|
|
59
59
|
participantToken: string;
|
|
60
60
|
voxketSessionId: string;
|
|
@@ -64,7 +64,7 @@ export declare class VoxketClient extends VoxketEventEmitter<VoxketEvents & RpcE
|
|
|
64
64
|
createSession(config: SessionConfig): Promise<VoxketSession>;
|
|
65
65
|
startSession(agentId?: string, options?: {
|
|
66
66
|
participantName?: string;
|
|
67
|
-
modalities?:
|
|
67
|
+
modalities?: ModalityValue[];
|
|
68
68
|
metadata?: Record<string, any>;
|
|
69
69
|
participantMetadata?: Record<string, any>;
|
|
70
70
|
}): Promise<VoxketSession>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Room, ConnectionState } from 'livekit-client';
|
|
2
2
|
import { VoxketEventEmitter } from './event-emitter';
|
|
3
|
-
import { VoxketEvents, AgentInfo, ParticipantInfo,
|
|
3
|
+
import { VoxketEvents, AgentInfo, ParticipantInfo, ModalityValue } from '../types/core';
|
|
4
4
|
export interface ConnectionConfig {
|
|
5
5
|
baseUrl: string;
|
|
6
6
|
appId?: string;
|
|
@@ -36,7 +36,7 @@ export declare class ConnectionManager {
|
|
|
36
36
|
/**
|
|
37
37
|
* Fetch connection details from the server
|
|
38
38
|
*/
|
|
39
|
-
fetchConnectionDetails(agentId: string, participantName: string, modalities:
|
|
39
|
+
fetchConnectionDetails(agentId: string, participantName: string, modalities: ModalityValue[], participantMetadata?: Record<string, any>): Promise<{
|
|
40
40
|
serverUrl: string;
|
|
41
41
|
participantToken: string;
|
|
42
42
|
voxketSessionId: string;
|
|
@@ -45,7 +45,7 @@ export declare class ConnectionManager {
|
|
|
45
45
|
/**
|
|
46
46
|
* Connect to the room
|
|
47
47
|
*/
|
|
48
|
-
connect(agentId: string, participantName: string, modalities:
|
|
48
|
+
connect(agentId: string, participantName: string, modalities: ModalityValue[], participantMetadata?: Record<string, any>): Promise<{
|
|
49
49
|
serverUrl: string;
|
|
50
50
|
participantToken: string;
|
|
51
51
|
voxketSessionId: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { DisplayType, PopupPosition } from '../components/widget';
|
|
3
3
|
import { WidgetTheme } from '../styles';
|
|
4
|
-
import {
|
|
4
|
+
import { ModalityValue, VoxketConfig } from '../types/core';
|
|
5
5
|
export interface RenderUIOptions {
|
|
6
6
|
target?: string | HTMLElement;
|
|
7
|
-
modality?:
|
|
7
|
+
modality?: ModalityValue[];
|
|
8
8
|
theme?: WidgetTheme | 'dark' | 'light' | 'vox';
|
|
9
9
|
component?: 'widget' | 'session' | 'chat-only' | 'voice-only';
|
|
10
10
|
className?: string;
|