@happyvertical/smrt-facts 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3945 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "timestamp": 1782177087357,
4
+ "packageName": "@happyvertical/smrt-facts",
5
+ "packageVersion": "0.30.0",
6
+ "objects": {
7
+ "@happyvertical/smrt-facts:FactContent": {
8
+ "name": "factcontent",
9
+ "className": "FactContent",
10
+ "qualifiedName": "@happyvertical/smrt-facts:FactContent",
11
+ "collection": "factcontents",
12
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/fact-content.ts",
13
+ "packageName": "@happyvertical/smrt-facts",
14
+ "fields": {
15
+ "factId": {
16
+ "type": "foreignKey",
17
+ "required": true,
18
+ "related": "Fact",
19
+ "_meta": {
20
+ "required": true
21
+ }
22
+ },
23
+ "contentId": {
24
+ "type": "crossPackageRef",
25
+ "required": true,
26
+ "related": "@happyvertical/smrt-content:Content"
27
+ },
28
+ "relationship": {
29
+ "type": "text",
30
+ "required": true,
31
+ "default": "extracted_from",
32
+ "_meta": {
33
+ "required": true
34
+ }
35
+ },
36
+ "metadata": {
37
+ "type": "text",
38
+ "required": false,
39
+ "default": ""
40
+ },
41
+ "tenantId": {
42
+ "type": "text",
43
+ "required": false,
44
+ "_meta": {
45
+ "sqlType": "UUID",
46
+ "nullable": true,
47
+ "__tenancy": {
48
+ "isTenantIdField": true,
49
+ "autoFilter": true,
50
+ "required": false,
51
+ "autoPopulate": true,
52
+ "nullable": true,
53
+ "mode": "optional",
54
+ "field": "tenantId",
55
+ "allowSuperAdminBypass": false
56
+ }
57
+ }
58
+ },
59
+ "createdAt": {
60
+ "type": "datetime",
61
+ "required": false
62
+ },
63
+ "updatedAt": {
64
+ "type": "datetime",
65
+ "required": false
66
+ }
67
+ },
68
+ "methods": {
69
+ "getRelationship": {
70
+ "name": "getRelationship",
71
+ "async": false,
72
+ "parameters": [],
73
+ "returnType": "FactContentRelationship",
74
+ "isStatic": false,
75
+ "isPublic": true
76
+ },
77
+ "getMetadata": {
78
+ "name": "getMetadata",
79
+ "async": false,
80
+ "parameters": [],
81
+ "returnType": "Record<string, any>",
82
+ "isStatic": false,
83
+ "isPublic": true
84
+ },
85
+ "setMetadata": {
86
+ "name": "setMetadata",
87
+ "async": false,
88
+ "parameters": [
89
+ {
90
+ "name": "data",
91
+ "type": "Record<string, any>",
92
+ "optional": false
93
+ }
94
+ ],
95
+ "returnType": "void",
96
+ "isStatic": false,
97
+ "isPublic": true
98
+ },
99
+ "updateMetadata": {
100
+ "name": "updateMetadata",
101
+ "async": false,
102
+ "parameters": [
103
+ {
104
+ "name": "updates",
105
+ "type": "Record<string, any>",
106
+ "optional": false
107
+ }
108
+ ],
109
+ "returnType": "void",
110
+ "isStatic": false,
111
+ "isPublic": true
112
+ },
113
+ "getFact": {
114
+ "name": "getFact",
115
+ "async": true,
116
+ "parameters": [],
117
+ "returnType": "Promise<null>",
118
+ "isStatic": false,
119
+ "isPublic": true
120
+ }
121
+ },
122
+ "decoratorConfig": {
123
+ "conflictColumns": [
124
+ "fact_id",
125
+ "content_id",
126
+ "relationship"
127
+ ],
128
+ "api": {
129
+ "include": [
130
+ "list",
131
+ "get",
132
+ "create",
133
+ "delete"
134
+ ]
135
+ },
136
+ "mcp": {
137
+ "include": [
138
+ "list",
139
+ "get",
140
+ "create"
141
+ ]
142
+ },
143
+ "cli": true,
144
+ "tenantScoped": {
145
+ "mode": "optional"
146
+ }
147
+ },
148
+ "extends": "SmrtObject",
149
+ "exportName": "FactContent",
150
+ "collectionExportName": "FactContentCollection",
151
+ "validationRules": [
152
+ {
153
+ "field": "factId",
154
+ "rule": "required",
155
+ "fieldType": "foreignKey"
156
+ },
157
+ {
158
+ "field": "contentId",
159
+ "rule": "required",
160
+ "fieldType": "crossPackageRef"
161
+ },
162
+ {
163
+ "field": "relationship",
164
+ "rule": "required",
165
+ "fieldType": "text"
166
+ }
167
+ ],
168
+ "schema": {
169
+ "tableName": "fact_contents",
170
+ "ddl": "CREATE TABLE IF NOT EXISTS \"fact_contents\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"fact_id\" UUID NOT NULL,\n \"content_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL DEFAULT 'extracted_from',\n \"metadata\" TEXT DEFAULT '',\n \"tenant_id\" UUID\n);",
171
+ "columns": {
172
+ "id": {
173
+ "type": "UUID",
174
+ "primaryKey": true,
175
+ "referenceKind": "id",
176
+ "notNull": true
177
+ },
178
+ "slug": {
179
+ "type": "TEXT",
180
+ "notNull": true
181
+ },
182
+ "context": {
183
+ "type": "TEXT",
184
+ "notNull": true,
185
+ "default": ""
186
+ },
187
+ "created_at": {
188
+ "type": "TIMESTAMP",
189
+ "notNull": true,
190
+ "default": "current_timestamp"
191
+ },
192
+ "updated_at": {
193
+ "type": "TIMESTAMP",
194
+ "notNull": true,
195
+ "default": "current_timestamp"
196
+ },
197
+ "fact_id": {
198
+ "type": "UUID",
199
+ "referenceKind": "foreignKey",
200
+ "notNull": true,
201
+ "unique": false
202
+ },
203
+ "content_id": {
204
+ "type": "UUID",
205
+ "referenceKind": "crossPackageRef",
206
+ "notNull": true,
207
+ "unique": false
208
+ },
209
+ "relationship": {
210
+ "type": "TEXT",
211
+ "notNull": true,
212
+ "unique": false,
213
+ "default": "extracted_from"
214
+ },
215
+ "metadata": {
216
+ "type": "TEXT",
217
+ "notNull": false,
218
+ "unique": false,
219
+ "default": ""
220
+ },
221
+ "tenant_id": {
222
+ "type": "UUID",
223
+ "referenceKind": "tenantId",
224
+ "notNull": false,
225
+ "unique": false
226
+ }
227
+ },
228
+ "indexes": [
229
+ {
230
+ "name": "fact_contents_id_idx",
231
+ "columns": [
232
+ "id"
233
+ ]
234
+ },
235
+ {
236
+ "name": "fact_contents_fact_id_content_id_idx",
237
+ "columns": [
238
+ "fact_id",
239
+ "content_id",
240
+ "relationship"
241
+ ],
242
+ "unique": true
243
+ }
244
+ ],
245
+ "version": "e74eafde"
246
+ }
247
+ },
248
+ "@happyvertical/smrt-facts:FactContentCollection": {
249
+ "name": "factcontentcollection",
250
+ "className": "FactContentCollection",
251
+ "qualifiedName": "@happyvertical/smrt-facts:FactContentCollection",
252
+ "collection": "factcontents",
253
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/fact-contents.ts",
254
+ "packageName": "@happyvertical/smrt-facts",
255
+ "fields": {},
256
+ "methods": {
257
+ "byLeft": {
258
+ "name": "byLeft",
259
+ "async": true,
260
+ "parameters": [
261
+ {
262
+ "name": "leftId",
263
+ "type": "string",
264
+ "optional": false
265
+ },
266
+ {
267
+ "name": "opts",
268
+ "type": "JunctionFilterOptions",
269
+ "optional": true
270
+ }
271
+ ],
272
+ "returnType": "Promise<TItem[]>",
273
+ "isStatic": false,
274
+ "isPublic": true
275
+ },
276
+ "byRight": {
277
+ "name": "byRight",
278
+ "async": true,
279
+ "parameters": [
280
+ {
281
+ "name": "rightId",
282
+ "type": "string",
283
+ "optional": false
284
+ },
285
+ {
286
+ "name": "opts",
287
+ "type": "JunctionFilterOptions",
288
+ "optional": true
289
+ }
290
+ ],
291
+ "returnType": "Promise<TItem[]>",
292
+ "isStatic": false,
293
+ "isPublic": true
294
+ },
295
+ "attach": {
296
+ "name": "attach",
297
+ "async": true,
298
+ "parameters": [
299
+ {
300
+ "name": "leftId",
301
+ "type": "string",
302
+ "optional": false
303
+ },
304
+ {
305
+ "name": "rightId",
306
+ "type": "string",
307
+ "optional": false
308
+ },
309
+ {
310
+ "name": "opts",
311
+ "type": "JunctionAttachOptions",
312
+ "optional": true
313
+ }
314
+ ],
315
+ "returnType": "Promise<TItem>",
316
+ "isStatic": false,
317
+ "isPublic": true
318
+ },
319
+ "detach": {
320
+ "name": "detach",
321
+ "async": true,
322
+ "parameters": [
323
+ {
324
+ "name": "leftId",
325
+ "type": "string",
326
+ "optional": false
327
+ },
328
+ {
329
+ "name": "rightId",
330
+ "type": "string",
331
+ "optional": false
332
+ },
333
+ {
334
+ "name": "opts",
335
+ "type": "JunctionFilterOptions",
336
+ "optional": true
337
+ }
338
+ ],
339
+ "returnType": "Promise<void>",
340
+ "isStatic": false,
341
+ "isPublic": true
342
+ },
343
+ "setLinks": {
344
+ "name": "setLinks",
345
+ "async": true,
346
+ "parameters": [
347
+ {
348
+ "name": "leftId",
349
+ "type": "string",
350
+ "optional": false
351
+ },
352
+ {
353
+ "name": "rightIds",
354
+ "type": "string[]",
355
+ "optional": false
356
+ },
357
+ {
358
+ "name": "opts",
359
+ "type": "JunctionAttachOptions",
360
+ "optional": true
361
+ }
362
+ ],
363
+ "returnType": "Promise<void>",
364
+ "isStatic": false,
365
+ "isPublic": true
366
+ },
367
+ "findByTenant": {
368
+ "name": "findByTenant",
369
+ "async": true,
370
+ "parameters": [
371
+ {
372
+ "name": "tenantId",
373
+ "type": "string",
374
+ "optional": false
375
+ }
376
+ ],
377
+ "returnType": "Promise<FactContent[]>",
378
+ "isStatic": false,
379
+ "isPublic": true
380
+ },
381
+ "findGlobal": {
382
+ "name": "findGlobal",
383
+ "async": true,
384
+ "parameters": [],
385
+ "returnType": "Promise<FactContent[]>",
386
+ "isStatic": false,
387
+ "isPublic": true
388
+ },
389
+ "findWithGlobals": {
390
+ "name": "findWithGlobals",
391
+ "async": true,
392
+ "parameters": [
393
+ {
394
+ "name": "tenantId",
395
+ "type": "string",
396
+ "optional": false
397
+ }
398
+ ],
399
+ "returnType": "Promise<FactContent[]>",
400
+ "isStatic": false,
401
+ "isPublic": true
402
+ }
403
+ },
404
+ "decoratorConfig": {},
405
+ "extends": "SmrtJunction",
406
+ "extendsTypeArg": "FactContent",
407
+ "exportName": "FactContentCollection",
408
+ "collectionExportName": "FactContentCollectionCollection",
409
+ "schema": {
410
+ "tableName": "fact_content_collections",
411
+ "ddl": "CREATE TABLE IF NOT EXISTS \"fact_content_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
412
+ "columns": {
413
+ "id": {
414
+ "type": "UUID",
415
+ "primaryKey": true,
416
+ "referenceKind": "id",
417
+ "notNull": true
418
+ },
419
+ "slug": {
420
+ "type": "TEXT",
421
+ "notNull": true
422
+ },
423
+ "context": {
424
+ "type": "TEXT",
425
+ "notNull": true,
426
+ "default": ""
427
+ },
428
+ "created_at": {
429
+ "type": "TIMESTAMP",
430
+ "notNull": true,
431
+ "default": "current_timestamp"
432
+ },
433
+ "updated_at": {
434
+ "type": "TIMESTAMP",
435
+ "notNull": true,
436
+ "default": "current_timestamp"
437
+ }
438
+ },
439
+ "indexes": [
440
+ {
441
+ "name": "fact_content_collections_id_idx",
442
+ "columns": [
443
+ "id"
444
+ ]
445
+ },
446
+ {
447
+ "name": "fact_content_collections_slug_context_idx",
448
+ "columns": [
449
+ "slug",
450
+ "context"
451
+ ],
452
+ "unique": true
453
+ }
454
+ ],
455
+ "version": "22be8f54"
456
+ }
457
+ },
458
+ "@happyvertical/smrt-facts:FactEvidence": {
459
+ "name": "factevidence",
460
+ "className": "FactEvidence",
461
+ "qualifiedName": "@happyvertical/smrt-facts:FactEvidence",
462
+ "collection": "factevidences",
463
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/fact-evidence.ts",
464
+ "packageName": "@happyvertical/smrt-facts",
465
+ "fields": {
466
+ "factId": {
467
+ "type": "foreignKey",
468
+ "required": true,
469
+ "related": "Fact",
470
+ "_meta": {
471
+ "required": true
472
+ }
473
+ },
474
+ "evidenceKey": {
475
+ "type": "text",
476
+ "required": true,
477
+ "default": "",
478
+ "_meta": {
479
+ "required": true
480
+ }
481
+ },
482
+ "status": {
483
+ "type": "text",
484
+ "required": true,
485
+ "default": "supports",
486
+ "_meta": {
487
+ "required": true,
488
+ "default": "supports"
489
+ }
490
+ },
491
+ "sourceKind": {
492
+ "type": "text",
493
+ "required": false,
494
+ "default": ""
495
+ },
496
+ "sourceId": {
497
+ "type": "text",
498
+ "required": false,
499
+ "default": ""
500
+ },
501
+ "sourceUrl": {
502
+ "type": "text",
503
+ "required": false,
504
+ "default": ""
505
+ },
506
+ "sourceTitle": {
507
+ "type": "text",
508
+ "required": false,
509
+ "default": ""
510
+ },
511
+ "quote": {
512
+ "type": "text",
513
+ "required": false,
514
+ "default": ""
515
+ },
516
+ "locator": {
517
+ "type": "text",
518
+ "required": false,
519
+ "default": ""
520
+ },
521
+ "extractionMethod": {
522
+ "type": "text",
523
+ "required": false,
524
+ "default": ""
525
+ },
526
+ "confidence": {
527
+ "type": "integer",
528
+ "required": false,
529
+ "default": 0
530
+ },
531
+ "metadata": {
532
+ "type": "text",
533
+ "required": false,
534
+ "default": ""
535
+ },
536
+ "tenantId": {
537
+ "type": "text",
538
+ "required": false,
539
+ "_meta": {
540
+ "sqlType": "UUID",
541
+ "nullable": true,
542
+ "__tenancy": {
543
+ "isTenantIdField": true,
544
+ "autoFilter": true,
545
+ "required": false,
546
+ "autoPopulate": true,
547
+ "nullable": true,
548
+ "mode": "optional",
549
+ "field": "tenantId",
550
+ "allowSuperAdminBypass": false
551
+ }
552
+ }
553
+ },
554
+ "createdAt": {
555
+ "type": "datetime",
556
+ "required": false
557
+ },
558
+ "updatedAt": {
559
+ "type": "datetime",
560
+ "required": false
561
+ }
562
+ },
563
+ "methods": {
564
+ "getMetadata": {
565
+ "name": "getMetadata",
566
+ "async": false,
567
+ "parameters": [],
568
+ "returnType": "Record<string, any>",
569
+ "isStatic": false,
570
+ "isPublic": true
571
+ },
572
+ "setMetadata": {
573
+ "name": "setMetadata",
574
+ "async": false,
575
+ "parameters": [
576
+ {
577
+ "name": "data",
578
+ "type": "Record<string, any>",
579
+ "optional": false
580
+ }
581
+ ],
582
+ "returnType": "void",
583
+ "isStatic": false,
584
+ "isPublic": true
585
+ },
586
+ "updateMetadata": {
587
+ "name": "updateMetadata",
588
+ "async": false,
589
+ "parameters": [
590
+ {
591
+ "name": "updates",
592
+ "type": "Record<string, any>",
593
+ "optional": false
594
+ }
595
+ ],
596
+ "returnType": "void",
597
+ "isStatic": false,
598
+ "isPublic": true
599
+ }
600
+ },
601
+ "decoratorConfig": {
602
+ "tableName": "fact_evidences",
603
+ "conflictColumns": [
604
+ "fact_id",
605
+ "evidence_key"
606
+ ],
607
+ "api": {
608
+ "include": [
609
+ "list",
610
+ "get",
611
+ "create",
612
+ "delete"
613
+ ]
614
+ },
615
+ "mcp": {
616
+ "include": [
617
+ "list",
618
+ "get",
619
+ "create"
620
+ ]
621
+ },
622
+ "cli": true,
623
+ "tenantScoped": {
624
+ "mode": "optional"
625
+ }
626
+ },
627
+ "extends": "SmrtObject",
628
+ "exportName": "FactEvidence",
629
+ "collectionExportName": "FactEvidenceCollection",
630
+ "validationRules": [
631
+ {
632
+ "field": "factId",
633
+ "rule": "required",
634
+ "fieldType": "foreignKey"
635
+ },
636
+ {
637
+ "field": "evidenceKey",
638
+ "rule": "required",
639
+ "fieldType": "text"
640
+ },
641
+ {
642
+ "field": "status",
643
+ "rule": "required",
644
+ "fieldType": "text"
645
+ }
646
+ ],
647
+ "schema": {
648
+ "tableName": "fact_evidences",
649
+ "ddl": "CREATE TABLE IF NOT EXISTS \"fact_evidences\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"fact_id\" UUID NOT NULL,\n \"evidence_key\" TEXT NOT NULL DEFAULT '',\n \"status\" TEXT NOT NULL DEFAULT 'supports',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"source_url\" TEXT DEFAULT '',\n \"source_title\" TEXT DEFAULT '',\n \"quote\" TEXT DEFAULT '',\n \"locator\" TEXT DEFAULT '',\n \"extraction_method\" TEXT DEFAULT '',\n \"confidence\" INTEGER DEFAULT 0,\n \"metadata\" TEXT DEFAULT '',\n \"tenant_id\" UUID\n);",
650
+ "columns": {
651
+ "id": {
652
+ "type": "UUID",
653
+ "primaryKey": true,
654
+ "referenceKind": "id",
655
+ "notNull": true
656
+ },
657
+ "slug": {
658
+ "type": "TEXT",
659
+ "notNull": true
660
+ },
661
+ "context": {
662
+ "type": "TEXT",
663
+ "notNull": true,
664
+ "default": ""
665
+ },
666
+ "created_at": {
667
+ "type": "TIMESTAMP",
668
+ "notNull": true,
669
+ "default": "current_timestamp"
670
+ },
671
+ "updated_at": {
672
+ "type": "TIMESTAMP",
673
+ "notNull": true,
674
+ "default": "current_timestamp"
675
+ },
676
+ "fact_id": {
677
+ "type": "UUID",
678
+ "referenceKind": "foreignKey",
679
+ "notNull": true,
680
+ "unique": false
681
+ },
682
+ "evidence_key": {
683
+ "type": "TEXT",
684
+ "notNull": true,
685
+ "unique": false,
686
+ "default": ""
687
+ },
688
+ "status": {
689
+ "type": "TEXT",
690
+ "notNull": true,
691
+ "unique": false,
692
+ "default": "supports"
693
+ },
694
+ "source_kind": {
695
+ "type": "TEXT",
696
+ "notNull": false,
697
+ "unique": false,
698
+ "default": ""
699
+ },
700
+ "source_id": {
701
+ "type": "TEXT",
702
+ "notNull": false,
703
+ "unique": false,
704
+ "default": ""
705
+ },
706
+ "source_url": {
707
+ "type": "TEXT",
708
+ "notNull": false,
709
+ "unique": false,
710
+ "default": ""
711
+ },
712
+ "source_title": {
713
+ "type": "TEXT",
714
+ "notNull": false,
715
+ "unique": false,
716
+ "default": ""
717
+ },
718
+ "quote": {
719
+ "type": "TEXT",
720
+ "notNull": false,
721
+ "unique": false,
722
+ "default": ""
723
+ },
724
+ "locator": {
725
+ "type": "TEXT",
726
+ "notNull": false,
727
+ "unique": false,
728
+ "default": ""
729
+ },
730
+ "extraction_method": {
731
+ "type": "TEXT",
732
+ "notNull": false,
733
+ "unique": false,
734
+ "default": ""
735
+ },
736
+ "confidence": {
737
+ "type": "INTEGER",
738
+ "notNull": false,
739
+ "unique": false,
740
+ "default": 0
741
+ },
742
+ "metadata": {
743
+ "type": "TEXT",
744
+ "notNull": false,
745
+ "unique": false,
746
+ "default": ""
747
+ },
748
+ "tenant_id": {
749
+ "type": "UUID",
750
+ "referenceKind": "tenantId",
751
+ "notNull": false,
752
+ "unique": false
753
+ }
754
+ },
755
+ "indexes": [
756
+ {
757
+ "name": "fact_evidences_id_idx",
758
+ "columns": [
759
+ "id"
760
+ ]
761
+ },
762
+ {
763
+ "name": "fact_evidences_fact_id_evidence_key_idx",
764
+ "columns": [
765
+ "fact_id",
766
+ "evidence_key"
767
+ ],
768
+ "unique": true
769
+ }
770
+ ],
771
+ "version": "46bab2ba"
772
+ }
773
+ },
774
+ "@happyvertical/smrt-facts:FactEvidenceCollection": {
775
+ "name": "factevidencecollection",
776
+ "className": "FactEvidenceCollection",
777
+ "qualifiedName": "@happyvertical/smrt-facts:FactEvidenceCollection",
778
+ "collection": "factevidences",
779
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/fact-evidences.ts",
780
+ "packageName": "@happyvertical/smrt-facts",
781
+ "fields": {},
782
+ "methods": {
783
+ "getForFact": {
784
+ "name": "getForFact",
785
+ "async": true,
786
+ "parameters": [
787
+ {
788
+ "name": "factId",
789
+ "type": "string",
790
+ "optional": false
791
+ }
792
+ ],
793
+ "returnType": "Promise<FactEvidence[]>",
794
+ "isStatic": false,
795
+ "isPublic": true
796
+ },
797
+ "getForSource": {
798
+ "name": "getForSource",
799
+ "async": true,
800
+ "parameters": [
801
+ {
802
+ "name": "sourceKind",
803
+ "type": "string",
804
+ "optional": false
805
+ },
806
+ {
807
+ "name": "sourceId",
808
+ "type": "string",
809
+ "optional": false
810
+ }
811
+ ],
812
+ "returnType": "Promise<FactEvidence[]>",
813
+ "isStatic": false,
814
+ "isPublic": true
815
+ },
816
+ "getForSources": {
817
+ "name": "getForSources",
818
+ "async": true,
819
+ "parameters": [
820
+ {
821
+ "name": "sources",
822
+ "type": "Array<object>",
823
+ "optional": false
824
+ }
825
+ ],
826
+ "returnType": "Promise<FactEvidence[]>",
827
+ "isStatic": false,
828
+ "isPublic": true
829
+ },
830
+ "bulkUpdateStatus": {
831
+ "name": "bulkUpdateStatus",
832
+ "async": true,
833
+ "parameters": [
834
+ {
835
+ "name": "evidenceIds",
836
+ "type": "string[]",
837
+ "optional": false
838
+ },
839
+ {
840
+ "name": "status",
841
+ "type": "FactEvidenceStatus",
842
+ "optional": false
843
+ },
844
+ {
845
+ "name": "options",
846
+ "type": "object",
847
+ "optional": true
848
+ }
849
+ ],
850
+ "returnType": "Promise<FactEvidence[]>",
851
+ "isStatic": false,
852
+ "isPublic": true
853
+ },
854
+ "replaceGeneratedForSources": {
855
+ "name": "replaceGeneratedForSources",
856
+ "async": true,
857
+ "parameters": [
858
+ {
859
+ "name": "sources",
860
+ "type": "Array<object>",
861
+ "optional": false
862
+ },
863
+ {
864
+ "name": "options",
865
+ "type": "object",
866
+ "optional": true
867
+ }
868
+ ],
869
+ "returnType": "Promise<object>",
870
+ "isStatic": false,
871
+ "isPublic": true
872
+ },
873
+ "upsertEvidence": {
874
+ "name": "upsertEvidence",
875
+ "async": true,
876
+ "parameters": [
877
+ {
878
+ "name": "options",
879
+ "type": "FactEvidenceOptions",
880
+ "optional": false
881
+ }
882
+ ],
883
+ "returnType": "Promise<FactEvidence>",
884
+ "isStatic": false,
885
+ "isPublic": true
886
+ }
887
+ },
888
+ "decoratorConfig": {
889
+ "tableName": "fact_evidences"
890
+ },
891
+ "extends": "SmrtCollection",
892
+ "extendsTypeArg": "FactEvidence",
893
+ "exportName": "FactEvidenceCollection",
894
+ "collectionExportName": "FactEvidenceCollectionCollection",
895
+ "schema": {
896
+ "tableName": "fact_evidences",
897
+ "ddl": "CREATE TABLE IF NOT EXISTS \"fact_evidences\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
898
+ "columns": {
899
+ "id": {
900
+ "type": "UUID",
901
+ "primaryKey": true,
902
+ "referenceKind": "id",
903
+ "notNull": true
904
+ },
905
+ "slug": {
906
+ "type": "TEXT",
907
+ "notNull": true
908
+ },
909
+ "context": {
910
+ "type": "TEXT",
911
+ "notNull": true,
912
+ "default": ""
913
+ },
914
+ "created_at": {
915
+ "type": "TIMESTAMP",
916
+ "notNull": true,
917
+ "default": "current_timestamp"
918
+ },
919
+ "updated_at": {
920
+ "type": "TIMESTAMP",
921
+ "notNull": true,
922
+ "default": "current_timestamp"
923
+ }
924
+ },
925
+ "indexes": [
926
+ {
927
+ "name": "fact_evidences_id_idx",
928
+ "columns": [
929
+ "id"
930
+ ]
931
+ },
932
+ {
933
+ "name": "fact_evidences_slug_context_idx",
934
+ "columns": [
935
+ "slug",
936
+ "context"
937
+ ],
938
+ "unique": true
939
+ }
940
+ ],
941
+ "version": "80329e4f"
942
+ }
943
+ },
944
+ "@happyvertical/smrt-facts:FactSource": {
945
+ "name": "factsource",
946
+ "className": "FactSource",
947
+ "qualifiedName": "@happyvertical/smrt-facts:FactSource",
948
+ "collection": "factsources",
949
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/fact-source.ts",
950
+ "packageName": "@happyvertical/smrt-facts",
951
+ "fields": {
952
+ "created_at": {
953
+ "type": "datetime",
954
+ "required": false
955
+ },
956
+ "updated_at": {
957
+ "type": "datetime",
958
+ "required": false
959
+ },
960
+ "factId": {
961
+ "type": "foreignKey",
962
+ "required": true,
963
+ "related": "Fact",
964
+ "_meta": {
965
+ "required": true
966
+ }
967
+ },
968
+ "sourceType": {
969
+ "type": "text",
970
+ "required": false,
971
+ "default": ""
972
+ },
973
+ "sourceUrl": {
974
+ "type": "text",
975
+ "required": false,
976
+ "default": ""
977
+ },
978
+ "sourceTitle": {
979
+ "type": "text",
980
+ "required": false,
981
+ "default": ""
982
+ },
983
+ "credibility": {
984
+ "type": "decimal",
985
+ "required": false,
986
+ "default": 0
987
+ },
988
+ "extractedAt": {
989
+ "type": "datetime",
990
+ "required": false
991
+ },
992
+ "metadata": {
993
+ "type": "text",
994
+ "required": false,
995
+ "default": ""
996
+ },
997
+ "tenantId": {
998
+ "type": "text",
999
+ "required": false,
1000
+ "_meta": {
1001
+ "sqlType": "UUID",
1002
+ "nullable": true,
1003
+ "__tenancy": {
1004
+ "isTenantIdField": true,
1005
+ "autoFilter": true,
1006
+ "required": false,
1007
+ "autoPopulate": true,
1008
+ "nullable": true,
1009
+ "mode": "optional",
1010
+ "field": "tenantId",
1011
+ "allowSuperAdminBypass": false
1012
+ }
1013
+ }
1014
+ },
1015
+ "createdAt": {
1016
+ "type": "datetime",
1017
+ "required": false
1018
+ },
1019
+ "updatedAt": {
1020
+ "type": "datetime",
1021
+ "required": false
1022
+ }
1023
+ },
1024
+ "methods": {
1025
+ "getAiUsageSnapshot": {
1026
+ "name": "getAiUsageSnapshot",
1027
+ "async": false,
1028
+ "parameters": [],
1029
+ "returnType": "AiUsageSnapshot | undefined",
1030
+ "isStatic": false,
1031
+ "isPublic": true
1032
+ },
1033
+ "resetAiUsage": {
1034
+ "name": "resetAiUsage",
1035
+ "async": false,
1036
+ "parameters": [],
1037
+ "returnType": "void",
1038
+ "isStatic": false,
1039
+ "isPublic": true
1040
+ },
1041
+ "listAiUsage": {
1042
+ "name": "listAiUsage",
1043
+ "async": true,
1044
+ "parameters": [
1045
+ {
1046
+ "name": "options",
1047
+ "type": "AiUsageListOptions",
1048
+ "optional": true
1049
+ }
1050
+ ],
1051
+ "returnType": "Promise<SmrtAiUsageRecord[]>",
1052
+ "isStatic": false,
1053
+ "isPublic": true
1054
+ },
1055
+ "summarizeAiUsage": {
1056
+ "name": "summarizeAiUsage",
1057
+ "async": true,
1058
+ "parameters": [
1059
+ {
1060
+ "name": "options",
1061
+ "type": "AiUsageSummaryOptions",
1062
+ "optional": true
1063
+ }
1064
+ ],
1065
+ "returnType": "Promise<Record<string, AiUsageStats>>",
1066
+ "isStatic": false,
1067
+ "isPublic": true
1068
+ },
1069
+ "destroy": {
1070
+ "name": "destroy",
1071
+ "async": false,
1072
+ "parameters": [],
1073
+ "returnType": "void",
1074
+ "isStatic": false,
1075
+ "isPublic": true
1076
+ },
1077
+ "markAsPersisted": {
1078
+ "name": "markAsPersisted",
1079
+ "async": false,
1080
+ "parameters": [],
1081
+ "returnType": "void",
1082
+ "isStatic": false,
1083
+ "isPublic": true
1084
+ },
1085
+ "initialize": {
1086
+ "name": "initialize",
1087
+ "async": true,
1088
+ "parameters": [],
1089
+ "returnType": "Promise",
1090
+ "isStatic": false,
1091
+ "isPublic": true
1092
+ },
1093
+ "loadDataFromDb": {
1094
+ "name": "loadDataFromDb",
1095
+ "async": true,
1096
+ "parameters": [
1097
+ {
1098
+ "name": "data",
1099
+ "type": "any",
1100
+ "optional": false
1101
+ }
1102
+ ],
1103
+ "returnType": "any",
1104
+ "isStatic": false,
1105
+ "isPublic": true
1106
+ },
1107
+ "getFields": {
1108
+ "name": "getFields",
1109
+ "async": true,
1110
+ "parameters": [],
1111
+ "returnType": "any",
1112
+ "isStatic": false,
1113
+ "isPublic": true
1114
+ },
1115
+ "toJSON": {
1116
+ "name": "toJSON",
1117
+ "async": false,
1118
+ "parameters": [],
1119
+ "returnType": "any",
1120
+ "isStatic": false,
1121
+ "isPublic": true
1122
+ },
1123
+ "toPlainObject": {
1124
+ "name": "toPlainObject",
1125
+ "async": false,
1126
+ "parameters": [],
1127
+ "returnType": "Record<string>",
1128
+ "isStatic": false,
1129
+ "isPublic": true
1130
+ },
1131
+ "toPublicJSON": {
1132
+ "name": "toPublicJSON",
1133
+ "async": false,
1134
+ "parameters": [],
1135
+ "returnType": "Record<string>",
1136
+ "isStatic": false,
1137
+ "isPublic": true
1138
+ },
1139
+ "getId": {
1140
+ "name": "getId",
1141
+ "async": true,
1142
+ "parameters": [],
1143
+ "returnType": "any",
1144
+ "isStatic": false,
1145
+ "isPublic": true
1146
+ },
1147
+ "getSlug": {
1148
+ "name": "getSlug",
1149
+ "async": true,
1150
+ "parameters": [],
1151
+ "returnType": "any",
1152
+ "isStatic": false,
1153
+ "isPublic": true
1154
+ },
1155
+ "getSavedId": {
1156
+ "name": "getSavedId",
1157
+ "async": true,
1158
+ "parameters": [],
1159
+ "returnType": "any",
1160
+ "isStatic": false,
1161
+ "isPublic": true
1162
+ },
1163
+ "isSaved": {
1164
+ "name": "isSaved",
1165
+ "async": true,
1166
+ "parameters": [],
1167
+ "returnType": "any",
1168
+ "isStatic": false,
1169
+ "isPublic": true
1170
+ },
1171
+ "save": {
1172
+ "name": "save",
1173
+ "async": true,
1174
+ "parameters": [],
1175
+ "returnType": "any",
1176
+ "isStatic": false,
1177
+ "isPublic": true
1178
+ },
1179
+ "classifyConstraintError": {
1180
+ "name": "classifyConstraintError",
1181
+ "async": false,
1182
+ "parameters": [
1183
+ {
1184
+ "name": "message",
1185
+ "type": "string",
1186
+ "optional": false
1187
+ }
1188
+ ],
1189
+ "returnType": "'unique' | 'not_null' | null",
1190
+ "isStatic": true,
1191
+ "isPublic": true
1192
+ },
1193
+ "loadFromId": {
1194
+ "name": "loadFromId",
1195
+ "async": true,
1196
+ "parameters": [],
1197
+ "returnType": "any",
1198
+ "isStatic": false,
1199
+ "isPublic": true
1200
+ },
1201
+ "loadFromSlug": {
1202
+ "name": "loadFromSlug",
1203
+ "async": true,
1204
+ "parameters": [],
1205
+ "returnType": "any",
1206
+ "isStatic": false,
1207
+ "isPublic": true
1208
+ },
1209
+ "is": {
1210
+ "name": "is",
1211
+ "async": true,
1212
+ "parameters": [
1213
+ {
1214
+ "name": "criteria",
1215
+ "type": "string",
1216
+ "optional": false
1217
+ },
1218
+ {
1219
+ "name": "options",
1220
+ "type": "any",
1221
+ "optional": true
1222
+ }
1223
+ ],
1224
+ "returnType": "any",
1225
+ "isStatic": false,
1226
+ "isPublic": true
1227
+ },
1228
+ "do": {
1229
+ "name": "do",
1230
+ "async": true,
1231
+ "parameters": [
1232
+ {
1233
+ "name": "instructions",
1234
+ "type": "string",
1235
+ "optional": false
1236
+ },
1237
+ {
1238
+ "name": "options",
1239
+ "type": "any",
1240
+ "optional": true
1241
+ }
1242
+ ],
1243
+ "returnType": "any",
1244
+ "isStatic": false,
1245
+ "isPublic": true
1246
+ },
1247
+ "describe": {
1248
+ "name": "describe",
1249
+ "async": true,
1250
+ "parameters": [
1251
+ {
1252
+ "name": "options",
1253
+ "type": "any",
1254
+ "optional": true
1255
+ }
1256
+ ],
1257
+ "returnType": "any",
1258
+ "isStatic": false,
1259
+ "isPublic": true
1260
+ },
1261
+ "delete": {
1262
+ "name": "delete",
1263
+ "async": true,
1264
+ "parameters": [],
1265
+ "returnType": "Promise<void>",
1266
+ "isStatic": false,
1267
+ "isPublic": true
1268
+ },
1269
+ "isRelatedLoaded": {
1270
+ "name": "isRelatedLoaded",
1271
+ "async": false,
1272
+ "parameters": [
1273
+ {
1274
+ "name": "fieldName",
1275
+ "type": "string",
1276
+ "optional": false
1277
+ }
1278
+ ],
1279
+ "returnType": "boolean",
1280
+ "isStatic": false,
1281
+ "isPublic": true
1282
+ },
1283
+ "loadRelated": {
1284
+ "name": "loadRelated",
1285
+ "async": true,
1286
+ "parameters": [
1287
+ {
1288
+ "name": "fieldName",
1289
+ "type": "string",
1290
+ "optional": false
1291
+ },
1292
+ {
1293
+ "name": "opts",
1294
+ "type": "LoadRelatedOptions",
1295
+ "optional": true
1296
+ }
1297
+ ],
1298
+ "returnType": "Promise<any>",
1299
+ "isStatic": false,
1300
+ "isPublic": true
1301
+ },
1302
+ "loadRelatedMany": {
1303
+ "name": "loadRelatedMany",
1304
+ "async": true,
1305
+ "parameters": [
1306
+ {
1307
+ "name": "fieldName",
1308
+ "type": "string",
1309
+ "optional": false
1310
+ },
1311
+ {
1312
+ "name": "opts",
1313
+ "type": "LoadRelatedOptions",
1314
+ "optional": true
1315
+ }
1316
+ ],
1317
+ "returnType": "Promise<any[]>",
1318
+ "isStatic": false,
1319
+ "isPublic": true
1320
+ },
1321
+ "getRelated": {
1322
+ "name": "getRelated",
1323
+ "async": true,
1324
+ "parameters": [
1325
+ {
1326
+ "name": "fieldName",
1327
+ "type": "string",
1328
+ "optional": false
1329
+ },
1330
+ {
1331
+ "name": "opts",
1332
+ "type": "LoadRelatedOptions",
1333
+ "optional": true
1334
+ }
1335
+ ],
1336
+ "returnType": "Promise<any>",
1337
+ "isStatic": false,
1338
+ "isPublic": true
1339
+ },
1340
+ "getAvailableTools": {
1341
+ "name": "getAvailableTools",
1342
+ "async": false,
1343
+ "parameters": [],
1344
+ "returnType": "AITool[]",
1345
+ "isStatic": false,
1346
+ "isPublic": true
1347
+ },
1348
+ "executeToolCall": {
1349
+ "name": "executeToolCall",
1350
+ "async": true,
1351
+ "parameters": [
1352
+ {
1353
+ "name": "toolCall",
1354
+ "type": "ToolCall",
1355
+ "optional": false
1356
+ }
1357
+ ],
1358
+ "returnType": "Promise<ToolCallResult>",
1359
+ "isStatic": false,
1360
+ "isPublic": true
1361
+ },
1362
+ "remember": {
1363
+ "name": "remember",
1364
+ "async": true,
1365
+ "parameters": [
1366
+ {
1367
+ "name": "options",
1368
+ "type": "object",
1369
+ "optional": false
1370
+ }
1371
+ ],
1372
+ "returnType": "Promise<void>",
1373
+ "isStatic": false,
1374
+ "isPublic": true
1375
+ },
1376
+ "recall": {
1377
+ "name": "recall",
1378
+ "async": true,
1379
+ "parameters": [
1380
+ {
1381
+ "name": "options",
1382
+ "type": "object",
1383
+ "optional": false
1384
+ }
1385
+ ],
1386
+ "returnType": "Promise<any | null>",
1387
+ "isStatic": false,
1388
+ "isPublic": true
1389
+ },
1390
+ "recallAll": {
1391
+ "name": "recallAll",
1392
+ "async": true,
1393
+ "parameters": [
1394
+ {
1395
+ "name": "options",
1396
+ "type": "object",
1397
+ "optional": true
1398
+ }
1399
+ ],
1400
+ "returnType": "Promise<Map<string, any>>",
1401
+ "isStatic": false,
1402
+ "isPublic": true
1403
+ },
1404
+ "forget": {
1405
+ "name": "forget",
1406
+ "async": true,
1407
+ "parameters": [
1408
+ {
1409
+ "name": "options",
1410
+ "type": "object",
1411
+ "optional": false
1412
+ }
1413
+ ],
1414
+ "returnType": "Promise<void>",
1415
+ "isStatic": false,
1416
+ "isPublic": true
1417
+ },
1418
+ "forgetScope": {
1419
+ "name": "forgetScope",
1420
+ "async": true,
1421
+ "parameters": [
1422
+ {
1423
+ "name": "options",
1424
+ "type": "object",
1425
+ "optional": false
1426
+ }
1427
+ ],
1428
+ "returnType": "Promise<number>",
1429
+ "isStatic": false,
1430
+ "isPublic": true
1431
+ },
1432
+ "generateEmbeddings": {
1433
+ "name": "generateEmbeddings",
1434
+ "async": true,
1435
+ "parameters": [
1436
+ {
1437
+ "name": "options",
1438
+ "type": "GenerateEmbeddingsOptions",
1439
+ "optional": true
1440
+ }
1441
+ ],
1442
+ "returnType": "Promise<void>",
1443
+ "isStatic": false,
1444
+ "isPublic": true
1445
+ },
1446
+ "getEmbedding": {
1447
+ "name": "getEmbedding",
1448
+ "async": true,
1449
+ "parameters": [
1450
+ {
1451
+ "name": "fieldName",
1452
+ "type": "string",
1453
+ "optional": false
1454
+ },
1455
+ {
1456
+ "name": "model",
1457
+ "type": "string",
1458
+ "optional": true
1459
+ }
1460
+ ],
1461
+ "returnType": "Promise<number[] | null>",
1462
+ "isStatic": false,
1463
+ "isPublic": true
1464
+ },
1465
+ "hasStaleEmbeddings": {
1466
+ "name": "hasStaleEmbeddings",
1467
+ "async": true,
1468
+ "parameters": [],
1469
+ "returnType": "Promise<boolean>",
1470
+ "isStatic": false,
1471
+ "isPublic": true
1472
+ },
1473
+ "clearEmbeddings": {
1474
+ "name": "clearEmbeddings",
1475
+ "async": true,
1476
+ "parameters": [],
1477
+ "returnType": "Promise<void>",
1478
+ "isStatic": false,
1479
+ "isPublic": true
1480
+ },
1481
+ "getMetadata": {
1482
+ "name": "getMetadata",
1483
+ "async": false,
1484
+ "parameters": [],
1485
+ "returnType": "Record<string, any>",
1486
+ "isStatic": false,
1487
+ "isPublic": true
1488
+ },
1489
+ "setMetadata": {
1490
+ "name": "setMetadata",
1491
+ "async": false,
1492
+ "parameters": [
1493
+ {
1494
+ "name": "data",
1495
+ "type": "Record<string, any>",
1496
+ "optional": false
1497
+ }
1498
+ ],
1499
+ "returnType": "void",
1500
+ "isStatic": false,
1501
+ "isPublic": true
1502
+ },
1503
+ "updateMetadata": {
1504
+ "name": "updateMetadata",
1505
+ "async": false,
1506
+ "parameters": [
1507
+ {
1508
+ "name": "updates",
1509
+ "type": "Record<string, any>",
1510
+ "optional": false
1511
+ }
1512
+ ],
1513
+ "returnType": "void",
1514
+ "isStatic": false,
1515
+ "isPublic": true
1516
+ },
1517
+ "getFact": {
1518
+ "name": "getFact",
1519
+ "async": true,
1520
+ "parameters": [],
1521
+ "returnType": "Promise<null>",
1522
+ "isStatic": false,
1523
+ "isPublic": true
1524
+ }
1525
+ },
1526
+ "decoratorConfig": {
1527
+ "tableStrategy": "sti",
1528
+ "api": {
1529
+ "include": [
1530
+ "list",
1531
+ "get",
1532
+ "create",
1533
+ "delete"
1534
+ ]
1535
+ },
1536
+ "mcp": {
1537
+ "include": [
1538
+ "list",
1539
+ "get",
1540
+ "create"
1541
+ ]
1542
+ },
1543
+ "cli": true,
1544
+ "tenantScoped": {
1545
+ "mode": "optional"
1546
+ }
1547
+ },
1548
+ "extends": "SmrtObject",
1549
+ "exportName": "FactSource",
1550
+ "collectionExportName": "FactSourceCollection",
1551
+ "validationRules": [
1552
+ {
1553
+ "field": "factId",
1554
+ "rule": "required",
1555
+ "fieldType": "foreignKey"
1556
+ }
1557
+ ],
1558
+ "schema": {
1559
+ "tableName": "fact_sources",
1560
+ "ddl": "CREATE TABLE IF NOT EXISTS \"fact_sources\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"fact_id\" UUID,\n \"source_type\" TEXT DEFAULT '',\n \"source_url\" TEXT DEFAULT '',\n \"source_title\" TEXT DEFAULT '',\n \"credibility\" REAL DEFAULT 0,\n \"extracted_at\" TIMESTAMP,\n \"metadata\" TEXT DEFAULT '',\n \"tenant_id\" UUID\n);",
1561
+ "columns": {
1562
+ "id": {
1563
+ "type": "UUID",
1564
+ "primaryKey": true,
1565
+ "referenceKind": "id",
1566
+ "notNull": true
1567
+ },
1568
+ "slug": {
1569
+ "type": "TEXT",
1570
+ "notNull": true
1571
+ },
1572
+ "context": {
1573
+ "type": "TEXT",
1574
+ "notNull": true,
1575
+ "default": ""
1576
+ },
1577
+ "_meta_type": {
1578
+ "type": "TEXT",
1579
+ "notNull": true
1580
+ },
1581
+ "_meta_data": {
1582
+ "type": "JSON",
1583
+ "notNull": false
1584
+ },
1585
+ "created_at": {
1586
+ "type": "TIMESTAMP",
1587
+ "notNull": true,
1588
+ "default": "current_timestamp"
1589
+ },
1590
+ "updated_at": {
1591
+ "type": "TIMESTAMP",
1592
+ "notNull": true,
1593
+ "default": "current_timestamp"
1594
+ },
1595
+ "fact_id": {
1596
+ "type": "UUID",
1597
+ "referenceKind": "foreignKey",
1598
+ "notNull": false
1599
+ },
1600
+ "source_type": {
1601
+ "type": "TEXT",
1602
+ "notNull": false,
1603
+ "default": ""
1604
+ },
1605
+ "source_url": {
1606
+ "type": "TEXT",
1607
+ "notNull": false,
1608
+ "default": ""
1609
+ },
1610
+ "source_title": {
1611
+ "type": "TEXT",
1612
+ "notNull": false,
1613
+ "default": ""
1614
+ },
1615
+ "credibility": {
1616
+ "type": "REAL",
1617
+ "notNull": false,
1618
+ "default": 0
1619
+ },
1620
+ "extracted_at": {
1621
+ "type": "TIMESTAMP",
1622
+ "notNull": false
1623
+ },
1624
+ "metadata": {
1625
+ "type": "TEXT",
1626
+ "notNull": false,
1627
+ "default": ""
1628
+ },
1629
+ "tenant_id": {
1630
+ "type": "UUID",
1631
+ "referenceKind": "tenantId",
1632
+ "notNull": false
1633
+ }
1634
+ },
1635
+ "indexes": [
1636
+ {
1637
+ "name": "fact_sources_id_idx",
1638
+ "columns": [
1639
+ "id"
1640
+ ]
1641
+ },
1642
+ {
1643
+ "name": "fact_sources_slug_context_meta_type_idx",
1644
+ "columns": [
1645
+ "slug",
1646
+ "context",
1647
+ "_meta_type"
1648
+ ],
1649
+ "unique": true
1650
+ },
1651
+ {
1652
+ "name": "fact_sources_meta_type_idx",
1653
+ "columns": [
1654
+ "_meta_type"
1655
+ ]
1656
+ }
1657
+ ],
1658
+ "version": "7f9f04b2"
1659
+ }
1660
+ },
1661
+ "@happyvertical/smrt-facts:FactSourceCollection": {
1662
+ "name": "factsourcecollection",
1663
+ "className": "FactSourceCollection",
1664
+ "qualifiedName": "@happyvertical/smrt-facts:FactSourceCollection",
1665
+ "collection": "factsources",
1666
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/fact-sources.ts",
1667
+ "packageName": "@happyvertical/smrt-facts",
1668
+ "fields": {},
1669
+ "methods": {
1670
+ "getForFact": {
1671
+ "name": "getForFact",
1672
+ "async": true,
1673
+ "parameters": [
1674
+ {
1675
+ "name": "factId",
1676
+ "type": "string",
1677
+ "optional": false
1678
+ }
1679
+ ],
1680
+ "returnType": "Promise<FactSource[]>",
1681
+ "isStatic": false,
1682
+ "isPublic": true
1683
+ },
1684
+ "countForFact": {
1685
+ "name": "countForFact",
1686
+ "async": true,
1687
+ "parameters": [
1688
+ {
1689
+ "name": "factId",
1690
+ "type": "string",
1691
+ "optional": false
1692
+ }
1693
+ ],
1694
+ "returnType": "Promise<number>",
1695
+ "isStatic": false,
1696
+ "isPublic": true
1697
+ },
1698
+ "getByType": {
1699
+ "name": "getByType",
1700
+ "async": true,
1701
+ "parameters": [
1702
+ {
1703
+ "name": "sourceType",
1704
+ "type": "string",
1705
+ "optional": false
1706
+ }
1707
+ ],
1708
+ "returnType": "Promise<FactSource[]>",
1709
+ "isStatic": false,
1710
+ "isPublic": true
1711
+ },
1712
+ "getHighCredibility": {
1713
+ "name": "getHighCredibility",
1714
+ "async": true,
1715
+ "parameters": [
1716
+ {
1717
+ "name": "minCredibility",
1718
+ "type": "number",
1719
+ "optional": true
1720
+ }
1721
+ ],
1722
+ "returnType": "Promise<FactSource[]>",
1723
+ "isStatic": false,
1724
+ "isPublic": true
1725
+ },
1726
+ "getAverageCredibility": {
1727
+ "name": "getAverageCredibility",
1728
+ "async": true,
1729
+ "parameters": [
1730
+ {
1731
+ "name": "factId",
1732
+ "type": "string",
1733
+ "optional": false
1734
+ }
1735
+ ],
1736
+ "returnType": "Promise<number>",
1737
+ "isStatic": false,
1738
+ "isPublic": true
1739
+ },
1740
+ "findByTenant": {
1741
+ "name": "findByTenant",
1742
+ "async": true,
1743
+ "parameters": [
1744
+ {
1745
+ "name": "tenantId",
1746
+ "type": "string",
1747
+ "optional": false
1748
+ }
1749
+ ],
1750
+ "returnType": "Promise<FactSource[]>",
1751
+ "isStatic": false,
1752
+ "isPublic": true
1753
+ },
1754
+ "findGlobal": {
1755
+ "name": "findGlobal",
1756
+ "async": true,
1757
+ "parameters": [],
1758
+ "returnType": "Promise<FactSource[]>",
1759
+ "isStatic": false,
1760
+ "isPublic": true
1761
+ },
1762
+ "findWithGlobals": {
1763
+ "name": "findWithGlobals",
1764
+ "async": true,
1765
+ "parameters": [
1766
+ {
1767
+ "name": "tenantId",
1768
+ "type": "string",
1769
+ "optional": false
1770
+ }
1771
+ ],
1772
+ "returnType": "Promise<FactSource[]>",
1773
+ "isStatic": false,
1774
+ "isPublic": true
1775
+ }
1776
+ },
1777
+ "decoratorConfig": {},
1778
+ "extends": "SmrtCollection",
1779
+ "extendsTypeArg": "FactSource",
1780
+ "exportName": "FactSourceCollection",
1781
+ "collectionExportName": "FactSourceCollectionCollection",
1782
+ "schema": {
1783
+ "tableName": "fact_source_collections",
1784
+ "ddl": "CREATE TABLE IF NOT EXISTS \"fact_source_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
1785
+ "columns": {
1786
+ "id": {
1787
+ "type": "UUID",
1788
+ "primaryKey": true,
1789
+ "referenceKind": "id",
1790
+ "notNull": true
1791
+ },
1792
+ "slug": {
1793
+ "type": "TEXT",
1794
+ "notNull": true
1795
+ },
1796
+ "context": {
1797
+ "type": "TEXT",
1798
+ "notNull": true,
1799
+ "default": ""
1800
+ },
1801
+ "created_at": {
1802
+ "type": "TIMESTAMP",
1803
+ "notNull": true,
1804
+ "default": "current_timestamp"
1805
+ },
1806
+ "updated_at": {
1807
+ "type": "TIMESTAMP",
1808
+ "notNull": true,
1809
+ "default": "current_timestamp"
1810
+ }
1811
+ },
1812
+ "indexes": [
1813
+ {
1814
+ "name": "fact_source_collections_id_idx",
1815
+ "columns": [
1816
+ "id"
1817
+ ]
1818
+ },
1819
+ {
1820
+ "name": "fact_source_collections_slug_context_idx",
1821
+ "columns": [
1822
+ "slug",
1823
+ "context"
1824
+ ],
1825
+ "unique": true
1826
+ }
1827
+ ],
1828
+ "version": "36f4adef"
1829
+ }
1830
+ },
1831
+ "@happyvertical/smrt-facts:FactSubject": {
1832
+ "name": "factsubject",
1833
+ "className": "FactSubject",
1834
+ "qualifiedName": "@happyvertical/smrt-facts:FactSubject",
1835
+ "collection": "factsubjects",
1836
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/fact-subject.ts",
1837
+ "packageName": "@happyvertical/smrt-facts",
1838
+ "fields": {
1839
+ "factId": {
1840
+ "type": "foreignKey",
1841
+ "required": true,
1842
+ "related": "Fact",
1843
+ "_meta": {
1844
+ "required": true
1845
+ }
1846
+ },
1847
+ "entityType": {
1848
+ "type": "text",
1849
+ "required": true,
1850
+ "default": "",
1851
+ "_meta": {
1852
+ "required": true
1853
+ }
1854
+ },
1855
+ "entityId": {
1856
+ "type": "text",
1857
+ "required": true,
1858
+ "default": "",
1859
+ "_meta": {
1860
+ "required": true
1861
+ }
1862
+ },
1863
+ "role": {
1864
+ "type": "text",
1865
+ "required": false,
1866
+ "default": "subject"
1867
+ },
1868
+ "metadata": {
1869
+ "type": "text",
1870
+ "required": false,
1871
+ "default": ""
1872
+ },
1873
+ "tenantId": {
1874
+ "type": "text",
1875
+ "required": false,
1876
+ "_meta": {
1877
+ "sqlType": "UUID",
1878
+ "nullable": true,
1879
+ "__tenancy": {
1880
+ "isTenantIdField": true,
1881
+ "autoFilter": true,
1882
+ "required": false,
1883
+ "autoPopulate": true,
1884
+ "nullable": true,
1885
+ "mode": "optional",
1886
+ "field": "tenantId",
1887
+ "allowSuperAdminBypass": false
1888
+ }
1889
+ }
1890
+ },
1891
+ "createdAt": {
1892
+ "type": "datetime",
1893
+ "required": false
1894
+ },
1895
+ "updatedAt": {
1896
+ "type": "datetime",
1897
+ "required": false
1898
+ }
1899
+ },
1900
+ "methods": {
1901
+ "getRole": {
1902
+ "name": "getRole",
1903
+ "async": false,
1904
+ "parameters": [],
1905
+ "returnType": "SubjectRole",
1906
+ "isStatic": false,
1907
+ "isPublic": true
1908
+ },
1909
+ "getMetadata": {
1910
+ "name": "getMetadata",
1911
+ "async": false,
1912
+ "parameters": [],
1913
+ "returnType": "Record<string, any>",
1914
+ "isStatic": false,
1915
+ "isPublic": true
1916
+ },
1917
+ "setMetadata": {
1918
+ "name": "setMetadata",
1919
+ "async": false,
1920
+ "parameters": [
1921
+ {
1922
+ "name": "data",
1923
+ "type": "Record<string, any>",
1924
+ "optional": false
1925
+ }
1926
+ ],
1927
+ "returnType": "void",
1928
+ "isStatic": false,
1929
+ "isPublic": true
1930
+ },
1931
+ "updateMetadata": {
1932
+ "name": "updateMetadata",
1933
+ "async": false,
1934
+ "parameters": [
1935
+ {
1936
+ "name": "updates",
1937
+ "type": "Record<string, any>",
1938
+ "optional": false
1939
+ }
1940
+ ],
1941
+ "returnType": "void",
1942
+ "isStatic": false,
1943
+ "isPublic": true
1944
+ },
1945
+ "getFact": {
1946
+ "name": "getFact",
1947
+ "async": true,
1948
+ "parameters": [],
1949
+ "returnType": "Promise<null>",
1950
+ "isStatic": false,
1951
+ "isPublic": true
1952
+ }
1953
+ },
1954
+ "decoratorConfig": {
1955
+ "conflictColumns": [
1956
+ "fact_id",
1957
+ "entity_type",
1958
+ "entity_id"
1959
+ ],
1960
+ "api": {
1961
+ "include": [
1962
+ "list",
1963
+ "get",
1964
+ "create",
1965
+ "delete"
1966
+ ]
1967
+ },
1968
+ "mcp": {
1969
+ "include": [
1970
+ "list",
1971
+ "get",
1972
+ "create"
1973
+ ]
1974
+ },
1975
+ "cli": true,
1976
+ "tenantScoped": {
1977
+ "mode": "optional"
1978
+ }
1979
+ },
1980
+ "extends": "SmrtObject",
1981
+ "exportName": "FactSubject",
1982
+ "collectionExportName": "FactSubjectCollection",
1983
+ "validationRules": [
1984
+ {
1985
+ "field": "factId",
1986
+ "rule": "required",
1987
+ "fieldType": "foreignKey"
1988
+ },
1989
+ {
1990
+ "field": "entityType",
1991
+ "rule": "required",
1992
+ "fieldType": "text"
1993
+ },
1994
+ {
1995
+ "field": "entityId",
1996
+ "rule": "required",
1997
+ "fieldType": "text"
1998
+ }
1999
+ ],
2000
+ "schema": {
2001
+ "tableName": "fact_subjects",
2002
+ "ddl": "CREATE TABLE IF NOT EXISTS \"fact_subjects\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"fact_id\" UUID NOT NULL,\n \"entity_type\" TEXT NOT NULL DEFAULT '',\n \"entity_id\" TEXT NOT NULL DEFAULT '',\n \"role\" TEXT DEFAULT 'subject',\n \"metadata\" TEXT DEFAULT '',\n \"tenant_id\" UUID\n);",
2003
+ "columns": {
2004
+ "id": {
2005
+ "type": "UUID",
2006
+ "primaryKey": true,
2007
+ "referenceKind": "id",
2008
+ "notNull": true
2009
+ },
2010
+ "slug": {
2011
+ "type": "TEXT",
2012
+ "notNull": true
2013
+ },
2014
+ "context": {
2015
+ "type": "TEXT",
2016
+ "notNull": true,
2017
+ "default": ""
2018
+ },
2019
+ "created_at": {
2020
+ "type": "TIMESTAMP",
2021
+ "notNull": true,
2022
+ "default": "current_timestamp"
2023
+ },
2024
+ "updated_at": {
2025
+ "type": "TIMESTAMP",
2026
+ "notNull": true,
2027
+ "default": "current_timestamp"
2028
+ },
2029
+ "fact_id": {
2030
+ "type": "UUID",
2031
+ "referenceKind": "foreignKey",
2032
+ "notNull": true,
2033
+ "unique": false
2034
+ },
2035
+ "entity_type": {
2036
+ "type": "TEXT",
2037
+ "notNull": true,
2038
+ "unique": false,
2039
+ "default": ""
2040
+ },
2041
+ "entity_id": {
2042
+ "type": "TEXT",
2043
+ "notNull": true,
2044
+ "unique": false,
2045
+ "default": ""
2046
+ },
2047
+ "role": {
2048
+ "type": "TEXT",
2049
+ "notNull": false,
2050
+ "unique": false,
2051
+ "default": "subject"
2052
+ },
2053
+ "metadata": {
2054
+ "type": "TEXT",
2055
+ "notNull": false,
2056
+ "unique": false,
2057
+ "default": ""
2058
+ },
2059
+ "tenant_id": {
2060
+ "type": "UUID",
2061
+ "referenceKind": "tenantId",
2062
+ "notNull": false,
2063
+ "unique": false
2064
+ }
2065
+ },
2066
+ "indexes": [
2067
+ {
2068
+ "name": "fact_subjects_id_idx",
2069
+ "columns": [
2070
+ "id"
2071
+ ]
2072
+ },
2073
+ {
2074
+ "name": "fact_subjects_fact_id_entity_type_idx",
2075
+ "columns": [
2076
+ "fact_id",
2077
+ "entity_type",
2078
+ "entity_id"
2079
+ ],
2080
+ "unique": true
2081
+ }
2082
+ ],
2083
+ "version": "979731eb"
2084
+ }
2085
+ },
2086
+ "@happyvertical/smrt-facts:FactSubjectCollection": {
2087
+ "name": "factsubjectcollection",
2088
+ "className": "FactSubjectCollection",
2089
+ "qualifiedName": "@happyvertical/smrt-facts:FactSubjectCollection",
2090
+ "collection": "factsubjects",
2091
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/fact-subjects.ts",
2092
+ "packageName": "@happyvertical/smrt-facts",
2093
+ "fields": {},
2094
+ "methods": {
2095
+ "getForFact": {
2096
+ "name": "getForFact",
2097
+ "async": true,
2098
+ "parameters": [
2099
+ {
2100
+ "name": "factId",
2101
+ "type": "string",
2102
+ "optional": false
2103
+ }
2104
+ ],
2105
+ "returnType": "Promise<FactSubject[]>",
2106
+ "isStatic": false,
2107
+ "isPublic": true
2108
+ },
2109
+ "getForEntity": {
2110
+ "name": "getForEntity",
2111
+ "async": true,
2112
+ "parameters": [
2113
+ {
2114
+ "name": "entityType",
2115
+ "type": "string",
2116
+ "optional": false
2117
+ },
2118
+ {
2119
+ "name": "entityId",
2120
+ "type": "string",
2121
+ "optional": false
2122
+ }
2123
+ ],
2124
+ "returnType": "Promise<FactSubject[]>",
2125
+ "isStatic": false,
2126
+ "isPublic": true
2127
+ },
2128
+ "linkEntity": {
2129
+ "name": "linkEntity",
2130
+ "async": true,
2131
+ "parameters": [
2132
+ {
2133
+ "name": "factId",
2134
+ "type": "string",
2135
+ "optional": false
2136
+ },
2137
+ {
2138
+ "name": "entityType",
2139
+ "type": "string",
2140
+ "optional": false
2141
+ },
2142
+ {
2143
+ "name": "entityId",
2144
+ "type": "string",
2145
+ "optional": false
2146
+ },
2147
+ {
2148
+ "name": "role",
2149
+ "type": "SubjectRole",
2150
+ "optional": true,
2151
+ "default": "subject"
2152
+ }
2153
+ ],
2154
+ "returnType": "Promise<FactSubject>",
2155
+ "isStatic": false,
2156
+ "isPublic": true
2157
+ },
2158
+ "unlinkEntity": {
2159
+ "name": "unlinkEntity",
2160
+ "async": true,
2161
+ "parameters": [
2162
+ {
2163
+ "name": "factId",
2164
+ "type": "string",
2165
+ "optional": false
2166
+ },
2167
+ {
2168
+ "name": "entityType",
2169
+ "type": "string",
2170
+ "optional": false
2171
+ },
2172
+ {
2173
+ "name": "entityId",
2174
+ "type": "string",
2175
+ "optional": false
2176
+ }
2177
+ ],
2178
+ "returnType": "Promise<void>",
2179
+ "isStatic": false,
2180
+ "isPublic": true
2181
+ },
2182
+ "getByRole": {
2183
+ "name": "getByRole",
2184
+ "async": true,
2185
+ "parameters": [
2186
+ {
2187
+ "name": "factId",
2188
+ "type": "string",
2189
+ "optional": false
2190
+ },
2191
+ {
2192
+ "name": "role",
2193
+ "type": "SubjectRole",
2194
+ "optional": false
2195
+ }
2196
+ ],
2197
+ "returnType": "Promise<FactSubject[]>",
2198
+ "isStatic": false,
2199
+ "isPublic": true
2200
+ },
2201
+ "countForFact": {
2202
+ "name": "countForFact",
2203
+ "async": true,
2204
+ "parameters": [
2205
+ {
2206
+ "name": "factId",
2207
+ "type": "string",
2208
+ "optional": false
2209
+ }
2210
+ ],
2211
+ "returnType": "Promise<number>",
2212
+ "isStatic": false,
2213
+ "isPublic": true
2214
+ },
2215
+ "findByTenant": {
2216
+ "name": "findByTenant",
2217
+ "async": true,
2218
+ "parameters": [
2219
+ {
2220
+ "name": "tenantId",
2221
+ "type": "string",
2222
+ "optional": false
2223
+ }
2224
+ ],
2225
+ "returnType": "Promise<FactSubject[]>",
2226
+ "isStatic": false,
2227
+ "isPublic": true
2228
+ },
2229
+ "findGlobal": {
2230
+ "name": "findGlobal",
2231
+ "async": true,
2232
+ "parameters": [],
2233
+ "returnType": "Promise<FactSubject[]>",
2234
+ "isStatic": false,
2235
+ "isPublic": true
2236
+ },
2237
+ "findWithGlobals": {
2238
+ "name": "findWithGlobals",
2239
+ "async": true,
2240
+ "parameters": [
2241
+ {
2242
+ "name": "tenantId",
2243
+ "type": "string",
2244
+ "optional": false
2245
+ }
2246
+ ],
2247
+ "returnType": "Promise<FactSubject[]>",
2248
+ "isStatic": false,
2249
+ "isPublic": true
2250
+ }
2251
+ },
2252
+ "decoratorConfig": {},
2253
+ "extends": "SmrtCollection",
2254
+ "extendsTypeArg": "FactSubject",
2255
+ "exportName": "FactSubjectCollection",
2256
+ "collectionExportName": "FactSubjectCollectionCollection",
2257
+ "schema": {
2258
+ "tableName": "fact_subject_collections",
2259
+ "ddl": "CREATE TABLE IF NOT EXISTS \"fact_subject_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
2260
+ "columns": {
2261
+ "id": {
2262
+ "type": "UUID",
2263
+ "primaryKey": true,
2264
+ "referenceKind": "id",
2265
+ "notNull": true
2266
+ },
2267
+ "slug": {
2268
+ "type": "TEXT",
2269
+ "notNull": true
2270
+ },
2271
+ "context": {
2272
+ "type": "TEXT",
2273
+ "notNull": true,
2274
+ "default": ""
2275
+ },
2276
+ "created_at": {
2277
+ "type": "TIMESTAMP",
2278
+ "notNull": true,
2279
+ "default": "current_timestamp"
2280
+ },
2281
+ "updated_at": {
2282
+ "type": "TIMESTAMP",
2283
+ "notNull": true,
2284
+ "default": "current_timestamp"
2285
+ }
2286
+ },
2287
+ "indexes": [
2288
+ {
2289
+ "name": "fact_subject_collections_id_idx",
2290
+ "columns": [
2291
+ "id"
2292
+ ]
2293
+ },
2294
+ {
2295
+ "name": "fact_subject_collections_slug_context_idx",
2296
+ "columns": [
2297
+ "slug",
2298
+ "context"
2299
+ ],
2300
+ "unique": true
2301
+ }
2302
+ ],
2303
+ "version": "0ce73db4"
2304
+ }
2305
+ },
2306
+ "@happyvertical/smrt-facts:FactTag": {
2307
+ "name": "facttag",
2308
+ "className": "FactTag",
2309
+ "qualifiedName": "@happyvertical/smrt-facts:FactTag",
2310
+ "collection": "facttags",
2311
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/fact-tag.ts",
2312
+ "packageName": "@happyvertical/smrt-facts",
2313
+ "fields": {
2314
+ "factId": {
2315
+ "type": "foreignKey",
2316
+ "required": true,
2317
+ "related": "Fact",
2318
+ "_meta": {
2319
+ "required": true
2320
+ }
2321
+ },
2322
+ "tagSlug": {
2323
+ "type": "text",
2324
+ "required": true,
2325
+ "default": "",
2326
+ "_meta": {
2327
+ "required": true
2328
+ }
2329
+ },
2330
+ "metadata": {
2331
+ "type": "text",
2332
+ "required": false,
2333
+ "default": ""
2334
+ },
2335
+ "tenantId": {
2336
+ "type": "text",
2337
+ "required": false,
2338
+ "_meta": {
2339
+ "sqlType": "UUID",
2340
+ "nullable": true,
2341
+ "__tenancy": {
2342
+ "isTenantIdField": true,
2343
+ "autoFilter": true,
2344
+ "required": false,
2345
+ "autoPopulate": true,
2346
+ "nullable": true,
2347
+ "mode": "optional",
2348
+ "field": "tenantId",
2349
+ "allowSuperAdminBypass": false
2350
+ }
2351
+ }
2352
+ },
2353
+ "createdAt": {
2354
+ "type": "datetime",
2355
+ "required": false
2356
+ },
2357
+ "updatedAt": {
2358
+ "type": "datetime",
2359
+ "required": false
2360
+ }
2361
+ },
2362
+ "methods": {
2363
+ "getMetadata": {
2364
+ "name": "getMetadata",
2365
+ "async": false,
2366
+ "parameters": [],
2367
+ "returnType": "Record<string, any>",
2368
+ "isStatic": false,
2369
+ "isPublic": true
2370
+ },
2371
+ "setMetadata": {
2372
+ "name": "setMetadata",
2373
+ "async": false,
2374
+ "parameters": [
2375
+ {
2376
+ "name": "data",
2377
+ "type": "Record<string, any>",
2378
+ "optional": false
2379
+ }
2380
+ ],
2381
+ "returnType": "void",
2382
+ "isStatic": false,
2383
+ "isPublic": true
2384
+ },
2385
+ "updateMetadata": {
2386
+ "name": "updateMetadata",
2387
+ "async": false,
2388
+ "parameters": [
2389
+ {
2390
+ "name": "updates",
2391
+ "type": "Record<string, any>",
2392
+ "optional": false
2393
+ }
2394
+ ],
2395
+ "returnType": "void",
2396
+ "isStatic": false,
2397
+ "isPublic": true
2398
+ },
2399
+ "getFact": {
2400
+ "name": "getFact",
2401
+ "async": true,
2402
+ "parameters": [],
2403
+ "returnType": "Promise<null>",
2404
+ "isStatic": false,
2405
+ "isPublic": true
2406
+ }
2407
+ },
2408
+ "decoratorConfig": {
2409
+ "conflictColumns": [
2410
+ "fact_id",
2411
+ "tag_slug"
2412
+ ],
2413
+ "api": {
2414
+ "include": [
2415
+ "list",
2416
+ "get",
2417
+ "create",
2418
+ "delete"
2419
+ ]
2420
+ },
2421
+ "mcp": {
2422
+ "include": [
2423
+ "list",
2424
+ "get",
2425
+ "create"
2426
+ ]
2427
+ },
2428
+ "cli": true,
2429
+ "tenantScoped": {
2430
+ "mode": "optional"
2431
+ }
2432
+ },
2433
+ "extends": "SmrtObject",
2434
+ "exportName": "FactTag",
2435
+ "collectionExportName": "FactTagCollection",
2436
+ "validationRules": [
2437
+ {
2438
+ "field": "factId",
2439
+ "rule": "required",
2440
+ "fieldType": "foreignKey"
2441
+ },
2442
+ {
2443
+ "field": "tagSlug",
2444
+ "rule": "required",
2445
+ "fieldType": "text"
2446
+ }
2447
+ ],
2448
+ "schema": {
2449
+ "tableName": "fact_tags",
2450
+ "ddl": "CREATE TABLE IF NOT EXISTS \"fact_tags\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"fact_id\" UUID NOT NULL,\n \"tag_slug\" TEXT NOT NULL DEFAULT '',\n \"metadata\" TEXT DEFAULT '',\n \"tenant_id\" UUID\n);",
2451
+ "columns": {
2452
+ "id": {
2453
+ "type": "UUID",
2454
+ "primaryKey": true,
2455
+ "referenceKind": "id",
2456
+ "notNull": true
2457
+ },
2458
+ "slug": {
2459
+ "type": "TEXT",
2460
+ "notNull": true
2461
+ },
2462
+ "context": {
2463
+ "type": "TEXT",
2464
+ "notNull": true,
2465
+ "default": ""
2466
+ },
2467
+ "created_at": {
2468
+ "type": "TIMESTAMP",
2469
+ "notNull": true,
2470
+ "default": "current_timestamp"
2471
+ },
2472
+ "updated_at": {
2473
+ "type": "TIMESTAMP",
2474
+ "notNull": true,
2475
+ "default": "current_timestamp"
2476
+ },
2477
+ "fact_id": {
2478
+ "type": "UUID",
2479
+ "referenceKind": "foreignKey",
2480
+ "notNull": true,
2481
+ "unique": false
2482
+ },
2483
+ "tag_slug": {
2484
+ "type": "TEXT",
2485
+ "notNull": true,
2486
+ "unique": false,
2487
+ "default": ""
2488
+ },
2489
+ "metadata": {
2490
+ "type": "TEXT",
2491
+ "notNull": false,
2492
+ "unique": false,
2493
+ "default": ""
2494
+ },
2495
+ "tenant_id": {
2496
+ "type": "UUID",
2497
+ "referenceKind": "tenantId",
2498
+ "notNull": false,
2499
+ "unique": false
2500
+ }
2501
+ },
2502
+ "indexes": [
2503
+ {
2504
+ "name": "fact_tags_id_idx",
2505
+ "columns": [
2506
+ "id"
2507
+ ]
2508
+ },
2509
+ {
2510
+ "name": "fact_tags_fact_id_tag_slug_idx",
2511
+ "columns": [
2512
+ "fact_id",
2513
+ "tag_slug"
2514
+ ],
2515
+ "unique": true
2516
+ }
2517
+ ],
2518
+ "version": "ebb242b1"
2519
+ }
2520
+ },
2521
+ "@happyvertical/smrt-facts:FactTagCollection": {
2522
+ "name": "facttagcollection",
2523
+ "className": "FactTagCollection",
2524
+ "qualifiedName": "@happyvertical/smrt-facts:FactTagCollection",
2525
+ "collection": "facttags",
2526
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/fact-tags.ts",
2527
+ "packageName": "@happyvertical/smrt-facts",
2528
+ "fields": {},
2529
+ "methods": {
2530
+ "getForFact": {
2531
+ "name": "getForFact",
2532
+ "async": true,
2533
+ "parameters": [
2534
+ {
2535
+ "name": "factId",
2536
+ "type": "string",
2537
+ "optional": false
2538
+ }
2539
+ ],
2540
+ "returnType": "Promise<FactTag[]>",
2541
+ "isStatic": false,
2542
+ "isPublic": true
2543
+ },
2544
+ "getForTag": {
2545
+ "name": "getForTag",
2546
+ "async": true,
2547
+ "parameters": [
2548
+ {
2549
+ "name": "tagSlug",
2550
+ "type": "string",
2551
+ "optional": false
2552
+ }
2553
+ ],
2554
+ "returnType": "Promise<FactTag[]>",
2555
+ "isStatic": false,
2556
+ "isPublic": true
2557
+ },
2558
+ "addTag": {
2559
+ "name": "addTag",
2560
+ "async": true,
2561
+ "parameters": [
2562
+ {
2563
+ "name": "factId",
2564
+ "type": "string",
2565
+ "optional": false
2566
+ },
2567
+ {
2568
+ "name": "tagSlug",
2569
+ "type": "string",
2570
+ "optional": false
2571
+ }
2572
+ ],
2573
+ "returnType": "Promise<FactTag>",
2574
+ "isStatic": false,
2575
+ "isPublic": true
2576
+ },
2577
+ "removeTag": {
2578
+ "name": "removeTag",
2579
+ "async": true,
2580
+ "parameters": [
2581
+ {
2582
+ "name": "factId",
2583
+ "type": "string",
2584
+ "optional": false
2585
+ },
2586
+ {
2587
+ "name": "tagSlug",
2588
+ "type": "string",
2589
+ "optional": false
2590
+ }
2591
+ ],
2592
+ "returnType": "Promise<void>",
2593
+ "isStatic": false,
2594
+ "isPublic": true
2595
+ },
2596
+ "getTagSlugs": {
2597
+ "name": "getTagSlugs",
2598
+ "async": true,
2599
+ "parameters": [
2600
+ {
2601
+ "name": "factId",
2602
+ "type": "string",
2603
+ "optional": false
2604
+ }
2605
+ ],
2606
+ "returnType": "Promise<string[]>",
2607
+ "isStatic": false,
2608
+ "isPublic": true
2609
+ },
2610
+ "findByTenant": {
2611
+ "name": "findByTenant",
2612
+ "async": true,
2613
+ "parameters": [
2614
+ {
2615
+ "name": "tenantId",
2616
+ "type": "string",
2617
+ "optional": false
2618
+ }
2619
+ ],
2620
+ "returnType": "Promise<FactTag[]>",
2621
+ "isStatic": false,
2622
+ "isPublic": true
2623
+ },
2624
+ "findGlobal": {
2625
+ "name": "findGlobal",
2626
+ "async": true,
2627
+ "parameters": [],
2628
+ "returnType": "Promise<FactTag[]>",
2629
+ "isStatic": false,
2630
+ "isPublic": true
2631
+ },
2632
+ "findWithGlobals": {
2633
+ "name": "findWithGlobals",
2634
+ "async": true,
2635
+ "parameters": [
2636
+ {
2637
+ "name": "tenantId",
2638
+ "type": "string",
2639
+ "optional": false
2640
+ }
2641
+ ],
2642
+ "returnType": "Promise<FactTag[]>",
2643
+ "isStatic": false,
2644
+ "isPublic": true
2645
+ }
2646
+ },
2647
+ "decoratorConfig": {},
2648
+ "extends": "SmrtCollection",
2649
+ "extendsTypeArg": "FactTag",
2650
+ "exportName": "FactTagCollection",
2651
+ "collectionExportName": "FactTagCollectionCollection",
2652
+ "schema": {
2653
+ "tableName": "fact_tag_collections",
2654
+ "ddl": "CREATE TABLE IF NOT EXISTS \"fact_tag_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
2655
+ "columns": {
2656
+ "id": {
2657
+ "type": "UUID",
2658
+ "primaryKey": true,
2659
+ "referenceKind": "id",
2660
+ "notNull": true
2661
+ },
2662
+ "slug": {
2663
+ "type": "TEXT",
2664
+ "notNull": true
2665
+ },
2666
+ "context": {
2667
+ "type": "TEXT",
2668
+ "notNull": true,
2669
+ "default": ""
2670
+ },
2671
+ "created_at": {
2672
+ "type": "TIMESTAMP",
2673
+ "notNull": true,
2674
+ "default": "current_timestamp"
2675
+ },
2676
+ "updated_at": {
2677
+ "type": "TIMESTAMP",
2678
+ "notNull": true,
2679
+ "default": "current_timestamp"
2680
+ }
2681
+ },
2682
+ "indexes": [
2683
+ {
2684
+ "name": "fact_tag_collections_id_idx",
2685
+ "columns": [
2686
+ "id"
2687
+ ]
2688
+ },
2689
+ {
2690
+ "name": "fact_tag_collections_slug_context_idx",
2691
+ "columns": [
2692
+ "slug",
2693
+ "context"
2694
+ ],
2695
+ "unique": true
2696
+ }
2697
+ ],
2698
+ "version": "4bac3c1d"
2699
+ }
2700
+ },
2701
+ "@happyvertical/smrt-facts:Fact": {
2702
+ "name": "fact",
2703
+ "className": "Fact",
2704
+ "qualifiedName": "@happyvertical/smrt-facts:Fact",
2705
+ "collection": "facts",
2706
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/fact.ts",
2707
+ "packageName": "@happyvertical/smrt-facts",
2708
+ "fields": {
2709
+ "created_at": {
2710
+ "type": "datetime",
2711
+ "required": false
2712
+ },
2713
+ "updated_at": {
2714
+ "type": "datetime",
2715
+ "required": false
2716
+ },
2717
+ "textRefined": {
2718
+ "type": "text",
2719
+ "required": true,
2720
+ "default": "",
2721
+ "_meta": {
2722
+ "required": true
2723
+ }
2724
+ },
2725
+ "textRaw": {
2726
+ "type": "text",
2727
+ "required": false,
2728
+ "default": ""
2729
+ },
2730
+ "type": {
2731
+ "type": "text",
2732
+ "required": true,
2733
+ "default": "assertion",
2734
+ "_meta": {
2735
+ "required": true
2736
+ }
2737
+ },
2738
+ "status": {
2739
+ "type": "text",
2740
+ "required": true,
2741
+ "default": "pending",
2742
+ "_meta": {
2743
+ "required": true
2744
+ }
2745
+ },
2746
+ "domain": {
2747
+ "type": "text",
2748
+ "required": false,
2749
+ "default": ""
2750
+ },
2751
+ "previousFactId": {
2752
+ "type": "foreignKey",
2753
+ "required": false,
2754
+ "related": "Fact"
2755
+ },
2756
+ "evolutionType": {
2757
+ "type": "text",
2758
+ "required": false,
2759
+ "default": "original"
2760
+ },
2761
+ "sourceCount": {
2762
+ "type": "integer",
2763
+ "required": false,
2764
+ "default": 0
2765
+ },
2766
+ "confidence": {
2767
+ "type": "decimal",
2768
+ "required": false,
2769
+ "default": 0
2770
+ },
2771
+ "metadata": {
2772
+ "type": "text",
2773
+ "required": false,
2774
+ "default": ""
2775
+ },
2776
+ "tenantId": {
2777
+ "type": "text",
2778
+ "required": false,
2779
+ "_meta": {
2780
+ "sqlType": "UUID",
2781
+ "nullable": true,
2782
+ "__tenancy": {
2783
+ "isTenantIdField": true,
2784
+ "autoFilter": true,
2785
+ "required": false,
2786
+ "autoPopulate": true,
2787
+ "nullable": true,
2788
+ "mode": "optional",
2789
+ "field": "tenantId",
2790
+ "allowSuperAdminBypass": false
2791
+ }
2792
+ }
2793
+ },
2794
+ "createdAt": {
2795
+ "type": "datetime",
2796
+ "required": false
2797
+ },
2798
+ "updatedAt": {
2799
+ "type": "datetime",
2800
+ "required": false
2801
+ }
2802
+ },
2803
+ "methods": {
2804
+ "getAiUsageSnapshot": {
2805
+ "name": "getAiUsageSnapshot",
2806
+ "async": false,
2807
+ "parameters": [],
2808
+ "returnType": "AiUsageSnapshot | undefined",
2809
+ "isStatic": false,
2810
+ "isPublic": true
2811
+ },
2812
+ "resetAiUsage": {
2813
+ "name": "resetAiUsage",
2814
+ "async": false,
2815
+ "parameters": [],
2816
+ "returnType": "void",
2817
+ "isStatic": false,
2818
+ "isPublic": true
2819
+ },
2820
+ "listAiUsage": {
2821
+ "name": "listAiUsage",
2822
+ "async": true,
2823
+ "parameters": [
2824
+ {
2825
+ "name": "options",
2826
+ "type": "AiUsageListOptions",
2827
+ "optional": true
2828
+ }
2829
+ ],
2830
+ "returnType": "Promise<SmrtAiUsageRecord[]>",
2831
+ "isStatic": false,
2832
+ "isPublic": true
2833
+ },
2834
+ "summarizeAiUsage": {
2835
+ "name": "summarizeAiUsage",
2836
+ "async": true,
2837
+ "parameters": [
2838
+ {
2839
+ "name": "options",
2840
+ "type": "AiUsageSummaryOptions",
2841
+ "optional": true
2842
+ }
2843
+ ],
2844
+ "returnType": "Promise<Record<string, AiUsageStats>>",
2845
+ "isStatic": false,
2846
+ "isPublic": true
2847
+ },
2848
+ "destroy": {
2849
+ "name": "destroy",
2850
+ "async": false,
2851
+ "parameters": [],
2852
+ "returnType": "void",
2853
+ "isStatic": false,
2854
+ "isPublic": true
2855
+ },
2856
+ "markAsPersisted": {
2857
+ "name": "markAsPersisted",
2858
+ "async": false,
2859
+ "parameters": [],
2860
+ "returnType": "void",
2861
+ "isStatic": false,
2862
+ "isPublic": true
2863
+ },
2864
+ "initialize": {
2865
+ "name": "initialize",
2866
+ "async": true,
2867
+ "parameters": [],
2868
+ "returnType": "Promise",
2869
+ "isStatic": false,
2870
+ "isPublic": true
2871
+ },
2872
+ "loadDataFromDb": {
2873
+ "name": "loadDataFromDb",
2874
+ "async": true,
2875
+ "parameters": [
2876
+ {
2877
+ "name": "data",
2878
+ "type": "any",
2879
+ "optional": false
2880
+ }
2881
+ ],
2882
+ "returnType": "any",
2883
+ "isStatic": false,
2884
+ "isPublic": true
2885
+ },
2886
+ "getFields": {
2887
+ "name": "getFields",
2888
+ "async": true,
2889
+ "parameters": [],
2890
+ "returnType": "any",
2891
+ "isStatic": false,
2892
+ "isPublic": true
2893
+ },
2894
+ "toJSON": {
2895
+ "name": "toJSON",
2896
+ "async": false,
2897
+ "parameters": [],
2898
+ "returnType": "any",
2899
+ "isStatic": false,
2900
+ "isPublic": true
2901
+ },
2902
+ "toPlainObject": {
2903
+ "name": "toPlainObject",
2904
+ "async": false,
2905
+ "parameters": [],
2906
+ "returnType": "Record<string>",
2907
+ "isStatic": false,
2908
+ "isPublic": true
2909
+ },
2910
+ "toPublicJSON": {
2911
+ "name": "toPublicJSON",
2912
+ "async": false,
2913
+ "parameters": [],
2914
+ "returnType": "Record<string>",
2915
+ "isStatic": false,
2916
+ "isPublic": true
2917
+ },
2918
+ "getId": {
2919
+ "name": "getId",
2920
+ "async": true,
2921
+ "parameters": [],
2922
+ "returnType": "any",
2923
+ "isStatic": false,
2924
+ "isPublic": true
2925
+ },
2926
+ "getSlug": {
2927
+ "name": "getSlug",
2928
+ "async": true,
2929
+ "parameters": [],
2930
+ "returnType": "any",
2931
+ "isStatic": false,
2932
+ "isPublic": true
2933
+ },
2934
+ "getSavedId": {
2935
+ "name": "getSavedId",
2936
+ "async": true,
2937
+ "parameters": [],
2938
+ "returnType": "any",
2939
+ "isStatic": false,
2940
+ "isPublic": true
2941
+ },
2942
+ "isSaved": {
2943
+ "name": "isSaved",
2944
+ "async": true,
2945
+ "parameters": [],
2946
+ "returnType": "any",
2947
+ "isStatic": false,
2948
+ "isPublic": true
2949
+ },
2950
+ "save": {
2951
+ "name": "save",
2952
+ "async": true,
2953
+ "parameters": [],
2954
+ "returnType": "any",
2955
+ "isStatic": false,
2956
+ "isPublic": true
2957
+ },
2958
+ "classifyConstraintError": {
2959
+ "name": "classifyConstraintError",
2960
+ "async": false,
2961
+ "parameters": [
2962
+ {
2963
+ "name": "message",
2964
+ "type": "string",
2965
+ "optional": false
2966
+ }
2967
+ ],
2968
+ "returnType": "'unique' | 'not_null' | null",
2969
+ "isStatic": true,
2970
+ "isPublic": true
2971
+ },
2972
+ "loadFromId": {
2973
+ "name": "loadFromId",
2974
+ "async": true,
2975
+ "parameters": [],
2976
+ "returnType": "any",
2977
+ "isStatic": false,
2978
+ "isPublic": true
2979
+ },
2980
+ "loadFromSlug": {
2981
+ "name": "loadFromSlug",
2982
+ "async": true,
2983
+ "parameters": [],
2984
+ "returnType": "any",
2985
+ "isStatic": false,
2986
+ "isPublic": true
2987
+ },
2988
+ "is": {
2989
+ "name": "is",
2990
+ "async": true,
2991
+ "parameters": [
2992
+ {
2993
+ "name": "criteria",
2994
+ "type": "string",
2995
+ "optional": false
2996
+ },
2997
+ {
2998
+ "name": "options",
2999
+ "type": "any",
3000
+ "optional": true
3001
+ }
3002
+ ],
3003
+ "returnType": "any",
3004
+ "isStatic": false,
3005
+ "isPublic": true
3006
+ },
3007
+ "do": {
3008
+ "name": "do",
3009
+ "async": true,
3010
+ "parameters": [
3011
+ {
3012
+ "name": "instructions",
3013
+ "type": "string",
3014
+ "optional": false
3015
+ },
3016
+ {
3017
+ "name": "options",
3018
+ "type": "any",
3019
+ "optional": true
3020
+ }
3021
+ ],
3022
+ "returnType": "any",
3023
+ "isStatic": false,
3024
+ "isPublic": true
3025
+ },
3026
+ "describe": {
3027
+ "name": "describe",
3028
+ "async": true,
3029
+ "parameters": [
3030
+ {
3031
+ "name": "options",
3032
+ "type": "any",
3033
+ "optional": true
3034
+ }
3035
+ ],
3036
+ "returnType": "any",
3037
+ "isStatic": false,
3038
+ "isPublic": true
3039
+ },
3040
+ "delete": {
3041
+ "name": "delete",
3042
+ "async": true,
3043
+ "parameters": [],
3044
+ "returnType": "Promise<void>",
3045
+ "isStatic": false,
3046
+ "isPublic": true
3047
+ },
3048
+ "isRelatedLoaded": {
3049
+ "name": "isRelatedLoaded",
3050
+ "async": false,
3051
+ "parameters": [
3052
+ {
3053
+ "name": "fieldName",
3054
+ "type": "string",
3055
+ "optional": false
3056
+ }
3057
+ ],
3058
+ "returnType": "boolean",
3059
+ "isStatic": false,
3060
+ "isPublic": true
3061
+ },
3062
+ "loadRelated": {
3063
+ "name": "loadRelated",
3064
+ "async": true,
3065
+ "parameters": [
3066
+ {
3067
+ "name": "fieldName",
3068
+ "type": "string",
3069
+ "optional": false
3070
+ },
3071
+ {
3072
+ "name": "opts",
3073
+ "type": "LoadRelatedOptions",
3074
+ "optional": true
3075
+ }
3076
+ ],
3077
+ "returnType": "Promise<any>",
3078
+ "isStatic": false,
3079
+ "isPublic": true
3080
+ },
3081
+ "loadRelatedMany": {
3082
+ "name": "loadRelatedMany",
3083
+ "async": true,
3084
+ "parameters": [
3085
+ {
3086
+ "name": "fieldName",
3087
+ "type": "string",
3088
+ "optional": false
3089
+ },
3090
+ {
3091
+ "name": "opts",
3092
+ "type": "LoadRelatedOptions",
3093
+ "optional": true
3094
+ }
3095
+ ],
3096
+ "returnType": "Promise<any[]>",
3097
+ "isStatic": false,
3098
+ "isPublic": true
3099
+ },
3100
+ "getRelated": {
3101
+ "name": "getRelated",
3102
+ "async": true,
3103
+ "parameters": [
3104
+ {
3105
+ "name": "fieldName",
3106
+ "type": "string",
3107
+ "optional": false
3108
+ },
3109
+ {
3110
+ "name": "opts",
3111
+ "type": "LoadRelatedOptions",
3112
+ "optional": true
3113
+ }
3114
+ ],
3115
+ "returnType": "Promise<any>",
3116
+ "isStatic": false,
3117
+ "isPublic": true
3118
+ },
3119
+ "getAvailableTools": {
3120
+ "name": "getAvailableTools",
3121
+ "async": false,
3122
+ "parameters": [],
3123
+ "returnType": "AITool[]",
3124
+ "isStatic": false,
3125
+ "isPublic": true
3126
+ },
3127
+ "executeToolCall": {
3128
+ "name": "executeToolCall",
3129
+ "async": true,
3130
+ "parameters": [
3131
+ {
3132
+ "name": "toolCall",
3133
+ "type": "ToolCall",
3134
+ "optional": false
3135
+ }
3136
+ ],
3137
+ "returnType": "Promise<ToolCallResult>",
3138
+ "isStatic": false,
3139
+ "isPublic": true
3140
+ },
3141
+ "remember": {
3142
+ "name": "remember",
3143
+ "async": true,
3144
+ "parameters": [
3145
+ {
3146
+ "name": "options",
3147
+ "type": "object",
3148
+ "optional": false
3149
+ }
3150
+ ],
3151
+ "returnType": "Promise<void>",
3152
+ "isStatic": false,
3153
+ "isPublic": true
3154
+ },
3155
+ "recall": {
3156
+ "name": "recall",
3157
+ "async": true,
3158
+ "parameters": [
3159
+ {
3160
+ "name": "options",
3161
+ "type": "object",
3162
+ "optional": false
3163
+ }
3164
+ ],
3165
+ "returnType": "Promise<any | null>",
3166
+ "isStatic": false,
3167
+ "isPublic": true
3168
+ },
3169
+ "recallAll": {
3170
+ "name": "recallAll",
3171
+ "async": true,
3172
+ "parameters": [
3173
+ {
3174
+ "name": "options",
3175
+ "type": "object",
3176
+ "optional": true
3177
+ }
3178
+ ],
3179
+ "returnType": "Promise<Map<string, any>>",
3180
+ "isStatic": false,
3181
+ "isPublic": true
3182
+ },
3183
+ "forget": {
3184
+ "name": "forget",
3185
+ "async": true,
3186
+ "parameters": [
3187
+ {
3188
+ "name": "options",
3189
+ "type": "object",
3190
+ "optional": false
3191
+ }
3192
+ ],
3193
+ "returnType": "Promise<void>",
3194
+ "isStatic": false,
3195
+ "isPublic": true
3196
+ },
3197
+ "forgetScope": {
3198
+ "name": "forgetScope",
3199
+ "async": true,
3200
+ "parameters": [
3201
+ {
3202
+ "name": "options",
3203
+ "type": "object",
3204
+ "optional": false
3205
+ }
3206
+ ],
3207
+ "returnType": "Promise<number>",
3208
+ "isStatic": false,
3209
+ "isPublic": true
3210
+ },
3211
+ "generateEmbeddings": {
3212
+ "name": "generateEmbeddings",
3213
+ "async": true,
3214
+ "parameters": [
3215
+ {
3216
+ "name": "options",
3217
+ "type": "GenerateEmbeddingsOptions",
3218
+ "optional": true
3219
+ }
3220
+ ],
3221
+ "returnType": "Promise<void>",
3222
+ "isStatic": false,
3223
+ "isPublic": true
3224
+ },
3225
+ "getEmbedding": {
3226
+ "name": "getEmbedding",
3227
+ "async": true,
3228
+ "parameters": [
3229
+ {
3230
+ "name": "fieldName",
3231
+ "type": "string",
3232
+ "optional": false
3233
+ },
3234
+ {
3235
+ "name": "model",
3236
+ "type": "string",
3237
+ "optional": true
3238
+ }
3239
+ ],
3240
+ "returnType": "Promise<number[] | null>",
3241
+ "isStatic": false,
3242
+ "isPublic": true
3243
+ },
3244
+ "hasStaleEmbeddings": {
3245
+ "name": "hasStaleEmbeddings",
3246
+ "async": true,
3247
+ "parameters": [],
3248
+ "returnType": "Promise<boolean>",
3249
+ "isStatic": false,
3250
+ "isPublic": true
3251
+ },
3252
+ "clearEmbeddings": {
3253
+ "name": "clearEmbeddings",
3254
+ "async": true,
3255
+ "parameters": [],
3256
+ "returnType": "Promise<void>",
3257
+ "isStatic": false,
3258
+ "isPublic": true
3259
+ },
3260
+ "getMetadata": {
3261
+ "name": "getMetadata",
3262
+ "async": false,
3263
+ "parameters": [],
3264
+ "returnType": "FactMetadata",
3265
+ "isStatic": false,
3266
+ "isPublic": true
3267
+ },
3268
+ "setMetadata": {
3269
+ "name": "setMetadata",
3270
+ "async": false,
3271
+ "parameters": [
3272
+ {
3273
+ "name": "data",
3274
+ "type": "FactMetadata",
3275
+ "optional": false
3276
+ }
3277
+ ],
3278
+ "returnType": "void",
3279
+ "isStatic": false,
3280
+ "isPublic": true
3281
+ },
3282
+ "updateMetadata": {
3283
+ "name": "updateMetadata",
3284
+ "async": false,
3285
+ "parameters": [
3286
+ {
3287
+ "name": "updates",
3288
+ "type": "Partial<FactMetadata>",
3289
+ "optional": false
3290
+ }
3291
+ ],
3292
+ "returnType": "void",
3293
+ "isStatic": false,
3294
+ "isPublic": true
3295
+ },
3296
+ "getType": {
3297
+ "name": "getType",
3298
+ "async": false,
3299
+ "parameters": [],
3300
+ "returnType": "FactType",
3301
+ "isStatic": false,
3302
+ "isPublic": true
3303
+ },
3304
+ "getStatus": {
3305
+ "name": "getStatus",
3306
+ "async": false,
3307
+ "parameters": [],
3308
+ "returnType": "FactStatus",
3309
+ "isStatic": false,
3310
+ "isPublic": true
3311
+ },
3312
+ "getEvolutionType": {
3313
+ "name": "getEvolutionType",
3314
+ "async": false,
3315
+ "parameters": [],
3316
+ "returnType": "EvolutionType",
3317
+ "isStatic": false,
3318
+ "isPublic": true
3319
+ },
3320
+ "isActive": {
3321
+ "name": "isActive",
3322
+ "async": false,
3323
+ "parameters": [],
3324
+ "returnType": "boolean",
3325
+ "isStatic": false,
3326
+ "isPublic": true
3327
+ },
3328
+ "isSuperseded": {
3329
+ "name": "isSuperseded",
3330
+ "async": false,
3331
+ "parameters": [],
3332
+ "returnType": "boolean",
3333
+ "isStatic": false,
3334
+ "isPublic": true
3335
+ },
3336
+ "hasPredecessor": {
3337
+ "name": "hasPredecessor",
3338
+ "async": false,
3339
+ "parameters": [],
3340
+ "returnType": "boolean",
3341
+ "isStatic": false,
3342
+ "isPublic": true
3343
+ },
3344
+ "getPredecessor": {
3345
+ "name": "getPredecessor",
3346
+ "async": true,
3347
+ "parameters": [],
3348
+ "returnType": "Promise<Fact | null>",
3349
+ "isStatic": false,
3350
+ "isPublic": true
3351
+ },
3352
+ "getSuccessors": {
3353
+ "name": "getSuccessors",
3354
+ "async": true,
3355
+ "parameters": [],
3356
+ "returnType": "Promise<Fact[]>",
3357
+ "isStatic": false,
3358
+ "isPublic": true
3359
+ },
3360
+ "getSources": {
3361
+ "name": "getSources",
3362
+ "async": true,
3363
+ "parameters": [],
3364
+ "returnType": "Promise",
3365
+ "isStatic": false,
3366
+ "isPublic": true
3367
+ },
3368
+ "getSubjects": {
3369
+ "name": "getSubjects",
3370
+ "async": true,
3371
+ "parameters": [],
3372
+ "returnType": "Promise",
3373
+ "isStatic": false,
3374
+ "isPublic": true
3375
+ }
3376
+ },
3377
+ "decoratorConfig": {
3378
+ "tableStrategy": "sti",
3379
+ "embeddings": {
3380
+ "fields": [
3381
+ "textRefined"
3382
+ ],
3383
+ "provider": "auto",
3384
+ "autoGenerate": true,
3385
+ "combinedField": {
3386
+ "name": "full_context",
3387
+ "template": "{textRefined}\n\nType: {type}\nDomain: {domain}"
3388
+ }
3389
+ },
3390
+ "api": {
3391
+ "include": [
3392
+ "list",
3393
+ "get",
3394
+ "create",
3395
+ "update",
3396
+ "delete"
3397
+ ]
3398
+ },
3399
+ "mcp": {
3400
+ "include": [
3401
+ "list",
3402
+ "get",
3403
+ "create",
3404
+ "update"
3405
+ ]
3406
+ },
3407
+ "cli": true,
3408
+ "tenantScoped": {
3409
+ "mode": "optional"
3410
+ }
3411
+ },
3412
+ "extends": "SmrtObject",
3413
+ "exportName": "Fact",
3414
+ "collectionExportName": "FactCollection",
3415
+ "validationRules": [
3416
+ {
3417
+ "field": "textRefined",
3418
+ "rule": "required",
3419
+ "fieldType": "text"
3420
+ },
3421
+ {
3422
+ "field": "type",
3423
+ "rule": "required",
3424
+ "fieldType": "text"
3425
+ },
3426
+ {
3427
+ "field": "status",
3428
+ "rule": "required",
3429
+ "fieldType": "text"
3430
+ }
3431
+ ],
3432
+ "schema": {
3433
+ "tableName": "facts",
3434
+ "ddl": "CREATE TABLE IF NOT EXISTS \"facts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"text_refined\" TEXT DEFAULT '',\n \"text_raw\" TEXT DEFAULT '',\n \"type\" TEXT DEFAULT 'assertion',\n \"status\" TEXT DEFAULT 'pending',\n \"domain\" TEXT DEFAULT '',\n \"previous_fact_id\" UUID,\n \"evolution_type\" TEXT DEFAULT 'original',\n \"source_count\" INTEGER DEFAULT 0,\n \"confidence\" REAL DEFAULT 0,\n \"metadata\" TEXT DEFAULT '',\n \"tenant_id\" UUID\n);",
3435
+ "columns": {
3436
+ "id": {
3437
+ "type": "UUID",
3438
+ "primaryKey": true,
3439
+ "referenceKind": "id",
3440
+ "notNull": true
3441
+ },
3442
+ "slug": {
3443
+ "type": "TEXT",
3444
+ "notNull": true
3445
+ },
3446
+ "context": {
3447
+ "type": "TEXT",
3448
+ "notNull": true,
3449
+ "default": ""
3450
+ },
3451
+ "_meta_type": {
3452
+ "type": "TEXT",
3453
+ "notNull": true
3454
+ },
3455
+ "_meta_data": {
3456
+ "type": "JSON",
3457
+ "notNull": false
3458
+ },
3459
+ "created_at": {
3460
+ "type": "TIMESTAMP",
3461
+ "notNull": true,
3462
+ "default": "current_timestamp"
3463
+ },
3464
+ "updated_at": {
3465
+ "type": "TIMESTAMP",
3466
+ "notNull": true,
3467
+ "default": "current_timestamp"
3468
+ },
3469
+ "text_refined": {
3470
+ "type": "TEXT",
3471
+ "notNull": false,
3472
+ "default": ""
3473
+ },
3474
+ "text_raw": {
3475
+ "type": "TEXT",
3476
+ "notNull": false,
3477
+ "default": ""
3478
+ },
3479
+ "type": {
3480
+ "type": "TEXT",
3481
+ "notNull": false,
3482
+ "default": "assertion"
3483
+ },
3484
+ "status": {
3485
+ "type": "TEXT",
3486
+ "notNull": false,
3487
+ "default": "pending"
3488
+ },
3489
+ "domain": {
3490
+ "type": "TEXT",
3491
+ "notNull": false,
3492
+ "default": ""
3493
+ },
3494
+ "previous_fact_id": {
3495
+ "type": "UUID",
3496
+ "referenceKind": "foreignKey",
3497
+ "notNull": false
3498
+ },
3499
+ "evolution_type": {
3500
+ "type": "TEXT",
3501
+ "notNull": false,
3502
+ "default": "original"
3503
+ },
3504
+ "source_count": {
3505
+ "type": "INTEGER",
3506
+ "notNull": false,
3507
+ "default": 0
3508
+ },
3509
+ "confidence": {
3510
+ "type": "REAL",
3511
+ "notNull": false,
3512
+ "default": 0
3513
+ },
3514
+ "metadata": {
3515
+ "type": "TEXT",
3516
+ "notNull": false,
3517
+ "default": ""
3518
+ },
3519
+ "tenant_id": {
3520
+ "type": "UUID",
3521
+ "referenceKind": "tenantId",
3522
+ "notNull": false
3523
+ }
3524
+ },
3525
+ "indexes": [
3526
+ {
3527
+ "name": "facts_id_idx",
3528
+ "columns": [
3529
+ "id"
3530
+ ]
3531
+ },
3532
+ {
3533
+ "name": "facts_slug_context_meta_type_idx",
3534
+ "columns": [
3535
+ "slug",
3536
+ "context",
3537
+ "_meta_type"
3538
+ ],
3539
+ "unique": true
3540
+ },
3541
+ {
3542
+ "name": "facts_meta_type_idx",
3543
+ "columns": [
3544
+ "_meta_type"
3545
+ ]
3546
+ }
3547
+ ],
3548
+ "version": "b48d7b97"
3549
+ }
3550
+ },
3551
+ "@happyvertical/smrt-facts:FactCollection": {
3552
+ "name": "factcollection",
3553
+ "className": "FactCollection",
3554
+ "qualifiedName": "@happyvertical/smrt-facts:FactCollection",
3555
+ "collection": "facts",
3556
+ "filePath": "/home/runner/_work/smrt/smrt/packages/facts/src/facts.ts",
3557
+ "packageName": "@happyvertical/smrt-facts",
3558
+ "fields": {},
3559
+ "methods": {
3560
+ "getActive": {
3561
+ "name": "getActive",
3562
+ "async": true,
3563
+ "parameters": [],
3564
+ "returnType": "Promise<Fact[]>",
3565
+ "isStatic": false,
3566
+ "isPublic": true
3567
+ },
3568
+ "getPending": {
3569
+ "name": "getPending",
3570
+ "async": true,
3571
+ "parameters": [],
3572
+ "returnType": "Promise<Fact[]>",
3573
+ "isStatic": false,
3574
+ "isPublic": true
3575
+ },
3576
+ "getByType": {
3577
+ "name": "getByType",
3578
+ "async": true,
3579
+ "parameters": [
3580
+ {
3581
+ "name": "type",
3582
+ "type": "FactType",
3583
+ "optional": false
3584
+ }
3585
+ ],
3586
+ "returnType": "Promise<Fact[]>",
3587
+ "isStatic": false,
3588
+ "isPublic": true
3589
+ },
3590
+ "getByDomain": {
3591
+ "name": "getByDomain",
3592
+ "async": true,
3593
+ "parameters": [
3594
+ {
3595
+ "name": "domain",
3596
+ "type": "string",
3597
+ "optional": false
3598
+ }
3599
+ ],
3600
+ "returnType": "Promise<Fact[]>",
3601
+ "isStatic": false,
3602
+ "isPublic": true
3603
+ },
3604
+ "getByStatus": {
3605
+ "name": "getByStatus",
3606
+ "async": true,
3607
+ "parameters": [
3608
+ {
3609
+ "name": "status",
3610
+ "type": "FactStatus",
3611
+ "optional": false
3612
+ }
3613
+ ],
3614
+ "returnType": "Promise<Fact[]>",
3615
+ "isStatic": false,
3616
+ "isPublic": true
3617
+ },
3618
+ "getSuccessors": {
3619
+ "name": "getSuccessors",
3620
+ "async": true,
3621
+ "parameters": [
3622
+ {
3623
+ "name": "previousFactId",
3624
+ "type": "string",
3625
+ "optional": false
3626
+ }
3627
+ ],
3628
+ "returnType": "Promise<Fact[]>",
3629
+ "isStatic": false,
3630
+ "isPublic": true
3631
+ },
3632
+ "findByTenant": {
3633
+ "name": "findByTenant",
3634
+ "async": true,
3635
+ "parameters": [
3636
+ {
3637
+ "name": "tenantId",
3638
+ "type": "string",
3639
+ "optional": false
3640
+ }
3641
+ ],
3642
+ "returnType": "Promise<Fact[]>",
3643
+ "isStatic": false,
3644
+ "isPublic": true
3645
+ },
3646
+ "findGlobal": {
3647
+ "name": "findGlobal",
3648
+ "async": true,
3649
+ "parameters": [],
3650
+ "returnType": "Promise<Fact[]>",
3651
+ "isStatic": false,
3652
+ "isPublic": true
3653
+ },
3654
+ "findWithGlobals": {
3655
+ "name": "findWithGlobals",
3656
+ "async": true,
3657
+ "parameters": [
3658
+ {
3659
+ "name": "tenantId",
3660
+ "type": "string",
3661
+ "optional": false
3662
+ }
3663
+ ],
3664
+ "returnType": "Promise<Fact[]>",
3665
+ "isStatic": false,
3666
+ "isPublic": true
3667
+ },
3668
+ "browseCatalog": {
3669
+ "name": "browseCatalog",
3670
+ "async": true,
3671
+ "parameters": [
3672
+ {
3673
+ "name": "query",
3674
+ "type": "any",
3675
+ "optional": true,
3676
+ "default": ""
3677
+ },
3678
+ {
3679
+ "name": "options",
3680
+ "type": "object",
3681
+ "optional": true
3682
+ }
3683
+ ],
3684
+ "returnType": "Promise<Fact[]>",
3685
+ "isStatic": false,
3686
+ "isPublic": true
3687
+ },
3688
+ "getForContent": {
3689
+ "name": "getForContent",
3690
+ "async": true,
3691
+ "parameters": [
3692
+ {
3693
+ "name": "contentId",
3694
+ "type": "string",
3695
+ "optional": false
3696
+ },
3697
+ {
3698
+ "name": "options",
3699
+ "type": "object",
3700
+ "optional": true
3701
+ }
3702
+ ],
3703
+ "returnType": "Promise<Fact[]>",
3704
+ "isStatic": false,
3705
+ "isPublic": true
3706
+ },
3707
+ "reconcile": {
3708
+ "name": "reconcile",
3709
+ "async": true,
3710
+ "parameters": [
3711
+ {
3712
+ "name": "options",
3713
+ "type": "ReconcileOptions",
3714
+ "optional": false
3715
+ }
3716
+ ],
3717
+ "returnType": "Promise<ReconcileResult>",
3718
+ "isStatic": false,
3719
+ "isPublic": true
3720
+ },
3721
+ "extractCandidatesFromText": {
3722
+ "name": "extractCandidatesFromText",
3723
+ "async": true,
3724
+ "parameters": [
3725
+ {
3726
+ "name": "text",
3727
+ "type": "string",
3728
+ "optional": false
3729
+ },
3730
+ {
3731
+ "name": "options",
3732
+ "type": "FactExtractionOptions",
3733
+ "optional": true
3734
+ }
3735
+ ],
3736
+ "returnType": "Promise<FactExtractionCandidate[]>",
3737
+ "isStatic": false,
3738
+ "isPublic": true
3739
+ },
3740
+ "extractArticleClaims": {
3741
+ "name": "extractArticleClaims",
3742
+ "async": true,
3743
+ "parameters": [
3744
+ {
3745
+ "name": "text",
3746
+ "type": "string",
3747
+ "optional": false
3748
+ },
3749
+ {
3750
+ "name": "options",
3751
+ "type": "FactExtractionOptions",
3752
+ "optional": true
3753
+ }
3754
+ ],
3755
+ "returnType": "Promise<FactExtractionCandidate[]>",
3756
+ "isStatic": false,
3757
+ "isPublic": true
3758
+ },
3759
+ "assessClaimSupport": {
3760
+ "name": "assessClaimSupport",
3761
+ "async": true,
3762
+ "parameters": [
3763
+ {
3764
+ "name": "claim",
3765
+ "type": "string",
3766
+ "optional": false
3767
+ },
3768
+ {
3769
+ "name": "candidateFacts",
3770
+ "type": "FactClaimSupportCandidate[]",
3771
+ "optional": false
3772
+ },
3773
+ {
3774
+ "name": "options",
3775
+ "type": "FactClaimSupportOptions",
3776
+ "optional": true
3777
+ }
3778
+ ],
3779
+ "returnType": "Promise<FactClaimSupportAssessment>",
3780
+ "isStatic": false,
3781
+ "isPublic": true
3782
+ },
3783
+ "branch": {
3784
+ "name": "branch",
3785
+ "async": true,
3786
+ "parameters": [
3787
+ {
3788
+ "name": "previousFactId",
3789
+ "type": "string",
3790
+ "optional": false
3791
+ },
3792
+ {
3793
+ "name": "data",
3794
+ "type": "Partial<FactOptions>",
3795
+ "optional": false
3796
+ },
3797
+ {
3798
+ "name": "evolutionType",
3799
+ "type": "EvolutionType",
3800
+ "optional": true,
3801
+ "default": "extension"
3802
+ }
3803
+ ],
3804
+ "returnType": "Promise<Fact>",
3805
+ "isStatic": false,
3806
+ "isPublic": true
3807
+ },
3808
+ "getEvolutionChain": {
3809
+ "name": "getEvolutionChain",
3810
+ "async": true,
3811
+ "parameters": [
3812
+ {
3813
+ "name": "factId",
3814
+ "type": "string",
3815
+ "optional": false
3816
+ }
3817
+ ],
3818
+ "returnType": "Promise<Fact[]>",
3819
+ "isStatic": false,
3820
+ "isPublic": true
3821
+ },
3822
+ "getLatestInChain": {
3823
+ "name": "getLatestInChain",
3824
+ "async": true,
3825
+ "parameters": [
3826
+ {
3827
+ "name": "factId",
3828
+ "type": "string",
3829
+ "optional": false
3830
+ }
3831
+ ],
3832
+ "returnType": "Promise<Fact>",
3833
+ "isStatic": false,
3834
+ "isPublic": true
3835
+ },
3836
+ "getEvolutionTree": {
3837
+ "name": "getEvolutionTree",
3838
+ "async": true,
3839
+ "parameters": [
3840
+ {
3841
+ "name": "factId",
3842
+ "type": "string",
3843
+ "optional": false
3844
+ }
3845
+ ],
3846
+ "returnType": "Promise<Fact[]>",
3847
+ "isStatic": false,
3848
+ "isPublic": true
3849
+ },
3850
+ "recalculateConfidence": {
3851
+ "name": "recalculateConfidence",
3852
+ "async": true,
3853
+ "parameters": [
3854
+ {
3855
+ "name": "factId",
3856
+ "type": "string",
3857
+ "optional": false
3858
+ }
3859
+ ],
3860
+ "returnType": "Promise<number>",
3861
+ "isStatic": false,
3862
+ "isPublic": true
3863
+ },
3864
+ "getEntityBriefing": {
3865
+ "name": "getEntityBriefing",
3866
+ "async": true,
3867
+ "parameters": [
3868
+ {
3869
+ "name": "entityType",
3870
+ "type": "string",
3871
+ "optional": false
3872
+ },
3873
+ {
3874
+ "name": "entityId",
3875
+ "type": "string",
3876
+ "optional": false
3877
+ }
3878
+ ],
3879
+ "returnType": "Promise<EntityBriefing>",
3880
+ "isStatic": false,
3881
+ "isPublic": true
3882
+ }
3883
+ },
3884
+ "decoratorConfig": {},
3885
+ "extends": "SmrtCollection",
3886
+ "extendsTypeArg": "Fact",
3887
+ "exportName": "FactCollection",
3888
+ "collectionExportName": "FactCollectionCollection",
3889
+ "schema": {
3890
+ "tableName": "fact_collections",
3891
+ "ddl": "CREATE TABLE IF NOT EXISTS \"fact_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
3892
+ "columns": {
3893
+ "id": {
3894
+ "type": "UUID",
3895
+ "primaryKey": true,
3896
+ "referenceKind": "id",
3897
+ "notNull": true
3898
+ },
3899
+ "slug": {
3900
+ "type": "TEXT",
3901
+ "notNull": true
3902
+ },
3903
+ "context": {
3904
+ "type": "TEXT",
3905
+ "notNull": true,
3906
+ "default": ""
3907
+ },
3908
+ "created_at": {
3909
+ "type": "TIMESTAMP",
3910
+ "notNull": true,
3911
+ "default": "current_timestamp"
3912
+ },
3913
+ "updated_at": {
3914
+ "type": "TIMESTAMP",
3915
+ "notNull": true,
3916
+ "default": "current_timestamp"
3917
+ }
3918
+ },
3919
+ "indexes": [
3920
+ {
3921
+ "name": "fact_collections_id_idx",
3922
+ "columns": [
3923
+ "id"
3924
+ ]
3925
+ },
3926
+ {
3927
+ "name": "fact_collections_slug_context_idx",
3928
+ "columns": [
3929
+ "slug",
3930
+ "context"
3931
+ ],
3932
+ "unique": true
3933
+ }
3934
+ ],
3935
+ "version": "3008a4e3"
3936
+ }
3937
+ }
3938
+ },
3939
+ "moduleType": "smrt",
3940
+ "smrtDependencies": [
3941
+ "@happyvertical/smrt-core",
3942
+ "@happyvertical/smrt-prompts",
3943
+ "@happyvertical/smrt-tenancy"
3944
+ ]
3945
+ }