@convex-dev/agent 0.1.5-alpha.3 → 0.1.5

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.
Files changed (37) hide show
  1. package/README.md +1 -0
  2. package/dist/commonjs/client/index.d.ts +22 -2
  3. package/dist/commonjs/client/index.d.ts.map +1 -1
  4. package/dist/commonjs/client/index.js +47 -2
  5. package/dist/commonjs/client/index.js.map +1 -1
  6. package/dist/commonjs/client/types.d.ts +13 -5
  7. package/dist/commonjs/client/types.d.ts.map +1 -1
  8. package/dist/commonjs/component/_generated/api.d.ts +2327 -4
  9. package/dist/commonjs/component/_generated/dataModel.d.ts +60 -0
  10. package/dist/commonjs/component/_generated/server.d.ts +97 -12
  11. package/dist/commonjs/react/types.d.ts +3 -3
  12. package/dist/commonjs/react/types.d.ts.map +1 -1
  13. package/dist/commonjs/react/useSmoothText.d.ts.map +1 -1
  14. package/dist/commonjs/react/useSmoothText.js +1 -0
  15. package/dist/commonjs/react/useSmoothText.js.map +1 -1
  16. package/dist/commonjs.tsbuildinfo +1 -1
  17. package/dist/esm/client/index.d.ts +22 -2
  18. package/dist/esm/client/index.d.ts.map +1 -1
  19. package/dist/esm/client/index.js +47 -2
  20. package/dist/esm/client/index.js.map +1 -1
  21. package/dist/esm/client/types.d.ts +13 -5
  22. package/dist/esm/client/types.d.ts.map +1 -1
  23. package/dist/esm/component/_generated/api.d.ts +2327 -4
  24. package/dist/esm/component/_generated/dataModel.d.ts +60 -0
  25. package/dist/esm/component/_generated/server.d.ts +97 -12
  26. package/dist/esm/react/types.d.ts +3 -3
  27. package/dist/esm/react/types.d.ts.map +1 -1
  28. package/dist/esm/react/useSmoothText.d.ts.map +1 -1
  29. package/dist/esm/react/useSmoothText.js +1 -0
  30. package/dist/esm/react/useSmoothText.js.map +1 -1
  31. package/dist/esm.tsbuildinfo +1 -1
  32. package/package.json +10 -7
  33. package/src/client/index.ts +64 -4
  34. package/src/client/types.ts +19 -9
  35. package/src/component/_generated/api.d.ts +22 -0
  36. package/src/react/types.ts +3 -3
  37. package/src/react/useSmoothText.ts +4 -0
@@ -1,3 +1,28 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated `api` utility.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import type * as apiKeys from "../apiKeys.js";
12
+ import type * as files from "../files.js";
13
+ import type * as messages from "../messages.js";
14
+ import type * as streams from "../streams.js";
15
+ import type * as threads from "../threads.js";
16
+ import type * as users from "../users.js";
17
+ import type * as vector_index from "../vector/index.js";
18
+ import type * as vector_tables from "../vector/tables.js";
19
+
20
+ import type {
21
+ ApiFromModules,
22
+ FilterApi,
23
+ FunctionReference,
24
+ } from "convex/server";
25
+
1
26
  /**
2
27
  * A utility for referencing Convex functions in your app's API.
3
28
  *
@@ -6,7 +31,2305 @@
6
31
  * const myFunctionReference = api.myModule.myFunction;
7
32
  * ```
8
33
  */
