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