@igorjpimenta/brayer 0.0.0-stage → 2026.10.28-beta.1

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 (52) hide show
  1. package/.migrations/0000_initial.sql +133 -0
  2. package/.migrations/0001_awesome_ben_parker.sql +8 -0
  3. package/.migrations/meta/0000_snapshot.json +931 -0
  4. package/.migrations/meta/0001_snapshot.json +983 -0
  5. package/.migrations/meta/_journal.json +20 -0
  6. package/LICENSE +21 -0
  7. package/README.md +245 -2
  8. package/bin/brayer.js +7 -0
  9. package/package.json +42 -4
  10. package/plugins/openclaw/brayer/index.js +119 -0
  11. package/plugins/openclaw/brayer/meta.js +23 -0
  12. package/plugins/openclaw/brayer/openclaw.plugin.json +14 -0
  13. package/plugins/openclaw/brayer/package.json +37 -0
  14. package/plugins/openclaw/brayer/session.js +30 -0
  15. package/plugins/openclaw/brayer/webhook.js +125 -0
  16. package/plugins/opencode/brayer/identity.js +11 -0
  17. package/plugins/opencode/brayer/index.js +92 -0
  18. package/plugins/opencode/brayer/package.json +27 -0
  19. package/plugins/opencode/brayer/session.js +25 -0
  20. package/plugins/shared/contract.js +193 -0
  21. package/plugins/wake/brayer/bin/brayer-wake.js +7 -0
  22. package/plugins/wake/brayer/index.js +125 -0
  23. package/plugins/wake/brayer/package.json +29 -0
  24. package/src/claim-webhook.js +66 -0
  25. package/src/cli.js +164 -0
  26. package/src/config.js +63 -0
  27. package/src/db.js +24 -0
  28. package/src/events-ws.js +121 -0
  29. package/src/evidence.js +42 -0
  30. package/src/identity.js +32 -0
  31. package/src/ids.js +17 -0
  32. package/src/mcp.js +114 -0
  33. package/src/schema.js +168 -0
  34. package/src/store/attempts.js +103 -0
  35. package/src/store/checkpoints.js +76 -0
  36. package/src/store/claims.js +139 -0
  37. package/src/store/events.js +24 -0
  38. package/src/store/evidence.js +67 -0
  39. package/src/store/orders.js +70 -0
  40. package/src/store/resume.js +38 -0
  41. package/src/store/rows.js +118 -0
  42. package/src/store/util.js +3 -0
  43. package/src/store/verdicts.js +61 -0
  44. package/src/store/webhooks.js +56 -0
  45. package/src/store.js +53 -0
  46. package/src/tools/attempts.js +75 -0
  47. package/src/tools/handoff.js +120 -0
  48. package/src/tools/index.js +28 -0
  49. package/src/tools/orders.js +146 -0
  50. package/src/tools/shared.js +7 -0
  51. package/src/tools/verdicts.js +46 -0
  52. package/src/version.js +5 -0
