@amigo-ai/platform-sdk 0.100.0 → 0.102.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 +0 -14
- package/api.md +13 -3
- package/dist/index.cjs +105 -15
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -15
- package/dist/index.mjs.map +3 -3
- package/dist/resources/calls.js +0 -6
- package/dist/resources/calls.js.map +1 -1
- package/dist/resources/conversations.js +0 -5
- package/dist/resources/conversations.js.map +1 -1
- package/dist/resources/runs.js +100 -0
- package/dist/resources/runs.js.map +1 -0
- package/dist/types/generated/api.d.ts +60 -327
- package/dist/types/generated/api.d.ts.map +1 -1
- package/dist/types/index.d.cts +3 -1
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/resources/calls.d.ts +0 -4
- package/dist/types/resources/calls.d.ts.map +1 -1
- package/dist/types/resources/conversations.d.ts +1 -5
- package/dist/types/resources/conversations.d.ts.map +1 -1
- package/dist/types/resources/external-integrations.d.ts.map +1 -1
- package/dist/types/resources/intake.d.ts.map +1 -1
- package/dist/types/resources/integrations.d.ts.map +1 -1
- package/dist/types/resources/metrics.d.ts.map +1 -1
- package/dist/types/resources/operators.d.ts.map +1 -1
- package/dist/types/resources/runs.d.ts +163 -0
- package/dist/types/resources/runs.d.ts.map +1 -0
- package/dist/types/resources/services.d.ts.map +1 -1
- package/dist/types/resources/settings.d.ts.map +1 -1
- package/dist/types/resources/surfaces.d.ts.map +1 -1
- package/dist/types/resources/world.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -853,20 +853,6 @@ await client.triggers.resume(trigger.id)
|
|
|
853
853
|
const runs = await client.triggers.listRuns(trigger.id)
|
|
854
854
|
```
|
|
855
855
|
|
|
856
|
-
### Review Queue
|
|
857
|
-
|
|
858
|
-
```typescript
|
|
859
|
-
const stats = await client.reviewQueue.getStats()
|
|
860
|
-
const dashboard = await client.reviewQueue.getDashboard()
|
|
861
|
-
const { items } = await client.reviewQueue.list({ status: 'pending' })
|
|
862
|
-
|
|
863
|
-
// Claim, approve, reject, correct
|
|
864
|
-
await client.reviewQueue.claim('item-id')
|
|
865
|
-
await client.reviewQueue.approve('item-id', { notes: 'Verified correct' })
|
|
866
|
-
await client.reviewQueue.reject('item-id', { reason: 'Data mismatch' })
|
|
867
|
-
await client.reviewQueue.batchApprove({ item_ids: ['id1', 'id2'] })
|
|
868
|
-
```
|
|
869
|
-
|
|
870
856
|
### Compliance
|
|
871
857
|
|
|
872
858
|
```typescript
|
package/api.md
CHANGED
|
@@ -52,7 +52,7 @@ Notes:
|
|
|
52
52
|
- Webhooks: `verifyWebhookSignature`, `parseWebhookEvent`, `WebhookVerificationError`
|
|
53
53
|
- Pagination and response helpers: `paginate`, `buildLastResponse`, `extractRequestId`
|
|
54
54
|
- Conversation helpers: `sessionConnectAuthProtocols`, `textStreamAuthProtocols`
|
|
55
|
-
- Conversation types: `ChannelKind`, `ConversationDetail`, `
|
|
55
|
+
- Conversation types: `ChannelKind`, `ConversationDetail`, `ConversationTurn`, `ConversationTurnAvailableAction`, `ConversationTurnStateTransition`, `CreateConversationRequest`, `SessionConnectUrlParams`, `SwitchChannelRequest`, `TextStreamAuthProtocols` (WebSocket constructor subprotocol tuple), `TextStreamUrlParams`, `TurnDoneEvent`, `TurnErrorEvent`, `TurnMessageEvent`, `TurnRequest`, `TurnResponse`, `TurnConversationSnapshot`, `TurnStreamEvent`, `TurnThinkingEvent`, `TurnTokenEvent`, `TurnToolCallCompletedEvent`, `TurnToolCallStartedEvent`
|
|
56
56
|
- Voice provider constants: `STT_PROVIDERS`, `TTS_PROVIDERS`, `VOICE_SESSION_PROVIDERS`
|
|
57
57
|
- Voice provider types: `AgentVoiceConfig`, `ServiceVoiceConfigInput`, `ServiceVoiceConfigOutput`, `SttProvider`, `TtsProvider`, `VoiceSessionProvider`, `VoiceSettingsRequest`, `VoiceSettingsResponse`
|
|
58
58
|
- Response and hook types: `PaginatedList`, `ListParams`, `LastResponseInfo`, `ResponseMetadata`, `WithResponseMetadata`, `AmigoResponse`, `RetryOptions`, `RateLimitInfo`, `ClientHooks`, `RequestHookContext`, `ResponseHookContext`, `ErrorHookContext`
|
|
@@ -118,6 +118,18 @@ All workspace-scoped resources also expose `withOptions(options)`.
|
|
|
118
118
|
- `get`
|
|
119
119
|
- `harnessContext`
|
|
120
120
|
|
|
121
|
+
### `runs`
|
|
122
|
+
|
|
123
|
+
- `list`
|
|
124
|
+
- `summary`
|
|
125
|
+
- `get`
|
|
126
|
+
- `trajectory`
|
|
127
|
+
- `sendGuidance`
|
|
128
|
+
- `takeOver`
|
|
129
|
+
- `handBack`
|
|
130
|
+
- `switchMode`
|
|
131
|
+
- `accessToken`
|
|
132
|
+
|
|
121
133
|
### `agentDefinitions`
|
|
122
134
|
|
|
123
135
|
- `list`
|
|
@@ -256,7 +268,6 @@ All workspace-scoped resources also expose `withOptions(options)`.
|
|
|
256
268
|
- `get`
|
|
257
269
|
- `getTimeline`
|
|
258
270
|
- `getIntelligence`
|
|
259
|
-
- `getActiveIntelligence`
|
|
260
271
|
- `getBenchmarks`
|
|
261
272
|
- `getPhoneVolume`
|
|
262
273
|
- `getTraceAnalysis`
|
|
@@ -266,7 +277,6 @@ All workspace-scoped resources also expose `withOptions(options)`.
|
|
|
266
277
|
|
|
267
278
|
### `conversations`
|
|
268
279
|
|
|
269
|
-
- `list`
|
|
270
280
|
- `create`
|
|
271
281
|
- `get`
|
|
272
282
|
- `close`
|
package/dist/index.cjs
CHANGED
|
@@ -1395,6 +1395,109 @@ var AgentRunsResource = class extends WorkspaceScopedResource {
|
|
|
1395
1395
|
}
|
|
1396
1396
|
};
|
|
1397
1397
|
|
|
1398
|
+
// src/resources/runs.ts
|
|
1399
|
+
var RunsResource = class extends WorkspaceScopedResource {
|
|
1400
|
+
/**
|
|
1401
|
+
* Paginated, newest-first list of runs. `kind` / `channel` / `status` are
|
|
1402
|
+
* multi-value OR-filters (repeat within an axis, AND across axes); `status`
|
|
1403
|
+
* accepts the virtual `live` (running + paused). `continuationToken` is the
|
|
1404
|
+
* opaque cursor from a prior page — round-trip it verbatim.
|
|
1405
|
+
*/
|
|
1406
|
+
async list(params) {
|
|
1407
|
+
return extractData(
|
|
1408
|
+
await this.client.GET("/v1/{workspace_id}/runs", {
|
|
1409
|
+
params: {
|
|
1410
|
+
path: { workspace_id: this.workspaceId },
|
|
1411
|
+
query: {
|
|
1412
|
+
limit: params?.limit,
|
|
1413
|
+
continuation_token: params?.continuationToken,
|
|
1414
|
+
kind: params?.kind,
|
|
1415
|
+
channel: params?.channel,
|
|
1416
|
+
status: params?.status,
|
|
1417
|
+
sort_by: params?.sortBy
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
})
|
|
1421
|
+
);
|
|
1422
|
+
}
|
|
1423
|
+
/** Aggregate run counts (total / live / by-status / by-kind). */
|
|
1424
|
+
async summary(params) {
|
|
1425
|
+
return extractData(
|
|
1426
|
+
await this.client.GET("/v1/{workspace_id}/runs/summary", {
|
|
1427
|
+
params: {
|
|
1428
|
+
path: { workspace_id: this.workspaceId },
|
|
1429
|
+
query: { kind: params?.kind, channel: params?.channel }
|
|
1430
|
+
}
|
|
1431
|
+
})
|
|
1432
|
+
);
|
|
1433
|
+
}
|
|
1434
|
+
/** Resolve one run by its channel-neutral `run_id`, at any status. */
|
|
1435
|
+
async get(runId) {
|
|
1436
|
+
return extractData(
|
|
1437
|
+
await this.client.GET("/v1/{workspace_id}/runs/{run_id}", {
|
|
1438
|
+
params: { path: { workspace_id: this.workspaceId, run_id: runId } }
|
|
1439
|
+
})
|
|
1440
|
+
);
|
|
1441
|
+
}
|
|
1442
|
+
/**
|
|
1443
|
+
* The ordered structural steps of a FRAMEWORK run's trajectory (perception /
|
|
1444
|
+
* decision / tool / completion). 409 for conversation runs (they have per-turn
|
|
1445
|
+
* detail via the conversation surface).
|
|
1446
|
+
*/
|
|
1447
|
+
async trajectory(runId) {
|
|
1448
|
+
return extractData(
|
|
1449
|
+
await this.client.GET("/v1/{workspace_id}/runs/{run_id}/trajectory", {
|
|
1450
|
+
params: { path: { workspace_id: this.workspaceId, run_id: runId } }
|
|
1451
|
+
})
|
|
1452
|
+
);
|
|
1453
|
+
}
|
|
1454
|
+
/** Send operator guidance to a LIVE run (the agent folds it into its next turn). */
|
|
1455
|
+
async sendGuidance(runId, body) {
|
|
1456
|
+
return extractData(
|
|
1457
|
+
await this.client.POST("/v1/{workspace_id}/runs/{run_id}/guidance", {
|
|
1458
|
+
params: { path: { workspace_id: this.workspaceId, run_id: runId } },
|
|
1459
|
+
body
|
|
1460
|
+
})
|
|
1461
|
+
);
|
|
1462
|
+
}
|
|
1463
|
+
/** Take a live run over (operator drives). Returns the audio-leg coordinates for voice. */
|
|
1464
|
+
async takeOver(runId, body) {
|
|
1465
|
+
return extractData(
|
|
1466
|
+
await this.client.POST("/v1/{workspace_id}/runs/{run_id}/takeover", {
|
|
1467
|
+
params: { path: { workspace_id: this.workspaceId, run_id: runId } },
|
|
1468
|
+
body
|
|
1469
|
+
})
|
|
1470
|
+
);
|
|
1471
|
+
}
|
|
1472
|
+
/** Hand a taken-over run back to the agent. */
|
|
1473
|
+
async handBack(runId, body) {
|
|
1474
|
+
return extractData(
|
|
1475
|
+
await this.client.POST("/v1/{workspace_id}/runs/{run_id}/handback", {
|
|
1476
|
+
params: { path: { workspace_id: this.workspaceId, run_id: runId } },
|
|
1477
|
+
body
|
|
1478
|
+
})
|
|
1479
|
+
);
|
|
1480
|
+
}
|
|
1481
|
+
/** Switch the operator's mode on a live run (listen ↔ takeover). */
|
|
1482
|
+
async switchMode(runId, body) {
|
|
1483
|
+
return extractData(
|
|
1484
|
+
await this.client.POST("/v1/{workspace_id}/runs/{run_id}/switch-mode", {
|
|
1485
|
+
params: { path: { workspace_id: this.workspaceId, run_id: runId } },
|
|
1486
|
+
body
|
|
1487
|
+
})
|
|
1488
|
+
);
|
|
1489
|
+
}
|
|
1490
|
+
/** Mint a run-scoped browser access token (voice takeover audio leg). */
|
|
1491
|
+
async accessToken(runId, body) {
|
|
1492
|
+
return extractData(
|
|
1493
|
+
await this.client.POST("/v1/{workspace_id}/runs/{run_id}/access-token", {
|
|
1494
|
+
params: { path: { workspace_id: this.workspaceId, run_id: runId } },
|
|
1495
|
+
body
|
|
1496
|
+
})
|
|
1497
|
+
);
|
|
1498
|
+
}
|
|
1499
|
+
};
|
|
1500
|
+
|
|
1398
1501
|
// src/resources/agent-definitions.ts
|
|
1399
1502
|
var AgentDefinitionsResource = class extends WorkspaceScopedResource {
|
|
1400
1503
|
async list(params) {
|
|
@@ -2308,14 +2411,6 @@ var CallsResource = class extends WorkspaceScopedResource {
|
|
|
2308
2411
|
})
|
|
2309
2412
|
);
|
|
2310
2413
|
}
|
|
2311
|
-
/** Get active intelligence across all in-progress calls */
|
|
2312
|
-
async getActiveIntelligence() {
|
|
2313
|
-
return extractData(
|
|
2314
|
-
await this.client.GET("/v1/{workspace_id}/calls/active/intelligence", {
|
|
2315
|
-
params: { path: { workspace_id: this.workspaceId } }
|
|
2316
|
-
})
|
|
2317
|
-
);
|
|
2318
|
-
}
|
|
2319
2414
|
/** Get performance benchmarks for a time period */
|
|
2320
2415
|
async getBenchmarks(params) {
|
|
2321
2416
|
return extractData(
|
|
@@ -2380,13 +2475,6 @@ var ConversationsResource = class extends WorkspaceScopedResource {
|
|
|
2380
2475
|
super(client, workspaceId2);
|
|
2381
2476
|
this.agentBaseUrl = agentBaseUrl;
|
|
2382
2477
|
}
|
|
2383
|
-
async list(params) {
|
|
2384
|
-
return extractData(
|
|
2385
|
-
await this.client.GET("/v1/{workspace_id}/conversations", {
|
|
2386
|
-
params: { path: { workspace_id: this.workspaceId }, query: params }
|
|
2387
|
-
})
|
|
2388
|
-
);
|
|
2389
|
-
}
|
|
2390
2478
|
async create(request) {
|
|
2391
2479
|
return extractData(
|
|
2392
2480
|
await this.client.POST("/v1/{workspace_id}/conversations", {
|
|
@@ -6219,6 +6307,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6219
6307
|
tokens;
|
|
6220
6308
|
agents;
|
|
6221
6309
|
agentRuns;
|
|
6310
|
+
runs;
|
|
6222
6311
|
agentDefinitions;
|
|
6223
6312
|
/** @deprecated Use `actions` instead */
|
|
6224
6313
|
skills;
|
|
@@ -6360,6 +6449,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6360
6449
|
mutable.tokens = new TokensResource(client, workspaceId2);
|
|
6361
6450
|
mutable.agents = new AgentsResource(client, workspaceId2);
|
|
6362
6451
|
mutable.agentRuns = new AgentRunsResource(client, workspaceId2);
|
|
6452
|
+
mutable.runs = new RunsResource(client, workspaceId2);
|
|
6363
6453
|
mutable.agentDefinitions = new AgentDefinitionsResource(client, workspaceId2);
|
|
6364
6454
|
mutable.skills = new SkillsResource(client, workspaceId2);
|
|
6365
6455
|
mutable.actions = new ActionsResource(client, workspaceId2);
|