@amaster.ai/dsh-storage 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +66 -0
  3. package/cordis.patch.yml +3 -0
  4. package/lib/backends/database.js +198 -0
  5. package/lib/generated/mysql/browser.js +17 -0
  6. package/lib/generated/mysql/client.js +34 -0
  7. package/lib/generated/mysql/commonInputTypes.js +10 -0
  8. package/lib/generated/mysql/enums.js +10 -0
  9. package/lib/generated/mysql/internal/class.js +49 -0
  10. package/lib/generated/mysql/internal/prismaNamespace.js +146 -0
  11. package/lib/generated/mysql/internal/prismaNamespaceBrowser.js +117 -0
  12. package/lib/generated/mysql/models/AiChatHistory.js +1 -0
  13. package/lib/generated/mysql/models/AiMessage.js +1 -0
  14. package/lib/generated/mysql/models.js +1 -0
  15. package/lib/generated/postgresql/browser.js +17 -0
  16. package/lib/generated/postgresql/client.js +34 -0
  17. package/lib/generated/postgresql/commonInputTypes.js +10 -0
  18. package/lib/generated/postgresql/enums.js +10 -0
  19. package/lib/generated/postgresql/internal/class.js +49 -0
  20. package/lib/generated/postgresql/internal/prismaNamespace.js +131 -0
  21. package/lib/generated/postgresql/internal/prismaNamespaceBrowser.js +102 -0
  22. package/lib/generated/postgresql/models/AiChatHistory.js +1 -0
  23. package/lib/generated/postgresql/models/AiMessage.js +1 -0
  24. package/lib/generated/postgresql/models.js +1 -0
  25. package/lib/generated/sqlite/browser.js +17 -0
  26. package/lib/generated/sqlite/client.js +34 -0
  27. package/lib/generated/sqlite/commonInputTypes.js +10 -0
  28. package/lib/generated/sqlite/enums.js +10 -0
  29. package/lib/generated/sqlite/internal/class.js +49 -0
  30. package/lib/generated/sqlite/internal/prismaNamespace.js +128 -0
  31. package/lib/generated/sqlite/internal/prismaNamespaceBrowser.js +99 -0
  32. package/lib/generated/sqlite/models/AiChatHistory.js +1 -0
  33. package/lib/generated/sqlite/models/AiMessage.js +1 -0
  34. package/lib/generated/sqlite/models.js +1 -0
  35. package/lib/generated/sqlserver/browser.js +17 -0
  36. package/lib/generated/sqlserver/client.js +34 -0
  37. package/lib/generated/sqlserver/commonInputTypes.js +10 -0
  38. package/lib/generated/sqlserver/enums.js +10 -0
  39. package/lib/generated/sqlserver/internal/class.js +49 -0
  40. package/lib/generated/sqlserver/internal/prismaNamespace.js +119 -0
  41. package/lib/generated/sqlserver/internal/prismaNamespaceBrowser.js +90 -0
  42. package/lib/generated/sqlserver/models/AiChatHistory.js +1 -0
  43. package/lib/generated/sqlserver/models/AiMessage.js +1 -0
  44. package/lib/generated/sqlserver/models.js +1 -0
  45. package/lib/index.js +224 -0
  46. package/lib/projector.js +153 -0
  47. package/lib/types/backends/database.d.ts +37 -0
  48. package/lib/types/generated/mysql/browser.d.ts +15 -0
  49. package/lib/types/generated/mysql/client.d.ts +34 -0
  50. package/lib/types/generated/mysql/commonInputTypes.d.ts +396 -0
  51. package/lib/types/generated/mysql/enums.d.ts +1 -0
  52. package/lib/types/generated/mysql/internal/class.d.ts +143 -0
  53. package/lib/types/generated/mysql/internal/prismaNamespace.d.ts +709 -0
  54. package/lib/types/generated/mysql/internal/prismaNamespaceBrowser.d.ts +112 -0
  55. package/lib/types/generated/mysql/models/AiChatHistory.d.ts +1258 -0
  56. package/lib/types/generated/mysql/models/AiMessage.d.ts +1360 -0
  57. package/lib/types/generated/mysql/models.d.ts +3 -0
  58. package/lib/types/generated/postgresql/browser.d.ts +15 -0
  59. package/lib/types/generated/postgresql/client.d.ts +34 -0
  60. package/lib/types/generated/postgresql/commonInputTypes.d.ts +392 -0
  61. package/lib/types/generated/postgresql/enums.d.ts +1 -0
  62. package/lib/types/generated/postgresql/internal/class.d.ts +143 -0
  63. package/lib/types/generated/postgresql/internal/prismaNamespace.d.ts +728 -0
  64. package/lib/types/generated/postgresql/internal/prismaNamespaceBrowser.d.ts +95 -0
  65. package/lib/types/generated/postgresql/models/AiChatHistory.d.ts +1373 -0
  66. package/lib/types/generated/postgresql/models/AiMessage.d.ts +1497 -0
  67. package/lib/types/generated/postgresql/models.d.ts +3 -0
  68. package/lib/types/generated/sqlite/browser.d.ts +15 -0
  69. package/lib/types/generated/sqlite/client.d.ts +34 -0
  70. package/lib/types/generated/sqlite/commonInputTypes.d.ts +373 -0
  71. package/lib/types/generated/sqlite/enums.d.ts +1 -0
  72. package/lib/types/generated/sqlite/internal/class.d.ts +143 -0
  73. package/lib/types/generated/sqlite/internal/prismaNamespace.d.ts +705 -0
  74. package/lib/types/generated/sqlite/internal/prismaNamespaceBrowser.d.ts +92 -0
  75. package/lib/types/generated/sqlite/models/AiChatHistory.d.ts +1371 -0
  76. package/lib/types/generated/sqlite/models/AiMessage.d.ts +1494 -0
  77. package/lib/types/generated/sqlite/models.d.ts +3 -0
  78. package/lib/types/generated/sqlserver/browser.d.ts +15 -0
  79. package/lib/types/generated/sqlserver/client.d.ts +34 -0
  80. package/lib/types/generated/sqlserver/commonInputTypes.d.ts +333 -0
  81. package/lib/types/generated/sqlserver/enums.d.ts +1 -0
  82. package/lib/types/generated/sqlserver/internal/class.d.ts +143 -0
  83. package/lib/types/generated/sqlserver/internal/prismaNamespace.d.ts +669 -0
  84. package/lib/types/generated/sqlserver/internal/prismaNamespaceBrowser.d.ts +80 -0
  85. package/lib/types/generated/sqlserver/models/AiChatHistory.d.ts +1257 -0
  86. package/lib/types/generated/sqlserver/models/AiMessage.d.ts +1376 -0
  87. package/lib/types/generated/sqlserver/models.d.ts +3 -0
  88. package/lib/types/index.d.ts +56 -0
  89. package/lib/types/projector.d.ts +48 -0
  90. package/lib/types/types.d.ts +49 -0
  91. package/lib/types.js +8 -0
  92. package/package.json +85 -0
  93. package/preview.png +0 -0
  94. package/prisma/schema.mysql.prisma +75 -0
  95. package/prisma/schema.postgresql.prisma +67 -0
  96. package/prisma/schema.sqlite.prisma +67 -0
  97. package/prisma/schema.sqlserver.prisma +73 -0
