@elevenlabs/react-native 0.3.0 → 0.3.1

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/src/types.ts CHANGED
@@ -134,6 +134,7 @@ export type AgentResponseCorrectionEvent = {
134
134
  corrected_agent_response: string;
135
135
  };
136
136
  };
137
+
137
138
  export type AgentAudioEvent = {
138
139
  type: "audio";
139
140
  audio_event: {
@@ -225,6 +226,13 @@ export type MCPToolApprovalResultEvent = {
225
226
  is_approved: boolean;
226
227
  };
227
228
 
229
+ export type VadScoreEvent = {
230
+ type: "vad_score";
231
+ vad_score_event: {
232
+ vad_score: number;
233
+ };
234
+ };
235
+
228
236
  export type InitiationClientDataEvent = {
229
237
  type: "conversation_initiation_client_data";
230
238
  conversation_config_override?: {
@@ -251,6 +259,49 @@ export type InitiationClientDataEvent = {
251
259
  user_id?: string;
252
260
  };
253
261
 
262
+ interface BaseMCPToolCallClientEventData {
263
+ service_id: string;
264
+ tool_call_id: string;
265
+ tool_name: string;
266
+ tool_description?: string;
267
+ parameters: Record<string, any>;
268
+ timestamp: string; // ISO string format
269
+ }
270
+
271
+ interface MCPToolCallClientEventLoadingData
272
+ extends BaseMCPToolCallClientEventData {
273
+ state: "loading";
274
+ }
275
+
276
+ interface MCPToolCallClientEventAwaitingApprovalData
277
+ extends BaseMCPToolCallClientEventData {
278
+ state: "awaiting_approval";
279
+ approval_timeout_secs: number;
280
+ }
281
+
282
+ interface MCPToolCallClientEventSuccessData
283
+ extends BaseMCPToolCallClientEventData {
284
+ state: "success";
285
+ result: any[];
286
+ }
287
+
288
+ interface MCPToolCallClientEventFailureData
289
+ extends BaseMCPToolCallClientEventData {
290
+ state: "failure";
291
+ error_message: string;
292
+ }
293
+
294
+ type MCPToolCallClientEventData =
295
+ | MCPToolCallClientEventLoadingData
296
+ | MCPToolCallClientEventAwaitingApprovalData
297
+ | MCPToolCallClientEventSuccessData
298
+ | MCPToolCallClientEventFailureData;
299
+
300
+ export type MCPToolCallClientEvent = {
301
+ type: "mcp_tool_call";
302
+ mcp_tool_call: MCPToolCallClientEventData;
303
+ };
304
+
254
305
  export type ConversationEvent =
255
306
  | UserTranscriptionEvent
256
307
  | AgentResponseEvent
@@ -260,4 +311,6 @@ export type ConversationEvent =
260
311
  | InternalTentativeAgentResponseEvent
261
312
  | ConfigEvent
262
313
  | PingEvent
263
- | ClientToolCallEvent;
314
+ | ClientToolCallEvent
315
+ | VadScoreEvent
316
+ | MCPToolCallClientEvent;
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // This file is auto-generated during build
2
- export const PACKAGE_VERSION = "0.3.0";
2
+ export const PACKAGE_VERSION = "0.3.1";