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