c0de-agent 1.10.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +5 -2
  2. package/dist/cli/commands/acp.js +3 -3
  3. package/dist/cli/commands/auth.d.ts +17 -0
  4. package/dist/cli/commands/auth.js +73 -0
  5. package/dist/cli/commands/chat.js +8 -0
  6. package/dist/cli/commands/config.d.ts +2 -9
  7. package/dist/cli/commands/config.js +9 -52
  8. package/dist/cli/commands/init.js +4 -2
  9. package/dist/cli/commands/plugin.js +8 -4
  10. package/dist/cli/commands/sessions.d.ts +10 -0
  11. package/dist/cli/commands/sessions.js +35 -0
  12. package/dist/cli/commands/update.js +18 -10
  13. package/dist/cli/index.js +30 -2
  14. package/dist/cli/modes/print.js +11 -1
  15. package/dist/core/config-path.d.ts +9 -0
  16. package/dist/core/config-path.js +48 -0
  17. package/dist/core/config.d.ts +10 -2
  18. package/dist/core/config.js +32 -10
  19. package/dist/core/index.d.ts +1 -1
  20. package/dist/core/index.js +1 -1
  21. package/dist/core/loop.js +13 -3
  22. package/dist/core/slash.js +92 -30
  23. package/dist/core/title.js +15 -0
  24. package/dist/core/types.d.ts +2 -0
  25. package/dist/db/client.d.ts +4 -0
  26. package/dist/db/client.js +5 -0
  27. package/dist/db/schema.d.ts +34 -0
  28. package/dist/db/schema.js +4 -0
  29. package/dist/server/agent-manager.d.ts +5 -0
  30. package/dist/server/agent-manager.js +28 -0
  31. package/dist/server/app.js +12 -2
  32. package/dist/server/auth-manager.d.ts +79 -0
  33. package/dist/server/auth-manager.js +270 -0
  34. package/dist/server/context.js +1 -0
  35. package/dist/server/middleware/auth.d.ts +4 -3
  36. package/dist/server/middleware/auth.js +5 -5
  37. package/dist/server/permission/interactive.d.ts +2 -0
  38. package/dist/server/permission/interactive.js +5 -1
  39. package/dist/server/permission/store.d.ts +4 -0
  40. package/dist/server/permission/store.js +1 -0
  41. package/dist/server/routes/auth.d.ts +4 -0
  42. package/dist/server/routes/auth.js +94 -0
  43. package/dist/server/routes/chat.d.ts +6 -1
  44. package/dist/server/routes/chat.js +87 -7
  45. package/dist/server/routes/config.js +59 -11
  46. package/dist/server/routes/permissions.d.ts +4 -1
  47. package/dist/server/routes/permissions.js +27 -4
  48. package/dist/server/routes/project.js +56 -2
  49. package/dist/server/routes/session.js +31 -7
  50. package/dist/server/routes/terminal.js +17 -2
  51. package/dist/server/routes/update.js +23 -1
  52. package/dist/server/server.js +47 -8
  53. package/dist/server/types.d.ts +8 -1
  54. package/dist/session/archive.d.ts +1 -1
  55. package/dist/session/branch.d.ts +1 -0
  56. package/dist/session/branch.js +12 -5
  57. package/dist/session/index.d.ts +1 -1
  58. package/dist/session/index.js +1 -1
  59. package/dist/session/session.d.ts +25 -5
  60. package/dist/session/session.js +129 -10
  61. package/dist/session/types.d.ts +1 -1
  62. package/dist/shared/types/agent.d.ts +11 -0
  63. package/dist/shared/types/config.d.ts +5 -0
  64. package/dist/shared/types/message.d.ts +6 -2
  65. package/dist/tools/index.js +2 -3
  66. package/dist/update/index.d.ts +1 -1
  67. package/dist/update/index.js +1 -1
  68. package/dist/update/ipc.d.ts +6 -0
  69. package/dist/update/ipc.js +7 -4
  70. package/dist/update/snapshot.d.ts +4 -0
  71. package/dist/update/snapshot.js +8 -0
  72. package/dist/update/updater.d.ts +55 -8
  73. package/dist/update/updater.js +230 -27
  74. package/drizzle/0006_sour_susan_delgado.sql +2 -0
  75. package/drizzle/0007_same_wilson_fisk.sql +2 -0
  76. package/drizzle/meta/0006_snapshot.json +867 -0
  77. package/drizzle/meta/0007_snapshot.json +869 -0
  78. package/drizzle/meta/_journal.json +14 -0
  79. package/package.json +1 -1
