@vinihcrosa/lumem-os 0.5.0 → 0.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.
@@ -0,0 +1,2931 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "0fc68390-c2db-4b34-8751-f324fc2b95d5",
5
+ "prevId": "9159230d-1021-4481-93b2-608c81df06ec",
6
+ "tables": {
7
+ "action_signal": {
8
+ "name": "action_signal",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "kind": {
18
+ "name": "kind",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "target": {
25
+ "name": "target",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "workspace_id": {
32
+ "name": "workspace_id",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": false,
36
+ "autoincrement": false
37
+ },
38
+ "project_id": {
39
+ "name": "project_id",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "worktree_id": {
46
+ "name": "worktree_id",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": false,
50
+ "autoincrement": false
51
+ },
52
+ "session_id": {
53
+ "name": "session_id",
54
+ "type": "text",
55
+ "primaryKey": false,
56
+ "notNull": false,
57
+ "autoincrement": false
58
+ },
59
+ "detail": {
60
+ "name": "detail",
61
+ "type": "integer",
62
+ "primaryKey": false,
63
+ "notNull": false,
64
+ "autoincrement": false
65
+ },
66
+ "created_at": {
67
+ "name": "created_at",
68
+ "type": "integer",
69
+ "primaryKey": false,
70
+ "notNull": true,
71
+ "autoincrement": false,
72
+ "default": "(unixepoch('subsec') * 1000)"
73
+ },
74
+ "updated_at": {
75
+ "name": "updated_at",
76
+ "type": "integer",
77
+ "primaryKey": false,
78
+ "notNull": true,
79
+ "autoincrement": false,
80
+ "default": "(unixepoch('subsec') * 1000)"
81
+ }
82
+ },
83
+ "indexes": {},
84
+ "foreignKeys": {},
85
+ "compositePrimaryKeys": {},
86
+ "uniqueConstraints": {},
87
+ "checkConstraints": {
88
+ "action_signal_kind": {
89
+ "name": "action_signal_kind",
90
+ "value": "\"action_signal\".\"kind\" IN (\n 'user_edited_after_agent',\n 'user_reverted_agent_commit',\n 'worktree_discarded',\n 'session_killed_early'\n )"
91
+ },
92
+ "action_signal_detail_number": {
93
+ "name": "action_signal_detail_number",
94
+ "value": "\"action_signal\".\"detail\" IS NULL OR typeof(\"action_signal\".\"detail\") = 'integer'"
95
+ },
96
+ "action_signal_target_shape": {
97
+ "name": "action_signal_target_shape",
98
+ "value": "length(\"action_signal\".\"target\") BETWEEN 1 AND 1024\n AND instr(\"action_signal\".\"target\", char(10)) = 0"
99
+ }
100
+ }
101
+ },
102
+ "agent_account": {
103
+ "name": "agent_account",
104
+ "columns": {
105
+ "id": {
106
+ "name": "id",
107
+ "type": "text",
108
+ "primaryKey": true,
109
+ "notNull": true,
110
+ "autoincrement": false
111
+ },
112
+ "agent_config_id": {
113
+ "name": "agent_config_id",
114
+ "type": "text",
115
+ "primaryKey": false,
116
+ "notNull": true,
117
+ "autoincrement": false
118
+ },
119
+ "label": {
120
+ "name": "label",
121
+ "type": "text",
122
+ "primaryKey": false,
123
+ "notNull": true,
124
+ "autoincrement": false
125
+ },
126
+ "kind": {
127
+ "name": "kind",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": true,
131
+ "autoincrement": false,
132
+ "default": "'subscription'"
133
+ },
134
+ "config_dir": {
135
+ "name": "config_dir",
136
+ "type": "text",
137
+ "primaryKey": false,
138
+ "notNull": false,
139
+ "autoincrement": false
140
+ },
141
+ "identity": {
142
+ "name": "identity",
143
+ "type": "text",
144
+ "primaryKey": false,
145
+ "notNull": false,
146
+ "autoincrement": false
147
+ },
148
+ "default_model": {
149
+ "name": "default_model",
150
+ "type": "text",
151
+ "primaryKey": false,
152
+ "notNull": false,
153
+ "autoincrement": false
154
+ },
155
+ "default_effort": {
156
+ "name": "default_effort",
157
+ "type": "text",
158
+ "primaryKey": false,
159
+ "notNull": false,
160
+ "autoincrement": false
161
+ },
162
+ "state": {
163
+ "name": "state",
164
+ "type": "text",
165
+ "primaryKey": false,
166
+ "notNull": true,
167
+ "autoincrement": false,
168
+ "default": "'connected'"
169
+ },
170
+ "created_at": {
171
+ "name": "created_at",
172
+ "type": "integer",
173
+ "primaryKey": false,
174
+ "notNull": true,
175
+ "autoincrement": false,
176
+ "default": "(unixepoch('subsec') * 1000)"
177
+ },
178
+ "updated_at": {
179
+ "name": "updated_at",
180
+ "type": "integer",
181
+ "primaryKey": false,
182
+ "notNull": true,
183
+ "autoincrement": false,
184
+ "default": "(unixepoch('subsec') * 1000)"
185
+ }
186
+ },
187
+ "indexes": {
188
+ "agent_account_config_dir": {
189
+ "name": "agent_account_config_dir",
190
+ "columns": [
191
+ "config_dir"
192
+ ],
193
+ "isUnique": true
194
+ },
195
+ "agent_account_one_bare_per_agent": {
196
+ "name": "agent_account_one_bare_per_agent",
197
+ "columns": [
198
+ "agent_config_id"
199
+ ],
200
+ "isUnique": true,
201
+ "where": "config_dir IS NULL"
202
+ },
203
+ "agent_account_label_per_agent": {
204
+ "name": "agent_account_label_per_agent",
205
+ "columns": [
206
+ "agent_config_id",
207
+ "label"
208
+ ],
209
+ "isUnique": true
210
+ }
211
+ },
212
+ "foreignKeys": {
213
+ "agent_account_agent_config_id_agent_config_id_fk": {
214
+ "name": "agent_account_agent_config_id_agent_config_id_fk",
215
+ "tableFrom": "agent_account",
216
+ "tableTo": "agent_config",
217
+ "columnsFrom": [
218
+ "agent_config_id"
219
+ ],
220
+ "columnsTo": [
221
+ "id"
222
+ ],
223
+ "onDelete": "restrict",
224
+ "onUpdate": "no action"
225
+ }
226
+ },
227
+ "compositePrimaryKeys": {},
228
+ "uniqueConstraints": {},
229
+ "checkConstraints": {
230
+ "agent_account_kind": {
231
+ "name": "agent_account_kind",
232
+ "value": "\"agent_account\".\"kind\" IN ('subscription', 'api_key')"
233
+ },
234
+ "agent_account_state": {
235
+ "name": "agent_account_state",
236
+ "value": "\"agent_account\".\"state\" IN ('connected', 'disconnected')"
237
+ }
238
+ }
239
+ },
240
+ "agent_config": {
241
+ "name": "agent_config",
242
+ "columns": {
243
+ "id": {
244
+ "name": "id",
245
+ "type": "text",
246
+ "primaryKey": true,
247
+ "notNull": true,
248
+ "autoincrement": false
249
+ },
250
+ "name": {
251
+ "name": "name",
252
+ "type": "text",
253
+ "primaryKey": false,
254
+ "notNull": true,
255
+ "autoincrement": false
256
+ },
257
+ "command": {
258
+ "name": "command",
259
+ "type": "text",
260
+ "primaryKey": false,
261
+ "notNull": true,
262
+ "autoincrement": false
263
+ },
264
+ "args": {
265
+ "name": "args",
266
+ "type": "text",
267
+ "primaryKey": false,
268
+ "notNull": true,
269
+ "autoincrement": false,
270
+ "default": "'[]'"
271
+ },
272
+ "env": {
273
+ "name": "env",
274
+ "type": "text",
275
+ "primaryKey": false,
276
+ "notNull": true,
277
+ "autoincrement": false,
278
+ "default": "'{}'"
279
+ },
280
+ "adapter_version": {
281
+ "name": "adapter_version",
282
+ "type": "text",
283
+ "primaryKey": false,
284
+ "notNull": false,
285
+ "autoincrement": false
286
+ },
287
+ "retired_at": {
288
+ "name": "retired_at",
289
+ "type": "integer",
290
+ "primaryKey": false,
291
+ "notNull": false,
292
+ "autoincrement": false
293
+ },
294
+ "default_account_id": {
295
+ "name": "default_account_id",
296
+ "type": "text",
297
+ "primaryKey": false,
298
+ "notNull": false,
299
+ "autoincrement": false
300
+ },
301
+ "created_at": {
302
+ "name": "created_at",
303
+ "type": "integer",
304
+ "primaryKey": false,
305
+ "notNull": true,
306
+ "autoincrement": false,
307
+ "default": "(unixepoch('subsec') * 1000)"
308
+ },
309
+ "updated_at": {
310
+ "name": "updated_at",
311
+ "type": "integer",
312
+ "primaryKey": false,
313
+ "notNull": true,
314
+ "autoincrement": false,
315
+ "default": "(unixepoch('subsec') * 1000)"
316
+ }
317
+ },
318
+ "indexes": {
319
+ "agent_config_name_unique": {
320
+ "name": "agent_config_name_unique",
321
+ "columns": [
322
+ "name"
323
+ ],
324
+ "isUnique": true
325
+ }
326
+ },
327
+ "foreignKeys": {},
328
+ "compositePrimaryKeys": {},
329
+ "uniqueConstraints": {},
330
+ "checkConstraints": {
331
+ "agent_config_adapter_version": {
332
+ "name": "agent_config_adapter_version",
333
+ "value": "\"agent_config\".\"retired_at\" IS NOT NULL OR \"agent_config\".\"adapter_version\" IS NOT NULL"
334
+ }
335
+ }
336
+ },
337
+ "checkout_port": {
338
+ "name": "checkout_port",
339
+ "columns": {
340
+ "id": {
341
+ "name": "id",
342
+ "type": "text",
343
+ "primaryKey": true,
344
+ "notNull": true,
345
+ "autoincrement": false
346
+ },
347
+ "scope_type": {
348
+ "name": "scope_type",
349
+ "type": "text",
350
+ "primaryKey": false,
351
+ "notNull": true,
352
+ "autoincrement": false
353
+ },
354
+ "scope_id": {
355
+ "name": "scope_id",
356
+ "type": "text",
357
+ "primaryKey": false,
358
+ "notNull": true,
359
+ "autoincrement": false
360
+ },
361
+ "port": {
362
+ "name": "port",
363
+ "type": "integer",
364
+ "primaryKey": false,
365
+ "notNull": true,
366
+ "autoincrement": false
367
+ },
368
+ "created_at": {
369
+ "name": "created_at",
370
+ "type": "integer",
371
+ "primaryKey": false,
372
+ "notNull": true,
373
+ "autoincrement": false,
374
+ "default": "(unixepoch('subsec') * 1000)"
375
+ },
376
+ "updated_at": {
377
+ "name": "updated_at",
378
+ "type": "integer",
379
+ "primaryKey": false,
380
+ "notNull": true,
381
+ "autoincrement": false,
382
+ "default": "(unixepoch('subsec') * 1000)"
383
+ }
384
+ },
385
+ "indexes": {
386
+ "checkout_port_scope": {
387
+ "name": "checkout_port_scope",
388
+ "columns": [
389
+ "scope_type",
390
+ "scope_id"
391
+ ],
392
+ "isUnique": true
393
+ },
394
+ "checkout_port_port": {
395
+ "name": "checkout_port_port",
396
+ "columns": [
397
+ "port"
398
+ ],
399
+ "isUnique": true
400
+ }
401
+ },
402
+ "foreignKeys": {},
403
+ "compositePrimaryKeys": {},
404
+ "uniqueConstraints": {},
405
+ "checkConstraints": {
406
+ "checkout_port_scope_type": {
407
+ "name": "checkout_port_scope_type",
408
+ "value": "\"checkout_port\".\"scope_type\" IN ('project', 'worktree')"
409
+ },
410
+ "checkout_port_range": {
411
+ "name": "checkout_port_range",
412
+ "value": "\"checkout_port\".\"port\" > 0 AND \"checkout_port\".\"port\" < 65536"
413
+ }
414
+ }
415
+ },
416
+ "daemon_settings": {
417
+ "name": "daemon_settings",
418
+ "columns": {
419
+ "id": {
420
+ "name": "id",
421
+ "type": "integer",
422
+ "primaryKey": true,
423
+ "notNull": true,
424
+ "autoincrement": false
425
+ },
426
+ "update_check": {
427
+ "name": "update_check",
428
+ "type": "integer",
429
+ "primaryKey": false,
430
+ "notNull": true,
431
+ "autoincrement": false,
432
+ "default": 1
433
+ },
434
+ "auto_update": {
435
+ "name": "auto_update",
436
+ "type": "text",
437
+ "primaryKey": false,
438
+ "notNull": true,
439
+ "autoincrement": false,
440
+ "default": "'off'"
441
+ }
442
+ },
443
+ "indexes": {},
444
+ "foreignKeys": {},
445
+ "compositePrimaryKeys": {},
446
+ "uniqueConstraints": {},
447
+ "checkConstraints": {
448
+ "daemon_settings_single_row": {
449
+ "name": "daemon_settings_single_row",
450
+ "value": "\"daemon_settings\".\"id\" = 1"
451
+ },
452
+ "daemon_settings_update_check": {
453
+ "name": "daemon_settings_update_check",
454
+ "value": "\"daemon_settings\".\"update_check\" IN (0, 1)"
455
+ },
456
+ "daemon_settings_auto_update": {
457
+ "name": "daemon_settings_auto_update",
458
+ "value": "\"daemon_settings\".\"auto_update\" IN ('off', 'idle')"
459
+ }
460
+ }
461
+ },
462
+ "memory_access": {
463
+ "name": "memory_access",
464
+ "columns": {
465
+ "id": {
466
+ "name": "id",
467
+ "type": "text",
468
+ "primaryKey": true,
469
+ "notNull": true,
470
+ "autoincrement": false
471
+ },
472
+ "workspace_id": {
473
+ "name": "workspace_id",
474
+ "type": "text",
475
+ "primaryKey": false,
476
+ "notNull": false,
477
+ "autoincrement": false
478
+ },
479
+ "from_project_id": {
480
+ "name": "from_project_id",
481
+ "type": "text",
482
+ "primaryKey": false,
483
+ "notNull": false,
484
+ "autoincrement": false
485
+ },
486
+ "target_project_id": {
487
+ "name": "target_project_id",
488
+ "type": "text",
489
+ "primaryKey": false,
490
+ "notNull": false,
491
+ "autoincrement": false
492
+ },
493
+ "kind": {
494
+ "name": "kind",
495
+ "type": "text",
496
+ "primaryKey": false,
497
+ "notNull": true,
498
+ "autoincrement": false
499
+ },
500
+ "target": {
501
+ "name": "target",
502
+ "type": "text",
503
+ "primaryKey": false,
504
+ "notNull": true,
505
+ "autoincrement": false
506
+ },
507
+ "decision": {
508
+ "name": "decision",
509
+ "type": "text",
510
+ "primaryKey": false,
511
+ "notNull": true,
512
+ "autoincrement": false
513
+ },
514
+ "reason": {
515
+ "name": "reason",
516
+ "type": "text",
517
+ "primaryKey": false,
518
+ "notNull": false,
519
+ "autoincrement": false
520
+ },
521
+ "actor": {
522
+ "name": "actor",
523
+ "type": "text",
524
+ "primaryKey": false,
525
+ "notNull": true,
526
+ "autoincrement": false
527
+ },
528
+ "created_at": {
529
+ "name": "created_at",
530
+ "type": "integer",
531
+ "primaryKey": false,
532
+ "notNull": true,
533
+ "autoincrement": false,
534
+ "default": "(unixepoch('subsec') * 1000)"
535
+ },
536
+ "updated_at": {
537
+ "name": "updated_at",
538
+ "type": "integer",
539
+ "primaryKey": false,
540
+ "notNull": true,
541
+ "autoincrement": false,
542
+ "default": "(unixepoch('subsec') * 1000)"
543
+ }
544
+ },
545
+ "indexes": {},
546
+ "foreignKeys": {},
547
+ "compositePrimaryKeys": {},
548
+ "uniqueConstraints": {},
549
+ "checkConstraints": {
550
+ "memory_access_kind": {
551
+ "name": "memory_access_kind",
552
+ "value": "\"memory_access\".\"kind\" IN ('memory', 'repository')"
553
+ },
554
+ "memory_access_decision": {
555
+ "name": "memory_access_decision",
556
+ "value": "\"memory_access\".\"decision\" IN ('allowed', 'denied')"
557
+ }
558
+ }
559
+ },
560
+ "memory_decision": {
561
+ "name": "memory_decision",
562
+ "columns": {
563
+ "id": {
564
+ "name": "id",
565
+ "type": "text",
566
+ "primaryKey": true,
567
+ "notNull": true,
568
+ "autoincrement": false
569
+ },
570
+ "idempotency_key": {
571
+ "name": "idempotency_key",
572
+ "type": "text",
573
+ "primaryKey": false,
574
+ "notNull": true,
575
+ "autoincrement": false
576
+ },
577
+ "path": {
578
+ "name": "path",
579
+ "type": "text",
580
+ "primaryKey": false,
581
+ "notNull": true,
582
+ "autoincrement": false
583
+ },
584
+ "operation": {
585
+ "name": "operation",
586
+ "type": "text",
587
+ "primaryKey": false,
588
+ "notNull": true,
589
+ "autoincrement": false
590
+ },
591
+ "outcome": {
592
+ "name": "outcome",
593
+ "type": "text",
594
+ "primaryKey": false,
595
+ "notNull": true,
596
+ "autoincrement": false
597
+ },
598
+ "actor": {
599
+ "name": "actor",
600
+ "type": "text",
601
+ "primaryKey": false,
602
+ "notNull": true,
603
+ "autoincrement": false
604
+ },
605
+ "confidence": {
606
+ "name": "confidence",
607
+ "type": "text",
608
+ "primaryKey": false,
609
+ "notNull": true,
610
+ "autoincrement": false
611
+ },
612
+ "candidate_hash": {
613
+ "name": "candidate_hash",
614
+ "type": "text",
615
+ "primaryKey": false,
616
+ "notNull": true,
617
+ "autoincrement": false
618
+ },
619
+ "rule_trace": {
620
+ "name": "rule_trace",
621
+ "type": "text",
622
+ "primaryKey": false,
623
+ "notNull": true,
624
+ "autoincrement": false,
625
+ "default": "'[]'"
626
+ },
627
+ "source_sessions": {
628
+ "name": "source_sessions",
629
+ "type": "text",
630
+ "primaryKey": false,
631
+ "notNull": true,
632
+ "autoincrement": false,
633
+ "default": "'[]'"
634
+ },
635
+ "reason": {
636
+ "name": "reason",
637
+ "type": "text",
638
+ "primaryKey": false,
639
+ "notNull": false,
640
+ "autoincrement": false
641
+ },
642
+ "commit_sha": {
643
+ "name": "commit_sha",
644
+ "type": "text",
645
+ "primaryKey": false,
646
+ "notNull": false,
647
+ "autoincrement": false
648
+ },
649
+ "created_at": {
650
+ "name": "created_at",
651
+ "type": "integer",
652
+ "primaryKey": false,
653
+ "notNull": true,
654
+ "autoincrement": false,
655
+ "default": "(unixepoch('subsec') * 1000)"
656
+ },
657
+ "updated_at": {
658
+ "name": "updated_at",
659
+ "type": "integer",
660
+ "primaryKey": false,
661
+ "notNull": true,
662
+ "autoincrement": false,
663
+ "default": "(unixepoch('subsec') * 1000)"
664
+ }
665
+ },
666
+ "indexes": {
667
+ "memory_decision_idempotency_key_unique": {
668
+ "name": "memory_decision_idempotency_key_unique",
669
+ "columns": [
670
+ "idempotency_key"
671
+ ],
672
+ "isUnique": true
673
+ }
674
+ },
675
+ "foreignKeys": {},
676
+ "compositePrimaryKeys": {},
677
+ "uniqueConstraints": {},
678
+ "checkConstraints": {
679
+ "memory_decision_operation": {
680
+ "name": "memory_decision_operation",
681
+ "value": "\"memory_decision\".\"operation\" IN ('add', 'update', 'delete')"
682
+ },
683
+ "memory_decision_outcome": {
684
+ "name": "memory_decision_outcome",
685
+ "value": "\"memory_decision\".\"outcome\" IN ('applied', 'noop', 'rejected')"
686
+ }
687
+ }
688
+ },
689
+ "memory_entry": {
690
+ "name": "memory_entry",
691
+ "columns": {
692
+ "id": {
693
+ "name": "id",
694
+ "type": "text",
695
+ "primaryKey": true,
696
+ "notNull": true,
697
+ "autoincrement": false
698
+ },
699
+ "path": {
700
+ "name": "path",
701
+ "type": "text",
702
+ "primaryKey": false,
703
+ "notNull": true,
704
+ "autoincrement": false
705
+ },
706
+ "type": {
707
+ "name": "type",
708
+ "type": "text",
709
+ "primaryKey": false,
710
+ "notNull": true,
711
+ "autoincrement": false
712
+ },
713
+ "scope": {
714
+ "name": "scope",
715
+ "type": "text",
716
+ "primaryKey": false,
717
+ "notNull": true,
718
+ "autoincrement": false
719
+ },
720
+ "slug": {
721
+ "name": "slug",
722
+ "type": "text",
723
+ "primaryKey": false,
724
+ "notNull": true,
725
+ "autoincrement": false
726
+ },
727
+ "workspace_id": {
728
+ "name": "workspace_id",
729
+ "type": "text",
730
+ "primaryKey": false,
731
+ "notNull": true,
732
+ "autoincrement": false,
733
+ "default": "''"
734
+ },
735
+ "project_id": {
736
+ "name": "project_id",
737
+ "type": "text",
738
+ "primaryKey": false,
739
+ "notNull": true,
740
+ "autoincrement": false,
741
+ "default": "''"
742
+ },
743
+ "name": {
744
+ "name": "name",
745
+ "type": "text",
746
+ "primaryKey": false,
747
+ "notNull": true,
748
+ "autoincrement": false
749
+ },
750
+ "description": {
751
+ "name": "description",
752
+ "type": "text",
753
+ "primaryKey": false,
754
+ "notNull": true,
755
+ "autoincrement": false
756
+ },
757
+ "source_actor": {
758
+ "name": "source_actor",
759
+ "type": "text",
760
+ "primaryKey": false,
761
+ "notNull": true,
762
+ "autoincrement": false
763
+ },
764
+ "confidence": {
765
+ "name": "confidence",
766
+ "type": "text",
767
+ "primaryKey": false,
768
+ "notNull": true,
769
+ "autoincrement": false
770
+ },
771
+ "pinned": {
772
+ "name": "pinned",
773
+ "type": "integer",
774
+ "primaryKey": false,
775
+ "notNull": true,
776
+ "autoincrement": false,
777
+ "default": false
778
+ },
779
+ "content_hash": {
780
+ "name": "content_hash",
781
+ "type": "text",
782
+ "primaryKey": false,
783
+ "notNull": true,
784
+ "autoincrement": false
785
+ },
786
+ "created_at": {
787
+ "name": "created_at",
788
+ "type": "integer",
789
+ "primaryKey": false,
790
+ "notNull": true,
791
+ "autoincrement": false,
792
+ "default": "(unixepoch('subsec') * 1000)"
793
+ },
794
+ "updated_at": {
795
+ "name": "updated_at",
796
+ "type": "integer",
797
+ "primaryKey": false,
798
+ "notNull": true,
799
+ "autoincrement": false,
800
+ "default": "(unixepoch('subsec') * 1000)"
801
+ }
802
+ },
803
+ "indexes": {
804
+ "memory_entry_path_unique": {
805
+ "name": "memory_entry_path_unique",
806
+ "columns": [
807
+ "path"
808
+ ],
809
+ "isUnique": true
810
+ },
811
+ "memory_entry_identity": {
812
+ "name": "memory_entry_identity",
813
+ "columns": [
814
+ "scope",
815
+ "workspace_id",
816
+ "project_id",
817
+ "type",
818
+ "slug"
819
+ ],
820
+ "isUnique": true
821
+ }
822
+ },
823
+ "foreignKeys": {},
824
+ "compositePrimaryKeys": {},
825
+ "uniqueConstraints": {},
826
+ "checkConstraints": {
827
+ "memory_entry_type": {
828
+ "name": "memory_entry_type",
829
+ "value": "\"memory_entry\".\"type\" IN ('user', 'feedback', 'project', 'domain', 'process', 'contract', 'reference')"
830
+ },
831
+ "memory_entry_scope": {
832
+ "name": "memory_entry_scope",
833
+ "value": "\"memory_entry\".\"scope\" IN ('global', 'workspace', 'project')"
834
+ }
835
+ }
836
+ },
837
+ "memory_proposal": {
838
+ "name": "memory_proposal",
839
+ "columns": {
840
+ "id": {
841
+ "name": "id",
842
+ "type": "text",
843
+ "primaryKey": true,
844
+ "notNull": true,
845
+ "autoincrement": false
846
+ },
847
+ "path": {
848
+ "name": "path",
849
+ "type": "text",
850
+ "primaryKey": false,
851
+ "notNull": true,
852
+ "autoincrement": false
853
+ },
854
+ "type": {
855
+ "name": "type",
856
+ "type": "text",
857
+ "primaryKey": false,
858
+ "notNull": true,
859
+ "autoincrement": false
860
+ },
861
+ "scope": {
862
+ "name": "scope",
863
+ "type": "text",
864
+ "primaryKey": false,
865
+ "notNull": true,
866
+ "autoincrement": false
867
+ },
868
+ "slug": {
869
+ "name": "slug",
870
+ "type": "text",
871
+ "primaryKey": false,
872
+ "notNull": true,
873
+ "autoincrement": false
874
+ },
875
+ "workspace_id": {
876
+ "name": "workspace_id",
877
+ "type": "text",
878
+ "primaryKey": false,
879
+ "notNull": false,
880
+ "autoincrement": false
881
+ },
882
+ "project_id": {
883
+ "name": "project_id",
884
+ "type": "text",
885
+ "primaryKey": false,
886
+ "notNull": false,
887
+ "autoincrement": false
888
+ },
889
+ "name": {
890
+ "name": "name",
891
+ "type": "text",
892
+ "primaryKey": false,
893
+ "notNull": true,
894
+ "autoincrement": false
895
+ },
896
+ "description": {
897
+ "name": "description",
898
+ "type": "text",
899
+ "primaryKey": false,
900
+ "notNull": true,
901
+ "autoincrement": false
902
+ },
903
+ "body": {
904
+ "name": "body",
905
+ "type": "text",
906
+ "primaryKey": false,
907
+ "notNull": true,
908
+ "autoincrement": false,
909
+ "default": "''"
910
+ },
911
+ "actor": {
912
+ "name": "actor",
913
+ "type": "text",
914
+ "primaryKey": false,
915
+ "notNull": true,
916
+ "autoincrement": false
917
+ },
918
+ "from_project_id": {
919
+ "name": "from_project_id",
920
+ "type": "text",
921
+ "primaryKey": false,
922
+ "notNull": false,
923
+ "autoincrement": false
924
+ },
925
+ "session_id": {
926
+ "name": "session_id",
927
+ "type": "text",
928
+ "primaryKey": false,
929
+ "notNull": false,
930
+ "autoincrement": false
931
+ },
932
+ "confidence": {
933
+ "name": "confidence",
934
+ "type": "text",
935
+ "primaryKey": false,
936
+ "notNull": true,
937
+ "autoincrement": false
938
+ },
939
+ "evidence": {
940
+ "name": "evidence",
941
+ "type": "text",
942
+ "primaryKey": false,
943
+ "notNull": false,
944
+ "autoincrement": false
945
+ },
946
+ "status": {
947
+ "name": "status",
948
+ "type": "text",
949
+ "primaryKey": false,
950
+ "notNull": true,
951
+ "autoincrement": false,
952
+ "default": "'pending'"
953
+ },
954
+ "resolved_at": {
955
+ "name": "resolved_at",
956
+ "type": "integer",
957
+ "primaryKey": false,
958
+ "notNull": false,
959
+ "autoincrement": false
960
+ },
961
+ "resolution_note": {
962
+ "name": "resolution_note",
963
+ "type": "text",
964
+ "primaryKey": false,
965
+ "notNull": false,
966
+ "autoincrement": false
967
+ },
968
+ "created_at": {
969
+ "name": "created_at",
970
+ "type": "integer",
971
+ "primaryKey": false,
972
+ "notNull": true,
973
+ "autoincrement": false,
974
+ "default": "(unixepoch('subsec') * 1000)"
975
+ },
976
+ "updated_at": {
977
+ "name": "updated_at",
978
+ "type": "integer",
979
+ "primaryKey": false,
980
+ "notNull": true,
981
+ "autoincrement": false,
982
+ "default": "(unixepoch('subsec') * 1000)"
983
+ }
984
+ },
985
+ "indexes": {},
986
+ "foreignKeys": {},
987
+ "compositePrimaryKeys": {},
988
+ "uniqueConstraints": {},
989
+ "checkConstraints": {
990
+ "memory_proposal_status": {
991
+ "name": "memory_proposal_status",
992
+ "value": "\"memory_proposal\".\"status\" IN ('pending', 'approved', 'rejected')"
993
+ },
994
+ "memory_proposal_type": {
995
+ "name": "memory_proposal_type",
996
+ "value": "\"memory_proposal\".\"type\" IN ('user', 'feedback', 'project', 'domain', 'process', 'contract', 'reference')"
997
+ },
998
+ "memory_proposal_scope": {
999
+ "name": "memory_proposal_scope",
1000
+ "value": "\"memory_proposal\".\"scope\" IN ('global', 'workspace', 'project')"
1001
+ },
1002
+ "memory_proposal_actor": {
1003
+ "name": "memory_proposal_actor",
1004
+ "value": "\"memory_proposal\".\"actor\" IN ('human', 'agent', 'distiller', 'auto_research', 'import')"
1005
+ },
1006
+ "memory_proposal_confidence": {
1007
+ "name": "memory_proposal_confidence",
1008
+ "value": "\"memory_proposal\".\"confidence\" IN ('low', 'medium', 'high')"
1009
+ }
1010
+ }
1011
+ },
1012
+ "memory_signal": {
1013
+ "name": "memory_signal",
1014
+ "columns": {
1015
+ "path": {
1016
+ "name": "path",
1017
+ "type": "text",
1018
+ "primaryKey": true,
1019
+ "notNull": true,
1020
+ "autoincrement": false
1021
+ },
1022
+ "recall_count": {
1023
+ "name": "recall_count",
1024
+ "type": "integer",
1025
+ "primaryKey": false,
1026
+ "notNull": true,
1027
+ "autoincrement": false,
1028
+ "default": 0
1029
+ },
1030
+ "last_recalled_at": {
1031
+ "name": "last_recalled_at",
1032
+ "type": "integer",
1033
+ "primaryKey": false,
1034
+ "notNull": false,
1035
+ "autoincrement": false
1036
+ },
1037
+ "best_score": {
1038
+ "name": "best_score",
1039
+ "type": "real",
1040
+ "primaryKey": false,
1041
+ "notNull": true,
1042
+ "autoincrement": false,
1043
+ "default": 0
1044
+ },
1045
+ "created_at": {
1046
+ "name": "created_at",
1047
+ "type": "integer",
1048
+ "primaryKey": false,
1049
+ "notNull": true,
1050
+ "autoincrement": false,
1051
+ "default": "(unixepoch('subsec') * 1000)"
1052
+ },
1053
+ "updated_at": {
1054
+ "name": "updated_at",
1055
+ "type": "integer",
1056
+ "primaryKey": false,
1057
+ "notNull": true,
1058
+ "autoincrement": false,
1059
+ "default": "(unixepoch('subsec') * 1000)"
1060
+ }
1061
+ },
1062
+ "indexes": {},
1063
+ "foreignKeys": {},
1064
+ "compositePrimaryKeys": {},
1065
+ "uniqueConstraints": {},
1066
+ "checkConstraints": {}
1067
+ },
1068
+ "memory_usage": {
1069
+ "name": "memory_usage",
1070
+ "columns": {
1071
+ "id": {
1072
+ "name": "id",
1073
+ "type": "text",
1074
+ "primaryKey": true,
1075
+ "notNull": true,
1076
+ "autoincrement": false
1077
+ },
1078
+ "kind": {
1079
+ "name": "kind",
1080
+ "type": "text",
1081
+ "primaryKey": false,
1082
+ "notNull": true,
1083
+ "autoincrement": false
1084
+ },
1085
+ "session_id": {
1086
+ "name": "session_id",
1087
+ "type": "text",
1088
+ "primaryKey": false,
1089
+ "notNull": false,
1090
+ "autoincrement": false
1091
+ },
1092
+ "workspace_id": {
1093
+ "name": "workspace_id",
1094
+ "type": "text",
1095
+ "primaryKey": false,
1096
+ "notNull": false,
1097
+ "autoincrement": false
1098
+ },
1099
+ "project_id": {
1100
+ "name": "project_id",
1101
+ "type": "text",
1102
+ "primaryKey": false,
1103
+ "notNull": false,
1104
+ "autoincrement": false
1105
+ },
1106
+ "amount": {
1107
+ "name": "amount",
1108
+ "type": "integer",
1109
+ "primaryKey": false,
1110
+ "notNull": true,
1111
+ "autoincrement": false,
1112
+ "default": 0
1113
+ },
1114
+ "duration_ms": {
1115
+ "name": "duration_ms",
1116
+ "type": "integer",
1117
+ "primaryKey": false,
1118
+ "notNull": true,
1119
+ "autoincrement": false,
1120
+ "default": 0
1121
+ },
1122
+ "created_at": {
1123
+ "name": "created_at",
1124
+ "type": "integer",
1125
+ "primaryKey": false,
1126
+ "notNull": true,
1127
+ "autoincrement": false,
1128
+ "default": "(unixepoch('subsec') * 1000)"
1129
+ },
1130
+ "updated_at": {
1131
+ "name": "updated_at",
1132
+ "type": "integer",
1133
+ "primaryKey": false,
1134
+ "notNull": true,
1135
+ "autoincrement": false,
1136
+ "default": "(unixepoch('subsec') * 1000)"
1137
+ }
1138
+ },
1139
+ "indexes": {},
1140
+ "foreignKeys": {},
1141
+ "compositePrimaryKeys": {},
1142
+ "uniqueConstraints": {},
1143
+ "checkConstraints": {}
1144
+ },
1145
+ "named_agent": {
1146
+ "name": "named_agent",
1147
+ "columns": {
1148
+ "id": {
1149
+ "name": "id",
1150
+ "type": "text",
1151
+ "primaryKey": true,
1152
+ "notNull": true,
1153
+ "autoincrement": false
1154
+ },
1155
+ "workspace_id": {
1156
+ "name": "workspace_id",
1157
+ "type": "text",
1158
+ "primaryKey": false,
1159
+ "notNull": true,
1160
+ "autoincrement": false
1161
+ },
1162
+ "name": {
1163
+ "name": "name",
1164
+ "type": "text",
1165
+ "primaryKey": false,
1166
+ "notNull": true,
1167
+ "autoincrement": false
1168
+ },
1169
+ "adapter": {
1170
+ "name": "adapter",
1171
+ "type": "text",
1172
+ "primaryKey": false,
1173
+ "notNull": true,
1174
+ "autoincrement": false
1175
+ },
1176
+ "model": {
1177
+ "name": "model",
1178
+ "type": "text",
1179
+ "primaryKey": false,
1180
+ "notNull": false,
1181
+ "autoincrement": false
1182
+ },
1183
+ "account_id": {
1184
+ "name": "account_id",
1185
+ "type": "text",
1186
+ "primaryKey": false,
1187
+ "notNull": false,
1188
+ "autoincrement": false
1189
+ },
1190
+ "effort": {
1191
+ "name": "effort",
1192
+ "type": "text",
1193
+ "primaryKey": false,
1194
+ "notNull": false,
1195
+ "autoincrement": false
1196
+ },
1197
+ "instructions": {
1198
+ "name": "instructions",
1199
+ "type": "text",
1200
+ "primaryKey": false,
1201
+ "notNull": true,
1202
+ "autoincrement": false,
1203
+ "default": "''"
1204
+ },
1205
+ "created_at": {
1206
+ "name": "created_at",
1207
+ "type": "integer",
1208
+ "primaryKey": false,
1209
+ "notNull": true,
1210
+ "autoincrement": false,
1211
+ "default": "(unixepoch('subsec') * 1000)"
1212
+ },
1213
+ "updated_at": {
1214
+ "name": "updated_at",
1215
+ "type": "integer",
1216
+ "primaryKey": false,
1217
+ "notNull": true,
1218
+ "autoincrement": false,
1219
+ "default": "(unixepoch('subsec') * 1000)"
1220
+ }
1221
+ },
1222
+ "indexes": {
1223
+ "named_agent_name_in_workspace": {
1224
+ "name": "named_agent_name_in_workspace",
1225
+ "columns": [
1226
+ "workspace_id",
1227
+ "name"
1228
+ ],
1229
+ "isUnique": true
1230
+ }
1231
+ },
1232
+ "foreignKeys": {
1233
+ "named_agent_workspace_id_workspace_id_fk": {
1234
+ "name": "named_agent_workspace_id_workspace_id_fk",
1235
+ "tableFrom": "named_agent",
1236
+ "tableTo": "workspace",
1237
+ "columnsFrom": [
1238
+ "workspace_id"
1239
+ ],
1240
+ "columnsTo": [
1241
+ "id"
1242
+ ],
1243
+ "onDelete": "restrict",
1244
+ "onUpdate": "no action"
1245
+ },
1246
+ "named_agent_account_id_agent_account_id_fk": {
1247
+ "name": "named_agent_account_id_agent_account_id_fk",
1248
+ "tableFrom": "named_agent",
1249
+ "tableTo": "agent_account",
1250
+ "columnsFrom": [
1251
+ "account_id"
1252
+ ],
1253
+ "columnsTo": [
1254
+ "id"
1255
+ ],
1256
+ "onDelete": "set null",
1257
+ "onUpdate": "no action"
1258
+ }
1259
+ },
1260
+ "compositePrimaryKeys": {},
1261
+ "uniqueConstraints": {},
1262
+ "checkConstraints": {}
1263
+ },
1264
+ "playbook": {
1265
+ "name": "playbook",
1266
+ "columns": {
1267
+ "id": {
1268
+ "name": "id",
1269
+ "type": "text",
1270
+ "primaryKey": true,
1271
+ "notNull": true,
1272
+ "autoincrement": false
1273
+ },
1274
+ "path": {
1275
+ "name": "path",
1276
+ "type": "text",
1277
+ "primaryKey": false,
1278
+ "notNull": true,
1279
+ "autoincrement": false
1280
+ },
1281
+ "scope": {
1282
+ "name": "scope",
1283
+ "type": "text",
1284
+ "primaryKey": false,
1285
+ "notNull": true,
1286
+ "autoincrement": false
1287
+ },
1288
+ "slug": {
1289
+ "name": "slug",
1290
+ "type": "text",
1291
+ "primaryKey": false,
1292
+ "notNull": true,
1293
+ "autoincrement": false
1294
+ },
1295
+ "workspace_id": {
1296
+ "name": "workspace_id",
1297
+ "type": "text",
1298
+ "primaryKey": false,
1299
+ "notNull": true,
1300
+ "autoincrement": false,
1301
+ "default": "''"
1302
+ },
1303
+ "project_id": {
1304
+ "name": "project_id",
1305
+ "type": "text",
1306
+ "primaryKey": false,
1307
+ "notNull": true,
1308
+ "autoincrement": false,
1309
+ "default": "''"
1310
+ },
1311
+ "task_class": {
1312
+ "name": "task_class",
1313
+ "type": "text",
1314
+ "primaryKey": false,
1315
+ "notNull": true,
1316
+ "autoincrement": false
1317
+ },
1318
+ "description": {
1319
+ "name": "description",
1320
+ "type": "text",
1321
+ "primaryKey": false,
1322
+ "notNull": true,
1323
+ "autoincrement": false
1324
+ },
1325
+ "pinned": {
1326
+ "name": "pinned",
1327
+ "type": "integer",
1328
+ "primaryKey": false,
1329
+ "notNull": true,
1330
+ "autoincrement": false,
1331
+ "default": false
1332
+ },
1333
+ "archived": {
1334
+ "name": "archived",
1335
+ "type": "integer",
1336
+ "primaryKey": false,
1337
+ "notNull": true,
1338
+ "autoincrement": false,
1339
+ "default": false
1340
+ },
1341
+ "loads": {
1342
+ "name": "loads",
1343
+ "type": "integer",
1344
+ "primaryKey": false,
1345
+ "notNull": true,
1346
+ "autoincrement": false,
1347
+ "default": 0
1348
+ },
1349
+ "last_loaded_at": {
1350
+ "name": "last_loaded_at",
1351
+ "type": "integer",
1352
+ "primaryKey": false,
1353
+ "notNull": false,
1354
+ "autoincrement": false
1355
+ },
1356
+ "content_hash": {
1357
+ "name": "content_hash",
1358
+ "type": "text",
1359
+ "primaryKey": false,
1360
+ "notNull": true,
1361
+ "autoincrement": false
1362
+ },
1363
+ "created_at": {
1364
+ "name": "created_at",
1365
+ "type": "integer",
1366
+ "primaryKey": false,
1367
+ "notNull": true,
1368
+ "autoincrement": false,
1369
+ "default": "(unixepoch('subsec') * 1000)"
1370
+ },
1371
+ "updated_at": {
1372
+ "name": "updated_at",
1373
+ "type": "integer",
1374
+ "primaryKey": false,
1375
+ "notNull": true,
1376
+ "autoincrement": false,
1377
+ "default": "(unixepoch('subsec') * 1000)"
1378
+ }
1379
+ },
1380
+ "indexes": {
1381
+ "playbook_path_unique": {
1382
+ "name": "playbook_path_unique",
1383
+ "columns": [
1384
+ "path"
1385
+ ],
1386
+ "isUnique": true
1387
+ },
1388
+ "playbook_identity": {
1389
+ "name": "playbook_identity",
1390
+ "columns": [
1391
+ "scope",
1392
+ "workspace_id",
1393
+ "project_id",
1394
+ "slug"
1395
+ ],
1396
+ "isUnique": true
1397
+ }
1398
+ },
1399
+ "foreignKeys": {},
1400
+ "compositePrimaryKeys": {},
1401
+ "uniqueConstraints": {},
1402
+ "checkConstraints": {
1403
+ "playbook_scope": {
1404
+ "name": "playbook_scope",
1405
+ "value": "\"playbook\".\"scope\" IN ('workspace', 'project')"
1406
+ }
1407
+ }
1408
+ },
1409
+ "project": {
1410
+ "name": "project",
1411
+ "columns": {
1412
+ "id": {
1413
+ "name": "id",
1414
+ "type": "text",
1415
+ "primaryKey": true,
1416
+ "notNull": true,
1417
+ "autoincrement": false
1418
+ },
1419
+ "workspace_id": {
1420
+ "name": "workspace_id",
1421
+ "type": "text",
1422
+ "primaryKey": false,
1423
+ "notNull": true,
1424
+ "autoincrement": false
1425
+ },
1426
+ "name": {
1427
+ "name": "name",
1428
+ "type": "text",
1429
+ "primaryKey": false,
1430
+ "notNull": true,
1431
+ "autoincrement": false
1432
+ },
1433
+ "path": {
1434
+ "name": "path",
1435
+ "type": "text",
1436
+ "primaryKey": false,
1437
+ "notNull": true,
1438
+ "autoincrement": false
1439
+ },
1440
+ "default_branch": {
1441
+ "name": "default_branch",
1442
+ "type": "text",
1443
+ "primaryKey": false,
1444
+ "notNull": true,
1445
+ "autoincrement": false
1446
+ },
1447
+ "remote_url": {
1448
+ "name": "remote_url",
1449
+ "type": "text",
1450
+ "primaryKey": false,
1451
+ "notNull": false,
1452
+ "autoincrement": false
1453
+ },
1454
+ "managed": {
1455
+ "name": "managed",
1456
+ "type": "integer",
1457
+ "primaryKey": false,
1458
+ "notNull": true,
1459
+ "autoincrement": false,
1460
+ "default": false
1461
+ },
1462
+ "scripts_trusted_hash": {
1463
+ "name": "scripts_trusted_hash",
1464
+ "type": "text",
1465
+ "primaryKey": false,
1466
+ "notNull": false,
1467
+ "autoincrement": false
1468
+ },
1469
+ "created_at": {
1470
+ "name": "created_at",
1471
+ "type": "integer",
1472
+ "primaryKey": false,
1473
+ "notNull": true,
1474
+ "autoincrement": false,
1475
+ "default": "(unixepoch('subsec') * 1000)"
1476
+ },
1477
+ "updated_at": {
1478
+ "name": "updated_at",
1479
+ "type": "integer",
1480
+ "primaryKey": false,
1481
+ "notNull": true,
1482
+ "autoincrement": false,
1483
+ "default": "(unixepoch('subsec') * 1000)"
1484
+ }
1485
+ },
1486
+ "indexes": {
1487
+ "project_path_unique": {
1488
+ "name": "project_path_unique",
1489
+ "columns": [
1490
+ "path"
1491
+ ],
1492
+ "isUnique": true
1493
+ },
1494
+ "project_name_per_workspace": {
1495
+ "name": "project_name_per_workspace",
1496
+ "columns": [
1497
+ "workspace_id",
1498
+ "name"
1499
+ ],
1500
+ "isUnique": true
1501
+ }
1502
+ },
1503
+ "foreignKeys": {
1504
+ "project_workspace_id_workspace_id_fk": {
1505
+ "name": "project_workspace_id_workspace_id_fk",
1506
+ "tableFrom": "project",
1507
+ "tableTo": "workspace",
1508
+ "columnsFrom": [
1509
+ "workspace_id"
1510
+ ],
1511
+ "columnsTo": [
1512
+ "id"
1513
+ ],
1514
+ "onDelete": "restrict",
1515
+ "onUpdate": "no action"
1516
+ }
1517
+ },
1518
+ "compositePrimaryKeys": {},
1519
+ "uniqueConstraints": {},
1520
+ "checkConstraints": {}
1521
+ },
1522
+ "role_binding": {
1523
+ "name": "role_binding",
1524
+ "columns": {
1525
+ "id": {
1526
+ "name": "id",
1527
+ "type": "text",
1528
+ "primaryKey": true,
1529
+ "notNull": true,
1530
+ "autoincrement": false
1531
+ },
1532
+ "scope_type": {
1533
+ "name": "scope_type",
1534
+ "type": "text",
1535
+ "primaryKey": false,
1536
+ "notNull": true,
1537
+ "autoincrement": false
1538
+ },
1539
+ "scope_id": {
1540
+ "name": "scope_id",
1541
+ "type": "text",
1542
+ "primaryKey": false,
1543
+ "notNull": true,
1544
+ "autoincrement": false
1545
+ },
1546
+ "role": {
1547
+ "name": "role",
1548
+ "type": "text",
1549
+ "primaryKey": false,
1550
+ "notNull": true,
1551
+ "autoincrement": false
1552
+ },
1553
+ "agent_id": {
1554
+ "name": "agent_id",
1555
+ "type": "text",
1556
+ "primaryKey": false,
1557
+ "notNull": true,
1558
+ "autoincrement": false
1559
+ },
1560
+ "created_at": {
1561
+ "name": "created_at",
1562
+ "type": "integer",
1563
+ "primaryKey": false,
1564
+ "notNull": true,
1565
+ "autoincrement": false,
1566
+ "default": "(unixepoch('subsec') * 1000)"
1567
+ },
1568
+ "updated_at": {
1569
+ "name": "updated_at",
1570
+ "type": "integer",
1571
+ "primaryKey": false,
1572
+ "notNull": true,
1573
+ "autoincrement": false,
1574
+ "default": "(unixepoch('subsec') * 1000)"
1575
+ }
1576
+ },
1577
+ "indexes": {
1578
+ "role_binding_one_per_scope": {
1579
+ "name": "role_binding_one_per_scope",
1580
+ "columns": [
1581
+ "scope_type",
1582
+ "scope_id",
1583
+ "role"
1584
+ ],
1585
+ "isUnique": true
1586
+ }
1587
+ },
1588
+ "foreignKeys": {
1589
+ "role_binding_agent_id_named_agent_id_fk": {
1590
+ "name": "role_binding_agent_id_named_agent_id_fk",
1591
+ "tableFrom": "role_binding",
1592
+ "tableTo": "named_agent",
1593
+ "columnsFrom": [
1594
+ "agent_id"
1595
+ ],
1596
+ "columnsTo": [
1597
+ "id"
1598
+ ],
1599
+ "onDelete": "cascade",
1600
+ "onUpdate": "no action"
1601
+ }
1602
+ },
1603
+ "compositePrimaryKeys": {},
1604
+ "uniqueConstraints": {},
1605
+ "checkConstraints": {
1606
+ "role_binding_scope_type": {
1607
+ "name": "role_binding_scope_type",
1608
+ "value": "\"role_binding\".\"scope_type\" IN ('workspace', 'project', 'task')"
1609
+ },
1610
+ "role_binding_role": {
1611
+ "name": "role_binding_role",
1612
+ "value": "\"role_binding\".\"role\" IN ('implementador', 'revisor', 'testador')"
1613
+ }
1614
+ }
1615
+ },
1616
+ "session": {
1617
+ "name": "session",
1618
+ "columns": {
1619
+ "id": {
1620
+ "name": "id",
1621
+ "type": "text",
1622
+ "primaryKey": true,
1623
+ "notNull": true,
1624
+ "autoincrement": false
1625
+ },
1626
+ "kind": {
1627
+ "name": "kind",
1628
+ "type": "text",
1629
+ "primaryKey": false,
1630
+ "notNull": true,
1631
+ "autoincrement": false
1632
+ },
1633
+ "script_name": {
1634
+ "name": "script_name",
1635
+ "type": "text",
1636
+ "primaryKey": false,
1637
+ "notNull": false,
1638
+ "autoincrement": false
1639
+ },
1640
+ "agent_config_id": {
1641
+ "name": "agent_config_id",
1642
+ "type": "text",
1643
+ "primaryKey": false,
1644
+ "notNull": false,
1645
+ "autoincrement": false
1646
+ },
1647
+ "agent_account_id": {
1648
+ "name": "agent_account_id",
1649
+ "type": "text",
1650
+ "primaryKey": false,
1651
+ "notNull": false,
1652
+ "autoincrement": false
1653
+ },
1654
+ "scope_type": {
1655
+ "name": "scope_type",
1656
+ "type": "text",
1657
+ "primaryKey": false,
1658
+ "notNull": true,
1659
+ "autoincrement": false
1660
+ },
1661
+ "scope_id": {
1662
+ "name": "scope_id",
1663
+ "type": "text",
1664
+ "primaryKey": false,
1665
+ "notNull": true,
1666
+ "autoincrement": false
1667
+ },
1668
+ "cwd": {
1669
+ "name": "cwd",
1670
+ "type": "text",
1671
+ "primaryKey": false,
1672
+ "notNull": true,
1673
+ "autoincrement": false
1674
+ },
1675
+ "command": {
1676
+ "name": "command",
1677
+ "type": "text",
1678
+ "primaryKey": false,
1679
+ "notNull": true,
1680
+ "autoincrement": false
1681
+ },
1682
+ "state": {
1683
+ "name": "state",
1684
+ "type": "text",
1685
+ "primaryKey": false,
1686
+ "notNull": true,
1687
+ "autoincrement": false,
1688
+ "default": "'running'"
1689
+ },
1690
+ "exit_code": {
1691
+ "name": "exit_code",
1692
+ "type": "integer",
1693
+ "primaryKey": false,
1694
+ "notNull": false,
1695
+ "autoincrement": false
1696
+ },
1697
+ "transport": {
1698
+ "name": "transport",
1699
+ "type": "text",
1700
+ "primaryKey": false,
1701
+ "notNull": true,
1702
+ "autoincrement": false,
1703
+ "default": "'pty'"
1704
+ },
1705
+ "acp_session_id": {
1706
+ "name": "acp_session_id",
1707
+ "type": "text",
1708
+ "primaryKey": false,
1709
+ "notNull": false,
1710
+ "autoincrement": false
1711
+ },
1712
+ "mode": {
1713
+ "name": "mode",
1714
+ "type": "text",
1715
+ "primaryKey": false,
1716
+ "notNull": false,
1717
+ "autoincrement": false
1718
+ },
1719
+ "model": {
1720
+ "name": "model",
1721
+ "type": "text",
1722
+ "primaryKey": false,
1723
+ "notNull": false,
1724
+ "autoincrement": false
1725
+ },
1726
+ "lumem_mode": {
1727
+ "name": "lumem_mode",
1728
+ "type": "text",
1729
+ "primaryKey": false,
1730
+ "notNull": true,
1731
+ "autoincrement": false,
1732
+ "default": "'ask'"
1733
+ },
1734
+ "resumed_from_id": {
1735
+ "name": "resumed_from_id",
1736
+ "type": "text",
1737
+ "primaryKey": false,
1738
+ "notNull": false,
1739
+ "autoincrement": false
1740
+ },
1741
+ "continued_from_id": {
1742
+ "name": "continued_from_id",
1743
+ "type": "text",
1744
+ "primaryKey": false,
1745
+ "notNull": false,
1746
+ "autoincrement": false
1747
+ },
1748
+ "task_id": {
1749
+ "name": "task_id",
1750
+ "type": "text",
1751
+ "primaryKey": false,
1752
+ "notNull": false,
1753
+ "autoincrement": false
1754
+ },
1755
+ "task_role": {
1756
+ "name": "task_role",
1757
+ "type": "text",
1758
+ "primaryKey": false,
1759
+ "notNull": false,
1760
+ "autoincrement": false
1761
+ },
1762
+ "pending_prompt": {
1763
+ "name": "pending_prompt",
1764
+ "type": "text",
1765
+ "primaryKey": false,
1766
+ "notNull": false,
1767
+ "autoincrement": false
1768
+ },
1769
+ "pending_reason": {
1770
+ "name": "pending_reason",
1771
+ "type": "text",
1772
+ "primaryKey": false,
1773
+ "notNull": false,
1774
+ "autoincrement": false
1775
+ },
1776
+ "pending_detail": {
1777
+ "name": "pending_detail",
1778
+ "type": "text",
1779
+ "primaryKey": false,
1780
+ "notNull": false,
1781
+ "autoincrement": false
1782
+ },
1783
+ "created_at": {
1784
+ "name": "created_at",
1785
+ "type": "integer",
1786
+ "primaryKey": false,
1787
+ "notNull": true,
1788
+ "autoincrement": false,
1789
+ "default": "(unixepoch('subsec') * 1000)"
1790
+ },
1791
+ "updated_at": {
1792
+ "name": "updated_at",
1793
+ "type": "integer",
1794
+ "primaryKey": false,
1795
+ "notNull": true,
1796
+ "autoincrement": false,
1797
+ "default": "(unixepoch('subsec') * 1000)"
1798
+ }
1799
+ },
1800
+ "indexes": {},
1801
+ "foreignKeys": {
1802
+ "session_agent_config_id_agent_config_id_fk": {
1803
+ "name": "session_agent_config_id_agent_config_id_fk",
1804
+ "tableFrom": "session",
1805
+ "tableTo": "agent_config",
1806
+ "columnsFrom": [
1807
+ "agent_config_id"
1808
+ ],
1809
+ "columnsTo": [
1810
+ "id"
1811
+ ],
1812
+ "onDelete": "restrict",
1813
+ "onUpdate": "no action"
1814
+ },
1815
+ "session_agent_account_id_agent_account_id_fk": {
1816
+ "name": "session_agent_account_id_agent_account_id_fk",
1817
+ "tableFrom": "session",
1818
+ "tableTo": "agent_account",
1819
+ "columnsFrom": [
1820
+ "agent_account_id"
1821
+ ],
1822
+ "columnsTo": [
1823
+ "id"
1824
+ ],
1825
+ "onDelete": "restrict",
1826
+ "onUpdate": "no action"
1827
+ },
1828
+ "session_continued_from_id_session_id_fk": {
1829
+ "name": "session_continued_from_id_session_id_fk",
1830
+ "tableFrom": "session",
1831
+ "tableTo": "session",
1832
+ "columnsFrom": [
1833
+ "continued_from_id"
1834
+ ],
1835
+ "columnsTo": [
1836
+ "id"
1837
+ ],
1838
+ "onDelete": "set null",
1839
+ "onUpdate": "no action"
1840
+ },
1841
+ "session_task_id_task_id_fk": {
1842
+ "name": "session_task_id_task_id_fk",
1843
+ "tableFrom": "session",
1844
+ "tableTo": "task",
1845
+ "columnsFrom": [
1846
+ "task_id"
1847
+ ],
1848
+ "columnsTo": [
1849
+ "id"
1850
+ ],
1851
+ "onDelete": "set null",
1852
+ "onUpdate": "no action"
1853
+ }
1854
+ },
1855
+ "compositePrimaryKeys": {},
1856
+ "uniqueConstraints": {},
1857
+ "checkConstraints": {
1858
+ "session_kind": {
1859
+ "name": "session_kind",
1860
+ "value": "\"session\".\"kind\" IN ('shell', 'agent', 'script')"
1861
+ },
1862
+ "session_scope_type": {
1863
+ "name": "session_scope_type",
1864
+ "value": "\"session\".\"scope_type\" IN ('project', 'worktree')"
1865
+ },
1866
+ "session_state": {
1867
+ "name": "session_state",
1868
+ "value": "\"session\".\"state\" IN ('running', 'exited')"
1869
+ },
1870
+ "session_agent_config": {
1871
+ "name": "session_agent_config",
1872
+ "value": "(\"session\".\"kind\" = 'agent' AND \"session\".\"agent_config_id\" IS NOT NULL\n AND \"session\".\"agent_account_id\" IS NOT NULL)\n OR (\"session\".\"kind\" <> 'agent' AND \"session\".\"agent_config_id\" IS NULL\n AND \"session\".\"agent_account_id\" IS NULL)"
1873
+ },
1874
+ "session_script_name": {
1875
+ "name": "session_script_name",
1876
+ "value": "(\"session\".\"kind\" = 'script' AND \"session\".\"script_name\" IS NOT NULL\n AND \"session\".\"script_name\" IN ('setup', 'run', 'teardown', 'test'))\n OR (\"session\".\"kind\" <> 'script' AND \"session\".\"script_name\" IS NULL)"
1877
+ },
1878
+ "session_exit_code": {
1879
+ "name": "session_exit_code",
1880
+ "value": "(\"session\".\"state\" = 'running' AND \"session\".\"exit_code\" IS NULL)\n OR (\"session\".\"state\" = 'exited')"
1881
+ },
1882
+ "session_transport": {
1883
+ "name": "session_transport",
1884
+ "value": "\"session\".\"transport\" IN ('pty', 'acp')"
1885
+ },
1886
+ "session_shell_transport": {
1887
+ "name": "session_shell_transport",
1888
+ "value": "\"session\".\"kind\" = 'agent' OR \"session\".\"transport\" = 'pty'"
1889
+ },
1890
+ "session_acp_id": {
1891
+ "name": "session_acp_id",
1892
+ "value": "(\"session\".\"transport\" = 'acp' AND \"session\".\"acp_session_id\" IS NOT NULL)\n OR (\"session\".\"transport\" = 'pty' AND \"session\".\"acp_session_id\" IS NULL)"
1893
+ },
1894
+ "session_lumem_mode": {
1895
+ "name": "session_lumem_mode",
1896
+ "value": "\"session\".\"lumem_mode\" IN ('ask', 'auto', 'free')"
1897
+ },
1898
+ "session_pending_reason": {
1899
+ "name": "session_pending_reason",
1900
+ "value": "\"session\".\"pending_reason\" IS NULL OR \"session\".\"pending_reason\" IN ('setup_failed')"
1901
+ }
1902
+ }
1903
+ },
1904
+ "session_usage": {
1905
+ "name": "session_usage",
1906
+ "columns": {
1907
+ "id": {
1908
+ "name": "id",
1909
+ "type": "text",
1910
+ "primaryKey": true,
1911
+ "notNull": true,
1912
+ "autoincrement": false
1913
+ },
1914
+ "session_id": {
1915
+ "name": "session_id",
1916
+ "type": "text",
1917
+ "primaryKey": false,
1918
+ "notNull": true,
1919
+ "autoincrement": false
1920
+ },
1921
+ "project_id": {
1922
+ "name": "project_id",
1923
+ "type": "text",
1924
+ "primaryKey": false,
1925
+ "notNull": true,
1926
+ "autoincrement": false
1927
+ },
1928
+ "worktree_id": {
1929
+ "name": "worktree_id",
1930
+ "type": "text",
1931
+ "primaryKey": false,
1932
+ "notNull": true,
1933
+ "autoincrement": false,
1934
+ "default": "''"
1935
+ },
1936
+ "agent_config_id": {
1937
+ "name": "agent_config_id",
1938
+ "type": "text",
1939
+ "primaryKey": false,
1940
+ "notNull": false,
1941
+ "autoincrement": false
1942
+ },
1943
+ "agent_account_id": {
1944
+ "name": "agent_account_id",
1945
+ "type": "text",
1946
+ "primaryKey": false,
1947
+ "notNull": false,
1948
+ "autoincrement": false
1949
+ },
1950
+ "tokens": {
1951
+ "name": "tokens",
1952
+ "type": "integer",
1953
+ "primaryKey": false,
1954
+ "notNull": true,
1955
+ "autoincrement": false,
1956
+ "default": 0
1957
+ },
1958
+ "turn": {
1959
+ "name": "turn",
1960
+ "type": "integer",
1961
+ "primaryKey": false,
1962
+ "notNull": true,
1963
+ "autoincrement": false,
1964
+ "default": 0
1965
+ },
1966
+ "cost": {
1967
+ "name": "cost",
1968
+ "type": "real",
1969
+ "primaryKey": false,
1970
+ "notNull": false,
1971
+ "autoincrement": false
1972
+ },
1973
+ "currency": {
1974
+ "name": "currency",
1975
+ "type": "text",
1976
+ "primaryKey": false,
1977
+ "notNull": false,
1978
+ "autoincrement": false
1979
+ },
1980
+ "created_at": {
1981
+ "name": "created_at",
1982
+ "type": "integer",
1983
+ "primaryKey": false,
1984
+ "notNull": true,
1985
+ "autoincrement": false,
1986
+ "default": "(unixepoch('subsec') * 1000)"
1987
+ },
1988
+ "updated_at": {
1989
+ "name": "updated_at",
1990
+ "type": "integer",
1991
+ "primaryKey": false,
1992
+ "notNull": true,
1993
+ "autoincrement": false,
1994
+ "default": "(unixepoch('subsec') * 1000)"
1995
+ }
1996
+ },
1997
+ "indexes": {
1998
+ "session_usage_project_at": {
1999
+ "name": "session_usage_project_at",
2000
+ "columns": [
2001
+ "project_id",
2002
+ "created_at"
2003
+ ],
2004
+ "isUnique": false
2005
+ },
2006
+ "session_usage_worktree_at": {
2007
+ "name": "session_usage_worktree_at",
2008
+ "columns": [
2009
+ "worktree_id",
2010
+ "created_at"
2011
+ ],
2012
+ "isUnique": false
2013
+ }
2014
+ },
2015
+ "foreignKeys": {},
2016
+ "compositePrimaryKeys": {},
2017
+ "uniqueConstraints": {},
2018
+ "checkConstraints": {
2019
+ "session_usage_tokens": {
2020
+ "name": "session_usage_tokens",
2021
+ "value": "\"session_usage\".\"tokens\" >= 0"
2022
+ }
2023
+ }
2024
+ },
2025
+ "task": {
2026
+ "name": "task",
2027
+ "columns": {
2028
+ "id": {
2029
+ "name": "id",
2030
+ "type": "text",
2031
+ "primaryKey": true,
2032
+ "notNull": true,
2033
+ "autoincrement": false
2034
+ },
2035
+ "workspace_id": {
2036
+ "name": "workspace_id",
2037
+ "type": "text",
2038
+ "primaryKey": false,
2039
+ "notNull": true,
2040
+ "autoincrement": false
2041
+ },
2042
+ "project_id": {
2043
+ "name": "project_id",
2044
+ "type": "text",
2045
+ "primaryKey": false,
2046
+ "notNull": true,
2047
+ "autoincrement": false
2048
+ },
2049
+ "title": {
2050
+ "name": "title",
2051
+ "type": "text",
2052
+ "primaryKey": false,
2053
+ "notNull": true,
2054
+ "autoincrement": false
2055
+ },
2056
+ "body": {
2057
+ "name": "body",
2058
+ "type": "text",
2059
+ "primaryKey": false,
2060
+ "notNull": true,
2061
+ "autoincrement": false,
2062
+ "default": "''"
2063
+ },
2064
+ "status": {
2065
+ "name": "status",
2066
+ "type": "text",
2067
+ "primaryKey": false,
2068
+ "notNull": true,
2069
+ "autoincrement": false,
2070
+ "default": "'open'"
2071
+ },
2072
+ "created_by": {
2073
+ "name": "created_by",
2074
+ "type": "text",
2075
+ "primaryKey": false,
2076
+ "notNull": true,
2077
+ "autoincrement": false,
2078
+ "default": "'human'"
2079
+ },
2080
+ "created_by_session": {
2081
+ "name": "created_by_session",
2082
+ "type": "text",
2083
+ "primaryKey": false,
2084
+ "notNull": false,
2085
+ "autoincrement": false
2086
+ },
2087
+ "worktree_id": {
2088
+ "name": "worktree_id",
2089
+ "type": "text",
2090
+ "primaryKey": false,
2091
+ "notNull": false,
2092
+ "autoincrement": false
2093
+ },
2094
+ "position": {
2095
+ "name": "position",
2096
+ "type": "integer",
2097
+ "primaryKey": false,
2098
+ "notNull": true,
2099
+ "autoincrement": false,
2100
+ "default": 0
2101
+ },
2102
+ "links": {
2103
+ "name": "links",
2104
+ "type": "text",
2105
+ "primaryKey": false,
2106
+ "notNull": true,
2107
+ "autoincrement": false,
2108
+ "default": "'[]'"
2109
+ },
2110
+ "reason": {
2111
+ "name": "reason",
2112
+ "type": "text",
2113
+ "primaryKey": false,
2114
+ "notNull": false,
2115
+ "autoincrement": false
2116
+ },
2117
+ "attempts": {
2118
+ "name": "attempts",
2119
+ "type": "integer",
2120
+ "primaryKey": false,
2121
+ "notNull": true,
2122
+ "autoincrement": false,
2123
+ "default": 0
2124
+ },
2125
+ "bounces": {
2126
+ "name": "bounces",
2127
+ "type": "integer",
2128
+ "primaryKey": false,
2129
+ "notNull": true,
2130
+ "autoincrement": false,
2131
+ "default": 0
2132
+ },
2133
+ "quota_refusals": {
2134
+ "name": "quota_refusals",
2135
+ "type": "integer",
2136
+ "primaryKey": false,
2137
+ "notNull": true,
2138
+ "autoincrement": false,
2139
+ "default": 0
2140
+ },
2141
+ "paused_until": {
2142
+ "name": "paused_until",
2143
+ "type": "integer",
2144
+ "primaryKey": false,
2145
+ "notNull": false,
2146
+ "autoincrement": false
2147
+ },
2148
+ "autonomy": {
2149
+ "name": "autonomy",
2150
+ "type": "text",
2151
+ "primaryKey": false,
2152
+ "notNull": true,
2153
+ "autoincrement": false,
2154
+ "default": "'inherit'"
2155
+ },
2156
+ "prepared_prompt": {
2157
+ "name": "prepared_prompt",
2158
+ "type": "text",
2159
+ "primaryKey": false,
2160
+ "notNull": false,
2161
+ "autoincrement": false
2162
+ },
2163
+ "prepared_role": {
2164
+ "name": "prepared_role",
2165
+ "type": "text",
2166
+ "primaryKey": false,
2167
+ "notNull": false,
2168
+ "autoincrement": false
2169
+ },
2170
+ "blocked_reason": {
2171
+ "name": "blocked_reason",
2172
+ "type": "text",
2173
+ "primaryKey": false,
2174
+ "notNull": false,
2175
+ "autoincrement": false
2176
+ },
2177
+ "notified_at": {
2178
+ "name": "notified_at",
2179
+ "type": "integer",
2180
+ "primaryKey": false,
2181
+ "notNull": false,
2182
+ "autoincrement": false
2183
+ },
2184
+ "external_source": {
2185
+ "name": "external_source",
2186
+ "type": "text",
2187
+ "primaryKey": false,
2188
+ "notNull": false,
2189
+ "autoincrement": false
2190
+ },
2191
+ "external_id": {
2192
+ "name": "external_id",
2193
+ "type": "text",
2194
+ "primaryKey": false,
2195
+ "notNull": false,
2196
+ "autoincrement": false
2197
+ },
2198
+ "external_state": {
2199
+ "name": "external_state",
2200
+ "type": "text",
2201
+ "primaryKey": false,
2202
+ "notNull": false,
2203
+ "autoincrement": false
2204
+ },
2205
+ "external_assignee": {
2206
+ "name": "external_assignee",
2207
+ "type": "text",
2208
+ "primaryKey": false,
2209
+ "notNull": false,
2210
+ "autoincrement": false
2211
+ },
2212
+ "external_body_hash": {
2213
+ "name": "external_body_hash",
2214
+ "type": "text",
2215
+ "primaryKey": false,
2216
+ "notNull": false,
2217
+ "autoincrement": false
2218
+ },
2219
+ "external_marks": {
2220
+ "name": "external_marks",
2221
+ "type": "text",
2222
+ "primaryKey": false,
2223
+ "notNull": true,
2224
+ "autoincrement": false,
2225
+ "default": "'[]'"
2226
+ },
2227
+ "status_changed_at": {
2228
+ "name": "status_changed_at",
2229
+ "type": "integer",
2230
+ "primaryKey": false,
2231
+ "notNull": true,
2232
+ "autoincrement": false,
2233
+ "default": "0"
2234
+ },
2235
+ "closed_at": {
2236
+ "name": "closed_at",
2237
+ "type": "integer",
2238
+ "primaryKey": false,
2239
+ "notNull": false,
2240
+ "autoincrement": false
2241
+ },
2242
+ "created_at": {
2243
+ "name": "created_at",
2244
+ "type": "integer",
2245
+ "primaryKey": false,
2246
+ "notNull": true,
2247
+ "autoincrement": false,
2248
+ "default": "(unixepoch('subsec') * 1000)"
2249
+ },
2250
+ "updated_at": {
2251
+ "name": "updated_at",
2252
+ "type": "integer",
2253
+ "primaryKey": false,
2254
+ "notNull": true,
2255
+ "autoincrement": false,
2256
+ "default": "(unixepoch('subsec') * 1000)"
2257
+ }
2258
+ },
2259
+ "indexes": {
2260
+ "task_by_workspace": {
2261
+ "name": "task_by_workspace",
2262
+ "columns": [
2263
+ "workspace_id",
2264
+ "status"
2265
+ ],
2266
+ "isUnique": false
2267
+ },
2268
+ "task_by_position": {
2269
+ "name": "task_by_position",
2270
+ "columns": [
2271
+ "workspace_id",
2272
+ "status",
2273
+ "position"
2274
+ ],
2275
+ "isUnique": false
2276
+ },
2277
+ "task_by_project": {
2278
+ "name": "task_by_project",
2279
+ "columns": [
2280
+ "project_id"
2281
+ ],
2282
+ "isUnique": false
2283
+ },
2284
+ "task_external_in_workspace": {
2285
+ "name": "task_external_in_workspace",
2286
+ "columns": [
2287
+ "workspace_id",
2288
+ "external_source",
2289
+ "external_id"
2290
+ ],
2291
+ "isUnique": true
2292
+ }
2293
+ },
2294
+ "foreignKeys": {
2295
+ "task_workspace_id_workspace_id_fk": {
2296
+ "name": "task_workspace_id_workspace_id_fk",
2297
+ "tableFrom": "task",
2298
+ "tableTo": "workspace",
2299
+ "columnsFrom": [
2300
+ "workspace_id"
2301
+ ],
2302
+ "columnsTo": [
2303
+ "id"
2304
+ ],
2305
+ "onDelete": "restrict",
2306
+ "onUpdate": "no action"
2307
+ },
2308
+ "task_project_id_project_id_fk": {
2309
+ "name": "task_project_id_project_id_fk",
2310
+ "tableFrom": "task",
2311
+ "tableTo": "project",
2312
+ "columnsFrom": [
2313
+ "project_id"
2314
+ ],
2315
+ "columnsTo": [
2316
+ "id"
2317
+ ],
2318
+ "onDelete": "restrict",
2319
+ "onUpdate": "no action"
2320
+ },
2321
+ "task_worktree_id_worktree_id_fk": {
2322
+ "name": "task_worktree_id_worktree_id_fk",
2323
+ "tableFrom": "task",
2324
+ "tableTo": "worktree",
2325
+ "columnsFrom": [
2326
+ "worktree_id"
2327
+ ],
2328
+ "columnsTo": [
2329
+ "id"
2330
+ ],
2331
+ "onDelete": "set null",
2332
+ "onUpdate": "no action"
2333
+ }
2334
+ },
2335
+ "compositePrimaryKeys": {},
2336
+ "uniqueConstraints": {},
2337
+ "checkConstraints": {
2338
+ "task_status": {
2339
+ "name": "task_status",
2340
+ "value": "\"task\".\"status\" IN ('proposed', 'backlog', 'open', 'in_progress', 'review', 'testing', 'ready_to_merge', 'done', 'dropped')"
2341
+ },
2342
+ "task_created_by": {
2343
+ "name": "task_created_by",
2344
+ "value": "\"task\".\"created_by\" IN ('human', 'agent')"
2345
+ },
2346
+ "task_autonomy": {
2347
+ "name": "task_autonomy",
2348
+ "value": "\"task\".\"autonomy\" IN ('inherit', 'off')"
2349
+ },
2350
+ "task_attempts_not_negative": {
2351
+ "name": "task_attempts_not_negative",
2352
+ "value": "\"task\".\"attempts\" >= 0"
2353
+ },
2354
+ "task_bounces_not_negative": {
2355
+ "name": "task_bounces_not_negative",
2356
+ "value": "\"task\".\"bounces\" >= 0"
2357
+ },
2358
+ "task_prepared_pair": {
2359
+ "name": "task_prepared_pair",
2360
+ "value": "(\"task\".\"prepared_prompt\" IS NULL AND \"task\".\"prepared_role\" IS NULL)\n OR (\"task\".\"prepared_prompt\" IS NOT NULL AND \"task\".\"prepared_role\" IS NOT NULL)"
2361
+ },
2362
+ "task_agent_provenance": {
2363
+ "name": "task_agent_provenance",
2364
+ "value": "(\"task\".\"created_by\" = 'agent' AND \"task\".\"created_by_session\" IS NOT NULL)\n OR (\"task\".\"created_by\" = 'human' AND \"task\".\"created_by_session\" IS NULL)"
2365
+ },
2366
+ "task_closed_at": {
2367
+ "name": "task_closed_at",
2368
+ "value": "(\"task\".\"status\" IN ('done', 'dropped') AND \"task\".\"closed_at\" IS NOT NULL)\n OR (\"task\".\"status\" NOT IN ('done', 'dropped') AND \"task\".\"closed_at\" IS NULL)"
2369
+ }
2370
+ }
2371
+ },
2372
+ "task_comment": {
2373
+ "name": "task_comment",
2374
+ "columns": {
2375
+ "id": {
2376
+ "name": "id",
2377
+ "type": "text",
2378
+ "primaryKey": true,
2379
+ "notNull": true,
2380
+ "autoincrement": false
2381
+ },
2382
+ "task_id": {
2383
+ "name": "task_id",
2384
+ "type": "text",
2385
+ "primaryKey": false,
2386
+ "notNull": true,
2387
+ "autoincrement": false
2388
+ },
2389
+ "body": {
2390
+ "name": "body",
2391
+ "type": "text",
2392
+ "primaryKey": false,
2393
+ "notNull": true,
2394
+ "autoincrement": false
2395
+ },
2396
+ "created_by": {
2397
+ "name": "created_by",
2398
+ "type": "text",
2399
+ "primaryKey": false,
2400
+ "notNull": true,
2401
+ "autoincrement": false,
2402
+ "default": "'human'"
2403
+ },
2404
+ "created_by_session": {
2405
+ "name": "created_by_session",
2406
+ "type": "text",
2407
+ "primaryKey": false,
2408
+ "notNull": false,
2409
+ "autoincrement": false
2410
+ },
2411
+ "created_at": {
2412
+ "name": "created_at",
2413
+ "type": "integer",
2414
+ "primaryKey": false,
2415
+ "notNull": true,
2416
+ "autoincrement": false,
2417
+ "default": "(unixepoch('subsec') * 1000)"
2418
+ },
2419
+ "updated_at": {
2420
+ "name": "updated_at",
2421
+ "type": "integer",
2422
+ "primaryKey": false,
2423
+ "notNull": true,
2424
+ "autoincrement": false,
2425
+ "default": "(unixepoch('subsec') * 1000)"
2426
+ }
2427
+ },
2428
+ "indexes": {
2429
+ "task_comment_by_task": {
2430
+ "name": "task_comment_by_task",
2431
+ "columns": [
2432
+ "task_id",
2433
+ "created_at"
2434
+ ],
2435
+ "isUnique": false
2436
+ }
2437
+ },
2438
+ "foreignKeys": {
2439
+ "task_comment_task_id_task_id_fk": {
2440
+ "name": "task_comment_task_id_task_id_fk",
2441
+ "tableFrom": "task_comment",
2442
+ "tableTo": "task",
2443
+ "columnsFrom": [
2444
+ "task_id"
2445
+ ],
2446
+ "columnsTo": [
2447
+ "id"
2448
+ ],
2449
+ "onDelete": "cascade",
2450
+ "onUpdate": "no action"
2451
+ }
2452
+ },
2453
+ "compositePrimaryKeys": {},
2454
+ "uniqueConstraints": {},
2455
+ "checkConstraints": {
2456
+ "task_comment_created_by": {
2457
+ "name": "task_comment_created_by",
2458
+ "value": "\"task_comment\".\"created_by\" IN ('human', 'agent')"
2459
+ },
2460
+ "task_comment_provenance": {
2461
+ "name": "task_comment_provenance",
2462
+ "value": "(\"task_comment\".\"created_by\" = 'agent' AND \"task_comment\".\"created_by_session\" IS NOT NULL)\n OR (\"task_comment\".\"created_by\" = 'human' AND \"task_comment\".\"created_by_session\" IS NULL)"
2463
+ }
2464
+ }
2465
+ },
2466
+ "task_finding": {
2467
+ "name": "task_finding",
2468
+ "columns": {
2469
+ "id": {
2470
+ "name": "id",
2471
+ "type": "text",
2472
+ "primaryKey": true,
2473
+ "notNull": true,
2474
+ "autoincrement": false
2475
+ },
2476
+ "task_id": {
2477
+ "name": "task_id",
2478
+ "type": "text",
2479
+ "primaryKey": false,
2480
+ "notNull": true,
2481
+ "autoincrement": false
2482
+ },
2483
+ "found_by_session": {
2484
+ "name": "found_by_session",
2485
+ "type": "text",
2486
+ "primaryKey": false,
2487
+ "notNull": true,
2488
+ "autoincrement": false
2489
+ },
2490
+ "role": {
2491
+ "name": "role",
2492
+ "type": "text",
2493
+ "primaryKey": false,
2494
+ "notNull": true,
2495
+ "autoincrement": false
2496
+ },
2497
+ "bucket": {
2498
+ "name": "bucket",
2499
+ "type": "text",
2500
+ "primaryKey": false,
2501
+ "notNull": true,
2502
+ "autoincrement": false
2503
+ },
2504
+ "title": {
2505
+ "name": "title",
2506
+ "type": "text",
2507
+ "primaryKey": false,
2508
+ "notNull": true,
2509
+ "autoincrement": false
2510
+ },
2511
+ "detail": {
2512
+ "name": "detail",
2513
+ "type": "text",
2514
+ "primaryKey": false,
2515
+ "notNull": true,
2516
+ "autoincrement": false,
2517
+ "default": "''"
2518
+ },
2519
+ "command": {
2520
+ "name": "command",
2521
+ "type": "text",
2522
+ "primaryKey": false,
2523
+ "notNull": false,
2524
+ "autoincrement": false
2525
+ },
2526
+ "expected": {
2527
+ "name": "expected",
2528
+ "type": "text",
2529
+ "primaryKey": false,
2530
+ "notNull": false,
2531
+ "autoincrement": false
2532
+ },
2533
+ "verification": {
2534
+ "name": "verification",
2535
+ "type": "text",
2536
+ "primaryKey": false,
2537
+ "notNull": true,
2538
+ "autoincrement": false,
2539
+ "default": "'pending'"
2540
+ },
2541
+ "output": {
2542
+ "name": "output",
2543
+ "type": "text",
2544
+ "primaryKey": false,
2545
+ "notNull": false,
2546
+ "autoincrement": false
2547
+ },
2548
+ "created_at": {
2549
+ "name": "created_at",
2550
+ "type": "integer",
2551
+ "primaryKey": false,
2552
+ "notNull": true,
2553
+ "autoincrement": false,
2554
+ "default": "(unixepoch('subsec') * 1000)"
2555
+ },
2556
+ "updated_at": {
2557
+ "name": "updated_at",
2558
+ "type": "integer",
2559
+ "primaryKey": false,
2560
+ "notNull": true,
2561
+ "autoincrement": false,
2562
+ "default": "(unixepoch('subsec') * 1000)"
2563
+ }
2564
+ },
2565
+ "indexes": {
2566
+ "task_finding_by_task": {
2567
+ "name": "task_finding_by_task",
2568
+ "columns": [
2569
+ "task_id",
2570
+ "created_at"
2571
+ ],
2572
+ "isUnique": false
2573
+ }
2574
+ },
2575
+ "foreignKeys": {
2576
+ "task_finding_task_id_task_id_fk": {
2577
+ "name": "task_finding_task_id_task_id_fk",
2578
+ "tableFrom": "task_finding",
2579
+ "tableTo": "task",
2580
+ "columnsFrom": [
2581
+ "task_id"
2582
+ ],
2583
+ "columnsTo": [
2584
+ "id"
2585
+ ],
2586
+ "onDelete": "cascade",
2587
+ "onUpdate": "no action"
2588
+ }
2589
+ },
2590
+ "compositePrimaryKeys": {},
2591
+ "uniqueConstraints": {},
2592
+ "checkConstraints": {
2593
+ "task_finding_bucket": {
2594
+ "name": "task_finding_bucket",
2595
+ "value": "\"task_finding\".\"bucket\" IN ('blocks', 'notes')"
2596
+ },
2597
+ "task_finding_verification": {
2598
+ "name": "task_finding_verification",
2599
+ "value": "\"task_finding\".\"verification\" IN ('pending', 'reproduced', 'refuted', 'skipped')"
2600
+ },
2601
+ "task_finding_reproduction": {
2602
+ "name": "task_finding_reproduction",
2603
+ "value": "(\"task_finding\".\"bucket\" = 'blocks' AND \"task_finding\".\"command\" IS NOT NULL)\n OR (\"task_finding\".\"bucket\" = 'notes' AND \"task_finding\".\"command\" IS NULL)"
2604
+ }
2605
+ }
2606
+ },
2607
+ "task_review": {
2608
+ "name": "task_review",
2609
+ "columns": {
2610
+ "id": {
2611
+ "name": "id",
2612
+ "type": "text",
2613
+ "primaryKey": true,
2614
+ "notNull": true,
2615
+ "autoincrement": false
2616
+ },
2617
+ "task_id": {
2618
+ "name": "task_id",
2619
+ "type": "text",
2620
+ "primaryKey": false,
2621
+ "notNull": true,
2622
+ "autoincrement": false
2623
+ },
2624
+ "by_session": {
2625
+ "name": "by_session",
2626
+ "type": "text",
2627
+ "primaryKey": false,
2628
+ "notNull": true,
2629
+ "autoincrement": false
2630
+ },
2631
+ "role": {
2632
+ "name": "role",
2633
+ "type": "text",
2634
+ "primaryKey": false,
2635
+ "notNull": true,
2636
+ "autoincrement": false
2637
+ },
2638
+ "blocks": {
2639
+ "name": "blocks",
2640
+ "type": "integer",
2641
+ "primaryKey": false,
2642
+ "notNull": true,
2643
+ "autoincrement": false,
2644
+ "default": 0
2645
+ },
2646
+ "notes": {
2647
+ "name": "notes",
2648
+ "type": "integer",
2649
+ "primaryKey": false,
2650
+ "notNull": true,
2651
+ "autoincrement": false,
2652
+ "default": 0
2653
+ },
2654
+ "created_at": {
2655
+ "name": "created_at",
2656
+ "type": "integer",
2657
+ "primaryKey": false,
2658
+ "notNull": true,
2659
+ "autoincrement": false,
2660
+ "default": "(unixepoch('subsec') * 1000)"
2661
+ },
2662
+ "updated_at": {
2663
+ "name": "updated_at",
2664
+ "type": "integer",
2665
+ "primaryKey": false,
2666
+ "notNull": true,
2667
+ "autoincrement": false,
2668
+ "default": "(unixepoch('subsec') * 1000)"
2669
+ }
2670
+ },
2671
+ "indexes": {
2672
+ "task_review_by_session": {
2673
+ "name": "task_review_by_session",
2674
+ "columns": [
2675
+ "by_session",
2676
+ "created_at"
2677
+ ],
2678
+ "isUnique": false
2679
+ }
2680
+ },
2681
+ "foreignKeys": {
2682
+ "task_review_task_id_task_id_fk": {
2683
+ "name": "task_review_task_id_task_id_fk",
2684
+ "tableFrom": "task_review",
2685
+ "tableTo": "task",
2686
+ "columnsFrom": [
2687
+ "task_id"
2688
+ ],
2689
+ "columnsTo": [
2690
+ "id"
2691
+ ],
2692
+ "onDelete": "cascade",
2693
+ "onUpdate": "no action"
2694
+ }
2695
+ },
2696
+ "compositePrimaryKeys": {},
2697
+ "uniqueConstraints": {},
2698
+ "checkConstraints": {
2699
+ "task_review_counts_not_negative": {
2700
+ "name": "task_review_counts_not_negative",
2701
+ "value": "\"task_review\".\"blocks\" >= 0 AND \"task_review\".\"notes\" >= 0"
2702
+ }
2703
+ }
2704
+ },
2705
+ "workspace": {
2706
+ "name": "workspace",
2707
+ "columns": {
2708
+ "id": {
2709
+ "name": "id",
2710
+ "type": "text",
2711
+ "primaryKey": true,
2712
+ "notNull": true,
2713
+ "autoincrement": false
2714
+ },
2715
+ "name": {
2716
+ "name": "name",
2717
+ "type": "text",
2718
+ "primaryKey": false,
2719
+ "notNull": true,
2720
+ "autoincrement": false
2721
+ },
2722
+ "default_lumem_mode": {
2723
+ "name": "default_lumem_mode",
2724
+ "type": "text",
2725
+ "primaryKey": false,
2726
+ "notNull": true,
2727
+ "autoincrement": false,
2728
+ "default": "'ask'"
2729
+ },
2730
+ "budget_cost_per_task": {
2731
+ "name": "budget_cost_per_task",
2732
+ "type": "real",
2733
+ "primaryKey": false,
2734
+ "notNull": false,
2735
+ "autoincrement": false
2736
+ },
2737
+ "budget_cost_per_day": {
2738
+ "name": "budget_cost_per_day",
2739
+ "type": "real",
2740
+ "primaryKey": false,
2741
+ "notNull": false,
2742
+ "autoincrement": false
2743
+ },
2744
+ "budget_turns_per_session": {
2745
+ "name": "budget_turns_per_session",
2746
+ "type": "integer",
2747
+ "primaryKey": false,
2748
+ "notNull": false,
2749
+ "autoincrement": false
2750
+ },
2751
+ "autonomy": {
2752
+ "name": "autonomy",
2753
+ "type": "text",
2754
+ "primaryKey": false,
2755
+ "notNull": true,
2756
+ "autoincrement": false,
2757
+ "default": "'manual'"
2758
+ },
2759
+ "autonomy_max_parallel": {
2760
+ "name": "autonomy_max_parallel",
2761
+ "type": "integer",
2762
+ "primaryKey": false,
2763
+ "notNull": true,
2764
+ "autoincrement": false,
2765
+ "default": 2
2766
+ },
2767
+ "merged_always_removes": {
2768
+ "name": "merged_always_removes",
2769
+ "type": "integer",
2770
+ "primaryKey": false,
2771
+ "notNull": true,
2772
+ "autoincrement": false,
2773
+ "default": false
2774
+ },
2775
+ "created_at": {
2776
+ "name": "created_at",
2777
+ "type": "integer",
2778
+ "primaryKey": false,
2779
+ "notNull": true,
2780
+ "autoincrement": false,
2781
+ "default": "(unixepoch('subsec') * 1000)"
2782
+ },
2783
+ "updated_at": {
2784
+ "name": "updated_at",
2785
+ "type": "integer",
2786
+ "primaryKey": false,
2787
+ "notNull": true,
2788
+ "autoincrement": false,
2789
+ "default": "(unixepoch('subsec') * 1000)"
2790
+ }
2791
+ },
2792
+ "indexes": {
2793
+ "workspace_name_unique": {
2794
+ "name": "workspace_name_unique",
2795
+ "columns": [
2796
+ "name"
2797
+ ],
2798
+ "isUnique": true
2799
+ }
2800
+ },
2801
+ "foreignKeys": {},
2802
+ "compositePrimaryKeys": {},
2803
+ "uniqueConstraints": {},
2804
+ "checkConstraints": {
2805
+ "workspace_default_lumem_mode": {
2806
+ "name": "workspace_default_lumem_mode",
2807
+ "value": "\"workspace\".\"default_lumem_mode\" IN ('ask', 'auto')"
2808
+ },
2809
+ "workspace_autonomy": {
2810
+ "name": "workspace_autonomy",
2811
+ "value": "\"workspace\".\"autonomy\" IN ('manual', 'assistido', 'autonomo')"
2812
+ },
2813
+ "workspace_autonomy_max_parallel": {
2814
+ "name": "workspace_autonomy_max_parallel",
2815
+ "value": "\"workspace\".\"autonomy_max_parallel\" >= 0"
2816
+ },
2817
+ "workspace_budget_not_negative": {
2818
+ "name": "workspace_budget_not_negative",
2819
+ "value": "(\"workspace\".\"budget_cost_per_task\" IS NULL OR \"workspace\".\"budget_cost_per_task\" >= 0)\n AND (\"workspace\".\"budget_cost_per_day\" IS NULL OR \"workspace\".\"budget_cost_per_day\" >= 0)\n AND (\"workspace\".\"budget_turns_per_session\" IS NULL OR \"workspace\".\"budget_turns_per_session\" >= 0)"
2820
+ }
2821
+ }
2822
+ },
2823
+ "worktree": {
2824
+ "name": "worktree",
2825
+ "columns": {
2826
+ "id": {
2827
+ "name": "id",
2828
+ "type": "text",
2829
+ "primaryKey": true,
2830
+ "notNull": true,
2831
+ "autoincrement": false
2832
+ },
2833
+ "project_id": {
2834
+ "name": "project_id",
2835
+ "type": "text",
2836
+ "primaryKey": false,
2837
+ "notNull": true,
2838
+ "autoincrement": false
2839
+ },
2840
+ "name": {
2841
+ "name": "name",
2842
+ "type": "text",
2843
+ "primaryKey": false,
2844
+ "notNull": true,
2845
+ "autoincrement": false
2846
+ },
2847
+ "branch": {
2848
+ "name": "branch",
2849
+ "type": "text",
2850
+ "primaryKey": false,
2851
+ "notNull": true,
2852
+ "autoincrement": false
2853
+ },
2854
+ "path": {
2855
+ "name": "path",
2856
+ "type": "text",
2857
+ "primaryKey": false,
2858
+ "notNull": true,
2859
+ "autoincrement": false
2860
+ },
2861
+ "state": {
2862
+ "name": "state",
2863
+ "type": "text",
2864
+ "primaryKey": false,
2865
+ "notNull": true,
2866
+ "autoincrement": false,
2867
+ "default": "'active'"
2868
+ },
2869
+ "created_at": {
2870
+ "name": "created_at",
2871
+ "type": "integer",
2872
+ "primaryKey": false,
2873
+ "notNull": true,
2874
+ "autoincrement": false,
2875
+ "default": "(unixepoch('subsec') * 1000)"
2876
+ },
2877
+ "updated_at": {
2878
+ "name": "updated_at",
2879
+ "type": "integer",
2880
+ "primaryKey": false,
2881
+ "notNull": true,
2882
+ "autoincrement": false,
2883
+ "default": "(unixepoch('subsec') * 1000)"
2884
+ }
2885
+ },
2886
+ "indexes": {
2887
+ "worktree_name_per_project": {
2888
+ "name": "worktree_name_per_project",
2889
+ "columns": [
2890
+ "project_id",
2891
+ "name"
2892
+ ],
2893
+ "isUnique": true
2894
+ }
2895
+ },
2896
+ "foreignKeys": {
2897
+ "worktree_project_id_project_id_fk": {
2898
+ "name": "worktree_project_id_project_id_fk",
2899
+ "tableFrom": "worktree",
2900
+ "tableTo": "project",
2901
+ "columnsFrom": [
2902
+ "project_id"
2903
+ ],
2904
+ "columnsTo": [
2905
+ "id"
2906
+ ],
2907
+ "onDelete": "restrict",
2908
+ "onUpdate": "no action"
2909
+ }
2910
+ },
2911
+ "compositePrimaryKeys": {},
2912
+ "uniqueConstraints": {},
2913
+ "checkConstraints": {
2914
+ "worktree_state": {
2915
+ "name": "worktree_state",
2916
+ "value": "\"worktree\".\"state\" IN ('active', 'missing')"
2917
+ }
2918
+ }
2919
+ }
2920
+ },
2921
+ "views": {},
2922
+ "enums": {},
2923
+ "_meta": {
2924
+ "schemas": {},
2925
+ "tables": {},
2926
+ "columns": {}
2927
+ },
2928
+ "internal": {
2929
+ "indexes": {}
2930
+ }
2931
+ }