@happyvertical/smrt-facts 0.40.65 → 0.40.67

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.
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
+ "sensitiveFieldsExcluded": true,
3
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
4
5
  "packageName": "@happyvertical/smrt-facts",
5
- "packageVersion": "0.40.65",
6
+ "packageVersion": "0.40.67",
6
7
  "sourceManifestPath": "dist/manifest.json",
7
8
  "agentDocPath": "AGENTS.md",
8
9
  "sourceHashes": {
9
- "manifest": "9a5468f044e5a9cd48e0b37f0dd052ce1a75eb250489faf25176c6eecb363c8b",
10
- "packageJson": "cd658eb1a6e0a33835254a822222abb861d379f4bd840f58168822f76d952233",
10
+ "manifest": "0e2b0830cd82d1a2d95bfeda548e4936292b828d5abc808451f3838ab6b0336d",
11
+ "packageJson": "37efe5cfa1b23b248eb0974511643b671f62c600e4866e99708caf06dc084c91",
11
12
  "agents": "f44effcb7b1f7689941d072f09ebeccbadedcbc1c207555f8a5481a94ef0a350"
12
13
  },
13
14
  "exports": [
@@ -72,13 +73,15 @@
72
73
  "name": "relationship",
73
74
  "type": "text",
74
75
  "required": true,
75
- "columnType": "TEXT"
76
+ "columnType": "TEXT",
77
+ "default": "extracted_from"
76
78
  },
77
79
  {
78
80
  "name": "metadata",
79
81
  "type": "text",
80
82
  "required": false,
81
- "columnType": "TEXT"
83
+ "columnType": "TEXT",
84
+ "default": ""
82
85
  },
83
86
  {
84
87
  "name": "tenantId",
@@ -122,6 +125,45 @@
122
125
  "setMetadata",
123
126
  "updateMetadata"
124
127
  ],
