opensentinel 3.6.1 → 3.7.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 (197) hide show
  1. package/README.md +12 -0
  2. package/dist/{agent-manager-7N7REQZQ.js → agent-manager-JZ4IM7XI.js} +8 -8
  3. package/dist/{agent-processor-I23VWQY3.js → agent-processor-DDDHC2SO.js} +22 -21
  4. package/dist/{agent-processor-I23VWQY3.js.map → agent-processor-DDDHC2SO.js.map} +1 -1
  5. package/dist/{alerting-4I37GG4U.js → alerting-LK7VVYTX.js} +4 -4
  6. package/dist/alerting-LK7VVYTX.js.map +1 -0
  7. package/dist/analyzer-OTWE3ARE.js +22 -0
  8. package/dist/{archiver-XLRIIXPY.js → archiver-FPGKRP6P.js} +16 -85
  9. package/dist/archiver-FPGKRP6P.js.map +1 -0
  10. package/dist/{audit-logger-AU3TMWKI.js → audit-logger-CI4WZQPD.js} +5 -5
  11. package/dist/bot-VDHBGUVI.js +47 -0
  12. package/dist/{brain-SLA474EU.js → brain-6QTXN4QP.js} +18 -17
  13. package/dist/{chunk-AR34B6XR.js → chunk-2I5QHYG6.js} +3 -3
  14. package/dist/chunk-2I5QHYG6.js.map +1 -0
  15. package/dist/chunk-3AWAWRWB.js +143 -0
  16. package/dist/chunk-3AWAWRWB.js.map +1 -0
  17. package/dist/{chunk-PUNIMPMY.js → chunk-4KIHDIXZ.js} +13 -2
  18. package/dist/chunk-4KIHDIXZ.js.map +1 -0
  19. package/dist/{chunk-GUKKW7JI.js → chunk-4WH6MFEW.js} +2 -2
  20. package/dist/chunk-4WH6MFEW.js.map +1 -0
  21. package/dist/{chunk-M7YLQHFP.js → chunk-56UJS2LA.js} +6 -6
  22. package/dist/{chunk-S4NJJS5C.js → chunk-5BTVJR7R.js} +3 -3
  23. package/dist/{chunk-HKOPRRDJ.js → chunk-5JJTLWOR.js} +3 -3
  24. package/dist/chunk-5JJTLWOR.js.map +1 -0
  25. package/dist/chunk-66SAOZPU.js +236 -0
  26. package/dist/chunk-66SAOZPU.js.map +1 -0
  27. package/dist/chunk-6HGMRR4J.js +113 -0
  28. package/dist/chunk-6HGMRR4J.js.map +1 -0
  29. package/dist/{chunk-BMOUYXLX.js → chunk-6ZNCY2GI.js} +5 -5
  30. package/dist/chunk-7BNFELEK.js +31 -0
  31. package/dist/chunk-7BNFELEK.js.map +1 -0
  32. package/dist/{chunk-KABG5PG3.js → chunk-BBN4VCNK.js} +4 -4
  33. package/dist/chunk-BBN4VCNK.js.map +1 -0
  34. package/dist/{chunk-4YJRBMMA.js → chunk-BNZHWAZC.js} +2 -2
  35. package/dist/{chunk-TAAZB5KN.js → chunk-CWT6CAE5.js} +2 -2
  36. package/dist/{chunk-UWUIJTT4.js → chunk-CZTMGHUC.js} +1 -1
  37. package/dist/chunk-CZTMGHUC.js.map +1 -0
  38. package/dist/chunk-DTISLIMB.js +89 -0
  39. package/dist/chunk-DTISLIMB.js.map +1 -0
  40. package/dist/{chunk-VKMFUIVA.js → chunk-GBVJTRXS.js} +2 -2
  41. package/dist/{chunk-MFK34XSY.js → chunk-GJETKBOY.js} +15 -15
  42. package/dist/chunk-GJETKBOY.js.map +1 -0
  43. package/dist/{chunk-HTF2GIQC.js → chunk-GW6V4D43.js} +2 -2
  44. package/dist/chunk-GW6V4D43.js.map +1 -0
  45. package/dist/{chunk-2RGPWU77.js → chunk-HJSEEFO3.js} +2 -2
  46. package/dist/{chunk-JOA5A3G3.js → chunk-HQZQFEAX.js} +5 -5
  47. package/dist/{chunk-45YXODSB.js → chunk-J4JW73TT.js} +2 -2
  48. package/dist/{chunk-KT7NLIXP.js → chunk-JHYYFPKX.js} +2 -2
  49. package/dist/{chunk-XMCVRVTF.js → chunk-P64EV4YY.js} +1 -1
  50. package/dist/chunk-P64EV4YY.js.map +1 -0
  51. package/dist/chunk-PBOCSGNL.js +84 -0
  52. package/dist/chunk-PBOCSGNL.js.map +1 -0
  53. package/dist/{chunk-H3BOLSTS.js → chunk-PD3CTDO6.js} +2 -2
  54. package/dist/{chunk-6UZPE35A.js → chunk-QPY3WRVM.js} +10 -87
  55. package/dist/chunk-QPY3WRVM.js.map +1 -0
  56. package/dist/{chunk-AD6YEH6U.js → chunk-S2EOIVF4.js} +590 -91
  57. package/dist/chunk-S2EOIVF4.js.map +1 -0
  58. package/dist/chunk-SDLOMKCW.js +213 -0
  59. package/dist/chunk-SDLOMKCW.js.map +1 -0
  60. package/dist/{chunk-7MZN73J2.js → chunk-TKBVW7ZJ.js} +4 -4
  61. package/dist/{chunk-A24GPVLY.js → chunk-V3OKHQUX.js} +5 -5
  62. package/dist/{chunk-NMSHVO5O.js → chunk-WMDVOWN6.js} +4 -4
  63. package/dist/{chunk-643M3AP5.js → chunk-WMFYI7XC.js} +7 -7
  64. package/dist/{chunk-6LTLIYAQ.js → chunk-YEDEAX6Y.js} +3 -3
  65. package/dist/{chunk-NYVBXUGD.js → chunk-ZIBRVA3Y.js} +60 -1
  66. package/dist/chunk-ZIBRVA3Y.js.map +1 -0
  67. package/dist/{chunk-6JY4HNUH.js → chunk-ZMML6T63.js} +361 -24
  68. package/dist/chunk-ZMML6T63.js.map +1 -0
  69. package/dist/{chunk-FFV2SXFD.js → chunk-ZVHG4KF2.js} +4 -4
  70. package/dist/cli.js.map +1 -1
  71. package/dist/commands/setup.js +1 -1
  72. package/dist/commands/start.js +2 -2
  73. package/dist/commands/status.js +1 -1
  74. package/dist/commands/stop.js +1 -1
  75. package/dist/commands/utils.js +1 -1
  76. package/dist/{cost-tracker-EMOIOYH7.js → cost-tracker-KZQSTSE2.js} +2 -2
  77. package/dist/{db-LRIOKQBO.js → db-I7MNG6CL.js} +10 -4
  78. package/dist/{discord-NKR3X4AV.js → discord-6UQHCN27.js} +24 -23
  79. package/dist/{documents-EYIYLZK2.js → documents-PFHSK7SZ.js} +19 -19
  80. package/dist/{email-EAQNULVD.js → email-6OIN4SYL.js} +22 -21
  81. package/dist/email-6OIN4SYL.js.map +1 -0
  82. package/dist/{enhanced-retrieval-OGHT6TS5.js → enhanced-retrieval-JWX2HWU4.js} +7 -6
  83. package/dist/{enhanced-retrieval-OGHT6TS5.js.map → enhanced-retrieval-JWX2HWU4.js.map} +1 -1
  84. package/dist/enrichment-pipeline-7FE5R5ZI.js +14 -0
  85. package/dist/{entity-resolution-4X4JU43O.js → entity-resolution-7Z6STVXX.js} +5 -5
  86. package/dist/{env-CHOFICED.js → env-GN5VHI43.js} +2 -2
  87. package/dist/{error-tracker-SVQSDQDW.js → error-tracker-64DEH3D7.js} +6 -6
  88. package/dist/{github-KGNILDWJ.js → github-DUWSXCNP.js} +4 -4
  89. package/dist/graph-client-NB475AK5.js +17 -0
  90. package/dist/{imessage-V2XNDDHT.js → imessage-DSGSGUZS.js} +19 -18
  91. package/dist/{inbox-summarizer-DKKRYXDR.js → inbox-summarizer-F2KAU72V.js} +19 -18
  92. package/dist/{incident-response-ZTIKUWEO.js → incident-response-E3UGMX5G.js} +5 -5
  93. package/dist/incident-response-E3UGMX5G.js.map +1 -0
  94. package/dist/{knowledge-base-J7PJ7MZ3.js → knowledge-base-5SMMOGQJ.js} +5 -5
  95. package/dist/lib.d.ts +21 -0
  96. package/dist/lib.js +64 -57
  97. package/dist/lib.js.map +1 -1
  98. package/dist/{matrix-XHTR53VQ.js → matrix-WYGEOZL5.js} +18 -17
  99. package/dist/{matrix-XHTR53VQ.js.map → matrix-WYGEOZL5.js.map} +1 -1
  100. package/dist/{mcp-3C2TN67D.js → mcp-DJ2QDA6A.js} +2 -2
  101. package/dist/{metrics-VJDWQWU7.js → metrics-BH3ZLGEV.js} +5 -5
  102. package/dist/{multi-user-S56GUD6L.js → multi-user-XAEMB244.js} +4 -4
  103. package/dist/oauth-UPJYFOVU.js +34 -0
  104. package/dist/{ocr-LGUIPKVZ.js → ocr-UONKTQU7.js} +4 -4
  105. package/dist/{presentations-HXTAMGHT.js → presentations-UOET2FVZ.js} +2 -2
  106. package/dist/{providers-H6YIC3MG.js → providers-2YQ6E3IF.js} +3 -3
  107. package/dist/{scheduler-CA5UNHZV.js → scheduler-6PLLAQI7.js} +21 -20
  108. package/dist/{schema-ALJ67YVG.js → schema-ETY7L2VA.js} +8 -2
  109. package/dist/sharepoint-V5P4Q62L.js +30 -0
  110. package/dist/{signal-X7IQJGRQ.js → signal-7D5EPGVL.js} +19 -18
  111. package/dist/{slack-P2LFUJUQ.js → slack-KSS6YK5Z.js} +23 -22
  112. package/dist/slack-KSS6YK5Z.js.map +1 -0
  113. package/dist/{sms-4VME2HUL.js → sms-CSUCC7HL.js} +3 -3
  114. package/dist/sms-CSUCC7HL.js.map +1 -0
  115. package/dist/{src-S5KX4YEV.js → src-GO7GGW7O.js} +48 -41
  116. package/dist/{src-S5KX4YEV.js.map → src-GO7GGW7O.js.map} +1 -1
  117. package/dist/token-store-SEWRX6RE.js +20 -0
  118. package/dist/token-store-SEWRX6RE.js.map +1 -0
  119. package/dist/{tools-FGPN522P.js → tools-PJZ6RI4P.js} +18 -17
  120. package/dist/tools-PJZ6RI4P.js.map +1 -0
  121. package/dist/{whatsapp-KRPQ4YUX.js → whatsapp-DWXK25V2.js} +19 -18
  122. package/dist/whatsapp-DWXK25V2.js.map +1 -0
  123. package/dist/{word-document-D6N2C47N.js → word-document-AV3YB4L2.js} +2 -2
  124. package/dist/{workflow-store-ZYAYE5P6.js → workflow-store-5Y56GUP7.js} +4 -4
  125. package/drizzle/0002_mushy_master_mold.sql +139 -139
  126. package/drizzle/0003_overjoyed_rhodey.sql +46 -0
  127. package/drizzle/meta/0002_snapshot.json +3636 -3636
  128. package/drizzle/meta/0003_snapshot.json +3946 -0
  129. package/drizzle/meta/_journal.json +7 -0
  130. package/package.json +110 -110
  131. package/dist/alerting-4I37GG4U.js.map +0 -1
  132. package/dist/archiver-XLRIIXPY.js.map +0 -1
  133. package/dist/bot-MU2TJQ3Y.js +0 -46
  134. package/dist/chunk-6JY4HNUH.js.map +0 -1
  135. package/dist/chunk-6UZPE35A.js.map +0 -1
  136. package/dist/chunk-AD6YEH6U.js.map +0 -1
  137. package/dist/chunk-AR34B6XR.js.map +0 -1
  138. package/dist/chunk-GUKKW7JI.js.map +0 -1
  139. package/dist/chunk-HKOPRRDJ.js.map +0 -1
  140. package/dist/chunk-HTF2GIQC.js.map +0 -1
  141. package/dist/chunk-KABG5PG3.js.map +0 -1
  142. package/dist/chunk-MFK34XSY.js.map +0 -1
  143. package/dist/chunk-NYVBXUGD.js.map +0 -1
  144. package/dist/chunk-PUNIMPMY.js.map +0 -1
  145. package/dist/chunk-UWUIJTT4.js.map +0 -1
  146. package/dist/chunk-XMCVRVTF.js.map +0 -1
  147. package/dist/email-EAQNULVD.js.map +0 -1
  148. package/dist/enrichment-pipeline-CMUVBDC7.js +0 -14
  149. package/dist/incident-response-ZTIKUWEO.js.map +0 -1
  150. /package/dist/{agent-manager-7N7REQZQ.js.map → agent-manager-JZ4IM7XI.js.map} +0 -0
  151. /package/dist/{audit-logger-AU3TMWKI.js.map → analyzer-OTWE3ARE.js.map} +0 -0
  152. /package/dist/{bot-MU2TJQ3Y.js.map → audit-logger-CI4WZQPD.js.map} +0 -0
  153. /package/dist/{brain-SLA474EU.js.map → bot-VDHBGUVI.js.map} +0 -0
  154. /package/dist/{cost-tracker-EMOIOYH7.js.map → brain-6QTXN4QP.js.map} +0 -0
  155. /package/dist/{chunk-M7YLQHFP.js.map → chunk-56UJS2LA.js.map} +0 -0
  156. /package/dist/{chunk-S4NJJS5C.js.map → chunk-5BTVJR7R.js.map} +0 -0
  157. /package/dist/{chunk-BMOUYXLX.js.map → chunk-6ZNCY2GI.js.map} +0 -0
  158. /package/dist/{chunk-4YJRBMMA.js.map → chunk-BNZHWAZC.js.map} +0 -0
  159. /package/dist/{chunk-TAAZB5KN.js.map → chunk-CWT6CAE5.js.map} +0 -0
  160. /package/dist/{chunk-VKMFUIVA.js.map → chunk-GBVJTRXS.js.map} +0 -0
  161. /package/dist/{chunk-2RGPWU77.js.map → chunk-HJSEEFO3.js.map} +0 -0
  162. /package/dist/{chunk-JOA5A3G3.js.map → chunk-HQZQFEAX.js.map} +0 -0
  163. /package/dist/{chunk-45YXODSB.js.map → chunk-J4JW73TT.js.map} +0 -0
  164. /package/dist/{chunk-KT7NLIXP.js.map → chunk-JHYYFPKX.js.map} +0 -0
  165. /package/dist/{chunk-H3BOLSTS.js.map → chunk-PD3CTDO6.js.map} +0 -0
  166. /package/dist/{chunk-7MZN73J2.js.map → chunk-TKBVW7ZJ.js.map} +0 -0
  167. /package/dist/{chunk-A24GPVLY.js.map → chunk-V3OKHQUX.js.map} +0 -0
  168. /package/dist/{chunk-NMSHVO5O.js.map → chunk-WMDVOWN6.js.map} +0 -0
  169. /package/dist/{chunk-643M3AP5.js.map → chunk-WMFYI7XC.js.map} +0 -0
  170. /package/dist/{chunk-6LTLIYAQ.js.map → chunk-YEDEAX6Y.js.map} +0 -0
  171. /package/dist/{chunk-FFV2SXFD.js.map → chunk-ZVHG4KF2.js.map} +0 -0
  172. /package/dist/{db-LRIOKQBO.js.map → cost-tracker-KZQSTSE2.js.map} +0 -0
  173. /package/dist/{discord-NKR3X4AV.js.map → db-I7MNG6CL.js.map} +0 -0
  174. /package/dist/{enrichment-pipeline-CMUVBDC7.js.map → discord-6UQHCN27.js.map} +0 -0
  175. /package/dist/{documents-EYIYLZK2.js.map → documents-PFHSK7SZ.js.map} +0 -0
  176. /package/dist/{entity-resolution-4X4JU43O.js.map → enrichment-pipeline-7FE5R5ZI.js.map} +0 -0
  177. /package/dist/{env-CHOFICED.js.map → entity-resolution-7Z6STVXX.js.map} +0 -0
  178. /package/dist/{error-tracker-SVQSDQDW.js.map → env-GN5VHI43.js.map} +0 -0
  179. /package/dist/{imessage-V2XNDDHT.js.map → error-tracker-64DEH3D7.js.map} +0 -0
  180. /package/dist/{github-KGNILDWJ.js.map → github-DUWSXCNP.js.map} +0 -0
  181. /package/dist/{inbox-summarizer-DKKRYXDR.js.map → graph-client-NB475AK5.js.map} +0 -0
  182. /package/dist/{knowledge-base-J7PJ7MZ3.js.map → imessage-DSGSGUZS.js.map} +0 -0
  183. /package/dist/{mcp-3C2TN67D.js.map → inbox-summarizer-F2KAU72V.js.map} +0 -0
  184. /package/dist/{metrics-VJDWQWU7.js.map → knowledge-base-5SMMOGQJ.js.map} +0 -0
  185. /package/dist/{ocr-LGUIPKVZ.js.map → mcp-DJ2QDA6A.js.map} +0 -0
  186. /package/dist/{providers-H6YIC3MG.js.map → metrics-BH3ZLGEV.js.map} +0 -0
  187. /package/dist/{multi-user-S56GUD6L.js.map → multi-user-XAEMB244.js.map} +0 -0
  188. /package/dist/{scheduler-CA5UNHZV.js.map → oauth-UPJYFOVU.js.map} +0 -0
  189. /package/dist/{schema-ALJ67YVG.js.map → ocr-UONKTQU7.js.map} +0 -0
  190. /package/dist/{presentations-HXTAMGHT.js.map → presentations-UOET2FVZ.js.map} +0 -0
  191. /package/dist/{signal-X7IQJGRQ.js.map → providers-2YQ6E3IF.js.map} +0 -0
  192. /package/dist/{slack-P2LFUJUQ.js.map → scheduler-6PLLAQI7.js.map} +0 -0
  193. /package/dist/{sms-4VME2HUL.js.map → schema-ETY7L2VA.js.map} +0 -0
  194. /package/dist/{tools-FGPN522P.js.map → sharepoint-V5P4Q62L.js.map} +0 -0
  195. /package/dist/{whatsapp-KRPQ4YUX.js.map → signal-7D5EPGVL.js.map} +0 -0
  196. /package/dist/{word-document-D6N2C47N.js.map → word-document-AV3YB4L2.js.map} +0 -0
  197. /package/dist/{workflow-store-ZYAYE5P6.js.map → workflow-store-5Y56GUP7.js.map} +0 -0
