@chat-js/cli 0.3.0 → 0.6.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 (136) hide show
  1. package/dist/index.js +1173 -964
  2. package/package.json +1 -1
  3. package/templates/chat-app/app/(auth)/device-login/page.tsx +37 -0
  4. package/templates/chat-app/app/(auth)/login/page.tsx +26 -2
  5. package/templates/chat-app/app/(auth)/register/page.tsx +0 -12
  6. package/templates/chat-app/app/(chat)/api/chat/filter-reasoning-parts.ts +1 -1
  7. package/templates/chat-app/app/(chat)/api/chat/prepare/route.ts +94 -0
  8. package/templates/chat-app/app/(chat)/api/chat/route.ts +107 -16
  9. package/templates/chat-app/app/(chat)/layout.tsx +4 -1
  10. package/templates/chat-app/app/api/trpc/[trpc]/route.ts +1 -0
  11. package/templates/chat-app/app/globals.css +9 -9
  12. package/templates/chat-app/app/layout.tsx +4 -2
  13. package/templates/chat-app/biome.jsonc +3 -3
  14. package/templates/chat-app/chat.config.ts +32 -12
  15. package/templates/chat-app/components/ai-elements/prompt-input.tsx +1 -1
  16. package/templates/chat-app/components/anonymous-session-init.tsx +10 -6
  17. package/templates/chat-app/components/artifact-actions.tsx +81 -18
  18. package/templates/chat-app/components/artifact-panel.tsx +142 -41
  19. package/templates/chat-app/components/attachment-list.tsx +1 -1
  20. package/templates/chat-app/components/{social-auth-providers.tsx → auth-providers.tsx} +49 -4
  21. package/templates/chat-app/components/chat/chat-welcome.tsx +3 -3
  22. package/templates/chat-app/components/chat-menu-items.tsx +1 -1
  23. package/templates/chat-app/components/chat-sync.tsx +9 -11
  24. package/templates/chat-app/components/console.tsx +9 -9
  25. package/templates/chat-app/components/context-usage.tsx +2 -2
  26. package/templates/chat-app/components/create-artifact.tsx +15 -5
  27. package/templates/chat-app/components/data-stream-handler.tsx +57 -16
  28. package/templates/chat-app/components/device-login-page.tsx +191 -0
  29. package/templates/chat-app/components/diffview.tsx +8 -2
  30. package/templates/chat-app/components/electron-auth-handler.tsx +184 -0
  31. package/templates/chat-app/components/electron-auth-ui.tsx +121 -0
  32. package/templates/chat-app/components/favicon-group.tsx +1 -1
  33. package/templates/chat-app/components/feedback-actions.tsx +7 -3
  34. package/templates/chat-app/components/greeting.tsx +1 -1
  35. package/templates/chat-app/components/interactive-chart-impl.tsx +3 -4
  36. package/templates/chat-app/components/interactive-charts.tsx +1 -1
  37. package/templates/chat-app/components/login-form.tsx +52 -10
  38. package/templates/chat-app/components/message-editor.tsx +7 -3
  39. package/templates/chat-app/components/message-siblings.tsx +14 -1
  40. package/templates/chat-app/components/model-selector.tsx +295 -27
  41. package/templates/chat-app/components/multimodal-input.tsx +259 -22
  42. package/templates/chat-app/components/parallel-response-cards.tsx +175 -0
  43. package/templates/chat-app/components/part/code-execution.tsx +8 -2
  44. package/templates/chat-app/components/part/document-common.tsx +1 -1
  45. package/templates/chat-app/components/part/document-preview.tsx +5 -5
  46. package/templates/chat-app/components/part/retrieve-url.tsx +12 -12
  47. package/templates/chat-app/components/part/text-message-part.tsx +9 -1
  48. package/templates/chat-app/components/project-chat-item.tsx +1 -1
  49. package/templates/chat-app/components/project-menu-items.tsx +1 -1
  50. package/templates/chat-app/components/research-task.tsx +1 -1
  51. package/templates/chat-app/components/research-tasks.tsx +1 -1
  52. package/templates/chat-app/components/retry-button.tsx +25 -8
  53. package/templates/chat-app/components/sandbox.tsx +1 -1
  54. package/templates/chat-app/components/sheet-editor.tsx +7 -7
  55. package/templates/chat-app/components/sidebar-chats-list.tsx +1 -1
  56. package/templates/chat-app/components/sidebar-toggle.tsx +15 -2
  57. package/templates/chat-app/components/sidebar-top-row.tsx +27 -12
  58. package/templates/chat-app/components/sidebar-user-nav.tsx +10 -1
  59. package/templates/chat-app/components/signup-form.tsx +49 -10
  60. package/templates/chat-app/components/sources.tsx +4 -4
  61. package/templates/chat-app/components/text-editor.tsx +5 -2
  62. package/templates/chat-app/components/toolbar.tsx +3 -3
  63. package/templates/chat-app/components/ui/sidebar.tsx +0 -1
  64. package/templates/chat-app/components/upgrade-cta/limit-display.tsx +1 -1
  65. package/templates/chat-app/components/user-message.tsx +14 -2
  66. package/templates/chat-app/electron.d.ts +41 -0
  67. package/templates/chat-app/evals/my-eval.eval.ts +3 -1
  68. package/templates/chat-app/hooks/chat-sync-hooks.ts +11 -0
  69. package/templates/chat-app/hooks/use-artifact.tsx +13 -13
  70. package/templates/chat-app/hooks/use-navigate-to-message.ts +39 -0
  71. package/templates/chat-app/lib/ai/gateways/provider-types.ts +19 -10
  72. package/templates/chat-app/lib/ai/stream-errors.test.ts +72 -0
  73. package/templates/chat-app/lib/ai/stream-errors.ts +94 -0
  74. package/templates/chat-app/lib/ai/tools/code-execution.javascript.ts +171 -0
  75. package/templates/chat-app/lib/ai/tools/code-execution.python.ts +336 -0
  76. package/templates/chat-app/lib/ai/tools/code-execution.shared.test.ts +71 -0
  77. package/templates/chat-app/lib/ai/tools/code-execution.shared.ts +59 -0
  78. package/templates/chat-app/lib/ai/tools/code-execution.ts +62 -391
  79. package/templates/chat-app/lib/ai/tools/code-execution.types.ts +24 -0
  80. package/templates/chat-app/lib/ai/tools/steps/multi-query-web-search.ts +3 -2
  81. package/templates/chat-app/lib/ai/types.ts +74 -3
  82. package/templates/chat-app/lib/anonymous-session-client.ts +0 -3
  83. package/templates/chat-app/lib/artifacts/code/client.tsx +35 -5
  84. package/templates/chat-app/lib/artifacts/sheet/client.tsx +11 -3
  85. package/templates/chat-app/lib/auth-client.ts +23 -1
  86. package/templates/chat-app/lib/auth.ts +18 -1
  87. package/templates/chat-app/lib/blob.ts +1 -1
  88. package/templates/chat-app/lib/clone-messages.ts +1 -1
  89. package/templates/chat-app/lib/config-schema.ts +18 -1
  90. package/templates/chat-app/lib/constants.ts +3 -4
  91. package/templates/chat-app/lib/db/migrations/0044_gray_red_shift.sql +5 -0
  92. package/templates/chat-app/lib/db/migrations/meta/0044_snapshot.json +1480 -0
  93. package/templates/chat-app/lib/db/migrations/meta/_journal.json +7 -0
  94. package/templates/chat-app/lib/db/queries.ts +84 -4
  95. package/templates/chat-app/lib/db/schema.ts +4 -1
  96. package/templates/chat-app/lib/editor/config.ts +4 -4
  97. package/templates/chat-app/lib/electron-auth.ts +96 -0
  98. package/templates/chat-app/lib/env-schema.ts +33 -4
  99. package/templates/chat-app/lib/message-conversion.ts +14 -2
  100. package/templates/chat-app/lib/playwright-test-environment.ts +18 -0
  101. package/templates/chat-app/lib/social-auth.ts +5 -0
  102. package/templates/chat-app/lib/stores/hooks-threads.ts +38 -1
  103. package/templates/chat-app/lib/stores/with-threads.test.ts +137 -0
  104. package/templates/chat-app/lib/stores/with-threads.ts +159 -7
  105. package/templates/chat-app/lib/stores/with-tracing.ts +1 -1
  106. package/templates/chat-app/lib/thread-utils.ts +22 -3
  107. package/templates/chat-app/lib/utils/download-assets.ts +6 -7
  108. package/templates/chat-app/lib/utils/rate-limit.ts +9 -3
  109. package/templates/chat-app/package.json +20 -18
  110. package/templates/chat-app/playwright.config.ts +0 -19
  111. package/templates/chat-app/providers/chat-input-provider.tsx +40 -2
  112. package/templates/chat-app/proxy.ts +28 -3
  113. package/templates/chat-app/scripts/check-env.ts +10 -0
  114. package/templates/chat-app/scripts/db-branch-delete.sh +7 -1
  115. package/templates/chat-app/scripts/db-branch-use.sh +7 -1
  116. package/templates/chat-app/scripts/with-db.sh +7 -1
  117. package/templates/chat-app/trpc/server.tsx +7 -2
  118. package/templates/chat-app/tsconfig.json +2 -1
  119. package/templates/chat-app/vercel.json +0 -10
  120. package/templates/chat-app/vitest.config.ts +2 -0
  121. package/templates/electron/CHANGELOG.md +7 -0
  122. package/templates/electron/README.md +54 -0
  123. package/templates/electron/entitlements.mac.plist +10 -0
  124. package/templates/electron/forge.config.ts +157 -0
  125. package/templates/electron/icon.png +0 -0
  126. package/templates/electron/package.json +53 -0
  127. package/templates/electron/scripts/generate-icons.test.js +37 -0
  128. package/templates/electron/scripts/generate-icons.ts +29 -0
  129. package/templates/electron/scripts/run-forge.cjs +28 -0
  130. package/templates/electron/scripts/write-branding.ts +18 -0
  131. package/templates/electron/src/config.ts +16 -0
  132. package/templates/electron/src/lib/auth-client.ts +64 -0
  133. package/templates/electron/src/main.ts +670 -0
  134. package/templates/electron/src/preload.d.ts +27 -0
  135. package/templates/electron/src/preload.ts +25 -0
  136. package/templates/electron/tsconfig.json +18 -0
