@nekzus/mcp-server 1.18.3 → 1.19.0-alpha.10
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 +162 -283
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +60 -40
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +488 -785
- package/dist/index.js.map +1 -1
- package/dist/src/cache.d.ts +22 -0
- package/dist/src/cache.d.ts.map +1 -0
- package/dist/src/cache.js +68 -0
- package/dist/src/cache.js.map +1 -0
- package/dist/src/config.d.ts +11 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +45 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/handlers/index.d.ts +2 -0
- package/dist/src/handlers/index.d.ts.map +1 -0
- package/dist/src/handlers/index.js +2 -0
- package/dist/src/handlers/index.js.map +1 -0
- package/dist/src/icons.d.ts +21 -0
- package/dist/src/icons.d.ts.map +1 -0
- package/dist/src/icons.js +29 -0
- package/dist/src/icons.js.map +1 -0
- package/dist/src/prompts/index.d.ts +3 -0
- package/dist/src/prompts/index.d.ts.map +1 -0
- package/dist/src/prompts/index.js +22 -0
- package/dist/src/prompts/index.js.map +1 -0
- package/dist/src/resources/index.d.ts +3 -0
- package/dist/src/resources/index.d.ts.map +1 -0
- package/dist/src/resources/index.js +62 -0
- package/dist/src/resources/index.js.map +1 -0
- package/dist/src/schemas.d.ts +143 -0
- package/dist/src/schemas.d.ts.map +1 -0
- package/dist/src/schemas.js +189 -0
- package/dist/src/schemas.js.map +1 -0
- package/dist/src/server.d.ts +7 -0
- package/dist/src/server.d.ts.map +1 -0
- package/dist/src/server.js +21 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/tools/index.d.ts +3 -0
- package/dist/src/tools/index.d.ts.map +1 -0
- package/dist/src/tools/index.js +411 -0
- package/dist/src/tools/index.js.map +1 -0
- package/dist/src/utils/fetch-retry.d.ts +5 -0
- package/dist/src/utils/fetch-retry.d.ts.map +1 -0
- package/dist/src/utils/fetch-retry.js +69 -0
- package/dist/src/utils/fetch-retry.js.map +1 -0
- package/llms-full.txt +312 -422
- package/package.json +16 -17
- package/smithery.yaml +10 -2
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as crypto from 'node:crypto';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
export const CACHE_TTL_MEDIUM = 60 * 60 * 1000; // 1 hour
|
|
5
|
+
export const CACHE_TTL_LONG = 6 * 60 * 60 * 1000; // 6 hours
|
|
6
|
+
export const CACHE_TTL_VERY_LONG = 24 * 60 * 60 * 1000; // 24 hours
|
|
7
|
+
export const MAX_CACHE_SIZE = 500; // Max number of items in cache
|
|
8
|
+
export const apiCache = new Map();
|
|
9
|
+
let currentLockfileHash = null;
|
|
10
|
+
export function getLockfileHash() {
|
|
11
|
+
const lockfiles = ['pnpm-lock.yaml', 'package-lock.json', 'yarn.lock'];
|
|
12
|
+
for (const lockfile of lockfiles) {
|
|
13
|
+
const fullPath = path.join(process.cwd(), lockfile);
|
|
14
|
+
if (fs.existsSync(fullPath)) {
|
|
15
|
+
try {
|
|
16
|
+
const content = fs.readFileSync(fullPath);
|
|
17
|
+
return crypto.createHash('md5').update(content).digest('hex');
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
console.error(`Error reading lockfile ${lockfile}:`, e);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
currentLockfileHash = getLockfileHash();
|
|
27
|
+
export function checkCacheInvalidation() {
|
|
28
|
+
const newHash = getLockfileHash();
|
|
29
|
+
if (newHash !== currentLockfileHash) {
|
|
30
|
+
console.error('[Cache] Lockfile changed, invalidating all cache entries.');
|
|
31
|
+
apiCache.clear();
|
|
32
|
+
currentLockfileHash = newHash;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export function generateCacheKey(toolName, ...args) {
|
|
36
|
+
return `${toolName}:${args.map((arg) => String(arg)).join(':')}`;
|
|
37
|
+
}
|
|
38
|
+
export function cacheGet(key) {
|
|
39
|
+
checkCacheInvalidation();
|
|
40
|
+
const entry = apiCache.get(key);
|
|
41
|
+
if (entry && entry.expiresAt > Date.now()) {
|
|
42
|
+
return entry.data;
|
|
43
|
+
}
|
|
44
|
+
if (entry && entry.expiresAt <= Date.now()) {
|
|
45
|
+
apiCache.delete(key);
|
|
46
|
+
}
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
export function cacheSet(key, value, ttlMilliseconds) {
|
|
50
|
+
if (ttlMilliseconds <= 0)
|
|
51
|
+
return;
|
|
52
|
+
const expiresAt = Date.now() + ttlMilliseconds;
|
|
53
|
+
apiCache.set(key, { data: value, expiresAt });
|
|
54
|
+
if (apiCache.size > MAX_CACHE_SIZE) {
|
|
55
|
+
const oldestKey = apiCache.keys().next().value;
|
|
56
|
+
if (oldestKey) {
|
|
57
|
+
apiCache.delete(oldestKey);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export const cacheManager = {
|
|
62
|
+
get: cacheGet,
|
|
63
|
+
set: cacheSet,
|
|
64
|
+
clear: () => apiCache.clear(),
|
|
65
|
+
generateKey: generateCacheKey,
|
|
66
|
+
size: () => apiCache.size,
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,SAAS;AACzD,MAAM,CAAC,MAAM,cAAc,GA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AC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;IACF,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE;IAC7B,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI;CACzB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const configSchema: z.ZodObject<{
|
|
3
|
+
NPM_REGISTRY_URL: z.ZodOptional<z.ZodString>;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare let NPM_REGISTRY_URL: string;
|
|
6
|
+
export declare function setNpmRegistryUrl(url: string): void;
|
|
7
|
+
export declare function getPackageRootAndVersion(): {
|
|
8
|
+
packageRoot: string;
|
|
9
|
+
serverVersion: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY;;iBAEvB,CAAC;AAEH,eAAO,IAAI,gBAAgB,QAA+B,CAAC;AAE3D,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEnD;AAED,wBAAgB,wBAAwB,IAAI;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAgCzF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export const configSchema = z.object({
|
|
6
|
+
NPM_REGISTRY_URL: z.string().optional().describe('URL of the NPM registry to use'),
|
|
7
|
+
});
|
|
8
|
+
export let NPM_REGISTRY_URL = 'https://registry.npmjs.org';
|
|
9
|
+
export function setNpmRegistryUrl(url) {
|
|
10
|
+
NPM_REGISTRY_URL = url.replace(/\/$/, '');
|
|
11
|
+
}
|
|
12
|
+
export function getPackageRootAndVersion() {
|
|
13
|
+
let __filename;
|
|
14
|
+
let __dirname = '';
|
|
15
|
+
try {
|
|
16
|
+
__filename = fileURLToPath(import.meta.url);
|
|
17
|
+
__dirname = path.dirname(__filename);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
__dirname = process.cwd();
|
|
21
|
+
}
|
|
22
|
+
let packageRoot = process.cwd();
|
|
23
|
+
if (__dirname && fs.existsSync(path.join(__dirname, 'package.json'))) {
|
|
24
|
+
packageRoot = __dirname;
|
|
25
|
+
}
|
|
26
|
+
else if (__dirname && fs.existsSync(path.join(__dirname, '..', 'package.json'))) {
|
|
27
|
+
packageRoot = path.join(__dirname, '..');
|
|
28
|
+
}
|
|
29
|
+
else if (__dirname && fs.existsSync(path.join(__dirname, '..', '..', 'package.json'))) {
|
|
30
|
+
packageRoot = path.join(__dirname, '..', '..');
|
|
31
|
+
}
|
|
32
|
+
let serverVersion = '1.0.0';
|
|
33
|
+
try {
|
|
34
|
+
const packageJsonPath = path.join(packageRoot, 'package.json');
|
|
35
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
36
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
37
|
+
serverVersion = packageJson.version;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
console.error('Error reading package.json version:', error);
|
|
42
|
+
}
|
|
43
|
+
return { packageRoot, serverVersion };
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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C,CAAC,EAAE,CAAC;QACnF,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;SAAM,IAAI,SAAS,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QACzF,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,aAAa,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC;QACJ,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QAC/D,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;YACpC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;YAC1E,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC;QACrC,CAAC;IACF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { handleNpmAlternatives, handleNpmChangelogAnalysis, handleNpmCompare, handleNpmDeprecated, handleNpmDeps, handleNpmLatest, handleNpmLicenseCompatibility, handleNpmMaintainers, handleNpmMaintenance, handleNpmPackageReadme, handleNpmQuality, handleNpmRepoStats, handleNpmScore, handleNpmSearch, handleNpmSize, handleNpmTrends, handleNpmTypes, handleNpmVersions, handleNpmVulnerabilities, } from '../../index.js';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/handlers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,6BAA6B,EAC7B,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,wBAAwB,GACxB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { handleNpmAlternatives, handleNpmChangelogAnalysis, handleNpmCompare, handleNpmDeprecated, handleNpmDeps, handleNpmLatest, handleNpmLicenseCompatibility, handleNpmMaintainers, handleNpmMaintenance, handleNpmPackageReadme, handleNpmQuality, handleNpmRepoStats, handleNpmScore, handleNpmSearch, handleNpmSize, handleNpmTrends, handleNpmTypes, handleNpmVersions, handleNpmVulnerabilities, } from '../../index.js';
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/handlers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,6BAA6B,EAC7B,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,wBAAwB,GACxB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const NPM_REGISTRY_ICON: {
|
|
2
|
+
src: string;
|
|
3
|
+
mimeType: string;
|
|
4
|
+
sizes: string[];
|
|
5
|
+
}[];
|
|
6
|
+
export declare const NPM_METRICS_ICON: {
|
|
7
|
+
src: string;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
sizes: string[];
|
|
10
|
+
}[];
|
|
11
|
+
export declare const NPM_SECURITY_ICON: {
|
|
12
|
+
src: string;
|
|
13
|
+
mimeType: string;
|
|
14
|
+
sizes: string[];
|
|
15
|
+
}[];
|
|
16
|
+
export declare const DOCUMENT_ICON: {
|
|
17
|
+
src: string;
|
|
18
|
+
mimeType: string;
|
|
19
|
+
sizes: string[];
|
|
20
|
+
}[];
|
|
21
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/icons.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;GAM7B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;GAM5B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;GAM7B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;GAMzB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const NPM_REGISTRY_ICON = [
|
|
2
|
+
{
|
|
3
|
+
src: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23cb3837" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m7.5 4.27 9 5.15"/><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 12v10"/></svg>',
|
|
4
|
+
mimeType: 'image/svg+xml',
|
|
5
|
+
sizes: ['any'],
|
|
6
|
+
},
|
|
7
|
+
];
|
|
8
|
+
export const NPM_METRICS_ICON = [
|
|
9
|
+
{
|
|
10
|
+
src: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23007acc" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/></svg>',
|
|
11
|
+
mimeType: 'image/svg+xml',
|
|
12
|
+
sizes: ['any'],
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
export const NPM_SECURITY_ICON = [
|
|
16
|
+
{
|
|
17
|
+
src: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2328a745" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',
|
|
18
|
+
mimeType: 'image/svg+xml',
|
|
19
|
+
sizes: ['any'],
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
export const DOCUMENT_ICON = [
|
|
23
|
+
{
|
|
24
|
+
src: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%236c757d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/></svg>',
|
|
25
|
+
mimeType: 'image/svg+xml',
|
|
26
|
+
sizes: ['any'],
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/icons.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC;QACC,GAAG,EAAE,maAAma;QACxa,QAAQ,EAAE,eAAe;QACzB,KAAK,EAAE,CAAC,KAAK,CAAC;KACd;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B;QACC,GAAG,EAAE,oUAAoU;QACzU,QAAQ,EAAE,eAAe;QACzB,KAAK,EAAE,CAAC,KAAK,CAAC;KACd;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC;QACC,GAAG,EAAE,yQAAyQ;QAC9Q,QAAQ,EAAE,eAAe;QACzB,KAAK,EAAE,CAAC,KAAK,CAAC;KACd;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B;QACC,GAAG,EAAE,sUAAsU;QAC3U,QAAQ,EAAE,eAAe;QACzB,KAAK,EAAE,CAAC,KAAK,CAAC;KACd;CACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAI9D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsB1D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { NPM_SECURITY_ICON } from '../icons.js';
|
|
3
|
+
export function registerAllPrompts(server) {
|
|
4
|
+
server.registerPrompt('analyze-package', {
|
|
5
|
+
description: 'Analyze an NPM package for security and quality',
|
|
6
|
+
argsSchema: z.object({
|
|
7
|
+
package: z.string().describe('Name of the npm package to analyze'),
|
|
8
|
+
}),
|
|
9
|
+
icons: NPM_SECURITY_ICON,
|
|
10
|
+
}, ({ package: pkgName }) => ({
|
|
11
|
+
messages: [
|
|
12
|
+
{
|
|
13
|
+
role: 'user',
|
|
14
|
+
content: {
|
|
15
|
+
type: 'text',
|
|
16
|
+
text: `Please analyze the npm package "${pkgName}". Check for vulnerabilities, maintenance status, and recent issues. Use the available tools to gather information.`,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IACnD,MAAM,CAAC,cAAc,CACpB,iBAAiB,EACjB;QACC,WAAW,EAAE,iDAAiD;QAC9D,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;SAClE,CAAC;QACF,KAAK,EAAE,iBAAiB;KACxB,EACD,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1B,QAAQ,EAAE;YACT;gBACC,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,mCAAmC,OAAO,qHAAqH;iBACrK;aACD;SACD;KACD,CAAC,CACF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAG9D,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAoEjF"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { DOCUMENT_ICON } from '../icons.js';
|
|
4
|
+
export function registerAllResources(server, packageRoot) {
|
|
5
|
+
const README_PATH = path.join(packageRoot, 'README.md');
|
|
6
|
+
const LLMS_FULL_TEXT_PATH = path.join(packageRoot, 'llms-full.txt');
|
|
7
|
+
// Register README.md resource
|
|
8
|
+
server.registerResource('serverReadme', 'doc://server/readme', {
|
|
9
|
+
description: 'Main documentation and usage guide for this NPM Info Server.',
|
|
10
|
+
mimeType: 'text/markdown',
|
|
11
|
+
icons: DOCUMENT_ICON,
|
|
12
|
+
}, async (uri) => {
|
|
13
|
+
try {
|
|
14
|
+
const readmeContent = fs.readFileSync(README_PATH, 'utf-8');
|
|
15
|
+
return {
|
|
16
|
+
contents: [
|
|
17
|
+
{
|
|
18
|
+
uri: uri.href,
|
|
19
|
+
text: readmeContent,
|
|
20
|
+
mimeType: 'text/markdown',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
console.error(`Error reading README.md for resource ${uri.href}:`, error.message);
|
|
27
|
+
throw {
|
|
28
|
+
code: -32002,
|
|
29
|
+
message: `Resource not found or unreadable: ${uri.href}`,
|
|
30
|
+
data: { uri: uri.href, cause: error.message },
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
// Register llms-full.txt resource (MCP Specification)
|
|
35
|
+
server.registerResource('mcpSpecification', 'doc://mcp/specification', {
|
|
36
|
+
description: 'The llms-full.txt content providing a comprehensive overview of the Model Context Protocol.',
|
|
37
|
+
mimeType: 'text/plain',
|
|
38
|
+
icons: DOCUMENT_ICON,
|
|
39
|
+
}, async (uri) => {
|
|
40
|
+
try {
|
|
41
|
+
const specContent = fs.readFileSync(LLMS_FULL_TEXT_PATH, 'utf-8');
|
|
42
|
+
return {
|
|
43
|
+
contents: [
|
|
44
|
+
{
|
|
45
|
+
uri: uri.href,
|
|
46
|
+
text: specContent,
|
|
47
|
+
mimeType: 'text/plain',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
console.error(`Error reading llms-full.txt for resource ${uri.href}:`, error.message);
|
|
54
|
+
throw {
|
|
55
|
+
code: -32002,
|
|
56
|
+
message: `Resource not found or unreadable: ${uri.href}`,
|
|
57
|
+
data: { uri: uri.href, cause: error.message },
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,WAAmB;IAC1E,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACxD,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAEpE,8BAA8B;IAC9B,MAAM,CAAC,gBAAgB,CACtB,cAAc,EACd,qBAAqB,EACrB;QACC,WAAW,EAAE,8DAA8D;QAC3E,QAAQ,EAAE,eAAe;QACzB,KAAK,EAAE,aAAa;KACpB,EACD,KAAK,EAAE,GAAQ,EAA4E,EAAE;QAC5F,IAAI,CAAC;YACJ,MAAM,aAAa,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAC5D,OAAO;gBACN,QAAQ,EAAE;oBACT;wBACC,GAAG,EAAE,GAAG,CAAC,IAAI;wBACb,IAAI,EAAE,aAAa;wBACnB,QAAQ,EAAE,eAAe;qBACzB;iBACD;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACrB,OAAO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ainerSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
email: z.ZodOptional<z.ZodString>;
|
|
5
|
+
url: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$loose>;
|
|
7
|
+
export declare const NpmPackageVersionSchema: z.ZodObject<{
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
version: z.ZodString;
|
|
10
|
+
description: z.ZodOptional<z.ZodString>;
|
|
11
|
+
author: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
12
|
+
name: z.ZodOptional<z.ZodString>;
|
|
13
|
+
email: z.ZodOptional<z.ZodString>;
|
|
14
|
+
url: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$loose>]>>;
|
|
16
|
+
license: z.ZodOptional<z.ZodString>;
|
|
17
|
+
repository: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
type: z.ZodOptional<z.ZodString>;
|
|
19
|
+
url: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$loose>>;
|
|
21
|
+
bugs: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
url: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$loose>>;
|
|
24
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
25
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
26
|
+
devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
27
|
+
peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
28
|
+
types: z.ZodOptional<z.ZodString>;
|
|
29
|
+
typings: z.ZodOptional<z.ZodString>;
|
|
30
|
+
dist: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
shasum: z.ZodOptional<z.ZodString>;
|
|
32
|
+
tarball: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$loose>>;
|
|
34
|
+
}, z.core.$loose>;
|
|
35
|
+
export declare const NpmPackageInfoSchema: z.ZodObject<{
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
'dist-tags': z.ZodRecord<z.ZodString, z.ZodString>;
|
|
38
|
+
versions: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
version: z.ZodString;
|
|
41
|
+
description: z.ZodOptional<z.ZodString>;
|
|
42
|
+
author: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
43
|
+
name: z.ZodOptional<z.ZodString>;
|
|
44
|
+
email: z.ZodOptional<z.ZodString>;
|
|
45
|
+
url: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$loose>]>>;
|
|
47
|
+
license: z.ZodOptional<z.ZodString>;
|
|
48
|
+
repository: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
type: z.ZodOptional<z.ZodString>;
|
|
50
|
+
url: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$loose>>;
|
|
52
|
+
bugs: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
url: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}, z.core.$loose>>;
|
|
55
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
56
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
57
|
+
devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
58
|
+
peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
59
|
+
types: z.ZodOptional<z.ZodString>;
|
|
60
|
+
typings: z.ZodOptional<z.ZodString>;
|
|
61
|
+
dist: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
shasum: z.ZodOptional<z.ZodString>;
|
|
63
|
+
tarball: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$loose>>;
|
|
65
|
+
}, z.core.$loose>>;
|
|
66
|
+
time: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
67
|
+
repository: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
type: z.ZodOptional<z.ZodString>;
|
|
69
|
+
url: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$loose>>;
|
|
71
|
+
bugs: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
url: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$loose>>;
|
|
74
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
75
|
+
maintainers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
email: z.ZodOptional<z.ZodString>;
|
|
78
|
+
url: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$loose>>>;
|
|
80
|
+
}, z.core.$loose>;
|
|
81
|
+
export declare const NpmPackageDataSchema: z.ZodObject<{
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
version: z.ZodString;
|
|
84
|
+
description: z.ZodOptional<z.ZodString>;
|
|
85
|
+
license: z.ZodOptional<z.ZodString>;
|
|
86
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
87
|
+
devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
88
|
+
peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
89
|
+
types: z.ZodOptional<z.ZodString>;
|
|
90
|
+
typings: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$loose>;
|
|
92
|
+
export declare const BundlephobiaDataSchema: z.ZodObject<{
|
|
93
|
+
size: z.ZodNumber;
|
|
94
|
+
gzip: z.ZodNumber;
|
|
95
|
+
dependencyCount: z.ZodNumber;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export declare const NpmDownloadsDataSchema: z.ZodObject<{
|
|
98
|
+
downloads: z.ZodNumber;
|
|
99
|
+
start: z.ZodString;
|
|
100
|
+
end: z.ZodString;
|
|
101
|
+
package: z.ZodString;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export declare const NpmSearchResultSchema: z.ZodObject<{
|
|
104
|
+
objects: z.ZodArray<z.ZodObject<{
|
|
105
|
+
package: z.ZodObject<{
|
|
106
|
+
name: z.ZodString;
|
|
107
|
+
version: z.ZodString;
|
|
108
|
+
description: z.ZodOptional<z.ZodString>;
|
|
109
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
110
|
+
publisher: z.ZodOptional<z.ZodObject<{
|
|
111
|
+
username: z.ZodString;
|
|
112
|
+
email: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
links: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
npm: z.ZodOptional<z.ZodString>;
|
|
116
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
117
|
+
repository: z.ZodOptional<z.ZodString>;
|
|
118
|
+
bugs: z.ZodOptional<z.ZodString>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
date: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
score: z.ZodObject<{
|
|
123
|
+
final: z.ZodNumber;
|
|
124
|
+
detail: z.ZodObject<{
|
|
125
|
+
quality: z.ZodNumber;
|
|
126
|
+
popularity: z.ZodNumber;
|
|
127
|
+
maintenance: z.ZodNumber;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
searchScore: z.ZodNumber;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
total: z.ZodNumber;
|
|
133
|
+
}, z.core.$loose>;
|
|
134
|
+
export type NpmPackageInfo = z.infer<typeof NpmPackageInfoSchema>;
|
|
135
|
+
export type NpmPackageData = z.infer<typeof NpmPackageDataSchema>;
|
|
136
|
+
export type BundlephobiaData = z.infer<typeof BundlephobiaDataSchema>;
|
|
137
|
+
export type NpmDownloadsData = z.infer<typeof NpmDownloadsDataSchema>;
|
|
138
|
+
export declare function isNpmPackageInfo(data: unknown): data is NpmPackageInfo;
|
|
139
|
+
export declare function isNpmPackageData(data: unknown): data is z.infer<typeof NpmPackageDataSchema>;
|
|
140
|
+
export declare function isBundlephobiaData(data: unknown): data is z.infer<typeof BundlephobiaDataSchema>;
|
|
141
|
+
export declare function isNpmDownloadsData(data: unknown): data is z.infer<typeof NpmDownloadsDataSchema>;
|
|
142
|
+
export declare function isValidNpmPackageName(name: string): boolean;
|
|
143
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB;;;;iBAMvB,CAAC;AAEV,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0C3B,CAAC;AAEV,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsBxB,CAAC;AAEV,eAAO,MAAM,oBAAoB;;;;;;;;;;iBAYxB,CAAC;AAEV,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCzB,CAAC;AAEV,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;A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