@kivox/client 0.1.0-beta.5 → 0.1.0-beta.50

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,806 +1,3717 @@
1
+ import createClient from "openapi-fetch";
1
2
  /**
2
- * Configuration for HTTP transport.
3
+ * This file was auto-generated by openapi-typescript.
4
+ * Do not make direct changes to the file.
3
5
  */
4
- type HttpTransportConfig = {
5
- /** Base URL for all requests */
6
- baseUrl: string
7
- /** Optional default headers */
8
- headers?: Record<string, string>
9
- };
10
- /**
11
- * Error thrown by HTTP transport operations.
12
- */
13
- declare class HttpTransportError extends Error {
14
- readonly status: number;
15
- readonly statusText: string;
16
- readonly body?: unknown;
17
- constructor(message: string, status: number, statusText: string, body?: unknown);
6
+ interface paths {
7
+ "/auth/registrations": {
8
+ parameters: {
9
+ query?: never
10
+ header?: never
11
+ path?: never
12
+ cookie?: never
13
+ }
14
+ get?: never
15
+ put?: never
16
+ /** Register a new user account */
17
+ post: operations["createRegistration"]
18
+ delete?: never
19
+ options?: never
20
+ head?: never
21
+ patch?: never
22
+ trace?: never
23
+ };
24
+ "/auth/sessions": {
25
+ parameters: {
26
+ query?: never
27
+ header?: never
28
+ path?: never
29
+ cookie?: never
30
+ }
31
+ get?: never
32
+ put?: never
33
+ /** Log in and start a session */
34
+ post: operations["createSession"]
35
+ /** Log out of all sessions */
36
+ delete: operations["revokeAllSessions"]
37
+ options?: never
38
+ head?: never
39
+ patch?: never
40
+ trace?: never
41
+ };
42
+ "/auth/sessions/me": {
43
+ parameters: {
44
+ query?: never
45
+ header?: never
46
+ path?: never
47
+ cookie?: never
48
+ }
49
+ get?: never
50
+ put?: never
51
+ post?: never
52
+ /** Log out of the current session */
53
+ delete: operations["revokeCurrentSession"]
54
+ options?: never
55
+ head?: never
56
+ patch?: never
57
+ trace?: never
58
+ };
59
+ "/auth/password-recoveries": {
60
+ parameters: {
61
+ query?: never
62
+ header?: never
63
+ path?: never
64
+ cookie?: never
65
+ }
66
+ get?: never
67
+ put?: never
68
+ /**
69
+ * Request a password reset email
70
+ * @description Always returns 204 regardless of whether the email exists
71
+ * to prevent email enumeration.
72
+ */
73
+ post: operations["createPasswordRecovery"]
74
+ delete?: never
75
+ options?: never
76
+ head?: never
77
+ patch?: never
78
+ trace?: never
79
+ };
80
+ "/auth/password-resets": {
81
+ parameters: {
82
+ query?: never
83
+ header?: never
84
+ path?: never
85
+ cookie?: never
86
+ }
87
+ get?: never
88
+ put?: never
89
+ /**
90
+ * Reset password using a recovery token
91
+ * @description Consumes the token and updates the password.
92
+ * All existing sessions are revoked on success.
93
+ */
94
+ post: operations["createPasswordReset"]
95
+ delete?: never
96
+ options?: never
97
+ head?: never
98
+ patch?: never
99
+ trace?: never
100
+ };
101
+ "/auth/api-keys": {
102
+ parameters: {
103
+ query?: never
104
+ header?: never
105
+ path?: never
106
+ cookie?: never
107
+ }
108
+ /** List API keys owned by the authenticated user */
109
+ get: operations["listAPIKeys"]
110
+ put?: never
111
+ /** Create a new API key */
112
+ post: operations["createAPIKey"]
113
+ delete?: never
114
+ options?: never
115
+ head?: never
116
+ patch?: never
117
+ trace?: never
118
+ };
119
+ "/auth/api-keys/{key_id}": {
120
+ parameters: {
121
+ query?: never
122
+ header?: never
123
+ path: {
124
+ key_id: string
125
+ }
126
+ cookie?: never
127
+ }
128
+ get?: never
129
+ put?: never
130
+ post?: never
131
+ /** Revoke an API key */
132
+ delete: operations["revokeAPIKey"]
133
+ options?: never
134
+ head?: never
135
+ patch?: never
136
+ trace?: never
137
+ };
138
+ "/user": {
139
+ parameters: {
140
+ query?: never
141
+ header?: never
142
+ path?: never
143
+ cookie?: never
144
+ }
145
+ /** Get the authenticated user's profile */
146
+ get: operations["getUser"]
147
+ put?: never
148
+ post?: never
149
+ /** Soft delete the authenticated user's account */
150
+ delete: operations["deleteUser"]
151
+ options?: never
152
+ head?: never
153
+ /** Update the authenticated user's profile */
154
+ patch: operations["updateUser"]
155
+ trace?: never
156
+ };
157
+ "/user/email": {
158
+ parameters: {
159
+ query?: never
160
+ header?: never
161
+ path?: never
162
+ cookie?: never
163
+ }
164
+ get?: never
165
+ put?: never
166
+ post?: never
167
+ delete?: never
168
+ options?: never
169
+ head?: never
170
+ /** Update the authenticated user's email address */
171
+ patch: operations["updateUserEmail"]
172
+ trace?: never
173
+ };
174
+ "/user/agents": {
175
+ parameters: {
176
+ query?: never
177
+ header?: never
178
+ path?: never
179
+ cookie?: never
180
+ }
181
+ /** List agents owned by the authenticated user */
182
+ get: operations["listUserAgents"]
183
+ put?: never
184
+ /** Create an agent owned by the authenticated user */
185
+ post: operations["createUserAgent"]
186
+ delete?: never
187
+ options?: never
188
+ head?: never
189
+ patch?: never
190
+ trace?: never
191
+ };
192
+ "/user/conversations": {
193
+ parameters: {
194
+ query?: never
195
+ header?: never
196
+ path?: never
197
+ cookie?: never
198
+ }
199
+ /** List conversations created by the authenticated user */
200
+ get: operations["listUserConversations"]
201
+ put?: never
202
+ post?: never
203
+ delete?: never
204
+ options?: never
205
+ head?: never
206
+ patch?: never
207
+ trace?: never
208
+ };
209
+ "/user/knowledge-bases": {
210
+ parameters: {
211
+ query?: never
212
+ header?: never
213
+ path?: never
214
+ cookie?: never
215
+ }
216
+ /** List knowledge bases owned by the authenticated user */
217
+ get: operations["listUserKnowledgeBases"]
218
+ put?: never
219
+ /** Create a knowledge base owned by the authenticated user */
220
+ post: operations["createUserKnowledgeBase"]
221
+ delete?: never
222
+ options?: never
223
+ head?: never
224
+ patch?: never
225
+ trace?: never
226
+ };
227
+ "/user/invitations": {
228
+ parameters: {
229
+ query?: never
230
+ header?: never
231
+ path?: never
232
+ cookie?: never
233
+ }
234
+ /** List pending org invitations for the authenticated user */
235
+ get: operations["listUserInvitations"]
236
+ put?: never
237
+ post?: never
238
+ delete?: never
239
+ options?: never
240
+ head?: never
241
+ patch?: never
242
+ trace?: never
243
+ };
244
+ "/user/invitations/{invitation_id}": {
245
+ parameters: {
246
+ query?: never
247
+ header?: never
248
+ path: {
249
+ invitation_id: string
250
+ }
251
+ cookie?: never
252
+ }
253
+ get?: never
254
+ put?: never
255
+ post?: never
256
+ delete?: never
257
+ options?: never
258
+ head?: never
259
+ /** Accept or decline an invitation */
260
+ patch: operations["updateUserInvitation"]
261
+ trace?: never
262
+ };
263
+ "/models": {
264
+ parameters: {
265
+ query?: never
266
+ header?: never
267
+ path?: never
268
+ cookie?: never
269
+ }
270
+ /** List available curated models */
271
+ get: operations["listModels"]
272
+ put?: never
273
+ post?: never
274
+ delete?: never
275
+ options?: never
276
+ head?: never
277
+ patch?: never
278
+ trace?: never
279
+ };
280
+ "/models/{model_slug}": {
281
+ parameters: {
282
+ query?: never
283
+ header?: never
284
+ path: {
285
+ /** @description Permanent slug for the model that never changes. */
286
+ model_slug: string
287
+ }
288
+ cookie?: never
289
+ }
290
+ /** Get a model by canonical slug */
291
+ get: operations["getModel"]
292
+ put?: never
293
+ post?: never
294
+ delete?: never
295
+ options?: never
296
+ head?: never
297
+ patch?: never
298
+ trace?: never
299
+ };
300
+ "/orgs": {
301
+ parameters: {
302
+ query?: never
303
+ header?: never
304
+ path?: never
305
+ cookie?: never
306
+ }
307
+ /** List organizations the authenticated user belongs to */
308
+ get: operations["listOrgs"]
309
+ put?: never
310
+ /** Create a new organization */
311
+ post: operations["createOrg"]
312
+ delete?: never
313
+ options?: never
314
+ head?: never
315
+ patch?: never
316
+ trace?: never
317
+ };
318
+ "/orgs/{org_slug}": {
319
+ parameters: {
320
+ query?: never
321
+ header?: never
322
+ path: {
323
+ org_slug: string
324
+ }
325
+ cookie?: never
326
+ }
327
+ /** Get an organization by slug */
328
+ get: operations["getOrg"]
329
+ put?: never
330
+ post?: never
331
+ /** Soft delete an organization (requires owner) */
332
+ delete: operations["deleteOrg"]
333
+ options?: never
334
+ head?: never
335
+ /** Update an organization (requires admin) */
336
+ patch: operations["updateOrg"]
337
+ trace?: never
338
+ };
339
+ "/orgs/{org_slug}/members": {
340
+ parameters: {
341
+ query?: never
342
+ header?: never
343
+ path: {
344
+ org_slug: string
345
+ }
346
+ cookie?: never
347
+ }
348
+ /** List members of an organization (requires viewer) */
349
+ get: operations["listOrgMembers"]
350
+ put?: never
351
+ post?: never
352
+ delete?: never
353
+ options?: never
354
+ head?: never
355
+ patch?: never
356
+ trace?: never
357
+ };
358
+ "/orgs/{org_slug}/members/{user_id}": {
359
+ parameters: {
360
+ query?: never
361
+ header?: never
362
+ path: {
363
+ org_slug: string
364
+ user_id: string
365
+ }
366
+ cookie?: never
367
+ }
368
+ get?: never
369
+ put?: never
370
+ post?: never
371
+ /** Remove a member from an organization (requires admin) */
372
+ delete: operations["removeOrgMember"]
373
+ options?: never
374
+ head?: never
375
+ /** Update a member's role (requires admin) */
376
+ patch: operations["updateOrgMember"]
377
+ trace?: never
378
+ };
379
+ "/orgs/{org_slug}/invitations": {
380
+ parameters: {
381
+ query?: never
382
+ header?: never
383
+ path: {
384
+ org_slug: string
385
+ }
386
+ cookie?: never
387
+ }
388
+ /** List invitations for an organization (requires admin) */
389
+ get: operations["listOrgInvitations"]
390
+ put?: never
391
+ /** Invite a user to an organization (requires admin) */
392
+ post: operations["createOrgInvitation"]
393
+ delete?: never
394
+ options?: never
395
+ head?: never
396
+ patch?: never
397
+ trace?: never
398
+ };
399
+ "/orgs/{org_slug}/invitations/{invitation_id}": {
400
+ parameters: {
401
+ query?: never
402
+ header?: never
403
+ path: {
404
+ org_slug: string
405
+ invitation_id: string
406
+ }
407
+ cookie?: never
408
+ }
409
+ get?: never
410
+ put?: never
411
+ post?: never
412
+ /** Cancel a pending invitation (requires admin) */
413
+ delete: operations["cancelOrgInvitation"]
414
+ options?: never
415
+ head?: never
416
+ patch?: never
417
+ trace?: never
418
+ };
419
+ "/orgs/{org_slug}/agents": {
420
+ parameters: {
421
+ query?: never
422
+ header?: never
423
+ path: {
424
+ org_slug: string
425
+ }
426
+ cookie?: never
427
+ }
428
+ /** List agents owned by an organization (requires viewer) */
429
+ get: operations["listOrgAgents"]
430
+ put?: never
431
+ /** Create an agent owned by an organization (requires member) */
432
+ post: operations["createOrgAgent"]
433
+ delete?: never
434
+ options?: never
435
+ head?: never
436
+ patch?: never
437
+ trace?: never
438
+ };
439
+ "/orgs/{org_slug}/knowledge-bases": {
440
+ parameters: {
441
+ query?: never
442
+ header?: never
443
+ path: {
444
+ org_slug: string
445
+ }
446
+ cookie?: never
447
+ }
448
+ /** List knowledge bases owned by an organization (requires viewer) */
449
+ get: operations["listOrgKnowledgeBases"]
450
+ put?: never
451
+ /** Create a knowledge base owned by an organization (requires member) */
452
+ post: operations["createOrgKnowledgeBase"]
453
+ delete?: never
454
+ options?: never
455
+ head?: never
456
+ patch?: never
457
+ trace?: never
458
+ };
459
+ "/orgs/{org_slug}/webhooks": {
460
+ parameters: {
461
+ query?: never
462
+ header?: never
463
+ path: {
464
+ org_slug: string
465
+ }
466
+ cookie?: never
467
+ }
468
+ /** List webhooks for an organization (requires admin) */
469
+ get: operations["listOrgWebhooks"]
470
+ put?: never
471
+ /** Create a webhook for an organization (requires admin) */
472
+ post: operations["createOrgWebhook"]
473
+ delete?: never
474
+ options?: never
475
+ head?: never
476
+ patch?: never
477
+ trace?: never
478
+ };
479
+ "/orgs/{org_slug}/webhooks/{webhook_id}": {
480
+ parameters: {
481
+ query?: never
482
+ header?: never
483
+ path: {
484
+ org_slug: string
485
+ webhook_id: string
486
+ }
487
+ cookie?: never
488
+ }
489
+ /** Get an organization webhook by ID (requires admin) */
490
+ get: operations["getOrgWebhook"]
491
+ put?: never
492
+ post?: never
493
+ /** Delete an organization webhook (requires admin) */
494
+ delete: operations["deleteOrgWebhook"]
495
+ options?: never
496
+ head?: never
497
+ /** Update an organization webhook (requires admin) */
498
+ patch: operations["updateOrgWebhook"]
499
+ trace?: never
500
+ };
501
+ "/agents/{agent_id}": {
502
+ parameters: {
503
+ query?: never
504
+ header?: never
505
+ path: {
506
+ agent_id: string
507
+ }
508
+ cookie?: never
509
+ }
510
+ /** Get an agent by ID (requires viewer) */
511
+ get: operations["getAgent"]
512
+ put?: never
513
+ post?: never
514
+ /** Soft delete an agent (requires admin) */
515
+ delete: operations["deleteAgent"]
516
+ options?: never
517
+ head?: never
518
+ /** Update an agent's config, secrets, or blueprint (requires member) */
519
+ patch: operations["updateAgent"]
520
+ trace?: never
521
+ };
522
+ "/agents/{agent_id}/status": {
523
+ parameters: {
524
+ query?: never
525
+ header?: never
526
+ path: {
527
+ agent_id: string
528
+ }
529
+ cookie?: never
530
+ }
531
+ get?: never
532
+ put?: never
533
+ post?: never
534
+ delete?: never
535
+ options?: never
536
+ head?: never
537
+ /** Transition an agent's status (requires admin) */
538
+ patch: operations["updateAgentStatus"]
539
+ trace?: never
540
+ };
541
+ "/agents/{agent_id}/diagnostics": {
542
+ parameters: {
543
+ query?: never
544
+ header?: never
545
+ path: {
546
+ agent_id: string
547
+ }
548
+ cookie?: never
549
+ }
550
+ get?: never
551
+ put?: never
552
+ /**
553
+ * Run diagnostics on an agent's blueprint (requires viewer)
554
+ * @description Pass a blueprint in the request body to validate it instead of the
555
+ * agent's saved blueprint. Useful for pre-save validation in the editor.
556
+ */
557
+ post: operations["createAgentDiagnostics"]
558
+ delete?: never
559
+ options?: never
560
+ head?: never
561
+ patch?: never
562
+ trace?: never
563
+ };
564
+ "/agents/{agent_id}/conversations": {
565
+ parameters: {
566
+ query?: never
567
+ header?: never
568
+ path: {
569
+ agent_id: string
570
+ }
571
+ cookie?: never
572
+ }
573
+ /** List conversations for an agent (requires viewer) */
574
+ get: operations["listAgentConversations"]
575
+ put?: never
576
+ post?: never
577
+ delete?: never
578
+ options?: never
579
+ head?: never
580
+ patch?: never
581
+ trace?: never
582
+ };
583
+ "/agents/{agent_id}/knowledge-bases": {
584
+ parameters: {
585
+ query?: never
586
+ header?: never
587
+ path: {
588
+ agent_id: string
589
+ }
590
+ cookie?: never
591
+ }
592
+ /** List knowledge bases linked to an agent (requires viewer) */
593
+ get: operations["listAgentKnowledgeBases"]
594
+ put?: never
595
+ post?: never
596
+ delete?: never
597
+ options?: never
598
+ head?: never
599
+ patch?: never
600
+ trace?: never
601
+ };
602
+ "/agents/{agent_id}/knowledge-bases/{knowledge_base_id}": {
603
+ parameters: {
604
+ query?: never
605
+ header?: never
606
+ path: {
607
+ agent_id: string
608
+ knowledge_base_id: string
609
+ }
610
+ cookie?: never
611
+ }
612
+ get?: never
613
+ /** Link a knowledge base to an agent (requires member) */
614
+ put: operations["linkAgentKnowledgeBase"]
615
+ post?: never
616
+ /** Unlink a knowledge base from an agent (requires member) */
617
+ delete: operations["unlinkAgentKnowledgeBase"]
618
+ options?: never
619
+ head?: never
620
+ patch?: never
621
+ trace?: never
622
+ };
623
+ "/agents/{agent_id}/webhooks": {
624
+ parameters: {
625
+ query?: never
626
+ header?: never
627
+ path: {
628
+ agent_id: string
629
+ }
630
+ cookie?: never
631
+ }
632
+ /** List webhooks for an agent (requires member) */
633
+ get: operations["listAgentWebhooks"]
634
+ put?: never
635
+ /** Create a webhook for an agent (requires member) */
636
+ post: operations["createAgentWebhook"]
637
+ delete?: never
638
+ options?: never
639
+ head?: never
640
+ patch?: never
641
+ trace?: never
642
+ };
643
+ "/agents/{agent_id}/webhooks/{webhook_id}": {
644
+ parameters: {
645
+ query?: never
646
+ header?: never
647
+ path: {
648
+ agent_id: string
649
+ webhook_id: string
650
+ }
651
+ cookie?: never
652
+ }
653
+ /** Get an agent webhook by ID (requires member) */
654
+ get: operations["getAgentWebhook"]
655
+ put?: never
656
+ post?: never
657
+ /** Delete an agent webhook (requires member) */
658
+ delete: operations["deleteAgentWebhook"]
659
+ options?: never
660
+ head?: never
661
+ /** Update an agent webhook (requires member) */
662
+ patch: operations["updateAgentWebhook"]
663
+ trace?: never
664
+ };
665
+ "/conversations": {
666
+ parameters: {
667
+ query?: never
668
+ header?: never
669
+ path?: never
670
+ cookie?: never
671
+ }
672
+ get?: never
673
+ put?: never
674
+ /** Start a new conversation with an agent */
675
+ post: operations["createConversation"]
676
+ delete?: never
677
+ options?: never
678
+ head?: never
679
+ patch?: never
680
+ trace?: never
681
+ };
682
+ "/conversations/{conversation_id}": {
683
+ parameters: {
684
+ query?: never
685
+ header?: never
686
+ path: {
687
+ conversation_id: string
688
+ }
689
+ cookie?: never
690
+ }
691
+ /** Get a conversation by ID (requires viewer on the parent agent) */
692
+ get: operations["getConversation"]
693
+ put?: never
694
+ post?: never
695
+ /** Soft delete a conversation (requires admin on the parent agent) */
696
+ delete: operations["deleteConversation"]
697
+ options?: never
698
+ head?: never
699
+ patch?: never
700
+ trace?: never
701
+ };
702
+ "/conversations/{conversation_id}/messages": {
703
+ parameters: {
704
+ query?: never
705
+ header?: never
706
+ path: {
707
+ conversation_id: string
708
+ }
709
+ cookie?: never
710
+ }
711
+ /** List messages in a conversation (requires viewer on the parent agent) */
712
+ get: operations["listConversationMessages"]
713
+ put?: never
714
+ /**
715
+ * Send a user message and stream the assistant response via SSE
716
+ * @description Sends a user message and streams the assistant's response as Server-Sent Events (SSE).
717
+ *
718
+ * **Event types:**
719
+ * - `delta`: Streaming text chunk.
720
+ * - `text`: Complete text message.
721
+ * - `tool_start`: A tool execution started.
722
+ * - `tool_complete`: A tool execution completed.
723
+ * - `tool_error`: A tool execution failed.
724
+ * - `turn_complete`: The turn finished successfully.
725
+ * - `session_ended`: The conversation ended.
726
+ * - `transfer_agent`: Agent transfer requested.
727
+ * - `transfer_human`: Human transfer requested.
728
+ * - `error`: An error occurred.
729
+ *
730
+ * Connect with `EventSource` in browsers or any SSE client.
731
+ */
732
+ post: operations["createConversationMessage"]
733
+ delete?: never
734
+ options?: never
735
+ head?: never
736
+ patch?: never
737
+ trace?: never
738
+ };
739
+ "/conversations/{conversation_id}/stream": {
740
+ parameters: {
741
+ query: {
742
+ /** @description Must be "voice" for WebSocket upgrade. */
743
+ medium: "voice"
744
+ }
745
+ header?: never
746
+ path: {
747
+ conversation_id: string
748
+ }
749
+ cookie?: never
750
+ }
751
+ /**
752
+ * Establish a WebSocket connection for real-time voice conversation
753
+ * @description Upgrades to a WebSocket connection for bidirectional voice streaming.
754
+ * The protocol is documented at https://kivox.com.co/docs/reference/ws-protocol.
755
+ */
756
+ get: operations["streamConversation"]
757
+ put?: never
758
+ post?: never
759
+ delete?: never
760
+ options?: never
761
+ head?: never
762
+ patch?: never
763
+ trace?: never
764
+ };
765
+ "/knowledge-bases/{knowledge_base_id}": {
766
+ parameters: {
767
+ query?: never
768
+ header?: never
769
+ path: {
770
+ knowledge_base_id: string
771
+ }
772
+ cookie?: never
773
+ }
774
+ /** Get a knowledge base by ID */
775
+ get: operations["getKnowledgeBase"]
776
+ put?: never
777
+ post?: never
778
+ /** Soft delete a knowledge base */
779
+ delete: operations["deleteKnowledgeBase"]
780
+ options?: never
781
+ head?: never
782
+ /** Update a knowledge base */
783
+ patch: operations["updateKnowledgeBase"]
784
+ trace?: never
785
+ };
786
+ "/knowledge-bases/{knowledge_base_id}/documents": {
787
+ parameters: {
788
+ query?: never
789
+ header?: never
790
+ path: {
791
+ knowledge_base_id: string
792
+ }
793
+ cookie?: never
794
+ }
795
+ /** List documents in a knowledge base */
796
+ get: operations["listKnowledgeBaseDocuments"]
797
+ put?: never
798
+ /**
799
+ * Add a document to a knowledge base
800
+ * @description Accepts three content types depending on the document source.
801
+ * Use `application/json` for URL and raw text documents.
802
+ * Use `multipart/form-data` for binary file uploads.
803
+ * All variants require a `type` field matching the content type used.
804
+ */
805
+ post: operations["createKnowledgeBaseDocument"]
806
+ delete?: never
807
+ options?: never
808
+ head?: never
809
+ patch?: never
810
+ trace?: never
811
+ };
812
+ "/knowledge-bases/{knowledge_base_id}/documents/{document_id}": {
813
+ parameters: {
814
+ query?: never
815
+ header?: never
816
+ path: {
817
+ knowledge_base_id: string
818
+ document_id: string
819
+ }
820
+ cookie?: never
821
+ }
822
+ /** Get a document by ID */
823
+ get: operations["getKnowledgeBaseDocument"]
824
+ put?: never
825
+ post?: never
826
+ /** Delete a document from a knowledge base */
827
+ delete: operations["deleteKnowledgeBaseDocument"]
828
+ options?: never
829
+ head?: never
830
+ patch?: never
831
+ trace?: never
832
+ };
833
+ "/knowledge-bases/{knowledge_base_id}/queries": {
834
+ parameters: {
835
+ query?: never
836
+ header?: never
837
+ path: {
838
+ knowledge_base_id: string
839
+ }
840
+ cookie?: never
841
+ }
842
+ get?: never
843
+ put?: never
844
+ /** Run a semantic search query against a knowledge base */
845
+ post: operations["queryKnowledgeBase"]
846
+ delete?: never
847
+ options?: never
848
+ head?: never
849
+ patch?: never
850
+ trace?: never
851
+ };
18
852
  }
19
- /**
20
- * Shared HTTP transport layer for REST API requests.
21
- * Handles request/response cycles with automatic JSON parsing.
22
- */
23
- declare class HttpTransport {
24
- private readonly config;
25
- constructor(config: HttpTransportConfig);
26
- /**
27
- * Makes an HTTP request to the specified path.
28
- *
29
- * @param path API path (e.g., '/agents')
30
- * @param init Fetch request options
31
- * @returns Parsed JSON response
32
- * @throws {HttpTransportError} If request fails
33
- */
34
- request<T>(path: string, init?: RequestInit): Promise<T>;
35
- /**
36
- * Makes a GET request.
37
- */
38
- get<T>(path: string, params?: Record<string, string>): Promise<T>;
39
- /**
40
- * Makes a POST request.
41
- */
42
- post<T>(path: string, body?: unknown): Promise<T>;
43
- /**
44
- * Makes a PUT request.
45
- */
46
- put<T>(path: string, body?: unknown): Promise<T>;
47
- /**
48
- * Makes a PATCH request.
49
- */
50
- patch<T>(path: string, body?: unknown): Promise<T>;
51
- /**
52
- * Makes a DELETE request.
53
- */
54
- delete<T>(path: string): Promise<T>;
853
+ interface components {
854
+ schemas: {
855
+ AuthSignupRequest: {
856
+ /** Format: email */
857
+ email: string
858
+ password: string
859
+ name: string
860
+ }
861
+ ErrorDetail: {
862
+ code: string
863
+ field?: string
864
+ message: string
865
+ }
866
+ Error: {
867
+ /** @enum {string} */
868
+ type: "security" | "auth" | "validation" | "permission" | "resource" | "limit" | "dependency" | "internal"
869
+ /**
870
+ * @description Stable dot-notation ref, e.g. `validation.field_required`.
871
+ * @example validation.field_required
872
+ */
873
+ code: string
874
+ /** @description English fallback. Never parse this string. */
875
+ message: string
876
+ /** @description Top-level request field that triggered the error, if applicable. */
877
+ param?: string
878
+ /** @description Named interpolation values for the client i18n bundle. */
879
+ params?: {
880
+ [key: string]: unknown
881
+ }
882
+ details?: components["schemas"]["ErrorDetail"][]
883
+ /**
884
+ * Format: uri
885
+ * @example https://kivox.com.co/docs/reference/errors#validation-field-required
886
+ */
887
+ doc_url: string
888
+ /**
889
+ * @description Include in support tickets.
890
+ * @example req_a1b2c3d4
891
+ */
892
+ request_id: string
893
+ }
894
+ AuthSessionResponse: {
895
+ session_token?: string
896
+ /** Format: date-time */
897
+ expires_at: string
898
+ }
899
+ AuthSigninRequest: {
900
+ /** Format: email */
901
+ email: string
902
+ password: string
903
+ }
904
+ AuthPasswordRecoverRequest: {
905
+ /** Format: email */
906
+ email: string
907
+ }
908
+ AuthPasswordResetRequest: {
909
+ token: string
910
+ password: string
911
+ }
912
+ APIKey: {
913
+ /** Format: uuid */
914
+ id: string
915
+ /** @enum {string} */
916
+ object: "api_key"
917
+ /** Format: uuid */
918
+ owner_user_id?: string
919
+ /** Format: uuid */
920
+ owner_org_id?: string
921
+ /** Format: uuid */
922
+ created_by_user_id: string
923
+ name: string
924
+ /** @example sk_live */
925
+ prefix: string
926
+ scopes: string[]
927
+ /** Format: date-time */
928
+ last_used_at?: string
929
+ /** Format: date-time */
930
+ expires_at?: string
931
+ /** Format: date-time */
932
+ created_at: string
933
+ }
934
+ OffsetMeta: {
935
+ total: number
936
+ limit: number
937
+ page: number
938
+ }
939
+ APIKeyListResponse: {
940
+ data: components["schemas"]["APIKey"][]
941
+ meta: components["schemas"]["OffsetMeta"]
942
+ }
943
+ APIKeyCreateRequest: {
944
+ name: string
945
+ scopes?: string[]
946
+ /** Format: date-time */
947
+ expires_at?: string
948
+ }
949
+ APIKeyCreateResponse: {
950
+ /** Format: uuid */
951
+ id: string
952
+ /** @enum {string} */
953
+ object: "api_key"
954
+ name: string
955
+ prefix: string
956
+ /**
957
+ * @description Full API key. Only present in this creation response.
958
+ * @example sk_live_xxxxxxxxxxxx
959
+ */
960
+ key: string
961
+ scopes: string[]
962
+ /** Format: date-time */
963
+ expires_at?: string
964
+ /** Format: date-time */
965
+ created_at: string
966
+ }
967
+ User: {
968
+ /** Format: uuid */
969
+ id: string
970
+ /** @enum {string} */
971
+ object: "user"
972
+ /** Format: email */
973
+ email: string
974
+ name: string
975
+ /** Format: uri */
976
+ avatar_url?: string
977
+ /** @default false */
978
+ is_admin: boolean
979
+ /** @default false */
980
+ is_banned: boolean
981
+ ban_reason?: string
982
+ /** Format: date-time */
983
+ created_at: string
984
+ /** Format: date-time */
985
+ updated_at: string
986
+ }
987
+ UserUpdateRequest: {
988
+ name?: string
989
+ /** Format: uri */
990
+ avatar_url?: string
991
+ }
992
+ UserUpdateEmailRequest: {
993
+ /** Format: email */
994
+ email: string
995
+ }
996
+ AgentConfig: {
997
+ name: string
998
+ /** Format: uri */
999
+ avatar_url?: string
1000
+ description?: string
1001
+ /** @example es */
1002
+ language?: string
1003
+ /** @example UTC */
1004
+ timezone?: string
1005
+ global_system_prompt?: string
1006
+ max_session_duration_minutes?: number
1007
+ max_silence_timeout_seconds?: number
1008
+ allow_interruptions?: boolean
1009
+ model_llm?: string
1010
+ }
1011
+ AgentSecret: {
1012
+ key: string
1013
+ value: string
1014
+ description?: string
1015
+ }
1016
+ AgentBlueprintNode: {
1017
+ id: string
1018
+ type: string
1019
+ data: {
1020
+ [key: string]: unknown
1021
+ }
1022
+ } & {
1023
+ [key: string]: unknown
1024
+ }
1025
+ AgentBlueprintEdge: {
1026
+ source: string
1027
+ target: string
1028
+ } & {
1029
+ [key: string]: unknown
1030
+ }
1031
+ AgentBlueprint: {
1032
+ /** @default 1 */
1033
+ version: string
1034
+ entries: {
1035
+ name: string
1036
+ workflow: {
1037
+ nodes: components["schemas"]["AgentBlueprintNode"][]
1038
+ edges: components["schemas"]["AgentBlueprintEdge"][]
1039
+ }
1040
+ }[]
1041
+ }
1042
+ /** @enum {string} */
1043
+ AgentStatus: "draft" | "live" | "archived"
1044
+ Agent: {
1045
+ /** Format: uuid */
1046
+ id: string
1047
+ /** @enum {string} */
1048
+ object: "agent"
1049
+ /** Format: uuid */
1050
+ owner_user_id?: string
1051
+ /** Format: uuid */
1052
+ owner_org_id?: string
1053
+ config: components["schemas"]["AgentConfig"]
1054
+ secrets?: components["schemas"]["AgentSecret"][]
1055
+ blueprint: components["schemas"]["AgentBlueprint"]
1056
+ status: components["schemas"]["AgentStatus"]
1057
+ /** Format: date-time */
1058
+ created_at: string
1059
+ /** Format: date-time */
1060
+ updated_at: string
1061
+ }
1062
+ AgentListResponse: {
1063
+ data: components["schemas"]["Agent"][]
1064
+ meta: components["schemas"]["OffsetMeta"]
1065
+ }
1066
+ AgentCreateRequest: {
1067
+ config?: components["schemas"]["AgentConfig"]
1068
+ secrets?: components["schemas"]["AgentSecret"][]
1069
+ blueprint?: components["schemas"]["AgentBlueprint"]
1070
+ }
1071
+ /** @enum {string} */
1072
+ ConversationStatus: "active" | "ended"
1073
+ Conversation: {
1074
+ /** Format: uuid */
1075
+ id: string
1076
+ /** @enum {string} */
1077
+ object: "conversation"
1078
+ /** Format: uuid */
1079
+ agent_id: string
1080
+ /** Format: uuid */
1081
+ created_by?: string
1082
+ status: components["schemas"]["ConversationStatus"]
1083
+ title?: string
1084
+ summary?: string
1085
+ /** Format: date-time */
1086
+ started_at: string
1087
+ /** Format: date-time */
1088
+ ended_at?: string
1089
+ end_reason?: string
1090
+ /** Format: date-time */
1091
+ updated_at?: string
1092
+ }
1093
+ CursorMeta: {
1094
+ next_cursor: string | null
1095
+ has_more: boolean
1096
+ }
1097
+ ConversationListResponse: {
1098
+ data: components["schemas"]["Conversation"][]
1099
+ meta: components["schemas"]["CursorMeta"]
1100
+ }
1101
+ /** @description Controls how documents are split before embedding. */
1102
+ KnowledgeBaseChunkStrategy: {
1103
+ /** @default 1000 */
1104
+ chunk_size: number
1105
+ /** @default 200 */
1106
+ chunk_overlap: number
1107
+ }
1108
+ KnowledgeBase: {
1109
+ /** Format: uuid */
1110
+ id: string
1111
+ /** @enum {string} */
1112
+ object: "knowledge_base"
1113
+ /** Format: uuid */
1114
+ owner_user_id?: string
1115
+ /** Format: uuid */
1116
+ owner_org_id?: string
1117
+ name: string
1118
+ description?: string
1119
+ /** @example text-embedding-3-small */
1120
+ embedding_model: string
1121
+ chunk_strategy: components["schemas"]["KnowledgeBaseChunkStrategy"]
1122
+ /** Format: date-time */
1123
+ created_at: string
1124
+ /** Format: date-time */
1125
+ updated_at: string
1126
+ /** @description Number of documents in the KB. This field is computed at runtime. */
1127
+ document_count?: number
1128
+ /** @description Number of chunks in the KB. This field is computed at runtime. */
1129
+ chunk_count?: number
1130
+ }
1131
+ KnowledgeBaseListResponse: {
1132
+ data: components["schemas"]["KnowledgeBase"][]
1133
+ meta: components["schemas"]["OffsetMeta"]
1134
+ }
1135
+ KnowledgeBaseCreateRequest: {
1136
+ name: string
1137
+ description?: string
1138
+ embedding_model: string
1139
+ chunk_strategy?: components["schemas"]["KnowledgeBaseChunkStrategy"]
1140
+ }
1141
+ /** @enum {string} */
1142
+ OrgInvitationRole: "admin" | "member" | "viewer"
1143
+ /** @enum {string} */
1144
+ OrgInvitationState: "pending" | "accepted" | "declined" | "expired"
1145
+ OrgInvitation: {
1146
+ /** Format: uuid */
1147
+ id: string
1148
+ /** @enum {string} */
1149
+ object: "org_invitation"
1150
+ /** Format: uuid */
1151
+ org_id: string
1152
+ /** Format: uuid */
1153
+ inviter_id: string
1154
+ /** Format: uuid */
1155
+ user_id: string
1156
+ role: components["schemas"]["OrgInvitationRole"]
1157
+ state: components["schemas"]["OrgInvitationState"]
1158
+ /** Format: date-time */
1159
+ created_at: string
1160
+ /** Format: date-time */
1161
+ expires_at: string
1162
+ }
1163
+ OrgInvitationListResponse: {
1164
+ data: components["schemas"]["OrgInvitation"][]
1165
+ meta: components["schemas"]["OffsetMeta"]
1166
+ }
1167
+ OrgInvitationStateUpdateRequest: {
1168
+ /** @enum {string} */
1169
+ state: "accepted" | "declined"
1170
+ }
1171
+ /** @description Describes the model's technical capabilities and supported modalities. */
1172
+ ModelArchitecture: {
1173
+ /**
1174
+ * @description Content types accepted as input by the model.
1175
+ * @example [
1176
+ * "text",
1177
+ * "image"
1178
+ * ]
1179
+ */
1180
+ input_modalities: ("text" | "image" | "audio" | "file")[]
1181
+ /**
1182
+ * @description Content types this model can produce as output.
1183
+ * @example [
1184
+ * "text"
1185
+ * ]
1186
+ */
1187
+ output_modalities: ("text" | "image" | "audio" | "embeddings")[]
1188
+ /**
1189
+ * @description Tokenization method or family used by the model (e.g. "cl100k", "llama3").
1190
+ * @example cl100k
1191
+ */
1192
+ tokenizer?: string
1193
+ /**
1194
+ * @description Instruction format type the model was fine-tuned on (e.g. "chat", "alpaca"). Null if not applicable.
1195
+ * @example chat
1196
+ */
1197
+ instruct_type?: string
1198
+ }
1199
+ /** @description Cost structure for using this model. All values are in USD per token/request/unit. A value of "0" indicates the operation is free. */
1200
+ ModelPricing: {
1201
+ /**
1202
+ * @description Cost per input token.
1203
+ * @example 0.00000025
1204
+ */
1205
+ prompt?: string
1206
+ /**
1207
+ * @description Cost per output token.
1208
+ * @example 0.00000075
1209
+ */
1210
+ completion?: string
1211
+ /**
1212
+ * @description Fixed cost per API request, regardless of token count.
1213
+ * @example 0
1214
+ */
1215
+ request?: string
1216
+ /**
1217
+ * @description Cost per image provided as input.
1218
+ * @example 0
1219
+ */
1220
+ image?: string
1221
+ /**
1222
+ * @description Cost per web search operation, if supported.
1223
+ * @example 0
1224
+ */
1225
+ web_search?: string
1226
+ /**
1227
+ * @description Cost per internal reasoning token, if the model supports extended thinking.
1228
+ * @example 0
1229
+ */
1230
+ internal_reasoning?: string
1231
+ /**
1232
+ * @description Cost per cached input token read (prompt caching).
1233
+ * @example 0
1234
+ */
1235
+ input_cache_read?: string
1236
+ /**
1237
+ * @description Cost per input token written to cache (prompt caching).
1238
+ * @example 0
1239
+ */
1240
+ input_cache_write?: string
1241
+ }
1242
+ Model: {
1243
+ /**
1244
+ * @description Unique model identifier used in API requests.
1245
+ * @example google/gemini-2.5-pro-preview
1246
+ */
1247
+ id: string
1248
+ /** @enum {string} */
1249
+ object: "model"
1250
+ /** @description Permanent slug for the model that never changes. */
1251
+ slug: string
1252
+ /**
1253
+ * @description Aggregator which this model is accessed.
1254
+ * @example openrouter
1255
+ */
1256
+ backend: string
1257
+ /**
1258
+ * @description Company which owns this model.
1259
+ * @example Google
1260
+ */
1261
+ company: string
1262
+ /**
1263
+ * @description Human-readable display name for the model.
1264
+ * @example Gemini 2.5 Pro Preview
1265
+ */
1266
+ name: string
1267
+ /** @description Detailed description of the model's capabilities and characteristics. */
1268
+ description?: string
1269
+ /**
1270
+ * @description Maximum context window size in tokens.
1271
+ * @example 1048576
1272
+ */
1273
+ context_length: number
1274
+ architecture: components["schemas"]["ModelArchitecture"]
1275
+ pricing: components["schemas"]["ModelPricing"]
1276
+ /**
1277
+ * @description API parameters supported by this model.
1278
+ * @example [
1279
+ * "tools",
1280
+ * "tool_choice",
1281
+ * "temperature",
1282
+ * "max_tokens",
1283
+ * "structured_outputs"
1284
+ * ]
1285
+ */
1286
+ supported_parameters: string[]
1287
+ /** @description Default parameter values applied to requests for this model, if any. */
1288
+ default_parameters?: {
1289
+ [key: string]: unknown
1290
+ }
1291
+ /**
1292
+ * @description Whether this model has been deprecated and may be removed.
1293
+ * @default false
1294
+ */
1295
+ is_deprecated: boolean
1296
+ /**
1297
+ * Format: date-time
1298
+ * @description Deprecation date for the model endpoint (null if not deprecated).
1299
+ */
1300
+ expiration_date?: string
1301
+ /**
1302
+ * @description Categorical tags assigned to the model by the platform (e.g., voice_agent, free, embedding).
1303
+ * @example [
1304
+ * "voice_agent",
1305
+ * "free"
1306
+ * ]
1307
+ */
1308
+ tags: string[]
1309
+ /** Format: date-time */
1310
+ created_at: string
1311
+ }
1312
+ ModelListResponse: {
1313
+ /** @enum {string} */
1314
+ object: "list"
1315
+ data: components["schemas"]["Model"][]
1316
+ }
1317
+ Org: {
1318
+ /** Format: uuid */
1319
+ id: string
1320
+ /** @enum {string} */
1321
+ object: "org"
1322
+ /** Format: uuid */
1323
+ created_by?: string
1324
+ name: string
1325
+ description?: string
1326
+ /** Format: uri */
1327
+ avatar_url?: string
1328
+ slug: string
1329
+ /** Format: date-time */
1330
+ created_at: string
1331
+ /** Format: date-time */
1332
+ updated_at: string
1333
+ }
1334
+ OrgListResponse: {
1335
+ data: components["schemas"]["Org"][]
1336
+ meta: components["schemas"]["OffsetMeta"]
1337
+ }
1338
+ OrgCreateRequest: {
1339
+ name: string
1340
+ description?: string
1341
+ slug: string
1342
+ }
1343
+ OrgUpdateRequest: {
1344
+ name?: string
1345
+ description?: string
1346
+ /** Format: uri */
1347
+ avatar_url?: string
1348
+ }
1349
+ /**
1350
+ * @description Hierarchy (highest to lowest): owner > admin > member > viewer.
1351
+ * @enum {string}
1352
+ */
1353
+ OrgMemberRole: "owner" | "admin" | "member" | "viewer"
1354
+ OrgMember: {
1355
+ /** Format: uuid */
1356
+ id: string
1357
+ /** @enum {string} */
1358
+ object: "org_member"
1359
+ /** Format: uuid */
1360
+ org_id: string
1361
+ /** Format: uuid */
1362
+ user_id: string
1363
+ role: components["schemas"]["OrgMemberRole"]
1364
+ /** Format: date-time */
1365
+ created_at: string
1366
+ /** Format: date-time */
1367
+ updated_at: string
1368
+ }
1369
+ OrgMemberListResponse: {
1370
+ data: components["schemas"]["OrgMember"][]
1371
+ meta: components["schemas"]["OffsetMeta"]
1372
+ }
1373
+ OrgMemberUpdateRequest: {
1374
+ role: components["schemas"]["OrgMemberRole"]
1375
+ }
1376
+ OrgInvitationCreateRequest: {
1377
+ /** Format: uuid */
1378
+ user_id?: string
1379
+ role: components["schemas"]["OrgInvitationRole"]
1380
+ }
1381
+ /** @enum {string} */
1382
+ WebhookScope: "agent" | "org"
1383
+ /** @enum {string} */
1384
+ WebhookEvent: "conversation.started" | "conversation.ended" | "conversation.message.created" | "agent.status.updated" | "agent.updated" | "agent.deleted"
1385
+ /** @enum {string} */
1386
+ WebhookDeliveryStatus: "pending" | "success" | "failed"
1387
+ Webhook: {
1388
+ /** Format: uuid */
1389
+ id: string
1390
+ /** @enum {string} */
1391
+ object: "webhook"
1392
+ scope: components["schemas"]["WebhookScope"]
1393
+ /** Format: uuid */
1394
+ agent_id?: string
1395
+ /** Format: uuid */
1396
+ org_id?: string
1397
+ active: boolean
1398
+ /** Format: uri */
1399
+ url: string
1400
+ /**
1401
+ * @default json
1402
+ * @enum {string}
1403
+ */
1404
+ content_type: "json" | "form"
1405
+ secret?: string
1406
+ events: components["schemas"]["WebhookEvent"][]
1407
+ /** Format: date-time */
1408
+ last_delivery_at?: string
1409
+ last_delivery_status?: components["schemas"]["WebhookDeliveryStatus"]
1410
+ /** Format: date-time */
1411
+ created_at: string
1412
+ /** Format: date-time */
1413
+ updated_at: string
1414
+ }
1415
+ WebhookListResponse: {
1416
+ data: components["schemas"]["Webhook"][]
1417
+ meta: components["schemas"]["OffsetMeta"]
1418
+ }
1419
+ WebhookCreateRequest: {
1420
+ /** Format: uri */
1421
+ url: string
1422
+ /**
1423
+ * @default json
1424
+ * @enum {string}
1425
+ */
1426
+ content_type: "json" | "form"
1427
+ secret?: string
1428
+ events: components["schemas"]["WebhookEvent"][]
1429
+ /** @default true */
1430
+ active: boolean
1431
+ }
1432
+ WebhookUpdateRequest: {
1433
+ /** Format: uri */
1434
+ url?: string
1435
+ /** @enum {string} */
1436
+ content_type?: "json" | "form"
1437
+ secret?: string
1438
+ events?: components["schemas"]["WebhookEvent"][]
1439
+ active?: boolean
1440
+ }
1441
+ AgentUpdateRequest: {
1442
+ config?: components["schemas"]["AgentConfig"]
1443
+ secrets?: components["schemas"]["AgentSecret"][]
1444
+ blueprint?: components["schemas"]["AgentBlueprint"]
1445
+ }
1446
+ AgentUpdateStatusRequest: {
1447
+ status: components["schemas"]["AgentStatus"]
1448
+ }
1449
+ AgentLintRequest: {
1450
+ blueprint?: components["schemas"]["AgentBlueprint"]
1451
+ }
1452
+ AgentLintResponse: {
1453
+ errors: string[]
1454
+ }
1455
+ /** @enum {string} */
1456
+ ConversationMessageRole: "user" | "assistant" | "tool"
1457
+ ConversationToolCall: {
1458
+ /** @description The unique invocation ID assigned by the LLM for this specific tool call. Echoed back in the tool result message via tool_call_id. */
1459
+ id: string
1460
+ /** @description The name of the tool that was invoked. */
1461
+ name: string
1462
+ /** @description The parsed arguments the LLM passed to the tool. */
1463
+ arguments: {
1464
+ [key: string]: unknown
1465
+ }
1466
+ }
1467
+ ConversationMessage: {
1468
+ /** Format: uuid */
1469
+ id: string
1470
+ /** @enum {string} */
1471
+ object: "conversation_message"
1472
+ /** Format: uuid */
1473
+ conversation_id: string
1474
+ role: components["schemas"]["ConversationMessageRole"]
1475
+ /** @description The text content of the message. Always present for user and tool messages. May be empty for assistant messages that only contain tool_calls. */
1476
+ content?: string
1477
+ /** @description Only present when role is assistant and the model invoked one or more tools. Null or absent for all other roles. */
1478
+ tool_calls?: components["schemas"]["ConversationToolCall"][]
1479
+ /** @description Only present when role is tool. References the id field of the ConversationToolCall in the preceding assistant message that triggered this tool execution. */
1480
+ tool_call_id?: string
1481
+ /** Format: date-time */
1482
+ created_at: string
1483
+ }
1484
+ ConversationMessageListResponse: {
1485
+ data: components["schemas"]["ConversationMessage"][]
1486
+ meta: components["schemas"]["CursorMeta"]
1487
+ }
1488
+ KnowledgeBaseUpdateRequest: {
1489
+ name?: string
1490
+ description?: string
1491
+ embedding_model?: string
1492
+ chunk_strategy?: components["schemas"]["KnowledgeBaseChunkStrategy"]
1493
+ }
1494
+ /**
1495
+ * @description How the document content was provided.
1496
+ * `file` uploaded binary (PDF, DOCX, TXT, etc.).
1497
+ * `url` fetched from a remote URL.
1498
+ * `raw_text` plain text submitted inline.
1499
+ * @enum {string}
1500
+ */
1501
+ KnowledgeBaseDocumentType: "file" | "url" | "raw_text"
1502
+ /** @enum {string} */
1503
+ KnowledgeBaseIngestionStatus: "pending" | "processing" | "ready" | "failed"
1504
+ KnowledgeBaseDocument: {
1505
+ /** Format: uuid */
1506
+ id: string
1507
+ /** @enum {string} */
1508
+ object: "knowledge_base_document"
1509
+ /** Format: uuid */
1510
+ knowledge_base_id: string
1511
+ /** @description Original filename, URL, or user-provided label. */
1512
+ name: string
1513
+ source_type: components["schemas"]["KnowledgeBaseDocumentType"]
1514
+ /** @description The internal storage path or external URL. */
1515
+ source_uri?: string
1516
+ /** @description The MIME type of the document. */
1517
+ mime_type: string
1518
+ status: components["schemas"]["KnowledgeBaseIngestionStatus"]
1519
+ /** @description Present only when status is `failed`. */
1520
+ error_message?: string
1521
+ /** Format: int64 */
1522
+ size_bytes: number
1523
+ /** @description Number of chunks after processing. 0 until complete. */
1524
+ chunk_count: number
1525
+ /** Format: date-time */
1526
+ processed_at?: string
1527
+ /** Format: date-time */
1528
+ created_at: string
1529
+ /** Format: date-time */
1530
+ updated_at: string
1531
+ }
1532
+ KnowledgeBaseDocumentListResponse: {
1533
+ data: components["schemas"]["KnowledgeBaseDocument"][]
1534
+ meta: components["schemas"]["OffsetMeta"]
1535
+ }
1536
+ KnowledgeBaseDocumentCreateFromURLRequest: {
1537
+ /**
1538
+ * @description discriminator enum property added by openapi-typescript
1539
+ * @enum {string}
1540
+ */
1541
+ source_type: "url"
1542
+ name: string
1543
+ /** Format: uri */
1544
+ source_uri: string
1545
+ }
1546
+ KnowledgeBaseDocumentCreateFromTextRequest: {
1547
+ /**
1548
+ * @description discriminator enum property added by openapi-typescript
1549
+ * @enum {string}
1550
+ */
1551
+ source_type: "raw_text"
1552
+ name: string
1553
+ content: string
1554
+ }
1555
+ KnowledgeBaseDocumentCreateFromFileRequest: {
1556
+ /** @enum {string} */
1557
+ source_type: "file"
1558
+ name: string
1559
+ /** Format: binary */
1560
+ file: string
1561
+ }
1562
+ KnowledgeBaseQueryRequest: {
1563
+ query: string
1564
+ /** @default 3 */
1565
+ top_k: number
1566
+ }
1567
+ KnowledgeBaseQueryMatch: {
1568
+ content: string
1569
+ /** @description The JSONB metadata associated with this chunk. */
1570
+ metadata: {
1571
+ [key: string]: unknown
1572
+ }
1573
+ /**
1574
+ * Format: float
1575
+ * @description Cosine similarity score (closer to 1 is better depending on metric).
1576
+ */
1577
+ score: number
1578
+ }
1579
+ KnowledgeBaseQueryResponse: {
1580
+ data: components["schemas"]["KnowledgeBaseQueryMatch"][]
1581
+ }
1582
+ };
1583
+ responses: {
1584
+ /** @description An unexpected internal server error occurred */
1585
+ Internal: {
1586
+ headers: {
1587
+ [name: string]: unknown
1588
+ }
1589
+ content: {
1590
+ "application/json": components["schemas"]["Error"]
1591
+ }
1592
+ }
1593
+ /** @description Request body or parameters failed validation */
1594
+ BadRequest: {
1595
+ headers: {
1596
+ [name: string]: unknown
1597
+ }
1598
+ content: {
1599
+ "application/json": components["schemas"]["Error"]
1600
+ }
1601
+ }
1602
+ /** @description Resource already exists or state conflict */
1603
+ Conflict: {
1604
+ headers: {
1605
+ [name: string]: unknown
1606
+ }
1607
+ content: {
1608
+ "application/json": components["schemas"]["Error"]
1609
+ }
1610
+ }
1611
+ /** @description Not authenticated */
1612
+ Unauthorized: {
1613
+ headers: {
1614
+ [name: string]: unknown
1615
+ }
1616
+ content: {
1617
+ "application/json": components["schemas"]["Error"]
1618
+ }
1619
+ }
1620
+ /** @description Resource not found */
1621
+ NotFound: {
1622
+ headers: {
1623
+ [name: string]: unknown
1624
+ }
1625
+ content: {
1626
+ "application/json": components["schemas"]["Error"]
1627
+ }
1628
+ }
1629
+ /** @description Insufficient permissions */
1630
+ Forbidden: {
1631
+ headers: {
1632
+ [name: string]: unknown
1633
+ }
1634
+ content: {
1635
+ "application/json": components["schemas"]["Error"]
1636
+ }
1637
+ }
1638
+ };
1639
+ parameters: never;
1640
+ requestBodies: never;
1641
+ headers: never;
1642
+ pathItems: never;
55
1643
  }
56
- /**
57
- * Paginated represents a paginated response containing items and metadata.
58
- */
59
- type Paginated<T> = {
60
- items: T
61
- total: number
62
- page: number
63
- page_size: number
64
- total_pages: number
65
- };
66
- type AgentStatus = "live" | "draft" | "archived";
67
- type Agent = {
68
- id: string
69
- template_id: string
70
- config: AgentConfig
71
- blueprint: AgentBlueprint
72
- status: AgentStatus
73
- created_at: Date
74
- updated_at: Date
75
- };
76
- type AgentConfig = {
77
- name: string
78
- description: string
79
- system_prompt: string
80
- language: string
81
- max_session_duration_minutes: number
82
- max_silence_timeout_seconds: number
83
- allow_interruptions: boolean
84
- };
85
- type AgentBlueprint<
86
- NodeType = unknown,
87
- EdgeType = unknown
88
- > = {
89
- nodes: NodeType[]
90
- edges: EdgeType[]
91
- };
92
- type AgentCreate = Partial<Pick<Agent, "config" | "blueprint" | "status" | "template_id">>;
93
- type AgentUpdate = Partial<Pick<AgentCreate, "config" | "blueprint">>;
94
- type NodeType = "CONTROL.START" | "CONTROL.DIALOG" | "CONTROL.END" | "LOGICAL.EVAL" | "FUNCTION.SET_VAR" | "FUNCTION.WEBHOOK" | "FUNCTION.EMAIL_NOTIFY" | "FUNCTION.KIBOT_NOTIFY" | "FUNCTION.TRANSFER" | "FUNCTION.TERMINATE";
95
- type Node = {
96
- id: string
97
- type: NodeType
98
- position: NodePosition
99
- measured: NodeDimensions
100
- data: Record<string, unknown>
101
- };
102
- type NodePosition = {
103
- x: number
104
- y: number
105
- };
106
- type NodeDimensions = {
107
- width: number
108
- height: number
109
- };
110
- type Edge = {
111
- id: string
112
- source: string
113
- target: string
114
- label: string
115
- };
116
- /**
117
- * Configuration for listing agents.
118
- */
119
- type AgentListParams = {
120
- /** Number of results per page */
121
- limit?: number
122
- /** Page number (1-indexed) */
123
- page?: number
124
- /** Search query */
125
- search?: string
126
- };
127
- /**
128
- * Client for interacting with KIVOX agents.
129
- *
130
- * @example
131
- * ```ts
132
- * const agents = await kivox.agents.list({ limit: 20 });
133
- * const agent = await kivox.agents.get('019bb51e-e45f-75e3-b828-94fdf231711e');
134
- * ```
135
- */
136
- declare class AgentClient {
137
- private readonly http;
138
- constructor(http: HttpTransport);
139
- /**
140
- * Lists all agents with optional filtering and pagination.
141
- *
142
- * @param params List configuration
143
- * @returns Paginated list of agents
144
- */
145
- list(params?: AgentListParams): Promise<Paginated<Agent[]>>;
146
- /**
147
- * Lists all live agents with optional filtering and pagination.
148
- *
149
- * @param params List configuration
150
- * @returns Paginated list of live agents
151
- */
152
- listLive(params?: AgentListParams): Promise<Paginated<Agent[]>>;
153
- /**
154
- * Lists all draft agents with optional filtering and pagination.
155
- *
156
- * @param params List configuration
157
- * @returns Paginated list of draft agents
158
- */
159
- listDraft(params?: AgentListParams): Promise<Paginated<Agent[]>>;
160
- /**
161
- * Lists all archived agents with optional filtering and pagination.
162
- *
163
- * @param params List configuration
164
- * @returns Paginated list of archived agents
165
- */
166
- listArchived(params?: AgentListParams): Promise<Paginated<Agent[]>>;
167
- /**
168
- * Gets a single agent by ID.
169
- *
170
- * @param id Agent ID
171
- * @returns Agent details
172
- */
173
- get(id: string): Promise<Agent>;
174
- /**
175
- * Creates a new agent.
176
- *
177
- * @param data Agent data
178
- * @returns Created agent
179
- */
180
- create(data: AgentCreate): Promise<Agent>;
181
- /**
182
- * Updates an existing agent.
183
- *
184
- * @param id Agent ID
185
- * @param data Updated agent data
186
- * @returns Updated agent
187
- */
188
- update(id: string, data: AgentUpdate): Promise<Agent>;
189
- /**
190
- * Marks an agent as live.
191
- *
192
- * @param id Agent ID
193
- * @returns Updated agent
194
- */
195
- markAsLive(id: string): Promise<Agent>;
196
- /**
197
- * Marks an agent as draft.
198
- *
199
- * @param id Agent ID
200
- * @returns Updated agent
201
- */
202
- markAsDraft(id: string): Promise<Agent>;
203
- /**
204
- * Marks an agent as archived.
205
- *
206
- * @param id Agent ID
207
- * @returns Updated agent
208
- */
209
- markAsArchived(id: string): Promise<Agent>;
210
- /**
211
- * Deletes an agent.
212
- *
213
- * @param id Agent ID
214
- */
215
- delete(id: string): Promise<Agent>;
216
- /**
217
- * Parses a list of agents with stringified config and blueprint fields.
218
- *
219
- * @returns List of parsed agents.
220
- */
221
- private static parseAgents;
222
- /**
223
- * Parses an agent with stringified config and blueprint fields.
224
- *
225
- * @returns Agent with parsed config and blueprint.
226
- */
227
- private static parseAgent;
1644
+ interface operations {
1645
+ createRegistration: {
1646
+ parameters: {
1647
+ query?: never
1648
+ header: {
1649
+ /** @description Cloudflare Turnstile challenge token. */
1650
+ "X-Turnstile-Token": string
1651
+ }
1652
+ path?: never
1653
+ cookie?: never
1654
+ }
1655
+ requestBody: {
1656
+ content: {
1657
+ "application/json": components["schemas"]["AuthSignupRequest"]
1658
+ }
1659
+ }
1660
+ responses: {
1661
+ /** @description Account created. Session cookie set in `Set-Cookie`. */
1662
+ 201: {
1663
+ headers: {
1664
+ "Set-Cookie"?: string
1665
+ [name: string]: unknown
1666
+ }
1667
+ content: {
1668
+ "application/json": components["schemas"]["AuthSessionResponse"]
1669
+ }
1670
+ }
1671
+ 400: components["responses"]["BadRequest"]
1672
+ 409: components["responses"]["Conflict"]
1673
+ default: components["responses"]["Internal"]
1674
+ }
1675
+ };
1676
+ createSession: {
1677
+ parameters: {
1678
+ query?: never
1679
+ header: {
1680
+ "X-Turnstile-Token": string
1681
+ }
1682
+ path?: never
1683
+ cookie?: never
1684
+ }
1685
+ requestBody: {
1686
+ content: {
1687
+ "application/json": components["schemas"]["AuthSigninRequest"]
1688
+ }
1689
+ }
1690
+ responses: {
1691
+ /** @description Session created. Cookie set in `Set-Cookie`. */
1692
+ 201: {
1693
+ headers: {
1694
+ "Set-Cookie"?: string
1695
+ [name: string]: unknown
1696
+ }
1697
+ content: {
1698
+ "application/json": components["schemas"]["AuthSessionResponse"]
1699
+ }
1700
+ }
1701
+ 400: components["responses"]["BadRequest"]
1702
+ 401: components["responses"]["Unauthorized"]
1703
+ default: components["responses"]["Internal"]
1704
+ }
1705
+ };
1706
+ revokeAllSessions: {
1707
+ parameters: {
1708
+ query?: never
1709
+ header?: never
1710
+ path?: never
1711
+ cookie?: never
1712
+ }
1713
+ requestBody?: never
1714
+ responses: {
1715
+ /** @description All sessions revoked. */
1716
+ 204: {
1717
+ headers: {
1718
+ [name: string]: unknown
1719
+ }
1720
+ content?: never
1721
+ }
1722
+ 401: components["responses"]["Unauthorized"]
1723
+ default: components["responses"]["Internal"]
1724
+ }
1725
+ };
1726
+ revokeCurrentSession: {
1727
+ parameters: {
1728
+ query?: never
1729
+ header?: never
1730
+ path?: never
1731
+ cookie?: never
1732
+ }
1733
+ requestBody?: never
1734
+ responses: {
1735
+ /** @description Session revoked. */
1736
+ 204: {
1737
+ headers: {
1738
+ [name: string]: unknown
1739
+ }
1740
+ content?: never
1741
+ }
1742
+ 401: components["responses"]["Unauthorized"]
1743
+ default: components["responses"]["Internal"]
1744
+ }
1745
+ };
1746
+ createPasswordRecovery: {
1747
+ parameters: {
1748
+ query?: never
1749
+ header: {
1750
+ "X-Turnstile-Token": string
1751
+ }
1752
+ path?: never
1753
+ cookie?: never
1754
+ }
1755
+ requestBody: {
1756
+ content: {
1757
+ "application/json": components["schemas"]["AuthPasswordRecoverRequest"]
1758
+ }
1759
+ }
1760
+ responses: {
1761
+ /** @description Reset email sent (or silently dropped if not found). */
1762
+ 204: {
1763
+ headers: {
1764
+ [name: string]: unknown
1765
+ }
1766
+ content?: never
1767
+ }
1768
+ 400: components["responses"]["BadRequest"]
1769
+ default: components["responses"]["Internal"]
1770
+ }
1771
+ };
1772
+ createPasswordReset: {
1773
+ parameters: {
1774
+ query?: never
1775
+ header?: never
1776
+ path?: never
1777
+ cookie?: never
1778
+ }
1779
+ requestBody: {
1780
+ content: {
1781
+ "application/json": components["schemas"]["AuthPasswordResetRequest"]
1782
+ }
1783
+ }
1784
+ responses: {
1785
+ /** @description Password updated. All sessions revoked. */
1786
+ 204: {
1787
+ headers: {
1788
+ [name: string]: unknown
1789
+ }
1790
+ content?: never
1791
+ }
1792
+ 400: components["responses"]["BadRequest"]
1793
+ default: components["responses"]["Internal"]
1794
+ }
1795
+ };
1796
+ listAPIKeys: {
1797
+ parameters: {
1798
+ query?: {
1799
+ limit?: number
1800
+ page?: number
1801
+ }
1802
+ header?: never
1803
+ path?: never
1804
+ cookie?: never
1805
+ }
1806
+ requestBody?: never
1807
+ responses: {
1808
+ /** @description OK */
1809
+ 200: {
1810
+ headers: {
1811
+ [name: string]: unknown
1812
+ }
1813
+ content: {
1814
+ "application/json": components["schemas"]["APIKeyListResponse"]
1815
+ }
1816
+ }
1817
+ 401: components["responses"]["Unauthorized"]
1818
+ default: components["responses"]["Internal"]
1819
+ }
1820
+ };
1821
+ createAPIKey: {
1822
+ parameters: {
1823
+ query?: never
1824
+ header?: never
1825
+ path?: never
1826
+ cookie?: never
1827
+ }
1828
+ requestBody: {
1829
+ content: {
1830
+ "application/json": components["schemas"]["APIKeyCreateRequest"]
1831
+ }
1832
+ }
1833
+ responses: {
1834
+ /** @description Key created. The `key` field contains the full raw value and will not be returned again. */
1835
+ 201: {
1836
+ headers: {
1837
+ [name: string]: unknown
1838
+ }
1839
+ content: {
1840
+ "application/json": components["schemas"]["APIKeyCreateResponse"]
1841
+ }
1842
+ }
1843
+ 400: components["responses"]["BadRequest"]
1844
+ 401: components["responses"]["Unauthorized"]
1845
+ default: components["responses"]["Internal"]
1846
+ }
1847
+ };
1848
+ revokeAPIKey: {
1849
+ parameters: {
1850
+ query?: never
1851
+ header?: never
1852
+ path: {
1853
+ key_id: string
1854
+ }
1855
+ cookie?: never
1856
+ }
1857
+ requestBody?: never
1858
+ responses: {
1859
+ /** @description Key revoked. */
1860
+ 204: {
1861
+ headers: {
1862
+ [name: string]: unknown
1863
+ }
1864
+ content?: never
1865
+ }
1866
+ 401: components["responses"]["Unauthorized"]
1867
+ 404: components["responses"]["NotFound"]
1868
+ default: components["responses"]["Internal"]
1869
+ }
1870
+ };
1871
+ getUser: {
1872
+ parameters: {
1873
+ query?: never
1874
+ header?: never
1875
+ path?: never
1876
+ cookie?: never
1877
+ }
1878
+ requestBody?: never
1879
+ responses: {
1880
+ /** @description OK */
1881
+ 200: {
1882
+ headers: {
1883
+ [name: string]: unknown
1884
+ }
1885
+ content: {
1886
+ "application/json": components["schemas"]["User"]
1887
+ }
1888
+ }
1889
+ 401: components["responses"]["Unauthorized"]
1890
+ default: components["responses"]["Internal"]
1891
+ }
1892
+ };
1893
+ deleteUser: {
1894
+ parameters: {
1895
+ query?: never
1896
+ header?: never
1897
+ path?: never
1898
+ cookie?: never
1899
+ }
1900
+ requestBody?: never
1901
+ responses: {
1902
+ /** @description Account deleted. */
1903
+ 204: {
1904
+ headers: {
1905
+ [name: string]: unknown
1906
+ }
1907
+ content?: never
1908
+ }
1909
+ 401: components["responses"]["Unauthorized"]
1910
+ default: components["responses"]["Internal"]
1911
+ }
1912
+ };
1913
+ updateUser: {
1914
+ parameters: {
1915
+ query?: never
1916
+ header?: never
1917
+ path?: never
1918
+ cookie?: never
1919
+ }
1920
+ requestBody: {
1921
+ content: {
1922
+ "application/json": components["schemas"]["UserUpdateRequest"]
1923
+ }
1924
+ }
1925
+ responses: {
1926
+ /** @description Updated. */
1927
+ 200: {
1928
+ headers: {
1929
+ [name: string]: unknown
1930
+ }
1931
+ content: {
1932
+ "application/json": components["schemas"]["User"]
1933
+ }
1934
+ }
1935
+ 400: components["responses"]["BadRequest"]
1936
+ 401: components["responses"]["Unauthorized"]
1937
+ default: components["responses"]["Internal"]
1938
+ }
1939
+ };
1940
+ updateUserEmail: {
1941
+ parameters: {
1942
+ query?: never
1943
+ header?: never
1944
+ path?: never
1945
+ cookie?: never
1946
+ }
1947
+ requestBody: {
1948
+ content: {
1949
+ "application/json": components["schemas"]["UserUpdateEmailRequest"]
1950
+ }
1951
+ }
1952
+ responses: {
1953
+ /** @description Email updated. */
1954
+ 200: {
1955
+ headers: {
1956
+ [name: string]: unknown
1957
+ }
1958
+ content: {
1959
+ "application/json": components["schemas"]["User"]
1960
+ }
1961
+ }
1962
+ 400: components["responses"]["BadRequest"]
1963
+ 401: components["responses"]["Unauthorized"]
1964
+ 409: components["responses"]["Conflict"]
1965
+ default: components["responses"]["Internal"]
1966
+ }
1967
+ };
1968
+ listUserAgents: {
1969
+ parameters: {
1970
+ query?: {
1971
+ limit?: number
1972
+ page?: number
1973
+ search?: string
1974
+ }
1975
+ header?: never
1976
+ path?: never
1977
+ cookie?: never
1978
+ }
1979
+ requestBody?: never
1980
+ responses: {
1981
+ /** @description OK */
1982
+ 200: {
1983
+ headers: {
1984
+ [name: string]: unknown
1985
+ }
1986
+ content: {
1987
+ "application/json": components["schemas"]["AgentListResponse"]
1988
+ }
1989
+ }
1990
+ 401: components["responses"]["Unauthorized"]
1991
+ default: components["responses"]["Internal"]
1992
+ }
1993
+ };
1994
+ createUserAgent: {
1995
+ parameters: {
1996
+ query?: never
1997
+ header?: never
1998
+ path?: never
1999
+ cookie?: never
2000
+ }
2001
+ requestBody: {
2002
+ content: {
2003
+ "application/json": components["schemas"]["AgentCreateRequest"]
2004
+ }
2005
+ }
2006
+ responses: {
2007
+ /** @description Agent created. */
2008
+ 201: {
2009
+ headers: {
2010
+ [name: string]: unknown
2011
+ }
2012
+ content: {
2013
+ "application/json": components["schemas"]["Agent"]
2014
+ }
2015
+ }
2016
+ 400: components["responses"]["BadRequest"]
2017
+ 401: components["responses"]["Unauthorized"]
2018
+ default: components["responses"]["Internal"]
2019
+ }
2020
+ };
2021
+ listUserConversations: {
2022
+ parameters: {
2023
+ query?: {
2024
+ limit?: number
2025
+ /** @description Cursor for pagination */
2026
+ cursor?: string
2027
+ }
2028
+ header?: never
2029
+ path?: never
2030
+ cookie?: never
2031
+ }
2032
+ requestBody?: never
2033
+ responses: {
2034
+ /** @description OK */
2035
+ 200: {
2036
+ headers: {
2037
+ [name: string]: unknown
2038
+ }
2039
+ content: {
2040
+ "application/json": components["schemas"]["ConversationListResponse"]
2041
+ }
2042
+ }
2043
+ 401: components["responses"]["Unauthorized"]
2044
+ default: components["responses"]["Internal"]
2045
+ }
2046
+ };
2047
+ listUserKnowledgeBases: {
2048
+ parameters: {
2049
+ query?: {
2050
+ limit?: number
2051
+ page?: number
2052
+ }
2053
+ header?: never
2054
+ path?: never
2055
+ cookie?: never
2056
+ }
2057
+ requestBody?: never
2058
+ responses: {
2059
+ /** @description OK */
2060
+ 200: {
2061
+ headers: {
2062
+ [name: string]: unknown
2063
+ }
2064
+ content: {
2065
+ "application/json": components["schemas"]["KnowledgeBaseListResponse"]
2066
+ }
2067
+ }
2068
+ 401: components["responses"]["Unauthorized"]
2069
+ default: components["responses"]["Internal"]
2070
+ }
2071
+ };
2072
+ createUserKnowledgeBase: {
2073
+ parameters: {
2074
+ query?: never
2075
+ header?: never
2076
+ path?: never
2077
+ cookie?: never
2078
+ }
2079
+ requestBody: {
2080
+ content: {
2081
+ "application/json": components["schemas"]["KnowledgeBaseCreateRequest"]
2082
+ }
2083
+ }
2084
+ responses: {
2085
+ /** @description Knowledge base created. */
2086
+ 201: {
2087
+ headers: {
2088
+ [name: string]: unknown
2089
+ }
2090
+ content: {
2091
+ "application/json": components["schemas"]["KnowledgeBase"]
2092
+ }
2093
+ }
2094
+ 400: components["responses"]["BadRequest"]
2095
+ 401: components["responses"]["Unauthorized"]
2096
+ default: components["responses"]["Internal"]
2097
+ }
2098
+ };
2099
+ listUserInvitations: {
2100
+ parameters: {
2101
+ query?: {
2102
+ limit?: number
2103
+ page?: number
2104
+ }
2105
+ header?: never
2106
+ path?: never
2107
+ cookie?: never
2108
+ }
2109
+ requestBody?: never
2110
+ responses: {
2111
+ /** @description OK */
2112
+ 200: {
2113
+ headers: {
2114
+ [name: string]: unknown
2115
+ }
2116
+ content: {
2117
+ "application/json": components["schemas"]["OrgInvitationListResponse"]
2118
+ }
2119
+ }
2120
+ 401: components["responses"]["Unauthorized"]
2121
+ default: components["responses"]["Internal"]
2122
+ }
2123
+ };
2124
+ updateUserInvitation: {
2125
+ parameters: {
2126
+ query?: never
2127
+ header?: never
2128
+ path: {
2129
+ invitation_id: string
2130
+ }
2131
+ cookie?: never
2132
+ }
2133
+ requestBody: {
2134
+ content: {
2135
+ "application/json": components["schemas"]["OrgInvitationStateUpdateRequest"]
2136
+ }
2137
+ }
2138
+ responses: {
2139
+ /** @description State updated. */
2140
+ 200: {
2141
+ headers: {
2142
+ [name: string]: unknown
2143
+ }
2144
+ content: {
2145
+ "application/json": components["schemas"]["OrgInvitation"]
2146
+ }
2147
+ }
2148
+ 400: components["responses"]["BadRequest"]
2149
+ 401: components["responses"]["Unauthorized"]
2150
+ 404: components["responses"]["NotFound"]
2151
+ default: components["responses"]["Internal"]
2152
+ }
2153
+ };
2154
+ listModels: {
2155
+ parameters: {
2156
+ query?: {
2157
+ /** @description Filter models by name or id. */
2158
+ search?: string
2159
+ /** @description Filter models by capabilities (e.g. "llm", "embedding", "free"). */
2160
+ tags?: string[]
2161
+ }
2162
+ header?: never
2163
+ path?: never
2164
+ cookie?: never
2165
+ }
2166
+ requestBody?: never
2167
+ responses: {
2168
+ /** @description OK */
2169
+ 200: {
2170
+ headers: {
2171
+ [name: string]: unknown
2172
+ }
2173
+ content: {
2174
+ "application/json": components["schemas"]["ModelListResponse"]
2175
+ }
2176
+ }
2177
+ 401: components["responses"]["Unauthorized"]
2178
+ default: components["responses"]["Internal"]
2179
+ }
2180
+ };
2181
+ getModel: {
2182
+ parameters: {
2183
+ query?: never
2184
+ header?: never
2185
+ path: {
2186
+ /** @description Permanent slug for the model that never changes. */
2187
+ model_slug: string
2188
+ }
2189
+ cookie?: never
2190
+ }
2191
+ requestBody?: never
2192
+ responses: {
2193
+ /** @description OK */
2194
+ 200: {
2195
+ headers: {
2196
+ [name: string]: unknown
2197
+ }
2198
+ content: {
2199
+ "application/json": components["schemas"]["Model"]
2200
+ }
2201
+ }
2202
+ 401: components["responses"]["Unauthorized"]
2203
+ 404: components["responses"]["NotFound"]
2204
+ default: components["responses"]["Internal"]
2205
+ }
2206
+ };
2207
+ listOrgs: {
2208
+ parameters: {
2209
+ query?: {
2210
+ limit?: number
2211
+ page?: number
2212
+ }
2213
+ header?: never
2214
+ path?: never
2215
+ cookie?: never
2216
+ }
2217
+ requestBody?: never
2218
+ responses: {
2219
+ /** @description OK */
2220
+ 200: {
2221
+ headers: {
2222
+ [name: string]: unknown
2223
+ }
2224
+ content: {
2225
+ "application/json": components["schemas"]["OrgListResponse"]
2226
+ }
2227
+ }
2228
+ 401: components["responses"]["Unauthorized"]
2229
+ default: components["responses"]["Internal"]
2230
+ }
2231
+ };
2232
+ createOrg: {
2233
+ parameters: {
2234
+ query?: never
2235
+ header?: never
2236
+ path?: never
2237
+ cookie?: never
2238
+ }
2239
+ requestBody: {
2240
+ content: {
2241
+ "application/json": components["schemas"]["OrgCreateRequest"]
2242
+ }
2243
+ }
2244
+ responses: {
2245
+ /** @description Organization created. */
2246
+ 201: {
2247
+ headers: {
2248
+ [name: string]: unknown
2249
+ }
2250
+ content: {
2251
+ "application/json": components["schemas"]["Org"]
2252
+ }
2253
+ }
2254
+ 400: components["responses"]["BadRequest"]
2255
+ 401: components["responses"]["Unauthorized"]
2256
+ 409: components["responses"]["Conflict"]
2257
+ default: components["responses"]["Internal"]
2258
+ }
2259
+ };
2260
+ getOrg: {
2261
+ parameters: {
2262
+ query?: never
2263
+ header?: never
2264
+ path: {
2265
+ org_slug: string
2266
+ }
2267
+ cookie?: never
2268
+ }
2269
+ requestBody?: never
2270
+ responses: {
2271
+ /** @description OK */
2272
+ 200: {
2273
+ headers: {
2274
+ [name: string]: unknown
2275
+ }
2276
+ content: {
2277
+ "application/json": components["schemas"]["Org"]
2278
+ }
2279
+ }
2280
+ 401: components["responses"]["Unauthorized"]
2281
+ 403: components["responses"]["Forbidden"]
2282
+ 404: components["responses"]["NotFound"]
2283
+ default: components["responses"]["Internal"]
2284
+ }
2285
+ };
2286
+ deleteOrg: {
2287
+ parameters: {
2288
+ query?: never
2289
+ header?: never
2290
+ path: {
2291
+ org_slug: string
2292
+ }
2293
+ cookie?: never
2294
+ }
2295
+ requestBody?: never
2296
+ responses: {
2297
+ /** @description Organization deleted. */
2298
+ 204: {
2299
+ headers: {
2300
+ [name: string]: unknown
2301
+ }
2302
+ content?: never
2303
+ }
2304
+ 401: components["responses"]["Unauthorized"]
2305
+ 403: components["responses"]["Forbidden"]
2306
+ 404: components["responses"]["NotFound"]
2307
+ default: components["responses"]["Internal"]
2308
+ }
2309
+ };
2310
+ updateOrg: {
2311
+ parameters: {
2312
+ query?: never
2313
+ header?: never
2314
+ path: {
2315
+ org_slug: string
2316
+ }
2317
+ cookie?: never
2318
+ }
2319
+ requestBody: {
2320
+ content: {
2321
+ "application/json": components["schemas"]["OrgUpdateRequest"]
2322
+ }
2323
+ }
2324
+ responses: {
2325
+ /** @description Updated. */
2326
+ 200: {
2327
+ headers: {
2328
+ [name: string]: unknown
2329
+ }
2330
+ content: {
2331
+ "application/json": components["schemas"]["Org"]
2332
+ }
2333
+ }
2334
+ 400: components["responses"]["BadRequest"]
2335
+ 401: components["responses"]["Unauthorized"]
2336
+ 403: components["responses"]["Forbidden"]
2337
+ 404: components["responses"]["NotFound"]
2338
+ default: components["responses"]["Internal"]
2339
+ }
2340
+ };
2341
+ listOrgMembers: {
2342
+ parameters: {
2343
+ query?: {
2344
+ limit?: number
2345
+ page?: number
2346
+ }
2347
+ header?: never
2348
+ path: {
2349
+ org_slug: string
2350
+ }
2351
+ cookie?: never
2352
+ }
2353
+ requestBody?: never
2354
+ responses: {
2355
+ /** @description OK */
2356
+ 200: {
2357
+ headers: {
2358
+ [name: string]: unknown
2359
+ }
2360
+ content: {
2361
+ "application/json": components["schemas"]["OrgMemberListResponse"]
2362
+ }
2363
+ }
2364
+ 401: components["responses"]["Unauthorized"]
2365
+ 403: components["responses"]["Forbidden"]
2366
+ 404: components["responses"]["NotFound"]
2367
+ default: components["responses"]["Internal"]
2368
+ }
2369
+ };
2370
+ removeOrgMember: {
2371
+ parameters: {
2372
+ query?: never
2373
+ header?: never
2374
+ path: {
2375
+ org_slug: string
2376
+ user_id: string
2377
+ }
2378
+ cookie?: never
2379
+ }
2380
+ requestBody?: never
2381
+ responses: {
2382
+ /** @description Member removed. */
2383
+ 204: {
2384
+ headers: {
2385
+ [name: string]: unknown
2386
+ }
2387
+ content?: never
2388
+ }
2389
+ 401: components["responses"]["Unauthorized"]
2390
+ 403: components["responses"]["Forbidden"]
2391
+ 404: components["responses"]["NotFound"]
2392
+ default: components["responses"]["Internal"]
2393
+ }
2394
+ };
2395
+ updateOrgMember: {
2396
+ parameters: {
2397
+ query?: never
2398
+ header?: never
2399
+ path: {
2400
+ org_slug: string
2401
+ user_id: string
2402
+ }
2403
+ cookie?: never
2404
+ }
2405
+ requestBody: {
2406
+ content: {
2407
+ "application/json": components["schemas"]["OrgMemberUpdateRequest"]
2408
+ }
2409
+ }
2410
+ responses: {
2411
+ /** @description Updated. */
2412
+ 200: {
2413
+ headers: {
2414
+ [name: string]: unknown
2415
+ }
2416
+ content: {
2417
+ "application/json": components["schemas"]["OrgMember"]
2418
+ }
2419
+ }
2420
+ 400: components["responses"]["BadRequest"]
2421
+ 401: components["responses"]["Unauthorized"]
2422
+ 403: components["responses"]["Forbidden"]
2423
+ 404: components["responses"]["NotFound"]
2424
+ default: components["responses"]["Internal"]
2425
+ }
2426
+ };
2427
+ listOrgInvitations: {
2428
+ parameters: {
2429
+ query?: {
2430
+ limit?: number
2431
+ page?: number
2432
+ }
2433
+ header?: never
2434
+ path: {
2435
+ org_slug: string
2436
+ }
2437
+ cookie?: never
2438
+ }
2439
+ requestBody?: never
2440
+ responses: {
2441
+ /** @description OK */
2442
+ 200: {
2443
+ headers: {
2444
+ [name: string]: unknown
2445
+ }
2446
+ content: {
2447
+ "application/json": components["schemas"]["OrgInvitationListResponse"]
2448
+ }
2449
+ }
2450
+ 401: components["responses"]["Unauthorized"]
2451
+ 403: components["responses"]["Forbidden"]
2452
+ 404: components["responses"]["NotFound"]
2453
+ default: components["responses"]["Internal"]
2454
+ }
2455
+ };
2456
+ createOrgInvitation: {
2457
+ parameters: {
2458
+ query?: never
2459
+ header?: never
2460
+ path: {
2461
+ org_slug: string
2462
+ }
2463
+ cookie?: never
2464
+ }
2465
+ requestBody: {
2466
+ content: {
2467
+ "application/json": components["schemas"]["OrgInvitationCreateRequest"]
2468
+ }
2469
+ }
2470
+ responses: {
2471
+ /** @description Invitation created. */
2472
+ 201: {
2473
+ headers: {
2474
+ [name: string]: unknown
2475
+ }
2476
+ content: {
2477
+ "application/json": components["schemas"]["OrgInvitation"]
2478
+ }
2479
+ }
2480
+ 400: components["responses"]["BadRequest"]
2481
+ 401: components["responses"]["Unauthorized"]
2482
+ 403: components["responses"]["Forbidden"]
2483
+ 404: components["responses"]["NotFound"]
2484
+ 409: components["responses"]["Conflict"]
2485
+ default: components["responses"]["Internal"]
2486
+ }
2487
+ };
2488
+ cancelOrgInvitation: {
2489
+ parameters: {
2490
+ query?: never
2491
+ header?: never
2492
+ path: {
2493
+ org_slug: string
2494
+ invitation_id: string
2495
+ }
2496
+ cookie?: never
2497
+ }
2498
+ requestBody?: never
2499
+ responses: {
2500
+ /** @description Invitation cancelled. */
2501
+ 204: {
2502
+ headers: {
2503
+ [name: string]: unknown
2504
+ }
2505
+ content?: never
2506
+ }
2507
+ 401: components["responses"]["Unauthorized"]
2508
+ 403: components["responses"]["Forbidden"]
2509
+ 404: components["responses"]["NotFound"]
2510
+ default: components["responses"]["Internal"]
2511
+ }
2512
+ };
2513
+ listOrgAgents: {
2514
+ parameters: {
2515
+ query?: {
2516
+ limit?: number
2517
+ page?: number
2518
+ search?: string
2519
+ }
2520
+ header?: never
2521
+ path: {
2522
+ org_slug: string
2523
+ }
2524
+ cookie?: never
2525
+ }
2526
+ requestBody?: never
2527
+ responses: {
2528
+ /** @description OK */
2529
+ 200: {
2530
+ headers: {
2531
+ [name: string]: unknown
2532
+ }
2533
+ content: {
2534
+ "application/json": components["schemas"]["AgentListResponse"]
2535
+ }
2536
+ }
2537
+ 401: components["responses"]["Unauthorized"]
2538
+ 403: components["responses"]["Forbidden"]
2539
+ 404: components["responses"]["NotFound"]
2540
+ default: components["responses"]["Internal"]
2541
+ }
2542
+ };
2543
+ createOrgAgent: {
2544
+ parameters: {
2545
+ query?: never
2546
+ header?: never
2547
+ path: {
2548
+ org_slug: string
2549
+ }
2550
+ cookie?: never
2551
+ }
2552
+ requestBody: {
2553
+ content: {
2554
+ "application/json": components["schemas"]["AgentCreateRequest"]
2555
+ }
2556
+ }
2557
+ responses: {
2558
+ /** @description Agent created. */
2559
+ 201: {
2560
+ headers: {
2561
+ [name: string]: unknown
2562
+ }
2563
+ content: {
2564
+ "application/json": components["schemas"]["Agent"]
2565
+ }
2566
+ }
2567
+ 400: components["responses"]["BadRequest"]
2568
+ 401: components["responses"]["Unauthorized"]
2569
+ 403: components["responses"]["Forbidden"]
2570
+ 404: components["responses"]["NotFound"]
2571
+ default: components["responses"]["Internal"]
2572
+ }
2573
+ };
2574
+ listOrgKnowledgeBases: {
2575
+ parameters: {
2576
+ query?: {
2577
+ limit?: number
2578
+ page?: number
2579
+ }
2580
+ header?: never
2581
+ path: {
2582
+ org_slug: string
2583
+ }
2584
+ cookie?: never
2585
+ }
2586
+ requestBody?: never
2587
+ responses: {
2588
+ /** @description OK */
2589
+ 200: {
2590
+ headers: {
2591
+ [name: string]: unknown
2592
+ }
2593
+ content: {
2594
+ "application/json": components["schemas"]["KnowledgeBaseListResponse"]
2595
+ }
2596
+ }
2597
+ 401: components["responses"]["Unauthorized"]
2598
+ 403: components["responses"]["Forbidden"]
2599
+ 404: components["responses"]["NotFound"]
2600
+ default: components["responses"]["Internal"]
2601
+ }
2602
+ };
2603
+ createOrgKnowledgeBase: {
2604
+ parameters: {
2605
+ query?: never
2606
+ header?: never
2607
+ path: {
2608
+ org_slug: string
2609
+ }
2610
+ cookie?: never
2611
+ }
2612
+ requestBody: {
2613
+ content: {
2614
+ "application/json": components["schemas"]["KnowledgeBaseCreateRequest"]
2615
+ }
2616
+ }
2617
+ responses: {
2618
+ /** @description Knowledge base created. */
2619
+ 201: {
2620
+ headers: {
2621
+ [name: string]: unknown
2622
+ }
2623
+ content: {
2624
+ "application/json": components["schemas"]["KnowledgeBase"]
2625
+ }
2626
+ }
2627
+ 400: components["responses"]["BadRequest"]
2628
+ 401: components["responses"]["Unauthorized"]
2629
+ 403: components["responses"]["Forbidden"]
2630
+ 404: components["responses"]["NotFound"]
2631
+ default: components["responses"]["Internal"]
2632
+ }
2633
+ };
2634
+ listOrgWebhooks: {
2635
+ parameters: {
2636
+ query?: {
2637
+ limit?: number
2638
+ page?: number
2639
+ }
2640
+ header?: never
2641
+ path: {
2642
+ org_slug: string
2643
+ }
2644
+ cookie?: never
2645
+ }
2646
+ requestBody?: never
2647
+ responses: {
2648
+ /** @description OK */
2649
+ 200: {
2650
+ headers: {
2651
+ [name: string]: unknown
2652
+ }
2653
+ content: {
2654
+ "application/json": components["schemas"]["WebhookListResponse"]
2655
+ }
2656
+ }
2657
+ 401: components["responses"]["Unauthorized"]
2658
+ 403: components["responses"]["Forbidden"]
2659
+ 404: components["responses"]["NotFound"]
2660
+ default: components["responses"]["Internal"]
2661
+ }
2662
+ };
2663
+ createOrgWebhook: {
2664
+ parameters: {
2665
+ query?: never
2666
+ header?: never
2667
+ path: {
2668
+ org_slug: string
2669
+ }
2670
+ cookie?: never
2671
+ }
2672
+ requestBody: {
2673
+ content: {
2674
+ "application/json": components["schemas"]["WebhookCreateRequest"]
2675
+ }
2676
+ }
2677
+ responses: {
2678
+ /** @description Webhook created. */
2679
+ 201: {
2680
+ headers: {
2681
+ [name: string]: unknown
2682
+ }
2683
+ content: {
2684
+ "application/json": components["schemas"]["Webhook"]
2685
+ }
2686
+ }
2687
+ 400: components["responses"]["BadRequest"]
2688
+ 401: components["responses"]["Unauthorized"]
2689
+ 403: components["responses"]["Forbidden"]
2690
+ 404: components["responses"]["NotFound"]
2691
+ default: components["responses"]["Internal"]
2692
+ }
2693
+ };
2694
+ getOrgWebhook: {
2695
+ parameters: {
2696
+ query?: never
2697
+ header?: never
2698
+ path: {
2699
+ org_slug: string
2700
+ webhook_id: string
2701
+ }
2702
+ cookie?: never
2703
+ }
2704
+ requestBody?: never
2705
+ responses: {
2706
+ /** @description OK */
2707
+ 200: {
2708
+ headers: {
2709
+ [name: string]: unknown
2710
+ }
2711
+ content: {
2712
+ "application/json": components["schemas"]["Webhook"]
2713
+ }
2714
+ }
2715
+ 401: components["responses"]["Unauthorized"]
2716
+ 403: components["responses"]["Forbidden"]
2717
+ 404: components["responses"]["NotFound"]
2718
+ default: components["responses"]["Internal"]
2719
+ }
2720
+ };
2721
+ deleteOrgWebhook: {
2722
+ parameters: {
2723
+ query?: never
2724
+ header?: never
2725
+ path: {
2726
+ org_slug: string
2727
+ webhook_id: string
2728
+ }
2729
+ cookie?: never
2730
+ }
2731
+ requestBody?: never
2732
+ responses: {
2733
+ /** @description Webhook deleted. */
2734
+ 204: {
2735
+ headers: {
2736
+ [name: string]: unknown
2737
+ }
2738
+ content?: never
2739
+ }
2740
+ 401: components["responses"]["Unauthorized"]
2741
+ 403: components["responses"]["Forbidden"]
2742
+ 404: components["responses"]["NotFound"]
2743
+ default: components["responses"]["Internal"]
2744
+ }
2745
+ };
2746
+ updateOrgWebhook: {
2747
+ parameters: {
2748
+ query?: never
2749
+ header?: never
2750
+ path: {
2751
+ org_slug: string
2752
+ webhook_id: string
2753
+ }
2754
+ cookie?: never
2755
+ }
2756
+ requestBody: {
2757
+ content: {
2758
+ "application/json": components["schemas"]["WebhookUpdateRequest"]
2759
+ }
2760
+ }
2761
+ responses: {
2762
+ /** @description Updated. */
2763
+ 200: {
2764
+ headers: {
2765
+ [name: string]: unknown
2766
+ }
2767
+ content: {
2768
+ "application/json": components["schemas"]["Webhook"]
2769
+ }
2770
+ }
2771
+ 400: components["responses"]["BadRequest"]
2772
+ 401: components["responses"]["Unauthorized"]
2773
+ 403: components["responses"]["Forbidden"]
2774
+ 404: components["responses"]["NotFound"]
2775
+ default: components["responses"]["Internal"]
2776
+ }
2777
+ };
2778
+ getAgent: {
2779
+ parameters: {
2780
+ query?: never
2781
+ header?: never
2782
+ path: {
2783
+ agent_id: string
2784
+ }
2785
+ cookie?: never
2786
+ }
2787
+ requestBody?: never
2788
+ responses: {
2789
+ /** @description OK */
2790
+ 200: {
2791
+ headers: {
2792
+ [name: string]: unknown
2793
+ }
2794
+ content: {
2795
+ "application/json": components["schemas"]["Agent"]
2796
+ }
2797
+ }
2798
+ 401: components["responses"]["Unauthorized"]
2799
+ 403: components["responses"]["Forbidden"]
2800
+ 404: components["responses"]["NotFound"]
2801
+ default: components["responses"]["Internal"]
2802
+ }
2803
+ };
2804
+ deleteAgent: {
2805
+ parameters: {
2806
+ query?: never
2807
+ header?: never
2808
+ path: {
2809
+ agent_id: string
2810
+ }
2811
+ cookie?: never
2812
+ }
2813
+ requestBody?: never
2814
+ responses: {
2815
+ /** @description Agent deleted. */
2816
+ 204: {
2817
+ headers: {
2818
+ [name: string]: unknown
2819
+ }
2820
+ content?: never
2821
+ }
2822
+ 401: components["responses"]["Unauthorized"]
2823
+ 403: components["responses"]["Forbidden"]
2824
+ 404: components["responses"]["NotFound"]
2825
+ default: components["responses"]["Internal"]
2826
+ }
2827
+ };
2828
+ updateAgent: {
2829
+ parameters: {
2830
+ query?: never
2831
+ header?: never
2832
+ path: {
2833
+ agent_id: string
2834
+ }
2835
+ cookie?: never
2836
+ }
2837
+ requestBody: {
2838
+ content: {
2839
+ "application/json": components["schemas"]["AgentUpdateRequest"]
2840
+ }
2841
+ }
2842
+ responses: {
2843
+ /** @description Updated. */
2844
+ 200: {
2845
+ headers: {
2846
+ [name: string]: unknown
2847
+ }
2848
+ content: {
2849
+ "application/json": components["schemas"]["Agent"]
2850
+ }
2851
+ }
2852
+ 400: components["responses"]["BadRequest"]
2853
+ 401: components["responses"]["Unauthorized"]
2854
+ 403: components["responses"]["Forbidden"]
2855
+ 404: components["responses"]["NotFound"]
2856
+ default: components["responses"]["Internal"]
2857
+ }
2858
+ };
2859
+ updateAgentStatus: {
2860
+ parameters: {
2861
+ query?: never
2862
+ header?: never
2863
+ path: {
2864
+ agent_id: string
2865
+ }
2866
+ cookie?: never
2867
+ }
2868
+ requestBody: {
2869
+ content: {
2870
+ "application/json": components["schemas"]["AgentUpdateStatusRequest"]
2871
+ }
2872
+ }
2873
+ responses: {
2874
+ /** @description Status updated. */
2875
+ 200: {
2876
+ headers: {
2877
+ [name: string]: unknown
2878
+ }
2879
+ content: {
2880
+ "application/json": components["schemas"]["Agent"]
2881
+ }
2882
+ }
2883
+ 400: components["responses"]["BadRequest"]
2884
+ 401: components["responses"]["Unauthorized"]
2885
+ 403: components["responses"]["Forbidden"]
2886
+ 404: components["responses"]["NotFound"]
2887
+ default: components["responses"]["Internal"]
2888
+ }
2889
+ };
2890
+ createAgentDiagnostics: {
2891
+ parameters: {
2892
+ query?: never
2893
+ header?: never
2894
+ path: {
2895
+ agent_id: string
2896
+ }
2897
+ cookie?: never
2898
+ }
2899
+ requestBody: {
2900
+ content: {
2901
+ "application/json": components["schemas"]["AgentLintRequest"]
2902
+ }
2903
+ }
2904
+ responses: {
2905
+ /** @description Diagnostics complete. Empty `errors` array means valid. */
2906
+ 200: {
2907
+ headers: {
2908
+ [name: string]: unknown
2909
+ }
2910
+ content: {
2911
+ "application/json": components["schemas"]["AgentLintResponse"]
2912
+ }
2913
+ }
2914
+ 400: components["responses"]["BadRequest"]
2915
+ 401: components["responses"]["Unauthorized"]
2916
+ 403: components["responses"]["Forbidden"]
2917
+ 404: components["responses"]["NotFound"]
2918
+ default: components["responses"]["Internal"]
2919
+ }
2920
+ };
2921
+ listAgentConversations: {
2922
+ parameters: {
2923
+ query?: {
2924
+ limit?: number
2925
+ /** @description Cursor for pagination */
2926
+ cursor?: string
2927
+ }
2928
+ header?: never
2929
+ path: {
2930
+ agent_id: string
2931
+ }
2932
+ cookie?: never
2933
+ }
2934
+ requestBody?: never
2935
+ responses: {
2936
+ /** @description OK */
2937
+ 200: {
2938
+ headers: {
2939
+ [name: string]: unknown
2940
+ }
2941
+ content: {
2942
+ "application/json": components["schemas"]["ConversationListResponse"]
2943
+ }
2944
+ }
2945
+ 401: components["responses"]["Unauthorized"]
2946
+ 403: components["responses"]["Forbidden"]
2947
+ 404: components["responses"]["NotFound"]
2948
+ default: components["responses"]["Internal"]
2949
+ }
2950
+ };
2951
+ listAgentKnowledgeBases: {
2952
+ parameters: {
2953
+ query?: {
2954
+ limit?: number
2955
+ page?: number
2956
+ }
2957
+ header?: never
2958
+ path: {
2959
+ agent_id: string
2960
+ }
2961
+ cookie?: never
2962
+ }
2963
+ requestBody?: never
2964
+ responses: {
2965
+ /** @description OK */
2966
+ 200: {
2967
+ headers: {
2968
+ [name: string]: unknown
2969
+ }
2970
+ content: {
2971
+ "application/json": components["schemas"]["KnowledgeBaseListResponse"]
2972
+ }
2973
+ }
2974
+ 401: components["responses"]["Unauthorized"]
2975
+ 403: components["responses"]["Forbidden"]
2976
+ 404: components["responses"]["NotFound"]
2977
+ default: components["responses"]["Internal"]
2978
+ }
2979
+ };
2980
+ linkAgentKnowledgeBase: {
2981
+ parameters: {
2982
+ query?: never
2983
+ header?: never
2984
+ path: {
2985
+ agent_id: string
2986
+ knowledge_base_id: string
2987
+ }
2988
+ cookie?: never
2989
+ }
2990
+ requestBody?: never
2991
+ responses: {
2992
+ /** @description Linked. */
2993
+ 204: {
2994
+ headers: {
2995
+ [name: string]: unknown
2996
+ }
2997
+ content?: never
2998
+ }
2999
+ 401: components["responses"]["Unauthorized"]
3000
+ 403: components["responses"]["Forbidden"]
3001
+ 404: components["responses"]["NotFound"]
3002
+ default: components["responses"]["Internal"]
3003
+ }
3004
+ };
3005
+ unlinkAgentKnowledgeBase: {
3006
+ parameters: {
3007
+ query?: never
3008
+ header?: never
3009
+ path: {
3010
+ agent_id: string
3011
+ knowledge_base_id: string
3012
+ }
3013
+ cookie?: never
3014
+ }
3015
+ requestBody?: never
3016
+ responses: {
3017
+ /** @description Unlinked. */
3018
+ 204: {
3019
+ headers: {
3020
+ [name: string]: unknown
3021
+ }
3022
+ content?: never
3023
+ }
3024
+ 401: components["responses"]["Unauthorized"]
3025
+ 403: components["responses"]["Forbidden"]
3026
+ 404: components["responses"]["NotFound"]
3027
+ default: components["responses"]["Internal"]
3028
+ }
3029
+ };
3030
+ listAgentWebhooks: {
3031
+ parameters: {
3032
+ query?: {
3033
+ limit?: number
3034
+ page?: number
3035
+ }
3036
+ header?: never
3037
+ path: {
3038
+ agent_id: string
3039
+ }
3040
+ cookie?: never
3041
+ }
3042
+ requestBody?: never
3043
+ responses: {
3044
+ /** @description OK */
3045
+ 200: {
3046
+ headers: {
3047
+ [name: string]: unknown
3048
+ }
3049
+ content: {
3050
+ "application/json": components["schemas"]["WebhookListResponse"]
3051
+ }
3052
+ }
3053
+ 401: components["responses"]["Unauthorized"]
3054
+ 403: components["responses"]["Forbidden"]
3055
+ 404: components["responses"]["NotFound"]
3056
+ default: components["responses"]["Internal"]
3057
+ }
3058
+ };
3059
+ createAgentWebhook: {
3060
+ parameters: {
3061
+ query?: never
3062
+ header?: never
3063
+ path: {
3064
+ agent_id: string
3065
+ }
3066
+ cookie?: never
3067
+ }
3068
+ requestBody: {
3069
+ content: {
3070
+ "application/json": components["schemas"]["WebhookCreateRequest"]
3071
+ }
3072
+ }
3073
+ responses: {
3074
+ /** @description Webhook created. */
3075
+ 201: {
3076
+ headers: {
3077
+ [name: string]: unknown
3078
+ }
3079
+ content: {
3080
+ "application/json": components["schemas"]["Webhook"]
3081
+ }
3082
+ }
3083
+ 400: components["responses"]["BadRequest"]
3084
+ 401: components["responses"]["Unauthorized"]
3085
+ 403: components["responses"]["Forbidden"]
3086
+ 404: components["responses"]["NotFound"]
3087
+ default: components["responses"]["Internal"]
3088
+ }
3089
+ };
3090
+ getAgentWebhook: {
3091
+ parameters: {
3092
+ query?: never
3093
+ header?: never
3094
+ path: {
3095
+ agent_id: string
3096
+ webhook_id: string
3097
+ }
3098
+ cookie?: never
3099
+ }
3100
+ requestBody?: never
3101
+ responses: {
3102
+ /** @description OK */
3103
+ 200: {
3104
+ headers: {
3105
+ [name: string]: unknown
3106
+ }
3107
+ content: {
3108
+ "application/json": components["schemas"]["Webhook"]
3109
+ }
3110
+ }
3111
+ 401: components["responses"]["Unauthorized"]
3112
+ 403: components["responses"]["Forbidden"]
3113
+ 404: components["responses"]["NotFound"]
3114
+ default: components["responses"]["Internal"]
3115
+ }
3116
+ };
3117
+ deleteAgentWebhook: {
3118
+ parameters: {
3119
+ query?: never
3120
+ header?: never
3121
+ path: {
3122
+ agent_id: string
3123
+ webhook_id: string
3124
+ }
3125
+ cookie?: never
3126
+ }
3127
+ requestBody?: never
3128
+ responses: {
3129
+ /** @description Webhook deleted. */
3130
+ 204: {
3131
+ headers: {
3132
+ [name: string]: unknown
3133
+ }
3134
+ content?: never
3135
+ }
3136
+ 401: components["responses"]["Unauthorized"]
3137
+ 403: components["responses"]["Forbidden"]
3138
+ 404: components["responses"]["NotFound"]
3139
+ default: components["responses"]["Internal"]
3140
+ }
3141
+ };
3142
+ updateAgentWebhook: {
3143
+ parameters: {
3144
+ query?: never
3145
+ header?: never
3146
+ path: {
3147
+ agent_id: string
3148
+ webhook_id: string
3149
+ }
3150
+ cookie?: never
3151
+ }
3152
+ requestBody: {
3153
+ content: {
3154
+ "application/json": components["schemas"]["WebhookUpdateRequest"]
3155
+ }
3156
+ }
3157
+ responses: {
3158
+ /** @description Updated. */
3159
+ 200: {
3160
+ headers: {
3161
+ [name: string]: unknown
3162
+ }
3163
+ content: {
3164
+ "application/json": components["schemas"]["Webhook"]
3165
+ }
3166
+ }
3167
+ 400: components["responses"]["BadRequest"]
3168
+ 401: components["responses"]["Unauthorized"]
3169
+ 403: components["responses"]["Forbidden"]
3170
+ 404: components["responses"]["NotFound"]
3171
+ default: components["responses"]["Internal"]
3172
+ }
3173
+ };
3174
+ createConversation: {
3175
+ parameters: {
3176
+ query?: never
3177
+ header?: never
3178
+ path?: never
3179
+ cookie?: never
3180
+ }
3181
+ requestBody: {
3182
+ content: {
3183
+ "application/json": {
3184
+ /**
3185
+ * Format: uuid
3186
+ * @description The agent to converse with.
3187
+ */
3188
+ agent_id: string
3189
+ }
3190
+ }
3191
+ }
3192
+ responses: {
3193
+ /** @description Conversation created. */
3194
+ 201: {
3195
+ headers: {
3196
+ [name: string]: unknown
3197
+ }
3198
+ content: {
3199
+ "application/json": components["schemas"]["Conversation"]
3200
+ }
3201
+ }
3202
+ 400: components["responses"]["BadRequest"]
3203
+ 401: components["responses"]["Unauthorized"]
3204
+ 403: components["responses"]["Forbidden"]
3205
+ 404: components["responses"]["NotFound"]
3206
+ default: components["responses"]["Internal"]
3207
+ }
3208
+ };
3209
+ getConversation: {
3210
+ parameters: {
3211
+ query?: never
3212
+ header?: never
3213
+ path: {
3214
+ conversation_id: string
3215
+ }
3216
+ cookie?: never
3217
+ }
3218
+ requestBody?: never
3219
+ responses: {
3220
+ /** @description OK */
3221
+ 200: {
3222
+ headers: {
3223
+ [name: string]: unknown
3224
+ }
3225
+ content: {
3226
+ "application/json": components["schemas"]["Conversation"]
3227
+ }
3228
+ }
3229
+ 401: components["responses"]["Unauthorized"]
3230
+ 403: components["responses"]["Forbidden"]
3231
+ 404: components["responses"]["NotFound"]
3232
+ default: components["responses"]["Internal"]
3233
+ }
3234
+ };
3235
+ deleteConversation: {
3236
+ parameters: {
3237
+ query?: never
3238
+ header?: never
3239
+ path: {
3240
+ conversation_id: string
3241
+ }
3242
+ cookie?: never
3243
+ }
3244
+ requestBody?: never
3245
+ responses: {
3246
+ /** @description Conversation deleted. */
3247
+ 204: {
3248
+ headers: {
3249
+ [name: string]: unknown
3250
+ }
3251
+ content?: never
3252
+ }
3253
+ 401: components["responses"]["Unauthorized"]
3254
+ 403: components["responses"]["Forbidden"]
3255
+ 404: components["responses"]["NotFound"]
3256
+ default: components["responses"]["Internal"]
3257
+ }
3258
+ };
3259
+ listConversationMessages: {
3260
+ parameters: {
3261
+ query?: {
3262
+ limit?: number
3263
+ /** @description Cursor for pagination */
3264
+ cursor?: string
3265
+ }
3266
+ header?: never
3267
+ path: {
3268
+ conversation_id: string
3269
+ }
3270
+ cookie?: never
3271
+ }
3272
+ requestBody?: never
3273
+ responses: {
3274
+ /** @description OK */
3275
+ 200: {
3276
+ headers: {
3277
+ [name: string]: unknown
3278
+ }
3279
+ content: {
3280
+ "application/json": components["schemas"]["ConversationMessageListResponse"]
3281
+ }
3282
+ }
3283
+ 401: components["responses"]["Unauthorized"]
3284
+ 403: components["responses"]["Forbidden"]
3285
+ 404: components["responses"]["NotFound"]
3286
+ default: components["responses"]["Internal"]
3287
+ }
3288
+ };
3289
+ createConversationMessage: {
3290
+ parameters: {
3291
+ query?: never
3292
+ header?: never
3293
+ path: {
3294
+ conversation_id: string
3295
+ }
3296
+ cookie?: never
3297
+ }
3298
+ requestBody: {
3299
+ content: {
3300
+ "application/json": {
3301
+ /** @description The user's message text. */
3302
+ content: string
3303
+ }
3304
+ }
3305
+ }
3306
+ responses: {
3307
+ /** @description SSE stream of events. */
3308
+ 200: {
3309
+ headers: {
3310
+ [name: string]: unknown
3311
+ }
3312
+ content: {
3313
+ "text/event-stream": string
3314
+ }
3315
+ }
3316
+ 400: components["responses"]["BadRequest"]
3317
+ 401: components["responses"]["Unauthorized"]
3318
+ 403: components["responses"]["Forbidden"]
3319
+ 404: components["responses"]["NotFound"]
3320
+ default: components["responses"]["Internal"]
3321
+ }
3322
+ };
3323
+ streamConversation: {
3324
+ parameters: {
3325
+ query: {
3326
+ /** @description Must be "voice" for WebSocket upgrade. */
3327
+ medium: "voice"
3328
+ }
3329
+ header?: never
3330
+ path: {
3331
+ conversation_id: string
3332
+ }
3333
+ cookie?: never
3334
+ }
3335
+ requestBody?: never
3336
+ responses: {
3337
+ /** @description WebSocket upgrade successful. */
3338
+ 101: {
3339
+ headers: {
3340
+ [name: string]: unknown
3341
+ }
3342
+ content?: never
3343
+ }
3344
+ /** @description Missing or invalid medium parameter. */
3345
+ 400: {
3346
+ headers: {
3347
+ [name: string]: unknown
3348
+ }
3349
+ content?: never
3350
+ }
3351
+ 401: components["responses"]["Unauthorized"]
3352
+ 403: components["responses"]["Forbidden"]
3353
+ 404: components["responses"]["NotFound"]
3354
+ default: components["responses"]["Internal"]
3355
+ }
3356
+ };
3357
+ getKnowledgeBase: {
3358
+ parameters: {
3359
+ query?: never
3360
+ header?: never
3361
+ path: {
3362
+ knowledge_base_id: string
3363
+ }
3364
+ cookie?: never
3365
+ }
3366
+ requestBody?: never
3367
+ responses: {
3368
+ /** @description OK */
3369
+ 200: {
3370
+ headers: {
3371
+ [name: string]: unknown
3372
+ }
3373
+ content: {
3374
+ "application/json": components["schemas"]["KnowledgeBase"]
3375
+ }
3376
+ }
3377
+ 401: components["responses"]["Unauthorized"]
3378
+ 403: components["responses"]["Forbidden"]
3379
+ 404: components["responses"]["NotFound"]
3380
+ default: components["responses"]["Internal"]
3381
+ }
3382
+ };
3383
+ deleteKnowledgeBase: {
3384
+ parameters: {
3385
+ query?: never
3386
+ header?: never
3387
+ path: {
3388
+ knowledge_base_id: string
3389
+ }
3390
+ cookie?: never
3391
+ }
3392
+ requestBody?: never
3393
+ responses: {
3394
+ /** @description Knowledge base deleted. */
3395
+ 204: {
3396
+ headers: {
3397
+ [name: string]: unknown
3398
+ }
3399
+ content?: never
3400
+ }
3401
+ 401: components["responses"]["Unauthorized"]
3402
+ 403: components["responses"]["Forbidden"]
3403
+ 404: components["responses"]["NotFound"]
3404
+ default: components["responses"]["Internal"]
3405
+ }
3406
+ };
3407
+ updateKnowledgeBase: {
3408
+ parameters: {
3409
+ query?: never
3410
+ header?: never
3411
+ path: {
3412
+ knowledge_base_id: string
3413
+ }
3414
+ cookie?: never
3415
+ }
3416
+ requestBody: {
3417
+ content: {
3418
+ "application/json": components["schemas"]["KnowledgeBaseUpdateRequest"]
3419
+ }
3420
+ }
3421
+ responses: {
3422
+ /** @description Updated. */
3423
+ 200: {
3424
+ headers: {
3425
+ [name: string]: unknown
3426
+ }
3427
+ content: {
3428
+ "application/json": components["schemas"]["KnowledgeBase"]
3429
+ }
3430
+ }
3431
+ 400: components["responses"]["BadRequest"]
3432
+ 401: components["responses"]["Unauthorized"]
3433
+ 403: components["responses"]["Forbidden"]
3434
+ 404: components["responses"]["NotFound"]
3435
+ default: components["responses"]["Internal"]
3436
+ }
3437
+ };
3438
+ listKnowledgeBaseDocuments: {
3439
+ parameters: {
3440
+ query?: {
3441
+ limit?: number
3442
+ page?: number
3443
+ }
3444
+ header?: never
3445
+ path: {
3446
+ knowledge_base_id: string
3447
+ }
3448
+ cookie?: never
3449
+ }
3450
+ requestBody?: never
3451
+ responses: {
3452
+ /** @description OK */
3453
+ 200: {
3454
+ headers: {
3455
+ [name: string]: unknown
3456
+ }
3457
+ content: {
3458
+ "application/json": components["schemas"]["KnowledgeBaseDocumentListResponse"]
3459
+ }
3460
+ }
3461
+ 401: components["responses"]["Unauthorized"]
3462
+ 403: components["responses"]["Forbidden"]
3463
+ 404: components["responses"]["NotFound"]
3464
+ default: components["responses"]["Internal"]
3465
+ }
3466
+ };
3467
+ createKnowledgeBaseDocument: {
3468
+ parameters: {
3469
+ query?: never
3470
+ header?: never
3471
+ path: {
3472
+ knowledge_base_id: string
3473
+ }
3474
+ cookie?: never
3475
+ }
3476
+ requestBody: {
3477
+ content: {
3478
+ "application/json": components["schemas"]["KnowledgeBaseDocumentCreateFromURLRequest"] | components["schemas"]["KnowledgeBaseDocumentCreateFromTextRequest"]
3479
+ "multipart/form-data": components["schemas"]["KnowledgeBaseDocumentCreateFromFileRequest"]
3480
+ }
3481
+ }
3482
+ responses: {
3483
+ /** @description Document created and queued for ingestion. */
3484
+ 201: {
3485
+ headers: {
3486
+ [name: string]: unknown
3487
+ }
3488
+ content: {
3489
+ "application/json": components["schemas"]["KnowledgeBaseDocument"]
3490
+ }
3491
+ }
3492
+ 400: components["responses"]["BadRequest"]
3493
+ 401: components["responses"]["Unauthorized"]
3494
+ 403: components["responses"]["Forbidden"]
3495
+ 404: components["responses"]["NotFound"]
3496
+ default: components["responses"]["Internal"]
3497
+ }
3498
+ };
3499
+ getKnowledgeBaseDocument: {
3500
+ parameters: {
3501
+ query?: never
3502
+ header?: never
3503
+ path: {
3504
+ knowledge_base_id: string
3505
+ document_id: string
3506
+ }
3507
+ cookie?: never
3508
+ }
3509
+ requestBody?: never
3510
+ responses: {
3511
+ /** @description OK */
3512
+ 200: {
3513
+ headers: {
3514
+ [name: string]: unknown
3515
+ }
3516
+ content: {
3517
+ "application/json": components["schemas"]["KnowledgeBaseDocument"]
3518
+ }
3519
+ }
3520
+ 401: components["responses"]["Unauthorized"]
3521
+ 403: components["responses"]["Forbidden"]
3522
+ 404: components["responses"]["NotFound"]
3523
+ default: components["responses"]["Internal"]
3524
+ }
3525
+ };
3526
+ deleteKnowledgeBaseDocument: {
3527
+ parameters: {
3528
+ query?: never
3529
+ header?: never
3530
+ path: {
3531
+ knowledge_base_id: string
3532
+ document_id: string
3533
+ }
3534
+ cookie?: never
3535
+ }
3536
+ requestBody?: never
3537
+ responses: {
3538
+ /** @description Document deleted. */
3539
+ 204: {
3540
+ headers: {
3541
+ [name: string]: unknown
3542
+ }
3543
+ content?: never
3544
+ }
3545
+ 401: components["responses"]["Unauthorized"]
3546
+ 403: components["responses"]["Forbidden"]
3547
+ 404: components["responses"]["NotFound"]
3548
+ default: components["responses"]["Internal"]
3549
+ }
3550
+ };
3551
+ queryKnowledgeBase: {
3552
+ parameters: {
3553
+ query?: never
3554
+ header?: never
3555
+ path: {
3556
+ knowledge_base_id: string
3557
+ }
3558
+ cookie?: never
3559
+ }
3560
+ requestBody: {
3561
+ content: {
3562
+ "application/json": components["schemas"]["KnowledgeBaseQueryRequest"]
3563
+ }
3564
+ }
3565
+ responses: {
3566
+ /** @description Query results ordered by relevance score. */
3567
+ 200: {
3568
+ headers: {
3569
+ [name: string]: unknown
3570
+ }
3571
+ content: {
3572
+ "application/json": components["schemas"]["KnowledgeBaseQueryResponse"]
3573
+ }
3574
+ }
3575
+ 400: components["responses"]["BadRequest"]
3576
+ 401: components["responses"]["Unauthorized"]
3577
+ 403: components["responses"]["Forbidden"]
3578
+ 404: components["responses"]["NotFound"]
3579
+ default: components["responses"]["Internal"]
3580
+ }
3581
+ };
228
3582
  }
229
3583
  /**
230
- * Configuration for WebSocket transport.
231
- */
232
- type WebSocketTransportConfig = {
233
- /** Base WebSocket URL */
234
- baseUrl: string
235
- /** Optional default headers (for protocol support) */
236
- headers?: Record<string, string>
237
- };
238
- /**
239
- * Shared WebSocket transport layer.
240
- * Provides WebSocket connection creation.
241
- */
242
- declare class WebSocketTransport {
243
- private readonly config;
244
- constructor(config: WebSocketTransportConfig);
245
- /**
246
- * Creates a WebSocket connection to the specified path.
247
- *
248
- * @param path WebSocket path (e.g., '/conversations/websocket')
249
- * @returns Raw WebSocket instance
250
- */
251
- connect(path: string): WebSocket;
252
- }
253
- /**
254
- * Represents a handshake offer initiated by the client.
255
- */
256
- type ClientSessionHandshakeOffer = {
257
- type: "session.handshake.offer"
258
- agent_id: string
259
- };
260
- /**
261
- * Signals that the client has ended the session.
262
- */
263
- type ClientSessionEnd = {
264
- type: "session.end"
265
- conversation_id: string
266
- };
267
- /**
268
- * Sends a text input from the client to the server.
269
- */
270
- type ClientInputText = {
271
- type: "input.text"
272
- conversation_id: string
273
- text: string
274
- };
275
- /**
276
- * Indicates that the client is starting an audio input.
277
- */
278
- type ClientInputAudio = {
279
- type: "input.audio"
280
- conversation_id: string
281
- };
282
- /**
283
- * Represents a continuous stream of audio data from the client.
284
- */
285
- type ClientInputAudioStream = {
286
- type: "input.audio.stream"
287
- conversation_id: string
288
- };
289
- /**
290
- * Signals that the client has cancelled a request.
291
- */
292
- type ClientRequestCancel = {
293
- type: "request.cancel"
294
- conversation_id: string
295
- };
296
- /**
297
- * Union type for all messages sent from the client to the server.
298
- */
299
- type ClientMessage = ClientSessionHandshakeOffer | ClientSessionEnd | ClientInputText | ClientInputAudio | ClientInputAudioStream | ClientRequestCancel;
300
- /**
301
- * Sent by the server when a handshake offer is accepted.
302
- */
303
- type ServerSessionHandshakeAccept = {
304
- type: "session.handshake.accept"
305
- agent_id: string
306
- conversation_id: string
307
- };
308
- /**
309
- * Sent by the server when a handshake offer is rejected.
310
- */
311
- type ServerSessionHandshakeReject = {
312
- type: "session.handshake.reject"
313
- reason: string
314
- };
315
- /**
316
- * Signals that the session has officially started.
317
- */
318
- type ServerSessionStart = {
319
- type: "session.start"
320
- conversation_id: string
321
- start_time: number
322
- end_time: number
323
- max_duration_ms: number
324
- };
325
- /**
326
- * Signals that the server has ended the session.
327
- */
328
- type ServerSessionEnd = {
329
- type: "session.end"
330
- conversation_id: string
331
- };
332
- /**
333
- * Periodic update from the server regarding session timing.
334
- */
335
- type ServerSessionTick = {
336
- type: "session.tick"
337
- conversation_id: string
338
- max_duration_ms: number
339
- remaining_time_ms: number
340
- elapsed_time_ms: number
341
- };
342
- /**
343
- * Sent when a session ends due to inactivity or exceeding max duration.
344
- */
345
- type ServerSessionTimeout = {
346
- type: "session.timeout"
347
- conversation_id: string
348
- };
349
- /**
350
- * Signals that the server has detected the start of speech.
351
- */
352
- type ServerSpeechStart = {
353
- type: "speech.start"
354
- conversation_id: string
355
- };
356
- /**
357
- * Signals that the server has detected the end of speech.
358
- */
359
- type ServerSpeechEnd = {
360
- type: "speech.end"
361
- conversation_id: string
362
- };
363
- /**
364
- * A partial text response chunk sent by the server.
365
- */
366
- type ServerResponseDeltaText = {
367
- type: "response.delta.text"
368
- conversation_id: string
369
- chunk: string
370
- };
371
- /**
372
- * A partial audio response chunk sent by the server.
373
- */
374
- type ServerResponseDeltaAudio = {
375
- type: "response.delta.audio"
376
- conversation_id: string
377
- size: number
378
- audio: Blob
379
- };
380
- /**
381
- * Signals that the full response (text or audio) has been delivered.
382
- */
383
- type ServerResponseComplete = {
384
- type: "response.complete"
385
- conversation_id: string
386
- };
387
- /**
388
- * Sent when an ongoing response is cancelled successfully.
389
- */
390
- type ServerResponseCancel = {
391
- type: "response.cancel"
392
- conversation_id: string
393
- };
394
- /**
395
- * Sent when an error occurs during processing a request.
396
- */
397
- type ServerResponseError = {
398
- type: "response.error"
399
- conversation_id: string
400
- code: string
401
- message: string
402
- };
403
- /**
404
- * Union type for all messages sent from the server to the client.
405
- */
406
- type ServerMessage = ServerSessionHandshakeAccept | ServerSessionHandshakeReject | ServerSessionStart | ServerSessionEnd | ServerSessionTick | ServerSessionTimeout | ServerSpeechStart | ServerSpeechEnd | ServerResponseDeltaText | ServerResponseDeltaAudio | ServerResponseComplete | ServerResponseCancel | ServerResponseError;
407
- /**
408
- * Union type for all messages sent from the client to the server before the session is established.
409
- */
410
- type ServerConnectionMessage = ServerSessionHandshakeAccept | ServerSessionHandshakeReject | ServerSessionStart;
411
- /**
412
- * Union type for all messages sent from the server to the client during the session lifecycle.
413
- */
414
- type ServerSessionLifecycleMessage = ServerSessionEnd | ServerSessionTick | ServerSessionTimeout;
415
- /**
416
- * Union type for all messages sent from the server to the client during the session activity.
417
- */
418
- type ServerSessionActivityMessage = ServerSpeechStart | ServerSpeechEnd | ServerResponseDeltaText | ServerResponseDeltaAudio | ServerResponseComplete | ServerResponseCancel | ServerResponseError;
419
- /**
420
- * Synthetic event emitted when the connection to the server is lost.
421
- */
422
- type SessionConnectionLostEvent = {
423
- type: "session.connection.lost"
424
- conversation_id: string
425
- reason: "socket_closed" | "socket_error"
426
- };
427
- /**
428
- * Events emitted during an active session
3584
+ * Extract a schema type from `components.schemas` by key.
429
3585
  *
430
- * @remarks
431
- * Connection messages are handled internally during connection establishment
432
- * and are not exposed through the session's `onEvent` callback.
433
- */
434
- type ServerSessionEvent = ServerSessionLifecycleMessage | ServerSessionActivityMessage | SessionConnectionLostEvent;
435
- /**
436
- * Error thrown by the transport layer.
3586
+ * @typeParam T - Schema name
437
3587
  */
438
- declare class ConversationTransportError extends Error {
439
- readonly code: string;
440
- constructor(message: string, code?: string);
441
- }
3588
+ type ApiSchema<T extends keyof components["schemas"]> = components["schemas"][T];
442
3589
  /**
443
- * Low-level WebSocket transport for conversation protocol.
444
- * Handles connection lifecycle and binary/JSON message routing.
445
- */
446
- declare class ConversationTransport {
447
- private;
448
- private readonly _ws;
449
- private _closed;
450
- private _onMessage;
451
- private _onBinary;
452
- private _onError;
453
- private _onClose;
454
- constructor(_ws: WebSocket);
455
- /**
456
- * Waits for WebSocket to open.
457
- * @throws {ConversationTransportError} If already connected or connection fails
458
- */
459
- connect(): Promise<void>;
460
- /**
461
- * Sends a JSON message to the server.
462
- * @throws {ConversationTransportError} If not connected
463
- */
464
- send(message: ClientMessage): void;
465
- /**
466
- * Sends binary data (audio) to the server.
467
- * @throws {ConversationTransportError} If not connected
468
- */
469
- sendBinary(data: Blob): Promise<void>;
470
- /**
471
- * Registers a callback for incoming JSON messages.
472
- */
473
- onMessage(handler: (msg: ServerMessage) => void): void;
474
- /**
475
- * Registers a callback for incoming binary data.
476
- */
477
- onBinary(handler: (blob: Blob) => void): void;
478
- /**
479
- * Registers a callback for connection errors.
480
- */
481
- onError(handler: (error: Error) => void): void;
482
- /**
483
- * Registers a callback for connection closure.
484
- */
485
- onClose(handler: () => void): void;
486
- /**
487
- * Closes the WebSocket connection and cleans up resources.
488
- */
489
- close(): void;
490
- }
491
- /**
492
- * Configuration for a conversation session.
493
- */
494
- type ConversationSessionConfig = {
495
- /**
496
- * Event handler for all server messages.
497
- *
498
- * @remarks
499
- * Important: `response.delta.audio` events combine the audio `Blob` and the metadata.
500
- */
501
- onEvent?: (event: ServerSessionEvent) => void
502
- };
503
- /**
504
- * Represents an active conversation session with a KIVOX agent.
505
- * Provides methods to send messages and audio, and a callback to handle all server events.
506
- */
507
- declare class ConversationSession {
508
- private;
509
- private _transport;
510
- private _conversationId;
511
- private _maxDurationMs;
512
- private _startTime;
513
- private _endTime;
514
- private _closed;
515
- private _pendingAudioMetadata;
516
- private _onEvent;
517
- /** The unique conversation identifier */
518
- get conversationId(): string;
519
- /** Maximum session duration in milliseconds */
520
- get maxDurationMs(): number;
521
- /** Unix timestamp when session started */
522
- get startTime(): number;
523
- /** Unix timestamp when session will end */
524
- get endTime(): number;
525
- /** Whether the session has been closed */
526
- get closed(): boolean;
527
- constructor(transport: ConversationTransport, conversationId: string, maxDurationMs: number, startTime: number, endTime: number, config: ConversationSessionConfig);
528
- /**
529
- * Sends a text message to the agent.
530
- * @param text The message text to send
531
- */
532
- sendText(text: string): void;
533
- /**
534
- * Sends a complete audio message to the agent.
535
- * @param audio Audio blob to send
536
- */
537
- sendAudio(audio: Blob): void;
538
- /**
539
- * Streams an audio chunk to the agent (for real-time audio input).
540
- * @param chunk Audio chunk to stream
541
- */
542
- streamAudio(chunk: Blob): void;
543
- /**
544
- * Requests the session to be cancelled.
545
- * The 'session.cancel' event will be triggered when complete.
546
- */
547
- cancelRequest(): void;
548
- /**
549
- * Requests the session to end gracefully.
550
- * The 'session.end' event will be triggered when complete.
551
- */
552
- end(): void;
553
- /**
554
- * Immediately closes the session and transport.
555
- * No further events will be received.
556
- */
557
- close(): void;
558
- }
559
- type Conversation = {
560
- id: string
561
- agent_id: string
562
- started_at: Date
563
- ended_at?: Date
564
- };
565
- /**
566
- * Configuration for listing conversations.
567
- */
568
- type ConversationListParams = {
569
- /** Agent ID to filter by */
570
- agentId: string
571
- /** Number of results per page */
572
- limit?: number
573
- /** Page number (1-indexed) */
574
- page?: number
575
- };
576
- /**
577
- * Extended configuration for the connect method.
3590
+ * Extract the JSON request body type for an operation.
3591
+ *
3592
+ * Returns `never` if no JSON body is defined.
3593
+ *
3594
+ * @typeParam T - Operation name
578
3595
  */
579
- type ConversationConnectParams = ConversationSessionConfig & {
580
- /** Agent ID to connect to */
581
- agentId: string
582
- /**
583
- * Optional callback for connection events.
584
- * Called during connection establishment, before the session is created.
585
- */
586
- onConnection?: (event: ServerConnectionMessage) => void
587
- };
3596
+ type ApiRequest<T extends keyof operations> = operations[T] extends {
3597
+ requestBody?: {
3598
+ content: {
3599
+ "application/json": infer Body
3600
+ }
3601
+ }
3602
+ } ? Body : never;
588
3603
  /**
589
- * Client for managing conversations and establishing sessions.
590
- *
591
- * @example
592
- * ```ts
593
- * // List past conversations
594
- * const conversations = await kivox.conversations.list();
3604
+ * Extract the JSON response type for an operation.
595
3605
  *
596
- * // Connect to an agent
597
- * const session = await kivox.conversations.connect({
598
- * agentId: 'agent-123',
599
- * onEvent: (event) => {
600
- * switch (event.type) {
601
- * case 'response.delta.text':
602
- * console.log(event.chunk);
603
- * break;
604
- * case 'response.delta.audio':
605
- * audioPlayer.enqueue(event.audio);
606
- * break;
607
- * }
608
- * }
609
- * });
3606
+ * Supports `200` and `201` responses. Returns `never` if neither exists.
610
3607
  *
611
- * session.sendText('Hello!');
612
- * ```
3608
+ * @typeParam T - Operation name
613
3609
  */
614
- declare class ConversationClient {
615
- private readonly http;
616
- private readonly ws;
617
- constructor(http: HttpTransport, ws: WebSocketTransport);
618
- /**
619
- * Lists conversations with optional filtering and pagination.
620
- *
621
- * @param params List configuration
622
- * @returns Paginated list of conversations
623
- */
624
- list(params: ConversationListParams): Promise<Paginated<Conversation[]>>;
625
- /**
626
- * Gets a single conversation by ID.
627
- *
628
- * @param id Conversation ID
629
- * @returns Conversation details
630
- */
631
- get(id: string): Promise<Conversation>;
632
- /**
633
- * Connects to an agent and establishes a conversation session.
634
- *
635
- * @param params Connection configuration
636
- * @returns Active conversation session
637
- * @throws {Error} If handshake fails or connection is lost
638
- */
639
- connect(params: ConversationConnectParams): Promise<ConversationSession>;
640
- }
641
- type MessageRole = "system" | "user" | "assistant";
642
- type Message = {
643
- id: string
644
- conversation_id: string
645
- role: MessageRole
646
- content: string
647
- created_at: Date
648
- };
3610
+ type ApiResponse<T extends keyof operations> = operations[T] extends {
3611
+ responses: {
3612
+ 200: {
3613
+ content: {
3614
+ "application/json": infer Res
3615
+ }
3616
+ }
3617
+ }
3618
+ } ? Res : operations[T] extends {
3619
+ responses: {
3620
+ 201: {
3621
+ content: {
3622
+ "application/json": infer Res
3623
+ }
3624
+ }
3625
+ }
3626
+ } ? Res : never;
649
3627
  /**
650
- * Configuration for listing messages.
3628
+ * All event types emitted by the backend `runtime` package runtime.
651
3629
  */
652
- type MessageListParams = {
653
- /** Conversation ID to filter by */
654
- conversationId?: string
655
- /** Number of results per page */
656
- limit?: number
657
- /** Page number (1-indexed) */
658
- page?: number
3630
+ type SSEEvent = {
3631
+ event: "assistant_tool_calls"
3632
+ data: {
3633
+ tool_calls: {
3634
+ id: string
3635
+ name: string
3636
+ arguments: Record<string, unknown>
3637
+ }[]
3638
+ }
3639
+ } | {
3640
+ event: "tool_call_start"
3641
+ data: {
3642
+ name: string
3643
+ tool_call_id: string
3644
+ arguments?: Record<string, unknown>
3645
+ }
3646
+ } | {
3647
+ event: "tool_call_end"
3648
+ data: {
3649
+ name: string
3650
+ tool_call_id: string
3651
+ result?: Record<string, unknown>
3652
+ error?: string
3653
+ }
3654
+ } | {
3655
+ event: "node_start"
3656
+ data: {
3657
+ node_id: string
3658
+ }
3659
+ } | {
3660
+ event: "node_end"
3661
+ data: {
3662
+ node_id: string
3663
+ }
3664
+ } | {
3665
+ event: "message_chunk"
3666
+ data: {
3667
+ chunk: string
3668
+ }
3669
+ } | {
3670
+ event: "message_static"
3671
+ data: {
3672
+ content: string
3673
+ }
3674
+ } | {
3675
+ event: "message_complete"
3676
+ data: {
3677
+ content?: string
3678
+ outcome?: string
3679
+ vars?: Record<string, unknown>
3680
+ }
3681
+ } | {
3682
+ event: "error"
3683
+ data: {
3684
+ message: string
3685
+ }
659
3686
  };
660
3687
  /**
661
- * Client for interacting with conversation messages.
3688
+ * Parses a `ReadableStream<Uint8Array>` as a Server-Sent Events stream,
3689
+ * yielding one {@link SSEEvent} per `event/data` block.
662
3690
  *
663
- * @example
664
- * ```ts
665
- * const messages = await kivox.messages.list({
666
- * conversationId: 'conv-123'
667
- * });
668
- * ```
3691
+ * Compatible with any SSE response body; pass `response.body` directly.
3692
+ *
3693
+ * @yields {SSEEvent}
669
3694
  */
670
- declare class MessageClient {
671
- private readonly http;
672
- constructor(http: HttpTransport);
673
- /**
674
- * Lists messages with optional filtering and pagination.
675
- *
676
- * @param params List configuration
677
- * @returns Paginated list of messages
678
- */
679
- list(params?: MessageListParams): Promise<Paginated<Message[]>>;
680
- /**
681
- * Gets a single message by ID.
682
- *
683
- * @param id Message ID
684
- * @returns Message details
685
- */
686
- get(id: string): Promise<Message>;
687
- }
688
- type Template = {
689
- id: string
690
- name: string
691
- description?: string
692
- blueprint: AgentBlueprint
693
- created_at: Date
694
- updated_at: Date
3695
+ declare function readSSE(stream: ReadableStream<Uint8Array>): AsyncGenerator<SSEEvent>;
3696
+ type KivoxFetchClient = ReturnType<typeof createClient<paths>>;
3697
+ type KivoxClient = {
3698
+ api: KivoxFetchClient
695
3699
  };
696
- type TemplateCreate = Pick<Template, "name" | "description" | "blueprint">;
697
- type TemplateUpdate = Partial<TemplateCreate>;
698
- /**
699
- * Configuration for listing templates.
700
- */
701
- type TemplateListParams = {
702
- /** Number of results per page */
703
- limit?: number
704
- /** Page number (1-indexed) */
705
- page?: number
3700
+ type CommonClientOptions = {
3701
+ baseUrl?: string
3702
+ version?: "v1"
3703
+ headers?: Record<string, string>
3704
+ };
3705
+ type SessionClientOptions = CommonClientOptions;
3706
+ type BearerClientOptions = CommonClientOptions & {
3707
+ bearerToken: string
706
3708
  };
707
3709
  /**
708
- * Client for interacting with KIVOX templates.
709
- *
710
- * @example
711
- * ```ts
712
- * const templates = await kivox.templates.list();
713
- * const template = await kivox.templates.get('template-123');
714
- * ```
715
- */
716
- declare class TemplateClient {
717
- private readonly http;
718
- constructor(http: HttpTransport);
719
- /**
720
- * Lists all templates with optional filtering and pagination.
721
- *
722
- * @param params List configuration
723
- * @returns Paginated list of templates
724
- */
725
- list(params?: TemplateListParams): Promise<Paginated<Template[]>>;
726
- /**
727
- * Gets a single template by ID.
728
- *
729
- * @param id Template ID
730
- * @returns Template details
731
- */
732
- get(id: string): Promise<Template>;
733
- /**
734
- * Creates a new template.
735
- *
736
- * @param data Template data
737
- * @returns Created template
738
- */
739
- create(data: TemplateCreate): Promise<Template>;
740
- /**
741
- * Updates an existing template.
742
- *
743
- * @param id Template ID
744
- * @param data Updated template data
745
- * @returns Updated template
746
- */
747
- update(id: string, data: TemplateUpdate): Promise<Template>;
748
- /**
749
- * Deletes a template.
750
- *
751
- * @param id Template ID
752
- */
753
- delete(id: string): Promise<void>;
754
- }
755
- /**
756
- * Configuration for the Kivox client.
3710
+ * Browser/Studio client. Authenticates via HttpOnly session cookie.
757
3711
  */
758
- type KivoxConfig = {
759
- /**
760
- * Base URL of your self-hosted KIVOX instance.
761
- * @example 'http://localhost:8787'
762
- * @example 'https://api.kivox.io'
763
- */
764
- baseUrl: string
765
- /**
766
- * Optional headers to include with all requests.
767
- * @example { Authorization: 'Bearer token' }
768
- */
769
- headers?: Record<string, string>
770
- };
3712
+ declare function createSessionClient(options?: SessionClientOptions): KivoxClient;
771
3713
  /**
772
- * Main KIVOX client.
773
- * Provides unified access to all KIVOX resources.
774
- *
775
- * @example
776
- * ```ts
777
- * import { KivoxClient } from '@kivox/client';
778
- *
779
- * const kivox = new KivoxClient({
780
- * baseUrl: 'http://localhost:8787',
781
- * });
782
- *
783
- * // List agents
784
- * const agents = await kivox.agents.list();
785
- *
786
- * // Start a conversation
787
- * const session = await kivox.conversations.connect({
788
- * agentId: '019bb51e-e45f-75e3-b828-94fdf231711e',
789
- * onEvent: (event) => {
790
- * console.log(event);
791
- * }
792
- * });
793
- * ```
3714
+ * Server-side / programmatic client. Authenticates via Bearer token.
794
3715
  */
795
- declare class KivoxClient {
796
- /** Agent resource client */
797
- readonly agents: AgentClient;
798
- /** Conversation resource client */
799
- readonly conversations: ConversationClient;
800
- /** Template resource client */
801
- readonly templates: TemplateClient;
802
- /** Message resource client */
803
- readonly messages: MessageClient;
804
- constructor(config: KivoxConfig);
805
- }
806
- export { TemplateUpdate, TemplateCreate, Template, SessionConnectionLostEvent, ServerSpeechStart, ServerSpeechEnd, ServerSessionTimeout, ServerSessionTick, ServerSessionStart, ServerSessionLifecycleMessage, ServerSessionHandshakeReject, ServerSessionHandshakeAccept, ServerSessionEvent, ServerSessionEnd, ServerSessionActivityMessage, ServerResponseError, ServerResponseDeltaText, ServerResponseDeltaAudio, ServerResponseComplete, ServerResponseCancel, ServerMessage, ServerConnectionMessage, Paginated, NodeType, NodePosition, NodeDimensions, Node, MessageRole, Message, KivoxConfig, KivoxClient, HttpTransportError, Edge, ConversationTransportError, ConversationSessionConfig, ConversationSession, Conversation, ClientSessionHandshakeOffer, ClientSessionEnd, ClientRequestCancel, ClientMessage, ClientInputText, ClientInputAudioStream, ClientInputAudio, AgentUpdate, AgentStatus, AgentCreate, AgentConfig, AgentBlueprint, Agent };
3716
+ declare function createBearerClient(options: BearerClientOptions): KivoxClient;
3717
+ export { readSSE, paths, operations, createSessionClient, createBearerClient, components, SessionClientOptions, SSEEvent, KivoxFetchClient, KivoxClient, CommonClientOptions, BearerClientOptions, ApiSchema, ApiResponse, ApiRequest };