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,819 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "8583309a-ef40-453d-9478-43e01efe86b0",
5
+ "prevId": "53e605f4-7944-4902-838f-76b5ad4ac0ba",
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
+ "title": {
149
+ "name": "title",
150
+ "type": "text",
151
+ "primaryKey": false,
152
+ "notNull": true,
153
+ "autoincrement": false,
154
+ "default": "'New Conversation'"
155
+ },
156
+ "slack_thread_id": {
157
+ "name": "slack_thread_id",
158
+ "type": "text",
159
+ "primaryKey": false,
160
+ "notNull": false,
161
+ "autoincrement": false
162
+ },
163
+ "created_at": {
164
+ "name": "created_at",
165
+ "type": "integer",
166
+ "primaryKey": false,
167
+ "notNull": true,
168
+ "autoincrement": false,
169
+ "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
170
+ },
171
+ "updated_at": {
172
+ "name": "updated_at",
173
+ "type": "integer",
174
+ "primaryKey": false,
175
+ "notNull": true,
176
+ "autoincrement": false,
177
+ "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
178
+ }
179
+ },
180
+ "indexes": {
181
+ "chat_userId_idx": {
182
+ "name": "chat_userId_idx",
183
+ "columns": [
184
+ "user_id"
185
+ ],
186
+ "isUnique": false
187
+ },
188
+ "chat_slack_thread_idx": {
189
+ "name": "chat_slack_thread_idx",
190
+ "columns": [
191
+ "slack_thread_id"
192
+ ],
193
+ "isUnique": false
194
+ }
195
+ },
196
+ "foreignKeys": {
197
+ "chat_user_id_user_id_fk": {
198
+ "name": "chat_user_id_user_id_fk",
199
+ "tableFrom": "chat",
200
+ "tableTo": "user",
201
+ "columnsFrom": [
202
+ "user_id"
203
+ ],
204
+ "columnsTo": [
205
+ "id"
206
+ ],
207
+ "onDelete": "cascade",
208
+ "onUpdate": "no action"
209
+ }
210
+ },
211
+ "compositePrimaryKeys": {},
212
+ "uniqueConstraints": {},
213
+ "checkConstraints": {}
214
+ },
215
+ "chat_message": {
216
+ "name": "chat_message",
217
+ "columns": {
218
+ "id": {
219
+ "name": "id",
220
+ "type": "text",
221
+ "primaryKey": true,
222
+ "notNull": true,
223
+ "autoincrement": false
224
+ },
225
+ "chat_id": {
226
+ "name": "chat_id",
227
+ "type": "text",
228
+ "primaryKey": false,
229
+ "notNull": true,
230
+ "autoincrement": false
231
+ },
232
+ "role": {
233
+ "name": "role",
234
+ "type": "text",
235
+ "primaryKey": false,
236
+ "notNull": true,
237
+ "autoincrement": false
238
+ },
239
+ "stop_reason": {
240
+ "name": "stop_reason",
241
+ "type": "text",
242
+ "primaryKey": false,
243
+ "notNull": false,
244
+ "autoincrement": false
245
+ },
246
+ "error_message": {
247
+ "name": "error_message",
248
+ "type": "text",
249
+ "primaryKey": false,
250
+ "notNull": false,
251
+ "autoincrement": false
252
+ },
253
+ "created_at": {
254
+ "name": "created_at",
255
+ "type": "integer",
256
+ "primaryKey": false,
257
+ "notNull": true,
258
+ "autoincrement": false,
259
+ "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
260
+ }
261
+ },
262
+ "indexes": {
263
+ "chat_message_chatId_idx": {
264
+ "name": "chat_message_chatId_idx",
265
+ "columns": [
266
+ "chat_id"
267
+ ],
268
+ "isUnique": false
269
+ },
270
+ "chat_message_createdAt_idx": {
271
+ "name": "chat_message_createdAt_idx",
272
+ "columns": [
273
+ "created_at"
274
+ ],
275
+ "isUnique": false
276
+ }
277
+ },
278
+ "foreignKeys": {
279
+ "chat_message_chat_id_chat_id_fk": {
280
+ "name": "chat_message_chat_id_chat_id_fk",
281
+ "tableFrom": "chat_message",
282
+ "tableTo": "chat",
283
+ "columnsFrom": [
284
+ "chat_id"
285
+ ],
286
+ "columnsTo": [
287
+ "id"
288
+ ],
289
+ "onDelete": "cascade",
290
+ "onUpdate": "no action"
291
+ }
292
+ },
293
+ "compositePrimaryKeys": {},
294
+ "uniqueConstraints": {},
295
+ "checkConstraints": {}
296
+ },
297
+ "message_feedback": {
298
+ "name": "message_feedback",
299
+ "columns": {
300
+ "message_id": {
301
+ "name": "message_id",
302
+ "type": "text",
303
+ "primaryKey": true,
304
+ "notNull": true,
305
+ "autoincrement": false
306
+ },
307
+ "vote": {
308
+ "name": "vote",
309
+ "type": "text",
310
+ "primaryKey": false,
311
+ "notNull": true,
312
+ "autoincrement": false
313
+ },
314
+ "explanation": {
315
+ "name": "explanation",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": false,
319
+ "autoincrement": false
320
+ },
321
+ "created_at": {
322
+ "name": "created_at",
323
+ "type": "integer",
324
+ "primaryKey": false,
325
+ "notNull": true,
326
+ "autoincrement": false,
327
+ "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
328
+ },
329
+ "updated_at": {
330
+ "name": "updated_at",
331
+ "type": "integer",
332
+ "primaryKey": false,
333
+ "notNull": true,
334
+ "autoincrement": false,
335
+ "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
336
+ }
337
+ },
338
+ "indexes": {},
339
+ "foreignKeys": {
340
+ "message_feedback_message_id_chat_message_id_fk": {
341
+ "name": "message_feedback_message_id_chat_message_id_fk",
342
+ "tableFrom": "message_feedback",
343
+ "tableTo": "chat_message",
344
+ "columnsFrom": [
345
+ "message_id"
346
+ ],
347
+ "columnsTo": [
348
+ "id"
349
+ ],
350
+ "onDelete": "cascade",
351
+ "onUpdate": "no action"
352
+ }
353
+ },
354
+ "compositePrimaryKeys": {},
355
+ "uniqueConstraints": {},
356
+ "checkConstraints": {}
357
+ },
358
+ "message_part": {
359
+ "name": "message_part",
360
+ "columns": {
361
+ "id": {
362
+ "name": "id",
363
+ "type": "text",
364
+ "primaryKey": true,
365
+ "notNull": true,
366
+ "autoincrement": false
367
+ },
368
+ "message_id": {
369
+ "name": "message_id",
370
+ "type": "text",
371
+ "primaryKey": false,
372
+ "notNull": true,
373
+ "autoincrement": false
374
+ },
375
+ "order": {
376
+ "name": "order",
377
+ "type": "integer",
378
+ "primaryKey": false,
379
+ "notNull": true,
380
+ "autoincrement": false
381
+ },
382
+ "created_at": {
383
+ "name": "created_at",
384
+ "type": "integer",
385
+ "primaryKey": false,
386
+ "notNull": true,
387
+ "autoincrement": false,
388
+ "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
389
+ },
390
+ "type": {
391
+ "name": "type",
392
+ "type": "text",
393
+ "primaryKey": false,
394
+ "notNull": true,
395
+ "autoincrement": false
396
+ },
397
+ "text": {
398
+ "name": "text",
399
+ "type": "text",
400
+ "primaryKey": false,
401
+ "notNull": false,
402
+ "autoincrement": false
403
+ },
404
+ "reasoning_text": {
405
+ "name": "reasoning_text",
406
+ "type": "text",
407
+ "primaryKey": false,
408
+ "notNull": false,
409
+ "autoincrement": false
410
+ },
411
+ "input_total_tokens": {
412
+ "name": "input_total_tokens",
413
+ "type": "integer",
414
+ "primaryKey": false,
415
+ "notNull": false,
416
+ "autoincrement": false
417
+ },
418
+ "input_no_cache_tokens": {
419
+ "name": "input_no_cache_tokens",
420
+ "type": "integer",
421
+ "primaryKey": false,
422
+ "notNull": false,
423
+ "autoincrement": false
424
+ },
425
+ "input_cache_read_tokens": {
426
+ "name": "input_cache_read_tokens",
427
+ "type": "integer",
428
+ "primaryKey": false,
429
+ "notNull": false,
430
+ "autoincrement": false
431
+ },
432
+ "input_cache_write_tokens": {
433
+ "name": "input_cache_write_tokens",
434
+ "type": "integer",
435
+ "primaryKey": false,
436
+ "notNull": false,
437
+ "autoincrement": false
438
+ },
439
+ "output_total_tokens": {
440
+ "name": "output_total_tokens",
441
+ "type": "integer",
442
+ "primaryKey": false,
443
+ "notNull": false,
444
+ "autoincrement": false
445
+ },
446
+ "output_text_tokens": {
447
+ "name": "output_text_tokens",
448
+ "type": "integer",
449
+ "primaryKey": false,
450
+ "notNull": false,
451
+ "autoincrement": false
452
+ },
453
+ "output_reasoning_tokens": {
454
+ "name": "output_reasoning_tokens",
455
+ "type": "integer",
456
+ "primaryKey": false,
457
+ "notNull": false,
458
+ "autoincrement": false
459
+ },
460
+ "total_tokens": {
461
+ "name": "total_tokens",
462
+ "type": "integer",
463
+ "primaryKey": false,
464
+ "notNull": false,
465
+ "autoincrement": false
466
+ },
467
+ "tool_call_id": {
468
+ "name": "tool_call_id",
469
+ "type": "text",
470
+ "primaryKey": false,
471
+ "notNull": false,
472
+ "autoincrement": false
473
+ },
474
+ "tool_name": {
475
+ "name": "tool_name",
476
+ "type": "text",
477
+ "primaryKey": false,
478
+ "notNull": false,
479
+ "autoincrement": false
480
+ },
481
+ "tool_state": {
482
+ "name": "tool_state",
483
+ "type": "text",
484
+ "primaryKey": false,
485
+ "notNull": false,
486
+ "autoincrement": false
487
+ },
488
+ "tool_error_text": {
489
+ "name": "tool_error_text",
490
+ "type": "text",
491
+ "primaryKey": false,
492
+ "notNull": false,
493
+ "autoincrement": false
494
+ },
495
+ "tool_input": {
496
+ "name": "tool_input",
497
+ "type": "text",
498
+ "primaryKey": false,
499
+ "notNull": false,
500
+ "autoincrement": false
501
+ },
502
+ "tool_output": {
503
+ "name": "tool_output",
504
+ "type": "text",
505
+ "primaryKey": false,
506
+ "notNull": false,
507
+ "autoincrement": false
508
+ },
509
+ "tool_approval_id": {
510
+ "name": "tool_approval_id",
511
+ "type": "text",
512
+ "primaryKey": false,
513
+ "notNull": false,
514
+ "autoincrement": false
515
+ },
516
+ "tool_approval_approved": {
517
+ "name": "tool_approval_approved",
518
+ "type": "integer",
519
+ "primaryKey": false,
520
+ "notNull": false,
521
+ "autoincrement": false
522
+ },
523
+ "tool_approval_reason": {
524
+ "name": "tool_approval_reason",
525
+ "type": "text",
526
+ "primaryKey": false,
527
+ "notNull": false,
528
+ "autoincrement": false
529
+ }
530
+ },
531
+ "indexes": {
532
+ "parts_message_id_idx": {
533
+ "name": "parts_message_id_idx",
534
+ "columns": [
535
+ "message_id"
536
+ ],
537
+ "isUnique": false
538
+ },
539
+ "parts_message_id_order_idx": {
540
+ "name": "parts_message_id_order_idx",
541
+ "columns": [
542
+ "message_id",
543
+ "order"
544
+ ],
545
+ "isUnique": false
546
+ }
547
+ },
548
+ "foreignKeys": {
549
+ "message_part_message_id_chat_message_id_fk": {
550
+ "name": "message_part_message_id_chat_message_id_fk",
551
+ "tableFrom": "message_part",
552
+ "tableTo": "chat_message",
553
+ "columnsFrom": [
554
+ "message_id"
555
+ ],
556
+ "columnsTo": [
557
+ "id"
558
+ ],
559
+ "onDelete": "cascade",
560
+ "onUpdate": "no action"
561
+ }
562
+ },
563
+ "compositePrimaryKeys": {},
564
+ "uniqueConstraints": {},
565
+ "checkConstraints": {
566
+ "text_required_if_type_is_text": {
567
+ "name": "text_required_if_type_is_text",
568
+ "value": "CASE WHEN \"message_part\".\"type\" = 'text' THEN \"message_part\".\"text\" IS NOT NULL ELSE TRUE END"
569
+ },
570
+ "reasoning_text_required_if_type_is_reasoning": {
571
+ "name": "reasoning_text_required_if_type_is_reasoning",
572
+ "value": "CASE WHEN \"message_part\".\"type\" = 'reasoning' THEN \"message_part\".\"reasoning_text\" IS NOT NULL ELSE TRUE END"
573
+ },
574
+ "tool_call_fields_required": {
575
+ "name": "tool_call_fields_required",
576
+ "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"
577
+ }
578
+ }
579
+ },
580
+ "session": {
581
+ "name": "session",
582
+ "columns": {
583
+ "id": {
584
+ "name": "id",
585
+ "type": "text",
586
+ "primaryKey": true,
587
+ "notNull": true,
588
+ "autoincrement": false
589
+ },
590
+ "expires_at": {
591
+ "name": "expires_at",
592
+ "type": "integer",
593
+ "primaryKey": false,
594
+ "notNull": true,
595
+ "autoincrement": false
596
+ },
597
+ "token": {
598
+ "name": "token",
599
+ "type": "text",
600
+ "primaryKey": false,
601
+ "notNull": true,
602
+ "autoincrement": false
603
+ },
604
+ "created_at": {
605
+ "name": "created_at",
606
+ "type": "integer",
607
+ "primaryKey": false,
608
+ "notNull": true,
609
+ "autoincrement": false,
610
+ "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
611
+ },
612
+ "updated_at": {
613
+ "name": "updated_at",
614
+ "type": "integer",
615
+ "primaryKey": false,
616
+ "notNull": true,
617
+ "autoincrement": false
618
+ },
619
+ "ip_address": {
620
+ "name": "ip_address",
621
+ "type": "text",
622
+ "primaryKey": false,
623
+ "notNull": false,
624
+ "autoincrement": false
625
+ },
626
+ "user_agent": {
627
+ "name": "user_agent",
628
+ "type": "text",
629
+ "primaryKey": false,
630
+ "notNull": false,
631
+ "autoincrement": false
632
+ },
633
+ "user_id": {
634
+ "name": "user_id",
635
+ "type": "text",
636
+ "primaryKey": false,
637
+ "notNull": true,
638
+ "autoincrement": false
639
+ }
640
+ },
641
+ "indexes": {
642
+ "session_token_unique": {
643
+ "name": "session_token_unique",
644
+ "columns": [
645
+ "token"
646
+ ],
647
+ "isUnique": true
648
+ },
649
+ "session_userId_idx": {
650
+ "name": "session_userId_idx",
651
+ "columns": [
652
+ "user_id"
653
+ ],
654
+ "isUnique": false
655
+ }
656
+ },
657
+ "foreignKeys": {
658
+ "session_user_id_user_id_fk": {
659
+ "name": "session_user_id_user_id_fk",
660
+ "tableFrom": "session",
661
+ "tableTo": "user",
662
+ "columnsFrom": [
663
+ "user_id"
664
+ ],
665
+ "columnsTo": [
666
+ "id"
667
+ ],
668
+ "onDelete": "cascade",
669
+ "onUpdate": "no action"
670
+ }
671
+ },
672
+ "compositePrimaryKeys": {},
673
+ "uniqueConstraints": {},
674
+ "checkConstraints": {}
675
+ },
676
+ "user": {
677
+ "name": "user",
678
+ "columns": {
679
+ "id": {
680
+ "name": "id",
681
+ "type": "text",
682
+ "primaryKey": true,
683
+ "notNull": true,
684
+ "autoincrement": false
685
+ },
686
+ "name": {
687
+ "name": "name",
688
+ "type": "text",
689
+ "primaryKey": false,
690
+ "notNull": true,
691
+ "autoincrement": false
692
+ },
693
+ "email": {
694
+ "name": "email",
695
+ "type": "text",
696
+ "primaryKey": false,
697
+ "notNull": true,
698
+ "autoincrement": false
699
+ },
700
+ "email_verified": {
701
+ "name": "email_verified",
702
+ "type": "integer",
703
+ "primaryKey": false,
704
+ "notNull": true,
705
+ "autoincrement": false,
706
+ "default": false
707
+ },
708
+ "image": {
709
+ "name": "image",
710
+ "type": "text",
711
+ "primaryKey": false,
712
+ "notNull": false,
713
+ "autoincrement": false
714
+ },
715
+ "created_at": {
716
+ "name": "created_at",
717
+ "type": "integer",
718
+ "primaryKey": false,
719
+ "notNull": true,
720
+ "autoincrement": false,
721
+ "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
722
+ },
723
+ "updated_at": {
724
+ "name": "updated_at",
725
+ "type": "integer",
726
+ "primaryKey": false,
727
+ "notNull": true,
728
+ "autoincrement": false,
729
+ "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
730
+ }
731
+ },
732
+ "indexes": {
733
+ "user_email_unique": {
734
+ "name": "user_email_unique",
735
+ "columns": [
736
+ "email"
737
+ ],
738
+ "isUnique": true
739
+ }
740
+ },
741
+ "foreignKeys": {},
742
+ "compositePrimaryKeys": {},
743
+ "uniqueConstraints": {},
744
+ "checkConstraints": {}
745
+ },
746
+ "verification": {
747
+ "name": "verification",
748
+ "columns": {
749
+ "id": {
750
+ "name": "id",
751
+ "type": "text",
752
+ "primaryKey": true,
753
+ "notNull": true,
754
+ "autoincrement": false
755
+ },
756
+ "identifier": {
757
+ "name": "identifier",
758
+ "type": "text",
759
+ "primaryKey": false,
760
+ "notNull": true,
761
+ "autoincrement": false
762
+ },
763
+ "value": {
764
+ "name": "value",
765
+ "type": "text",
766
+ "primaryKey": false,
767
+ "notNull": true,
768
+ "autoincrement": false
769
+ },
770
+ "expires_at": {
771
+ "name": "expires_at",
772
+ "type": "integer",
773
+ "primaryKey": false,
774
+ "notNull": true,
775
+ "autoincrement": false
776
+ },
777
+ "created_at": {
778
+ "name": "created_at",
779
+ "type": "integer",
780
+ "primaryKey": false,
781
+ "notNull": true,
782
+ "autoincrement": false,
783
+ "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
784
+ },
785
+ "updated_at": {
786
+ "name": "updated_at",
787
+ "type": "integer",
788
+ "primaryKey": false,
789
+ "notNull": true,
790
+ "autoincrement": false,
791
+ "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
792
+ }
793
+ },
794
+ "indexes": {
795
+ "verification_identifier_idx": {
796
+ "name": "verification_identifier_idx",
797
+ "columns": [
798
+ "identifier"
799
+ ],
800
+ "isUnique": false
801
+ }
802
+ },
803
+ "foreignKeys": {},
804
+ "compositePrimaryKeys": {},
805
+ "uniqueConstraints": {},
806
+ "checkConstraints": {}
807
+ }
808
+ },
809
+ "views": {},
810
+ "enums": {},
811
+ "_meta": {
812
+ "schemas": {},
813
+ "tables": {},
814
+ "columns": {}
815
+ },
816
+ "internal": {
817
+ "indexes": {}
818
+ }
819
+ }