@nekzus/mcp-server 1.19.0 → 1.20.1
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 +12 -12
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -21
- package/dist/index.js.map +1 -1
- package/package.json +12 -15
- package/smithery.yaml +10 -2
package/dist/index.js
CHANGED
|
@@ -117,7 +117,7 @@ export async function fetchWithRetry(url, options = {}, config = {}) {
|
|
|
117
117
|
const retryAfter = response.headers.get('retry-after');
|
|
118
118
|
const waitMs = retryAfter
|
|
119
119
|
? parseInt(retryAfter, 10) * 1000
|
|
120
|
-
: HTTP_INITIAL_BACKOFF_MS *
|
|
120
|
+
: HTTP_INITIAL_BACKOFF_MS * 2 ** attempt;
|
|
121
121
|
await new Promise((resolve) => setTimeout(resolve, waitMs));
|
|
122
122
|
continue;
|
|
123
123
|
}
|
|
@@ -126,7 +126,7 @@ export async function fetchWithRetry(url, options = {}, config = {}) {
|
|
|
126
126
|
}
|
|
127
127
|
catch (err) {
|
|
128
128
|
if (attempt < maxRetries) {
|
|
129
|
-
const waitMs = HTTP_INITIAL_BACKOFF_MS *
|
|
129
|
+
const waitMs = HTTP_INITIAL_BACKOFF_MS * 2 ** attempt;
|
|
130
130
|
await new Promise((resolve) => setTimeout(resolve, waitMs));
|
|
131
131
|
continue;
|
|
132
132
|
}
|
|
@@ -1032,14 +1032,16 @@ export async function fetchRepoStatsFromDepsDev(owner, repo, ignoreCache = false
|
|
|
1032
1032
|
license: data.license ?? 'unknown',
|
|
1033
1033
|
description: data.description ?? '',
|
|
1034
1034
|
homepage: data.homepage ?? '',
|
|
1035
|
-
scorecard: data.scorecard
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1035
|
+
scorecard: data.scorecard
|
|
1036
|
+
? {
|
|
1037
|
+
overallScore: data.scorecard.overallScore,
|
|
1038
|
+
checks: (data.scorecard.checks || []).map((c) => ({
|
|
1039
|
+
name: c.name,
|
|
1040
|
+
score: c.score,
|
|
1041
|
+
reason: c.reason,
|
|
1042
|
+
})),
|
|
1043
|
+
}
|
|
1044
|
+
: undefined,
|
|
1043
1045
|
};
|
|
1044
1046
|
cacheSet(cacheKey, result, CACHE_TTL_VERY_LONG);
|
|
1045
1047
|
return result;
|
|
@@ -1210,7 +1212,7 @@ export async function handleNpmVulnerabilities(args) {
|
|
|
1210
1212
|
// Start fetching dependencies with deps.dev
|
|
1211
1213
|
await processPackage(name, version);
|
|
1212
1214
|
// Ecosystem Check: Scan associated packages that share the same version
|
|
1213
|
-
if (ECOSYSTEM_MAP[name]) {
|
|
1215
|
+
if (Object.hasOwn(ECOSYSTEM_MAP, name) && Array.isArray(ECOSYSTEM_MAP[name])) {
|
|
1214
1216
|
for (const associatedPkg of ECOSYSTEM_MAP[name]) {
|
|
1215
1217
|
await processPackage(associatedPkg, version);
|
|
1216
1218
|
}
|
|
@@ -1699,19 +1701,20 @@ export async function getLocalPackageMetrics(name, ignoreCache = false) {
|
|
|
1699
1701
|
let popularity = popularityNPM;
|
|
1700
1702
|
if (github.hasGitHubData) {
|
|
1701
1703
|
const popularityGH = Math.min(1, github.starsCount / 50000);
|
|
1702
|
-
popularity =
|
|
1703
|
-
}
|
|
1704
|
-
const quality = (
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
: lastPublishDaysAgo < 365
|
|
1704
|
+
popularity = popularityNPM * 0.7 + popularityGH * 0.3;
|
|
1705
|
+
}
|
|
1706
|
+
const quality = (hasTypes ? 0.3 : 0) + (hasReadme ? 0.2 : 0) + Math.max(0, 0.5 - dependencyCount * 0.005);
|
|
1707
|
+
const maintenancePublish = lastPublishDaysAgo < 30
|
|
1708
|
+
? 1.0
|
|
1709
|
+
: lastPublishDaysAgo < 90
|
|
1710
|
+
? 0.8
|
|
1711
|
+
: lastPublishDaysAgo < 365
|
|
1712
|
+
? 0.5
|
|
1710
1713
|
: 0.2;
|
|
1711
1714
|
let maintenance = maintenancePublish;
|
|
1712
1715
|
if (github.hasGitHubData) {
|
|
1713
1716
|
const issuesScore = github.openIssuesCount < 50 ? 0.3 : github.openIssuesCount < 200 ? 0.2 : 0.1;
|
|
1714
|
-
maintenance =
|
|
1717
|
+
maintenance = maintenancePublish * 0.7 + issuesScore;
|
|
1715
1718
|
}
|
|
1716
1719
|
const finalScore = popularity * 0.4 + quality * 0.3 + maintenance * 0.3;
|
|
1717
1720
|
const result = {
|
|
@@ -2305,7 +2308,9 @@ export async function handleNpmPackageReadme(args) {
|
|
|
2305
2308
|
};
|
|
2306
2309
|
}
|
|
2307
2310
|
const versionToUse = versionTag === 'latest' ? packageInfo['dist-tags']?.latest : versionTag;
|
|
2308
|
-
if (!versionToUse ||
|
|
2311
|
+
if (!versionToUse ||
|
|
2312
|
+
!packageInfo.versions ||
|
|
2313
|
+
!Object.hasOwn(packageInfo.versions, versionToUse)) {
|
|
2309
2314
|
return {
|
|
2310
2315
|
packageInput: pkgInput,
|
|
2311
2316
|
packageName: name,
|