@@ -0,0 +1,1480 @@
1
+ {
2
+ "id": "557ad212-e874-4463-a45b-17438f28fadb",
3
+ "prevId": "4eb32625-a73e-4940-a4c0-040cfce7d4a1",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "account_id": {
18
+ "name": "account_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "provider_id": {
24
+ "name": "provider_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "user_id": {
30
+ "name": "user_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "id_token": {
48
+ "name": "id_token",
49
+ "type": "text",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "access_token_expires_at": {
54
+ "name": "access_token_expires_at",
55
+ "type": "timestamp",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "refresh_token_expires_at": {
60
+ "name": "refresh_token_expires_at",
61
+ "type": "timestamp",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "scope": {
66
+ "name": "scope",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true
89
+ }
90
+ },
91
+ "indexes": {},
92
+ "foreignKeys": {
93
+ "account_user_id_user_id_fk": {
94
+ "name": "account_user_id_user_id_fk",
95
+ "tableFrom": "account",
96
+ "tableTo": "user",
97
+ "columnsFrom": ["user_id"],
98
+ "columnsTo": ["id"],
99
+ "onDelete": "cascade",
100
+ "onUpdate": "no action"
101
+ }
102
+ },
103
+ "compositePrimaryKeys": {},
104
+ "uniqueConstraints": {},
105
+ "policies": {},
106
+ "checkConstraints": {},
107
+ "isRLSEnabled": false
108
+ },
109
+ "public.Chat": {
110
+ "name": "Chat",
111
+ "schema": "",
112
+ "columns": {
113
+ "id": {
114
+ "name": "id",
115
+ "type": "uuid",
116
+ "primaryKey": true,
117
+ "notNull": true,
118
+ "default": "gen_random_uuid()"
119
+ },
120
+ "createdAt": {
121
+ "name": "createdAt",
122
+ "type": "timestamp",
123
+ "primaryKey": false,
124
+ "notNull": true
125
+ },
126
+ "updatedAt": {
127
+ "name": "updatedAt",
128
+ "type": "timestamp",
129
+ "primaryKey": false,
130
+ "notNull": true,
131
+ "default": "now()"
132
+ },
133
+ "title": {
134
+ "name": "title",
135
+ "type": "text",
136
+ "primaryKey": false,
137
+ "notNull": true
138
+ },
139
+ "userId": {
140
+ "name": "userId",
141
+ "type": "text",
142
+ "primaryKey": false,
143
+ "notNull": true
144
+ },
145
+ "visibility": {
146
+ "name": "visibility",
147
+ "type": "varchar",
148
+ "primaryKey": false,
149
+ "notNull": true,
150
+ "default": "'private'"
151
+ },
152
+ "isPinned": {
153
+ "name": "isPinned",
154
+ "type": "boolean",
155
+ "primaryKey": false,
156
+ "notNull": true,
157
+ "default": false
158
+ },
159
+ "projectId": {
160
+ "name": "projectId",
161
+ "type": "uuid",
162
+ "primaryKey": false,
163
+ "notNull": false
164
+ }
165
+ },
166
+ "indexes": {},
167
+ "foreignKeys": {
168
+ "Chat_userId_user_id_fk": {
169
+ "name": "Chat_userId_user_id_fk",
170
+ "tableFrom": "Chat",
171
+ "tableTo": "user",
172
+ "columnsFrom": ["userId"],
173
+ "columnsTo": ["id"],
174
+ "onDelete": "no action",
175
+ "onUpdate": "no action"
176
+ },
177
+ "Chat_projectId_Project_id_fk": {
178
+ "name": "Chat_projectId_Project_id_fk",
179
+ "tableFrom": "Chat",
180
+ "tableTo": "Project",
181
+ "columnsFrom": ["projectId"],
182
+ "columnsTo": ["id"],
183
+ "onDelete": "set null",
184
+ "onUpdate": "no action"
185
+ }
186
+ },
187
+ "compositePrimaryKeys": {},
188
+ "uniqueConstraints": {},
189
+ "policies": {},
190
+ "checkConstraints": {},
191
+ "isRLSEnabled": false
192
+ },
193
+ "public.Document": {
194
+ "name": "Document",
195
+ "schema": "",
196
+ "columns": {
197
+ "id": {
198
+ "name": "id",
199
+ "type": "uuid",
200
+ "primaryKey": false,
201
+ "notNull": true,
202
+ "default": "gen_random_uuid()"
203
+ },
204
+ "createdAt": {
205
+ "name": "createdAt",
206
+ "type": "timestamp",
207
+ "primaryKey": false,
208
+ "notNull": true
209
+ },
210
+ "title": {
211
+ "name": "title",
212
+ "type": "text",
213
+ "primaryKey": false,
214
+ "notNull": true
215
+ },
216
+ "content": {
217
+ "name": "content",
218
+ "type": "text",
219
+ "primaryKey": false,
220
+ "notNull": false
221
+ },
222
+ "kind": {
223
+ "name": "kind",
224
+ "type": "varchar",
225
+ "primaryKey": false,
226
+ "notNull": true,
227
+ "default": "'text'"
228
+ },
229
+ "userId": {
230
+ "name": "userId",
231
+ "type": "text",
232
+ "primaryKey": false,
233
+ "notNull": true
234
+ },
235
+ "messageId": {
236
+ "name": "messageId",
237
+ "type": "uuid",
238
+ "primaryKey": false,
239
+ "notNull": true
240
+ }
241
+ },
242
+ "indexes": {
243
+ "Document_message_id_idx": {
244
+ "name": "Document_message_id_idx",
245
+ "columns": [
246
+ {
247
+ "expression": "messageId",
248
+ "isExpression": false,
249
+ "asc": true,
250
+ "nulls": "last"
251
+ }
252
+ ],
253
+ "isUnique": false,
254
+ "concurrently": false,
255
+ "method": "btree",
256
+ "with": {}
257
+ }
258
+ },
259
+ "foreignKeys": {
260
+ "Document_userId_user_id_fk": {
261
+ "name": "Document_userId_user_id_fk",
262
+ "tableFrom": "Document",
263
+ "tableTo": "user",
264
+ "columnsFrom": ["userId"],
265
+ "columnsTo": ["id"],
266
+ "onDelete": "no action",
267
+ "onUpdate": "no action"
268
+ },
269
+ "Document_messageId_Message_id_fk": {
270
+ "name": "Document_messageId_Message_id_fk",
271
+ "tableFrom": "Document",
272
+ "tableTo": "Message",
273
+ "columnsFrom": ["messageId"],
274
+ "columnsTo": ["id"],
275
+ "onDelete": "cascade",
276
+ "onUpdate": "no action"
277
+ }
278
+ },
279
+ "compositePrimaryKeys": {
280
+ "Document_id_createdAt_pk": {
281
+ "name": "Document_id_createdAt_pk",
282
+ "columns": ["id", "createdAt"]
283
+ }
284
+ },
285
+ "uniqueConstraints": {},
286
+ "policies": {},
287
+ "checkConstraints": {},
288
+ "isRLSEnabled": false
289
+ },
290
+ "public.McpConnector": {
291
+ "name": "McpConnector",
292
+ "schema": "",
293
+ "columns": {
294
+ "id": {
295
+ "name": "id",
296
+ "type": "uuid",
297
+ "primaryKey": true,
298
+ "notNull": true,
299
+ "default": "gen_random_uuid()"
300
+ },
301
+ "userId": {
302
+ "name": "userId",
303
+ "type": "text",
304
+ "primaryKey": false,
305
+ "notNull": false
306
+ },
307
+ "name": {
308
+ "name": "name",
309
+ "type": "varchar(256)",
310
+ "primaryKey": false,
311
+ "notNull": true
312
+ },
313
+ "nameId": {
314
+ "name": "nameId",
315
+ "type": "varchar(256)",
316
+ "primaryKey": false,
317
+ "notNull": true
318
+ },
319
+ "url": {
320
+ "name": "url",
321
+ "type": "text",
322
+ "primaryKey": false,
323
+ "notNull": true
324
+ },
325
+ "type": {
326
+ "name": "type",
327
+ "type": "varchar",
328
+ "primaryKey": false,
329
+ "notNull": true,
330
+ "default": "'http'"
331
+ },
332
+ "oauthClientId": {
333
+ "name": "oauthClientId",
334
+ "type": "text",
335
+ "primaryKey": false,
336
+ "notNull": false
337
+ },
338
+ "oauthClientSecret": {
339
+ "name": "oauthClientSecret",
340
+ "type": "text",
341
+ "primaryKey": false,
342
+ "notNull": false
343
+ },
344
+ "enabled": {
345
+ "name": "enabled",
346
+ "type": "boolean",
347
+ "primaryKey": false,
348
+ "notNull": true,
349
+ "default": true
350
+ },
351
+ "createdAt": {
352
+ "name": "createdAt",
353
+ "type": "timestamp",
354
+ "primaryKey": false,
355
+ "notNull": true,
356
+ "default": "now()"
357
+ },
358
+ "updatedAt": {
359
+ "name": "updatedAt",
360
+ "type": "timestamp",
361
+ "primaryKey": false,
362
+ "notNull": true,
363
+ "default": "now()"
364
+ }
365
+ },
366
+ "indexes": {
367
+ "McpConnector_user_id_idx": {
368
+ "name": "McpConnector_user_id_idx",
369
+ "columns": [
370
+ {
371
+ "expression": "userId",
372
+ "isExpression": false,
373
+ "asc": true,
374
+ "nulls": "last"
375
+ }
376
+ ],
377
+ "isUnique": false,
378
+ "concurrently": false,
379
+ "method": "btree",
380
+ "with": {}
381
+ },
382
+ "McpConnector_user_name_id_idx": {
383
+ "name": "McpConnector_user_name_id_idx",
384
+ "columns": [
385
+ {
386
+ "expression": "userId",
387
+ "isExpression": false,
388
+ "asc": true,
389
+ "nulls": "last"
390
+ },
391
+ {
392
+ "expression": "nameId",
393
+ "isExpression": false,
394
+ "asc": true,
395
+ "nulls": "last"
396
+ }
397
+ ],
398
+ "isUnique": false,
399
+ "concurrently": false,
400
+ "method": "btree",
401
+ "with": {}
402
+ },
403
+ "McpConnector_user_name_id_unique": {
404
+ "name": "McpConnector_user_name_id_unique",
405
+ "columns": [
406
+ {
407
+ "expression": "userId",
408
+ "isExpression": false,
409
+ "asc": true,
410
+ "nulls": "last"
411
+ },
412
+ {
413
+ "expression": "nameId",
414
+ "isExpression": false,
415
+ "asc": true,
416
+ "nulls": "last"
417
+ }
418
+ ],
419
+ "isUnique": true,
420
+ "concurrently": false,
421
+ "method": "btree",
422
+ "with": {}
423
+ }
424
+ },
425
+ "foreignKeys": {
426
+ "McpConnector_userId_user_id_fk": {
427
+ "name": "McpConnector_userId_user_id_fk",
428
+ "tableFrom": "McpConnector",
429
+ "tableTo": "user",
430
+ "columnsFrom": ["userId"],
431
+ "columnsTo": ["id"],
432
+ "onDelete": "cascade",
433
+ "onUpdate": "no action"
434
+ }
435
+ },
436
+ "compositePrimaryKeys": {},
437
+ "uniqueConstraints": {},
438
+ "policies": {},
439
+ "checkConstraints": {},
440
+ "isRLSEnabled": false
441
+ },
442
+ "public.McpOAuthSession": {
443
+ "name": "McpOAuthSession",
444
+ "schema": "",
445
+ "columns": {
446
+ "id": {
447
+ "name": "id",
448
+ "type": "uuid",
449
+ "primaryKey": true,
450
+ "notNull": true,
451
+ "default": "gen_random_uuid()"
452
+ },
453
+ "mcpConnectorId": {
454
+ "name": "mcpConnectorId",
455
+ "type": "uuid",
456
+ "primaryKey": false,
457
+ "notNull": true
458
+ },
459
+ "serverUrl": {
460
+ "name": "serverUrl",
461
+ "type": "text",
462
+ "primaryKey": false,
463
+ "notNull": true
464
+ },
465
+ "clientInfo": {
466
+ "name": "clientInfo",
467
+ "type": "text",
468
+ "primaryKey": false,
469
+ "notNull": false
470
+ },
471
+ "tokens": {
472
+ "name": "tokens",
473
+ "type": "text",
474
+ "primaryKey": false,
475
+ "notNull": false
476
+ },
477
+ "codeVerifier": {
478
+ "name": "codeVerifier",
479
+ "type": "text",
480
+ "primaryKey": false,
481
+ "notNull": false
482
+ },
483
+ "state": {
484
+ "name": "state",
485
+ "type": "text",
486
+ "primaryKey": false,
487
+ "notNull": false
488
+ },
489
+ "createdAt": {
490
+ "name": "createdAt",
491
+ "type": "timestamp",
492
+ "primaryKey": false,
493
+ "notNull": true,
494
+ "default": "now()"
495
+ },
496
+ "updatedAt": {
497
+ "name": "updatedAt",
498
+ "type": "timestamp",
499
+ "primaryKey": false,
500
+ "notNull": true,
501
+ "default": "now()"
502
+ }
503
+ },
504
+ "indexes": {
505
+ "McpOAuthSession_connector_idx": {
506
+ "name": "McpOAuthSession_connector_idx",
507
+ "columns": [
508
+ {
509
+ "expression": "mcpConnectorId",
510
+ "isExpression": false,
511
+ "asc": true,
512
+ "nulls": "last"
513
+ }
514
+ ],
515
+ "isUnique": false,
516
+ "concurrently": false,
517
+ "method": "btree",
518
+ "with": {}
519
+ },
520
+ "McpOAuthSession_state_idx": {
521
+ "name": "McpOAuthSession_state_idx",
522
+ "columns": [
523
+ {
524
+ "expression": "state",
525
+ "isExpression": false,
526
+ "asc": true,
527
+ "nulls": "last"
528
+ }
529
+ ],
530
+ "isUnique": false,
531
+ "concurrently": false,
532
+ "method": "btree",
533
+ "with": {}
534
+ }
535
+ },
536
+ "foreignKeys": {
537
+ "McpOAuthSession_mcpConnectorId_McpConnector_id_fk": {
538
+ "name": "McpOAuthSession_mcpConnectorId_McpConnector_id_fk",
539
+ "tableFrom": "McpOAuthSession",
540
+ "tableTo": "McpConnector",
541
+ "columnsFrom": ["mcpConnectorId"],
542
+ "columnsTo": ["id"],
543
+ "onDelete": "cascade",
544
+ "onUpdate": "no action"
545
+ }
546
+ },
547
+ "compositePrimaryKeys": {},
548
+ "uniqueConstraints": {
549
+ "McpOAuthSession_state_unique": {
550
+ "name": "McpOAuthSession_state_unique",
551
+ "nullsNotDistinct": false,
552
+ "columns": ["state"]
553
+ }
554
+ },
555
+ "policies": {},
556
+ "checkConstraints": {},
557
+ "isRLSEnabled": false
558
+ },
559
+ "public.Message": {
560
+ "name": "Message",
561
+ "schema": "",
562
+ "columns": {
563
+ "id": {
564
+ "name": "id",
565
+ "type": "uuid",
566
+ "primaryKey": true,
567
+ "notNull": true,
568
+ "default": "gen_random_uuid()"
569
+ },
570
+ "chatId": {
571
+ "name": "chatId",
572
+ "type": "uuid",
573
+ "primaryKey": false,
574
+ "notNull": true
575
+ },
576
+ "parentMessageId": {
577
+ "name": "parentMessageId",
578
+ "type": "uuid",
579
+ "primaryKey": false,
580
+ "notNull": false
581
+ },
582
+ "role": {
583
+ "name": "role",
584
+ "type": "varchar",
585
+ "primaryKey": false,
586
+ "notNull": true
587
+ },
588
+ "attachments": {
589
+ "name": "attachments",
590
+ "type": "json",
591
+ "primaryKey": false,
592
+ "notNull": true
593
+ },
594
+ "createdAt": {
595
+ "name": "createdAt",
596
+ "type": "timestamp",
597
+ "primaryKey": false,
598
+ "notNull": true
599
+ },
600
+ "annotations": {
601
+ "name": "annotations",
602
+ "type": "json",
603
+ "primaryKey": false,
604
+ "notNull": false
605
+ },
606
+ "selectedModel": {
607
+ "name": "selectedModel",
608
+ "type": "json",
609
+ "primaryKey": false,
610
+ "notNull": false
611
+ },
612
+ "selectedTool": {
613
+ "name": "selectedTool",
614
+ "type": "varchar(256)",
615
+ "primaryKey": false,
616
+ "notNull": false,
617
+ "default": "''"
618
+ },
619
+ "parallelGroupId": {
620
+ "name": "parallelGroupId",
621
+ "type": "uuid",
622
+ "primaryKey": false,
623
+ "notNull": false
624
+ },
625
+ "parallelIndex": {
626
+ "name": "parallelIndex",
627
+ "type": "integer",
628
+ "primaryKey": false,
629
+ "notNull": false
630
+ },
631
+ "isPrimaryParallel": {
632
+ "name": "isPrimaryParallel",
633
+ "type": "boolean",
634
+ "primaryKey": false,
635
+ "notNull": false
636
+ },
637
+ "lastContext": {
638
+ "name": "lastContext",
639
+ "type": "json",
640
+ "primaryKey": false,
641
+ "notNull": false
642
+ },
643
+ "activeStreamId": {
644
+ "name": "activeStreamId",
645
+ "type": "varchar(64)",
646
+ "primaryKey": false,
647
+ "notNull": false
648
+ },
649
+ "canceledAt": {
650
+ "name": "canceledAt",
651
+ "type": "timestamp",
652
+ "primaryKey": false,
653
+ "notNull": false
654
+ }
655
+ },
656
+ "indexes": {},
657
+ "foreignKeys": {
658
+ "Message_chatId_Chat_id_fk": {
659
+ "name": "Message_chatId_Chat_id_fk",
660
+ "tableFrom": "Message",
661
+ "tableTo": "Chat",
662
+ "columnsFrom": ["chatId"],
663
+ "columnsTo": ["id"],
664
+ "onDelete": "cascade",
665
+ "onUpdate": "no action"
666
+ }
667
+ },
668
+ "compositePrimaryKeys": {},
669
+ "uniqueConstraints": {},
670
+ "policies": {},
671
+ "checkConstraints": {},
672
+ "isRLSEnabled": false
673
+ },
674
+ "public.Part": {
675
+ "name": "Part",
676
+ "schema": "",
677
+ "columns": {
678
+ "id": {
679
+ "name": "id",
680
+ "type": "uuid",
681
+ "primaryKey": true,
682
+ "notNull": true,
683
+ "default": "gen_random_uuid()"
684
+ },
685
+ "messageId": {
686
+ "name": "messageId",
687
+ "type": "uuid",
688
+ "primaryKey": false,
689
+ "notNull": true
690
+ },
691
+ "createdAt": {
692
+ "name": "createdAt",
693
+ "type": "timestamp",
694
+ "primaryKey": false,
695
+ "notNull": true,
696
+ "default": "now()"
697
+ },
698
+ "order": {
699
+ "name": "order",
700
+ "type": "integer",
701
+ "primaryKey": false,
702
+ "notNull": true,
703
+ "default": 0
704
+ },
705
+ "type": {
706
+ "name": "type",
707
+ "type": "varchar",
708
+ "primaryKey": false,
709
+ "notNull": true
710
+ },
711
+ "text_text": {
712
+ "name": "text_text",
713
+ "type": "text",
714
+ "primaryKey": false,
715
+ "notNull": false
716
+ },
717
+ "reasoning_text": {
718
+ "name": "reasoning_text",
719
+ "type": "text",
720
+ "primaryKey": false,
721
+ "notNull": false
722
+ },
723
+ "file_mediaType": {
724
+ "name": "file_mediaType",
725
+ "type": "varchar",
726
+ "primaryKey": false,
727
+ "notNull": false
728
+ },
729
+ "file_filename": {
730
+ "name": "file_filename",
731
+ "type": "varchar",
732
+ "primaryKey": false,
733
+ "notNull": false
734
+ },
735
+ "file_url": {
736
+ "name": "file_url",
737
+ "type": "varchar",
738
+ "primaryKey": false,
739
+ "notNull": false
740
+ },
741
+ "source_url_sourceId": {
742
+ "name": "source_url_sourceId",
743
+ "type": "varchar",
744
+ "primaryKey": false,
745
+ "notNull": false
746
+ },
747
+ "source_url_url": {
748
+ "name": "source_url_url",
749
+ "type": "varchar",
750
+ "primaryKey": false,
751
+ "notNull": false
752
+ },
753
+ "source_url_title": {
754
+ "name": "source_url_title",
755
+ "type": "varchar",
756
+ "primaryKey": false,
757
+ "notNull": false
758
+ },
759
+ "source_document_sourceId": {
760
+ "name": "source_document_sourceId",
761
+ "type": "varchar",
762
+ "primaryKey": false,
763
+ "notNull": false
764
+ },
765
+ "source_document_mediaType": {
766
+ "name": "source_document_mediaType",
767
+ "type": "varchar",
768
+ "primaryKey": false,
769
+ "notNull": false
770
+ },
771
+ "source_document_title": {
772
+ "name": "source_document_title",
773
+ "type": "varchar",
774
+ "primaryKey": false,
775
+ "notNull": false
776
+ },
777
+ "source_document_filename": {
778
+ "name": "source_document_filename",
779
+ "type": "varchar",
780
+ "primaryKey": false,
781
+ "notNull": false
782
+ },
783
+ "tool_name": {
784
+ "name": "tool_name",
785
+ "type": "varchar",
786
+ "primaryKey": false,
787
+ "notNull": false
788
+ },
789
+ "tool_toolCallId": {
790
+ "name": "tool_toolCallId",
791
+ "type": "varchar",
792
+ "primaryKey": false,
793
+ "notNull": false
794
+ },
795
+ "tool_state": {
796
+ "name": "tool_state",
797
+ "type": "varchar",
798
+ "primaryKey": false,
799
+ "notNull": false
800
+ },
801
+ "tool_input": {
802
+ "name": "tool_input",
803
+ "type": "json",
804
+ "primaryKey": false,
805
+ "notNull": false
806
+ },
807
+ "tool_output": {
808
+ "name": "tool_output",
809
+ "type": "json",
810
+ "primaryKey": false,
811
+ "notNull": false
812
+ },
813
+ "tool_errorText": {
814
+ "name": "tool_errorText",
815
+ "type": "varchar",
816
+ "primaryKey": false,
817
+ "notNull": false
818
+ },
819
+ "data_type": {
820
+ "name": "data_type",
821
+ "type": "varchar",
822
+ "primaryKey": false,
823
+ "notNull": false
824
+ },
825
+ "data_blob": {
826
+ "name": "data_blob",
827
+ "type": "json",
828
+ "primaryKey": false,
829
+ "notNull": false
830
+ },
831
+ "providerMetadata": {
832
+ "name": "providerMetadata",
833
+ "type": "json",
834
+ "primaryKey": false,
835
+ "notNull": false
836
+ }
837
+ },
838
+ "indexes": {
839
+ "Part_message_id_idx": {
840
+ "name": "Part_message_id_idx",
841
+ "columns": [
842
+ {
843
+ "expression": "messageId",
844
+ "isExpression": false,
845
+ "asc": true,
846
+ "nulls": "last"
847
+ }
848
+ ],
849
+ "isUnique": false,
850
+ "concurrently": false,
851
+ "method": "btree",
852
+ "with": {}
853
+ },
854
+ "Part_message_id_order_idx": {
855
+ "name": "Part_message_id_order_idx",
856
+ "columns": [
857
+ {
858
+ "expression": "messageId",
859
+ "isExpression": false,
860
+ "asc": true,
861
+ "nulls": "last"
862
+ },
863
+ {
864
+ "expression": "order",
865
+ "isExpression": false,
866
+ "asc": true,
867
+ "nulls": "last"
868
+ }
869
+ ],
870
+ "isUnique": false,
871
+ "concurrently": false,
872
+ "method": "btree",
873
+ "with": {}
874
+ }
875
+ },
876
+ "foreignKeys": {
877
+ "Part_messageId_Message_id_fk": {
878
+ "name": "Part_messageId_Message_id_fk",
879
+ "tableFrom": "Part",
880
+ "tableTo": "Message",
881
+ "columnsFrom": ["messageId"],
882
+ "columnsTo": ["id"],
883
+ "onDelete": "cascade",
884
+ "onUpdate": "no action"
885
+ }
886
+ },
887
+ "compositePrimaryKeys": {},
888
+ "uniqueConstraints": {},
889
+ "policies": {},
890
+ "checkConstraints": {
891
+ "Part_text_required_if_type_text": {
892
+ "name": "Part_text_required_if_type_text",
893
+ "value": "CASE WHEN \"Part\".\"type\" = 'text' THEN \"Part\".\"text_text\" IS NOT NULL ELSE TRUE END"
894
+ },
895
+ "Part_reasoning_required_if_type_reasoning": {
896
+ "name": "Part_reasoning_required_if_type_reasoning",
897
+ "value": "CASE WHEN \"Part\".\"type\" = 'reasoning' THEN \"Part\".\"reasoning_text\" IS NOT NULL ELSE TRUE END"
898
+ },
899
+ "Part_file_required_if_type_file": {
900
+ "name": "Part_file_required_if_type_file",
901
+ "value": "CASE WHEN \"Part\".\"type\" = 'file' THEN \"Part\".\"file_mediaType\" IS NOT NULL AND \"Part\".\"file_url\" IS NOT NULL ELSE TRUE END"
902
+ },
903
+ "Part_source_url_required_if_type_source_url": {
904
+ "name": "Part_source_url_required_if_type_source_url",
905
+ "value": "CASE WHEN \"Part\".\"type\" = 'source-url' THEN \"Part\".\"source_url_sourceId\" IS NOT NULL AND \"Part\".\"source_url_url\" IS NOT NULL ELSE TRUE END"
906
+ },
907
+ "Part_source_document_required_if_type_source_document": {
908
+ "name": "Part_source_document_required_if_type_source_document",
909
+ "value": "CASE WHEN \"Part\".\"type\" = 'source-document' THEN \"Part\".\"source_document_sourceId\" IS NOT NULL AND \"Part\".\"source_document_mediaType\" IS NOT NULL AND \"Part\".\"source_document_title\" IS NOT NULL ELSE TRUE END"
910
+ },
911
+ "Part_tool_required_if_type_tool": {
912
+ "name": "Part_tool_required_if_type_tool",
913
+ "value": "CASE WHEN \"Part\".\"type\" LIKE 'tool-%' THEN \"Part\".\"tool_toolCallId\" IS NOT NULL AND \"Part\".\"tool_state\" IS NOT NULL ELSE TRUE END"
914
+ },
915
+ "Part_data_required_if_type_data": {
916
+ "name": "Part_data_required_if_type_data",
917
+ "value": "CASE WHEN \"Part\".\"type\" LIKE 'data-%' THEN \"Part\".\"data_type\" IS NOT NULL ELSE TRUE END"
918
+ }
919
+ },
920
+ "isRLSEnabled": false
921
+ },
922
+ "public.Project": {
923
+ "name": "Project",
924
+ "schema": "",
925
+ "columns": {
926
+ "id": {
927
+ "name": "id",
928
+ "type": "uuid",
929
+ "primaryKey": true,
930
+ "notNull": true,
931
+ "default": "gen_random_uuid()"
932
+ },
933
+ "createdAt": {
934
+ "name": "createdAt",
935
+ "type": "timestamp",
936
+ "primaryKey": false,
937
+ "notNull": true,
938
+ "default": "now()"
939
+ },
940
+ "updatedAt": {
941
+ "name": "updatedAt",
942
+ "type": "timestamp",
943
+ "primaryKey": false,
944
+ "notNull": true,
945
+ "default": "now()"
946
+ },
947
+ "userId": {
948
+ "name": "userId",
949
+ "type": "text",
950
+ "primaryKey": false,
951
+ "notNull": true
952
+ },
953
+ "name": {
954
+ "name": "name",
955
+ "type": "text",
956
+ "primaryKey": false,
957
+ "notNull": true
958
+ },
959
+ "instructions": {
960
+ "name": "instructions",
961
+ "type": "text",
962
+ "primaryKey": false,
963
+ "notNull": true,
964
+ "default": "''"
965
+ },
966
+ "icon": {
967
+ "name": "icon",
968
+ "type": "varchar(64)",
969
+ "primaryKey": false,
970
+ "notNull": true,
971
+ "default": "'folder'"
972
+ },
973
+ "iconColor": {
974
+ "name": "iconColor",
975
+ "type": "varchar(32)",
976
+ "primaryKey": false,
977
+ "notNull": true,
978
+ "default": "'gray'"
979
+ }
980
+ },
981
+ "indexes": {
982
+ "Project_user_id_idx": {
983
+ "name": "Project_user_id_idx",
984
+ "columns": [
985
+ {
986
+ "expression": "userId",
987
+ "isExpression": false,
988
+ "asc": true,
989
+ "nulls": "last"
990
+ }
991
+ ],
992
+ "isUnique": false,
993
+ "concurrently": false,
994
+ "method": "btree",
995
+ "with": {}
996
+ }
997
+ },
998
+ "foreignKeys": {
999
+ "Project_userId_user_id_fk": {
1000
+ "name": "Project_userId_user_id_fk",
1001
+ "tableFrom": "Project",
1002
+ "tableTo": "user",
1003
+ "columnsFrom": ["userId"],
1004
+ "columnsTo": ["id"],
1005
+ "onDelete": "cascade",
1006
+ "onUpdate": "no action"
1007
+ }
1008
+ },
1009
+ "compositePrimaryKeys": {},
1010
+ "uniqueConstraints": {},
1011
+ "policies": {},
1012
+ "checkConstraints": {},
1013
+ "isRLSEnabled": false
1014
+ },
1015
+ "public.session": {
1016
+ "name": "session",
1017
+ "schema": "",
1018
+ "columns": {
1019
+ "id": {
1020
+ "name": "id",
1021
+ "type": "text",
1022
+ "primaryKey": true,
1023
+ "notNull": true
1024
+ },
1025
+ "expires_at": {
1026
+ "name": "expires_at",
1027
+ "type": "timestamp",
1028
+ "primaryKey": false,
1029
+ "notNull": true
1030
+ },
1031
+ "token": {
1032
+ "name": "token",
1033
+ "type": "text",
1034
+ "primaryKey": false,
1035
+ "notNull": true
1036
+ },
1037
+ "created_at": {
1038
+ "name": "created_at",
1039
+ "type": "timestamp",
1040
+ "primaryKey": false,
1041
+ "notNull": true,
1042
+ "default": "now()"
1043
+ },
1044
+ "updated_at": {
1045
+ "name": "updated_at",
1046
+ "type": "timestamp",
1047
+ "primaryKey": false,
1048
+ "notNull": true
1049
+ },
1050
+ "ip_address": {
1051
+ "name": "ip_address",
1052
+ "type": "text",
1053
+ "primaryKey": false,
1054
+ "notNull": false
1055
+ },
1056
+ "user_agent": {
1057
+ "name": "user_agent",
1058
+ "type": "text",
1059
+ "primaryKey": false,
1060
+ "notNull": false
1061
+ },
1062
+ "user_id": {
1063
+ "name": "user_id",
1064
+ "type": "text",
1065
+ "primaryKey": false,
1066
+ "notNull": true
1067
+ }
1068
+ },
1069
+ "indexes": {},
1070
+ "foreignKeys": {
1071
+ "session_user_id_user_id_fk": {
1072
+ "name": "session_user_id_user_id_fk",
1073
+ "tableFrom": "session",
1074
+ "tableTo": "user",
1075
+ "columnsFrom": ["user_id"],
1076
+ "columnsTo": ["id"],
1077
+ "onDelete": "cascade",
1078
+ "onUpdate": "no action"
1079
+ }
1080
+ },
1081
+ "compositePrimaryKeys": {},
1082
+ "uniqueConstraints": {
1083
+ "session_token_unique": {
1084
+ "name": "session_token_unique",
1085
+ "nullsNotDistinct": false,
1086
+ "columns": ["token"]
1087
+ }
1088
+ },
1089
+ "policies": {},
1090
+ "checkConstraints": {},
1091
+ "isRLSEnabled": false
1092
+ },
1093
+ "public.Suggestion": {
1094
+ "name": "Suggestion",
1095
+ "schema": "",
1096
+ "columns": {
1097
+ "id": {
1098
+ "name": "id",
1099
+ "type": "uuid",
1100
+ "primaryKey": false,
1101
+ "notNull": true,
1102
+ "default": "gen_random_uuid()"
1103
+ },
1104
+ "documentId": {
1105
+ "name": "documentId",
1106
+ "type": "uuid",
1107
+ "primaryKey": false,
1108
+ "notNull": true
1109
+ },
1110
+ "documentCreatedAt": {
1111
+ "name": "documentCreatedAt",
1112
+ "type": "timestamp",
1113
+ "primaryKey": false,
1114
+ "notNull": true
1115
+ },
1116
+ "originalText": {
1117
+ "name": "originalText",
1118
+ "type": "text",
1119
+ "primaryKey": false,
1120
+ "notNull": true
1121
+ },
1122
+ "suggestedText": {
1123
+ "name": "suggestedText",
1124
+ "type": "text",
1125
+ "primaryKey": false,
1126
+ "notNull": true
1127
+ },
1128
+ "description": {
1129
+ "name": "description",
1130
+ "type": "text",
1131
+ "primaryKey": false,
1132
+ "notNull": false
1133
+ },
1134
+ "isResolved": {
1135
+ "name": "isResolved",
1136
+ "type": "boolean",
1137
+ "primaryKey": false,
1138
+ "notNull": true,
1139
+ "default": false
1140
+ },
1141
+ "userId": {
1142
+ "name": "userId",
1143
+ "type": "text",
1144
+ "primaryKey": false,
1145
+ "notNull": true
1146
+ },
1147
+ "createdAt": {
1148
+ "name": "createdAt",
1149
+ "type": "timestamp",
1150
+ "primaryKey": false,
1151
+ "notNull": true
1152
+ }
1153
+ },
1154
+ "indexes": {},
1155
+ "foreignKeys": {
1156
+ "Suggestion_userId_user_id_fk": {
1157
+ "name": "Suggestion_userId_user_id_fk",
1158
+ "tableFrom": "Suggestion",
1159
+ "tableTo": "user",
1160
+ "columnsFrom": ["userId"],
1161
+ "columnsTo": ["id"],
1162
+ "onDelete": "no action",
1163
+ "onUpdate": "no action"
1164
+ },
1165
+ "Suggestion_documentId_documentCreatedAt_Document_id_createdAt_fk": {
1166
+ "name": "Suggestion_documentId_documentCreatedAt_Document_id_createdAt_fk",
1167
+ "tableFrom": "Suggestion",
1168
+ "tableTo": "Document",
1169
+ "columnsFrom": ["documentId", "documentCreatedAt"],
1170
+ "columnsTo": ["id", "createdAt"],
1171
+ "onDelete": "no action",
1172
+ "onUpdate": "no action"
1173
+ }
1174
+ },
1175
+ "compositePrimaryKeys": {
1176
+ "Suggestion_id_pk": {
1177
+ "name": "Suggestion_id_pk",
1178
+ "columns": ["id"]
1179
+ }
1180
+ },
1181
+ "uniqueConstraints": {},
1182
+ "policies": {},
1183
+ "checkConstraints": {},
1184
+ "isRLSEnabled": false
1185
+ },
1186
+ "public.user": {
1187
+ "name": "user",
1188
+ "schema": "",
1189
+ "columns": {
1190
+ "id": {
1191
+ "name": "id",
1192
+ "type": "text",
1193
+ "primaryKey": true,
1194
+ "notNull": true
1195
+ },
1196
+ "name": {
1197
+ "name": "name",
1198
+ "type": "text",
1199
+ "primaryKey": false,
1200
+ "notNull": true
1201
+ },
1202
+ "email": {
1203
+ "name": "email",
1204
+ "type": "text",
1205
+ "primaryKey": false,
1206
+ "notNull": true
1207
+ },
1208
+ "email_verified": {
1209
+ "name": "email_verified",
1210
+ "type": "boolean",
1211
+ "primaryKey": false,
1212
+ "notNull": true,
1213
+ "default": false
1214
+ },
1215
+ "image": {
1216
+ "name": "image",
1217
+ "type": "text",
1218
+ "primaryKey": false,
1219
+ "notNull": false
1220
+ },
1221
+ "created_at": {
1222
+ "name": "created_at",
1223
+ "type": "timestamp",
1224
+ "primaryKey": false,
1225
+ "notNull": true,
1226
+ "default": "now()"
1227
+ },
1228
+ "updated_at": {
1229
+ "name": "updated_at",
1230
+ "type": "timestamp",
1231
+ "primaryKey": false,
1232
+ "notNull": true,
1233
+ "default": "now()"
1234
+ }
1235
+ },
1236
+ "indexes": {},
1237
+ "foreignKeys": {},
1238
+ "compositePrimaryKeys": {},
1239
+ "uniqueConstraints": {
1240
+ "user_email_unique": {
1241
+ "name": "user_email_unique",
1242
+ "nullsNotDistinct": false,
1243
+ "columns": ["email"]
1244
+ }
1245
+ },
1246
+ "policies": {},
1247
+ "checkConstraints": {},
1248
+ "isRLSEnabled": false
1249
+ },
1250
+ "public.UserCredit": {
1251
+ "name": "UserCredit",
1252
+ "schema": "",
1253
+ "columns": {
1254
+ "userId": {
1255
+ "name": "userId",
1256
+ "type": "text",
1257
+ "primaryKey": true,
1258
+ "notNull": true
1259
+ },
1260
+ "credits": {
1261
+ "name": "credits",
1262
+ "type": "integer",
1263
+ "primaryKey": false,
1264
+ "notNull": true,
1265
+ "default": 50
1266
+ }
1267
+ },
1268
+ "indexes": {},
1269
+ "foreignKeys": {
1270
+ "UserCredit_userId_user_id_fk": {
1271
+ "name": "UserCredit_userId_user_id_fk",
1272
+ "tableFrom": "UserCredit",
1273
+ "tableTo": "user",
1274
+ "columnsFrom": ["userId"],
1275
+ "columnsTo": ["id"],
1276
+ "onDelete": "cascade",
1277
+ "onUpdate": "no action"
1278
+ }
1279
+ },
1280
+ "compositePrimaryKeys": {},
1281
+ "uniqueConstraints": {},
1282
+ "policies": {},
1283
+ "checkConstraints": {},
1284
+ "isRLSEnabled": false
1285
+ },
1286
+ "public.UserModelPreference": {
1287
+ "name": "UserModelPreference",
1288
+ "schema": "",
1289
+ "columns": {
1290
+ "userId": {
1291
+ "name": "userId",
1292
+ "type": "text",
1293
+ "primaryKey": false,
1294
+ "notNull": true
1295
+ },
1296
+ "modelId": {
1297
+ "name": "modelId",
1298
+ "type": "varchar(256)",
1299
+ "primaryKey": false,
1300
+ "notNull": true
1301
+ },
1302
+ "enabled": {
1303
+ "name": "enabled",
1304
+ "type": "boolean",
1305
+ "primaryKey": false,
1306
+ "notNull": true
1307
+ },
1308
+ "createdAt": {
1309
+ "name": "createdAt",
1310
+ "type": "timestamp",
1311
+ "primaryKey": false,
1312
+ "notNull": true,
1313
+ "default": "now()"
1314
+ },
1315
+ "updatedAt": {
1316
+ "name": "updatedAt",
1317
+ "type": "timestamp",
1318
+ "primaryKey": false,
1319
+ "notNull": true,
1320
+ "default": "now()"
1321
+ }
1322
+ },
1323
+ "indexes": {
1324
+ "UserModelPreference_user_id_idx": {
1325
+ "name": "UserModelPreference_user_id_idx",
1326
+ "columns": [
1327
+ {
1328
+ "expression": "userId",
1329
+ "isExpression": false,
1330
+ "asc": true,
1331
+ "nulls": "last"
1332
+ }
1333
+ ],
1334
+ "isUnique": false,
1335
+ "concurrently": false,
1336
+ "method": "btree",
1337
+ "with": {}
1338
+ }
1339
+ },
1340
+ "foreignKeys": {
1341
+ "UserModelPreference_userId_user_id_fk": {
1342
+ "name": "UserModelPreference_userId_user_id_fk",
1343
+ "tableFrom": "UserModelPreference",
1344
+ "tableTo": "user",
1345
+ "columnsFrom": ["userId"],
1346
+ "columnsTo": ["id"],
1347
+ "onDelete": "cascade",
1348
+ "onUpdate": "no action"
1349
+ }
1350
+ },
1351
+ "compositePrimaryKeys": {
1352
+ "UserModelPreference_userId_modelId_pk": {
1353
+ "name": "UserModelPreference_userId_modelId_pk",
1354
+ "columns": ["userId", "modelId"]
1355
+ }
1356
+ },
1357
+ "uniqueConstraints": {},
1358
+ "policies": {},
1359
+ "checkConstraints": {},
1360
+ "isRLSEnabled": false
1361
+ },
1362
+ "public.verification": {
1363
+ "name": "verification",
1364
+ "schema": "",
1365
+ "columns": {
1366
+ "id": {
1367
+ "name": "id",
1368
+ "type": "text",
1369
+ "primaryKey": true,
1370
+ "notNull": true
1371
+ },
1372
+ "identifier": {
1373
+ "name": "identifier",
1374
+ "type": "text",
1375
+ "primaryKey": false,
1376
+ "notNull": true
1377
+ },
1378
+ "value": {
1379
+ "name": "value",
1380
+ "type": "text",
1381
+ "primaryKey": false,
1382
+ "notNull": true
1383
+ },
1384
+ "expires_at": {
1385
+ "name": "expires_at",
1386
+ "type": "timestamp",
1387
+ "primaryKey": false,
1388
+ "notNull": true
1389
+ },
1390
+ "created_at": {
1391
+ "name": "created_at",
1392
+ "type": "timestamp",
1393
+ "primaryKey": false,
1394
+ "notNull": true,
1395
+ "default": "now()"
1396
+ },
1397
+ "updated_at": {
1398
+ "name": "updated_at",
1399
+ "type": "timestamp",
1400
+ "primaryKey": false,
1401
+ "notNull": true,
1402
+ "default": "now()"
1403
+ }
1404
+ },
1405
+ "indexes": {},
1406
+ "foreignKeys": {},
1407
+ "compositePrimaryKeys": {},
1408
+ "uniqueConstraints": {},
1409
+ "policies": {},
1410
+ "checkConstraints": {},
1411
+ "isRLSEnabled": false
1412
+ },
1413
+ "public.Vote": {
1414
+ "name": "Vote",
1415
+ "schema": "",
1416
+ "columns": {
1417
+ "chatId": {
1418
+ "name": "chatId",
1419
+ "type": "uuid",
1420
+ "primaryKey": false,
1421
+ "notNull": true
1422
+ },
1423
+ "messageId": {
1424
+ "name": "messageId",
1425
+ "type": "uuid",
1426
+ "primaryKey": false,
1427
+ "notNull": true
1428
+ },
1429
+ "isUpvoted": {
1430
+ "name": "isUpvoted",
1431
+ "type": "boolean",
1432
+ "primaryKey": false,
1433
+ "notNull": true
1434
+ }
1435
+ },
1436
+ "indexes": {},
1437
+ "foreignKeys": {
1438
+ "Vote_chatId_Chat_id_fk": {
1439
+ "name": "Vote_chatId_Chat_id_fk",
1440
+ "tableFrom": "Vote",
1441
+ "tableTo": "Chat",
1442
+ "columnsFrom": ["chatId"],
1443
+ "columnsTo": ["id"],
1444
+ "onDelete": "cascade",
1445
+ "onUpdate": "no action"
1446
+ },
1447
+ "Vote_messageId_Message_id_fk": {
1448
+ "name": "Vote_messageId_Message_id_fk",
1449
+ "tableFrom": "Vote",
1450
+ "tableTo": "Message",
1451
+ "columnsFrom": ["messageId"],
1452
+ "columnsTo": ["id"],
1453
+ "onDelete": "cascade",
1454
+ "onUpdate": "no action"
1455
+ }
1456
+ },
1457
+ "compositePrimaryKeys": {
1458
+ "Vote_chatId_messageId_pk": {
1459
+ "name": "Vote_chatId_messageId_pk",
1460
+ "columns": ["chatId", "messageId"]
1461
+ }
1462
+ },
1463
+ "uniqueConstraints": {},
1464
+ "policies": {},
1465
+ "checkConstraints": {},
1466
+ "isRLSEnabled": false
1467
+ }
1468
+ },
1469
+ "enums": {},
1470
+ "schemas": {},
1471
+ "sequences": {},
1472
+ "roles": {},
1473
+ "policies": {},
1474
+ "views": {},
1475
+ "_meta": {
1476
+ "columns": {},
1477
+ "schemas": {},
1478
+ "tables": {}
1479
+ }
1480
+ }