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

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,3714 @@
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
+ system_prompt?: string
1006
+ model_llm?: string
1007
+ }
1008
+ AgentSecret: {
1009
+ key: string
1010
+ value: string
1011
+ description?: string
1012
+ }
1013
+ AgentBlueprintNode: {
1014
+ id: string
1015
+ type: string
1016
+ data: {
1017
+ [key: string]: unknown
1018
+ }
1019
+ } & {
1020
+ [key: string]: unknown
1021
+ }
1022
+ AgentBlueprintEdge: {
1023
+ source: string
1024
+ target: string
1025
+ } & {
1026
+ [key: string]: unknown
1027
+ }
1028
+ AgentBlueprint: {
1029
+ /** @default 1 */
1030
+ version: string
1031
+ entries: {
1032
+ name: string
1033
+ workflow: {
1034
+ nodes: components["schemas"]["AgentBlueprintNode"][]
1035
+ edges: components["schemas"]["AgentBlueprintEdge"][]
1036
+ }
1037
+ }[]
1038
+ }
1039
+ /** @enum {string} */
1040
+ AgentStatus: "draft" | "live" | "archived"
1041
+ Agent: {
1042
+ /** Format: uuid */
1043
+ id: string
1044
+ /** @enum {string} */
1045
+ object: "agent"
1046
+ /** Format: uuid */
1047
+ owner_user_id?: string
1048
+ /** Format: uuid */
1049
+ owner_org_id?: string
1050
+ config: components["schemas"]["AgentConfig"]
1051
+ secrets?: components["schemas"]["AgentSecret"][]
1052
+ blueprint: components["schemas"]["AgentBlueprint"]
1053
+ status: components["schemas"]["AgentStatus"]
1054
+ /** Format: date-time */
1055
+ created_at: string
1056
+ /** Format: date-time */
1057
+ updated_at: string
1058
+ }
1059
+ AgentListResponse: {
1060
+ data: components["schemas"]["Agent"][]
1061
+ meta: components["schemas"]["OffsetMeta"]
1062
+ }
1063
+ AgentCreateRequest: {
1064
+ config?: components["schemas"]["AgentConfig"]
1065
+ secrets?: components["schemas"]["AgentSecret"][]
1066
+ blueprint?: components["schemas"]["AgentBlueprint"]
1067
+ }
1068
+ /** @enum {string} */
1069
+ ConversationStatus: "active" | "ended"
1070
+ Conversation: {
1071
+ /** Format: uuid */
1072
+ id: string
1073
+ /** @enum {string} */
1074
+ object: "conversation"
1075
+ /** Format: uuid */
1076
+ agent_id: string
1077
+ /** Format: uuid */
1078
+ created_by?: string
1079
+ status: components["schemas"]["ConversationStatus"]
1080
+ title?: string
1081
+ summary?: string
1082
+ /** Format: date-time */
1083
+ started_at: string
1084
+ /** Format: date-time */
1085
+ ended_at?: string
1086
+ end_reason?: string
1087
+ /** Format: date-time */
1088
+ updated_at?: string
1089
+ }
1090
+ CursorMeta: {
1091
+ next_cursor: string | null
1092
+ has_more: boolean
1093
+ }
1094
+ ConversationListResponse: {
1095
+ data: components["schemas"]["Conversation"][]
1096
+ meta: components["schemas"]["CursorMeta"]
1097
+ }
1098
+ /** @description Controls how documents are split before embedding. */
1099
+ KnowledgeBaseChunkStrategy: {
1100
+ /** @default 1000 */
1101
+ chunk_size: number
1102
+ /** @default 200 */
1103
+ chunk_overlap: number
1104
+ }
1105
+ KnowledgeBase: {
1106
+ /** Format: uuid */
1107
+ id: string
1108
+ /** @enum {string} */
1109
+ object: "knowledge_base"
1110
+ /** Format: uuid */
1111
+ owner_user_id?: string
1112
+ /** Format: uuid */
1113
+ owner_org_id?: string
1114
+ name: string
1115
+ description?: string
1116
+ /** @example text-embedding-3-small */
1117
+ embedding_model: string
1118
+ chunk_strategy: components["schemas"]["KnowledgeBaseChunkStrategy"]
1119
+ /** Format: date-time */
1120
+ created_at: string
1121
+ /** Format: date-time */
1122
+ updated_at: string
1123
+ /** @description Number of documents in the KB. This field is computed at runtime. */
1124
+ document_count?: number
1125
+ /** @description Number of chunks in the KB. This field is computed at runtime. */
1126
+ chunk_count?: number
1127
+ }
1128
+ KnowledgeBaseListResponse: {
1129
+ data: components["schemas"]["KnowledgeBase"][]
1130
+ meta: components["schemas"]["OffsetMeta"]
1131
+ }
1132
+ KnowledgeBaseCreateRequest: {
1133
+ name: string
1134
+ description?: string
1135
+ embedding_model: string
1136
+ chunk_strategy?: components["schemas"]["KnowledgeBaseChunkStrategy"]
1137
+ }
1138
+ /** @enum {string} */
1139
+ OrgInvitationRole: "admin" | "member" | "viewer"
1140
+ /** @enum {string} */
1141
+ OrgInvitationState: "pending" | "accepted" | "declined" | "expired"
1142
+ OrgInvitation: {
1143
+ /** Format: uuid */
1144
+ id: string
1145
+ /** @enum {string} */
1146
+ object: "org_invitation"
1147
+ /** Format: uuid */
1148
+ org_id: string
1149
+ /** Format: uuid */
1150
+ inviter_id: string
1151
+ /** Format: uuid */
1152
+ user_id: string
1153
+ role: components["schemas"]["OrgInvitationRole"]
1154
+ state: components["schemas"]["OrgInvitationState"]
1155
+ /** Format: date-time */
1156
+ created_at: string
1157
+ /** Format: date-time */
1158
+ expires_at: string
1159
+ }
1160
+ OrgInvitationListResponse: {
1161
+ data: components["schemas"]["OrgInvitation"][]
1162
+ meta: components["schemas"]["OffsetMeta"]
1163
+ }
1164
+ OrgInvitationStateUpdateRequest: {
1165
+ /** @enum {string} */
1166
+ state: "accepted" | "declined"
1167
+ }
1168
+ /** @description Describes the model's technical capabilities and supported modalities. */
1169
+ ModelArchitecture: {
1170
+ /**
1171
+ * @description Content types accepted as input by the model.
1172
+ * @example [
1173
+ * "text",
1174
+ * "image"
1175
+ * ]
1176
+ */
1177
+ input_modalities: ("text" | "image" | "audio" | "file")[]
1178
+ /**
1179
+ * @description Content types this model can produce as output.
1180
+ * @example [
1181
+ * "text"
1182
+ * ]
1183
+ */
1184
+ output_modalities: ("text" | "image" | "audio" | "embeddings")[]
1185
+ /**
1186
+ * @description Tokenization method or family used by the model (e.g. "cl100k", "llama3").
1187
+ * @example cl100k
1188
+ */
1189
+ tokenizer?: string
1190
+ /**
1191
+ * @description Instruction format type the model was fine-tuned on (e.g. "chat", "alpaca"). Null if not applicable.
1192
+ * @example chat
1193
+ */
1194
+ instruct_type?: string
1195
+ }
1196
+ /** @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. */
1197
+ ModelPricing: {
1198
+ /**
1199
+ * @description Cost per input token.
1200
+ * @example 0.00000025
1201
+ */
1202
+ prompt?: string
1203
+ /**
1204
+ * @description Cost per output token.
1205
+ * @example 0.00000075
1206
+ */
1207
+ completion?: string
1208
+ /**
1209
+ * @description Fixed cost per API request, regardless of token count.
1210
+ * @example 0
1211
+ */
1212
+ request?: string
1213
+ /**
1214
+ * @description Cost per image provided as input.
1215
+ * @example 0
1216
+ */
1217
+ image?: string
1218
+ /**
1219
+ * @description Cost per web search operation, if supported.
1220
+ * @example 0
1221
+ */
1222
+ web_search?: string
1223
+ /**
1224
+ * @description Cost per internal reasoning token, if the model supports extended thinking.
1225
+ * @example 0
1226
+ */
1227
+ internal_reasoning?: string
1228
+ /**
1229
+ * @description Cost per cached input token read (prompt caching).
1230
+ * @example 0
1231
+ */
1232
+ input_cache_read?: string
1233
+ /**
1234
+ * @description Cost per input token written to cache (prompt caching).
1235
+ * @example 0
1236
+ */
1237
+ input_cache_write?: string
1238
+ }
1239
+ Model: {
1240
+ /**
1241
+ * @description Unique model identifier used in API requests.
1242
+ * @example google/gemini-2.5-pro-preview
1243
+ */
1244
+ id: string
1245
+ /** @enum {string} */
1246
+ object: "model"
1247
+ /** @description Permanent slug for the model that never changes. */
1248
+ slug: string
1249
+ /**
1250
+ * @description Aggregator which this model is accessed.
1251
+ * @example openrouter
1252
+ */
1253
+ backend: string
1254
+ /**
1255
+ * @description Company which owns this model.
1256
+ * @example Google
1257
+ */
1258
+ company: string
1259
+ /**
1260
+ * @description Human-readable display name for the model.
1261
+ * @example Gemini 2.5 Pro Preview
1262
+ */
1263
+ name: string
1264
+ /** @description Detailed description of the model's capabilities and characteristics. */
1265
+ description?: string
1266
+ /**
1267
+ * @description Maximum context window size in tokens.
1268
+ * @example 1048576
1269
+ */
1270
+ context_length: number
1271
+ architecture: components["schemas"]["ModelArchitecture"]
1272
+ pricing: components["schemas"]["ModelPricing"]
1273
+ /**
1274
+ * @description API parameters supported by this model.
1275
+ * @example [
1276
+ * "tools",
1277
+ * "tool_choice",
1278
+ * "temperature",
1279
+ * "max_tokens",
1280
+ * "structured_outputs"
1281
+ * ]
1282
+ */
1283
+ supported_parameters: string[]
1284
+ /** @description Default parameter values applied to requests for this model, if any. */
1285
+ default_parameters?: {
1286
+ [key: string]: unknown
1287
+ }
1288
+ /**
1289
+ * @description Whether this model has been deprecated and may be removed.
1290
+ * @default false
1291
+ */
1292
+ is_deprecated: boolean
1293
+ /**
1294
+ * Format: date-time
1295
+ * @description Deprecation date for the model endpoint (null if not deprecated).
1296
+ */
1297
+ expiration_date?: string
1298
+ /**
1299
+ * @description Categorical tags assigned to the model by the platform (e.g., voice_agent, free, embedding).
1300
+ * @example [
1301
+ * "voice_agent",
1302
+ * "free"
1303
+ * ]
1304
+ */
1305
+ tags: string[]
1306
+ /** Format: date-time */
1307
+ created_at: string
1308
+ }
1309
+ ModelListResponse: {
1310
+ /** @enum {string} */
1311
+ object: "list"
1312
+ data: components["schemas"]["Model"][]
1313
+ }
1314
+ Org: {
1315
+ /** Format: uuid */
1316
+ id: string
1317
+ /** @enum {string} */
1318
+ object: "org"
1319
+ /** Format: uuid */
1320
+ created_by?: string
1321
+ name: string
1322
+ description?: string
1323
+ /** Format: uri */
1324
+ avatar_url?: string
1325
+ slug: string
1326
+ /** Format: date-time */
1327
+ created_at: string
1328
+ /** Format: date-time */
1329
+ updated_at: string
1330
+ }
1331
+ OrgListResponse: {
1332
+ data: components["schemas"]["Org"][]
1333
+ meta: components["schemas"]["OffsetMeta"]
1334
+ }
1335
+ OrgCreateRequest: {
1336
+ name: string
1337
+ description?: string
1338
+ slug: string
1339
+ }
1340
+ OrgUpdateRequest: {
1341
+ name?: string
1342
+ description?: string
1343
+ /** Format: uri */
1344
+ avatar_url?: string
1345
+ }
1346
+ /**
1347
+ * @description Hierarchy (highest to lowest): owner > admin > member > viewer.
1348
+ * @enum {string}
1349
+ */
1350
+ OrgMemberRole: "owner" | "admin" | "member" | "viewer"
1351
+ OrgMember: {
1352
+ /** Format: uuid */
1353
+ id: string
1354
+ /** @enum {string} */
1355
+ object: "org_member"
1356
+ /** Format: uuid */
1357
+ org_id: string
1358
+ /** Format: uuid */
1359
+ user_id: string
1360
+ role: components["schemas"]["OrgMemberRole"]
1361
+ /** Format: date-time */
1362
+ created_at: string
1363
+ /** Format: date-time */
1364
+ updated_at: string
1365
+ }
1366
+ OrgMemberListResponse: {
1367
+ data: components["schemas"]["OrgMember"][]
1368
+ meta: components["schemas"]["OffsetMeta"]
1369
+ }
1370
+ OrgMemberUpdateRequest: {
1371
+ role: components["schemas"]["OrgMemberRole"]
1372
+ }
1373
+ OrgInvitationCreateRequest: {
1374
+ /** Format: uuid */
1375
+ user_id?: string
1376
+ role: components["schemas"]["OrgInvitationRole"]
1377
+ }
1378
+ /** @enum {string} */
1379
+ WebhookScope: "agent" | "org"
1380
+ /** @enum {string} */
1381
+ WebhookEvent: "conversation.started" | "conversation.ended" | "conversation.message.created" | "agent.status.updated" | "agent.updated" | "agent.deleted"
1382
+ /** @enum {string} */
1383
+ WebhookDeliveryStatus: "pending" | "success" | "failed"
1384
+ Webhook: {
1385
+ /** Format: uuid */
1386
+ id: string
1387
+ /** @enum {string} */
1388
+ object: "webhook"
1389
+ scope: components["schemas"]["WebhookScope"]
1390
+ /** Format: uuid */
1391
+ agent_id?: string
1392
+ /** Format: uuid */
1393
+ org_id?: string
1394
+ active: boolean
1395
+ /** Format: uri */
1396
+ url: string
1397
+ /**
1398
+ * @default json
1399
+ * @enum {string}
1400
+ */
1401
+ content_type: "json" | "form"
1402
+ secret?: string
1403
+ events: components["schemas"]["WebhookEvent"][]
1404
+ /** Format: date-time */
1405
+ last_delivery_at?: string
1406
+ last_delivery_status?: components["schemas"]["WebhookDeliveryStatus"]
1407
+ /** Format: date-time */
1408
+ created_at: string
1409
+ /** Format: date-time */
1410
+ updated_at: string
1411
+ }
1412
+ WebhookListResponse: {
1413
+ data: components["schemas"]["Webhook"][]
1414
+ meta: components["schemas"]["OffsetMeta"]
1415
+ }
1416
+ WebhookCreateRequest: {
1417
+ /** Format: uri */
1418
+ url: string
1419
+ /**
1420
+ * @default json
1421
+ * @enum {string}
1422
+ */
1423
+ content_type: "json" | "form"
1424
+ secret?: string
1425
+ events: components["schemas"]["WebhookEvent"][]
1426
+ /** @default true */
1427
+ active: boolean
1428
+ }
1429
+ WebhookUpdateRequest: {
1430
+ /** Format: uri */
1431
+ url?: string
1432
+ /** @enum {string} */
1433
+ content_type?: "json" | "form"
1434
+ secret?: string
1435
+ events?: components["schemas"]["WebhookEvent"][]
1436
+ active?: boolean
1437
+ }
1438
+ AgentUpdateRequest: {
1439
+ config?: components["schemas"]["AgentConfig"]
1440
+ secrets?: components["schemas"]["AgentSecret"][]
1441
+ blueprint?: components["schemas"]["AgentBlueprint"]
1442
+ }
1443
+ AgentUpdateStatusRequest: {
1444
+ status: components["schemas"]["AgentStatus"]
1445
+ }
1446
+ AgentLintRequest: {
1447
+ blueprint?: components["schemas"]["AgentBlueprint"]
1448
+ }
1449
+ AgentLintResponse: {
1450
+ errors: string[]
1451
+ }
1452
+ /** @enum {string} */
1453
+ ConversationMessageRole: "user" | "assistant" | "tool"
1454
+ ConversationToolCall: {
1455
+ /** @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. */
1456
+ id: string
1457
+ /** @description The name of the tool that was invoked. */
1458
+ name: string
1459
+ /** @description The parsed arguments the LLM passed to the tool. */
1460
+ arguments: {
1461
+ [key: string]: unknown
1462
+ }
1463
+ }
1464
+ ConversationMessage: {
1465
+ /** Format: uuid */
1466
+ id: string
1467
+ /** @enum {string} */
1468
+ object: "conversation_message"
1469
+ /** Format: uuid */
1470
+ conversation_id: string
1471
+ role: components["schemas"]["ConversationMessageRole"]
1472
+ /** @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. */
1473
+ content?: string
1474
+ /** @description Only present when role is assistant and the model invoked one or more tools. Null or absent for all other roles. */
1475
+ tool_calls?: components["schemas"]["ConversationToolCall"][]
1476
+ /** @description Only present when role is tool. References the id field of the ConversationToolCall in the preceding assistant message that triggered this tool execution. */
1477
+ tool_call_id?: string
1478
+ /** Format: date-time */
1479
+ created_at: string
1480
+ }
1481
+ ConversationMessageListResponse: {
1482
+ data: components["schemas"]["ConversationMessage"][]
1483
+ meta: components["schemas"]["CursorMeta"]
1484
+ }
1485
+ KnowledgeBaseUpdateRequest: {
1486
+ name?: string
1487
+ description?: string
1488
+ embedding_model?: string
1489
+ chunk_strategy?: components["schemas"]["KnowledgeBaseChunkStrategy"]
1490
+ }
1491
+ /**
1492
+ * @description How the document content was provided.
1493
+ * `file` uploaded binary (PDF, DOCX, TXT, etc.).
1494
+ * `url` fetched from a remote URL.
1495
+ * `raw_text` plain text submitted inline.
1496
+ * @enum {string}
1497
+ */
1498
+ KnowledgeBaseDocumentType: "file" | "url" | "raw_text"
1499
+ /** @enum {string} */
1500
+ KnowledgeBaseIngestionStatus: "pending" | "processing" | "ready" | "failed"
1501
+ KnowledgeBaseDocument: {
1502
+ /** Format: uuid */
1503
+ id: string
1504
+ /** @enum {string} */
1505
+ object: "knowledge_base_document"
1506
+ /** Format: uuid */
1507
+ knowledge_base_id: string
1508
+ /** @description Original filename, URL, or user-provided label. */
1509
+ name: string
1510
+ source_type: components["schemas"]["KnowledgeBaseDocumentType"]
1511
+ /** @description The internal storage path or external URL. */
1512
+ source_uri?: string
1513
+ /** @description The MIME type of the document. */
1514
+ mime_type: string
1515
+ status: components["schemas"]["KnowledgeBaseIngestionStatus"]
1516
+ /** @description Present only when status is `failed`. */
1517
+ error_message?: string
1518
+ /** Format: int64 */
1519
+ size_bytes: number
1520
+ /** @description Number of chunks after processing. 0 until complete. */
1521
+ chunk_count: number
1522
+ /** Format: date-time */
1523
+ processed_at?: string
1524
+ /** Format: date-time */
1525
+ created_at: string
1526
+ /** Format: date-time */
1527
+ updated_at: string
1528
+ }
1529
+ KnowledgeBaseDocumentListResponse: {
1530
+ data: components["schemas"]["KnowledgeBaseDocument"][]
1531
+ meta: components["schemas"]["OffsetMeta"]
1532
+ }
1533
+ KnowledgeBaseDocumentCreateFromURLRequest: {
1534
+ /**
1535
+ * @description discriminator enum property added by openapi-typescript
1536
+ * @enum {string}
1537
+ */
1538
+ source_type: "url"
1539
+ name: string
1540
+ /** Format: uri */
1541
+ source_uri: string
1542
+ }
1543
+ KnowledgeBaseDocumentCreateFromTextRequest: {
1544
+ /**
1545
+ * @description discriminator enum property added by openapi-typescript
1546
+ * @enum {string}
1547
+ */
1548
+ source_type: "raw_text"
1549
+ name: string
1550
+ content: string
1551
+ }
1552
+ KnowledgeBaseDocumentCreateFromFileRequest: {
1553
+ /** @enum {string} */
1554
+ source_type: "file"
1555
+ name: string
1556
+ /** Format: binary */
1557
+ file: string
1558
+ }
1559
+ KnowledgeBaseQueryRequest: {
1560
+ query: string
1561
+ /** @default 3 */
1562
+ top_k: number
1563
+ }
1564
+ KnowledgeBaseQueryMatch: {
1565
+ content: string
1566
+ /** @description The JSONB metadata associated with this chunk. */
1567
+ metadata: {
1568
+ [key: string]: unknown
1569
+ }
1570
+ /**
1571
+ * Format: float
1572
+ * @description Cosine similarity score (closer to 1 is better depending on metric).
1573
+ */
1574
+ score: number
1575
+ }
1576
+ KnowledgeBaseQueryResponse: {
1577
+ data: components["schemas"]["KnowledgeBaseQueryMatch"][]
1578
+ }
1579
+ };
1580
+ responses: {
1581
+ /** @description An unexpected internal server error occurred */
1582
+ Internal: {
1583
+ headers: {
1584
+ [name: string]: unknown
1585
+ }
1586
+ content: {
1587
+ "application/json": components["schemas"]["Error"]
1588
+ }
1589
+ }
1590
+ /** @description Request body or parameters failed validation */
1591
+ BadRequest: {
1592
+ headers: {
1593
+ [name: string]: unknown
1594
+ }
1595
+ content: {
1596
+ "application/json": components["schemas"]["Error"]
1597
+ }
1598
+ }
1599
+ /** @description Resource already exists or state conflict */
1600
+ Conflict: {
1601
+ headers: {
1602
+ [name: string]: unknown
1603
+ }
1604
+ content: {
1605
+ "application/json": components["schemas"]["Error"]
1606
+ }
1607
+ }
1608
+ /** @description Not authenticated */
1609
+ Unauthorized: {
1610
+ headers: {
1611
+ [name: string]: unknown
1612
+ }
1613
+ content: {
1614
+ "application/json": components["schemas"]["Error"]
1615
+ }
1616
+ }
1617
+ /** @description Resource not found */
1618
+ NotFound: {
1619
+ headers: {
1620
+ [name: string]: unknown
1621
+ }
1622
+ content: {
1623
+ "application/json": components["schemas"]["Error"]
1624
+ }
1625
+ }
1626
+ /** @description Insufficient permissions */
1627
+ Forbidden: {
1628
+ headers: {
1629
+ [name: string]: unknown
1630
+ }
1631
+ content: {
1632
+ "application/json": components["schemas"]["Error"]
1633
+ }
1634
+ }
1635
+ };
1636
+ parameters: never;
1637
+ requestBodies: never;
1638
+ headers: never;
1639
+ pathItems: never;
55
1640
  }
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;
1641
+ interface operations {
1642
+ createRegistration: {
1643
+ parameters: {
1644
+ query?: never
1645
+ header: {
1646
+ /** @description Cloudflare Turnstile challenge token. */
1647
+ "X-Turnstile-Token": string
1648
+ }
1649
+ path?: never
1650
+ cookie?: never
1651
+ }
1652
+ requestBody: {
1653
+ content: {
1654
+ "application/json": components["schemas"]["AuthSignupRequest"]
1655
+ }
1656
+ }
1657
+ responses: {
1658
+ /** @description Account created. Session cookie set in `Set-Cookie`. */
1659
+ 201: {
1660
+ headers: {
1661
+ "Set-Cookie"?: string
1662
+ [name: string]: unknown
1663
+ }
1664
+ content: {
1665
+ "application/json": components["schemas"]["AuthSessionResponse"]
1666
+ }
1667
+ }
1668
+ 400: components["responses"]["BadRequest"]
1669
+ 409: components["responses"]["Conflict"]
1670
+ default: components["responses"]["Internal"]
1671
+ }
1672
+ };
1673
+ createSession: {
1674
+ parameters: {
1675
+ query?: never
1676
+ header: {
1677
+ "X-Turnstile-Token": string
1678
+ }
1679
+ path?: never
1680
+ cookie?: never
1681
+ }
1682
+ requestBody: {
1683
+ content: {
1684
+ "application/json": components["schemas"]["AuthSigninRequest"]
1685
+ }
1686
+ }
1687
+ responses: {
1688
+ /** @description Session created. Cookie set in `Set-Cookie`. */
1689
+ 201: {
1690
+ headers: {
1691
+ "Set-Cookie"?: string
1692
+ [name: string]: unknown
1693
+ }
1694
+ content: {
1695
+ "application/json": components["schemas"]["AuthSessionResponse"]
1696
+ }
1697
+ }
1698
+ 400: components["responses"]["BadRequest"]
1699
+ 401: components["responses"]["Unauthorized"]
1700
+ default: components["responses"]["Internal"]
1701
+ }
1702
+ };
1703
+ revokeAllSessions: {
1704
+ parameters: {
1705
+ query?: never
1706
+ header?: never
1707
+ path?: never
1708
+ cookie?: never
1709
+ }
1710
+ requestBody?: never
1711
+ responses: {
1712
+ /** @description All sessions revoked. */
1713
+ 204: {
1714
+ headers: {
1715
+ [name: string]: unknown
1716
+ }
1717
+ content?: never
1718
+ }
1719
+ 401: components["responses"]["Unauthorized"]
1720
+ default: components["responses"]["Internal"]
1721
+ }
1722
+ };
1723
+ revokeCurrentSession: {
1724
+ parameters: {
1725
+ query?: never
1726
+ header?: never
1727
+ path?: never
1728
+ cookie?: never
1729
+ }
1730
+ requestBody?: never
1731
+ responses: {
1732
+ /** @description Session revoked. */
1733
+ 204: {
1734
+ headers: {
1735
+ [name: string]: unknown
1736
+ }
1737
+ content?: never
1738
+ }
1739
+ 401: components["responses"]["Unauthorized"]
1740
+ default: components["responses"]["Internal"]
1741
+ }
1742
+ };
1743
+ createPasswordRecovery: {
1744
+ parameters: {
1745
+ query?: never
1746
+ header: {
1747
+ "X-Turnstile-Token": string
1748
+ }
1749
+ path?: never
1750
+ cookie?: never
1751
+ }
1752
+ requestBody: {
1753
+ content: {
1754
+ "application/json": components["schemas"]["AuthPasswordRecoverRequest"]
1755
+ }
1756
+ }
1757
+ responses: {
1758
+ /** @description Reset email sent (or silently dropped if not found). */
1759
+ 204: {
1760
+ headers: {
1761
+ [name: string]: unknown
1762
+ }
1763
+ content?: never
1764
+ }
1765
+ 400: components["responses"]["BadRequest"]
1766
+ default: components["responses"]["Internal"]
1767
+ }
1768
+ };
1769
+ createPasswordReset: {
1770
+ parameters: {
1771
+ query?: never
1772
+ header?: never
1773
+ path?: never
1774
+ cookie?: never
1775
+ }
1776
+ requestBody: {
1777
+ content: {
1778
+ "application/json": components["schemas"]["AuthPasswordResetRequest"]
1779
+ }
1780
+ }
1781
+ responses: {
1782
+ /** @description Password updated. All sessions revoked. */
1783
+ 204: {
1784
+ headers: {
1785
+ [name: string]: unknown
1786
+ }
1787
+ content?: never
1788
+ }
1789
+ 400: components["responses"]["BadRequest"]
1790
+ default: components["responses"]["Internal"]
1791
+ }
1792
+ };
1793
+ listAPIKeys: {
1794
+ parameters: {
1795
+ query?: {
1796
+ limit?: number
1797
+ page?: number
1798
+ }
1799
+ header?: never
1800
+ path?: never
1801
+ cookie?: never
1802
+ }
1803
+ requestBody?: never
1804
+ responses: {
1805
+ /** @description OK */
1806
+ 200: {
1807
+ headers: {
1808
+ [name: string]: unknown
1809
+ }
1810
+ content: {
1811
+ "application/json": components["schemas"]["APIKeyListResponse"]
1812
+ }
1813
+ }
1814
+ 401: components["responses"]["Unauthorized"]
1815
+ default: components["responses"]["Internal"]
1816
+ }
1817
+ };
1818
+ createAPIKey: {
1819
+ parameters: {
1820
+ query?: never
1821
+ header?: never
1822
+ path?: never
1823
+ cookie?: never
1824
+ }
1825
+ requestBody: {
1826
+ content: {
1827
+ "application/json": components["schemas"]["APIKeyCreateRequest"]
1828
+ }
1829
+ }
1830
+ responses: {
1831
+ /** @description Key created. The `key` field contains the full raw value and will not be returned again. */
1832
+ 201: {
1833
+ headers: {
1834
+ [name: string]: unknown
1835
+ }
1836
+ content: {
1837
+ "application/json": components["schemas"]["APIKeyCreateResponse"]
1838
+ }
1839
+ }
1840
+ 400: components["responses"]["BadRequest"]
1841
+ 401: components["responses"]["Unauthorized"]
1842
+ default: components["responses"]["Internal"]
1843
+ }
1844
+ };
1845
+ revokeAPIKey: {
1846
+ parameters: {
1847
+ query?: never
1848
+ header?: never
1849
+ path: {
1850
+ key_id: string
1851
+ }
1852
+ cookie?: never
1853
+ }
1854
+ requestBody?: never
1855
+ responses: {
1856
+ /** @description Key revoked. */
1857
+ 204: {
1858
+ headers: {
1859
+ [name: string]: unknown
1860
+ }
1861
+ content?: never
1862
+ }
1863
+ 401: components["responses"]["Unauthorized"]
1864
+ 404: components["responses"]["NotFound"]
1865
+ default: components["responses"]["Internal"]
1866
+ }
1867
+ };
1868
+ getUser: {
1869
+ parameters: {
1870
+ query?: never
1871
+ header?: never
1872
+ path?: never
1873
+ cookie?: never
1874
+ }
1875
+ requestBody?: never
1876
+ responses: {
1877
+ /** @description OK */
1878
+ 200: {
1879
+ headers: {
1880
+ [name: string]: unknown
1881
+ }
1882
+ content: {
1883
+ "application/json": components["schemas"]["User"]
1884
+ }
1885
+ }
1886
+ 401: components["responses"]["Unauthorized"]
1887
+ default: components["responses"]["Internal"]
1888
+ }
1889
+ };
1890
+ deleteUser: {
1891
+ parameters: {
1892
+ query?: never
1893
+ header?: never
1894
+ path?: never
1895
+ cookie?: never
1896
+ }
1897
+ requestBody?: never
1898
+ responses: {
1899
+ /** @description Account deleted. */
1900
+ 204: {
1901
+ headers: {
1902
+ [name: string]: unknown
1903
+ }
1904
+ content?: never
1905
+ }
1906
+ 401: components["responses"]["Unauthorized"]
1907
+ default: components["responses"]["Internal"]
1908
+ }
1909
+ };
1910
+ updateUser: {
1911
+ parameters: {
1912
+ query?: never
1913
+ header?: never
1914
+ path?: never
1915
+ cookie?: never
1916
+ }
1917
+ requestBody: {
1918
+ content: {
1919
+ "application/json": components["schemas"]["UserUpdateRequest"]
1920
+ }
1921
+ }
1922
+ responses: {
1923
+ /** @description Updated. */
1924
+ 200: {
1925
+ headers: {
1926
+ [name: string]: unknown
1927
+ }
1928
+ content: {
1929
+ "application/json": components["schemas"]["User"]
1930
+ }
1931
+ }
1932
+ 400: components["responses"]["BadRequest"]
1933
+ 401: components["responses"]["Unauthorized"]
1934
+ default: components["responses"]["Internal"]
1935
+ }
1936
+ };
1937
+ updateUserEmail: {
1938
+ parameters: {
1939
+ query?: never
1940
+ header?: never
1941
+ path?: never
1942
+ cookie?: never
1943
+ }
1944
+ requestBody: {
1945
+ content: {
1946
+ "application/json": components["schemas"]["UserUpdateEmailRequest"]
1947
+ }
1948
+ }
1949
+ responses: {
1950
+ /** @description Email updated. */
1951
+ 200: {
1952
+ headers: {
1953
+ [name: string]: unknown
1954
+ }
1955
+ content: {
1956
+ "application/json": components["schemas"]["User"]
1957
+ }
1958
+ }
1959
+ 400: components["responses"]["BadRequest"]
1960
+ 401: components["responses"]["Unauthorized"]
1961
+ 409: components["responses"]["Conflict"]
1962
+ default: components["responses"]["Internal"]
1963
+ }
1964
+ };
1965
+ listUserAgents: {
1966
+ parameters: {
1967
+ query?: {
1968
+ limit?: number
1969
+ page?: number
1970
+ search?: string
1971
+ }
1972
+ header?: never
1973
+ path?: never
1974
+ cookie?: never
1975
+ }
1976
+ requestBody?: never
1977
+ responses: {
1978
+ /** @description OK */
1979
+ 200: {
1980
+ headers: {
1981
+ [name: string]: unknown
1982
+ }
1983
+ content: {
1984
+ "application/json": components["schemas"]["AgentListResponse"]
1985
+ }
1986
+ }
1987
+ 401: components["responses"]["Unauthorized"]
1988
+ default: components["responses"]["Internal"]
1989
+ }
1990
+ };
1991
+ createUserAgent: {
1992
+ parameters: {
1993
+ query?: never
1994
+ header?: never
1995
+ path?: never
1996
+ cookie?: never
1997
+ }
1998
+ requestBody: {
1999
+ content: {
2000
+ "application/json": components["schemas"]["AgentCreateRequest"]
2001
+ }
2002
+ }
2003
+ responses: {
2004
+ /** @description Agent created. */
2005
+ 201: {
2006
+ headers: {
2007
+ [name: string]: unknown
2008
+ }
2009
+ content: {
2010
+ "application/json": components["schemas"]["Agent"]
2011
+ }
2012
+ }
2013
+ 400: components["responses"]["BadRequest"]
2014
+ 401: components["responses"]["Unauthorized"]
2015
+ default: components["responses"]["Internal"]
2016
+ }
2017
+ };
2018
+ listUserConversations: {
2019
+ parameters: {
2020
+ query?: {
2021
+ limit?: number
2022
+ /** @description Cursor for pagination */
2023
+ cursor?: string
2024
+ }
2025
+ header?: never
2026
+ path?: never
2027
+ cookie?: never
2028
+ }
2029
+ requestBody?: never
2030
+ responses: {
2031
+ /** @description OK */
2032
+ 200: {
2033
+ headers: {
2034
+ [name: string]: unknown
2035
+ }
2036
+ content: {
2037
+ "application/json": components["schemas"]["ConversationListResponse"]
2038
+ }
2039
+ }
2040
+ 401: components["responses"]["Unauthorized"]
2041
+ default: components["responses"]["Internal"]
2042
+ }
2043
+ };
2044
+ listUserKnowledgeBases: {
2045
+ parameters: {
2046
+ query?: {
2047
+ limit?: number
2048
+ page?: number
2049
+ }
2050
+ header?: never
2051
+ path?: never
2052
+ cookie?: never
2053
+ }
2054
+ requestBody?: never
2055
+ responses: {
2056
+ /** @description OK */
2057
+ 200: {
2058
+ headers: {
2059
+ [name: string]: unknown
2060
+ }
2061
+ content: {
2062
+ "application/json": components["schemas"]["KnowledgeBaseListResponse"]
2063
+ }
2064
+ }
2065
+ 401: components["responses"]["Unauthorized"]
2066
+ default: components["responses"]["Internal"]
2067
+ }
2068
+ };
2069
+ createUserKnowledgeBase: {
2070
+ parameters: {
2071
+ query?: never
2072
+ header?: never
2073
+ path?: never
2074
+ cookie?: never
2075
+ }
2076
+ requestBody: {
2077
+ content: {
2078
+ "application/json": components["schemas"]["KnowledgeBaseCreateRequest"]
2079
+ }
2080
+ }
2081
+ responses: {
2082
+ /** @description Knowledge base created. */
2083
+ 201: {
2084
+ headers: {
2085
+ [name: string]: unknown
2086
+ }
2087
+ content: {
2088
+ "application/json": components["schemas"]["KnowledgeBase"]
2089
+ }
2090
+ }
2091
+ 400: components["responses"]["BadRequest"]
2092
+ 401: components["responses"]["Unauthorized"]
2093
+ default: components["responses"]["Internal"]
2094
+ }
2095
+ };
2096
+ listUserInvitations: {
2097
+ parameters: {
2098
+ query?: {
2099
+ limit?: number
2100
+ page?: number
2101
+ }
2102
+ header?: never
2103
+ path?: never
2104
+ cookie?: never
2105
+ }
2106
+ requestBody?: never
2107
+ responses: {
2108
+ /** @description OK */
2109
+ 200: {
2110
+ headers: {
2111
+ [name: string]: unknown
2112
+ }
2113
+ content: {
2114
+ "application/json": components["schemas"]["OrgInvitationListResponse"]
2115
+ }
2116
+ }
2117
+ 401: components["responses"]["Unauthorized"]
2118
+ default: components["responses"]["Internal"]
2119
+ }
2120
+ };
2121
+ updateUserInvitation: {
2122
+ parameters: {
2123
+ query?: never
2124
+ header?: never
2125
+ path: {
2126
+ invitation_id: string
2127
+ }
2128
+ cookie?: never
2129
+ }
2130
+ requestBody: {
2131
+ content: {
2132
+ "application/json": components["schemas"]["OrgInvitationStateUpdateRequest"]
2133
+ }
2134
+ }
2135
+ responses: {
2136
+ /** @description State updated. */
2137
+ 200: {
2138
+ headers: {
2139
+ [name: string]: unknown
2140
+ }
2141
+ content: {
2142
+ "application/json": components["schemas"]["OrgInvitation"]
2143
+ }
2144
+ }
2145
+ 400: components["responses"]["BadRequest"]
2146
+ 401: components["responses"]["Unauthorized"]
2147
+ 404: components["responses"]["NotFound"]
2148
+ default: components["responses"]["Internal"]
2149
+ }
2150
+ };
2151
+ listModels: {
2152
+ parameters: {
2153
+ query?: {
2154
+ /** @description Filter models by name or id. */
2155
+ search?: string
2156
+ /** @description Filter models by capabilities (e.g. "llm", "embedding", "free"). */
2157
+ tags?: string[]
2158
+ }
2159
+ header?: never
2160
+ path?: never
2161
+ cookie?: never
2162
+ }
2163
+ requestBody?: never
2164
+ responses: {
2165
+ /** @description OK */
2166
+ 200: {
2167
+ headers: {
2168
+ [name: string]: unknown
2169
+ }
2170
+ content: {
2171
+ "application/json": components["schemas"]["ModelListResponse"]
2172
+ }
2173
+ }
2174
+ 401: components["responses"]["Unauthorized"]
2175
+ default: components["responses"]["Internal"]
2176
+ }
2177
+ };
2178
+ getModel: {
2179
+ parameters: {
2180
+ query?: never
2181
+ header?: never
2182
+ path: {
2183
+ /** @description Permanent slug for the model that never changes. */
2184
+ model_slug: string
2185
+ }
2186
+ cookie?: never
2187
+ }
2188
+ requestBody?: never
2189
+ responses: {
2190
+ /** @description OK */
2191
+ 200: {
2192
+ headers: {
2193
+ [name: string]: unknown
2194
+ }
2195
+ content: {
2196
+ "application/json": components["schemas"]["Model"]
2197
+ }
2198
+ }
2199
+ 401: components["responses"]["Unauthorized"]
2200
+ 404: components["responses"]["NotFound"]
2201
+ default: components["responses"]["Internal"]
2202
+ }
2203
+ };
2204
+ listOrgs: {
2205
+ parameters: {
2206
+ query?: {
2207
+ limit?: number
2208
+ page?: number
2209
+ }
2210
+ header?: never
2211
+ path?: never
2212
+ cookie?: never
2213
+ }
2214
+ requestBody?: never
2215
+ responses: {
2216
+ /** @description OK */
2217
+ 200: {
2218
+ headers: {
2219
+ [name: string]: unknown
2220
+ }
2221
+ content: {
2222
+ "application/json": components["schemas"]["OrgListResponse"]
2223
+ }
2224
+ }
2225
+ 401: components["responses"]["Unauthorized"]
2226
+ default: components["responses"]["Internal"]
2227
+ }
2228
+ };
2229
+ createOrg: {
2230
+ parameters: {
2231
+ query?: never
2232
+ header?: never
2233
+ path?: never
2234
+ cookie?: never
2235
+ }
2236
+ requestBody: {
2237
+ content: {
2238
+ "application/json": components["schemas"]["OrgCreateRequest"]
2239
+ }
2240
+ }
2241
+ responses: {
2242
+ /** @description Organization created. */
2243
+ 201: {
2244
+ headers: {
2245
+ [name: string]: unknown
2246
+ }
2247
+ content: {
2248
+ "application/json": components["schemas"]["Org"]
2249
+ }
2250
+ }
2251
+ 400: components["responses"]["BadRequest"]
2252
+ 401: components["responses"]["Unauthorized"]
2253
+ 409: components["responses"]["Conflict"]
2254
+ default: components["responses"]["Internal"]
2255
+ }
2256
+ };
2257
+ getOrg: {
2258
+ parameters: {
2259
+ query?: never
2260
+ header?: never
2261
+ path: {
2262
+ org_slug: string
2263
+ }
2264
+ cookie?: never
2265
+ }
2266
+ requestBody?: never
2267
+ responses: {
2268
+ /** @description OK */
2269
+ 200: {
2270
+ headers: {
2271
+ [name: string]: unknown
2272
+ }
2273
+ content: {
2274
+ "application/json": components["schemas"]["Org"]
2275
+ }
2276
+ }
2277
+ 401: components["responses"]["Unauthorized"]
2278
+ 403: components["responses"]["Forbidden"]
2279
+ 404: components["responses"]["NotFound"]
2280
+ default: components["responses"]["Internal"]
2281
+ }
2282
+ };
2283
+ deleteOrg: {
2284
+ parameters: {
2285
+ query?: never
2286
+ header?: never
2287
+ path: {
2288
+ org_slug: string
2289
+ }
2290
+ cookie?: never
2291
+ }
2292
+ requestBody?: never
2293
+ responses: {
2294
+ /** @description Organization deleted. */
2295
+ 204: {
2296
+ headers: {
2297
+ [name: string]: unknown
2298
+ }
2299
+ content?: never
2300
+ }
2301
+ 401: components["responses"]["Unauthorized"]
2302
+ 403: components["responses"]["Forbidden"]
2303
+ 404: components["responses"]["NotFound"]
2304
+ default: components["responses"]["Internal"]
2305
+ }
2306
+ };
2307
+ updateOrg: {
2308
+ parameters: {
2309
+ query?: never
2310
+ header?: never
2311
+ path: {
2312
+ org_slug: string
2313
+ }
2314
+ cookie?: never
2315
+ }
2316
+ requestBody: {
2317
+ content: {
2318
+ "application/json": components["schemas"]["OrgUpdateRequest"]
2319
+ }
2320
+ }
2321
+ responses: {
2322
+ /** @description Updated. */
2323
+ 200: {
2324
+ headers: {
2325
+ [name: string]: unknown
2326
+ }
2327
+ content: {
2328
+ "application/json": components["schemas"]["Org"]
2329
+ }
2330
+ }
2331
+ 400: components["responses"]["BadRequest"]
2332
+ 401: components["responses"]["Unauthorized"]
2333
+ 403: components["responses"]["Forbidden"]
2334
+ 404: components["responses"]["NotFound"]
2335
+ default: components["responses"]["Internal"]
2336
+ }
2337
+ };
2338
+ listOrgMembers: {
2339
+ parameters: {
2340
+ query?: {
2341
+ limit?: number
2342
+ page?: number
2343
+ }
2344
+ header?: never
2345
+ path: {
2346
+ org_slug: string
2347
+ }
2348
+ cookie?: never
2349
+ }
2350
+ requestBody?: never
2351
+ responses: {
2352
+ /** @description OK */
2353
+ 200: {
2354
+ headers: {
2355
+ [name: string]: unknown
2356
+ }
2357
+ content: {
2358
+ "application/json": components["schemas"]["OrgMemberListResponse"]
2359
+ }
2360
+ }
2361
+ 401: components["responses"]["Unauthorized"]
2362
+ 403: components["responses"]["Forbidden"]
2363
+ 404: components["responses"]["NotFound"]
2364
+ default: components["responses"]["Internal"]
2365
+ }
2366
+ };
2367
+ removeOrgMember: {
2368
+ parameters: {
2369
+ query?: never
2370
+ header?: never
2371
+ path: {
2372
+ org_slug: string
2373
+ user_id: string
2374
+ }
2375
+ cookie?: never
2376
+ }
2377
+ requestBody?: never
2378
+ responses: {
2379
+ /** @description Member removed. */
2380
+ 204: {
2381
+ headers: {
2382
+ [name: string]: unknown
2383
+ }
2384
+ content?: never
2385
+ }
2386
+ 401: components["responses"]["Unauthorized"]
2387
+ 403: components["responses"]["Forbidden"]
2388
+ 404: components["responses"]["NotFound"]
2389
+ default: components["responses"]["Internal"]
2390
+ }
2391
+ };
2392
+ updateOrgMember: {
2393
+ parameters: {
2394
+ query?: never
2395
+ header?: never
2396
+ path: {
2397
+ org_slug: string
2398
+ user_id: string
2399
+ }
2400
+ cookie?: never
2401
+ }
2402
+ requestBody: {
2403
+ content: {
2404
+ "application/json": components["schemas"]["OrgMemberUpdateRequest"]
2405
+ }
2406
+ }
2407
+ responses: {
2408
+ /** @description Updated. */
2409
+ 200: {
2410
+ headers: {
2411
+ [name: string]: unknown
2412
+ }
2413
+ content: {
2414
+ "application/json": components["schemas"]["OrgMember"]
2415
+ }
2416
+ }
2417
+ 400: components["responses"]["BadRequest"]
2418
+ 401: components["responses"]["Unauthorized"]
2419
+ 403: components["responses"]["Forbidden"]
2420
+ 404: components["responses"]["NotFound"]
2421
+ default: components["responses"]["Internal"]
2422
+ }
2423
+ };
2424
+ listOrgInvitations: {
2425
+ parameters: {
2426
+ query?: {
2427
+ limit?: number
2428
+ page?: number
2429
+ }
2430
+ header?: never
2431
+ path: {
2432
+ org_slug: string
2433
+ }
2434
+ cookie?: never
2435
+ }
2436
+ requestBody?: never
2437
+ responses: {
2438
+ /** @description OK */
2439
+ 200: {
2440
+ headers: {
2441
+ [name: string]: unknown
2442
+ }
2443
+ content: {
2444
+ "application/json": components["schemas"]["OrgInvitationListResponse"]
2445
+ }
2446
+ }
2447
+ 401: components["responses"]["Unauthorized"]
2448
+ 403: components["responses"]["Forbidden"]
2449
+ 404: components["responses"]["NotFound"]
2450
+ default: components["responses"]["Internal"]
2451
+ }
2452
+ };
2453
+ createOrgInvitation: {
2454
+ parameters: {
2455
+ query?: never
2456
+ header?: never
2457
+ path: {
2458
+ org_slug: string
2459
+ }
2460
+ cookie?: never
2461
+ }
2462
+ requestBody: {
2463
+ content: {
2464
+ "application/json": components["schemas"]["OrgInvitationCreateRequest"]
2465
+ }
2466
+ }
2467
+ responses: {
2468
+ /** @description Invitation created. */
2469
+ 201: {
2470
+ headers: {
2471
+ [name: string]: unknown
2472
+ }
2473
+ content: {
2474
+ "application/json": components["schemas"]["OrgInvitation"]
2475
+ }
2476
+ }
2477
+ 400: components["responses"]["BadRequest"]
2478
+ 401: components["responses"]["Unauthorized"]
2479
+ 403: components["responses"]["Forbidden"]
2480
+ 404: components["responses"]["NotFound"]
2481
+ 409: components["responses"]["Conflict"]
2482
+ default: components["responses"]["Internal"]
2483
+ }
2484
+ };
2485
+ cancelOrgInvitation: {
2486
+ parameters: {
2487
+ query?: never
2488
+ header?: never
2489
+ path: {
2490
+ org_slug: string
2491
+ invitation_id: string
2492
+ }
2493
+ cookie?: never
2494
+ }
2495
+ requestBody?: never
2496
+ responses: {
2497
+ /** @description Invitation cancelled. */
2498
+ 204: {
2499
+ headers: {
2500
+ [name: string]: unknown
2501
+ }
2502
+ content?: never
2503
+ }
2504
+ 401: components["responses"]["Unauthorized"]
2505
+ 403: components["responses"]["Forbidden"]
2506
+ 404: components["responses"]["NotFound"]
2507
+ default: components["responses"]["Internal"]
2508
+ }
2509
+ };
2510
+ listOrgAgents: {
2511
+ parameters: {
2512
+ query?: {
2513
+ limit?: number
2514
+ page?: number
2515
+ search?: string
2516
+ }
2517
+ header?: never
2518
+ path: {
2519
+ org_slug: string
2520
+ }
2521
+ cookie?: never
2522
+ }
2523
+ requestBody?: never
2524
+ responses: {
2525
+ /** @description OK */
2526
+ 200: {
2527
+ headers: {
2528
+ [name: string]: unknown
2529
+ }
2530
+ content: {
2531
+ "application/json": components["schemas"]["AgentListResponse"]
2532
+ }
2533
+ }
2534
+ 401: components["responses"]["Unauthorized"]
2535
+ 403: components["responses"]["Forbidden"]
2536
+ 404: components["responses"]["NotFound"]
2537
+ default: components["responses"]["Internal"]
2538
+ }
2539
+ };
2540
+ createOrgAgent: {
2541
+ parameters: {
2542
+ query?: never
2543
+ header?: never
2544
+ path: {
2545
+ org_slug: string
2546
+ }
2547
+ cookie?: never
2548
+ }
2549
+ requestBody: {
2550
+ content: {
2551
+ "application/json": components["schemas"]["AgentCreateRequest"]
2552
+ }
2553
+ }
2554
+ responses: {
2555
+ /** @description Agent created. */
2556
+ 201: {
2557
+ headers: {
2558
+ [name: string]: unknown
2559
+ }
2560
+ content: {
2561
+ "application/json": components["schemas"]["Agent"]
2562
+ }
2563
+ }
2564
+ 400: components["responses"]["BadRequest"]
2565
+ 401: components["responses"]["Unauthorized"]
2566
+ 403: components["responses"]["Forbidden"]
2567
+ 404: components["responses"]["NotFound"]
2568
+ default: components["responses"]["Internal"]
2569
+ }
2570
+ };
2571
+ listOrgKnowledgeBases: {
2572
+ parameters: {
2573
+ query?: {
2574
+ limit?: number
2575
+ page?: number
2576
+ }
2577
+ header?: never
2578
+ path: {
2579
+ org_slug: string
2580
+ }
2581
+ cookie?: never
2582
+ }
2583
+ requestBody?: never
2584
+ responses: {
2585
+ /** @description OK */
2586
+ 200: {
2587
+ headers: {
2588
+ [name: string]: unknown
2589
+ }
2590
+ content: {
2591
+ "application/json": components["schemas"]["KnowledgeBaseListResponse"]
2592
+ }
2593
+ }
2594
+ 401: components["responses"]["Unauthorized"]
2595
+ 403: components["responses"]["Forbidden"]
2596
+ 404: components["responses"]["NotFound"]
2597
+ default: components["responses"]["Internal"]
2598
+ }
2599
+ };
2600
+ createOrgKnowledgeBase: {
2601
+ parameters: {
2602
+ query?: never
2603
+ header?: never
2604
+ path: {
2605
+ org_slug: string
2606
+ }
2607
+ cookie?: never
2608
+ }
2609
+ requestBody: {
2610
+ content: {
2611
+ "application/json": components["schemas"]["KnowledgeBaseCreateRequest"]
2612
+ }
2613
+ }
2614
+ responses: {
2615
+ /** @description Knowledge base created. */
2616
+ 201: {
2617
+ headers: {
2618
+ [name: string]: unknown
2619
+ }
2620
+ content: {
2621
+ "application/json": components["schemas"]["KnowledgeBase"]
2622
+ }
2623
+ }
2624
+ 400: components["responses"]["BadRequest"]
2625
+ 401: components["responses"]["Unauthorized"]
2626
+ 403: components["responses"]["Forbidden"]
2627
+ 404: components["responses"]["NotFound"]
2628
+ default: components["responses"]["Internal"]
2629
+ }
2630
+ };
2631
+ listOrgWebhooks: {
2632
+ parameters: {
2633
+ query?: {
2634
+ limit?: number
2635
+ page?: number
2636
+ }
2637
+ header?: never
2638
+ path: {
2639
+ org_slug: string
2640
+ }
2641
+ cookie?: never
2642
+ }
2643
+ requestBody?: never
2644
+ responses: {
2645
+ /** @description OK */
2646
+ 200: {
2647
+ headers: {
2648
+ [name: string]: unknown
2649
+ }
2650
+ content: {
2651
+ "application/json": components["schemas"]["WebhookListResponse"]
2652
+ }
2653
+ }
2654
+ 401: components["responses"]["Unauthorized"]
2655
+ 403: components["responses"]["Forbidden"]
2656
+ 404: components["responses"]["NotFound"]
2657
+ default: components["responses"]["Internal"]
2658
+ }
2659
+ };
2660
+ createOrgWebhook: {
2661
+ parameters: {
2662
+ query?: never
2663
+ header?: never
2664
+ path: {
2665
+ org_slug: string
2666
+ }
2667
+ cookie?: never
2668
+ }
2669
+ requestBody: {
2670
+ content: {
2671
+ "application/json": components["schemas"]["WebhookCreateRequest"]
2672
+ }
2673
+ }
2674
+ responses: {
2675
+ /** @description Webhook created. */
2676
+ 201: {
2677
+ headers: {
2678
+ [name: string]: unknown
2679
+ }
2680
+ content: {
2681
+ "application/json": components["schemas"]["Webhook"]
2682
+ }
2683
+ }
2684
+ 400: components["responses"]["BadRequest"]
2685
+ 401: components["responses"]["Unauthorized"]
2686
+ 403: components["responses"]["Forbidden"]
2687
+ 404: components["responses"]["NotFound"]
2688
+ default: components["responses"]["Internal"]
2689
+ }
2690
+ };
2691
+ getOrgWebhook: {
2692
+ parameters: {
2693
+ query?: never
2694
+ header?: never
2695
+ path: {
2696
+ org_slug: string
2697
+ webhook_id: string
2698
+ }
2699
+ cookie?: never
2700
+ }
2701
+ requestBody?: never
2702
+ responses: {
2703
+ /** @description OK */
2704
+ 200: {
2705
+ headers: {
2706
+ [name: string]: unknown
2707
+ }
2708
+ content: {
2709
+ "application/json": components["schemas"]["Webhook"]
2710
+ }
2711
+ }
2712
+ 401: components["responses"]["Unauthorized"]
2713
+ 403: components["responses"]["Forbidden"]
2714
+ 404: components["responses"]["NotFound"]
2715
+ default: components["responses"]["Internal"]
2716
+ }
2717
+ };
2718
+ deleteOrgWebhook: {
2719
+ parameters: {
2720
+ query?: never
2721
+ header?: never
2722
+ path: {
2723
+ org_slug: string
2724
+ webhook_id: string
2725
+ }
2726
+ cookie?: never
2727
+ }
2728
+ requestBody?: never
2729
+ responses: {
2730
+ /** @description Webhook deleted. */
2731
+ 204: {
2732
+ headers: {
2733
+ [name: string]: unknown
2734
+ }
2735
+ content?: never
2736
+ }
2737
+ 401: components["responses"]["Unauthorized"]
2738
+ 403: components["responses"]["Forbidden"]
2739
+ 404: components["responses"]["NotFound"]
2740
+ default: components["responses"]["Internal"]
2741
+ }
2742
+ };
2743
+ updateOrgWebhook: {
2744
+ parameters: {
2745
+ query?: never
2746
+ header?: never
2747
+ path: {
2748
+ org_slug: string
2749
+ webhook_id: string
2750
+ }
2751
+ cookie?: never
2752
+ }
2753
+ requestBody: {
2754
+ content: {
2755
+ "application/json": components["schemas"]["WebhookUpdateRequest"]
2756
+ }
2757
+ }
2758
+ responses: {
2759
+ /** @description Updated. */
2760
+ 200: {
2761
+ headers: {
2762
+ [name: string]: unknown
2763
+ }
2764
+ content: {
2765
+ "application/json": components["schemas"]["Webhook"]
2766
+ }
2767
+ }
2768
+ 400: components["responses"]["BadRequest"]
2769
+ 401: components["responses"]["Unauthorized"]
2770
+ 403: components["responses"]["Forbidden"]
2771
+ 404: components["responses"]["NotFound"]
2772
+ default: components["responses"]["Internal"]
2773
+ }
2774
+ };
2775
+ getAgent: {
2776
+ parameters: {
2777
+ query?: never
2778
+ header?: never
2779
+ path: {
2780
+ agent_id: string
2781
+ }
2782
+ cookie?: never
2783
+ }
2784
+ requestBody?: never
2785
+ responses: {
2786
+ /** @description OK */
2787
+ 200: {
2788
+ headers: {
2789
+ [name: string]: unknown
2790
+ }
2791
+ content: {
2792
+ "application/json": components["schemas"]["Agent"]
2793
+ }
2794
+ }
2795
+ 401: components["responses"]["Unauthorized"]
2796
+ 403: components["responses"]["Forbidden"]
2797
+ 404: components["responses"]["NotFound"]
2798
+ default: components["responses"]["Internal"]
2799
+ }
2800
+ };
2801
+ deleteAgent: {
2802
+ parameters: {
2803
+ query?: never
2804
+ header?: never
2805
+ path: {
2806
+ agent_id: string
2807
+ }
2808
+ cookie?: never
2809
+ }
2810
+ requestBody?: never
2811
+ responses: {
2812
+ /** @description Agent deleted. */
2813
+ 204: {
2814
+ headers: {
2815
+ [name: string]: unknown
2816
+ }
2817
+ content?: never
2818
+ }
2819
+ 401: components["responses"]["Unauthorized"]
2820
+ 403: components["responses"]["Forbidden"]
2821
+ 404: components["responses"]["NotFound"]
2822
+ default: components["responses"]["Internal"]
2823
+ }
2824
+ };
2825
+ updateAgent: {
2826
+ parameters: {
2827
+ query?: never
2828
+ header?: never
2829
+ path: {
2830
+ agent_id: string
2831
+ }
2832
+ cookie?: never
2833
+ }
2834
+ requestBody: {
2835
+ content: {
2836
+ "application/json": components["schemas"]["AgentUpdateRequest"]
2837
+ }
2838
+ }
2839
+ responses: {
2840
+ /** @description Updated. */
2841
+ 200: {
2842
+ headers: {
2843
+ [name: string]: unknown
2844
+ }
2845
+ content: {
2846
+ "application/json": components["schemas"]["Agent"]
2847
+ }
2848
+ }
2849
+ 400: components["responses"]["BadRequest"]
2850
+ 401: components["responses"]["Unauthorized"]
2851
+ 403: components["responses"]["Forbidden"]
2852
+ 404: components["responses"]["NotFound"]
2853
+ default: components["responses"]["Internal"]
2854
+ }
2855
+ };
2856
+ updateAgentStatus: {
2857
+ parameters: {
2858
+ query?: never
2859
+ header?: never
2860
+ path: {
2861
+ agent_id: string
2862
+ }
2863
+ cookie?: never
2864
+ }
2865
+ requestBody: {
2866
+ content: {
2867
+ "application/json": components["schemas"]["AgentUpdateStatusRequest"]
2868
+ }
2869
+ }
2870
+ responses: {
2871
+ /** @description Status updated. */
2872
+ 200: {
2873
+ headers: {
2874
+ [name: string]: unknown
2875
+ }
2876
+ content: {
2877
+ "application/json": components["schemas"]["Agent"]
2878
+ }
2879
+ }
2880
+ 400: components["responses"]["BadRequest"]
2881
+ 401: components["responses"]["Unauthorized"]
2882
+ 403: components["responses"]["Forbidden"]
2883
+ 404: components["responses"]["NotFound"]
2884
+ default: components["responses"]["Internal"]
2885
+ }
2886
+ };
2887
+ createAgentDiagnostics: {
2888
+ parameters: {
2889
+ query?: never
2890
+ header?: never
2891
+ path: {
2892
+ agent_id: string
2893
+ }
2894
+ cookie?: never
2895
+ }
2896
+ requestBody: {
2897
+ content: {
2898
+ "application/json": components["schemas"]["AgentLintRequest"]
2899
+ }
2900
+ }
2901
+ responses: {
2902
+ /** @description Diagnostics complete. Empty `errors` array means valid. */
2903
+ 200: {
2904
+ headers: {
2905
+ [name: string]: unknown
2906
+ }
2907
+ content: {
2908
+ "application/json": components["schemas"]["AgentLintResponse"]
2909
+ }
2910
+ }
2911
+ 400: components["responses"]["BadRequest"]
2912
+ 401: components["responses"]["Unauthorized"]
2913
+ 403: components["responses"]["Forbidden"]
2914
+ 404: components["responses"]["NotFound"]
2915
+ default: components["responses"]["Internal"]
2916
+ }
2917
+ };
2918
+ listAgentConversations: {
2919
+ parameters: {
2920
+ query?: {
2921
+ limit?: number
2922
+ /** @description Cursor for pagination */
2923
+ cursor?: string
2924
+ }
2925
+ header?: never
2926
+ path: {
2927
+ agent_id: string
2928
+ }
2929
+ cookie?: never
2930
+ }
2931
+ requestBody?: never
2932
+ responses: {
2933
+ /** @description OK */
2934
+ 200: {
2935
+ headers: {
2936
+ [name: string]: unknown
2937
+ }
2938
+ content: {
2939
+ "application/json": components["schemas"]["ConversationListResponse"]
2940
+ }
2941
+ }
2942
+ 401: components["responses"]["Unauthorized"]
2943
+ 403: components["responses"]["Forbidden"]
2944
+ 404: components["responses"]["NotFound"]
2945
+ default: components["responses"]["Internal"]
2946
+ }
2947
+ };
2948
+ listAgentKnowledgeBases: {
2949
+ parameters: {
2950
+ query?: {
2951
+ limit?: number
2952
+ page?: number
2953
+ }
2954
+ header?: never
2955
+ path: {
2956
+ agent_id: string
2957
+ }
2958
+ cookie?: never
2959
+ }
2960
+ requestBody?: never
2961
+ responses: {
2962
+ /** @description OK */
2963
+ 200: {
2964
+ headers: {
2965
+ [name: string]: unknown
2966
+ }
2967
+ content: {
2968
+ "application/json": components["schemas"]["KnowledgeBaseListResponse"]
2969
+ }
2970
+ }
2971
+ 401: components["responses"]["Unauthorized"]
2972
+ 403: components["responses"]["Forbidden"]
2973
+ 404: components["responses"]["NotFound"]
2974
+ default: components["responses"]["Internal"]
2975
+ }
2976
+ };
2977
+ linkAgentKnowledgeBase: {
2978
+ parameters: {
2979
+ query?: never
2980
+ header?: never
2981
+ path: {
2982
+ agent_id: string
2983
+ knowledge_base_id: string
2984
+ }
2985
+ cookie?: never
2986
+ }
2987
+ requestBody?: never
2988
+ responses: {
2989
+ /** @description Linked. */
2990
+ 204: {
2991
+ headers: {
2992
+ [name: string]: unknown
2993
+ }
2994
+ content?: never
2995
+ }
2996
+ 401: components["responses"]["Unauthorized"]
2997
+ 403: components["responses"]["Forbidden"]
2998
+ 404: components["responses"]["NotFound"]
2999
+ default: components["responses"]["Internal"]
3000
+ }
3001
+ };
3002
+ unlinkAgentKnowledgeBase: {
3003
+ parameters: {
3004
+ query?: never
3005
+ header?: never
3006
+ path: {
3007
+ agent_id: string
3008
+ knowledge_base_id: string
3009
+ }
3010
+ cookie?: never
3011
+ }
3012
+ requestBody?: never
3013
+ responses: {
3014
+ /** @description Unlinked. */
3015
+ 204: {
3016
+ headers: {
3017
+ [name: string]: unknown
3018
+ }
3019
+ content?: never
3020
+ }
3021
+ 401: components["responses"]["Unauthorized"]
3022
+ 403: components["responses"]["Forbidden"]
3023
+ 404: components["responses"]["NotFound"]
3024
+ default: components["responses"]["Internal"]
3025
+ }
3026
+ };
3027
+ listAgentWebhooks: {
3028
+ parameters: {
3029
+ query?: {
3030
+ limit?: number
3031
+ page?: number
3032
+ }
3033
+ header?: never
3034
+ path: {
3035
+ agent_id: string
3036
+ }
3037
+ cookie?: never
3038
+ }
3039
+ requestBody?: never
3040
+ responses: {
3041
+ /** @description OK */
3042
+ 200: {
3043
+ headers: {
3044
+ [name: string]: unknown
3045
+ }
3046
+ content: {
3047
+ "application/json": components["schemas"]["WebhookListResponse"]
3048
+ }
3049
+ }
3050
+ 401: components["responses"]["Unauthorized"]
3051
+ 403: components["responses"]["Forbidden"]
3052
+ 404: components["responses"]["NotFound"]
3053
+ default: components["responses"]["Internal"]
3054
+ }
3055
+ };
3056
+ createAgentWebhook: {
3057
+ parameters: {
3058
+ query?: never
3059
+ header?: never
3060
+ path: {
3061
+ agent_id: string
3062
+ }
3063
+ cookie?: never
3064
+ }
3065
+ requestBody: {
3066
+ content: {
3067
+ "application/json": components["schemas"]["WebhookCreateRequest"]
3068
+ }
3069
+ }
3070
+ responses: {
3071
+ /** @description Webhook created. */
3072
+ 201: {
3073
+ headers: {
3074
+ [name: string]: unknown
3075
+ }
3076
+ content: {
3077
+ "application/json": components["schemas"]["Webhook"]
3078
+ }
3079
+ }
3080
+ 400: components["responses"]["BadRequest"]
3081
+ 401: components["responses"]["Unauthorized"]
3082
+ 403: components["responses"]["Forbidden"]
3083
+ 404: components["responses"]["NotFound"]
3084
+ default: components["responses"]["Internal"]
3085
+ }
3086
+ };
3087
+ getAgentWebhook: {
3088
+ parameters: {
3089
+ query?: never
3090
+ header?: never
3091
+ path: {
3092
+ agent_id: string
3093
+ webhook_id: string
3094
+ }
3095
+ cookie?: never
3096
+ }
3097
+ requestBody?: never
3098
+ responses: {
3099
+ /** @description OK */
3100
+ 200: {
3101
+ headers: {
3102
+ [name: string]: unknown
3103
+ }
3104
+ content: {
3105
+ "application/json": components["schemas"]["Webhook"]
3106
+ }
3107
+ }
3108
+ 401: components["responses"]["Unauthorized"]
3109
+ 403: components["responses"]["Forbidden"]
3110
+ 404: components["responses"]["NotFound"]
3111
+ default: components["responses"]["Internal"]
3112
+ }
3113
+ };
3114
+ deleteAgentWebhook: {
3115
+ parameters: {
3116
+ query?: never
3117
+ header?: never
3118
+ path: {
3119
+ agent_id: string
3120
+ webhook_id: string
3121
+ }
3122
+ cookie?: never
3123
+ }
3124
+ requestBody?: never
3125
+ responses: {
3126
+ /** @description Webhook deleted. */
3127
+ 204: {
3128
+ headers: {
3129
+ [name: string]: unknown
3130
+ }
3131
+ content?: never
3132
+ }
3133
+ 401: components["responses"]["Unauthorized"]
3134
+ 403: components["responses"]["Forbidden"]
3135
+ 404: components["responses"]["NotFound"]
3136
+ default: components["responses"]["Internal"]
3137
+ }
3138
+ };
3139
+ updateAgentWebhook: {
3140
+ parameters: {
3141
+ query?: never
3142
+ header?: never
3143
+ path: {
3144
+ agent_id: string
3145
+ webhook_id: string
3146
+ }
3147
+ cookie?: never
3148
+ }
3149
+ requestBody: {
3150
+ content: {
3151
+ "application/json": components["schemas"]["WebhookUpdateRequest"]
3152
+ }
3153
+ }
3154
+ responses: {
3155
+ /** @description Updated. */
3156
+ 200: {
3157
+ headers: {
3158
+ [name: string]: unknown
3159
+ }
3160
+ content: {
3161
+ "application/json": components["schemas"]["Webhook"]
3162
+ }
3163
+ }
3164
+ 400: components["responses"]["BadRequest"]
3165
+ 401: components["responses"]["Unauthorized"]
3166
+ 403: components["responses"]["Forbidden"]
3167
+ 404: components["responses"]["NotFound"]
3168
+ default: components["responses"]["Internal"]
3169
+ }
3170
+ };
3171
+ createConversation: {
3172
+ parameters: {
3173
+ query?: never
3174
+ header?: never
3175
+ path?: never
3176
+ cookie?: never
3177
+ }
3178
+ requestBody: {
3179
+ content: {
3180
+ "application/json": {
3181
+ /**
3182
+ * Format: uuid
3183
+ * @description The agent to converse with.
3184
+ */
3185
+ agent_id: string
3186
+ }
3187
+ }
3188
+ }
3189
+ responses: {
3190
+ /** @description Conversation created. */
3191
+ 201: {
3192
+ headers: {
3193
+ [name: string]: unknown
3194
+ }
3195
+ content: {
3196
+ "application/json": components["schemas"]["Conversation"]
3197
+ }
3198
+ }
3199
+ 400: components["responses"]["BadRequest"]
3200
+ 401: components["responses"]["Unauthorized"]
3201
+ 403: components["responses"]["Forbidden"]
3202
+ 404: components["responses"]["NotFound"]
3203
+ default: components["responses"]["Internal"]
3204
+ }
3205
+ };
3206
+ getConversation: {
3207
+ parameters: {
3208
+ query?: never
3209
+ header?: never
3210
+ path: {
3211
+ conversation_id: string
3212
+ }
3213
+ cookie?: never
3214
+ }
3215
+ requestBody?: never
3216
+ responses: {
3217
+ /** @description OK */
3218
+ 200: {
3219
+ headers: {
3220
+ [name: string]: unknown
3221
+ }
3222
+ content: {
3223
+ "application/json": components["schemas"]["Conversation"]
3224
+ }
3225
+ }
3226
+ 401: components["responses"]["Unauthorized"]
3227
+ 403: components["responses"]["Forbidden"]
3228
+ 404: components["responses"]["NotFound"]
3229
+ default: components["responses"]["Internal"]
3230
+ }
3231
+ };
3232
+ deleteConversation: {
3233
+ parameters: {
3234
+ query?: never
3235
+ header?: never
3236
+ path: {
3237
+ conversation_id: string
3238
+ }
3239
+ cookie?: never
3240
+ }
3241
+ requestBody?: never
3242
+ responses: {
3243
+ /** @description Conversation deleted. */
3244
+ 204: {
3245
+ headers: {
3246
+ [name: string]: unknown
3247
+ }
3248
+ content?: never
3249
+ }
3250
+ 401: components["responses"]["Unauthorized"]
3251
+ 403: components["responses"]["Forbidden"]
3252
+ 404: components["responses"]["NotFound"]
3253
+ default: components["responses"]["Internal"]
3254
+ }
3255
+ };
3256
+ listConversationMessages: {
3257
+ parameters: {
3258
+ query?: {
3259
+ limit?: number
3260
+ /** @description Cursor for pagination */
3261
+ cursor?: string
3262
+ }
3263
+ header?: never
3264
+ path: {
3265
+ conversation_id: string
3266
+ }
3267
+ cookie?: never
3268
+ }
3269
+ requestBody?: never
3270
+ responses: {
3271
+ /** @description OK */
3272
+ 200: {
3273
+ headers: {
3274
+ [name: string]: unknown
3275
+ }
3276
+ content: {
3277
+ "application/json": components["schemas"]["ConversationMessageListResponse"]
3278
+ }
3279
+ }
3280
+ 401: components["responses"]["Unauthorized"]
3281
+ 403: components["responses"]["Forbidden"]
3282
+ 404: components["responses"]["NotFound"]
3283
+ default: components["responses"]["Internal"]
3284
+ }
3285
+ };
3286
+ createConversationMessage: {
3287
+ parameters: {
3288
+ query?: never
3289
+ header?: never
3290
+ path: {
3291
+ conversation_id: string
3292
+ }
3293
+ cookie?: never
3294
+ }
3295
+ requestBody: {
3296
+ content: {
3297
+ "application/json": {
3298
+ /** @description The user's message text. */
3299
+ content: string
3300
+ }
3301
+ }
3302
+ }
3303
+ responses: {
3304
+ /** @description SSE stream of events. */
3305
+ 200: {
3306
+ headers: {
3307
+ [name: string]: unknown
3308
+ }
3309
+ content: {
3310
+ "text/event-stream": string
3311
+ }
3312
+ }
3313
+ 400: components["responses"]["BadRequest"]
3314
+ 401: components["responses"]["Unauthorized"]
3315
+ 403: components["responses"]["Forbidden"]
3316
+ 404: components["responses"]["NotFound"]
3317
+ default: components["responses"]["Internal"]
3318
+ }
3319
+ };
3320
+ streamConversation: {
3321
+ parameters: {
3322
+ query: {
3323
+ /** @description Must be "voice" for WebSocket upgrade. */
3324
+ medium: "voice"
3325
+ }
3326
+ header?: never
3327
+ path: {
3328
+ conversation_id: string
3329
+ }
3330
+ cookie?: never
3331
+ }
3332
+ requestBody?: never
3333
+ responses: {
3334
+ /** @description WebSocket upgrade successful. */
3335
+ 101: {
3336
+ headers: {
3337
+ [name: string]: unknown
3338
+ }
3339
+ content?: never
3340
+ }
3341
+ /** @description Missing or invalid medium parameter. */
3342
+ 400: {
3343
+ headers: {
3344
+ [name: string]: unknown
3345
+ }
3346
+ content?: never
3347
+ }
3348
+ 401: components["responses"]["Unauthorized"]
3349
+ 403: components["responses"]["Forbidden"]
3350
+ 404: components["responses"]["NotFound"]
3351
+ default: components["responses"]["Internal"]
3352
+ }
3353
+ };
3354
+ getKnowledgeBase: {
3355
+ parameters: {
3356
+ query?: never
3357
+ header?: never
3358
+ path: {
3359
+ knowledge_base_id: string
3360
+ }
3361
+ cookie?: never
3362
+ }
3363
+ requestBody?: never
3364
+ responses: {
3365
+ /** @description OK */
3366
+ 200: {
3367
+ headers: {
3368
+ [name: string]: unknown
3369
+ }
3370
+ content: {
3371
+ "application/json": components["schemas"]["KnowledgeBase"]
3372
+ }
3373
+ }
3374
+ 401: components["responses"]["Unauthorized"]
3375
+ 403: components["responses"]["Forbidden"]
3376
+ 404: components["responses"]["NotFound"]
3377
+ default: components["responses"]["Internal"]
3378
+ }
3379
+ };
3380
+ deleteKnowledgeBase: {
3381
+ parameters: {
3382
+ query?: never
3383
+ header?: never
3384
+ path: {
3385
+ knowledge_base_id: string
3386
+ }
3387
+ cookie?: never
3388
+ }
3389
+ requestBody?: never
3390
+ responses: {
3391
+ /** @description Knowledge base deleted. */
3392
+ 204: {
3393
+ headers: {
3394
+ [name: string]: unknown
3395
+ }
3396
+ content?: never
3397
+ }
3398
+ 401: components["responses"]["Unauthorized"]
3399
+ 403: components["responses"]["Forbidden"]
3400
+ 404: components["responses"]["NotFound"]
3401
+ default: components["responses"]["Internal"]
3402
+ }
3403
+ };
3404
+ updateKnowledgeBase: {
3405
+ parameters: {
3406
+ query?: never
3407
+ header?: never
3408
+ path: {
3409
+ knowledge_base_id: string
3410
+ }
3411
+ cookie?: never
3412
+ }
3413
+ requestBody: {
3414
+ content: {
3415
+ "application/json": components["schemas"]["KnowledgeBaseUpdateRequest"]
3416
+ }
3417
+ }
3418
+ responses: {
3419
+ /** @description Updated. */
3420
+ 200: {
3421
+ headers: {
3422
+ [name: string]: unknown
3423
+ }
3424
+ content: {
3425
+ "application/json": components["schemas"]["KnowledgeBase"]
3426
+ }
3427
+ }
3428
+ 400: components["responses"]["BadRequest"]
3429
+ 401: components["responses"]["Unauthorized"]
3430
+ 403: components["responses"]["Forbidden"]
3431
+ 404: components["responses"]["NotFound"]
3432
+ default: components["responses"]["Internal"]
3433
+ }
3434
+ };
3435
+ listKnowledgeBaseDocuments: {
3436
+ parameters: {
3437
+ query?: {
3438
+ limit?: number
3439
+ page?: number
3440
+ }
3441
+ header?: never
3442
+ path: {
3443
+ knowledge_base_id: string
3444
+ }
3445
+ cookie?: never
3446
+ }
3447
+ requestBody?: never
3448
+ responses: {
3449
+ /** @description OK */
3450
+ 200: {
3451
+ headers: {
3452
+ [name: string]: unknown
3453
+ }
3454
+ content: {
3455
+ "application/json": components["schemas"]["KnowledgeBaseDocumentListResponse"]
3456
+ }
3457
+ }
3458
+ 401: components["responses"]["Unauthorized"]
3459
+ 403: components["responses"]["Forbidden"]
3460
+ 404: components["responses"]["NotFound"]
3461
+ default: components["responses"]["Internal"]
3462
+ }
3463
+ };
3464
+ createKnowledgeBaseDocument: {
3465
+ parameters: {
3466
+ query?: never
3467
+ header?: never
3468
+ path: {
3469
+ knowledge_base_id: string
3470
+ }
3471
+ cookie?: never
3472
+ }
3473
+ requestBody: {
3474
+ content: {
3475
+ "application/json": components["schemas"]["KnowledgeBaseDocumentCreateFromURLRequest"] | components["schemas"]["KnowledgeBaseDocumentCreateFromTextRequest"]
3476
+ "multipart/form-data": components["schemas"]["KnowledgeBaseDocumentCreateFromFileRequest"]
3477
+ }
3478
+ }
3479
+ responses: {
3480
+ /** @description Document created and queued for ingestion. */
3481
+ 201: {
3482
+ headers: {
3483
+ [name: string]: unknown
3484
+ }
3485
+ content: {
3486
+ "application/json": components["schemas"]["KnowledgeBaseDocument"]
3487
+ }
3488
+ }
3489
+ 400: components["responses"]["BadRequest"]
3490
+ 401: components["responses"]["Unauthorized"]
3491
+ 403: components["responses"]["Forbidden"]
3492
+ 404: components["responses"]["NotFound"]
3493
+ default: components["responses"]["Internal"]
3494
+ }
3495
+ };
3496
+ getKnowledgeBaseDocument: {
3497
+ parameters: {
3498
+ query?: never
3499
+ header?: never
3500
+ path: {
3501
+ knowledge_base_id: string
3502
+ document_id: string
3503
+ }
3504
+ cookie?: never
3505
+ }
3506
+ requestBody?: never
3507
+ responses: {
3508
+ /** @description OK */
3509
+ 200: {
3510
+ headers: {
3511
+ [name: string]: unknown
3512
+ }
3513
+ content: {
3514
+ "application/json": components["schemas"]["KnowledgeBaseDocument"]
3515
+ }
3516
+ }
3517
+ 401: components["responses"]["Unauthorized"]
3518
+ 403: components["responses"]["Forbidden"]
3519
+ 404: components["responses"]["NotFound"]
3520
+ default: components["responses"]["Internal"]
3521
+ }
3522
+ };
3523
+ deleteKnowledgeBaseDocument: {
3524
+ parameters: {
3525
+ query?: never
3526
+ header?: never
3527
+ path: {
3528
+ knowledge_base_id: string
3529
+ document_id: string
3530
+ }
3531
+ cookie?: never
3532
+ }
3533
+ requestBody?: never
3534
+ responses: {
3535
+ /** @description Document deleted. */
3536
+ 204: {
3537
+ headers: {
3538
+ [name: string]: unknown
3539
+ }
3540
+ content?: never
3541
+ }
3542
+ 401: components["responses"]["Unauthorized"]
3543
+ 403: components["responses"]["Forbidden"]
3544
+ 404: components["responses"]["NotFound"]
3545
+ default: components["responses"]["Internal"]
3546
+ }
3547
+ };
3548
+ queryKnowledgeBase: {
3549
+ parameters: {
3550
+ query?: never
3551
+ header?: never
3552
+ path: {
3553
+ knowledge_base_id: string
3554
+ }
3555
+ cookie?: never
3556
+ }
3557
+ requestBody: {
3558
+ content: {
3559
+ "application/json": components["schemas"]["KnowledgeBaseQueryRequest"]
3560
+ }
3561
+ }
3562
+ responses: {
3563
+ /** @description Query results ordered by relevance score. */
3564
+ 200: {
3565
+ headers: {
3566
+ [name: string]: unknown
3567
+ }
3568
+ content: {
3569
+ "application/json": components["schemas"]["KnowledgeBaseQueryResponse"]
3570
+ }
3571
+ }
3572
+ 400: components["responses"]["BadRequest"]
3573
+ 401: components["responses"]["Unauthorized"]
3574
+ 403: components["responses"]["Forbidden"]
3575
+ 404: components["responses"]["NotFound"]
3576
+ default: components["responses"]["Internal"]
3577
+ }
3578
+ };
228
3579
  }
