@convex-dev/agent 0.0.17-alpha.2 → 0.1.0-alpha.0

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 (49) hide show
  1. package/README.md +25 -7
  2. package/dist/commonjs/client/index.d.ts +229 -756
  3. package/dist/commonjs/client/index.d.ts.map +1 -1
  4. package/dist/commonjs/client/index.js +135 -140
  5. package/dist/commonjs/client/index.js.map +1 -1
  6. package/dist/commonjs/component/messages.d.ts +208 -896
  7. package/dist/commonjs/component/messages.d.ts.map +1 -1
  8. package/dist/commonjs/component/messages.js +117 -109
  9. package/dist/commonjs/component/messages.js.map +1 -1
  10. package/dist/commonjs/component/schema.d.ts +1278 -580
  11. package/dist/commonjs/component/schema.d.ts.map +1 -1
  12. package/dist/commonjs/component/schema.js +28 -21
  13. package/dist/commonjs/component/schema.js.map +1 -1
  14. package/dist/commonjs/component/users.d.ts +5 -2
  15. package/dist/commonjs/component/users.d.ts.map +1 -1
  16. package/dist/commonjs/component/users.js +57 -27
  17. package/dist/commonjs/component/users.js.map +1 -1
  18. package/dist/commonjs/validators.d.ts +44 -59
  19. package/dist/commonjs/validators.d.ts.map +1 -1
  20. package/dist/commonjs/validators.js +10 -12
  21. package/dist/commonjs/validators.js.map +1 -1
  22. package/dist/esm/client/index.d.ts +229 -756
  23. package/dist/esm/client/index.d.ts.map +1 -1
  24. package/dist/esm/client/index.js +135 -140
  25. package/dist/esm/client/index.js.map +1 -1
  26. package/dist/esm/component/messages.d.ts +208 -896
  27. package/dist/esm/component/messages.d.ts.map +1 -1
  28. package/dist/esm/component/messages.js +117 -109
  29. package/dist/esm/component/messages.js.map +1 -1
  30. package/dist/esm/component/schema.d.ts +1278 -580
  31. package/dist/esm/component/schema.d.ts.map +1 -1
  32. package/dist/esm/component/schema.js +28 -21
  33. package/dist/esm/component/schema.js.map +1 -1
  34. package/dist/esm/component/users.d.ts +5 -2
  35. package/dist/esm/component/users.d.ts.map +1 -1
  36. package/dist/esm/component/users.js +57 -27
  37. package/dist/esm/component/users.js.map +1 -1
  38. package/dist/esm/validators.d.ts +44 -59
  39. package/dist/esm/validators.d.ts.map +1 -1
  40. package/dist/esm/validators.js +10 -12
  41. package/dist/esm/validators.js.map +1 -1
  42. package/package.json +2 -2
  43. package/src/client/index.ts +215 -199
  44. package/src/component/_generated/api.d.ts +19 -94
  45. package/src/component/messages.test.ts +110 -3
  46. package/src/component/messages.ts +176 -154
  47. package/src/component/schema.ts +34 -21
  48. package/src/component/users.ts +57 -32
  49. package/src/validators.ts +12 -15
@@ -54,697 +54,18 @@ export declare const updateThread: import("convex/server").RegisteredMutation<"p
54
54
  _id: string;
55
55
  }>>;
56
56
  export declare function deleteMessage(ctx: MutationCtx, messageDoc: Doc<"messages">): Promise<void>;
