@hyperfixation/db 0.1.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 (65) hide show
  1. package/LICENSE +21 -0
  2. package/dist/app-state.d.ts +12 -0
  3. package/dist/app-state.js +18 -0
  4. package/dist/boot-checks.d.ts +56 -0
  5. package/dist/boot-checks.js +228 -0
  6. package/dist/classify.d.ts +6 -0
  7. package/dist/classify.js +75 -0
  8. package/dist/control-plane.d.ts +75 -0
  9. package/dist/control-plane.js +155 -0
  10. package/dist/delete-guard.d.ts +32 -0
  11. package/dist/delete-guard.js +62 -0
  12. package/dist/fenced-client.d.ts +35 -0
  13. package/dist/fenced-client.js +153 -0
  14. package/dist/grant-ro.d.ts +23 -0
  15. package/dist/grant-ro.js +49 -0
  16. package/dist/index.d.ts +12 -0
  17. package/dist/index.js +10 -0
  18. package/dist/internal/control-pool.d.ts +20 -0
  19. package/dist/internal/control-pool.js +17 -0
  20. package/dist/loader.d.ts +15 -0
  21. package/dist/loader.js +82 -0
  22. package/dist/migrate.d.ts +54 -0
  23. package/dist/migrate.js +143 -0
  24. package/dist/migration-policy.d.ts +14 -0
  25. package/dist/migration-policy.js +85 -0
  26. package/dist/migrator.d.ts +9 -0
  27. package/dist/migrator.js +9 -0
  28. package/dist/roles.d.ts +47 -0
  29. package/dist/roles.js +112 -0
  30. package/dist/schema/app.d.ts +235 -0
  31. package/dist/schema/app.js +23 -0
  32. package/dist/schema/approvals.d.ts +352 -0
  33. package/dist/schema/approvals.js +43 -0
  34. package/dist/schema/auth.d.ts +1272 -0
  35. package/dist/schema/auth.js +120 -0
  36. package/dist/schema/index.d.ts +7 -0
  37. package/dist/schema/index.js +7 -0
  38. package/dist/schema/ledger.d.ts +722 -0
  39. package/dist/schema/ledger.js +68 -0
  40. package/dist/schema/machinery.d.ts +1343 -0
  41. package/dist/schema/machinery.js +146 -0
  42. package/dist/schema/records.d.ts +15 -0
  43. package/dist/schema/records.js +16 -0
  44. package/dist/schema/runs.d.ts +213 -0
  45. package/dist/schema/runs.js +26 -0
  46. package/dist/step-pool.d.ts +26 -0
  47. package/dist/step-pool.js +57 -0
  48. package/migrations/0000_core_schema.sql +185 -0
  49. package/migrations/0001_llm_call_reservation_index.sql +4 -0
  50. package/migrations/0002_approvals.sql +25 -0
  51. package/migrations/0003_auth_invitation.sql +13 -0
  52. package/migrations/0004_machinery.sql +105 -0
  53. package/migrations/0005_nullable_activity_task_record.sql +4 -0
  54. package/migrations/0006_activity_score_key.sql +5 -0
  55. package/migrations/0007_score_spec_name.sql +3 -0
  56. package/migrations/meta/0000_snapshot.json +1238 -0
  57. package/migrations/meta/0001_snapshot.json +1238 -0
  58. package/migrations/meta/0002_snapshot.json +1426 -0
  59. package/migrations/meta/0003_snapshot.json +1516 -0
  60. package/migrations/meta/0004_snapshot.json +2353 -0
  61. package/migrations/meta/0005_snapshot.json +2353 -0
  62. package/migrations/meta/0006_snapshot.json +2415 -0
  63. package/migrations/meta/0007_snapshot.json +2427 -0
  64. package/migrations/meta/_journal.json +62 -0
  65. package/package.json +58 -0
