@getsupervisor/agents-studio-sdk 1.0.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/CHANGELOG.md +3 -0
- package/README.md +57 -0
- package/dist/index.cjs +318 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +652 -0
- package/dist/index.d.ts +652 -0
- package/dist/index.js +282 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
type paths = {
|
|
2
|
+
'/v1/agents/{agentId}': {
|
|
3
|
+
get: operations['getAgentDetail'];
|
|
4
|
+
delete: operations['deleteAgent'];
|
|
5
|
+
};
|
|
6
|
+
'/v1/agents/{agentId}/knowledge/upload': {
|
|
7
|
+
post: operations['uploadAgentKnowledge'];
|
|
8
|
+
};
|
|
9
|
+
'/v1/agents/{agentId}/knowledge/bases': {
|
|
10
|
+
get: operations['listAgentKnowledgeBases'];
|
|
11
|
+
};
|
|
12
|
+
'/v1/agents/{agentId}/knowledge/uploads': {
|
|
13
|
+
get: operations['listAgentKnowledgeUploads'];
|
|
14
|
+
};
|
|
15
|
+
'/v1/agents/{agentId}/instructions': {
|
|
16
|
+
get: operations['listAgentInstructions'];
|
|
17
|
+
post: operations['createAgentInstruction'];
|
|
18
|
+
};
|
|
19
|
+
'/v1/agents/{agentId}/phones': {
|
|
20
|
+
post: operations['connectAgentPhone'];
|
|
21
|
+
};
|
|
22
|
+
'/v1/agents/{agentId}/phones/{phoneId}': {
|
|
23
|
+
delete: operations['disconnectAgentPhone'];
|
|
24
|
+
};
|
|
25
|
+
'/v1/workspaces/{workspaceId}/phones': {
|
|
26
|
+
get: operations['listWorkspacePhones'];
|
|
27
|
+
};
|
|
28
|
+
'/v1/workspaces/{workspaceId}/enable': {
|
|
29
|
+
post: operations['enableWorkspace'];
|
|
30
|
+
};
|
|
31
|
+
'/v1/tools': {
|
|
32
|
+
get: operations['listTools'];
|
|
33
|
+
};
|
|
34
|
+
'/v1/tools/{toolId}/execute': {
|
|
35
|
+
post: operations['executeTool'];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
type components = {
|
|
39
|
+
schemas: {
|
|
40
|
+
AgentDetail: {
|
|
41
|
+
agentId: string;
|
|
42
|
+
name: string;
|
|
43
|
+
workspaceId: string;
|
|
44
|
+
provider: string;
|
|
45
|
+
versionId?: string;
|
|
46
|
+
status: 'inactive' | 'training' | 'active' | 'archived';
|
|
47
|
+
voiceProfile?: {
|
|
48
|
+
voiceId?: string;
|
|
49
|
+
llmId?: string;
|
|
50
|
+
webhookUrl?: string;
|
|
51
|
+
};
|
|
52
|
+
knowledgeBaseIds?: string[];
|
|
53
|
+
tools?: string[];
|
|
54
|
+
createdAt?: string;
|
|
55
|
+
updatedAt?: string;
|
|
56
|
+
};
|
|
57
|
+
KnowledgeBaseSummary: {
|
|
58
|
+
id: string;
|
|
59
|
+
providerId?: string;
|
|
60
|
+
name: string;
|
|
61
|
+
documents?: number;
|
|
62
|
+
lastSyncedAt?: string;
|
|
63
|
+
};
|
|
64
|
+
KnowledgeUploadRequest: {
|
|
65
|
+
document_id: string;
|
|
66
|
+
file_path: string;
|
|
67
|
+
file_name: string;
|
|
68
|
+
source: string;
|
|
69
|
+
drive_file_id?: string | null;
|
|
70
|
+
user_id: string;
|
|
71
|
+
};
|
|
72
|
+
KnowledgeUploadResponse: {
|
|
73
|
+
document_id: string;
|
|
74
|
+
file_path: string;
|
|
75
|
+
file_name: string;
|
|
76
|
+
source: string;
|
|
77
|
+
drive_file_id?: string | null;
|
|
78
|
+
user_id: string;
|
|
79
|
+
status: 'queued' | 'processing' | 'completed' | 'failed';
|
|
80
|
+
};
|
|
81
|
+
KnowledgeUploadListResponse: {
|
|
82
|
+
data: {
|
|
83
|
+
document_id: string;
|
|
84
|
+
file_path: string;
|
|
85
|
+
file_name: string;
|
|
86
|
+
source: string;
|
|
87
|
+
drive_file_id?: string | null;
|
|
88
|
+
user_id: string;
|
|
89
|
+
status: 'queued' | 'processing' | 'completed' | 'failed';
|
|
90
|
+
}[];
|
|
91
|
+
};
|
|
92
|
+
Instruction: {
|
|
93
|
+
id: string;
|
|
94
|
+
versionId: string;
|
|
95
|
+
order: number;
|
|
96
|
+
content: string;
|
|
97
|
+
createdAt?: string;
|
|
98
|
+
updatedAt?: string;
|
|
99
|
+
};
|
|
100
|
+
CreateInstructionRequest: {
|
|
101
|
+
order: number;
|
|
102
|
+
content: string;
|
|
103
|
+
metadata?: {
|
|
104
|
+
[key: string]: unknown;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
InstructionCreatedResponse: {
|
|
108
|
+
id: string;
|
|
109
|
+
versionId: string;
|
|
110
|
+
order: number;
|
|
111
|
+
createdAt: string;
|
|
112
|
+
};
|
|
113
|
+
ConnectPhoneRequest: {
|
|
114
|
+
agent_id: string;
|
|
115
|
+
phone_id: string;
|
|
116
|
+
test_phones?: string[];
|
|
117
|
+
allow_all?: boolean;
|
|
118
|
+
};
|
|
119
|
+
PhoneAssignmentResponse: {
|
|
120
|
+
agent_id: string;
|
|
121
|
+
phone_id: string;
|
|
122
|
+
allow_all: boolean;
|
|
123
|
+
test_phones?: string[];
|
|
124
|
+
channel?: string | null;
|
|
125
|
+
assigned_at?: string | null;
|
|
126
|
+
};
|
|
127
|
+
WorkspacePhone: {
|
|
128
|
+
id: string;
|
|
129
|
+
external_id: string;
|
|
130
|
+
channel?: 'voice' | null;
|
|
131
|
+
supports_outbound?: boolean | null;
|
|
132
|
+
assigned_to?: string | null;
|
|
133
|
+
last_used_at?: string | null;
|
|
134
|
+
requires_qr_reauth?: boolean | null;
|
|
135
|
+
};
|
|
136
|
+
WorkspacePhonesResponse: {
|
|
137
|
+
data: components['schemas']['WorkspacePhone'][];
|
|
138
|
+
};
|
|
139
|
+
ToolSummary: {
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
identifier: string;
|
|
143
|
+
description?: string;
|
|
144
|
+
enabled: boolean;
|
|
145
|
+
};
|
|
146
|
+
ExecuteToolRequest: {
|
|
147
|
+
payload: {
|
|
148
|
+
[key: string]: unknown;
|
|
149
|
+
};
|
|
150
|
+
metadata?: {
|
|
151
|
+
[key: string]: unknown;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
ExecuteToolResponse: {
|
|
155
|
+
result: {
|
|
156
|
+
[key: string]: unknown;
|
|
157
|
+
};
|
|
158
|
+
metadata?: {
|
|
159
|
+
[key: string]: unknown;
|
|
160
|
+
};
|
|
161
|
+
toolId: string;
|
|
162
|
+
};
|
|
163
|
+
WorkspaceEnableRequest: {
|
|
164
|
+
provider: 'retell';
|
|
165
|
+
apiKey: string;
|
|
166
|
+
metadata?: {
|
|
167
|
+
[key: string]: unknown;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
WorkspaceEnableResponse: {
|
|
171
|
+
status: 'enabled';
|
|
172
|
+
provider: string;
|
|
173
|
+
workspaceId: string;
|
|
174
|
+
};
|
|
175
|
+
ErrorResponse: {
|
|
176
|
+
code: string;
|
|
177
|
+
message: string;
|
|
178
|
+
details?: {
|
|
179
|
+
[key: string]: unknown;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
responses: never;
|
|
184
|
+
parameters: {
|
|
185
|
+
AgentId: string;
|
|
186
|
+
PhoneId: string;
|
|
187
|
+
WorkspaceId: string;
|
|
188
|
+
ToolId: string;
|
|
189
|
+
};
|
|
190
|
+
requestBodies: never;
|
|
191
|
+
headers: never;
|
|
192
|
+
pathItems: never;
|
|
193
|
+
};
|
|
194
|
+
type operations = {
|
|
195
|
+
getAgentDetail: {
|
|
196
|
+
parameters: {
|
|
197
|
+
path: {
|
|
198
|
+
agentId: components['parameters']['AgentId'];
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
responses: {
|
|
202
|
+
200: {
|
|
203
|
+
content: {
|
|
204
|
+
'application/json': components['schemas']['AgentDetail'];
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
404: {
|
|
208
|
+
content: {
|
|
209
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
deleteAgent: {
|
|
215
|
+
parameters: {
|
|
216
|
+
path: {
|
|
217
|
+
agentId: components['parameters']['AgentId'];
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
responses: {
|
|
221
|
+
204: {
|
|
222
|
+
content: never;
|
|
223
|
+
};
|
|
224
|
+
409: {
|
|
225
|
+
content: {
|
|
226
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
uploadAgentKnowledge: {
|
|
232
|
+
parameters: {
|
|
233
|
+
path: {
|
|
234
|
+
agentId: components['parameters']['AgentId'];
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
requestBody: {
|
|
238
|
+
content: {
|
|
239
|
+
'application/json': components['schemas']['KnowledgeUploadRequest'];
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
responses: {
|
|
243
|
+
202: {
|
|
244
|
+
content: {
|
|
245
|
+
'application/json': components['schemas']['KnowledgeUploadResponse'];
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
400: {
|
|
249
|
+
content: {
|
|
250
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
409: {
|
|
254
|
+
content: {
|
|
255
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
listAgentKnowledgeBases: {
|
|
261
|
+
parameters: {
|
|
262
|
+
path: {
|
|
263
|
+
agentId: components['parameters']['AgentId'];
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
responses: {
|
|
267
|
+
200: {
|
|
268
|
+
content: {
|
|
269
|
+
'application/json': {
|
|
270
|
+
data?: components['schemas']['KnowledgeBaseSummary'][];
|
|
271
|
+
agent_id?: string;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
404: {
|
|
276
|
+
content: {
|
|
277
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
listAgentKnowledgeUploads: {
|
|
283
|
+
parameters: {
|
|
284
|
+
path: {
|
|
285
|
+
agentId: components['parameters']['AgentId'];
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
responses: {
|
|
289
|
+
200: {
|
|
290
|
+
content: {
|
|
291
|
+
'application/json': components['schemas']['KnowledgeUploadListResponse'];
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
listAgentInstructions: {
|
|
297
|
+
parameters: {
|
|
298
|
+
query?: {
|
|
299
|
+
versionId?: string;
|
|
300
|
+
};
|
|
301
|
+
path: {
|
|
302
|
+
agentId: components['parameters']['AgentId'];
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
responses: {
|
|
306
|
+
200: {
|
|
307
|
+
content: {
|
|
308
|
+
'application/json': {
|
|
309
|
+
data?: components['schemas']['Instruction'][];
|
|
310
|
+
versionId?: string;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
404: {
|
|
315
|
+
content: {
|
|
316
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
createAgentInstruction: {
|
|
322
|
+
parameters: {
|
|
323
|
+
path: {
|
|
324
|
+
agentId: components['parameters']['AgentId'];
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
requestBody: {
|
|
328
|
+
content: {
|
|
329
|
+
'application/json': components['schemas']['CreateInstructionRequest'];
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
responses: {
|
|
333
|
+
201: {
|
|
334
|
+
content: {
|
|
335
|
+
'application/json': components['schemas']['InstructionCreatedResponse'];
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
400: {
|
|
339
|
+
content: {
|
|
340
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
409: {
|
|
344
|
+
content: {
|
|
345
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
connectAgentPhone: {
|
|
351
|
+
parameters: {
|
|
352
|
+
path: {
|
|
353
|
+
agentId: components['parameters']['AgentId'];
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
requestBody: {
|
|
357
|
+
content: {
|
|
358
|
+
'application/json': components['schemas']['ConnectPhoneRequest'];
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
responses: {
|
|
362
|
+
200: {
|
|
363
|
+
content: {
|
|
364
|
+
'application/json': components['schemas']['PhoneAssignmentResponse'];
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
400: {
|
|
368
|
+
content: {
|
|
369
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
404: {
|
|
373
|
+
content: {
|
|
374
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
409: {
|
|
378
|
+
content: {
|
|
379
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
disconnectAgentPhone: {
|
|
385
|
+
parameters: {
|
|
386
|
+
path: {
|
|
387
|
+
agentId: components['parameters']['AgentId'];
|
|
388
|
+
phoneId: components['parameters']['PhoneId'];
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
responses: {
|
|
392
|
+
204: {
|
|
393
|
+
content: never;
|
|
394
|
+
};
|
|
395
|
+
404: {
|
|
396
|
+
content: {
|
|
397
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
409: {
|
|
401
|
+
content: {
|
|
402
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
listWorkspacePhones: {
|
|
408
|
+
parameters: {
|
|
409
|
+
query?: {
|
|
410
|
+
channel?: 'voice';
|
|
411
|
+
};
|
|
412
|
+
path: {
|
|
413
|
+
workspaceId: components['parameters']['WorkspaceId'];
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
responses: {
|
|
417
|
+
200: {
|
|
418
|
+
content: {
|
|
419
|
+
'application/json': components['schemas']['WorkspacePhonesResponse'];
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
enableWorkspace: {
|
|
425
|
+
parameters: {
|
|
426
|
+
path: {
|
|
427
|
+
workspaceId: components['parameters']['WorkspaceId'];
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
requestBody: {
|
|
431
|
+
content: {
|
|
432
|
+
'application/json': components['schemas']['WorkspaceEnableRequest'];
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
responses: {
|
|
436
|
+
200: {
|
|
437
|
+
content: {
|
|
438
|
+
'application/json': components['schemas']['WorkspaceEnableResponse'];
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
400: {
|
|
442
|
+
content: {
|
|
443
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
502: {
|
|
447
|
+
content: {
|
|
448
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
listTools: {
|
|
454
|
+
responses: {
|
|
455
|
+
200: {
|
|
456
|
+
content: {
|
|
457
|
+
'application/json': {
|
|
458
|
+
data?: components['schemas']['ToolSummary'][];
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
executeTool: {
|
|
465
|
+
parameters: {
|
|
466
|
+
path: {
|
|
467
|
+
toolId: components['parameters']['ToolId'];
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
requestBody: {
|
|
471
|
+
content: {
|
|
472
|
+
'application/json': components['schemas']['ExecuteToolRequest'];
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
responses: {
|
|
476
|
+
200: {
|
|
477
|
+
content: {
|
|
478
|
+
'application/json': components['schemas']['ExecuteToolResponse'];
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
400: {
|
|
482
|
+
content: {
|
|
483
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
404: {
|
|
487
|
+
content: {
|
|
488
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
409: {
|
|
492
|
+
content: {
|
|
493
|
+
'application/json': components['schemas']['ErrorResponse'];
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
type ClientConfig = {
|
|
501
|
+
baseUrl: string;
|
|
502
|
+
headers?: Record<string, string>;
|
|
503
|
+
timeoutMs?: number;
|
|
504
|
+
fetchImpl?: typeof fetch;
|
|
505
|
+
logger?: {
|
|
506
|
+
debug?: (...a: any[]) => void;
|
|
507
|
+
error?: (...a: any[]) => void;
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
type AgentDetail = components['schemas']['AgentDetail'];
|
|
511
|
+
type KnowledgeUploadRequest = components['schemas']['KnowledgeUploadRequest'];
|
|
512
|
+
type KnowledgeUploadResponse = components['schemas']['KnowledgeUploadResponse'];
|
|
513
|
+
type KnowledgeUploadListResponse = components['schemas']['KnowledgeUploadListResponse'];
|
|
514
|
+
type AgentKnowledgeBasesResponse = paths['/v1/agents/{agentId}/knowledge/bases']['get']['responses'][200]['content']['application/json'];
|
|
515
|
+
type AgentKnowledgeUploadsResponse = paths['/v1/agents/{agentId}/knowledge/uploads']['get']['responses'][200]['content']['application/json'];
|
|
516
|
+
type Instruction = components['schemas']['Instruction'];
|
|
517
|
+
type CreateInstructionRequest = components['schemas']['CreateInstructionRequest'];
|
|
518
|
+
type InstructionCreatedResponse = components['schemas']['InstructionCreatedResponse'];
|
|
519
|
+
type AgentInstructionsResponse = paths['/v1/agents/{agentId}/instructions']['get']['responses'][200]['content']['application/json'];
|
|
520
|
+
type ConnectPhoneRequest = components['schemas']['ConnectPhoneRequest'];
|
|
521
|
+
type PhoneAssignmentResponse = components['schemas']['PhoneAssignmentResponse'];
|
|
522
|
+
type WorkspacePhone = components['schemas']['WorkspacePhone'];
|
|
523
|
+
type WorkspacePhonesResponse = components['schemas']['WorkspacePhonesResponse'];
|
|
524
|
+
type WorkspacePhoneChannel = 'voice';
|
|
525
|
+
type WorkspaceEnableRequest = components['schemas']['WorkspaceEnableRequest'];
|
|
526
|
+
type WorkspaceEnableResponse = components['schemas']['WorkspaceEnableResponse'];
|
|
527
|
+
type ToolSummary = components['schemas']['ToolSummary'];
|
|
528
|
+
type ExecuteToolRequest = components['schemas']['ExecuteToolRequest'];
|
|
529
|
+
type ExecuteToolResponse = components['schemas']['ExecuteToolResponse'];
|
|
530
|
+
type ToolsCatalogResponse = paths['/v1/tools']['get']['responses'][200]['content']['application/json'];
|
|
531
|
+
type ErrorResponse = components['schemas']['ErrorResponse'];
|
|
532
|
+
|
|
533
|
+
declare class HttpError extends Error {
|
|
534
|
+
status: number;
|
|
535
|
+
statusText: string;
|
|
536
|
+
body?: unknown;
|
|
537
|
+
url?: string;
|
|
538
|
+
constructor(status: number, statusText: string, body?: unknown, url?: string);
|
|
539
|
+
}
|
|
540
|
+
declare class TimeoutError extends Error {
|
|
541
|
+
ms: number;
|
|
542
|
+
url?: string;
|
|
543
|
+
constructor(ms: number, url?: string);
|
|
544
|
+
}
|
|
545
|
+
declare class NetworkError extends Error {
|
|
546
|
+
cause?: unknown;
|
|
547
|
+
url?: string;
|
|
548
|
+
constructor(cause?: unknown, url?: string);
|
|
549
|
+
}
|
|
550
|
+
type RetryPolicy = {
|
|
551
|
+
maxRetries?: number;
|
|
552
|
+
baseDelayMs?: number;
|
|
553
|
+
maxDelayMs?: number;
|
|
554
|
+
retryOn?: (err: unknown, attempt: number) => boolean;
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
declare function createAgentsApi(cfg: ClientConfig & {
|
|
558
|
+
retry?: RetryPolicy;
|
|
559
|
+
}): {
|
|
560
|
+
get(agentId: string): Promise<AgentDetail>;
|
|
561
|
+
delete(agentId: string): Promise<void>;
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
declare function createAgentKnowledgeApi(cfg: ClientConfig & {
|
|
565
|
+
retry?: RetryPolicy;
|
|
566
|
+
}): {
|
|
567
|
+
upload(agentId: string, payload: KnowledgeUploadRequest): Promise<KnowledgeUploadResponse>;
|
|
568
|
+
listBases(agentId: string): Promise<AgentKnowledgeBasesResponse>;
|
|
569
|
+
listUploads(agentId: string): Promise<AgentKnowledgeUploadsResponse>;
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
declare function createAgentInstructionsApi(cfg: ClientConfig & {
|
|
573
|
+
retry?: RetryPolicy;
|
|
574
|
+
}): {
|
|
575
|
+
list(agentId: string, opts?: {
|
|
576
|
+
versionId?: string;
|
|
577
|
+
}): Promise<AgentInstructionsResponse>;
|
|
578
|
+
create(agentId: string, payload: CreateInstructionRequest): Promise<InstructionCreatedResponse>;
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
declare function createAgentPhonesApi(cfg: ClientConfig & {
|
|
582
|
+
retry?: RetryPolicy;
|
|
583
|
+
}): {
|
|
584
|
+
connect(agentId: string, payload: ConnectPhoneRequest): Promise<PhoneAssignmentResponse>;
|
|
585
|
+
disconnect(agentId: string, phoneId: string): Promise<void>;
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
declare function createWorkspacesApi(cfg: ClientConfig & {
|
|
589
|
+
retry?: RetryPolicy;
|
|
590
|
+
}): {
|
|
591
|
+
listPhones(workspaceId: string, opts?: {
|
|
592
|
+
channel?: WorkspacePhoneChannel;
|
|
593
|
+
}): Promise<WorkspacePhonesResponse>;
|
|
594
|
+
enable(workspaceId: string, payload: WorkspaceEnableRequest): Promise<WorkspaceEnableResponse>;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
declare function createToolsApi(cfg: ClientConfig & {
|
|
598
|
+
retry?: RetryPolicy;
|
|
599
|
+
}): {
|
|
600
|
+
list(): Promise<ToolsCatalogResponse>;
|
|
601
|
+
execute(toolId: string, payload: ExecuteToolRequest): Promise<ExecuteToolResponse>;
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
declare function createClient(cfg: ClientConfig & {
|
|
605
|
+
retry?: RetryPolicy;
|
|
606
|
+
}): {
|
|
607
|
+
agents: {
|
|
608
|
+
knowledge: {
|
|
609
|
+
upload(agentId: string, payload: KnowledgeUploadRequest): Promise<KnowledgeUploadResponse>;
|
|
610
|
+
listBases(agentId: string): Promise<AgentKnowledgeBasesResponse>;
|
|
611
|
+
listUploads(agentId: string): Promise<AgentKnowledgeUploadsResponse>;
|
|
612
|
+
};
|
|
613
|
+
instructions: {
|
|
614
|
+
list(agentId: string, opts?: {
|
|
615
|
+
versionId?: string;
|
|
616
|
+
}): Promise<AgentInstructionsResponse>;
|
|
617
|
+
create(agentId: string, payload: CreateInstructionRequest): Promise<InstructionCreatedResponse>;
|
|
618
|
+
};
|
|
619
|
+
phones: {
|
|
620
|
+
connect(agentId: string, payload: ConnectPhoneRequest): Promise<PhoneAssignmentResponse>;
|
|
621
|
+
disconnect(agentId: string, phoneId: string): Promise<void>;
|
|
622
|
+
};
|
|
623
|
+
get(agentId: string): Promise<AgentDetail>;
|
|
624
|
+
delete(agentId: string): Promise<void>;
|
|
625
|
+
};
|
|
626
|
+
workspaces: {
|
|
627
|
+
listPhones(workspaceId: string, opts?: {
|
|
628
|
+
channel?: WorkspacePhoneChannel;
|
|
629
|
+
}): Promise<WorkspacePhonesResponse>;
|
|
630
|
+
enable(workspaceId: string, payload: WorkspaceEnableRequest): Promise<WorkspaceEnableResponse>;
|
|
631
|
+
};
|
|
632
|
+
tools: {
|
|
633
|
+
list(): Promise<ToolsCatalogResponse>;
|
|
634
|
+
execute(toolId: string, payload: ExecuteToolRequest): Promise<ExecuteToolResponse>;
|
|
635
|
+
};
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
declare function createHttp(cfg: ClientConfig & {
|
|
639
|
+
retry?: RetryPolicy;
|
|
640
|
+
}): {
|
|
641
|
+
base: string;
|
|
642
|
+
headers: Record<string, string>;
|
|
643
|
+
timeout: number;
|
|
644
|
+
log: {
|
|
645
|
+
debug?: (...a: any[]) => void;
|
|
646
|
+
error?: (...a: any[]) => void;
|
|
647
|
+
};
|
|
648
|
+
retry: RetryPolicy;
|
|
649
|
+
doFetch: (url: string, init: RequestInit) => Promise<Response>;
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
export { type AgentDetail, type AgentInstructionsResponse, type AgentKnowledgeBasesResponse, type AgentKnowledgeUploadsResponse, type ClientConfig, type ConnectPhoneRequest, type CreateInstructionRequest, type ErrorResponse, type ExecuteToolRequest, type ExecuteToolResponse, HttpError, type Instruction, type InstructionCreatedResponse, type KnowledgeUploadListResponse, type KnowledgeUploadRequest, type KnowledgeUploadResponse, NetworkError, type PhoneAssignmentResponse, type RetryPolicy, TimeoutError, type ToolSummary, type ToolsCatalogResponse, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, createAgentInstructionsApi, createAgentKnowledgeApi, createAgentPhonesApi, createAgentsApi, createClient, createHttp, createToolsApi, createWorkspacesApi };
|