@convex-dev/agent 0.2.12 → 0.3.1

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