@getsupervisor/agents-studio-sdk 1.1.0 → 1.3.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.d.ts CHANGED
@@ -1,38 +1,62 @@
1
1
  type paths = {
2
- '/v1/agents/{agentId}': {
3
- get: operations['getAgentDetail'];
4
- delete: operations['deleteAgent'];
2
+ "/v1/agents": {
3
+ get: operations["listAgents"];
4
+ post: operations["createAgent"];
5
5
  };
6
- '/v1/agents/{agentId}/knowledge/upload': {
7
- post: operations['uploadAgentKnowledge'];
6
+ "/v1/agents/{agentId}": {
7
+ get: operations["getAgentDetail"];
8
+ delete: operations["deleteAgent"];
9
+ patch: operations["updateAgent"];
8
10
  };
9
- '/v1/agents/{agentId}/knowledge/bases': {
10
- get: operations['listAgentKnowledgeBases'];
11
+ "/v1/agents/{agentId}/knowledge/upload": {
12
+ post: operations["uploadAgentKnowledge"];
11
13
  };
12
- '/v1/agents/{agentId}/knowledge/uploads': {
13
- get: operations['listAgentKnowledgeUploads'];
14
+ "/v1/agents/{agentId}/knowledge/bases": {
15
+ get: operations["listAgentKnowledgeBases"];
14
16
  };
15
- '/v1/agents/{agentId}/instructions': {
16
- get: operations['listAgentInstructions'];
17
- post: operations['createAgentInstruction'];
17
+ "/v1/agents/{agentId}/knowledge/uploads": {
18
+ get: operations["listAgentKnowledgeUploads"];
18
19
  };
19
- '/v1/agents/{agentId}/phones': {
20
- post: operations['connectAgentPhone'];
20
+ "/v1/agents/{agentId}/instructions": {
21
+ get: operations["listAgentInstructions"];
22
+ post: operations["createAgentInstruction"];
21
23
  };
22
- '/v1/agents/{agentId}/phones/{phoneId}': {
23
- delete: operations['disconnectAgentPhone'];
24
+ "/v1/agents/{agentId}/instructions/{instructionId}": {
25
+ patch: operations["updateAgentInstruction"];
24
26
  };
25
- '/v1/workspaces/{workspaceId}/phones': {
26
- get: operations['listWorkspacePhones'];
27
+ "/v1/agents/{agentId}/schedule": {
28
+ get: operations["getAgentSchedule"];
29
+ put: operations["updateAgentSchedule"];
27
30
  };
28
- '/v1/workspaces/{workspaceId}/enable': {
29
- post: operations['enableWorkspace'];
31
+ "/v1/agents/{agentId}/versions": {
32
+ get: operations["listAgentVersions"];
33
+ post: operations["createAgentVersion"];
30
34
  };
31
- '/v1/tools': {
32
- get: operations['listTools'];
35
+ "/v1/agents/{agentId}/versions/{versionId}": {
36
+ get: operations["getAgentVersion"];
37
+ delete: operations["deleteAgentInstruction"];
38
+ patch: operations["updateAgentVersion"];
33
39
  };
34
- '/v1/tools/{toolId}/execute': {
35
- post: operations['executeTool'];
40
+ "/v1/agents/{agentId}/phones": {
41
+ post: operations["connectAgentPhone"];
42
+ };
43
+ "/v1/agents/{agentId}/phones/{phoneId}": {
44
+ delete: operations["disconnectAgentPhone"];
45
+ };
46
+ "/v1/workspaces/{workspaceId}/phones": {
47
+ get: operations["listWorkspacePhones"];
48
+ };
49
+ "/v1/workspaces/{workspaceId}/enable": {
50
+ post: operations["enableWorkspace"];
51
+ };
52
+ "/v1/tools": {
53
+ get: operations["listTools"];
54
+ };
55
+ "/v1/tools/{toolId}/execute": {
56
+ post: operations["executeTool"];
57
+ };
58
+ "/v1/voices": {
59
+ get: operations["listVoices"];
36
60
  };
37
61
  };
38
62
  type components = {
@@ -43,7 +67,7 @@ type components = {
43
67
  workspaceId: string;
44
68
  provider: string;
45
69
  versionId?: string;
46
- status: 'inactive' | 'training' | 'active' | 'archived';
70
+ status: "inactive" | "training" | "active" | "archived";
47
71
  voiceProfile?: {
48
72
  voiceId?: string;
49
73
  llmId?: string;
@@ -54,6 +78,50 @@ type components = {
54
78
  createdAt?: string;
55
79
  updatedAt?: string;
56
80
  };
81
+ PaginationMeta: {
82
+ total: number;
83
+ page: number;
84
+ limit: number;
85
+ hasNext: boolean;
86
+ };
87
+ QueryValue: string | number | boolean | string[];
88
+ QueryFilterOperators: {
89
+ [key: string]: components["schemas"]["QueryValue"];
90
+ };
91
+ QueryFilters: {
92
+ [key: string]: components["schemas"]["QueryValue"] | components["schemas"]["QueryFilterOperators"];
93
+ };
94
+ QueryOrGroups: {
95
+ [key: string]: components["schemas"]["QueryFilters"];
96
+ };
97
+ AgentSummary: {
98
+ agentId: string;
99
+ name: string;
100
+ status: "inactive" | "training" | "active" | "archived";
101
+ workspaceId: string;
102
+ createdAt: string;
103
+ };
104
+ AgentListResponse: {
105
+ data: components["schemas"]["AgentSummary"][];
106
+ meta: components["schemas"]["PaginationMeta"];
107
+ };
108
+ CreateAgentRequest: {
109
+ name: string;
110
+ provider: string;
111
+ languageCode: string;
112
+ templateId?: string | null;
113
+ metadata?: {
114
+ [key: string]: unknown;
115
+ };
116
+ };
117
+ UpdateAgentRequest: {
118
+ name?: string;
119
+ status?: "inactive" | "training" | "active" | "archived";
120
+ metadata?: {
121
+ [key: string]: unknown;
122
+ };
123
+ provider?: string;
124
+ };
57
125
  KnowledgeBaseSummary: {
58
126
  id: string;
59
127
  providerId?: string;
@@ -76,18 +144,18 @@ type components = {
76
144
  source: string;
77
145
  drive_file_id?: string | null;
78
146
  user_id: string;
79
- status: 'queued' | 'processing' | 'completed' | 'failed';
147
+ status: "queued" | "processing" | "completed" | "failed";
80
148
  };
81
149
  KnowledgeUploadListResponse: {
82
- data: {
150
+ data: ({
83
151
  document_id: string;
84
152
  file_path: string;
85
153
  file_name: string;
86
154
  source: string;
87
155
  drive_file_id?: string | null;
88
156
  user_id: string;
89
- status: 'queued' | 'processing' | 'completed' | 'failed';
90
- }[];
157
+ status: "queued" | "processing" | "completed" | "failed";
158
+ })[];
91
159
  };
92
160
  Instruction: {
93
161
  id: string;
@@ -110,6 +178,88 @@ type components = {
110
178
  order: number;
111
179
  createdAt: string;
112
180
  };
181
+ UpdateInstructionRequest: {
182
+ order?: number;
183
+ content?: string;
184
+ metadata?: {
185
+ [key: string]: unknown;
186
+ };
187
+ };
188
+ VoiceSummary: {
189
+ id: string;
190
+ providerVoiceId?: string;
191
+ name: string;
192
+ gender?: "female" | "male" | "neutral";
193
+ locale: string;
194
+ tags?: string[];
195
+ previewUrl?: string;
196
+ provider: string;
197
+ };
198
+ VoiceListResponse: {
199
+ data: components["schemas"]["VoiceSummary"][];
200
+ meta: components["schemas"]["PaginationMeta"];
201
+ };
202
+ AgentScheduleSlot: {
203
+ startTime: string;
204
+ endTime: string;
205
+ };
206
+ AgentScheduleRule: {
207
+ dayOfWeek: "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday";
208
+ slots: components["schemas"]["AgentScheduleSlot"][];
209
+ isClosed?: boolean;
210
+ };
211
+ AgentSchedule: {
212
+ agentId: string;
213
+ timezone: string;
214
+ rules: components["schemas"]["AgentScheduleRule"][];
215
+ metadata?: {
216
+ [key: string]: unknown;
217
+ };
218
+ };
219
+ UpdateAgentScheduleRequest: {
220
+ timezone: string;
221
+ rules: components["schemas"]["AgentScheduleRule"][];
222
+ metadata?: {
223
+ [key: string]: unknown;
224
+ };
225
+ };
226
+ AgentVersionSummary: {
227
+ versionId: string;
228
+ agentId: string;
229
+ label: string;
230
+ status: "draft" | "published" | "archived";
231
+ isActive?: boolean;
232
+ createdAt: string;
233
+ updatedAt?: string;
234
+ publishedAt?: string | null;
235
+ };
236
+ AgentVersionDetail: components["schemas"]["AgentVersionSummary"] & {
237
+ description?: string;
238
+ metadata?: {
239
+ [key: string]: unknown;
240
+ };
241
+ instructionsVersionId?: string;
242
+ };
243
+ AgentVersionListResponse: {
244
+ data: components["schemas"]["AgentVersionSummary"][];
245
+ meta?: components["schemas"]["PaginationMeta"];
246
+ };
247
+ CreateAgentVersionRequest: {
248
+ label: string;
249
+ description?: string;
250
+ sourceVersionId?: string;
251
+ metadata?: {
252
+ [key: string]: unknown;
253
+ };
254
+ };
255
+ UpdateAgentVersionRequest: {
256
+ label?: string;
257
+ description?: string;
258
+ status?: "draft" | "published" | "archived";
259
+ metadata?: {
260
+ [key: string]: unknown;
261
+ };
262
+ };
113
263
  ConnectPhoneRequest: {
114
264
  agent_id: string;
115
265
  phone_id: string;
@@ -127,14 +277,14 @@ type components = {
127
277
  WorkspacePhone: {
128
278
  id: string;
129
279
  external_id: string;
130
- channel?: 'voice' | null;
280
+ channel?: "voice" | null;
131
281
  supports_outbound?: boolean | null;
132
282
  assigned_to?: string | null;
133
283
  last_used_at?: string | null;
134
284
  requires_qr_reauth?: boolean | null;
135
285
  };
136
286
  WorkspacePhonesResponse: {
137
- data: components['schemas']['WorkspacePhone'][];
287
+ data: components["schemas"]["WorkspacePhone"][];
138
288
  };
139
289
  ToolSummary: {
140
290
  id: string;
@@ -161,14 +311,14 @@ type components = {
161
311
  toolId: string;
162
312
  };
163
313
  WorkspaceEnableRequest: {
164
- provider: 'retell';
314
+ provider: "retell";
165
315
  apiKey: string;
166
316
  metadata?: {
167
317
  [key: string]: unknown;
168
318
  };
169
319
  };
170
320
  WorkspaceEnableResponse: {
171
- status: 'enabled';
321
+ status: "enabled";
172
322
  provider: string;
173
323
  workspaceId: string;
174
324
  };
@@ -182,39 +332,114 @@ type components = {
182
332
  };
183
333
  responses: never;
184
334
  parameters: {
335
+ XWorkspaceId: string;
185
336
  AgentId: string;
186
337
  PhoneId: string;
338
+ InstructionId: string;
339
+ VersionId: string;
187
340
  WorkspaceId: string;
188
341
  ToolId: string;
342
+ PageParam?: number;
343
+ LimitParam?: number;
344
+ SortParam?: string;
345
+ FieldsParam?: string;
346
+ IncludeParam?: string;
347
+ SearchParam?: string;
348
+ FilterParam?: components["schemas"]["QueryFilters"];
349
+ OrParam?: components["schemas"]["QueryOrGroups"];
189
350
  };
190
351
  requestBodies: never;
191
352
  headers: never;
192
353
  pathItems: never;
193
354
  };
194
355
  type operations = {
356
+ listAgents: {
357
+ parameters: {
358
+ query?: {
359
+ page?: components["parameters"]["PageParam"];
360
+ limit?: components["parameters"]["LimitParam"];
361
+ sort?: components["parameters"]["SortParam"];
362
+ fields?: components["parameters"]["FieldsParam"];
363
+ include?: components["parameters"]["IncludeParam"];
364
+ q?: components["parameters"]["SearchParam"];
365
+ filter?: components["parameters"]["FilterParam"];
366
+ or?: components["parameters"]["OrParam"];
367
+ };
368
+ header: {
369
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
370
+ };
371
+ };
372
+ responses: {
373
+ 200: {
374
+ content: {
375
+ "application/json": components["schemas"]["AgentListResponse"];
376
+ };
377
+ };
378
+ };
379
+ };
380
+ createAgent: {
381
+ parameters: {
382
+ header: {
383
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
384
+ };
385
+ };
386
+ requestBody: {
387
+ content: {
388
+ "application/json": components["schemas"]["CreateAgentRequest"];
389
+ };
390
+ };
391
+ responses: {
392
+ 201: {
393
+ content: {
394
+ "application/json": components["schemas"]["AgentDetail"];
395
+ };
396
+ };
397
+ 400: {
398
+ content: {
399
+ "application/json": components["schemas"]["ErrorResponse"];
400
+ };
401
+ };
402
+ 404: {
403
+ content: {
404
+ "application/json": components["schemas"]["ErrorResponse"];
405
+ };
406
+ };
407
+ 409: {
408
+ content: {
409
+ "application/json": components["schemas"]["ErrorResponse"];
410
+ };
411
+ };
412
+ };
413
+ };
195
414
  getAgentDetail: {
196
415
  parameters: {
416
+ header: {
417
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
418
+ };
197
419
  path: {
198
- agentId: components['parameters']['AgentId'];
420
+ agentId: components["parameters"]["AgentId"];
199
421
  };
200
422
  };
201
423
  responses: {
202
424
  200: {
203
425
  content: {
204
- 'application/json': components['schemas']['AgentDetail'];
426
+ "application/json": components["schemas"]["AgentDetail"];
205
427
  };
206
428
  };
207
429
  404: {
208
430
  content: {
209
- 'application/json': components['schemas']['ErrorResponse'];
431
+ "application/json": components["schemas"]["ErrorResponse"];
210
432
  };
211
433
  };
212
434
  };
213
435
  };
214
436
  deleteAgent: {
215
437
  parameters: {
438
+ header: {
439
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
440
+ };
216
441
  path: {
217
- agentId: components['parameters']['AgentId'];
442
+ agentId: components["parameters"]["AgentId"];
218
443
  };
219
444
  };
220
445
  responses: {
@@ -223,72 +448,138 @@ type operations = {
223
448
  };
224
449
  409: {
225
450
  content: {
226
- 'application/json': components['schemas']['ErrorResponse'];
451
+ "application/json": components["schemas"]["ErrorResponse"];
452
+ };
453
+ };
454
+ };
455
+ };
456
+ updateAgent: {
457
+ parameters: {
458
+ header: {
459
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
460
+ };
461
+ path: {
462
+ agentId: components["parameters"]["AgentId"];
463
+ };
464
+ };
465
+ requestBody: {
466
+ content: {
467
+ "application/json": components["schemas"]["UpdateAgentRequest"];
468
+ };
469
+ };
470
+ responses: {
471
+ 200: {
472
+ content: {
473
+ "application/json": components["schemas"]["AgentDetail"];
474
+ };
475
+ };
476
+ 400: {
477
+ content: {
478
+ "application/json": components["schemas"]["ErrorResponse"];
479
+ };
480
+ };
481
+ 404: {
482
+ content: {
483
+ "application/json": components["schemas"]["ErrorResponse"];
484
+ };
485
+ };
486
+ 409: {
487
+ content: {
488
+ "application/json": components["schemas"]["ErrorResponse"];
227
489
  };
228
490
  };
229
491
  };
230
492
  };
231
493
  uploadAgentKnowledge: {
232
494
  parameters: {
495
+ header: {
496
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
497
+ };
233
498
  path: {
234
- agentId: components['parameters']['AgentId'];
499
+ agentId: components["parameters"]["AgentId"];
235
500
  };
236
501
  };
237
502
  requestBody: {
238
503
  content: {
239
- 'application/json': components['schemas']['KnowledgeUploadRequest'];
504
+ "application/json": components["schemas"]["KnowledgeUploadRequest"];
240
505
  };
241
506
  };
242
507
  responses: {
243
508
  202: {
244
509
  content: {
245
- 'application/json': components['schemas']['KnowledgeUploadResponse'];
510
+ "application/json": components["schemas"]["KnowledgeUploadResponse"];
246
511
  };
247
512
  };
248
513
  400: {
249
514
  content: {
250
- 'application/json': components['schemas']['ErrorResponse'];
515
+ "application/json": components["schemas"]["ErrorResponse"];
251
516
  };
252
517
  };
253
518
  409: {
254
519
  content: {
255
- 'application/json': components['schemas']['ErrorResponse'];
520
+ "application/json": components["schemas"]["ErrorResponse"];
256
521
  };
257
522
  };
258
523
  };
259
524
  };
260
525
  listAgentKnowledgeBases: {
261
526
  parameters: {
527
+ query?: {
528
+ page?: components["parameters"]["PageParam"];
529
+ limit?: components["parameters"]["LimitParam"];
530
+ sort?: components["parameters"]["SortParam"];
531
+ fields?: components["parameters"]["FieldsParam"];
532
+ include?: components["parameters"]["IncludeParam"];
533
+ q?: components["parameters"]["SearchParam"];
534
+ filter?: components["parameters"]["FilterParam"];
535
+ or?: components["parameters"]["OrParam"];
536
+ };
537
+ header: {
538
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
539
+ };
262
540
  path: {
263
- agentId: components['parameters']['AgentId'];
541
+ agentId: components["parameters"]["AgentId"];
264
542
  };
265
543
  };
266
544
  responses: {
267
545
  200: {
268
546
  content: {
269
- 'application/json': {
270
- data?: components['schemas']['KnowledgeBaseSummary'][];
547
+ "application/json": {
548
+ data?: components["schemas"]["KnowledgeBaseSummary"][];
271
549
  agent_id?: string;
272
550
  };
273
551
  };
274
552
  };
275
553
  404: {
276
554
  content: {
277
- 'application/json': components['schemas']['ErrorResponse'];
555
+ "application/json": components["schemas"]["ErrorResponse"];
278
556
  };
279
557
  };
280
558
  };
281
559
  };
282
560
  listAgentKnowledgeUploads: {
283
561
  parameters: {
562
+ query?: {
563
+ page?: components["parameters"]["PageParam"];
564
+ limit?: components["parameters"]["LimitParam"];
565
+ sort?: components["parameters"]["SortParam"];
566
+ fields?: components["parameters"]["FieldsParam"];
567
+ include?: components["parameters"]["IncludeParam"];
568
+ q?: components["parameters"]["SearchParam"];
569
+ filter?: components["parameters"]["FilterParam"];
570
+ or?: components["parameters"]["OrParam"];
571
+ };
572
+ header: {
573
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
574
+ };
284
575
  path: {
285
- agentId: components['parameters']['AgentId'];
576
+ agentId: components["parameters"]["AgentId"];
286
577
  };
287
578
  };
288
579
  responses: {
289
580
  200: {
290
581
  content: {
291
- 'application/json': components['schemas']['KnowledgeUploadListResponse'];
582
+ "application/json": components["schemas"]["KnowledgeUploadListResponse"];
292
583
  };
293
584
  };
294
585
  };
@@ -297,95 +588,333 @@ type operations = {
297
588
  parameters: {
298
589
  query?: {
299
590
  versionId?: string;
591
+ page?: components["parameters"]["PageParam"];
592
+ limit?: components["parameters"]["LimitParam"];
593
+ sort?: components["parameters"]["SortParam"];
594
+ fields?: components["parameters"]["FieldsParam"];
595
+ q?: components["parameters"]["SearchParam"];
596
+ filter?: components["parameters"]["FilterParam"];
597
+ or?: components["parameters"]["OrParam"];
598
+ };
599
+ header: {
600
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
300
601
  };
301
602
  path: {
302
- agentId: components['parameters']['AgentId'];
603
+ agentId: components["parameters"]["AgentId"];
303
604
  };
304
605
  };
305
606
  responses: {
306
607
  200: {
307
608
  content: {
308
- 'application/json': {
309
- data?: components['schemas']['Instruction'][];
609
+ "application/json": {
610
+ data: components["schemas"]["Instruction"][];
310
611
  versionId?: string;
311
612
  };
312
613
  };
313
614
  };
314
615
  404: {
315
616
  content: {
316
- 'application/json': components['schemas']['ErrorResponse'];
617
+ "application/json": components["schemas"]["ErrorResponse"];
317
618
  };
318
619
  };
319
620
  };
320
621
  };
321
622
  createAgentInstruction: {
322
623
  parameters: {
624
+ header: {
625
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
626
+ };
323
627
  path: {
324
- agentId: components['parameters']['AgentId'];
628
+ agentId: components["parameters"]["AgentId"];
325
629
  };
326
630
  };
327
631
  requestBody: {
328
632
  content: {
329
- 'application/json': components['schemas']['CreateInstructionRequest'];
633
+ "application/json": components["schemas"]["CreateInstructionRequest"];
330
634
  };
331
635
  };
332
636
  responses: {
333
637
  201: {
334
638
  content: {
335
- 'application/json': components['schemas']['InstructionCreatedResponse'];
639
+ "application/json": components["schemas"]["InstructionCreatedResponse"];
336
640
  };
337
641
  };
338
642
  400: {
339
643
  content: {
340
- 'application/json': components['schemas']['ErrorResponse'];
644
+ "application/json": components["schemas"]["ErrorResponse"];
341
645
  };
342
646
  };
343
647
  409: {
344
648
  content: {
345
- 'application/json': components['schemas']['ErrorResponse'];
649
+ "application/json": components["schemas"]["ErrorResponse"];
650
+ };
651
+ };
652
+ };
653
+ };
654
+ updateAgentInstruction: {
655
+ parameters: {
656
+ header: {
657
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
658
+ };
659
+ path: {
660
+ agentId: components["parameters"]["AgentId"];
661
+ instructionId: components["parameters"]["InstructionId"];
662
+ };
663
+ };
664
+ requestBody: {
665
+ content: {
666
+ "application/json": components["schemas"]["UpdateInstructionRequest"];
667
+ };
668
+ };
669
+ responses: {
670
+ 200: {
671
+ content: {
672
+ "application/json": components["schemas"]["Instruction"];
673
+ };
674
+ };
675
+ 400: {
676
+ content: {
677
+ "application/json": components["schemas"]["ErrorResponse"];
678
+ };
679
+ };
680
+ 404: {
681
+ content: {
682
+ "application/json": components["schemas"]["ErrorResponse"];
683
+ };
684
+ };
685
+ };
686
+ };
687
+ getAgentSchedule: {
688
+ parameters: {
689
+ header: {
690
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
691
+ };
692
+ path: {
693
+ agentId: components["parameters"]["AgentId"];
694
+ };
695
+ };
696
+ responses: {
697
+ 200: {
698
+ content: {
699
+ "application/json": components["schemas"]["AgentSchedule"];
700
+ };
701
+ };
702
+ 404: {
703
+ content: {
704
+ "application/json": components["schemas"]["ErrorResponse"];
705
+ };
706
+ };
707
+ };
708
+ };
709
+ updateAgentSchedule: {
710
+ parameters: {
711
+ header: {
712
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
713
+ };
714
+ path: {
715
+ agentId: components["parameters"]["AgentId"];
716
+ };
717
+ };
718
+ requestBody: {
719
+ content: {
720
+ "application/json": components["schemas"]["UpdateAgentScheduleRequest"];
721
+ };
722
+ };
723
+ responses: {
724
+ 200: {
725
+ content: {
726
+ "application/json": components["schemas"]["AgentSchedule"];
727
+ };
728
+ };
729
+ 400: {
730
+ content: {
731
+ "application/json": components["schemas"]["ErrorResponse"];
732
+ };
733
+ };
734
+ 404: {
735
+ content: {
736
+ "application/json": components["schemas"]["ErrorResponse"];
737
+ };
738
+ };
739
+ };
740
+ };
741
+ listAgentVersions: {
742
+ parameters: {
743
+ query?: {
744
+ status?: "draft" | "published" | "archived";
745
+ page?: components["parameters"]["PageParam"];
746
+ limit?: components["parameters"]["LimitParam"];
747
+ sort?: components["parameters"]["SortParam"];
748
+ fields?: components["parameters"]["FieldsParam"];
749
+ include?: components["parameters"]["IncludeParam"];
750
+ q?: components["parameters"]["SearchParam"];
751
+ filter?: components["parameters"]["FilterParam"];
752
+ or?: components["parameters"]["OrParam"];
753
+ };
754
+ header: {
755
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
756
+ };
757
+ path: {
758
+ agentId: components["parameters"]["AgentId"];
759
+ };
760
+ };
761
+ responses: {
762
+ 200: {
763
+ content: {
764
+ "application/json": components["schemas"]["AgentVersionListResponse"];
765
+ };
766
+ };
767
+ };
768
+ };
769
+ createAgentVersion: {
770
+ parameters: {
771
+ header: {
772
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
773
+ };
774
+ path: {
775
+ agentId: components["parameters"]["AgentId"];
776
+ };
777
+ };
778
+ requestBody: {
779
+ content: {
780
+ "application/json": components["schemas"]["CreateAgentVersionRequest"];
781
+ };
782
+ };
783
+ responses: {
784
+ 201: {
785
+ content: {
786
+ "application/json": components["schemas"]["AgentVersionDetail"];
787
+ };
788
+ };
789
+ 400: {
790
+ content: {
791
+ "application/json": components["schemas"]["ErrorResponse"];
792
+ };
793
+ };
794
+ };
795
+ };
796
+ getAgentVersion: {
797
+ parameters: {
798
+ header: {
799
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
800
+ };
801
+ path: {
802
+ agentId: components["parameters"]["AgentId"];
803
+ versionId: components["parameters"]["VersionId"];
804
+ };
805
+ };
806
+ responses: {
807
+ 200: {
808
+ content: {
809
+ "application/json": components["schemas"]["AgentVersionDetail"];
810
+ };
811
+ };
812
+ 404: {
813
+ content: {
814
+ "application/json": components["schemas"]["ErrorResponse"];
815
+ };
816
+ };
817
+ };
818
+ };
819
+ deleteAgentInstruction: {
820
+ parameters: {
821
+ header: {
822
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
823
+ };
824
+ path: {
825
+ agentId: components["parameters"]["AgentId"];
826
+ instructionId: components["parameters"]["InstructionId"];
827
+ };
828
+ };
829
+ responses: {
830
+ 204: {
831
+ content: never;
832
+ };
833
+ 404: {
834
+ content: {
835
+ "application/json": components["schemas"]["ErrorResponse"];
836
+ };
837
+ };
838
+ };
839
+ };
840
+ updateAgentVersion: {
841
+ parameters: {
842
+ header: {
843
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
844
+ };
845
+ path: {
846
+ agentId: components["parameters"]["AgentId"];
847
+ versionId: components["parameters"]["VersionId"];
848
+ };
849
+ };
850
+ requestBody: {
851
+ content: {
852
+ "application/json": components["schemas"]["UpdateAgentVersionRequest"];
853
+ };
854
+ };
855
+ responses: {
856
+ 200: {
857
+ content: {
858
+ "application/json": components["schemas"]["AgentVersionDetail"];
859
+ };
860
+ };
861
+ 400: {
862
+ content: {
863
+ "application/json": components["schemas"]["ErrorResponse"];
864
+ };
865
+ };
866
+ 404: {
867
+ content: {
868
+ "application/json": components["schemas"]["ErrorResponse"];
346
869
  };
347
870
  };
348
871
  };
349
872
  };
350
873
  connectAgentPhone: {
351
874
  parameters: {
875
+ header: {
876
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
877
+ };
352
878
  path: {
353
- agentId: components['parameters']['AgentId'];
879
+ agentId: components["parameters"]["AgentId"];
354
880
  };
355
881
  };
356
882
  requestBody: {
357
883
  content: {
358
- 'application/json': components['schemas']['ConnectPhoneRequest'];
884
+ "application/json": components["schemas"]["ConnectPhoneRequest"];
359
885
  };
360
886
  };
361
887
  responses: {
362
888
  200: {
363
889
  content: {
364
- 'application/json': components['schemas']['PhoneAssignmentResponse'];
890
+ "application/json": components["schemas"]["PhoneAssignmentResponse"];
365
891
  };
366
892
  };
367
893
  400: {
368
894
  content: {
369
- 'application/json': components['schemas']['ErrorResponse'];
895
+ "application/json": components["schemas"]["ErrorResponse"];
370
896
  };
371
897
  };
372
898
  404: {
373
899
  content: {
374
- 'application/json': components['schemas']['ErrorResponse'];
900
+ "application/json": components["schemas"]["ErrorResponse"];
375
901
  };
376
902
  };
377
903
  409: {
378
904
  content: {
379
- 'application/json': components['schemas']['ErrorResponse'];
905
+ "application/json": components["schemas"]["ErrorResponse"];
380
906
  };
381
907
  };
382
908
  };
383
909
  };
384
910
  disconnectAgentPhone: {
385
911
  parameters: {
912
+ header: {
913
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
914
+ };
386
915
  path: {
387
- agentId: components['parameters']['AgentId'];
388
- phoneId: components['parameters']['PhoneId'];
916
+ agentId: components["parameters"]["AgentId"];
917
+ phoneId: components["parameters"]["PhoneId"];
389
918
  };
390
919
  };
391
920
  responses: {
@@ -394,12 +923,12 @@ type operations = {
394
923
  };
395
924
  404: {
396
925
  content: {
397
- 'application/json': components['schemas']['ErrorResponse'];
926
+ "application/json": components["schemas"]["ErrorResponse"];
398
927
  };
399
928
  };
400
929
  409: {
401
930
  content: {
402
- 'application/json': components['schemas']['ErrorResponse'];
931
+ "application/json": components["schemas"]["ErrorResponse"];
403
932
  };
404
933
  };
405
934
  };
@@ -407,16 +936,24 @@ type operations = {
407
936
  listWorkspacePhones: {
408
937
  parameters: {
409
938
  query?: {
410
- channel?: 'voice';
939
+ channel?: "voice";
940
+ page?: components["parameters"]["PageParam"];
941
+ limit?: components["parameters"]["LimitParam"];
942
+ sort?: components["parameters"]["SortParam"];
943
+ fields?: components["parameters"]["FieldsParam"];
944
+ include?: components["parameters"]["IncludeParam"];
945
+ q?: components["parameters"]["SearchParam"];
946
+ filter?: components["parameters"]["FilterParam"];
947
+ or?: components["parameters"]["OrParam"];
411
948
  };
412
949
  path: {
413
- workspaceId: components['parameters']['WorkspaceId'];
950
+ workspaceId: components["parameters"]["WorkspaceId"];
414
951
  };
415
952
  };
416
953
  responses: {
417
954
  200: {
418
955
  content: {
419
- 'application/json': components['schemas']['WorkspacePhonesResponse'];
956
+ "application/json": components["schemas"]["WorkspacePhonesResponse"];
420
957
  };
421
958
  };
422
959
  };
@@ -424,38 +961,50 @@ type operations = {
424
961
  enableWorkspace: {
425
962
  parameters: {
426
963
  path: {
427
- workspaceId: components['parameters']['WorkspaceId'];
964
+ workspaceId: components["parameters"]["WorkspaceId"];
428
965
  };
429
966
  };
430
967
  requestBody: {
431
968
  content: {
432
- 'application/json': components['schemas']['WorkspaceEnableRequest'];
969
+ "application/json": components["schemas"]["WorkspaceEnableRequest"];
433
970
  };
434
971
  };
435
972
  responses: {
436
973
  200: {
437
974
  content: {
438
- 'application/json': components['schemas']['WorkspaceEnableResponse'];
975
+ "application/json": components["schemas"]["WorkspaceEnableResponse"];
439
976
  };
440
977
  };
441
978
  400: {
442
979
  content: {
443
- 'application/json': components['schemas']['ErrorResponse'];
980
+ "application/json": components["schemas"]["ErrorResponse"];
444
981
  };
445
982
  };
446
983
  502: {
447
984
  content: {
448
- 'application/json': components['schemas']['ErrorResponse'];
985
+ "application/json": components["schemas"]["ErrorResponse"];
449
986
  };
450
987
  };
451
988
  };
452
989
  };
453
990
  listTools: {
991
+ parameters: {
992
+ query?: {
993
+ page?: components["parameters"]["PageParam"];
994
+ limit?: components["parameters"]["LimitParam"];
995
+ sort?: components["parameters"]["SortParam"];
996
+ fields?: components["parameters"]["FieldsParam"];
997
+ include?: components["parameters"]["IncludeParam"];
998
+ q?: components["parameters"]["SearchParam"];
999
+ filter?: components["parameters"]["FilterParam"];
1000
+ or?: components["parameters"]["OrParam"];
1001
+ };
1002
+ };
454
1003
  responses: {
455
1004
  200: {
456
1005
  content: {
457
- 'application/json': {
458
- data?: components['schemas']['ToolSummary'][];
1006
+ "application/json": {
1007
+ data?: components["schemas"]["ToolSummary"][];
459
1008
  };
460
1009
  };
461
1010
  };
@@ -464,39 +1013,92 @@ type operations = {
464
1013
  executeTool: {
465
1014
  parameters: {
466
1015
  path: {
467
- toolId: components['parameters']['ToolId'];
1016
+ toolId: components["parameters"]["ToolId"];
468
1017
  };
469
1018
  };
470
1019
  requestBody: {
471
1020
  content: {
472
- 'application/json': components['schemas']['ExecuteToolRequest'];
1021
+ "application/json": components["schemas"]["ExecuteToolRequest"];
473
1022
  };
474
1023
  };
475
1024
  responses: {
476
1025
  200: {
477
1026
  content: {
478
- 'application/json': components['schemas']['ExecuteToolResponse'];
1027
+ "application/json": components["schemas"]["ExecuteToolResponse"];
479
1028
  };
480
1029
  };
481
1030
  400: {
482
1031
  content: {
483
- 'application/json': components['schemas']['ErrorResponse'];
1032
+ "application/json": components["schemas"]["ErrorResponse"];
484
1033
  };
485
1034
  };
486
1035
  404: {
487
1036
  content: {
488
- 'application/json': components['schemas']['ErrorResponse'];
1037
+ "application/json": components["schemas"]["ErrorResponse"];
489
1038
  };
490
1039
  };
491
1040
  409: {
492
1041
  content: {
493
- 'application/json': components['schemas']['ErrorResponse'];
1042
+ "application/json": components["schemas"]["ErrorResponse"];
1043
+ };
1044
+ };
1045
+ };
1046
+ };
1047
+ listVoices: {
1048
+ parameters: {
1049
+ query?: {
1050
+ agentId?: string;
1051
+ agentVersionId?: string;
1052
+ gender?: "female" | "male" | "neutral";
1053
+ locale?: string;
1054
+ page?: components["parameters"]["PageParam"];
1055
+ limit?: components["parameters"]["LimitParam"];
1056
+ sort?: components["parameters"]["SortParam"];
1057
+ fields?: components["parameters"]["FieldsParam"];
1058
+ include?: components["parameters"]["IncludeParam"];
1059
+ q?: components["parameters"]["SearchParam"];
1060
+ filter?: components["parameters"]["FilterParam"];
1061
+ or?: components["parameters"]["OrParam"];
1062
+ };
1063
+ header: {
1064
+ "x-workspace-id": components["parameters"]["XWorkspaceId"];
1065
+ };
1066
+ };
1067
+ responses: {
1068
+ 200: {
1069
+ content: {
1070
+ "application/json": components["schemas"]["VoiceListResponse"];
1071
+ };
1072
+ };
1073
+ 400: {
1074
+ content: {
1075
+ "application/json": components["schemas"]["ErrorResponse"];
494
1076
  };
495
1077
  };
496
1078
  };
497
1079
  };
498
1080
  };
499
1081
 
1082
+ type QueryValue = components['schemas']['QueryValue'];
1083
+ type QueryFilterOperators = components['schemas']['QueryFilterOperators'];
1084
+ type QueryFilters = components['schemas']['QueryFilters'];
1085
+ type QueryOrGroups = components['schemas']['QueryOrGroups'];
1086
+ type PaginationMeta = components['schemas']['PaginationMeta'];
1087
+ type QueryBuilderSerializable = {
1088
+ build: () => string;
1089
+ toString?: () => string;
1090
+ };
1091
+ type QueryBuilderInput = string | QueryBuilderSerializable | undefined | null;
1092
+ type ListQueryOptions = Partial<{
1093
+ page: number;
1094
+ limit: number;
1095
+ sort: string | string[];
1096
+ fields: string | string[];
1097
+ include: string | string[];
1098
+ search: string;
1099
+ filter: QueryFilters | QueryBuilderInput;
1100
+ or: QueryOrGroups | QueryBuilderInput;
1101
+ }>;
500
1102
  type ClientConfig = {
501
1103
  baseUrl: string;
502
1104
  headers?: Record<string, string>;
@@ -510,6 +1112,10 @@ type ClientConfig = {
510
1112
  getWorkspaceId?: () => string | undefined;
511
1113
  };
512
1114
  type AgentDetail = components['schemas']['AgentDetail'];
1115
+ type AgentSummary = components['schemas']['AgentSummary'];
1116
+ type AgentListResponse = components['schemas']['AgentListResponse'];
1117
+ type CreateAgentRequest = components['schemas']['CreateAgentRequest'];
1118
+ type UpdateAgentRequest = components['schemas']['UpdateAgentRequest'];
513
1119
  type KnowledgeUploadRequest = components['schemas']['KnowledgeUploadRequest'];
514
1120
  type KnowledgeUploadResponse = components['schemas']['KnowledgeUploadResponse'];
515
1121
  type KnowledgeUploadListResponse = components['schemas']['KnowledgeUploadListResponse'];
@@ -519,6 +1125,7 @@ type Instruction = components['schemas']['Instruction'];
519
1125
  type CreateInstructionRequest = components['schemas']['CreateInstructionRequest'];
520
1126
  type InstructionCreatedResponse = components['schemas']['InstructionCreatedResponse'];
521
1127
  type AgentInstructionsResponse = paths['/v1/agents/{agentId}/instructions']['get']['responses'][200]['content']['application/json'];
1128
+ type UpdateInstructionRequest = components['schemas']['UpdateInstructionRequest'];
522
1129
  type ConnectPhoneRequest = components['schemas']['ConnectPhoneRequest'];
523
1130
  type PhoneAssignmentResponse = components['schemas']['PhoneAssignmentResponse'];
524
1131
  type WorkspacePhone = components['schemas']['WorkspacePhone'];
@@ -526,6 +1133,15 @@ type WorkspacePhonesResponse = components['schemas']['WorkspacePhonesResponse'];
526
1133
  type WorkspacePhoneChannel = 'voice';
527
1134
  type WorkspaceEnableRequest = components['schemas']['WorkspaceEnableRequest'];
528
1135
  type WorkspaceEnableResponse = components['schemas']['WorkspaceEnableResponse'];
1136
+ type VoiceSummary = components['schemas']['VoiceSummary'];
1137
+ type VoiceListResponse = components['schemas']['VoiceListResponse'];
1138
+ type AgentSchedule = components['schemas']['AgentSchedule'];
1139
+ type UpdateAgentScheduleRequest = components['schemas']['UpdateAgentScheduleRequest'];
1140
+ type AgentVersionSummary = components['schemas']['AgentVersionSummary'];
1141
+ type AgentVersionDetail = components['schemas']['AgentVersionDetail'];
1142
+ type AgentVersionListResponse = components['schemas']['AgentVersionListResponse'];
1143
+ type CreateAgentVersionRequest = components['schemas']['CreateAgentVersionRequest'];
1144
+ type UpdateAgentVersionRequest = components['schemas']['UpdateAgentVersionRequest'];
529
1145
  type ToolSummary = components['schemas']['ToolSummary'];
530
1146
  type ExecuteToolRequest = components['schemas']['ExecuteToolRequest'];
531
1147
  type ExecuteToolResponse = components['schemas']['ExecuteToolResponse'];
@@ -556,53 +1172,273 @@ type RetryPolicy = {
556
1172
  retryOn?: (err: unknown, attempt: number) => boolean;
557
1173
  };
558
1174
 
559
- declare function createAgentsApi(cfg: ClientConfig & {
1175
+ type ListAgentInstructionsOptions = ListQueryOptions & {
1176
+ versionId?: string;
1177
+ };
1178
+ declare function createAgentInstructionsApi(cfg: ClientConfig & {
560
1179
  retry?: RetryPolicy;
561
1180
  }): {
562
- get(agentId: string): Promise<AgentDetail>;
563
- delete(agentId: string): Promise<void>;
1181
+ list(agentId: string, opts?: ListAgentInstructionsOptions): Promise<AgentInstructionsResponse>;
1182
+ create(agentId: string, payload: CreateInstructionRequest): Promise<InstructionCreatedResponse>;
1183
+ update(agentId: string, instructionId: string, payload: UpdateInstructionRequest): Promise<Instruction>;
1184
+ delete(agentId: string, instructionId: string): Promise<void>;
564
1185
  };
565
1186
 
1187
+ type ListAgentKnowledgeOptions = ListQueryOptions;
566
1188
  declare function createAgentKnowledgeApi(cfg: ClientConfig & {
567
1189
  retry?: RetryPolicy;
568
1190
  }): {
569
1191
  upload(agentId: string, payload: KnowledgeUploadRequest): Promise<KnowledgeUploadResponse>;
570
- listBases(agentId: string): Promise<AgentKnowledgeBasesResponse>;
571
- listUploads(agentId: string): Promise<AgentKnowledgeUploadsResponse>;
1192
+ listBases(agentId: string, opts?: ListAgentKnowledgeOptions): Promise<AgentKnowledgeBasesResponse>;
1193
+ listUploads(agentId: string, opts?: ListAgentKnowledgeOptions): Promise<AgentKnowledgeUploadsResponse>;
572
1194
  };
573
1195
 
574
- declare function createAgentInstructionsApi(cfg: ClientConfig & {
1196
+ declare function createAgentPhonesApi(cfg: ClientConfig & {
575
1197
  retry?: RetryPolicy;
576
1198
  }): {
577
- list(agentId: string, opts?: {
578
- versionId?: string;
579
- }): Promise<AgentInstructionsResponse>;
580
- create(agentId: string, payload: CreateInstructionRequest): Promise<InstructionCreatedResponse>;
1199
+ connect(agentId: string, payload: ConnectPhoneRequest): Promise<PhoneAssignmentResponse>;
1200
+ disconnect(agentId: string, phoneId: string): Promise<void>;
581
1201
  };
582
1202
 
583
- declare function createAgentPhonesApi(cfg: ClientConfig & {
1203
+ declare function createAgentScheduleApi(cfg: ClientConfig & {
584
1204
  retry?: RetryPolicy;
585
1205
  }): {
586
- connect(agentId: string, payload: ConnectPhoneRequest): Promise<PhoneAssignmentResponse>;
587
- disconnect(agentId: string, phoneId: string): Promise<void>;
1206
+ get(agentId: string): Promise<AgentSchedule>;
1207
+ update(agentId: string, payload: UpdateAgentScheduleRequest): Promise<AgentSchedule>;
588
1208
  };
589
1209
 
590
- declare function createWorkspacesApi(cfg: ClientConfig & {
1210
+ type ListAgentVersionsOptions = {
1211
+ status?: 'draft' | 'published' | 'archived';
1212
+ } & ListQueryOptions;
1213
+ declare function createAgentVersionsApi(cfg: ClientConfig & {
591
1214
  retry?: RetryPolicy;
592
1215
  }): {
593
- listPhones(workspaceId: string, opts?: {
594
- channel?: WorkspacePhoneChannel;
595
- }): Promise<WorkspacePhonesResponse>;
596
- enable(workspaceId: string, payload: WorkspaceEnableRequest): Promise<WorkspaceEnableResponse>;
1216
+ list(agentId: string, opts?: ListAgentVersionsOptions): Promise<AgentVersionListResponse>;
1217
+ get(agentId: string, versionId: string): Promise<AgentVersionDetail>;
1218
+ create(agentId: string, payload: CreateAgentVersionRequest): Promise<AgentVersionDetail>;
1219
+ update(agentId: string, versionId: string, payload: UpdateAgentVersionRequest): Promise<AgentVersionDetail>;
1220
+ };
1221
+
1222
+ type AgentInstructionsApi = ReturnType<typeof createAgentInstructionsApi>;
1223
+ type AgentKnowledgeApi = ReturnType<typeof createAgentKnowledgeApi>;
1224
+ type AgentPhonesApi = ReturnType<typeof createAgentPhonesApi>;
1225
+ type AgentScheduleApi = ReturnType<typeof createAgentScheduleApi>;
1226
+ type AgentVersionsApi = ReturnType<typeof createAgentVersionsApi>;
1227
+ type AgentInstructionsHelper = ReturnType<typeof bindAgentInstructions>;
1228
+ type AgentKnowledgeHelper = ReturnType<typeof bindAgentKnowledge>;
1229
+ type AgentPhonesHelper = ReturnType<typeof bindAgentPhones>;
1230
+ type AgentScheduleHelper = ReturnType<typeof bindAgentSchedule>;
1231
+ type AgentVersionsHelper = ReturnType<typeof bindAgentVersions>;
1232
+ type AgentBase = AgentSummary & Partial<Omit<AgentDetail, keyof AgentSummary>>;
1233
+ interface AgentEntity extends AgentBase {
1234
+ instructions: AgentInstructionsHelper;
1235
+ knowledge: AgentKnowledgeHelper;
1236
+ phones: AgentPhonesHelper;
1237
+ schedule: AgentScheduleHelper;
1238
+ versions: AgentVersionsHelper;
1239
+ refresh(): Promise<AgentEntity>;
1240
+ }
1241
+ type AgentEntityFactoryOptions = {
1242
+ instructionsApi: AgentInstructionsApi;
1243
+ knowledgeApi: AgentKnowledgeApi;
1244
+ phonesApi: AgentPhonesApi;
1245
+ scheduleApi: AgentScheduleApi;
1246
+ versionsApi: AgentVersionsApi;
1247
+ reload(agentId: string): Promise<AgentEntity>;
1248
+ };
1249
+ declare const bindAgentInstructions: (api: AgentInstructionsApi, agentId: string) => {
1250
+ list(opts?: ListAgentInstructionsOptions): Promise<{
1251
+ data: components["schemas"]["Instruction"][];
1252
+ versionId?: string;
1253
+ }>;
1254
+ create(payload: CreateInstructionRequest): Promise<{
1255
+ id: string;
1256
+ versionId: string;
1257
+ order: number;
1258
+ createdAt: string;
1259
+ }>;
1260
+ update(instructionId: string, payload: UpdateInstructionRequest): Promise<{
1261
+ id: string;
1262
+ versionId: string;
1263
+ order: number;
1264
+ content: string;
1265
+ createdAt?: string;
1266
+ updatedAt?: string;
1267
+ }>;
1268
+ delete(instructionId: string): Promise<void>;
1269
+ };
1270
+ declare const bindAgentKnowledge: (api: AgentKnowledgeApi, agentId: string) => {
1271
+ upload(payload: KnowledgeUploadRequest): Promise<{
1272
+ document_id: string;
1273
+ file_path: string;
1274
+ file_name: string;
1275
+ source: string;
1276
+ drive_file_id?: string | null;
1277
+ user_id: string;
1278
+ status: "queued" | "processing" | "completed" | "failed";
1279
+ }>;
1280
+ listBases(opts?: ListAgentKnowledgeOptions): Promise<{
1281
+ data?: components["schemas"]["KnowledgeBaseSummary"][];
1282
+ agent_id?: string;
1283
+ }>;
1284
+ listUploads(opts?: ListAgentKnowledgeOptions): Promise<{
1285
+ data: ({
1286
+ document_id: string;
1287
+ file_path: string;
1288
+ file_name: string;
1289
+ source: string;
1290
+ drive_file_id?: string | null;
1291
+ user_id: string;
1292
+ status: "queued" | "processing" | "completed" | "failed";
1293
+ })[];
1294
+ }>;
1295
+ };
1296
+ declare const bindAgentPhones: (api: AgentPhonesApi, agentId: string) => {
1297
+ connect(payload: ConnectPhoneRequest): Promise<{
1298
+ agent_id: string;
1299
+ phone_id: string;
1300
+ allow_all: boolean;
1301
+ test_phones?: string[];
1302
+ channel?: string | null;
1303
+ assigned_at?: string | null;
1304
+ }>;
1305
+ disconnect(phoneId: string): Promise<void>;
1306
+ };
1307
+ declare const bindAgentSchedule: (api: AgentScheduleApi, agentId: string) => {
1308
+ get(): Promise<{
1309
+ agentId: string;
1310
+ timezone: string;
1311
+ rules: components["schemas"]["AgentScheduleRule"][];
1312
+ metadata?: {
1313
+ [key: string]: unknown;
1314
+ };
1315
+ }>;
1316
+ update(payload: UpdateAgentScheduleRequest): Promise<{
1317
+ agentId: string;
1318
+ timezone: string;
1319
+ rules: components["schemas"]["AgentScheduleRule"][];
1320
+ metadata?: {
1321
+ [key: string]: unknown;
1322
+ };
1323
+ }>;
1324
+ };
1325
+ declare const bindAgentVersions: (api: AgentVersionsApi, agentId: string) => {
1326
+ list(opts?: ListAgentVersionsOptions): Promise<{
1327
+ data: components["schemas"]["AgentVersionSummary"][];
1328
+ meta?: components["schemas"]["PaginationMeta"];
1329
+ }>;
1330
+ get(versionId: string): Promise<{
1331
+ versionId: string;
1332
+ agentId: string;
1333
+ label: string;
1334
+ status: "draft" | "published" | "archived";
1335
+ isActive?: boolean;
1336
+ createdAt: string;
1337
+ updatedAt?: string;
1338
+ publishedAt?: string | null;
1339
+ } & {
1340
+ description?: string;
1341
+ metadata?: {
1342
+ [key: string]: unknown;
1343
+ };
1344
+ instructionsVersionId?: string;
1345
+ }>;
1346
+ create(payload: CreateAgentVersionRequest): Promise<{
1347
+ versionId: string;
1348
+ agentId: string;
1349
+ label: string;
1350
+ status: "draft" | "published" | "archived";
1351
+ isActive?: boolean;
1352
+ createdAt: string;
1353
+ updatedAt?: string;
1354
+ publishedAt?: string | null;
1355
+ } & {
1356
+ description?: string;
1357
+ metadata?: {
1358
+ [key: string]: unknown;
1359
+ };
1360
+ instructionsVersionId?: string;
1361
+ }>;
1362
+ update(versionId: string, payload: UpdateAgentVersionRequest): Promise<{
1363
+ versionId: string;
1364
+ agentId: string;
1365
+ label: string;
1366
+ status: "draft" | "published" | "archived";
1367
+ isActive?: boolean;
1368
+ createdAt: string;
1369
+ updatedAt?: string;
1370
+ publishedAt?: string | null;
1371
+ } & {
1372
+ description?: string;
1373
+ metadata?: {
1374
+ [key: string]: unknown;
1375
+ };
1376
+ instructionsVersionId?: string;
1377
+ }>;
1378
+ };
1379
+ type AgentSnapshot = AgentDetail | AgentSummary;
1380
+ declare const createAgentEntity: (dto: AgentSnapshot, options: AgentEntityFactoryOptions) => AgentEntity;
1381
+
1382
+ type AgentEntityDependencies = {
1383
+ instructionsApi: ReturnType<typeof createAgentInstructionsApi>;
1384
+ knowledgeApi: ReturnType<typeof createAgentKnowledgeApi>;
1385
+ phonesApi: ReturnType<typeof createAgentPhonesApi>;
1386
+ scheduleApi: ReturnType<typeof createAgentScheduleApi>;
1387
+ versionsApi: ReturnType<typeof createAgentVersionsApi>;
1388
+ };
1389
+ type ListAgentsOptions = ListQueryOptions;
1390
+ type AgentsApi = {
1391
+ list(options?: ListAgentsOptions): Promise<AgentListResponse>;
1392
+ get(agentId: string): Promise<AgentDetail>;
1393
+ create(payload: CreateAgentRequest): Promise<AgentDetail>;
1394
+ update(agentId: string, payload: UpdateAgentRequest): Promise<AgentDetail>;
1395
+ delete(agentId: string): Promise<void>;
1396
+ };
1397
+ type AgentListResponseWithEntities = Omit<AgentListResponse, 'data'> & {
1398
+ data: AgentEntity[];
597
1399
  };
1400
+ type AgentsApiWithEntities = Omit<AgentsApi, 'get' | 'create' | 'update' | 'list'> & {
1401
+ list(options?: ListAgentsOptions): Promise<AgentListResponseWithEntities>;
1402
+ get(agentId: string): Promise<AgentEntity>;
1403
+ create(payload: CreateAgentRequest): Promise<AgentEntity>;
1404
+ update(agentId: string, payload: UpdateAgentRequest): Promise<AgentEntity>;
1405
+ };
1406
+ declare function createAgentsApi(cfg: ClientConfig & {
1407
+ retry?: RetryPolicy;
1408
+ }, relatedApis?: AgentEntityDependencies): AgentsApi | AgentsApiWithEntities;
598
1409
 
1410
+ type ListToolsOptions = ListQueryOptions;
599
1411
  declare function createToolsApi(cfg: ClientConfig & {
600
1412
  retry?: RetryPolicy;
601
1413
  }): {
602
- list(): Promise<ToolsCatalogResponse>;
1414
+ list(options?: ListToolsOptions): Promise<ToolsCatalogResponse>;
603
1415
  execute(toolId: string, payload: ExecuteToolRequest): Promise<ExecuteToolResponse>;
604
1416
  };
605
1417
 
1418
+ type ListVoicesOptions = ListQueryOptions & {
1419
+ agentId?: string;
1420
+ agentVersionId?: string;
1421
+ gender?: 'female' | 'male' | 'neutral';
1422
+ locale?: string;
1423
+ page?: number;
1424
+ pageSize?: number;
1425
+ };
1426
+ declare function createVoicesApi(cfg: ClientConfig & {
1427
+ retry?: RetryPolicy;
1428
+ }): {
1429
+ list(options?: ListVoicesOptions): Promise<VoiceListResponse>;
1430
+ };
1431
+
1432
+ type ListWorkspacePhonesOptions = ListQueryOptions & {
1433
+ channel?: WorkspacePhoneChannel;
1434
+ };
1435
+ declare function createWorkspacesApi(cfg: ClientConfig & {
1436
+ retry?: RetryPolicy;
1437
+ }): {
1438
+ listPhones(workspaceId: string, opts?: ListWorkspacePhonesOptions): Promise<WorkspacePhonesResponse>;
1439
+ enable(workspaceId: string, payload: WorkspaceEnableRequest): Promise<WorkspaceEnableResponse>;
1440
+ };
1441
+
606
1442
  declare function createClient(initialCfg: ClientConfig & {
607
1443
  retry?: RetryPolicy;
608
1444
  }): {
@@ -622,65 +1458,109 @@ declare function createClient(initialCfg: ClientConfig & {
622
1458
  agents: {
623
1459
  knowledge: {
624
1460
  upload(agentId: string, payload: KnowledgeUploadRequest): Promise<KnowledgeUploadResponse>;
625
- listBases(agentId: string): Promise<AgentKnowledgeBasesResponse>;
626
- listUploads(agentId: string): Promise<AgentKnowledgeUploadsResponse>;
1461
+ listBases(agentId: string, opts?: ListAgentKnowledgeOptions): Promise<AgentKnowledgeBasesResponse>;
1462
+ listUploads(agentId: string, opts?: ListAgentKnowledgeOptions): Promise<AgentKnowledgeUploadsResponse>;
627
1463
  };
628
1464
  instructions: {
629
- list(agentId: string, opts?: {
630
- versionId?: string;
631
- }): Promise<AgentInstructionsResponse>;
1465
+ list(agentId: string, opts?: ListAgentInstructionsOptions): Promise<AgentInstructionsResponse>;
632
1466
  create(agentId: string, payload: CreateInstructionRequest): Promise<InstructionCreatedResponse>;
1467
+ update(agentId: string, instructionId: string, payload: UpdateInstructionRequest): Promise<Instruction>;
1468
+ delete(agentId: string, instructionId: string): Promise<void>;
633
1469
  };
634
1470
  phones: {
635
1471
  connect(agentId: string, payload: ConnectPhoneRequest): Promise<PhoneAssignmentResponse>;
636
1472
  disconnect(agentId: string, phoneId: string): Promise<void>;
637
1473
  };
638
- get(agentId: string): Promise<AgentDetail>;
639
- delete(agentId: string): Promise<void>;
1474
+ schedule: {
1475
+ get(agentId: string): Promise<AgentSchedule>;
1476
+ update(agentId: string, payload: UpdateAgentScheduleRequest): Promise<AgentSchedule>;
1477
+ };
1478
+ versions: {
1479
+ list(agentId: string, opts?: ListAgentVersionsOptions): Promise<AgentVersionListResponse>;
1480
+ get(agentId: string, versionId: string): Promise<AgentVersionDetail>;
1481
+ create(agentId: string, payload: CreateAgentVersionRequest): Promise<AgentVersionDetail>;
1482
+ update(agentId: string, versionId: string, payload: UpdateAgentVersionRequest): Promise<AgentVersionDetail>;
1483
+ };
1484
+ delete: (agentId: string) => Promise<void>;
1485
+ list(options?: ListAgentsOptions): Promise<Omit<{
1486
+ data: components["schemas"]["AgentSummary"][];
1487
+ meta: components["schemas"]["PaginationMeta"];
1488
+ }, "data"> & {
1489
+ data: AgentEntity[];
1490
+ }>;
1491
+ get(agentId: string): Promise<AgentEntity>;
1492
+ create(payload: CreateAgentRequest): Promise<AgentEntity>;
1493
+ update(agentId: string, payload: UpdateAgentRequest): Promise<AgentEntity>;
640
1494
  };
641
1495
  workspaces: {
642
- listPhones(workspaceId: string, opts?: {
643
- channel?: WorkspacePhoneChannel;
644
- }): Promise<WorkspacePhonesResponse>;
1496
+ listPhones(workspaceId: string, opts?: ListWorkspacePhonesOptions): Promise<WorkspacePhonesResponse>;
645
1497
  enable(workspaceId: string, payload: WorkspaceEnableRequest): Promise<WorkspaceEnableResponse>;
646
1498
  };
647
1499
  tools: {
648
- list(): Promise<ToolsCatalogResponse>;
1500
+ list(options?: ListToolsOptions): Promise<ToolsCatalogResponse>;
649
1501
  execute(toolId: string, payload: ExecuteToolRequest): Promise<ExecuteToolResponse>;
650
1502
  };
1503
+ voices: {
1504
+ list(options?: ListVoicesOptions): Promise<VoiceListResponse>;
1505
+ };
651
1506
  };
652
1507
  };
653
1508
  agents: {
654
1509
  knowledge: {
655
1510
  upload(agentId: string, payload: KnowledgeUploadRequest): Promise<KnowledgeUploadResponse>;
656
- listBases(agentId: string): Promise<AgentKnowledgeBasesResponse>;
657
- listUploads(agentId: string): Promise<AgentKnowledgeUploadsResponse>;
1511
+ listBases(agentId: string, opts?: ListAgentKnowledgeOptions): Promise<AgentKnowledgeBasesResponse>;
1512
+ listUploads(agentId: string, opts?: ListAgentKnowledgeOptions): Promise<AgentKnowledgeUploadsResponse>;
658
1513
  };
659
1514
  instructions: {
660
- list(agentId: string, opts?: {
661
- versionId?: string;
662
- }): Promise<AgentInstructionsResponse>;
1515
+ list(agentId: string, opts?: ListAgentInstructionsOptions): Promise<AgentInstructionsResponse>;
663
1516
  create(agentId: string, payload: CreateInstructionRequest): Promise<InstructionCreatedResponse>;
1517
+ update(agentId: string, instructionId: string, payload: UpdateInstructionRequest): Promise<Instruction>;
1518
+ delete(agentId: string, instructionId: string): Promise<void>;
664
1519
  };
665
1520
  phones: {
666
1521
  connect(agentId: string, payload: ConnectPhoneRequest): Promise<PhoneAssignmentResponse>;
667
1522
  disconnect(agentId: string, phoneId: string): Promise<void>;
668
1523
  };
669
- get(agentId: string): Promise<AgentDetail>;
670
- delete(agentId: string): Promise<void>;
1524
+ schedule: {
1525
+ get(agentId: string): Promise<AgentSchedule>;
1526
+ update(agentId: string, payload: UpdateAgentScheduleRequest): Promise<AgentSchedule>;
1527
+ };
1528
+ versions: {
1529
+ list(agentId: string, opts?: ListAgentVersionsOptions): Promise<AgentVersionListResponse>;
1530
+ get(agentId: string, versionId: string): Promise<AgentVersionDetail>;
1531
+ create(agentId: string, payload: CreateAgentVersionRequest): Promise<AgentVersionDetail>;
1532
+ update(agentId: string, versionId: string, payload: UpdateAgentVersionRequest): Promise<AgentVersionDetail>;
1533
+ };
1534
+ delete: (agentId: string) => Promise<void>;
1535
+ list(options?: ListAgentsOptions): Promise<Omit<{
1536
+ data: components["schemas"]["AgentSummary"][];
1537
+ meta: components["schemas"]["PaginationMeta"];
1538
+ }, "data"> & {
1539
+ data: AgentEntity[];
1540
+ }>;
1541
+ get(agentId: string): Promise<AgentEntity>;
1542
+ create(payload: CreateAgentRequest): Promise<AgentEntity>;
1543
+ update(agentId: string, payload: UpdateAgentRequest): Promise<AgentEntity>;
671
1544
  };
672
1545
  workspaces: {
673
- listPhones(workspaceId: string, opts?: {
674
- channel?: WorkspacePhoneChannel;
675
- }): Promise<WorkspacePhonesResponse>;
1546
+ listPhones(workspaceId: string, opts?: ListWorkspacePhonesOptions): Promise<WorkspacePhonesResponse>;
676
1547
  enable(workspaceId: string, payload: WorkspaceEnableRequest): Promise<WorkspaceEnableResponse>;
677
1548
  };
678
1549
  tools: {
679
- list(): Promise<ToolsCatalogResponse>;
1550
+ list(options?: ListToolsOptions): Promise<ToolsCatalogResponse>;
680
1551
  execute(toolId: string, payload: ExecuteToolRequest): Promise<ExecuteToolResponse>;
681
1552
  };
1553
+ voices: {
1554
+ list(options?: ListVoicesOptions): Promise<VoiceListResponse>;
1555
+ };
682
1556
  };
683
1557
 
1558
+ type QueryParamPrimitive = string | number | boolean;
1559
+ type QueryParamValue = QueryParamPrimitive | QueryParamPrimitive[] | null | undefined;
1560
+ type QueryInit = string | URLSearchParams | Record<string, QueryParamValue>;
1561
+ type FetchOptions = RequestInit & {
1562
+ query?: QueryInit;
1563
+ };
684
1564
  declare function createHttp(cfg: ClientConfig & {
685
1565
  retry?: RetryPolicy;
686
1566
  }): {
@@ -691,9 +1571,9 @@ declare function createHttp(cfg: ClientConfig & {
691
1571
  error?: (...a: any[]) => void;
692
1572
  };
693
1573
  retry: RetryPolicy;
694
- doFetch: (url: string, init?: RequestInit) => Promise<Response>;
1574
+ doFetch: (url: string, init?: FetchOptions) => Promise<Response>;
695
1575
  buildHeaders: (extra?: HeadersInit) => Record<string, string>;
696
1576
  resolveWorkspaceId: () => string;
697
1577
  };
698
1578
 
699
- 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 };
1579
+ export { type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentInstructionsResponse, type AgentKnowledgeBasesResponse, type AgentKnowledgeUploadsResponse, type AgentListResponse, type AgentSchedule, type AgentSummary, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ClientConfig, type ConnectPhoneRequest, type CreateAgentRequest, type CreateAgentVersionRequest, type CreateInstructionRequest, type ErrorResponse, type ExecuteToolRequest, type ExecuteToolResponse, HttpError, type Instruction, type InstructionCreatedResponse, type KnowledgeUploadListResponse, type KnowledgeUploadRequest, type KnowledgeUploadResponse, type ListAgentInstructionsOptions, type ListAgentKnowledgeOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListQueryOptions, type ListToolsOptions, type ListVoicesOptions, type ListWorkspacePhonesOptions, NetworkError, type PaginationMeta, type PhoneAssignmentResponse, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type RetryPolicy, TimeoutError, type ToolSummary, type ToolsCatalogResponse, type UpdateAgentRequest, type UpdateAgentScheduleRequest, type UpdateAgentVersionRequest, type UpdateInstructionRequest, type VoiceListResponse, type VoiceSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, bindAgentInstructions, bindAgentKnowledge, bindAgentPhones, bindAgentSchedule, bindAgentVersions, createAgentEntity, createAgentInstructionsApi, createAgentKnowledgeApi, createAgentPhonesApi, createAgentScheduleApi, createAgentVersionsApi, createAgentsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWorkspacesApi };