pi-mcp-extension 1.9.9 → 1.9.10
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 +2 -1
- package/src/server-manager.ts +4 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-mcp-extension",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.10",
|
|
4
4
|
"description": "MCP (Model Context Protocol) client extension for the Pi coding agent — connect Pi to any MCP server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"@eslint/js": "^10.0.1",
|
|
46
46
|
"@types/node": "^26.6.5",
|
|
47
47
|
"eslint": "^10.13.0",
|
|
48
|
+
"fast-check": "^4.10.2",
|
|
48
49
|
"tsx": "^4.19.4",
|
|
49
50
|
"typescript": "^5.7.0",
|
|
50
51
|
"typescript-eslint": "^8.71.2"
|
package/src/server-manager.ts
CHANGED
|
@@ -99,7 +99,7 @@ export function isOAuthUnauthorizedError(error: unknown, seen = new Set<unknown>
|
|
|
99
99
|
|
|
100
100
|
// Reject messages that explicitly report a non-401/403 HTTP status code
|
|
101
101
|
const httpStatusMatch = msg.match(
|
|
102
|
-
/\b(?:HTTP
|
|
102
|
+
/\b(?:HTTP(?:\/\d(?:\.\d)?)?\s+|status(?:\s+code)?[:\s]+|(?:POSTing|GETting|connecting)\s+to\s+\S+:\s*|(?:Non-200\s+status\s+code\s*\())(\d{3})\b/i,
|
|
103
103
|
);
|
|
104
104
|
if (httpStatusMatch) {
|
|
105
105
|
const status = Number(httpStatusMatch[1]);
|
|
@@ -112,18 +112,17 @@ export function isOAuthUnauthorizedError(error: unknown, seen = new Set<unknown>
|
|
|
112
112
|
// nosemgrep: pi-mcp.no-401-substring -- WHY: intentional message-text fallback after structured checks for SDK paths that only surface text
|
|
113
113
|
/^\s*401\s*$/.test(msg) ||
|
|
114
114
|
// nosemgrep: pi-mcp.no-401-substring -- WHY: intentional message-text fallback after structured checks for SDK paths that only surface text
|
|
115
|
-
/\bHTTP
|
|
115
|
+
/\bHTTP(?:\/\d(?:\.\d)?)?[:\s]+401\b/i.test(msg) ||
|
|
116
116
|
// nosemgrep: pi-mcp.no-401-substring -- WHY: intentional message-text fallback after structured checks for SDK paths that only surface text
|
|
117
117
|
/\bstatus(?:\s+code)?[:\s(]+401\b/i.test(msg) ||
|
|
118
118
|
// nosemgrep: pi-mcp.no-401-substring -- WHY: intentional message-text fallback after structured checks for SDK paths that only surface text
|
|
119
|
+
/\b(?:POSTing|GETting|connecting)\s+to\s+\S+:\s*401\b/i.test(msg) ||
|
|
120
|
+
// nosemgrep: pi-mcp.no-401-substring -- WHY: intentional message-text fallback after structured checks for SDK paths that only surface text
|
|
119
121
|
/\breturned\s+401\b/i.test(msg) ||
|
|
120
122
|
// nosemgrep: pi-mcp.no-401-substring -- WHY: intentional message-text fallback after structured checks for SDK paths that only surface text
|
|
121
123
|
/\b401\s+Unauthorized\b/i.test(msg) ||
|
|
122
124
|
// nosemgrep: pi-mcp.no-401-substring -- WHY: intentional message-text fallback after structured checks for SDK paths that only surface text
|
|
123
|
-
/:\s*401\b/.test(msg) ||
|
|
124
|
-
// nosemgrep: pi-mcp.no-401-substring -- WHY: intentional message-text fallback after structured checks for SDK paths that only surface text
|
|
125
125
|
/\(401\)/.test(msg) ||
|
|
126
|
-
/\bUnauthorized\b/i.test(msg) ||
|
|
127
126
|
/\binvalid_token\b/i.test(msg)
|
|
128
127
|
) {
|
|
129
128
|
return true;
|