@hamsa-ai/voice-agents-sdk 0.4.1-beta.2 → 0.4.1-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 +52 -0
- 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/classes/livekit-manager.d.ts +1 -1
- package/types/classes/types.d.ts +5 -0
- package/types/main.d.ts +4 -1
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@ import { LiveKitAudioManager } from './livekit-audio-manager';
|
|
|
38
38
|
import { LiveKitConnection } from './livekit-connection';
|
|
39
39
|
import { LiveKitToolRegistry } from './livekit-tool-registry';
|
|
40
40
|
import type { AudioLevelsResult, CallAnalyticsResult, ConnectionStatsResult, ParticipantData, PerformanceMetricsResult, Tool, TrackStatsResult } from './types';
|
|
41
|
-
export type { AudioLevelsResult, CallAnalyticsResult, ConnectionStatsResult, ParticipantData, PerformanceMetricsResult, TrackStatsData, TrackStatsResult, } from './types';
|
|
41
|
+
export type { AgentState, AudioLevelsResult, CallAnalyticsResult, ConnectionStatsResult, ParticipantData, PerformanceMetricsResult, TrackStatsData, TrackStatsResult, } from './types';
|
|
42
42
|
/**
|
|
43
43
|
* Main LiveKitManager class that orchestrates voice agent communication
|
|
44
44
|
*
|
package/types/classes/types.d.ts
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Shared types and interfaces for LiveKit modules
|
|
3
3
|
*/
|
|
4
4
|
import type { ConnectionQuality, RemoteTrack, RemoteTrackPublication } from 'livekit-client';
|
|
5
|
+
/**
|
|
6
|
+
* Agent state as defined by LiveKit
|
|
7
|
+
* Represents the current state of the voice agent
|
|
8
|
+
*/
|
|
9
|
+
export type AgentState = 'idle' | 'initializing' | 'listening' | 'thinking' | 'speaking';
|
|
5
10
|
/**
|
|
6
11
|
* Function signature for client-side tools that can be executed by the agent.
|
|
7
12
|
* Tools can be synchronous or asynchronous and accept variable arguments.
|
package/types/main.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
import type { ConnectionState, LocalTrack, LocalTrackPublication, Participant, RemoteParticipant, RemoteTrack, RemoteTrackPublication, Room } from 'livekit-client';
|
|
3
|
-
import LiveKitManager, { type AudioLevelsResult, type CallAnalyticsResult, type ConnectionStatsResult, type ParticipantData, type PerformanceMetricsResult, type TrackStatsResult } from './classes/livekit-manager';
|
|
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
|
+
export type { AgentState } from './classes/livekit-manager';
|
|
5
6
|
/**
|
|
6
7
|
* Custom error class that includes both human-readable message and machine-readable messageKey
|
|
7
8
|
* for internationalization and programmatic error handling
|
|
@@ -143,6 +144,8 @@ type HamsaVoiceAgentEvents = {
|
|
|
143
144
|
speaking: () => void;
|
|
144
145
|
/** Emitted when agent is listening */
|
|
145
146
|
listening: () => void;
|
|
147
|
+
/** Emitted when agent state changes (idle, initializing, listening, thinking, speaking) */
|
|
148
|
+
agentStateChanged: (state: AgentState) => void;
|
|
146
149
|
/** Emitted when an error occurs */
|
|
147
150
|
error: (error: Error | HamsaApiError) => void;
|
|
148
151
|
/** Emitted when a remote track is subscribed */
|