opensentinel 2.1.1

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 (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +283 -0
  3. package/dist/bot-KJ26BG56.js +15 -0
  4. package/dist/bot-KJ26BG56.js.map +1 -0
  5. package/dist/charts-MMXM6BWW.js +241 -0
  6. package/dist/charts-MMXM6BWW.js.map +1 -0
  7. package/dist/chunk-4LVWXUNC.js +1079 -0
  8. package/dist/chunk-4LVWXUNC.js.map +1 -0
  9. package/dist/chunk-4TG2IG5K.js +5249 -0
  10. package/dist/chunk-4TG2IG5K.js.map +1 -0
  11. package/dist/chunk-6DRDKB45.js +251 -0
  12. package/dist/chunk-6DRDKB45.js.map +1 -0
  13. package/dist/chunk-6SNHU3CY.js +123 -0
  14. package/dist/chunk-6SNHU3CY.js.map +1 -0
  15. package/dist/chunk-CI6Q63MM.js +1613 -0
  16. package/dist/chunk-CI6Q63MM.js.map +1 -0
  17. package/dist/chunk-CQ4JURG7.js +57 -0
  18. package/dist/chunk-CQ4JURG7.js.map +1 -0
  19. package/dist/chunk-F6QUZQGI.js +51 -0
  20. package/dist/chunk-F6QUZQGI.js.map +1 -0
  21. package/dist/chunk-GK3E2I7A.js +216 -0
  22. package/dist/chunk-GK3E2I7A.js.map +1 -0
  23. package/dist/chunk-GUBEEYDW.js +211 -0
  24. package/dist/chunk-GUBEEYDW.js.map +1 -0
  25. package/dist/chunk-GVJVEWHI.js +29 -0
  26. package/dist/chunk-GVJVEWHI.js.map +1 -0
  27. package/dist/chunk-HH2HBTQM.js +806 -0
  28. package/dist/chunk-HH2HBTQM.js.map +1 -0
  29. package/dist/chunk-JXUP2X7V.js +129 -0
  30. package/dist/chunk-JXUP2X7V.js.map +1 -0
  31. package/dist/chunk-KHNYJY2Z.js +178 -0
  32. package/dist/chunk-KHNYJY2Z.js.map +1 -0
  33. package/dist/chunk-L3F43VPB.js +652 -0
  34. package/dist/chunk-L3F43VPB.js.map +1 -0
  35. package/dist/chunk-L3PDU3XN.js +803 -0
  36. package/dist/chunk-L3PDU3XN.js.map +1 -0
  37. package/dist/chunk-NSBPE2FW.js +17 -0
  38. package/dist/chunk-NSBPE2FW.js.map +1 -0
  39. package/dist/cli.d.ts +1 -0
  40. package/dist/cli.js +52 -0
  41. package/dist/cli.js.map +1 -0
  42. package/dist/commands/setup.d.ts +9 -0
  43. package/dist/commands/setup.js +374 -0
  44. package/dist/commands/setup.js.map +1 -0
  45. package/dist/commands/start.d.ts +8 -0
  46. package/dist/commands/start.js +27 -0
  47. package/dist/commands/start.js.map +1 -0
  48. package/dist/commands/status.d.ts +8 -0
  49. package/dist/commands/status.js +57 -0
  50. package/dist/commands/status.js.map +1 -0
  51. package/dist/commands/stop.d.ts +8 -0
  52. package/dist/commands/stop.js +37 -0
  53. package/dist/commands/stop.js.map +1 -0
  54. package/dist/commands/utils.d.ts +50 -0
  55. package/dist/commands/utils.js +36 -0
  56. package/dist/commands/utils.js.map +1 -0
  57. package/dist/discord-ZOJFTVTB.js +49 -0
  58. package/dist/discord-ZOJFTVTB.js.map +1 -0
  59. package/dist/imessage-JFRB6EJ7.js +14 -0
  60. package/dist/imessage-JFRB6EJ7.js.map +1 -0
  61. package/dist/lib.d.ts +855 -0
  62. package/dist/lib.js +274 -0
  63. package/dist/lib.js.map +1 -0
  64. package/dist/mcp-LS7Q3Z5W.js +30 -0
  65. package/dist/mcp-LS7Q3Z5W.js.map +1 -0
  66. package/dist/scheduler-EZ7CZMCS.js +42 -0
  67. package/dist/scheduler-EZ7CZMCS.js.map +1 -0
  68. package/dist/signal-T3MCSULM.js +14 -0
  69. package/dist/signal-T3MCSULM.js.map +1 -0
  70. package/dist/slack-N2M4FHAJ.js +54 -0
  71. package/dist/slack-N2M4FHAJ.js.map +1 -0
  72. package/dist/src-K7GASHRH.js +430 -0
  73. package/dist/src-K7GASHRH.js.map +1 -0
  74. package/dist/tools-24GZHYRF.js +16 -0
  75. package/dist/tools-24GZHYRF.js.map +1 -0
  76. package/dist/whatsapp-VCRUPAO5.js +14 -0
  77. package/dist/whatsapp-VCRUPAO5.js.map +1 -0
  78. package/drizzle/0000_chilly_shinobi_shaw.sql +75 -0
  79. package/drizzle/0001_freezing_shape.sql +274 -0
  80. package/drizzle/meta/0000_snapshot.json +529 -0
  81. package/drizzle/meta/0001_snapshot.json +2576 -0
  82. package/drizzle/meta/_journal.json +20 -0
  83. package/package.json +98 -0
@@ -0,0 +1,2576 @@
1
+ {
2
+ "id": "c8308974-5489-4fdd-97a8-d0f576326a7c",
3
+ "prevId": "ea8f1d9a-a216-483c-ba97-26a84023aff6",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.achievements": {
8
+ "name": "achievements",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "code": {
19
+ "name": "code",
20
+ "type": "text",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "name": {
25
+ "name": "name",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "description": {
31
+ "name": "description",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": false
35
+ },
36
+ "icon_emoji": {
37
+ "name": "icon_emoji",
38
+ "type": "text",
39
+ "primaryKey": false,
40
+ "notNull": false
41
+ },
42
+ "category": {
43
+ "name": "category",
44
+ "type": "text",
45
+ "primaryKey": false,
46
+ "notNull": false
47
+ },
48
+ "criteria": {
49
+ "name": "criteria",
50
+ "type": "jsonb",
51
+ "primaryKey": false,
52
+ "notNull": false
53
+ },
54
+ "points": {
55
+ "name": "points",
56
+ "type": "integer",
57
+ "primaryKey": false,
58
+ "notNull": false,
59
+ "default": 10
60
+ },
61
+ "created_at": {
62
+ "name": "created_at",
63
+ "type": "timestamp",
64
+ "primaryKey": false,
65
+ "notNull": true,
66
+ "default": "now()"
67
+ }
68
+ },
69
+ "indexes": {},
70
+ "foreignKeys": {},
71
+ "compositePrimaryKeys": {},
72
+ "uniqueConstraints": {
73
+ "achievements_code_unique": {
74
+ "name": "achievements_code_unique",
75
+ "nullsNotDistinct": false,
76
+ "columns": [
77
+ "code"
78
+ ]
79
+ }
80
+ },
81
+ "policies": {},
82
+ "checkConstraints": {},
83
+ "isRLSEnabled": false
84
+ },
85
+ "public.agent_messages": {
86
+ "name": "agent_messages",
87
+ "schema": "",
88
+ "columns": {
89
+ "id": {
90
+ "name": "id",
91
+ "type": "uuid",
92
+ "primaryKey": true,
93
+ "notNull": true,
94
+ "default": "gen_random_uuid()"
95
+ },
96
+ "agent_id": {
97
+ "name": "agent_id",
98
+ "type": "uuid",
99
+ "primaryKey": false,
100
+ "notNull": true
101
+ },
102
+ "role": {
103
+ "name": "role",
104
+ "type": "text",
105
+ "primaryKey": false,
106
+ "notNull": true
107
+ },
108
+ "content": {
109
+ "name": "content",
110
+ "type": "text",
111
+ "primaryKey": false,
112
+ "notNull": true
113
+ },
114
+ "metadata": {
115
+ "name": "metadata",
116
+ "type": "jsonb",
117
+ "primaryKey": false,
118
+ "notNull": false
119
+ },
120
+ "created_at": {
121
+ "name": "created_at",
122
+ "type": "timestamp",
123
+ "primaryKey": false,
124
+ "notNull": true,
125
+ "default": "now()"
126
+ }
127
+ },
128
+ "indexes": {
129
+ "agent_messages_agent_idx": {
130
+ "name": "agent_messages_agent_idx",
131
+ "columns": [
132
+ {
133
+ "expression": "agent_id",
134
+ "isExpression": false,
135
+ "asc": true,
136
+ "nulls": "last"
137
+ }
138
+ ],
139
+ "isUnique": false,
140
+ "concurrently": false,
141
+ "method": "btree",
142
+ "with": {}
143
+ }
144
+ },
145
+ "foreignKeys": {
146
+ "agent_messages_agent_id_sub_agents_id_fk": {
147
+ "name": "agent_messages_agent_id_sub_agents_id_fk",
148
+ "tableFrom": "agent_messages",
149
+ "tableTo": "sub_agents",
150
+ "columnsFrom": [
151
+ "agent_id"
152
+ ],
153
+ "columnsTo": [
154
+ "id"
155
+ ],
156
+ "onDelete": "no action",
157
+ "onUpdate": "no action"
158
+ }
159
+ },
160
+ "compositePrimaryKeys": {},
161
+ "uniqueConstraints": {},
162
+ "policies": {},
163
+ "checkConstraints": {},
164
+ "isRLSEnabled": false
165
+ },
166
+ "public.agent_progress": {
167
+ "name": "agent_progress",
168
+ "schema": "",
169
+ "columns": {
170
+ "id": {
171
+ "name": "id",
172
+ "type": "uuid",
173
+ "primaryKey": true,
174
+ "notNull": true,
175
+ "default": "gen_random_uuid()"
176
+ },
177
+ "agent_id": {
178
+ "name": "agent_id",
179
+ "type": "uuid",
180
+ "primaryKey": false,
181
+ "notNull": true
182
+ },
183
+ "step": {
184
+ "name": "step",
185
+ "type": "integer",
186
+ "primaryKey": false,
187
+ "notNull": true
188
+ },
189
+ "description": {
190
+ "name": "description",
191
+ "type": "text",
192
+ "primaryKey": false,
193
+ "notNull": true
194
+ },
195
+ "status": {
196
+ "name": "status",
197
+ "type": "text",
198
+ "primaryKey": false,
199
+ "notNull": true
200
+ },
201
+ "output": {
202
+ "name": "output",
203
+ "type": "jsonb",
204
+ "primaryKey": false,
205
+ "notNull": false
206
+ },
207
+ "created_at": {
208
+ "name": "created_at",
209
+ "type": "timestamp",
210
+ "primaryKey": false,
211
+ "notNull": true,
212
+ "default": "now()"
213
+ }
214
+ },
215
+ "indexes": {
216
+ "agent_progress_agent_idx": {
217
+ "name": "agent_progress_agent_idx",
218
+ "columns": [
219
+ {
220
+ "expression": "agent_id",
221
+ "isExpression": false,
222
+ "asc": true,
223
+ "nulls": "last"
224
+ }
225
+ ],
226
+ "isUnique": false,
227
+ "concurrently": false,
228
+ "method": "btree",
229
+ "with": {}
230
+ }
231
+ },
232
+ "foreignKeys": {
233
+ "agent_progress_agent_id_sub_agents_id_fk": {
234
+ "name": "agent_progress_agent_id_sub_agents_id_fk",
235
+ "tableFrom": "agent_progress",
236
+ "tableTo": "sub_agents",
237
+ "columnsFrom": [
238
+ "agent_id"
239
+ ],
240
+ "columnsTo": [
241
+ "id"
242
+ ],
243
+ "onDelete": "no action",
244
+ "onUpdate": "no action"
245
+ }
246
+ },
247
+ "compositePrimaryKeys": {},
248
+ "uniqueConstraints": {},
249
+ "policies": {},
250
+ "checkConstraints": {},
251
+ "isRLSEnabled": false
252
+ },
253
+ "public.api_keys": {
254
+ "name": "api_keys",
255
+ "schema": "",
256
+ "columns": {
257
+ "id": {
258
+ "name": "id",
259
+ "type": "uuid",
260
+ "primaryKey": true,
261
+ "notNull": true,
262
+ "default": "gen_random_uuid()"
263
+ },
264
+ "user_id": {
265
+ "name": "user_id",
266
+ "type": "uuid",
267
+ "primaryKey": false,
268
+ "notNull": true
269
+ },
270
+ "name": {
271
+ "name": "name",
272
+ "type": "text",
273
+ "primaryKey": false,
274
+ "notNull": true
275
+ },
276
+ "key_hash": {
277
+ "name": "key_hash",
278
+ "type": "text",
279
+ "primaryKey": false,
280
+ "notNull": true
281
+ },
282
+ "key_prefix": {
283
+ "name": "key_prefix",
284
+ "type": "text",
285
+ "primaryKey": false,
286
+ "notNull": true
287
+ },
288
+ "permissions": {
289
+ "name": "permissions",
290
+ "type": "jsonb",
291
+ "primaryKey": false,
292
+ "notNull": false
293
+ },
294
+ "last_used_at": {
295
+ "name": "last_used_at",
296
+ "type": "timestamp",
297
+ "primaryKey": false,
298
+ "notNull": false
299
+ },
300
+ "expires_at": {
301
+ "name": "expires_at",
302
+ "type": "timestamp",
303
+ "primaryKey": false,
304
+ "notNull": false
305
+ },
306
+ "created_at": {
307
+ "name": "created_at",
308
+ "type": "timestamp",
309
+ "primaryKey": false,
310
+ "notNull": true,
311
+ "default": "now()"
312
+ },
313
+ "revoked_at": {
314
+ "name": "revoked_at",
315
+ "type": "timestamp",
316
+ "primaryKey": false,
317
+ "notNull": false
318
+ }
319
+ },
320
+ "indexes": {
321
+ "api_keys_user_idx": {
322
+ "name": "api_keys_user_idx",
323
+ "columns": [
324
+ {
325
+ "expression": "user_id",
326
+ "isExpression": false,
327
+ "asc": true,
328
+ "nulls": "last"
329
+ }
330
+ ],
331
+ "isUnique": false,
332
+ "concurrently": false,
333
+ "method": "btree",
334
+ "with": {}
335
+ }
336
+ },
337
+ "foreignKeys": {
338
+ "api_keys_user_id_users_id_fk": {
339
+ "name": "api_keys_user_id_users_id_fk",
340
+ "tableFrom": "api_keys",
341
+ "tableTo": "users",
342
+ "columnsFrom": [
343
+ "user_id"
344
+ ],
345
+ "columnsTo": [
346
+ "id"
347
+ ],
348
+ "onDelete": "no action",
349
+ "onUpdate": "no action"
350
+ }
351
+ },
352
+ "compositePrimaryKeys": {},
353
+ "uniqueConstraints": {},
354
+ "policies": {},
355
+ "checkConstraints": {},
356
+ "isRLSEnabled": false
357
+ },
358
+ "public.archived_memories": {
359
+ "name": "archived_memories",
360
+ "schema": "",
361
+ "columns": {
362
+ "id": {
363
+ "name": "id",
364
+ "type": "uuid",
365
+ "primaryKey": true,
366
+ "notNull": true,
367
+ "default": "gen_random_uuid()"
368
+ },
369
+ "original_memory_id": {
370
+ "name": "original_memory_id",
371
+ "type": "uuid",
372
+ "primaryKey": false,
373
+ "notNull": true
374
+ },
375
+ "user_id": {
376
+ "name": "user_id",
377
+ "type": "uuid",
378
+ "primaryKey": false,
379
+ "notNull": false
380
+ },
381
+ "type": {
382
+ "name": "type",
383
+ "type": "text",
384
+ "primaryKey": false,
385
+ "notNull": true
386
+ },
387
+ "content": {
388
+ "name": "content",
389
+ "type": "text",
390
+ "primaryKey": false,
391
+ "notNull": true
392
+ },
393
+ "reason": {
394
+ "name": "reason",
395
+ "type": "text",
396
+ "primaryKey": false,
397
+ "notNull": false
398
+ },
399
+ "original_created_at": {
400
+ "name": "original_created_at",
401
+ "type": "timestamp",
402
+ "primaryKey": false,
403
+ "notNull": false
404
+ },
405
+ "archived_at": {
406
+ "name": "archived_at",
407
+ "type": "timestamp",
408
+ "primaryKey": false,
409
+ "notNull": true,
410
+ "default": "now()"
411
+ }
412
+ },
413
+ "indexes": {
414
+ "archived_memories_user_idx": {
415
+ "name": "archived_memories_user_idx",
416
+ "columns": [
417
+ {
418
+ "expression": "user_id",
419
+ "isExpression": false,
420
+ "asc": true,
421
+ "nulls": "last"
422
+ }
423
+ ],
424
+ "isUnique": false,
425
+ "concurrently": false,
426
+ "method": "btree",
427
+ "with": {}
428
+ }
429
+ },
430
+ "foreignKeys": {
431
+ "archived_memories_user_id_users_id_fk": {
432
+ "name": "archived_memories_user_id_users_id_fk",
433
+ "tableFrom": "archived_memories",
434
+ "tableTo": "users",
435
+ "columnsFrom": [
436
+ "user_id"
437
+ ],
438
+ "columnsTo": [
439
+ "id"
440
+ ],
441
+ "onDelete": "no action",
442
+ "onUpdate": "no action"
443
+ }
444
+ },
445
+ "compositePrimaryKeys": {},
446
+ "uniqueConstraints": {},
447
+ "policies": {},
448
+ "checkConstraints": {},
449
+ "isRLSEnabled": false
450
+ },
451
+ "public.audit_logs": {
452
+ "name": "audit_logs",
453
+ "schema": "",
454
+ "columns": {
455
+ "id": {
456
+ "name": "id",
457
+ "type": "uuid",
458
+ "primaryKey": true,
459
+ "notNull": true,
460
+ "default": "gen_random_uuid()"
461
+ },
462
+ "user_id": {
463
+ "name": "user_id",
464
+ "type": "uuid",
465
+ "primaryKey": false,
466
+ "notNull": false
467
+ },
468
+ "session_id": {
469
+ "name": "session_id",
470
+ "type": "uuid",
471
+ "primaryKey": false,
472
+ "notNull": false
473
+ },
474
+ "action": {
475
+ "name": "action",
476
+ "type": "text",
477
+ "primaryKey": false,
478
+ "notNull": true
479
+ },
480
+ "resource": {
481
+ "name": "resource",
482
+ "type": "text",
483
+ "primaryKey": false,
484
+ "notNull": false
485
+ },
486
+ "resource_id": {
487
+ "name": "resource_id",
488
+ "type": "text",
489
+ "primaryKey": false,
490
+ "notNull": false
491
+ },
492
+ "details": {
493
+ "name": "details",
494
+ "type": "jsonb",
495
+ "primaryKey": false,
496
+ "notNull": false
497
+ },
498
+ "ip_address": {
499
+ "name": "ip_address",
500
+ "type": "text",
501
+ "primaryKey": false,
502
+ "notNull": false
503
+ },
504
+ "user_agent": {
505
+ "name": "user_agent",
506
+ "type": "text",
507
+ "primaryKey": false,
508
+ "notNull": false
509
+ },
510
+ "success": {
511
+ "name": "success",
512
+ "type": "boolean",
513
+ "primaryKey": false,
514
+ "notNull": false,
515
+ "default": true
516
+ },
517
+ "created_at": {
518
+ "name": "created_at",
519
+ "type": "timestamp",
520
+ "primaryKey": false,
521
+ "notNull": true,
522
+ "default": "now()"
523
+ }
524
+ },
525
+ "indexes": {
526
+ "audit_logs_user_idx": {
527
+ "name": "audit_logs_user_idx",
528
+ "columns": [
529
+ {
530
+ "expression": "user_id",
531
+ "isExpression": false,
532
+ "asc": true,
533
+ "nulls": "last"
534
+ }
535
+ ],
536
+ "isUnique": false,
537
+ "concurrently": false,
538
+ "method": "btree",
539
+ "with": {}
540
+ },
541
+ "audit_logs_action_idx": {
542
+ "name": "audit_logs_action_idx",
543
+ "columns": [
544
+ {
545
+ "expression": "action",
546
+ "isExpression": false,
547
+ "asc": true,
548
+ "nulls": "last"
549
+ }
550
+ ],
551
+ "isUnique": false,
552
+ "concurrently": false,
553
+ "method": "btree",
554
+ "with": {}
555
+ },
556
+ "audit_logs_created_idx": {
557
+ "name": "audit_logs_created_idx",
558
+ "columns": [
559
+ {
560
+ "expression": "created_at",
561
+ "isExpression": false,
562
+ "asc": true,
563
+ "nulls": "last"
564
+ }
565
+ ],
566
+ "isUnique": false,
567
+ "concurrently": false,
568
+ "method": "btree",
569
+ "with": {}
570
+ }
571
+ },
572
+ "foreignKeys": {
573
+ "audit_logs_user_id_users_id_fk": {
574
+ "name": "audit_logs_user_id_users_id_fk",
575
+ "tableFrom": "audit_logs",
576
+ "tableTo": "users",
577
+ "columnsFrom": [
578
+ "user_id"
579
+ ],
580
+ "columnsTo": [
581
+ "id"
582
+ ],
583
+ "onDelete": "no action",
584
+ "onUpdate": "no action"
585
+ },
586
+ "audit_logs_session_id_sessions_id_fk": {
587
+ "name": "audit_logs_session_id_sessions_id_fk",
588
+ "tableFrom": "audit_logs",
589
+ "tableTo": "sessions",
590
+ "columnsFrom": [
591
+ "session_id"
592
+ ],
593
+ "columnsTo": [
594
+ "id"
595
+ ],
596
+ "onDelete": "no action",
597
+ "onUpdate": "no action"
598
+ }
599
+ },
600
+ "compositePrimaryKeys": {},
601
+ "uniqueConstraints": {},
602
+ "policies": {},
603
+ "checkConstraints": {},
604
+ "isRLSEnabled": false
605
+ },
606
+ "public.calendar_triggers": {
607
+ "name": "calendar_triggers",
608
+ "schema": "",
609
+ "columns": {
610
+ "id": {
611
+ "name": "id",
612
+ "type": "uuid",
613
+ "primaryKey": true,
614
+ "notNull": true,
615
+ "default": "gen_random_uuid()"
616
+ },
617
+ "user_id": {
618
+ "name": "user_id",
619
+ "type": "uuid",
620
+ "primaryKey": false,
621
+ "notNull": true
622
+ },
623
+ "name": {
624
+ "name": "name",
625
+ "type": "text",
626
+ "primaryKey": false,
627
+ "notNull": true
628
+ },
629
+ "calendar_source": {
630
+ "name": "calendar_source",
631
+ "type": "text",
632
+ "primaryKey": false,
633
+ "notNull": true
634
+ },
635
+ "calendar_id": {
636
+ "name": "calendar_id",
637
+ "type": "text",
638
+ "primaryKey": false,
639
+ "notNull": false
640
+ },
641
+ "trigger_type": {
642
+ "name": "trigger_type",
643
+ "type": "text",
644
+ "primaryKey": false,
645
+ "notNull": true
646
+ },
647
+ "offset_minutes": {
648
+ "name": "offset_minutes",
649
+ "type": "integer",
650
+ "primaryKey": false,
651
+ "notNull": false,
652
+ "default": 0
653
+ },
654
+ "action": {
655
+ "name": "action",
656
+ "type": "jsonb",
657
+ "primaryKey": false,
658
+ "notNull": false
659
+ },
660
+ "enabled": {
661
+ "name": "enabled",
662
+ "type": "boolean",
663
+ "primaryKey": false,
664
+ "notNull": false,
665
+ "default": true
666
+ },
667
+ "last_triggered": {
668
+ "name": "last_triggered",
669
+ "type": "timestamp",
670
+ "primaryKey": false,
671
+ "notNull": false
672
+ },
673
+ "created_at": {
674
+ "name": "created_at",
675
+ "type": "timestamp",
676
+ "primaryKey": false,
677
+ "notNull": true,
678
+ "default": "now()"
679
+ }
680
+ },
681
+ "indexes": {
682
+ "calendar_triggers_user_idx": {
683
+ "name": "calendar_triggers_user_idx",
684
+ "columns": [
685
+ {
686
+ "expression": "user_id",
687
+ "isExpression": false,
688
+ "asc": true,
689
+ "nulls": "last"
690
+ }
691
+ ],
692
+ "isUnique": false,
693
+ "concurrently": false,
694
+ "method": "btree",
695
+ "with": {}
696
+ }
697
+ },
698
+ "foreignKeys": {
699
+ "calendar_triggers_user_id_users_id_fk": {
700
+ "name": "calendar_triggers_user_id_users_id_fk",
701
+ "tableFrom": "calendar_triggers",
702
+ "tableTo": "users",
703
+ "columnsFrom": [
704
+ "user_id"
705
+ ],
706
+ "columnsTo": [
707
+ "id"
708
+ ],
709
+ "onDelete": "no action",
710
+ "onUpdate": "no action"
711
+ }
712
+ },
713
+ "compositePrimaryKeys": {},
714
+ "uniqueConstraints": {},
715
+ "policies": {},
716
+ "checkConstraints": {},
717
+ "isRLSEnabled": false
718
+ },
719
+ "public.conversations": {
720
+ "name": "conversations",
721
+ "schema": "",
722
+ "columns": {
723
+ "id": {
724
+ "name": "id",
725
+ "type": "uuid",
726
+ "primaryKey": true,
727
+ "notNull": true,
728
+ "default": "gen_random_uuid()"
729
+ },
730
+ "user_id": {
731
+ "name": "user_id",
732
+ "type": "uuid",
733
+ "primaryKey": false,
734
+ "notNull": false
735
+ },
736
+ "title": {
737
+ "name": "title",
738
+ "type": "text",
739
+ "primaryKey": false,
740
+ "notNull": false
741
+ },
742
+ "source": {
743
+ "name": "source",
744
+ "type": "text",
745
+ "primaryKey": false,
746
+ "notNull": true,
747
+ "default": "'telegram'"
748
+ },
749
+ "metadata": {
750
+ "name": "metadata",
751
+ "type": "jsonb",
752
+ "primaryKey": false,
753
+ "notNull": false
754
+ },
755
+ "created_at": {
756
+ "name": "created_at",
757
+ "type": "timestamp",
758
+ "primaryKey": false,
759
+ "notNull": true,
760
+ "default": "now()"
761
+ },
762
+ "updated_at": {
763
+ "name": "updated_at",
764
+ "type": "timestamp",
765
+ "primaryKey": false,
766
+ "notNull": true,
767
+ "default": "now()"
768
+ }
769
+ },
770
+ "indexes": {},
771
+ "foreignKeys": {
772
+ "conversations_user_id_users_id_fk": {
773
+ "name": "conversations_user_id_users_id_fk",
774
+ "tableFrom": "conversations",
775
+ "tableTo": "users",
776
+ "columnsFrom": [
777
+ "user_id"
778
+ ],
779
+ "columnsTo": [
780
+ "id"
781
+ ],
782
+ "onDelete": "no action",
783
+ "onUpdate": "no action"
784
+ }
785
+ },
786
+ "compositePrimaryKeys": {},
787
+ "uniqueConstraints": {},
788
+ "policies": {},
789
+ "checkConstraints": {},
790
+ "isRLSEnabled": false
791
+ },
792
+ "public.error_logs": {
793
+ "name": "error_logs",
794
+ "schema": "",
795
+ "columns": {
796
+ "id": {
797
+ "name": "id",
798
+ "type": "uuid",
799
+ "primaryKey": true,
800
+ "notNull": true,
801
+ "default": "gen_random_uuid()"
802
+ },
803
+ "source": {
804
+ "name": "source",
805
+ "type": "text",
806
+ "primaryKey": false,
807
+ "notNull": true
808
+ },
809
+ "error_type": {
810
+ "name": "error_type",
811
+ "type": "text",
812
+ "primaryKey": false,
813
+ "notNull": true
814
+ },
815
+ "error_code": {
816
+ "name": "error_code",
817
+ "type": "text",
818
+ "primaryKey": false,
819
+ "notNull": false
820
+ },
821
+ "message": {
822
+ "name": "message",
823
+ "type": "text",
824
+ "primaryKey": false,
825
+ "notNull": true
826
+ },
827
+ "stack": {
828
+ "name": "stack",
829
+ "type": "text",
830
+ "primaryKey": false,
831
+ "notNull": false
832
+ },
833
+ "context": {
834
+ "name": "context",
835
+ "type": "jsonb",
836
+ "primaryKey": false,
837
+ "notNull": false
838
+ },
839
+ "user_id": {
840
+ "name": "user_id",
841
+ "type": "uuid",
842
+ "primaryKey": false,
843
+ "notNull": false
844
+ },
845
+ "conversation_id": {
846
+ "name": "conversation_id",
847
+ "type": "uuid",
848
+ "primaryKey": false,
849
+ "notNull": false
850
+ },
851
+ "resolved": {
852
+ "name": "resolved",
853
+ "type": "boolean",
854
+ "primaryKey": false,
855
+ "notNull": false,
856
+ "default": false
857
+ },
858
+ "created_at": {
859
+ "name": "created_at",
860
+ "type": "timestamp",
861
+ "primaryKey": false,
862
+ "notNull": true,
863
+ "default": "now()"
864
+ }
865
+ },
866
+ "indexes": {
867
+ "error_logs_source_idx": {
868
+ "name": "error_logs_source_idx",
869
+ "columns": [
870
+ {
871
+ "expression": "source",
872
+ "isExpression": false,
873
+ "asc": true,
874
+ "nulls": "last"
875
+ }
876
+ ],
877
+ "isUnique": false,
878
+ "concurrently": false,
879
+ "method": "btree",
880
+ "with": {}
881
+ },
882
+ "error_logs_created_idx": {
883
+ "name": "error_logs_created_idx",
884
+ "columns": [
885
+ {
886
+ "expression": "created_at",
887
+ "isExpression": false,
888
+ "asc": true,
889
+ "nulls": "last"
890
+ }
891
+ ],
892
+ "isUnique": false,
893
+ "concurrently": false,
894
+ "method": "btree",
895
+ "with": {}
896
+ }
897
+ },
898
+ "foreignKeys": {
899
+ "error_logs_user_id_users_id_fk": {
900
+ "name": "error_logs_user_id_users_id_fk",
901
+ "tableFrom": "error_logs",
902
+ "tableTo": "users",
903
+ "columnsFrom": [
904
+ "user_id"
905
+ ],
906
+ "columnsTo": [
907
+ "id"
908
+ ],
909
+ "onDelete": "no action",
910
+ "onUpdate": "no action"
911
+ },
912
+ "error_logs_conversation_id_conversations_id_fk": {
913
+ "name": "error_logs_conversation_id_conversations_id_fk",
914
+ "tableFrom": "error_logs",
915
+ "tableTo": "conversations",
916
+ "columnsFrom": [
917
+ "conversation_id"
918
+ ],
919
+ "columnsTo": [
920
+ "id"
921
+ ],
922
+ "onDelete": "no action",
923
+ "onUpdate": "no action"
924
+ }
925
+ },
926
+ "compositePrimaryKeys": {},
927
+ "uniqueConstraints": {},
928
+ "policies": {},
929
+ "checkConstraints": {},
930
+ "isRLSEnabled": false
931
+ },
932
+ "public.memories": {
933
+ "name": "memories",
934
+ "schema": "",
935
+ "columns": {
936
+ "id": {
937
+ "name": "id",
938
+ "type": "uuid",
939
+ "primaryKey": true,
940
+ "notNull": true,
941
+ "default": "gen_random_uuid()"
942
+ },
943
+ "user_id": {
944
+ "name": "user_id",
945
+ "type": "uuid",
946
+ "primaryKey": false,
947
+ "notNull": false
948
+ },
949
+ "type": {
950
+ "name": "type",
951
+ "type": "text",
952
+ "primaryKey": false,
953
+ "notNull": true
954
+ },
955
+ "content": {
956
+ "name": "content",
957
+ "type": "text",
958
+ "primaryKey": false,
959
+ "notNull": true
960
+ },
961
+ "embedding": {
962
+ "name": "embedding",
963
+ "type": "vector(1536)",
964
+ "primaryKey": false,
965
+ "notNull": false
966
+ },
967
+ "importance": {
968
+ "name": "importance",
969
+ "type": "integer",
970
+ "primaryKey": false,
971
+ "notNull": false,
972
+ "default": 5
973
+ },
974
+ "source": {
975
+ "name": "source",
976
+ "type": "text",
977
+ "primaryKey": false,
978
+ "notNull": false
979
+ },
980
+ "metadata": {
981
+ "name": "metadata",
982
+ "type": "jsonb",
983
+ "primaryKey": false,
984
+ "notNull": false
985
+ },
986
+ "last_accessed": {
987
+ "name": "last_accessed",
988
+ "type": "timestamp",
989
+ "primaryKey": false,
990
+ "notNull": false,
991
+ "default": "now()"
992
+ },
993
+ "created_at": {
994
+ "name": "created_at",
995
+ "type": "timestamp",
996
+ "primaryKey": false,
997
+ "notNull": true,
998
+ "default": "now()"
999
+ }
1000
+ },
1001
+ "indexes": {
1002
+ "memories_user_idx": {
1003
+ "name": "memories_user_idx",
1004
+ "columns": [
1005
+ {
1006
+ "expression": "user_id",
1007
+ "isExpression": false,
1008
+ "asc": true,
1009
+ "nulls": "last"
1010
+ }
1011
+ ],
1012
+ "isUnique": false,
1013
+ "concurrently": false,
1014
+ "method": "btree",
1015
+ "with": {}
1016
+ }
1017
+ },
1018
+ "foreignKeys": {
1019
+ "memories_user_id_users_id_fk": {
1020
+ "name": "memories_user_id_users_id_fk",
1021
+ "tableFrom": "memories",
1022
+ "tableTo": "users",
1023
+ "columnsFrom": [
1024
+ "user_id"
1025
+ ],
1026
+ "columnsTo": [
1027
+ "id"
1028
+ ],
1029
+ "onDelete": "no action",
1030
+ "onUpdate": "no action"
1031
+ }
1032
+ },
1033
+ "compositePrimaryKeys": {},
1034
+ "uniqueConstraints": {},
1035
+ "policies": {},
1036
+ "checkConstraints": {},
1037
+ "isRLSEnabled": false
1038
+ },
1039
+ "public.messages": {
1040
+ "name": "messages",
1041
+ "schema": "",
1042
+ "columns": {
1043
+ "id": {
1044
+ "name": "id",
1045
+ "type": "uuid",
1046
+ "primaryKey": true,
1047
+ "notNull": true,
1048
+ "default": "gen_random_uuid()"
1049
+ },
1050
+ "conversation_id": {
1051
+ "name": "conversation_id",
1052
+ "type": "uuid",
1053
+ "primaryKey": false,
1054
+ "notNull": true
1055
+ },
1056
+ "role": {
1057
+ "name": "role",
1058
+ "type": "text",
1059
+ "primaryKey": false,
1060
+ "notNull": true
1061
+ },
1062
+ "content": {
1063
+ "name": "content",
1064
+ "type": "text",
1065
+ "primaryKey": false,
1066
+ "notNull": true
1067
+ },
1068
+ "token_count": {
1069
+ "name": "token_count",
1070
+ "type": "integer",
1071
+ "primaryKey": false,
1072
+ "notNull": false
1073
+ },
1074
+ "metadata": {
1075
+ "name": "metadata",
1076
+ "type": "jsonb",
1077
+ "primaryKey": false,
1078
+ "notNull": false
1079
+ },
1080
+ "created_at": {
1081
+ "name": "created_at",
1082
+ "type": "timestamp",
1083
+ "primaryKey": false,
1084
+ "notNull": true,
1085
+ "default": "now()"
1086
+ }
1087
+ },
1088
+ "indexes": {
1089
+ "messages_conversation_idx": {
1090
+ "name": "messages_conversation_idx",
1091
+ "columns": [
1092
+ {
1093
+ "expression": "conversation_id",
1094
+ "isExpression": false,
1095
+ "asc": true,
1096
+ "nulls": "last"
1097
+ }
1098
+ ],
1099
+ "isUnique": false,
1100
+ "concurrently": false,
1101
+ "method": "btree",
1102
+ "with": {}
1103
+ }
1104
+ },
1105
+ "foreignKeys": {
1106
+ "messages_conversation_id_conversations_id_fk": {
1107
+ "name": "messages_conversation_id_conversations_id_fk",
1108
+ "tableFrom": "messages",
1109
+ "tableTo": "conversations",
1110
+ "columnsFrom": [
1111
+ "conversation_id"
1112
+ ],
1113
+ "columnsTo": [
1114
+ "id"
1115
+ ],
1116
+ "onDelete": "no action",
1117
+ "onUpdate": "no action"
1118
+ }
1119
+ },
1120
+ "compositePrimaryKeys": {},
1121
+ "uniqueConstraints": {},
1122
+ "policies": {},
1123
+ "checkConstraints": {},
1124
+ "isRLSEnabled": false
1125
+ },
1126
+ "public.metrics": {
1127
+ "name": "metrics",
1128
+ "schema": "",
1129
+ "columns": {
1130
+ "id": {
1131
+ "name": "id",
1132
+ "type": "uuid",
1133
+ "primaryKey": true,
1134
+ "notNull": true,
1135
+ "default": "gen_random_uuid()"
1136
+ },
1137
+ "name": {
1138
+ "name": "name",
1139
+ "type": "text",
1140
+ "primaryKey": false,
1141
+ "notNull": true
1142
+ },
1143
+ "value": {
1144
+ "name": "value",
1145
+ "type": "integer",
1146
+ "primaryKey": false,
1147
+ "notNull": true
1148
+ },
1149
+ "unit": {
1150
+ "name": "unit",
1151
+ "type": "text",
1152
+ "primaryKey": false,
1153
+ "notNull": false
1154
+ },
1155
+ "tags": {
1156
+ "name": "tags",
1157
+ "type": "jsonb",
1158
+ "primaryKey": false,
1159
+ "notNull": false
1160
+ },
1161
+ "timestamp": {
1162
+ "name": "timestamp",
1163
+ "type": "timestamp",
1164
+ "primaryKey": false,
1165
+ "notNull": true,
1166
+ "default": "now()"
1167
+ }
1168
+ },
1169
+ "indexes": {
1170
+ "metrics_name_timestamp_idx": {
1171
+ "name": "metrics_name_timestamp_idx",
1172
+ "columns": [
1173
+ {
1174
+ "expression": "name",
1175
+ "isExpression": false,
1176
+ "asc": true,
1177
+ "nulls": "last"
1178
+ },
1179
+ {
1180
+ "expression": "timestamp",
1181
+ "isExpression": false,
1182
+ "asc": true,
1183
+ "nulls": "last"
1184
+ }
1185
+ ],
1186
+ "isUnique": false,
1187
+ "concurrently": false,
1188
+ "method": "btree",
1189
+ "with": {}
1190
+ }
1191
+ },
1192
+ "foreignKeys": {},
1193
+ "compositePrimaryKeys": {},
1194
+ "uniqueConstraints": {},
1195
+ "policies": {},
1196
+ "checkConstraints": {},
1197
+ "isRLSEnabled": false
1198
+ },
1199
+ "public.molt_modes": {
1200
+ "name": "molt_modes",
1201
+ "schema": "",
1202
+ "columns": {
1203
+ "id": {
1204
+ "name": "id",
1205
+ "type": "uuid",
1206
+ "primaryKey": true,
1207
+ "notNull": true,
1208
+ "default": "gen_random_uuid()"
1209
+ },
1210
+ "user_id": {
1211
+ "name": "user_id",
1212
+ "type": "uuid",
1213
+ "primaryKey": false,
1214
+ "notNull": true
1215
+ },
1216
+ "mode": {
1217
+ "name": "mode",
1218
+ "type": "text",
1219
+ "primaryKey": false,
1220
+ "notNull": true
1221
+ },
1222
+ "activated_at": {
1223
+ "name": "activated_at",
1224
+ "type": "timestamp",
1225
+ "primaryKey": false,
1226
+ "notNull": true,
1227
+ "default": "now()"
1228
+ },
1229
+ "deactivated_at": {
1230
+ "name": "deactivated_at",
1231
+ "type": "timestamp",
1232
+ "primaryKey": false,
1233
+ "notNull": false
1234
+ },
1235
+ "metadata": {
1236
+ "name": "metadata",
1237
+ "type": "jsonb",
1238
+ "primaryKey": false,
1239
+ "notNull": false
1240
+ }
1241
+ },
1242
+ "indexes": {
1243
+ "molt_modes_user_idx": {
1244
+ "name": "molt_modes_user_idx",
1245
+ "columns": [
1246
+ {
1247
+ "expression": "user_id",
1248
+ "isExpression": false,
1249
+ "asc": true,
1250
+ "nulls": "last"
1251
+ }
1252
+ ],
1253
+ "isUnique": false,
1254
+ "concurrently": false,
1255
+ "method": "btree",
1256
+ "with": {}
1257
+ }
1258
+ },
1259
+ "foreignKeys": {
1260
+ "molt_modes_user_id_users_id_fk": {
1261
+ "name": "molt_modes_user_id_users_id_fk",
1262
+ "tableFrom": "molt_modes",
1263
+ "tableTo": "users",
1264
+ "columnsFrom": [
1265
+ "user_id"
1266
+ ],
1267
+ "columnsTo": [
1268
+ "id"
1269
+ ],
1270
+ "onDelete": "no action",
1271
+ "onUpdate": "no action"
1272
+ }
1273
+ },
1274
+ "compositePrimaryKeys": {},
1275
+ "uniqueConstraints": {},
1276
+ "policies": {},
1277
+ "checkConstraints": {},
1278
+ "isRLSEnabled": false
1279
+ },
1280
+ "public.organization_members": {
1281
+ "name": "organization_members",
1282
+ "schema": "",
1283
+ "columns": {
1284
+ "id": {
1285
+ "name": "id",
1286
+ "type": "uuid",
1287
+ "primaryKey": true,
1288
+ "notNull": true,
1289
+ "default": "gen_random_uuid()"
1290
+ },
1291
+ "organization_id": {
1292
+ "name": "organization_id",
1293
+ "type": "uuid",
1294
+ "primaryKey": false,
1295
+ "notNull": true
1296
+ },
1297
+ "user_id": {
1298
+ "name": "user_id",
1299
+ "type": "uuid",
1300
+ "primaryKey": false,
1301
+ "notNull": true
1302
+ },
1303
+ "role": {
1304
+ "name": "role",
1305
+ "type": "text",
1306
+ "primaryKey": false,
1307
+ "notNull": true
1308
+ },
1309
+ "joined_at": {
1310
+ "name": "joined_at",
1311
+ "type": "timestamp",
1312
+ "primaryKey": false,
1313
+ "notNull": true,
1314
+ "default": "now()"
1315
+ }
1316
+ },
1317
+ "indexes": {
1318
+ "org_members_org_idx": {
1319
+ "name": "org_members_org_idx",
1320
+ "columns": [
1321
+ {
1322
+ "expression": "organization_id",
1323
+ "isExpression": false,
1324
+ "asc": true,
1325
+ "nulls": "last"
1326
+ }
1327
+ ],
1328
+ "isUnique": false,
1329
+ "concurrently": false,
1330
+ "method": "btree",
1331
+ "with": {}
1332
+ },
1333
+ "org_members_user_idx": {
1334
+ "name": "org_members_user_idx",
1335
+ "columns": [
1336
+ {
1337
+ "expression": "user_id",
1338
+ "isExpression": false,
1339
+ "asc": true,
1340
+ "nulls": "last"
1341
+ }
1342
+ ],
1343
+ "isUnique": false,
1344
+ "concurrently": false,
1345
+ "method": "btree",
1346
+ "with": {}
1347
+ }
1348
+ },
1349
+ "foreignKeys": {
1350
+ "organization_members_organization_id_organizations_id_fk": {
1351
+ "name": "organization_members_organization_id_organizations_id_fk",
1352
+ "tableFrom": "organization_members",
1353
+ "tableTo": "organizations",
1354
+ "columnsFrom": [
1355
+ "organization_id"
1356
+ ],
1357
+ "columnsTo": [
1358
+ "id"
1359
+ ],
1360
+ "onDelete": "no action",
1361
+ "onUpdate": "no action"
1362
+ },
1363
+ "organization_members_user_id_users_id_fk": {
1364
+ "name": "organization_members_user_id_users_id_fk",
1365
+ "tableFrom": "organization_members",
1366
+ "tableTo": "users",
1367
+ "columnsFrom": [
1368
+ "user_id"
1369
+ ],
1370
+ "columnsTo": [
1371
+ "id"
1372
+ ],
1373
+ "onDelete": "no action",
1374
+ "onUpdate": "no action"
1375
+ }
1376
+ },
1377
+ "compositePrimaryKeys": {},
1378
+ "uniqueConstraints": {},
1379
+ "policies": {},
1380
+ "checkConstraints": {},
1381
+ "isRLSEnabled": false
1382
+ },
1383
+ "public.organizations": {
1384
+ "name": "organizations",
1385
+ "schema": "",
1386
+ "columns": {
1387
+ "id": {
1388
+ "name": "id",
1389
+ "type": "uuid",
1390
+ "primaryKey": true,
1391
+ "notNull": true,
1392
+ "default": "gen_random_uuid()"
1393
+ },
1394
+ "name": {
1395
+ "name": "name",
1396
+ "type": "text",
1397
+ "primaryKey": false,
1398
+ "notNull": true
1399
+ },
1400
+ "slug": {
1401
+ "name": "slug",
1402
+ "type": "text",
1403
+ "primaryKey": false,
1404
+ "notNull": false
1405
+ },
1406
+ "settings": {
1407
+ "name": "settings",
1408
+ "type": "jsonb",
1409
+ "primaryKey": false,
1410
+ "notNull": false
1411
+ },
1412
+ "created_at": {
1413
+ "name": "created_at",
1414
+ "type": "timestamp",
1415
+ "primaryKey": false,
1416
+ "notNull": true,
1417
+ "default": "now()"
1418
+ },
1419
+ "updated_at": {
1420
+ "name": "updated_at",
1421
+ "type": "timestamp",
1422
+ "primaryKey": false,
1423
+ "notNull": false,
1424
+ "default": "now()"
1425
+ }
1426
+ },
1427
+ "indexes": {},
1428
+ "foreignKeys": {},
1429
+ "compositePrimaryKeys": {},
1430
+ "uniqueConstraints": {
1431
+ "organizations_slug_unique": {
1432
+ "name": "organizations_slug_unique",
1433
+ "nullsNotDistinct": false,
1434
+ "columns": [
1435
+ "slug"
1436
+ ]
1437
+ }
1438
+ },
1439
+ "policies": {},
1440
+ "checkConstraints": {},
1441
+ "isRLSEnabled": false
1442
+ },
1443
+ "public.personas": {
1444
+ "name": "personas",
1445
+ "schema": "",
1446
+ "columns": {
1447
+ "id": {
1448
+ "name": "id",
1449
+ "type": "uuid",
1450
+ "primaryKey": true,
1451
+ "notNull": true,
1452
+ "default": "gen_random_uuid()"
1453
+ },
1454
+ "user_id": {
1455
+ "name": "user_id",
1456
+ "type": "uuid",
1457
+ "primaryKey": false,
1458
+ "notNull": false
1459
+ },
1460
+ "name": {
1461
+ "name": "name",
1462
+ "type": "text",
1463
+ "primaryKey": false,
1464
+ "notNull": true
1465
+ },
1466
+ "description": {
1467
+ "name": "description",
1468
+ "type": "text",
1469
+ "primaryKey": false,
1470
+ "notNull": false
1471
+ },
1472
+ "base_prompt": {
1473
+ "name": "base_prompt",
1474
+ "type": "text",
1475
+ "primaryKey": false,
1476
+ "notNull": true
1477
+ },
1478
+ "is_default": {
1479
+ "name": "is_default",
1480
+ "type": "boolean",
1481
+ "primaryKey": false,
1482
+ "notNull": false,
1483
+ "default": false
1484
+ },
1485
+ "is_system": {
1486
+ "name": "is_system",
1487
+ "type": "boolean",
1488
+ "primaryKey": false,
1489
+ "notNull": false,
1490
+ "default": false
1491
+ },
1492
+ "settings": {
1493
+ "name": "settings",
1494
+ "type": "jsonb",
1495
+ "primaryKey": false,
1496
+ "notNull": false
1497
+ },
1498
+ "created_at": {
1499
+ "name": "created_at",
1500
+ "type": "timestamp",
1501
+ "primaryKey": false,
1502
+ "notNull": true,
1503
+ "default": "now()"
1504
+ }
1505
+ },
1506
+ "indexes": {
1507
+ "personas_user_idx": {
1508
+ "name": "personas_user_idx",
1509
+ "columns": [
1510
+ {
1511
+ "expression": "user_id",
1512
+ "isExpression": false,
1513
+ "asc": true,
1514
+ "nulls": "last"
1515
+ }
1516
+ ],
1517
+ "isUnique": false,
1518
+ "concurrently": false,
1519
+ "method": "btree",
1520
+ "with": {}
1521
+ }
1522
+ },
1523
+ "foreignKeys": {
1524
+ "personas_user_id_users_id_fk": {
1525
+ "name": "personas_user_id_users_id_fk",
1526
+ "tableFrom": "personas",
1527
+ "tableTo": "users",
1528
+ "columnsFrom": [
1529
+ "user_id"
1530
+ ],
1531
+ "columnsTo": [
1532
+ "id"
1533
+ ],
1534
+ "onDelete": "no action",
1535
+ "onUpdate": "no action"
1536
+ }
1537
+ },
1538
+ "compositePrimaryKeys": {},
1539
+ "uniqueConstraints": {},
1540
+ "policies": {},
1541
+ "checkConstraints": {},
1542
+ "isRLSEnabled": false
1543
+ },
1544
+ "public.rate_limits": {
1545
+ "name": "rate_limits",
1546
+ "schema": "",
1547
+ "columns": {
1548
+ "id": {
1549
+ "name": "id",
1550
+ "type": "uuid",
1551
+ "primaryKey": true,
1552
+ "notNull": true,
1553
+ "default": "gen_random_uuid()"
1554
+ },
1555
+ "identifier": {
1556
+ "name": "identifier",
1557
+ "type": "text",
1558
+ "primaryKey": false,
1559
+ "notNull": true
1560
+ },
1561
+ "endpoint": {
1562
+ "name": "endpoint",
1563
+ "type": "text",
1564
+ "primaryKey": false,
1565
+ "notNull": true
1566
+ },
1567
+ "window_start": {
1568
+ "name": "window_start",
1569
+ "type": "timestamp",
1570
+ "primaryKey": false,
1571
+ "notNull": true
1572
+ },
1573
+ "request_count": {
1574
+ "name": "request_count",
1575
+ "type": "integer",
1576
+ "primaryKey": false,
1577
+ "notNull": false,
1578
+ "default": 0
1579
+ },
1580
+ "last_request": {
1581
+ "name": "last_request",
1582
+ "type": "timestamp",
1583
+ "primaryKey": false,
1584
+ "notNull": false
1585
+ }
1586
+ },
1587
+ "indexes": {
1588
+ "rate_limits_identifier_endpoint_idx": {
1589
+ "name": "rate_limits_identifier_endpoint_idx",
1590
+ "columns": [
1591
+ {
1592
+ "expression": "identifier",
1593
+ "isExpression": false,
1594
+ "asc": true,
1595
+ "nulls": "last"
1596
+ },
1597
+ {
1598
+ "expression": "endpoint",
1599
+ "isExpression": false,
1600
+ "asc": true,
1601
+ "nulls": "last"
1602
+ }
1603
+ ],
1604
+ "isUnique": false,
1605
+ "concurrently": false,
1606
+ "method": "btree",
1607
+ "with": {}
1608
+ }
1609
+ },
1610
+ "foreignKeys": {},
1611
+ "compositePrimaryKeys": {},
1612
+ "uniqueConstraints": {},
1613
+ "policies": {},
1614
+ "checkConstraints": {},
1615
+ "isRLSEnabled": false
1616
+ },
1617
+ "public.scheduled_tasks": {
1618
+ "name": "scheduled_tasks",
1619
+ "schema": "",
1620
+ "columns": {
1621
+ "id": {
1622
+ "name": "id",
1623
+ "type": "uuid",
1624
+ "primaryKey": true,
1625
+ "notNull": true,
1626
+ "default": "gen_random_uuid()"
1627
+ },
1628
+ "user_id": {
1629
+ "name": "user_id",
1630
+ "type": "uuid",
1631
+ "primaryKey": false,
1632
+ "notNull": false
1633
+ },
1634
+ "name": {
1635
+ "name": "name",
1636
+ "type": "text",
1637
+ "primaryKey": false,
1638
+ "notNull": true
1639
+ },
1640
+ "description": {
1641
+ "name": "description",
1642
+ "type": "text",
1643
+ "primaryKey": false,
1644
+ "notNull": false
1645
+ },
1646
+ "cron_expression": {
1647
+ "name": "cron_expression",
1648
+ "type": "text",
1649
+ "primaryKey": false,
1650
+ "notNull": false
1651
+ },
1652
+ "next_run_at": {
1653
+ "name": "next_run_at",
1654
+ "type": "timestamp",
1655
+ "primaryKey": false,
1656
+ "notNull": false
1657
+ },
1658
+ "last_run_at": {
1659
+ "name": "last_run_at",
1660
+ "type": "timestamp",
1661
+ "primaryKey": false,
1662
+ "notNull": false
1663
+ },
1664
+ "enabled": {
1665
+ "name": "enabled",
1666
+ "type": "boolean",
1667
+ "primaryKey": false,
1668
+ "notNull": false,
1669
+ "default": true
1670
+ },
1671
+ "action": {
1672
+ "name": "action",
1673
+ "type": "jsonb",
1674
+ "primaryKey": false,
1675
+ "notNull": false
1676
+ },
1677
+ "created_at": {
1678
+ "name": "created_at",
1679
+ "type": "timestamp",
1680
+ "primaryKey": false,
1681
+ "notNull": true,
1682
+ "default": "now()"
1683
+ }
1684
+ },
1685
+ "indexes": {},
1686
+ "foreignKeys": {
1687
+ "scheduled_tasks_user_id_users_id_fk": {
1688
+ "name": "scheduled_tasks_user_id_users_id_fk",
1689
+ "tableFrom": "scheduled_tasks",
1690
+ "tableTo": "users",
1691
+ "columnsFrom": [
1692
+ "user_id"
1693
+ ],
1694
+ "columnsTo": [
1695
+ "id"
1696
+ ],
1697
+ "onDelete": "no action",
1698
+ "onUpdate": "no action"
1699
+ }
1700
+ },
1701
+ "compositePrimaryKeys": {},
1702
+ "uniqueConstraints": {},
1703
+ "policies": {},
1704
+ "checkConstraints": {},
1705
+ "isRLSEnabled": false
1706
+ },
1707
+ "public.sessions": {
1708
+ "name": "sessions",
1709
+ "schema": "",
1710
+ "columns": {
1711
+ "id": {
1712
+ "name": "id",
1713
+ "type": "uuid",
1714
+ "primaryKey": true,
1715
+ "notNull": true,
1716
+ "default": "gen_random_uuid()"
1717
+ },
1718
+ "user_id": {
1719
+ "name": "user_id",
1720
+ "type": "uuid",
1721
+ "primaryKey": false,
1722
+ "notNull": true
1723
+ },
1724
+ "token": {
1725
+ "name": "token",
1726
+ "type": "text",
1727
+ "primaryKey": false,
1728
+ "notNull": true
1729
+ },
1730
+ "device_info": {
1731
+ "name": "device_info",
1732
+ "type": "jsonb",
1733
+ "primaryKey": false,
1734
+ "notNull": false
1735
+ },
1736
+ "ip_address": {
1737
+ "name": "ip_address",
1738
+ "type": "text",
1739
+ "primaryKey": false,
1740
+ "notNull": false
1741
+ },
1742
+ "created_at": {
1743
+ "name": "created_at",
1744
+ "type": "timestamp",
1745
+ "primaryKey": false,
1746
+ "notNull": true,
1747
+ "default": "now()"
1748
+ },
1749
+ "expires_at": {
1750
+ "name": "expires_at",
1751
+ "type": "timestamp",
1752
+ "primaryKey": false,
1753
+ "notNull": true
1754
+ },
1755
+ "last_active_at": {
1756
+ "name": "last_active_at",
1757
+ "type": "timestamp",
1758
+ "primaryKey": false,
1759
+ "notNull": false,
1760
+ "default": "now()"
1761
+ }
1762
+ },
1763
+ "indexes": {
1764
+ "sessions_user_idx": {
1765
+ "name": "sessions_user_idx",
1766
+ "columns": [
1767
+ {
1768
+ "expression": "user_id",
1769
+ "isExpression": false,
1770
+ "asc": true,
1771
+ "nulls": "last"
1772
+ }
1773
+ ],
1774
+ "isUnique": false,
1775
+ "concurrently": false,
1776
+ "method": "btree",
1777
+ "with": {}
1778
+ }
1779
+ },
1780
+ "foreignKeys": {
1781
+ "sessions_user_id_users_id_fk": {
1782
+ "name": "sessions_user_id_users_id_fk",
1783
+ "tableFrom": "sessions",
1784
+ "tableTo": "users",
1785
+ "columnsFrom": [
1786
+ "user_id"
1787
+ ],
1788
+ "columnsTo": [
1789
+ "id"
1790
+ ],
1791
+ "onDelete": "no action",
1792
+ "onUpdate": "no action"
1793
+ }
1794
+ },
1795
+ "compositePrimaryKeys": {},
1796
+ "uniqueConstraints": {
1797
+ "sessions_token_unique": {
1798
+ "name": "sessions_token_unique",
1799
+ "nullsNotDistinct": false,
1800
+ "columns": [
1801
+ "token"
1802
+ ]
1803
+ }
1804
+ },
1805
+ "policies": {},
1806
+ "checkConstraints": {},
1807
+ "isRLSEnabled": false
1808
+ },
1809
+ "public.shared_memories": {
1810
+ "name": "shared_memories",
1811
+ "schema": "",
1812
+ "columns": {
1813
+ "id": {
1814
+ "name": "id",
1815
+ "type": "uuid",
1816
+ "primaryKey": true,
1817
+ "notNull": true,
1818
+ "default": "gen_random_uuid()"
1819
+ },
1820
+ "organization_id": {
1821
+ "name": "organization_id",
1822
+ "type": "uuid",
1823
+ "primaryKey": false,
1824
+ "notNull": true
1825
+ },
1826
+ "memory_id": {
1827
+ "name": "memory_id",
1828
+ "type": "uuid",
1829
+ "primaryKey": false,
1830
+ "notNull": true
1831
+ },
1832
+ "shared_by": {
1833
+ "name": "shared_by",
1834
+ "type": "uuid",
1835
+ "primaryKey": false,
1836
+ "notNull": true
1837
+ },
1838
+ "shared_at": {
1839
+ "name": "shared_at",
1840
+ "type": "timestamp",
1841
+ "primaryKey": false,
1842
+ "notNull": true,
1843
+ "default": "now()"
1844
+ }
1845
+ },
1846
+ "indexes": {
1847
+ "shared_memories_org_idx": {
1848
+ "name": "shared_memories_org_idx",
1849
+ "columns": [
1850
+ {
1851
+ "expression": "organization_id",
1852
+ "isExpression": false,
1853
+ "asc": true,
1854
+ "nulls": "last"
1855
+ }
1856
+ ],
1857
+ "isUnique": false,
1858
+ "concurrently": false,
1859
+ "method": "btree",
1860
+ "with": {}
1861
+ }
1862
+ },
1863
+ "foreignKeys": {
1864
+ "shared_memories_organization_id_organizations_id_fk": {
1865
+ "name": "shared_memories_organization_id_organizations_id_fk",
1866
+ "tableFrom": "shared_memories",
1867
+ "tableTo": "organizations",
1868
+ "columnsFrom": [
1869
+ "organization_id"
1870
+ ],
1871
+ "columnsTo": [
1872
+ "id"
1873
+ ],
1874
+ "onDelete": "no action",
1875
+ "onUpdate": "no action"
1876
+ },
1877
+ "shared_memories_memory_id_memories_id_fk": {
1878
+ "name": "shared_memories_memory_id_memories_id_fk",
1879
+ "tableFrom": "shared_memories",
1880
+ "tableTo": "memories",
1881
+ "columnsFrom": [
1882
+ "memory_id"
1883
+ ],
1884
+ "columnsTo": [
1885
+ "id"
1886
+ ],
1887
+ "onDelete": "no action",
1888
+ "onUpdate": "no action"
1889
+ },
1890
+ "shared_memories_shared_by_users_id_fk": {
1891
+ "name": "shared_memories_shared_by_users_id_fk",
1892
+ "tableFrom": "shared_memories",
1893
+ "tableTo": "users",
1894
+ "columnsFrom": [
1895
+ "shared_by"
1896
+ ],
1897
+ "columnsTo": [
1898
+ "id"
1899
+ ],
1900
+ "onDelete": "no action",
1901
+ "onUpdate": "no action"
1902
+ }
1903
+ },
1904
+ "compositePrimaryKeys": {},
1905
+ "uniqueConstraints": {},
1906
+ "policies": {},
1907
+ "checkConstraints": {},
1908
+ "isRLSEnabled": false
1909
+ },
1910
+ "public.sub_agents": {
1911
+ "name": "sub_agents",
1912
+ "schema": "",
1913
+ "columns": {
1914
+ "id": {
1915
+ "name": "id",
1916
+ "type": "uuid",
1917
+ "primaryKey": true,
1918
+ "notNull": true,
1919
+ "default": "gen_random_uuid()"
1920
+ },
1921
+ "parent_conversation_id": {
1922
+ "name": "parent_conversation_id",
1923
+ "type": "uuid",
1924
+ "primaryKey": false,
1925
+ "notNull": false
1926
+ },
1927
+ "user_id": {
1928
+ "name": "user_id",
1929
+ "type": "uuid",
1930
+ "primaryKey": false,
1931
+ "notNull": true
1932
+ },
1933
+ "type": {
1934
+ "name": "type",
1935
+ "type": "text",
1936
+ "primaryKey": false,
1937
+ "notNull": true
1938
+ },
1939
+ "name": {
1940
+ "name": "name",
1941
+ "type": "text",
1942
+ "primaryKey": false,
1943
+ "notNull": true
1944
+ },
1945
+ "status": {
1946
+ "name": "status",
1947
+ "type": "text",
1948
+ "primaryKey": false,
1949
+ "notNull": true
1950
+ },
1951
+ "objective": {
1952
+ "name": "objective",
1953
+ "type": "text",
1954
+ "primaryKey": false,
1955
+ "notNull": true
1956
+ },
1957
+ "context": {
1958
+ "name": "context",
1959
+ "type": "jsonb",
1960
+ "primaryKey": false,
1961
+ "notNull": false
1962
+ },
1963
+ "result": {
1964
+ "name": "result",
1965
+ "type": "jsonb",
1966
+ "primaryKey": false,
1967
+ "notNull": false
1968
+ },
1969
+ "token_budget": {
1970
+ "name": "token_budget",
1971
+ "type": "integer",
1972
+ "primaryKey": false,
1973
+ "notNull": false,
1974
+ "default": 50000
1975
+ },
1976
+ "tokens_used": {
1977
+ "name": "tokens_used",
1978
+ "type": "integer",
1979
+ "primaryKey": false,
1980
+ "notNull": false,
1981
+ "default": 0
1982
+ },
1983
+ "time_budget_ms": {
1984
+ "name": "time_budget_ms",
1985
+ "type": "integer",
1986
+ "primaryKey": false,
1987
+ "notNull": false,
1988
+ "default": 3600000
1989
+ },
1990
+ "started_at": {
1991
+ "name": "started_at",
1992
+ "type": "timestamp",
1993
+ "primaryKey": false,
1994
+ "notNull": false
1995
+ },
1996
+ "completed_at": {
1997
+ "name": "completed_at",
1998
+ "type": "timestamp",
1999
+ "primaryKey": false,
2000
+ "notNull": false
2001
+ },
2002
+ "created_at": {
2003
+ "name": "created_at",
2004
+ "type": "timestamp",
2005
+ "primaryKey": false,
2006
+ "notNull": true,
2007
+ "default": "now()"
2008
+ }
2009
+ },
2010
+ "indexes": {
2011
+ "sub_agents_user_idx": {
2012
+ "name": "sub_agents_user_idx",
2013
+ "columns": [
2014
+ {
2015
+ "expression": "user_id",
2016
+ "isExpression": false,
2017
+ "asc": true,
2018
+ "nulls": "last"
2019
+ }
2020
+ ],
2021
+ "isUnique": false,
2022
+ "concurrently": false,
2023
+ "method": "btree",
2024
+ "with": {}
2025
+ },
2026
+ "sub_agents_status_idx": {
2027
+ "name": "sub_agents_status_idx",
2028
+ "columns": [
2029
+ {
2030
+ "expression": "status",
2031
+ "isExpression": false,
2032
+ "asc": true,
2033
+ "nulls": "last"
2034
+ }
2035
+ ],
2036
+ "isUnique": false,
2037
+ "concurrently": false,
2038
+ "method": "btree",
2039
+ "with": {}
2040
+ }
2041
+ },
2042
+ "foreignKeys": {
2043
+ "sub_agents_parent_conversation_id_conversations_id_fk": {
2044
+ "name": "sub_agents_parent_conversation_id_conversations_id_fk",
2045
+ "tableFrom": "sub_agents",
2046
+ "tableTo": "conversations",
2047
+ "columnsFrom": [
2048
+ "parent_conversation_id"
2049
+ ],
2050
+ "columnsTo": [
2051
+ "id"
2052
+ ],
2053
+ "onDelete": "no action",
2054
+ "onUpdate": "no action"
2055
+ },
2056
+ "sub_agents_user_id_users_id_fk": {
2057
+ "name": "sub_agents_user_id_users_id_fk",
2058
+ "tableFrom": "sub_agents",
2059
+ "tableTo": "users",
2060
+ "columnsFrom": [
2061
+ "user_id"
2062
+ ],
2063
+ "columnsTo": [
2064
+ "id"
2065
+ ],
2066
+ "onDelete": "no action",
2067
+ "onUpdate": "no action"
2068
+ }
2069
+ },
2070
+ "compositePrimaryKeys": {},
2071
+ "uniqueConstraints": {},
2072
+ "policies": {},
2073
+ "checkConstraints": {},
2074
+ "isRLSEnabled": false
2075
+ },
2076
+ "public.tool_logs": {
2077
+ "name": "tool_logs",
2078
+ "schema": "",
2079
+ "columns": {
2080
+ "id": {
2081
+ "name": "id",
2082
+ "type": "uuid",
2083
+ "primaryKey": true,
2084
+ "notNull": true,
2085
+ "default": "gen_random_uuid()"
2086
+ },
2087
+ "conversation_id": {
2088
+ "name": "conversation_id",
2089
+ "type": "uuid",
2090
+ "primaryKey": false,
2091
+ "notNull": false
2092
+ },
2093
+ "tool_name": {
2094
+ "name": "tool_name",
2095
+ "type": "text",
2096
+ "primaryKey": false,
2097
+ "notNull": true
2098
+ },
2099
+ "input": {
2100
+ "name": "input",
2101
+ "type": "jsonb",
2102
+ "primaryKey": false,
2103
+ "notNull": false
2104
+ },
2105
+ "output": {
2106
+ "name": "output",
2107
+ "type": "jsonb",
2108
+ "primaryKey": false,
2109
+ "notNull": false
2110
+ },
2111
+ "success": {
2112
+ "name": "success",
2113
+ "type": "boolean",
2114
+ "primaryKey": false,
2115
+ "notNull": true
2116
+ },
2117
+ "duration_ms": {
2118
+ "name": "duration_ms",
2119
+ "type": "integer",
2120
+ "primaryKey": false,
2121
+ "notNull": false
2122
+ },
2123
+ "created_at": {
2124
+ "name": "created_at",
2125
+ "type": "timestamp",
2126
+ "primaryKey": false,
2127
+ "notNull": true,
2128
+ "default": "now()"
2129
+ }
2130
+ },
2131
+ "indexes": {
2132
+ "tool_logs_conversation_idx": {
2133
+ "name": "tool_logs_conversation_idx",
2134
+ "columns": [
2135
+ {
2136
+ "expression": "conversation_id",
2137
+ "isExpression": false,
2138
+ "asc": true,
2139
+ "nulls": "last"
2140
+ }
2141
+ ],
2142
+ "isUnique": false,
2143
+ "concurrently": false,
2144
+ "method": "btree",
2145
+ "with": {}
2146
+ }
2147
+ },
2148
+ "foreignKeys": {
2149
+ "tool_logs_conversation_id_conversations_id_fk": {
2150
+ "name": "tool_logs_conversation_id_conversations_id_fk",
2151
+ "tableFrom": "tool_logs",
2152
+ "tableTo": "conversations",
2153
+ "columnsFrom": [
2154
+ "conversation_id"
2155
+ ],
2156
+ "columnsTo": [
2157
+ "id"
2158
+ ],
2159
+ "onDelete": "no action",
2160
+ "onUpdate": "no action"
2161
+ }
2162
+ },
2163
+ "compositePrimaryKeys": {},
2164
+ "uniqueConstraints": {},
2165
+ "policies": {},
2166
+ "checkConstraints": {},
2167
+ "isRLSEnabled": false
2168
+ },
2169
+ "public.usage_patterns": {
2170
+ "name": "usage_patterns",
2171
+ "schema": "",
2172
+ "columns": {
2173
+ "id": {
2174
+ "name": "id",
2175
+ "type": "uuid",
2176
+ "primaryKey": true,
2177
+ "notNull": true,
2178
+ "default": "gen_random_uuid()"
2179
+ },
2180
+ "user_id": {
2181
+ "name": "user_id",
2182
+ "type": "uuid",
2183
+ "primaryKey": false,
2184
+ "notNull": true
2185
+ },
2186
+ "pattern_type": {
2187
+ "name": "pattern_type",
2188
+ "type": "text",
2189
+ "primaryKey": false,
2190
+ "notNull": true
2191
+ },
2192
+ "pattern_key": {
2193
+ "name": "pattern_key",
2194
+ "type": "text",
2195
+ "primaryKey": false,
2196
+ "notNull": true
2197
+ },
2198
+ "pattern_data": {
2199
+ "name": "pattern_data",
2200
+ "type": "jsonb",
2201
+ "primaryKey": false,
2202
+ "notNull": false
2203
+ },
2204
+ "confidence": {
2205
+ "name": "confidence",
2206
+ "type": "integer",
2207
+ "primaryKey": false,
2208
+ "notNull": false,
2209
+ "default": 0
2210
+ },
2211
+ "first_seen": {
2212
+ "name": "first_seen",
2213
+ "type": "timestamp",
2214
+ "primaryKey": false,
2215
+ "notNull": true,
2216
+ "default": "now()"
2217
+ },
2218
+ "last_seen": {
2219
+ "name": "last_seen",
2220
+ "type": "timestamp",
2221
+ "primaryKey": false,
2222
+ "notNull": false,
2223
+ "default": "now()"
2224
+ },
2225
+ "occurrences": {
2226
+ "name": "occurrences",
2227
+ "type": "integer",
2228
+ "primaryKey": false,
2229
+ "notNull": false,
2230
+ "default": 1
2231
+ }
2232
+ },
2233
+ "indexes": {
2234
+ "usage_patterns_user_idx": {
2235
+ "name": "usage_patterns_user_idx",
2236
+ "columns": [
2237
+ {
2238
+ "expression": "user_id",
2239
+ "isExpression": false,
2240
+ "asc": true,
2241
+ "nulls": "last"
2242
+ }
2243
+ ],
2244
+ "isUnique": false,
2245
+ "concurrently": false,
2246
+ "method": "btree",
2247
+ "with": {}
2248
+ },
2249
+ "usage_patterns_type_idx": {
2250
+ "name": "usage_patterns_type_idx",
2251
+ "columns": [
2252
+ {
2253
+ "expression": "pattern_type",
2254
+ "isExpression": false,
2255
+ "asc": true,
2256
+ "nulls": "last"
2257
+ }
2258
+ ],
2259
+ "isUnique": false,
2260
+ "concurrently": false,
2261
+ "method": "btree",
2262
+ "with": {}
2263
+ }
2264
+ },
2265
+ "foreignKeys": {
2266
+ "usage_patterns_user_id_users_id_fk": {
2267
+ "name": "usage_patterns_user_id_users_id_fk",
2268
+ "tableFrom": "usage_patterns",
2269
+ "tableTo": "users",
2270
+ "columnsFrom": [
2271
+ "user_id"
2272
+ ],
2273
+ "columnsTo": [
2274
+ "id"
2275
+ ],
2276
+ "onDelete": "no action",
2277
+ "onUpdate": "no action"
2278
+ }
2279
+ },
2280
+ "compositePrimaryKeys": {},
2281
+ "uniqueConstraints": {},
2282
+ "policies": {},
2283
+ "checkConstraints": {},
2284
+ "isRLSEnabled": false
2285
+ },
2286
+ "public.usage_quotas": {
2287
+ "name": "usage_quotas",
2288
+ "schema": "",
2289
+ "columns": {
2290
+ "id": {
2291
+ "name": "id",
2292
+ "type": "uuid",
2293
+ "primaryKey": true,
2294
+ "notNull": true,
2295
+ "default": "gen_random_uuid()"
2296
+ },
2297
+ "user_id": {
2298
+ "name": "user_id",
2299
+ "type": "uuid",
2300
+ "primaryKey": false,
2301
+ "notNull": false
2302
+ },
2303
+ "organization_id": {
2304
+ "name": "organization_id",
2305
+ "type": "uuid",
2306
+ "primaryKey": false,
2307
+ "notNull": false
2308
+ },
2309
+ "quota_type": {
2310
+ "name": "quota_type",
2311
+ "type": "text",
2312
+ "primaryKey": false,
2313
+ "notNull": true
2314
+ },
2315
+ "limit_value": {
2316
+ "name": "limit_value",
2317
+ "type": "integer",
2318
+ "primaryKey": false,
2319
+ "notNull": true
2320
+ },
2321
+ "current_value": {
2322
+ "name": "current_value",
2323
+ "type": "integer",
2324
+ "primaryKey": false,
2325
+ "notNull": false,
2326
+ "default": 0
2327
+ },
2328
+ "reset_at": {
2329
+ "name": "reset_at",
2330
+ "type": "timestamp",
2331
+ "primaryKey": false,
2332
+ "notNull": false
2333
+ },
2334
+ "updated_at": {
2335
+ "name": "updated_at",
2336
+ "type": "timestamp",
2337
+ "primaryKey": false,
2338
+ "notNull": false,
2339
+ "default": "now()"
2340
+ }
2341
+ },
2342
+ "indexes": {
2343
+ "usage_quotas_user_idx": {
2344
+ "name": "usage_quotas_user_idx",
2345
+ "columns": [
2346
+ {
2347
+ "expression": "user_id",
2348
+ "isExpression": false,
2349
+ "asc": true,
2350
+ "nulls": "last"
2351
+ }
2352
+ ],
2353
+ "isUnique": false,
2354
+ "concurrently": false,
2355
+ "method": "btree",
2356
+ "with": {}
2357
+ },
2358
+ "usage_quotas_org_idx": {
2359
+ "name": "usage_quotas_org_idx",
2360
+ "columns": [
2361
+ {
2362
+ "expression": "organization_id",
2363
+ "isExpression": false,
2364
+ "asc": true,
2365
+ "nulls": "last"
2366
+ }
2367
+ ],
2368
+ "isUnique": false,
2369
+ "concurrently": false,
2370
+ "method": "btree",
2371
+ "with": {}
2372
+ }
2373
+ },
2374
+ "foreignKeys": {
2375
+ "usage_quotas_user_id_users_id_fk": {
2376
+ "name": "usage_quotas_user_id_users_id_fk",
2377
+ "tableFrom": "usage_quotas",
2378
+ "tableTo": "users",
2379
+ "columnsFrom": [
2380
+ "user_id"
2381
+ ],
2382
+ "columnsTo": [
2383
+ "id"
2384
+ ],
2385
+ "onDelete": "no action",
2386
+ "onUpdate": "no action"
2387
+ },
2388
+ "usage_quotas_organization_id_organizations_id_fk": {
2389
+ "name": "usage_quotas_organization_id_organizations_id_fk",
2390
+ "tableFrom": "usage_quotas",
2391
+ "tableTo": "organizations",
2392
+ "columnsFrom": [
2393
+ "organization_id"
2394
+ ],
2395
+ "columnsTo": [
2396
+ "id"
2397
+ ],
2398
+ "onDelete": "no action",
2399
+ "onUpdate": "no action"
2400
+ }
2401
+ },
2402
+ "compositePrimaryKeys": {},
2403
+ "uniqueConstraints": {},
2404
+ "policies": {},
2405
+ "checkConstraints": {},
2406
+ "isRLSEnabled": false
2407
+ },
2408
+ "public.user_achievements": {
2409
+ "name": "user_achievements",
2410
+ "schema": "",
2411
+ "columns": {
2412
+ "id": {
2413
+ "name": "id",
2414
+ "type": "uuid",
2415
+ "primaryKey": true,
2416
+ "notNull": true,
2417
+ "default": "gen_random_uuid()"
2418
+ },
2419
+ "user_id": {
2420
+ "name": "user_id",
2421
+ "type": "uuid",
2422
+ "primaryKey": false,
2423
+ "notNull": true
2424
+ },
2425
+ "achievement_id": {
2426
+ "name": "achievement_id",
2427
+ "type": "uuid",
2428
+ "primaryKey": false,
2429
+ "notNull": true
2430
+ },
2431
+ "unlocked_at": {
2432
+ "name": "unlocked_at",
2433
+ "type": "timestamp",
2434
+ "primaryKey": false,
2435
+ "notNull": true,
2436
+ "default": "now()"
2437
+ },
2438
+ "progress": {
2439
+ "name": "progress",
2440
+ "type": "integer",
2441
+ "primaryKey": false,
2442
+ "notNull": false,
2443
+ "default": 100
2444
+ },
2445
+ "notified": {
2446
+ "name": "notified",
2447
+ "type": "boolean",
2448
+ "primaryKey": false,
2449
+ "notNull": false,
2450
+ "default": false
2451
+ }
2452
+ },
2453
+ "indexes": {
2454
+ "user_achievements_user_idx": {
2455
+ "name": "user_achievements_user_idx",
2456
+ "columns": [
2457
+ {
2458
+ "expression": "user_id",
2459
+ "isExpression": false,
2460
+ "asc": true,
2461
+ "nulls": "last"
2462
+ }
2463
+ ],
2464
+ "isUnique": false,
2465
+ "concurrently": false,
2466
+ "method": "btree",
2467
+ "with": {}
2468
+ }
2469
+ },
2470
+ "foreignKeys": {
2471
+ "user_achievements_user_id_users_id_fk": {
2472
+ "name": "user_achievements_user_id_users_id_fk",
2473
+ "tableFrom": "user_achievements",
2474
+ "tableTo": "users",
2475
+ "columnsFrom": [
2476
+ "user_id"
2477
+ ],
2478
+ "columnsTo": [
2479
+ "id"
2480
+ ],
2481
+ "onDelete": "no action",
2482
+ "onUpdate": "no action"
2483
+ },
2484
+ "user_achievements_achievement_id_achievements_id_fk": {
2485
+ "name": "user_achievements_achievement_id_achievements_id_fk",
2486
+ "tableFrom": "user_achievements",
2487
+ "tableTo": "achievements",
2488
+ "columnsFrom": [
2489
+ "achievement_id"
2490
+ ],
2491
+ "columnsTo": [
2492
+ "id"
2493
+ ],
2494
+ "onDelete": "no action",
2495
+ "onUpdate": "no action"
2496
+ }
2497
+ },
2498
+ "compositePrimaryKeys": {},
2499
+ "uniqueConstraints": {},
2500
+ "policies": {},
2501
+ "checkConstraints": {},
2502
+ "isRLSEnabled": false
2503
+ },
2504
+ "public.users": {
2505
+ "name": "users",
2506
+ "schema": "",
2507
+ "columns": {
2508
+ "id": {
2509
+ "name": "id",
2510
+ "type": "uuid",
2511
+ "primaryKey": true,
2512
+ "notNull": true,
2513
+ "default": "gen_random_uuid()"
2514
+ },
2515
+ "telegram_id": {
2516
+ "name": "telegram_id",
2517
+ "type": "text",
2518
+ "primaryKey": false,
2519
+ "notNull": false
2520
+ },
2521
+ "name": {
2522
+ "name": "name",
2523
+ "type": "text",
2524
+ "primaryKey": false,
2525
+ "notNull": false
2526
+ },
2527
+ "preferences": {
2528
+ "name": "preferences",
2529
+ "type": "jsonb",
2530
+ "primaryKey": false,
2531
+ "notNull": false
2532
+ },
2533
+ "created_at": {
2534
+ "name": "created_at",
2535
+ "type": "timestamp",
2536
+ "primaryKey": false,
2537
+ "notNull": true,
2538
+ "default": "now()"
2539
+ },
2540
+ "updated_at": {
2541
+ "name": "updated_at",
2542
+ "type": "timestamp",
2543
+ "primaryKey": false,
2544
+ "notNull": true,
2545
+ "default": "now()"
2546
+ }
2547
+ },
2548
+ "indexes": {},
2549
+ "foreignKeys": {},
2550
+ "compositePrimaryKeys": {},
2551
+ "uniqueConstraints": {
2552
+ "users_telegram_id_unique": {
2553
+ "name": "users_telegram_id_unique",
2554
+ "nullsNotDistinct": false,
2555
+ "columns": [
2556
+ "telegram_id"
2557
+ ]
2558
+ }
2559
+ },
2560
+ "policies": {},
2561
+ "checkConstraints": {},
2562
+ "isRLSEnabled": false
2563
+ }
2564
+ },
2565
+ "enums": {},
2566
+ "schemas": {},
2567
+ "sequences": {},
2568
+ "roles": {},
2569
+ "policies": {},
2570
+ "views": {},
2571
+ "_meta": {
2572
+ "columns": {},
2573
+ "schemas": {},
2574
+ "tables": {}
2575
+ }
2576
+ }