@convex-dev/agent 0.5.0-alpha.1 → 0.6.0-alpha.1

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