@hamsa-ai/voice-agents-sdk 0.4.0-beta.1 → 0.4.0-beta.3
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 +351 -123
- package/dist/index.cjs.js +2 -1
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +2 -1
- package/dist/index.umd.js.map +1 -0
- package/package.json +22 -13
- package/types/classes/livekit-analytics.d.ts +370 -0
- package/types/classes/livekit-audio-manager.d.ts +738 -0
- package/types/classes/livekit-connection.d.ts +318 -0
- package/types/classes/livekit-manager.d.ts +527 -0
- package/types/classes/livekit-tool-registry.d.ts +607 -0
- package/types/classes/{screen_wake_lock.d.ts → screen-wake-lock.d.ts} +4 -4
- package/types/classes/types.d.ts +325 -0
- package/types/main.d.ts +679 -56
- package/types/classes/livekit_manager.d.ts +0 -118
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LiveKitManager encapsulates all direct interactions with the livekit-client SDK
|
|
3
|
-
* and replaces the WebSocketManager functionality.
|
|
4
|
-
*/
|
|
5
|
-
export default class LiveKitManager extends EventEmitter<[never]> {
|
|
6
|
-
/**
|
|
7
|
-
* Creates a new LiveKitManager instance.
|
|
8
|
-
* @param {string} lkUrl - The LiveKit WebSocket URL
|
|
9
|
-
* @param {string} accessToken - The LiveKit access token
|
|
10
|
-
* @param {Array} tools - Array of tools/functions to be used
|
|
11
|
-
*/
|
|
12
|
-
constructor(lkUrl: string, accessToken: string, tools?: any[]);
|
|
13
|
-
lkUrl: string;
|
|
14
|
-
accessToken: string;
|
|
15
|
-
tools: any[];
|
|
16
|
-
room: Room;
|
|
17
|
-
isConnected: boolean;
|
|
18
|
-
volume: number;
|
|
19
|
-
audioElements: Set<any>;
|
|
20
|
-
isPaused: boolean;
|
|
21
|
-
callStartTime: number;
|
|
22
|
-
callStats: {
|
|
23
|
-
connectionAttempts: number;
|
|
24
|
-
reconnectionAttempts: number;
|
|
25
|
-
totalBytesReceived: number;
|
|
26
|
-
totalBytesSent: number;
|
|
27
|
-
packetsLost: number;
|
|
28
|
-
participantCount: number;
|
|
29
|
-
trackCount: number;
|
|
30
|
-
audioLevels: any[];
|
|
31
|
-
connectionQuality: string;
|
|
32
|
-
};
|
|
33
|
-
participants: Map<any, any>;
|
|
34
|
-
trackStats: Map<any, any>;
|
|
35
|
-
connectionMetrics: {
|
|
36
|
-
latency: number;
|
|
37
|
-
packetLoss: number;
|
|
38
|
-
bandwidth: number;
|
|
39
|
-
quality: string;
|
|
40
|
-
jitter: number;
|
|
41
|
-
};
|
|
42
|
-
audioMetrics: {
|
|
43
|
-
userAudioLevel: number;
|
|
44
|
-
agentAudioLevel: number;
|
|
45
|
-
userSpeakingTime: number;
|
|
46
|
-
agentSpeakingTime: number;
|
|
47
|
-
audioDropouts: number;
|
|
48
|
-
echoCancellationActive: boolean;
|
|
49
|
-
};
|
|
50
|
-
performanceMetrics: {
|
|
51
|
-
responseTime: number;
|
|
52
|
-
networkLatency: number;
|
|
53
|
-
connectionEstablishedTime: number;
|
|
54
|
-
reconnectionCount: number;
|
|
55
|
-
};
|
|
56
|
-
analyticsInterval: NodeJS.Timeout;
|
|
57
|
-
/**
|
|
58
|
-
* Connects to the LiveKit room.
|
|
59
|
-
* @returns {Promise<void>}
|
|
60
|
-
*/
|
|
61
|
-
connect(): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* Disconnects from the LiveKit room.
|
|
64
|
-
* @returns {Promise<void>}
|
|
65
|
-
*/
|
|
66
|
-
disconnect(): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Pauses the call by muting local microphone and pausing remote audio.
|
|
69
|
-
*/
|
|
70
|
-
pause(): void;
|
|
71
|
-
/**
|
|
72
|
-
* Resumes the call by unmuting local microphone and resuming remote audio.
|
|
73
|
-
*/
|
|
74
|
-
resume(): void;
|
|
75
|
-
/**
|
|
76
|
-
* Sets the volume for all audio elements.
|
|
77
|
-
* @param {number} volume - Volume level between 0.0 and 1.0
|
|
78
|
-
*/
|
|
79
|
-
setVolume(volume: number): void;
|
|
80
|
-
/**
|
|
81
|
-
* Registers client-side tools as RPC methods.
|
|
82
|
-
* @param {Array} tools - Array of tool objects
|
|
83
|
-
*/
|
|
84
|
-
registerTools(tools: any[]): void;
|
|
85
|
-
/**
|
|
86
|
-
* Gets current connection statistics.
|
|
87
|
-
* @returns {Object} Connection statistics
|
|
88
|
-
*/
|
|
89
|
-
getConnectionStats(): any;
|
|
90
|
-
/**
|
|
91
|
-
* Gets current audio levels and metrics.
|
|
92
|
-
* @returns {Object} Audio metrics
|
|
93
|
-
*/
|
|
94
|
-
getAudioLevels(): any;
|
|
95
|
-
/**
|
|
96
|
-
* Gets current performance metrics.
|
|
97
|
-
* @returns {Object} Performance metrics
|
|
98
|
-
*/
|
|
99
|
-
getPerformanceMetrics(): any;
|
|
100
|
-
/**
|
|
101
|
-
* Gets current participant information.
|
|
102
|
-
* @returns {Array} Array of participant data
|
|
103
|
-
*/
|
|
104
|
-
getParticipants(): any[];
|
|
105
|
-
/**
|
|
106
|
-
* Gets current track statistics.
|
|
107
|
-
* @returns {Object} Track statistics
|
|
108
|
-
*/
|
|
109
|
-
getTrackStats(): any;
|
|
110
|
-
/**
|
|
111
|
-
* Gets comprehensive call analytics.
|
|
112
|
-
* @returns {Object} Complete analytics data
|
|
113
|
-
*/
|
|
114
|
-
getCallAnalytics(): any;
|
|
115
|
-
#private;
|
|
116
|
-
}
|
|
117
|
-
import { EventEmitter } from "events";
|
|
118
|
-
import { Room } from "livekit-client";
|