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