@voice-ai-labs/web-sdk 0.6.0 → 0.8.0

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.js CHANGED
@@ -27625,6 +27625,14 @@ class AgentClient extends BaseClient {
27625
27625
  async getStatus(agentId) {
27626
27626
  return super.get(`/connection/agent-status/${encodeURIComponent(agentId)}`);
27627
27627
  }
27628
+ /**
27629
+ * Create an outbound call for an agent.
27630
+ *
27631
+ * Requires backend-side credentials (service token or dev API key).
27632
+ */
27633
+ async createOutboundCall(options) {
27634
+ return this.post('/calls/outbound', options);
27635
+ }
27628
27636
  /**
27629
27637
  * Assign a knowledge base to an agent for RAG
27630
27638
  *
@@ -27718,19 +27726,19 @@ class AnalyticsClient extends BaseClient {
27718
27726
  /**
27719
27727
  * Get transcript download URL for a call
27720
27728
  *
27721
- * @param summaryId - The call summary ID
27729
+ * @param callId - The call identifier
27722
27730
  * @returns Object with transcript URL
27723
27731
  *
27724
27732
  * @example
27725
27733
  * ```typescript
27726
- * const { url } = await client.analytics.getTranscriptUrl(12345);
27734
+ * const { url } = await client.analytics.getTranscriptUrl("call_12345");
27727
27735
  *
27728
27736
  * // Download transcript
27729
27737
  * window.open(url, '_blank');
27730
27738
  * ```
27731
27739
  */
27732
- async getTranscriptUrl(summaryId) {
27733
- return this.get(`/agent/call-history/${summaryId}/transcript`);
27740
+ async getTranscriptUrl(callId) {
27741
+ return this.get(`/agent/call-history/${callId}/transcript`);
27734
27742
  }
27735
27743
  /**
27736
27744
  * Get agent stats summary
@@ -29175,19 +29183,23 @@ class VoiceAI {
29175
29183
  ? '/connection/test-connection-details'
29176
29184
  : '/connection/connection-details';
29177
29185
  const endpoint = `${url}${endpointPath}`;
29186
+ if (options.agentId && options.agentConfig) {
29187
+ throw new Error('agentId and agentConfig cannot be used together. Use agentId for a saved agent, or agentConfig for an inline agent configuration.');
29188
+ }
29189
+ if (options.agentConfig && options.agentOverrides) {
29190
+ throw new Error('agentConfig and agentOverrides cannot be used together. Use agentOverrides only with agentId.');
29191
+ }
29178
29192
  const requestData = {};
29179
29193
  if (options.agentId)
29180
29194
  requestData.agent_id = options.agentId;
29181
29195
  if (options.agentConfig) {
29182
- requestData.metadata = JSON.stringify(options.agentConfig);
29196
+ requestData.agent_config = options.agentConfig;
29183
29197
  }
29184
- else if (options.metadata) {
29185
- requestData.metadata = options.metadata;
29198
+ if (options.agentOverrides) {
29199
+ requestData.agent_overrides = options.agentOverrides;
29186
29200
  }
29187
- if (options.environment) {
29188
- requestData.environment = typeof options.environment === 'string'
29189
- ? options.environment
29190
- : JSON.stringify(options.environment);
29201
+ if (options.dynamicVariables) {
29202
+ requestData.dynamic_variables = options.dynamicVariables;
29191
29203
  }
29192
29204
  const apiKey = options.apiKey || this.apiKey;
29193
29205
  this.effectiveApiKey = apiKey;