@@ -0,0 +1,867 @@
1
+ {
2
+ "id": "e197147a-a802-4d0f-b582-e5f146ed7c05",
3
+ "prevId": "4d4bbde6-b9e6-4e16-85ee-d902dcb65cd8",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.compaction_archives": {
8
+ "name": "compaction_archives",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "session_id": {
19
+ "name": "session_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "compaction_id": {
25
+ "name": "compaction_id",
26
+ "type": "uuid",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "archive_type": {
31
+ "name": "archive_type",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ },
36
+ "original_entries": {
37
+ "name": "original_entries",
38
+ "type": "jsonb",
39
+ "primaryKey": false,
40
+ "notNull": true
41
+ },
42
+ "file_snapshots": {
43
+ "name": "file_snapshots",
44
+ "type": "jsonb",
45
+ "primaryKey": false,
46
+ "notNull": false,
47
+ "default": "'[]'::jsonb"
48
+ },
49
+ "summary": {
50
+ "name": "summary",
51
+ "type": "text",
52
+ "primaryKey": false,
53
+ "notNull": true
54
+ },
55
+ "token_count": {
56
+ "name": "token_count",
57
+ "type": "integer",
58
+ "primaryKey": false,
59
+ "notNull": false
60
+ },
61
+ "searchable_text": {
62
+ "name": "searchable_text",
63
+ "type": "text",
64
+ "primaryKey": false,
65
+ "notNull": false
66
+ },
67
+ "created_at": {
68
+ "name": "created_at",
69
+ "type": "timestamp with time zone",
70
+ "primaryKey": false,
71
+ "notNull": true,
72
+ "default": "now()"
73
+ }
74
+ },
75
+ "indexes": {
76
+ "idx_archives_session": {
77
+ "name": "idx_archives_session",
78
+ "columns": [
79
+ {
80
+ "expression": "session_id",
81
+ "isExpression": false,
82
+ "asc": true,
83
+ "nulls": "last"
84
+ }
85
+ ],
86
+ "isUnique": false,
87
+ "concurrently": false,
88
+ "method": "btree",
89
+ "with": {}
90
+ }
91
+ },
92
+ "foreignKeys": {
93
+ "compaction_archives_session_id_sessions_id_fk": {
94
+ "name": "compaction_archives_session_id_sessions_id_fk",
95
+ "tableFrom": "compaction_archives",
96
+ "tableTo": "sessions",
97
+ "columnsFrom": [
98
+ "session_id"
99
+ ],
100
+ "columnsTo": [
101
+ "id"
102
+ ],
103
+ "onDelete": "cascade",
104
+ "onUpdate": "no action"
105
+ }
106
+ },
107
+ "compositePrimaryKeys": {},
108
+ "uniqueConstraints": {},
109
+ "policies": {},
110
+ "checkConstraints": {},
111
+ "isRLSEnabled": false
112
+ },
113
+ "public.file_snapshots": {
114
+ "name": "file_snapshots",
115
+ "schema": "",
116
+ "columns": {
117
+ "id": {
118
+ "name": "id",
119
+ "type": "uuid",
120
+ "primaryKey": true,
121
+ "notNull": true,
122
+ "default": "gen_random_uuid()"
123
+ },
124
+ "session_id": {
125
+ "name": "session_id",
126
+ "type": "uuid",
127
+ "primaryKey": false,
128
+ "notNull": true
129
+ },
130
+ "entry_id": {
131
+ "name": "entry_id",
132
+ "type": "uuid",
133
+ "primaryKey": false,
134
+ "notNull": false
135
+ },
136
+ "file_path": {
137
+ "name": "file_path",
138
+ "type": "text",
139
+ "primaryKey": false,
140
+ "notNull": true
141
+ },
142
+ "content": {
143
+ "name": "content",
144
+ "type": "text",
145
+ "primaryKey": false,
146
+ "notNull": true
147
+ },
148
+ "content_hash": {
149
+ "name": "content_hash",
150
+ "type": "text",
151
+ "primaryKey": false,
152
+ "notNull": true
153
+ },
154
+ "token_count": {
155
+ "name": "token_count",
156
+ "type": "integer",
157
+ "primaryKey": false,
158
+ "notNull": false,
159
+ "default": 0
160
+ },
161
+ "version": {
162
+ "name": "version",
163
+ "type": "integer",
164
+ "primaryKey": false,
165
+ "notNull": false,
166
+ "default": 1
167
+ },
168
+ "mtime_ms": {
169
+ "name": "mtime_ms",
170
+ "type": "bigint",
171
+ "primaryKey": false,
172
+ "notNull": false
173
+ },
174
+ "created_at": {
175
+ "name": "created_at",
176
+ "type": "timestamp with time zone",
177
+ "primaryKey": false,
178
+ "notNull": true,
179
+ "default": "now()"
180
+ }
181
+ },
182
+ "indexes": {
183
+ "idx_snapshots_session_path": {
184
+ "name": "idx_snapshots_session_path",
185
+ "columns": [
186
+ {
187
+ "expression": "session_id",
188
+ "isExpression": false,
189
+ "asc": true,
190
+ "nulls": "last"
191
+ },
192
+ {
193
+ "expression": "file_path",
194
+ "isExpression": false,
195
+ "asc": true,
196
+ "nulls": "last"
197
+ }
198
+ ],
199
+ "isUnique": false,
200
+ "concurrently": false,
201
+ "method": "btree",
202
+ "with": {}
203
+ },
204
+ "idx_snapshots_latest": {
205
+ "name": "idx_snapshots_latest",
206
+ "columns": [
207
+ {
208
+ "expression": "session_id",
209
+ "isExpression": false,
210
+ "asc": true,
211
+ "nulls": "last"
212
+ },
213
+ {
214
+ "expression": "file_path",
215
+ "isExpression": false,
216
+ "asc": true,
217
+ "nulls": "last"
218
+ },
219
+ {
220
+ "expression": "version",
221
+ "isExpression": false,
222
+ "asc": true,
223
+ "nulls": "last"
224
+ }
225
+ ],
226
+ "isUnique": true,
227
+ "concurrently": false,
228
+ "method": "btree",
229
+ "with": {}
230
+ }
231
+ },
232
+ "foreignKeys": {
233
+ "file_snapshots_session_id_sessions_id_fk": {
234
+ "name": "file_snapshots_session_id_sessions_id_fk",
235
+ "tableFrom": "file_snapshots",
236
+ "tableTo": "sessions",
237
+ "columnsFrom": [
238
+ "session_id"
239
+ ],
240
+ "columnsTo": [
241
+ "id"
242
+ ],
243
+ "onDelete": "cascade",
244
+ "onUpdate": "no action"
245
+ }
246
+ },
247
+ "compositePrimaryKeys": {},
248
+ "uniqueConstraints": {},
249
+ "policies": {},
250
+ "checkConstraints": {},
251
+ "isRLSEnabled": false
252
+ },
253
+ "public.kanban_boards": {
254
+ "name": "kanban_boards",
255
+ "schema": "",
256
+ "columns": {
257
+ "id": {
258
+ "name": "id",
259
+ "type": "uuid",
260
+ "primaryKey": true,
261
+ "notNull": true,
262
+ "default": "gen_random_uuid()"
263
+ },
264
+ "project_id": {
265
+ "name": "project_id",
266
+ "type": "text",
267
+ "primaryKey": false,
268
+ "notNull": true
269
+ },
270
+ "columns": {
271
+ "name": "columns",
272
+ "type": "jsonb",
273
+ "primaryKey": false,
274
+ "notNull": true
275
+ },
276
+ "labels": {
277
+ "name": "labels",
278
+ "type": "jsonb",
279
+ "primaryKey": false,
280
+ "notNull": true,
281
+ "default": "'[]'::jsonb"
282
+ },
283
+ "created_at": {
284
+ "name": "created_at",
285
+ "type": "timestamp with time zone",
286
+ "primaryKey": false,
287
+ "notNull": true,
288
+ "default": "now()"
289
+ },
290
+ "updated_at": {
291
+ "name": "updated_at",
292
+ "type": "timestamp with time zone",
293
+ "primaryKey": false,
294
+ "notNull": true,
295
+ "default": "now()"
296
+ }
297
+ },
298
+ "indexes": {
299
+ "uq_kanban_boards_project": {
300
+ "name": "uq_kanban_boards_project",
301
+ "columns": [
302
+ {
303
+ "expression": "project_id",
304
+ "isExpression": false,
305
+ "asc": true,
306
+ "nulls": "last"
307
+ }
308
+ ],
309
+ "isUnique": true,
310
+ "concurrently": false,
311
+ "method": "btree",
312
+ "with": {}
313
+ }
314
+ },
315
+ "foreignKeys": {
316
+ "kanban_boards_project_id_projects_id_fk": {
317
+ "name": "kanban_boards_project_id_projects_id_fk",
318
+ "tableFrom": "kanban_boards",
319
+ "tableTo": "projects",
320
+ "columnsFrom": [
321
+ "project_id"
322
+ ],
323
+ "columnsTo": [
324
+ "id"
325
+ ],
326
+ "onDelete": "cascade",
327
+ "onUpdate": "no action"
328
+ }
329
+ },
330
+ "compositePrimaryKeys": {},
331
+ "uniqueConstraints": {},
332
+ "policies": {},
333
+ "checkConstraints": {},
334
+ "isRLSEnabled": false
335
+ },
336
+ "public.kanban_cards": {
337
+ "name": "kanban_cards",
338
+ "schema": "",
339
+ "columns": {
340
+ "id": {
341
+ "name": "id",
342
+ "type": "uuid",
343
+ "primaryKey": true,
344
+ "notNull": true,
345
+ "default": "gen_random_uuid()"
346
+ },
347
+ "board_id": {
348
+ "name": "board_id",
349
+ "type": "uuid",
350
+ "primaryKey": false,
351
+ "notNull": true
352
+ },
353
+ "title": {
354
+ "name": "title",
355
+ "type": "text",
356
+ "primaryKey": false,
357
+ "notNull": true
358
+ },
359
+ "description": {
360
+ "name": "description",
361
+ "type": "text",
362
+ "primaryKey": false,
363
+ "notNull": false
364
+ },
365
+ "column_id": {
366
+ "name": "column_id",
367
+ "type": "text",
368
+ "primaryKey": false,
369
+ "notNull": true
370
+ },
371
+ "priority": {
372
+ "name": "priority",
373
+ "type": "text",
374
+ "primaryKey": false,
375
+ "notNull": true,
376
+ "default": "'medium'"
377
+ },
378
+ "position": {
379
+ "name": "position",
380
+ "type": "real",
381
+ "primaryKey": false,
382
+ "notNull": true,
383
+ "default": 0
384
+ },
385
+ "labels": {
386
+ "name": "labels",
387
+ "type": "jsonb",
388
+ "primaryKey": false,
389
+ "notNull": true,
390
+ "default": "'[]'::jsonb"
391
+ },
392
+ "created_at": {
393
+ "name": "created_at",
394
+ "type": "timestamp with time zone",
395
+ "primaryKey": false,
396
+ "notNull": true,
397
+ "default": "now()"
398
+ },
399
+ "updated_at": {
400
+ "name": "updated_at",
401
+ "type": "timestamp with time zone",
402
+ "primaryKey": false,
403
+ "notNull": true,
404
+ "default": "now()"
405
+ }
406
+ },
407
+ "indexes": {
408
+ "idx_kanban_cards_board": {
409
+ "name": "idx_kanban_cards_board",
410
+ "columns": [
411
+ {
412
+ "expression": "board_id",
413
+ "isExpression": false,
414
+ "asc": true,
415
+ "nulls": "last"
416
+ },
417
+ {
418
+ "expression": "column_id",
419
+ "isExpression": false,
420
+ "asc": true,
421
+ "nulls": "last"
422
+ },
423
+ {
424
+ "expression": "position",
425
+ "isExpression": false,
426
+ "asc": true,
427
+ "nulls": "last"
428
+ }
429
+ ],
430
+ "isUnique": false,
431
+ "concurrently": false,
432
+ "method": "btree",
433
+ "with": {}
434
+ }
435
+ },
436
+ "foreignKeys": {
437
+ "kanban_cards_board_id_kanban_boards_id_fk": {
438
+ "name": "kanban_cards_board_id_kanban_boards_id_fk",
439
+ "tableFrom": "kanban_cards",
440
+ "tableTo": "kanban_boards",
441
+ "columnsFrom": [
442
+ "board_id"
443
+ ],
444
+ "columnsTo": [
445
+ "id"
446
+ ],
447
+ "onDelete": "cascade",
448
+ "onUpdate": "no action"
449
+ }
450
+ },
451
+ "compositePrimaryKeys": {},
452
+ "uniqueConstraints": {},
453
+ "policies": {},
454
+ "checkConstraints": {},
455
+ "isRLSEnabled": false
456
+ },
457
+ "public.projects": {
458
+ "name": "projects",
459
+ "schema": "",
460
+ "columns": {
461
+ "id": {
462
+ "name": "id",
463
+ "type": "text",
464
+ "primaryKey": true,
465
+ "notNull": true
466
+ },
467
+ "worktree": {
468
+ "name": "worktree",
469
+ "type": "text",
470
+ "primaryKey": false,
471
+ "notNull": true
472
+ },
473
+ "vcs": {
474
+ "name": "vcs",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": false
478
+ },
479
+ "name": {
480
+ "name": "name",
481
+ "type": "text",
482
+ "primaryKey": false,
483
+ "notNull": false
484
+ },
485
+ "git_remote": {
486
+ "name": "git_remote",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": false
490
+ },
491
+ "created_at": {
492
+ "name": "created_at",
493
+ "type": "timestamp with time zone",
494
+ "primaryKey": false,
495
+ "notNull": true,
496
+ "default": "now()"
497
+ },
498
+ "updated_at": {
499
+ "name": "updated_at",
500
+ "type": "timestamp with time zone",
501
+ "primaryKey": false,
502
+ "notNull": true,
503
+ "default": "now()"
504
+ }
505
+ },
506
+ "indexes": {},
507
+ "foreignKeys": {},
508
+ "compositePrimaryKeys": {},
509
+ "uniqueConstraints": {},
510
+ "policies": {},
511
+ "checkConstraints": {},
512
+ "isRLSEnabled": false
513
+ },
514
+ "public.session_entries": {
515
+ "name": "session_entries",
516
+ "schema": "",
517
+ "columns": {
518
+ "id": {
519
+ "name": "id",
520
+ "type": "uuid",
521
+ "primaryKey": true,
522
+ "notNull": true,
523
+ "default": "gen_random_uuid()"
524
+ },
525
+ "session_id": {
526
+ "name": "session_id",
527
+ "type": "uuid",
528
+ "primaryKey": false,
529
+ "notNull": true
530
+ },
531
+ "tag": {
532
+ "name": "tag",
533
+ "type": "text",
534
+ "primaryKey": false,
535
+ "notNull": true
536
+ },
537
+ "role": {
538
+ "name": "role",
539
+ "type": "text",
540
+ "primaryKey": false,
541
+ "notNull": false
542
+ },
543
+ "content": {
544
+ "name": "content",
545
+ "type": "jsonb",
546
+ "primaryKey": false,
547
+ "notNull": true
548
+ },
549
+ "tool_name": {
550
+ "name": "tool_name",
551
+ "type": "text",
552
+ "primaryKey": false,
553
+ "notNull": false
554
+ },
555
+ "token_count": {
556
+ "name": "token_count",
557
+ "type": "integer",
558
+ "primaryKey": false,
559
+ "notNull": false,
560
+ "default": 0
561
+ },
562
+ "created_at": {
563
+ "name": "created_at",
564
+ "type": "timestamp with time zone",
565
+ "primaryKey": false,
566
+ "notNull": true,
567
+ "default": "now()"
568
+ }
569
+ },
570
+ "indexes": {
571
+ "idx_entries_session": {
572
+ "name": "idx_entries_session",
573
+ "columns": [
574
+ {
575
+ "expression": "session_id",
576
+ "isExpression": false,
577
+ "asc": true,
578
+ "nulls": "last"
579
+ },
580
+ {
581
+ "expression": "created_at",
582
+ "isExpression": false,
583
+ "asc": true,
584
+ "nulls": "last"
585
+ }
586
+ ],
587
+ "isUnique": false,
588
+ "concurrently": false,
589
+ "method": "btree",
590
+ "with": {}
591
+ }
592
+ },
593
+ "foreignKeys": {
594
+ "session_entries_session_id_sessions_id_fk": {
595
+ "name": "session_entries_session_id_sessions_id_fk",
596
+ "tableFrom": "session_entries",
597
+ "tableTo": "sessions",
598
+ "columnsFrom": [
599
+ "session_id"
600
+ ],
601
+ "columnsTo": [
602
+ "id"
603
+ ],
604
+ "onDelete": "cascade",
605
+ "onUpdate": "no action"
606
+ }
607
+ },
608
+ "compositePrimaryKeys": {},
609
+ "uniqueConstraints": {},
610
+ "policies": {},
611
+ "checkConstraints": {},
612
+ "isRLSEnabled": false
613
+ },
614
+ "public.sessions": {
615
+ "name": "sessions",
616
+ "schema": "",
617
+ "columns": {
618
+ "id": {
619
+ "name": "id",
620
+ "type": "uuid",
621
+ "primaryKey": true,
622
+ "notNull": true,
623
+ "default": "gen_random_uuid()"
624
+ },
625
+ "title": {
626
+ "name": "title",
627
+ "type": "text",
628
+ "primaryKey": false,
629
+ "notNull": true
630
+ },
631
+ "parent_id": {
632
+ "name": "parent_id",
633
+ "type": "uuid",
634
+ "primaryKey": false,
635
+ "notNull": false
636
+ },
637
+ "project_id": {
638
+ "name": "project_id",
639
+ "type": "text",
640
+ "primaryKey": false,
641
+ "notNull": false
642
+ },
643
+ "branch_point": {
644
+ "name": "branch_point",
645
+ "type": "integer",
646
+ "primaryKey": false,
647
+ "notNull": false
648
+ },
649
+ "metadata": {
650
+ "name": "metadata",
651
+ "type": "jsonb",
652
+ "primaryKey": false,
653
+ "notNull": true,
654
+ "default": "'{}'::jsonb"
655
+ },
656
+ "agent_type": {
657
+ "name": "agent_type",
658
+ "type": "text",
659
+ "primaryKey": false,
660
+ "notNull": false
661
+ },
662
+ "worktree_path": {
663
+ "name": "worktree_path",
664
+ "type": "text",
665
+ "primaryKey": false,
666
+ "notNull": false
667
+ },
668
+ "source": {
669
+ "name": "source",
670
+ "type": "text",
671
+ "primaryKey": false,
672
+ "notNull": false
673
+ },
674
+ "deleted_at": {
675
+ "name": "deleted_at",
676
+ "type": "timestamp with time zone",
677
+ "primaryKey": false,
678
+ "notNull": false
679
+ },
680
+ "created_at": {
681
+ "name": "created_at",
682
+ "type": "timestamp with time zone",
683
+ "primaryKey": false,
684
+ "notNull": true,
685
+ "default": "now()"
686
+ },
687
+ "updated_at": {
688
+ "name": "updated_at",
689
+ "type": "timestamp with time zone",
690
+ "primaryKey": false,
691
+ "notNull": true,
692
+ "default": "now()"
693
+ }
694
+ },
695
+ "indexes": {
696
+ "idx_sessions_parent": {
697
+ "name": "idx_sessions_parent",
698
+ "columns": [
699
+ {
700
+ "expression": "parent_id",
701
+ "isExpression": false,
702
+ "asc": true,
703
+ "nulls": "last"
704
+ }
705
+ ],
706
+ "isUnique": false,
707
+ "concurrently": false,
708
+ "method": "btree",
709
+ "with": {}
710
+ },
711
+ "idx_sessions_project": {
712
+ "name": "idx_sessions_project",
713
+ "columns": [
714
+ {
715
+ "expression": "project_id",
716
+ "isExpression": false,
717
+ "asc": true,
718
+ "nulls": "last"
719
+ }
720
+ ],
721
+ "isUnique": false,
722
+ "concurrently": false,
723
+ "method": "btree",
724
+ "with": {}
725
+ }
726
+ },
727
+ "foreignKeys": {
728
+ "sessions_parent_id_sessions_id_fk": {
729
+ "name": "sessions_parent_id_sessions_id_fk",
730
+ "tableFrom": "sessions",
731
+ "tableTo": "sessions",
732
+ "columnsFrom": [
733
+ "parent_id"
734
+ ],
735
+ "columnsTo": [
736
+ "id"
737
+ ],
738
+ "onDelete": "no action",
739
+ "onUpdate": "no action"
740
+ },
741
+ "sessions_project_id_projects_id_fk": {
742
+ "name": "sessions_project_id_projects_id_fk",
743
+ "tableFrom": "sessions",
744
+ "tableTo": "projects",
745
+ "columnsFrom": [
746
+ "project_id"
747
+ ],
748
+ "columnsTo": [
749
+ "id"
750
+ ],
751
+ "onDelete": "set null",
752
+ "onUpdate": "no action"
753
+ }
754
+ },
755
+ "compositePrimaryKeys": {},
756
+ "uniqueConstraints": {},
757
+ "policies": {},
758
+ "checkConstraints": {},
759
+ "isRLSEnabled": false
760
+ },
761
+ "public.tool_metrics": {
762
+ "name": "tool_metrics",
763
+ "schema": "",
764
+ "columns": {
765
+ "model": {
766
+ "name": "model",
767
+ "type": "text",
768
+ "primaryKey": false,
769
+ "notNull": true
770
+ },
771
+ "tool": {
772
+ "name": "tool",
773
+ "type": "text",
774
+ "primaryKey": false,
775
+ "notNull": true
776
+ },
777
+ "mode": {
778
+ "name": "mode",
779
+ "type": "text",
780
+ "primaryKey": false,
781
+ "notNull": true
782
+ },
783
+ "attempts": {
784
+ "name": "attempts",
785
+ "type": "integer",
786
+ "primaryKey": false,
787
+ "notNull": true,
788
+ "default": 0
789
+ },
790
+ "successes": {
791
+ "name": "successes",
792
+ "type": "integer",
793
+ "primaryKey": false,
794
+ "notNull": true,
795
+ "default": 0
796
+ },
797
+ "failures": {
798
+ "name": "failures",
799
+ "type": "integer",
800
+ "primaryKey": false,
801
+ "notNull": true,
802
+ "default": 0
803
+ },
804
+ "avg_latency_ms": {
805
+ "name": "avg_latency_ms",
806
+ "type": "real",
807
+ "primaryKey": false,
808
+ "notNull": true,
809
+ "default": 0
810
+ },
811
+ "last_used": {
812
+ "name": "last_used",
813
+ "type": "timestamp with time zone",
814
+ "primaryKey": false,
815
+ "notNull": true,
816
+ "default": "now()"
817
+ }
818
+ },
819
+ "indexes": {
820
+ "uq_tool_metrics_model_tool_mode": {
821
+ "name": "uq_tool_metrics_model_tool_mode",
822
+ "columns": [
823
+ {
824
+ "expression": "model",
825
+ "isExpression": false,
826
+ "asc": true,
827
+ "nulls": "last"
828
+ },
829
+ {
830
+ "expression": "tool",
831
+ "isExpression": false,
832
+ "asc": true,
833
+ "nulls": "last"
834
+ },
835
+ {
836
+ "expression": "mode",
837
+ "isExpression": false,
838
+ "asc": true,
839
+ "nulls": "last"
840
+ }
841
+ ],
842
+ "isUnique": true,
843
+ "concurrently": false,
844
+ "method": "btree",
845
+ "with": {}
846
+ }
847
+ },
848
+ "foreignKeys": {},
849
+ "compositePrimaryKeys": {},
850
+ "uniqueConstraints": {},
851
+ "policies": {},
852
+ "checkConstraints": {},
853
+ "isRLSEnabled": false
854
+ }
855
+ },
856
+ "enums": {},
857
+ "schemas": {},
858
+ "sequences": {},
859
+ "roles": {},
860
+ "policies": {},
861
+ "views": {},
862
+ "_meta": {
863
+ "columns": {},
864
+ "schemas": {},
865
+ "tables": {}
866
+ }
867
+ }