@@ -0,0 +1,3946 @@
1
+ {
2
+ "id": "dee9604c-bc17-458e-a47e-212a965c7993",
3
+ "prevId": "d823a6f9-f08e-4e90-a0d1-96a148219691",
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
+ "sequence_number": {
525
+ "name": "sequence_number",
526
+ "type": "integer",
527
+ "primaryKey": false,
528
+ "notNull": false
529
+ },
530
+ "entry_hash": {
531
+ "name": "entry_hash",
532
+ "type": "text",
533
+ "primaryKey": false,
534
+ "notNull": false
535
+ },
536
+ "previous_hash": {
537
+ "name": "previous_hash",
538
+ "type": "text",
539
+ "primaryKey": false,
540
+ "notNull": false
541
+ }
542
+ },
543
+ "indexes": {
544
+ "audit_logs_user_idx": {
545
+ "name": "audit_logs_user_idx",
546
+ "columns": [
547
+ {
548
+ "expression": "user_id",
549
+ "isExpression": false,
550
+ "asc": true,
551
+ "nulls": "last"
552
+ }
553
+ ],
554
+ "isUnique": false,
555
+ "concurrently": false,
556
+ "method": "btree",
557
+ "with": {}
558
+ },
559
+ "audit_logs_action_idx": {
560
+ "name": "audit_logs_action_idx",
561
+ "columns": [
562
+ {
563
+ "expression": "action",
564
+ "isExpression": false,
565
+ "asc": true,
566
+ "nulls": "last"
567
+ }
568
+ ],
569
+ "isUnique": false,
570
+ "concurrently": false,
571
+ "method": "btree",
572
+ "with": {}
573
+ },
574
+ "audit_logs_created_idx": {
575
+ "name": "audit_logs_created_idx",
576
+ "columns": [
577
+ {
578
+ "expression": "created_at",
579
+ "isExpression": false,
580
+ "asc": true,
581
+ "nulls": "last"
582
+ }
583
+ ],
584
+ "isUnique": false,
585
+ "concurrently": false,
586
+ "method": "btree",
587
+ "with": {}
588
+ },
589
+ "audit_logs_sequence_idx": {
590
+ "name": "audit_logs_sequence_idx",
591
+ "columns": [
592
+ {
593
+ "expression": "sequence_number",
594
+ "isExpression": false,
595
+ "asc": true,
596
+ "nulls": "last"
597
+ }
598
+ ],
599
+ "isUnique": false,
600
+ "concurrently": false,
601
+ "method": "btree",
602
+ "with": {}
603
+ }
604
+ },
605
+ "foreignKeys": {
606
+ "audit_logs_user_id_users_id_fk": {
607
+ "name": "audit_logs_user_id_users_id_fk",
608
+ "tableFrom": "audit_logs",
609
+ "tableTo": "users",
610
+ "columnsFrom": [
611
+ "user_id"
612
+ ],
613
+ "columnsTo": [
614
+ "id"
615
+ ],
616
+ "onDelete": "no action",
617
+ "onUpdate": "no action"
618
+ },
619
+ "audit_logs_session_id_sessions_id_fk": {
620
+ "name": "audit_logs_session_id_sessions_id_fk",
621
+ "tableFrom": "audit_logs",
622
+ "tableTo": "sessions",
623
+ "columnsFrom": [
624
+ "session_id"
625
+ ],
626
+ "columnsTo": [
627
+ "id"
628
+ ],
629
+ "onDelete": "no action",
630
+ "onUpdate": "no action"
631
+ }
632
+ },
633
+ "compositePrimaryKeys": {},
634
+ "uniqueConstraints": {},
635
+ "policies": {},
636
+ "checkConstraints": {},
637
+ "isRLSEnabled": false
638
+ },
639
+ "public.calendar_triggers": {
640
+ "name": "calendar_triggers",
641
+ "schema": "",
642
+ "columns": {
643
+ "id": {
644
+ "name": "id",
645
+ "type": "uuid",
646
+ "primaryKey": true,
647
+ "notNull": true,
648
+ "default": "gen_random_uuid()"
649
+ },
650
+ "user_id": {
651
+ "name": "user_id",
652
+ "type": "uuid",
653
+ "primaryKey": false,
654
+ "notNull": true
655
+ },
656
+ "name": {
657
+ "name": "name",
658
+ "type": "text",
659
+ "primaryKey": false,
660
+ "notNull": true
661
+ },
662
+ "calendar_source": {
663
+ "name": "calendar_source",
664
+ "type": "text",
665
+ "primaryKey": false,
666
+ "notNull": true
667
+ },
668
+ "calendar_id": {
669
+ "name": "calendar_id",
670
+ "type": "text",
671
+ "primaryKey": false,
672
+ "notNull": false
673
+ },
674
+ "trigger_type": {
675
+ "name": "trigger_type",
676
+ "type": "text",
677
+ "primaryKey": false,
678
+ "notNull": true
679
+ },
680
+ "offset_minutes": {
681
+ "name": "offset_minutes",
682
+ "type": "integer",
683
+ "primaryKey": false,
684
+ "notNull": false,
685
+ "default": 0
686
+ },
687
+ "action": {
688
+ "name": "action",
689
+ "type": "jsonb",
690
+ "primaryKey": false,
691
+ "notNull": false
692
+ },
693
+ "enabled": {
694
+ "name": "enabled",
695
+ "type": "boolean",
696
+ "primaryKey": false,
697
+ "notNull": false,
698
+ "default": true
699
+ },
700
+ "last_triggered": {
701
+ "name": "last_triggered",
702
+ "type": "timestamp",
703
+ "primaryKey": false,
704
+ "notNull": false
705
+ },
706
+ "created_at": {
707
+ "name": "created_at",
708
+ "type": "timestamp",
709
+ "primaryKey": false,
710
+ "notNull": true,
711
+ "default": "now()"
712
+ }
713
+ },
714
+ "indexes": {
715
+ "calendar_triggers_user_idx": {
716
+ "name": "calendar_triggers_user_idx",
717
+ "columns": [
718
+ {
719
+ "expression": "user_id",
720
+ "isExpression": false,
721
+ "asc": true,
722
+ "nulls": "last"
723
+ }
724
+ ],
725
+ "isUnique": false,
726
+ "concurrently": false,
727
+ "method": "btree",
728
+ "with": {}
729
+ }
730
+ },
731
+ "foreignKeys": {
732
+ "calendar_triggers_user_id_users_id_fk": {
733
+ "name": "calendar_triggers_user_id_users_id_fk",
734
+ "tableFrom": "calendar_triggers",
735
+ "tableTo": "users",
736
+ "columnsFrom": [
737
+ "user_id"
738
+ ],
739
+ "columnsTo": [
740
+ "id"
741
+ ],
742
+ "onDelete": "no action",
743
+ "onUpdate": "no action"
744
+ }
745
+ },
746
+ "compositePrimaryKeys": {},
747
+ "uniqueConstraints": {},
748
+ "policies": {},
749
+ "checkConstraints": {},
750
+ "isRLSEnabled": false
751
+ },
752
+ "public.conversations": {
753
+ "name": "conversations",
754
+ "schema": "",
755
+ "columns": {
756
+ "id": {
757
+ "name": "id",
758
+ "type": "uuid",
759
+ "primaryKey": true,
760
+ "notNull": true,
761
+ "default": "gen_random_uuid()"
762
+ },
763
+ "user_id": {
764
+ "name": "user_id",
765
+ "type": "uuid",
766
+ "primaryKey": false,
767
+ "notNull": false
768
+ },
769
+ "title": {
770
+ "name": "title",
771
+ "type": "text",
772
+ "primaryKey": false,
773
+ "notNull": false
774
+ },
775
+ "source": {
776
+ "name": "source",
777
+ "type": "text",
778
+ "primaryKey": false,
779
+ "notNull": true,
780
+ "default": "'telegram'"
781
+ },
782
+ "metadata": {
783
+ "name": "metadata",
784
+ "type": "jsonb",
785
+ "primaryKey": false,
786
+ "notNull": false
787
+ },
788
+ "created_at": {
789
+ "name": "created_at",
790
+ "type": "timestamp",
791
+ "primaryKey": false,
792
+ "notNull": true,
793
+ "default": "now()"
794
+ },
795
+ "updated_at": {
796
+ "name": "updated_at",
797
+ "type": "timestamp",
798
+ "primaryKey": false,
799
+ "notNull": true,
800
+ "default": "now()"
801
+ }
802
+ },
803
+ "indexes": {},
804
+ "foreignKeys": {
805
+ "conversations_user_id_users_id_fk": {
806
+ "name": "conversations_user_id_users_id_fk",
807
+ "tableFrom": "conversations",
808
+ "tableTo": "users",
809
+ "columnsFrom": [
810
+ "user_id"
811
+ ],
812
+ "columnsTo": [
813
+ "id"
814
+ ],
815
+ "onDelete": "no action",
816
+ "onUpdate": "no action"
817
+ }
818
+ },
819
+ "compositePrimaryKeys": {},
820
+ "uniqueConstraints": {},
821
+ "policies": {},
822
+ "checkConstraints": {},
823
+ "isRLSEnabled": false
824
+ },
825
+ "public.document_chunks": {
826
+ "name": "document_chunks",
827
+ "schema": "",
828
+ "columns": {
829
+ "id": {
830
+ "name": "id",
831
+ "type": "uuid",
832
+ "primaryKey": true,
833
+ "notNull": true,
834
+ "default": "gen_random_uuid()"
835
+ },
836
+ "document_id": {
837
+ "name": "document_id",
838
+ "type": "uuid",
839
+ "primaryKey": false,
840
+ "notNull": true
841
+ },
842
+ "chunk_index": {
843
+ "name": "chunk_index",
844
+ "type": "integer",
845
+ "primaryKey": false,
846
+ "notNull": true
847
+ },
848
+ "content": {
849
+ "name": "content",
850
+ "type": "text",
851
+ "primaryKey": false,
852
+ "notNull": true
853
+ },
854
+ "embedding": {
855
+ "name": "embedding",
856
+ "type": "vector(1536)",
857
+ "primaryKey": false,
858
+ "notNull": false
859
+ },
860
+ "token_count": {
861
+ "name": "token_count",
862
+ "type": "integer",
863
+ "primaryKey": false,
864
+ "notNull": false
865
+ },
866
+ "metadata": {
867
+ "name": "metadata",
868
+ "type": "jsonb",
869
+ "primaryKey": false,
870
+ "notNull": false
871
+ },
872
+ "created_at": {
873
+ "name": "created_at",
874
+ "type": "timestamp",
875
+ "primaryKey": false,
876
+ "notNull": true,
877
+ "default": "now()"
878
+ }
879
+ },
880
+ "indexes": {
881
+ "document_chunks_document_idx": {
882
+ "name": "document_chunks_document_idx",
883
+ "columns": [
884
+ {
885
+ "expression": "document_id",
886
+ "isExpression": false,
887
+ "asc": true,
888
+ "nulls": "last"
889
+ }
890
+ ],
891
+ "isUnique": false,
892
+ "concurrently": false,
893
+ "method": "btree",
894
+ "with": {}
895
+ }
896
+ },
897
+ "foreignKeys": {
898
+ "document_chunks_document_id_documents_id_fk": {
899
+ "name": "document_chunks_document_id_documents_id_fk",
900
+ "tableFrom": "document_chunks",
901
+ "tableTo": "documents",
902
+ "columnsFrom": [
903
+ "document_id"
904
+ ],
905
+ "columnsTo": [
906
+ "id"
907
+ ],
908
+ "onDelete": "cascade",
909
+ "onUpdate": "no action"
910
+ }
911
+ },
912
+ "compositePrimaryKeys": {},
913
+ "uniqueConstraints": {},
914
+ "policies": {},
915
+ "checkConstraints": {},
916
+ "isRLSEnabled": false
917
+ },
918
+ "public.documents": {
919
+ "name": "documents",
920
+ "schema": "",
921
+ "columns": {
922
+ "id": {
923
+ "name": "id",
924
+ "type": "uuid",
925
+ "primaryKey": true,
926
+ "notNull": true,
927
+ "default": "gen_random_uuid()"
928
+ },
929
+ "name": {
930
+ "name": "name",
931
+ "type": "text",
932
+ "primaryKey": false,
933
+ "notNull": true
934
+ },
935
+ "filename": {
936
+ "name": "filename",
937
+ "type": "text",
938
+ "primaryKey": false,
939
+ "notNull": false
940
+ },
941
+ "mime_type": {
942
+ "name": "mime_type",
943
+ "type": "text",
944
+ "primaryKey": false,
945
+ "notNull": false
946
+ },
947
+ "file_size": {
948
+ "name": "file_size",
949
+ "type": "integer",
950
+ "primaryKey": false,
951
+ "notNull": false
952
+ },
953
+ "source": {
954
+ "name": "source",
955
+ "type": "text",
956
+ "primaryKey": false,
957
+ "notNull": false
958
+ },
959
+ "source_url": {
960
+ "name": "source_url",
961
+ "type": "text",
962
+ "primaryKey": false,
963
+ "notNull": false
964
+ },
965
+ "metadata": {
966
+ "name": "metadata",
967
+ "type": "jsonb",
968
+ "primaryKey": false,
969
+ "notNull": false
970
+ },
971
+ "status": {
972
+ "name": "status",
973
+ "type": "text",
974
+ "primaryKey": false,
975
+ "notNull": true,
976
+ "default": "'pending'"
977
+ },
978
+ "error_message": {
979
+ "name": "error_message",
980
+ "type": "text",
981
+ "primaryKey": false,
982
+ "notNull": false
983
+ },
984
+ "chunk_count": {
985
+ "name": "chunk_count",
986
+ "type": "integer",
987
+ "primaryKey": false,
988
+ "notNull": false,
989
+ "default": 0
990
+ },
991
+ "total_tokens": {
992
+ "name": "total_tokens",
993
+ "type": "integer",
994
+ "primaryKey": false,
995
+ "notNull": false,
996
+ "default": 0
997
+ },
998
+ "user_id": {
999
+ "name": "user_id",
1000
+ "type": "uuid",
1001
+ "primaryKey": false,
1002
+ "notNull": false
1003
+ },
1004
+ "created_at": {
1005
+ "name": "created_at",
1006
+ "type": "timestamp",
1007
+ "primaryKey": false,
1008
+ "notNull": true,
1009
+ "default": "now()"
1010
+ },
1011
+ "updated_at": {
1012
+ "name": "updated_at",
1013
+ "type": "timestamp",
1014
+ "primaryKey": false,
1015
+ "notNull": true,
1016
+ "default": "now()"
1017
+ },
1018
+ "processed_at": {
1019
+ "name": "processed_at",
1020
+ "type": "timestamp",
1021
+ "primaryKey": false,
1022
+ "notNull": false
1023
+ }
1024
+ },
1025
+ "indexes": {
1026
+ "documents_user_idx": {
1027
+ "name": "documents_user_idx",
1028
+ "columns": [
1029
+ {
1030
+ "expression": "user_id",
1031
+ "isExpression": false,
1032
+ "asc": true,
1033
+ "nulls": "last"
1034
+ }
1035
+ ],
1036
+ "isUnique": false,
1037
+ "concurrently": false,
1038
+ "method": "btree",
1039
+ "with": {}
1040
+ },
1041
+ "documents_status_idx": {
1042
+ "name": "documents_status_idx",
1043
+ "columns": [
1044
+ {
1045
+ "expression": "status",
1046
+ "isExpression": false,
1047
+ "asc": true,
1048
+ "nulls": "last"
1049
+ }
1050
+ ],
1051
+ "isUnique": false,
1052
+ "concurrently": false,
1053
+ "method": "btree",
1054
+ "with": {}
1055
+ }
1056
+ },
1057
+ "foreignKeys": {
1058
+ "documents_user_id_users_id_fk": {
1059
+ "name": "documents_user_id_users_id_fk",
1060
+ "tableFrom": "documents",
1061
+ "tableTo": "users",
1062
+ "columnsFrom": [
1063
+ "user_id"
1064
+ ],
1065
+ "columnsTo": [
1066
+ "id"
1067
+ ],
1068
+ "onDelete": "no action",
1069
+ "onUpdate": "no action"
1070
+ }
1071
+ },
1072
+ "compositePrimaryKeys": {},
1073
+ "uniqueConstraints": {},
1074
+ "policies": {},
1075
+ "checkConstraints": {},
1076
+ "isRLSEnabled": false
1077
+ },
1078
+ "public.error_logs": {
1079
+ "name": "error_logs",
1080
+ "schema": "",
1081
+ "columns": {
1082
+ "id": {
1083
+ "name": "id",
1084
+ "type": "uuid",
1085
+ "primaryKey": true,
1086
+ "notNull": true,
1087
+ "default": "gen_random_uuid()"
1088
+ },
1089
+ "source": {
1090
+ "name": "source",
1091
+ "type": "text",
1092
+ "primaryKey": false,
1093
+ "notNull": true
1094
+ },
1095
+ "error_type": {
1096
+ "name": "error_type",
1097
+ "type": "text",
1098
+ "primaryKey": false,
1099
+ "notNull": true
1100
+ },
1101
+ "error_code": {
1102
+ "name": "error_code",
1103
+ "type": "text",
1104
+ "primaryKey": false,
1105
+ "notNull": false
1106
+ },
1107
+ "message": {
1108
+ "name": "message",
1109
+ "type": "text",
1110
+ "primaryKey": false,
1111
+ "notNull": true
1112
+ },
1113
+ "stack": {
1114
+ "name": "stack",
1115
+ "type": "text",
1116
+ "primaryKey": false,
1117
+ "notNull": false
1118
+ },
1119
+ "context": {
1120
+ "name": "context",
1121
+ "type": "jsonb",
1122
+ "primaryKey": false,
1123
+ "notNull": false
1124
+ },
1125
+ "user_id": {
1126
+ "name": "user_id",
1127
+ "type": "uuid",
1128
+ "primaryKey": false,
1129
+ "notNull": false
1130
+ },
1131
+ "conversation_id": {
1132
+ "name": "conversation_id",
1133
+ "type": "uuid",
1134
+ "primaryKey": false,
1135
+ "notNull": false
1136
+ },
1137
+ "resolved": {
1138
+ "name": "resolved",
1139
+ "type": "boolean",
1140
+ "primaryKey": false,
1141
+ "notNull": false,
1142
+ "default": false
1143
+ },
1144
+ "created_at": {
1145
+ "name": "created_at",
1146
+ "type": "timestamp",
1147
+ "primaryKey": false,
1148
+ "notNull": true,
1149
+ "default": "now()"
1150
+ }
1151
+ },
1152
+ "indexes": {
1153
+ "error_logs_source_idx": {
1154
+ "name": "error_logs_source_idx",
1155
+ "columns": [
1156
+ {
1157
+ "expression": "source",
1158
+ "isExpression": false,
1159
+ "asc": true,
1160
+ "nulls": "last"
1161
+ }
1162
+ ],
1163
+ "isUnique": false,
1164
+ "concurrently": false,
1165
+ "method": "btree",
1166
+ "with": {}
1167
+ },
1168
+ "error_logs_created_idx": {
1169
+ "name": "error_logs_created_idx",
1170
+ "columns": [
1171
+ {
1172
+ "expression": "created_at",
1173
+ "isExpression": false,
1174
+ "asc": true,
1175
+ "nulls": "last"
1176
+ }
1177
+ ],
1178
+ "isUnique": false,
1179
+ "concurrently": false,
1180
+ "method": "btree",
1181
+ "with": {}
1182
+ }
1183
+ },
1184
+ "foreignKeys": {
1185
+ "error_logs_user_id_users_id_fk": {
1186
+ "name": "error_logs_user_id_users_id_fk",
1187
+ "tableFrom": "error_logs",
1188
+ "tableTo": "users",
1189
+ "columnsFrom": [
1190
+ "user_id"
1191
+ ],
1192
+ "columnsTo": [
1193
+ "id"
1194
+ ],
1195
+ "onDelete": "no action",
1196
+ "onUpdate": "no action"
1197
+ },
1198
+ "error_logs_conversation_id_conversations_id_fk": {
1199
+ "name": "error_logs_conversation_id_conversations_id_fk",
1200
+ "tableFrom": "error_logs",
1201
+ "tableTo": "conversations",
1202
+ "columnsFrom": [
1203
+ "conversation_id"
1204
+ ],
1205
+ "columnsTo": [
1206
+ "id"
1207
+ ],
1208
+ "onDelete": "no action",
1209
+ "onUpdate": "no action"
1210
+ }
1211
+ },
1212
+ "compositePrimaryKeys": {},
1213
+ "uniqueConstraints": {},
1214
+ "policies": {},
1215
+ "checkConstraints": {},
1216
+ "isRLSEnabled": false
1217
+ },
1218
+ "public.molt_modes": {
1219
+ "name": "molt_modes",
1220
+ "schema": "",
1221
+ "columns": {
1222
+ "id": {
1223
+ "name": "id",
1224
+ "type": "uuid",
1225
+ "primaryKey": true,
1226
+ "notNull": true,
1227
+ "default": "gen_random_uuid()"
1228
+ },
1229
+ "user_id": {
1230
+ "name": "user_id",
1231
+ "type": "uuid",
1232
+ "primaryKey": false,
1233
+ "notNull": true
1234
+ },
1235
+ "mode": {
1236
+ "name": "mode",
1237
+ "type": "text",
1238
+ "primaryKey": false,
1239
+ "notNull": true
1240
+ },
1241
+ "activated_at": {
1242
+ "name": "activated_at",
1243
+ "type": "timestamp",
1244
+ "primaryKey": false,
1245
+ "notNull": true,
1246
+ "default": "now()"
1247
+ },
1248
+ "deactivated_at": {
1249
+ "name": "deactivated_at",
1250
+ "type": "timestamp",
1251
+ "primaryKey": false,
1252
+ "notNull": false
1253
+ },
1254
+ "metadata": {
1255
+ "name": "metadata",
1256
+ "type": "jsonb",
1257
+ "primaryKey": false,
1258
+ "notNull": false
1259
+ }
1260
+ },
1261
+ "indexes": {
1262
+ "molt_modes_user_idx": {
1263
+ "name": "molt_modes_user_idx",
1264
+ "columns": [
1265
+ {
1266
+ "expression": "user_id",
1267
+ "isExpression": false,
1268
+ "asc": true,
1269
+ "nulls": "last"
1270
+ }
1271
+ ],
1272
+ "isUnique": false,
1273
+ "concurrently": false,
1274
+ "method": "btree",
1275
+ "with": {}
1276
+ }
1277
+ },
1278
+ "foreignKeys": {
1279
+ "molt_modes_user_id_users_id_fk": {
1280
+ "name": "molt_modes_user_id_users_id_fk",
1281
+ "tableFrom": "molt_modes",
1282
+ "tableTo": "users",
1283
+ "columnsFrom": [
1284
+ "user_id"
1285
+ ],
1286
+ "columnsTo": [
1287
+ "id"
1288
+ ],
1289
+ "onDelete": "no action",
1290
+ "onUpdate": "no action"
1291
+ }
1292
+ },
1293
+ "compositePrimaryKeys": {},
1294
+ "uniqueConstraints": {},
1295
+ "policies": {},
1296
+ "checkConstraints": {},
1297
+ "isRLSEnabled": false
1298
+ },
1299
+ "public.graph_entities": {
1300
+ "name": "graph_entities",
1301
+ "schema": "",
1302
+ "columns": {
1303
+ "id": {
1304
+ "name": "id",
1305
+ "type": "uuid",
1306
+ "primaryKey": true,
1307
+ "notNull": true,
1308
+ "default": "gen_random_uuid()"
1309
+ },
1310
+ "user_id": {
1311
+ "name": "user_id",
1312
+ "type": "uuid",
1313
+ "primaryKey": false,
1314
+ "notNull": false
1315
+ },
1316
+ "type": {
1317
+ "name": "type",
1318
+ "type": "text",
1319
+ "primaryKey": false,
1320
+ "notNull": true
1321
+ },
1322
+ "name": {
1323
+ "name": "name",
1324
+ "type": "text",
1325
+ "primaryKey": false,
1326
+ "notNull": true
1327
+ },
1328
+ "aliases": {
1329
+ "name": "aliases",
1330
+ "type": "jsonb",
1331
+ "primaryKey": false,
1332
+ "notNull": false,
1333
+ "default": "'[]'::jsonb"
1334
+ },
1335
+ "description": {
1336
+ "name": "description",
1337
+ "type": "text",
1338
+ "primaryKey": false,
1339
+ "notNull": false
1340
+ },
1341
+ "attributes": {
1342
+ "name": "attributes",
1343
+ "type": "jsonb",
1344
+ "primaryKey": false,
1345
+ "notNull": false,
1346
+ "default": "'{}'::jsonb"
1347
+ },
1348
+ "importance": {
1349
+ "name": "importance",
1350
+ "type": "integer",
1351
+ "primaryKey": false,
1352
+ "notNull": false,
1353
+ "default": 50
1354
+ },
1355
+ "mention_count": {
1356
+ "name": "mention_count",
1357
+ "type": "integer",
1358
+ "primaryKey": false,
1359
+ "notNull": false,
1360
+ "default": 1
1361
+ },
1362
+ "embedding": {
1363
+ "name": "embedding",
1364
+ "type": "vector(1536)",
1365
+ "primaryKey": false,
1366
+ "notNull": false
1367
+ },
1368
+ "created_at": {
1369
+ "name": "created_at",
1370
+ "type": "timestamp",
1371
+ "primaryKey": false,
1372
+ "notNull": true,
1373
+ "default": "now()"
1374
+ },
1375
+ "updated_at": {
1376
+ "name": "updated_at",
1377
+ "type": "timestamp",
1378
+ "primaryKey": false,
1379
+ "notNull": true,
1380
+ "default": "now()"
1381
+ }
1382
+ },
1383
+ "indexes": {
1384
+ "graph_entities_user_idx": {
1385
+ "name": "graph_entities_user_idx",
1386
+ "columns": [
1387
+ {
1388
+ "expression": "user_id",
1389
+ "isExpression": false,
1390
+ "asc": true,
1391
+ "nulls": "last"
1392
+ }
1393
+ ],
1394
+ "isUnique": false,
1395
+ "concurrently": false,
1396
+ "method": "btree",
1397
+ "with": {}
1398
+ },
1399
+ "graph_entities_type_idx": {
1400
+ "name": "graph_entities_type_idx",
1401
+ "columns": [
1402
+ {
1403
+ "expression": "type",
1404
+ "isExpression": false,
1405
+ "asc": true,
1406
+ "nulls": "last"
1407
+ }
1408
+ ],
1409
+ "isUnique": false,
1410
+ "concurrently": false,
1411
+ "method": "btree",
1412
+ "with": {}
1413
+ },
1414
+ "graph_entities_name_idx": {
1415
+ "name": "graph_entities_name_idx",
1416
+ "columns": [
1417
+ {
1418
+ "expression": "name",
1419
+ "isExpression": false,
1420
+ "asc": true,
1421
+ "nulls": "last"
1422
+ }
1423
+ ],
1424
+ "isUnique": false,
1425
+ "concurrently": false,
1426
+ "method": "btree",
1427
+ "with": {}
1428
+ }
1429
+ },
1430
+ "foreignKeys": {
1431
+ "graph_entities_user_id_users_id_fk": {
1432
+ "name": "graph_entities_user_id_users_id_fk",
1433
+ "tableFrom": "graph_entities",
1434
+ "tableTo": "users",
1435
+ "columnsFrom": [
1436
+ "user_id"
1437
+ ],
1438
+ "columnsTo": [
1439
+ "id"
1440
+ ],
1441
+ "onDelete": "no action",
1442
+ "onUpdate": "no action"
1443
+ }
1444
+ },
1445
+ "compositePrimaryKeys": {},
1446
+ "uniqueConstraints": {},
1447
+ "policies": {},
1448
+ "checkConstraints": {},
1449
+ "isRLSEnabled": false
1450
+ },
1451
+ "public.graph_relationships": {
1452
+ "name": "graph_relationships",
1453
+ "schema": "",
1454
+ "columns": {
1455
+ "id": {
1456
+ "name": "id",
1457
+ "type": "uuid",
1458
+ "primaryKey": true,
1459
+ "notNull": true,
1460
+ "default": "gen_random_uuid()"
1461
+ },
1462
+ "source_entity_id": {
1463
+ "name": "source_entity_id",
1464
+ "type": "uuid",
1465
+ "primaryKey": false,
1466
+ "notNull": true
1467
+ },
1468
+ "target_entity_id": {
1469
+ "name": "target_entity_id",
1470
+ "type": "uuid",
1471
+ "primaryKey": false,
1472
+ "notNull": true
1473
+ },
1474
+ "type": {
1475
+ "name": "type",
1476
+ "type": "text",
1477
+ "primaryKey": false,
1478
+ "notNull": true
1479
+ },
1480
+ "strength": {
1481
+ "name": "strength",
1482
+ "type": "integer",
1483
+ "primaryKey": false,
1484
+ "notNull": false,
1485
+ "default": 50
1486
+ },
1487
+ "bidirectional": {
1488
+ "name": "bidirectional",
1489
+ "type": "boolean",
1490
+ "primaryKey": false,
1491
+ "notNull": false,
1492
+ "default": false
1493
+ },
1494
+ "context": {
1495
+ "name": "context",
1496
+ "type": "text",
1497
+ "primaryKey": false,
1498
+ "notNull": false
1499
+ },
1500
+ "attributes": {
1501
+ "name": "attributes",
1502
+ "type": "jsonb",
1503
+ "primaryKey": false,
1504
+ "notNull": false,
1505
+ "default": "'{}'::jsonb"
1506
+ },
1507
+ "created_at": {
1508
+ "name": "created_at",
1509
+ "type": "timestamp",
1510
+ "primaryKey": false,
1511
+ "notNull": true,
1512
+ "default": "now()"
1513
+ },
1514
+ "updated_at": {
1515
+ "name": "updated_at",
1516
+ "type": "timestamp",
1517
+ "primaryKey": false,
1518
+ "notNull": true,
1519
+ "default": "now()"
1520
+ }
1521
+ },
1522
+ "indexes": {
1523
+ "graph_rel_source_idx": {
1524
+ "name": "graph_rel_source_idx",
1525
+ "columns": [
1526
+ {
1527
+ "expression": "source_entity_id",
1528
+ "isExpression": false,
1529
+ "asc": true,
1530
+ "nulls": "last"
1531
+ }
1532
+ ],
1533
+ "isUnique": false,
1534
+ "concurrently": false,
1535
+ "method": "btree",
1536
+ "with": {}
1537
+ },
1538
+ "graph_rel_target_idx": {
1539
+ "name": "graph_rel_target_idx",
1540
+ "columns": [
1541
+ {
1542
+ "expression": "target_entity_id",
1543
+ "isExpression": false,
1544
+ "asc": true,
1545
+ "nulls": "last"
1546
+ }
1547
+ ],
1548
+ "isUnique": false,
1549
+ "concurrently": false,
1550
+ "method": "btree",
1551
+ "with": {}
1552
+ },
1553
+ "graph_rel_type_idx": {
1554
+ "name": "graph_rel_type_idx",
1555
+ "columns": [
1556
+ {
1557
+ "expression": "type",
1558
+ "isExpression": false,
1559
+ "asc": true,
1560
+ "nulls": "last"
1561
+ }
1562
+ ],
1563
+ "isUnique": false,
1564
+ "concurrently": false,
1565
+ "method": "btree",
1566
+ "with": {}
1567
+ }
1568
+ },
1569
+ "foreignKeys": {
1570
+ "graph_relationships_source_entity_id_graph_entities_id_fk": {
1571
+ "name": "graph_relationships_source_entity_id_graph_entities_id_fk",
1572
+ "tableFrom": "graph_relationships",
1573
+ "tableTo": "graph_entities",
1574
+ "columnsFrom": [
1575
+ "source_entity_id"
1576
+ ],
1577
+ "columnsTo": [
1578
+ "id"
1579
+ ],
1580
+ "onDelete": "cascade",
1581
+ "onUpdate": "no action"
1582
+ },
1583
+ "graph_relationships_target_entity_id_graph_entities_id_fk": {
1584
+ "name": "graph_relationships_target_entity_id_graph_entities_id_fk",
1585
+ "tableFrom": "graph_relationships",
1586
+ "tableTo": "graph_entities",
1587
+ "columnsFrom": [
1588
+ "target_entity_id"
1589
+ ],
1590
+ "columnsTo": [
1591
+ "id"
1592
+ ],
1593
+ "onDelete": "cascade",
1594
+ "onUpdate": "no action"
1595
+ }
1596
+ },
1597
+ "compositePrimaryKeys": {},
1598
+ "uniqueConstraints": {},
1599
+ "policies": {},
1600
+ "checkConstraints": {},
1601
+ "isRLSEnabled": false
1602
+ },
1603
+ "public.incident_timeline": {
1604
+ "name": "incident_timeline",
1605
+ "schema": "",
1606
+ "columns": {
1607
+ "id": {
1608
+ "name": "id",
1609
+ "type": "uuid",
1610
+ "primaryKey": true,
1611
+ "notNull": true,
1612
+ "default": "gen_random_uuid()"
1613
+ },
1614
+ "incident_id": {
1615
+ "name": "incident_id",
1616
+ "type": "uuid",
1617
+ "primaryKey": false,
1618
+ "notNull": true
1619
+ },
1620
+ "event_type": {
1621
+ "name": "event_type",
1622
+ "type": "text",
1623
+ "primaryKey": false,
1624
+ "notNull": true
1625
+ },
1626
+ "description": {
1627
+ "name": "description",
1628
+ "type": "text",
1629
+ "primaryKey": false,
1630
+ "notNull": true
1631
+ },
1632
+ "performed_by": {
1633
+ "name": "performed_by",
1634
+ "type": "uuid",
1635
+ "primaryKey": false,
1636
+ "notNull": false
1637
+ },
1638
+ "metadata": {
1639
+ "name": "metadata",
1640
+ "type": "jsonb",
1641
+ "primaryKey": false,
1642
+ "notNull": false
1643
+ },
1644
+ "created_at": {
1645
+ "name": "created_at",
1646
+ "type": "timestamp",
1647
+ "primaryKey": false,
1648
+ "notNull": true,
1649
+ "default": "now()"
1650
+ }
1651
+ },
1652
+ "indexes": {
1653
+ "incident_timeline_incident_idx": {
1654
+ "name": "incident_timeline_incident_idx",
1655
+ "columns": [
1656
+ {
1657
+ "expression": "incident_id",
1658
+ "isExpression": false,
1659
+ "asc": true,
1660
+ "nulls": "last"
1661
+ }
1662
+ ],
1663
+ "isUnique": false,
1664
+ "concurrently": false,
1665
+ "method": "btree",
1666
+ "with": {}
1667
+ }
1668
+ },
1669
+ "foreignKeys": {
1670
+ "incident_timeline_incident_id_security_incidents_id_fk": {
1671
+ "name": "incident_timeline_incident_id_security_incidents_id_fk",
1672
+ "tableFrom": "incident_timeline",
1673
+ "tableTo": "security_incidents",
1674
+ "columnsFrom": [
1675
+ "incident_id"
1676
+ ],
1677
+ "columnsTo": [
1678
+ "id"
1679
+ ],
1680
+ "onDelete": "cascade",
1681
+ "onUpdate": "no action"
1682
+ },
1683
+ "incident_timeline_performed_by_users_id_fk": {
1684
+ "name": "incident_timeline_performed_by_users_id_fk",
1685
+ "tableFrom": "incident_timeline",
1686
+ "tableTo": "users",
1687
+ "columnsFrom": [
1688
+ "performed_by"
1689
+ ],
1690
+ "columnsTo": [
1691
+ "id"
1692
+ ],
1693
+ "onDelete": "no action",
1694
+ "onUpdate": "no action"
1695
+ }
1696
+ },
1697
+ "compositePrimaryKeys": {},
1698
+ "uniqueConstraints": {},
1699
+ "policies": {},
1700
+ "checkConstraints": {},
1701
+ "isRLSEnabled": false
1702
+ },
1703
+ "public.m365_analysis_results": {
1704
+ "name": "m365_analysis_results",
1705
+ "schema": "",
1706
+ "columns": {
1707
+ "id": {
1708
+ "name": "id",
1709
+ "type": "uuid",
1710
+ "primaryKey": true,
1711
+ "notNull": true,
1712
+ "default": "gen_random_uuid()"
1713
+ },
1714
+ "user_key": {
1715
+ "name": "user_key",
1716
+ "type": "text",
1717
+ "primaryKey": false,
1718
+ "notNull": true
1719
+ },
1720
+ "input_type": {
1721
+ "name": "input_type",
1722
+ "type": "text",
1723
+ "primaryKey": false,
1724
+ "notNull": true
1725
+ },
1726
+ "input_id": {
1727
+ "name": "input_id",
1728
+ "type": "text",
1729
+ "primaryKey": false,
1730
+ "notNull": false
1731
+ },
1732
+ "subject": {
1733
+ "name": "subject",
1734
+ "type": "text",
1735
+ "primaryKey": false,
1736
+ "notNull": false
1737
+ },
1738
+ "sender": {
1739
+ "name": "sender",
1740
+ "type": "text",
1741
+ "primaryKey": false,
1742
+ "notNull": false
1743
+ },
1744
+ "risk_score": {
1745
+ "name": "risk_score",
1746
+ "type": "integer",
1747
+ "primaryKey": false,
1748
+ "notNull": true
1749
+ },
1750
+ "category": {
1751
+ "name": "category",
1752
+ "type": "text",
1753
+ "primaryKey": false,
1754
+ "notNull": true
1755
+ },
1756
+ "explanation": {
1757
+ "name": "explanation",
1758
+ "type": "jsonb",
1759
+ "primaryKey": false,
1760
+ "notNull": false
1761
+ },
1762
+ "recommended_actions": {
1763
+ "name": "recommended_actions",
1764
+ "type": "jsonb",
1765
+ "primaryKey": false,
1766
+ "notNull": false
1767
+ },
1768
+ "engine": {
1769
+ "name": "engine",
1770
+ "type": "text",
1771
+ "primaryKey": false,
1772
+ "notNull": true
1773
+ },
1774
+ "model": {
1775
+ "name": "model",
1776
+ "type": "text",
1777
+ "primaryKey": false,
1778
+ "notNull": false
1779
+ },
1780
+ "latency_ms": {
1781
+ "name": "latency_ms",
1782
+ "type": "integer",
1783
+ "primaryKey": false,
1784
+ "notNull": false
1785
+ },
1786
+ "created_at": {
1787
+ "name": "created_at",
1788
+ "type": "timestamp",
1789
+ "primaryKey": false,
1790
+ "notNull": true,
1791
+ "default": "now()"
1792
+ }
1793
+ },
1794
+ "indexes": {
1795
+ "m365_analysis_user_idx": {
1796
+ "name": "m365_analysis_user_idx",
1797
+ "columns": [
1798
+ {
1799
+ "expression": "user_key",
1800
+ "isExpression": false,
1801
+ "asc": true,
1802
+ "nulls": "last"
1803
+ }
1804
+ ],
1805
+ "isUnique": false,
1806
+ "concurrently": false,
1807
+ "method": "btree",
1808
+ "with": {}
1809
+ },
1810
+ "m365_analysis_created_idx": {
1811
+ "name": "m365_analysis_created_idx",
1812
+ "columns": [
1813
+ {
1814
+ "expression": "created_at",
1815
+ "isExpression": false,
1816
+ "asc": true,
1817
+ "nulls": "last"
1818
+ }
1819
+ ],
1820
+ "isUnique": false,
1821
+ "concurrently": false,
1822
+ "method": "btree",
1823
+ "with": {}
1824
+ }
1825
+ },
1826
+ "foreignKeys": {},
1827
+ "compositePrimaryKeys": {},
1828
+ "uniqueConstraints": {},
1829
+ "policies": {},
1830
+ "checkConstraints": {},
1831
+ "isRLSEnabled": false
1832
+ },
1833
+ "public.m365_connections": {
1834
+ "name": "m365_connections",
1835
+ "schema": "",
1836
+ "columns": {
1837
+ "id": {
1838
+ "name": "id",
1839
+ "type": "uuid",
1840
+ "primaryKey": true,
1841
+ "notNull": true,
1842
+ "default": "gen_random_uuid()"
1843
+ },
1844
+ "user_key": {
1845
+ "name": "user_key",
1846
+ "type": "text",
1847
+ "primaryKey": false,
1848
+ "notNull": true
1849
+ },
1850
+ "microsoft_user_id": {
1851
+ "name": "microsoft_user_id",
1852
+ "type": "text",
1853
+ "primaryKey": false,
1854
+ "notNull": false
1855
+ },
1856
+ "email": {
1857
+ "name": "email",
1858
+ "type": "text",
1859
+ "primaryKey": false,
1860
+ "notNull": false
1861
+ },
1862
+ "display_name": {
1863
+ "name": "display_name",
1864
+ "type": "text",
1865
+ "primaryKey": false,
1866
+ "notNull": false
1867
+ },
1868
+ "access_token_encrypted": {
1869
+ "name": "access_token_encrypted",
1870
+ "type": "text",
1871
+ "primaryKey": false,
1872
+ "notNull": true
1873
+ },
1874
+ "refresh_token_encrypted": {
1875
+ "name": "refresh_token_encrypted",
1876
+ "type": "text",
1877
+ "primaryKey": false,
1878
+ "notNull": false
1879
+ },
1880
+ "scope": {
1881
+ "name": "scope",
1882
+ "type": "text",
1883
+ "primaryKey": false,
1884
+ "notNull": false
1885
+ },
1886
+ "token_type": {
1887
+ "name": "token_type",
1888
+ "type": "text",
1889
+ "primaryKey": false,
1890
+ "notNull": false,
1891
+ "default": "'Bearer'"
1892
+ },
1893
+ "expires_at": {
1894
+ "name": "expires_at",
1895
+ "type": "timestamp",
1896
+ "primaryKey": false,
1897
+ "notNull": true
1898
+ },
1899
+ "created_at": {
1900
+ "name": "created_at",
1901
+ "type": "timestamp",
1902
+ "primaryKey": false,
1903
+ "notNull": true,
1904
+ "default": "now()"
1905
+ },
1906
+ "updated_at": {
1907
+ "name": "updated_at",
1908
+ "type": "timestamp",
1909
+ "primaryKey": false,
1910
+ "notNull": true,
1911
+ "default": "now()"
1912
+ }
1913
+ },
1914
+ "indexes": {
1915
+ "m365_connections_user_idx": {
1916
+ "name": "m365_connections_user_idx",
1917
+ "columns": [
1918
+ {
1919
+ "expression": "user_key",
1920
+ "isExpression": false,
1921
+ "asc": true,
1922
+ "nulls": "last"
1923
+ }
1924
+ ],
1925
+ "isUnique": false,
1926
+ "concurrently": false,
1927
+ "method": "btree",
1928
+ "with": {}
1929
+ }
1930
+ },
1931
+ "foreignKeys": {},
1932
+ "compositePrimaryKeys": {},
1933
+ "uniqueConstraints": {
1934
+ "m365_connections_user_key_unique": {
1935
+ "name": "m365_connections_user_key_unique",
1936
+ "nullsNotDistinct": false,
1937
+ "columns": [
1938
+ "user_key"
1939
+ ]
1940
+ }
1941
+ },
1942
+ "policies": {},
1943
+ "checkConstraints": {},
1944
+ "isRLSEnabled": false
1945
+ },
1946
+ "public.m365_oauth_states": {
1947
+ "name": "m365_oauth_states",
1948
+ "schema": "",
1949
+ "columns": {
1950
+ "state": {
1951
+ "name": "state",
1952
+ "type": "text",
1953
+ "primaryKey": true,
1954
+ "notNull": true
1955
+ },
1956
+ "code_verifier": {
1957
+ "name": "code_verifier",
1958
+ "type": "text",
1959
+ "primaryKey": false,
1960
+ "notNull": true
1961
+ },
1962
+ "user_key": {
1963
+ "name": "user_key",
1964
+ "type": "text",
1965
+ "primaryKey": false,
1966
+ "notNull": false
1967
+ },
1968
+ "return_to": {
1969
+ "name": "return_to",
1970
+ "type": "text",
1971
+ "primaryKey": false,
1972
+ "notNull": false
1973
+ },
1974
+ "created_at": {
1975
+ "name": "created_at",
1976
+ "type": "timestamp",
1977
+ "primaryKey": false,
1978
+ "notNull": true,
1979
+ "default": "now()"
1980
+ },
1981
+ "expires_at": {
1982
+ "name": "expires_at",
1983
+ "type": "timestamp",
1984
+ "primaryKey": false,
1985
+ "notNull": true
1986
+ }
1987
+ },
1988
+ "indexes": {
1989
+ "m365_oauth_states_expires_idx": {
1990
+ "name": "m365_oauth_states_expires_idx",
1991
+ "columns": [
1992
+ {
1993
+ "expression": "expires_at",
1994
+ "isExpression": false,
1995
+ "asc": true,
1996
+ "nulls": "last"
1997
+ }
1998
+ ],
1999
+ "isUnique": false,
2000
+ "concurrently": false,
2001
+ "method": "btree",
2002
+ "with": {}
2003
+ }
2004
+ },
2005
+ "foreignKeys": {},
2006
+ "compositePrimaryKeys": {},
2007
+ "uniqueConstraints": {},
2008
+ "policies": {},
2009
+ "checkConstraints": {},
2010
+ "isRLSEnabled": false
2011
+ },
2012
+ "public.memories": {
2013
+ "name": "memories",
2014
+ "schema": "",
2015
+ "columns": {
2016
+ "id": {
2017
+ "name": "id",
2018
+ "type": "uuid",
2019
+ "primaryKey": true,
2020
+ "notNull": true,
2021
+ "default": "gen_random_uuid()"
2022
+ },
2023
+ "user_id": {
2024
+ "name": "user_id",
2025
+ "type": "uuid",
2026
+ "primaryKey": false,
2027
+ "notNull": false
2028
+ },
2029
+ "type": {
2030
+ "name": "type",
2031
+ "type": "text",
2032
+ "primaryKey": false,
2033
+ "notNull": true
2034
+ },
2035
+ "content": {
2036
+ "name": "content",
2037
+ "type": "text",
2038
+ "primaryKey": false,
2039
+ "notNull": true
2040
+ },
2041
+ "embedding": {
2042
+ "name": "embedding",
2043
+ "type": "vector(1536)",
2044
+ "primaryKey": false,
2045
+ "notNull": false
2046
+ },
2047
+ "search_vector": {
2048
+ "name": "search_vector",
2049
+ "type": "tsvector",
2050
+ "primaryKey": false,
2051
+ "notNull": false
2052
+ },
2053
+ "importance": {
2054
+ "name": "importance",
2055
+ "type": "integer",
2056
+ "primaryKey": false,
2057
+ "notNull": false,
2058
+ "default": 5
2059
+ },
2060
+ "source": {
2061
+ "name": "source",
2062
+ "type": "text",
2063
+ "primaryKey": false,
2064
+ "notNull": false
2065
+ },
2066
+ "provenance": {
2067
+ "name": "provenance",
2068
+ "type": "text",
2069
+ "primaryKey": false,
2070
+ "notNull": false
2071
+ },
2072
+ "metadata": {
2073
+ "name": "metadata",
2074
+ "type": "jsonb",
2075
+ "primaryKey": false,
2076
+ "notNull": false
2077
+ },
2078
+ "encrypted": {
2079
+ "name": "encrypted",
2080
+ "type": "boolean",
2081
+ "primaryKey": false,
2082
+ "notNull": true,
2083
+ "default": false
2084
+ },
2085
+ "last_accessed": {
2086
+ "name": "last_accessed",
2087
+ "type": "timestamp",
2088
+ "primaryKey": false,
2089
+ "notNull": false,
2090
+ "default": "now()"
2091
+ },
2092
+ "created_at": {
2093
+ "name": "created_at",
2094
+ "type": "timestamp",
2095
+ "primaryKey": false,
2096
+ "notNull": true,
2097
+ "default": "now()"
2098
+ }
2099
+ },
2100
+ "indexes": {
2101
+ "memories_user_idx": {
2102
+ "name": "memories_user_idx",
2103
+ "columns": [
2104
+ {
2105
+ "expression": "user_id",
2106
+ "isExpression": false,
2107
+ "asc": true,
2108
+ "nulls": "last"
2109
+ }
2110
+ ],
2111
+ "isUnique": false,
2112
+ "concurrently": false,
2113
+ "method": "btree",
2114
+ "with": {}
2115
+ }
2116
+ },
2117
+ "foreignKeys": {
2118
+ "memories_user_id_users_id_fk": {
2119
+ "name": "memories_user_id_users_id_fk",
2120
+ "tableFrom": "memories",
2121
+ "tableTo": "users",
2122
+ "columnsFrom": [
2123
+ "user_id"
2124
+ ],
2125
+ "columnsTo": [
2126
+ "id"
2127
+ ],
2128
+ "onDelete": "no action",
2129
+ "onUpdate": "no action"
2130
+ }
2131
+ },
2132
+ "compositePrimaryKeys": {},
2133
+ "uniqueConstraints": {},
2134
+ "policies": {},
2135
+ "checkConstraints": {},
2136
+ "isRLSEnabled": false
2137
+ },
2138
+ "public.messages": {
2139
+ "name": "messages",
2140
+ "schema": "",
2141
+ "columns": {
2142
+ "id": {
2143
+ "name": "id",
2144
+ "type": "uuid",
2145
+ "primaryKey": true,
2146
+ "notNull": true,
2147
+ "default": "gen_random_uuid()"
2148
+ },
2149
+ "conversation_id": {
2150
+ "name": "conversation_id",
2151
+ "type": "uuid",
2152
+ "primaryKey": false,
2153
+ "notNull": true
2154
+ },
2155
+ "role": {
2156
+ "name": "role",
2157
+ "type": "text",
2158
+ "primaryKey": false,
2159
+ "notNull": true
2160
+ },
2161
+ "content": {
2162
+ "name": "content",
2163
+ "type": "text",
2164
+ "primaryKey": false,
2165
+ "notNull": true
2166
+ },
2167
+ "token_count": {
2168
+ "name": "token_count",
2169
+ "type": "integer",
2170
+ "primaryKey": false,
2171
+ "notNull": false
2172
+ },
2173
+ "metadata": {
2174
+ "name": "metadata",
2175
+ "type": "jsonb",
2176
+ "primaryKey": false,
2177
+ "notNull": false
2178
+ },
2179
+ "encrypted": {
2180
+ "name": "encrypted",
2181
+ "type": "boolean",
2182
+ "primaryKey": false,
2183
+ "notNull": true,
2184
+ "default": false
2185
+ },
2186
+ "created_at": {
2187
+ "name": "created_at",
2188
+ "type": "timestamp",
2189
+ "primaryKey": false,
2190
+ "notNull": true,
2191
+ "default": "now()"
2192
+ }
2193
+ },
2194
+ "indexes": {
2195
+ "messages_conversation_idx": {
2196
+ "name": "messages_conversation_idx",
2197
+ "columns": [
2198
+ {
2199
+ "expression": "conversation_id",
2200
+ "isExpression": false,
2201
+ "asc": true,
2202
+ "nulls": "last"
2203
+ }
2204
+ ],
2205
+ "isUnique": false,
2206
+ "concurrently": false,
2207
+ "method": "btree",
2208
+ "with": {}
2209
+ }
2210
+ },
2211
+ "foreignKeys": {
2212
+ "messages_conversation_id_conversations_id_fk": {
2213
+ "name": "messages_conversation_id_conversations_id_fk",
2214
+ "tableFrom": "messages",
2215
+ "tableTo": "conversations",
2216
+ "columnsFrom": [
2217
+ "conversation_id"
2218
+ ],
2219
+ "columnsTo": [
2220
+ "id"
2221
+ ],
2222
+ "onDelete": "no action",
2223
+ "onUpdate": "no action"
2224
+ }
2225
+ },
2226
+ "compositePrimaryKeys": {},
2227
+ "uniqueConstraints": {},
2228
+ "policies": {},
2229
+ "checkConstraints": {},
2230
+ "isRLSEnabled": false
2231
+ },
2232
+ "public.metrics": {
2233
+ "name": "metrics",
2234
+ "schema": "",
2235
+ "columns": {
2236
+ "id": {
2237
+ "name": "id",
2238
+ "type": "uuid",
2239
+ "primaryKey": true,
2240
+ "notNull": true,
2241
+ "default": "gen_random_uuid()"
2242
+ },
2243
+ "name": {
2244
+ "name": "name",
2245
+ "type": "text",
2246
+ "primaryKey": false,
2247
+ "notNull": true
2248
+ },
2249
+ "value": {
2250
+ "name": "value",
2251
+ "type": "integer",
2252
+ "primaryKey": false,
2253
+ "notNull": true
2254
+ },
2255
+ "unit": {
2256
+ "name": "unit",
2257
+ "type": "text",
2258
+ "primaryKey": false,
2259
+ "notNull": false
2260
+ },
2261
+ "tags": {
2262
+ "name": "tags",
2263
+ "type": "jsonb",
2264
+ "primaryKey": false,
2265
+ "notNull": false
2266
+ },
2267
+ "timestamp": {
2268
+ "name": "timestamp",
2269
+ "type": "timestamp",
2270
+ "primaryKey": false,
2271
+ "notNull": true,
2272
+ "default": "now()"
2273
+ }
2274
+ },
2275
+ "indexes": {
2276
+ "metrics_name_timestamp_idx": {
2277
+ "name": "metrics_name_timestamp_idx",
2278
+ "columns": [
2279
+ {
2280
+ "expression": "name",
2281
+ "isExpression": false,
2282
+ "asc": true,
2283
+ "nulls": "last"
2284
+ },
2285
+ {
2286
+ "expression": "timestamp",
2287
+ "isExpression": false,
2288
+ "asc": true,
2289
+ "nulls": "last"
2290
+ }
2291
+ ],
2292
+ "isUnique": false,
2293
+ "concurrently": false,
2294
+ "method": "btree",
2295
+ "with": {}
2296
+ }
2297
+ },
2298
+ "foreignKeys": {},
2299
+ "compositePrimaryKeys": {},
2300
+ "uniqueConstraints": {},
2301
+ "policies": {},
2302
+ "checkConstraints": {},
2303
+ "isRLSEnabled": false
2304
+ },
2305
+ "public.organization_members": {
2306
+ "name": "organization_members",
2307
+ "schema": "",
2308
+ "columns": {
2309
+ "id": {
2310
+ "name": "id",
2311
+ "type": "uuid",
2312
+ "primaryKey": true,
2313
+ "notNull": true,
2314
+ "default": "gen_random_uuid()"
2315
+ },
2316
+ "organization_id": {
2317
+ "name": "organization_id",
2318
+ "type": "uuid",
2319
+ "primaryKey": false,
2320
+ "notNull": true
2321
+ },
2322
+ "user_id": {
2323
+ "name": "user_id",
2324
+ "type": "uuid",
2325
+ "primaryKey": false,
2326
+ "notNull": true
2327
+ },
2328
+ "role": {
2329
+ "name": "role",
2330
+ "type": "text",
2331
+ "primaryKey": false,
2332
+ "notNull": true
2333
+ },
2334
+ "joined_at": {
2335
+ "name": "joined_at",
2336
+ "type": "timestamp",
2337
+ "primaryKey": false,
2338
+ "notNull": true,
2339
+ "default": "now()"
2340
+ }
2341
+ },
2342
+ "indexes": {
2343
+ "org_members_org_idx": {
2344
+ "name": "org_members_org_idx",
2345
+ "columns": [
2346
+ {
2347
+ "expression": "organization_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
+ "org_members_user_idx": {
2359
+ "name": "org_members_user_idx",
2360
+ "columns": [
2361
+ {
2362
+ "expression": "user_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
+ "organization_members_organization_id_organizations_id_fk": {
2376
+ "name": "organization_members_organization_id_organizations_id_fk",
2377
+ "tableFrom": "organization_members",
2378
+ "tableTo": "organizations",
2379
+ "columnsFrom": [
2380
+ "organization_id"
2381
+ ],
2382
+ "columnsTo": [
2383
+ "id"
2384
+ ],
2385
+ "onDelete": "no action",
2386
+ "onUpdate": "no action"
2387
+ },
2388
+ "organization_members_user_id_users_id_fk": {
2389
+ "name": "organization_members_user_id_users_id_fk",
2390
+ "tableFrom": "organization_members",
2391
+ "tableTo": "users",
2392
+ "columnsFrom": [
2393
+ "user_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.organizations": {
2409
+ "name": "organizations",
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
+ "name": {
2420
+ "name": "name",
2421
+ "type": "text",
2422
+ "primaryKey": false,
2423
+ "notNull": true
2424
+ },
2425
+ "slug": {
2426
+ "name": "slug",
2427
+ "type": "text",
2428
+ "primaryKey": false,
2429
+ "notNull": false
2430
+ },
2431
+ "settings": {
2432
+ "name": "settings",
2433
+ "type": "jsonb",
2434
+ "primaryKey": false,
2435
+ "notNull": false
2436
+ },
2437
+ "created_at": {
2438
+ "name": "created_at",
2439
+ "type": "timestamp",
2440
+ "primaryKey": false,
2441
+ "notNull": true,
2442
+ "default": "now()"
2443
+ },
2444
+ "updated_at": {
2445
+ "name": "updated_at",
2446
+ "type": "timestamp",
2447
+ "primaryKey": false,
2448
+ "notNull": false,
2449
+ "default": "now()"
2450
+ }
2451
+ },
2452
+ "indexes": {},
2453
+ "foreignKeys": {},
2454
+ "compositePrimaryKeys": {},
2455
+ "uniqueConstraints": {
2456
+ "organizations_slug_unique": {
2457
+ "name": "organizations_slug_unique",
2458
+ "nullsNotDistinct": false,
2459
+ "columns": [
2460
+ "slug"
2461
+ ]
2462
+ }
2463
+ },
2464
+ "policies": {},
2465
+ "checkConstraints": {},
2466
+ "isRLSEnabled": false
2467
+ },
2468
+ "public.personas": {
2469
+ "name": "personas",
2470
+ "schema": "",
2471
+ "columns": {
2472
+ "id": {
2473
+ "name": "id",
2474
+ "type": "uuid",
2475
+ "primaryKey": true,
2476
+ "notNull": true,
2477
+ "default": "gen_random_uuid()"
2478
+ },
2479
+ "user_id": {
2480
+ "name": "user_id",
2481
+ "type": "uuid",
2482
+ "primaryKey": false,
2483
+ "notNull": false
2484
+ },
2485
+ "name": {
2486
+ "name": "name",
2487
+ "type": "text",
2488
+ "primaryKey": false,
2489
+ "notNull": true
2490
+ },
2491
+ "description": {
2492
+ "name": "description",
2493
+ "type": "text",
2494
+ "primaryKey": false,
2495
+ "notNull": false
2496
+ },
2497
+ "base_prompt": {
2498
+ "name": "base_prompt",
2499
+ "type": "text",
2500
+ "primaryKey": false,
2501
+ "notNull": true
2502
+ },
2503
+ "is_default": {
2504
+ "name": "is_default",
2505
+ "type": "boolean",
2506
+ "primaryKey": false,
2507
+ "notNull": false,
2508
+ "default": false
2509
+ },
2510
+ "is_system": {
2511
+ "name": "is_system",
2512
+ "type": "boolean",
2513
+ "primaryKey": false,
2514
+ "notNull": false,
2515
+ "default": false
2516
+ },
2517
+ "settings": {
2518
+ "name": "settings",
2519
+ "type": "jsonb",
2520
+ "primaryKey": false,
2521
+ "notNull": false
2522
+ },
2523
+ "created_at": {
2524
+ "name": "created_at",
2525
+ "type": "timestamp",
2526
+ "primaryKey": false,
2527
+ "notNull": true,
2528
+ "default": "now()"
2529
+ }
2530
+ },
2531
+ "indexes": {
2532
+ "personas_user_idx": {
2533
+ "name": "personas_user_idx",
2534
+ "columns": [
2535
+ {
2536
+ "expression": "user_id",
2537
+ "isExpression": false,
2538
+ "asc": true,
2539
+ "nulls": "last"
2540
+ }
2541
+ ],
2542
+ "isUnique": false,
2543
+ "concurrently": false,
2544
+ "method": "btree",
2545
+ "with": {}
2546
+ }
2547
+ },
2548
+ "foreignKeys": {
2549
+ "personas_user_id_users_id_fk": {
2550
+ "name": "personas_user_id_users_id_fk",
2551
+ "tableFrom": "personas",
2552
+ "tableTo": "users",
2553
+ "columnsFrom": [
2554
+ "user_id"
2555
+ ],
2556
+ "columnsTo": [
2557
+ "id"
2558
+ ],
2559
+ "onDelete": "no action",
2560
+ "onUpdate": "no action"
2561
+ }
2562
+ },
2563
+ "compositePrimaryKeys": {},
2564
+ "uniqueConstraints": {},
2565
+ "policies": {},
2566
+ "checkConstraints": {},
2567
+ "isRLSEnabled": false
2568
+ },
2569
+ "public.rate_limits": {
2570
+ "name": "rate_limits",
2571
+ "schema": "",
2572
+ "columns": {
2573
+ "id": {
2574
+ "name": "id",
2575
+ "type": "uuid",
2576
+ "primaryKey": true,
2577
+ "notNull": true,
2578
+ "default": "gen_random_uuid()"
2579
+ },
2580
+ "identifier": {
2581
+ "name": "identifier",
2582
+ "type": "text",
2583
+ "primaryKey": false,
2584
+ "notNull": true
2585
+ },
2586
+ "endpoint": {
2587
+ "name": "endpoint",
2588
+ "type": "text",
2589
+ "primaryKey": false,
2590
+ "notNull": true
2591
+ },
2592
+ "window_start": {
2593
+ "name": "window_start",
2594
+ "type": "timestamp",
2595
+ "primaryKey": false,
2596
+ "notNull": true
2597
+ },
2598
+ "request_count": {
2599
+ "name": "request_count",
2600
+ "type": "integer",
2601
+ "primaryKey": false,
2602
+ "notNull": false,
2603
+ "default": 0
2604
+ },
2605
+ "last_request": {
2606
+ "name": "last_request",
2607
+ "type": "timestamp",
2608
+ "primaryKey": false,
2609
+ "notNull": false
2610
+ }
2611
+ },
2612
+ "indexes": {
2613
+ "rate_limits_identifier_endpoint_idx": {
2614
+ "name": "rate_limits_identifier_endpoint_idx",
2615
+ "columns": [
2616
+ {
2617
+ "expression": "identifier",
2618
+ "isExpression": false,
2619
+ "asc": true,
2620
+ "nulls": "last"
2621
+ },
2622
+ {
2623
+ "expression": "endpoint",
2624
+ "isExpression": false,
2625
+ "asc": true,
2626
+ "nulls": "last"
2627
+ }
2628
+ ],
2629
+ "isUnique": false,
2630
+ "concurrently": false,
2631
+ "method": "btree",
2632
+ "with": {}
2633
+ }
2634
+ },
2635
+ "foreignKeys": {},
2636
+ "compositePrimaryKeys": {},
2637
+ "uniqueConstraints": {},
2638
+ "policies": {},
2639
+ "checkConstraints": {},
2640
+ "isRLSEnabled": false
2641
+ },
2642
+ "public.scheduled_tasks": {
2643
+ "name": "scheduled_tasks",
2644
+ "schema": "",
2645
+ "columns": {
2646
+ "id": {
2647
+ "name": "id",
2648
+ "type": "uuid",
2649
+ "primaryKey": true,
2650
+ "notNull": true,
2651
+ "default": "gen_random_uuid()"
2652
+ },
2653
+ "user_id": {
2654
+ "name": "user_id",
2655
+ "type": "uuid",
2656
+ "primaryKey": false,
2657
+ "notNull": false
2658
+ },
2659
+ "name": {
2660
+ "name": "name",
2661
+ "type": "text",
2662
+ "primaryKey": false,
2663
+ "notNull": true
2664
+ },
2665
+ "description": {
2666
+ "name": "description",
2667
+ "type": "text",
2668
+ "primaryKey": false,
2669
+ "notNull": false
2670
+ },
2671
+ "cron_expression": {
2672
+ "name": "cron_expression",
2673
+ "type": "text",
2674
+ "primaryKey": false,
2675
+ "notNull": false
2676
+ },
2677
+ "next_run_at": {
2678
+ "name": "next_run_at",
2679
+ "type": "timestamp",
2680
+ "primaryKey": false,
2681
+ "notNull": false
2682
+ },
2683
+ "last_run_at": {
2684
+ "name": "last_run_at",
2685
+ "type": "timestamp",
2686
+ "primaryKey": false,
2687
+ "notNull": false
2688
+ },
2689
+ "enabled": {
2690
+ "name": "enabled",
2691
+ "type": "boolean",
2692
+ "primaryKey": false,
2693
+ "notNull": false,
2694
+ "default": true
2695
+ },
2696
+ "action": {
2697
+ "name": "action",
2698
+ "type": "jsonb",
2699
+ "primaryKey": false,
2700
+ "notNull": false
2701
+ },
2702
+ "created_at": {
2703
+ "name": "created_at",
2704
+ "type": "timestamp",
2705
+ "primaryKey": false,
2706
+ "notNull": true,
2707
+ "default": "now()"
2708
+ }
2709
+ },
2710
+ "indexes": {},
2711
+ "foreignKeys": {
2712
+ "scheduled_tasks_user_id_users_id_fk": {
2713
+ "name": "scheduled_tasks_user_id_users_id_fk",
2714
+ "tableFrom": "scheduled_tasks",
2715
+ "tableTo": "users",
2716
+ "columnsFrom": [
2717
+ "user_id"
2718
+ ],
2719
+ "columnsTo": [
2720
+ "id"
2721
+ ],
2722
+ "onDelete": "no action",
2723
+ "onUpdate": "no action"
2724
+ }
2725
+ },
2726
+ "compositePrimaryKeys": {},
2727
+ "uniqueConstraints": {},
2728
+ "policies": {},
2729
+ "checkConstraints": {},
2730
+ "isRLSEnabled": false
2731
+ },
2732
+ "public.security_incidents": {
2733
+ "name": "security_incidents",
2734
+ "schema": "",
2735
+ "columns": {
2736
+ "id": {
2737
+ "name": "id",
2738
+ "type": "uuid",
2739
+ "primaryKey": true,
2740
+ "notNull": true,
2741
+ "default": "gen_random_uuid()"
2742
+ },
2743
+ "incident_number": {
2744
+ "name": "incident_number",
2745
+ "type": "text",
2746
+ "primaryKey": false,
2747
+ "notNull": true
2748
+ },
2749
+ "title": {
2750
+ "name": "title",
2751
+ "type": "text",
2752
+ "primaryKey": false,
2753
+ "notNull": true
2754
+ },
2755
+ "description": {
2756
+ "name": "description",
2757
+ "type": "text",
2758
+ "primaryKey": false,
2759
+ "notNull": true
2760
+ },
2761
+ "type": {
2762
+ "name": "type",
2763
+ "type": "text",
2764
+ "primaryKey": false,
2765
+ "notNull": true
2766
+ },
2767
+ "severity": {
2768
+ "name": "severity",
2769
+ "type": "text",
2770
+ "primaryKey": false,
2771
+ "notNull": true
2772
+ },
2773
+ "status": {
2774
+ "name": "status",
2775
+ "type": "text",
2776
+ "primaryKey": false,
2777
+ "notNull": true,
2778
+ "default": "'open'"
2779
+ },
2780
+ "user_id": {
2781
+ "name": "user_id",
2782
+ "type": "uuid",
2783
+ "primaryKey": false,
2784
+ "notNull": false
2785
+ },
2786
+ "assigned_to": {
2787
+ "name": "assigned_to",
2788
+ "type": "uuid",
2789
+ "primaryKey": false,
2790
+ "notNull": false
2791
+ },
2792
+ "source": {
2793
+ "name": "source",
2794
+ "type": "text",
2795
+ "primaryKey": false,
2796
+ "notNull": true
2797
+ },
2798
+ "source_data": {
2799
+ "name": "source_data",
2800
+ "type": "jsonb",
2801
+ "primaryKey": false,
2802
+ "notNull": false
2803
+ },
2804
+ "impact_assessment": {
2805
+ "name": "impact_assessment",
2806
+ "type": "text",
2807
+ "primaryKey": false,
2808
+ "notNull": false
2809
+ },
2810
+ "containment_actions": {
2811
+ "name": "containment_actions",
2812
+ "type": "jsonb",
2813
+ "primaryKey": false,
2814
+ "notNull": false
2815
+ },
2816
+ "resolution_notes": {
2817
+ "name": "resolution_notes",
2818
+ "type": "text",
2819
+ "primaryKey": false,
2820
+ "notNull": false
2821
+ },
2822
+ "related_incidents": {
2823
+ "name": "related_incidents",
2824
+ "type": "jsonb",
2825
+ "primaryKey": false,
2826
+ "notNull": false
2827
+ },
2828
+ "metadata": {
2829
+ "name": "metadata",
2830
+ "type": "jsonb",
2831
+ "primaryKey": false,
2832
+ "notNull": false
2833
+ },
2834
+ "created_at": {
2835
+ "name": "created_at",
2836
+ "type": "timestamp",
2837
+ "primaryKey": false,
2838
+ "notNull": true,
2839
+ "default": "now()"
2840
+ },
2841
+ "updated_at": {
2842
+ "name": "updated_at",
2843
+ "type": "timestamp",
2844
+ "primaryKey": false,
2845
+ "notNull": true,
2846
+ "default": "now()"
2847
+ },
2848
+ "investigated_at": {
2849
+ "name": "investigated_at",
2850
+ "type": "timestamp",
2851
+ "primaryKey": false,
2852
+ "notNull": false
2853
+ },
2854
+ "contained_at": {
2855
+ "name": "contained_at",
2856
+ "type": "timestamp",
2857
+ "primaryKey": false,
2858
+ "notNull": false
2859
+ },
2860
+ "resolved_at": {
2861
+ "name": "resolved_at",
2862
+ "type": "timestamp",
2863
+ "primaryKey": false,
2864
+ "notNull": false
2865
+ },
2866
+ "closed_at": {
2867
+ "name": "closed_at",
2868
+ "type": "timestamp",
2869
+ "primaryKey": false,
2870
+ "notNull": false
2871
+ }
2872
+ },
2873
+ "indexes": {
2874
+ "security_incidents_status_idx": {
2875
+ "name": "security_incidents_status_idx",
2876
+ "columns": [
2877
+ {
2878
+ "expression": "status",
2879
+ "isExpression": false,
2880
+ "asc": true,
2881
+ "nulls": "last"
2882
+ }
2883
+ ],
2884
+ "isUnique": false,
2885
+ "concurrently": false,
2886
+ "method": "btree",
2887
+ "with": {}
2888
+ },
2889
+ "security_incidents_severity_idx": {
2890
+ "name": "security_incidents_severity_idx",
2891
+ "columns": [
2892
+ {
2893
+ "expression": "severity",
2894
+ "isExpression": false,
2895
+ "asc": true,
2896
+ "nulls": "last"
2897
+ }
2898
+ ],
2899
+ "isUnique": false,
2900
+ "concurrently": false,
2901
+ "method": "btree",
2902
+ "with": {}
2903
+ },
2904
+ "security_incidents_created_idx": {
2905
+ "name": "security_incidents_created_idx",
2906
+ "columns": [
2907
+ {
2908
+ "expression": "created_at",
2909
+ "isExpression": false,
2910
+ "asc": true,
2911
+ "nulls": "last"
2912
+ }
2913
+ ],
2914
+ "isUnique": false,
2915
+ "concurrently": false,
2916
+ "method": "btree",
2917
+ "with": {}
2918
+ }
2919
+ },
2920
+ "foreignKeys": {
2921
+ "security_incidents_user_id_users_id_fk": {
2922
+ "name": "security_incidents_user_id_users_id_fk",
2923
+ "tableFrom": "security_incidents",
2924
+ "tableTo": "users",
2925
+ "columnsFrom": [
2926
+ "user_id"
2927
+ ],
2928
+ "columnsTo": [
2929
+ "id"
2930
+ ],
2931
+ "onDelete": "no action",
2932
+ "onUpdate": "no action"
2933
+ },
2934
+ "security_incidents_assigned_to_users_id_fk": {
2935
+ "name": "security_incidents_assigned_to_users_id_fk",
2936
+ "tableFrom": "security_incidents",
2937
+ "tableTo": "users",
2938
+ "columnsFrom": [
2939
+ "assigned_to"
2940
+ ],
2941
+ "columnsTo": [
2942
+ "id"
2943
+ ],
2944
+ "onDelete": "no action",
2945
+ "onUpdate": "no action"
2946
+ }
2947
+ },
2948
+ "compositePrimaryKeys": {},
2949
+ "uniqueConstraints": {
2950
+ "security_incidents_incident_number_unique": {
2951
+ "name": "security_incidents_incident_number_unique",
2952
+ "nullsNotDistinct": false,
2953
+ "columns": [
2954
+ "incident_number"
2955
+ ]
2956
+ }
2957
+ },
2958
+ "policies": {},
2959
+ "checkConstraints": {},
2960
+ "isRLSEnabled": false
2961
+ },
2962
+ "public.sessions": {
2963
+ "name": "sessions",
2964
+ "schema": "",
2965
+ "columns": {
2966
+ "id": {
2967
+ "name": "id",
2968
+ "type": "uuid",
2969
+ "primaryKey": true,
2970
+ "notNull": true,
2971
+ "default": "gen_random_uuid()"
2972
+ },
2973
+ "user_id": {
2974
+ "name": "user_id",
2975
+ "type": "uuid",
2976
+ "primaryKey": false,
2977
+ "notNull": true
2978
+ },
2979
+ "token": {
2980
+ "name": "token",
2981
+ "type": "text",
2982
+ "primaryKey": false,
2983
+ "notNull": true
2984
+ },
2985
+ "device_info": {
2986
+ "name": "device_info",
2987
+ "type": "jsonb",
2988
+ "primaryKey": false,
2989
+ "notNull": false
2990
+ },
2991
+ "ip_address": {
2992
+ "name": "ip_address",
2993
+ "type": "text",
2994
+ "primaryKey": false,
2995
+ "notNull": false
2996
+ },
2997
+ "created_at": {
2998
+ "name": "created_at",
2999
+ "type": "timestamp",
3000
+ "primaryKey": false,
3001
+ "notNull": true,
3002
+ "default": "now()"
3003
+ },
3004
+ "expires_at": {
3005
+ "name": "expires_at",
3006
+ "type": "timestamp",
3007
+ "primaryKey": false,
3008
+ "notNull": true
3009
+ },
3010
+ "last_active_at": {
3011
+ "name": "last_active_at",
3012
+ "type": "timestamp",
3013
+ "primaryKey": false,
3014
+ "notNull": false,
3015
+ "default": "now()"
3016
+ }
3017
+ },
3018
+ "indexes": {
3019
+ "sessions_user_idx": {
3020
+ "name": "sessions_user_idx",
3021
+ "columns": [
3022
+ {
3023
+ "expression": "user_id",
3024
+ "isExpression": false,
3025
+ "asc": true,
3026
+ "nulls": "last"
3027
+ }
3028
+ ],
3029
+ "isUnique": false,
3030
+ "concurrently": false,
3031
+ "method": "btree",
3032
+ "with": {}
3033
+ }
3034
+ },
3035
+ "foreignKeys": {
3036
+ "sessions_user_id_users_id_fk": {
3037
+ "name": "sessions_user_id_users_id_fk",
3038
+ "tableFrom": "sessions",
3039
+ "tableTo": "users",
3040
+ "columnsFrom": [
3041
+ "user_id"
3042
+ ],
3043
+ "columnsTo": [
3044
+ "id"
3045
+ ],
3046
+ "onDelete": "no action",
3047
+ "onUpdate": "no action"
3048
+ }
3049
+ },
3050
+ "compositePrimaryKeys": {},
3051
+ "uniqueConstraints": {
3052
+ "sessions_token_unique": {
3053
+ "name": "sessions_token_unique",
3054
+ "nullsNotDistinct": false,
3055
+ "columns": [
3056
+ "token"
3057
+ ]
3058
+ }
3059
+ },
3060
+ "policies": {},
3061
+ "checkConstraints": {},
3062
+ "isRLSEnabled": false
3063
+ },
3064
+ "public.shared_memories": {
3065
+ "name": "shared_memories",
3066
+ "schema": "",
3067
+ "columns": {
3068
+ "id": {
3069
+ "name": "id",
3070
+ "type": "uuid",
3071
+ "primaryKey": true,
3072
+ "notNull": true,
3073
+ "default": "gen_random_uuid()"
3074
+ },
3075
+ "organization_id": {
3076
+ "name": "organization_id",
3077
+ "type": "uuid",
3078
+ "primaryKey": false,
3079
+ "notNull": true
3080
+ },
3081
+ "memory_id": {
3082
+ "name": "memory_id",
3083
+ "type": "uuid",
3084
+ "primaryKey": false,
3085
+ "notNull": true
3086
+ },
3087
+ "shared_by": {
3088
+ "name": "shared_by",
3089
+ "type": "uuid",
3090
+ "primaryKey": false,
3091
+ "notNull": true
3092
+ },
3093
+ "shared_at": {
3094
+ "name": "shared_at",
3095
+ "type": "timestamp",
3096
+ "primaryKey": false,
3097
+ "notNull": true,
3098
+ "default": "now()"
3099
+ }
3100
+ },
3101
+ "indexes": {
3102
+ "shared_memories_org_idx": {
3103
+ "name": "shared_memories_org_idx",
3104
+ "columns": [
3105
+ {
3106
+ "expression": "organization_id",
3107
+ "isExpression": false,
3108
+ "asc": true,
3109
+ "nulls": "last"
3110
+ }
3111
+ ],
3112
+ "isUnique": false,
3113
+ "concurrently": false,
3114
+ "method": "btree",
3115
+ "with": {}
3116
+ }
3117
+ },
3118
+ "foreignKeys": {
3119
+ "shared_memories_organization_id_organizations_id_fk": {
3120
+ "name": "shared_memories_organization_id_organizations_id_fk",
3121
+ "tableFrom": "shared_memories",
3122
+ "tableTo": "organizations",
3123
+ "columnsFrom": [
3124
+ "organization_id"
3125
+ ],
3126
+ "columnsTo": [
3127
+ "id"
3128
+ ],
3129
+ "onDelete": "no action",
3130
+ "onUpdate": "no action"
3131
+ },
3132
+ "shared_memories_memory_id_memories_id_fk": {
3133
+ "name": "shared_memories_memory_id_memories_id_fk",
3134
+ "tableFrom": "shared_memories",
3135
+ "tableTo": "memories",
3136
+ "columnsFrom": [
3137
+ "memory_id"
3138
+ ],
3139
+ "columnsTo": [
3140
+ "id"
3141
+ ],
3142
+ "onDelete": "no action",
3143
+ "onUpdate": "no action"
3144
+ },
3145
+ "shared_memories_shared_by_users_id_fk": {
3146
+ "name": "shared_memories_shared_by_users_id_fk",
3147
+ "tableFrom": "shared_memories",
3148
+ "tableTo": "users",
3149
+ "columnsFrom": [
3150
+ "shared_by"
3151
+ ],
3152
+ "columnsTo": [
3153
+ "id"
3154
+ ],
3155
+ "onDelete": "no action",
3156
+ "onUpdate": "no action"
3157
+ }
3158
+ },
3159
+ "compositePrimaryKeys": {},
3160
+ "uniqueConstraints": {},
3161
+ "policies": {},
3162
+ "checkConstraints": {},
3163
+ "isRLSEnabled": false
3164
+ },
3165
+ "public.sub_agents": {
3166
+ "name": "sub_agents",
3167
+ "schema": "",
3168
+ "columns": {
3169
+ "id": {
3170
+ "name": "id",
3171
+ "type": "uuid",
3172
+ "primaryKey": true,
3173
+ "notNull": true,
3174
+ "default": "gen_random_uuid()"
3175
+ },
3176
+ "parent_conversation_id": {
3177
+ "name": "parent_conversation_id",
3178
+ "type": "uuid",
3179
+ "primaryKey": false,
3180
+ "notNull": false
3181
+ },
3182
+ "user_id": {
3183
+ "name": "user_id",
3184
+ "type": "uuid",
3185
+ "primaryKey": false,
3186
+ "notNull": true
3187
+ },
3188
+ "type": {
3189
+ "name": "type",
3190
+ "type": "text",
3191
+ "primaryKey": false,
3192
+ "notNull": true
3193
+ },
3194
+ "name": {
3195
+ "name": "name",
3196
+ "type": "text",
3197
+ "primaryKey": false,
3198
+ "notNull": true
3199
+ },
3200
+ "status": {
3201
+ "name": "status",
3202
+ "type": "text",
3203
+ "primaryKey": false,
3204
+ "notNull": true
3205
+ },
3206
+ "objective": {
3207
+ "name": "objective",
3208
+ "type": "text",
3209
+ "primaryKey": false,
3210
+ "notNull": true
3211
+ },
3212
+ "context": {
3213
+ "name": "context",
3214
+ "type": "jsonb",
3215
+ "primaryKey": false,
3216
+ "notNull": false
3217
+ },
3218
+ "result": {
3219
+ "name": "result",
3220
+ "type": "jsonb",
3221
+ "primaryKey": false,
3222
+ "notNull": false
3223
+ },
3224
+ "token_budget": {
3225
+ "name": "token_budget",
3226
+ "type": "integer",
3227
+ "primaryKey": false,
3228
+ "notNull": false,
3229
+ "default": 50000
3230
+ },
3231
+ "tokens_used": {
3232
+ "name": "tokens_used",
3233
+ "type": "integer",
3234
+ "primaryKey": false,
3235
+ "notNull": false,
3236
+ "default": 0
3237
+ },
3238
+ "time_budget_ms": {
3239
+ "name": "time_budget_ms",
3240
+ "type": "integer",
3241
+ "primaryKey": false,
3242
+ "notNull": false,
3243
+ "default": 3600000
3244
+ },
3245
+ "started_at": {
3246
+ "name": "started_at",
3247
+ "type": "timestamp",
3248
+ "primaryKey": false,
3249
+ "notNull": false
3250
+ },
3251
+ "completed_at": {
3252
+ "name": "completed_at",
3253
+ "type": "timestamp",
3254
+ "primaryKey": false,
3255
+ "notNull": false
3256
+ },
3257
+ "created_at": {
3258
+ "name": "created_at",
3259
+ "type": "timestamp",
3260
+ "primaryKey": false,
3261
+ "notNull": true,
3262
+ "default": "now()"
3263
+ }
3264
+ },
3265
+ "indexes": {
3266
+ "sub_agents_user_idx": {
3267
+ "name": "sub_agents_user_idx",
3268
+ "columns": [
3269
+ {
3270
+ "expression": "user_id",
3271
+ "isExpression": false,
3272
+ "asc": true,
3273
+ "nulls": "last"
3274
+ }
3275
+ ],
3276
+ "isUnique": false,
3277
+ "concurrently": false,
3278
+ "method": "btree",
3279
+ "with": {}
3280
+ },
3281
+ "sub_agents_status_idx": {
3282
+ "name": "sub_agents_status_idx",
3283
+ "columns": [
3284
+ {
3285
+ "expression": "status",
3286
+ "isExpression": false,
3287
+ "asc": true,
3288
+ "nulls": "last"
3289
+ }
3290
+ ],
3291
+ "isUnique": false,
3292
+ "concurrently": false,
3293
+ "method": "btree",
3294
+ "with": {}
3295
+ }
3296
+ },
3297
+ "foreignKeys": {
3298
+ "sub_agents_parent_conversation_id_conversations_id_fk": {
3299
+ "name": "sub_agents_parent_conversation_id_conversations_id_fk",
3300
+ "tableFrom": "sub_agents",
3301
+ "tableTo": "conversations",
3302
+ "columnsFrom": [
3303
+ "parent_conversation_id"
3304
+ ],
3305
+ "columnsTo": [
3306
+ "id"
3307
+ ],
3308
+ "onDelete": "no action",
3309
+ "onUpdate": "no action"
3310
+ },
3311
+ "sub_agents_user_id_users_id_fk": {
3312
+ "name": "sub_agents_user_id_users_id_fk",
3313
+ "tableFrom": "sub_agents",
3314
+ "tableTo": "users",
3315
+ "columnsFrom": [
3316
+ "user_id"
3317
+ ],
3318
+ "columnsTo": [
3319
+ "id"
3320
+ ],
3321
+ "onDelete": "no action",
3322
+ "onUpdate": "no action"
3323
+ }
3324
+ },
3325
+ "compositePrimaryKeys": {},
3326
+ "uniqueConstraints": {},
3327
+ "policies": {},
3328
+ "checkConstraints": {},
3329
+ "isRLSEnabled": false
3330
+ },
3331
+ "public.tool_logs": {
3332
+ "name": "tool_logs",
3333
+ "schema": "",
3334
+ "columns": {
3335
+ "id": {
3336
+ "name": "id",
3337
+ "type": "uuid",
3338
+ "primaryKey": true,
3339
+ "notNull": true,
3340
+ "default": "gen_random_uuid()"
3341
+ },
3342
+ "conversation_id": {
3343
+ "name": "conversation_id",
3344
+ "type": "uuid",
3345
+ "primaryKey": false,
3346
+ "notNull": false
3347
+ },
3348
+ "tool_name": {
3349
+ "name": "tool_name",
3350
+ "type": "text",
3351
+ "primaryKey": false,
3352
+ "notNull": true
3353
+ },
3354
+ "input": {
3355
+ "name": "input",
3356
+ "type": "jsonb",
3357
+ "primaryKey": false,
3358
+ "notNull": false
3359
+ },
3360
+ "output": {
3361
+ "name": "output",
3362
+ "type": "jsonb",
3363
+ "primaryKey": false,
3364
+ "notNull": false
3365
+ },
3366
+ "success": {
3367
+ "name": "success",
3368
+ "type": "boolean",
3369
+ "primaryKey": false,
3370
+ "notNull": true
3371
+ },
3372
+ "duration_ms": {
3373
+ "name": "duration_ms",
3374
+ "type": "integer",
3375
+ "primaryKey": false,
3376
+ "notNull": false
3377
+ },
3378
+ "created_at": {
3379
+ "name": "created_at",
3380
+ "type": "timestamp",
3381
+ "primaryKey": false,
3382
+ "notNull": true,
3383
+ "default": "now()"
3384
+ }
3385
+ },
3386
+ "indexes": {
3387
+ "tool_logs_conversation_idx": {
3388
+ "name": "tool_logs_conversation_idx",
3389
+ "columns": [
3390
+ {
3391
+ "expression": "conversation_id",
3392
+ "isExpression": false,
3393
+ "asc": true,
3394
+ "nulls": "last"
3395
+ }
3396
+ ],
3397
+ "isUnique": false,
3398
+ "concurrently": false,
3399
+ "method": "btree",
3400
+ "with": {}
3401
+ }
3402
+ },
3403
+ "foreignKeys": {
3404
+ "tool_logs_conversation_id_conversations_id_fk": {
3405
+ "name": "tool_logs_conversation_id_conversations_id_fk",
3406
+ "tableFrom": "tool_logs",
3407
+ "tableTo": "conversations",
3408
+ "columnsFrom": [
3409
+ "conversation_id"
3410
+ ],
3411
+ "columnsTo": [
3412
+ "id"
3413
+ ],
3414
+ "onDelete": "no action",
3415
+ "onUpdate": "no action"
3416
+ }
3417
+ },
3418
+ "compositePrimaryKeys": {},
3419
+ "uniqueConstraints": {},
3420
+ "policies": {},
3421
+ "checkConstraints": {},
3422
+ "isRLSEnabled": false
3423
+ },
3424
+ "public.two_factor_auth": {
3425
+ "name": "two_factor_auth",
3426
+ "schema": "",
3427
+ "columns": {
3428
+ "id": {
3429
+ "name": "id",
3430
+ "type": "uuid",
3431
+ "primaryKey": true,
3432
+ "notNull": true,
3433
+ "default": "gen_random_uuid()"
3434
+ },
3435
+ "user_id": {
3436
+ "name": "user_id",
3437
+ "type": "uuid",
3438
+ "primaryKey": false,
3439
+ "notNull": true
3440
+ },
3441
+ "secret_encrypted": {
3442
+ "name": "secret_encrypted",
3443
+ "type": "text",
3444
+ "primaryKey": false,
3445
+ "notNull": true
3446
+ },
3447
+ "recovery_codes": {
3448
+ "name": "recovery_codes",
3449
+ "type": "jsonb",
3450
+ "primaryKey": false,
3451
+ "notNull": true
3452
+ },
3453
+ "enabled_at": {
3454
+ "name": "enabled_at",
3455
+ "type": "timestamp",
3456
+ "primaryKey": false,
3457
+ "notNull": true
3458
+ },
3459
+ "last_verified_at": {
3460
+ "name": "last_verified_at",
3461
+ "type": "timestamp",
3462
+ "primaryKey": false,
3463
+ "notNull": false
3464
+ },
3465
+ "key_version": {
3466
+ "name": "key_version",
3467
+ "type": "integer",
3468
+ "primaryKey": false,
3469
+ "notNull": true,
3470
+ "default": 1
3471
+ },
3472
+ "metadata": {
3473
+ "name": "metadata",
3474
+ "type": "jsonb",
3475
+ "primaryKey": false,
3476
+ "notNull": false
3477
+ },
3478
+ "created_at": {
3479
+ "name": "created_at",
3480
+ "type": "timestamp",
3481
+ "primaryKey": false,
3482
+ "notNull": true,
3483
+ "default": "now()"
3484
+ },
3485
+ "updated_at": {
3486
+ "name": "updated_at",
3487
+ "type": "timestamp",
3488
+ "primaryKey": false,
3489
+ "notNull": true,
3490
+ "default": "now()"
3491
+ }
3492
+ },
3493
+ "indexes": {
3494
+ "two_factor_auth_user_idx": {
3495
+ "name": "two_factor_auth_user_idx",
3496
+ "columns": [
3497
+ {
3498
+ "expression": "user_id",
3499
+ "isExpression": false,
3500
+ "asc": true,
3501
+ "nulls": "last"
3502
+ }
3503
+ ],
3504
+ "isUnique": false,
3505
+ "concurrently": false,
3506
+ "method": "btree",
3507
+ "with": {}
3508
+ }
3509
+ },
3510
+ "foreignKeys": {
3511
+ "two_factor_auth_user_id_users_id_fk": {
3512
+ "name": "two_factor_auth_user_id_users_id_fk",
3513
+ "tableFrom": "two_factor_auth",
3514
+ "tableTo": "users",
3515
+ "columnsFrom": [
3516
+ "user_id"
3517
+ ],
3518
+ "columnsTo": [
3519
+ "id"
3520
+ ],
3521
+ "onDelete": "cascade",
3522
+ "onUpdate": "no action"
3523
+ }
3524
+ },
3525
+ "compositePrimaryKeys": {},
3526
+ "uniqueConstraints": {
3527
+ "two_factor_auth_user_id_unique": {
3528
+ "name": "two_factor_auth_user_id_unique",
3529
+ "nullsNotDistinct": false,
3530
+ "columns": [
3531
+ "user_id"
3532
+ ]
3533
+ }
3534
+ },
3535
+ "policies": {},
3536
+ "checkConstraints": {},
3537
+ "isRLSEnabled": false
3538
+ },
3539
+ "public.usage_patterns": {
3540
+ "name": "usage_patterns",
3541
+ "schema": "",
3542
+ "columns": {
3543
+ "id": {
3544
+ "name": "id",
3545
+ "type": "uuid",
3546
+ "primaryKey": true,
3547
+ "notNull": true,
3548
+ "default": "gen_random_uuid()"
3549
+ },
3550
+ "user_id": {
3551
+ "name": "user_id",
3552
+ "type": "uuid",
3553
+ "primaryKey": false,
3554
+ "notNull": true
3555
+ },
3556
+ "pattern_type": {
3557
+ "name": "pattern_type",
3558
+ "type": "text",
3559
+ "primaryKey": false,
3560
+ "notNull": true
3561
+ },
3562
+ "pattern_key": {
3563
+ "name": "pattern_key",
3564
+ "type": "text",
3565
+ "primaryKey": false,
3566
+ "notNull": true
3567
+ },
3568
+ "pattern_data": {
3569
+ "name": "pattern_data",
3570
+ "type": "jsonb",
3571
+ "primaryKey": false,
3572
+ "notNull": false
3573
+ },
3574
+ "confidence": {
3575
+ "name": "confidence",
3576
+ "type": "integer",
3577
+ "primaryKey": false,
3578
+ "notNull": false,
3579
+ "default": 0
3580
+ },
3581
+ "first_seen": {
3582
+ "name": "first_seen",
3583
+ "type": "timestamp",
3584
+ "primaryKey": false,
3585
+ "notNull": true,
3586
+ "default": "now()"
3587
+ },
3588
+ "last_seen": {
3589
+ "name": "last_seen",
3590
+ "type": "timestamp",
3591
+ "primaryKey": false,
3592
+ "notNull": false,
3593
+ "default": "now()"
3594
+ },
3595
+ "occurrences": {
3596
+ "name": "occurrences",
3597
+ "type": "integer",
3598
+ "primaryKey": false,
3599
+ "notNull": false,
3600
+ "default": 1
3601
+ }
3602
+ },
3603
+ "indexes": {
3604
+ "usage_patterns_user_idx": {
3605
+ "name": "usage_patterns_user_idx",
3606
+ "columns": [
3607
+ {
3608
+ "expression": "user_id",
3609
+ "isExpression": false,
3610
+ "asc": true,
3611
+ "nulls": "last"
3612
+ }
3613
+ ],
3614
+ "isUnique": false,
3615
+ "concurrently": false,
3616
+ "method": "btree",
3617
+ "with": {}
3618
+ },
3619
+ "usage_patterns_type_idx": {
3620
+ "name": "usage_patterns_type_idx",
3621
+ "columns": [
3622
+ {
3623
+ "expression": "pattern_type",
3624
+ "isExpression": false,
3625
+ "asc": true,
3626
+ "nulls": "last"
3627
+ }
3628
+ ],
3629
+ "isUnique": false,
3630
+ "concurrently": false,
3631
+ "method": "btree",
3632
+ "with": {}
3633
+ }
3634
+ },
3635
+ "foreignKeys": {
3636
+ "usage_patterns_user_id_users_id_fk": {
3637
+ "name": "usage_patterns_user_id_users_id_fk",
3638
+ "tableFrom": "usage_patterns",
3639
+ "tableTo": "users",
3640
+ "columnsFrom": [
3641
+ "user_id"
3642
+ ],
3643
+ "columnsTo": [
3644
+ "id"
3645
+ ],
3646
+ "onDelete": "no action",
3647
+ "onUpdate": "no action"
3648
+ }
3649
+ },
3650
+ "compositePrimaryKeys": {},
3651
+ "uniqueConstraints": {},
3652
+ "policies": {},
3653
+ "checkConstraints": {},
3654
+ "isRLSEnabled": false
3655
+ },
3656
+ "public.usage_quotas": {
3657
+ "name": "usage_quotas",
3658
+ "schema": "",
3659
+ "columns": {
3660
+ "id": {
3661
+ "name": "id",
3662
+ "type": "uuid",
3663
+ "primaryKey": true,
3664
+ "notNull": true,
3665
+ "default": "gen_random_uuid()"
3666
+ },
3667
+ "user_id": {
3668
+ "name": "user_id",
3669
+ "type": "uuid",
3670
+ "primaryKey": false,
3671
+ "notNull": false
3672
+ },
3673
+ "organization_id": {
3674
+ "name": "organization_id",
3675
+ "type": "uuid",
3676
+ "primaryKey": false,
3677
+ "notNull": false
3678
+ },
3679
+ "quota_type": {
3680
+ "name": "quota_type",
3681
+ "type": "text",
3682
+ "primaryKey": false,
3683
+ "notNull": true
3684
+ },
3685
+ "limit_value": {
3686
+ "name": "limit_value",
3687
+ "type": "integer",
3688
+ "primaryKey": false,
3689
+ "notNull": true
3690
+ },
3691
+ "current_value": {
3692
+ "name": "current_value",
3693
+ "type": "integer",
3694
+ "primaryKey": false,
3695
+ "notNull": false,
3696
+ "default": 0
3697
+ },
3698
+ "reset_at": {
3699
+ "name": "reset_at",
3700
+ "type": "timestamp",
3701
+ "primaryKey": false,
3702
+ "notNull": false
3703
+ },
3704
+ "updated_at": {
3705
+ "name": "updated_at",
3706
+ "type": "timestamp",
3707
+ "primaryKey": false,
3708
+ "notNull": false,
3709
+ "default": "now()"
3710
+ }
3711
+ },
3712
+ "indexes": {
3713
+ "usage_quotas_user_idx": {
3714
+ "name": "usage_quotas_user_idx",
3715
+ "columns": [
3716
+ {
3717
+ "expression": "user_id",
3718
+ "isExpression": false,
3719
+ "asc": true,
3720
+ "nulls": "last"
3721
+ }
3722
+ ],
3723
+ "isUnique": false,
3724
+ "concurrently": false,
3725
+ "method": "btree",
3726
+ "with": {}
3727
+ },
3728
+ "usage_quotas_org_idx": {
3729
+ "name": "usage_quotas_org_idx",
3730
+ "columns": [
3731
+ {
3732
+ "expression": "organization_id",
3733
+ "isExpression": false,
3734
+ "asc": true,
3735
+ "nulls": "last"
3736
+ }
3737
+ ],
3738
+ "isUnique": false,
3739
+ "concurrently": false,
3740
+ "method": "btree",
3741
+ "with": {}
3742
+ }
3743
+ },
3744
+ "foreignKeys": {
3745
+ "usage_quotas_user_id_users_id_fk": {
3746
+ "name": "usage_quotas_user_id_users_id_fk",
3747
+ "tableFrom": "usage_quotas",
3748
+ "tableTo": "users",
3749
+ "columnsFrom": [
3750
+ "user_id"
3751
+ ],
3752
+ "columnsTo": [
3753
+ "id"
3754
+ ],
3755
+ "onDelete": "no action",
3756
+ "onUpdate": "no action"
3757
+ },
3758
+ "usage_quotas_organization_id_organizations_id_fk": {
3759
+ "name": "usage_quotas_organization_id_organizations_id_fk",
3760
+ "tableFrom": "usage_quotas",
3761
+ "tableTo": "organizations",
3762
+ "columnsFrom": [
3763
+ "organization_id"
3764
+ ],
3765
+ "columnsTo": [
3766
+ "id"
3767
+ ],
3768
+ "onDelete": "no action",
3769
+ "onUpdate": "no action"
3770
+ }
3771
+ },
3772
+ "compositePrimaryKeys": {},
3773
+ "uniqueConstraints": {},
3774
+ "policies": {},
3775
+ "checkConstraints": {},
3776
+ "isRLSEnabled": false
3777
+ },
3778
+ "public.user_achievements": {
3779
+ "name": "user_achievements",
3780
+ "schema": "",
3781
+ "columns": {
3782
+ "id": {
3783
+ "name": "id",
3784
+ "type": "uuid",
3785
+ "primaryKey": true,
3786
+ "notNull": true,
3787
+ "default": "gen_random_uuid()"
3788
+ },
3789
+ "user_id": {
3790
+ "name": "user_id",
3791
+ "type": "uuid",
3792
+ "primaryKey": false,
3793
+ "notNull": true
3794
+ },
3795
+ "achievement_id": {
3796
+ "name": "achievement_id",
3797
+ "type": "uuid",
3798
+ "primaryKey": false,
3799
+ "notNull": true
3800
+ },
3801
+ "unlocked_at": {
3802
+ "name": "unlocked_at",
3803
+ "type": "timestamp",
3804
+ "primaryKey": false,
3805
+ "notNull": true,
3806
+ "default": "now()"
3807
+ },
3808
+ "progress": {
3809
+ "name": "progress",
3810
+ "type": "integer",
3811
+ "primaryKey": false,
3812
+ "notNull": false,
3813
+ "default": 100
3814
+ },
3815
+ "notified": {
3816
+ "name": "notified",
3817
+ "type": "boolean",
3818
+ "primaryKey": false,
3819
+ "notNull": false,
3820
+ "default": false
3821
+ }
3822
+ },
3823
+ "indexes": {
3824
+ "user_achievements_user_idx": {
3825
+ "name": "user_achievements_user_idx",
3826
+ "columns": [
3827
+ {
3828
+ "expression": "user_id",
3829
+ "isExpression": false,
3830
+ "asc": true,
3831
+ "nulls": "last"
3832
+ }
3833
+ ],
3834
+ "isUnique": false,
3835
+ "concurrently": false,
3836
+ "method": "btree",
3837
+ "with": {}
3838
+ }
3839
+ },
3840
+ "foreignKeys": {
3841
+ "user_achievements_user_id_users_id_fk": {
3842
+ "name": "user_achievements_user_id_users_id_fk",
3843
+ "tableFrom": "user_achievements",
3844
+ "tableTo": "users",
3845
+ "columnsFrom": [
3846
+ "user_id"
3847
+ ],
3848
+ "columnsTo": [
3849
+ "id"
3850
+ ],
3851
+ "onDelete": "no action",
3852
+ "onUpdate": "no action"
3853
+ },
3854
+ "user_achievements_achievement_id_achievements_id_fk": {
3855
+ "name": "user_achievements_achievement_id_achievements_id_fk",
3856
+ "tableFrom": "user_achievements",
3857
+ "tableTo": "achievements",
3858
+ "columnsFrom": [
3859
+ "achievement_id"
3860
+ ],
3861
+ "columnsTo": [
3862
+ "id"
3863
+ ],
3864
+ "onDelete": "no action",
3865
+ "onUpdate": "no action"
3866
+ }
3867
+ },
3868
+ "compositePrimaryKeys": {},
3869
+ "uniqueConstraints": {},
3870
+ "policies": {},
3871
+ "checkConstraints": {},
3872
+ "isRLSEnabled": false
3873
+ },
3874
+ "public.users": {
3875
+ "name": "users",
3876
+ "schema": "",
3877
+ "columns": {
3878
+ "id": {
3879
+ "name": "id",
3880
+ "type": "uuid",
3881
+ "primaryKey": true,
3882
+ "notNull": true,
3883
+ "default": "gen_random_uuid()"
3884
+ },
3885
+ "telegram_id": {
3886
+ "name": "telegram_id",
3887
+ "type": "text",
3888
+ "primaryKey": false,
3889
+ "notNull": false
3890
+ },
3891
+ "name": {
3892
+ "name": "name",
3893
+ "type": "text",
3894
+ "primaryKey": false,
3895
+ "notNull": false
3896
+ },
3897
+ "preferences": {
3898
+ "name": "preferences",
3899
+ "type": "jsonb",
3900
+ "primaryKey": false,
3901
+ "notNull": false
3902
+ },
3903
+ "created_at": {
3904
+ "name": "created_at",
3905
+ "type": "timestamp",
3906
+ "primaryKey": false,
3907
+ "notNull": true,
3908
+ "default": "now()"
3909
+ },
3910
+ "updated_at": {
3911
+ "name": "updated_at",
3912
+ "type": "timestamp",
3913
+ "primaryKey": false,
3914
+ "notNull": true,
3915
+ "default": "now()"
3916
+ }
3917
+ },
3918
+ "indexes": {},
3919
+ "foreignKeys": {},
3920
+ "compositePrimaryKeys": {},
3921
+ "uniqueConstraints": {
3922
+ "users_telegram_id_unique": {
3923
+ "name": "users_telegram_id_unique",
3924
+ "nullsNotDistinct": false,
3925
+ "columns": [
3926
+ "telegram_id"
3927
+ ]
3928
+ }
3929
+ },
3930
+ "policies": {},
3931
+ "checkConstraints": {},
3932
+ "isRLSEnabled": false
3933
+ }
3934
+ },
3935
+ "enums": {},
3936
+ "schemas": {},
3937
+ "sequences": {},
3938
+ "roles": {},
3939
+ "policies": {},
3940
+ "views": {},
3941
+ "_meta": {
3942
+ "columns": {},
3943
+ "schemas": {},
3944
+ "tables": {}
3945
+ }
3946
+ }