@glydeunity/voice-sdk 1.3.6 → 1.4.0
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/glyde-chat.umd.js +265 -0
- package/dist/glyde-chat.umd.js.map +1 -0
- package/dist/index.d.ts +851 -16
- package/dist/voice-sdk.es.js +1738 -70
- package/dist/voice-sdk.es.js.map +1 -0
- package/package.json +29 -9
- package/dist/voice-sdk.umd.js +0 -140
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,311 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GLYDE Voice SDK
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* A comprehensive SDK for voice and text chat interactions with GLYDE AI agents.
|
|
5
|
+
*
|
|
6
|
+
* ## Usage Patterns
|
|
7
|
+
*
|
|
8
|
+
* ### 1. CDN Users (Minimal Code)
|
|
9
|
+
* ```html
|
|
10
|
+
* <script src="https://cdn.glyde.com/voice-sdk/v1.4.0/glyde-chat.umd.js"></script>
|
|
11
|
+
* <script>
|
|
12
|
+
* GlydeChat.init({
|
|
13
|
+
* publishableKey: 'pk_...',
|
|
14
|
+
* contextId: 'uuid...',
|
|
15
|
+
* unityBaseUrl: 'https://api.glydeunity.com'
|
|
16
|
+
* });
|
|
17
|
+
* </script>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* ### 2. SDK Users (Full Control)
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { GlydeVoice, GlydeText } from '@glydeunity/voice-sdk';
|
|
23
|
+
* import { VoiceChat, TextChat } from '@glydeunity/voice-sdk/components';
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* ### 3. GLYDE Developers (Maximum Reuse)
|
|
27
|
+
* ```typescript
|
|
28
|
+
* import { useVoiceAgent, useTextChat } from '@glydeunity/voice-sdk/hooks';
|
|
29
|
+
* import { ChatWidget } from '@glydeunity/voice-sdk/components';
|
|
30
|
+
* ```
|
|
6
31
|
*
|
|
7
32
|
* @packageDocumentation
|
|
8
33
|
*/
|
|
9
34
|
|
|
35
|
+
import { default as default_2 } from 'react';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Activity / live indicator icon
|
|
39
|
+
*/
|
|
40
|
+
export declare const ActivityIcon: default_2.FC<IconProps>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Base configuration shared between voice and text chat
|
|
44
|
+
*/
|
|
45
|
+
export declare interface BaseGlydeConfig {
|
|
46
|
+
/** Publishable key for external apps */
|
|
47
|
+
publishableKey?: string;
|
|
48
|
+
/** API key for programmatic access */
|
|
49
|
+
apiKey?: string;
|
|
50
|
+
/** JWT token for GLYDEBuddy passthrough */
|
|
51
|
+
authToken?: string;
|
|
52
|
+
/** Context identifier (e.g., application_uuid) */
|
|
53
|
+
contextId?: string;
|
|
54
|
+
/** Unity API base URL - defaults to https://api.glydeunity.com */
|
|
55
|
+
unityBaseUrl?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Bot / AI icon
|
|
60
|
+
*/
|
|
61
|
+
export declare const BotIcon: default_2.FC<IconProps>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Chat message for text chat
|
|
65
|
+
*/
|
|
66
|
+
export declare interface ChatMessage {
|
|
67
|
+
role: 'user' | 'assistant' | 'system';
|
|
68
|
+
content: string;
|
|
69
|
+
created?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Chat mode selection
|
|
74
|
+
*/
|
|
75
|
+
export declare type ChatMode = 'voice' | 'text';
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* ChatWidget Component
|
|
79
|
+
*
|
|
80
|
+
* A floating chat widget that provides:
|
|
81
|
+
* - Voice and text chat modes
|
|
82
|
+
* - Mode selection toggle
|
|
83
|
+
* - Floating button to open/close
|
|
84
|
+
* - Configurable position
|
|
85
|
+
* - Theme support
|
|
86
|
+
*/
|
|
87
|
+
export declare const ChatWidget: default_2.FC<ChatWidgetProps>;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Configuration for the ChatWidget (CDN auto-inject)
|
|
91
|
+
*/
|
|
92
|
+
export declare interface ChatWidgetConfig extends BaseGlydeConfig {
|
|
93
|
+
/** Voice context type */
|
|
94
|
+
contextType?: VoiceContextType;
|
|
95
|
+
/** Default chat mode */
|
|
96
|
+
defaultMode?: ChatMode;
|
|
97
|
+
/** Widget position */
|
|
98
|
+
position?: WidgetPosition;
|
|
99
|
+
/** Theme mode */
|
|
100
|
+
theme?: ThemeMode;
|
|
101
|
+
/** Allow switching between voice and text modes */
|
|
102
|
+
allowModeSwitch?: boolean;
|
|
103
|
+
/** Custom container element (instead of floating widget) */
|
|
104
|
+
container?: string | HTMLElement;
|
|
105
|
+
/** Callback when widget is ready */
|
|
106
|
+
onReady?: () => void;
|
|
107
|
+
/** Callback when mode changes */
|
|
108
|
+
onModeChange?: (mode: ChatMode) => void;
|
|
109
|
+
/** Callback for transcripts/messages */
|
|
110
|
+
onTranscript?: (text: string, role: 'user' | 'agent') => void;
|
|
111
|
+
/** Callback for errors */
|
|
112
|
+
onError?: (error: Error) => void;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* ChatWidget component props (extends ChatWidgetConfig)
|
|
117
|
+
*/
|
|
118
|
+
export declare interface ChatWidgetProps extends ChatWidgetConfig {
|
|
119
|
+
/** Initial expanded state */
|
|
120
|
+
initialExpanded?: boolean;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Component-specific style objects (for inline styles)
|
|
125
|
+
*/
|
|
126
|
+
export declare const componentStyles: {
|
|
127
|
+
floatingButton: {
|
|
128
|
+
position: "fixed";
|
|
129
|
+
width: string;
|
|
130
|
+
height: string;
|
|
131
|
+
borderRadius: string;
|
|
132
|
+
border: string;
|
|
133
|
+
cursor: string;
|
|
134
|
+
display: string;
|
|
135
|
+
alignItems: string;
|
|
136
|
+
justifyContent: string;
|
|
137
|
+
boxShadow: string;
|
|
138
|
+
transition: string;
|
|
139
|
+
zIndex: number;
|
|
140
|
+
};
|
|
141
|
+
widgetPanel: {
|
|
142
|
+
position: "fixed";
|
|
143
|
+
width: string;
|
|
144
|
+
height: string;
|
|
145
|
+
borderRadius: string;
|
|
146
|
+
boxShadow: string;
|
|
147
|
+
display: string;
|
|
148
|
+
flexDirection: "column";
|
|
149
|
+
overflow: string;
|
|
150
|
+
zIndex: number;
|
|
151
|
+
};
|
|
152
|
+
card: {
|
|
153
|
+
background: string;
|
|
154
|
+
borderRadius: string;
|
|
155
|
+
boxShadow: string;
|
|
156
|
+
overflow: string;
|
|
157
|
+
};
|
|
158
|
+
header: {
|
|
159
|
+
padding: string;
|
|
160
|
+
borderBottom: string;
|
|
161
|
+
display: string;
|
|
162
|
+
justifyContent: string;
|
|
163
|
+
alignItems: string;
|
|
164
|
+
};
|
|
165
|
+
modeSelector: {
|
|
166
|
+
display: string;
|
|
167
|
+
gap: string;
|
|
168
|
+
padding: string;
|
|
169
|
+
background: string;
|
|
170
|
+
borderRadius: string;
|
|
171
|
+
};
|
|
172
|
+
modeSelectorButton: {
|
|
173
|
+
padding: string;
|
|
174
|
+
border: string;
|
|
175
|
+
borderRadius: string;
|
|
176
|
+
cursor: string;
|
|
177
|
+
display: string;
|
|
178
|
+
alignItems: string;
|
|
179
|
+
gap: string;
|
|
180
|
+
fontSize: string;
|
|
181
|
+
fontWeight: number;
|
|
182
|
+
transition: string;
|
|
183
|
+
};
|
|
184
|
+
transcriptArea: {
|
|
185
|
+
flex: number;
|
|
186
|
+
overflowY: "auto";
|
|
187
|
+
padding: string;
|
|
188
|
+
background: string;
|
|
189
|
+
};
|
|
190
|
+
messageBubble: {
|
|
191
|
+
maxWidth: string;
|
|
192
|
+
padding: string;
|
|
193
|
+
borderRadius: string;
|
|
194
|
+
boxShadow: string;
|
|
195
|
+
};
|
|
196
|
+
messageBubbleUser: {
|
|
197
|
+
background: string;
|
|
198
|
+
color: string;
|
|
199
|
+
borderTopRightRadius: string;
|
|
200
|
+
};
|
|
201
|
+
messageBubbleAgent: {
|
|
202
|
+
background: string;
|
|
203
|
+
color: string;
|
|
204
|
+
borderTopLeftRadius: string;
|
|
205
|
+
};
|
|
206
|
+
controlsArea: {
|
|
207
|
+
padding: string;
|
|
208
|
+
borderTop: string;
|
|
209
|
+
background: string;
|
|
210
|
+
};
|
|
211
|
+
speakingIndicator: {
|
|
212
|
+
display: string;
|
|
213
|
+
alignItems: string;
|
|
214
|
+
gap: string;
|
|
215
|
+
fontSize: string;
|
|
216
|
+
};
|
|
217
|
+
speakingDot: {
|
|
218
|
+
width: string;
|
|
219
|
+
height: string;
|
|
220
|
+
borderRadius: string;
|
|
221
|
+
transition: string;
|
|
222
|
+
};
|
|
223
|
+
primaryButton: {
|
|
224
|
+
padding: string;
|
|
225
|
+
background: string;
|
|
226
|
+
color: string;
|
|
227
|
+
border: string;
|
|
228
|
+
borderRadius: string;
|
|
229
|
+
fontSize: string;
|
|
230
|
+
fontWeight: number;
|
|
231
|
+
cursor: string;
|
|
232
|
+
display: string;
|
|
233
|
+
alignItems: string;
|
|
234
|
+
justifyContent: string;
|
|
235
|
+
gap: string;
|
|
236
|
+
transition: string;
|
|
237
|
+
};
|
|
238
|
+
secondaryButton: {
|
|
239
|
+
padding: string;
|
|
240
|
+
background: string;
|
|
241
|
+
color: string;
|
|
242
|
+
border: string;
|
|
243
|
+
borderRadius: string;
|
|
244
|
+
fontSize: string;
|
|
245
|
+
fontWeight: number;
|
|
246
|
+
cursor: string;
|
|
247
|
+
display: string;
|
|
248
|
+
alignItems: string;
|
|
249
|
+
justifyContent: string;
|
|
250
|
+
gap: string;
|
|
251
|
+
transition: string;
|
|
252
|
+
};
|
|
253
|
+
dangerButton: {
|
|
254
|
+
padding: string;
|
|
255
|
+
background: string;
|
|
256
|
+
color: string;
|
|
257
|
+
border: string;
|
|
258
|
+
borderRadius: string;
|
|
259
|
+
fontSize: string;
|
|
260
|
+
fontWeight: number;
|
|
261
|
+
cursor: string;
|
|
262
|
+
display: string;
|
|
263
|
+
alignItems: string;
|
|
264
|
+
gap: string;
|
|
265
|
+
transition: string;
|
|
266
|
+
};
|
|
267
|
+
iconButton: {
|
|
268
|
+
width: string;
|
|
269
|
+
height: string;
|
|
270
|
+
padding: string;
|
|
271
|
+
border: string;
|
|
272
|
+
borderRadius: string;
|
|
273
|
+
cursor: string;
|
|
274
|
+
display: string;
|
|
275
|
+
alignItems: string;
|
|
276
|
+
justifyContent: string;
|
|
277
|
+
transition: string;
|
|
278
|
+
};
|
|
279
|
+
inputField: {
|
|
280
|
+
flex: number;
|
|
281
|
+
padding: string;
|
|
282
|
+
borderRadius: string;
|
|
283
|
+
border: string;
|
|
284
|
+
background: string;
|
|
285
|
+
color: string;
|
|
286
|
+
fontSize: string;
|
|
287
|
+
outline: string;
|
|
288
|
+
transition: string;
|
|
289
|
+
};
|
|
290
|
+
statusBadge: {
|
|
291
|
+
padding: string;
|
|
292
|
+
borderRadius: string;
|
|
293
|
+
fontSize: string;
|
|
294
|
+
fontWeight: number;
|
|
295
|
+
display: string;
|
|
296
|
+
alignItems: string;
|
|
297
|
+
gap: string;
|
|
298
|
+
};
|
|
299
|
+
statusBadgeLive: {
|
|
300
|
+
background: string;
|
|
301
|
+
color: string;
|
|
302
|
+
};
|
|
303
|
+
statusBadgeConnecting: {
|
|
304
|
+
background: string;
|
|
305
|
+
color: string;
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
|
|
10
309
|
/**
|
|
11
310
|
* Deepgram agent configuration for LLM and voice settings
|
|
12
311
|
*/
|
|
@@ -44,9 +343,41 @@ export declare interface DeepgramAgentConfig {
|
|
|
44
343
|
}
|
|
45
344
|
|
|
46
345
|
/**
|
|
47
|
-
*
|
|
48
|
-
* @see https://developers.deepgram.com/docs/voice-agent-function-call-request
|
|
346
|
+
* Deepgram agent configuration for LLM and voice settings
|
|
49
347
|
*/
|
|
348
|
+
declare interface DeepgramAgentConfig_2 {
|
|
349
|
+
tags?: string[];
|
|
350
|
+
think?: {
|
|
351
|
+
provider?: {
|
|
352
|
+
type: string;
|
|
353
|
+
model?: string;
|
|
354
|
+
};
|
|
355
|
+
functions?: Array<{
|
|
356
|
+
name: string;
|
|
357
|
+
description: string;
|
|
358
|
+
parameters: unknown;
|
|
359
|
+
endpoint?: {
|
|
360
|
+
url: string;
|
|
361
|
+
method?: string;
|
|
362
|
+
headers?: Record<string, string>;
|
|
363
|
+
};
|
|
364
|
+
}>;
|
|
365
|
+
};
|
|
366
|
+
speak?: {
|
|
367
|
+
provider?: {
|
|
368
|
+
type: string;
|
|
369
|
+
model?: string;
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
listen?: {
|
|
373
|
+
provider?: {
|
|
374
|
+
type: string;
|
|
375
|
+
model?: string;
|
|
376
|
+
version?: string;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
|
|
50
381
|
/**
|
|
51
382
|
* Individual function call within a FunctionCallRequest
|
|
52
383
|
* @see https://developers.deepgram.com/docs/voice-agent-function-call-request
|
|
@@ -73,10 +404,6 @@ export declare interface FunctionCallRequest {
|
|
|
73
404
|
functions: FunctionCall[];
|
|
74
405
|
}
|
|
75
406
|
|
|
76
|
-
/**
|
|
77
|
-
* Function call response to send back to Deepgram
|
|
78
|
-
* @see https://developers.deepgram.com/docs/voice-agent-function-call-response
|
|
79
|
-
*/
|
|
80
407
|
/**
|
|
81
408
|
* Function call response to send back to Deepgram Voice Agent
|
|
82
409
|
* @see https://developers.deepgram.com/docs/voice-agent-function-call-response
|
|
@@ -91,6 +418,139 @@ export declare interface FunctionCallResponse {
|
|
|
91
418
|
content: string;
|
|
92
419
|
}
|
|
93
420
|
|
|
421
|
+
/**
|
|
422
|
+
* Get position styles for floating widget
|
|
423
|
+
*/
|
|
424
|
+
export declare function getPositionStyles(position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left', offset?: number): {
|
|
425
|
+
button: React.CSSProperties;
|
|
426
|
+
panel: React.CSSProperties;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Get CSS variables for a theme
|
|
431
|
+
*/
|
|
432
|
+
export declare function getThemeCSSVariables(theme: 'light' | 'dark'): string;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Global CSS styles to inject
|
|
436
|
+
*/
|
|
437
|
+
export declare const globalStyles = "\n @keyframes glyde-pulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.5; transform: scale(1.2); }\n }\n\n @keyframes glyde-spin {\n to { transform: rotate(360deg); }\n }\n\n @keyframes glyde-fade-in {\n from { opacity: 0; transform: translateY(10px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n @keyframes glyde-slide-up {\n from { opacity: 0; transform: translateY(20px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n @keyframes glyde-bounce {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-5px); }\n }\n\n .glyde-widget-root {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.5;\n color: var(--glyde-text);\n box-sizing: border-box;\n }\n\n .glyde-widget-root *, .glyde-widget-root *::before, .glyde-widget-root *::after {\n box-sizing: border-box;\n }\n\n .glyde-spinner {\n width: 32px;\n height: 32px;\n border: 3px solid var(--glyde-border);\n border-top-color: var(--glyde-primary);\n border-radius: 50%;\n animation: glyde-spin 1s linear infinite;\n }\n\n .glyde-pulse-dot {\n animation: glyde-pulse 1.5s infinite;\n }\n\n .glyde-fade-in {\n animation: glyde-fade-in 0.3s ease-out;\n }\n\n .glyde-slide-up {\n animation: glyde-slide-up 0.3s ease-out;\n }\n";
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* GlydeChat - CDN entry point
|
|
441
|
+
*
|
|
442
|
+
* Provides static methods for initializing and controlling the chat widget.
|
|
443
|
+
*/
|
|
444
|
+
export declare const GlydeChat: {
|
|
445
|
+
/**
|
|
446
|
+
* Initialize the chat widget
|
|
447
|
+
*
|
|
448
|
+
* @param config - Widget configuration
|
|
449
|
+
* @returns Control object for the widget
|
|
450
|
+
*/
|
|
451
|
+
init(config: ChatWidgetConfig): {
|
|
452
|
+
/**
|
|
453
|
+
* Destroy the widget
|
|
454
|
+
*/
|
|
455
|
+
destroy(): void;
|
|
456
|
+
/**
|
|
457
|
+
* Update widget configuration
|
|
458
|
+
*/
|
|
459
|
+
update(newConfig: Partial<ChatWidgetConfig>): void;
|
|
460
|
+
} | null;
|
|
461
|
+
/**
|
|
462
|
+
* Render widget into a specific container (non-floating)
|
|
463
|
+
*
|
|
464
|
+
* @param container - DOM element or selector
|
|
465
|
+
* @param config - Widget configuration
|
|
466
|
+
*/
|
|
467
|
+
render(container: HTMLElement | string, config: ChatWidgetConfig): {
|
|
468
|
+
destroy(): void;
|
|
469
|
+
update(newConfig: Partial<ChatWidgetConfig>): void;
|
|
470
|
+
} | null;
|
|
471
|
+
/**
|
|
472
|
+
* Check if the SDK is loaded and ready
|
|
473
|
+
*/
|
|
474
|
+
isReady(): boolean;
|
|
475
|
+
/**
|
|
476
|
+
* Get SDK version
|
|
477
|
+
*/
|
|
478
|
+
readonly version: string;
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* GlydeText - Text Chat Client
|
|
483
|
+
*
|
|
484
|
+
* Connects to GLYDE Unity API for text-based conversations.
|
|
485
|
+
* Uses the screening chat endpoints for candidate interactions.
|
|
486
|
+
*/
|
|
487
|
+
export declare class GlydeText {
|
|
488
|
+
private config;
|
|
489
|
+
private unityUrl;
|
|
490
|
+
private history;
|
|
491
|
+
private isTyping;
|
|
492
|
+
private initialized;
|
|
493
|
+
/**
|
|
494
|
+
* Create a new GlydeText instance
|
|
495
|
+
* @param config - Configuration options
|
|
496
|
+
*/
|
|
497
|
+
constructor(config: GlydeTextConfig);
|
|
498
|
+
/**
|
|
499
|
+
* Get authentication headers based on configured auth method
|
|
500
|
+
* @returns Headers object with appropriate authentication
|
|
501
|
+
*/
|
|
502
|
+
private getAuthHeaders;
|
|
503
|
+
/**
|
|
504
|
+
* Emit event to callback
|
|
505
|
+
*/
|
|
506
|
+
private emit;
|
|
507
|
+
/**
|
|
508
|
+
* Set typing state and notify callback
|
|
509
|
+
*/
|
|
510
|
+
private setTyping;
|
|
511
|
+
/**
|
|
512
|
+
* Initialize the chat session and load existing history
|
|
513
|
+
* @returns The loaded message history
|
|
514
|
+
*/
|
|
515
|
+
initialize(): Promise<ChatMessage[]>;
|
|
516
|
+
/**
|
|
517
|
+
* Send a message and get the agent's response
|
|
518
|
+
* @param message - The message content to send
|
|
519
|
+
* @returns The agent's response message
|
|
520
|
+
*/
|
|
521
|
+
sendMessage(message: string): Promise<ChatMessage>;
|
|
522
|
+
/**
|
|
523
|
+
* Get the current conversation history
|
|
524
|
+
* @returns Array of chat messages
|
|
525
|
+
*/
|
|
526
|
+
getHistory(): ChatMessage[];
|
|
527
|
+
/**
|
|
528
|
+
* Clear the local conversation history
|
|
529
|
+
* Note: This does not clear server-side history
|
|
530
|
+
*/
|
|
531
|
+
clearHistory(): void;
|
|
532
|
+
/**
|
|
533
|
+
* Check if the chat is currently waiting for a response
|
|
534
|
+
*/
|
|
535
|
+
getIsTyping(): boolean;
|
|
536
|
+
/**
|
|
537
|
+
* Check if the chat has been initialized
|
|
538
|
+
*/
|
|
539
|
+
getIsInitialized(): boolean;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Configuration options for GlydeText (text chat)
|
|
544
|
+
*/
|
|
545
|
+
export declare interface GlydeTextConfig extends BaseGlydeConfig {
|
|
546
|
+
/** Event callback for text chat events */
|
|
547
|
+
onEvent?: (event: TextChatEvent) => void;
|
|
548
|
+
/** Message callback for chat messages */
|
|
549
|
+
onMessage?: (message: ChatMessage) => void;
|
|
550
|
+
/** Typing indicator callback */
|
|
551
|
+
onTyping?: (isTyping: boolean) => void;
|
|
552
|
+
}
|
|
553
|
+
|
|
94
554
|
/**
|
|
95
555
|
* GlydeVoice - Voice Agent Client
|
|
96
556
|
*
|
|
@@ -127,7 +587,7 @@ export declare class GlydeVoice {
|
|
|
127
587
|
* Create a new GlydeVoice instance
|
|
128
588
|
* @param config - Configuration options
|
|
129
589
|
*/
|
|
130
|
-
constructor(config:
|
|
590
|
+
constructor(config: GlydeVoiceConfig_2);
|
|
131
591
|
/**
|
|
132
592
|
* Get authentication headers based on configured auth method
|
|
133
593
|
* Supports publishableKey, apiKey, and JWT token (authToken)
|
|
@@ -200,7 +660,7 @@ export declare class GlydeVoice {
|
|
|
200
660
|
/**
|
|
201
661
|
* Get the current server configuration
|
|
202
662
|
*/
|
|
203
|
-
getServerConfig():
|
|
663
|
+
getServerConfig(): VoiceConfig_2 | null;
|
|
204
664
|
/**
|
|
205
665
|
* Stop the voice session
|
|
206
666
|
*/
|
|
@@ -257,7 +717,7 @@ export declare class GlydeVoice {
|
|
|
257
717
|
setSessionContext(context: {
|
|
258
718
|
clientUuid?: string;
|
|
259
719
|
contextId?: string;
|
|
260
|
-
contextType?:
|
|
720
|
+
contextType?: VoiceContextType_2;
|
|
261
721
|
currentJobUuid?: string;
|
|
262
722
|
}): void;
|
|
263
723
|
}
|
|
@@ -265,7 +725,25 @@ export declare class GlydeVoice {
|
|
|
265
725
|
/**
|
|
266
726
|
* Configuration options for GlydeVoice
|
|
267
727
|
*/
|
|
268
|
-
export declare interface GlydeVoiceConfig {
|
|
728
|
+
export declare interface GlydeVoiceConfig extends BaseGlydeConfig {
|
|
729
|
+
/** Voice context type - determines which prompt and tools to use */
|
|
730
|
+
contextType: VoiceContextType;
|
|
731
|
+
/** DOM element to render the widget UI (optional) */
|
|
732
|
+
container?: HTMLElement | string;
|
|
733
|
+
/** Event callback for voice agent events */
|
|
734
|
+
onEvent?: (event: VoiceEvent) => void;
|
|
735
|
+
/** Transcript callback for conversation text */
|
|
736
|
+
onTranscript?: (text: string, role: 'user' | 'agent') => void;
|
|
737
|
+
/** Override system prompt (skips config fetch) */
|
|
738
|
+
systemPrompt?: string;
|
|
739
|
+
/** Override Deepgram configuration */
|
|
740
|
+
deepgramConfig?: DeepgramAgentConfig;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Configuration options for GlydeVoice
|
|
745
|
+
*/
|
|
746
|
+
declare interface GlydeVoiceConfig_2 {
|
|
269
747
|
/** Publishable key for external apps (Screen) */
|
|
270
748
|
publishableKey?: string;
|
|
271
749
|
/** API key for programmatic access */
|
|
@@ -273,7 +751,7 @@ export declare interface GlydeVoiceConfig {
|
|
|
273
751
|
/** JWT token for GLYDEBuddy passthrough (Teams app) */
|
|
274
752
|
authToken?: string;
|
|
275
753
|
/** Voice context type - determines which prompt and tools to use */
|
|
276
|
-
contextType:
|
|
754
|
+
contextType: VoiceContextType_2;
|
|
277
755
|
/** Context identifier (e.g., application_uuid) - required for screening */
|
|
278
756
|
contextId?: string;
|
|
279
757
|
/** Unity API base URL - defaults to https://api.glydeunity.com */
|
|
@@ -281,15 +759,26 @@ export declare interface GlydeVoiceConfig {
|
|
|
281
759
|
/** DOM element to render the widget UI (optional) */
|
|
282
760
|
container?: HTMLElement | string;
|
|
283
761
|
/** Event callback for voice agent events */
|
|
284
|
-
onEvent?: (event:
|
|
762
|
+
onEvent?: (event: VoiceEvent_2) => void;
|
|
285
763
|
/** Transcript callback for conversation text */
|
|
286
764
|
onTranscript?: (text: string, role: 'user' | 'agent') => void;
|
|
287
765
|
/** Override system prompt (skips config fetch) */
|
|
288
766
|
systemPrompt?: string;
|
|
289
767
|
/** Override Deepgram configuration */
|
|
290
|
-
deepgramConfig?:
|
|
768
|
+
deepgramConfig?: DeepgramAgentConfig_2;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
declare interface IconProps {
|
|
772
|
+
size?: number;
|
|
773
|
+
color?: string;
|
|
774
|
+
className?: string;
|
|
291
775
|
}
|
|
292
776
|
|
|
777
|
+
/**
|
|
778
|
+
* Inject global styles into the document
|
|
779
|
+
*/
|
|
780
|
+
export declare function injectGlobalStyles(theme?: 'light' | 'dark'): void;
|
|
781
|
+
|
|
293
782
|
/**
|
|
294
783
|
* Job opportunity result from search
|
|
295
784
|
*/
|
|
@@ -304,6 +793,11 @@ export declare interface JobOpportunity {
|
|
|
304
793
|
match_score?: number;
|
|
305
794
|
}
|
|
306
795
|
|
|
796
|
+
/**
|
|
797
|
+
* Loader / spinner icon
|
|
798
|
+
*/
|
|
799
|
+
export declare const LoaderIcon: default_2.FC<IconProps>;
|
|
800
|
+
|
|
307
801
|
/**
|
|
308
802
|
* MCP Tool definition for voice agent
|
|
309
803
|
*/
|
|
@@ -313,6 +807,306 @@ export declare interface MCPTool {
|
|
|
313
807
|
inputSchema?: unknown;
|
|
314
808
|
}
|
|
315
809
|
|
|
810
|
+
/**
|
|
811
|
+
* MCP Tool definition for voice agent
|
|
812
|
+
*/
|
|
813
|
+
declare interface MCPTool_2 {
|
|
814
|
+
name: string;
|
|
815
|
+
description: string;
|
|
816
|
+
inputSchema?: unknown;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* Message / chat icon
|
|
821
|
+
*/
|
|
822
|
+
export declare const MessageIcon: default_2.FC<IconProps>;
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Microphone icon
|
|
826
|
+
*/
|
|
827
|
+
export declare const MicIcon: default_2.FC<IconProps>;
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Microphone off / muted icon
|
|
831
|
+
*/
|
|
832
|
+
export declare const MicOffIcon: default_2.FC<IconProps>;
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Minimize icon
|
|
836
|
+
*/
|
|
837
|
+
export declare const MinimizeIcon: default_2.FC<IconProps>;
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* Phone icon
|
|
841
|
+
*/
|
|
842
|
+
export declare const PhoneIcon: default_2.FC<IconProps>;
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Phone off / end call icon
|
|
846
|
+
*/
|
|
847
|
+
export declare const PhoneOffIcon: default_2.FC<IconProps>;
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Send icon
|
|
851
|
+
*/
|
|
852
|
+
export declare const SendIcon: default_2.FC<IconProps>;
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* TextChat Component
|
|
856
|
+
*
|
|
857
|
+
* Provides a complete text chat interface with:
|
|
858
|
+
* - Message history display
|
|
859
|
+
* - Text input with send button
|
|
860
|
+
* - Loading indicators
|
|
861
|
+
* - Auto-scroll to latest messages
|
|
862
|
+
*/
|
|
863
|
+
export declare const TextChat: default_2.FC<TextChatProps>;
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Text chat events emitted by the text chat client
|
|
867
|
+
*/
|
|
868
|
+
export declare interface TextChatEvent {
|
|
869
|
+
type: 'message' | 'typing' | 'error' | 'ready' | 'history_loaded';
|
|
870
|
+
payload?: unknown;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* TextChat component props
|
|
875
|
+
*/
|
|
876
|
+
export declare interface TextChatProps {
|
|
877
|
+
/** Application UUID (context ID for screening) */
|
|
878
|
+
contextId: string;
|
|
879
|
+
/** Publishable key for authentication */
|
|
880
|
+
publishableKey?: string;
|
|
881
|
+
/** API key for authentication */
|
|
882
|
+
apiKey?: string;
|
|
883
|
+
/** JWT auth token for GLYDEBuddy passthrough */
|
|
884
|
+
authToken?: string;
|
|
885
|
+
/** Unity API URL */
|
|
886
|
+
unityApiUrl?: string;
|
|
887
|
+
/** Fixed height for the component */
|
|
888
|
+
height?: string | number;
|
|
889
|
+
/** Header title */
|
|
890
|
+
title?: string;
|
|
891
|
+
/** Placeholder text for input */
|
|
892
|
+
placeholder?: string;
|
|
893
|
+
/** Auto-initialize chat on mount */
|
|
894
|
+
autoInit?: boolean;
|
|
895
|
+
/** Callback when message is sent */
|
|
896
|
+
onMessage?: (message: ChatMessage) => void;
|
|
897
|
+
/** Callback when error occurs */
|
|
898
|
+
onError?: (error: Error) => void;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* Text chat status
|
|
903
|
+
*/
|
|
904
|
+
export declare type TextChatStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* Theme color definitions
|
|
908
|
+
*/
|
|
909
|
+
export declare const themeColors: {
|
|
910
|
+
light: {
|
|
911
|
+
primary: string;
|
|
912
|
+
primaryHover: string;
|
|
913
|
+
primaryLight: string;
|
|
914
|
+
primaryText: string;
|
|
915
|
+
secondary: string;
|
|
916
|
+
secondaryHover: string;
|
|
917
|
+
secondaryLight: string;
|
|
918
|
+
secondaryText: string;
|
|
919
|
+
success: string;
|
|
920
|
+
successLight: string;
|
|
921
|
+
successText: string;
|
|
922
|
+
error: string;
|
|
923
|
+
errorHover: string;
|
|
924
|
+
errorLight: string;
|
|
925
|
+
errorText: string;
|
|
926
|
+
background: string;
|
|
927
|
+
surface: string;
|
|
928
|
+
border: string;
|
|
929
|
+
borderLight: string;
|
|
930
|
+
text: string;
|
|
931
|
+
textSecondary: string;
|
|
932
|
+
textMuted: string;
|
|
933
|
+
};
|
|
934
|
+
dark: {
|
|
935
|
+
primary: string;
|
|
936
|
+
primaryHover: string;
|
|
937
|
+
primaryLight: string;
|
|
938
|
+
primaryText: string;
|
|
939
|
+
secondary: string;
|
|
940
|
+
secondaryHover: string;
|
|
941
|
+
secondaryLight: string;
|
|
942
|
+
secondaryText: string;
|
|
943
|
+
success: string;
|
|
944
|
+
successLight: string;
|
|
945
|
+
successText: string;
|
|
946
|
+
error: string;
|
|
947
|
+
errorHover: string;
|
|
948
|
+
errorLight: string;
|
|
949
|
+
errorText: string;
|
|
950
|
+
background: string;
|
|
951
|
+
surface: string;
|
|
952
|
+
border: string;
|
|
953
|
+
borderLight: string;
|
|
954
|
+
text: string;
|
|
955
|
+
textSecondary: string;
|
|
956
|
+
textMuted: string;
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* Theme options
|
|
962
|
+
*/
|
|
963
|
+
export declare type ThemeMode = 'light' | 'dark' | 'auto';
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Transcript message from voice or text chat
|
|
967
|
+
*/
|
|
968
|
+
export declare interface Transcript {
|
|
969
|
+
role: 'user' | 'agent' | 'assistant';
|
|
970
|
+
content: string;
|
|
971
|
+
timestamp: Date;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Update theme CSS variables
|
|
976
|
+
*/
|
|
977
|
+
export declare function updateTheme(theme: 'light' | 'dark'): void;
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* User icon
|
|
981
|
+
*/
|
|
982
|
+
export declare const UserIcon: default_2.FC<IconProps>;
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* React hook for managing text chat state and lifecycle
|
|
986
|
+
*
|
|
987
|
+
* @param config - Text chat configuration
|
|
988
|
+
* @returns Text chat state and control methods
|
|
989
|
+
*/
|
|
990
|
+
export declare function useTextChat(config: UseTextChatConfig): UseTextChatReturn;
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* Text chat hook configuration
|
|
994
|
+
*/
|
|
995
|
+
export declare interface UseTextChatConfig extends Omit<GlydeTextConfig, 'onEvent' | 'onMessage' | 'onTyping'> {
|
|
996
|
+
/** Auto-initialize the chat on mount */
|
|
997
|
+
autoInit?: boolean;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* Text chat hook return value
|
|
1002
|
+
*/
|
|
1003
|
+
export declare interface UseTextChatReturn {
|
|
1004
|
+
/** Current status of the text chat */
|
|
1005
|
+
status: TextChatStatus;
|
|
1006
|
+
/** Chat message history */
|
|
1007
|
+
messages: ChatMessage[];
|
|
1008
|
+
/** Whether the agent is typing/processing */
|
|
1009
|
+
isLoading: boolean;
|
|
1010
|
+
/** Error message if status is 'error' */
|
|
1011
|
+
errorMessage: string | null;
|
|
1012
|
+
/** Initialize the chat session */
|
|
1013
|
+
initialize: () => Promise<void>;
|
|
1014
|
+
/** Send a message */
|
|
1015
|
+
sendMessage: (message: string) => Promise<void>;
|
|
1016
|
+
/** Clear local message history */
|
|
1017
|
+
clearHistory: () => void;
|
|
1018
|
+
/** The underlying GlydeText instance */
|
|
1019
|
+
textChat: GlydeText | null;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
/**
|
|
1023
|
+
* React hook for managing voice agent state and lifecycle
|
|
1024
|
+
*
|
|
1025
|
+
* @param config - Voice agent configuration
|
|
1026
|
+
* @returns Voice agent state and control methods
|
|
1027
|
+
*/
|
|
1028
|
+
export declare function useVoiceAgent(config: UseVoiceAgentConfig): UseVoiceAgentReturn;
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* Voice agent hook configuration
|
|
1032
|
+
*/
|
|
1033
|
+
export declare interface UseVoiceAgentConfig extends Omit<GlydeVoiceConfig, 'onEvent' | 'onTranscript'> {
|
|
1034
|
+
/** Auto-start the voice agent on mount */
|
|
1035
|
+
autoStart?: boolean;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
/**
|
|
1039
|
+
* Voice agent hook return value
|
|
1040
|
+
*/
|
|
1041
|
+
export declare interface UseVoiceAgentReturn {
|
|
1042
|
+
/** Current status of the voice agent */
|
|
1043
|
+
status: VoiceAgentStatus;
|
|
1044
|
+
/** Conversation transcripts */
|
|
1045
|
+
transcripts: Transcript[];
|
|
1046
|
+
/** Whether the user is currently speaking */
|
|
1047
|
+
isUserSpeaking: boolean;
|
|
1048
|
+
/** Whether the agent is currently speaking */
|
|
1049
|
+
isAgentSpeaking: boolean;
|
|
1050
|
+
/** Whether the microphone is muted */
|
|
1051
|
+
isMuted: boolean;
|
|
1052
|
+
/** Error message if status is 'error' */
|
|
1053
|
+
errorMessage: string | null;
|
|
1054
|
+
/** Start the voice session */
|
|
1055
|
+
start: () => Promise<void>;
|
|
1056
|
+
/** Stop the voice session */
|
|
1057
|
+
stop: () => void;
|
|
1058
|
+
/** Toggle mute state */
|
|
1059
|
+
toggleMute: () => void;
|
|
1060
|
+
/** Set mute state */
|
|
1061
|
+
setMuted: (muted: boolean) => void;
|
|
1062
|
+
/** Clear transcripts */
|
|
1063
|
+
clearTranscripts: () => void;
|
|
1064
|
+
/** The underlying GlydeVoice instance */
|
|
1065
|
+
voiceAgent: GlydeVoice | null;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* Voice agent status
|
|
1070
|
+
*/
|
|
1071
|
+
export declare type VoiceAgentStatus = 'idle' | 'connecting' | 'active' | 'error';
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* VoiceChat Component
|
|
1075
|
+
*
|
|
1076
|
+
* Provides a complete voice chat interface with:
|
|
1077
|
+
* - Start/stop call controls
|
|
1078
|
+
* - Real-time transcript display
|
|
1079
|
+
* - Speaking indicators (user and agent)
|
|
1080
|
+
* - Mute/unmute toggle
|
|
1081
|
+
*/
|
|
1082
|
+
export declare const VoiceChat: default_2.FC<VoiceChatProps>;
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* VoiceChat component props
|
|
1086
|
+
*/
|
|
1087
|
+
export declare interface VoiceChatProps {
|
|
1088
|
+
/** Application UUID (context ID for screening) */
|
|
1089
|
+
contextId: string;
|
|
1090
|
+
/** Publishable key for authentication */
|
|
1091
|
+
publishableKey?: string;
|
|
1092
|
+
/** API key for authentication */
|
|
1093
|
+
apiKey?: string;
|
|
1094
|
+
/** JWT auth token for GLYDEBuddy passthrough */
|
|
1095
|
+
authToken?: string;
|
|
1096
|
+
/** Unity API URL */
|
|
1097
|
+
unityApiUrl?: string;
|
|
1098
|
+
/** Voice context type */
|
|
1099
|
+
contextType?: VoiceContextType;
|
|
1100
|
+
/** Fixed height for the component */
|
|
1101
|
+
height?: string | number;
|
|
1102
|
+
/** Callback when transcript is added */
|
|
1103
|
+
onTranscript?: (text: string, role: 'user' | 'agent') => void;
|
|
1104
|
+
/** Callback when call ends */
|
|
1105
|
+
onCallEnd?: () => void;
|
|
1106
|
+
/** Callback when error occurs */
|
|
1107
|
+
onError?: (error: Error) => void;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
316
1110
|
/**
|
|
317
1111
|
* Voice configuration response from Unity API
|
|
318
1112
|
*/
|
|
@@ -326,6 +1120,24 @@ export declare interface VoiceConfig {
|
|
|
326
1120
|
};
|
|
327
1121
|
}
|
|
328
1122
|
|
|
1123
|
+
/**
|
|
1124
|
+
* Voice configuration response from Unity API
|
|
1125
|
+
*/
|
|
1126
|
+
declare interface VoiceConfig_2 {
|
|
1127
|
+
system_prompt: string;
|
|
1128
|
+
available_tools: MCPTool_2[];
|
|
1129
|
+
deepgram_config: DeepgramAgentConfig_2;
|
|
1130
|
+
context: {
|
|
1131
|
+
type: VoiceContextType_2;
|
|
1132
|
+
id: string | null;
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Voice context types supported by the voice agent
|
|
1138
|
+
*/
|
|
1139
|
+
export declare type VoiceContextType = 'screening' | 'recruiter' | 'custom' | 'phone';
|
|
1140
|
+
|
|
329
1141
|
/**
|
|
330
1142
|
* GlydeVoice SDK - Voice Agent Client for GLYDE Unity
|
|
331
1143
|
*
|
|
@@ -350,7 +1162,7 @@ export declare interface VoiceConfig {
|
|
|
350
1162
|
/**
|
|
351
1163
|
* Voice context types supported by the voice agent
|
|
352
1164
|
*/
|
|
353
|
-
|
|
1165
|
+
declare type VoiceContextType_2 = 'screening' | 'recruiter' | 'custom' | 'phone';
|
|
354
1166
|
|
|
355
1167
|
/**
|
|
356
1168
|
* Voice events emitted by the agent
|
|
@@ -360,4 +1172,27 @@ export declare interface VoiceEvent {
|
|
|
360
1172
|
payload?: unknown;
|
|
361
1173
|
}
|
|
362
1174
|
|
|
1175
|
+
/**
|
|
1176
|
+
* Voice events emitted by the agent
|
|
1177
|
+
*/
|
|
1178
|
+
declare interface VoiceEvent_2 {
|
|
1179
|
+
type: 'open' | 'close' | 'error' | 'ready' | 'user_speaking' | 'agent_speaking' | 'microphone_ready' | 'transcript' | 'agent_audio';
|
|
1180
|
+
payload?: unknown;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* Volume X / muted speaker icon
|
|
1185
|
+
*/
|
|
1186
|
+
export declare const VolumeXIcon: default_2.FC<IconProps>;
|
|
1187
|
+
|
|
1188
|
+
/**
|
|
1189
|
+
* Widget position options
|
|
1190
|
+
*/
|
|
1191
|
+
export declare type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* X / close icon
|
|
1195
|
+
*/
|
|
1196
|
+
export declare const XIcon: default_2.FC<IconProps>;
|
|
1197
|
+
|
|
363
1198
|
export { }
|