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