@yawlabs/mcph 0.46.0 → 0.46.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.
- package/CHANGELOG.md +8 -0
- package/dist/index.js +7 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@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.
|
|
4
4
|
|
|
5
|
+
## 0.46.2 — 2026-04-18
|
|
6
|
+
|
|
7
|
+
- **Doctor's UPGRADE AVAILABLE section points at `mcph upgrade`** — Previously it inlined `npm install -g @yawlabs/mcph@latest` with a long prose aside about npx-vs-global. Now it tells the user to run `mcph upgrade` (prints the exact command for their install method) or `mcph upgrade --run` (executes for global-npm). Shorter, single source of truth for "how do I actually update?" since doctor already detects staleness and the upgrade subcommand already understands how the install was done.
|
|
8
|
+
|
|
9
|
+
## 0.46.1 — 2026-04-18
|
|
10
|
+
|
|
11
|
+
- **Fix `mcph upgrade` reporting `Current: dev` in shipped bundles** — The v0.46.0 `readCurrentVersion()` used `(globalThis as ...).__VERSION__`, but tsup's `define` only substitutes bare identifier references, not property accesses — so the compiled bundle fell through to the "dev" fallback regardless of what version was installed. Switched to the same `declare const __VERSION__ / typeof __VERSION__ !== "undefined"` pattern used in `index.ts`, `doctor-cmd.ts`, `server.ts`, and `upstream.ts`. Smoke-tested via `npx @yawlabs/mcph@latest upgrade`: now reports the actual installed version.
|
|
12
|
+
|
|
5
13
|
## 0.46.0 — 2026-04-18
|
|
6
14
|
|
|
7
15
|
- **`mcph upgrade` — show (or run) the command that bumps `@yawlabs/mcph` to the latest version** — `mcph doctor` has surfaced staleness for a while, but the fix step was left to the user. This subcommand turns that prompt into an action: it detects *how* mcph is installed by inspecting `process.argv[1]` (global npm, npx cache, project-local `node_modules`, or a dev checkout), fetches the latest version from the npm registry (3s timeout, graceful offline fallback), and prints the exact command that moves the current install forward. `--run` spawns the upgrade for the global-npm case (whitelisted to `npm install -g @yawlabs/mcph@latest` — never arbitrary input into a shell), refuses with exit 2 on non-global install methods to avoid surprise writes, and exit 3 if the spawned npm invocation fails. `--json` emits `{ current, latest, stale, method, command }` so CI scripts can branch on staleness without parsing prose. `npx -y` installs are a no-op ("restart the MCP client and it will fetch the new version") — the path detection catches the `_npx` staging directory and says so. Exit codes are wired for scripting: 0 up-to-date or offline, 1 stale without `--run` (copy-paste mode), 2 usage/refusal, 3 `--run` failed. Completes the doctor→fix handoff that's been missing since the upgrade-check section landed.
|
package/dist/index.js
CHANGED
|
@@ -1458,7 +1458,7 @@ function selectFlakyNamespaces(entries, limit) {
|
|
|
1458
1458
|
}
|
|
1459
1459
|
|
|
1460
1460
|
// src/doctor-cmd.ts
|
|
1461
|
-
var VERSION = true ? "0.46.
|
|
1461
|
+
var VERSION = true ? "0.46.2" : "dev";
|
|
1462
1462
|
async function runDoctor(opts = {}) {
|
|
1463
1463
|
if (opts.json) return runDoctorJson(opts);
|
|
1464
1464
|
const lines = [];
|
|
@@ -1528,9 +1528,8 @@ async function runDoctor(opts = {}) {
|
|
|
1528
1528
|
if (staleHint) {
|
|
1529
1529
|
print("UPGRADE AVAILABLE");
|
|
1530
1530
|
print(` Running ${VERSION}; npm latest is ${staleHint}.`);
|
|
1531
|
-
print("
|
|
1532
|
-
print("
|
|
1533
|
-
print(" Otherwise restart your MCP client; `npx -y @yawlabs/mcph` will fetch the new version.");
|
|
1531
|
+
print(" Run `mcph upgrade` to see the exact command for your install, or");
|
|
1532
|
+
print(" `mcph upgrade --run` to execute it (global-npm installs only).");
|
|
1534
1533
|
print("");
|
|
1535
1534
|
}
|
|
1536
1535
|
let exitCode = 0;
|
|
@@ -4746,7 +4745,7 @@ function categorizeSpawnError(err) {
|
|
|
4746
4745
|
}
|
|
4747
4746
|
async function connectToUpstream(config, onDisconnect, onListChanged) {
|
|
4748
4747
|
const client = new Client(
|
|
4749
|
-
{ name: "mcph", version: true ? "0.46.
|
|
4748
|
+
{ name: "mcph", version: true ? "0.46.2" : "dev" },
|
|
4750
4749
|
{ capabilities: {} }
|
|
4751
4750
|
);
|
|
4752
4751
|
let transport;
|
|
@@ -5227,7 +5226,7 @@ var ConnectServer = class _ConnectServer {
|
|
|
5227
5226
|
this.apiUrl = apiUrl6;
|
|
5228
5227
|
this.token = token6;
|
|
5229
5228
|
this.server = new Server(
|
|
5230
|
-
{ name: "mcph", version: true ? "0.46.
|
|
5229
|
+
{ name: "mcph", version: true ? "0.46.2" : "dev" },
|
|
5231
5230
|
{
|
|
5232
5231
|
capabilities: {
|
|
5233
5232
|
tools: { listChanged: true },
|
|
@@ -7572,8 +7571,7 @@ async function runUpgrade(opts = {}) {
|
|
|
7572
7571
|
return { exitCode: 3, lines };
|
|
7573
7572
|
}
|
|
7574
7573
|
function readCurrentVersion() {
|
|
7575
|
-
|
|
7576
|
-
return typeof v === "string" ? v : "dev";
|
|
7574
|
+
return true ? "0.46.2" : "dev";
|
|
7577
7575
|
}
|
|
7578
7576
|
|
|
7579
7577
|
// src/index.ts
|
|
@@ -7689,7 +7687,7 @@ ${installBlock}
|
|
|
7689
7687
|
);
|
|
7690
7688
|
process.exit(0);
|
|
7691
7689
|
} else if (subcommand === "--version" || subcommand === "-V") {
|
|
7692
|
-
process.stdout.write(`mcph ${true ? "0.46.
|
|
7690
|
+
process.stdout.write(`mcph ${true ? "0.46.2" : "dev"}
|
|
7693
7691
|
`);
|
|
7694
7692
|
process.exit(0);
|
|
7695
7693
|
} else if (subcommand && !subcommand.startsWith("-")) {
|
package/package.json
CHANGED