@@ -0,0 +1,1497 @@
1
+ import type * as runtime from "@prisma/client/runtime/client";
2
+ import type * as Prisma from "../internal/prismaNamespace.js";
3
+ /**
4
+ * Model AiMessage
5
+ * One row per projected session event (user message, assistant message,
6
+ * tool call/result, compression snapshot, ...).
7
+ */
8
+ export type AiMessageModel = runtime.Types.Result.DefaultSelection<Prisma.$AiMessagePayload>;
9
+ export type AggregateAiMessage = {
10
+ _count: AiMessageCountAggregateOutputType | null;
11
+ _min: AiMessageMinAggregateOutputType | null;
12
+ _max: AiMessageMaxAggregateOutputType | null;
13
+ };
14
+ export type AiMessageMinAggregateOutputType = {
15
+ id: string | null;
16
+ sessionId: string | null;
17
+ historyId: string | null;
18
+ type: string | null;
19
+ content: string | null;
20
+ model: string | null;
21
+ agentId: string | null;
22
+ createdAt: Date | null;
23
+ updatedAt: Date | null;
24
+ deletedAt: Date | null;
25
+ };
26
+ export type AiMessageMaxAggregateOutputType = {
27
+ id: string | null;
28
+ sessionId: string | null;
29
+ historyId: string | null;
30
+ type: string | null;
31
+ content: string | null;
32
+ model: string | null;
33
+ agentId: string | null;
34
+ createdAt: Date | null;
35
+ updatedAt: Date | null;
36
+ deletedAt: Date | null;
37
+ };
38
+ export type AiMessageCountAggregateOutputType = {
39
+ id: number;
40
+ sessionId: number;
41
+ historyId: number;
42
+ type: number;
43
+ content: number;
44
+ thoughts: number;
45
+ model: number;
46
+ tokens: number;
47
+ toolCalls: number;
48
+ agentId: number;
49
+ metadata: number;
50
+ createdAt: number;
51
+ updatedAt: number;
52
+ deletedAt: number;
53
+ _all: number;
54
+ };
55
+ export type AiMessageMinAggregateInputType = {
56
+ id?: true;
57
+ sessionId?: true;
58
+ historyId?: true;
59
+ type?: true;
60
+ content?: true;
61
+ model?: true;
62
+ agentId?: true;
63
+ createdAt?: true;
64
+ updatedAt?: true;
65
+ deletedAt?: true;
66
+ };
67
+ export type AiMessageMaxAggregateInputType = {
68
+ id?: true;
69
+ sessionId?: true;
70
+ historyId?: true;
71
+ type?: true;
72
+ content?: true;
73
+ model?: true;
74
+ agentId?: true;
75
+ createdAt?: true;
76
+ updatedAt?: true;
77
+ deletedAt?: true;
78
+ };
79
+ export type AiMessageCountAggregateInputType = {
80
+ id?: true;
81
+ sessionId?: true;
82
+ historyId?: true;
83
+ type?: true;
84
+ content?: true;
85
+ thoughts?: true;
86
+ model?: true;
87
+ tokens?: true;
88
+ toolCalls?: true;
89
+ agentId?: true;
90
+ metadata?: true;
91
+ createdAt?: true;
92
+ updatedAt?: true;
93
+ deletedAt?: true;
94
+ _all?: true;
95
+ };
96
+ export type AiMessageAggregateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
97
+ /**
98
+ * Filter which AiMessage to aggregate.
99
+ */
100
+ where?: Prisma.AiMessageWhereInput;
101
+ /**
102
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
103
+ *
104
+ * Determine the order of AiMessages to fetch.
105
+ */
106
+ orderBy?: Prisma.AiMessageOrderByWithRelationInput | Prisma.AiMessageOrderByWithRelationInput[];
107
+ /**
108
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
109
+ *
110
+ * Sets the start position
111
+ */
112
+ cursor?: Prisma.AiMessageWhereUniqueInput;
113
+ /**
114
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
115
+ *
116
+ * Take `±n` AiMessages from the position of the cursor.
117
+ */
118
+ take?: number;
119
+ /**
120
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
121
+ *
122
+ * Skip the first `n` AiMessages.
123
+ */
124
+ skip?: number;
125
+ /**
126
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
127
+ *
128
+ * Count returned AiMessages
129
+ **/
130
+ _count?: true | AiMessageCountAggregateInputType;
131
+ /**
132
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
133
+ *
134
+ * Select which fields to find the minimum value
135
+ **/
136
+ _min?: AiMessageMinAggregateInputType;
137
+ /**
138
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
139
+ *
140
+ * Select which fields to find the maximum value
141
+ **/
142
+ _max?: AiMessageMaxAggregateInputType;
143
+ };
144
+ export type GetAiMessageAggregateType<T extends AiMessageAggregateArgs> = {
145
+ [P in keyof T & keyof AggregateAiMessage]: P extends '_count' | 'count' ? T[P] extends true ? number : Prisma.GetScalarType<T[P], AggregateAiMessage[P]> : Prisma.GetScalarType<T[P], AggregateAiMessage[P]>;
146
+ };
147
+ export type AiMessageGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
148
+ where?: Prisma.AiMessageWhereInput;
149
+ orderBy?: Prisma.AiMessageOrderByWithAggregationInput | Prisma.AiMessageOrderByWithAggregationInput[];
150
+ by: Prisma.AiMessageScalarFieldEnum[] | Prisma.AiMessageScalarFieldEnum;
151
+ having?: Prisma.AiMessageScalarWhereWithAggregatesInput;
152
+ take?: number;
153
+ skip?: number;
154
+ _count?: AiMessageCountAggregateInputType | true;
155
+ _min?: AiMessageMinAggregateInputType;
156
+ _max?: AiMessageMaxAggregateInputType;
157
+ };
158
+ export type AiMessageGroupByOutputType = {
159
+ id: string;
160
+ sessionId: string;
161
+ historyId: string | null;
162
+ type: string;
163
+ content: string;
164
+ thoughts: runtime.JsonValue | null;
165
+ model: string | null;
166
+ tokens: runtime.JsonValue | null;
167
+ toolCalls: runtime.JsonValue | null;
168
+ agentId: string | null;
169
+ metadata: runtime.JsonValue | null;
170
+ createdAt: Date;
171
+ updatedAt: Date;
172
+ deletedAt: Date | null;
173
+ _count: AiMessageCountAggregateOutputType | null;
174
+ _min: AiMessageMinAggregateOutputType | null;
175
+ _max: AiMessageMaxAggregateOutputType | null;
176
+ };
177
+ export type GetAiMessageGroupByPayload<T extends AiMessageGroupByArgs> = Prisma.PrismaPromise<Array<Prisma.PickEnumerable<AiMessageGroupByOutputType, T['by']> & {
178
+ [P in ((keyof T) & (keyof AiMessageGroupByOutputType))]: P extends '_count' ? T[P] extends boolean ? number : Prisma.GetScalarType<T[P], AiMessageGroupByOutputType[P]> : Prisma.GetScalarType<T[P], AiMessageGroupByOutputType[P]>;
179
+ }>>;
180
+ export type AiMessageWhereInput = {
181
+ AND?: Prisma.AiMessageWhereInput | Prisma.AiMessageWhereInput[];
182
+ OR?: Prisma.AiMessageWhereInput[];
183
+ NOT?: Prisma.AiMessageWhereInput | Prisma.AiMessageWhereInput[];
184
+ id?: Prisma.StringFilter<"AiMessage"> | string;
185
+ sessionId?: Prisma.StringFilter<"AiMessage"> | string;
186
+ historyId?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
187
+ type?: Prisma.StringFilter<"AiMessage"> | string;
188
+ content?: Prisma.StringFilter<"AiMessage"> | string;
189
+ thoughts?: Prisma.JsonNullableFilter<"AiMessage">;
190
+ model?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
191
+ tokens?: Prisma.JsonNullableFilter<"AiMessage">;
192
+ toolCalls?: Prisma.JsonNullableFilter<"AiMessage">;
193
+ agentId?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
194
+ metadata?: Prisma.JsonNullableFilter<"AiMessage">;
195
+ createdAt?: Prisma.DateTimeFilter<"AiMessage"> | Date | string;
196
+ updatedAt?: Prisma.DateTimeFilter<"AiMessage"> | Date | string;
197
+ deletedAt?: Prisma.DateTimeNullableFilter<"AiMessage"> | Date | string | null;
198
+ history?: Prisma.XOR<Prisma.AiChatHistoryNullableScalarRelationFilter, Prisma.AiChatHistoryWhereInput> | null;
199
+ };
200
+ export type AiMessageOrderByWithRelationInput = {
201
+ id?: Prisma.SortOrder;
202
+ sessionId?: Prisma.SortOrder;
203
+ historyId?: Prisma.SortOrderInput | Prisma.SortOrder;
204
+ type?: Prisma.SortOrder;
205
+ content?: Prisma.SortOrder;
206
+ thoughts?: Prisma.SortOrderInput | Prisma.SortOrder;
207
+ model?: Prisma.SortOrderInput | Prisma.SortOrder;
208
+ tokens?: Prisma.SortOrderInput | Prisma.SortOrder;
209
+ toolCalls?: Prisma.SortOrderInput | Prisma.SortOrder;
210
+ agentId?: Prisma.SortOrderInput | Prisma.SortOrder;
211
+ metadata?: Prisma.SortOrderInput | Prisma.SortOrder;
212
+ createdAt?: Prisma.SortOrder;
213
+ updatedAt?: Prisma.SortOrder;
214
+ deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder;
215
+ history?: Prisma.AiChatHistoryOrderByWithRelationInput;
216
+ };
217
+ export type AiMessageWhereUniqueInput = Prisma.AtLeast<{
218
+ id?: string;
219
+ AND?: Prisma.AiMessageWhereInput | Prisma.AiMessageWhereInput[];
220
+ OR?: Prisma.AiMessageWhereInput[];
221
+ NOT?: Prisma.AiMessageWhereInput | Prisma.AiMessageWhereInput[];
222
+ sessionId?: Prisma.StringFilter<"AiMessage"> | string;
223
+ historyId?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
224
+ type?: Prisma.StringFilter<"AiMessage"> | string;
225
+ content?: Prisma.StringFilter<"AiMessage"> | string;
226
+ thoughts?: Prisma.JsonNullableFilter<"AiMessage">;
227
+ model?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
228
+ tokens?: Prisma.JsonNullableFilter<"AiMessage">;
229
+ toolCalls?: Prisma.JsonNullableFilter<"AiMessage">;
230
+ agentId?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
231
+ metadata?: Prisma.JsonNullableFilter<"AiMessage">;
232
+ createdAt?: Prisma.DateTimeFilter<"AiMessage"> | Date | string;
233
+ updatedAt?: Prisma.DateTimeFilter<"AiMessage"> | Date | string;
234
+ deletedAt?: Prisma.DateTimeNullableFilter<"AiMessage"> | Date | string | null;
235
+ history?: Prisma.XOR<Prisma.AiChatHistoryNullableScalarRelationFilter, Prisma.AiChatHistoryWhereInput> | null;
236
+ }, "id">;
237
+ export type AiMessageOrderByWithAggregationInput = {
238
+ id?: Prisma.SortOrder;
239
+ sessionId?: Prisma.SortOrder;
240
+ historyId?: Prisma.SortOrderInput | Prisma.SortOrder;
241
+ type?: Prisma.SortOrder;
242
+ content?: Prisma.SortOrder;
243
+ thoughts?: Prisma.SortOrderInput | Prisma.SortOrder;
244
+ model?: Prisma.SortOrderInput | Prisma.SortOrder;
245
+ tokens?: Prisma.SortOrderInput | Prisma.SortOrder;
246
+ toolCalls?: Prisma.SortOrderInput | Prisma.SortOrder;
247
+ agentId?: Prisma.SortOrderInput | Prisma.SortOrder;
248
+ metadata?: Prisma.SortOrderInput | Prisma.SortOrder;
249
+ createdAt?: Prisma.SortOrder;
250
+ updatedAt?: Prisma.SortOrder;
251
+ deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder;
252
+ _count?: Prisma.AiMessageCountOrderByAggregateInput;
253
+ _max?: Prisma.AiMessageMaxOrderByAggregateInput;
254
+ _min?: Prisma.AiMessageMinOrderByAggregateInput;
255
+ };
256
+ export type AiMessageScalarWhereWithAggregatesInput = {
257
+ AND?: Prisma.AiMessageScalarWhereWithAggregatesInput | Prisma.AiMessageScalarWhereWithAggregatesInput[];
258
+ OR?: Prisma.AiMessageScalarWhereWithAggregatesInput[];
259
+ NOT?: Prisma.AiMessageScalarWhereWithAggregatesInput | Prisma.AiMessageScalarWhereWithAggregatesInput[];
260
+ id?: Prisma.StringWithAggregatesFilter<"AiMessage"> | string;
261
+ sessionId?: Prisma.StringWithAggregatesFilter<"AiMessage"> | string;
262
+ historyId?: Prisma.StringNullableWithAggregatesFilter<"AiMessage"> | string | null;
263
+ type?: Prisma.StringWithAggregatesFilter<"AiMessage"> | string;
264
+ content?: Prisma.StringWithAggregatesFilter<"AiMessage"> | string;
265
+ thoughts?: Prisma.JsonNullableWithAggregatesFilter<"AiMessage">;
266
+ model?: Prisma.StringNullableWithAggregatesFilter<"AiMessage"> | string | null;
267
+ tokens?: Prisma.JsonNullableWithAggregatesFilter<"AiMessage">;
268
+ toolCalls?: Prisma.JsonNullableWithAggregatesFilter<"AiMessage">;
269
+ agentId?: Prisma.StringNullableWithAggregatesFilter<"AiMessage"> | string | null;
270
+ metadata?: Prisma.JsonNullableWithAggregatesFilter<"AiMessage">;
271
+ createdAt?: Prisma.DateTimeWithAggregatesFilter<"AiMessage"> | Date | string;
272
+ updatedAt?: Prisma.DateTimeWithAggregatesFilter<"AiMessage"> | Date | string;
273
+ deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"AiMessage"> | Date | string | null;
274
+ };
275
+ export type AiMessageCreateInput = {
276
+ id?: string;
277
+ sessionId: string;
278
+ type: string;
279
+ content: string;
280
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
281
+ model?: string | null;
282
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
283
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
284
+ agentId?: string | null;
285
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
286
+ createdAt?: Date | string;
287
+ updatedAt?: Date | string;
288
+ deletedAt?: Date | string | null;
289
+ history?: Prisma.AiChatHistoryCreateNestedOneWithoutMessagesInput;
290
+ };
291
+ export type AiMessageUncheckedCreateInput = {
292
+ id?: string;
293
+ sessionId: string;
294
+ historyId?: string | null;
295
+ type: string;
296
+ content: string;
297
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
298
+ model?: string | null;
299
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
300
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
301
+ agentId?: string | null;
302
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
303
+ createdAt?: Date | string;
304
+ updatedAt?: Date | string;
305
+ deletedAt?: Date | string | null;
306
+ };
307
+ export type AiMessageUpdateInput = {
308
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
309
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
310
+ type?: Prisma.StringFieldUpdateOperationsInput | string;
311
+ content?: Prisma.StringFieldUpdateOperationsInput | string;
312
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
313
+ model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
314
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
315
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
316
+ agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
317
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
318
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
319
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
320
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
321
+ history?: Prisma.AiChatHistoryUpdateOneWithoutMessagesNestedInput;
322
+ };
323
+ export type AiMessageUncheckedUpdateInput = {
324
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
325
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
326
+ historyId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
327
+ type?: Prisma.StringFieldUpdateOperationsInput | string;
328
+ content?: Prisma.StringFieldUpdateOperationsInput | string;
329
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
330
+ model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
331
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
332
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
333
+ agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
334
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
335
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
336
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
337
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
338
+ };
339
+ export type AiMessageCreateManyInput = {
340
+ id?: string;
341
+ sessionId: string;
342
+ historyId?: string | null;
343
+ type: string;
344
+ content: string;
345
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
346
+ model?: string | null;
347
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
348
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
349
+ agentId?: string | null;
350
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
351
+ createdAt?: Date | string;
352
+ updatedAt?: Date | string;
353
+ deletedAt?: Date | string | null;
354
+ };
355
+ export type AiMessageUpdateManyMutationInput = {
356
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
357
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
358
+ type?: Prisma.StringFieldUpdateOperationsInput | string;
359
+ content?: Prisma.StringFieldUpdateOperationsInput | string;
360
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
361
+ model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
362
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
363
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
364
+ agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
365
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
366
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
367
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
368
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
369
+ };
370
+ export type AiMessageUncheckedUpdateManyInput = {
371
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
372
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
373
+ historyId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
374
+ type?: Prisma.StringFieldUpdateOperationsInput | string;
375
+ content?: Prisma.StringFieldUpdateOperationsInput | string;
376
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
377
+ model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
378
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
379
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
380
+ agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
381
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
382
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
383
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
384
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
385
+ };
386
+ export type AiMessageCountOrderByAggregateInput = {
387
+ id?: Prisma.SortOrder;
388
+ sessionId?: Prisma.SortOrder;
389
+ historyId?: Prisma.SortOrder;
390
+ type?: Prisma.SortOrder;
391
+ content?: Prisma.SortOrder;
392
+ thoughts?: Prisma.SortOrder;
393
+ model?: Prisma.SortOrder;
394
+ tokens?: Prisma.SortOrder;
395
+ toolCalls?: Prisma.SortOrder;
396
+ agentId?: Prisma.SortOrder;
397
+ metadata?: Prisma.SortOrder;
398
+ createdAt?: Prisma.SortOrder;
399
+ updatedAt?: Prisma.SortOrder;
400
+ deletedAt?: Prisma.SortOrder;
401
+ };
402
+ export type AiMessageMaxOrderByAggregateInput = {
403
+ id?: Prisma.SortOrder;
404
+ sessionId?: Prisma.SortOrder;
405
+ historyId?: Prisma.SortOrder;
406
+ type?: Prisma.SortOrder;
407
+ content?: Prisma.SortOrder;
408
+ model?: Prisma.SortOrder;
409
+ agentId?: Prisma.SortOrder;
410
+ createdAt?: Prisma.SortOrder;
411
+ updatedAt?: Prisma.SortOrder;
412
+ deletedAt?: Prisma.SortOrder;
413
+ };
414
+ export type AiMessageMinOrderByAggregateInput = {
415
+ id?: Prisma.SortOrder;
416
+ sessionId?: Prisma.SortOrder;
417
+ historyId?: Prisma.SortOrder;
418
+ type?: Prisma.SortOrder;
419
+ content?: Prisma.SortOrder;
420
+ model?: Prisma.SortOrder;
421
+ agentId?: Prisma.SortOrder;
422
+ createdAt?: Prisma.SortOrder;
423
+ updatedAt?: Prisma.SortOrder;
424
+ deletedAt?: Prisma.SortOrder;
425
+ };
426
+ export type AiMessageListRelationFilter = {
427
+ every?: Prisma.AiMessageWhereInput;
428
+ some?: Prisma.AiMessageWhereInput;
429
+ none?: Prisma.AiMessageWhereInput;
430
+ };
431
+ export type AiMessageOrderByRelationAggregateInput = {
432
+ _count?: Prisma.SortOrder;
433
+ };
434
+ export type StringFieldUpdateOperationsInput = {
435
+ set?: string;
436
+ };
437
+ export type NullableStringFieldUpdateOperationsInput = {
438
+ set?: string | null;
439
+ };
440
+ export type DateTimeFieldUpdateOperationsInput = {
441
+ set?: Date | string;
442
+ };
443
+ export type NullableDateTimeFieldUpdateOperationsInput = {
444
+ set?: Date | string | null;
445
+ };
446
+ export type AiMessageCreateNestedManyWithoutHistoryInput = {
447
+ create?: Prisma.XOR<Prisma.AiMessageCreateWithoutHistoryInput, Prisma.AiMessageUncheckedCreateWithoutHistoryInput> | Prisma.AiMessageCreateWithoutHistoryInput[] | Prisma.AiMessageUncheckedCreateWithoutHistoryInput[];
448
+ connectOrCreate?: Prisma.AiMessageCreateOrConnectWithoutHistoryInput | Prisma.AiMessageCreateOrConnectWithoutHistoryInput[];
449
+ createMany?: Prisma.AiMessageCreateManyHistoryInputEnvelope;
450
+ connect?: Prisma.AiMessageWhereUniqueInput | Prisma.AiMessageWhereUniqueInput[];
451
+ };
452
+ export type AiMessageUncheckedCreateNestedManyWithoutHistoryInput = {
453
+ create?: Prisma.XOR<Prisma.AiMessageCreateWithoutHistoryInput, Prisma.AiMessageUncheckedCreateWithoutHistoryInput> | Prisma.AiMessageCreateWithoutHistoryInput[] | Prisma.AiMessageUncheckedCreateWithoutHistoryInput[];
454
+ connectOrCreate?: Prisma.AiMessageCreateOrConnectWithoutHistoryInput | Prisma.AiMessageCreateOrConnectWithoutHistoryInput[];
455
+ createMany?: Prisma.AiMessageCreateManyHistoryInputEnvelope;
456
+ connect?: Prisma.AiMessageWhereUniqueInput | Prisma.AiMessageWhereUniqueInput[];
457
+ };
458
+ export type AiMessageUpdateManyWithoutHistoryNestedInput = {
459
+ create?: Prisma.XOR<Prisma.AiMessageCreateWithoutHistoryInput, Prisma.AiMessageUncheckedCreateWithoutHistoryInput> | Prisma.AiMessageCreateWithoutHistoryInput[] | Prisma.AiMessageUncheckedCreateWithoutHistoryInput[];
460
+ connectOrCreate?: Prisma.AiMessageCreateOrConnectWithoutHistoryInput | Prisma.AiMessageCreateOrConnectWithoutHistoryInput[];
461
+ upsert?: Prisma.AiMessageUpsertWithWhereUniqueWithoutHistoryInput | Prisma.AiMessageUpsertWithWhereUniqueWithoutHistoryInput[];
462
+ createMany?: Prisma.AiMessageCreateManyHistoryInputEnvelope;
463
+ set?: Prisma.AiMessageWhereUniqueInput | Prisma.AiMessageWhereUniqueInput[];
464
+ disconnect?: Prisma.AiMessageWhereUniqueInput | Prisma.AiMessageWhereUniqueInput[];
465
+ delete?: Prisma.AiMessageWhereUniqueInput | Prisma.AiMessageWhereUniqueInput[];
466
+ connect?: Prisma.AiMessageWhereUniqueInput | Prisma.AiMessageWhereUniqueInput[];
467
+ update?: Prisma.AiMessageUpdateWithWhereUniqueWithoutHistoryInput | Prisma.AiMessageUpdateWithWhereUniqueWithoutHistoryInput[];
468
+ updateMany?: Prisma.AiMessageUpdateManyWithWhereWithoutHistoryInput | Prisma.AiMessageUpdateManyWithWhereWithoutHistoryInput[];
469
+ deleteMany?: Prisma.AiMessageScalarWhereInput | Prisma.AiMessageScalarWhereInput[];
470
+ };
471
+ export type AiMessageUncheckedUpdateManyWithoutHistoryNestedInput = {
472
+ create?: Prisma.XOR<Prisma.AiMessageCreateWithoutHistoryInput, Prisma.AiMessageUncheckedCreateWithoutHistoryInput> | Prisma.AiMessageCreateWithoutHistoryInput[] | Prisma.AiMessageUncheckedCreateWithoutHistoryInput[];
473
+ connectOrCreate?: Prisma.AiMessageCreateOrConnectWithoutHistoryInput | Prisma.AiMessageCreateOrConnectWithoutHistoryInput[];
474
+ upsert?: Prisma.AiMessageUpsertWithWhereUniqueWithoutHistoryInput | Prisma.AiMessageUpsertWithWhereUniqueWithoutHistoryInput[];
475
+ createMany?: Prisma.AiMessageCreateManyHistoryInputEnvelope;
476
+ set?: Prisma.AiMessageWhereUniqueInput | Prisma.AiMessageWhereUniqueInput[];
477
+ disconnect?: Prisma.AiMessageWhereUniqueInput | Prisma.AiMessageWhereUniqueInput[];
478
+ delete?: Prisma.AiMessageWhereUniqueInput | Prisma.AiMessageWhereUniqueInput[];
479
+ connect?: Prisma.AiMessageWhereUniqueInput | Prisma.AiMessageWhereUniqueInput[];
480
+ update?: Prisma.AiMessageUpdateWithWhereUniqueWithoutHistoryInput | Prisma.AiMessageUpdateWithWhereUniqueWithoutHistoryInput[];
481
+ updateMany?: Prisma.AiMessageUpdateManyWithWhereWithoutHistoryInput | Prisma.AiMessageUpdateManyWithWhereWithoutHistoryInput[];
482
+ deleteMany?: Prisma.AiMessageScalarWhereInput | Prisma.AiMessageScalarWhereInput[];
483
+ };
484
+ export type AiMessageCreateWithoutHistoryInput = {
485
+ id?: string;
486
+ sessionId: string;
487
+ type: string;
488
+ content: string;
489
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
490
+ model?: string | null;
491
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
492
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
493
+ agentId?: string | null;
494
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
495
+ createdAt?: Date | string;
496
+ updatedAt?: Date | string;
497
+ deletedAt?: Date | string | null;
498
+ };
499
+ export type AiMessageUncheckedCreateWithoutHistoryInput = {
500
+ id?: string;
501
+ sessionId: string;
502
+ type: string;
503
+ content: string;
504
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
505
+ model?: string | null;
506
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
507
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
508
+ agentId?: string | null;
509
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
510
+ createdAt?: Date | string;
511
+ updatedAt?: Date | string;
512
+ deletedAt?: Date | string | null;
513
+ };
514
+ export type AiMessageCreateOrConnectWithoutHistoryInput = {
515
+ where: Prisma.AiMessageWhereUniqueInput;
516
+ create: Prisma.XOR<Prisma.AiMessageCreateWithoutHistoryInput, Prisma.AiMessageUncheckedCreateWithoutHistoryInput>;
517
+ };
518
+ export type AiMessageCreateManyHistoryInputEnvelope = {
519
+ data: Prisma.AiMessageCreateManyHistoryInput | Prisma.AiMessageCreateManyHistoryInput[];
520
+ skipDuplicates?: boolean;
521
+ };
522
+ export type AiMessageUpsertWithWhereUniqueWithoutHistoryInput = {
523
+ where: Prisma.AiMessageWhereUniqueInput;
524
+ update: Prisma.XOR<Prisma.AiMessageUpdateWithoutHistoryInput, Prisma.AiMessageUncheckedUpdateWithoutHistoryInput>;
525
+ create: Prisma.XOR<Prisma.AiMessageCreateWithoutHistoryInput, Prisma.AiMessageUncheckedCreateWithoutHistoryInput>;
526
+ };
527
+ export type AiMessageUpdateWithWhereUniqueWithoutHistoryInput = {
528
+ where: Prisma.AiMessageWhereUniqueInput;
529
+ data: Prisma.XOR<Prisma.AiMessageUpdateWithoutHistoryInput, Prisma.AiMessageUncheckedUpdateWithoutHistoryInput>;
530
+ };
531
+ export type AiMessageUpdateManyWithWhereWithoutHistoryInput = {
532
+ where: Prisma.AiMessageScalarWhereInput;
533
+ data: Prisma.XOR<Prisma.AiMessageUpdateManyMutationInput, Prisma.AiMessageUncheckedUpdateManyWithoutHistoryInput>;
534
+ };
535
+ export type AiMessageScalarWhereInput = {
536
+ AND?: Prisma.AiMessageScalarWhereInput | Prisma.AiMessageScalarWhereInput[];
537
+ OR?: Prisma.AiMessageScalarWhereInput[];
538
+ NOT?: Prisma.AiMessageScalarWhereInput | Prisma.AiMessageScalarWhereInput[];
539
+ id?: Prisma.StringFilter<"AiMessage"> | string;
540
+ sessionId?: Prisma.StringFilter<"AiMessage"> | string;
541
+ historyId?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
542
+ type?: Prisma.StringFilter<"AiMessage"> | string;
543
+ content?: Prisma.StringFilter<"AiMessage"> | string;
544
+ thoughts?: Prisma.JsonNullableFilter<"AiMessage">;
545
+ model?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
546
+ tokens?: Prisma.JsonNullableFilter<"AiMessage">;
547
+ toolCalls?: Prisma.JsonNullableFilter<"AiMessage">;
548
+ agentId?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
549
+ metadata?: Prisma.JsonNullableFilter<"AiMessage">;
550
+ createdAt?: Prisma.DateTimeFilter<"AiMessage"> | Date | string;
551
+ updatedAt?: Prisma.DateTimeFilter<"AiMessage"> | Date | string;
552
+ deletedAt?: Prisma.DateTimeNullableFilter<"AiMessage"> | Date | string | null;
553
+ };
554
+ export type AiMessageCreateManyHistoryInput = {
555
+ id?: string;
556
+ sessionId: string;
557
+ type: string;
558
+ content: string;
559
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
560
+ model?: string | null;
561
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
562
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
563
+ agentId?: string | null;
564
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
565
+ createdAt?: Date | string;
566
+ updatedAt?: Date | string;
567
+ deletedAt?: Date | string | null;
568
+ };
569
+ export type AiMessageUpdateWithoutHistoryInput = {
570
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
571
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
572
+ type?: Prisma.StringFieldUpdateOperationsInput | string;
573
+ content?: Prisma.StringFieldUpdateOperationsInput | string;
574
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
575
+ model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
576
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
577
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
578
+ agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
579
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
580
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
581
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
582
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
583
+ };
584
+ export type AiMessageUncheckedUpdateWithoutHistoryInput = {
585
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
586
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
587
+ type?: Prisma.StringFieldUpdateOperationsInput | string;
588
+ content?: Prisma.StringFieldUpdateOperationsInput | string;
589
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
590
+ model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
591
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
592
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
593
+ agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
594
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
595
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
596
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
597
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
598
+ };
599
+ export type AiMessageUncheckedUpdateManyWithoutHistoryInput = {
600
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
601
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
602
+ type?: Prisma.StringFieldUpdateOperationsInput | string;
603
+ content?: Prisma.StringFieldUpdateOperationsInput | string;
604
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
605
+ model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
606
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
607
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
608
+ agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
609
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
610
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
611
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
612
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
613
+ };
614
+ export type AiMessageSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
615
+ id?: boolean;
616
+ sessionId?: boolean;
617
+ historyId?: boolean;
618
+ type?: boolean;
619
+ content?: boolean;
620
+ thoughts?: boolean;
621
+ model?: boolean;
622
+ tokens?: boolean;
623
+ toolCalls?: boolean;
624
+ agentId?: boolean;
625
+ metadata?: boolean;
626
+ createdAt?: boolean;
627
+ updatedAt?: boolean;
628
+ deletedAt?: boolean;
629
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
630
+ }, ExtArgs["result"]["aiMessage"]>;
631
+ export type AiMessageSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
632
+ id?: boolean;
633
+ sessionId?: boolean;
634
+ historyId?: boolean;
635
+ type?: boolean;
636
+ content?: boolean;
637
+ thoughts?: boolean;
638
+ model?: boolean;
639
+ tokens?: boolean;
640
+ toolCalls?: boolean;
641
+ agentId?: boolean;
642
+ metadata?: boolean;
643
+ createdAt?: boolean;
644
+ updatedAt?: boolean;
645
+ deletedAt?: boolean;
646
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
647
+ }, ExtArgs["result"]["aiMessage"]>;
648
+ export type AiMessageSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
649
+ id?: boolean;
650
+ sessionId?: boolean;
651
+ historyId?: boolean;
652
+ type?: boolean;
653
+ content?: boolean;
654
+ thoughts?: boolean;
655
+ model?: boolean;
656
+ tokens?: boolean;
657
+ toolCalls?: boolean;
658
+ agentId?: boolean;
659
+ metadata?: boolean;
660
+ createdAt?: boolean;
661
+ updatedAt?: boolean;
662
+ deletedAt?: boolean;
663
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
664
+ }, ExtArgs["result"]["aiMessage"]>;
665
+ export type AiMessageSelectScalar = {
666
+ id?: boolean;
667
+ sessionId?: boolean;
668
+ historyId?: boolean;
669
+ type?: boolean;
670
+ content?: boolean;
671
+ thoughts?: boolean;
672
+ model?: boolean;
673
+ tokens?: boolean;
674
+ toolCalls?: boolean;
675
+ agentId?: boolean;
676
+ metadata?: boolean;
677
+ createdAt?: boolean;
678
+ updatedAt?: boolean;
679
+ deletedAt?: boolean;
680
+ };
681
+ export type AiMessageOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "sessionId" | "historyId" | "type" | "content" | "thoughts" | "model" | "tokens" | "toolCalls" | "agentId" | "metadata" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["aiMessage"]>;
682
+ export type AiMessageInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
683
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
684
+ };
685
+ export type AiMessageIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
686
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
687
+ };
688
+ export type AiMessageIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
689
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
690
+ };
691
+ export type $AiMessagePayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
692
+ name: "AiMessage";
693
+ objects: {
694
+ history: Prisma.$AiChatHistoryPayload<ExtArgs> | null;
695
+ };
696
+ scalars: runtime.Types.Extensions.GetPayloadResult<{
697
+ id: string;
698
+ sessionId: string;
699
+ historyId: string | null;
700
+ type: string;
701
+ content: string;
702
+ thoughts: runtime.JsonValue | null;
703
+ model: string | null;
704
+ tokens: runtime.JsonValue | null;
705
+ toolCalls: runtime.JsonValue | null;
706
+ agentId: string | null;
707
+ metadata: runtime.JsonValue | null;
708
+ createdAt: Date;
709
+ updatedAt: Date;
710
+ deletedAt: Date | null;
711
+ }, ExtArgs["result"]["aiMessage"]>;
712
+ composites: {};
713
+ };
714
+ export type AiMessageGetPayload<S extends boolean | null | undefined | AiMessageDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$AiMessagePayload, S>;
715
+ export type AiMessageCountArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = Omit<AiMessageFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
716
+ select?: AiMessageCountAggregateInputType | true;
717
+ };
718
+ export interface AiMessageDelegate<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> {
719
+ [K: symbol]: {
720
+ types: Prisma.TypeMap<ExtArgs>['model']['AiMessage'];
721
+ meta: {
722
+ name: 'AiMessage';
723
+ };
724
+ };
725
+ /**
726
+ * Find zero or one AiMessage that matches the filter.
727
+ * @param {AiMessageFindUniqueArgs} args - Arguments to find a AiMessage
728
+ * @example
729
+ * // Get one AiMessage
730
+ * const aiMessage = await prisma.aiMessage.findUnique({
731
+ * where: {
732
+ * // ... provide filter here
733
+ * }
734
+ * })
735
+ */
736
+ findUnique<T extends AiMessageFindUniqueArgs>(args: Prisma.SelectSubset<T, AiMessageFindUniqueArgs<ExtArgs>>): Prisma.Prisma__AiMessageClient<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>;
737
+ /**
738
+ * Find one AiMessage that matches the filter or throw an error with `error.code='P2025'`
739
+ * if no matches were found.
740
+ * @param {AiMessageFindUniqueOrThrowArgs} args - Arguments to find a AiMessage
741
+ * @example
742
+ * // Get one AiMessage
743
+ * const aiMessage = await prisma.aiMessage.findUniqueOrThrow({
744
+ * where: {
745
+ * // ... provide filter here
746
+ * }
747
+ * })
748
+ */
749
+ findUniqueOrThrow<T extends AiMessageFindUniqueOrThrowArgs>(args: Prisma.SelectSubset<T, AiMessageFindUniqueOrThrowArgs<ExtArgs>>): Prisma.Prisma__AiMessageClient<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
750
+ /**
751
+ * Find the first AiMessage that matches the filter.
752
+ * Note, that providing `undefined` is treated as the value not being there.
753
+ * Read more here: https://pris.ly/d/null-undefined
754
+ * @param {AiMessageFindFirstArgs} args - Arguments to find a AiMessage
755
+ * @example
756
+ * // Get one AiMessage
757
+ * const aiMessage = await prisma.aiMessage.findFirst({
758
+ * where: {
759
+ * // ... provide filter here
760
+ * }
761
+ * })
762
+ */
763
+ findFirst<T extends AiMessageFindFirstArgs>(args?: Prisma.SelectSubset<T, AiMessageFindFirstArgs<ExtArgs>>): Prisma.Prisma__AiMessageClient<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>;
764
+ /**
765
+ * Find the first AiMessage that matches the filter or
766
+ * throw `PrismaKnownClientError` with `P2025` code if no matches were found.
767
+ * Note, that providing `undefined` is treated as the value not being there.
768
+ * Read more here: https://pris.ly/d/null-undefined
769
+ * @param {AiMessageFindFirstOrThrowArgs} args - Arguments to find a AiMessage
770
+ * @example
771
+ * // Get one AiMessage
772
+ * const aiMessage = await prisma.aiMessage.findFirstOrThrow({
773
+ * where: {
774
+ * // ... provide filter here
775
+ * }
776
+ * })
777
+ */
778
+ findFirstOrThrow<T extends AiMessageFindFirstOrThrowArgs>(args?: Prisma.SelectSubset<T, AiMessageFindFirstOrThrowArgs<ExtArgs>>): Prisma.Prisma__AiMessageClient<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
779
+ /**
780
+ * Find zero or more AiMessages that matches the filter.
781
+ * Note, that providing `undefined` is treated as the value not being there.
782
+ * Read more here: https://pris.ly/d/null-undefined
783
+ * @param {AiMessageFindManyArgs} args - Arguments to filter and select certain fields only.
784
+ * @example
785
+ * // Get all AiMessages
786
+ * const aiMessages = await prisma.aiMessage.findMany()
787
+ *
788
+ * // Get first 10 AiMessages
789
+ * const aiMessages = await prisma.aiMessage.findMany({ take: 10 })
790
+ *
791
+ * // Only select the `id`
792
+ * const aiMessageWithIdOnly = await prisma.aiMessage.findMany({ select: { id: true } })
793
+ *
794
+ */
795
+ findMany<T extends AiMessageFindManyArgs>(args?: Prisma.SelectSubset<T, AiMessageFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>;
796
+ /**
797
+ * Create a AiMessage.
798
+ * @param {AiMessageCreateArgs} args - Arguments to create a AiMessage.
799
+ * @example
800
+ * // Create one AiMessage
801
+ * const AiMessage = await prisma.aiMessage.create({
802
+ * data: {
803
+ * // ... data to create a AiMessage
804
+ * }
805
+ * })
806
+ *
807
+ */
808
+ create<T extends AiMessageCreateArgs>(args: Prisma.SelectSubset<T, AiMessageCreateArgs<ExtArgs>>): Prisma.Prisma__AiMessageClient<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
809
+ /**
810
+ * Create many AiMessages.
811
+ * @param {AiMessageCreateManyArgs} args - Arguments to create many AiMessages.
812
+ * @example
813
+ * // Create many AiMessages
814
+ * const aiMessage = await prisma.aiMessage.createMany({
815
+ * data: [
816
+ * // ... provide data here
817
+ * ]
818
+ * })
819
+ *
820
+ */
821
+ createMany<T extends AiMessageCreateManyArgs>(args?: Prisma.SelectSubset<T, AiMessageCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
822
+ /**
823
+ * Create many AiMessages and returns the data saved in the database.
824
+ * @param {AiMessageCreateManyAndReturnArgs} args - Arguments to create many AiMessages.
825
+ * @example
826
+ * // Create many AiMessages
827
+ * const aiMessage = await prisma.aiMessage.createManyAndReturn({
828
+ * data: [
829
+ * // ... provide data here
830
+ * ]
831
+ * })
832
+ *
833
+ * // Create many AiMessages and only return the `id`
834
+ * const aiMessageWithIdOnly = await prisma.aiMessage.createManyAndReturn({
835
+ * select: { id: true },
836
+ * data: [
837
+ * // ... provide data here
838
+ * ]
839
+ * })
840
+ * Note, that providing `undefined` is treated as the value not being there.
841
+ * Read more here: https://pris.ly/d/null-undefined
842
+ *
843
+ */
844
+ createManyAndReturn<T extends AiMessageCreateManyAndReturnArgs>(args?: Prisma.SelectSubset<T, AiMessageCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>;
845
+ /**
846
+ * Delete a AiMessage.
847
+ * @param {AiMessageDeleteArgs} args - Arguments to delete one AiMessage.
848
+ * @example
849
+ * // Delete one AiMessage
850
+ * const AiMessage = await prisma.aiMessage.delete({
851
+ * where: {
852
+ * // ... filter to delete one AiMessage
853
+ * }
854
+ * })
855
+ *
856
+ */
857
+ delete<T extends AiMessageDeleteArgs>(args: Prisma.SelectSubset<T, AiMessageDeleteArgs<ExtArgs>>): Prisma.Prisma__AiMessageClient<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
858
+ /**
859
+ * Update one AiMessage.
860
+ * @param {AiMessageUpdateArgs} args - Arguments to update one AiMessage.
861
+ * @example
862
+ * // Update one AiMessage
863
+ * const aiMessage = await prisma.aiMessage.update({
864
+ * where: {
865
+ * // ... provide filter here
866
+ * },
867
+ * data: {
868
+ * // ... provide data here
869
+ * }
870
+ * })
871
+ *
872
+ */
873
+ update<T extends AiMessageUpdateArgs>(args: Prisma.SelectSubset<T, AiMessageUpdateArgs<ExtArgs>>): Prisma.Prisma__AiMessageClient<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
874
+ /**
875
+ * Delete zero or more AiMessages.
876
+ * @param {AiMessageDeleteManyArgs} args - Arguments to filter AiMessages to delete.
877
+ * @example
878
+ * // Delete a few AiMessages
879
+ * const { count } = await prisma.aiMessage.deleteMany({
880
+ * where: {
881
+ * // ... provide filter here
882
+ * }
883
+ * })
884
+ *
885
+ */
886
+ deleteMany<T extends AiMessageDeleteManyArgs>(args?: Prisma.SelectSubset<T, AiMessageDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
887
+ /**
888
+ * Update zero or more AiMessages.
889
+ * Note, that providing `undefined` is treated as the value not being there.
890
+ * Read more here: https://pris.ly/d/null-undefined
891
+ * @param {AiMessageUpdateManyArgs} args - Arguments to update one or more rows.
892
+ * @example
893
+ * // Update many AiMessages
894
+ * const aiMessage = await prisma.aiMessage.updateMany({
895
+ * where: {
896
+ * // ... provide filter here
897
+ * },
898
+ * data: {
899
+ * // ... provide data here
900
+ * }
901
+ * })
902
+ *
903
+ */
904
+ updateMany<T extends AiMessageUpdateManyArgs>(args: Prisma.SelectSubset<T, AiMessageUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
905
+ /**
906
+ * Update zero or more AiMessages and returns the data updated in the database.
907
+ * @param {AiMessageUpdateManyAndReturnArgs} args - Arguments to update many AiMessages.
908
+ * @example
909
+ * // Update many AiMessages
910
+ * const aiMessage = await prisma.aiMessage.updateManyAndReturn({
911
+ * where: {
912
+ * // ... provide filter here
913
+ * },
914
+ * data: [
915
+ * // ... provide data here
916
+ * ]
917
+ * })
918
+ *
919
+ * // Update zero or more AiMessages and only return the `id`
920
+ * const aiMessageWithIdOnly = await prisma.aiMessage.updateManyAndReturn({
921
+ * select: { id: true },
922
+ * where: {
923
+ * // ... provide filter here
924
+ * },
925
+ * data: [
926
+ * // ... provide data here
927
+ * ]
928
+ * })
929
+ * Note, that providing `undefined` is treated as the value not being there.
930
+ * Read more here: https://pris.ly/d/null-undefined
931
+ *
932
+ */
933
+ updateManyAndReturn<T extends AiMessageUpdateManyAndReturnArgs>(args: Prisma.SelectSubset<T, AiMessageUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>;
934
+ /**
935
+ * Create or update one AiMessage.
936
+ * @param {AiMessageUpsertArgs} args - Arguments to update or create a AiMessage.
937
+ * @example
938
+ * // Update or create a AiMessage
939
+ * const aiMessage = await prisma.aiMessage.upsert({
940
+ * create: {
941
+ * // ... data to create a AiMessage
942
+ * },
943
+ * update: {
944
+ * // ... in case it already exists, update
945
+ * },
946
+ * where: {
947
+ * // ... the filter for the AiMessage we want to update
948
+ * }
949
+ * })
950
+ */
951
+ upsert<T extends AiMessageUpsertArgs>(args: Prisma.SelectSubset<T, AiMessageUpsertArgs<ExtArgs>>): Prisma.Prisma__AiMessageClient<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
952
+ /**
953
+ * Count the number of AiMessages.
954
+ * Note, that providing `undefined` is treated as the value not being there.
955
+ * Read more here: https://pris.ly/d/null-undefined
956
+ * @param {AiMessageCountArgs} args - Arguments to filter AiMessages to count.
957
+ * @example
958
+ * // Count the number of AiMessages
959
+ * const count = await prisma.aiMessage.count({
960
+ * where: {
961
+ * // ... the filter for the AiMessages we want to count
962
+ * }
963
+ * })
964
+ **/
965
+ count<T extends AiMessageCountArgs>(args?: Prisma.Subset<T, AiMessageCountArgs>): Prisma.PrismaPromise<T extends runtime.Types.Utils.Record<'select', any> ? T['select'] extends true ? number : Prisma.GetScalarType<T['select'], AiMessageCountAggregateOutputType> : number>;
966
+ /**
967
+ * Allows you to perform aggregations operations on a AiMessage.
968
+ * Note, that providing `undefined` is treated as the value not being there.
969
+ * Read more here: https://pris.ly/d/null-undefined
970
+ * @param {AiMessageAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
971
+ * @example
972
+ * // Ordered by age ascending
973
+ * // Where email contains prisma.io
974
+ * // Limited to the 10 users
975
+ * const aggregations = await prisma.user.aggregate({
976
+ * _avg: {
977
+ * age: true,
978
+ * },
979
+ * where: {
980
+ * email: {
981
+ * contains: "prisma.io",
982
+ * },
983
+ * },
984
+ * orderBy: {
985
+ * age: "asc",
986
+ * },
987
+ * take: 10,
988
+ * })
989
+ **/
990
+ aggregate<T extends AiMessageAggregateArgs>(args: Prisma.Subset<T, AiMessageAggregateArgs>): Prisma.PrismaPromise<GetAiMessageAggregateType<T>>;
991
+ /**
992
+ * Group by AiMessage.
993
+ * Note, that providing `undefined` is treated as the value not being there.
994
+ * Read more here: https://pris.ly/d/null-undefined
995
+ * @param {AiMessageGroupByArgs} args - Group by arguments.
996
+ * @example
997
+ * // Group by city, order by createdAt, get count
998
+ * const result = await prisma.user.groupBy({
999
+ * by: ['city', 'createdAt'],
1000
+ * orderBy: {
1001
+ * createdAt: true
1002
+ * },
1003
+ * _count: {
1004
+ * _all: true
1005
+ * },
1006
+ * })
1007
+ *
1008
+ **/
1009
+ groupBy<T extends AiMessageGroupByArgs, HasSelectOrTake extends Prisma.Or<Prisma.Extends<'skip', Prisma.Keys<T>>, Prisma.Extends<'take', Prisma.Keys<T>>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? {
1010
+ orderBy: AiMessageGroupByArgs['orderBy'];
1011
+ } : {
1012
+ orderBy?: AiMessageGroupByArgs['orderBy'];
1013
+ }, OrderFields extends Prisma.ExcludeUnderscoreKeys<Prisma.Keys<Prisma.MaybeTupleToUnion<T['orderBy']>>>, ByFields extends Prisma.MaybeTupleToUnion<T['by']>, ByValid extends Prisma.Has<ByFields, OrderFields>, HavingFields extends Prisma.GetHavingFields<T['having']>, HavingValid extends Prisma.Has<ByFields, HavingFields>, ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, InputErrors extends ByEmpty extends Prisma.True ? `Error: "by" must not be empty.` : HavingValid extends Prisma.False ? {
1014
+ [P in HavingFields]: P extends ByFields ? never : P extends string ? `Error: Field "${P}" used in "having" needs to be provided in "by".` : [
1015
+ Error,
1016
+ 'Field ',
1017
+ P,
1018
+ ` in "having" needs to be provided in "by"`
1019
+ ];
1020
+ }[HavingFields] : 'take' extends Prisma.Keys<T> ? 'orderBy' extends Prisma.Keys<T> ? ByValid extends Prisma.True ? {} : {
1021
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
1022
+ }[OrderFields] : 'Error: If you provide "take", you also need to provide "orderBy"' : 'skip' extends Prisma.Keys<T> ? 'orderBy' extends Prisma.Keys<T> ? ByValid extends Prisma.True ? {} : {
1023
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
1024
+ }[OrderFields] : 'Error: If you provide "skip", you also need to provide "orderBy"' : ByValid extends Prisma.True ? {} : {
1025
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
1026
+ }[OrderFields]>(args: Prisma.SubsetIntersection<T, AiMessageGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetAiMessageGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>;
1027
+ /**
1028
+ * Fields of the AiMessage model
1029
+ */
1030
+ readonly fields: AiMessageFieldRefs;
1031
+ }
1032
+ /**
1033
+ * The delegate class that acts as a "Promise-like" for AiMessage.
1034
+ * Why is this prefixed with `Prisma__`?
1035
+ * Because we want to prevent naming conflicts as mentioned in
1036
+ * https://github.com/prisma/prisma-client-js/issues/707
1037
+ */
1038
+ export interface Prisma__AiMessageClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
1039
+ readonly [Symbol.toStringTag]: "PrismaPromise";
1040
+ history<T extends Prisma.AiMessage$historyArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AiMessage$historyArgs<ExtArgs>>): Prisma.Prisma__AiChatHistoryClient<runtime.Types.Result.GetResult<Prisma.$AiChatHistoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>;
1041
+ /**
1042
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
1043
+ * @param onfulfilled The callback to execute when the Promise is resolved.
1044
+ * @param onrejected The callback to execute when the Promise is rejected.
1045
+ * @returns A Promise for the completion of which ever callback is executed.
1046
+ */
1047
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): runtime.Types.Utils.JsPromise<TResult1 | TResult2>;
1048
+ /**
1049
+ * Attaches a callback for only the rejection of the Promise.
1050
+ * @param onrejected The callback to execute when the Promise is rejected.
1051
+ * @returns A Promise for the completion of the callback.
1052
+ */
1053
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): runtime.Types.Utils.JsPromise<T | TResult>;
1054
+ /**
1055
+ * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
1056
+ * resolved value cannot be modified from the callback.
1057
+ * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
1058
+ * @returns A Promise for the completion of the callback.
1059
+ */
1060
+ finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise<T>;
1061
+ }
1062
+ /**
1063
+ * Fields of the AiMessage model
1064
+ */
1065
+ export interface AiMessageFieldRefs {
1066
+ readonly id: Prisma.FieldRef<"AiMessage", 'String'>;
1067
+ readonly sessionId: Prisma.FieldRef<"AiMessage", 'String'>;
1068
+ readonly historyId: Prisma.FieldRef<"AiMessage", 'String'>;
1069
+ readonly type: Prisma.FieldRef<"AiMessage", 'String'>;
1070
+ readonly content: Prisma.FieldRef<"AiMessage", 'String'>;
1071
+ readonly thoughts: Prisma.FieldRef<"AiMessage", 'Json'>;
1072
+ readonly model: Prisma.FieldRef<"AiMessage", 'String'>;
1073
+ readonly tokens: Prisma.FieldRef<"AiMessage", 'Json'>;
1074
+ readonly toolCalls: Prisma.FieldRef<"AiMessage", 'Json'>;
1075
+ readonly agentId: Prisma.FieldRef<"AiMessage", 'String'>;
1076
+ readonly metadata: Prisma.FieldRef<"AiMessage", 'Json'>;
1077
+ readonly createdAt: Prisma.FieldRef<"AiMessage", 'DateTime'>;
1078
+ readonly updatedAt: Prisma.FieldRef<"AiMessage", 'DateTime'>;
1079
+ readonly deletedAt: Prisma.FieldRef<"AiMessage", 'DateTime'>;
1080
+ }
1081
+ /**
1082
+ * AiMessage findUnique
1083
+ */
1084
+ export type AiMessageFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1085
+ /**
1086
+ * Select specific fields to fetch from the AiMessage
1087
+ */
1088
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1089
+ /**
1090
+ * Omit specific fields from the AiMessage
1091
+ */
1092
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1093
+ /**
1094
+ * Choose, which related nodes to fetch as well
1095
+ */
1096
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1097
+ /**
1098
+ * Filter, which AiMessage to fetch.
1099
+ */
1100
+ where: Prisma.AiMessageWhereUniqueInput;
1101
+ };
1102
+ /**
1103
+ * AiMessage findUniqueOrThrow
1104
+ */
1105
+ export type AiMessageFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1106
+ /**
1107
+ * Select specific fields to fetch from the AiMessage
1108
+ */
1109
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1110
+ /**
1111
+ * Omit specific fields from the AiMessage
1112
+ */
1113
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1114
+ /**
1115
+ * Choose, which related nodes to fetch as well
1116
+ */
1117
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1118
+ /**
1119
+ * Filter, which AiMessage to fetch.
1120
+ */
1121
+ where: Prisma.AiMessageWhereUniqueInput;
1122
+ };
1123
+ /**
1124
+ * AiMessage findFirst
1125
+ */
1126
+ export type AiMessageFindFirstArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1127
+ /**
1128
+ * Select specific fields to fetch from the AiMessage
1129
+ */
1130
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1131
+ /**
1132
+ * Omit specific fields from the AiMessage
1133
+ */
1134
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1135
+ /**
1136
+ * Choose, which related nodes to fetch as well
1137
+ */
1138
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1139
+ /**
1140
+ * Filter, which AiMessage to fetch.
1141
+ */
1142
+ where?: Prisma.AiMessageWhereInput;
1143
+ /**
1144
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
1145
+ *
1146
+ * Determine the order of AiMessages to fetch.
1147
+ */
1148
+ orderBy?: Prisma.AiMessageOrderByWithRelationInput | Prisma.AiMessageOrderByWithRelationInput[];
1149
+ /**
1150
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
1151
+ *
1152
+ * Sets the position for searching for AiMessages.
1153
+ */
1154
+ cursor?: Prisma.AiMessageWhereUniqueInput;
1155
+ /**
1156
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1157
+ *
1158
+ * Take `±n` AiMessages from the position of the cursor.
1159
+ */
1160
+ take?: number;
1161
+ /**
1162
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1163
+ *
1164
+ * Skip the first `n` AiMessages.
1165
+ */
1166
+ skip?: number;
1167
+ /**
1168
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1169
+ *
1170
+ * Filter by unique combinations of AiMessages.
1171
+ */
1172
+ distinct?: Prisma.AiMessageScalarFieldEnum | Prisma.AiMessageScalarFieldEnum[];
1173
+ };
1174
+ /**
1175
+ * AiMessage findFirstOrThrow
1176
+ */
1177
+ export type AiMessageFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1178
+ /**
1179
+ * Select specific fields to fetch from the AiMessage
1180
+ */
1181
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1182
+ /**
1183
+ * Omit specific fields from the AiMessage
1184
+ */
1185
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1186
+ /**
1187
+ * Choose, which related nodes to fetch as well
1188
+ */
1189
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1190
+ /**
1191
+ * Filter, which AiMessage to fetch.
1192
+ */
1193
+ where?: Prisma.AiMessageWhereInput;
1194
+ /**
1195
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
1196
+ *
1197
+ * Determine the order of AiMessages to fetch.
1198
+ */
1199
+ orderBy?: Prisma.AiMessageOrderByWithRelationInput | Prisma.AiMessageOrderByWithRelationInput[];
1200
+ /**
1201
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
1202
+ *
1203
+ * Sets the position for searching for AiMessages.
1204
+ */
1205
+ cursor?: Prisma.AiMessageWhereUniqueInput;
1206
+ /**
1207
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1208
+ *
1209
+ * Take `±n` AiMessages from the position of the cursor.
1210
+ */
1211
+ take?: number;
1212
+ /**
1213
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1214
+ *
1215
+ * Skip the first `n` AiMessages.
1216
+ */
1217
+ skip?: number;
1218
+ /**
1219
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1220
+ *
1221
+ * Filter by unique combinations of AiMessages.
1222
+ */
1223
+ distinct?: Prisma.AiMessageScalarFieldEnum | Prisma.AiMessageScalarFieldEnum[];
1224
+ };
1225
+ /**
1226
+ * AiMessage findMany
1227
+ */
1228
+ export type AiMessageFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1229
+ /**
1230
+ * Select specific fields to fetch from the AiMessage
1231
+ */
1232
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1233
+ /**
1234
+ * Omit specific fields from the AiMessage
1235
+ */
1236
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1237
+ /**
1238
+ * Choose, which related nodes to fetch as well
1239
+ */
1240
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1241
+ /**
1242
+ * Filter, which AiMessages to fetch.
1243
+ */
1244
+ where?: Prisma.AiMessageWhereInput;
1245
+ /**
1246
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
1247
+ *
1248
+ * Determine the order of AiMessages to fetch.
1249
+ */
1250
+ orderBy?: Prisma.AiMessageOrderByWithRelationInput | Prisma.AiMessageOrderByWithRelationInput[];
1251
+ /**
1252
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
1253
+ *
1254
+ * Sets the position for listing AiMessages.
1255
+ */
1256
+ cursor?: Prisma.AiMessageWhereUniqueInput;
1257
+ /**
1258
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1259
+ *
1260
+ * Take `±n` AiMessages from the position of the cursor.
1261
+ */
1262
+ take?: number;
1263
+ /**
1264
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1265
+ *
1266
+ * Skip the first `n` AiMessages.
1267
+ */
1268
+ skip?: number;
1269
+ /**
1270
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1271
+ *
1272
+ * Filter by unique combinations of AiMessages.
1273
+ */
1274
+ distinct?: Prisma.AiMessageScalarFieldEnum | Prisma.AiMessageScalarFieldEnum[];
1275
+ };
1276
+ /**
1277
+ * AiMessage create
1278
+ */
1279
+ export type AiMessageCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1280
+ /**
1281
+ * Select specific fields to fetch from the AiMessage
1282
+ */
1283
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1284
+ /**
1285
+ * Omit specific fields from the AiMessage
1286
+ */
1287
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1288
+ /**
1289
+ * Choose, which related nodes to fetch as well
1290
+ */
1291
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1292
+ /**
1293
+ * The data needed to create a AiMessage.
1294
+ */
1295
+ data: Prisma.XOR<Prisma.AiMessageCreateInput, Prisma.AiMessageUncheckedCreateInput>;
1296
+ };
1297
+ /**
1298
+ * AiMessage createMany
1299
+ */
1300
+ export type AiMessageCreateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1301
+ /**
1302
+ * The data used to create many AiMessages.
1303
+ */
1304
+ data: Prisma.AiMessageCreateManyInput | Prisma.AiMessageCreateManyInput[];
1305
+ skipDuplicates?: boolean;
1306
+ };
1307
+ /**
1308
+ * AiMessage createManyAndReturn
1309
+ */
1310
+ export type AiMessageCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1311
+ /**
1312
+ * Select specific fields to fetch from the AiMessage
1313
+ */
1314
+ select?: Prisma.AiMessageSelectCreateManyAndReturn<ExtArgs> | null;
1315
+ /**
1316
+ * Omit specific fields from the AiMessage
1317
+ */
1318
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1319
+ /**
1320
+ * The data used to create many AiMessages.
1321
+ */
1322
+ data: Prisma.AiMessageCreateManyInput | Prisma.AiMessageCreateManyInput[];
1323
+ skipDuplicates?: boolean;
1324
+ /**
1325
+ * Choose, which related nodes to fetch as well
1326
+ */
1327
+ include?: Prisma.AiMessageIncludeCreateManyAndReturn<ExtArgs> | null;
1328
+ };
1329
+ /**
1330
+ * AiMessage update
1331
+ */
1332
+ export type AiMessageUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1333
+ /**
1334
+ * Select specific fields to fetch from the AiMessage
1335
+ */
1336
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1337
+ /**
1338
+ * Omit specific fields from the AiMessage
1339
+ */
1340
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1341
+ /**
1342
+ * Choose, which related nodes to fetch as well
1343
+ */
1344
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1345
+ /**
1346
+ * The data needed to update a AiMessage.
1347
+ */
1348
+ data: Prisma.XOR<Prisma.AiMessageUpdateInput, Prisma.AiMessageUncheckedUpdateInput>;
1349
+ /**
1350
+ * Choose, which AiMessage to update.
1351
+ */
1352
+ where: Prisma.AiMessageWhereUniqueInput;
1353
+ };
1354
+ /**
1355
+ * AiMessage updateMany
1356
+ */
1357
+ export type AiMessageUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1358
+ /**
1359
+ * The data used to update AiMessages.
1360
+ */
1361
+ data: Prisma.XOR<Prisma.AiMessageUpdateManyMutationInput, Prisma.AiMessageUncheckedUpdateManyInput>;
1362
+ /**
1363
+ * Filter which AiMessages to update
1364
+ */
1365
+ where?: Prisma.AiMessageWhereInput;
1366
+ /**
1367
+ * Limit how many AiMessages to update.
1368
+ */
1369
+ limit?: number;
1370
+ };
1371
+ /**
1372
+ * AiMessage updateManyAndReturn
1373
+ */
1374
+ export type AiMessageUpdateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1375
+ /**
1376
+ * Select specific fields to fetch from the AiMessage
1377
+ */
1378
+ select?: Prisma.AiMessageSelectUpdateManyAndReturn<ExtArgs> | null;
1379
+ /**
1380
+ * Omit specific fields from the AiMessage
1381
+ */
1382
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1383
+ /**
1384
+ * The data used to update AiMessages.
1385
+ */
1386
+ data: Prisma.XOR<Prisma.AiMessageUpdateManyMutationInput, Prisma.AiMessageUncheckedUpdateManyInput>;
1387
+ /**
1388
+ * Filter which AiMessages to update
1389
+ */
1390
+ where?: Prisma.AiMessageWhereInput;
1391
+ /**
1392
+ * Limit how many AiMessages to update.
1393
+ */
1394
+ limit?: number;
1395
+ /**
1396
+ * Choose, which related nodes to fetch as well
1397
+ */
1398
+ include?: Prisma.AiMessageIncludeUpdateManyAndReturn<ExtArgs> | null;
1399
+ };
1400
+ /**
1401
+ * AiMessage upsert
1402
+ */
1403
+ export type AiMessageUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1404
+ /**
1405
+ * Select specific fields to fetch from the AiMessage
1406
+ */
1407
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1408
+ /**
1409
+ * Omit specific fields from the AiMessage
1410
+ */
1411
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1412
+ /**
1413
+ * Choose, which related nodes to fetch as well
1414
+ */
1415
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1416
+ /**
1417
+ * The filter to search for the AiMessage to update in case it exists.
1418
+ */
1419
+ where: Prisma.AiMessageWhereUniqueInput;
1420
+ /**
1421
+ * In case the AiMessage found by the `where` argument doesn't exist, create a new AiMessage with this data.
1422
+ */
1423
+ create: Prisma.XOR<Prisma.AiMessageCreateInput, Prisma.AiMessageUncheckedCreateInput>;
1424
+ /**
1425
+ * In case the AiMessage was found with the provided `where` argument, update it with this data.
1426
+ */
1427
+ update: Prisma.XOR<Prisma.AiMessageUpdateInput, Prisma.AiMessageUncheckedUpdateInput>;
1428
+ };
1429
+ /**
1430
+ * AiMessage delete
1431
+ */
1432
+ export type AiMessageDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1433
+ /**
1434
+ * Select specific fields to fetch from the AiMessage
1435
+ */
1436
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1437
+ /**
1438
+ * Omit specific fields from the AiMessage
1439
+ */
1440
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1441
+ /**
1442
+ * Choose, which related nodes to fetch as well
1443
+ */
1444
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1445
+ /**
1446
+ * Filter which AiMessage to delete.
1447
+ */
1448
+ where: Prisma.AiMessageWhereUniqueInput;
1449
+ };
1450
+ /**
1451
+ * AiMessage deleteMany
1452
+ */
1453
+ export type AiMessageDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1454
+ /**
1455
+ * Filter which AiMessages to delete
1456
+ */
1457
+ where?: Prisma.AiMessageWhereInput;
1458
+ /**
1459
+ * Limit how many AiMessages to delete.
1460
+ */
1461
+ limit?: number;
1462
+ };
1463
+ /**
1464
+ * AiMessage.history
1465
+ */
1466
+ export type AiMessage$historyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1467
+ /**
1468
+ * Select specific fields to fetch from the AiChatHistory
1469
+ */
1470
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
1471
+ /**
1472
+ * Omit specific fields from the AiChatHistory
1473
+ */
1474
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
1475
+ /**
1476
+ * Choose, which related nodes to fetch as well
1477
+ */
1478
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
1479
+ where?: Prisma.AiChatHistoryWhereInput;
1480
+ };
1481
+ /**
1482
+ * AiMessage without action
1483
+ */
1484
+ export type AiMessageDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1485
+ /**
1486
+ * Select specific fields to fetch from the AiMessage
1487
+ */
1488
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1489
+ /**
1490
+ * Omit specific fields from the AiMessage
1491
+ */
1492
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1493
+ /**
1494
+ * Choose, which related nodes to fetch as well
1495
+ */
1496
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1497
+ };