9
- export const api: import("convex/server").AnyApi;
10
- export const internal: import("convex/server").AnyApi;
11
- export const components: import("convex/server").AnyChildComponents;
12
- //# sourceMappingURL=api.d.ts.map
34
+ declare const fullApi: ApiFromModules<{
35
+ apiKeys: typeof apiKeys;
36
+ files: typeof files;
37
+ messages: typeof messages;
38
+ streams: typeof streams;
39
+ threads: typeof threads;
40
+ users: typeof users;
41
+ "vector/index": typeof vector_index;
42
+ "vector/tables": typeof vector_tables;
43
+ }>;
44
+ export type Mounts = {
45
+ apiKeys: {
46
+ destroy: FunctionReference<
47
+ "mutation",
48
+ "public",
49
+ { apiKey?: string; name?: string },
50
+ | "missing"
51
+ | "deleted"
52
+ | "name mismatch"
53
+ | "must provide either apiKey or name"
54
+ >;
55
+ issue: FunctionReference<"mutation", "public", { name?: string }, string>;
56
+ validate: FunctionReference<"query", "public", { apiKey: string }, boolean>;
57
+ };
58
+ files: {
59
+ addFile: FunctionReference<
60
+ "mutation",
61
+ "public",
62
+ { hash: string; storageId: string },
63
+ { fileId: string; storageIdUnused: boolean }
64
+ >;
65
+ copyFile: FunctionReference<"mutation", "public", { fileId: string }, null>;
66
+ getFilesToDelete: FunctionReference<
67
+ "query",
68
+ "public",
69
+ { cursor?: string; limit?: number },
70
+ {
71
+ continueCursor: string;
72
+ files: Array<{
73
+ _creationTime: number;
74
+ _id: string;
75
+ hash: string;
76
+ refcount: number;
77
+ storageId: string;
78
+ }>;
79
+ isDone: boolean;
80
+ }
81
+ >;
82
+ useExistingFile: FunctionReference<
83
+ "mutation",
84
+ "public",
85
+ { hash: string },
86
+ string | null
87
+ >;
88
+ };
89
+ messages: {
90
+ addMessages: FunctionReference<
91
+ "mutation",
92
+ "public",
93
+ {
94
+ agentName?: string;
95
+ embeddings?: {
96
+ dimension:
97
+ | 128
98
+ | 256
99
+ | 512
100
+ | 768
101
+ | 1024
102
+ | 1408
103
+ | 1536
104
+ | 2048
105
+ | 3072
106
+ | 4096;
107
+ model: string;
108
+ vectors: Array<Array<number> | null>;
109
+ };
110
+ failPendingSteps?: boolean;
111
+ messages: Array<{
112
+ error?: string;
113
+ files?: Array<{
114
+ data?: ArrayBuffer | string;
115
+ fileId?: string;
116
+ mimeType: string;
117
+ url?: string;
118
+ }>;
119
+ finishReason?:
120
+ | "stop"
121
+ | "length"
122
+ | "content-filter"
123
+ | "tool-calls"
124
+ | "error"
125
+ | "other"
126
+ | "unknown";
127
+ id?: string;
128
+ message:
129
+ | {
130
+ content:
131
+ | string
132
+ | Array<
133
+ | {
134
+ providerOptions?: Record<string, Record<string, any>>;
135
+ text: string;
136
+ type: "text";
137
+ }
138
+ | {
139
+ image: string | ArrayBuffer;
140
+ mimeType?: string;
141
+ providerOptions?: Record<string, Record<string, any>>;
142
+ type: "image";
143
+ }
144
+ | {
145
+ data: string | ArrayBuffer;
146
+ filename?: string;
147
+ mimeType: string;
148
+ providerOptions?: Record<string, Record<string, any>>;
149
+ type: "file";
150
+ }
151
+ >;
152
+ providerOptions?: Record<string, Record<string, any>>;
153
+ role: "user";
154
+ }
155
+ | {
156
+ content:
157
+ | string
158
+ | Array<
159
+ | {
160
+ providerOptions?: Record<string, Record<string, any>>;
161
+ text: string;
162
+ type: "text";
163
+ }
164
+ | {
165
+ data: string | ArrayBuffer;
166
+ filename?: string;
167
+ mimeType: string;
168
+ providerOptions?: Record<string, Record<string, any>>;
169
+ type: "file";
170
+ }
171
+ | {
172
+ providerOptions?: Record<string, Record<string, any>>;
173
+ signature?: string;
174
+ text: string;
175
+ type: "reasoning";
176
+ }
177
+ | {
178
+ data: string;
179
+ providerOptions?: Record<string, Record<string, any>>;
180
+ type: "redacted-reasoning";
181
+ }
182
+ | {
183
+ args: any;
184
+ providerOptions?: Record<string, Record<string, any>>;
185
+ toolCallId: string;
186
+ toolName: string;
187
+ type: "tool-call";
188
+ }
189
+ >;
190
+ providerOptions?: Record<string, Record<string, any>>;
191
+ role: "assistant";
192
+ }
193
+ | {
194
+ content: Array<{
195
+ args?: any;
196
+ experimental_content?: Array<
197
+ | { text: string; type: "text" }
198
+ | { data: string; mimeType?: string; type: "image" }
199
+ >;
200
+ isError?: boolean;
201
+ providerOptions?: Record<string, Record<string, any>>;
202
+ result: any;
203
+ toolCallId: string;
204
+ toolName: string;
205
+ type: "tool-result";
206
+ }>;
207
+ providerOptions?: Record<string, Record<string, any>>;
208
+ role: "tool";
209
+ }
210
+ | {
211
+ content: string;
212
+ providerOptions?: Record<string, Record<string, any>>;
213
+ role: "system";
214
+ };
215
+ model?: string;
216
+ provider?: string;
217
+ providerMetadata?: Record<string, Record<string, any>>;
218
+ reasoning?: string;
219
+ reasoningDetails?: Array<
220
+ | { signature?: string; text: string; type: "text" }
221
+ | { data: string; type: "redacted" }
222
+ >;
223
+ sources?: Array<{
224
+ id: string;
225
+ providerOptions?: Record<string, Record<string, any>>;
226
+ sourceType: "url";
227
+ title?: string;
228
+ url: string;
229
+ }>;
230
+ text?: string;
231
+ usage?: {
232
+ completionTokens: number;
233
+ promptTokens: number;
234
+ totalTokens: number;
235
+ };
236
+ warnings?: Array<
237
+ | { details?: string; setting: string; type: "unsupported-setting" }
238
+ | { details?: string; tool: any; type: "unsupported-tool" }
239
+ | { message: string; type: "other" }
240
+ >;
241
+ }>;
242
+ pending?: boolean;
243
+ promptMessageId?: string;
244
+ stepId?: string;
245
+ threadId: string;
246
+ userId?: string;
247
+ },
248
+ {
249
+ messages: Array<{
250
+ _creationTime: number;
251
+ _id: string;
252
+ agentName?: string;
253
+ embeddingId?: string;
254
+ error?: string;
255
+ files?: Array<{
256
+ data?: ArrayBuffer | string;
257
+ fileId?: string;
258
+ mimeType: string;
259
+ url?: string;
260
+ }>;
261
+ finishReason?:
262
+ | "stop"
263
+ | "length"
264
+ | "content-filter"
265
+ | "tool-calls"
266
+ | "error"
267
+ | "other"
268
+ | "unknown";
269
+ id?: string;
270
+ message?:
271
+ | {
272
+ content:
273
+ | string
274
+ | Array<
275
+ | {
276
+ providerOptions?: Record<string, Record<string, any>>;
277
+ text: string;
278
+ type: "text";
279
+ }
280
+ | {
281
+ image: string | ArrayBuffer;
282
+ mimeType?: string;
283
+ providerOptions?: Record<string, Record<string, any>>;
284
+ type: "image";
285
+ }
286
+ | {
287
+ data: string | ArrayBuffer;
288
+ filename?: string;
289
+ mimeType: string;
290
+ providerOptions?: Record<string, Record<string, any>>;
291
+ type: "file";
292
+ }
293
+ >;
294
+ providerOptions?: Record<string, Record<string, any>>;
295
+ role: "user";
296
+ }
297
+ | {
298
+ content:
299
+ | string
300
+ | Array<
301
+ | {
302
+ providerOptions?: Record<string, Record<string, any>>;
303
+ text: string;
304
+ type: "text";
305
+ }
306
+ | {
307
+ data: string | ArrayBuffer;
308
+ filename?: string;
309
+ mimeType: string;
310
+ providerOptions?: Record<string, Record<string, any>>;
311
+ type: "file";
312
+ }
313
+ | {
314
+ providerOptions?: Record<string, Record<string, any>>;
315
+ signature?: string;
316
+ text: string;
317
+ type: "reasoning";
318
+ }
319
+ | {
320
+ data: string;
321
+ providerOptions?: Record<string, Record<string, any>>;
322
+ type: "redacted-reasoning";
323
+ }
324
+ | {
325
+ args: any;
326
+ providerOptions?: Record<string, Record<string, any>>;
327
+ toolCallId: string;
328
+ toolName: string;
329
+ type: "tool-call";
330
+ }
331
+ >;
332
+ providerOptions?: Record<string, Record<string, any>>;
333
+ role: "assistant";
334
+ }
335
+ | {
336
+ content: Array<{
337
+ args?: any;
338
+ experimental_content?: Array<
339
+ | { text: string; type: "text" }
340
+ | { data: string; mimeType?: string; type: "image" }
341
+ >;
342
+ isError?: boolean;
343
+ providerOptions?: Record<string, Record<string, any>>;
344
+ result: any;
345
+ toolCallId: string;
346
+ toolName: string;
347
+ type: "tool-result";
348
+ }>;
349
+ providerOptions?: Record<string, Record<string, any>>;
350
+ role: "tool";
351
+ }
352
+ | {
353
+ content: string;
354
+ providerOptions?: Record<string, Record<string, any>>;
355
+ role: "system";
356
+ };
357
+ model?: string;
358
+ order: number;
359
+ provider?: string;
360
+ providerMetadata?: Record<string, Record<string, any>>;
361
+ providerOptions?: Record<string, Record<string, any>>;
362
+ reasoning?: string;
363
+ reasoningDetails?: Array<
364
+ | { signature?: string; text: string; type: "text" }
365
+ | { data: string; type: "redacted" }
366
+ >;
367
+ sources?: Array<{
368
+ id: string;
369
+ providerOptions?: Record<string, Record<string, any>>;
370
+ sourceType: "url";
371
+ title?: string;
372
+ url: string;
373
+ }>;
374
+ status: "pending" | "success" | "failed";
375
+ stepOrder: number;
376
+ text?: string;
377
+ threadId: string;
378
+ tool: boolean;
379
+ usage?: {
380
+ completionTokens: number;
381
+ promptTokens: number;
382
+ totalTokens: number;
383
+ };
384
+ userId?: string;
385
+ warnings?: Array<
386
+ | { details?: string; setting: string; type: "unsupported-setting" }
387
+ | { details?: string; tool: any; type: "unsupported-tool" }
388
+ | { message: string; type: "other" }
389
+ >;
390
+ }>;
391
+ pending?: {
392
+ _creationTime: number;
393
+ _id: string;
394
+ agentName?: string;
395
+ embeddingId?: string;
396
+ error?: string;
397
+ files?: Array<{
398
+ data?: ArrayBuffer | string;
399
+ fileId?: string;
400
+ mimeType: string;
401
+ url?: string;
402
+ }>;
403
+ finishReason?:
404
+ | "stop"
405
+ | "length"
406
+ | "content-filter"
407
+ | "tool-calls"
408
+ | "error"
409
+ | "other"
410
+ | "unknown";
411
+ id?: string;
412
+ message?:
413
+ | {
414
+ content:
415
+ | string
416
+ | Array<
417
+ | {
418
+ providerOptions?: Record<string, Record<string, any>>;
419
+ text: string;
420
+ type: "text";
421
+ }
422
+ | {
423
+ image: string | ArrayBuffer;
424
+ mimeType?: string;
425
+ providerOptions?: Record<string, Record<string, any>>;
426
+ type: "image";
427
+ }
428
+ | {
429
+ data: string | ArrayBuffer;
430
+ filename?: string;
431
+ mimeType: string;
432
+ providerOptions?: Record<string, Record<string, any>>;
433
+ type: "file";
434
+ }
435
+ >;
436
+ providerOptions?: Record<string, Record<string, any>>;
437
+ role: "user";
438
+ }
439
+ | {
440
+ content:
441
+ | string
442
+ | Array<
443
+ | {
444
+ providerOptions?: Record<string, Record<string, any>>;
445
+ text: string;
446
+ type: "text";
447
+ }
448
+ | {
449
+ data: string | ArrayBuffer;
450
+ filename?: string;
451
+ mimeType: string;
452
+ providerOptions?: Record<string, Record<string, any>>;
453
+ type: "file";
454
+ }
455
+ | {
456
+ providerOptions?: Record<string, Record<string, any>>;
457
+ signature?: string;
458
+ text: string;
459
+ type: "reasoning";
460
+ }
461
+ | {
462
+ data: string;
463
+ providerOptions?: Record<string, Record<string, any>>;
464
+ type: "redacted-reasoning";
465
+ }
466
+ | {
467
+ args: any;
468
+ providerOptions?: Record<string, Record<string, any>>;
469
+ toolCallId: string;
470
+ toolName: string;
471
+ type: "tool-call";
472
+ }
473
+ >;
474
+ providerOptions?: Record<string, Record<string, any>>;
475
+ role: "assistant";
476
+ }
477
+ | {
478
+ content: Array<{
479
+ args?: any;
480
+ experimental_content?: Array<
481
+ | { text: string; type: "text" }
482
+ | { data: string; mimeType?: string; type: "image" }
483
+ >;
484
+ isError?: boolean;
485
+ providerOptions?: Record<string, Record<string, any>>;
486
+ result: any;
487
+ toolCallId: string;
488
+ toolName: string;
489
+ type: "tool-result";
490
+ }>;
491
+ providerOptions?: Record<string, Record<string, any>>;
492
+ role: "tool";
493
+ }
494
+ | {
495
+ content: string;
496
+ providerOptions?: Record<string, Record<string, any>>;
497
+ role: "system";
498
+ };
499
+ model?: string;
500
+ order: number;
501
+ provider?: string;
502
+ providerMetadata?: Record<string, Record<string, any>>;
503
+ providerOptions?: Record<string, Record<string, any>>;
504
+ reasoning?: string;
505
+ reasoningDetails?: Array<
506
+ | { signature?: string; text: string; type: "text" }
507
+ | { data: string; type: "redacted" }
508
+ >;
509
+ sources?: Array<{
510
+ id: string;
511
+ providerOptions?: Record<string, Record<string, any>>;
512
+ sourceType: "url";
513
+ title?: string;
514
+ url: string;
515
+ }>;
516
+ status: "pending" | "success" | "failed";
517
+ stepOrder: number;
518
+ text?: string;
519
+ threadId: string;
520
+ tool: boolean;
521
+ usage?: {
522
+ completionTokens: number;
523
+ promptTokens: number;
524
+ totalTokens: number;
525
+ };
526
+ userId?: string;
527
+ warnings?: Array<
528
+ | { details?: string; setting: string; type: "unsupported-setting" }
529
+ | { details?: string; tool: any; type: "unsupported-tool" }
530
+ | { message: string; type: "other" }
531
+ >;
532
+ };
533
+ }
534
+ >;
535
+ addStep: FunctionReference<
536
+ "mutation",
537
+ "public",
538
+ {
539
+ failPendingSteps?: boolean;
540
+ promptMessageId: string;
541
+ step: {
542
+ embeddings?: {
543
+ dimension:
544
+ | 128
545
+ | 256
546
+ | 512
547
+ | 768
548
+ | 1024
549
+ | 1408
550
+ | 1536
551
+ | 2048
552
+ | 3072
553
+ | 4096;
554
+ model: string;
555
+ vectors: Array<Array<number> | null>;
556
+ };
557
+ messages: Array<{
558
+ error?: string;
559
+ files?: Array<{
560
+ data?: ArrayBuffer | string;
561
+ fileId?: string;
562
+ mimeType: string;
563
+ url?: string;
564
+ }>;
565
+ finishReason?:
566
+ | "stop"
567
+ | "length"
568
+ | "content-filter"
569
+ | "tool-calls"
570
+ | "error"
571
+ | "other"
572
+ | "unknown";
573
+ id?: string;
574
+ message:
575
+ | {
576
+ content:
577
+ | string
578
+ | Array<
579
+ | {
580
+ providerOptions?: Record<
581
+ string,
582
+ Record<string, any>
583
+ >;
584
+ text: string;
585
+ type: "text";
586
+ }
587
+ | {
588
+ image: string | ArrayBuffer;
589
+ mimeType?: string;
590
+ providerOptions?: Record<
591
+ string,
592
+ Record<string, any>
593
+ >;
594
+ type: "image";
595
+ }
596
+ | {
597
+ data: string | ArrayBuffer;
598
+ filename?: string;
599
+ mimeType: string;
600
+ providerOptions?: Record<
601
+ string,
602
+ Record<string, any>
603
+ >;
604
+ type: "file";
605
+ }
606
+ >;
607
+ providerOptions?: Record<string, Record<string, any>>;
608
+ role: "user";
609
+ }
610
+ | {
611
+ content:
612
+ | string
613
+ | Array<
614
+ | {
615
+ providerOptions?: Record<
616
+ string,
617
+ Record<string, any>
618
+ >;
619
+ text: string;
620
+ type: "text";
621
+ }
622
+ | {
623
+ data: string | ArrayBuffer;
624
+ filename?: string;
625
+ mimeType: string;
626
+ providerOptions?: Record<
627
+ string,
628
+ Record<string, any>
629
+ >;
630
+ type: "file";
631
+ }
632
+ | {
633
+ providerOptions?: Record<
634
+ string,
635
+ Record<string, any>
636
+ >;
637
+ signature?: string;
638
+ text: string;
639
+ type: "reasoning";
640
+ }
641
+ | {
642
+ data: string;
643
+ providerOptions?: Record<
644
+ string,
645
+ Record<string, any>
646
+ >;
647
+ type: "redacted-reasoning";
648
+ }
649
+ | {
650
+ args: any;
651
+ providerOptions?: Record<
652
+ string,
653
+ Record<string, any>
654
+ >;
655
+ toolCallId: string;
656
+ toolName: string;
657
+ type: "tool-call";
658
+ }
659
+ >;
660
+ providerOptions?: Record<string, Record<string, any>>;
661
+ role: "assistant";
662
+ }
663
+ | {
664
+ content: Array<{
665
+ args?: any;
666
+ experimental_content?: Array<
667
+ | { text: string; type: "text" }
668
+ | { data: string; mimeType?: string; type: "image" }
669
+ >;
670
+ isError?: boolean;
671
+ providerOptions?: Record<string, Record<string, any>>;
672
+ result: any;
673
+ toolCallId: string;
674
+ toolName: string;
675
+ type: "tool-result";
676
+ }>;
677
+ providerOptions?: Record<string, Record<string, any>>;
678
+ role: "tool";
679
+ }
680
+ | {
681
+ content: string;
682
+ providerOptions?: Record<string, Record<string, any>>;
683
+ role: "system";
684
+ };
685
+ model?: string;
686
+ provider?: string;
687
+ providerMetadata?: Record<string, Record<string, any>>;
688
+ reasoning?: string;
689
+ reasoningDetails?: Array<
690
+ | { signature?: string; text: string; type: "text" }
691
+ | { data: string; type: "redacted" }
692
+ >;
693
+ sources?: Array<{
694
+ id: string;
695
+ providerOptions?: Record<string, Record<string, any>>;
696
+ sourceType: "url";
697
+ title?: string;
698
+ url: string;
699
+ }>;
700
+ text?: string;
701
+ usage?: {
702
+ completionTokens: number;
703
+ promptTokens: number;
704
+ totalTokens: number;
705
+ };
706
+ warnings?: Array<
707
+ | {
708
+ details?: string;
709
+ setting: string;
710
+ type: "unsupported-setting";
711
+ }
712
+ | { details?: string; tool: any; type: "unsupported-tool" }
713
+ | { message: string; type: "other" }
714
+ >;
715
+ }>;
716
+ step: {
717
+ experimental_providerMetadata?: Record<string, Record<string, any>>;
718
+ files?: Array<any>;
719
+ finishReason:
720
+ | "stop"
721
+ | "length"
722
+ | "content-filter"
723
+ | "tool-calls"
724
+ | "error"
725
+ | "other"
726
+ | "unknown";
727
+ isContinued: boolean;
728
+ logprobs?: any;
729
+ providerMetadata?: Record<string, Record<string, any>>;
730
+ reasoning?: string;
731
+ reasoningDetails?: Array<
732
+ | { signature?: string; text: string; type: "text" }
733
+ | { data: string; type: "redacted" }
734
+ >;
735
+ request?: {
736
+ body?: any;
737
+ headers?: Record<string, string>;
738
+ method?: string;
739
+ url?: string;
740
+ };
741
+ response?: {
742
+ body?: any;
743
+ headers?: Record<string, string>;
744
+ id: string;
745
+ messages: Array<{
746
+ fileId?: string;
747
+ id?: string;
748
+ message:
749
+ | {
750
+ content:
751
+ | string
752
+ | Array<
753
+ | {
754
+ providerOptions?: Record<
755
+ string,
756
+ Record<string, any>
757
+ >;
758
+ text: string;
759
+ type: "text";
760
+ }
761
+ | {
762
+ image: string | ArrayBuffer;
763
+ mimeType?: string;
764
+ providerOptions?: Record<
765
+ string,
766
+ Record<string, any>
767
+ >;
768
+ type: "image";
769
+ }
770
+ | {
771
+ data: string | ArrayBuffer;
772
+ filename?: string;
773
+ mimeType: string;
774
+ providerOptions?: Record<
775
+ string,
776
+ Record<string, any>
777
+ >;
778
+ type: "file";
779
+ }
780
+ >;
781
+ providerOptions?: Record<string, Record<string, any>>;
782
+ role: "user";
783
+ }
784
+ | {
785
+ content:
786
+ | string
787
+ | Array<
788
+ | {
789
+ providerOptions?: Record<
790
+ string,
791
+ Record<string, any>
792
+ >;
793
+ text: string;
794
+ type: "text";
795
+ }
796
+ | {
797
+ data: string | ArrayBuffer;
798
+ filename?: string;
799
+ mimeType: string;
800
+ providerOptions?: Record<
801
+ string,
802
+ Record<string, any>
803
+ >;
804
+ type: "file";
805
+ }
806
+ | {
807
+ providerOptions?: Record<
808
+ string,
809
+ Record<string, any>
810
+ >;
811
+ signature?: string;
812
+ text: string;
813
+ type: "reasoning";
814
+ }
815
+ | {
816
+ data: string;
817
+ providerOptions?: Record<
818
+ string,
819
+ Record<string, any>
820
+ >;
821
+ type: "redacted-reasoning";
822
+ }
823
+ | {
824
+ args: any;
825
+ providerOptions?: Record<
826
+ string,
827
+ Record<string, any>
828
+ >;
829
+ toolCallId: string;
830
+ toolName: string;
831
+ type: "tool-call";
832
+ }
833
+ >;
834
+ providerOptions?: Record<string, Record<string, any>>;
835
+ role: "assistant";
836
+ }
837
+ | {
838
+ content: Array<{
839
+ args?: any;
840
+ experimental_content?: Array<
841
+ | { text: string; type: "text" }
842
+ | { data: string; mimeType?: string; type: "image" }
843
+ >;
844
+ isError?: boolean;
845
+ providerOptions?: Record<string, Record<string, any>>;
846
+ result: any;
847
+ toolCallId: string;
848
+ toolName: string;
849
+ type: "tool-result";
850
+ }>;
851
+ providerOptions?: Record<string, Record<string, any>>;
852
+ role: "tool";
853
+ }
854
+ | {
855
+ content: string;
856
+ providerOptions?: Record<string, Record<string, any>>;
857
+ role: "system";
858
+ };
859
+ }>;
860
+ modelId: string;
861
+ timestamp: number;
862
+ };
863
+ sources?: Array<{
864
+ id: string;
865
+ providerOptions?: Record<string, Record<string, any>>;
866
+ sourceType: "url";
867
+ title?: string;
868
+ url: string;
869
+ }>;
870
+ stepType: "initial" | "continue" | "tool-result";
871
+ text: string;
872
+ toolCalls: Array<{
873
+ args: any;
874
+ providerOptions?: Record<string, Record<string, any>>;
875
+ toolCallId: string;
876
+ toolName: string;
877
+ type: "tool-call";
878
+ }>;
879
+ toolResults: Array<{
880
+ args?: any;
881
+ experimental_content?: Array<
882
+ | { text: string; type: "text" }
883
+ | { data: string; mimeType?: string; type: "image" }
884
+ >;
885
+ isError?: boolean;
886
+ providerOptions?: Record<string, Record<string, any>>;
887
+ result: any;
888
+ toolCallId: string;
889
+ toolName: string;
890
+ type: "tool-result";
891
+ }>;
892
+ usage?: {
893
+ completionTokens: number;
894
+ promptTokens: number;
895
+ totalTokens: number;
896
+ };
897
+ warnings?: Array<
898
+ | {
899
+ details?: string;
900
+ setting: string;
901
+ type: "unsupported-setting";
902
+ }
903
+ | { details?: string; tool: any; type: "unsupported-tool" }
904
+ | { message: string; type: "other" }
905
+ >;
906
+ };
907
+ };
908
+ threadId: string;
909
+ userId?: string;
910
+ },
911
+ Array<{
912
+ _creationTime: number;
913
+ _id: string;
914
+ agentName?: string;
915
+ embeddingId?: string;
916
+ error?: string;
917
+ files?: Array<{
918
+ data?: ArrayBuffer | string;
919
+ fileId?: string;
920
+ mimeType: string;
921
+ url?: string;
922
+ }>;
923
+ finishReason?:
924
+ | "stop"
925
+ | "length"
926
+ | "content-filter"
927
+ | "tool-calls"
928
+ | "error"
929
+ | "other"
930
+ | "unknown";
931
+ id?: string;
932
+ message?:
933
+ | {
934
+ content:
935
+ | string
936
+ | Array<
937
+ | {
938
+ providerOptions?: Record<string, Record<string, any>>;
939
+ text: string;
940
+ type: "text";
941
+ }
942
+ | {
943
+ image: string | ArrayBuffer;
944
+ mimeType?: string;
945
+ providerOptions?: Record<string, Record<string, any>>;
946
+ type: "image";
947
+ }
948
+ | {
949
+ data: string | ArrayBuffer;
950
+ filename?: string;
951
+ mimeType: string;
952
+ providerOptions?: Record<string, Record<string, any>>;
953
+ type: "file";
954
+ }
955
+ >;
956
+ providerOptions?: Record<string, Record<string, any>>;
957
+ role: "user";
958
+ }
959
+ | {
960
+ content:
961
+ | string
962
+ | Array<
963
+ | {
964
+ providerOptions?: Record<string, Record<string, any>>;
965
+ text: string;
966
+ type: "text";
967
+ }
968
+ | {
969
+ data: string | ArrayBuffer;
970
+ filename?: string;
971
+ mimeType: string;
972
+ providerOptions?: Record<string, Record<string, any>>;
973
+ type: "file";
974
+ }
975
+ | {
976
+ providerOptions?: Record<string, Record<string, any>>;
977
+ signature?: string;
978
+ text: string;
979
+ type: "reasoning";
980
+ }
981
+ | {
982
+ data: string;
983
+ providerOptions?: Record<string, Record<string, any>>;
984
+ type: "redacted-reasoning";
985
+ }
986
+ | {
987
+ args: any;
988
+ providerOptions?: Record<string, Record<string, any>>;
989
+ toolCallId: string;
990
+ toolName: string;
991
+ type: "tool-call";
992
+ }
993
+ >;
994
+ providerOptions?: Record<string, Record<string, any>>;
995
+ role: "assistant";
996
+ }
997
+ | {
998
+ content: Array<{
999
+ args?: any;
1000
+ experimental_content?: Array<
1001
+ | { text: string; type: "text" }
1002
+ | { data: string; mimeType?: string; type: "image" }
1003
+ >;
1004
+ isError?: boolean;
1005
+ providerOptions?: Record<string, Record<string, any>>;
1006
+ result: any;
1007
+ toolCallId: string;
1008
+ toolName: string;
1009
+ type: "tool-result";
1010
+ }>;
1011
+ providerOptions?: Record<string, Record<string, any>>;
1012
+ role: "tool";
1013
+ }
1014
+ | {
1015
+ content: string;
1016
+ providerOptions?: Record<string, Record<string, any>>;
1017
+ role: "system";
1018
+ };
1019
+ model?: string;
1020
+ order: number;
1021
+ provider?: string;
1022
+ providerMetadata?: Record<string, Record<string, any>>;
1023
+ providerOptions?: Record<string, Record<string, any>>;
1024
+ reasoning?: string;
1025
+ reasoningDetails?: Array<
1026
+ | { signature?: string; text: string; type: "text" }
1027
+ | { data: string; type: "redacted" }
1028
+ >;
1029
+ sources?: Array<{
1030
+ id: string;
1031
+ providerOptions?: Record<string, Record<string, any>>;
1032
+ sourceType: "url";
1033
+ title?: string;
1034
+ url: string;
1035
+ }>;
1036
+ status: "pending" | "success" | "failed";
1037
+ stepOrder: number;
1038
+ text?: string;
1039
+ threadId: string;
1040
+ tool: boolean;
1041
+ usage?: {
1042
+ completionTokens: number;
1043
+ promptTokens: number;
1044
+ totalTokens: number;
1045
+ };
1046
+ userId?: string;
1047
+ warnings?: Array<
1048
+ | { details?: string; setting: string; type: "unsupported-setting" }
1049
+ | { details?: string; tool: any; type: "unsupported-tool" }
1050
+ | { message: string; type: "other" }
1051
+ >;
1052
+ }>
1053
+ >;
1054
+ commitMessage: FunctionReference<
1055
+ "mutation",
1056
+ "public",
1057
+ { messageId: string },
1058
+ null
1059
+ >;
1060
+ getMessagesByIds: FunctionReference<
1061
+ "query",
1062
+ "public",
1063
+ { messageIds: Array<string> },
1064
+ Array<null | {
1065
+ _creationTime: number;
1066
+ _id: string;
1067
+ agentName?: string;
1068
+ embeddingId?: string;
1069
+ error?: string;
1070
+ files?: Array<{
1071
+ data?: ArrayBuffer | string;
1072
+ fileId?: string;
1073
+ mimeType: string;
1074
+ url?: string;
1075
+ }>;
1076
+ finishReason?:
1077
+ | "stop"
1078
+ | "length"
1079
+ | "content-filter"
1080
+ | "tool-calls"
1081
+ | "error"
1082
+ | "other"
1083
+ | "unknown";
1084
+ id?: string;
1085
+ message?:
1086
+ | {
1087
+ content:
1088
+ | string
1089
+ | Array<
1090
+ | {
1091
+ providerOptions?: Record<string, Record<string, any>>;
1092
+ text: string;
1093
+ type: "text";
1094
+ }
1095
+ | {
1096
+ image: string | ArrayBuffer;
1097
+ mimeType?: string;
1098
+ providerOptions?: Record<string, Record<string, any>>;
1099
+ type: "image";
1100
+ }
1101
+ | {
1102
+ data: string | ArrayBuffer;
1103
+ filename?: string;
1104
+ mimeType: string;
1105
+ providerOptions?: Record<string, Record<string, any>>;
1106
+ type: "file";
1107
+ }
1108
+ >;
1109
+ providerOptions?: Record<string, Record<string, any>>;
1110
+ role: "user";
1111
+ }
1112
+ | {
1113
+ content:
1114
+ | string
1115
+ | Array<
1116
+ | {
1117
+ providerOptions?: Record<string, Record<string, any>>;
1118
+ text: string;
1119
+ type: "text";
1120
+ }
1121
+ | {
1122
+ data: string | ArrayBuffer;
1123
+ filename?: string;
1124
+ mimeType: string;
1125
+ providerOptions?: Record<string, Record<string, any>>;
1126
+ type: "file";
1127
+ }
1128
+ | {
1129
+ providerOptions?: Record<string, Record<string, any>>;
1130
+ signature?: string;
1131
+ text: string;
1132
+ type: "reasoning";
1133
+ }
1134
+ | {
1135
+ data: string;
1136
+ providerOptions?: Record<string, Record<string, any>>;
1137
+ type: "redacted-reasoning";
1138
+ }
1139
+ | {
1140
+ args: any;
1141
+ providerOptions?: Record<string, Record<string, any>>;
1142
+ toolCallId: string;
1143
+ toolName: string;
1144
+ type: "tool-call";
1145
+ }
1146
+ >;
1147
+ providerOptions?: Record<string, Record<string, any>>;
1148
+ role: "assistant";
1149
+ }
1150
+ | {
1151
+ content: Array<{
1152
+ args?: any;
1153
+ experimental_content?: Array<
1154
+ | { text: string; type: "text" }
1155
+ | { data: string; mimeType?: string; type: "image" }
1156
+ >;
1157
+ isError?: boolean;
1158
+ providerOptions?: Record<string, Record<string, any>>;
1159
+ result: any;
1160
+ toolCallId: string;
1161
+ toolName: string;
1162
+ type: "tool-result";
1163
+ }>;
1164
+ providerOptions?: Record<string, Record<string, any>>;
1165
+ role: "tool";
1166
+ }
1167
+ | {
1168
+ content: string;
1169
+ providerOptions?: Record<string, Record<string, any>>;
1170
+ role: "system";
1171
+ };
1172
+ model?: string;
1173
+ order: number;
1174
+ provider?: string;
1175
+ providerMetadata?: Record<string, Record<string, any>>;
1176
+ providerOptions?: Record<string, Record<string, any>>;
1177
+ reasoning?: string;
1178
+ reasoningDetails?: Array<
1179
+ | { signature?: string; text: string; type: "text" }
1180
+ | { data: string; type: "redacted" }
1181
+ >;
1182
+ sources?: Array<{
1183
+ id: string;
1184
+ providerOptions?: Record<string, Record<string, any>>;
1185
+ sourceType: "url";
1186
+ title?: string;
1187
+ url: string;
1188
+ }>;
1189
+ status: "pending" | "success" | "failed";
1190
+ stepOrder: number;
1191
+ text?: string;
1192
+ threadId: string;
1193
+ tool: boolean;
1194
+ usage?: {
1195
+ completionTokens: number;
1196
+ promptTokens: number;
1197
+ totalTokens: number;
1198
+ };
1199
+ userId?: string;
1200
+ warnings?: Array<
1201
+ | { details?: string; setting: string; type: "unsupported-setting" }
1202
+ | { details?: string; tool: any; type: "unsupported-tool" }
1203
+ | { message: string; type: "other" }
1204
+ >;
1205
+ }>
1206
+ >;
1207
+ getThreadMessages: FunctionReference<
1208
+ "query",
1209
+ "public",
1210
+ { deprecated: "Use listMessagesByThreadId instead" },
1211
+ {
1212
+ continueCursor: string;
1213
+ isDone: boolean;
1214
+ page: Array<{
1215
+ _creationTime: number;
1216
+ _id: string;
1217
+ agentName?: string;
1218
+ embeddingId?: string;
1219
+ error?: string;
1220
+ files?: Array<{
1221
+ data?: ArrayBuffer | string;
1222
+ fileId?: string;
1223
+ mimeType: string;
1224
+ url?: string;
1225
+ }>;
1226
+ finishReason?:
1227
+ | "stop"
1228
+ | "length"
1229
+ | "content-filter"
1230
+ | "tool-calls"
1231
+ | "error"
1232
+ | "other"
1233
+ | "unknown";
1234
+ id?: string;
1235
+ message?:
1236
+ | {
1237
+ content:
1238
+ | string
1239
+ | Array<
1240
+ | {
1241
+ providerOptions?: Record<string, Record<string, any>>;
1242
+ text: string;
1243
+ type: "text";
1244
+ }
1245
+ | {
1246
+ image: string | ArrayBuffer;
1247
+ mimeType?: string;
1248
+ providerOptions?: Record<string, Record<string, any>>;
1249
+ type: "image";
1250
+ }
1251
+ | {
1252
+ data: string | ArrayBuffer;
1253
+ filename?: string;
1254
+ mimeType: string;
1255
+ providerOptions?: Record<string, Record<string, any>>;
1256
+ type: "file";
1257
+ }
1258
+ >;
1259
+ providerOptions?: Record<string, Record<string, any>>;
1260
+ role: "user";
1261
+ }
1262
+ | {
1263
+ content:
1264
+ | string
1265
+ | Array<
1266
+ | {
1267
+ providerOptions?: Record<string, Record<string, any>>;
1268
+ text: string;
1269
+ type: "text";
1270
+ }
1271
+ | {
1272
+ data: string | ArrayBuffer;
1273
+ filename?: string;
1274
+ mimeType: string;
1275
+ providerOptions?: Record<string, Record<string, any>>;
1276
+ type: "file";
1277
+ }
1278
+ | {
1279
+ providerOptions?: Record<string, Record<string, any>>;
1280
+ signature?: string;
1281
+ text: string;
1282
+ type: "reasoning";
1283
+ }
1284
+ | {
1285
+ data: string;
1286
+ providerOptions?: Record<string, Record<string, any>>;
1287
+ type: "redacted-reasoning";
1288
+ }
1289
+ | {
1290
+ args: any;
1291
+ providerOptions?: Record<string, Record<string, any>>;
1292
+ toolCallId: string;
1293
+ toolName: string;
1294
+ type: "tool-call";
1295
+ }
1296
+ >;
1297
+ providerOptions?: Record<string, Record<string, any>>;
1298
+ role: "assistant";
1299
+ }
1300
+ | {
1301
+ content: Array<{
1302
+ args?: any;
1303
+ experimental_content?: Array<
1304
+ | { text: string; type: "text" }
1305
+ | { data: string; mimeType?: string; type: "image" }
1306
+ >;
1307
+ isError?: boolean;
1308
+ providerOptions?: Record<string, Record<string, any>>;
1309
+ result: any;
1310
+ toolCallId: string;
1311
+ toolName: string;
1312
+ type: "tool-result";
1313
+ }>;
1314
+ providerOptions?: Record<string, Record<string, any>>;
1315
+ role: "tool";
1316
+ }
1317
+ | {
1318
+ content: string;
1319
+ providerOptions?: Record<string, Record<string, any>>;
1320
+ role: "system";
1321
+ };
1322
+ model?: string;
1323
+ order: number;
1324
+ provider?: string;
1325
+ providerMetadata?: Record<string, Record<string, any>>;
1326
+ providerOptions?: Record<string, Record<string, any>>;
1327
+ reasoning?: string;
1328
+ reasoningDetails?: Array<
1329
+ | { signature?: string; text: string; type: "text" }
1330
+ | { data: string; type: "redacted" }
1331
+ >;
1332
+ sources?: Array<{
1333
+ id: string;
1334
+ providerOptions?: Record<string, Record<string, any>>;
1335
+ sourceType: "url";
1336
+ title?: string;
1337
+ url: string;
1338
+ }>;
1339
+ status: "pending" | "success" | "failed";
1340
+ stepOrder: number;
1341
+ text?: string;
1342
+ threadId: string;
1343
+ tool: boolean;
1344
+ usage?: {
1345
+ completionTokens: number;
1346
+ promptTokens: number;
1347
+ totalTokens: number;
1348
+ };
1349
+ userId?: string;
1350
+ warnings?: Array<
1351
+ | { details?: string; setting: string; type: "unsupported-setting" }
1352
+ | { details?: string; tool: any; type: "unsupported-tool" }
1353
+ | { message: string; type: "other" }
1354
+ >;
1355
+ }>;
1356
+ pageStatus?: "SplitRecommended" | "SplitRequired" | null;
1357
+ splitCursor?: string | null;
1358
+ }
1359
+ >;
1360
+ listMessagesByThreadId: FunctionReference<
1361
+ "query",
1362
+ "public",
1363
+ {
1364
+ excludeToolMessages?: boolean;
1365
+ isTool?: "use excludeToolMessages instead of this";
1366
+ order: "asc" | "desc";
1367
+ paginationOpts?: {
1368
+ cursor: string | null;
1369
+ endCursor?: string | null;
1370
+ id?: number;
1371
+ maximumBytesRead?: number;
1372
+ maximumRowsRead?: number;
1373
+ numItems: number;
1374
+ };
1375
+ statuses?: Array<"pending" | "success" | "failed">;
1376
+ threadId: string;
1377
+ upToAndIncludingMessageId?: string;
1378
+ },
1379
+ {
1380
+ continueCursor: string;
1381
+ isDone: boolean;
1382
+ page: Array<{
1383
+ _creationTime: number;
1384
+ _id: string;
1385
+ agentName?: string;
1386
+ embeddingId?: string;
1387
+ error?: string;
1388
+ files?: Array<{
1389
+ data?: ArrayBuffer | string;
1390
+ fileId?: string;
1391
+ mimeType: string;
1392
+ url?: string;
1393
+ }>;
1394
+ finishReason?:
1395
+ | "stop"
1396
+ | "length"
1397
+ | "content-filter"
1398
+ | "tool-calls"
1399
+ | "error"
1400
+ | "other"
1401
+ | "unknown";
1402
+ id?: string;
1403
+ message?:
1404
+ | {
1405
+ content:
1406
+ | string
1407
+ | Array<
1408
+ | {
1409
+ providerOptions?: Record<string, Record<string, any>>;
1410
+ text: string;
1411
+ type: "text";
1412
+ }
1413
+ | {
1414
+ image: string | ArrayBuffer;
1415
+ mimeType?: string;
1416
+ providerOptions?: Record<string, Record<string, any>>;
1417
+ type: "image";
1418
+ }
1419
+ | {
1420
+ data: string | ArrayBuffer;
1421
+ filename?: string;
1422
+ mimeType: string;
1423
+ providerOptions?: Record<string, Record<string, any>>;
1424
+ type: "file";
1425
+ }
1426
+ >;
1427
+ providerOptions?: Record<string, Record<string, any>>;
1428
+ role: "user";
1429
+ }
1430
+ | {
1431
+ content:
1432
+ | string
1433
+ | Array<
1434
+ | {
1435
+ providerOptions?: Record<string, Record<string, any>>;
1436
+ text: string;
1437
+ type: "text";
1438
+ }
1439
+ | {
1440
+ data: string | ArrayBuffer;
1441
+ filename?: string;
1442
+ mimeType: string;
1443
+ providerOptions?: Record<string, Record<string, any>>;
1444
+ type: "file";
1445
+ }
1446
+ | {
1447
+ providerOptions?: Record<string, Record<string, any>>;
1448
+ signature?: string;
1449
+ text: string;
1450
+ type: "reasoning";
1451
+ }
1452
+ | {
1453
+ data: string;
1454
+ providerOptions?: Record<string, Record<string, any>>;
1455
+ type: "redacted-reasoning";
1456
+ }
1457
+ | {
1458
+ args: any;
1459
+ providerOptions?: Record<string, Record<string, any>>;
1460
+ toolCallId: string;
1461
+ toolName: string;
1462
+ type: "tool-call";
1463
+ }
1464
+ >;
1465
+ providerOptions?: Record<string, Record<string, any>>;
1466
+ role: "assistant";
1467
+ }
1468
+ | {
1469
+ content: Array<{
1470
+ args?: any;
1471
+ experimental_content?: Array<
1472
+ | { text: string; type: "text" }
1473
+ | { data: string; mimeType?: string; type: "image" }
1474
+ >;
1475
+ isError?: boolean;
1476
+ providerOptions?: Record<string, Record<string, any>>;
1477
+ result: any;
1478
+ toolCallId: string;
1479
+ toolName: string;
1480
+ type: "tool-result";
1481
+ }>;
1482
+ providerOptions?: Record<string, Record<string, any>>;
1483
+ role: "tool";
1484
+ }
1485
+ | {
1486
+ content: string;
1487
+ providerOptions?: Record<string, Record<string, any>>;
1488
+ role: "system";
1489
+ };
1490
+ model?: string;
1491
+ order: number;
1492
+ provider?: string;
1493
+ providerMetadata?: Record<string, Record<string, any>>;
1494
+ providerOptions?: Record<string, Record<string, any>>;
1495
+ reasoning?: string;
1496
+ reasoningDetails?: Array<
1497
+ | { signature?: string; text: string; type: "text" }
1498
+ | { data: string; type: "redacted" }
1499
+ >;
1500
+ sources?: Array<{
1501
+ id: string;
1502
+ providerOptions?: Record<string, Record<string, any>>;
1503
+ sourceType: "url";
1504
+ title?: string;
1505
+ url: string;
1506
+ }>;
1507
+ status: "pending" | "success" | "failed";
1508
+ stepOrder: number;
1509
+ text?: string;
1510
+ threadId: string;
1511
+ tool: boolean;
1512
+ usage?: {
1513
+ completionTokens: number;
1514
+ promptTokens: number;
1515
+ totalTokens: number;
1516
+ };
1517
+ userId?: string;
1518
+ warnings?: Array<
1519
+ | { details?: string; setting: string; type: "unsupported-setting" }
1520
+ | { details?: string; tool: any; type: "unsupported-tool" }
1521
+ | { message: string; type: "other" }
1522
+ >;
1523
+ }>;
1524
+ pageStatus?: "SplitRecommended" | "SplitRequired" | null;
1525
+ splitCursor?: string | null;
1526
+ }
1527
+ >;
1528
+ rollbackMessage: FunctionReference<
1529
+ "mutation",
1530
+ "public",
1531
+ { error?: string; messageId: string },
1532
+ null
1533
+ >;
1534
+ searchMessages: FunctionReference<
1535
+ "action",
1536
+ "public",
1537
+ {
1538
+ beforeMessageId?: string;
1539
+ limit: number;
1540
+ messageRange?: { after: number; before: number };
1541
+ searchAllMessagesForUserId?: string;
1542
+ text?: string;
1543
+ threadId?: string;
1544
+ vector?: Array<number>;
1545
+ vectorModel?: string;
1546
+ vectorScoreThreshold?: number;
1547
+ },
1548
+ Array<{
1549
+ _creationTime: number;
1550
+ _id: string;
1551
+ agentName?: string;
1552
+ embeddingId?: string;
1553
+ error?: string;
1554
+ files?: Array<{
1555
+ data?: ArrayBuffer | string;
1556
+ fileId?: string;
1557
+ mimeType: string;
1558
+ url?: string;
1559
+ }>;
1560
+ finishReason?:
1561
+ | "stop"
1562
+ | "length"
1563
+ | "content-filter"
1564
+ | "tool-calls"
1565
+ | "error"
1566
+ | "other"
1567
+ | "unknown";
1568
+ id?: string;
1569
+ message?:
1570
+ | {
1571
+ content:
1572
+ | string
1573
+ | Array<
1574
+ | {
1575
+ providerOptions?: Record<string, Record<string, any>>;
1576
+ text: string;
1577
+ type: "text";
1578
+ }
1579
+ | {
1580
+ image: string | ArrayBuffer;
1581
+ mimeType?: string;
1582
+ providerOptions?: Record<string, Record<string, any>>;
1583
+ type: "image";
1584
+ }
1585
+ | {
1586
+ data: string | ArrayBuffer;
1587
+ filename?: string;
1588
+ mimeType: string;
1589
+ providerOptions?: Record<string, Record<string, any>>;
1590
+ type: "file";
1591
+ }
1592
+ >;
1593
+ providerOptions?: Record<string, Record<string, any>>;
1594
+ role: "user";
1595
+ }
1596
+ | {
1597
+ content:
1598
+ | string
1599
+ | Array<
1600
+ | {
1601
+ providerOptions?: Record<string, Record<string, any>>;
1602
+ text: string;
1603
+ type: "text";
1604
+ }
1605
+ | {
1606
+ data: string | ArrayBuffer;
1607
+ filename?: string;
1608
+ mimeType: string;
1609
+ providerOptions?: Record<string, Record<string, any>>;
1610
+ type: "file";
1611
+ }
1612
+ | {
1613
+ providerOptions?: Record<string, Record<string, any>>;
1614
+ signature?: string;
1615
+ text: string;
1616
+ type: "reasoning";
1617
+ }
1618
+ | {
1619
+ data: string;
1620
+ providerOptions?: Record<string, Record<string, any>>;
1621
+ type: "redacted-reasoning";
1622
+ }
1623
+ | {
1624
+ args: any;
1625
+ providerOptions?: Record<string, Record<string, any>>;
1626
+ toolCallId: string;
1627
+ toolName: string;
1628
+ type: "tool-call";
1629
+ }
1630
+ >;
1631
+ providerOptions?: Record<string, Record<string, any>>;
1632
+ role: "assistant";
1633
+ }
1634
+ | {
1635
+ content: Array<{
1636
+ args?: any;
1637
+ experimental_content?: Array<
1638
+ | { text: string; type: "text" }
1639
+ | { data: string; mimeType?: string; type: "image" }
1640
+ >;
1641
+ isError?: boolean;
1642
+ providerOptions?: Record<string, Record<string, any>>;
1643
+ result: any;
1644
+ toolCallId: string;
1645
+ toolName: string;
1646
+ type: "tool-result";
1647
+ }>;
1648
+ providerOptions?: Record<string, Record<string, any>>;
1649
+ role: "tool";
1650
+ }
1651
+ | {
1652
+ content: string;
1653
+ providerOptions?: Record<string, Record<string, any>>;
1654
+ role: "system";
1655
+ };
1656
+ model?: string;
1657
+ order: number;
1658
+ provider?: string;
1659
+ providerMetadata?: Record<string, Record<string, any>>;
1660
+ providerOptions?: Record<string, Record<string, any>>;
1661
+ reasoning?: string;
1662
+ reasoningDetails?: Array<
1663
+ | { signature?: string; text: string; type: "text" }
1664
+ | { data: string; type: "redacted" }
1665
+ >;
1666
+ sources?: Array<{
1667
+ id: string;
1668
+ providerOptions?: Record<string, Record<string, any>>;
1669
+ sourceType: "url";
1670
+ title?: string;
1671
+ url: string;
1672
+ }>;
1673
+ status: "pending" | "success" | "failed";
1674
+ stepOrder: number;
1675
+ text?: string;
1676
+ threadId: string;
1677
+ tool: boolean;
1678
+ usage?: {
1679
+ completionTokens: number;
1680
+ promptTokens: number;
1681
+ totalTokens: number;
1682
+ };
1683
+ userId?: string;
1684
+ warnings?: Array<
1685
+ | { details?: string; setting: string; type: "unsupported-setting" }
1686
+ | { details?: string; tool: any; type: "unsupported-tool" }
1687
+ | { message: string; type: "other" }
1688
+ >;
1689
+ }>
1690
+ >;
1691
+ textSearch: FunctionReference<
1692
+ "query",
1693
+ "public",
1694
+ {
1695
+ beforeMessageId?: string;
1696
+ limit: number;
1697
+ searchAllMessagesForUserId?: string;
1698
+ text: string;
1699
+ threadId?: string;
1700
+ },
1701
+ Array<{
1702
+ _creationTime: number;
1703
+ _id: string;
1704
+ agentName?: string;
1705
+ embeddingId?: string;
1706
+ error?: string;
1707
+ files?: Array<{
1708
+ data?: ArrayBuffer | string;
1709
+ fileId?: string;
1710
+ mimeType: string;
1711
+ url?: string;
1712
+ }>;
1713
+ finishReason?:
1714
+ | "stop"
1715
+ | "length"
1716
+ | "content-filter"
1717
+ | "tool-calls"
1718
+ | "error"
1719
+ | "other"
1720
+ | "unknown";
1721
+ id?: string;
1722
+ message?:
1723
+ | {
1724
+ content:
1725
+ | string
1726
+ | Array<
1727
+ | {
1728
+ providerOptions?: Record<string, Record<string, any>>;
1729
+ text: string;
1730
+ type: "text";
1731
+ }
1732
+ | {
1733
+ image: string | ArrayBuffer;
1734
+ mimeType?: string;
1735
+ providerOptions?: Record<string, Record<string, any>>;
1736
+ type: "image";
1737
+ }
1738
+ | {
1739
+ data: string | ArrayBuffer;
1740
+ filename?: string;
1741
+ mimeType: string;
1742
+ providerOptions?: Record<string, Record<string, any>>;
1743
+ type: "file";
1744
+ }
1745
+ >;
1746
+ providerOptions?: Record<string, Record<string, any>>;
1747
+ role: "user";
1748
+ }
1749
+ | {
1750
+ content:
1751
+ | string
1752
+ | Array<
1753
+ | {
1754
+ providerOptions?: Record<string, Record<string, any>>;
1755
+ text: string;
1756
+ type: "text";
1757
+ }
1758
+ | {
1759
+ data: string | ArrayBuffer;
1760
+ filename?: string;
1761
+ mimeType: string;
1762
+ providerOptions?: Record<string, Record<string, any>>;
1763
+ type: "file";
1764
+ }
1765
+ | {
1766
+ providerOptions?: Record<string, Record<string, any>>;
1767
+ signature?: string;
1768
+ text: string;
1769
+ type: "reasoning";
1770
+ }
1771
+ | {
1772
+ data: string;
1773
+ providerOptions?: Record<string, Record<string, any>>;
1774
+ type: "redacted-reasoning";
1775
+ }
1776
+ | {
1777
+ args: any;
1778
+ providerOptions?: Record<string, Record<string, any>>;
1779
+ toolCallId: string;
1780
+ toolName: string;
1781
+ type: "tool-call";
1782
+ }
1783
+ >;
1784
+ providerOptions?: Record<string, Record<string, any>>;
1785
+ role: "assistant";
1786
+ }
1787
+ | {
1788
+ content: Array<{
1789
+ args?: any;
1790
+ experimental_content?: Array<
1791
+ | { text: string; type: "text" }
1792
+ | { data: string; mimeType?: string; type: "image" }
1793
+ >;
1794
+ isError?: boolean;
1795
+ providerOptions?: Record<string, Record<string, any>>;
1796
+ result: any;
1797
+ toolCallId: string;
1798
+ toolName: string;
1799
+ type: "tool-result";
1800
+ }>;
1801
+ providerOptions?: Record<string, Record<string, any>>;
1802
+ role: "tool";
1803
+ }
1804
+ | {
1805
+ content: string;
1806
+ providerOptions?: Record<string, Record<string, any>>;
1807
+ role: "system";
1808
+ };
1809
+ model?: string;
1810
+ order: number;
1811
+ provider?: string;
1812
+ providerMetadata?: Record<string, Record<string, any>>;
1813
+ providerOptions?: Record<string, Record<string, any>>;
1814
+ reasoning?: string;
1815
+ reasoningDetails?: Array<
1816
+ | { signature?: string; text: string; type: "text" }
1817
+ | { data: string; type: "redacted" }
1818
+ >;
1819
+ sources?: Array<{
1820
+ id: string;
1821
+ providerOptions?: Record<string, Record<string, any>>;
1822
+ sourceType: "url";
1823
+ title?: string;
1824
+ url: string;
1825
+ }>;
1826
+ status: "pending" | "success" | "failed";
1827
+ stepOrder: number;
1828
+ text?: string;
1829
+ threadId: string;
1830
+ tool: boolean;
1831
+ usage?: {
1832
+ completionTokens: number;
1833
+ promptTokens: number;
1834
+ totalTokens: number;
1835
+ };
1836
+ userId?: string;
1837
+ warnings?: Array<
1838
+ | { details?: string; setting: string; type: "unsupported-setting" }
1839
+ | { details?: string; tool: any; type: "unsupported-tool" }
1840
+ | { message: string; type: "other" }
1841
+ >;
1842
+ }>
1843
+ >;
1844
+ };
1845
+ streams: {
1846
+ addDelta: FunctionReference<
1847
+ "mutation",
1848
+ "public",
1849
+ {
1850
+ end: number;
1851
+ parts: Array<
1852
+ | { textDelta: string; type: "text-delta" }
1853
+ | { textDelta: string; type: "reasoning" }
1854
+ | {
1855
+ source: {
1856
+ id: string;
1857
+ providerOptions?: Record<string, Record<string, any>>;
1858
+ sourceType: "url";
1859
+ title?: string;
1860
+ url: string;
1861
+ };
1862
+ type: "source";
1863
+ }
1864
+ | {
1865
+ args: any;
1866
+ providerOptions?: Record<string, Record<string, any>>;
1867
+ toolCallId: string;
1868
+ toolName: string;
1869
+ type: "tool-call";
1870
+ }
1871
+ | {
1872
+ toolCallId: string;
1873
+ toolName: string;
1874
+ type: "tool-call-streaming-start";
1875
+ }
1876
+ | {
1877
+ argsTextDelta: string;
1878
+ toolCallId: string;
1879
+ toolName: string;
1880
+ type: "tool-call-delta";
1881
+ }
1882
+ | {
1883
+ args?: any;
1884
+ experimental_content?: Array<
1885
+ | { text: string; type: "text" }
1886
+ | { data: string; mimeType?: string; type: "image" }
1887
+ >;
1888
+ isError?: boolean;
1889
+ providerOptions?: Record<string, Record<string, any>>;
1890
+ result: any;
1891
+ toolCallId: string;
1892
+ toolName: string;
1893
+ type: "tool-result";
1894
+ }
1895
+ >;
1896
+ start: number;
1897
+ streamId: string;
1898
+ },
1899
+ null
1900
+ >;
1901
+ create: FunctionReference<
1902
+ "mutation",
1903
+ "public",
1904
+ {
1905
+ agentName?: string;
1906
+ model?: string;
1907
+ order: number;
1908
+ provider?: string;
1909
+ providerOptions?: Record<string, Record<string, any>>;
1910
+ stepOrder: number;
1911
+ threadId: string;
1912
+ userId?: string;
1913
+ },
1914
+ string
1915
+ >;
1916
+ finish: FunctionReference<
1917
+ "mutation",
1918
+ "public",
1919
+ {
1920
+ finalDelta?: {
1921
+ end: number;
1922
+ parts: Array<
1923
+ | { textDelta: string; type: "text-delta" }
1924
+ | { textDelta: string; type: "reasoning" }
1925
+ | {
1926
+ source: {
1927
+ id: string;
1928
+ providerOptions?: Record<string, Record<string, any>>;
1929
+ sourceType: "url";
1930
+ title?: string;
1931
+ url: string;
1932
+ };
1933
+ type: "source";
1934
+ }
1935
+ | {
1936
+ args: any;
1937
+ providerOptions?: Record<string, Record<string, any>>;
1938
+ toolCallId: string;
1939
+ toolName: string;
1940
+ type: "tool-call";
1941
+ }
1942
+ | {
1943
+ toolCallId: string;
1944
+ toolName: string;
1945
+ type: "tool-call-streaming-start";
1946
+ }
1947
+ | {
1948
+ argsTextDelta: string;
1949
+ toolCallId: string;
1950
+ toolName: string;
1951
+ type: "tool-call-delta";
1952
+ }
1953
+ | {
1954
+ args?: any;
1955
+ experimental_content?: Array<
1956
+ | { text: string; type: "text" }
1957
+ | { data: string; mimeType?: string; type: "image" }
1958
+ >;
1959
+ isError?: boolean;
1960
+ providerOptions?: Record<string, Record<string, any>>;
1961
+ result: any;
1962
+ toolCallId: string;
1963
+ toolName: string;
1964
+ type: "tool-result";
1965
+ }
1966
+ >;
1967
+ start: number;
1968
+ streamId: string;
1969
+ };
1970
+ streamId: string;
1971
+ },
1972
+ null
1973
+ >;
1974
+ list: FunctionReference<
1975
+ "query",
1976
+ "public",
1977
+ { threadId: string },
1978
+ Array<{
1979
+ agentName?: string;
1980
+ model?: string;
1981
+ order: number;
1982
+ provider?: string;
1983
+ providerOptions?: Record<string, Record<string, any>>;
1984
+ stepOrder: number;
1985
+ streamId: string;
1986
+ userId?: string;
1987
+ }>
1988
+ >;
1989
+ listDeltas: FunctionReference<
1990
+ "query",
1991
+ "public",
1992
+ {
1993
+ cursors: Array<{ cursor: number; streamId: string }>;
1994
+ threadId: string;
1995
+ },
1996
+ Array<{
1997
+ end: number;
1998
+ parts: Array<
1999
+ | { textDelta: string; type: "text-delta" }
2000
+ | { textDelta: string; type: "reasoning" }
2001
+ | {
2002
+ source: {
2003
+ id: string;
2004
+ providerOptions?: Record<string, Record<string, any>>;
2005
+ sourceType: "url";
2006
+ title?: string;
2007
+ url: string;
2008
+ };
2009
+ type: "source";
2010
+ }
2011
+ | {
2012
+ args: any;
2013
+ providerOptions?: Record<string, Record<string, any>>;
2014
+ toolCallId: string;
2015
+ toolName: string;
2016
+ type: "tool-call";
2017
+ }
2018
+ | {
2019
+ toolCallId: string;
2020
+ toolName: string;
2021
+ type: "tool-call-streaming-start";
2022
+ }
2023
+ | {
2024
+ argsTextDelta: string;
2025
+ toolCallId: string;
2026
+ toolName: string;
2027
+ type: "tool-call-delta";
2028
+ }
2029
+ | {
2030
+ args?: any;
2031
+ experimental_content?: Array<
2032
+ | { text: string; type: "text" }
2033
+ | { data: string; mimeType?: string; type: "image" }
2034
+ >;
2035
+ isError?: boolean;
2036
+ providerOptions?: Record<string, Record<string, any>>;
2037
+ result: any;
2038
+ toolCallId: string;
2039
+ toolName: string;
2040
+ type: "tool-result";
2041
+ }
2042
+ >;
2043
+ start: number;
2044
+ streamId: string;
2045
+ }>
2046
+ >;
2047
+ };
2048
+ threads: {
2049
+ createThread: FunctionReference<
2050
+ "mutation",
2051
+ "public",
2052
+ {
2053
+ defaultSystemPrompt?: string;
2054
+ parentThreadIds?: Array<string>;
2055
+ summary?: string;
2056
+ title?: string;
2057
+ userId?: string;
2058
+ },
2059
+ {
2060
+ _creationTime: number;
2061
+ _id: string;
2062
+ status: "active" | "archived";
2063
+ summary?: string;
2064
+ title?: string;
2065
+ userId?: string;
2066
+ }
2067
+ >;
2068
+ deleteAllForThreadIdAsync: FunctionReference<
2069
+ "mutation",
2070
+ "public",
2071
+ { cursor?: string; limit?: number; threadId: string },
2072
+ { cursor: string; isDone: boolean }
2073
+ >;
2074
+ deleteAllForThreadIdSync: FunctionReference<
2075
+ "action",
2076
+ "public",
2077
+ { cursor?: string; limit?: number; threadId: string },
2078
+ null
2079
+ >;
2080
+ getThread: FunctionReference<
2081
+ "query",
2082
+ "public",
2083
+ { threadId: string },
2084
+ {
2085
+ _creationTime: number;
2086
+ _id: string;
2087
+ status: "active" | "archived";
2088
+ summary?: string;
2089
+ title?: string;
2090
+ userId?: string;
2091
+ } | null
2092
+ >;
2093
+ listThreadsByUserId: FunctionReference<
2094
+ "query",
2095
+ "public",
2096
+ {
2097
+ order?: "asc" | "desc";
2098
+ paginationOpts?: {
2099
+ cursor: string | null;
2100
+ endCursor?: string | null;
2101
+ id?: number;
2102
+ maximumBytesRead?: number;
2103
+ maximumRowsRead?: number;
2104
+ numItems: number;
2105
+ };
2106
+ userId?: string;
2107
+ },
2108
+ {
2109
+ continueCursor: string;
2110
+ isDone: boolean;
2111
+ page: Array<{
2112
+ _creationTime: number;
2113
+ _id: string;
2114
+ status: "active" | "archived";
2115
+ summary?: string;
2116
+ title?: string;
2117
+ userId?: string;
2118
+ }>;
2119
+ pageStatus?: "SplitRecommended" | "SplitRequired" | null;
2120
+ splitCursor?: string | null;
2121
+ }
2122
+ >;
2123
+ updateThread: FunctionReference<
2124
+ "mutation",
2125
+ "public",
2126
+ {
2127
+ patch: {
2128
+ status?: "active" | "archived";
2129
+ summary?: string;
2130
+ title?: string;
2131
+ };
2132
+ threadId: string;
2133
+ },
2134
+ {
2135
+ _creationTime: number;
2136
+ _id: string;
2137
+ status: "active" | "archived";
2138
+ summary?: string;
2139
+ title?: string;
2140
+ userId?: string;
2141
+ }
2142
+ >;
2143
+ };
2144
+ users: {
2145
+ deleteAllForUserId: FunctionReference<
2146
+ "action",
2147
+ "public",
2148
+ { userId: string },
2149
+ null
2150
+ >;
2151
+ deleteAllForUserIdAsync: FunctionReference<
2152
+ "mutation",
2153
+ "public",
2154
+ { userId: string },
2155
+ boolean
2156
+ >;
2157
+ listUsersWithThreads: FunctionReference<
2158
+ "query",
2159
+ "public",
2160
+ {
2161
+ paginationOpts: {
2162
+ cursor: string | null;
2163
+ endCursor?: string | null;
2164
+ id?: number;
2165
+ maximumBytesRead?: number;
2166
+ maximumRowsRead?: number;
2167
+ numItems: number;
2168
+ };
2169
+ },
2170
+ {
2171
+ continueCursor: string;
2172
+ isDone: boolean;
2173
+ page: Array<string>;
2174
+ pageStatus?: "SplitRecommended" | "SplitRequired" | null;
2175
+ splitCursor?: string | null;
2176
+ }
2177
+ >;
2178
+ };
2179
+ vector: {
2180
+ index: {
2181
+ deleteBatch: FunctionReference<
2182
+ "mutation",
2183
+ "public",
2184
+ {
2185
+ ids: Array<
2186
+ | string
2187
+ | string
2188
+ | string
2189
+ | string
2190
+ | string
2191
+ | string
2192
+ | string
2193
+ | string
2194
+ | string
2195
+ | string
2196
+ >;
2197
+ },
2198
+ null
2199
+ >;
2200
+ deleteBatchForThread: FunctionReference<
2201
+ "mutation",
2202
+ "public",
2203
+ {
2204
+ cursor?: string;
2205
+ limit: number;
2206
+ model: string;
2207
+ threadId: string;
2208
+ vectorDimension:
2209
+ | 128
2210
+ | 256
2211
+ | 512
2212
+ | 768
2213
+ | 1024
2214
+ | 1408
2215
+ | 1536
2216
+ | 2048
2217
+ | 3072
2218
+ | 4096;
2219
+ },
2220
+ { continueCursor: string; isDone: boolean }
2221
+ >;
2222
+ insertBatch: FunctionReference<
2223
+ "mutation",
2224
+ "public",
2225
+ {
2226
+ vectorDimension:
2227
+ | 128
2228
+ | 256
2229
+ | 512
2230
+ | 768
2231
+ | 1024
2232
+ | 1408
2233
+ | 1536
2234
+ | 2048
2235
+ | 3072
2236
+ | 4096;
2237
+ vectors: Array<{
2238
+ messageId?: string;
2239
+ model: string;
2240
+ table: string;
2241
+ threadId?: string;
2242
+ userId?: string;
2243
+ vector: Array<number>;
2244
+ }>;
2245
+ },
2246
+ Array<
2247
+ | string
2248
+ | string
2249
+ | string
2250
+ | string
2251
+ | string
2252
+ | string
2253
+ | string
2254
+ | string
2255
+ | string
2256
+ | string
2257
+ >
2258
+ >;
2259
+ paginate: FunctionReference<
2260
+ "query",
2261
+ "public",
2262
+ {
2263
+ cursor?: string;
2264
+ limit: number;
2265
+ table?: string;
2266
+ targetModel: string;
2267
+ vectorDimension:
2268
+ | 128
2269
+ | 256
2270
+ | 512
2271
+ | 768
2272
+ | 1024
2273
+ | 1408
2274
+ | 1536
2275
+ | 2048
2276
+ | 3072
2277
+ | 4096;
2278
+ },
2279
+ {
2280
+ continueCursor: string;
2281
+ ids: Array<
2282
+ | string
2283
+ | string
2284
+ | string
2285
+ | string
2286
+ | string
2287
+ | string
2288
+ | string
2289
+ | string
2290
+ | string
2291
+ | string
2292
+ >;
2293
+ isDone: boolean;
2294
+ }
2295
+ >;
2296
+ updateBatch: FunctionReference<
2297
+ "mutation",
2298
+ "public",
2299
+ {
2300
+ vectors: Array<{
2301
+ id:
2302
+ | string
2303
+ | string
2304
+ | string
2305
+ | string
2306
+ | string
2307
+ | string
2308
+ | string
2309
+ | string
2310
+ | string
2311
+ | string;
2312
+ model: string;
2313
+ vector: Array<number>;
2314
+ }>;
2315
+ },
2316
+ null
2317
+ >;
2318
+ };
2319
+ };
2320
+ };
2321
+ // For now fullApiWithMounts is only fullApi which provides
2322
+ // jump-to-definition in component client code.
2323
+ // Use Mounts for the same type without the inference.
2324
+ declare const fullApiWithMounts: typeof fullApi;
2325
+
2326
+ export declare const api: FilterApi<
2327
+ typeof fullApiWithMounts,
2328
+ FunctionReference<any, "public">
2329
+ >;
2330
+ export declare const internal: FilterApi<
2331
+ typeof fullApiWithMounts,
2332
+ FunctionReference<any, "internal">
2333
+ >;
2334
+
2335
+ export declare const components: {};