57
- export declare const vMessageDoc: import("convex/values").VObject<{
58
- id?: string | undefined;
59
- userId?: string | undefined;
60
- parentMessageId?: import("convex/values").GenericId<"messages"> | undefined;
61
- stepId?: import("convex/values").GenericId<"steps"> | undefined;
62
- embeddingId?: import("convex/values").GenericId<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096"> | undefined;
63
- error?: string | undefined;
64
- agentName?: string | undefined;
65
- model?: string | undefined;
66
- provider?: string | undefined;
67
- providerOptions?: Record<string, Record<string, any>> | undefined;
68
- message?: {
69
- providerOptions?: Record<string, Record<string, any>> | undefined;
70
- role: "user";
71
- content: string | ({
72
- providerOptions?: Record<string, Record<string, any>> | undefined;
73
- type: "text";
74
- text: string;
75
- } | {
76
- providerOptions?: Record<string, Record<string, any>> | undefined;
77
- mimeType?: string | undefined;
78
- type: "image";
79
- image: string | ArrayBuffer;
80
- } | {
81
- providerOptions?: Record<string, Record<string, any>> | undefined;
82
- type: "file";
83
- mimeType: string;
84
- data: string | ArrayBuffer;
85
- })[];
86
- } | {
87
- providerOptions?: Record<string, Record<string, any>> | undefined;
88
- role: "assistant";
89
- content: string | ({
90
- providerOptions?: Record<string, Record<string, any>> | undefined;
91
- type: "text";
92
- text: string;
93
- } | {
94
- providerOptions?: Record<string, Record<string, any>> | undefined;
95
- type: "file";
96
- mimeType: string;
97
- data: string | ArrayBuffer;
98
- } | {
99
- providerOptions?: Record<string, Record<string, any>> | undefined;
100
- signature?: string | undefined;
101
- type: "reasoning";
102
- text: string;
103
- } | {
104
- providerOptions?: Record<string, Record<string, any>> | undefined;
105
- type: "redacted-reasoning";
106
- data: string;
107
- } | {
108
- providerOptions?: Record<string, Record<string, any>> | undefined;
109
- type: "tool-call";
110
- toolCallId: string;
111
- toolName: string;
112
- args: any;
113
- })[];
114
- } | {
115
- providerOptions?: Record<string, Record<string, any>> | undefined;
116
- role: "tool";
117
- content: {
118
- providerOptions?: Record<string, Record<string, any>> | undefined;
119
- args?: any;
120
- experimental_content?: ({
121
- type: "text";
122
- text: string;
123
- } | {
124
- mimeType?: string | undefined;
125
- type: "image";
126
- data: string;
127
- })[] | undefined;
128
- isError?: boolean | undefined;
129
- type: "tool-result";
130
- toolCallId: string;
131
- toolName: string;
132
- result: any;
133
- }[];
134
- } | {
135
- providerOptions?: Record<string, Record<string, any>> | undefined;
136
- role: "system";
137
- content: string;
138
- } | undefined;
139
- text?: string | undefined;
140
- reasoning?: string | undefined;
141
- files?: {
142
- data?: string | ArrayBuffer | undefined;
143
- url?: string | undefined;
144
- fileId?: import("convex/values").GenericId<"files"> | undefined;
145
- mimeType: string;
146
- }[] | undefined;
147
- usage?: {
148
- promptTokens: number;
149
- completionTokens: number;
150
- totalTokens: number;
151
- } | undefined;
152
- providerMetadata?: Record<string, Record<string, any>> | undefined;
153
- sources?: {
154
- title?: string | undefined;
155
- providerOptions?: Record<string, Record<string, any>> | undefined;
156
- id: string;
157
- url: string;
158
- sourceType: "url";
159
- }[] | undefined;
160
- reasoningDetails?: ({
161
- signature?: string | undefined;
162
- type: "text";
163
- text: string;
164
- } | {
165
- type: "redacted";
166
- data: string;
167
- })[] | undefined;
168
- warnings?: ({
169
- details?: string | undefined;
170
- type: "unsupported-setting";
171
- setting: string;
172
- } | {
173
- details?: string | undefined;
174
- type: "unsupported-tool";
175
- tool: any;
176
- } | {
177
- type: "other";
178
- message: string;
179
- })[] | undefined;
180
- finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
181
- status: "pending" | "success" | "failed";
182
- order: number;
183
- threadId: import("convex/values").GenericId<"threads">;
184
- stepOrder: number;
185
- tool: boolean;
186
- }, {
187
- id: import("convex/values").VString<string | undefined, "optional">;
188
- userId: import("convex/values").VString<string | undefined, "optional">;
189
- threadId: import("convex/values").VId<import("convex/values").GenericId<"threads">, "required">;
190
- parentMessageId: import("convex/values").VId<import("convex/values").GenericId<"messages"> | undefined, "optional">;
191
- stepId: import("convex/values").VId<import("convex/values").GenericId<"steps"> | undefined, "optional">;
192
- order: import("convex/values").VFloat64<number, "required">;
193
- stepOrder: import("convex/values").VFloat64<number, "required">;
194
- embeddingId: import("convex/values").VUnion<import("convex/values").GenericId<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096"> | undefined, import("convex/values").VId<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096", "required">[], "optional", never>;
195
- error: import("convex/values").VString<string | undefined, "optional">;
196
- status: import("convex/values").VUnion<"pending" | "success" | "failed", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"success", "required">, import("convex/values").VLiteral<"failed", "required">], "required", never>;
197
- agentName: import("convex/values").VString<string | undefined, "optional">;
198
- model: import("convex/values").VString<string | undefined, "optional">;
199
- provider: import("convex/values").VString<string | undefined, "optional">;
200
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
201
- message: import("convex/values").VUnion<{
202
- providerOptions?: Record<string, Record<string, any>> | undefined;
203
- role: "user";
204
- content: string | ({
205
- providerOptions?: Record<string, Record<string, any>> | undefined;
206
- type: "text";
207
- text: string;
208
- } | {
209
- providerOptions?: Record<string, Record<string, any>> | undefined;
210
- mimeType?: string | undefined;
211
- type: "image";
212
- image: string | ArrayBuffer;
213
- } | {
214
- providerOptions?: Record<string, Record<string, any>> | undefined;
215
- type: "file";
216
- mimeType: string;
217
- data: string | ArrayBuffer;
218
- })[];
219
- } | {
220
- providerOptions?: Record<string, Record<string, any>> | undefined;
221
- role: "assistant";
222
- content: string | ({
223
- providerOptions?: Record<string, Record<string, any>> | undefined;
224
- type: "text";
225
- text: string;
226
- } | {
227
- providerOptions?: Record<string, Record<string, any>> | undefined;
228
- type: "file";
229
- mimeType: string;
230
- data: string | ArrayBuffer;
231
- } | {
232
- providerOptions?: Record<string, Record<string, any>> | undefined;
233
- signature?: string | undefined;
234
- type: "reasoning";
235
- text: string;
236
- } | {
237
- providerOptions?: Record<string, Record<string, any>> | undefined;
238
- type: "redacted-reasoning";
239
- data: string;
240
- } | {
241
- providerOptions?: Record<string, Record<string, any>> | undefined;
242
- type: "tool-call";
243
- toolCallId: string;
244
- toolName: string;
245
- args: any;
246
- })[];
247
- } | {
248
- providerOptions?: Record<string, Record<string, any>> | undefined;
249
- role: "tool";
250
- content: {
251
- providerOptions?: Record<string, Record<string, any>> | undefined;
252
- args?: any;
253
- experimental_content?: ({
254
- type: "text";
255
- text: string;
256
- } | {
257
- mimeType?: string | undefined;
258
- type: "image";
259
- data: string;
260
- })[] | undefined;
261
- isError?: boolean | undefined;
262
- type: "tool-result";
263
- toolCallId: string;
264
- toolName: string;
265
- result: any;
266
- }[];
267
- } | {
268
- providerOptions?: Record<string, Record<string, any>> | undefined;
269
- role: "system";
270
- content: string;
271
- } | undefined, [import("convex/values").VObject<{
272
- providerOptions?: Record<string, Record<string, any>> | undefined;
273
- role: "user";
274
- content: string | ({
275
- providerOptions?: Record<string, Record<string, any>> | undefined;
276
- type: "text";
277
- text: string;
278
- } | {
279
- providerOptions?: Record<string, Record<string, any>> | undefined;
280
- mimeType?: string | undefined;
281
- type: "image";
282
- image: string | ArrayBuffer;
283
- } | {
284
- providerOptions?: Record<string, Record<string, any>> | undefined;
285
- type: "file";
286
- mimeType: string;
287
- data: string | ArrayBuffer;
288
- })[];
289
- }, {
290
- role: import("convex/values").VLiteral<"user", "required">;
291
- content: import("convex/values").VUnion<string | ({
292
- providerOptions?: Record<string, Record<string, any>> | undefined;
293
- type: "text";
294
- text: string;
295
- } | {
296
- providerOptions?: Record<string, Record<string, any>> | undefined;
297
- mimeType?: string | undefined;
298
- type: "image";
299
- image: string | ArrayBuffer;
300
- } | {
301
- providerOptions?: Record<string, Record<string, any>> | undefined;
302
- type: "file";
303
- mimeType: string;
304
- data: string | ArrayBuffer;
305
- })[], [import("convex/values").VString<string, "required">, import("convex/values").VArray<({
306
- providerOptions?: Record<string, Record<string, any>> | undefined;
307
- type: "text";
308
- text: string;
309
- } | {
310
- providerOptions?: Record<string, Record<string, any>> | undefined;
311
- mimeType?: string | undefined;
312
- type: "image";
313
- image: string | ArrayBuffer;
314
- } | {
315
- providerOptions?: Record<string, Record<string, any>> | undefined;
316
- type: "file";
317
- mimeType: string;
318
- data: string | ArrayBuffer;
319
- })[], import("convex/values").VUnion<{
320
- providerOptions?: Record<string, Record<string, any>> | undefined;
321
- type: "text";
322
- text: string;
323
- } | {
324
- providerOptions?: Record<string, Record<string, any>> | undefined;
325
- mimeType?: string | undefined;
326
- type: "image";
327
- image: string | ArrayBuffer;
328
- } | {
329
- providerOptions?: Record<string, Record<string, any>> | undefined;
330
- type: "file";
331
- mimeType: string;
332
- data: string | ArrayBuffer;
333
- }, [import("convex/values").VObject<{
334
- providerOptions?: Record<string, Record<string, any>> | undefined;
335
- type: "text";
336
- text: string;
337
- }, {
338
- type: import("convex/values").VLiteral<"text", "required">;
339
- text: import("convex/values").VString<string, "required">;
340
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
341
- }, "required", "type" | "providerOptions" | "text" | `providerOptions.${string}`>, import("convex/values").VObject<{
342
- providerOptions?: Record<string, Record<string, any>> | undefined;
343
- mimeType?: string | undefined;
344
- type: "image";
345
- image: string | ArrayBuffer;
346
- }, {
347
- type: import("convex/values").VLiteral<"image", "required">;
348
- image: import("convex/values").VUnion<string | ArrayBuffer, [import("convex/values").VString<string, "required">, import("convex/values").VBytes<ArrayBuffer, "required">], "required", never>;
349
- mimeType: import("convex/values").VString<string | undefined, "optional">;
350
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
351
- }, "required", "type" | "providerOptions" | `providerOptions.${string}` | "image" | "mimeType">, import("convex/values").VObject<{
352
- providerOptions?: Record<string, Record<string, any>> | undefined;
353
- type: "file";
354
- mimeType: string;
355
- data: string | ArrayBuffer;
356
- }, {
357
- type: import("convex/values").VLiteral<"file", "required">;
358
- data: import("convex/values").VUnion<string | ArrayBuffer, [import("convex/values").VString<string, "required">, import("convex/values").VBytes<ArrayBuffer, "required">], "required", never>;
359
- mimeType: import("convex/values").VString<string, "required">;
360
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
361
- }, "required", "type" | "providerOptions" | `providerOptions.${string}` | "mimeType" | "data">], "required", "type" | "providerOptions" | "text" | `providerOptions.${string}` | "image" | "mimeType" | "data">, "required">], "required", never>;
362
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
363
- }, "required", "providerOptions" | "role" | `providerOptions.${string}` | "content">, import("convex/values").VObject<{
364
- providerOptions?: Record<string, Record<string, any>> | undefined;
365
- role: "assistant";
366
- content: string | ({
367
- providerOptions?: Record<string, Record<string, any>> | undefined;
368
- type: "text";
369
- text: string;
370
- } | {
371
- providerOptions?: Record<string, Record<string, any>> | undefined;
372
- type: "file";
373
- mimeType: string;
374
- data: string | ArrayBuffer;
375
- } | {
376
- providerOptions?: Record<string, Record<string, any>> | undefined;
377
- signature?: string | undefined;
378
- type: "reasoning";
379
- text: string;
380
- } | {
381
- providerOptions?: Record<string, Record<string, any>> | undefined;
382
- type: "redacted-reasoning";
383
- data: string;
384
- } | {
385
- providerOptions?: Record<string, Record<string, any>> | undefined;
386
- type: "tool-call";
387
- toolCallId: string;
388
- toolName: string;
389
- args: any;
390
- })[];
391
- }, {
392
- role: import("convex/values").VLiteral<"assistant", "required">;
393
- content: import("convex/values").VUnion<string | ({
394
- providerOptions?: Record<string, Record<string, any>> | undefined;
395
- type: "text";
396
- text: string;
397
- } | {
398
- providerOptions?: Record<string, Record<string, any>> | undefined;
399
- type: "file";
400
- mimeType: string;
401
- data: string | ArrayBuffer;
402
- } | {
403
- providerOptions?: Record<string, Record<string, any>> | undefined;
404
- signature?: string | undefined;
405
- type: "reasoning";
406
- text: string;
407
- } | {
408
- providerOptions?: Record<string, Record<string, any>> | undefined;
409
- type: "redacted-reasoning";
410
- data: string;
411
- } | {
412
- providerOptions?: Record<string, Record<string, any>> | undefined;
413
- type: "tool-call";
414
- toolCallId: string;
415
- toolName: string;
416
- args: any;
417
- })[], [import("convex/values").VString<string, "required">, import("convex/values").VArray<({
418
- providerOptions?: Record<string, Record<string, any>> | undefined;
419
- type: "text";
420
- text: string;
421
- } | {
422
- providerOptions?: Record<string, Record<string, any>> | undefined;
423
- type: "file";
424
- mimeType: string;
425
- data: string | ArrayBuffer;
426
- } | {
427
- providerOptions?: Record<string, Record<string, any>> | undefined;
428
- signature?: string | undefined;
429
- type: "reasoning";
430
- text: string;
431
- } | {
432
- providerOptions?: Record<string, Record<string, any>> | undefined;
433
- type: "redacted-reasoning";
434
- data: string;
435
- } | {
436
- providerOptions?: Record<string, Record<string, any>> | undefined;
437
- type: "tool-call";
438
- toolCallId: string;
439
- toolName: string;
440
- args: any;
441
- })[], import("convex/values").VUnion<{
442
- providerOptions?: Record<string, Record<string, any>> | undefined;
443
- type: "text";
444
- text: string;
445
- } | {
446
- providerOptions?: Record<string, Record<string, any>> | undefined;
447
- type: "file";
448
- mimeType: string;
449
- data: string | ArrayBuffer;
450
- } | {
451
- providerOptions?: Record<string, Record<string, any>> | undefined;
452
- signature?: string | undefined;
453
- type: "reasoning";
454
- text: string;
455
- } | {
456
- providerOptions?: Record<string, Record<string, any>> | undefined;
457
- type: "redacted-reasoning";
458
- data: string;
459
- } | {
460
- providerOptions?: Record<string, Record<string, any>> | undefined;
461
- type: "tool-call";
462
- toolCallId: string;
463
- toolName: string;
464
- args: any;
465
- }, [import("convex/values").VObject<{
466
- providerOptions?: Record<string, Record<string, any>> | undefined;
467
- type: "text";
468
- text: string;
469
- }, {
470
- type: import("convex/values").VLiteral<"text", "required">;
471
- text: import("convex/values").VString<string, "required">;
472
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
473
- }, "required", "type" | "providerOptions" | "text" | `providerOptions.${string}`>, import("convex/values").VObject<{
474
- providerOptions?: Record<string, Record<string, any>> | undefined;
475
- type: "file";
476
- mimeType: string;
477
- data: string | ArrayBuffer;
478
- }, {
479
- type: import("convex/values").VLiteral<"file", "required">;
480
- data: import("convex/values").VUnion<string | ArrayBuffer, [import("convex/values").VString<string, "required">, import("convex/values").VBytes<ArrayBuffer, "required">], "required", never>;
481
- mimeType: import("convex/values").VString<string, "required">;
482
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
483
- }, "required", "type" | "providerOptions" | `providerOptions.${string}` | "mimeType" | "data">, import("convex/values").VObject<{
484
- providerOptions?: Record<string, Record<string, any>> | undefined;
485
- signature?: string | undefined;
486
- type: "reasoning";
487
- text: string;
488
- }, {
489
- type: import("convex/values").VLiteral<"reasoning", "required">;
490
- text: import("convex/values").VString<string, "required">;
491
- signature: import("convex/values").VString<string | undefined, "optional">;
492
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
493
- }, "required", "type" | "providerOptions" | "text" | `providerOptions.${string}` | "signature">, import("convex/values").VObject<{
494
- providerOptions?: Record<string, Record<string, any>> | undefined;
495
- type: "redacted-reasoning";
496
- data: string;
497
- }, {
498
- type: import("convex/values").VLiteral<"redacted-reasoning", "required">;
499
- data: import("convex/values").VString<string, "required">;
500
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
501
- }, "required", "type" | "providerOptions" | `providerOptions.${string}` | "data">, import("convex/values").VObject<{
502
- providerOptions?: Record<string, Record<string, any>> | undefined;
503
- type: "tool-call";
504
- toolCallId: string;
505
- toolName: string;
506
- args: any;
507
- }, {
508
- type: import("convex/values").VLiteral<"tool-call", "required">;
509
- toolCallId: import("convex/values").VString<string, "required">;
510
- toolName: import("convex/values").VString<string, "required">;
511
- args: import("convex/values").VAny<any, "required", string>;
512
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
513
- }, "required", "type" | "providerOptions" | `providerOptions.${string}` | "toolCallId" | "toolName" | "args" | `args.${string}`>], "required", "type" | "providerOptions" | "text" | `providerOptions.${string}` | "mimeType" | "data" | "signature" | "toolCallId" | "toolName" | "args" | `args.${string}`>, "required">], "required", never>;
514
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
515
- }, "required", "providerOptions" | "role" | `providerOptions.${string}` | "content">, import("convex/values").VObject<{
516
- providerOptions?: Record<string, Record<string, any>> | undefined;
517
- role: "tool";
518
- content: {
519
- providerOptions?: Record<string, Record<string, any>> | undefined;
520
- args?: any;
521
- experimental_content?: ({
522
- type: "text";
523
- text: string;
524
- } | {
525
- mimeType?: string | undefined;
526
- type: "image";
527
- data: string;
528
- })[] | undefined;
529
- isError?: boolean | undefined;
530
- type: "tool-result";
531
- toolCallId: string;
532
- toolName: string;
533
- result: any;
534
- }[];
535
- }, {
536
- role: import("convex/values").VLiteral<"tool", "required">;
537
- content: import("convex/values").VArray<{
538
- providerOptions?: Record<string, Record<string, any>> | undefined;
539
- args?: any;
540
- experimental_content?: ({
541
- type: "text";
542
- text: string;
543
- } | {
544
- mimeType?: string | undefined;
545
- type: "image";
546
- data: string;
547
- })[] | undefined;
548
- isError?: boolean | undefined;
549
- type: "tool-result";
550
- toolCallId: string;
551
- toolName: string;
552
- result: any;
553
- }[], import("convex/values").VObject<{
554
- providerOptions?: Record<string, Record<string, any>> | undefined;
555
- args?: any;
556
- experimental_content?: ({
557
- type: "text";
558
- text: string;
559
- } | {
560
- mimeType?: string | undefined;
561
- type: "image";
562
- data: string;
563
- })[] | undefined;
564
- isError?: boolean | undefined;
565
- type: "tool-result";
566
- toolCallId: string;
567
- toolName: string;
568
- result: any;
569
- }, {
570
- type: import("convex/values").VLiteral<"tool-result", "required">;
571
- toolCallId: import("convex/values").VString<string, "required">;
572
- toolName: import("convex/values").VString<string, "required">;
573
- result: import("convex/values").VAny<any, "required", string>;
574
- args: import("convex/values").VAny<any, "optional", string>;
575
- experimental_content: import("convex/values").VArray<({
576
- type: "text";
577
- text: string;
578
- } | {
579
- mimeType?: string | undefined;
580
- type: "image";
581
- data: string;
582
- })[] | undefined, import("convex/values").VUnion<{
583
- type: "text";
584
- text: string;
585
- } | {
586
- mimeType?: string | undefined;
587
- type: "image";
588
- data: string;
589
- }, [import("convex/values").VObject<{
590
- type: "text";
591
- text: string;
592
- }, {
593
- type: import("convex/values").VLiteral<"text", "required">;
594
- text: import("convex/values").VString<string, "required">;
595
- }, "required", "type" | "text">, import("convex/values").VObject<{
596
- mimeType?: string | undefined;
597
- type: "image";
598
- data: string;
599
- }, {
600
- type: import("convex/values").VLiteral<"image", "required">;
601
- data: import("convex/values").VString<string, "required">;
602
- mimeType: import("convex/values").VString<string | undefined, "optional">;
603
- }, "required", "type" | "mimeType" | "data">], "required", "type" | "text" | "mimeType" | "data">, "optional">;
604
- isError: import("convex/values").VBoolean<boolean | undefined, "optional">;
605
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
606
- }, "required", "type" | "providerOptions" | `providerOptions.${string}` | "toolCallId" | "toolName" | "args" | `args.${string}` | "result" | "experimental_content" | "isError" | `result.${string}`>, "required">;
607
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
608
- }, "required", "providerOptions" | "role" | `providerOptions.${string}` | "content">, import("convex/values").VObject<{
609
- providerOptions?: Record<string, Record<string, any>> | undefined;
610
- role: "system";
611
- content: string;
612
- }, {
613
- role: import("convex/values").VLiteral<"system", "required">;
614
- content: import("convex/values").VString<string, "required">;
615
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
616
- }, "required", "providerOptions" | "role" | `providerOptions.${string}` | "content">], "optional", "providerOptions" | "role" | `providerOptions.${string}` | "content">;
617
- tool: import("convex/values").VBoolean<boolean, "required">;
618
- text: import("convex/values").VString<string | undefined, "optional">;
619
- files: import("convex/values").VArray<{
620
- data?: string | ArrayBuffer | undefined;
621
- url?: string | undefined;
622
- fileId?: import("convex/values").GenericId<"files"> | undefined;
623
- mimeType: string;
624
- }[] | undefined, import("convex/values").VObject<{
625
- data?: string | ArrayBuffer | undefined;
626
- url?: string | undefined;
627
- fileId?: import("convex/values").GenericId<"files"> | undefined;
628
- mimeType: string;
629
- }, {
630
- data: import("convex/values").VUnion<string | ArrayBuffer | undefined, [import("convex/values").VBytes<ArrayBuffer, "required">, import("convex/values").VString<string, "required">], "optional", never>;
631
- url: import("convex/values").VString<string | undefined, "optional">;
632
- mimeType: import("convex/values").VString<string, "required">;
633
- fileId: import("convex/values").VId<import("convex/values").GenericId<"files"> | undefined, "optional">;
634
- }, "required", "mimeType" | "data" | "url" | "fileId">, "optional">;
635
- usage: import("convex/values").VObject<{
636
- promptTokens: number;
637
- completionTokens: number;
638
- totalTokens: number;
639
- } | undefined, {
640
- promptTokens: import("convex/values").VFloat64<number, "required">;
641
- completionTokens: import("convex/values").VFloat64<number, "required">;
642
- totalTokens: import("convex/values").VFloat64<number, "required">;
643
- }, "optional", "promptTokens" | "completionTokens" | "totalTokens">;
644
- providerMetadata: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
645
- sources: import("convex/values").VArray<{
646
- title?: string | undefined;
647
- providerOptions?: Record<string, Record<string, any>> | undefined;
648
- id: string;
649
- url: string;
650
- sourceType: "url";
651
- }[] | undefined, import("convex/values").VObject<{
652
- title?: string | undefined;
653
- providerOptions?: Record<string, Record<string, any>> | undefined;
654
- id: string;
655
- url: string;
656
- sourceType: "url";
657
- }, {
658
- sourceType: import("convex/values").VLiteral<"url", "required">;
659
- id: import("convex/values").VString<string, "required">;
660
- url: import("convex/values").VString<string, "required">;
661
- title: import("convex/values").VString<string | undefined, "optional">;
662
- providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
663
- }, "required", "id" | "title" | "providerOptions" | `providerOptions.${string}` | "url" | "sourceType">, "optional">;
664
- reasoning: import("convex/values").VString<string | undefined, "optional">;
665
- reasoningDetails: import("convex/values").VArray<({
666
- signature?: string | undefined;
667
- type: "text";
668
- text: string;
669
- } | {
670
- type: "redacted";
671
- data: string;
672
- })[] | undefined, import("convex/values").VUnion<{
673
- signature?: string | undefined;
674
- type: "text";
675
- text: string;
676
- } | {
677
- type: "redacted";
678
- data: string;
679
- }, [import("convex/values").VObject<{
680
- signature?: string | undefined;
681
- type: "text";
682
- text: string;
683
- }, {
684
- type: import("convex/values").VLiteral<"text", "required">;
685
- text: import("convex/values").VString<string, "required">;
686
- signature: import("convex/values").VString<string | undefined, "optional">;
687
- }, "required", "type" | "text" | "signature">, import("convex/values").VObject<{
688
- type: "redacted";
689
- data: string;
690
- }, {
691
- type: import("convex/values").VLiteral<"redacted", "required">;
692
- data: import("convex/values").VString<string, "required">;
693
- }, "required", "type" | "data">], "required", "type" | "text" | "data" | "signature">, "optional">;
694
- warnings: import("convex/values").VArray<({
695
- details?: string | undefined;
696
- type: "unsupported-setting";
697
- setting: string;
698
- } | {
699
- details?: string | undefined;
700
- type: "unsupported-tool";
701
- tool: any;
702
- } | {
703
- type: "other";
704
- message: string;
705
- })[] | undefined, import("convex/values").VUnion<{
706
- details?: string | undefined;
707
- type: "unsupported-setting";
708
- setting: string;
709
- } | {
710
- details?: string | undefined;
711
- type: "unsupported-tool";
712
- tool: any;
713
- } | {
714
- type: "other";
715
- message: string;
716
- }, [import("convex/values").VObject<{
717
- details?: string | undefined;
718
- type: "unsupported-setting";
719
- setting: string;
720
- }, {
721
- type: import("convex/values").VLiteral<"unsupported-setting", "required">;
722
- setting: import("convex/values").VString<string, "required">;
723
- details: import("convex/values").VString<string | undefined, "optional">;
724
- }, "required", "type" | "setting" | "details">, import("convex/values").VObject<{
725
- details?: string | undefined;
726
- type: "unsupported-tool";
727
- tool: any;
728
- }, {
729
- type: import("convex/values").VLiteral<"unsupported-tool", "required">;
730
- tool: import("convex/values").VAny<any, "required", string>;
731
- details: import("convex/values").VString<string | undefined, "optional">;
732
- }, "required", "type" | "tool" | "details" | `tool.${string}`>, import("convex/values").VObject<{
733
- type: "other";
734
- message: string;
735
- }, {
736
- type: import("convex/values").VLiteral<"other", "required">;
737
- message: import("convex/values").VString<string, "required">;
738
- }, "required", "type" | "message">], "required", "type" | "message" | "tool" | "setting" | "details" | `tool.${string}`>, "optional">;
739
- finishReason: import("convex/values").VUnion<"length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined, [import("convex/values").VLiteral<"stop", "required">, import("convex/values").VLiteral<"length", "required">, import("convex/values").VLiteral<"content-filter", "required">, import("convex/values").VLiteral<"tool-calls", "required">, import("convex/values").VLiteral<"error", "required">, import("convex/values").VLiteral<"other", "required">, import("convex/values").VLiteral<"unknown", "required">], "optional", never>;
740
- }, "required", "id" | "status" | "userId" | "order" | "threadId" | "parentMessageId" | "stepId" | "stepOrder" | "embeddingId" | "error" | "agentName" | "model" | "provider" | "providerOptions" | "message" | "text" | `providerOptions.${string}` | "reasoning" | "tool" | "files" | "usage" | "providerMetadata" | "sources" | "reasoningDetails" | "warnings" | "finishReason" | "message.providerOptions" | "message.role" | `message.providerOptions.${string}` | "message.content" | "usage.promptTokens" | "usage.completionTokens" | "usage.totalTokens" | `providerMetadata.${string}`>;
741
57
  export declare const messageStatuses: ("pending" | "success" | "failed")[];
