@pi-archimedes/mcp 2.4.0 → 2.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-archimedes/mcp",
3
- "version": "2.4.0",
3
+ "version": "2.5.1",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -17,7 +17,7 @@
17
17
  "@modelcontextprotocol/sdk": "^1.30.0",
18
18
  "@napi-rs/keyring": "^1.3.0",
19
19
  "open": "^10.2.0",
20
- "@pi-archimedes/core": "2.4.0"
20
+ "@pi-archimedes/core": "2.5.1"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@earendil-works/pi-coding-agent": ">=0.1.0",
@@ -25,8 +25,8 @@
25
25
  "typebox": ">=1.1.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@earendil-works/pi-coding-agent": "^0.84.2",
29
- "@earendil-works/pi-tui": "^0.84.2",
28
+ "@earendil-works/pi-coding-agent": "^0.84.4",
29
+ "@earendil-works/pi-tui": "^0.84.4",
30
30
  "@types/node": "^22.0.0",
31
31
  "typebox": "^1.1.38",
32
32
  "typescript": "^6.0.3"
@@ -364,7 +364,10 @@ export class ServerClient {
364
364
  if (e instanceof StreamableHTTPError && e.code === 401) {
365
365
  const c = this.client;
366
366
  this.client = null;
367
- await c.close().catch(() => {});
367
+ // A failed connect auto-closes the transport (SDK Client.connect())
368
+ // which fires onclose and may already have nulled this.client —
369
+ // without this guard the TypeError masked the needs-auth state.
370
+ if (c) await c.close().catch(() => {});
368
371
  this._status = "needs-auth";
369
372
  this._error = NEEDS_AUTH_MESSAGE;
370
373
  return;