@@ -0,0 +1,931 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "0affc281-06ce-4cf5-8a24-6c4d146db24d",
5
+ "prevId": "00000000-0000-0000-0000-000000000000",
6
+ "tables": {
7
+ "attempts": {
8
+ "name": "attempts",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "work_order_id": {
18
+ "name": "work_order_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "harness": {
25
+ "name": "harness",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "agent": {
32
+ "name": "agent",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": true,
36
+ "autoincrement": false
37
+ },
38
+ "session_ref": {
39
+ "name": "session_ref",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "model": {
46
+ "name": "model",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": false,
50
+ "autoincrement": false
51
+ },
52
+ "status": {
53
+ "name": "status",
54
+ "type": "text",
55
+ "primaryKey": false,
56
+ "notNull": true,
57
+ "autoincrement": false
58
+ },
59
+ "started_at": {
60
+ "name": "started_at",
61
+ "type": "integer",
62
+ "primaryKey": false,
63
+ "notNull": true,
64
+ "autoincrement": false
65
+ },
66
+ "ended_at": {
67
+ "name": "ended_at",
68
+ "type": "integer",
69
+ "primaryKey": false,
70
+ "notNull": false,
71
+ "autoincrement": false
72
+ },
73
+ "tokens_in": {
74
+ "name": "tokens_in",
75
+ "type": "integer",
76
+ "primaryKey": false,
77
+ "notNull": true,
78
+ "autoincrement": false,
79
+ "default": 0
80
+ },
81
+ "tokens_out": {
82
+ "name": "tokens_out",
83
+ "type": "integer",
84
+ "primaryKey": false,
85
+ "notNull": true,
86
+ "autoincrement": false,
87
+ "default": 0
88
+ },
89
+ "cache_read": {
90
+ "name": "cache_read",
91
+ "type": "integer",
92
+ "primaryKey": false,
93
+ "notNull": true,
94
+ "autoincrement": false,
95
+ "default": 0
96
+ },
97
+ "cost_usd": {
98
+ "name": "cost_usd",
99
+ "type": "real",
100
+ "primaryKey": false,
101
+ "notNull": true,
102
+ "autoincrement": false,
103
+ "default": 0
104
+ },
105
+ "tool_calls": {
106
+ "name": "tool_calls",
107
+ "type": "integer",
108
+ "primaryKey": false,
109
+ "notNull": true,
110
+ "autoincrement": false,
111
+ "default": 0
112
+ },
113
+ "error": {
114
+ "name": "error",
115
+ "type": "text",
116
+ "primaryKey": false,
117
+ "notNull": false,
118
+ "autoincrement": false
119
+ },
120
+ "checkpoint_id": {
121
+ "name": "checkpoint_id",
122
+ "type": "text",
123
+ "primaryKey": false,
124
+ "notNull": false,
125
+ "autoincrement": false
126
+ }
127
+ },
128
+ "indexes": {
129
+ "idx_attempts_order": {
130
+ "name": "idx_attempts_order",
131
+ "columns": [
132
+ "work_order_id"
133
+ ],
134
+ "isUnique": false
135
+ }
136
+ },
137
+ "foreignKeys": {
138
+ "attempts_work_order_id_work_orders_id_fk": {
139
+ "name": "attempts_work_order_id_work_orders_id_fk",
140
+ "tableFrom": "attempts",
141
+ "tableTo": "work_orders",
142
+ "columnsFrom": [
143
+ "work_order_id"
144
+ ],
145
+ "columnsTo": [
146
+ "id"
147
+ ],
148
+ "onDelete": "cascade",
149
+ "onUpdate": "no action"
150
+ }
151
+ },
152
+ "compositePrimaryKeys": {},
153
+ "uniqueConstraints": {},
154
+ "checkConstraints": {
155
+ "attempts_status": {
156
+ "name": "attempts_status",
157
+ "value": "\"attempts\".\"status\" IN ('running', 'finished', 'failed', 'abandoned')"
158
+ }
159
+ }
160
+ },
161
+ "checkpoints": {
162
+ "name": "checkpoints",
163
+ "columns": {
164
+ "id": {
165
+ "name": "id",
166
+ "type": "text",
167
+ "primaryKey": true,
168
+ "notNull": true,
169
+ "autoincrement": false
170
+ },
171
+ "work_order_id": {
172
+ "name": "work_order_id",
173
+ "type": "text",
174
+ "primaryKey": false,
175
+ "notNull": true,
176
+ "autoincrement": false
177
+ },
178
+ "attempt_id": {
179
+ "name": "attempt_id",
180
+ "type": "text",
181
+ "primaryKey": false,
182
+ "notNull": true,
183
+ "autoincrement": false
184
+ },
185
+ "kind": {
186
+ "name": "kind",
187
+ "type": "text",
188
+ "primaryKey": false,
189
+ "notNull": true,
190
+ "autoincrement": false
191
+ },
192
+ "goal": {
193
+ "name": "goal",
194
+ "type": "text",
195
+ "primaryKey": false,
196
+ "notNull": false,
197
+ "autoincrement": false
198
+ },
199
+ "state_json": {
200
+ "name": "state_json",
201
+ "type": "text",
202
+ "primaryKey": false,
203
+ "notNull": true,
204
+ "autoincrement": false
205
+ },
206
+ "summary": {
207
+ "name": "summary",
208
+ "type": "text",
209
+ "primaryKey": false,
210
+ "notNull": false,
211
+ "autoincrement": false
212
+ },
213
+ "confidence": {
214
+ "name": "confidence",
215
+ "type": "real",
216
+ "primaryKey": false,
217
+ "notNull": false,
218
+ "autoincrement": false
219
+ },
220
+ "resume_recipe": {
221
+ "name": "resume_recipe",
222
+ "type": "text",
223
+ "primaryKey": false,
224
+ "notNull": false,
225
+ "autoincrement": false
226
+ },
227
+ "tree_hash": {
228
+ "name": "tree_hash",
229
+ "type": "text",
230
+ "primaryKey": false,
231
+ "notNull": false,
232
+ "autoincrement": false
233
+ },
234
+ "created_at": {
235
+ "name": "created_at",
236
+ "type": "integer",
237
+ "primaryKey": false,
238
+ "notNull": true,
239
+ "autoincrement": false
240
+ }
241
+ },
242
+ "indexes": {
243
+ "idx_checkpoints_order": {
244
+ "name": "idx_checkpoints_order",
245
+ "columns": [
246
+ "work_order_id"
247
+ ],
248
+ "isUnique": false
249
+ },
250
+ "idx_checkpoints_attempt": {
251
+ "name": "idx_checkpoints_attempt",
252
+ "columns": [
253
+ "attempt_id"
254
+ ],
255
+ "isUnique": false
256
+ }
257
+ },
258
+ "foreignKeys": {
259
+ "checkpoints_work_order_id_work_orders_id_fk": {
260
+ "name": "checkpoints_work_order_id_work_orders_id_fk",
261
+ "tableFrom": "checkpoints",
262
+ "tableTo": "work_orders",
263
+ "columnsFrom": [
264
+ "work_order_id"
265
+ ],
266
+ "columnsTo": [
267
+ "id"
268
+ ],
269
+ "onDelete": "cascade",
270
+ "onUpdate": "no action"
271
+ },
272
+ "checkpoints_attempt_id_attempts_id_fk": {
273
+ "name": "checkpoints_attempt_id_attempts_id_fk",
274
+ "tableFrom": "checkpoints",
275
+ "tableTo": "attempts",
276
+ "columnsFrom": [
277
+ "attempt_id"
278
+ ],
279
+ "columnsTo": [
280
+ "id"
281
+ ],
282
+ "onDelete": "cascade",
283
+ "onUpdate": "no action"
284
+ }
285
+ },
286
+ "compositePrimaryKeys": {},
287
+ "uniqueConstraints": {},
288
+ "checkConstraints": {}
289
+ },
290
+ "events": {
291
+ "name": "events",
292
+ "columns": {
293
+ "id": {
294
+ "name": "id",
295
+ "type": "integer",
296
+ "primaryKey": true,
297
+ "notNull": true,
298
+ "autoincrement": true
299
+ },
300
+ "work_order_id": {
301
+ "name": "work_order_id",
302
+ "type": "text",
303
+ "primaryKey": false,
304
+ "notNull": true,
305
+ "autoincrement": false
306
+ },
307
+ "attempt_id": {
308
+ "name": "attempt_id",
309
+ "type": "text",
310
+ "primaryKey": false,
311
+ "notNull": false,
312
+ "autoincrement": false
313
+ },
314
+ "from_status": {
315
+ "name": "from_status",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": false,
319
+ "autoincrement": false
320
+ },
321
+ "to_status": {
322
+ "name": "to_status",
323
+ "type": "text",
324
+ "primaryKey": false,
325
+ "notNull": false,
326
+ "autoincrement": false
327
+ },
328
+ "kind": {
329
+ "name": "kind",
330
+ "type": "text",
331
+ "primaryKey": false,
332
+ "notNull": false,
333
+ "autoincrement": false
334
+ },
335
+ "actor": {
336
+ "name": "actor",
337
+ "type": "text",
338
+ "primaryKey": false,
339
+ "notNull": false,
340
+ "autoincrement": false
341
+ },
342
+ "note": {
343
+ "name": "note",
344
+ "type": "text",
345
+ "primaryKey": false,
346
+ "notNull": false,
347
+ "autoincrement": false
348
+ },
349
+ "session_ref": {
350
+ "name": "session_ref",
351
+ "type": "text",
352
+ "primaryKey": false,
353
+ "notNull": false,
354
+ "autoincrement": false
355
+ },
356
+ "at": {
357
+ "name": "at",
358
+ "type": "integer",
359
+ "primaryKey": false,
360
+ "notNull": true,
361
+ "autoincrement": false
362
+ }
363
+ },
364
+ "indexes": {
365
+ "idx_events_order": {
366
+ "name": "idx_events_order",
367
+ "columns": [
368
+ "work_order_id"
369
+ ],
370
+ "isUnique": false
371
+ }
372
+ },
373
+ "foreignKeys": {
374
+ "events_work_order_id_work_orders_id_fk": {
375
+ "name": "events_work_order_id_work_orders_id_fk",
376
+ "tableFrom": "events",
377
+ "tableTo": "work_orders",
378
+ "columnsFrom": [
379
+ "work_order_id"
380
+ ],
381
+ "columnsTo": [
382
+ "id"
383
+ ],
384
+ "onDelete": "cascade",
385
+ "onUpdate": "no action"
386
+ }
387
+ },
388
+ "compositePrimaryKeys": {},
389
+ "uniqueConstraints": {},
390
+ "checkConstraints": {}
391
+ },
392
+ "evidence": {
393
+ "name": "evidence",
394
+ "columns": {
395
+ "id": {
396
+ "name": "id",
397
+ "type": "text",
398
+ "primaryKey": true,
399
+ "notNull": true,
400
+ "autoincrement": false
401
+ },
402
+ "work_order_id": {
403
+ "name": "work_order_id",
404
+ "type": "text",
405
+ "primaryKey": false,
406
+ "notNull": true,
407
+ "autoincrement": false
408
+ },
409
+ "attempt_id": {
410
+ "name": "attempt_id",
411
+ "type": "text",
412
+ "primaryKey": false,
413
+ "notNull": true,
414
+ "autoincrement": false
415
+ },
416
+ "kind": {
417
+ "name": "kind",
418
+ "type": "text",
419
+ "primaryKey": false,
420
+ "notNull": true,
421
+ "autoincrement": false
422
+ },
423
+ "uri": {
424
+ "name": "uri",
425
+ "type": "text",
426
+ "primaryKey": false,
427
+ "notNull": true,
428
+ "autoincrement": false
429
+ },
430
+ "sha256": {
431
+ "name": "sha256",
432
+ "type": "text",
433
+ "primaryKey": false,
434
+ "notNull": true,
435
+ "autoincrement": false
436
+ },
437
+ "summary": {
438
+ "name": "summary",
439
+ "type": "text",
440
+ "primaryKey": false,
441
+ "notNull": false,
442
+ "autoincrement": false
443
+ },
444
+ "command": {
445
+ "name": "command",
446
+ "type": "text",
447
+ "primaryKey": false,
448
+ "notNull": false,
449
+ "autoincrement": false
450
+ },
451
+ "exit_code": {
452
+ "name": "exit_code",
453
+ "type": "integer",
454
+ "primaryKey": false,
455
+ "notNull": false,
456
+ "autoincrement": false
457
+ },
458
+ "status": {
459
+ "name": "status",
460
+ "type": "text",
461
+ "primaryKey": false,
462
+ "notNull": false,
463
+ "autoincrement": false
464
+ },
465
+ "verifier": {
466
+ "name": "verifier",
467
+ "type": "text",
468
+ "primaryKey": false,
469
+ "notNull": false,
470
+ "autoincrement": false
471
+ },
472
+ "created_at": {
473
+ "name": "created_at",
474
+ "type": "integer",
475
+ "primaryKey": false,
476
+ "notNull": true,
477
+ "autoincrement": false
478
+ }
479
+ },
480
+ "indexes": {
481
+ "idx_evidence_order": {
482
+ "name": "idx_evidence_order",
483
+ "columns": [
484
+ "work_order_id"
485
+ ],
486
+ "isUnique": false
487
+ },
488
+ "idx_evidence_attempt": {
489
+ "name": "idx_evidence_attempt",
490
+ "columns": [
491
+ "attempt_id"
492
+ ],
493
+ "isUnique": false
494
+ }
495
+ },
496
+ "foreignKeys": {
497
+ "evidence_work_order_id_work_orders_id_fk": {
498
+ "name": "evidence_work_order_id_work_orders_id_fk",
499
+ "tableFrom": "evidence",
500
+ "tableTo": "work_orders",
501
+ "columnsFrom": [
502
+ "work_order_id"
503
+ ],
504
+ "columnsTo": [
505
+ "id"
506
+ ],
507
+ "onDelete": "cascade",
508
+ "onUpdate": "no action"
509
+ },
510
+ "evidence_attempt_id_attempts_id_fk": {
511
+ "name": "evidence_attempt_id_attempts_id_fk",
512
+ "tableFrom": "evidence",
513
+ "tableTo": "attempts",
514
+ "columnsFrom": [
515
+ "attempt_id"
516
+ ],
517
+ "columnsTo": [
518
+ "id"
519
+ ],
520
+ "onDelete": "cascade",
521
+ "onUpdate": "no action"
522
+ }
523
+ },
524
+ "compositePrimaryKeys": {},
525
+ "uniqueConstraints": {},
526
+ "checkConstraints": {
527
+ "evidence_kind": {
528
+ "name": "evidence_kind",
529
+ "value": "\"evidence\".\"kind\" IN ('diff', 'test', 'lint', 'screenshot', 'artifact', 'log')"
530
+ }
531
+ }
532
+ },
533
+ "playbooks": {
534
+ "name": "playbooks",
535
+ "columns": {
536
+ "id": {
537
+ "name": "id",
538
+ "type": "text",
539
+ "primaryKey": true,
540
+ "notNull": true,
541
+ "autoincrement": false
542
+ },
543
+ "name": {
544
+ "name": "name",
545
+ "type": "text",
546
+ "primaryKey": false,
547
+ "notNull": true,
548
+ "autoincrement": false
549
+ },
550
+ "version": {
551
+ "name": "version",
552
+ "type": "integer",
553
+ "primaryKey": false,
554
+ "notNull": true,
555
+ "autoincrement": false,
556
+ "default": 1
557
+ },
558
+ "trigger": {
559
+ "name": "trigger",
560
+ "type": "text",
561
+ "primaryKey": false,
562
+ "notNull": false,
563
+ "autoincrement": false
564
+ },
565
+ "procedure": {
566
+ "name": "procedure",
567
+ "type": "text",
568
+ "primaryKey": false,
569
+ "notNull": true,
570
+ "autoincrement": false
571
+ },
572
+ "provenance": {
573
+ "name": "provenance",
574
+ "type": "text",
575
+ "primaryKey": false,
576
+ "notNull": false,
577
+ "autoincrement": false
578
+ },
579
+ "eval_score": {
580
+ "name": "eval_score",
581
+ "type": "real",
582
+ "primaryKey": false,
583
+ "notNull": false,
584
+ "autoincrement": false
585
+ },
586
+ "status": {
587
+ "name": "status",
588
+ "type": "text",
589
+ "primaryKey": false,
590
+ "notNull": true,
591
+ "autoincrement": false,
592
+ "default": "'draft'"
593
+ },
594
+ "created_at": {
595
+ "name": "created_at",
596
+ "type": "integer",
597
+ "primaryKey": false,
598
+ "notNull": true,
599
+ "autoincrement": false
600
+ }
601
+ },
602
+ "indexes": {},
603
+ "foreignKeys": {},
604
+ "compositePrimaryKeys": {},
605
+ "uniqueConstraints": {},
606
+ "checkConstraints": {}
607
+ },
608
+ "verdicts": {
609
+ "name": "verdicts",
610
+ "columns": {
611
+ "id": {
612
+ "name": "id",
613
+ "type": "text",
614
+ "primaryKey": true,
615
+ "notNull": true,
616
+ "autoincrement": false
617
+ },
618
+ "work_order_id": {
619
+ "name": "work_order_id",
620
+ "type": "text",
621
+ "primaryKey": false,
622
+ "notNull": true,
623
+ "autoincrement": false
624
+ },
625
+ "attempt_id": {
626
+ "name": "attempt_id",
627
+ "type": "text",
628
+ "primaryKey": false,
629
+ "notNull": false,
630
+ "autoincrement": false
631
+ },
632
+ "decision": {
633
+ "name": "decision",
634
+ "type": "text",
635
+ "primaryKey": false,
636
+ "notNull": true,
637
+ "autoincrement": false
638
+ },
639
+ "reason": {
640
+ "name": "reason",
641
+ "type": "text",
642
+ "primaryKey": false,
643
+ "notNull": false,
644
+ "autoincrement": false
645
+ },
646
+ "actor": {
647
+ "name": "actor",
648
+ "type": "text",
649
+ "primaryKey": false,
650
+ "notNull": true,
651
+ "autoincrement": false
652
+ },
653
+ "policy": {
654
+ "name": "policy",
655
+ "type": "text",
656
+ "primaryKey": false,
657
+ "notNull": false,
658
+ "autoincrement": false
659
+ },
660
+ "evidence_ids": {
661
+ "name": "evidence_ids",
662
+ "type": "text",
663
+ "primaryKey": false,
664
+ "notNull": false,
665
+ "autoincrement": false
666
+ },
667
+ "created_at": {
668
+ "name": "created_at",
669
+ "type": "integer",
670
+ "primaryKey": false,
671
+ "notNull": true,
672
+ "autoincrement": false
673
+ }
674
+ },
675
+ "indexes": {
676
+ "idx_verdicts_order": {
677
+ "name": "idx_verdicts_order",
678
+ "columns": [
679
+ "work_order_id"
680
+ ],
681
+ "isUnique": false
682
+ }
683
+ },
684
+ "foreignKeys": {
685
+ "verdicts_work_order_id_work_orders_id_fk": {
686
+ "name": "verdicts_work_order_id_work_orders_id_fk",
687
+ "tableFrom": "verdicts",
688
+ "tableTo": "work_orders",
689
+ "columnsFrom": [
690
+ "work_order_id"
691
+ ],
692
+ "columnsTo": [
693
+ "id"
694
+ ],
695
+ "onDelete": "cascade",
696
+ "onUpdate": "no action"
697
+ },
698
+ "verdicts_attempt_id_attempts_id_fk": {
699
+ "name": "verdicts_attempt_id_attempts_id_fk",
700
+ "tableFrom": "verdicts",
701
+ "tableTo": "attempts",
702
+ "columnsFrom": [
703
+ "attempt_id"
704
+ ],
705
+ "columnsTo": [
706
+ "id"
707
+ ],
708
+ "onDelete": "set null",
709
+ "onUpdate": "no action"
710
+ }
711
+ },
712
+ "compositePrimaryKeys": {},
713
+ "uniqueConstraints": {},
714
+ "checkConstraints": {
715
+ "verdicts_decision": {
716
+ "name": "verdicts_decision",
717
+ "value": "\"verdicts\".\"decision\" IN ('approve', 'reject', 'escalate', 'rollback')"
718
+ }
719
+ }
720
+ },
721
+ "work_orders": {
722
+ "name": "work_orders",
723
+ "columns": {
724
+ "id": {
725
+ "name": "id",
726
+ "type": "text",
727
+ "primaryKey": true,
728
+ "notNull": true,
729
+ "autoincrement": false
730
+ },
731
+ "title": {
732
+ "name": "title",
733
+ "type": "text",
734
+ "primaryKey": false,
735
+ "notNull": true,
736
+ "autoincrement": false
737
+ },
738
+ "goal": {
739
+ "name": "goal",
740
+ "type": "text",
741
+ "primaryKey": false,
742
+ "notNull": true,
743
+ "autoincrement": false
744
+ },
745
+ "constraints": {
746
+ "name": "constraints",
747
+ "type": "text",
748
+ "primaryKey": false,
749
+ "notNull": false,
750
+ "autoincrement": false
751
+ },
752
+ "acceptance": {
753
+ "name": "acceptance",
754
+ "type": "text",
755
+ "primaryKey": false,
756
+ "notNull": true,
757
+ "autoincrement": false
758
+ },
759
+ "status": {
760
+ "name": "status",
761
+ "type": "text",
762
+ "primaryKey": false,
763
+ "notNull": true,
764
+ "autoincrement": false
765
+ },
766
+ "priority": {
767
+ "name": "priority",
768
+ "type": "integer",
769
+ "primaryKey": false,
770
+ "notNull": true,
771
+ "autoincrement": false,
772
+ "default": 50
773
+ },
774
+ "workspace": {
775
+ "name": "workspace",
776
+ "type": "text",
777
+ "primaryKey": false,
778
+ "notNull": false,
779
+ "autoincrement": false
780
+ },
781
+ "repo": {
782
+ "name": "repo",
783
+ "type": "text",
784
+ "primaryKey": false,
785
+ "notNull": false,
786
+ "autoincrement": false
787
+ },
788
+ "branch": {
789
+ "name": "branch",
790
+ "type": "text",
791
+ "primaryKey": false,
792
+ "notNull": false,
793
+ "autoincrement": false
794
+ },
795
+ "budget_tokens": {
796
+ "name": "budget_tokens",
797
+ "type": "integer",
798
+ "primaryKey": false,
799
+ "notNull": false,
800
+ "autoincrement": false
801
+ },
802
+ "budget_usd": {
803
+ "name": "budget_usd",
804
+ "type": "real",
805
+ "primaryKey": false,
806
+ "notNull": false,
807
+ "autoincrement": false
808
+ },
809
+ "model_policy": {
810
+ "name": "model_policy",
811
+ "type": "text",
812
+ "primaryKey": false,
813
+ "notNull": false,
814
+ "autoincrement": false
815
+ },
816
+ "approval_mode": {
817
+ "name": "approval_mode",
818
+ "type": "text",
819
+ "primaryKey": false,
820
+ "notNull": true,
821
+ "autoincrement": false,
822
+ "default": "'human'"
823
+ },
824
+ "parent_id": {
825
+ "name": "parent_id",
826
+ "type": "text",
827
+ "primaryKey": false,
828
+ "notNull": false,
829
+ "autoincrement": false
830
+ },
831
+ "assignee": {
832
+ "name": "assignee",
833
+ "type": "text",
834
+ "primaryKey": false,
835
+ "notNull": false,
836
+ "autoincrement": false
837
+ },
838
+ "claim_expires_at": {
839
+ "name": "claim_expires_at",
840
+ "type": "integer",
841
+ "primaryKey": false,
842
+ "notNull": false,
843
+ "autoincrement": false
844
+ },
845
+ "lease_seconds": {
846
+ "name": "lease_seconds",
847
+ "type": "integer",
848
+ "primaryKey": false,
849
+ "notNull": false,
850
+ "autoincrement": false
851
+ },
852
+ "last_heartbeat": {
853
+ "name": "last_heartbeat",
854
+ "type": "integer",
855
+ "primaryKey": false,
856
+ "notNull": false,
857
+ "autoincrement": false
858
+ },
859
+ "attempt_count": {
860
+ "name": "attempt_count",
861
+ "type": "integer",
862
+ "primaryKey": false,
863
+ "notNull": true,
864
+ "autoincrement": false,
865
+ "default": 0
866
+ },
867
+ "created_at": {
868
+ "name": "created_at",
869
+ "type": "integer",
870
+ "primaryKey": false,
871
+ "notNull": true,
872
+ "autoincrement": false
873
+ },
874
+ "updated_at": {
875
+ "name": "updated_at",
876
+ "type": "integer",
877
+ "primaryKey": false,
878
+ "notNull": true,
879
+ "autoincrement": false
880
+ },
881
+ "closed_at": {
882
+ "name": "closed_at",
883
+ "type": "integer",
884
+ "primaryKey": false,
885
+ "notNull": false,
886
+ "autoincrement": false
887
+ }
888
+ },
889
+ "indexes": {
890
+ "idx_work_orders_status_priority": {
891
+ "name": "idx_work_orders_status_priority",
892
+ "columns": [
893
+ "status",
894
+ "priority"
895
+ ],
896
+ "isUnique": false
897
+ },
898
+ "idx_work_orders_assignee": {
899
+ "name": "idx_work_orders_assignee",
900
+ "columns": [
901
+ "assignee"
902
+ ],
903
+ "isUnique": false
904
+ }
905
+ },
906
+ "foreignKeys": {},
907
+ "compositePrimaryKeys": {},
908
+ "uniqueConstraints": {},
909
+ "checkConstraints": {
910
+ "work_orders_status": {
911
+ "name": "work_orders_status",
912
+ "value": "\"work_orders\".\"status\" IN ('draft', 'ready', 'claimed', 'running', 'review', 'approved', 'rejected', 'blocked', 'done', 'cancelled')"
913
+ },
914
+ "work_orders_approval_mode": {
915
+ "name": "work_orders_approval_mode",
916
+ "value": "\"work_orders\".\"approval_mode\" IN ('auto', 'evidence', 'human')"
917
+ }
918
+ }
919
+ }
920
+ },
921
+ "views": {},
922
+ "enums": {},
923
+ "_meta": {
924
+ "schemas": {},
925
+ "tables": {},
926
+ "columns": {}
927
+ },
928
+ "internal": {
929
+ "indexes": {}
930
+ }
931
+ }