@hamsa-ai/voice-agents-sdk 0.4.2 → 0.4.3-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hamsa-ai/voice-agents-sdk",
3
- "version": "0.4.2",
3
+ "version": "0.4.3-beta.2",
4
4
  "description": "Hamsa AI - Voice Agents JavaScript SDK",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -188,6 +188,8 @@ export declare class LiveKitConnection extends EventEmitter {
188
188
  private reconnectionAttempts;
189
189
  /** Whether we've already emitted a 'connected' event for the current session */
190
190
  private hasEmittedConnected;
191
+ /** Enable debug logging for troubleshooting */
192
+ private readonly debug;
191
193
  /**
192
194
  * Creates a new LiveKitConnection instance
193
195
  *
@@ -197,19 +199,21 @@ export declare class LiveKitConnection extends EventEmitter {
197
199
  *
198
200
  * @param lkUrl - LiveKit WebSocket URL (e.g., 'wss://livekit.example.com')
199
201
  * @param accessToken - JWT token for room authentication and authorization
202
+ * @param debug - Enable debug logging (defaults to false)
200
203
  *
201
204
  * @example
202
205
  * ```typescript
203
206
  * const connection = new LiveKitConnection(
204
207
  * 'wss://rtc.eu.tryhamsa.com',
205
- * 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
208
+ * 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
209
+ * false
206
210
  * );
207
211
  *
208
212
  * // Connection is ready for use
209
213
  * await connection.connect();
210
214
  * ```
211
215
  */
212
- constructor(lkUrl: string, accessToken: string);
216
+ constructor(lkUrl: string, accessToken: string, debug?: boolean);
213
217
  /**
214
218
  * Provides access to the underlying LiveKit room instance
215
219
  *
@@ -83,7 +83,7 @@ export default class LiveKitManager extends EventEmitter {
83
83
  * );
84
84
  * ```
85
85
  */
86
- constructor(lkUrl: string, accessToken: string, tools?: Tool[]);
86
+ constructor(lkUrl: string, accessToken: string, tools?: Tool[], debug?: boolean);
87
87
  /**
88
88
  * Establishes connection to the LiveKit room and initializes voice agent communication
89
89
  *
package/types/main.d.ts CHANGED
@@ -21,6 +21,8 @@ type HamsaVoiceAgentConfig = {
21
21
  API_URL?: string;
22
22
  /** LiveKit RTC WebSocket URL. Defaults to 'wss://rtc.eu.tryhamsa.com' */
23
23
  LIVEKIT_URL?: string;
24
+ /** Enable debug logging for troubleshooting. Defaults to false */
25
+ debug?: boolean;
24
26
  };
25
27
  /**
26
28
  * Configuration options for starting a voice agent conversation
@@ -302,8 +304,6 @@ declare class HamsaVoiceAgent extends EventEmitter {
302
304
  private static readonly DEFAULT_OUTPUT_VOLUME;
303
305
  /** Default fallback input volume when not connected */
304
306
  private static readonly DEFAULT_INPUT_VOLUME;
305
- /** Delay in milliseconds before auto-disconnect when agent leaves (allows LiveKit cleanup) */
306
- private static readonly AGENT_DISCONNECT_DELAY_MS;
307
307
  /** Internal LiveKit manager instance for WebRTC communication */
308
308
  liveKitManager: LiveKitManager | null;
309
309
  /** Hamsa API key for authentication */
@@ -312,6 +312,8 @@ declare class HamsaVoiceAgent extends EventEmitter {
312
312
  API_URL: string;
313
313
  /** LiveKit RTC WebSocket URL */
314
314
  LIVEKIT_URL: string;
315
+ /** Enable debug logging for troubleshooting */
316
+ debug: boolean;
315
317
  /** Job ID for tracking conversation completion status */
316
318
  jobId: string | null;
317
319
  /** Screen wake lock manager to prevent device sleep during calls */
@@ -340,7 +342,7 @@ declare class HamsaVoiceAgent extends EventEmitter {
340
342
  *
341
343
  * @throws {Error} If apiKey is not provided or invalid
342
344
  */
343
- constructor(apiKey: string, { API_URL, LIVEKIT_URL, }?: HamsaVoiceAgentConfig);
345
+ constructor(apiKey: string, { API_URL, LIVEKIT_URL, debug, }?: HamsaVoiceAgentConfig);
344
346
  /**
345
347
  * Adjusts the volume level for voice agent audio playback
346
348
  *