@happyvertical/smrt-facts 0.51.30 → 0.51.33
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.
- package/README.md +3 -1
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/__tests__/fixtures/decision-claim-support-3166.d.ts +33 -0
- package/dist/__tests__/fixtures/decision-claim-support-3166.d.ts.map +1 -0
- package/dist/catalog-search.d.ts +7 -0
- package/dist/catalog-search.d.ts.map +1 -0
- package/dist/fact-content.d.ts +39 -0
- package/dist/fact-content.d.ts.map +1 -0
- package/dist/fact-contents.d.ts +32 -0
- package/dist/fact-contents.d.ts.map +1 -0
- package/dist/fact-evidence.d.ts +37 -0
- package/dist/fact-evidence.d.ts.map +1 -0
- package/dist/fact-evidences.d.ts +32 -0
- package/dist/fact-evidences.d.ts.map +1 -0
- package/dist/fact-source.d.ts +29 -0
- package/dist/fact-source.d.ts.map +1 -0
- package/dist/fact-sources.d.ts +50 -0
- package/dist/fact-sources.d.ts.map +1 -0
- package/dist/fact-subject.d.ts +28 -0
- package/dist/fact-subject.d.ts.map +1 -0
- package/dist/fact-subjects.d.ts +56 -0
- package/dist/fact-subjects.d.ts.map +1 -0
- package/dist/fact-tag.d.ts +34 -0
- package/dist/fact-tag.d.ts.map +1 -0
- package/dist/fact-tags.d.ts +51 -0
- package/dist/fact-tags.d.ts.map +1 -0
- package/dist/fact.d.ts +77 -0
- package/dist/fact.d.ts.map +1 -0
- package/dist/facts.d.ts +173 -0
- package/dist/facts.d.ts.map +1 -0
- package/dist/index.d.ts +25 -847
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -6
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/prompts.d.ts +5 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +4 -4
- package/dist/types.d.ts +258 -375
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +26 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +11 -11
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for @happyvertical/smrt-facts
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Calculate confidence score for a fact based on multiple signals.
|
|
6
|
+
*
|
|
7
|
+
* Formula (v1, simple weighted):
|
|
8
|
+
* base = 0.5
|
|
9
|
+
* + min(sourceCount/10, 0.3) source volume boost
|
|
10
|
+
* + avgSourceCredibility * 0.2 credibility boost
|
|
11
|
+
* + max(0, 0.1 - days*0.01) recency boost (decays over 10 days)
|
|
12
|
+
* + corroborationScore * 0.1 agreement boost
|
|
13
|
+
* = clamped to [0, 1]
|
|
14
|
+
*/
|
|
15
|
+
export declare function calculateConfidence(params: {
|
|
16
|
+
sourceCount: number;
|
|
17
|
+
avgSourceCredibility?: number;
|
|
18
|
+
daysSinceLastSource?: number;
|
|
19
|
+
corroborationScore?: number;
|
|
20
|
+
}): number;
|
|
21
|
+
/**
|
|
22
|
+
* Normalize text for comparison and storage.
|
|
23
|
+
* Trims whitespace, collapses multiple spaces, and lowercases.
|
|
24
|
+
*/
|
|
25
|
+
export declare function normalizeText(text: string): string;
|
|
26
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,GAAG,MAAM,CAiBT;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-facts",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.33",
|
|
4
4
|
"description": "Distributed memory and knowledge management with provenance tracking for SMRT framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
"./manifest.json": "./dist/manifest.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@happyvertical/ai": "^0.94.
|
|
23
|
-
"@happyvertical/files": "^0.94.
|
|
24
|
-
"@happyvertical/logger": "^0.94.
|
|
25
|
-
"@happyvertical/smrt-core": "0.51.
|
|
26
|
-
"@happyvertical/smrt-prompts": "0.51.
|
|
27
|
-
"@happyvertical/smrt-tenancy": "0.51.
|
|
28
|
-
"@happyvertical/sql": "^0.94.
|
|
29
|
-
"@happyvertical/utils": "^0.94.
|
|
22
|
+
"@happyvertical/ai": "^0.94.1",
|
|
23
|
+
"@happyvertical/files": "^0.94.1",
|
|
24
|
+
"@happyvertical/logger": "^0.94.1",
|
|
25
|
+
"@happyvertical/smrt-core": "0.51.33",
|
|
26
|
+
"@happyvertical/smrt-prompts": "0.51.33",
|
|
27
|
+
"@happyvertical/smrt-tenancy": "0.51.33",
|
|
28
|
+
"@happyvertical/sql": "^0.94.1",
|
|
29
|
+
"@happyvertical/utils": "^0.94.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@happyvertical/smrt-vitest": "0.51.
|
|
32
|
+
"@happyvertical/smrt-vitest": "0.51.33",
|
|
33
33
|
"@types/node": "24.13.6",
|
|
34
|
-
"typescript": "
|
|
34
|
+
"typescript": "6.0.3",
|
|
35
35
|
"vite": "8.1.4",
|
|
36
36
|
"vitest": "4.1.10"
|
|
37
37
|
},
|