nao-core 0.0.38__py3-none-manylinux2014_aarch64.whl

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 (98) hide show
  1. nao_core/__init__.py +2 -0
  2. nao_core/__init__.py.bak +2 -0
  3. nao_core/bin/build-info.json +5 -0
  4. nao_core/bin/fastapi/main.py +268 -0
  5. nao_core/bin/fastapi/test_main.py +156 -0
  6. nao_core/bin/migrations-postgres/0000_user_auth_and_chat_tables.sql +98 -0
  7. nao_core/bin/migrations-postgres/0001_message_feedback.sql +9 -0
  8. nao_core/bin/migrations-postgres/0002_chat_message_stop_reason_and_error_message.sql +2 -0
  9. nao_core/bin/migrations-postgres/0003_handle_slack_with_thread.sql +2 -0
  10. nao_core/bin/migrations-postgres/0004_input_and_output_tokens.sql +8 -0
  11. nao_core/bin/migrations-postgres/0005_add_project_tables.sql +39 -0
  12. nao_core/bin/migrations-postgres/0006_llm_model_ids.sql +4 -0
  13. nao_core/bin/migrations-postgres/0007_chat_message_llm_info.sql +2 -0
  14. nao_core/bin/migrations-postgres/meta/0000_snapshot.json +707 -0
  15. nao_core/bin/migrations-postgres/meta/0001_snapshot.json +766 -0
  16. nao_core/bin/migrations-postgres/meta/0002_snapshot.json +778 -0
  17. nao_core/bin/migrations-postgres/meta/0003_snapshot.json +799 -0
  18. nao_core/bin/migrations-postgres/meta/0004_snapshot.json +847 -0
  19. nao_core/bin/migrations-postgres/meta/0005_snapshot.json +1129 -0
  20. nao_core/bin/migrations-postgres/meta/0006_snapshot.json +1141 -0
  21. nao_core/bin/migrations-postgres/meta/_journal.json +62 -0
  22. nao_core/bin/migrations-sqlite/0000_user_auth_and_chat_tables.sql +98 -0
  23. nao_core/bin/migrations-sqlite/0001_message_feedback.sql +8 -0
  24. nao_core/bin/migrations-sqlite/0002_chat_message_stop_reason_and_error_message.sql +2 -0
  25. nao_core/bin/migrations-sqlite/0003_handle_slack_with_thread.sql +2 -0
  26. nao_core/bin/migrations-sqlite/0004_input_and_output_tokens.sql +8 -0
  27. nao_core/bin/migrations-sqlite/0005_add_project_tables.sql +38 -0
  28. nao_core/bin/migrations-sqlite/0006_llm_model_ids.sql +4 -0
  29. nao_core/bin/migrations-sqlite/0007_chat_message_llm_info.sql +2 -0
  30. nao_core/bin/migrations-sqlite/meta/0000_snapshot.json +674 -0
  31. nao_core/bin/migrations-sqlite/meta/0001_snapshot.json +735 -0
  32. nao_core/bin/migrations-sqlite/meta/0002_snapshot.json +749 -0
  33. nao_core/bin/migrations-sqlite/meta/0003_snapshot.json +763 -0
  34. nao_core/bin/migrations-sqlite/meta/0004_snapshot.json +819 -0
  35. nao_core/bin/migrations-sqlite/meta/0005_snapshot.json +1086 -0
  36. nao_core/bin/migrations-sqlite/meta/0006_snapshot.json +1100 -0
  37. nao_core/bin/migrations-sqlite/meta/_journal.json +62 -0
  38. nao_core/bin/nao-chat-server +0 -0
  39. nao_core/bin/public/assets/code-block-F6WJLWQG-CV0uOmNJ.js +153 -0
  40. nao_core/bin/public/assets/index-DcbndLHo.css +1 -0
  41. nao_core/bin/public/assets/index-t1hZI3nl.js +560 -0
  42. nao_core/bin/public/favicon.ico +0 -0
  43. nao_core/bin/public/index.html +18 -0
  44. nao_core/bin/rg +0 -0
  45. nao_core/commands/__init__.py +6 -0
  46. nao_core/commands/chat.py +225 -0
  47. nao_core/commands/debug.py +158 -0
  48. nao_core/commands/init.py +358 -0
  49. nao_core/commands/sync/__init__.py +124 -0
  50. nao_core/commands/sync/accessors.py +290 -0
  51. nao_core/commands/sync/cleanup.py +156 -0
  52. nao_core/commands/sync/providers/__init__.py +32 -0
  53. nao_core/commands/sync/providers/base.py +113 -0
  54. nao_core/commands/sync/providers/databases/__init__.py +17 -0
  55. nao_core/commands/sync/providers/databases/bigquery.py +79 -0
  56. nao_core/commands/sync/providers/databases/databricks.py +79 -0
  57. nao_core/commands/sync/providers/databases/duckdb.py +78 -0
  58. nao_core/commands/sync/providers/databases/postgres.py +79 -0
  59. nao_core/commands/sync/providers/databases/provider.py +129 -0
  60. nao_core/commands/sync/providers/databases/snowflake.py +79 -0
  61. nao_core/commands/sync/providers/notion/__init__.py +5 -0
  62. nao_core/commands/sync/providers/notion/provider.py +205 -0
  63. nao_core/commands/sync/providers/repositories/__init__.py +5 -0
  64. nao_core/commands/sync/providers/repositories/provider.py +134 -0
  65. nao_core/commands/sync/registry.py +23 -0
  66. nao_core/config/__init__.py +30 -0
  67. nao_core/config/base.py +100 -0
  68. nao_core/config/databases/__init__.py +55 -0
  69. nao_core/config/databases/base.py +85 -0
  70. nao_core/config/databases/bigquery.py +99 -0
  71. nao_core/config/databases/databricks.py +79 -0
  72. nao_core/config/databases/duckdb.py +41 -0
  73. nao_core/config/databases/postgres.py +83 -0
  74. nao_core/config/databases/snowflake.py +125 -0
  75. nao_core/config/exceptions.py +7 -0
  76. nao_core/config/llm/__init__.py +19 -0
  77. nao_core/config/notion/__init__.py +8 -0
  78. nao_core/config/repos/__init__.py +3 -0
  79. nao_core/config/repos/base.py +11 -0
  80. nao_core/config/slack/__init__.py +12 -0
  81. nao_core/context/__init__.py +54 -0
  82. nao_core/context/base.py +57 -0
  83. nao_core/context/git.py +177 -0
  84. nao_core/context/local.py +59 -0
  85. nao_core/main.py +13 -0
  86. nao_core/templates/__init__.py +41 -0
  87. nao_core/templates/context.py +193 -0
  88. nao_core/templates/defaults/databases/columns.md.j2 +23 -0
  89. nao_core/templates/defaults/databases/description.md.j2 +32 -0
  90. nao_core/templates/defaults/databases/preview.md.j2 +22 -0
  91. nao_core/templates/defaults/databases/profiling.md.j2 +34 -0
  92. nao_core/templates/engine.py +133 -0
  93. nao_core/templates/render.py +196 -0
  94. nao_core-0.0.38.dist-info/METADATA +150 -0
  95. nao_core-0.0.38.dist-info/RECORD +98 -0
  96. nao_core-0.0.38.dist-info/WHEEL +4 -0
  97. nao_core-0.0.38.dist-info/entry_points.txt +2 -0
  98. nao_core-0.0.38.dist-info/licenses/LICENSE +22 -0