@@ -0,0 +1,2353 @@
1
+ {
2
+ "id": "a676449b-557b-4853-93fe-aa5f9f7e9ab9",
3
+ "prevId": "83640783-d54a-4812-a70b-e3cb0bd83bda",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.hf_app_state": {
8
+ "name": "hf_app_state",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "integer",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": 1
17
+ },
18
+ "paused": {
19
+ "name": "paused",
20
+ "type": "boolean",
21
+ "primaryKey": false,
22
+ "notNull": true,
23
+ "default": false
24
+ },
25
+ "paused_by": {
26
+ "name": "paused_by",
27
+ "type": "text",
28
+ "primaryKey": false,
29
+ "notNull": false
30
+ },
31
+ "budget_usd": {
32
+ "name": "budget_usd",
33
+ "type": "numeric(12, 4)",
34
+ "primaryKey": false,
35
+ "notNull": true
36
+ },
37
+ "read_token_hash": {
38
+ "name": "read_token_hash",
39
+ "type": "text",
40
+ "primaryKey": false,
41
+ "notNull": false
42
+ },
43
+ "write_token_hash": {
44
+ "name": "write_token_hash",
45
+ "type": "text",
46
+ "primaryKey": false,
47
+ "notNull": false
48
+ }
49
+ },
50
+ "indexes": {},
51
+ "foreignKeys": {},
52
+ "compositePrimaryKeys": {},
53
+ "uniqueConstraints": {},
54
+ "policies": {},
55
+ "checkConstraints": {
56
+ "hf_app_state_singleton": {
57
+ "name": "hf_app_state_singleton",
58
+ "value": "\"hf_app_state\".\"id\" = 1"
59
+ }
60
+ },
61
+ "isRLSEnabled": false
62
+ },
63
+ "public.hf_audit": {
64
+ "name": "hf_audit",
65
+ "schema": "",
66
+ "columns": {
67
+ "id": {
68
+ "name": "id",
69
+ "type": "bigint",
70
+ "primaryKey": true,
71
+ "notNull": true,
72
+ "identity": {
73
+ "type": "always",
74
+ "name": "hf_audit_id_seq",
75
+ "schema": "public",
76
+ "increment": "1",
77
+ "startWith": "1",
78
+ "minValue": "1",
79
+ "maxValue": "9223372036854775807",
80
+ "cache": "1",
81
+ "cycle": false
82
+ }
83
+ },
84
+ "actor_id": {
85
+ "name": "actor_id",
86
+ "type": "text",
87
+ "primaryKey": false,
88
+ "notNull": false
89
+ },
90
+ "action": {
91
+ "name": "action",
92
+ "type": "text",
93
+ "primaryKey": false,
94
+ "notNull": true
95
+ },
96
+ "target_type": {
97
+ "name": "target_type",
98
+ "type": "text",
99
+ "primaryKey": false,
100
+ "notNull": false
101
+ },
102
+ "target_id": {
103
+ "name": "target_id",
104
+ "type": "text",
105
+ "primaryKey": false,
106
+ "notNull": false
107
+ },
108
+ "meta": {
109
+ "name": "meta",
110
+ "type": "jsonb",
111
+ "primaryKey": false,
112
+ "notNull": false
113
+ },
114
+ "at": {
115
+ "name": "at",
116
+ "type": "timestamp with time zone",
117
+ "primaryKey": false,
118
+ "notNull": true,
119
+ "default": "now()"
120
+ }
121
+ },
122
+ "indexes": {},
123
+ "foreignKeys": {},
124
+ "compositePrimaryKeys": {},
125
+ "uniqueConstraints": {},
126
+ "policies": {},
127
+ "checkConstraints": {},
128
+ "isRLSEnabled": false
129
+ },
130
+ "public.hf_approval": {
131
+ "name": "hf_approval",
132
+ "schema": "",
133
+ "columns": {
134
+ "id": {
135
+ "name": "id",
136
+ "type": "bigint",
137
+ "primaryKey": true,
138
+ "notNull": true,
139
+ "identity": {
140
+ "type": "always",
141
+ "name": "hf_approval_id_seq",
142
+ "schema": "public",
143
+ "increment": "1",
144
+ "startWith": "1",
145
+ "minValue": "1",
146
+ "maxValue": "9223372036854775807",
147
+ "cache": "1",
148
+ "cycle": false
149
+ }
150
+ },
151
+ "run_id": {
152
+ "name": "run_id",
153
+ "type": "text",
154
+ "primaryKey": false,
155
+ "notNull": true
156
+ },
157
+ "key": {
158
+ "name": "key",
159
+ "type": "text",
160
+ "primaryKey": false,
161
+ "notNull": true
162
+ },
163
+ "workflow_id": {
164
+ "name": "workflow_id",
165
+ "type": "text",
166
+ "primaryKey": false,
167
+ "notNull": true
168
+ },
169
+ "type": {
170
+ "name": "type",
171
+ "type": "text",
172
+ "primaryKey": false,
173
+ "notNull": true
174
+ },
175
+ "record_type": {
176
+ "name": "record_type",
177
+ "type": "text",
178
+ "primaryKey": false,
179
+ "notNull": false
180
+ },
181
+ "record_id": {
182
+ "name": "record_id",
183
+ "type": "text",
184
+ "primaryKey": false,
185
+ "notNull": false
186
+ },
187
+ "draft": {
188
+ "name": "draft",
189
+ "type": "jsonb",
190
+ "primaryKey": false,
191
+ "notNull": false
192
+ },
193
+ "edited_draft": {
194
+ "name": "edited_draft",
195
+ "type": "jsonb",
196
+ "primaryKey": false,
197
+ "notNull": false
198
+ },
199
+ "status": {
200
+ "name": "status",
201
+ "type": "text",
202
+ "primaryKey": false,
203
+ "notNull": true
204
+ },
205
+ "assignee_id": {
206
+ "name": "assignee_id",
207
+ "type": "text",
208
+ "primaryKey": false,
209
+ "notNull": false
210
+ },
211
+ "decided_by": {
212
+ "name": "decided_by",
213
+ "type": "text",
214
+ "primaryKey": false,
215
+ "notNull": false
216
+ },
217
+ "decided_at": {
218
+ "name": "decided_at",
219
+ "type": "timestamp with time zone",
220
+ "primaryKey": false,
221
+ "notNull": false
222
+ },
223
+ "decided_via": {
224
+ "name": "decided_via",
225
+ "type": "text",
226
+ "primaryKey": false,
227
+ "notNull": false
228
+ },
229
+ "decision_key": {
230
+ "name": "decision_key",
231
+ "type": "text",
232
+ "primaryKey": false,
233
+ "notNull": false
234
+ },
235
+ "resume_workflow_id": {
236
+ "name": "resume_workflow_id",
237
+ "type": "text",
238
+ "primaryKey": false,
239
+ "notNull": false
240
+ },
241
+ "notified_at": {
242
+ "name": "notified_at",
243
+ "type": "timestamp with time zone",
244
+ "primaryKey": false,
245
+ "notNull": false
246
+ },
247
+ "expires_at": {
248
+ "name": "expires_at",
249
+ "type": "timestamp with time zone",
250
+ "primaryKey": false,
251
+ "notNull": false
252
+ },
253
+ "batch_id": {
254
+ "name": "batch_id",
255
+ "type": "text",
256
+ "primaryKey": false,
257
+ "notNull": false
258
+ },
259
+ "created_at": {
260
+ "name": "created_at",
261
+ "type": "timestamp with time zone",
262
+ "primaryKey": false,
263
+ "notNull": true,
264
+ "default": "now()"
265
+ }
266
+ },
267
+ "indexes": {
268
+ "hf_approval_run_key_uq": {
269
+ "name": "hf_approval_run_key_uq",
270
+ "columns": [
271
+ {
272
+ "expression": "run_id",
273
+ "isExpression": false,
274
+ "asc": true,
275
+ "nulls": "last"
276
+ },
277
+ {
278
+ "expression": "key",
279
+ "isExpression": false,
280
+ "asc": true,
281
+ "nulls": "last"
282
+ }
283
+ ],
284
+ "isUnique": true,
285
+ "concurrently": false,
286
+ "method": "btree",
287
+ "with": {}
288
+ },
289
+ "hf_approval_status_idx": {
290
+ "name": "hf_approval_status_idx",
291
+ "columns": [
292
+ {
293
+ "expression": "status",
294
+ "isExpression": false,
295
+ "asc": true,
296
+ "nulls": "last"
297
+ },
298
+ {
299
+ "expression": "expires_at",
300
+ "isExpression": false,
301
+ "asc": true,
302
+ "nulls": "last"
303
+ }
304
+ ],
305
+ "isUnique": false,
306
+ "concurrently": false,
307
+ "method": "btree",
308
+ "with": {}
309
+ }
310
+ },
311
+ "foreignKeys": {},
312
+ "compositePrimaryKeys": {},
313
+ "uniqueConstraints": {},
314
+ "policies": {},
315
+ "checkConstraints": {},
316
+ "isRLSEnabled": false
317
+ },
318
+ "public.hf_account": {
319
+ "name": "hf_account",
320
+ "schema": "",
321
+ "columns": {
322
+ "id": {
323
+ "name": "id",
324
+ "type": "text",
325
+ "primaryKey": true,
326
+ "notNull": true
327
+ },
328
+ "account_id": {
329
+ "name": "account_id",
330
+ "type": "text",
331
+ "primaryKey": false,
332
+ "notNull": true
333
+ },
334
+ "provider_id": {
335
+ "name": "provider_id",
336
+ "type": "text",
337
+ "primaryKey": false,
338
+ "notNull": true
339
+ },
340
+ "user_id": {
341
+ "name": "user_id",
342
+ "type": "text",
343
+ "primaryKey": false,
344
+ "notNull": true
345
+ },
346
+ "access_token": {
347
+ "name": "access_token",
348
+ "type": "text",
349
+ "primaryKey": false,
350
+ "notNull": false
351
+ },
352
+ "refresh_token": {
353
+ "name": "refresh_token",
354
+ "type": "text",
355
+ "primaryKey": false,
356
+ "notNull": false
357
+ },
358
+ "id_token": {
359
+ "name": "id_token",
360
+ "type": "text",
361
+ "primaryKey": false,
362
+ "notNull": false
363
+ },
364
+ "access_token_expires_at": {
365
+ "name": "access_token_expires_at",
366
+ "type": "timestamp with time zone",
367
+ "primaryKey": false,
368
+ "notNull": false
369
+ },
370
+ "refresh_token_expires_at": {
371
+ "name": "refresh_token_expires_at",
372
+ "type": "timestamp with time zone",
373
+ "primaryKey": false,
374
+ "notNull": false
375
+ },
376
+ "scope": {
377
+ "name": "scope",
378
+ "type": "text",
379
+ "primaryKey": false,
380
+ "notNull": false
381
+ },
382
+ "password": {
383
+ "name": "password",
384
+ "type": "text",
385
+ "primaryKey": false,
386
+ "notNull": false
387
+ },
388
+ "created_at": {
389
+ "name": "created_at",
390
+ "type": "timestamp with time zone",
391
+ "primaryKey": false,
392
+ "notNull": true,
393
+ "default": "now()"
394
+ },
395
+ "updated_at": {
396
+ "name": "updated_at",
397
+ "type": "timestamp with time zone",
398
+ "primaryKey": false,
399
+ "notNull": true,
400
+ "default": "now()"
401
+ }
402
+ },
403
+ "indexes": {},
404
+ "foreignKeys": {
405
+ "hf_account_user_id_hf_user_id_fk": {
406
+ "name": "hf_account_user_id_hf_user_id_fk",
407
+ "tableFrom": "hf_account",
408
+ "tableTo": "hf_user",
409
+ "columnsFrom": [
410
+ "user_id"
411
+ ],
412
+ "columnsTo": [
413
+ "id"
414
+ ],
415
+ "onDelete": "cascade",
416
+ "onUpdate": "no action"
417
+ }
418
+ },
419
+ "compositePrimaryKeys": {},
420
+ "uniqueConstraints": {},
421
+ "policies": {},
422
+ "checkConstraints": {},
423
+ "isRLSEnabled": false
424
+ },
425
+ "public.hf_invitation": {
426
+ "name": "hf_invitation",
427
+ "schema": "",
428
+ "columns": {
429
+ "id": {
430
+ "name": "id",
431
+ "type": "text",
432
+ "primaryKey": true,
433
+ "notNull": true
434
+ },
435
+ "organization_id": {
436
+ "name": "organization_id",
437
+ "type": "text",
438
+ "primaryKey": false,
439
+ "notNull": true
440
+ },
441
+ "email": {
442
+ "name": "email",
443
+ "type": "text",
444
+ "primaryKey": false,
445
+ "notNull": true
446
+ },
447
+ "role": {
448
+ "name": "role",
449
+ "type": "text",
450
+ "primaryKey": false,
451
+ "notNull": false
452
+ },
453
+ "status": {
454
+ "name": "status",
455
+ "type": "text",
456
+ "primaryKey": false,
457
+ "notNull": true,
458
+ "default": "'pending'"
459
+ },
460
+ "expires_at": {
461
+ "name": "expires_at",
462
+ "type": "timestamp with time zone",
463
+ "primaryKey": false,
464
+ "notNull": true
465
+ },
466
+ "inviter_id": {
467
+ "name": "inviter_id",
468
+ "type": "text",
469
+ "primaryKey": false,
470
+ "notNull": true
471
+ },
472
+ "created_at": {
473
+ "name": "created_at",
474
+ "type": "timestamp with time zone",
475
+ "primaryKey": false,
476
+ "notNull": true,
477
+ "default": "now()"
478
+ }
479
+ },
480
+ "indexes": {},
481
+ "foreignKeys": {
482
+ "hf_invitation_organization_id_hf_organization_id_fk": {
483
+ "name": "hf_invitation_organization_id_hf_organization_id_fk",
484
+ "tableFrom": "hf_invitation",
485
+ "tableTo": "hf_organization",
486
+ "columnsFrom": [
487
+ "organization_id"
488
+ ],
489
+ "columnsTo": [
490
+ "id"
491
+ ],
492
+ "onDelete": "cascade",
493
+ "onUpdate": "no action"
494
+ },
495
+ "hf_invitation_inviter_id_hf_user_id_fk": {
496
+ "name": "hf_invitation_inviter_id_hf_user_id_fk",
497
+ "tableFrom": "hf_invitation",
498
+ "tableTo": "hf_user",
499
+ "columnsFrom": [
500
+ "inviter_id"
501
+ ],
502
+ "columnsTo": [
503
+ "id"
504
+ ],
505
+ "onDelete": "cascade",
506
+ "onUpdate": "no action"
507
+ }
508
+ },
509
+ "compositePrimaryKeys": {},
510
+ "uniqueConstraints": {},
511
+ "policies": {},
512
+ "checkConstraints": {},
513
+ "isRLSEnabled": false
514
+ },
515
+ "public.hf_member": {
516
+ "name": "hf_member",
517
+ "schema": "",
518
+ "columns": {
519
+ "id": {
520
+ "name": "id",
521
+ "type": "text",
522
+ "primaryKey": true,
523
+ "notNull": true
524
+ },
525
+ "organization_id": {
526
+ "name": "organization_id",
527
+ "type": "text",
528
+ "primaryKey": false,
529
+ "notNull": true
530
+ },
531
+ "user_id": {
532
+ "name": "user_id",
533
+ "type": "text",
534
+ "primaryKey": false,
535
+ "notNull": true
536
+ },
537
+ "role": {
538
+ "name": "role",
539
+ "type": "text",
540
+ "primaryKey": false,
541
+ "notNull": true,
542
+ "default": "'member'"
543
+ },
544
+ "created_at": {
545
+ "name": "created_at",
546
+ "type": "timestamp with time zone",
547
+ "primaryKey": false,
548
+ "notNull": true,
549
+ "default": "now()"
550
+ }
551
+ },
552
+ "indexes": {},
553
+ "foreignKeys": {
554
+ "hf_member_organization_id_hf_organization_id_fk": {
555
+ "name": "hf_member_organization_id_hf_organization_id_fk",
556
+ "tableFrom": "hf_member",
557
+ "tableTo": "hf_organization",
558
+ "columnsFrom": [
559
+ "organization_id"
560
+ ],
561
+ "columnsTo": [
562
+ "id"
563
+ ],
564
+ "onDelete": "cascade",
565
+ "onUpdate": "no action"
566
+ },
567
+ "hf_member_user_id_hf_user_id_fk": {
568
+ "name": "hf_member_user_id_hf_user_id_fk",
569
+ "tableFrom": "hf_member",
570
+ "tableTo": "hf_user",
571
+ "columnsFrom": [
572
+ "user_id"
573
+ ],
574
+ "columnsTo": [
575
+ "id"
576
+ ],
577
+ "onDelete": "cascade",
578
+ "onUpdate": "no action"
579
+ }
580
+ },
581
+ "compositePrimaryKeys": {},
582
+ "uniqueConstraints": {},
583
+ "policies": {},
584
+ "checkConstraints": {},
585
+ "isRLSEnabled": false
586
+ },
587
+ "public.hf_organization": {
588
+ "name": "hf_organization",
589
+ "schema": "",
590
+ "columns": {
591
+ "id": {
592
+ "name": "id",
593
+ "type": "text",
594
+ "primaryKey": true,
595
+ "notNull": true
596
+ },
597
+ "name": {
598
+ "name": "name",
599
+ "type": "text",
600
+ "primaryKey": false,
601
+ "notNull": true
602
+ },
603
+ "slug": {
604
+ "name": "slug",
605
+ "type": "text",
606
+ "primaryKey": false,
607
+ "notNull": true
608
+ },
609
+ "logo": {
610
+ "name": "logo",
611
+ "type": "text",
612
+ "primaryKey": false,
613
+ "notNull": false
614
+ },
615
+ "created_at": {
616
+ "name": "created_at",
617
+ "type": "timestamp with time zone",
618
+ "primaryKey": false,
619
+ "notNull": true,
620
+ "default": "now()"
621
+ },
622
+ "metadata": {
623
+ "name": "metadata",
624
+ "type": "text",
625
+ "primaryKey": false,
626
+ "notNull": false
627
+ }
628
+ },
629
+ "indexes": {},
630
+ "foreignKeys": {},
631
+ "compositePrimaryKeys": {},
632
+ "uniqueConstraints": {
633
+ "hf_organization_slug_unique": {
634
+ "name": "hf_organization_slug_unique",
635
+ "nullsNotDistinct": false,
636
+ "columns": [
637
+ "slug"
638
+ ]
639
+ }
640
+ },
641
+ "policies": {},
642
+ "checkConstraints": {},
643
+ "isRLSEnabled": false
644
+ },
645
+ "public.hf_passkey": {
646
+ "name": "hf_passkey",
647
+ "schema": "",
648
+ "columns": {
649
+ "id": {
650
+ "name": "id",
651
+ "type": "text",
652
+ "primaryKey": true,
653
+ "notNull": true
654
+ },
655
+ "name": {
656
+ "name": "name",
657
+ "type": "text",
658
+ "primaryKey": false,
659
+ "notNull": false
660
+ },
661
+ "public_key": {
662
+ "name": "public_key",
663
+ "type": "text",
664
+ "primaryKey": false,
665
+ "notNull": true
666
+ },
667
+ "user_id": {
668
+ "name": "user_id",
669
+ "type": "text",
670
+ "primaryKey": false,
671
+ "notNull": true
672
+ },
673
+ "credential_id": {
674
+ "name": "credential_id",
675
+ "type": "text",
676
+ "primaryKey": false,
677
+ "notNull": true
678
+ },
679
+ "counter": {
680
+ "name": "counter",
681
+ "type": "integer",
682
+ "primaryKey": false,
683
+ "notNull": true
684
+ },
685
+ "device_type": {
686
+ "name": "device_type",
687
+ "type": "text",
688
+ "primaryKey": false,
689
+ "notNull": true
690
+ },
691
+ "backed_up": {
692
+ "name": "backed_up",
693
+ "type": "boolean",
694
+ "primaryKey": false,
695
+ "notNull": true
696
+ },
697
+ "transports": {
698
+ "name": "transports",
699
+ "type": "text",
700
+ "primaryKey": false,
701
+ "notNull": false
702
+ },
703
+ "created_at": {
704
+ "name": "created_at",
705
+ "type": "timestamp with time zone",
706
+ "primaryKey": false,
707
+ "notNull": false,
708
+ "default": "now()"
709
+ },
710
+ "aaguid": {
711
+ "name": "aaguid",
712
+ "type": "text",
713
+ "primaryKey": false,
714
+ "notNull": false
715
+ }
716
+ },
717
+ "indexes": {},
718
+ "foreignKeys": {
719
+ "hf_passkey_user_id_hf_user_id_fk": {
720
+ "name": "hf_passkey_user_id_hf_user_id_fk",
721
+ "tableFrom": "hf_passkey",
722
+ "tableTo": "hf_user",
723
+ "columnsFrom": [
724
+ "user_id"
725
+ ],
726
+ "columnsTo": [
727
+ "id"
728
+ ],
729
+ "onDelete": "cascade",
730
+ "onUpdate": "no action"
731
+ }
732
+ },
733
+ "compositePrimaryKeys": {},
734
+ "uniqueConstraints": {},
735
+ "policies": {},
736
+ "checkConstraints": {},
737
+ "isRLSEnabled": false
738
+ },
739
+ "public.hf_session": {
740
+ "name": "hf_session",
741
+ "schema": "",
742
+ "columns": {
743
+ "id": {
744
+ "name": "id",
745
+ "type": "text",
746
+ "primaryKey": true,
747
+ "notNull": true
748
+ },
749
+ "expires_at": {
750
+ "name": "expires_at",
751
+ "type": "timestamp with time zone",
752
+ "primaryKey": false,
753
+ "notNull": true
754
+ },
755
+ "token": {
756
+ "name": "token",
757
+ "type": "text",
758
+ "primaryKey": false,
759
+ "notNull": true
760
+ },
761
+ "created_at": {
762
+ "name": "created_at",
763
+ "type": "timestamp with time zone",
764
+ "primaryKey": false,
765
+ "notNull": true,
766
+ "default": "now()"
767
+ },
768
+ "updated_at": {
769
+ "name": "updated_at",
770
+ "type": "timestamp with time zone",
771
+ "primaryKey": false,
772
+ "notNull": true,
773
+ "default": "now()"
774
+ },
775
+ "ip_address": {
776
+ "name": "ip_address",
777
+ "type": "text",
778
+ "primaryKey": false,
779
+ "notNull": false
780
+ },
781
+ "user_agent": {
782
+ "name": "user_agent",
783
+ "type": "text",
784
+ "primaryKey": false,
785
+ "notNull": false
786
+ },
787
+ "user_id": {
788
+ "name": "user_id",
789
+ "type": "text",
790
+ "primaryKey": false,
791
+ "notNull": true
792
+ },
793
+ "active_organization_id": {
794
+ "name": "active_organization_id",
795
+ "type": "text",
796
+ "primaryKey": false,
797
+ "notNull": false
798
+ },
799
+ "impersonated_by": {
800
+ "name": "impersonated_by",
801
+ "type": "text",
802
+ "primaryKey": false,
803
+ "notNull": false
804
+ },
805
+ "factor": {
806
+ "name": "factor",
807
+ "type": "text",
808
+ "primaryKey": false,
809
+ "notNull": true,
810
+ "default": "'code'"
811
+ }
812
+ },
813
+ "indexes": {},
814
+ "foreignKeys": {
815
+ "hf_session_user_id_hf_user_id_fk": {
816
+ "name": "hf_session_user_id_hf_user_id_fk",
817
+ "tableFrom": "hf_session",
818
+ "tableTo": "hf_user",
819
+ "columnsFrom": [
820
+ "user_id"
821
+ ],
822
+ "columnsTo": [
823
+ "id"
824
+ ],
825
+ "onDelete": "cascade",
826
+ "onUpdate": "no action"
827
+ }
828
+ },
829
+ "compositePrimaryKeys": {},
830
+ "uniqueConstraints": {
831
+ "hf_session_token_unique": {
832
+ "name": "hf_session_token_unique",
833
+ "nullsNotDistinct": false,
834
+ "columns": [
835
+ "token"
836
+ ]
837
+ }
838
+ },
839
+ "policies": {},
840
+ "checkConstraints": {},
841
+ "isRLSEnabled": false
842
+ },
843
+ "public.hf_user": {
844
+ "name": "hf_user",
845
+ "schema": "",
846
+ "columns": {
847
+ "id": {
848
+ "name": "id",
849
+ "type": "text",
850
+ "primaryKey": true,
851
+ "notNull": true
852
+ },
853
+ "name": {
854
+ "name": "name",
855
+ "type": "text",
856
+ "primaryKey": false,
857
+ "notNull": true
858
+ },
859
+ "email": {
860
+ "name": "email",
861
+ "type": "text",
862
+ "primaryKey": false,
863
+ "notNull": true
864
+ },
865
+ "email_verified": {
866
+ "name": "email_verified",
867
+ "type": "boolean",
868
+ "primaryKey": false,
869
+ "notNull": true,
870
+ "default": false
871
+ },
872
+ "image": {
873
+ "name": "image",
874
+ "type": "text",
875
+ "primaryKey": false,
876
+ "notNull": false
877
+ },
878
+ "created_at": {
879
+ "name": "created_at",
880
+ "type": "timestamp with time zone",
881
+ "primaryKey": false,
882
+ "notNull": true,
883
+ "default": "now()"
884
+ },
885
+ "updated_at": {
886
+ "name": "updated_at",
887
+ "type": "timestamp with time zone",
888
+ "primaryKey": false,
889
+ "notNull": true,
890
+ "default": "now()"
891
+ },
892
+ "role": {
893
+ "name": "role",
894
+ "type": "text",
895
+ "primaryKey": false,
896
+ "notNull": false
897
+ },
898
+ "banned": {
899
+ "name": "banned",
900
+ "type": "boolean",
901
+ "primaryKey": false,
902
+ "notNull": false,
903
+ "default": false
904
+ },
905
+ "ban_reason": {
906
+ "name": "ban_reason",
907
+ "type": "text",
908
+ "primaryKey": false,
909
+ "notNull": false
910
+ },
911
+ "ban_expires": {
912
+ "name": "ban_expires",
913
+ "type": "timestamp with time zone",
914
+ "primaryKey": false,
915
+ "notNull": false
916
+ }
917
+ },
918
+ "indexes": {},
919
+ "foreignKeys": {},
920
+ "compositePrimaryKeys": {},
921
+ "uniqueConstraints": {
922
+ "hf_user_email_unique": {
923
+ "name": "hf_user_email_unique",
924
+ "nullsNotDistinct": false,
925
+ "columns": [
926
+ "email"
927
+ ]
928
+ }
929
+ },
930
+ "policies": {},
931
+ "checkConstraints": {},
932
+ "isRLSEnabled": false
933
+ },
934
+ "public.hf_verification": {
935
+ "name": "hf_verification",
936
+ "schema": "",
937
+ "columns": {
938
+ "id": {
939
+ "name": "id",
940
+ "type": "text",
941
+ "primaryKey": true,
942
+ "notNull": true
943
+ },
944
+ "identifier": {
945
+ "name": "identifier",
946
+ "type": "text",
947
+ "primaryKey": false,
948
+ "notNull": true
949
+ },
950
+ "value": {
951
+ "name": "value",
952
+ "type": "text",
953
+ "primaryKey": false,
954
+ "notNull": true
955
+ },
956
+ "expires_at": {
957
+ "name": "expires_at",
958
+ "type": "timestamp with time zone",
959
+ "primaryKey": false,
960
+ "notNull": true
961
+ },
962
+ "created_at": {
963
+ "name": "created_at",
964
+ "type": "timestamp with time zone",
965
+ "primaryKey": false,
966
+ "notNull": true,
967
+ "default": "now()"
968
+ },
969
+ "updated_at": {
970
+ "name": "updated_at",
971
+ "type": "timestamp with time zone",
972
+ "primaryKey": false,
973
+ "notNull": true,
974
+ "default": "now()"
975
+ }
976
+ },
977
+ "indexes": {},
978
+ "foreignKeys": {},
979
+ "compositePrimaryKeys": {},
980
+ "uniqueConstraints": {},
981
+ "policies": {},
982
+ "checkConstraints": {},
983
+ "isRLSEnabled": false
984
+ },
985
+ "public.hf_action_log": {
986
+ "name": "hf_action_log",
987
+ "schema": "",
988
+ "columns": {
989
+ "id": {
990
+ "name": "id",
991
+ "type": "bigint",
992
+ "primaryKey": true,
993
+ "notNull": true,
994
+ "identity": {
995
+ "type": "always",
996
+ "name": "hf_action_log_id_seq",
997
+ "schema": "public",
998
+ "increment": "1",
999
+ "startWith": "1",
1000
+ "minValue": "1",
1001
+ "maxValue": "9223372036854775807",
1002
+ "cache": "1",
1003
+ "cycle": false
1004
+ }
1005
+ },
1006
+ "run_id": {
1007
+ "name": "run_id",
1008
+ "type": "text",
1009
+ "primaryKey": false,
1010
+ "notNull": true
1011
+ },
1012
+ "key": {
1013
+ "name": "key",
1014
+ "type": "text",
1015
+ "primaryKey": false,
1016
+ "notNull": true
1017
+ },
1018
+ "workflow_id": {
1019
+ "name": "workflow_id",
1020
+ "type": "text",
1021
+ "primaryKey": false,
1022
+ "notNull": true
1023
+ },
1024
+ "channel": {
1025
+ "name": "channel",
1026
+ "type": "text",
1027
+ "primaryKey": false,
1028
+ "notNull": true
1029
+ },
1030
+ "idempotency_key": {
1031
+ "name": "idempotency_key",
1032
+ "type": "text",
1033
+ "primaryKey": false,
1034
+ "notNull": true
1035
+ },
1036
+ "status": {
1037
+ "name": "status",
1038
+ "type": "text",
1039
+ "primaryKey": false,
1040
+ "notNull": true
1041
+ },
1042
+ "external_id": {
1043
+ "name": "external_id",
1044
+ "type": "text",
1045
+ "primaryKey": false,
1046
+ "notNull": false
1047
+ },
1048
+ "approval_id": {
1049
+ "name": "approval_id",
1050
+ "type": "bigint",
1051
+ "primaryKey": false,
1052
+ "notNull": false
1053
+ },
1054
+ "record_type": {
1055
+ "name": "record_type",
1056
+ "type": "text",
1057
+ "primaryKey": false,
1058
+ "notNull": false
1059
+ },
1060
+ "record_id": {
1061
+ "name": "record_id",
1062
+ "type": "text",
1063
+ "primaryKey": false,
1064
+ "notNull": false
1065
+ },
1066
+ "request": {
1067
+ "name": "request",
1068
+ "type": "jsonb",
1069
+ "primaryKey": false,
1070
+ "notNull": false
1071
+ },
1072
+ "response": {
1073
+ "name": "response",
1074
+ "type": "jsonb",
1075
+ "primaryKey": false,
1076
+ "notNull": false
1077
+ },
1078
+ "started_at": {
1079
+ "name": "started_at",
1080
+ "type": "timestamp with time zone",
1081
+ "primaryKey": false,
1082
+ "notNull": true,
1083
+ "default": "now()"
1084
+ },
1085
+ "finished_at": {
1086
+ "name": "finished_at",
1087
+ "type": "timestamp with time zone",
1088
+ "primaryKey": false,
1089
+ "notNull": false
1090
+ }
1091
+ },
1092
+ "indexes": {
1093
+ "hf_action_log_run_key_uq": {
1094
+ "name": "hf_action_log_run_key_uq",
1095
+ "columns": [
1096
+ {
1097
+ "expression": "run_id",
1098
+ "isExpression": false,
1099
+ "asc": true,
1100
+ "nulls": "last"
1101
+ },
1102
+ {
1103
+ "expression": "key",
1104
+ "isExpression": false,
1105
+ "asc": true,
1106
+ "nulls": "last"
1107
+ }
1108
+ ],
1109
+ "isUnique": true,
1110
+ "concurrently": false,
1111
+ "method": "btree",
1112
+ "with": {}
1113
+ }
1114
+ },
1115
+ "foreignKeys": {},
1116
+ "compositePrimaryKeys": {},
1117
+ "uniqueConstraints": {},
1118
+ "policies": {},
1119
+ "checkConstraints": {},
1120
+ "isRLSEnabled": false
1121
+ },
1122
+ "public.hf_budget_period": {
1123
+ "name": "hf_budget_period",
1124
+ "schema": "",
1125
+ "columns": {
1126
+ "period": {
1127
+ "name": "period",
1128
+ "type": "text",
1129
+ "primaryKey": true,
1130
+ "notNull": true
1131
+ },
1132
+ "budget_usd": {
1133
+ "name": "budget_usd",
1134
+ "type": "numeric(12, 4)",
1135
+ "primaryKey": false,
1136
+ "notNull": true
1137
+ },
1138
+ "spent_usd": {
1139
+ "name": "spent_usd",
1140
+ "type": "numeric(12, 4)",
1141
+ "primaryKey": false,
1142
+ "notNull": true,
1143
+ "default": "'0'"
1144
+ },
1145
+ "created_at": {
1146
+ "name": "created_at",
1147
+ "type": "timestamp with time zone",
1148
+ "primaryKey": false,
1149
+ "notNull": true,
1150
+ "default": "now()"
1151
+ }
1152
+ },
1153
+ "indexes": {},
1154
+ "foreignKeys": {},
1155
+ "compositePrimaryKeys": {},
1156
+ "uniqueConstraints": {},
1157
+ "policies": {},
1158
+ "checkConstraints": {
1159
+ "hf_budget_period_spent_non_negative": {
1160
+ "name": "hf_budget_period_spent_non_negative",
1161
+ "value": "\"hf_budget_period\".\"spent_usd\" >= 0"
1162
+ }
1163
+ },
1164
+ "isRLSEnabled": false
1165
+ },
1166
+ "public.hf_llm_call": {
1167
+ "name": "hf_llm_call",
1168
+ "schema": "",
1169
+ "columns": {
1170
+ "id": {
1171
+ "name": "id",
1172
+ "type": "bigint",
1173
+ "primaryKey": true,
1174
+ "notNull": true,
1175
+ "identity": {
1176
+ "type": "always",
1177
+ "name": "hf_llm_call_id_seq",
1178
+ "schema": "public",
1179
+ "increment": "1",
1180
+ "startWith": "1",
1181
+ "minValue": "1",
1182
+ "maxValue": "9223372036854775807",
1183
+ "cache": "1",
1184
+ "cycle": false
1185
+ }
1186
+ },
1187
+ "run_id": {
1188
+ "name": "run_id",
1189
+ "type": "text",
1190
+ "primaryKey": false,
1191
+ "notNull": true
1192
+ },
1193
+ "key": {
1194
+ "name": "key",
1195
+ "type": "text",
1196
+ "primaryKey": false,
1197
+ "notNull": true
1198
+ },
1199
+ "workflow_id": {
1200
+ "name": "workflow_id",
1201
+ "type": "text",
1202
+ "primaryKey": false,
1203
+ "notNull": true
1204
+ },
1205
+ "period": {
1206
+ "name": "period",
1207
+ "type": "text",
1208
+ "primaryKey": false,
1209
+ "notNull": true
1210
+ },
1211
+ "step_name": {
1212
+ "name": "step_name",
1213
+ "type": "text",
1214
+ "primaryKey": false,
1215
+ "notNull": false
1216
+ },
1217
+ "prompt_name": {
1218
+ "name": "prompt_name",
1219
+ "type": "text",
1220
+ "primaryKey": false,
1221
+ "notNull": false
1222
+ },
1223
+ "prompt_hash": {
1224
+ "name": "prompt_hash",
1225
+ "type": "text",
1226
+ "primaryKey": false,
1227
+ "notNull": false
1228
+ },
1229
+ "input_hash": {
1230
+ "name": "input_hash",
1231
+ "type": "text",
1232
+ "primaryKey": false,
1233
+ "notNull": true
1234
+ },
1235
+ "model": {
1236
+ "name": "model",
1237
+ "type": "text",
1238
+ "primaryKey": false,
1239
+ "notNull": false
1240
+ },
1241
+ "status": {
1242
+ "name": "status",
1243
+ "type": "text",
1244
+ "primaryKey": false,
1245
+ "notNull": true
1246
+ },
1247
+ "input": {
1248
+ "name": "input",
1249
+ "type": "jsonb",
1250
+ "primaryKey": false,
1251
+ "notNull": false
1252
+ },
1253
+ "output": {
1254
+ "name": "output",
1255
+ "type": "jsonb",
1256
+ "primaryKey": false,
1257
+ "notNull": false
1258
+ },
1259
+ "tokens_in": {
1260
+ "name": "tokens_in",
1261
+ "type": "integer",
1262
+ "primaryKey": false,
1263
+ "notNull": false
1264
+ },
1265
+ "tokens_out": {
1266
+ "name": "tokens_out",
1267
+ "type": "integer",
1268
+ "primaryKey": false,
1269
+ "notNull": false
1270
+ },
1271
+ "estimated_cost_usd": {
1272
+ "name": "estimated_cost_usd",
1273
+ "type": "numeric(12, 6)",
1274
+ "primaryKey": false,
1275
+ "notNull": true
1276
+ },
1277
+ "cost_usd": {
1278
+ "name": "cost_usd",
1279
+ "type": "numeric(12, 6)",
1280
+ "primaryKey": false,
1281
+ "notNull": false
1282
+ },
1283
+ "possible_double_charge": {
1284
+ "name": "possible_double_charge",
1285
+ "type": "boolean",
1286
+ "primaryKey": false,
1287
+ "notNull": true,
1288
+ "default": false
1289
+ },
1290
+ "latency_ms": {
1291
+ "name": "latency_ms",
1292
+ "type": "integer",
1293
+ "primaryKey": false,
1294
+ "notNull": false
1295
+ },
1296
+ "trace_id": {
1297
+ "name": "trace_id",
1298
+ "type": "text",
1299
+ "primaryKey": false,
1300
+ "notNull": false
1301
+ },
1302
+ "started_at": {
1303
+ "name": "started_at",
1304
+ "type": "timestamp with time zone",
1305
+ "primaryKey": false,
1306
+ "notNull": true,
1307
+ "default": "now()"
1308
+ },
1309
+ "finished_at": {
1310
+ "name": "finished_at",
1311
+ "type": "timestamp with time zone",
1312
+ "primaryKey": false,
1313
+ "notNull": false
1314
+ }
1315
+ },
1316
+ "indexes": {
1317
+ "hf_llm_call_run_key_uq": {
1318
+ "name": "hf_llm_call_run_key_uq",
1319
+ "columns": [
1320
+ {
1321
+ "expression": "run_id",
1322
+ "isExpression": false,
1323
+ "asc": true,
1324
+ "nulls": "last"
1325
+ },
1326
+ {
1327
+ "expression": "key",
1328
+ "isExpression": false,
1329
+ "asc": true,
1330
+ "nulls": "last"
1331
+ }
1332
+ ],
1333
+ "isUnique": true,
1334
+ "concurrently": false,
1335
+ "method": "btree",
1336
+ "with": {}
1337
+ },
1338
+ "hf_llm_call_period_status_idx": {
1339
+ "name": "hf_llm_call_period_status_idx",
1340
+ "columns": [
1341
+ {
1342
+ "expression": "period",
1343
+ "isExpression": false,
1344
+ "asc": true,
1345
+ "nulls": "last"
1346
+ },
1347
+ {
1348
+ "expression": "status",
1349
+ "isExpression": false,
1350
+ "asc": true,
1351
+ "nulls": "last"
1352
+ }
1353
+ ],
1354
+ "isUnique": false,
1355
+ "concurrently": false,
1356
+ "method": "btree",
1357
+ "with": {}
1358
+ }
1359
+ },
1360
+ "foreignKeys": {},
1361
+ "compositePrimaryKeys": {},
1362
+ "uniqueConstraints": {},
1363
+ "policies": {},
1364
+ "checkConstraints": {},
1365
+ "isRLSEnabled": false
1366
+ },
1367
+ "public.hf_activity": {
1368
+ "name": "hf_activity",
1369
+ "schema": "",
1370
+ "columns": {
1371
+ "id": {
1372
+ "name": "id",
1373
+ "type": "bigint",
1374
+ "primaryKey": true,
1375
+ "notNull": true,
1376
+ "identity": {
1377
+ "type": "always",
1378
+ "name": "hf_activity_id_seq",
1379
+ "schema": "public",
1380
+ "increment": "1",
1381
+ "startWith": "1",
1382
+ "minValue": "1",
1383
+ "maxValue": "9223372036854775807",
1384
+ "cache": "1",
1385
+ "cycle": false
1386
+ }
1387
+ },
1388
+ "record_type": {
1389
+ "name": "record_type",
1390
+ "type": "text",
1391
+ "primaryKey": false,
1392
+ "notNull": true
1393
+ },
1394
+ "record_id": {
1395
+ "name": "record_id",
1396
+ "type": "text",
1397
+ "primaryKey": false,
1398
+ "notNull": true
1399
+ },
1400
+ "kind": {
1401
+ "name": "kind",
1402
+ "type": "text",
1403
+ "primaryKey": false,
1404
+ "notNull": true
1405
+ },
1406
+ "actor_id": {
1407
+ "name": "actor_id",
1408
+ "type": "text",
1409
+ "primaryKey": false,
1410
+ "notNull": false
1411
+ },
1412
+ "body": {
1413
+ "name": "body",
1414
+ "type": "text",
1415
+ "primaryKey": false,
1416
+ "notNull": false
1417
+ },
1418
+ "meta": {
1419
+ "name": "meta",
1420
+ "type": "jsonb",
1421
+ "primaryKey": false,
1422
+ "notNull": false
1423
+ },
1424
+ "run_id": {
1425
+ "name": "run_id",
1426
+ "type": "text",
1427
+ "primaryKey": false,
1428
+ "notNull": false
1429
+ },
1430
+ "at": {
1431
+ "name": "at",
1432
+ "type": "timestamp with time zone",
1433
+ "primaryKey": false,
1434
+ "notNull": true,
1435
+ "default": "now()"
1436
+ }
1437
+ },
1438
+ "indexes": {
1439
+ "hf_activity_record_idx": {
1440
+ "name": "hf_activity_record_idx",
1441
+ "columns": [
1442
+ {
1443
+ "expression": "record_type",
1444
+ "isExpression": false,
1445
+ "asc": true,
1446
+ "nulls": "last"
1447
+ },
1448
+ {
1449
+ "expression": "record_id",
1450
+ "isExpression": false,
1451
+ "asc": true,
1452
+ "nulls": "last"
1453
+ }
1454
+ ],
1455
+ "isUnique": false,
1456
+ "concurrently": false,
1457
+ "method": "btree",
1458
+ "with": {}
1459
+ }
1460
+ },
1461
+ "foreignKeys": {},
1462
+ "compositePrimaryKeys": {},
1463
+ "uniqueConstraints": {},
1464
+ "policies": {},
1465
+ "checkConstraints": {},
1466
+ "isRLSEnabled": false
1467
+ },
1468
+ "public.hf_label": {
1469
+ "name": "hf_label",
1470
+ "schema": "",
1471
+ "columns": {
1472
+ "id": {
1473
+ "name": "id",
1474
+ "type": "bigint",
1475
+ "primaryKey": true,
1476
+ "notNull": true,
1477
+ "identity": {
1478
+ "type": "always",
1479
+ "name": "hf_label_id_seq",
1480
+ "schema": "public",
1481
+ "increment": "1",
1482
+ "startWith": "1",
1483
+ "minValue": "1",
1484
+ "maxValue": "9223372036854775807",
1485
+ "cache": "1",
1486
+ "cycle": false
1487
+ }
1488
+ },
1489
+ "record_type": {
1490
+ "name": "record_type",
1491
+ "type": "text",
1492
+ "primaryKey": false,
1493
+ "notNull": true
1494
+ },
1495
+ "record_id": {
1496
+ "name": "record_id",
1497
+ "type": "text",
1498
+ "primaryKey": false,
1499
+ "notNull": true
1500
+ },
1501
+ "target": {
1502
+ "name": "target",
1503
+ "type": "text",
1504
+ "primaryKey": false,
1505
+ "notNull": true
1506
+ },
1507
+ "target_id": {
1508
+ "name": "target_id",
1509
+ "type": "text",
1510
+ "primaryKey": false,
1511
+ "notNull": false
1512
+ },
1513
+ "value": {
1514
+ "name": "value",
1515
+ "type": "text",
1516
+ "primaryKey": false,
1517
+ "notNull": true
1518
+ },
1519
+ "correction": {
1520
+ "name": "correction",
1521
+ "type": "jsonb",
1522
+ "primaryKey": false,
1523
+ "notNull": false
1524
+ },
1525
+ "user_id": {
1526
+ "name": "user_id",
1527
+ "type": "text",
1528
+ "primaryKey": false,
1529
+ "notNull": false
1530
+ },
1531
+ "created_at": {
1532
+ "name": "created_at",
1533
+ "type": "timestamp with time zone",
1534
+ "primaryKey": false,
1535
+ "notNull": true,
1536
+ "default": "now()"
1537
+ }
1538
+ },
1539
+ "indexes": {
1540
+ "hf_label_record_idx": {
1541
+ "name": "hf_label_record_idx",
1542
+ "columns": [
1543
+ {
1544
+ "expression": "record_type",
1545
+ "isExpression": false,
1546
+ "asc": true,
1547
+ "nulls": "last"
1548
+ },
1549
+ {
1550
+ "expression": "record_id",
1551
+ "isExpression": false,
1552
+ "asc": true,
1553
+ "nulls": "last"
1554
+ }
1555
+ ],
1556
+ "isUnique": false,
1557
+ "concurrently": false,
1558
+ "method": "btree",
1559
+ "with": {}
1560
+ }
1561
+ },
1562
+ "foreignKeys": {},
1563
+ "compositePrimaryKeys": {},
1564
+ "uniqueConstraints": {},
1565
+ "policies": {},
1566
+ "checkConstraints": {},
1567
+ "isRLSEnabled": false
1568
+ },
1569
+ "public.hf_outcome": {
1570
+ "name": "hf_outcome",
1571
+ "schema": "",
1572
+ "columns": {
1573
+ "id": {
1574
+ "name": "id",
1575
+ "type": "bigint",
1576
+ "primaryKey": true,
1577
+ "notNull": true,
1578
+ "identity": {
1579
+ "type": "always",
1580
+ "name": "hf_outcome_id_seq",
1581
+ "schema": "public",
1582
+ "increment": "1",
1583
+ "startWith": "1",
1584
+ "minValue": "1",
1585
+ "maxValue": "9223372036854775807",
1586
+ "cache": "1",
1587
+ "cycle": false
1588
+ }
1589
+ },
1590
+ "record_type": {
1591
+ "name": "record_type",
1592
+ "type": "text",
1593
+ "primaryKey": false,
1594
+ "notNull": true
1595
+ },
1596
+ "record_id": {
1597
+ "name": "record_id",
1598
+ "type": "text",
1599
+ "primaryKey": false,
1600
+ "notNull": true
1601
+ },
1602
+ "outcome": {
1603
+ "name": "outcome",
1604
+ "type": "text",
1605
+ "primaryKey": false,
1606
+ "notNull": true
1607
+ },
1608
+ "at": {
1609
+ "name": "at",
1610
+ "type": "timestamp with time zone",
1611
+ "primaryKey": false,
1612
+ "notNull": true,
1613
+ "default": "now()"
1614
+ },
1615
+ "notes": {
1616
+ "name": "notes",
1617
+ "type": "text",
1618
+ "primaryKey": false,
1619
+ "notNull": false
1620
+ }
1621
+ },
1622
+ "indexes": {
1623
+ "hf_outcome_record_idx": {
1624
+ "name": "hf_outcome_record_idx",
1625
+ "columns": [
1626
+ {
1627
+ "expression": "record_type",
1628
+ "isExpression": false,
1629
+ "asc": true,
1630
+ "nulls": "last"
1631
+ },
1632
+ {
1633
+ "expression": "record_id",
1634
+ "isExpression": false,
1635
+ "asc": true,
1636
+ "nulls": "last"
1637
+ }
1638
+ ],
1639
+ "isUnique": false,
1640
+ "concurrently": false,
1641
+ "method": "btree",
1642
+ "with": {}
1643
+ }
1644
+ },
1645
+ "foreignKeys": {},
1646
+ "compositePrimaryKeys": {},
1647
+ "uniqueConstraints": {},
1648
+ "policies": {},
1649
+ "checkConstraints": {},
1650
+ "isRLSEnabled": false
1651
+ },
1652
+ "public.hf_record_link": {
1653
+ "name": "hf_record_link",
1654
+ "schema": "",
1655
+ "columns": {
1656
+ "id": {
1657
+ "name": "id",
1658
+ "type": "bigint",
1659
+ "primaryKey": true,
1660
+ "notNull": true,
1661
+ "identity": {
1662
+ "type": "always",
1663
+ "name": "hf_record_link_id_seq",
1664
+ "schema": "public",
1665
+ "increment": "1",
1666
+ "startWith": "1",
1667
+ "minValue": "1",
1668
+ "maxValue": "9223372036854775807",
1669
+ "cache": "1",
1670
+ "cycle": false
1671
+ }
1672
+ },
1673
+ "source_record_id": {
1674
+ "name": "source_record_id",
1675
+ "type": "bigint",
1676
+ "primaryKey": false,
1677
+ "notNull": true
1678
+ },
1679
+ "record_type": {
1680
+ "name": "record_type",
1681
+ "type": "text",
1682
+ "primaryKey": false,
1683
+ "notNull": true
1684
+ },
1685
+ "record_id": {
1686
+ "name": "record_id",
1687
+ "type": "text",
1688
+ "primaryKey": false,
1689
+ "notNull": true
1690
+ },
1691
+ "confidence": {
1692
+ "name": "confidence",
1693
+ "type": "double precision",
1694
+ "primaryKey": false,
1695
+ "notNull": false
1696
+ },
1697
+ "method": {
1698
+ "name": "method",
1699
+ "type": "text",
1700
+ "primaryKey": false,
1701
+ "notNull": true
1702
+ },
1703
+ "decided_by": {
1704
+ "name": "decided_by",
1705
+ "type": "text",
1706
+ "primaryKey": false,
1707
+ "notNull": false
1708
+ },
1709
+ "decided_at": {
1710
+ "name": "decided_at",
1711
+ "type": "timestamp with time zone",
1712
+ "primaryKey": false,
1713
+ "notNull": false
1714
+ }
1715
+ },
1716
+ "indexes": {
1717
+ "hf_record_link_source_record_uq": {
1718
+ "name": "hf_record_link_source_record_uq",
1719
+ "columns": [
1720
+ {
1721
+ "expression": "source_record_id",
1722
+ "isExpression": false,
1723
+ "asc": true,
1724
+ "nulls": "last"
1725
+ }
1726
+ ],
1727
+ "isUnique": true,
1728
+ "concurrently": false,
1729
+ "method": "btree",
1730
+ "with": {}
1731
+ },
1732
+ "hf_record_link_record_idx": {
1733
+ "name": "hf_record_link_record_idx",
1734
+ "columns": [
1735
+ {
1736
+ "expression": "record_type",
1737
+ "isExpression": false,
1738
+ "asc": true,
1739
+ "nulls": "last"
1740
+ },
1741
+ {
1742
+ "expression": "record_id",
1743
+ "isExpression": false,
1744
+ "asc": true,
1745
+ "nulls": "last"
1746
+ }
1747
+ ],
1748
+ "isUnique": false,
1749
+ "concurrently": false,
1750
+ "method": "btree",
1751
+ "with": {}
1752
+ }
1753
+ },
1754
+ "foreignKeys": {},
1755
+ "compositePrimaryKeys": {},
1756
+ "uniqueConstraints": {},
1757
+ "policies": {},
1758
+ "checkConstraints": {},
1759
+ "isRLSEnabled": false
1760
+ },
1761
+ "public.hf_score": {
1762
+ "name": "hf_score",
1763
+ "schema": "",
1764
+ "columns": {
1765
+ "id": {
1766
+ "name": "id",
1767
+ "type": "bigint",
1768
+ "primaryKey": true,
1769
+ "notNull": true,
1770
+ "identity": {
1771
+ "type": "always",
1772
+ "name": "hf_score_id_seq",
1773
+ "schema": "public",
1774
+ "increment": "1",
1775
+ "startWith": "1",
1776
+ "minValue": "1",
1777
+ "maxValue": "9223372036854775807",
1778
+ "cache": "1",
1779
+ "cycle": false
1780
+ }
1781
+ },
1782
+ "record_type": {
1783
+ "name": "record_type",
1784
+ "type": "text",
1785
+ "primaryKey": false,
1786
+ "notNull": true
1787
+ },
1788
+ "record_id": {
1789
+ "name": "record_id",
1790
+ "type": "text",
1791
+ "primaryKey": false,
1792
+ "notNull": true
1793
+ },
1794
+ "spec_version": {
1795
+ "name": "spec_version",
1796
+ "type": "integer",
1797
+ "primaryKey": false,
1798
+ "notNull": true
1799
+ },
1800
+ "score": {
1801
+ "name": "score",
1802
+ "type": "double precision",
1803
+ "primaryKey": false,
1804
+ "notNull": true
1805
+ },
1806
+ "explanation": {
1807
+ "name": "explanation",
1808
+ "type": "text",
1809
+ "primaryKey": false,
1810
+ "notNull": false
1811
+ },
1812
+ "llm_call_id": {
1813
+ "name": "llm_call_id",
1814
+ "type": "bigint",
1815
+ "primaryKey": false,
1816
+ "notNull": false
1817
+ },
1818
+ "created_at": {
1819
+ "name": "created_at",
1820
+ "type": "timestamp with time zone",
1821
+ "primaryKey": false,
1822
+ "notNull": true,
1823
+ "default": "now()"
1824
+ }
1825
+ },
1826
+ "indexes": {
1827
+ "hf_score_record_idx": {
1828
+ "name": "hf_score_record_idx",
1829
+ "columns": [
1830
+ {
1831
+ "expression": "record_type",
1832
+ "isExpression": false,
1833
+ "asc": true,
1834
+ "nulls": "last"
1835
+ },
1836
+ {
1837
+ "expression": "record_id",
1838
+ "isExpression": false,
1839
+ "asc": true,
1840
+ "nulls": "last"
1841
+ }
1842
+ ],
1843
+ "isUnique": false,
1844
+ "concurrently": false,
1845
+ "method": "btree",
1846
+ "with": {}
1847
+ }
1848
+ },
1849
+ "foreignKeys": {},
1850
+ "compositePrimaryKeys": {},
1851
+ "uniqueConstraints": {},
1852
+ "policies": {},
1853
+ "checkConstraints": {},
1854
+ "isRLSEnabled": false
1855
+ },
1856
+ "public.hf_source_record": {
1857
+ "name": "hf_source_record",
1858
+ "schema": "",
1859
+ "columns": {
1860
+ "id": {
1861
+ "name": "id",
1862
+ "type": "bigint",
1863
+ "primaryKey": true,
1864
+ "notNull": true,
1865
+ "identity": {
1866
+ "type": "always",
1867
+ "name": "hf_source_record_id_seq",
1868
+ "schema": "public",
1869
+ "increment": "1",
1870
+ "startWith": "1",
1871
+ "minValue": "1",
1872
+ "maxValue": "9223372036854775807",
1873
+ "cache": "1",
1874
+ "cycle": false
1875
+ }
1876
+ },
1877
+ "source": {
1878
+ "name": "source",
1879
+ "type": "text",
1880
+ "primaryKey": false,
1881
+ "notNull": true
1882
+ },
1883
+ "external_id": {
1884
+ "name": "external_id",
1885
+ "type": "text",
1886
+ "primaryKey": false,
1887
+ "notNull": true
1888
+ },
1889
+ "payload": {
1890
+ "name": "payload",
1891
+ "type": "jsonb",
1892
+ "primaryKey": false,
1893
+ "notNull": true
1894
+ },
1895
+ "payload_hash": {
1896
+ "name": "payload_hash",
1897
+ "type": "text",
1898
+ "primaryKey": false,
1899
+ "notNull": true
1900
+ },
1901
+ "status": {
1902
+ "name": "status",
1903
+ "type": "text",
1904
+ "primaryKey": false,
1905
+ "notNull": true,
1906
+ "default": "'new'"
1907
+ },
1908
+ "attempts": {
1909
+ "name": "attempts",
1910
+ "type": "integer",
1911
+ "primaryKey": false,
1912
+ "notNull": true,
1913
+ "default": 0
1914
+ },
1915
+ "error": {
1916
+ "name": "error",
1917
+ "type": "text",
1918
+ "primaryKey": false,
1919
+ "notNull": false
1920
+ },
1921
+ "run_id": {
1922
+ "name": "run_id",
1923
+ "type": "bigint",
1924
+ "primaryKey": false,
1925
+ "notNull": false
1926
+ },
1927
+ "first_seen": {
1928
+ "name": "first_seen",
1929
+ "type": "timestamp with time zone",
1930
+ "primaryKey": false,
1931
+ "notNull": true,
1932
+ "default": "now()"
1933
+ },
1934
+ "last_seen": {
1935
+ "name": "last_seen",
1936
+ "type": "timestamp with time zone",
1937
+ "primaryKey": false,
1938
+ "notNull": true,
1939
+ "default": "now()"
1940
+ }
1941
+ },
1942
+ "indexes": {
1943
+ "hf_source_record_source_external_uq": {
1944
+ "name": "hf_source_record_source_external_uq",
1945
+ "columns": [
1946
+ {
1947
+ "expression": "source",
1948
+ "isExpression": false,
1949
+ "asc": true,
1950
+ "nulls": "last"
1951
+ },
1952
+ {
1953
+ "expression": "external_id",
1954
+ "isExpression": false,
1955
+ "asc": true,
1956
+ "nulls": "last"
1957
+ }
1958
+ ],
1959
+ "isUnique": true,
1960
+ "concurrently": false,
1961
+ "method": "btree",
1962
+ "with": {}
1963
+ },
1964
+ "hf_source_record_status_idx": {
1965
+ "name": "hf_source_record_status_idx",
1966
+ "columns": [
1967
+ {
1968
+ "expression": "status",
1969
+ "isExpression": false,
1970
+ "asc": true,
1971
+ "nulls": "last"
1972
+ }
1973
+ ],
1974
+ "isUnique": false,
1975
+ "concurrently": false,
1976
+ "method": "btree",
1977
+ "with": {}
1978
+ }
1979
+ },
1980
+ "foreignKeys": {},
1981
+ "compositePrimaryKeys": {},
1982
+ "uniqueConstraints": {},
1983
+ "policies": {},
1984
+ "checkConstraints": {},
1985
+ "isRLSEnabled": false
1986
+ },
1987
+ "public.hf_source_run": {
1988
+ "name": "hf_source_run",
1989
+ "schema": "",
1990
+ "columns": {
1991
+ "id": {
1992
+ "name": "id",
1993
+ "type": "bigint",
1994
+ "primaryKey": true,
1995
+ "notNull": true,
1996
+ "identity": {
1997
+ "type": "always",
1998
+ "name": "hf_source_run_id_seq",
1999
+ "schema": "public",
2000
+ "increment": "1",
2001
+ "startWith": "1",
2002
+ "minValue": "1",
2003
+ "maxValue": "9223372036854775807",
2004
+ "cache": "1",
2005
+ "cycle": false
2006
+ }
2007
+ },
2008
+ "source": {
2009
+ "name": "source",
2010
+ "type": "text",
2011
+ "primaryKey": false,
2012
+ "notNull": true
2013
+ },
2014
+ "started_at": {
2015
+ "name": "started_at",
2016
+ "type": "timestamp with time zone",
2017
+ "primaryKey": false,
2018
+ "notNull": true,
2019
+ "default": "now()"
2020
+ },
2021
+ "finished_at": {
2022
+ "name": "finished_at",
2023
+ "type": "timestamp with time zone",
2024
+ "primaryKey": false,
2025
+ "notNull": false
2026
+ },
2027
+ "status": {
2028
+ "name": "status",
2029
+ "type": "text",
2030
+ "primaryKey": false,
2031
+ "notNull": true
2032
+ },
2033
+ "rows_in": {
2034
+ "name": "rows_in",
2035
+ "type": "integer",
2036
+ "primaryKey": false,
2037
+ "notNull": true,
2038
+ "default": 0
2039
+ },
2040
+ "rows_new": {
2041
+ "name": "rows_new",
2042
+ "type": "integer",
2043
+ "primaryKey": false,
2044
+ "notNull": true,
2045
+ "default": 0
2046
+ },
2047
+ "rows_changed": {
2048
+ "name": "rows_changed",
2049
+ "type": "integer",
2050
+ "primaryKey": false,
2051
+ "notNull": true,
2052
+ "default": 0
2053
+ },
2054
+ "error": {
2055
+ "name": "error",
2056
+ "type": "text",
2057
+ "primaryKey": false,
2058
+ "notNull": false
2059
+ }
2060
+ },
2061
+ "indexes": {},
2062
+ "foreignKeys": {},
2063
+ "compositePrimaryKeys": {},
2064
+ "uniqueConstraints": {},
2065
+ "policies": {},
2066
+ "checkConstraints": {},
2067
+ "isRLSEnabled": false
2068
+ },
2069
+ "public.hf_task": {
2070
+ "name": "hf_task",
2071
+ "schema": "",
2072
+ "columns": {
2073
+ "id": {
2074
+ "name": "id",
2075
+ "type": "bigint",
2076
+ "primaryKey": true,
2077
+ "notNull": true,
2078
+ "identity": {
2079
+ "type": "always",
2080
+ "name": "hf_task_id_seq",
2081
+ "schema": "public",
2082
+ "increment": "1",
2083
+ "startWith": "1",
2084
+ "minValue": "1",
2085
+ "maxValue": "9223372036854775807",
2086
+ "cache": "1",
2087
+ "cycle": false
2088
+ }
2089
+ },
2090
+ "record_type": {
2091
+ "name": "record_type",
2092
+ "type": "text",
2093
+ "primaryKey": false,
2094
+ "notNull": true
2095
+ },
2096
+ "record_id": {
2097
+ "name": "record_id",
2098
+ "type": "text",
2099
+ "primaryKey": false,
2100
+ "notNull": true
2101
+ },
2102
+ "title": {
2103
+ "name": "title",
2104
+ "type": "text",
2105
+ "primaryKey": false,
2106
+ "notNull": true
2107
+ },
2108
+ "due_at": {
2109
+ "name": "due_at",
2110
+ "type": "timestamp with time zone",
2111
+ "primaryKey": false,
2112
+ "notNull": false
2113
+ },
2114
+ "owner_id": {
2115
+ "name": "owner_id",
2116
+ "type": "text",
2117
+ "primaryKey": false,
2118
+ "notNull": false
2119
+ },
2120
+ "done_at": {
2121
+ "name": "done_at",
2122
+ "type": "timestamp with time zone",
2123
+ "primaryKey": false,
2124
+ "notNull": false
2125
+ },
2126
+ "cancelled_at": {
2127
+ "name": "cancelled_at",
2128
+ "type": "timestamp with time zone",
2129
+ "primaryKey": false,
2130
+ "notNull": false
2131
+ },
2132
+ "origin": {
2133
+ "name": "origin",
2134
+ "type": "text",
2135
+ "primaryKey": false,
2136
+ "notNull": true
2137
+ },
2138
+ "origin_ref": {
2139
+ "name": "origin_ref",
2140
+ "type": "text",
2141
+ "primaryKey": false,
2142
+ "notNull": false
2143
+ },
2144
+ "created_at": {
2145
+ "name": "created_at",
2146
+ "type": "timestamp with time zone",
2147
+ "primaryKey": false,
2148
+ "notNull": true,
2149
+ "default": "now()"
2150
+ }
2151
+ },
2152
+ "indexes": {
2153
+ "hf_task_record_idx": {
2154
+ "name": "hf_task_record_idx",
2155
+ "columns": [
2156
+ {
2157
+ "expression": "record_type",
2158
+ "isExpression": false,
2159
+ "asc": true,
2160
+ "nulls": "last"
2161
+ },
2162
+ {
2163
+ "expression": "record_id",
2164
+ "isExpression": false,
2165
+ "asc": true,
2166
+ "nulls": "last"
2167
+ }
2168
+ ],
2169
+ "isUnique": false,
2170
+ "concurrently": false,
2171
+ "method": "btree",
2172
+ "with": {}
2173
+ },
2174
+ "hf_task_origin_ref_uq": {
2175
+ "name": "hf_task_origin_ref_uq",
2176
+ "columns": [
2177
+ {
2178
+ "expression": "origin",
2179
+ "isExpression": false,
2180
+ "asc": true,
2181
+ "nulls": "last"
2182
+ },
2183
+ {
2184
+ "expression": "origin_ref",
2185
+ "isExpression": false,
2186
+ "asc": true,
2187
+ "nulls": "last"
2188
+ }
2189
+ ],
2190
+ "isUnique": true,
2191
+ "where": "\"hf_task\".\"origin_ref\" IS NOT NULL",
2192
+ "concurrently": false,
2193
+ "method": "btree",
2194
+ "with": {}
2195
+ }
2196
+ },
2197
+ "foreignKeys": {},
2198
+ "compositePrimaryKeys": {},
2199
+ "uniqueConstraints": {},
2200
+ "policies": {},
2201
+ "checkConstraints": {},
2202
+ "isRLSEnabled": false
2203
+ },
2204
+ "public.hf_run": {
2205
+ "name": "hf_run",
2206
+ "schema": "",
2207
+ "columns": {
2208
+ "run_id": {
2209
+ "name": "run_id",
2210
+ "type": "text",
2211
+ "primaryKey": true,
2212
+ "notNull": true
2213
+ },
2214
+ "flow": {
2215
+ "name": "flow",
2216
+ "type": "text",
2217
+ "primaryKey": false,
2218
+ "notNull": true
2219
+ },
2220
+ "input": {
2221
+ "name": "input",
2222
+ "type": "jsonb",
2223
+ "primaryKey": false,
2224
+ "notNull": false
2225
+ },
2226
+ "status": {
2227
+ "name": "status",
2228
+ "type": "text",
2229
+ "primaryKey": false,
2230
+ "notNull": true
2231
+ },
2232
+ "attempt": {
2233
+ "name": "attempt",
2234
+ "type": "integer",
2235
+ "primaryKey": false,
2236
+ "notNull": true,
2237
+ "default": 1
2238
+ },
2239
+ "current_workflow_id": {
2240
+ "name": "current_workflow_id",
2241
+ "type": "text",
2242
+ "primaryKey": false,
2243
+ "notNull": true
2244
+ },
2245
+ "version": {
2246
+ "name": "version",
2247
+ "type": "text",
2248
+ "primaryKey": false,
2249
+ "notNull": false
2250
+ },
2251
+ "record_type": {
2252
+ "name": "record_type",
2253
+ "type": "text",
2254
+ "primaryKey": false,
2255
+ "notNull": false
2256
+ },
2257
+ "record_id": {
2258
+ "name": "record_id",
2259
+ "type": "text",
2260
+ "primaryKey": false,
2261
+ "notNull": false
2262
+ },
2263
+ "error": {
2264
+ "name": "error",
2265
+ "type": "text",
2266
+ "primaryKey": false,
2267
+ "notNull": false
2268
+ },
2269
+ "started_at": {
2270
+ "name": "started_at",
2271
+ "type": "timestamp with time zone",
2272
+ "primaryKey": false,
2273
+ "notNull": true,
2274
+ "default": "now()"
2275
+ },
2276
+ "finished_at": {
2277
+ "name": "finished_at",
2278
+ "type": "timestamp with time zone",
2279
+ "primaryKey": false,
2280
+ "notNull": false
2281
+ }
2282
+ },
2283
+ "indexes": {
2284
+ "hf_run_status_idx": {
2285
+ "name": "hf_run_status_idx",
2286
+ "columns": [
2287
+ {
2288
+ "expression": "status",
2289
+ "isExpression": false,
2290
+ "asc": true,
2291
+ "nulls": "last"
2292
+ }
2293
+ ],
2294
+ "isUnique": false,
2295
+ "concurrently": false,
2296
+ "method": "btree",
2297
+ "with": {}
2298
+ },
2299
+ "hf_run_record_idx": {
2300
+ "name": "hf_run_record_idx",
2301
+ "columns": [
2302
+ {
2303
+ "expression": "record_type",
2304
+ "isExpression": false,
2305
+ "asc": true,
2306
+ "nulls": "last"
2307
+ },
2308
+ {
2309
+ "expression": "record_id",
2310
+ "isExpression": false,
2311
+ "asc": true,
2312
+ "nulls": "last"
2313
+ }
2314
+ ],
2315
+ "isUnique": false,
2316
+ "concurrently": false,
2317
+ "method": "btree",
2318
+ "with": {}
2319
+ }
2320
+ },
2321
+ "foreignKeys": {},
2322
+ "compositePrimaryKeys": {},
2323
+ "uniqueConstraints": {
2324
+ "hf_run_current_workflow_id_unique": {
2325
+ "name": "hf_run_current_workflow_id_unique",
2326
+ "nullsNotDistinct": false,
2327
+ "columns": [
2328
+ "current_workflow_id"
2329
+ ]
2330
+ }
2331
+ },
2332
+ "policies": {},
2333
+ "checkConstraints": {
2334
+ "hf_run_attempt_positive": {
2335
+ "name": "hf_run_attempt_positive",
2336
+ "value": "\"hf_run\".\"attempt\" >= 1"
2337
+ }
2338
+ },
2339
+ "isRLSEnabled": false
2340
+ }
2341
+ },
2342
+ "enums": {},
2343
+ "schemas": {},
2344
+ "sequences": {},
2345
+ "roles": {},
2346
+ "policies": {},
2347
+ "views": {},
2348
+ "_meta": {
2349
+ "columns": {},
2350
+ "schemas": {},
2351
+ "tables": {}
2352
+ }
2353
+ }