@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/README.md +173 -22
- package/dist/client/agents.d.ts +7 -1
- package/dist/client/agents.d.ts.map +1 -1
- package/dist/client/agents.js +8 -0
- package/dist/client/agents.js.map +1 -1
- package/dist/client/analytics.d.ts +3 -3
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +4 -4
- package/dist/client/analytics.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +23 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +23 -11
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +67 -14
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -54,8 +54,31 @@ await voiceai.connect({
|
|
|
54
54
|
|
|
55
55
|
// Test mode: preview paused agents before deploying
|
|
56
56
|
await voiceai.connect({ agentId: 'agent-123', testMode: true });
|
|
57
|
+
|
|
58
|
+
// Apply safe per-call overrides to a saved agent
|
|
59
|
+
await voiceai.connect({
|
|
60
|
+
agentId: 'agent-123',
|
|
61
|
+
agentOverrides: {
|
|
62
|
+
prompt: 'You are helping with premium support only.',
|
|
63
|
+
greeting: 'Thanks for calling premium support.',
|
|
64
|
+
},
|
|
65
|
+
});
|
|
57
66
|
```
|
|
58
67
|
|
|
68
|
+
`connect()` supports these top-level request shapes:
|
|
69
|
+
|
|
70
|
+
- `agentId` for a saved agent
|
|
71
|
+
- `agentConfig` for an inline agent configuration
|
|
72
|
+
- `agentOverrides` for safe per-call overrides on a saved agent
|
|
73
|
+
- `dynamicVariables` for optional runtime variables passed at call start
|
|
74
|
+
|
|
75
|
+
These connection shapes are mutually exclusive where noted:
|
|
76
|
+
|
|
77
|
+
- Use `agentId` with optional `agentOverrides` and `dynamicVariables` for a saved agent
|
|
78
|
+
- Use `agentConfig` with optional `dynamicVariables` for an inline agent configuration
|
|
79
|
+
- Do not combine `agentId` with `agentConfig`
|
|
80
|
+
- Do not combine `agentConfig` with `agentOverrides`
|
|
81
|
+
|
|
59
82
|
### Events
|
|
60
83
|
|
|
61
84
|
```typescript
|
|
@@ -200,8 +223,46 @@ await voiceai.agents.pause(agent.agent_id);
|
|
|
200
223
|
|
|
201
224
|
// Delete an agent
|
|
202
225
|
await voiceai.agents.disable(agent.agent_id);
|
|
226
|
+
|
|
227
|
+
// Create an outbound call (server-side only)
|
|
228
|
+
// NOTE: Outbound is restricted to approved accounts.
|
|
229
|
+
// If your account is not approved, this endpoint may return 403.
|
|
230
|
+
await voiceai.agents.createOutboundCall({
|
|
231
|
+
agent_id: agent.agent_id,
|
|
232
|
+
target_phone_number: '+15551234567',
|
|
233
|
+
dynamic_variables: { case_id: 'abc-1' }
|
|
234
|
+
});
|
|
203
235
|
```
|
|
204
236
|
|
|
237
|
+
> **Outbound access control:** `POST /api/v1/calls/outbound` is restricted to approved accounts.
|
|
238
|
+
> If you need outbound enabled for your account/workspace, please contact Voice.ai support.
|
|
239
|
+
|
|
240
|
+
### Dynamic Variables
|
|
241
|
+
|
|
242
|
+
Pass optional `dynamic_variables` at call start and reference them in your prompt with `{{variable_name}}`:
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
await voiceai.agents.update(agent.agent_id, {
|
|
246
|
+
config: {
|
|
247
|
+
allow_outbound_calling: true,
|
|
248
|
+
prompt: 'You are helping {{customer_name}} with order {{order_id}}.'
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
await voiceai.connect({
|
|
253
|
+
agentId: agent.agent_id,
|
|
254
|
+
dynamicVariables: {
|
|
255
|
+
customer_name: 'Alice',
|
|
256
|
+
order_id: '12345'
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
- `dynamic_variables` must be a flat object of string, number, or boolean values.
|
|
262
|
+
- Extra variables are allowed.
|
|
263
|
+
- Variables that are not referenced by the runtime prompt are ignored.
|
|
264
|
+
- The runtime is responsible for interpolating these variables into the prompt.
|
|
265
|
+
|
|
205
266
|
## Knowledge Base
|
|
206
267
|
|
|
207
268
|
```typescript
|
|
@@ -259,7 +320,7 @@ const history = await voiceai.analytics.getCallHistory({
|
|
|
259
320
|
});
|
|
260
321
|
|
|
261
322
|
// Get transcript URL
|
|
262
|
-
const transcript = await voiceai.analytics.getTranscriptUrl(
|
|
323
|
+
const transcript = await voiceai.analytics.getTranscriptUrl(callId);
|
|
263
324
|
|
|
264
325
|
// Get stats summary
|
|
265
326
|
const stats = await voiceai.analytics.getStatsSummary();
|
|
@@ -269,6 +330,12 @@ const stats = await voiceai.analytics.getStatsSummary();
|
|
|
269
330
|
|
|
270
331
|
Configure webhooks when creating or updating an agent.
|
|
271
332
|
|
|
333
|
+
`webhooks.events`, `webhooks.inbound_call`, and `webhooks.tools` use different contracts:
|
|
334
|
+
|
|
335
|
+
- `webhooks.events` supports `secret` (write-only on create/update) and `has_secret` (read-only on fetch).
|
|
336
|
+
- `webhooks.inbound_call` supports `secret` (write-only on create/update) and `has_secret` (read-only on fetch).
|
|
337
|
+
- `webhooks.tools` define outbound API calls and do not use `secret`.
|
|
338
|
+
|
|
272
339
|
### Configure Webhook Events and Tools
|
|
273
340
|
|
|
274
341
|
```typescript
|
|
@@ -280,11 +347,17 @@ const agent = await voiceai.agents.create({
|
|
|
280
347
|
webhooks: {
|
|
281
348
|
events: {
|
|
282
349
|
url: 'https://your-server.com/webhooks/voice-events',
|
|
283
|
-
secret: 'your-hmac-secret', //
|
|
350
|
+
secret: 'your-hmac-secret', // Event webhook signing secret
|
|
284
351
|
events: ['call.started', 'call.completed'], // Or omit for all events
|
|
285
352
|
timeout: 5,
|
|
286
353
|
enabled: true
|
|
287
354
|
},
|
|
355
|
+
inbound_call: {
|
|
356
|
+
url: 'https://your-server.com/webhooks/inbound-call',
|
|
357
|
+
secret: 'your-inbound-call-secret', // Inbound call webhook signing secret
|
|
358
|
+
timeout: 5,
|
|
359
|
+
enabled: true
|
|
360
|
+
},
|
|
288
361
|
tools: [
|
|
289
362
|
{
|
|
290
363
|
name: 'get_account_status',
|
|
@@ -293,6 +366,13 @@ const agent = await voiceai.agents.create({
|
|
|
293
366
|
parameters: {
|
|
294
367
|
customer_id: 'string'
|
|
295
368
|
},
|
|
369
|
+
method: 'POST',
|
|
370
|
+
execution_mode: 'sync',
|
|
371
|
+
auth_type: 'api_key',
|
|
372
|
+
auth_token: 'your-api-key',
|
|
373
|
+
headers: {
|
|
374
|
+
'X-Service-Version': '2026-02'
|
|
375
|
+
},
|
|
296
376
|
response: {
|
|
297
377
|
type: 'object',
|
|
298
378
|
properties: {
|
|
@@ -300,7 +380,6 @@ const agent = await voiceai.agents.create({
|
|
|
300
380
|
tier: { type: 'string' }
|
|
301
381
|
}
|
|
302
382
|
},
|
|
303
|
-
secret: 'tool-signing-secret',
|
|
304
383
|
timeout: 10
|
|
305
384
|
}
|
|
306
385
|
]
|
|
@@ -326,6 +405,12 @@ await voiceai.agents.update(agentId, {
|
|
|
326
405
|
query: 'string',
|
|
327
406
|
top_k: 'number'
|
|
328
407
|
},
|
|
408
|
+
method: 'GET',
|
|
409
|
+
execution_mode: 'async',
|
|
410
|
+
auth_type: 'custom_headers',
|
|
411
|
+
headers: {
|
|
412
|
+
'X-Internal-Token': 'your-internal-token'
|
|
413
|
+
},
|
|
329
414
|
timeout: 20
|
|
330
415
|
}
|
|
331
416
|
]
|
|
@@ -334,6 +419,20 @@ await voiceai.agents.update(agentId, {
|
|
|
334
419
|
});
|
|
335
420
|
```
|
|
336
421
|
|
|
422
|
+
### Webhook configuration requiredness
|
|
423
|
+
|
|
424
|
+
- `webhooks.events`
|
|
425
|
+
- Required: `url`
|
|
426
|
+
- Optional: `secret`, `events`, `timeout` (default `5`), `enabled` (default `true`)
|
|
427
|
+
- `webhooks.inbound_call`
|
|
428
|
+
- Required: `url`
|
|
429
|
+
- Optional: `secret`, `timeout` (default `5`), `enabled` (default `true`)
|
|
430
|
+
- `webhooks.tools`
|
|
431
|
+
- Required per tool: `name`, `description`, `parameters`, `url`, `method`, `execution_mode`, `auth_type`
|
|
432
|
+
- Optional per tool: `auth_token`, `headers`, `response`, `timeout` (default `10`)
|
|
433
|
+
|
|
434
|
+
If a field is optional and omitted, the service uses the documented default. Prefer omitting optional fields instead of sending `null` unless you explicitly intend to clear behavior in a supported way.
|
|
435
|
+
|
|
337
436
|
### Event Types
|
|
338
437
|
|
|
339
438
|
| Event | Description |
|
|
@@ -341,9 +440,9 @@ await voiceai.agents.update(agentId, {
|
|
|
341
440
|
| `call.started` | Call connected, agent ready |
|
|
342
441
|
| `call.completed` | Call ended, includes transcript and usage data |
|
|
343
442
|
|
|
344
|
-
### Webhook Payload
|
|
443
|
+
### Event Webhook Payload
|
|
345
444
|
|
|
346
|
-
Your
|
|
445
|
+
Your event webhook URL receives POST requests with this structure:
|
|
347
446
|
|
|
348
447
|
```typescript
|
|
349
448
|
interface WebhookEvent {
|
|
@@ -357,32 +456,59 @@ interface WebhookEvent {
|
|
|
357
456
|
// call.completed: duration_seconds, credits_used, transcript_uri, transcript_summary
|
|
358
457
|
};
|
|
359
458
|
}
|
|
459
|
+
```
|
|
360
460
|
|
|
361
|
-
|
|
362
|
-
event: 'function_call';
|
|
363
|
-
timestamp: string; // ISO 8601
|
|
364
|
-
call_id: string;
|
|
365
|
-
agent_id: string;
|
|
366
|
-
data: {
|
|
367
|
-
request_id: string;
|
|
368
|
-
function_name: string;
|
|
369
|
-
arguments: Record<string, unknown>;
|
|
370
|
-
};
|
|
371
|
-
}
|
|
461
|
+
### Webhook Tool Request Shape
|
|
372
462
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
463
|
+
For webhook tools, Voice.ai makes outbound HTTP requests directly to each tool `url`.
|
|
464
|
+
|
|
465
|
+
- `method: 'GET'`: tool arguments are sent as query parameters.
|
|
466
|
+
- `method: 'POST' | 'PUT' | 'PATCH' | 'DELETE'`: tool arguments are sent as JSON body.
|
|
467
|
+
- Metadata headers are always sent:
|
|
468
|
+
- `X-VoiceAI-Request-Id`
|
|
469
|
+
- `X-VoiceAI-Tool-Name`
|
|
470
|
+
- `X-VoiceAI-Agent-Id`
|
|
471
|
+
- `X-VoiceAI-Call-Id`
|
|
472
|
+
|
|
473
|
+
```http
|
|
474
|
+
GET /webhooks/tools/search-kb?query=refund+policy&top_k=3
|
|
475
|
+
X-VoiceAI-Request-Id: req_123
|
|
476
|
+
X-VoiceAI-Tool-Name: search_knowledge_base
|
|
477
|
+
X-VoiceAI-Agent-Id: agent_123
|
|
478
|
+
X-VoiceAI-Call-Id: call_123
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
```http
|
|
482
|
+
POST /webhooks/tools/account-status
|
|
483
|
+
Content-Type: application/json
|
|
484
|
+
X-VoiceAI-Request-Id: req_456
|
|
485
|
+
X-VoiceAI-Tool-Name: get_account_status
|
|
486
|
+
X-VoiceAI-Agent-Id: agent_123
|
|
487
|
+
X-VoiceAI-Call-Id: call_123
|
|
488
|
+
|
|
489
|
+
{"customer_id":"cust_789"}
|
|
376
490
|
```
|
|
377
491
|
|
|
378
|
-
###
|
|
492
|
+
### Webhook Tool Authentication
|
|
493
|
+
|
|
494
|
+
- `auth_type: 'none'`: no auth headers added.
|
|
495
|
+
- `auth_type: 'bearer_token'`: sends `Authorization: Bearer <auth_token>`.
|
|
496
|
+
- `auth_type: 'api_key'`: sends `X-API-Key: <auth_token>`.
|
|
497
|
+
- `auth_type: 'custom_headers'`: sends your configured `headers` map.
|
|
498
|
+
|
|
499
|
+
### Webhook Tool Response Behavior
|
|
379
500
|
|
|
380
|
-
|
|
501
|
+
- `execution_mode: 'sync'`: waits for downstream response body; non-2xx fails the tool call.
|
|
502
|
+
- `execution_mode: 'async'`: treats any 2xx as accepted and does not require a response payload.
|
|
503
|
+
|
|
504
|
+
### Signature Verification (Event Webhooks)
|
|
505
|
+
|
|
506
|
+
If you configure `webhooks.events.secret`, verify the HMAC-SHA256 signature:
|
|
381
507
|
|
|
382
508
|
```typescript
|
|
383
509
|
import crypto from 'crypto';
|
|
384
510
|
|
|
385
|
-
function
|
|
511
|
+
function verifyEventWebhook(body: string, headers: Headers, secret: string): boolean {
|
|
386
512
|
const signature = headers.get('x-webhook-signature');
|
|
387
513
|
const timestamp = headers.get('x-webhook-timestamp');
|
|
388
514
|
|
|
@@ -395,6 +521,31 @@ function verifyWebhook(body: string, headers: Headers, secret: string): boolean
|
|
|
395
521
|
}
|
|
396
522
|
```
|
|
397
523
|
|
|
524
|
+
### Inbound Call Webhook Payload
|
|
525
|
+
|
|
526
|
+
If you configure `webhooks.inbound_call`, Voice.ai sends inbound call personalization requests with this shape:
|
|
527
|
+
|
|
528
|
+
```typescript
|
|
529
|
+
interface InboundCallWebhookRequest {
|
|
530
|
+
agent_id: string;
|
|
531
|
+
call_id: string;
|
|
532
|
+
from_number: string;
|
|
533
|
+
to_number: string;
|
|
534
|
+
}
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
Your endpoint should respond with:
|
|
538
|
+
|
|
539
|
+
```typescript
|
|
540
|
+
interface InboundCallWebhookResponse {
|
|
541
|
+
dynamic_variables?: Record<string, string | number | boolean>;
|
|
542
|
+
agent_overrides?: Record<string, unknown>;
|
|
543
|
+
}
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
If you configure `webhooks.inbound_call.secret`, verify the HMAC-SHA256 signature using the same
|
|
547
|
+
`X-Webhook-Timestamp` and `X-Webhook-Signature` headers shown above for event webhooks.
|
|
548
|
+
|
|
398
549
|
## Security
|
|
399
550
|
|
|
400
551
|
`connect()` fetches connection details and connects in one call. To keep your API key off the browser, split into two steps:
|
package/dist/client/agents.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Managing agent knowledge bases
|
|
9
9
|
*/
|
|
10
10
|
import { BaseClient, BaseClientConfig } from './base';
|
|
11
|
-
import type { Agent, CreateAgentRequest, UpdateAgentRequest, AgentDeployResponse, AgentPauseResponse, AgentDeleteResponse, AgentConnectionStatusResponse, InitAgentRequest, InitAgentResponse, PaginatedAgentResponse, ListAgentsOptions } from '../types';
|
|
11
|
+
import type { Agent, CreateAgentRequest, UpdateAgentRequest, AgentDeployResponse, AgentPauseResponse, AgentDeleteResponse, AgentConnectionStatusResponse, InitAgentRequest, InitAgentResponse, PaginatedAgentResponse, ListAgentsOptions, CreateOutboundCallRequest, CreateOutboundCallResponse } from '../types';
|
|
12
12
|
/**
|
|
13
13
|
* Client for Agent management operations
|
|
14
14
|
*/
|
|
@@ -172,6 +172,12 @@ export declare class AgentClient extends BaseClient {
|
|
|
172
172
|
* ```
|
|
173
173
|
*/
|
|
174
174
|
getStatus(agentId: string): Promise<AgentConnectionStatusResponse>;
|
|
175
|
+
/**
|
|
176
|
+
* Create an outbound call for an agent.
|
|
177
|
+
*
|
|
178
|
+
* Requires backend-side credentials (service token or dev API key).
|
|
179
|
+
*/
|
|
180
|
+
createOutboundCall(options: CreateOutboundCallRequest): Promise<CreateOutboundCallResponse>;
|
|
175
181
|
/**
|
|
176
182
|
* Assign a knowledge base to an agent for RAG
|
|
177
183
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/client/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,KAAK,EACV,KAAK,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,6BAA6B,EAC7B,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/client/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAA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C,iBAAiB,CAAC;IAI9E;;;;;;;;;;;;;;;;OAgBG;IACG,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAKxE;;;;OAIG;IACG,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAIjG;;;;;;;;;;;;OAYG;IACG,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAKxE;;;;;;;;;OASG;IACG,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG5D"}
|
package/dist/client/agents.js
CHANGED
|
@@ -200,6 +200,14 @@ export class AgentClient extends BaseClient {
|
|
|
200
200
|
async getStatus(agentId) {
|
|
201
201
|
return super.get(`/connection/agent-status/${encodeURIComponent(agentId)}`);
|
|
202
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Create an outbound call for an agent.
|
|
205
|
+
*
|
|
206
|
+
* Requires backend-side credentials (service token or dev API key).
|
|
207
|
+
*/
|
|
208
|
+
async createOutboundCall(options) {
|
|
209
|
+
return this.post('/calls/outbound', options);
|
|
210
|
+
}
|
|
203
211
|
/**
|
|
204
212
|
* Assign a knowledge base to an agent for RAG
|
|
205
213
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/client/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAoB,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/client/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAoB,MAAM,QAAQ,CAAC;AAkBtD;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,UAAU;IACzC,YAAY,MAAwB;QAClC,KAAK,CA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AC,CAAC;IACtF,CAAC;CACF"}
|
|
@@ -46,18 +46,18 @@ export declare class AnalyticsClient extends BaseClient {
|
|
|
46
46
|
/**
|
|
47
47
|
* Get transcript download URL for a call
|
|
48
48
|
*
|
|
49
|
-
* @param
|
|
49
|
+
* @param callId - The call identifier
|
|
50
50
|
* @returns Object with transcript URL
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
53
|
* ```typescript
|
|
54
|
-
* const { url } = await client.analytics.getTranscriptUrl(
|
|
54
|
+
* const { url } = await client.analytics.getTranscriptUrl("call_12345");
|
|
55
55
|
*
|
|
56
56
|
* // Download transcript
|
|
57
57
|
* window.open(url, '_blank');
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
|
-
getTranscriptUrl(
|
|
60
|
+
getTranscriptUrl(callId: string): Promise<TranscriptResponse>;
|
|
61
61
|
/**
|
|
62
62
|
* Get agent stats summary
|
|
63
63
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/client/analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,KAAK,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,qBAAa,eAAgB,SAAQ,UAAU;gBACjC,MAAM,EAAE,gBAAgB;IAIpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAY5F;;;;;;;;;;;;;OAaG;IACG,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/client/analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,KAAK,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,qBAAa,eAAgB,SAAQ,UAAU;gBACjC,MAAM,EAAE,gBAAgB;IAIpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAY5F;;;;;;;;;;;;;OAaG;IACG,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAInE;;;;;;;;;;;;;OAaG;IACG,eAAe,IAAI,OAAO,CAAC,yBAAyB,CAAC;CAG5D"}
|
package/dist/client/analytics.js
CHANGED
|
@@ -60,19 +60,19 @@ export class AnalyticsClient extends BaseClient {
|
|
|
60
60
|
/**
|
|
61
61
|
* Get transcript download URL for a call
|
|
62
62
|
*
|
|
63
|
-
* @param
|
|
63
|
+
* @param callId - The call identifier
|
|
64
64
|
* @returns Object with transcript URL
|
|
65
65
|
*
|
|
66
66
|
* @example
|
|
67
67
|
* ```typescript
|
|
68
|
-
* const { url } = await client.analytics.getTranscriptUrl(
|
|
68
|
+
* const { url } = await client.analytics.getTranscriptUrl("call_12345");
|
|
69
69
|
*
|
|
70
70
|
* // Download transcript
|
|
71
71
|
* window.open(url, '_blank');
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
74
|
-
async getTranscriptUrl(
|
|
75
|
-
return this.get(`/agent/call-history/${
|
|
74
|
+
async getTranscriptUrl(callId) {
|
|
75
|
+
return this.get(`/agent/call-history/${callId}/transcript`);
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Get agent stats summary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/client/analytics.ts"],"names":[],"mappings":"AA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;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAmBvG;AAMD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,YAAY,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -27621,6 +27621,14 @@ class AgentClient extends BaseClient {
|
|
|
27621
27621
|
async getStatus(agentId) {
|
|
27622
27622
|
return super.get(`/connection/agent-status/${encodeURIComponent(agentId)}`);
|
|
27623
27623
|
}
|
|
27624
|
+
/**
|
|
27625
|
+
* Create an outbound call for an agent.
|
|
27626
|
+
*
|
|
27627
|
+
* Requires backend-side credentials (service token or dev API key).
|
|
27628
|
+
*/
|
|
27629
|
+
async createOutboundCall(options) {
|
|
27630
|
+
return this.post('/calls/outbound', options);
|
|
27631
|
+
}
|
|
27624
27632
|
/**
|
|
27625
27633
|
* Assign a knowledge base to an agent for RAG
|
|
27626
27634
|
*
|
|
@@ -27714,19 +27722,19 @@ class AnalyticsClient extends BaseClient {
|
|
|
27714
27722
|
/**
|
|
27715
27723
|
* Get transcript download URL for a call
|
|
27716
27724
|
*
|
|
27717
|
-
* @param
|
|
27725
|
+
* @param callId - The call identifier
|
|
27718
27726
|
* @returns Object with transcript URL
|
|
27719
27727
|
*
|
|
27720
27728
|
* @example
|
|
27721
27729
|
* ```typescript
|
|
27722
|
-
* const { url } = await client.analytics.getTranscriptUrl(
|
|
27730
|
+
* const { url } = await client.analytics.getTranscriptUrl("call_12345");
|
|
27723
27731
|
*
|
|
27724
27732
|
* // Download transcript
|
|
27725
27733
|
* window.open(url, '_blank');
|
|
27726
27734
|
* ```
|
|
27727
27735
|
*/
|
|
27728
|
-
async getTranscriptUrl(
|
|
27729
|
-
return this.get(`/agent/call-history/${
|
|
27736
|
+
async getTranscriptUrl(callId) {
|
|
27737
|
+
return this.get(`/agent/call-history/${callId}/transcript`);
|
|
27730
27738
|
}
|
|
27731
27739
|
/**
|
|
27732
27740
|
* Get agent stats summary
|
|
@@ -29171,19 +29179,23 @@ class VoiceAI {
|
|
|
29171
29179
|
? '/connection/test-connection-details'
|
|
29172
29180
|
: '/connection/connection-details';
|
|
29173
29181
|
const endpoint = `${url}${endpointPath}`;
|
|
29182
|
+
if (options.agentId && options.agentConfig) {
|
|
29183
|
+
throw new Error('agentId and agentConfig cannot be used together. Use agentId for a saved agent, or agentConfig for an inline agent configuration.');
|
|
29184
|
+
}
|
|
29185
|
+
if (options.agentConfig && options.agentOverrides) {
|
|
29186
|
+
throw new Error('agentConfig and agentOverrides cannot be used together. Use agentOverrides only with agentId.');
|
|
29187
|
+
}
|
|
29174
29188
|
const requestData = {};
|
|
29175
29189
|
if (options.agentId)
|
|
29176
29190
|
requestData.agent_id = options.agentId;
|
|
29177
29191
|
if (options.agentConfig) {
|
|
29178
|
-
requestData.
|
|
29192
|
+
requestData.agent_config = options.agentConfig;
|
|
29179
29193
|
}
|
|
29180
|
-
|
|
29181
|
-
requestData.
|
|
29194
|
+
if (options.agentOverrides) {
|
|
29195
|
+
requestData.agent_overrides = options.agentOverrides;
|
|
29182
29196
|
}
|
|
29183
|
-
if (options.
|
|
29184
|
-
requestData.
|
|
29185
|
-
? options.environment
|
|
29186
|
-
: JSON.stringify(options.environment);
|
|
29197
|
+
if (options.dynamicVariables) {
|
|
29198
|
+
requestData.dynamic_variables = options.dynamicVariables;
|
|
29187
29199
|
}
|
|
29188
29200
|
const apiKey = options.apiKey || this.apiKey;
|
|
29189
29201
|
this.effectiveApiKey = apiKey;
|