742
58
  export declare const addMessages: import("convex/server").RegisteredMutation<"public", {
743
59
  userId?: string | undefined;
744
- parentMessageId?: import("convex/values").GenericId<"messages"> | undefined;
745
- stepId?: import("convex/values").GenericId<"steps"> | undefined;
746
60
  pending?: boolean | undefined;
747
61
  agentName?: string | undefined;
62
+ stepId?: import("convex/values").GenericId<"steps"> | undefined;
63
+ embeddings?: {
64
+ model: string;
65
+ dimension: 128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096;
66
+ vectors: (number[] | null)[];
67
+ } | undefined;
68
+ promptMessageId?: import("convex/values").GenericId<"messages"> | undefined;
748
69
  failPendingSteps?: boolean | undefined;
749
70
  threadId: import("convex/values").GenericId<"threads">;
750
71
  messages: {
@@ -794,11 +115,6 @@ export declare const addMessages: import("convex/server").RegisteredMutation<"pu
794
115
  message: string;
795
116
  })[] | undefined;
796
117
  finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
797
- embedding?: {
798
- model: string;
799
- vector: number[];
800
- dimension: 128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096;
801
- } | undefined;
802
118
  message: {
803
119
  providerOptions?: Record<string, Record<string, any>> | undefined;
804
120
  role: "user";
@@ -877,8 +193,6 @@ export declare const addMessages: import("convex/server").RegisteredMutation<"pu
877
193
  _creationTime: number;
878
194
  id?: string | undefined;
879
195
  userId?: string | undefined;
880
- parentMessageId?: import("convex/values").GenericId<"messages"> | undefined;
881
- stepId?: import("convex/values").GenericId<"steps"> | undefined;
882
196
  embeddingId?: import("convex/values").GenericId<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096"> | undefined;
883
197
  error?: string | undefined;
884
198
  agentName?: string | undefined;
@@ -998,6 +312,8 @@ export declare const addMessages: import("convex/server").RegisteredMutation<"pu
998
312
  message: string;
999
313
  })[] | undefined;
