@hamsa-ai/voice-agents-sdk 0.4.5-beta.1 → 0.4.5
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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/main.d.ts +9 -15
package/package.json
CHANGED
package/types/main.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import type { ConnectionState, LocalTrack, LocalTrackPublication, Participant, RemoteParticipant, RemoteTrack,
|
|
2
|
+
import type { ConnectionState, LocalTrack, LocalTrackPublication, Participant, RemoteParticipant, RemoteTrack, Room } from 'livekit-client';
|
|
3
3
|
import LiveKitManager, { type AgentState, type AudioLevelsResult, type CallAnalyticsResult, type ConnectionStatsResult, type ParticipantData, type PerformanceMetricsResult, type TrackStatsResult } from './classes/livekit-manager';
|
|
4
4
|
import ScreenWakeLock from './classes/screen-wake-lock';
|
|
5
|
+
import type { ConnectionQualityData, TrackSubscriptionData, TrackUnsubscriptionData } from './classes/types';
|
|
5
6
|
export type { AgentState } from './classes/livekit-manager';
|
|
6
7
|
/**
|
|
7
8
|
* Custom error class that includes both human-readable message and machine-readable messageKey
|
|
@@ -153,17 +154,9 @@ type HamsaVoiceAgentEvents = {
|
|
|
153
154
|
/** Emitted when an error occurs */
|
|
154
155
|
error: (error: Error | HamsaApiError) => void;
|
|
155
156
|
/** Emitted when a remote track is subscribed */
|
|
156
|
-
trackSubscribed: (data:
|
|
157
|
-
track: RemoteTrack;
|
|
158
|
-
publication: RemoteTrackPublication;
|
|
159
|
-
participant: RemoteParticipant;
|
|
160
|
-
}) => void;
|
|
157
|
+
trackSubscribed: (data: TrackSubscriptionData) => void;
|
|
161
158
|
/** Emitted when a remote track is unsubscribed */
|
|
162
|
-
trackUnsubscribed: (data:
|
|
163
|
-
track: RemoteTrack;
|
|
164
|
-
publication: RemoteTrackPublication;
|
|
165
|
-
participant: RemoteParticipant;
|
|
166
|
-
}) => void;
|
|
159
|
+
trackUnsubscribed: (data: TrackUnsubscriptionData) => void;
|
|
167
160
|
/** Emitted when a local track is published */
|
|
168
161
|
localTrackPublished: (data: {
|
|
169
162
|
track?: LocalTrack;
|
|
@@ -172,14 +165,15 @@ type HamsaVoiceAgentEvents = {
|
|
|
172
165
|
/** Emitted when analytics data is updated */
|
|
173
166
|
analyticsUpdated: (analytics: CallAnalyticsResult) => void;
|
|
174
167
|
/** Emitted when connection quality changes */
|
|
175
|
-
connectionQualityChanged: (data:
|
|
176
|
-
quality: 'excellent' | 'good' | 'poor';
|
|
177
|
-
metrics: ConnectionStatsResult;
|
|
178
|
-
}) => void;
|
|
168
|
+
connectionQualityChanged: (data: ConnectionQualityData) => void;
|
|
179
169
|
/** Emitted when connection state changes */
|
|
180
170
|
connectionStateChanged: (state: ConnectionState) => void;
|
|
181
171
|
/** Emitted when audio playback state changes */
|
|
182
172
|
audioPlaybackChanged: (playing: boolean) => void;
|
|
173
|
+
/** Emitted when microphone is muted */
|
|
174
|
+
micMuted: () => void;
|
|
175
|
+
/** Emitted when microphone is unmuted */
|
|
176
|
+
micUnmuted: () => void;
|
|
183
177
|
/** Emitted when a participant connects */
|
|
184
178
|
participantConnected: (participant: RemoteParticipant) => void;
|
|
185
179
|
/** Emitted when a participant disconnects */
|