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