1000
314
  finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
315
+ parentMessageId?: import("convex/values").GenericId<"messages"> | undefined;
316
+ stepId?: import("convex/values").GenericId<"steps"> | undefined;
1001
317
  status: "pending" | "success" | "failed";
1002
318
  order: number;
1003
319
  threadId: import("convex/values").GenericId<"threads">;
@@ -1005,13 +321,11 @@ export declare const addMessages: import("convex/server").RegisteredMutation<"pu
1005
321
  tool: boolean;
1006
322
  }[];
1007
323
  }>>;
1008
- export declare function getMaxMessage(ctx: QueryCtx, threadId: Id<"threads"> | undefined, userId: string | undefined): Promise<{
324
+ export declare function getMaxMessage(ctx: QueryCtx, threadId: Id<"threads">, order?: number): Promise<{
1009
325
  _id: import("convex/values").GenericId<"messages">;
1010
326
  _creationTime: number;
1011
327
  id?: string | undefined;
1012
328
  userId?: string | undefined;
1013
- parentMessageId?: import("convex/values").GenericId<"messages"> | undefined;
1014
- stepId?: import("convex/values").GenericId<"steps"> | undefined;
1015
329
  embeddingId?: import("convex/values").GenericId<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096"> | undefined;
1016
330
  error?: string | undefined;
1017
331
  agentName?: string | undefined;
@@ -1131,6 +445,8 @@ export declare function getMaxMessage(ctx: QueryCtx, threadId: Id<"threads"> | u
1131
445
  message: string;
1132
446
  })[] | undefined;
1133
447
  finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
448
+ parentMessageId?: import("convex/values").GenericId<"messages"> | undefined;
449
+ stepId?: import("convex/values").GenericId<"steps"> | undefined;
1134
450
  status: "pending" | "success" | "failed";
1135
451
  order: number;
1136
452
  threadId: import("convex/values").GenericId<"threads">;
@@ -1141,8 +457,12 @@ export declare const addStep: import("convex/server").RegisteredMutation<"public
1141
457
  userId?: string | undefined;
1142
458
  failPendingSteps?: boolean | undefined;
1143
459
  threadId: import("convex/values").GenericId<"threads">;
1144
- parentMessageId: import("convex/values").GenericId<"messages">;
1145
460
  step: {
461
+ embeddings?: {
462
+ model: string;
463
+ dimension: 128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096;
464
+ vectors: (number[] | null)[];
465
+ } | undefined;
1146
466
  messages: {
1147
467
  id?: string | undefined;
1148
468
  error?: string | undefined;
@@ -1190,11 +510,6 @@ export declare const addStep: import("convex/server").RegisteredMutation<"public
1190
510
  message: string;
1191
511
  })[] | undefined;
1192
512
  finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
1193
- embedding?: {
1194
- model: string;
1195
- vector: number[];
1196
- dimension: 128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096;
1197
- } | undefined;
1198
513
  message: {
1199
514
  providerOptions?: Record<string, Record<string, any>> | undefined;
1200
515
  role: "user";
@@ -1423,14 +738,15 @@ export declare const addStep: import("convex/server").RegisteredMutation<"public
1423
738
  }[];
1424
739
  };
