@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,1494 @@
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
+ };
521
+ export type AiMessageUpsertWithWhereUniqueWithoutHistoryInput = {
522
+ where: Prisma.AiMessageWhereUniqueInput;
523
+ update: Prisma.XOR<Prisma.AiMessageUpdateWithoutHistoryInput, Prisma.AiMessageUncheckedUpdateWithoutHistoryInput>;
524
+ create: Prisma.XOR<Prisma.AiMessageCreateWithoutHistoryInput, Prisma.AiMessageUncheckedCreateWithoutHistoryInput>;
525
+ };
526
+ export type AiMessageUpdateWithWhereUniqueWithoutHistoryInput = {
527
+ where: Prisma.AiMessageWhereUniqueInput;
528
+ data: Prisma.XOR<Prisma.AiMessageUpdateWithoutHistoryInput, Prisma.AiMessageUncheckedUpdateWithoutHistoryInput>;
529
+ };
530
+ export type AiMessageUpdateManyWithWhereWithoutHistoryInput = {
531
+ where: Prisma.AiMessageScalarWhereInput;
532
+ data: Prisma.XOR<Prisma.AiMessageUpdateManyMutationInput, Prisma.AiMessageUncheckedUpdateManyWithoutHistoryInput>;
533
+ };
534
+ export type AiMessageScalarWhereInput = {
535
+ AND?: Prisma.AiMessageScalarWhereInput | Prisma.AiMessageScalarWhereInput[];
536
+ OR?: Prisma.AiMessageScalarWhereInput[];
537
+ NOT?: Prisma.AiMessageScalarWhereInput | Prisma.AiMessageScalarWhereInput[];
538
+ id?: Prisma.StringFilter<"AiMessage"> | string;
539
+ sessionId?: Prisma.StringFilter<"AiMessage"> | string;
540
+ historyId?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
541
+ type?: Prisma.StringFilter<"AiMessage"> | string;
542
+ content?: Prisma.StringFilter<"AiMessage"> | string;
543
+ thoughts?: Prisma.JsonNullableFilter<"AiMessage">;
544
+ model?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
545
+ tokens?: Prisma.JsonNullableFilter<"AiMessage">;
546
+ toolCalls?: Prisma.JsonNullableFilter<"AiMessage">;
547
+ agentId?: Prisma.StringNullableFilter<"AiMessage"> | string | null;
548
+ metadata?: Prisma.JsonNullableFilter<"AiMessage">;
549
+ createdAt?: Prisma.DateTimeFilter<"AiMessage"> | Date | string;
550
+ updatedAt?: Prisma.DateTimeFilter<"AiMessage"> | Date | string;
551
+ deletedAt?: Prisma.DateTimeNullableFilter<"AiMessage"> | Date | string | null;
552
+ };
553
+ export type AiMessageCreateManyHistoryInput = {
554
+ id?: string;
555
+ sessionId: string;
556
+ type: string;
557
+ content: string;
558
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
559
+ model?: string | null;
560
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
561
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
562
+ agentId?: string | null;
563
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
564
+ createdAt?: Date | string;
565
+ updatedAt?: Date | string;
566
+ deletedAt?: Date | string | null;
567
+ };
568
+ export type AiMessageUpdateWithoutHistoryInput = {
569
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
570
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
571
+ type?: Prisma.StringFieldUpdateOperationsInput | string;
572
+ content?: Prisma.StringFieldUpdateOperationsInput | string;
573
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
574
+ model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
575
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
576
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
577
+ agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
578
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
579
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
580
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
581
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
582
+ };
583
+ export type AiMessageUncheckedUpdateWithoutHistoryInput = {
584
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
585
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
586
+ type?: Prisma.StringFieldUpdateOperationsInput | string;
587
+ content?: Prisma.StringFieldUpdateOperationsInput | string;
588
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
589
+ model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
590
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
591
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
592
+ agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
593
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
594
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
595
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
596
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
597
+ };
598
+ export type AiMessageUncheckedUpdateManyWithoutHistoryInput = {
599
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
600
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
601
+ type?: Prisma.StringFieldUpdateOperationsInput | string;
602
+ content?: Prisma.StringFieldUpdateOperationsInput | string;
603
+ thoughts?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
604
+ model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
605
+ tokens?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
606
+ toolCalls?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
607
+ agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
608
+ metadata?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue;
609
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
610
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string;
611
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
612
+ };
613
+ export type AiMessageSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
614
+ id?: boolean;
615
+ sessionId?: boolean;
616
+ historyId?: boolean;
617
+ type?: boolean;
618
+ content?: boolean;
619
+ thoughts?: boolean;
620
+ model?: boolean;
621
+ tokens?: boolean;
622
+ toolCalls?: boolean;
623
+ agentId?: boolean;
624
+ metadata?: boolean;
625
+ createdAt?: boolean;
626
+ updatedAt?: boolean;
627
+ deletedAt?: boolean;
628
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
629
+ }, ExtArgs["result"]["aiMessage"]>;
630
+ export type AiMessageSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
631
+ id?: boolean;
632
+ sessionId?: boolean;
633
+ historyId?: boolean;
634
+ type?: boolean;
635
+ content?: boolean;
636
+ thoughts?: boolean;
637
+ model?: boolean;
638
+ tokens?: boolean;
639
+ toolCalls?: boolean;
640
+ agentId?: boolean;
641
+ metadata?: boolean;
642
+ createdAt?: boolean;
643
+ updatedAt?: boolean;
644
+ deletedAt?: boolean;
645
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
646
+ }, ExtArgs["result"]["aiMessage"]>;
647
+ export type AiMessageSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
648
+ id?: boolean;
649
+ sessionId?: boolean;
650
+ historyId?: boolean;
651
+ type?: boolean;
652
+ content?: boolean;
653
+ thoughts?: boolean;
654
+ model?: boolean;
655
+ tokens?: boolean;
656
+ toolCalls?: boolean;
657
+ agentId?: boolean;
658
+ metadata?: boolean;
659
+ createdAt?: boolean;
660
+ updatedAt?: boolean;
661
+ deletedAt?: boolean;
662
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
663
+ }, ExtArgs["result"]["aiMessage"]>;
664
+ export type AiMessageSelectScalar = {
665
+ id?: boolean;
666
+ sessionId?: boolean;
667
+ historyId?: boolean;
668
+ type?: boolean;
669
+ content?: boolean;
670
+ thoughts?: boolean;
671
+ model?: boolean;
672
+ tokens?: boolean;
673
+ toolCalls?: boolean;
674
+ agentId?: boolean;
675
+ metadata?: boolean;
676
+ createdAt?: boolean;
677
+ updatedAt?: boolean;
678
+ deletedAt?: boolean;
679
+ };
680
+ 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"]>;
681
+ export type AiMessageInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
682
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
683
+ };
684
+ export type AiMessageIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
685
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
686
+ };
687
+ export type AiMessageIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
688
+ history?: boolean | Prisma.AiMessage$historyArgs<ExtArgs>;
689
+ };
690
+ export type $AiMessagePayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
691
+ name: "AiMessage";
692
+ objects: {
693
+ history: Prisma.$AiChatHistoryPayload<ExtArgs> | null;
694
+ };
695
+ scalars: runtime.Types.Extensions.GetPayloadResult<{
696
+ id: string;
697
+ sessionId: string;
698
+ historyId: string | null;
699
+ type: string;
700
+ content: string;
701
+ thoughts: runtime.JsonValue | null;
702
+ model: string | null;
703
+ tokens: runtime.JsonValue | null;
704
+ toolCalls: runtime.JsonValue | null;
705
+ agentId: string | null;
706
+ metadata: runtime.JsonValue | null;
707
+ createdAt: Date;
708
+ updatedAt: Date;
709
+ deletedAt: Date | null;
710
+ }, ExtArgs["result"]["aiMessage"]>;
711
+ composites: {};
712
+ };
713
+ export type AiMessageGetPayload<S extends boolean | null | undefined | AiMessageDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$AiMessagePayload, S>;
714
+ export type AiMessageCountArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = Omit<AiMessageFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
715
+ select?: AiMessageCountAggregateInputType | true;
716
+ };
717
+ export interface AiMessageDelegate<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> {
718
+ [K: symbol]: {
719
+ types: Prisma.TypeMap<ExtArgs>['model']['AiMessage'];
720
+ meta: {
721
+ name: 'AiMessage';
722
+ };
723
+ };
724
+ /**
725
+ * Find zero or one AiMessage that matches the filter.
726
+ * @param {AiMessageFindUniqueArgs} args - Arguments to find a AiMessage
727
+ * @example
728
+ * // Get one AiMessage
729
+ * const aiMessage = await prisma.aiMessage.findUnique({
730
+ * where: {
731
+ * // ... provide filter here
732
+ * }
733
+ * })
734
+ */
735
+ 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>;
736
+ /**
737
+ * Find one AiMessage that matches the filter or throw an error with `error.code='P2025'`
738
+ * if no matches were found.
739
+ * @param {AiMessageFindUniqueOrThrowArgs} args - Arguments to find a AiMessage
740
+ * @example
741
+ * // Get one AiMessage
742
+ * const aiMessage = await prisma.aiMessage.findUniqueOrThrow({
743
+ * where: {
744
+ * // ... provide filter here
745
+ * }
746
+ * })
747
+ */
748
+ 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>;
749
+ /**
750
+ * Find the first AiMessage that matches the filter.
751
+ * Note, that providing `undefined` is treated as the value not being there.
752
+ * Read more here: https://pris.ly/d/null-undefined
753
+ * @param {AiMessageFindFirstArgs} args - Arguments to find a AiMessage
754
+ * @example
755
+ * // Get one AiMessage
756
+ * const aiMessage = await prisma.aiMessage.findFirst({
757
+ * where: {
758
+ * // ... provide filter here
759
+ * }
760
+ * })
761
+ */
762
+ 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>;
763
+ /**
764
+ * Find the first AiMessage that matches the filter or
765
+ * throw `PrismaKnownClientError` with `P2025` code if no matches were found.
766
+ * Note, that providing `undefined` is treated as the value not being there.
767
+ * Read more here: https://pris.ly/d/null-undefined
768
+ * @param {AiMessageFindFirstOrThrowArgs} args - Arguments to find a AiMessage
769
+ * @example
770
+ * // Get one AiMessage
771
+ * const aiMessage = await prisma.aiMessage.findFirstOrThrow({
772
+ * where: {
773
+ * // ... provide filter here
774
+ * }
775
+ * })
776
+ */
777
+ 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>;
778
+ /**
779
+ * Find zero or more AiMessages that matches the filter.
780
+ * Note, that providing `undefined` is treated as the value not being there.
781
+ * Read more here: https://pris.ly/d/null-undefined
782
+ * @param {AiMessageFindManyArgs} args - Arguments to filter and select certain fields only.
783
+ * @example
784
+ * // Get all AiMessages
785
+ * const aiMessages = await prisma.aiMessage.findMany()
786
+ *
787
+ * // Get first 10 AiMessages
788
+ * const aiMessages = await prisma.aiMessage.findMany({ take: 10 })
789
+ *
790
+ * // Only select the `id`
791
+ * const aiMessageWithIdOnly = await prisma.aiMessage.findMany({ select: { id: true } })
792
+ *
793
+ */
794
+ findMany<T extends AiMessageFindManyArgs>(args?: Prisma.SelectSubset<T, AiMessageFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>;
795
+ /**
796
+ * Create a AiMessage.
797
+ * @param {AiMessageCreateArgs} args - Arguments to create a AiMessage.
798
+ * @example
799
+ * // Create one AiMessage
800
+ * const AiMessage = await prisma.aiMessage.create({
801
+ * data: {
802
+ * // ... data to create a AiMessage
803
+ * }
804
+ * })
805
+ *
806
+ */
807
+ 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>;
808
+ /**
809
+ * Create many AiMessages.
810
+ * @param {AiMessageCreateManyArgs} args - Arguments to create many AiMessages.
811
+ * @example
812
+ * // Create many AiMessages
813
+ * const aiMessage = await prisma.aiMessage.createMany({
814
+ * data: [
815
+ * // ... provide data here
816
+ * ]
817
+ * })
818
+ *
819
+ */
820
+ createMany<T extends AiMessageCreateManyArgs>(args?: Prisma.SelectSubset<T, AiMessageCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
821
+ /**
822
+ * Create many AiMessages and returns the data saved in the database.
823
+ * @param {AiMessageCreateManyAndReturnArgs} args - Arguments to create many AiMessages.
824
+ * @example
825
+ * // Create many AiMessages
826
+ * const aiMessage = await prisma.aiMessage.createManyAndReturn({
827
+ * data: [
828
+ * // ... provide data here
829
+ * ]
830
+ * })
831
+ *
832
+ * // Create many AiMessages and only return the `id`
833
+ * const aiMessageWithIdOnly = await prisma.aiMessage.createManyAndReturn({
834
+ * select: { id: true },
835
+ * data: [
836
+ * // ... provide data here
837
+ * ]
838
+ * })
839
+ * Note, that providing `undefined` is treated as the value not being there.
840
+ * Read more here: https://pris.ly/d/null-undefined
841
+ *
842
+ */
843
+ createManyAndReturn<T extends AiMessageCreateManyAndReturnArgs>(args?: Prisma.SelectSubset<T, AiMessageCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>;
844
+ /**
845
+ * Delete a AiMessage.
846
+ * @param {AiMessageDeleteArgs} args - Arguments to delete one AiMessage.
847
+ * @example
848
+ * // Delete one AiMessage
849
+ * const AiMessage = await prisma.aiMessage.delete({
850
+ * where: {
851
+ * // ... filter to delete one AiMessage
852
+ * }
853
+ * })
854
+ *
855
+ */
856
+ 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>;
857
+ /**
858
+ * Update one AiMessage.
859
+ * @param {AiMessageUpdateArgs} args - Arguments to update one AiMessage.
860
+ * @example
861
+ * // Update one AiMessage
862
+ * const aiMessage = await prisma.aiMessage.update({
863
+ * where: {
864
+ * // ... provide filter here
865
+ * },
866
+ * data: {
867
+ * // ... provide data here
868
+ * }
869
+ * })
870
+ *
871
+ */
872
+ 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>;
873
+ /**
874
+ * Delete zero or more AiMessages.
875
+ * @param {AiMessageDeleteManyArgs} args - Arguments to filter AiMessages to delete.
876
+ * @example
877
+ * // Delete a few AiMessages
878
+ * const { count } = await prisma.aiMessage.deleteMany({
879
+ * where: {
880
+ * // ... provide filter here
881
+ * }
882
+ * })
883
+ *
884
+ */
885
+ deleteMany<T extends AiMessageDeleteManyArgs>(args?: Prisma.SelectSubset<T, AiMessageDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
886
+ /**
887
+ * Update zero or more AiMessages.
888
+ * Note, that providing `undefined` is treated as the value not being there.
889
+ * Read more here: https://pris.ly/d/null-undefined
890
+ * @param {AiMessageUpdateManyArgs} args - Arguments to update one or more rows.
891
+ * @example
892
+ * // Update many AiMessages
893
+ * const aiMessage = await prisma.aiMessage.updateMany({
894
+ * where: {
895
+ * // ... provide filter here
896
+ * },
897
+ * data: {
898
+ * // ... provide data here
899
+ * }
900
+ * })
901
+ *
902
+ */
903
+ updateMany<T extends AiMessageUpdateManyArgs>(args: Prisma.SelectSubset<T, AiMessageUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
904
+ /**
905
+ * Update zero or more AiMessages and returns the data updated in the database.
906
+ * @param {AiMessageUpdateManyAndReturnArgs} args - Arguments to update many AiMessages.
907
+ * @example
908
+ * // Update many AiMessages
909
+ * const aiMessage = await prisma.aiMessage.updateManyAndReturn({
910
+ * where: {
911
+ * // ... provide filter here
912
+ * },
913
+ * data: [
914
+ * // ... provide data here
915
+ * ]
916
+ * })
917
+ *
918
+ * // Update zero or more AiMessages and only return the `id`
919
+ * const aiMessageWithIdOnly = await prisma.aiMessage.updateManyAndReturn({
920
+ * select: { id: true },
921
+ * where: {
922
+ * // ... provide filter here
923
+ * },
924
+ * data: [
925
+ * // ... provide data here
926
+ * ]
927
+ * })
928
+ * Note, that providing `undefined` is treated as the value not being there.
929
+ * Read more here: https://pris.ly/d/null-undefined
930
+ *
931
+ */
932
+ updateManyAndReturn<T extends AiMessageUpdateManyAndReturnArgs>(args: Prisma.SelectSubset<T, AiMessageUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>;
933
+ /**
934
+ * Create or update one AiMessage.
935
+ * @param {AiMessageUpsertArgs} args - Arguments to update or create a AiMessage.
936
+ * @example
937
+ * // Update or create a AiMessage
938
+ * const aiMessage = await prisma.aiMessage.upsert({
939
+ * create: {
940
+ * // ... data to create a AiMessage
941
+ * },
942
+ * update: {
943
+ * // ... in case it already exists, update
944
+ * },
945
+ * where: {
946
+ * // ... the filter for the AiMessage we want to update
947
+ * }
948
+ * })
949
+ */
950
+ 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>;
951
+ /**
952
+ * Count the number of AiMessages.
953
+ * Note, that providing `undefined` is treated as the value not being there.
954
+ * Read more here: https://pris.ly/d/null-undefined
955
+ * @param {AiMessageCountArgs} args - Arguments to filter AiMessages to count.
956
+ * @example
957
+ * // Count the number of AiMessages
958
+ * const count = await prisma.aiMessage.count({
959
+ * where: {
960
+ * // ... the filter for the AiMessages we want to count
961
+ * }
962
+ * })
963
+ **/
964
+ 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>;
965
+ /**
966
+ * Allows you to perform aggregations operations on a AiMessage.
967
+ * Note, that providing `undefined` is treated as the value not being there.
968
+ * Read more here: https://pris.ly/d/null-undefined
969
+ * @param {AiMessageAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
970
+ * @example
971
+ * // Ordered by age ascending
972
+ * // Where email contains prisma.io
973
+ * // Limited to the 10 users
974
+ * const aggregations = await prisma.user.aggregate({
975
+ * _avg: {
976
+ * age: true,
977
+ * },
978
+ * where: {
979
+ * email: {
980
+ * contains: "prisma.io",
981
+ * },
982
+ * },
983
+ * orderBy: {
984
+ * age: "asc",
985
+ * },
986
+ * take: 10,
987
+ * })
988
+ **/
989
+ aggregate<T extends AiMessageAggregateArgs>(args: Prisma.Subset<T, AiMessageAggregateArgs>): Prisma.PrismaPromise<GetAiMessageAggregateType<T>>;
990
+ /**
991
+ * Group by AiMessage.
992
+ * Note, that providing `undefined` is treated as the value not being there.
993
+ * Read more here: https://pris.ly/d/null-undefined
994
+ * @param {AiMessageGroupByArgs} args - Group by arguments.
995
+ * @example
996
+ * // Group by city, order by createdAt, get count
997
+ * const result = await prisma.user.groupBy({
998
+ * by: ['city', 'createdAt'],
999
+ * orderBy: {
1000
+ * createdAt: true
1001
+ * },
1002
+ * _count: {
1003
+ * _all: true
1004
+ * },
1005
+ * })
1006
+ *
1007
+ **/
1008
+ 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 ? {
1009
+ orderBy: AiMessageGroupByArgs['orderBy'];
1010
+ } : {
1011
+ orderBy?: AiMessageGroupByArgs['orderBy'];
1012
+ }, 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 ? {
1013
+ [P in HavingFields]: P extends ByFields ? never : P extends string ? `Error: Field "${P}" used in "having" needs to be provided in "by".` : [
1014
+ Error,
1015
+ 'Field ',
1016
+ P,
1017
+ ` in "having" needs to be provided in "by"`
1018
+ ];
1019
+ }[HavingFields] : 'take' extends Prisma.Keys<T> ? 'orderBy' extends Prisma.Keys<T> ? ByValid extends Prisma.True ? {} : {
1020
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
1021
+ }[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 ? {} : {
1022
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
1023
+ }[OrderFields] : 'Error: If you provide "skip", you also need to provide "orderBy"' : ByValid extends Prisma.True ? {} : {
1024
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
1025
+ }[OrderFields]>(args: Prisma.SubsetIntersection<T, AiMessageGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetAiMessageGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>;
1026
+ /**
1027
+ * Fields of the AiMessage model
1028
+ */
1029
+ readonly fields: AiMessageFieldRefs;
1030
+ }
1031
+ /**
1032
+ * The delegate class that acts as a "Promise-like" for AiMessage.
1033
+ * Why is this prefixed with `Prisma__`?
1034
+ * Because we want to prevent naming conflicts as mentioned in
1035
+ * https://github.com/prisma/prisma-client-js/issues/707
1036
+ */
1037
+ export interface Prisma__AiMessageClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
1038
+ readonly [Symbol.toStringTag]: "PrismaPromise";
1039
+ 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>;
1040
+ /**
1041
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
1042
+ * @param onfulfilled The callback to execute when the Promise is resolved.
1043
+ * @param onrejected The callback to execute when the Promise is rejected.
1044
+ * @returns A Promise for the completion of which ever callback is executed.
1045
+ */
1046
+ 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>;
1047
+ /**
1048
+ * Attaches a callback for only the rejection of the Promise.
1049
+ * @param onrejected The callback to execute when the Promise is rejected.
1050
+ * @returns A Promise for the completion of the callback.
1051
+ */
1052
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): runtime.Types.Utils.JsPromise<T | TResult>;
1053
+ /**
1054
+ * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
1055
+ * resolved value cannot be modified from the callback.
1056
+ * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
1057
+ * @returns A Promise for the completion of the callback.
1058
+ */
1059
+ finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise<T>;
1060
+ }
1061
+ /**
1062
+ * Fields of the AiMessage model
1063
+ */
1064
+ export interface AiMessageFieldRefs {
1065
+ readonly id: Prisma.FieldRef<"AiMessage", 'String'>;
1066
+ readonly sessionId: Prisma.FieldRef<"AiMessage", 'String'>;
1067
+ readonly historyId: Prisma.FieldRef<"AiMessage", 'String'>;
1068
+ readonly type: Prisma.FieldRef<"AiMessage", 'String'>;
1069
+ readonly content: Prisma.FieldRef<"AiMessage", 'String'>;
1070
+ readonly thoughts: Prisma.FieldRef<"AiMessage", 'Json'>;
1071
+ readonly model: Prisma.FieldRef<"AiMessage", 'String'>;
1072
+ readonly tokens: Prisma.FieldRef<"AiMessage", 'Json'>;
1073
+ readonly toolCalls: Prisma.FieldRef<"AiMessage", 'Json'>;
1074
+ readonly agentId: Prisma.FieldRef<"AiMessage", 'String'>;
1075
+ readonly metadata: Prisma.FieldRef<"AiMessage", 'Json'>;
1076
+ readonly createdAt: Prisma.FieldRef<"AiMessage", 'DateTime'>;
1077
+ readonly updatedAt: Prisma.FieldRef<"AiMessage", 'DateTime'>;
1078
+ readonly deletedAt: Prisma.FieldRef<"AiMessage", 'DateTime'>;
1079
+ }
1080
+ /**
1081
+ * AiMessage findUnique
1082
+ */
1083
+ export type AiMessageFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1084
+ /**
1085
+ * Select specific fields to fetch from the AiMessage
1086
+ */
1087
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1088
+ /**
1089
+ * Omit specific fields from the AiMessage
1090
+ */
1091
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1092
+ /**
1093
+ * Choose, which related nodes to fetch as well
1094
+ */
1095
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1096
+ /**
1097
+ * Filter, which AiMessage to fetch.
1098
+ */
1099
+ where: Prisma.AiMessageWhereUniqueInput;
1100
+ };
1101
+ /**
1102
+ * AiMessage findUniqueOrThrow
1103
+ */
1104
+ export type AiMessageFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1105
+ /**
1106
+ * Select specific fields to fetch from the AiMessage
1107
+ */
1108
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1109
+ /**
1110
+ * Omit specific fields from the AiMessage
1111
+ */
1112
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1113
+ /**
1114
+ * Choose, which related nodes to fetch as well
1115
+ */
1116
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1117
+ /**
1118
+ * Filter, which AiMessage to fetch.
1119
+ */
1120
+ where: Prisma.AiMessageWhereUniqueInput;
1121
+ };
1122
+ /**
1123
+ * AiMessage findFirst
1124
+ */
1125
+ export type AiMessageFindFirstArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1126
+ /**
1127
+ * Select specific fields to fetch from the AiMessage
1128
+ */
1129
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1130
+ /**
1131
+ * Omit specific fields from the AiMessage
1132
+ */
1133
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1134
+ /**
1135
+ * Choose, which related nodes to fetch as well
1136
+ */
1137
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1138
+ /**
1139
+ * Filter, which AiMessage to fetch.
1140
+ */
1141
+ where?: Prisma.AiMessageWhereInput;
1142
+ /**
1143
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
1144
+ *
1145
+ * Determine the order of AiMessages to fetch.
1146
+ */
1147
+ orderBy?: Prisma.AiMessageOrderByWithRelationInput | Prisma.AiMessageOrderByWithRelationInput[];
1148
+ /**
1149
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
1150
+ *
1151
+ * Sets the position for searching for AiMessages.
1152
+ */
1153
+ cursor?: Prisma.AiMessageWhereUniqueInput;
1154
+ /**
1155
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1156
+ *
1157
+ * Take `±n` AiMessages from the position of the cursor.
1158
+ */
1159
+ take?: number;
1160
+ /**
1161
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1162
+ *
1163
+ * Skip the first `n` AiMessages.
1164
+ */
1165
+ skip?: number;
1166
+ /**
1167
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1168
+ *
1169
+ * Filter by unique combinations of AiMessages.
1170
+ */
1171
+ distinct?: Prisma.AiMessageScalarFieldEnum | Prisma.AiMessageScalarFieldEnum[];
1172
+ };
1173
+ /**
1174
+ * AiMessage findFirstOrThrow
1175
+ */
1176
+ export type AiMessageFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1177
+ /**
1178
+ * Select specific fields to fetch from the AiMessage
1179
+ */
1180
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1181
+ /**
1182
+ * Omit specific fields from the AiMessage
1183
+ */
1184
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1185
+ /**
1186
+ * Choose, which related nodes to fetch as well
1187
+ */
1188
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1189
+ /**
1190
+ * Filter, which AiMessage to fetch.
1191
+ */
1192
+ where?: Prisma.AiMessageWhereInput;
1193
+ /**
1194
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
1195
+ *
1196
+ * Determine the order of AiMessages to fetch.
1197
+ */
1198
+ orderBy?: Prisma.AiMessageOrderByWithRelationInput | Prisma.AiMessageOrderByWithRelationInput[];
1199
+ /**
1200
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
1201
+ *
1202
+ * Sets the position for searching for AiMessages.
1203
+ */
1204
+ cursor?: Prisma.AiMessageWhereUniqueInput;
1205
+ /**
1206
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1207
+ *
1208
+ * Take `±n` AiMessages from the position of the cursor.
1209
+ */
1210
+ take?: number;
1211
+ /**
1212
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1213
+ *
1214
+ * Skip the first `n` AiMessages.
1215
+ */
1216
+ skip?: number;
1217
+ /**
1218
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1219
+ *
1220
+ * Filter by unique combinations of AiMessages.
1221
+ */
1222
+ distinct?: Prisma.AiMessageScalarFieldEnum | Prisma.AiMessageScalarFieldEnum[];
1223
+ };
1224
+ /**
1225
+ * AiMessage findMany
1226
+ */
1227
+ export type AiMessageFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1228
+ /**
1229
+ * Select specific fields to fetch from the AiMessage
1230
+ */
1231
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1232
+ /**
1233
+ * Omit specific fields from the AiMessage
1234
+ */
1235
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1236
+ /**
1237
+ * Choose, which related nodes to fetch as well
1238
+ */
1239
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1240
+ /**
1241
+ * Filter, which AiMessages to fetch.
1242
+ */
1243
+ where?: Prisma.AiMessageWhereInput;
1244
+ /**
1245
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
1246
+ *
1247
+ * Determine the order of AiMessages to fetch.
1248
+ */
1249
+ orderBy?: Prisma.AiMessageOrderByWithRelationInput | Prisma.AiMessageOrderByWithRelationInput[];
1250
+ /**
1251
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
1252
+ *
1253
+ * Sets the position for listing AiMessages.
1254
+ */
1255
+ cursor?: Prisma.AiMessageWhereUniqueInput;
1256
+ /**
1257
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1258
+ *
1259
+ * Take `±n` AiMessages from the position of the cursor.
1260
+ */
1261
+ take?: number;
1262
+ /**
1263
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1264
+ *
1265
+ * Skip the first `n` AiMessages.
1266
+ */
1267
+ skip?: number;
1268
+ /**
1269
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1270
+ *
1271
+ * Filter by unique combinations of AiMessages.
1272
+ */
1273
+ distinct?: Prisma.AiMessageScalarFieldEnum | Prisma.AiMessageScalarFieldEnum[];
1274
+ };
1275
+ /**
1276
+ * AiMessage create
1277
+ */
1278
+ export type AiMessageCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1279
+ /**
1280
+ * Select specific fields to fetch from the AiMessage
1281
+ */
1282
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1283
+ /**
1284
+ * Omit specific fields from the AiMessage
1285
+ */
1286
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1287
+ /**
1288
+ * Choose, which related nodes to fetch as well
1289
+ */
1290
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1291
+ /**
1292
+ * The data needed to create a AiMessage.
1293
+ */
1294
+ data: Prisma.XOR<Prisma.AiMessageCreateInput, Prisma.AiMessageUncheckedCreateInput>;
1295
+ };
1296
+ /**
1297
+ * AiMessage createMany
1298
+ */
1299
+ export type AiMessageCreateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1300
+ /**
1301
+ * The data used to create many AiMessages.
1302
+ */
1303
+ data: Prisma.AiMessageCreateManyInput | Prisma.AiMessageCreateManyInput[];
1304
+ };
1305
+ /**
1306
+ * AiMessage createManyAndReturn
1307
+ */
1308
+ export type AiMessageCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1309
+ /**
1310
+ * Select specific fields to fetch from the AiMessage
1311
+ */
1312
+ select?: Prisma.AiMessageSelectCreateManyAndReturn<ExtArgs> | null;
1313
+ /**
1314
+ * Omit specific fields from the AiMessage
1315
+ */
1316
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1317
+ /**
1318
+ * The data used to create many AiMessages.
1319
+ */
1320
+ data: Prisma.AiMessageCreateManyInput | Prisma.AiMessageCreateManyInput[];
1321
+ /**
1322
+ * Choose, which related nodes to fetch as well
1323
+ */
1324
+ include?: Prisma.AiMessageIncludeCreateManyAndReturn<ExtArgs> | null;
1325
+ };
1326
+ /**
1327
+ * AiMessage update
1328
+ */
1329
+ export type AiMessageUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1330
+ /**
1331
+ * Select specific fields to fetch from the AiMessage
1332
+ */
1333
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1334
+ /**
1335
+ * Omit specific fields from the AiMessage
1336
+ */
1337
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1338
+ /**
1339
+ * Choose, which related nodes to fetch as well
1340
+ */
1341
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1342
+ /**
1343
+ * The data needed to update a AiMessage.
1344
+ */
1345
+ data: Prisma.XOR<Prisma.AiMessageUpdateInput, Prisma.AiMessageUncheckedUpdateInput>;
1346
+ /**
1347
+ * Choose, which AiMessage to update.
1348
+ */
1349
+ where: Prisma.AiMessageWhereUniqueInput;
1350
+ };
1351
+ /**
1352
+ * AiMessage updateMany
1353
+ */
1354
+ export type AiMessageUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1355
+ /**
1356
+ * The data used to update AiMessages.
1357
+ */
1358
+ data: Prisma.XOR<Prisma.AiMessageUpdateManyMutationInput, Prisma.AiMessageUncheckedUpdateManyInput>;
1359
+ /**
1360
+ * Filter which AiMessages to update
1361
+ */
1362
+ where?: Prisma.AiMessageWhereInput;
1363
+ /**
1364
+ * Limit how many AiMessages to update.
1365
+ */
1366
+ limit?: number;
1367
+ };
1368
+ /**
1369
+ * AiMessage updateManyAndReturn
1370
+ */
1371
+ export type AiMessageUpdateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1372
+ /**
1373
+ * Select specific fields to fetch from the AiMessage
1374
+ */
1375
+ select?: Prisma.AiMessageSelectUpdateManyAndReturn<ExtArgs> | null;
1376
+ /**
1377
+ * Omit specific fields from the AiMessage
1378
+ */
1379
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1380
+ /**
1381
+ * The data used to update AiMessages.
1382
+ */
1383
+ data: Prisma.XOR<Prisma.AiMessageUpdateManyMutationInput, Prisma.AiMessageUncheckedUpdateManyInput>;
1384
+ /**
1385
+ * Filter which AiMessages to update
1386
+ */
1387
+ where?: Prisma.AiMessageWhereInput;
1388
+ /**
1389
+ * Limit how many AiMessages to update.
1390
+ */
1391
+ limit?: number;
1392
+ /**
1393
+ * Choose, which related nodes to fetch as well
1394
+ */
1395
+ include?: Prisma.AiMessageIncludeUpdateManyAndReturn<ExtArgs> | null;
1396
+ };
1397
+ /**
1398
+ * AiMessage upsert
1399
+ */
1400
+ export type AiMessageUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1401
+ /**
1402
+ * Select specific fields to fetch from the AiMessage
1403
+ */
1404
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1405
+ /**
1406
+ * Omit specific fields from the AiMessage
1407
+ */
1408
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1409
+ /**
1410
+ * Choose, which related nodes to fetch as well
1411
+ */
1412
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1413
+ /**
1414
+ * The filter to search for the AiMessage to update in case it exists.
1415
+ */
1416
+ where: Prisma.AiMessageWhereUniqueInput;
1417
+ /**
1418
+ * In case the AiMessage found by the `where` argument doesn't exist, create a new AiMessage with this data.
1419
+ */
1420
+ create: Prisma.XOR<Prisma.AiMessageCreateInput, Prisma.AiMessageUncheckedCreateInput>;
1421
+ /**
1422
+ * In case the AiMessage was found with the provided `where` argument, update it with this data.
1423
+ */
1424
+ update: Prisma.XOR<Prisma.AiMessageUpdateInput, Prisma.AiMessageUncheckedUpdateInput>;
1425
+ };
1426
+ /**
1427
+ * AiMessage delete
1428
+ */
1429
+ export type AiMessageDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1430
+ /**
1431
+ * Select specific fields to fetch from the AiMessage
1432
+ */
1433
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1434
+ /**
1435
+ * Omit specific fields from the AiMessage
1436
+ */
1437
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1438
+ /**
1439
+ * Choose, which related nodes to fetch as well
1440
+ */
1441
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1442
+ /**
1443
+ * Filter which AiMessage to delete.
1444
+ */
1445
+ where: Prisma.AiMessageWhereUniqueInput;
1446
+ };
1447
+ /**
1448
+ * AiMessage deleteMany
1449
+ */
1450
+ export type AiMessageDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1451
+ /**
1452
+ * Filter which AiMessages to delete
1453
+ */
1454
+ where?: Prisma.AiMessageWhereInput;
1455
+ /**
1456
+ * Limit how many AiMessages to delete.
1457
+ */
1458
+ limit?: number;
1459
+ };
1460
+ /**
1461
+ * AiMessage.history
1462
+ */
1463
+ export type AiMessage$historyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1464
+ /**
1465
+ * Select specific fields to fetch from the AiChatHistory
1466
+ */
1467
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
1468
+ /**
1469
+ * Omit specific fields from the AiChatHistory
1470
+ */
1471
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
1472
+ /**
1473
+ * Choose, which related nodes to fetch as well
1474
+ */
1475
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
1476
+ where?: Prisma.AiChatHistoryWhereInput;
1477
+ };
1478
+ /**
1479
+ * AiMessage without action
1480
+ */
1481
+ export type AiMessageDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1482
+ /**
1483
+ * Select specific fields to fetch from the AiMessage
1484
+ */
1485
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1486
+ /**
1487
+ * Omit specific fields from the AiMessage
1488
+ */
1489
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1490
+ /**
1491
+ * Choose, which related nodes to fetch as well
1492
+ */
1493
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1494
+ };