@fatagnus/convex-feedback 0.2.7 → 0.2.9

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