229
3580
  /**
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
3581
+ * Extract a schema type from `components.schemas` by key.
429
3582
  *
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.
3583
+ * @typeParam T - Schema name
437
3584
  */
438
- declare class ConversationTransportError extends Error {
439
- readonly code: string;
440
- constructor(message: string, code?: string);
441
- }
3585
+ type ApiSchema<T extends keyof components["schemas"]> = components["schemas"][T];
442
3586
  /**
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.
3587
+ * Extract the JSON request body type for an operation.
3588
+ *
3589
+ * Returns `never` if no JSON body is defined.
3590
+ *
3591
+ * @typeParam T - Operation name
578
3592
  */
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
- };
3593
+ type ApiRequest<T extends keyof operations> = operations[T] extends {
3594
+ requestBody?: {
3595
+ content: {
3596
+ "application/json": infer Body
3597
+ }
3598
+ }
3599
+ } ? Body : never;
588
3600
  /**
589
- * Client for managing conversations and establishing sessions.
590
- *
591
- * @example
592
- * ```ts
593
- * // List past conversations
594
- * const conversations = await kivox.conversations.list();
3601
+ * Extract the JSON response type for an operation.
595
3602
  *
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
- * });
3603
+ * Supports `200` and `201` responses. Returns `never` if neither exists.
610
3604
  *
611
- * session.sendText('Hello!');
612
- * ```
3605
+ * @typeParam T - Operation name
613
3606
  */
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
- };
3607
+ type ApiResponse<T extends keyof operations> = operations[T] extends {
3608
+ responses: {
3609
+ 200: {
3610
+ content: {
3611
+ "application/json": infer Res
3612
+ }
3613
+ }
3614
+ }
3615
+ } ? Res : operations[T] extends {
3616
+ responses: {
3617
+ 201: {
3618
+ content: {
3619
+ "application/json": infer Res
3620
+ }
3621
+ }
3622
+ }
3623
+ } ? Res : never;
649
3624
  /**
650
- * Configuration for listing messages.
3625
+ * All event types emitted by the backend `runtime` package runtime.
651
3626
  */
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
3627
+ type SSEEvent = {
3628
+ event: "assistant_tool_calls"
3629
+ data: {
3630
+ tool_calls: {
3631
+ id: string
3632
+ name: string
3633
+ arguments: Record<string, unknown>
3634
+ }[]
3635
+ }
3636
+ } | {
3637
+ event: "tool_call_start"
3638
+ data: {
3639
+ name: string
3640
+ tool_call_id: string
3641
+ arguments?: Record<string, unknown>
3642
+ }
3643
+ } | {
3644
+ event: "tool_call_end"
3645
+ data: {
3646
+ name: string
3647
+ tool_call_id: string
3648
+ result?: Record<string, unknown>
3649
+ error?: string
3650
+ }
3651
+ } | {
3652
+ event: "node_start"
3653
+ data: {
3654
+ node_id: string
3655
+ }
3656
+ } | {
3657
+ event: "node_end"
3658
+ data: {
3659
+ node_id: string
3660
+ }
3661
+ } | {
3662
+ event: "message_chunk"
3663
+ data: {
3664
+ chunk: string
3665
+ }
3666
+ } | {
3667
+ event: "message_static"
3668
+ data: {
3669
+ content: string
3670
+ }
3671
+ } | {
3672
+ event: "message_complete"
3673
+ data: {
3674
+ content?: string
3675
+ outcome?: string
3676
+ vars?: Record<string, unknown>
3677
+ }
3678
+ } | {
3679
+ event: "error"
3680
+ data: {
3681
+ message: string
3682
+ }
659
3683
  };
