@burtson-labs/agent-core 1.6.24 → 1.6.25
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/dist/mcp/authFailure.d.ts +1 -0
- package/dist/mcp/authFailure.d.ts.map +1 -1
- package/dist/mcp/authFailure.js +29 -2
- package/dist/mcp/authFailure.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +2 -1
- package/dist/mcp/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -53,6 +53,7 @@ export interface McpAuthFailure {
|
|
|
53
53
|
export declare const AUTH_RECOVERY_MARKER = "[auth-recovery]";
|
|
54
54
|
/** True when a tool result carries auth-recovery guidance from this module. */
|
|
55
55
|
export declare function isAuthRecoveryGuidance(text: string): boolean;
|
|
56
|
+
export declare function looksLikeGoogleAuthFailure(message: string): boolean;
|
|
56
57
|
/**
|
|
57
58
|
* Does this MCP failure look like an expired or rejected credential?
|
|
58
59
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authFailure.d.ts","sourceRoot":"","sources":["../../src/mcp/authFailure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"authFailure.d.ts","sourceRoot":"","sources":["../../src/mcp/authFailure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAyBH,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD,+EAA+E;AAC/E,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5D;AAgBD,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG7D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CA6BtE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,gBAAgB,CAAC,EAAE,MAAM,GACxB,MAAM,CAKR"}
|
package/dist/mcp/authFailure.js
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.AUTH_RECOVERY_MARKER = void 0;
|
|
28
28
|
exports.isAuthRecoveryGuidance = isAuthRecoveryGuidance;
|
|
29
|
+
exports.looksLikeGoogleAuthFailure = looksLikeGoogleAuthFailure;
|
|
29
30
|
exports.looksLikeAuthFailure = looksLikeAuthFailure;
|
|
30
31
|
exports.describeMcpAuthFailure = describeMcpAuthFailure;
|
|
31
32
|
exports.formatMcpToolError = formatMcpToolError;
|
|
@@ -45,7 +46,11 @@ const AUTH_FAILURE_PATTERNS = [
|
|
|
45
46
|
/\b(?:401|403)\b|\bunauthori[sz]ed\b|\bforbidden\b/i,
|
|
46
47
|
/\bauthentication (?:failed|required|error)\b/i,
|
|
47
48
|
/\bnot authenticated\b|\bre-?authenticat/i,
|
|
48
|
-
/\binvalid_grant\b|\binvalid_token\b|\btoken_expired\b/i
|
|
49
|
+
/\binvalid_grant\b|\binvalid_token\b|\btoken_expired\b/i,
|
|
50
|
+
// An error that names a refresh token is an auth failure — Google's is
|
|
51
|
+
// "refused the refresh token", which none of the verb-specific patterns
|
|
52
|
+
// above catch on their own.
|
|
53
|
+
/\brefresh[_ ]?token\b/i
|
|
49
54
|
];
|
|
50
55
|
/**
|
|
51
56
|
* Stable sentinel embedded in every auth-recovery guidance message.
|
|
@@ -62,6 +67,22 @@ exports.AUTH_RECOVERY_MARKER = '[auth-recovery]';
|
|
|
62
67
|
function isAuthRecoveryGuidance(text) {
|
|
63
68
|
return typeof text === 'string' && text.includes(exports.AUTH_RECOVERY_MARKER);
|
|
64
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Signals that an auth failure is specifically a GOOGLE Workspace token, even
|
|
72
|
+
* when it surfaces through a Bandit-authenticated MCP server.
|
|
73
|
+
*
|
|
74
|
+
* Why this matters: a server like `burtson-labs` authenticates its transport
|
|
75
|
+
* with the user's Bandit key (so the per-server hint says `/login`), but then
|
|
76
|
+
* uses the user's stored GOOGLE refresh token to reach Gmail/Drive/Calendar.
|
|
77
|
+
* When GOOGLE rejects that token, `/login` (re-auth Bandit) does nothing — the
|
|
78
|
+
* fix is `/mcp google connect` (re-authorize Google). The transport is fine;
|
|
79
|
+
* the downstream Google grant is what expired. The error text is the only place
|
|
80
|
+
* that distinguishes the two, so we read it.
|
|
81
|
+
*/
|
|
82
|
+
const GOOGLE_AUTH_SIGNALS = /\b(google|gmail|googleemail|workspace|refresh token)\b/i;
|
|
83
|
+
function looksLikeGoogleAuthFailure(message) {
|
|
84
|
+
return !!message && looksLikeAuthFailure(message) && GOOGLE_AUTH_SIGNALS.test(message);
|
|
85
|
+
}
|
|
65
86
|
/**
|
|
66
87
|
* Does this MCP failure look like an expired or rejected credential?
|
|
67
88
|
*
|
|
@@ -90,7 +111,13 @@ function looksLikeAuthFailure(message) {
|
|
|
90
111
|
*/
|
|
91
112
|
function describeMcpAuthFailure(failure) {
|
|
92
113
|
const { server, original } = failure;
|
|
93
|
-
|
|
114
|
+
// Error content wins over the server's static auth config: a Google-token
|
|
115
|
+
// failure needs `/mcp google connect` regardless of how the server's
|
|
116
|
+
// transport authenticates. Otherwise fall back to the config-derived hint
|
|
117
|
+
// (e.g. `/login` for Bandit-auth servers), then the generic default.
|
|
118
|
+
const command = looksLikeGoogleAuthFailure(original)
|
|
119
|
+
? '/mcp google connect (re-authorize your Google Workspace — pick the correct account in the browser)'
|
|
120
|
+
: (failure.reconnectCommand ?? `/mcp connect ${server}`);
|
|
94
121
|
return [
|
|
95
122
|
`${exports.AUTH_RECOVERY_MARKER} Authentication for the "${server}" MCP server has expired or been rejected.`,
|
|
96
123
|
'',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authFailure.js","sourceRoot":"","sources":["../../src/mcp/authFailure.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;
|
|
1
|
+
{"version":3,"file":"authFailure.js","sourceRoot":"","sources":["../../src/mcp/authFailure.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAyDH,wDAEC;AAgBD,gEAEC;AASD,oDAGC;AAeD,wDA6BC;AAMD,gDAUC;AAnJD;;;;;;;GAOG;AACH,MAAM,qBAAqB,GAAa;IACtC,qCAAqC;IACrC,kCAAkC;IAClC,mGAAmG;IACnG,8DAA8D;IAC9D,oDAAoD;IACpD,+CAA+C;IAC/C,0CAA0C;IAC1C,wDAAwD;IACxD,uEAAuE;IACvE,wEAAwE;IACxE,4BAA4B;IAC5B,wBAAwB;CACzB,CAAC;AAqBF;;;;;;;;;GASG;AACU,QAAA,oBAAoB,GAAG,iBAAiB,CAAC;AAEtD,+EAA+E;AAC/E,SAAgB,sBAAsB,CAAC,IAAY;IACjD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,4BAAoB,CAAC,CAAC;AACzE,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,mBAAmB,GAAG,yDAAyD,CAAC;AAEtF,SAAgB,0BAA0B,CAAC,OAAe;IACxD,OAAO,CAAC,CAAC,OAAO,IAAI,oBAAoB,CAAC,OAAO,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC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EAAE,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,kBAAkB,cAAc,KAAK,OAAO,EAAE,CAAC;AACxD,CAAC"}
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export { McpClientPool, fingerprintServerConfig, type McpClientPoolOptions, type McpTrustGate, type McpToolsDiscoveredCallback, type RemoteToolDef as McpRemoteToolDef } from './clientPool';
|
|
14
14
|
export { mcpToolToAgentTool, getAllMcpAgentTools } from './toolAdapter';
|
|
15
|
-
export { looksLikeAuthFailure, describeMcpAuthFailure, formatMcpToolError, type McpAuthFailure } from './authFailure';
|
|
15
|
+
export { looksLikeAuthFailure, looksLikeGoogleAuthFailure, describeMcpAuthFailure, formatMcpToolError, type McpAuthFailure } from './authFailure';
|
|
16
16
|
export { serveBanditMcp } from './server';
|
|
17
17
|
export { shouldActivateServer, effectiveTriggers, inferProviderHint } from './activation';
|
|
18
18
|
export type { McpServerConfig, McpServersFile, McpServerStatus, McpServerSnapshot } from './types';
|
package/dist/mcp/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,IAAI,gBAAgB,EACvC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,IAAI,gBAAgB,EACvC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAClJ,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,eAAe,EACf,cAAc,EACd,eAAe,EACf,iBAAiB,EAClB,MAAM,SAAS,CAAC"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* pool gets zero behavior change. No backward-compat risk.
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.inferProviderHint = exports.effectiveTriggers = exports.shouldActivateServer = exports.serveBanditMcp = exports.formatMcpToolError = exports.describeMcpAuthFailure = exports.looksLikeAuthFailure = exports.getAllMcpAgentTools = exports.mcpToolToAgentTool = exports.fingerprintServerConfig = exports.McpClientPool = void 0;
|
|
15
|
+
exports.inferProviderHint = exports.effectiveTriggers = exports.shouldActivateServer = exports.serveBanditMcp = exports.formatMcpToolError = exports.describeMcpAuthFailure = exports.looksLikeGoogleAuthFailure = exports.looksLikeAuthFailure = exports.getAllMcpAgentTools = exports.mcpToolToAgentTool = exports.fingerprintServerConfig = exports.McpClientPool = void 0;
|
|
16
16
|
var clientPool_1 = require("./clientPool");
|
|
17
17
|
Object.defineProperty(exports, "McpClientPool", { enumerable: true, get: function () { return clientPool_1.McpClientPool; } });
|
|
18
18
|
Object.defineProperty(exports, "fingerprintServerConfig", { enumerable: true, get: function () { return clientPool_1.fingerprintServerConfig; } });
|
|
@@ -21,6 +21,7 @@ Object.defineProperty(exports, "mcpToolToAgentTool", { enumerable: true, get: fu
|
|
|
21
21
|
Object.defineProperty(exports, "getAllMcpAgentTools", { enumerable: true, get: function () { return toolAdapter_1.getAllMcpAgentTools; } });
|
|
22
22
|
var authFailure_1 = require("./authFailure");
|
|
23
23
|
Object.defineProperty(exports, "looksLikeAuthFailure", { enumerable: true, get: function () { return authFailure_1.looksLikeAuthFailure; } });
|
|
24
|
+
Object.defineProperty(exports, "looksLikeGoogleAuthFailure", { enumerable: true, get: function () { return authFailure_1.looksLikeGoogleAuthFailure; } });
|
|
24
25
|
Object.defineProperty(exports, "describeMcpAuthFailure", { enumerable: true, get: function () { return authFailure_1.describeMcpAuthFailure; } });
|
|
25
26
|
Object.defineProperty(exports, "formatMcpToolError", { enumerable: true, get: function () { return authFailure_1.formatMcpToolError; } });
|
|
26
27
|
var server_1 = require("./server");
|
package/dist/mcp/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,2CAOsB;AANpB,2GAAA,aAAa,OAAA;AACb,qHAAA,uBAAuB,OAAA;AAMzB,6CAAwE;AAA/D,iHAAA,kBAAkB,OAAA;AAAE,kHAAA,mBAAmB,OAAA;AAChD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,2CAOsB;AANpB,2GAAA,aAAa,OAAA;AACb,qHAAA,uBAAuB,OAAA;AAMzB,6CAAwE;AAA/D,iHAAA,kBAAkB,OAAA;AAAE,kHAAA,mBAAmB,OAAA;AAChD,6CAAkJ;AAAzI,mHAAA,oBAAoB,OAAA;AAAE,yHAAA,0BAA0B,OAAA;AAAE,qHAAA,sBAAsB,OAAA;AAAE,iHAAA,kBAAkB,OAAA;AACrG,mCAA0C;AAAjC,wGAAA,cAAc,OAAA;AACvB,2CAIsB;AAHpB,kHAAA,oBAAoB,OAAA;AACpB,+GAAA,iBAAiB,OAAA;AACjB,+GAAA,iBAAiB,OAAA"}
|