@@ -0,0 +1,1141 @@
1
+ {
2
+ "id": "aafed8bb-ee2e-4a38-b934-8ba27f382601",
3
+ "prevId": "00555437-2213-4363-91e0-bd40e45920a5",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "account_id": {
18
+ "name": "account_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "provider_id": {
24
+ "name": "provider_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "user_id": {
30
+ "name": "user_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "id_token": {
48
+ "name": "id_token",
49
+ "type": "text",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "access_token_expires_at": {
54
+ "name": "access_token_expires_at",
55
+ "type": "timestamp",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "refresh_token_expires_at": {
60
+ "name": "refresh_token_expires_at",
61
+ "type": "timestamp",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "scope": {
66
+ "name": "scope",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true
89
+ }
90
+ },
91
+ "indexes": {
92
+ "account_userId_idx": {
93
+ "name": "account_userId_idx",
94
+ "columns": [
95
+ {
96
+ "expression": "user_id",
97
+ "isExpression": false,
98
+ "asc": true,
99
+ "nulls": "last"
100
+ }
101
+ ],
102
+ "isUnique": false,
103
+ "concurrently": false,
104
+ "method": "btree",
105
+ "with": {}
106
+ }
107
+ },
108
+ "foreignKeys": {
109
+ "account_user_id_user_id_fk": {
110
+ "name": "account_user_id_user_id_fk",
111
+ "tableFrom": "account",
112
+ "tableTo": "user",
113
+ "columnsFrom": [
114
+ "user_id"
115
+ ],
116
+ "columnsTo": [
117
+ "id"
118
+ ],
119
+ "onDelete": "cascade",
120
+ "onUpdate": "no action"
121
+ }
122
+ },
123
+ "compositePrimaryKeys": {},
124
+ "uniqueConstraints": {},
125
+ "policies": {},
126
+ "checkConstraints": {},
127
+ "isRLSEnabled": false
128
+ },
129
+ "public.chat": {
130
+ "name": "chat",
131
+ "schema": "",
132
+ "columns": {
133
+ "id": {
134
+ "name": "id",
135
+ "type": "text",
136
+ "primaryKey": true,
137
+ "notNull": true
138
+ },
139
+ "user_id": {
140
+ "name": "user_id",
141
+ "type": "text",
142
+ "primaryKey": false,
143
+ "notNull": true
144
+ },
145
+ "project_id": {
146
+ "name": "project_id",
147
+ "type": "text",
148
+ "primaryKey": false,
149
+ "notNull": true
150
+ },
151
+ "title": {
152
+ "name": "title",
153
+ "type": "text",
154
+ "primaryKey": false,
155
+ "notNull": true,
156
+ "default": "'New Conversation'"
157
+ },
158
+ "slack_thread_id": {
159
+ "name": "slack_thread_id",
160
+ "type": "text",
161
+ "primaryKey": false,
162
+ "notNull": false
163
+ },
164
+ "created_at": {
165
+ "name": "created_at",
166
+ "type": "timestamp",
167
+ "primaryKey": false,
168
+ "notNull": true,
169
+ "default": "now()"
170
+ },
171
+ "updated_at": {
172
+ "name": "updated_at",
173
+ "type": "timestamp",
174
+ "primaryKey": false,
175
+ "notNull": true,
176
+ "default": "now()"
177
+ }
178
+ },
179
+ "indexes": {
180
+ "chat_userId_idx": {
181
+ "name": "chat_userId_idx",
182
+ "columns": [
183
+ {
184
+ "expression": "user_id",
185
+ "isExpression": false,
186
+ "asc": true,
187
+ "nulls": "last"
188
+ }
189
+ ],
190
+ "isUnique": false,
191
+ "concurrently": false,
192
+ "method": "btree",
193
+ "with": {}
194
+ },
195
+ "chat_projectId_idx": {
196
+ "name": "chat_projectId_idx",
197
+ "columns": [
198
+ {
199
+ "expression": "project_id",
200
+ "isExpression": false,
201
+ "asc": true,
202
+ "nulls": "last"
203
+ }
204
+ ],
205
+ "isUnique": false,
206
+ "concurrently": false,
207
+ "method": "btree",
208
+ "with": {}
209
+ },
210
+ "chat_slack_thread_idx": {
211
+ "name": "chat_slack_thread_idx",
212
+ "columns": [
213
+ {
214
+ "expression": "slack_thread_id",
215
+ "isExpression": false,
216
+ "asc": true,
217
+ "nulls": "last"
218
+ }
219
+ ],
220
+ "isUnique": false,
221
+ "concurrently": false,
222
+ "method": "btree",
223
+ "with": {}
224
+ }
225
+ },
226
+ "foreignKeys": {
227
+ "chat_user_id_user_id_fk": {
228
+ "name": "chat_user_id_user_id_fk",
229
+ "tableFrom": "chat",
230
+ "tableTo": "user",
231
+ "columnsFrom": [
232
+ "user_id"
233
+ ],
234
+ "columnsTo": [
235
+ "id"
236
+ ],
237
+ "onDelete": "cascade",
238
+ "onUpdate": "no action"
239
+ },
240
+ "chat_project_id_project_id_fk": {
241
+ "name": "chat_project_id_project_id_fk",
242
+ "tableFrom": "chat",
243
+ "tableTo": "project",
244
+ "columnsFrom": [
245
+ "project_id"
246
+ ],
247
+ "columnsTo": [
248
+ "id"
249
+ ],
250
+ "onDelete": "cascade",
251
+ "onUpdate": "no action"
252
+ }
253
+ },
254
+ "compositePrimaryKeys": {},
255
+ "uniqueConstraints": {},
256
+ "policies": {},
257
+ "checkConstraints": {},
258
+ "isRLSEnabled": false
259
+ },
260
+ "public.chat_message": {
261
+ "name": "chat_message",
262
+ "schema": "",
263
+ "columns": {
264
+ "id": {
265
+ "name": "id",
266
+ "type": "text",
267
+ "primaryKey": true,
268
+ "notNull": true
269
+ },
270
+ "chat_id": {
271
+ "name": "chat_id",
272
+ "type": "text",
273
+ "primaryKey": false,
274
+ "notNull": true
275
+ },
276
+ "role": {
277
+ "name": "role",
278
+ "type": "text",
279
+ "primaryKey": false,
280
+ "notNull": true
281
+ },
282
+ "stop_reason": {
283
+ "name": "stop_reason",
284
+ "type": "text",
285
+ "primaryKey": false,
286
+ "notNull": false
287
+ },
288
+ "error_message": {
289
+ "name": "error_message",
290
+ "type": "text",
291
+ "primaryKey": false,
292
+ "notNull": false
293
+ },
294
+ "created_at": {
295
+ "name": "created_at",
296
+ "type": "timestamp",
297
+ "primaryKey": false,
298
+ "notNull": true,
299
+ "default": "now()"
300
+ }
301
+ },
302
+ "indexes": {
303
+ "chat_message_chatId_idx": {
304
+ "name": "chat_message_chatId_idx",
305
+ "columns": [
306
+ {
307
+ "expression": "chat_id",
308
+ "isExpression": false,
309
+ "asc": true,
310
+ "nulls": "last"
311
+ }
312
+ ],
313
+ "isUnique": false,
314
+ "concurrently": false,
315
+ "method": "btree",
316
+ "with": {}
317
+ },
318
+ "chat_message_createdAt_idx": {
319
+ "name": "chat_message_createdAt_idx",
320
+ "columns": [
321
+ {
322
+ "expression": "created_at",
323
+ "isExpression": false,
324
+ "asc": true,
325
+ "nulls": "last"
326
+ }
327
+ ],
328
+ "isUnique": false,
329
+ "concurrently": false,
330
+ "method": "btree",
331
+ "with": {}
332
+ }
333
+ },
334
+ "foreignKeys": {
335
+ "chat_message_chat_id_chat_id_fk": {
336
+ "name": "chat_message_chat_id_chat_id_fk",
337
+ "tableFrom": "chat_message",
338
+ "tableTo": "chat",
339
+ "columnsFrom": [
340
+ "chat_id"
341
+ ],
342
+ "columnsTo": [
343
+ "id"
344
+ ],
345
+ "onDelete": "cascade",
346
+ "onUpdate": "no action"
347
+ }
348
+ },
349
+ "compositePrimaryKeys": {},
350
+ "uniqueConstraints": {},
351
+ "policies": {},
352
+ "checkConstraints": {},
353
+ "isRLSEnabled": false
354
+ },
355
+ "public.message_feedback": {
356
+ "name": "message_feedback",
357
+ "schema": "",
358
+ "columns": {
359
+ "message_id": {
360
+ "name": "message_id",
361
+ "type": "text",
362
+ "primaryKey": true,
363
+ "notNull": true
364
+ },
365
+ "vote": {
366
+ "name": "vote",
367
+ "type": "text",
368
+ "primaryKey": false,
369
+ "notNull": true
370
+ },
371
+ "explanation": {
372
+ "name": "explanation",
373
+ "type": "text",
374
+ "primaryKey": false,
375
+ "notNull": false
376
+ },
377
+ "created_at": {
378
+ "name": "created_at",
379
+ "type": "timestamp",
380
+ "primaryKey": false,
381
+ "notNull": true,
382
+ "default": "now()"
383
+ },
384
+ "updated_at": {
385
+ "name": "updated_at",
386
+ "type": "timestamp",
387
+ "primaryKey": false,
388
+ "notNull": true,
389
+ "default": "now()"
390
+ }
391
+ },
392
+ "indexes": {},
393
+ "foreignKeys": {
394
+ "message_feedback_message_id_chat_message_id_fk": {
395
+ "name": "message_feedback_message_id_chat_message_id_fk",
396
+ "tableFrom": "message_feedback",
397
+ "tableTo": "chat_message",
398
+ "columnsFrom": [
399
+ "message_id"
400
+ ],
401
+ "columnsTo": [
402
+ "id"
403
+ ],
404
+ "onDelete": "cascade",
405
+ "onUpdate": "no action"
406
+ }
407
+ },
408
+ "compositePrimaryKeys": {},
409
+ "uniqueConstraints": {},
410
+ "policies": {},
411
+ "checkConstraints": {},
412
+ "isRLSEnabled": false
413
+ },
414
+ "public.message_part": {
415
+ "name": "message_part",
416
+ "schema": "",
417
+ "columns": {
418
+ "id": {
419
+ "name": "id",
420
+ "type": "text",
421
+ "primaryKey": true,
422
+ "notNull": true
423
+ },
424
+ "message_id": {
425
+ "name": "message_id",
426
+ "type": "text",
427
+ "primaryKey": false,
428
+ "notNull": true
429
+ },
430
+ "order": {
431
+ "name": "order",
432
+ "type": "integer",
433
+ "primaryKey": false,
434
+ "notNull": true
435
+ },
436
+ "created_at": {
437
+ "name": "created_at",
438
+ "type": "timestamp",
439
+ "primaryKey": false,
440
+ "notNull": true,
441
+ "default": "now()"
442
+ },
443
+ "type": {
444
+ "name": "type",
445
+ "type": "text",
446
+ "primaryKey": false,
447
+ "notNull": true
448
+ },
449
+ "text": {
450
+ "name": "text",
451
+ "type": "text",
452
+ "primaryKey": false,
453
+ "notNull": false
454
+ },
455
+ "reasoning_text": {
456
+ "name": "reasoning_text",
457
+ "type": "text",
458
+ "primaryKey": false,
459
+ "notNull": false
460
+ },
461
+ "input_total_tokens": {
462
+ "name": "input_total_tokens",
463
+ "type": "integer",
464
+ "primaryKey": false,
465
+ "notNull": false
466
+ },
467
+ "input_no_cache_tokens": {
468
+ "name": "input_no_cache_tokens",
469
+ "type": "integer",
470
+ "primaryKey": false,
471
+ "notNull": false
472
+ },
473
+ "input_cache_read_tokens": {
474
+ "name": "input_cache_read_tokens",
475
+ "type": "integer",
476
+ "primaryKey": false,
477
+ "notNull": false
478
+ },
479
+ "input_cache_write_tokens": {
480
+ "name": "input_cache_write_tokens",
481
+ "type": "integer",
482
+ "primaryKey": false,
483
+ "notNull": false
484
+ },
485
+ "output_total_tokens": {
486
+ "name": "output_total_tokens",
487
+ "type": "integer",
488
+ "primaryKey": false,
489
+ "notNull": false
490
+ },
491
+ "output_text_tokens": {
492
+ "name": "output_text_tokens",
493
+ "type": "integer",
494
+ "primaryKey": false,
495
+ "notNull": false
496
+ },
497
+ "output_reasoning_tokens": {
498
+ "name": "output_reasoning_tokens",
499
+ "type": "integer",
500
+ "primaryKey": false,
501
+ "notNull": false
502
+ },
503
+ "total_tokens": {
504
+ "name": "total_tokens",
505
+ "type": "integer",
506
+ "primaryKey": false,
507
+ "notNull": false
508
+ },
509
+ "tool_call_id": {
510
+ "name": "tool_call_id",
511
+ "type": "text",
512
+ "primaryKey": false,
513
+ "notNull": false
514
+ },
515
+ "tool_name": {
516
+ "name": "tool_name",
517
+ "type": "text",
518
+ "primaryKey": false,
519
+ "notNull": false
520
+ },
521
+ "tool_state": {
522
+ "name": "tool_state",
523
+ "type": "text",
524
+ "primaryKey": false,
525
+ "notNull": false
526
+ },
527
+ "tool_error_text": {
528
+ "name": "tool_error_text",
529
+ "type": "text",
530
+ "primaryKey": false,
531
+ "notNull": false
532
+ },
533
+ "tool_input": {
534
+ "name": "tool_input",
535
+ "type": "jsonb",
536
+ "primaryKey": false,
537
+ "notNull": false
538
+ },
539
+ "tool_output": {
540
+ "name": "tool_output",
541
+ "type": "jsonb",
542
+ "primaryKey": false,
543
+ "notNull": false
544
+ },
545
+ "tool_approval_id": {
546
+ "name": "tool_approval_id",
547
+ "type": "text",
548
+ "primaryKey": false,
549
+ "notNull": false
550
+ },
551
+ "tool_approval_approved": {
552
+ "name": "tool_approval_approved",
553
+ "type": "boolean",
554
+ "primaryKey": false,
555
+ "notNull": false
556
+ },
557
+ "tool_approval_reason": {
558
+ "name": "tool_approval_reason",
559
+ "type": "text",
560
+ "primaryKey": false,
561
+ "notNull": false
562
+ }
563
+ },
564
+ "indexes": {
565
+ "parts_message_id_idx": {
566
+ "name": "parts_message_id_idx",
567
+ "columns": [
568
+ {
569
+ "expression": "message_id",
570
+ "isExpression": false,
571
+ "asc": true,
572
+ "nulls": "last"
573
+ }
574
+ ],
575
+ "isUnique": false,
576
+ "concurrently": false,
577
+ "method": "btree",
578
+ "with": {}
579
+ },
580
+ "parts_message_id_order_idx": {
581
+ "name": "parts_message_id_order_idx",
582
+ "columns": [
583
+ {
584
+ "expression": "message_id",
585
+ "isExpression": false,
586
+ "asc": true,
587
+ "nulls": "last"
588
+ },
589
+ {
590
+ "expression": "order",
591
+ "isExpression": false,
592
+ "asc": true,
593
+ "nulls": "last"
594
+ }
595
+ ],
596
+ "isUnique": false,
597
+ "concurrently": false,
598
+ "method": "btree",
599
+ "with": {}
600
+ }
601
+ },
602
+ "foreignKeys": {
603
+ "message_part_message_id_chat_message_id_fk": {
604
+ "name": "message_part_message_id_chat_message_id_fk",
605
+ "tableFrom": "message_part",
606
+ "tableTo": "chat_message",
607
+ "columnsFrom": [
608
+ "message_id"
609
+ ],
610
+ "columnsTo": [
611
+ "id"
612
+ ],
613
+ "onDelete": "cascade",
614
+ "onUpdate": "no action"
615
+ }
616
+ },
617
+ "compositePrimaryKeys": {},
618
+ "uniqueConstraints": {},
619
+ "policies": {},
620
+ "checkConstraints": {
621
+ "text_required_if_type_is_text": {
622
+ "name": "text_required_if_type_is_text",
623
+ "value": "CASE WHEN \"message_part\".\"type\" = 'text' THEN \"message_part\".\"text\" IS NOT NULL ELSE TRUE END"
624
+ },
625
+ "reasoning_text_required_if_type_is_reasoning": {
626
+ "name": "reasoning_text_required_if_type_is_reasoning",
627
+ "value": "CASE WHEN \"message_part\".\"type\" = 'reasoning' THEN \"message_part\".\"reasoning_text\" IS NOT NULL ELSE TRUE END"
628
+ },
629
+ "tool_call_fields_required": {
630
+ "name": "tool_call_fields_required",
631
+ "value": "CASE WHEN \"message_part\".\"type\" LIKE 'tool-%' THEN \"message_part\".\"tool_call_id\" IS NOT NULL AND \"message_part\".\"tool_state\" IS NOT NULL ELSE TRUE END"
632
+ }
633
+ },
634
+ "isRLSEnabled": false
635
+ },
636
+ "public.project": {
637
+ "name": "project",
638
+ "schema": "",
639
+ "columns": {
640
+ "id": {
641
+ "name": "id",
642
+ "type": "text",
643
+ "primaryKey": true,
644
+ "notNull": true
645
+ },
646
+ "name": {
647
+ "name": "name",
648
+ "type": "text",
649
+ "primaryKey": false,
650
+ "notNull": true
651
+ },
652
+ "type": {
653
+ "name": "type",
654
+ "type": "text",
655
+ "primaryKey": false,
656
+ "notNull": true
657
+ },
658
+ "path": {
659
+ "name": "path",
660
+ "type": "text",
661
+ "primaryKey": false,
662
+ "notNull": false
663
+ },
664
+ "slack_bot_token": {
665
+ "name": "slack_bot_token",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": false
669
+ },
670
+ "slack_signing_secret": {
671
+ "name": "slack_signing_secret",
672
+ "type": "text",
673
+ "primaryKey": false,
674
+ "notNull": false
675
+ },
676
+ "created_at": {
677
+ "name": "created_at",
678
+ "type": "timestamp",
679
+ "primaryKey": false,
680
+ "notNull": true,
681
+ "default": "now()"
682
+ },
683
+ "updated_at": {
684
+ "name": "updated_at",
685
+ "type": "timestamp",
686
+ "primaryKey": false,
687
+ "notNull": true,
688
+ "default": "now()"
689
+ }
690
+ },
691
+ "indexes": {},
692
+ "foreignKeys": {},
693
+ "compositePrimaryKeys": {},
694
+ "uniqueConstraints": {},
695
+ "policies": {},
696
+ "checkConstraints": {
697
+ "local_project_path_required": {
698
+ "name": "local_project_path_required",
699
+ "value": "CASE WHEN \"project\".\"type\" = 'local' THEN \"project\".\"path\" IS NOT NULL ELSE TRUE END"
700
+ }
701
+ },
702
+ "isRLSEnabled": false
703
+ },
704
+ "public.project_llm_config": {
705
+ "name": "project_llm_config",
706
+ "schema": "",
707
+ "columns": {
708
+ "id": {
709
+ "name": "id",
710
+ "type": "text",
711
+ "primaryKey": true,
712
+ "notNull": true
713
+ },
714
+ "project_id": {
715
+ "name": "project_id",
716
+ "type": "text",
717
+ "primaryKey": false,
718
+ "notNull": true
719
+ },
720
+ "provider": {
721
+ "name": "provider",
722
+ "type": "text",
723
+ "primaryKey": false,
724
+ "notNull": true
725
+ },
726
+ "api_key": {
727
+ "name": "api_key",
728
+ "type": "text",
729
+ "primaryKey": false,
730
+ "notNull": true
731
+ },
732
+ "enabled_models": {
733
+ "name": "enabled_models",
734
+ "type": "jsonb",
735
+ "primaryKey": false,
736
+ "notNull": true,
737
+ "default": "'[]'::jsonb"
738
+ },
739
+ "base_url": {
740
+ "name": "base_url",
741
+ "type": "text",
742
+ "primaryKey": false,
743
+ "notNull": false
744
+ },
745
+ "created_at": {
746
+ "name": "created_at",
747
+ "type": "timestamp",
748
+ "primaryKey": false,
749
+ "notNull": true,
750
+ "default": "now()"
751
+ },
752
+ "updated_at": {
753
+ "name": "updated_at",
754
+ "type": "timestamp",
755
+ "primaryKey": false,
756
+ "notNull": true,
757
+ "default": "now()"
758
+ }
759
+ },
760
+ "indexes": {
761
+ "project_llm_config_projectId_idx": {
762
+ "name": "project_llm_config_projectId_idx",
763
+ "columns": [
764
+ {
765
+ "expression": "project_id",
766
+ "isExpression": false,
767
+ "asc": true,
768
+ "nulls": "last"
769
+ }
770
+ ],
771
+ "isUnique": false,
772
+ "concurrently": false,
773
+ "method": "btree",
774
+ "with": {}
775
+ }
776
+ },
777
+ "foreignKeys": {
778
+ "project_llm_config_project_id_project_id_fk": {
779
+ "name": "project_llm_config_project_id_project_id_fk",
780
+ "tableFrom": "project_llm_config",
781
+ "tableTo": "project",
782
+ "columnsFrom": [
783
+ "project_id"
784
+ ],
785
+ "columnsTo": [
786
+ "id"
787
+ ],
788
+ "onDelete": "cascade",
789
+ "onUpdate": "no action"
790
+ }
791
+ },
792
+ "compositePrimaryKeys": {},
793
+ "uniqueConstraints": {
794
+ "project_llm_config_project_provider": {
795
+ "name": "project_llm_config_project_provider",
796
+ "nullsNotDistinct": false,
797
+ "columns": [
798
+ "project_id",
799
+ "provider"
800
+ ]
801
+ }
802
+ },
803
+ "policies": {},
804
+ "checkConstraints": {},
805
+ "isRLSEnabled": false
806
+ },
807
+ "public.project_member": {
808
+ "name": "project_member",
809
+ "schema": "",
810
+ "columns": {
811
+ "project_id": {
812
+ "name": "project_id",
813
+ "type": "text",
814
+ "primaryKey": false,
815
+ "notNull": true
816
+ },
817
+ "user_id": {
818
+ "name": "user_id",
819
+ "type": "text",
820
+ "primaryKey": false,
821
+ "notNull": true
822
+ },
823
+ "role": {
824
+ "name": "role",
825
+ "type": "text",
826
+ "primaryKey": false,
827
+ "notNull": true
828
+ },
829
+ "created_at": {
830
+ "name": "created_at",
831
+ "type": "timestamp",
832
+ "primaryKey": false,
833
+ "notNull": true,
834
+ "default": "now()"
835
+ }
836
+ },
837
+ "indexes": {
838
+ "project_member_userId_idx": {
839
+ "name": "project_member_userId_idx",
840
+ "columns": [
841
+ {
842
+ "expression": "user_id",
843
+ "isExpression": false,
844
+ "asc": true,
845
+ "nulls": "last"
846
+ }
847
+ ],
848
+ "isUnique": false,
849
+ "concurrently": false,
850
+ "method": "btree",
851
+ "with": {}
852
+ }
853
+ },
854
+ "foreignKeys": {
855
+ "project_member_project_id_project_id_fk": {
856
+ "name": "project_member_project_id_project_id_fk",
857
+ "tableFrom": "project_member",
858
+ "tableTo": "project",
859
+ "columnsFrom": [
860
+ "project_id"
861
+ ],
862
+ "columnsTo": [
863
+ "id"
864
+ ],
865
+ "onDelete": "cascade",
866
+ "onUpdate": "no action"
867
+ },
868
+ "project_member_user_id_user_id_fk": {
869
+ "name": "project_member_user_id_user_id_fk",
870
+ "tableFrom": "project_member",
871
+ "tableTo": "user",
872
+ "columnsFrom": [
873
+ "user_id"
874
+ ],
875
+ "columnsTo": [
876
+ "id"
877
+ ],
878
+ "onDelete": "cascade",
879
+ "onUpdate": "no action"
880
+ }
881
+ },
882
+ "compositePrimaryKeys": {
883
+ "project_member_project_id_user_id_pk": {
884
+ "name": "project_member_project_id_user_id_pk",
885
+ "columns": [
886
+ "project_id",
887
+ "user_id"
888
+ ]
889
+ }
890
+ },
891
+ "uniqueConstraints": {},
892
+ "policies": {},
893
+ "checkConstraints": {},
894
+ "isRLSEnabled": false
895
+ },
896
+ "public.session": {
897
+ "name": "session",
898
+ "schema": "",
899
+ "columns": {
900
+ "id": {
901
+ "name": "id",
902
+ "type": "text",
903
+ "primaryKey": true,
904
+ "notNull": true
905
+ },
906
+ "expires_at": {
907
+ "name": "expires_at",
908
+ "type": "timestamp",
909
+ "primaryKey": false,
910
+ "notNull": true
911
+ },
912
+ "token": {
913
+ "name": "token",
914
+ "type": "text",
915
+ "primaryKey": false,
916
+ "notNull": true
917
+ },
918
+ "created_at": {
919
+ "name": "created_at",
920
+ "type": "timestamp",
921
+ "primaryKey": false,
922
+ "notNull": true,
923
+ "default": "now()"
924
+ },
925
+ "updated_at": {
926
+ "name": "updated_at",
927
+ "type": "timestamp",
928
+ "primaryKey": false,
929
+ "notNull": true
930
+ },
931
+ "ip_address": {
932
+ "name": "ip_address",
933
+ "type": "text",
934
+ "primaryKey": false,
935
+ "notNull": false
936
+ },
937
+ "user_agent": {
938
+ "name": "user_agent",
939
+ "type": "text",
940
+ "primaryKey": false,
941
+ "notNull": false
942
+ },
943
+ "user_id": {
944
+ "name": "user_id",
945
+ "type": "text",
946
+ "primaryKey": false,
947
+ "notNull": true
948
+ }
949
+ },
950
+ "indexes": {
951
+ "session_userId_idx": {
952
+ "name": "session_userId_idx",
953
+ "columns": [
954
+ {
955
+ "expression": "user_id",
956
+ "isExpression": false,
957
+ "asc": true,
958
+ "nulls": "last"
959
+ }
960
+ ],
961
+ "isUnique": false,
962
+ "concurrently": false,
963
+ "method": "btree",
964
+ "with": {}
965
+ }
966
+ },
967
+ "foreignKeys": {
968
+ "session_user_id_user_id_fk": {
969
+ "name": "session_user_id_user_id_fk",
970
+ "tableFrom": "session",
971
+ "tableTo": "user",
972
+ "columnsFrom": [
973
+ "user_id"
974
+ ],
975
+ "columnsTo": [
976
+ "id"
977
+ ],
978
+ "onDelete": "cascade",
979
+ "onUpdate": "no action"
980
+ }
981
+ },
982
+ "compositePrimaryKeys": {},
983
+ "uniqueConstraints": {
984
+ "session_token_unique": {
985
+ "name": "session_token_unique",
986
+ "nullsNotDistinct": false,
987
+ "columns": [
988
+ "token"
989
+ ]
990
+ }
991
+ },
992
+ "policies": {},
993
+ "checkConstraints": {},
994
+ "isRLSEnabled": false
995
+ },
996
+ "public.user": {
997
+ "name": "user",
998
+ "schema": "",
999
+ "columns": {
1000
+ "id": {
1001
+ "name": "id",
1002
+ "type": "text",
1003
+ "primaryKey": true,
1004
+ "notNull": true
1005
+ },
1006
+ "name": {
1007
+ "name": "name",
1008
+ "type": "text",
1009
+ "primaryKey": false,
1010
+ "notNull": true
1011
+ },
1012
+ "email": {
1013
+ "name": "email",
1014
+ "type": "text",
1015
+ "primaryKey": false,
1016
+ "notNull": true
1017
+ },
1018
+ "email_verified": {
1019
+ "name": "email_verified",
1020
+ "type": "boolean",
1021
+ "primaryKey": false,
1022
+ "notNull": true,
1023
+ "default": false
1024
+ },
1025
+ "image": {
1026
+ "name": "image",
1027
+ "type": "text",
1028
+ "primaryKey": false,
1029
+ "notNull": false
1030
+ },
1031
+ "created_at": {
1032
+ "name": "created_at",
1033
+ "type": "timestamp",
1034
+ "primaryKey": false,
1035
+ "notNull": true,
1036
+ "default": "now()"
1037
+ },
1038
+ "updated_at": {
1039
+ "name": "updated_at",
1040
+ "type": "timestamp",
1041
+ "primaryKey": false,
1042
+ "notNull": true,
1043
+ "default": "now()"
1044
+ }
1045
+ },
1046
+ "indexes": {},
1047
+ "foreignKeys": {},
1048
+ "compositePrimaryKeys": {},
1049
+ "uniqueConstraints": {
1050
+ "user_email_unique": {
1051
+ "name": "user_email_unique",
1052
+ "nullsNotDistinct": false,
1053
+ "columns": [
1054
+ "email"
1055
+ ]
1056
+ }
1057
+ },
1058
+ "policies": {},
1059
+ "checkConstraints": {},
1060
+ "isRLSEnabled": false
1061
+ },
1062
+ "public.verification": {
1063
+ "name": "verification",
1064
+ "schema": "",
1065
+ "columns": {
1066
+ "id": {
1067
+ "name": "id",
1068
+ "type": "text",
1069
+ "primaryKey": true,
1070
+ "notNull": true
1071
+ },
1072
+ "identifier": {
1073
+ "name": "identifier",
1074
+ "type": "text",
1075
+ "primaryKey": false,
1076
+ "notNull": true
1077
+ },
1078
+ "value": {
1079
+ "name": "value",
1080
+ "type": "text",
1081
+ "primaryKey": false,
1082
+ "notNull": true
1083
+ },
1084
+ "expires_at": {
1085
+ "name": "expires_at",
1086
+ "type": "timestamp",
1087
+ "primaryKey": false,
1088
+ "notNull": true
1089
+ },
1090
+ "created_at": {
1091
+ "name": "created_at",
1092
+ "type": "timestamp",
1093
+ "primaryKey": false,
1094
+ "notNull": true,
1095
+ "default": "now()"
1096
+ },
1097
+ "updated_at": {
1098
+ "name": "updated_at",
1099
+ "type": "timestamp",
1100
+ "primaryKey": false,
1101
+ "notNull": true,
1102
+ "default": "now()"
1103
+ }
1104
+ },
1105
+ "indexes": {
1106
+ "verification_identifier_idx": {
1107
+ "name": "verification_identifier_idx",
1108
+ "columns": [
1109
+ {
1110
+ "expression": "identifier",
1111
+ "isExpression": false,
1112
+ "asc": true,
1113
+ "nulls": "last"
1114
+ }
1115
+ ],
1116
+ "isUnique": false,
1117
+ "concurrently": false,
1118
+ "method": "btree",
1119
+ "with": {}
1120
+ }
1121
+ },
1122
+ "foreignKeys": {},
1123
+ "compositePrimaryKeys": {},
1124
+ "uniqueConstraints": {},
1125
+ "policies": {},
1126
+ "checkConstraints": {},
1127
+ "isRLSEnabled": false
1128
+ }
1129
+ },
1130
+ "enums": {},
1131
+ "schemas": {},
1132
+ "sequences": {},
1133
+ "roles": {},
1134
+ "policies": {},
1135
+ "views": {},
1136
+ "_meta": {
1137
+ "columns": {},
1138
+ "schemas": {},
1139
+ "tables": {}
1140
+ }
1141
+ }