660
3684
  /**
661
- * Client for interacting with conversation messages.
3685
+ * Parses a `ReadableStream<Uint8Array>` as a Server-Sent Events stream,
3686
+ * yielding one {@link SSEEvent} per `event/data` block.
662
3687
  *
663
- * @example
664
- * ```ts
665
- * const messages = await kivox.messages.list({
666
- * conversationId: 'conv-123'
667
- * });
668
- * ```
3688
+ * Compatible with any SSE response body; pass `response.body` directly.
3689
+ *
3690
+ * @yields {SSEEvent}
669
3691
  */
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
3692
+ declare function readSSE(stream: ReadableStream<Uint8Array>): AsyncGenerator<SSEEvent>;
3693
+ type KivoxFetchClient = ReturnType<typeof createClient<paths>>;
3694
+ type KivoxClient = {
3695
+ api: KivoxFetchClient
695
3696
  };
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
3697
+ type CommonClientOptions = {
3698
+ baseUrl?: string
3699
+ version?: "v1"
3700
+ headers?: Record<string, string>
3701
+ };
3702
+ type SessionClientOptions = CommonClientOptions;
3703
+ type BearerClientOptions = CommonClientOptions & {
3704
+ bearerToken: string
706
3705
  };
707
3706
  /**
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.
3707
+ * Browser/Studio client. Authenticates via HttpOnly session cookie.
757
3708
  */
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
- };
3709
+ declare function createSessionClient(options?: SessionClientOptions): KivoxClient;
771
3710
  /**
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
- * ```
3711
+ * Server-side / programmatic client. Authenticates via Bearer token.
794
3712
  */
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 };
3713
+ declare function createBearerClient(options: BearerClientOptions): KivoxClient;
3714
+ export { readSSE, paths, operations, createSessionClient, createBearerClient, components, SessionClientOptions, SSEEvent, KivoxFetchClient, KivoxClient, CommonClientOptions, BearerClientOptions, ApiSchema, ApiResponse, ApiRequest };