@4da/mcp-server 5.0.2 → 5.0.4
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 -3
- package/dist/auth-context.d.ts +0 -1
- package/dist/auth-context.js +0 -1
- package/dist/auth.d.ts +0 -1
- package/dist/auth.js +0 -1
- package/dist/db.d.ts +17 -2
- package/dist/db.js +104 -67
- package/dist/doctor.d.ts +0 -1
- package/dist/doctor.js +17 -15
- package/dist/embeddings.d.ts +0 -1
- package/dist/embeddings.js +0 -1
- package/dist/http-transport.d.ts +0 -1
- package/dist/http-transport.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +17 -5
- package/dist/live/cache.d.ts +0 -1
- package/dist/live/cache.js +0 -1
- package/dist/live/crates-registry.d.ts +0 -1
- package/dist/live/crates-registry.js +5 -8
- package/dist/live/cvss.d.ts +0 -1
- package/dist/live/cvss.js +0 -1
- package/dist/live/go-registry.d.ts +0 -1
- package/dist/live/go-registry.js +4 -9
- package/dist/live/hn-fetcher.d.ts +0 -1
- package/dist/live/hn-fetcher.js +23 -11
- package/dist/live/http-utils.d.ts +0 -1
- package/dist/live/http-utils.js +0 -1
- package/dist/live/index.d.ts +0 -1
- package/dist/live/index.js +0 -1
- package/dist/live/npm-registry.d.ts +0 -1
- package/dist/live/npm-registry.js +4 -8
- package/dist/live/osv-scanner.d.ts +20 -2
- package/dist/live/osv-scanner.js +82 -9
- package/dist/live/platform.d.ts +0 -1
- package/dist/live/platform.js +0 -1
- package/dist/live/pypi-registry.d.ts +0 -1
- package/dist/live/pypi-registry.js +7 -10
- package/dist/live/rate-limiter.d.ts +0 -1
- package/dist/live/rate-limiter.js +0 -1
- package/dist/live/semver-utils.d.ts +11 -1
- package/dist/live/semver-utils.js +14 -1
- package/dist/live/types.d.ts +0 -1
- package/dist/live/types.js +0 -1
- package/dist/live/version-resolver.d.ts +0 -1
- package/dist/live/version-resolver.js +0 -1
- package/dist/live-singleton.d.ts +0 -1
- package/dist/live-singleton.js +0 -1
- package/dist/project-scanner.d.ts +0 -1
- package/dist/project-scanner.js +0 -1
- package/dist/schema-registry.d.ts +17 -8
- package/dist/schema-registry.js +54 -9
- package/dist/schemas/developer-dna.json +1 -1
- package/dist/schemas/get-context.json +2 -2
- package/dist/schemas/get-relevant-content.json +1 -1
- package/dist/schemas/record-feedback.json +1 -1
- package/dist/setup.d.ts +0 -1
- package/dist/setup.js +0 -1
- package/dist/tool-dispatch.d.ts +0 -1
- package/dist/tool-dispatch.js +21 -2
- package/dist/tools/agent-memory.d.ts +0 -1
- package/dist/tools/agent-memory.js +0 -1
- package/dist/tools/decision-enforcement.d.ts +0 -1
- package/dist/tools/decision-enforcement.js +0 -1
- package/dist/tools/decision-memory.d.ts +0 -1
- package/dist/tools/decision-memory.js +0 -1
- package/dist/tools/decision-recall.d.ts +0 -1
- package/dist/tools/decision-recall.js +0 -1
- package/dist/tools/dependency-health.d.ts +0 -1
- package/dist/tools/dependency-health.js +31 -5
- package/dist/tools/developer-dna.d.ts +3 -3
- package/dist/tools/developer-dna.js +63 -47
- package/dist/tools/ecosystem-pulse.d.ts +7 -2
- package/dist/tools/ecosystem-pulse.js +39 -3
- package/dist/tools/get-actionable-signals.d.ts +0 -1
- package/dist/tools/get-actionable-signals.js +0 -1
- package/dist/tools/get-context.d.ts +0 -1
- package/dist/tools/get-context.js +2 -3
- package/dist/tools/get-relevant-content.d.ts +0 -1
- package/dist/tools/get-relevant-content.js +1 -3
- package/dist/tools/index.d.ts +0 -1
- package/dist/tools/index.js +0 -1
- package/dist/tools/knowledge-gaps.d.ts +0 -1
- package/dist/tools/knowledge-gaps.js +79 -17
- package/dist/tools/recall.d.ts +0 -1
- package/dist/tools/recall.js +0 -1
- package/dist/tools/record-feedback.d.ts +1 -2
- package/dist/tools/record-feedback.js +7 -8
- package/dist/tools/upgrade-planner.d.ts +0 -1
- package/dist/tools/upgrade-planner.js +15 -3
- package/dist/tools/vulnerability-scan.d.ts +0 -1
- package/dist/tools/vulnerability-scan.js +0 -1
- package/dist/tools/what-should-i-know.d.ts +0 -1
- package/dist/tools/what-should-i-know.js +6 -3
- package/dist/types.d.ts +2 -3
- package/dist/types.js +0 -1
- package/package.json +37 -11
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* record_feedback tool
|
|
4
4
|
*
|
|
5
|
-
* Record user
|
|
5
|
+
* Record explicit user interaction history for an item.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Tool definition for MCP registration
|
|
9
9
|
*/
|
|
10
10
|
export const recordFeedbackTool = {
|
|
11
11
|
name: "record_feedback",
|
|
12
|
-
description: `Record user
|
|
12
|
+
description: `Record explicit user interaction history for a content item.
|
|
13
13
|
|
|
14
14
|
Feedback actions:
|
|
15
|
-
- "click": User clicked/opened the item
|
|
16
|
-
- "save": User saved/bookmarked the item
|
|
17
|
-
- "dismiss": User dismissed the item
|
|
18
|
-
- "mark_irrelevant": User marked item as not relevant
|
|
15
|
+
- "click": User clicked/opened the item
|
|
16
|
+
- "save": User saved/bookmarked the item
|
|
17
|
+
- "dismiss": User dismissed the item
|
|
18
|
+
- "mark_irrelevant": User marked item as not relevant
|
|
19
19
|
|
|
20
|
-
This
|
|
20
|
+
This records what happened; it does not train content preferences (interaction counts only graduate scoring's bootstrap gate).`,
|
|
21
21
|
inputSchema: {
|
|
22
22
|
type: "object",
|
|
23
23
|
properties: {
|
|
@@ -58,4 +58,3 @@ export function executeRecordFeedback(db, params) {
|
|
|
58
58
|
}
|
|
59
59
|
return db.recordFeedback(params.item_id, params.source_type, params.action);
|
|
60
60
|
}
|
|
61
|
-
//# sourceMappingURL=record-feedback.js.map
|
|
@@ -80,4 +80,3 @@ export declare const upgradePlannerTool: {
|
|
|
80
80
|
};
|
|
81
81
|
export declare function executeUpgradePlanner(_db: FourDADatabase, params: UpgradePlannerParams, liveIntel: LiveIntelligence | null): Promise<UpgradePlanResult>;
|
|
82
82
|
export {};
|
|
83
|
-
//# sourceMappingURL=upgrade-planner.d.ts.map
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* - When no vulnerability scan has run, the plan says so instead of silently
|
|
18
18
|
* producing a CVE-blind ranking.
|
|
19
19
|
*/
|
|
20
|
-
import { maxSemver } from "../live/semver-utils.js";
|
|
20
|
+
import { compareSemver, maxSemver } from "../live/semver-utils.js";
|
|
21
21
|
const PROVENANCE_NOTE = "Point-in-time heuristic from local lockfiles plus live registry/OSV lookups. " +
|
|
22
22
|
"Not the 4DA desktop app's cross-project, version-confirmed plan.";
|
|
23
23
|
export const upgradePlannerTool = {
|
|
@@ -136,8 +136,21 @@ export async function executeUpgradePlanner(_db, params, liveIntel) {
|
|
|
136
136
|
// Skip if no upgrade needed (no vuln, not deprecated, not behind => no reasons)
|
|
137
137
|
if (reasons.length === 0)
|
|
138
138
|
continue;
|
|
139
|
+
// Never recommend a downgrade: when the current version is a prerelease
|
|
140
|
+
// AHEAD of the latest stable (rsa 0.10.0-rc.18 vs stable 0.9.10), the
|
|
141
|
+
// stable line is not an upgrade target. Fall back to the highest vuln
|
|
142
|
+
// fix version that IS ahead of current, else no target ("review").
|
|
143
|
+
if (targetVersion &&
|
|
144
|
+
dep.currentVersion &&
|
|
145
|
+
compareSemver(dep.currentVersion, targetVersion) >= 0) {
|
|
146
|
+
const vulnFixesAhead = (vulns ?? [])
|
|
147
|
+
.map((v) => v.fixedVersion)
|
|
148
|
+
.filter((f) => Boolean(f))
|
|
149
|
+
.filter((f) => compareSemver(f, dep.currentVersion) > 0);
|
|
150
|
+
targetVersion = vulnFixesAhead.length > 0 ? maxSemver(vulnFixesAhead) : null;
|
|
151
|
+
}
|
|
139
152
|
const label = dep.versionsBehind?.label;
|
|
140
|
-
const upgradeType = !label || label === "up-to-date" ? "
|
|
153
|
+
const upgradeType = !label || label === "up-to-date" ? "unknown" : label;
|
|
141
154
|
recommendations.push({
|
|
142
155
|
package: dep.name,
|
|
143
156
|
ecosystem: dep.ecosystem,
|
|
@@ -245,4 +258,3 @@ export async function executeUpgradePlanner(_db, params, liveIntel) {
|
|
|
245
258
|
provenance: { mode: "standalone_heuristic", note: PROVENANCE_NOTE },
|
|
246
259
|
};
|
|
247
260
|
}
|
|
248
|
-
//# sourceMappingURL=upgrade-planner.js.map
|
|
@@ -76,4 +76,3 @@ export declare const whatShouldIKnowTool: {
|
|
|
76
76
|
};
|
|
77
77
|
export declare function executeWhatShouldIKnow(db: FourDADatabase, params: WhatShouldIKnowParams): WhatShouldIKnowResult | Promise<WhatShouldIKnowResult>;
|
|
78
78
|
export {};
|
|
79
|
-
//# sourceMappingURL=what-should-i-know.d.ts.map
|
|
@@ -40,9 +40,13 @@ export const whatShouldIKnowTool = {
|
|
|
40
40
|
function getOpenDecisionWindows(db) {
|
|
41
41
|
try {
|
|
42
42
|
const rawDb = db.getRawDb();
|
|
43
|
-
return rawDb.prepare(
|
|
43
|
+
return rawDb.prepare(
|
|
44
|
+
// opened_at, not created_at — the wrong column name made this query
|
|
45
|
+
// throw (swallowed below) on EVERY schema in existence, so the
|
|
46
|
+
// decision-windows section had never returned a row for anyone.
|
|
47
|
+
`SELECT id, title, description, urgency
|
|
44
48
|
FROM decision_windows WHERE status = 'open'
|
|
45
|
-
ORDER BY urgency DESC,
|
|
49
|
+
ORDER BY urgency DESC, opened_at DESC
|
|
46
50
|
LIMIT 20`).all();
|
|
47
51
|
}
|
|
48
52
|
catch {
|
|
@@ -345,4 +349,3 @@ export function executeWhatShouldIKnow(db, params) {
|
|
|
345
349
|
// Provider configured -> hybrid wisdom (returns a Promise; dispatch awaits).
|
|
346
350
|
return getRelevantWisdomHybrid(db, task, files, embedConfig).then(({ wisdom, recall_mode }) => finalize(wisdom, recall_mode));
|
|
347
351
|
}
|
|
348
|
-
//# sourceMappingURL=what-should-i-know.js.map
|
package/dist/types.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export interface ActiveTopic {
|
|
|
81
81
|
last_seen: string;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Retained compatibility shape for historic topic affinity data.
|
|
85
85
|
*/
|
|
86
86
|
export interface TopicAffinity {
|
|
87
87
|
topic: string;
|
|
@@ -92,7 +92,7 @@ export interface TopicAffinity {
|
|
|
92
92
|
total_exposures: number;
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
95
|
+
* Retained compatibility shape for historic anti-topic data.
|
|
96
96
|
*/
|
|
97
97
|
export interface AntiTopic {
|
|
98
98
|
topic: string;
|
|
@@ -394,4 +394,3 @@ export interface AgentFeedbackTopItemRow {
|
|
|
394
394
|
used_count: number;
|
|
395
395
|
rejected_count: number;
|
|
396
396
|
}
|
|
397
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4da/mcp-server",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"mcpName": "io.github.4DA-Systems/4da-mcp-server",
|
|
5
5
|
"description": "Dependency intelligence for AI coding agents. Live CVE scanning, dependency health, upgrade planning, ecosystem news, decision memory — zero config, privacy-first. 9 tools standalone, 14 total with desktop app.",
|
|
6
6
|
"type": "module",
|
|
@@ -18,6 +18,18 @@
|
|
|
18
18
|
"README.md",
|
|
19
19
|
"LICENSE"
|
|
20
20
|
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"clean": "node -e \"const fs=require('fs');fs.rmSync('dist',{recursive:true,force:true})\"",
|
|
23
|
+
"build": "pnpm run clean && tsc && pnpm run copy-schemas",
|
|
24
|
+
"copy-schemas": "node -e \"const fs=require('fs');const path=require('path');const src='src/schemas';const dst='dist/schemas';if(!fs.existsSync(dst))fs.mkdirSync(dst,{recursive:true});fs.readdirSync(src).filter(f=>f.endsWith('.json')).forEach(f=>fs.copyFileSync(path.join(src,f),path.join(dst,f)))\"",
|
|
25
|
+
"dev": "tsc --watch",
|
|
26
|
+
"start": "node dist/index.js",
|
|
27
|
+
"inspect": "npx @modelcontextprotocol/inspector node dist/index.js",
|
|
28
|
+
"setup": "node dist/setup.js",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"test:watch": "vitest",
|
|
31
|
+
"prepublishOnly": "pnpm run build"
|
|
32
|
+
},
|
|
21
33
|
"keywords": [
|
|
22
34
|
"mcp",
|
|
23
35
|
"mcp-server",
|
|
@@ -84,14 +96,28 @@
|
|
|
84
96
|
"engines": {
|
|
85
97
|
"node": ">=20.0.0"
|
|
86
98
|
},
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
"pnpm": {
|
|
100
|
+
"onlyBuiltDependencies": [
|
|
101
|
+
"better-sqlite3",
|
|
102
|
+
"esbuild"
|
|
103
|
+
],
|
|
104
|
+
"overrides": {
|
|
105
|
+
"fast-uri": ">=3.1.5",
|
|
106
|
+
"ip-address": ">=10.3.1 <11",
|
|
107
|
+
"vite": ">=7.3.5 <8",
|
|
108
|
+
"esbuild": ">=0.28.1",
|
|
109
|
+
"hono": ">=4.12.34 <5",
|
|
110
|
+
"@hono/node-server": ">=2.0.5 <3",
|
|
111
|
+
"minimatch@>=9.0.0 <9.0.6": ">=9.0.7",
|
|
112
|
+
"picomatch@>=4.0.0 <4.0.4": ">=4.0.4",
|
|
113
|
+
"brace-expansion@<1.1.18": ">=1.1.18 <2",
|
|
114
|
+
"brace-expansion@>=2.0.0 <2.0.3": ">=2.0.3",
|
|
115
|
+
"brace-expansion@>=3.0.0 <5.0.9": ">=5.0.9 <6",
|
|
116
|
+
"js-yaml@>=4.0.0 <4.3.1": ">=4.3.1 <5",
|
|
117
|
+
"nanoid@<3.3.18": ">=3.3.18 <4",
|
|
118
|
+
"nanoid@>=4.0.0 <5.1.16": ">=5.1.16 <6",
|
|
119
|
+
"postcss@<8.5.23": ">=8.5.23 <9",
|
|
120
|
+
"undici@>=7.0.0 <7.29.0": ">=7.29.0 <8"
|
|
121
|
+
}
|
|
96
122
|
}
|
|
97
|
-
}
|
|
123
|
+
}
|