freshcontext-mcp 0.3.20 → 0.3.22
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 +55 -9
- package/SECURITY.md +9 -7
- package/dist/adapters/arxiv.d.ts +15 -0
- package/dist/adapters/arxiv.js +1 -1
- package/dist/adapters/changelog.d.ts +2 -0
- package/dist/adapters/finance.d.ts +2 -0
- package/dist/adapters/finance.js +1 -1
- package/dist/adapters/gdelt.d.ts +2 -0
- package/dist/adapters/gdelt.js +1 -1
- package/dist/adapters/gebiz.d.ts +2 -0
- package/dist/adapters/gebiz.js +1 -1
- package/dist/adapters/github.d.ts +2 -0
- package/dist/adapters/govcontracts.d.ts +2 -0
- package/dist/adapters/hackernews.d.ts +2 -0
- package/dist/adapters/jobs.d.ts +2 -0
- package/dist/adapters/jobs.js +6 -6
- package/dist/adapters/packageTrends.d.ts +2 -0
- package/dist/adapters/productHunt.d.ts +2 -0
- package/dist/adapters/reddit.d.ts +8 -0
- package/dist/adapters/reddit.js +1 -1
- package/dist/adapters/registry.d.ts +19 -0
- package/dist/adapters/repoSearch.d.ts +2 -0
- package/dist/adapters/repoSearch.js +1 -1
- package/dist/adapters/scholar.d.ts +2 -0
- package/dist/adapters/secFilings.d.ts +2 -0
- package/dist/adapters/secFilings.js +1 -1
- package/dist/adapters/yc.d.ts +2 -0
- package/dist/core/decay.d.ts +5 -0
- package/dist/core/decision.d.ts +3 -0
- package/dist/core/decision.js +1 -3
- package/dist/core/envelope.d.ts +5 -0
- package/dist/core/explain.d.ts +12 -0
- package/dist/core/guards.d.ts +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.js +2 -0
- package/dist/core/pipeline.d.ts +3 -0
- package/dist/core/pipeline.js +8 -0
- package/dist/core/provenance.d.ts +5 -0
- package/dist/core/provenanceReadiness.d.ts +2 -0
- package/dist/core/provenanceReadiness.js +220 -0
- package/dist/core/rank.d.ts +4 -0
- package/dist/core/readable.d.ts +2 -0
- package/dist/core/readable.js +75 -0
- package/dist/core/signal.d.ts +3 -0
- package/dist/core/sourceProfiles.d.ts +4 -0
- package/dist/core/sourceProfiles.js +20 -0
- package/dist/core/types.d.ts +239 -0
- package/dist/core/utility.d.ts +2 -0
- package/dist/rest/handler.d.ts +1 -0
- package/dist/security.d.ts +15 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +2 -2
- package/dist/tools/evaluateContext.d.ts +21 -0
- package/dist/tools/evaluateContext.js +3 -1
- package/dist/tools/freshnessStamp.d.ts +1 -0
- package/dist/types.d.ts +1 -0
- package/docs/API_DESIGN.md +28 -1
- package/docs/CLIENT_SETUP.md +4 -4
- package/docs/CODEX_MCP_USAGE.md +3 -3
- package/docs/CORE_API.md +79 -15
- package/docs/CORE_MCP_BOUNDARY.md +13 -4
- package/docs/FUTURE_LANES.md +43 -43
- package/docs/HUMAN_READABLE_OUTPUT_CONTRACT.md +293 -0
- package/docs/RELEASE_NOTES.md +49 -5
- package/docs/SIGNAL_CONTRACT.md +215 -213
- package/docs/SOURCE_PROFILES.md +69 -24
- package/package-script-guard.mjs +84 -75
- package/package.json +16 -1
- package/server.json +2 -2
package/package-script-guard.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
|
-
import { spawnSync } from "node:child_process";
|
|
4
|
-
import { join } from "node:path";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
import { join } from "node:path";
|
|
5
5
|
|
|
6
6
|
const SOURCE_CHECKOUT_MESSAGE = [
|
|
7
7
|
"This npm script is for the FreshContext source checkout.",
|
|
@@ -40,19 +40,24 @@ const commands = {
|
|
|
40
40
|
command: "tsx",
|
|
41
41
|
args: ["examples/evaluate-with-source-profile.ts"],
|
|
42
42
|
},
|
|
43
|
-
"demo:evaluate:file": {
|
|
44
|
-
required: ["examples/evaluate-file.ts", "examples/sources.academic.example.json"],
|
|
45
|
-
command: "tsx",
|
|
46
|
-
args: ["examples/evaluate-file.ts", "examples/sources.academic.example.json"],
|
|
47
|
-
passThroughArgs: true,
|
|
48
|
-
},
|
|
49
|
-
"batch:validate": {
|
|
50
|
-
required: ["examples/validate-signal-batch.ts"],
|
|
51
|
-
command: "tsx",
|
|
52
|
-
args: ["examples/validate-signal-batch.ts"],
|
|
53
|
-
passThroughArgs: true,
|
|
54
|
-
},
|
|
55
|
-
"
|
|
43
|
+
"demo:evaluate:file": {
|
|
44
|
+
required: ["examples/evaluate-file.ts", "examples/sources.academic.example.json"],
|
|
45
|
+
command: "tsx",
|
|
46
|
+
args: ["examples/evaluate-file.ts", "examples/sources.academic.example.json"],
|
|
47
|
+
passThroughArgs: true,
|
|
48
|
+
},
|
|
49
|
+
"batch:validate": {
|
|
50
|
+
required: ["examples/validate-signal-batch.ts"],
|
|
51
|
+
command: "tsx",
|
|
52
|
+
args: ["examples/validate-signal-batch.ts"],
|
|
53
|
+
passThroughArgs: true,
|
|
54
|
+
},
|
|
55
|
+
"core:fixture": {
|
|
56
|
+
required: ["scripts/pack-core-fixture.mjs", "dist/core/index.js"],
|
|
57
|
+
command: "node",
|
|
58
|
+
args: ["scripts/pack-core-fixture.mjs"],
|
|
59
|
+
},
|
|
60
|
+
"smoke:stdio": {
|
|
56
61
|
required: ["scripts/smoke-stdio.mjs"],
|
|
57
62
|
command: "node",
|
|
58
63
|
args: ["scripts/smoke-stdio.mjs"],
|
|
@@ -98,20 +103,24 @@ const commands = {
|
|
|
98
103
|
"tests/freshnessStamp.test.ts",
|
|
99
104
|
"tests/hackernews.test.ts",
|
|
100
105
|
"tests/arxivSignals.test.ts",
|
|
101
|
-
"tests/arxivDecisionIntegration.test.ts",
|
|
102
|
-
"tests/core.test.ts",
|
|
103
|
-
"tests/haPriV2GoldenVectors.test.ts",
|
|
104
|
-
"tests/signalContractExamples.test.ts",
|
|
105
|
-
"tests/batchValidationHarness.test.ts",
|
|
106
|
-
"tests/rank.test.ts",
|
|
107
|
-
"tests/workerEnvelope.test.ts",
|
|
108
|
-
"tests/packageScriptGuard.test.mjs",
|
|
109
|
-
"tests/
|
|
110
|
-
"tests/
|
|
111
|
-
"tests/
|
|
106
|
+
"tests/arxivDecisionIntegration.test.ts",
|
|
107
|
+
"tests/core.test.ts",
|
|
108
|
+
"tests/haPriV2GoldenVectors.test.ts",
|
|
109
|
+
"tests/signalContractExamples.test.ts",
|
|
110
|
+
"tests/batchValidationHarness.test.ts",
|
|
111
|
+
"tests/rank.test.ts",
|
|
112
|
+
"tests/workerEnvelope.test.ts",
|
|
113
|
+
"tests/packageScriptGuard.test.mjs",
|
|
114
|
+
"tests/corePackageFixture.test.mjs",
|
|
115
|
+
"tests/readableOutput.test.ts",
|
|
116
|
+
"tests/provenanceReadiness.test.ts",
|
|
117
|
+
"tests/adapterNetworkBoundary.test.ts",
|
|
118
|
+
"tests/workerRouteSecurity.test.ts",
|
|
119
|
+
"tests/workerCoreEnvelopeParity.test.ts",
|
|
112
120
|
"tests/coreEnvelopeOptions.test.ts",
|
|
113
121
|
"tests/mathSpine.test.ts",
|
|
114
122
|
"tests/coreApiContract.test.ts",
|
|
123
|
+
"tests/coreSubpathExport.test.mjs",
|
|
115
124
|
"tests/corePipeline.test.ts",
|
|
116
125
|
"tests/decision.test.ts",
|
|
117
126
|
"tests/evaluateContextTool.test.ts",
|
|
@@ -131,54 +140,54 @@ if (!config) {
|
|
|
131
140
|
process.exit(1);
|
|
132
141
|
}
|
|
133
142
|
|
|
134
|
-
const hasSourceCheckoutFiles = config.required.every((path) => existsSync(path));
|
|
135
|
-
if (!hasSourceCheckoutFiles) {
|
|
136
|
-
console.log(SOURCE_CHECKOUT_MESSAGE);
|
|
137
|
-
process.exit(0);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function resolveCommand(command, args) {
|
|
141
|
-
if (command === "node") return { command: process.execPath, args };
|
|
142
|
-
|
|
143
|
-
const localNodeEntrypoints = {
|
|
144
|
-
tsx: join("node_modules", "tsx", "dist", "cli.mjs"),
|
|
145
|
-
tsc: join("node_modules", "typescript", "bin", "tsc"),
|
|
146
|
-
};
|
|
147
|
-
const nodeEntrypoint = localNodeEntrypoints[command];
|
|
148
|
-
if (nodeEntrypoint && existsSync(nodeEntrypoint)) {
|
|
149
|
-
return { command: process.execPath, args: [nodeEntrypoint, ...args] };
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const localBin = process.platform === "win32"
|
|
153
|
-
? join("node_modules", ".bin", `${command}.cmd`)
|
|
154
|
-
: join("node_modules", ".bin", command);
|
|
155
|
-
|
|
156
|
-
if (existsSync(localBin)) return { command: localBin, args };
|
|
157
|
-
if (process.platform === "win32" && !command.endsWith(".cmd")) {
|
|
158
|
-
return { command: `${command}.cmd`, args };
|
|
159
|
-
}
|
|
160
|
-
return { command, args };
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function validatePassThroughArgs(args) {
|
|
164
|
-
for (const arg of args) {
|
|
165
|
-
if (arg.includes("\0")) {
|
|
166
|
-
console.error("FreshContext package script arguments cannot contain null bytes.");
|
|
167
|
-
process.exit(1);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return args;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const args = [
|
|
174
|
-
...config.args,
|
|
175
|
-
...(config.passThroughArgs ? validatePassThroughArgs(process.argv.slice(3)) : []),
|
|
176
|
-
];
|
|
177
|
-
const invocation = resolveCommand(config.command, args);
|
|
178
|
-
const child = spawnSync(invocation.command, invocation.args, {
|
|
179
|
-
stdio: "inherit",
|
|
180
|
-
shell: false,
|
|
181
|
-
});
|
|
143
|
+
const hasSourceCheckoutFiles = config.required.every((path) => existsSync(path));
|
|
144
|
+
if (!hasSourceCheckoutFiles) {
|
|
145
|
+
console.log(SOURCE_CHECKOUT_MESSAGE);
|
|
146
|
+
process.exit(0);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function resolveCommand(command, args) {
|
|
150
|
+
if (command === "node") return { command: process.execPath, args };
|
|
151
|
+
|
|
152
|
+
const localNodeEntrypoints = {
|
|
153
|
+
tsx: join("node_modules", "tsx", "dist", "cli.mjs"),
|
|
154
|
+
tsc: join("node_modules", "typescript", "bin", "tsc"),
|
|
155
|
+
};
|
|
156
|
+
const nodeEntrypoint = localNodeEntrypoints[command];
|
|
157
|
+
if (nodeEntrypoint && existsSync(nodeEntrypoint)) {
|
|
158
|
+
return { command: process.execPath, args: [nodeEntrypoint, ...args] };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const localBin = process.platform === "win32"
|
|
162
|
+
? join("node_modules", ".bin", `${command}.cmd`)
|
|
163
|
+
: join("node_modules", ".bin", command);
|
|
164
|
+
|
|
165
|
+
if (existsSync(localBin)) return { command: localBin, args };
|
|
166
|
+
if (process.platform === "win32" && !command.endsWith(".cmd")) {
|
|
167
|
+
return { command: `${command}.cmd`, args };
|
|
168
|
+
}
|
|
169
|
+
return { command, args };
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function validatePassThroughArgs(args) {
|
|
173
|
+
for (const arg of args) {
|
|
174
|
+
if (arg.includes("\0")) {
|
|
175
|
+
console.error("FreshContext package script arguments cannot contain null bytes.");
|
|
176
|
+
process.exit(1);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return args;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const args = [
|
|
183
|
+
...config.args,
|
|
184
|
+
...(config.passThroughArgs ? validatePassThroughArgs(process.argv.slice(3)) : []),
|
|
185
|
+
];
|
|
186
|
+
const invocation = resolveCommand(config.command, args);
|
|
187
|
+
const child = spawnSync(invocation.command, invocation.args, {
|
|
188
|
+
stdio: "inherit",
|
|
189
|
+
shell: false,
|
|
190
|
+
});
|
|
182
191
|
|
|
183
192
|
if (child.error) {
|
|
184
193
|
console.error(child.error.message);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "freshcontext-mcp",
|
|
3
3
|
"mcpName": "io.github.PrinceGabriel-lgtm/freshcontext",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.22",
|
|
5
5
|
"description": "Context integrity infrastructure for AI agents and retrieval systems. Score, explain, and wrap candidate context before it reaches the model.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"mcp",
|
|
@@ -29,6 +29,18 @@
|
|
|
29
29
|
"node": ">=20"
|
|
30
30
|
},
|
|
31
31
|
"main": "dist/server.js",
|
|
32
|
+
"types": "dist/server.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/server.d.ts",
|
|
36
|
+
"import": "./dist/server.js"
|
|
37
|
+
},
|
|
38
|
+
"./core": {
|
|
39
|
+
"types": "./dist/core/index.d.ts",
|
|
40
|
+
"import": "./dist/core/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./package.json": "./package.json"
|
|
43
|
+
},
|
|
32
44
|
"bin": {
|
|
33
45
|
"freshcontext-mcp": "dist/server.js"
|
|
34
46
|
},
|
|
@@ -36,6 +48,7 @@
|
|
|
36
48
|
".env.example",
|
|
37
49
|
"dist/",
|
|
38
50
|
"!dist/apify.js",
|
|
51
|
+
"!dist/apify.d.ts",
|
|
39
52
|
"FRESHCONTEXT_SPEC.md",
|
|
40
53
|
"METHODOLOGY.md",
|
|
41
54
|
"docs/API_DESIGN.md",
|
|
@@ -47,6 +60,7 @@
|
|
|
47
60
|
"docs/FUTURE_LANES.md",
|
|
48
61
|
"docs/HA_PRI_V2_DESIGN.md",
|
|
49
62
|
"docs/HA_PRI_V2_PRODUCTION_ENFORCEMENT_PLAN.md",
|
|
63
|
+
"docs/HUMAN_READABLE_OUTPUT_CONTRACT.md",
|
|
50
64
|
"docs/RELEASE_INTEGRITY.md",
|
|
51
65
|
"docs/RELEASE_NOTES.md",
|
|
52
66
|
"docs/SIGNAL_CONTRACT.md",
|
|
@@ -68,6 +82,7 @@
|
|
|
68
82
|
"demo:evaluate": "node package-script-guard.mjs demo:evaluate",
|
|
69
83
|
"demo:evaluate:file": "node package-script-guard.mjs demo:evaluate:file",
|
|
70
84
|
"batch:validate": "node package-script-guard.mjs batch:validate",
|
|
85
|
+
"core:fixture": "node package-script-guard.mjs core:fixture",
|
|
71
86
|
"smoke:stdio": "node package-script-guard.mjs smoke:stdio",
|
|
72
87
|
"trust:gate": "node package-script-guard.mjs trust:gate",
|
|
73
88
|
"trust:report": "node package-script-guard.mjs trust:report",
|
package/server.json
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"url": "https://github.com/PrinceGabriel-lgtm/freshcontext-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.22",
|
|
10
10
|
"website_url": "https://freshcontext-site.pages.dev",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "freshcontext-mcp",
|
|
15
|
-
"version": "0.3.
|
|
15
|
+
"version": "0.3.22",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
}
|