128
+ "methodSignatures": [
129
+ {
130
+ "name": "getFact",
131
+ "async": true,
132
+ "returns": "Promise<null>"
133
+ },
134
+ {
135
+ "name": "getMetadata",
136
+ "returns": "Record<string>"
137
+ },
138
+ {
139
+ "name": "getRelationship",
140
+ "returns": "FactContentRelationship"
141
+ },
142
+ {
143
+ "name": "setMetadata",
144
+ "params": [
145
+ "data: Record<string>"
146
+ ],
147
+ "returns": "void"
148
+ },
149
+ {
150
+ "name": "updateMetadata",
151
+ "params": [
152
+ "updates: Record<string>"
153
+ ],
154
+ "returns": "void"
155
+ }
156
+ ],
157
+ "tenant": {
158
+ "scoped": true,
159
+ "mode": "optional",
160
+ "field": "tenantId"
161
+ },
162
+ "conflictColumns": [
163
+ "fact_id",
164
+ "content_id",
165
+ "relationship"
166
+ ],
125
167
  "surfaces": [
126
168
  {
127
169
  "kind": "api",
@@ -231,6 +273,77 @@
231
273
  "findWithGlobals",
232
274
  "setLinks"
233
275
  ],
276
+ "methodSignatures": [
277
+ {
278
+ "name": "attach",
279
+ "async": true,
280
+ "params": [
281
+ "leftId: string",
282
+ "rightId: string",
283
+ "opts?: JunctionAttachOptions"
284
+ ],
285
+ "returns": "Promise<TItem>"
286
+ },
287
+ {
288
+ "name": "byLeft",
289
+ "async": true,
290
+ "params": [
291
+ "leftId: string",
292
+ "opts?: JunctionFilterOptions"
293
+ ],
294
+ "returns": "Promise<TItem[]>"
295
+ },
296
+ {
297
+ "name": "byRight",
298
+ "async": true,
299
+ "params": [
300
+ "rightId: string",
301
+ "opts?: JunctionFilterOptions"
302
+ ],
303
+ "returns": "Promise<TItem[]>"
304
+ },
305
+ {
306
+ "name": "detach",
307
+ "async": true,
308
+ "params": [
309
+ "leftId: string",
310
+ "rightId: string",
311
+ "opts?: JunctionFilterOptions"
312
+ ],
313
+ "returns": "Promise<void>"
314
+ },
315
+ {
316
+ "name": "findByTenant",
317
+ "async": true,
318
+ "params": [
319
+ "tenantId: string"
320
+ ],
321
+ "returns": "Promise<FactContent[]>"
322
+ },
323
+ {
324
+ "name": "findGlobal",
325
+ "async": true,
326
+ "returns": "Promise<FactContent[]>"
327
+ },
328
+ {
329
+ "name": "findWithGlobals",
330
+ "async": true,
331
+ "params": [
332
+ "tenantId: string"
333
+ ],
334
+ "returns": "Promise<FactContent[]>"
335
+ },
336
+ {
337
+ "name": "setLinks",
338
+ "async": true,
339
+ "params": [
340
+ "leftId: string",
341
+ "rightIds: string[]",
342
+ "opts?: JunctionAttachOptions"
343
+ ],
344
+ "returns": "Promise<void>"
345
+ }
346
+ ],
234
347
  "surfaces": [],
235
348
  "relationshipFeatures": [
236
349
  "SmrtJunction",
@@ -258,67 +371,78 @@
258
371
  "name": "evidenceKey",
259
372
  "type": "text",
260
373
  "required": true,
261
- "columnType": "TEXT"
374
+ "columnType": "TEXT",
375
+ "default": ""
262
376
  },
263
377
  {
264
378
  "name": "status",
265
379
  "type": "text",
266
380
  "required": true,
267
- "columnType": "TEXT"
381
+ "columnType": "TEXT",
382
+ "default": "supports"
268
383
  },
269
384
  {
270
385
  "name": "sourceKind",
271
386
  "type": "text",
272
387
  "required": false,
273
- "columnType": "TEXT"
388
+ "columnType": "TEXT",
389
+ "default": ""
274
390
  },
275
391
  {
276
392
  "name": "sourceId",
277
393
  "type": "text",
278
394
  "required": false,
279
- "columnType": "TEXT"
395
+ "columnType": "TEXT",
396
+ "default": ""
280
397
  },
281
398
  {
282
399
  "name": "sourceUrl",
283
400
  "type": "text",
284
401
  "required": false,
285
- "columnType": "TEXT"
402
+ "columnType": "TEXT",
403
+ "default": ""
286
404
  },
287
405
  {
288
406
  "name": "sourceTitle",
289
407
  "type": "text",
290
408
  "required": false,
291
- "columnType": "TEXT"
409
+ "columnType": "TEXT",
410
+ "default": ""
292
411
  },
293
412
  {
294
413
  "name": "quote",
295
414
  "type": "text",
296
415
  "required": false,
297
- "columnType": "TEXT"
416
+ "columnType": "TEXT",
417
+ "default": ""
298
418
  },
299
419
  {
300
420
  "name": "locator",
301
421
  "type": "text",
302
422
  "required": false,
303
- "columnType": "TEXT"
423
+ "columnType": "TEXT",
424
+ "default": ""
304
425
  },
305
426
  {
306
427
  "name": "extractionMethod",
307
428
  "type": "text",
308
429
  "required": false,
309
- "columnType": "TEXT"
430
+ "columnType": "TEXT",
431
+ "default": ""
310
432
  },
311
433
  {
312
434
  "name": "confidence",
313
435
  "type": "integer",
314
436
  "required": false,
315
- "columnType": "INTEGER"
437
+ "columnType": "INTEGER",
438
+ "default": 0
316
439
  },
317
440
  {
318
441
  "name": "metadata",
319
442
  "type": "text",
320
443
  "required": false,
321
- "columnType": "TEXT"
444
+ "columnType": "TEXT",
445
+ "default": ""
322
446
  },
323
447
  {
324
448
  "name": "tenantId",
@@ -353,6 +477,35 @@
353
477
  "setMetadata",
354
478
  "updateMetadata"
355
479
  ],
480
+ "methodSignatures": [
481
+ {
482
+ "name": "getMetadata",
483
+ "returns": "Record<string>"
484
+ },
485
+ {
486
+ "name": "setMetadata",
487
+ "params": [
488
+ "data: Record<string>"
489
+ ],
490
+ "returns": "void"
491
+ },
492
+ {
493
+ "name": "updateMetadata",
494
+ "params": [
495
+ "updates: Record<string>"
496
+ ],
497
+ "returns": "void"
498
+ }
499
+ ],
500
+ "tenant": {
501
+ "scoped": true,
502
+ "mode": "optional",
503
+ "field": "tenantId"
504
+ },
505
+ "conflictColumns": [
506
+ "fact_id",
507
+ "evidence_key"
508
+ ],
356
509
  "surfaces": [
357
510
  {
358
511
  "kind": "api",
@@ -459,6 +612,60 @@
459
612
  "replaceGeneratedForSources",
460
613
  "upsertEvidence"
461
614
  ],
615
+ "methodSignatures": [
616
+ {
617
+ "name": "bulkUpdateStatus",
618
+ "async": true,
619
+ "params": [
620
+ "evidenceIds: string[]",
621
+ "status: FactEvidenceStatus",
622
+ "options?: object"
623
+ ],
624
+ "returns": "Promise<FactEvidence[]>"
625
+ },
626
+ {
627
+ "name": "getForFact",
628
+ "async": true,
629
+ "params": [
630
+ "factId: string"
631
+ ],
632
+ "returns": "Promise<FactEvidence[]>"
633
+ },
634
+ {
635
+ "name": "getForSource",
636
+ "async": true,
637
+ "params": [
638
+ "sourceKind: string",
639
+ "sourceId: string"
640
+ ],
641
+ "returns": "Promise<FactEvidence[]>"
642
+ },
643
+ {
644
+ "name": "getForSources",
645
+ "async": true,
646
+ "params": [
647
+ "sources: Array<object>"
648
+ ],
649
+ "returns": "Promise<FactEvidence[]>"
650
+ },
651
+ {
652
+ "name": "replaceGeneratedForSources",
653
+ "async": true,
654
+ "params": [
655
+ "sources: Array<object>",
656
+ "options?: object"
657
+ ],
658
+ "returns": "Promise<object>"
659
+ },
660
+ {
661
+ "name": "upsertEvidence",
662
+ "async": true,
663
+ "params": [
664
+ "options: FactEvidenceOptions"
665
+ ],
666
+ "returns": "Promise<FactEvidence>"
667
+ }
668
+ ],
462
669
  "surfaces": [],
463
670
  "relationshipFeatures": [
464
671
  "uuidColumns"
@@ -497,25 +704,29 @@
497
704
  "name": "sourceType",
498
705
  "type": "text",
499
706
  "required": false,
500
- "columnType": "TEXT"
707
+ "columnType": "TEXT",
708
+ "default": ""
501
709
  },
502
710
  {
503
711
  "name": "sourceUrl",
504
712
  "type": "text",
505
713
  "required": false,
506
- "columnType": "TEXT"
714
+ "columnType": "TEXT",
715
+ "default": ""
507
716
  },
508
717
  {
509
718
  "name": "sourceTitle",
510
719
  "type": "text",
511
720
  "required": false,
512
- "columnType": "TEXT"
721
+ "columnType": "TEXT",
722
+ "default": ""
513
723
  },
514
724
  {
515
725
  "name": "credibility",
516
726
  "type": "decimal",
517
727
  "required": false,
518
- "columnType": "REAL"
728
+ "columnType": "REAL",
729
+ "default": 0
519
730
  },
520
731
  {
521
732
  "name": "extractedAt",
@@ -527,7 +738,8 @@
527
738
  "name": "metadata",
528
739
  "type": "text",
529
740
  "required": false,
530
- "columnType": "TEXT"
741
+ "columnType": "TEXT",
742
+ "default": ""
531
743
  },
532
744
  {
533
745
  "name": "tenantId",
@@ -604,6 +816,301 @@
604
816
  "toPublicJSON",
605
817
  "updateMetadata"
606
818
  ],
819
+ "methodSignatures": [
820
+ {
821
+ "name": "_setLoadedRelationship",
822
+ "params": [
823
+ "fieldName: string",
824
+ "value: any"
825
+ ],
826
+ "returns": "void"
827
+ },
828
+ {
829
+ "name": "classifyConstraintError",
830
+ "static": true,
831
+ "params": [
832
+ "message: string"
833
+ ],
834
+ "returns": "'unique' | 'not_null' | null"
835
+ },
836
+ {
837
+ "name": "clearEmbeddings",
838
+ "async": true,
839
+ "returns": "Promise<void>"
840
+ },
841
+ {
842
+ "name": "delete",
843
+ "async": true,
844
+ "returns": "Promise<void>"
845
+ },
846
+ {
847
+ "name": "describe",
848
+ "async": true,
849
+ "params": [
850
+ "options?: AiOperationOptions"
851
+ ],
852
+ "returns": "any"
853
+ },
854
+ {
855
+ "name": "destroy",
856
+ "returns": "void"
857
+ },
858
+ {
859
+ "name": "do",
860
+ "async": true,
861
+ "params": [
862
+ "instructions: string",
863
+ "options?: AiOperationOptions"
864
+ ],
865
+ "returns": "any"
866
+ },
867
+ {
868
+ "name": "executeToolCall",
869
+ "async": true,
870
+ "params": [
871
+ "toolCall: ToolCall"
872
+ ],
873
+ "returns": "Promise<ToolCallResult>"
874
+ },
875
+ {
876
+ "name": "forget",
877
+ "async": true,
878
+ "params": [
879
+ "options: object"
880
+ ],
881
+ "returns": "Promise<void>"
882
+ },
883
+ {
884
+ "name": "forgetScope",
885
+ "async": true,
886
+ "params": [
887
+ "options: object"
888
+ ],
889
+ "returns": "Promise<number>"
890
+ },
891
+ {
892
+ "name": "generateEmbeddings",
893
+ "async": true,
894
+ "params": [
895
+ "options?: GenerateEmbeddingsOptions"
896
+ ],
897
+ "returns": "Promise<void>"
898
+ },
899
+ {
900
+ "name": "getAiUsageSnapshot",
901
+ "returns": "AiUsageSnapshot | undefined"
902
+ },
903
+ {
904
+ "name": "getAvailableTools",
905
+ "returns": "AITool[]"
906
+ },
907
+ {
908
+ "name": "getEmbedding",
909
+ "async": true,
910
+ "params": [
911
+ "fieldName: string",
912
+ "model?: string"
913
+ ],
914
+ "returns": "Promise<number[] | null>"
915
+ },
916
+ {
917
+ "name": "getFact",
918
+ "async": true,
919
+ "returns": "Promise<null>"
920
+ },
921
+ {
922
+ "name": "getFields",
923
+ "async": true,
924
+ "returns": "Promise<any>"
925
+ },
926
+ {
927
+ "name": "getId",
928
+ "async": true,
929
+ "returns": "any"
930
+ },
931
+ {
932
+ "name": "getMetadata",
933
+ "returns": "Record<string>"
934
+ },
935
+ {
936
+ "name": "getRelated",
937
+ "async": true,
938
+ "params": [
939
+ "fieldName: string",
940
+ "opts?: LoadRelatedOptions"
941
+ ],
942
+ "returns": "Promise<any>"
943
+ },
944
+ {
945
+ "name": "getSavedId",
946
+ "async": true,
947
+ "returns": "any"
948
+ },
949
+ {
950
+ "name": "getSlug",
951
+ "async": true,
952
+ "returns": "any"
953
+ },
954
+ {
955
+ "name": "hasStaleEmbeddings",
956
+ "async": true,
957
+ "returns": "Promise<boolean>"
958
+ },
959
+ {
960
+ "name": "initialize",
961
+ "async": true,
962
+ "returns": "Promise"
963
+ },
964
+ {
965
+ "name": "is",
966
+ "async": true,
967
+ "params": [
968
+ "criteria: string",
969
+ "options?: AiOperationOptions"
970
+ ],
971
+ "returns": "any"
972
+ },
973
+ {
974
+ "name": "isRelatedLoaded",
975
+ "params": [
976
+ "fieldName: string"
977
+ ],
978
+ "returns": "boolean"
979
+ },
980
+ {
981
+ "name": "isSaved",
982
+ "async": true,
983
+ "returns": "any"
984
+ },
985
+ {
986
+ "name": "listAiUsage",
987
+ "async": true,
988
+ "params": [
989
+ "options?: AiUsageListOptions"
990
+ ],
991
+ "returns": "Promise<SmrtAiUsageRecord[]>"
992
+ },
993
+ {
994
+ "name": "loadDataFromDb",
995
+ "async": true,
996
+ "params": [
997
+ "data: Record<string>"
998
+ ],
999
+ "returns": "any"
1000
+ },
1001
+ {
1002
+ "name": "loadFromId",
1003
+ "async": true,
1004
+ "returns": "any"
1005
+ },
1006
+ {
1007
+ "name": "loadFromSlug",
1008
+ "async": true,
1009
+ "returns": "any"
1010
+ },
1011
+ {
1012
+ "name": "loadRelated",
1013
+ "async": true,
1014
+ "params": [
1015
+ "fieldName: string",
1016
+ "opts?: LoadRelatedOptions"
1017
+ ],
1018
+ "returns": "Promise<any>"
1019
+ },
1020
+ {
1021
+ "name": "loadRelatedMany",
1022
+ "async": true,
1023
+ "params": [
1024
+ "fieldName: string",
1025
+ "opts?: LoadRelatedOptions"
1026
+ ],
1027
+ "returns": "Promise<any[]>"
1028
+ },
1029
+ {
1030
+ "name": "markAsPersisted",
1031
+ "returns": "void"
1032
+ },
1033
+ {
1034
+ "name": "recall",
1035
+ "async": true,
1036
+ "params": [
1037
+ "options: object"
1038
+ ],
1039
+ "returns": "Promise"
1040
+ },
1041
+ {
1042
+ "name": "recallAll",
1043
+ "async": true,
1044
+ "params": [
1045
+ "options?: object"
1046
+ ],
1047
+ "returns": "Promise<Map<string>>"
1048
+ },
1049
+ {
1050
+ "name": "remember",
1051
+ "async": true,
1052
+ "params": [
1053
+ "options: object"
1054
+ ],
1055
+ "returns": "Promise<void>"
1056
+ },
1057
+ {
1058
+ "name": "requireInsertOnSave",
1059
+ "returns": "void"
1060
+ },
1061
+ {
1062
+ "name": "resetAiUsage",
1063
+ "returns": "void"
1064
+ },
1065
+ {
1066
+ "name": "save",
1067
+ "async": true,
1068
+ "returns": "any"
1069
+ },
1070
+ {
1071
+ "name": "setMetadata",
1072
+ "params": [
1073
+ "data: Record<string>"
1074
+ ],
1075
+ "returns": "void"
1076
+ },
1077
+ {
1078
+ "name": "summarizeAiUsage",
1079
+ "async": true,
1080
+ "params": [
1081
+ "options?: AiUsageSummaryOptions"
1082
+ ],
1083
+ "returns": "Promise<Record<string, AiUsageStats>>"
1084
+ },
1085
+ {
1086
+ "name": "toJSON",
1087
+ "returns": "any"
1088
+ },
1089
+ {
1090
+ "name": "toPlainObject",
1091
+ "returns": "Record<string>"
1092
+ },
1093
+ {
1094
+ "name": "toPublicJSON",
1095
+ "params": [
1096
+ "options?: PublicJsonOptions"
1097
+ ],
1098
+ "returns": "Record<string>"
1099
+ },
1100
+ {
1101
+ "name": "updateMetadata",
1102
+ "params": [
1103
+ "updates: Record<string>"
1104
+ ],
1105
+ "returns": "void"
1106
+ }
1107
+ ],
1108
+ "tenant": {
1109
+ "scoped": true,
1110
+ "mode": "optional",
1111
+ "field": "tenantId"
1112
+ },
1113
+ "tableStrategy": "sti",
607
1114
  "surfaces": [
608
1115
  {
609
1116
  "kind": "api",
@@ -712,6 +1219,69 @@
712
1219
  "getForFact",
713
1220
  "getHighCredibility"
714
1221
  ],
1222
+ "methodSignatures": [
1223
+ {
1224
+ "name": "countForFact",
1225
+ "async": true,
1226
+ "params": [
1227
+ "factId: string"
1228
+ ],
1229
+ "returns": "Promise<number>"
1230
+ },
1231
+ {
1232
+ "name": "findByTenant",
1233
+ "async": true,
1234
+ "params": [
1235
+ "tenantId: string"
1236
+ ],
1237
+ "returns": "Promise<FactSource[]>"
1238
+ },
1239
+ {
1240
+ "name": "findGlobal",
1241
+ "async": true,
1242
+ "returns": "Promise<FactSource[]>"
1243
+ },
1244
+ {
1245
+ "name": "findWithGlobals",
1246
+ "async": true,
1247
+ "params": [
1248
+ "tenantId: string"
1249
+ ],
1250
+ "returns": "Promise<FactSource[]>"
1251
+ },
1252
+ {
1253
+ "name": "getAverageCredibility",
1254
+ "async": true,
1255
+ "params": [
1256
+ "factId: string"
1257
+ ],
1258
+ "returns": "Promise<number>"
1259
+ },
1260
+ {
1261
+ "name": "getByType",
1262
+ "async": true,
1263
+ "params": [
1264
+ "sourceType: string"
1265
+ ],
1266
+ "returns": "Promise<FactSource[]>"
1267
+ },
1268
+ {
1269
+ "name": "getForFact",
1270
+ "async": true,
1271
+ "params": [
1272
+ "factId: string"
1273
+ ],
1274
+ "returns": "Promise<FactSource[]>"
1275
+ },
1276
+ {
1277
+ "name": "getHighCredibility",
1278
+ "async": true,
1279
+ "params": [
1280
+ "minCredibility?: number"
1281
+ ],
1282
+ "returns": "Promise<FactSource[]>"
1283
+ }
1284
+ ],
715
1285
  "surfaces": [],
716
1286
  "relationshipFeatures": [
717
1287
  "uuidColumns"
@@ -738,25 +1308,29 @@
738
1308
  "name": "entityType",
739
1309
  "type": "text",
740
1310
  "required": true,
741
- "columnType": "TEXT"
1311
+ "columnType": "TEXT",
1312
+ "default": ""
742
1313
  },
743
1314
  {
744
1315
  "name": "entityId",
745
1316
  "type": "text",
746
1317
  "required": true,
747
- "columnType": "TEXT"
1318
+ "columnType": "TEXT",
1319
+ "default": ""
748
1320
  },
749
1321
  {
750
1322
  "name": "role",
751
1323
  "type": "text",
752
1324
  "required": false,
753
- "columnType": "TEXT"
1325
+ "columnType": "TEXT",
1326
+ "default": "subject"
754
1327
  },
755
1328
  {
756
1329
  "name": "metadata",
757
1330
  "type": "text",
758
1331
  "required": false,
759
- "columnType": "TEXT"
1332
+ "columnType": "TEXT",
1333
+ "default": ""
760
1334
  },
761
1335
  {
762
1336
  "name": "tenantId",
@@ -793,6 +1367,45 @@
793
1367
  "setMetadata",
794
1368
  "updateMetadata"
795
1369
  ],
1370
+ "methodSignatures": [
1371
+ {
1372
+ "name": "getFact",
1373
+ "async": true,
1374
+ "returns": "Promise<null>"
1375
+ },
1376
+ {
1377
+ "name": "getMetadata",
1378
+ "returns": "Record<string>"
1379
+ },
1380
+ {
1381
+ "name": "getRole",
1382
+ "returns": "SubjectRole"
1383
+ },
1384
+ {
1385
+ "name": "setMetadata",
1386
+ "params": [
1387
+ "data: Record<string>"
1388
+ ],
1389
+ "returns": "void"
1390
+ },
1391
+ {
1392
+ "name": "updateMetadata",
1393
+ "params": [
1394
+ "updates: Record<string>"
1395
+ ],
1396
+ "returns": "void"
1397
+ }
1398
+ ],
1399
+ "tenant": {
1400
+ "scoped": true,
1401
+ "mode": "optional",
1402
+ "field": "tenantId"
1403
+ },
1404
+ "conflictColumns": [
1405
+ "fact_id",
1406
+ "entity_type",
1407
+ "entity_id"
1408
+ ],
796
1409
  "surfaces": [
797
1410
  {
798
1411
  "kind": "api",
@@ -902,6 +1515,84 @@
902
1515
  "linkEntity",
903
1516
  "unlinkEntity"
904
1517
  ],
1518
+ "methodSignatures": [
1519
+ {
1520
+ "name": "countForFact",
1521
+ "async": true,
1522
+ "params": [
1523
+ "factId: string"
1524
+ ],
1525
+ "returns": "Promise<number>"
1526
+ },
1527
+ {
1528
+ "name": "findByTenant",
1529
+ "async": true,
1530
+ "params": [
1531
+ "tenantId: string"
1532
+ ],
1533
+ "returns": "Promise<FactSubject[]>"
1534
+ },
1535
+ {
1536
+ "name": "findGlobal",
1537
+ "async": true,
1538
+ "returns": "Promise<FactSubject[]>"
1539
+ },
1540
+ {
1541
+ "name": "findWithGlobals",
1542
+ "async": true,
1543
+ "params": [
1544
+ "tenantId: string"
1545
+ ],
1546
+ "returns": "Promise<FactSubject[]>"
1547
+ },
1548
+ {
1549
+ "name": "getByRole",
1550
+ "async": true,
1551
+ "params": [
1552
+ "factId: string",
1553
+ "role: SubjectRole"
1554
+ ],
1555
+ "returns": "Promise<FactSubject[]>"
1556
+ },
1557
+ {
1558
+ "name": "getForEntity",
1559
+ "async": true,
1560
+ "params": [
1561
+ "entityType: string",
1562
+ "entityId: string"
1563
+ ],
1564
+ "returns": "Promise<FactSubject[]>"
1565
+ },
1566
+ {
1567
+ "name": "getForFact",
1568
+ "async": true,
1569
+ "params": [
1570
+ "factId: string"
1571
+ ],
1572
+ "returns": "Promise<FactSubject[]>"
1573
+ },
1574
+ {
1575
+ "name": "linkEntity",
1576
+ "async": true,
1577
+ "params": [
1578
+ "factId: string",
1579
+ "entityType: string",
1580
+ "entityId: string",
1581
+ "role?: SubjectRole"
1582
+ ],
1583
+ "returns": "Promise<FactSubject>"
1584
+ },
1585
+ {
1586
+ "name": "unlinkEntity",
1587
+ "async": true,
1588
+ "params": [
1589
+ "factId: string",
1590
+ "entityType: string",
1591
+ "entityId: string"
1592
+ ],
1593
+ "returns": "Promise<void>"
1594
+ }
1595
+ ],
905
1596
  "surfaces": [],
906
1597
  "relationshipFeatures": [
907
1598
  "uuidColumns"
@@ -928,13 +1619,15 @@
928
1619
  "name": "tagSlug",
929
1620
  "type": "text",
930
1621
  "required": true,
931
- "columnType": "TEXT"
1622
+ "columnType": "TEXT",
1623
+ "default": ""
932
1624
  },
933
1625
  {
934
1626
  "name": "metadata",
935
1627
  "type": "text",
936
1628
  "required": false,
937
- "columnType": "TEXT"
1629
+ "columnType": "TEXT",
1630
+ "default": ""
938
1631
  },
939
1632
  {
940
1633
  "name": "tenantId",
@@ -970,6 +1663,40 @@
970
1663
  "setMetadata",
971
1664
  "updateMetadata"
972
1665
  ],
1666
+ "methodSignatures": [
1667
+ {
1668
+ "name": "getFact",
1669
+ "async": true,
1670
+ "returns": "Promise<null>"
1671
+ },
1672
+ {
1673
+ "name": "getMetadata",
1674
+ "returns": "Record<string>"
1675
+ },
1676
+ {
1677
+ "name": "setMetadata",
1678
+ "params": [
1679
+ "data: Record<string>"
1680
+ ],
1681
+ "returns": "void"
1682
+ },
1683
+ {
1684
+ "name": "updateMetadata",
1685
+ "params": [
1686
+ "updates: Record<string>"
1687
+ ],
1688
+ "returns": "void"
1689
+ }
1690
+ ],
1691
+ "tenant": {
1692
+ "scoped": true,
1693
+ "mode": "optional",
1694
+ "field": "tenantId"
1695
+ },
1696
+ "conflictColumns": [
1697
+ "fact_id",
1698
+ "tag_slug"
1699
+ ],
973
1700
  "surfaces": [
974
1701
  {
975
1702
  "kind": "api",
@@ -1078,6 +1805,71 @@
1078
1805
  "getTagSlugs",
1079
1806
  "removeTag"
1080
1807
  ],
1808
+ "methodSignatures": [
1809
+ {
1810
+ "name": "addTag",
1811
+ "async": true,
1812
+ "params": [
1813
+ "factId: string",
1814
+ "tagSlug: string"
1815
+ ],
1816
+ "returns": "Promise<FactTag>"
1817
+ },
1818
+ {
1819
+ "name": "findByTenant",
1820
+ "async": true,
1821
+ "params": [
1822
+ "tenantId: string"
1823
+ ],
1824
+ "returns": "Promise<FactTag[]>"
1825
+ },
1826
+ {
1827
+ "name": "findGlobal",
1828
+ "async": true,
1829
+ "returns": "Promise<FactTag[]>"
1830
+ },
1831
+ {
1832
+ "name": "findWithGlobals",
1833
+ "async": true,
1834
+ "params": [
1835
+ "tenantId: string"
1836
+ ],
1837
+ "returns": "Promise<FactTag[]>"
1838
+ },
1839
+ {
1840
+ "name": "getForFact",
1841
+ "async": true,
1842
+ "params": [
1843
+ "factId: string"
1844
+ ],
1845
+ "returns": "Promise<FactTag[]>"
1846
+ },
1847
+ {
1848
+ "name": "getForTag",
1849
+ "async": true,
1850
+ "params": [
1851
+ "tagSlug: string"
1852
+ ],
1853
+ "returns": "Promise<FactTag[]>"
1854
+ },
1855
+ {
1856
+ "name": "getTagSlugs",
1857
+ "async": true,
1858
+ "params": [
1859
+ "factId: string"
1860
+ ],
1861
+ "returns": "Promise<string[]>"
1862
+ },
1863
+ {
1864
+ "name": "removeTag",
1865
+ "async": true,
1866
+ "params": [
1867
+ "factId: string",
1868
+ "tagSlug: string"
1869
+ ],
1870
+ "returns": "Promise<void>"
1871
+ }
1872
+ ],
1081
1873
  "surfaces": [],
1082
1874
  "relationshipFeatures": [
1083
1875
  "uuidColumns"
@@ -1109,31 +1901,36 @@
1109
1901
  "name": "textRefined",
1110
1902
  "type": "text",
1111
1903
  "required": true,
1112
- "columnType": "TEXT"
1904
+ "columnType": "TEXT",
1905
+ "default": ""
1113
1906
  },
1114
1907
  {
1115
1908
  "name": "textRaw",
1116
1909
  "type": "text",
1117
1910
  "required": false,
1118
- "columnType": "TEXT"
1911
+ "columnType": "TEXT",
1912
+ "default": ""
1119
1913
  },
1120
1914
  {
1121
1915
  "name": "type",
1122
1916
  "type": "text",
1123
1917
  "required": true,
1124
- "columnType": "TEXT"
1918
+ "columnType": "TEXT",
1919
+ "default": "assertion"
1125
1920
  },
1126
1921
  {
1127
1922
  "name": "status",
1128
1923
  "type": "text",
1129
1924
  "required": true,
1130
- "columnType": "TEXT"
1925
+ "columnType": "TEXT",
1926
+ "default": "pending"
1131
1927
  },
1132
1928
  {
1133
1929
  "name": "domain",
1134
1930
  "type": "text",
1135
1931
  "required": false,
1136
- "columnType": "TEXT"
1932
+ "columnType": "TEXT",
1933
+ "default": ""
1137
1934
  },
1138
1935
  {
1139
1936
  "name": "previousFactId",
@@ -1146,25 +1943,29 @@
1146
1943
  "name": "evolutionType",
1147
1944
  "type": "text",
1148
1945
  "required": false,
1149
- "columnType": "TEXT"
1946
+ "columnType": "TEXT",
1947
+ "default": "original"
1150
1948
  },
1151
1949
  {
1152
1950
  "name": "sourceCount",
1153
1951
  "type": "integer",
1154
1952
  "required": false,
1155
- "columnType": "INTEGER"
1953
+ "columnType": "INTEGER",
1954
+ "default": 0
1156
1955
  },
1157
1956
  {
1158
1957
  "name": "confidence",
1159
1958
  "type": "decimal",
1160
1959
  "required": false,
1161
- "columnType": "REAL"
1960
+ "columnType": "REAL",
1961
+ "default": 0
1162
1962
  },
1163
1963
  {
1164
1964
  "name": "metadata",
1165
1965
  "type": "text",
1166
1966
  "required": false,
1167
- "columnType": "TEXT"
1967
+ "columnType": "TEXT",
1968
+ "default": ""
1168
1969
  },
1169
1970
  {
1170
1971
  "name": "tenantId",
@@ -1250,6 +2051,340 @@
1250
2051
  "toPublicJSON",
1251
2052
  "updateMetadata"
1252
2053
  ],
2054
+ "methodSignatures": [
2055
+ {
2056
+ "name": "_setLoadedRelationship",
2057
+ "params": [
2058
+ "fieldName: string",
2059
+ "value: any"
2060
+ ],
2061
+ "returns": "void"
2062
+ },
2063
+ {
2064
+ "name": "classifyConstraintError",
2065
+ "static": true,
2066
+ "params": [
2067
+ "message: string"
2068
+ ],
2069
+ "returns": "'unique' | 'not_null' | null"
2070
+ },
2071
+ {
2072
+ "name": "clearEmbeddings",
2073
+ "async": true,
2074
+ "returns": "Promise<void>"
2075
+ },
2076
+ {
2077
+ "name": "delete",
2078
+ "async": true,
2079
+ "returns": "Promise<void>"
2080
+ },
2081
+ {
2082
+ "name": "describe",
2083
+ "async": true,
2084
+ "params": [
2085
+ "options?: AiOperationOptions"
2086
+ ],
2087
+ "returns": "any"
2088
+ },
2089
+ {
2090
+ "name": "destroy",
2091
+ "returns": "void"
2092
+ },
2093
+ {
2094
+ "name": "do",
2095
+ "async": true,
2096
+ "params": [
2097
+ "instructions: string",
2098
+ "options?: AiOperationOptions"
2099
+ ],
2100
+ "returns": "any"
2101
+ },
2102
+ {
2103
+ "name": "executeToolCall",
2104
+ "async": true,
2105
+ "params": [
2106
+ "toolCall: ToolCall"
2107
+ ],
2108
+ "returns": "Promise<ToolCallResult>"
2109
+ },
2110
+ {
2111
+ "name": "forget",
2112
+ "async": true,
2113
+ "params": [
2114
+ "options: object"
2115
+ ],
2116
+ "returns": "Promise<void>"
2117
+ },
2118
+ {
2119
+ "name": "forgetScope",
2120
+ "async": true,
2121
+ "params": [
2122
+ "options: object"
2123
+ ],
2124
+ "returns": "Promise<number>"
2125
+ },
2126
+ {
2127
+ "name": "generateEmbeddings",
2128
+ "async": true,
2129
+ "params": [
2130
+ "options?: GenerateEmbeddingsOptions"
2131
+ ],
2132
+ "returns": "Promise<void>"
2133
+ },
2134
+ {
2135
+ "name": "getAiUsageSnapshot",
2136
+ "returns": "AiUsageSnapshot | undefined"
2137
+ },
2138
+ {
2139
+ "name": "getAvailableTools",
2140
+ "returns": "AITool[]"
2141
+ },
2142
+ {
2143
+ "name": "getEmbedding",
2144
+ "async": true,
2145
+ "params": [
2146
+ "fieldName: string",
2147
+ "model?: string"
2148
+ ],
2149
+ "returns": "Promise<number[] | null>"
2150
+ },
2151
+ {
2152
+ "name": "getEvolutionType",
2153
+ "returns": "EvolutionType"
2154
+ },
2155
+ {
2156
+ "name": "getFields",
2157
+ "async": true,
2158
+ "returns": "Promise<any>"
2159
+ },
2160
+ {
2161
+ "name": "getId",
2162
+ "async": true,
2163
+ "returns": "any"
2164
+ },
2165
+ {
2166
+ "name": "getMetadata",
2167
+ "returns": "FactMetadata"
2168
+ },
2169
+ {
2170
+ "name": "getPredecessor",
2171
+ "async": true,
2172
+ "returns": "Promise<Fact | null>"
2173
+ },
2174
+ {
2175
+ "name": "getRelated",
2176
+ "async": true,
2177
+ "params": [
2178
+ "fieldName: string",
2179
+ "opts?: LoadRelatedOptions"
2180
+ ],
2181
+ "returns": "Promise<any>"
2182
+ },
2183
+ {
2184
+ "name": "getSavedId",
2185
+ "async": true,
2186
+ "returns": "any"
2187
+ },
2188
+ {
2189
+ "name": "getSlug",
2190
+ "async": true,
2191
+ "returns": "any"
2192
+ },
2193
+ {
2194
+ "name": "getSources",
2195
+ "async": true,
2196
+ "returns": "Promise"
2197
+ },
2198
+ {
2199
+ "name": "getStatus",
2200
+ "returns": "FactStatus"
2201
+ },
2202
+ {
2203
+ "name": "getSubjects",
2204
+ "async": true,
2205
+ "returns": "Promise"
2206
+ },
2207
+ {
2208
+ "name": "getSuccessors",
2209
+ "async": true,
2210
+ "returns": "Promise<Fact[]>"
2211
+ },
2212
+ {
2213
+ "name": "getType",
2214
+ "returns": "FactType"
2215
+ },
2216
+ {
2217
+ "name": "hasPredecessor",
2218
+ "returns": "boolean"
2219
+ },
2220
+ {
2221
+ "name": "hasStaleEmbeddings",
2222
+ "async": true,
2223
+ "returns": "Promise<boolean>"
2224
+ },
2225
+ {
2226
+ "name": "initialize",
2227
+ "async": true,
2228
+ "returns": "Promise"
2229
+ },
2230
+ {
2231
+ "name": "is",
2232
+ "async": true,
2233
+ "params": [
2234
+ "criteria: string",
2235
+ "options?: AiOperationOptions"
2236
+ ],
2237
+ "returns": "any"
2238
+ },
2239
+ {
2240
+ "name": "isActive",
2241
+ "returns": "boolean"
2242
+ },
2243
+ {
2244
+ "name": "isRelatedLoaded",
2245
+ "params": [
2246
+ "fieldName: string"
2247
+ ],
2248
+ "returns": "boolean"
2249
+ },
2250
+ {
2251
+ "name": "isSaved",
2252
+ "async": true,
2253
+ "returns": "any"
2254
+ },
2255
+ {
2256
+ "name": "isSuperseded",
2257
+ "returns": "boolean"
2258
+ },
2259
+ {
2260
+ "name": "listAiUsage",
2261
+ "async": true,
2262
+ "params": [
2263
+ "options?: AiUsageListOptions"
2264
+ ],
2265
+ "returns": "Promise<SmrtAiUsageRecord[]>"
2266
+ },
2267
+ {
2268
+ "name": "loadDataFromDb",
2269
+ "async": true,
2270
+ "params": [
2271
+ "data: Record<string>"
2272
+ ],
2273
+ "returns": "any"
2274
+ },
2275
+ {
2276
+ "name": "loadFromId",
2277
+ "async": true,
2278
+ "returns": "any"
2279
+ },
2280
+ {
2281
+ "name": "loadFromSlug",
2282
+ "async": true,
2283
+ "returns": "any"
2284
+ },
2285
+ {
2286
+ "name": "loadRelated",
2287
+ "async": true,
2288
+ "params": [
2289
+ "fieldName: string",
2290
+ "opts?: LoadRelatedOptions"
2291
+ ],
2292
+ "returns": "Promise<any>"
2293
+ },
2294
+ {
2295
+ "name": "loadRelatedMany",
2296
+ "async": true,
2297
+ "params": [
2298
+ "fieldName: string",
2299
+ "opts?: LoadRelatedOptions"
2300
+ ],
2301
+ "returns": "Promise<any[]>"
2302
+ },
2303
+ {
2304
+ "name": "markAsPersisted",
2305
+ "returns": "void"
2306
+ },
2307
+ {
2308
+ "name": "recall",
2309
+ "async": true,
2310
+ "params": [
2311
+ "options: object"
2312
+ ],
2313
+ "returns": "Promise"
2314
+ },
2315
+ {
2316
+ "name": "recallAll",
2317
+ "async": true,
2318
+ "params": [
2319
+ "options?: object"
2320
+ ],
2321
+ "returns": "Promise<Map<string>>"
2322
+ },
2323
+ {
2324
+ "name": "remember",
2325
+ "async": true,
2326
+ "params": [
2327
+ "options: object"
2328
+ ],
2329
+ "returns": "Promise<void>"
2330
+ },
2331
+ {
2332
+ "name": "requireInsertOnSave",
2333
+ "returns": "void"
2334
+ },
2335
+ {
2336
+ "name": "resetAiUsage",
2337
+ "returns": "void"
2338
+ },
2339
+ {
2340
+ "name": "save",
2341
+ "async": true,
2342
+ "returns": "any"
2343
+ },
2344
+ {
2345
+ "name": "setMetadata",
2346
+ "params": [
2347
+ "data: FactMetadata"
2348
+ ],
2349
+ "returns": "void"
2350
+ },
2351
+ {
2352
+ "name": "summarizeAiUsage",
2353
+ "async": true,
2354
+ "params": [
2355
+ "options?: AiUsageSummaryOptions"
2356
+ ],
2357
+ "returns": "Promise<Record<string, AiUsageStats>>"
2358
+ },
2359
+ {
2360
+ "name": "toJSON",
2361
+ "returns": "any"
2362
+ },
2363
+ {
2364
+ "name": "toPlainObject",
2365
+ "returns": "Record<string>"
2366
+ },
2367
+ {
2368
+ "name": "toPublicJSON",
2369
+ "params": [
2370
+ "options?: PublicJsonOptions"
2371
+ ],
2372
+ "returns": "Record<string>"
2373
+ },
2374
+ {
2375
+ "name": "updateMetadata",
2376
+ "params": [
2377
+ "updates: Partial<FactMetadata>"
2378
+ ],
2379
+ "returns": "void"
2380
+ }
2381
+ ],
2382
+ "tenant": {
2383
+ "scoped": true,
2384
+ "mode": "optional",
2385
+ "field": "tenantId"
2386
+ },
2387
+ "tableStrategy": "sti",
1253
2388
  "surfaces": [
1254
2389
  {
1255
2390
  "kind": "api",
@@ -1385,6 +2520,176 @@
1385
2520
  "recalculateConfidence",
1386
2521
  "reconcile"
1387
2522
  ],
2523
+ "methodSignatures": [
2524
+ {
2525
+ "name": "assessClaimSupport",
2526
+ "async": true,
2527
+ "params": [
2528
+ "claim: string",
2529
+ "candidateFacts: FactClaimSupportCandidate[]",
2530
+ "options?: FactClaimSupportOptions"
2531
+ ],
2532
+ "returns": "Promise<FactClaimSupportAssessment>"
2533
+ },
2534
+ {
2535
+ "name": "branch",
2536
+ "async": true,
2537
+ "params": [
2538
+ "previousFactId: string",
2539
+ "data: Partial<FactOptions>",
2540
+ "evolutionType?: EvolutionType"
2541
+ ],
2542
+ "returns": "Promise<Fact>"
2543
+ },
2544
+ {
2545
+ "name": "browseCatalog",
2546
+ "async": true,
2547
+ "params": [
2548
+ "query?: any",
2549
+ "options?: object"
2550
+ ],
2551
+ "returns": "Promise<Fact[]>"
2552
+ },
2553
+ {
2554
+ "name": "extractArticleClaims",
2555
+ "async": true,
2556
+ "params": [
2557
+ "text: string",
2558
+ "options?: FactExtractionOptions"
2559
+ ],
2560
+ "returns": "Promise<FactExtractionCandidate[]>"
2561
+ },
2562
+ {
2563
+ "name": "extractCandidatesFromText",
2564
+ "async": true,
2565
+ "params": [
2566
+ "text: string",
2567
+ "options?: FactExtractionOptions"
2568
+ ],
2569
+ "returns": "Promise<FactExtractionCandidate[]>"
2570
+ },
2571
+ {
2572
+ "name": "findByTenant",
2573
+ "async": true,
2574
+ "params": [
2575
+ "tenantId: string"
2576
+ ],
2577
+ "returns": "Promise<Fact[]>"
2578
+ },
2579
+ {
2580
+ "name": "findGlobal",
2581
+ "async": true,
2582
+ "returns": "Promise<Fact[]>"
2583
+ },
2584
+ {
2585
+ "name": "findWithGlobals",
2586
+ "async": true,
2587
+ "params": [
2588
+ "tenantId: string"
2589
+ ],
2590
+ "returns": "Promise<Fact[]>"
2591
+ },
2592
+ {
2593
+ "name": "getActive",
2594
+ "async": true,
2595
+ "returns": "Promise<Fact[]>"
2596
+ },
2597
+ {
2598
+ "name": "getByDomain",
2599
+ "async": true,
2600
+ "params": [
2601
+ "domain: string"
2602
+ ],
2603
+ "returns": "Promise<Fact[]>"
2604
+ },
2605
+ {
2606
+ "name": "getByStatus",
2607
+ "async": true,
2608
+ "params": [
2609
+ "status: FactStatus"
2610
+ ],
2611
+ "returns": "Promise<Fact[]>"
2612
+ },
2613
+ {
2614
+ "name": "getByType",
2615
+ "async": true,
2616
+ "params": [
2617
+ "type: FactType"
2618
+ ],
2619
+ "returns": "Promise<Fact[]>"
2620
+ },
2621
+ {
2622
+ "name": "getEntityBriefing",
2623
+ "async": true,
2624
+ "params": [
2625
+ "entityType: string",
2626
+ "entityId: string"
2627
+ ],
2628
+ "returns": "Promise<EntityBriefing>"
2629
+ },
2630
+ {
2631
+ "name": "getEvolutionChain",
2632
+ "async": true,
2633
+ "params": [
2634
+ "factId: string"
2635
+ ],
2636
+ "returns": "Promise<Fact[]>"
2637
+ },
2638
+ {
2639
+ "name": "getEvolutionTree",
2640
+ "async": true,
2641
+ "params": [
2642
+ "factId: string"
2643
+ ],
2644
+ "returns": "Promise<Fact[]>"
2645
+ },
2646
+ {
2647
+ "name": "getForContent",
2648
+ "async": true,
2649
+ "params": [
2650
+ "contentId: string",
2651
+ "options?: object"
2652
+ ],
2653
+ "returns": "Promise<Fact[]>"
2654
+ },
2655
+ {
2656
+ "name": "getLatestInChain",
2657
+ "async": true,
2658
+ "params": [
2659
+ "factId: string"
2660
+ ],
2661
+ "returns": "Promise<Fact>"
2662
+ },
2663
+ {
2664
+ "name": "getPending",
2665
+ "async": true,
2666
+ "returns": "Promise<Fact[]>"
2667
+ },
2668
+ {
2669
+ "name": "getSuccessors",
2670
+ "async": true,
2671
+ "params": [
2672
+ "previousFactId: string"
2673
+ ],
2674
+ "returns": "Promise<Fact[]>"
2675
+ },
2676
+ {
2677
+ "name": "recalculateConfidence",
2678
+ "async": true,
2679
+ "params": [
2680
+ "factId: string"
2681
+ ],
2682
+ "returns": "Promise<number>"
2683
+ },
2684
+ {
2685
+ "name": "reconcile",
2686
+ "async": true,
2687
+ "params": [
2688
+ "options: ReconcileOptions"
2689
+ ],
2690
+ "returns": "Promise<ReconcileResult>"
2691
+ }
2692
+ ],
1388
2693
  "surfaces": [],
1389
2694
  "relationshipFeatures": [
1390
2695
  "uuidColumns"