1425
740
  };
741
+ promptMessageId: import("convex/values").GenericId<"messages">;
1426
742
  }, Promise<{
1427
743
  _id: import("convex/values").GenericId<"steps">;
1428
744
  _creationTime: number;
1429
745
  status: "pending" | "success" | "failed";
1430
746
  order: number;
1431
747
  threadId: import("convex/values").GenericId<"threads">;
1432
- parentMessageId: import("convex/values").GenericId<"messages">;
1433
748
  stepOrder: number;
749
+ parentMessageId: import("convex/values").GenericId<"messages">;
1434
750
  step: {
1435
751
  reasoning?: string | undefined;
1436
752
  files?: any[] | undefined;
@@ -1553,125 +869,22 @@ export declare const addStep: import("convex/server").RegisteredMutation<"public
1553
869
  role: "system";
1554
870
  content: string;
1555
871
  };
1556
- }[];
1557
- timestamp: number;
1558
- modelId: string;
1559
- } | undefined;
1560
- text: string;
1561
- finishReason: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown";
1562
- isContinued: boolean;
1563
- stepType: "tool-result" | "initial" | "continue";
1564
- toolCalls: {
1565
- providerOptions?: Record<string, Record<string, any>> | undefined;
1566
- type: "tool-call";
1567
- toolCallId: string;
1568
- toolName: string;
1569
- args: any;
1570
- }[];
1571
- toolResults: {
1572
- providerOptions?: Record<string, Record<string, any>> | undefined;
1573
- args?: any;
1574
- experimental_content?: ({
1575
- type: "text";
1576
- text: string;
1577
- } | {
1578
- mimeType?: string | undefined;
1579
- type: "image";
1580
- data: string;
1581
- })[] | undefined;
1582
- isError?: boolean | undefined;
1583
- type: "tool-result";
1584
- toolCallId: string;
1585
- toolName: string;
1586
- result: any;
1587
- }[];
1588
- };
1589
- }[]>>;
1590
- export declare const rollbackMessage: import("convex/server").RegisteredMutation<"public", {
1591
- error?: string | undefined;
1592
- messageId: import("convex/values").GenericId<"messages">;
1593
- }, Promise<void>>;
1594
- export declare const commitMessage: import("convex/server").RegisteredMutation<"public", {
1595
- messageId: Id<"messages">;
1596
- }, Promise<void>>;
1597
- export declare const listMessagesByThreadId: import("convex/server").RegisteredQuery<"public", {
1598
- order?: "asc" | "desc" | undefined;
1599
- excludeToolMessages?: boolean | undefined;
1600
- paginationOpts?: {
1601
- id?: number | undefined;
1602
- endCursor?: string | null | undefined;
1603
- maximumRowsRead?: number | undefined;
1604
- maximumBytesRead?: number | undefined;
1605
- numItems: number;
1606
- cursor: string | null;
1607
- } | undefined;
1608
- beforeMessageId?: import("convex/values").GenericId<"messages"> | undefined;
1609
- isTool?: "use excludeToolMessages instead of this" | undefined;
1610
- statuses?: ("pending" | "success" | "failed")[] | undefined;
1611
- threadId: import("convex/values").GenericId<"threads">;
1612
- }, Promise<import("convex/server").PaginationResult<{
1613
- _id: import("convex/values").GenericId<"messages">;
1614
- _creationTime: number;
1615
- id?: string | undefined;
1616
- userId?: string | undefined;
1617
- parentMessageId?: import("convex/values").GenericId<"messages"> | undefined;
1618
- stepId?: import("convex/values").GenericId<"steps"> | undefined;
1619
- embeddingId?: import("convex/values").GenericId<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096"> | undefined;
1620
- error?: string | undefined;
1621
- agentName?: string | undefined;
1622
- model?: string | undefined;
1623
- provider?: string | undefined;
1624
- providerOptions?: Record<string, Record<string, any>> | undefined;
1625
- message?: {
1626
- providerOptions?: Record<string, Record<string, any>> | undefined;
1627
- role: "user";
1628
- content: string | ({
1629
- providerOptions?: Record<string, Record<string, any>> | undefined;
1630
- type: "text";
1631
- text: string;
1632
- } | {
1633
- providerOptions?: Record<string, Record<string, any>> | undefined;
1634
- mimeType?: string | undefined;
1635
- type: "image";
1636
- image: string | ArrayBuffer;
1637
- } | {
1638
- providerOptions?: Record<string, Record<string, any>> | undefined;
1639
- type: "file";
1640
- mimeType: string;
1641
- data: string | ArrayBuffer;
1642
- })[];
1643
- } | {
1644
- providerOptions?: Record<string, Record<string, any>> | undefined;
1645
- role: "assistant";
1646
- content: string | ({
1647
- providerOptions?: Record<string, Record<string, any>> | undefined;
1648
- type: "text";
1649
- text: string;
1650
- } | {
1651
- providerOptions?: Record<string, Record<string, any>> | undefined;
1652
- type: "file";
1653
- mimeType: string;
1654
- data: string | ArrayBuffer;
1655
- } | {
1656
- providerOptions?: Record<string, Record<string, any>> | undefined;
1657
- signature?: string | undefined;
1658
- type: "reasoning";
1659
- text: string;
1660
- } | {
1661
- providerOptions?: Record<string, Record<string, any>> | undefined;
1662
- type: "redacted-reasoning";
1663
- data: string;
1664
- } | {
872
+ }[];
873
+ timestamp: number;
874
+ modelId: string;
875
+ } | undefined;
876
+ text: string;
877
+ finishReason: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown";
878
+ isContinued: boolean;
879
+ stepType: "tool-result" | "initial" | "continue";
880
+ toolCalls: {
1665
881
  providerOptions?: Record<string, Record<string, any>> | undefined;
1666
882
  type: "tool-call";
1667
883
  toolCallId: string;
1668
884
  toolName: string;
1669
885
  args: any;
1670
- })[];
1671
- } | {
1672
- providerOptions?: Record<string, Record<string, any>> | undefined;
1673
- role: "tool";
1674
- content: {
886
+ }[];
887
+ toolResults: {
1675
888
  providerOptions?: Record<string, Record<string, any>> | undefined;
1676
889
  args?: any;
1677
890
  experimental_content?: ({
@@ -1688,59 +901,166 @@ export declare const listMessagesByThreadId: import("convex/server").RegisteredQ
1688
901
  toolName: string;
1689
902
  result: any;
1690
903
  }[];
1691
- } | {
1692
- providerOptions?: Record<string, Record<string, any>> | undefined;
1693
- role: "system";
1694
- content: string;
1695
- } | undefined;
1696
- text?: string | undefined;
1697
- reasoning?: string | undefined;
1698
- files?: {
1699
- data?: string | ArrayBuffer | undefined;
1700
- url?: string | undefined;
1701
- fileId?: import("convex/values").GenericId<"files"> | undefined;
1702
- mimeType: string;
1703
- }[] | undefined;
1704
- usage?: {
1705
- promptTokens: number;
1706
- completionTokens: number;
1707
- totalTokens: number;
904
+ };
905
+ }[]>>;
906
+ export declare const rollbackMessage: import("convex/server").RegisteredMutation<"public", {
907
+ error?: string | undefined;
908
+ messageId: import("convex/values").GenericId<"messages">;
909
+ }, Promise<void>>;
910
+ export declare const commitMessage: import("convex/server").RegisteredMutation<"public", {
911
+ messageId: Id<"messages">;
912
+ }, Promise<void>>;
913
+ export declare const listMessagesByThreadId: import("convex/server").RegisteredQuery<"public", {
914
+ order?: "asc" | "desc" | undefined;
915
+ excludeToolMessages?: boolean | undefined;
916
+ paginationOpts?: {
917
+ id?: number | undefined;
918
+ endCursor?: string | null | undefined;
919
+ maximumRowsRead?: number | undefined;
920
+ maximumBytesRead?: number | undefined;
921
+ numItems: number;
922
+ cursor: string | null;
1708
923
  } | undefined;
1709
- providerMetadata?: Record<string, Record<string, any>> | undefined;
1710
- sources?: {
1711
- title?: string | undefined;
1712
- providerOptions?: Record<string, Record<string, any>> | undefined;
1713
- id: string;
1714
- url: string;
1715
- sourceType: "url";
1716
- }[] | undefined;
1717
- reasoningDetails?: ({
1718
- signature?: string | undefined;
1719
- type: "text";
1720
- text: string;
1721
- } | {
1722
- type: "redacted";
1723
- data: string;
1724
- })[] | undefined;
1725
- warnings?: ({
1726
- details?: string | undefined;
1727
- type: "unsupported-setting";
1728
- setting: string;
1729
- } | {
1730
- details?: string | undefined;
1731
- type: "unsupported-tool";
1732
- tool: any;
1733
- } | {
1734
- type: "other";
1735
- message: string;
1736
- })[] | undefined;
1737
- finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
1738
- status: "pending" | "success" | "failed";
1739
- order: number;
924
+ isTool?: "use excludeToolMessages instead of this" | undefined;
925
+ statuses?: ("pending" | "success" | "failed")[] | undefined;
926
+ upToAndIncludingMessageId?: import("convex/values").GenericId<"messages"> | undefined;
1740
927
  threadId: import("convex/values").GenericId<"threads">;
1741
- stepOrder: number;
1742
- tool: boolean;
1743
- }>>>;
928
+ }, Promise<{
929
+ page: {
930
+ id?: string | undefined;
931
+ userId?: string | undefined;
932
+ embeddingId?: string | undefined;
933
+ error?: string | undefined;
934
+ agentName?: string | undefined;
935
+ model?: string | undefined;
936
+ provider?: string | undefined;
937
+ providerOptions?: Record<string, Record<string, any>> | undefined;
938
+ message?: {
939
+ providerOptions?: Record<string, Record<string, any>> | undefined;
940
+ role: "user";
941
+ content: string | ({
942
+ providerOptions?: Record<string, Record<string, any>> | undefined;
943
+ type: "text";
944
+ text: string;
945
+ } | {
946
+ providerOptions?: Record<string, Record<string, any>> | undefined;
947
+ mimeType?: string | undefined;
948
+ type: "image";
949
+ image: string | ArrayBuffer;
950
+ } | {
951
+ providerOptions?: Record<string, Record<string, any>> | undefined;
952
+ type: "file";
953
+ mimeType: string;
954
+ data: string | ArrayBuffer;
955
+ })[];
956
+ } | {
957
+ providerOptions?: Record<string, Record<string, any>> | undefined;
958
+ role: "assistant";
959
+ content: string | ({
960
+ providerOptions?: Record<string, Record<string, any>> | undefined;
961
+ type: "text";
962
+ text: string;
963
+ } | {
964
+ providerOptions?: Record<string, Record<string, any>> | undefined;
965
+ type: "file";
966
+ mimeType: string;
967
+ data: string | ArrayBuffer;
968
+ } | {
969
+ providerOptions?: Record<string, Record<string, any>> | undefined;
970
+ signature?: string | undefined;
971
+ type: "reasoning";
972
+ text: string;
973
+ } | {
974
+ providerOptions?: Record<string, Record<string, any>> | undefined;
975
+ type: "redacted-reasoning";
976
+ data: string;
977
+ } | {
978
+ providerOptions?: Record<string, Record<string, any>> | undefined;
979
+ type: "tool-call";
980
+ toolCallId: string;
981
+ toolName: string;
982
+ args: any;
983
+ })[];
984
+ } | {
985
+ providerOptions?: Record<string, Record<string, any>> | undefined;
986
+ role: "tool";
987
+ content: {
988
+ providerOptions?: Record<string, Record<string, any>> | undefined;
989
+ args?: any;
990
+ experimental_content?: ({
991
+ type: "text";
992
+ text: string;
993
+ } | {
994
+ mimeType?: string | undefined;
995
+ type: "image";
996
+ data: string;
997
+ })[] | undefined;
998
+ isError?: boolean | undefined;
999
+ type: "tool-result";
1000
+ toolCallId: string;
1001
+ toolName: string;
1002
+ result: any;
1003
+ }[];
1004
+ } | {
1005
+ providerOptions?: Record<string, Record<string, any>> | undefined;
1006
+ role: "system";
1007
+ content: string;
1008
+ } | undefined;
1009
+ text?: string | undefined;
1010
+ reasoning?: string | undefined;
1011
+ files?: {
1012
+ data?: string | ArrayBuffer | undefined;
1013
+ url?: string | undefined;
1014
+ fileId?: string | undefined;
1015
+ mimeType: string;
1016
+ }[] | undefined;
1017
+ usage?: {
1018
+ promptTokens: number;
1019
+ completionTokens: number;
1020
+ totalTokens: number;
1021
+ } | undefined;
1022
+ providerMetadata?: Record<string, Record<string, any>> | undefined;
1023
+ sources?: {
1024
+ title?: string | undefined;
1025
+ providerOptions?: Record<string, Record<string, any>> | undefined;
1026
+ id: string;
1027
+ url: string;
1028
+ sourceType: "url";
1029
+ }[] | undefined;
1030
+ reasoningDetails?: ({
1031
+ signature?: string | undefined;
1032
+ type: "text";
1033
+ text: string;
1034
+ } | {
1035
+ type: "redacted";
1036
+ data: string;
1037
+ })[] | undefined;
1038
+ warnings?: ({
1039
+ details?: string | undefined;
1040
+ type: "unsupported-setting";
1041
+ setting: string;
1042
+ } | {
1043
+ details?: string | undefined;
1044
+ type: "unsupported-tool";
1045
+ tool: any;
1046
+ } | {
1047
+ type: "other";
1048
+ message: string;
1049
+ })[] | undefined;
1050
+ finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
1051
+ status: "pending" | "success" | "failed";
1052
+ order: number;
1053
+ _creationTime: number;
1054
+ threadId: string;
1055
+ stepOrder: number;
1056
+ tool: boolean;
1057
+ _id: string;
1058
+ }[];
1059
+ isDone: boolean;
1060
+ continueCursor: import("convex/server").Cursor;
1061
+ splitCursor?: import("convex/server").Cursor | null;
1062
+ pageStatus?: "SplitRecommended" | "SplitRequired" | null;
1063
+ }>>;
1744
1064
  /** @deprecated Use listMessagesByThreadId instead. */
