@yawlabs/npmjs-mcp 0.11.1 → 0.11.2

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -9
  2. package/package.json +57 -57
package/dist/index.js CHANGED
@@ -30437,11 +30437,15 @@ function maxSatisfying(versions, range) {
30437
30437
  for (const sub of subRanges) {
30438
30438
  const parsed = parseRange(sub);
30439
30439
  if (!parsed) continue;
30440
- const subTargetsPrerelease = /\d+\.\d+\.\d+-/.test(sub);
30440
+ const anchorMatch = sub.match(/(\d+)\.(\d+)\.(\d+)-/);
30441
+ const prereleaseAnchor = anchorMatch ? [Number(anchorMatch[1]), Number(anchorMatch[2]), Number(anchorMatch[3])] : null;
30441
30442
  for (const v of versions) {
30442
- if (v.includes("-") && !subTargetsPrerelease) continue;
30443
30443
  const vp = parseSemver(v);
30444
30444
  if (!vp) continue;
30445
+ if (v.includes("-")) {
30446
+ if (!prereleaseAnchor) continue;
30447
+ if (vp[0] !== prereleaseAnchor[0] || vp[1] !== prereleaseAnchor[1] || vp[2] !== prereleaseAnchor[2]) continue;
30448
+ }
30445
30449
  if (parsed.min && cmpSemver(vp, parsed.min) < 0) continue;
30446
30450
  if (parsed.max && cmpSemver(vp, parsed.max) >= 0) continue;
30447
30451
  if (!bestParsed || cmpSemver(vp, bestParsed) > 0) {
@@ -31242,6 +31246,7 @@ function classifyHookTarget(target) {
31242
31246
  if (/^@[^/]+$/.test(target)) return { type: "scope", name: target };
31243
31247
  return { type: "package", name: target };
31244
31248
  }
31249
+ var httpsEndpoint = external_exports3.string().url().refine((u) => u.startsWith("https://"), { message: "Endpoint must use https://" });
31245
31250
  function stripSecrets(data) {
31246
31251
  if (Array.isArray(data)) {
31247
31252
  return data.map((item) => stripSecrets(item));
@@ -31269,7 +31274,7 @@ var hookTools = [
31269
31274
  },
31270
31275
  inputSchema: external_exports3.object({
31271
31276
  target: external_exports3.string().describe("Hook target: 'pkg', '@scope/pkg', '@scope', or '~user'"),
31272
- endpoint: external_exports3.string().url().describe("HTTPS URL that will receive POST events"),
31277
+ endpoint: httpsEndpoint.describe("HTTPS URL that will receive POST events"),
31273
31278
  secret: external_exports3.string().describe("Secret used to HMAC-sign webhook payloads")
31274
31279
  }),
31275
31280
  handler: async (input) => {
@@ -31347,7 +31352,7 @@ var hookTools = [
31347
31352
  },
31348
31353
  inputSchema: external_exports3.object({
31349
31354
  id: external_exports3.string().describe("Hook ID"),
31350
- endpoint: external_exports3.string().url().describe("New HTTPS URL"),
31355
+ endpoint: httpsEndpoint.describe("New HTTPS URL"),
31351
31356
  secret: external_exports3.string().describe("New signing secret")
31352
31357
  }),
31353
31358
  handler: async (input) => {
@@ -31673,20 +31678,21 @@ var packageTools = [
31673
31678
  if (!res.ok) return translateError(res, { pkg: input.name, op: "versions" });
31674
31679
  const pkg = res.data;
31675
31680
  const limit = input.limit ?? 50;
31676
- const allVersions = Object.keys(pkg.versions).map((v) => ({
31681
+ const totalPublished = Object.keys(pkg.versions).length;
31682
+ const dated = Object.keys(pkg.versions).map((v) => ({
31677
31683
  version: v,
31678
31684
  date: pkg.time[v],
31679
31685
  deprecated: pkg.versions[v].deprecated,
31680
31686
  npmUser: pkg.versions[v]._npmUser?.name
31681
- })).sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
31682
- const versions = limit > 0 ? allVersions.slice(0, limit) : allVersions;
31687
+ })).filter((r) => r.date).sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
31688
+ const versions = limit > 0 ? dated.slice(0, limit) : dated;
31683
31689
  return {
31684
31690
  ok: true,
31685
31691
  status: 200,
31686
31692
  data: {
31687
31693
  name: pkg.name,
31688
31694
  distTags: pkg["dist-tags"],
31689
- total: allVersions.length,
31695
+ total: totalPublished,
31690
31696
  showing: versions.length,
31691
31697
  versions
31692
31698
  }
@@ -32372,6 +32378,12 @@ var workflowTools = [
32372
32378
  detail: `"${input.name}" exists. Maintainers: ${maintainers.join(", ") || "unknown"}. Authenticate to check your access.`
32373
32379
  });
32374
32380
  }
32381
+ } else {
32382
+ checks.push({
32383
+ check: "Package name availability",
32384
+ status: "warn",
32385
+ detail: `Could not verify whether "${input.name}" is available or whether you have access (registry returned HTTP ${pkgRes.status}). Re-run npm_publish_preflight before publishing.`
32386
+ });
32375
32387
  }
32376
32388
  if (twoFactorAuth && twoFactorAuth !== "disabled" && canPublishHeadless !== true) {
32377
32389
  actions.push({
@@ -32439,6 +32451,7 @@ function parseTeamTarget(target) {
32439
32451
  function highestVersion(versions) {
32440
32452
  const parsed = [];
32441
32453
  for (const v of versions) {
32454
+ if (v.includes("-")) continue;
32442
32455
  const m = v.match(/^(\d+)\.(\d+)\.(\d+)/);
32443
32456
  if (m) parsed.push([Number(m[1]), Number(m[2]), Number(m[3]), v]);
32444
32457
  }
@@ -32640,6 +32653,7 @@ var writeTools = [
32640
32653
  tarballError = "could not re-fetch packument for tarball DELETE rev";
32641
32654
  }
32642
32655
  }
32656
+ const complete = !tarballUrl || tarballDeleted;
32643
32657
  return {
32644
32658
  ok: true,
32645
32659
  status: 200,
@@ -32647,6 +32661,7 @@ var writeTools = [
32647
32661
  package: input.name,
32648
32662
  unpublishedVersion: input.version,
32649
32663
  remainingVersions: Object.keys(packument.versions),
32664
+ complete,
32650
32665
  tarballDeleted,
32651
32666
  ...tarballError ? { tarballWarning: tarballError } : {}
32652
32667
  }
@@ -33303,7 +33318,7 @@ var writeTools = [
33303
33318
  ];
33304
33319
 
33305
33320
  // src/index.ts
33306
- var version2 = true ? "0.11.1" : (await null).createRequire(import.meta.url)("../package.json").version;
33321
+ var version2 = true ? "0.11.2" : (await null).createRequire(import.meta.url)("../package.json").version;
33307
33322
  var subcommand = process.argv[2];
33308
33323
  if (subcommand === "version" || subcommand === "--version") {
33309
33324
  console.log(version2);
package/package.json CHANGED
@@ -1,57 +1,57 @@
1
- {
2
- "name": "@yawlabs/npmjs-mcp",
3
- "version": "0.11.1",
4
- "description": "npm registry MCP server — package intelligence, security audits, and dependency analysis for AI assistants",
5
- "license": "MIT",
6
- "author": "YawLabs <contact@yaw.sh>",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/YawLabs/npmjs-mcp.git"
10
- },
11
- "keywords": [
12
- "npm",
13
- "npmjs",
14
- "registry",
15
- "mcp",
16
- "model-context-protocol",
17
- "ai",
18
- "packages",
19
- "security",
20
- "audit",
21
- "dependencies"
22
- ],
23
- "type": "module",
24
- "main": "dist/index.js",
25
- "bin": {
26
- "npmjs-mcp": "dist/index.js"
27
- },
28
- "files": [
29
- "dist/index.js"
30
- ],
31
- "scripts": {
32
- "build": "tsc && node build.mjs",
33
- "dev": "tsc --watch",
34
- "start": "node dist/index.js",
35
- "test": "npm run build && node --test dist/api.test.js dist/tools/tools.test.js dist/tools/handlers.test.js dist/tools/writes.test.js dist/tools/hooks.test.js",
36
- "test:ci": "npm run test",
37
- "lint": "biome check src/",
38
- "lint:fix": "biome check --write src/",
39
- "prepublishOnly": "npm run build"
40
- },
41
- "dependencies": {},
42
- "overrides": {
43
- "hono": "^4.12.14",
44
- "@hono/node-server": "^1.19.13"
45
- },
46
- "devDependencies": {
47
- "@biomejs/biome": "^2.4.12",
48
- "@modelcontextprotocol/sdk": "^1.29.0",
49
- "@types/node": "^25.6.0",
50
- "esbuild": "^0.28.0",
51
- "typescript": "^6.0.3",
52
- "zod": "^4.3.6"
53
- },
54
- "engines": {
55
- "node": ">=18"
56
- }
57
- }
1
+ {
2
+ "name": "@yawlabs/npmjs-mcp",
3
+ "version": "0.11.2",
4
+ "description": "npm registry MCP server — package intelligence, security audits, and dependency analysis for AI assistants",
5
+ "license": "MIT",
6
+ "author": "YawLabs <contact@yaw.sh>",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/YawLabs/npmjs-mcp.git"
10
+ },
11
+ "keywords": [
12
+ "npm",
13
+ "npmjs",
14
+ "registry",
15
+ "mcp",
16
+ "model-context-protocol",
17
+ "ai",
18
+ "packages",
19
+ "security",
20
+ "audit",
21
+ "dependencies"
22
+ ],
23
+ "type": "module",
24
+ "main": "dist/index.js",
25
+ "bin": {
26
+ "npmjs-mcp": "dist/index.js"
27
+ },
28
+ "files": [
29
+ "dist/index.js"
30
+ ],
31
+ "scripts": {
32
+ "build": "tsc && node build.mjs",
33
+ "dev": "tsc --watch",
34
+ "start": "node dist/index.js",
35
+ "test": "npm run build && node --test dist/api.test.js dist/tools/tools.test.js dist/tools/handlers.test.js dist/tools/writes.test.js dist/tools/hooks.test.js",
36
+ "test:ci": "npm run test",
37
+ "lint": "biome check src/",
38
+ "lint:fix": "biome check --write src/",
39
+ "prepublishOnly": "npm run build"
40
+ },
41
+ "dependencies": {},
42
+ "overrides": {
43
+ "hono": "^4.12.14",
44
+ "@hono/node-server": "^1.19.13"
45
+ },
46
+ "devDependencies": {
47
+ "@biomejs/biome": "^2.4.12",
48
+ "@modelcontextprotocol/sdk": "^1.29.0",
49
+ "@types/node": "^25.6.0",
50
+ "esbuild": "^0.28.0",
51
+ "typescript": "^6.0.3",
52
+ "zod": "^4.3.6"
53
+ },
54
+ "engines": {
55
+ "node": ">=18"
56
+ }
57
+ }