@yawlabs/mcph 0.46.0 → 0.46.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/CHANGELOG.md +4 -0
- package/dist/index.js +5 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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.1 — 2026-04-18
|
|
6
|
+
|
|
7
|
+
- **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.
|
|
8
|
+
|
|
5
9
|
## 0.46.0 — 2026-04-18
|
|
6
10
|
|
|
7
11
|
- **`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.1" : "dev";
|
|
1462
1462
|
async function runDoctor(opts = {}) {
|
|
1463
1463
|
if (opts.json) return runDoctorJson(opts);
|
|
1464
1464
|
const lines = [];
|
|
@@ -4746,7 +4746,7 @@ function categorizeSpawnError(err) {
|
|
|
4746
4746
|
}
|
|
4747
4747
|
async function connectToUpstream(config, onDisconnect, onListChanged) {
|
|
4748
4748
|
const client = new Client(
|
|
4749
|
-
{ name: "mcph", version: true ? "0.46.
|
|
4749
|
+
{ name: "mcph", version: true ? "0.46.1" : "dev" },
|
|
4750
4750
|
{ capabilities: {} }
|
|
4751
4751
|
);
|
|
4752
4752
|
let transport;
|
|
@@ -5227,7 +5227,7 @@ var ConnectServer = class _ConnectServer {
|
|
|
5227
5227
|
this.apiUrl = apiUrl6;
|
|
5228
5228
|
this.token = token6;
|
|
5229
5229
|
this.server = new Server(
|
|
5230
|
-
{ name: "mcph", version: true ? "0.46.
|
|
5230
|
+
{ name: "mcph", version: true ? "0.46.1" : "dev" },
|
|
5231
5231
|
{
|
|
5232
5232
|
capabilities: {
|
|
5233
5233
|
tools: { listChanged: true },
|
|
@@ -7572,8 +7572,7 @@ async function runUpgrade(opts = {}) {
|
|
|
7572
7572
|
return { exitCode: 3, lines };
|
|
7573
7573
|
}
|
|
7574
7574
|
function readCurrentVersion() {
|
|
7575
|
-
|
|
7576
|
-
return typeof v === "string" ? v : "dev";
|
|
7575
|
+
return true ? "0.46.1" : "dev";
|
|
7577
7576
|
}
|
|
7578
7577
|
|
|
7579
7578
|
// src/index.ts
|
|
@@ -7689,7 +7688,7 @@ ${installBlock}
|
|
|
7689
7688
|
);
|
|
7690
7689
|
process.exit(0);
|
|
7691
7690
|
} else if (subcommand === "--version" || subcommand === "-V") {
|
|
7692
|
-
process.stdout.write(`mcph ${true ? "0.46.
|
|
7691
|
+
process.stdout.write(`mcph ${true ? "0.46.1" : "dev"}
|
|
7693
7692
|
`);
|
|
7694
7693
|
process.exit(0);
|
|
7695
7694
|
} else if (subcommand && !subcommand.startsWith("-")) {
|
package/package.json
CHANGED