1745
1065
  export declare const getThreadMessages: import("convex/server").RegisteredQuery<"public", {
1746
1066
  deprecated: "Use listMessagesByThreadId instead";
@@ -1759,13 +1079,9 @@ export declare const searchMessages: import("convex/server").RegisteredAction<"p
1759
1079
  beforeMessageId?: import("convex/values").GenericId<"messages"> | undefined;
1760
1080
  limit: number;
1761
1081
  }, Promise<{
1762
- _id: import("convex/values").GenericId<"messages">;
1763
- _creationTime: number;
1764
1082
  id?: string | undefined;
1765
1083
  userId?: string | undefined;
1766
- parentMessageId?: import("convex/values").GenericId<"messages"> | undefined;
1767
- stepId?: import("convex/values").GenericId<"steps"> | undefined;
1768
- embeddingId?: import("convex/values").GenericId<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096"> | undefined;
1084
+ embeddingId?: string | undefined;
1769
1085
  error?: string | undefined;
1770
1086
  agentName?: string | undefined;
1771
1087
  model?: string | undefined;
@@ -1847,7 +1163,7 @@ export declare const searchMessages: import("convex/server").RegisteredAction<"p
1847
1163
  files?: {
1848
1164
  data?: string | ArrayBuffer | undefined;
1849
1165
  url?: string | undefined;
1850
- fileId?: import("convex/values").GenericId<"files"> | undefined;
1166
+ fileId?: string | undefined;
1851
1167
  mimeType: string;
1852
1168
  }[] | undefined;
1853
1169
  usage?: {
@@ -1886,9 +1202,11 @@ export declare const searchMessages: import("convex/server").RegisteredAction<"p
1886
1202
  finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
1887
1203
  status: "pending" | "success" | "failed";
1888
1204
  order: number;
1889
- threadId: import("convex/values").GenericId<"threads">;
1205
+ _creationTime: number;
1206
+ threadId: string;
1890
1207
  stepOrder: number;
1891
1208
  tool: boolean;
1209
+ _id: string;
1892
1210
  }[]>>;
1893
1211
  export declare const _fetchSearchMessages: import("convex/server").RegisteredQuery<"internal", {
1894
1212
  userId?: string | undefined;
@@ -1897,9 +1215,7 @@ export declare const _fetchSearchMessages: import("convex/server").RegisteredQue
1897
1215
  textSearchMessages?: {
1898
1216
  id?: string | undefined;
1899
1217
  userId?: string | undefined;
1900
- parentMessageId?: import("convex/values").GenericId<"messages"> | undefined;
1901
- stepId?: import("convex/values").GenericId<"steps"> | undefined;
1902
- embeddingId?: import("convex/values").GenericId<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096"> | undefined;
1218
+ embeddingId?: string | undefined;
1903
1219
  error?: string | undefined;
1904
1220
  agentName?: string | undefined;
1905
1221
  model?: string | undefined;
@@ -1981,7 +1297,7 @@ export declare const _fetchSearchMessages: import("convex/server").RegisteredQue
1981
1297
  files?: {
1982
1298
  data?: string | ArrayBuffer | undefined;
1983
1299
  url?: string | undefined;
1984
- fileId?: import("convex/values").GenericId<"files"> | undefined;
1300
+ fileId?: string | undefined;
1985
1301
  mimeType: string;
1986
1302
  }[] | undefined;
1987
1303
  usage?: {
@@ -2020,11 +1336,11 @@ export declare const _fetchSearchMessages: import("convex/server").RegisteredQue
2020
1336
  finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
2021
1337
  status: "pending" | "success" | "failed";
2022
1338
  order: number;
2023
- threadId: import("convex/values").GenericId<"threads">;
1339
+ _creationTime: number;
1340
+ threadId: string;
2024
1341
  stepOrder: number;
2025
1342
  tool: boolean;
2026
- _creationTime: number;
2027
- _id: import("convex/values").GenericId<"messages">;
1343
+ _id: string;
2028
1344
  }[] | undefined;
2029
1345
  limit: number;
2030
1346
  messageRange: {
@@ -2033,13 +1349,9 @@ export declare const _fetchSearchMessages: import("convex/server").RegisteredQue
2033
1349
  };
2034
1350
  vectorIds: import("convex/values").GenericId<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096">[];
2035
1351
  }, Promise<{
2036
- _id: import("convex/values").GenericId<"messages">;
2037
- _creationTime: number;
2038
1352
  id?: string | undefined;
2039
1353
  userId?: string | undefined;
2040
- parentMessageId?: import("convex/values").GenericId<"messages"> | undefined;
2041
- stepId?: import("convex/values").GenericId<"steps"> | undefined;
2042
- embeddingId?: import("convex/values").GenericId<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096"> | undefined;
1354
+ embeddingId?: string | undefined;
2043
1355
  error?: string | undefined;
2044
1356
  agentName?: string | undefined;
2045
1357
  model?: string | undefined;
@@ -2121,7 +1433,7 @@ export declare const _fetchSearchMessages: import("convex/server").RegisteredQue
2121
1433
  files?: {
2122
1434
  data?: string | ArrayBuffer | undefined;
2123
1435
  url?: string | undefined;
2124
- fileId?: import("convex/values").GenericId<"files"> | undefined;
1436
+ fileId?: string | undefined;
2125
1437
  mimeType: string;
2126
1438
  }[] | undefined;
2127
1439
  usage?: {
@@ -2160,9 +1472,11 @@ export declare const _fetchSearchMessages: import("convex/server").RegisteredQue
2160
1472
  finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
2161
1473
  status: "pending" | "success" | "failed";
2162
1474
  order: number;
2163
- threadId: import("convex/values").GenericId<"threads">;
1475
+ _creationTime: number;
1476
+ threadId: string;
2164
1477
  stepOrder: number;
2165
1478
  tool: boolean;
1479
+ _id: string;
2166
1480
  }[]>>;
2167
1481
  export declare const textSearch: import("convex/server").RegisteredQuery<"public", {
2168
1482
  userId?: string | undefined;
@@ -2171,13 +1485,9 @@ export declare const textSearch: import("convex/server").RegisteredQuery<"public
2171
1485
  text: string;
2172
1486
  limit: number;
2173
1487
  }, Promise<{
2174
- _id: import("convex/values").GenericId<"messages">;
2175
- _creationTime: number;
2176
1488
  id?: string | undefined;
2177
1489
  userId?: string | undefined;
2178
- parentMessageId?: import("convex/values").GenericId<"messages"> | undefined;
2179
- stepId?: import("convex/values").GenericId<"steps"> | undefined;
2180
- embeddingId?: import("convex/values").GenericId<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096"> | undefined;
1490
+ embeddingId?: string | undefined;
2181
1491
  error?: string | undefined;
2182
1492
  agentName?: string | undefined;
2183
1493
  model?: string | undefined;
@@ -2259,7 +1569,7 @@ export declare const textSearch: import("convex/server").RegisteredQuery<"public
2259
1569
  files?: {
2260
1570
  data?: string | ArrayBuffer | undefined;
2261
1571
  url?: string | undefined;
2262
- fileId?: import("convex/values").GenericId<"files"> | undefined;
1572
+ fileId?: string | undefined;
2263
1573
  mimeType: string;
2264
1574
  }[] | undefined;
2265
1575
  usage?: {
@@ -2298,8 +1608,10 @@ export declare const textSearch: import("convex/server").RegisteredQuery<"public
2298
1608
  finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
2299
1609
  status: "pending" | "success" | "failed";
2300
1610
  order: number;
2301
- threadId: import("convex/values").GenericId<"threads">;
1611
+ _creationTime: number;
1612
+ threadId: string;
2302
1613
  stepOrder: number;
2303
1614
  tool: boolean;
1615
+ _id: string;
2304
1616
  }[]>>;
2305
1617
  //# sourceMappingURL=messages.d.ts.map