@yawlabs/mcp 0.60.2 → 0.60.3

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to `@yawlabs/mcp` (formerly `@yawlabs/mcph`) are documented here. This project uses [semantic versioning](https://semver.org) and a CI-gated release flow: pushing a `vX.Y.Z` tag triggers `.github/workflows/release.yml`, which publishes to npm.
3
+ All notable changes to `@yawlabs/mcp` (formerly `@yawlabs/mcph`) are documented here. This project uses [semantic versioning](https://semver.org) and a script-gated release flow: `./release.sh <version>` runs lint + tests + build, bumps, tags, publishes to npm, and creates the GitHub release.
4
4
 
5
5
  ## 0.60.2 -- pnpm/bun global stores upgrade with their owning tool
6
6
 
package/dist/index.js CHANGED
@@ -2820,6 +2820,7 @@ async function gcExpiredTrials(opts) {
2820
2820
 
2821
2821
  // src/upgrade-cmd.ts
2822
2822
  import { spawn as spawn2 } from "child_process";
2823
+ import { realpathSync } from "fs";
2823
2824
  var UPGRADE_USAGE = `Usage: yaw-mcp upgrade [--run] [--json]
2824
2825
 
2825
2826
  Show (or execute) the command to upgrade @yawlabs/mcp to the latest version.
@@ -2860,6 +2861,52 @@ function localInstallRoot(argvPath) {
2860
2861
  const idx = argvPath.replace(/\\/g, "/").indexOf("/node_modules/");
2861
2862
  return idx > 0 ? argvPath.slice(0, idx) : null;
2862
2863
  }
2864
+ async function defaultNpmPrefix() {
2865
+ if (process.env.VITEST) return null;
2866
+ return new Promise((resolve5) => {
2867
+ const child = spawn2("npm", ["prefix", "-g"], {
2868
+ shell: process.platform === "win32",
2869
+ stdio: ["ignore", "pipe", "ignore"]
2870
+ });
2871
+ let out = "";
2872
+ const timer = setTimeout(() => {
2873
+ child.kill();
2874
+ resolve5(null);
2875
+ }, 3e3);
2876
+ child.stdout?.on("data", (d) => {
2877
+ out += String(d);
2878
+ });
2879
+ child.on("close", (code) => {
2880
+ clearTimeout(timer);
2881
+ resolve5(code === 0 && out.trim() ? out.trim() : null);
2882
+ });
2883
+ child.on("error", () => {
2884
+ clearTimeout(timer);
2885
+ resolve5(null);
2886
+ });
2887
+ });
2888
+ }
2889
+ function comparablePath(p) {
2890
+ let real = p;
2891
+ try {
2892
+ real = realpathSync(p);
2893
+ } catch {
2894
+ }
2895
+ const normalized = real.replace(/\\/g, "/");
2896
+ return process.platform === "win32" ? normalized.toLowerCase() : normalized;
2897
+ }
2898
+ async function refineInstallMethod(method, argvPath, npmPrefix = defaultNpmPrefix) {
2899
+ if (method !== "local-node-modules" && method !== "unknown") return method;
2900
+ if (!argvPath) return method;
2901
+ const prefix = await npmPrefix();
2902
+ if (!prefix) return method;
2903
+ const entry = comparablePath(argvPath);
2904
+ const pfx = comparablePath(prefix);
2905
+ if (entry.startsWith(`${pfx}/node_modules/`) || entry.startsWith(`${pfx}/lib/node_modules/`)) {
2906
+ return "global-npm";
2907
+ }
2908
+ return method;
2909
+ }
2863
2910
  function buildUpgradePlan(input) {
2864
2911
  const { current, latest, method } = input;
2865
2912
  const stale = latest !== null && current !== "dev" && compareSemverLocal(current, latest) < 0;
@@ -2948,7 +2995,7 @@ async function runUpgrade(opts = {}) {
2948
2995
  const fetcher = opts.fetchLatest ?? defaultFetchLatest;
2949
2996
  const current = opts.currentVersion ?? readCurrentVersion();
2950
2997
  const argvPath = opts.argvPath ?? process.argv[1];
2951
- const method = detectInstallMethod(argvPath);
2998
+ const method = await refineInstallMethod(detectInstallMethod(argvPath), argvPath, opts.npmPrefix);
2952
2999
  let latest;
2953
3000
  try {
2954
3001
  latest = await fetcher();
@@ -3033,7 +3080,7 @@ async function runUpgrade(opts = {}) {
3033
3080
  return { exitCode: 3, lines };
3034
3081
  }
3035
3082
  function readCurrentVersion() {
3036
- return true ? "0.60.2" : "dev";
3083
+ return true ? "0.60.3" : "dev";
3037
3084
  }
3038
3085
 
3039
3086
  // src/usage-hints.ts
@@ -3095,7 +3142,7 @@ function selectFlakyNamespaces(entries, limit) {
3095
3142
  }
3096
3143
 
3097
3144
  // src/doctor-cmd.ts
3098
- var VERSION = true ? "0.60.2" : "dev";
3145
+ var VERSION = true ? "0.60.3" : "dev";
3099
3146
  async function runDoctor(opts = {}) {
3100
3147
  if (opts.json) return runDoctorJson(opts);
3101
3148
  const lines = [];
@@ -3167,7 +3214,7 @@ async function runDoctor(opts = {}) {
3167
3214
  const latest = skipCheck ? null : await fetchLatestVersion(opts.registryFetch);
3168
3215
  const staleHint = latest && VERSION !== "dev" && compareSemver(VERSION, latest) < 0 ? latest : null;
3169
3216
  if (staleHint) {
3170
- const method = detectInstallMethod(process.argv[1]);
3217
+ const method = await refineInstallMethod(detectInstallMethod(process.argv[1]), process.argv[1]);
3171
3218
  print("UPGRADE AVAILABLE");
3172
3219
  if (method === "bundled-app") {
3173
3220
  print(` Running ${VERSION}; npm latest is ${staleHint}. This copy ships inside`);
@@ -5083,16 +5130,21 @@ function defaultSpawn2(cmd, args) {
5083
5130
  async function maybeAutoUpgrade(deps = {}) {
5084
5131
  const optOut = process.env.YAW_MCP_AUTO_UPGRADE;
5085
5132
  if (optOut === "0" || optOut?.toLowerCase() === "false") return;
5086
- const current = deps.currentVersion ?? (true ? "0.60.2" : "dev");
5133
+ const current = deps.currentVersion ?? (true ? "0.60.3" : "dev");
5087
5134
  if (current === "dev") return;
5088
5135
  const method = detectInstallMethod(deps.argvPath ?? process.argv[1]);
5089
5136
  const latest = await (deps.fetchLatestImpl ?? fetchLatestVersion2)();
5090
5137
  if (latest === null) return;
5091
5138
  const plan = buildUpgradePlan({ current, latest, method });
5092
5139
  if (!plan.stale) return;
5093
- if (method === "global-npm") {
5094
- log("info", "yaw-mcp is out of date; upgrading the global install in the background", { current, latest });
5095
- (deps.spawnImpl ?? defaultSpawn2)("npm", ["install", "-g", "@yawlabs/mcp@latest"]);
5140
+ const globalSpec = method === "global-npm" ? { cmd: "npm", args: ["install", "-g", "@yawlabs/mcp@latest"] } : method === "pnpm-global" ? { cmd: "pnpm", args: ["add", "-g", "@yawlabs/mcp@latest"] } : method === "bun-global" ? { cmd: "bun", args: ["add", "-g", "@yawlabs/mcp@latest"] } : null;
5141
+ if (globalSpec) {
5142
+ log("info", "yaw-mcp is out of date; upgrading the global install in the background", {
5143
+ current,
5144
+ latest,
5145
+ tool: globalSpec.cmd
5146
+ });
5147
+ (deps.spawnImpl ?? defaultSpawn2)(globalSpec.cmd, globalSpec.args);
5096
5148
  return;
5097
5149
  }
5098
5150
  if (method === "bundled-app") {
@@ -7356,7 +7408,7 @@ function categorizeSpawnError(err) {
7356
7408
  }
7357
7409
  async function connectToUpstream(config, onDisconnect, onListChanged) {
7358
7410
  const client = new Client(
7359
- { name: "yaw-mcp", version: true ? "0.60.2" : "dev" },
7411
+ { name: "yaw-mcp", version: true ? "0.60.3" : "dev" },
7360
7412
  { capabilities: {} }
7361
7413
  );
7362
7414
  let transport;
@@ -7665,7 +7717,7 @@ var ConnectServer = class _ConnectServer {
7665
7717
  this.apiUrl = apiUrl5;
7666
7718
  this.token = token5;
7667
7719
  this.server = new Server(
7668
- { name: "yaw-mcp", version: true ? "0.60.2" : "dev" },
7720
+ { name: "yaw-mcp", version: true ? "0.60.3" : "dev" },
7669
7721
  {
7670
7722
  capabilities: {
7671
7723
  tools: { listChanged: true },
@@ -10636,7 +10688,7 @@ if (subcommand === "compliance") {
10636
10688
  `);
10637
10689
  process.exit(0);
10638
10690
  } else if (subcommand === "--version" || subcommand === "-V") {
10639
- process.stdout.write(`yaw-mcp ${true ? "0.60.2" : "dev"}
10691
+ process.stdout.write(`yaw-mcp ${true ? "0.60.3" : "dev"}
10640
10692
  `);
10641
10693
  process.exit(0);
10642
10694
  } else if (subcommand && !subcommand.startsWith("-")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/mcp",
3
- "version": "0.60.2",
3
+ "version": "0.60.3",
4
4
  "mcpName": "io.github.YawLabs/mcp",
5
5
  "description": "Yaw MCP -- MCP servers, managed. Free to run locally; Yaw Team adds cross-machine sync.",
6
6
  "license": "UNLICENSED",