@burtson-labs/agent-core 1.6.25 → 1.6.26
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.
|
@@ -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;AAkCH,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,CA2CtE;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
|
@@ -50,7 +50,16 @@ const AUTH_FAILURE_PATTERNS = [
|
|
|
50
50
|
// An error that names a refresh token is an auth failure — Google's is
|
|
51
51
|
// "refused the refresh token", which none of the verb-specific patterns
|
|
52
52
|
// above catch on their own.
|
|
53
|
-
/\brefresh[_ ]?token\b/i
|
|
53
|
+
/\brefresh[_ ]?token\b/i,
|
|
54
|
+
// "No connection" preconditions: the credential isn't expired, it was never
|
|
55
|
+
// set up (or was disconnected). Recovery is identical — connect it — so this
|
|
56
|
+
// routes through the same auth-recovery guidance. Google's is "No Google
|
|
57
|
+
// connection matches the request … Visit …/account/google-connections to
|
|
58
|
+
// connect one." Verb-agnostic patterns above miss it because nothing is
|
|
59
|
+
// "expired" or "rejected."
|
|
60
|
+
/\bno\b[\s\S]{0,40}\bconnection\b[\s\S]{0,30}\b(?:matches|found|configured|exists|available)\b/i,
|
|
61
|
+
/\b(?:account|workspace)\b[\s\S]{0,30}\b(?:not connected|isn'?t connected|needs? to be connected)\b/i,
|
|
62
|
+
/\/account\/google-connections\b/i
|
|
54
63
|
];
|
|
55
64
|
/**
|
|
56
65
|
* Stable sentinel embedded in every auth-recovery guidance message.
|
|
@@ -111,33 +120,38 @@ function looksLikeAuthFailure(message) {
|
|
|
111
120
|
*/
|
|
112
121
|
function describeMcpAuthFailure(failure) {
|
|
113
122
|
const { server, original } = failure;
|
|
114
|
-
// Error content wins over the server's static auth config: a Google
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
const
|
|
119
|
-
|
|
123
|
+
// Error content wins over the server's static auth config: a Google failure
|
|
124
|
+
// needs `/mcp google connect` regardless of how the server's transport
|
|
125
|
+
// authenticates. Otherwise fall back to the config-derived hint (e.g.
|
|
126
|
+
// `/login` for Bandit-auth servers), then the generic default.
|
|
127
|
+
const isGoogle = looksLikeGoogleAuthFailure(original);
|
|
128
|
+
const command = isGoogle
|
|
129
|
+
? '/mcp google connect (re-authorize Google in the browser — pick the correct account)'
|
|
120
130
|
: (failure.reconnectCommand ?? `/mcp connect ${server}`);
|
|
121
|
-
|
|
122
|
-
`${exports.AUTH_RECOVERY_MARKER}
|
|
131
|
+
const lines = [
|
|
132
|
+
`${exports.AUTH_RECOVERY_MARKER} The "${server}" MCP server can't reach its data — its connection needs (re)authorizing.`,
|
|
123
133
|
'',
|
|
124
134
|
`Underlying error: ${original}`,
|
|
125
135
|
'',
|
|
126
|
-
'This is RECOVERABLE and usually takes under a minute
|
|
127
|
-
'configured correctly, its credential just needs refreshing. Do not treat',
|
|
136
|
+
'This is RECOVERABLE and usually takes under a minute. Do not treat',
|
|
128
137
|
`"${server}" as permanently unavailable.`,
|
|
129
138
|
'',
|
|
130
139
|
'Do this now, in order:',
|
|
131
|
-
`1. Tell the user plainly that the "${server}" connection needs re
|
|
140
|
+
`1. Tell the user plainly that the "${server}" connection needs (re)authorizing,`,
|
|
132
141
|
` and that they can fix it by running: ${command}`,
|
|
133
142
|
` Present that command as inline code in one sentence — do not wrap it in a`,
|
|
134
|
-
` code fence or put it on its own line
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
143
|
+
` code fence or put it on its own line. Prefer that CLI command over any web`,
|
|
144
|
+
` URL in the error above; the user is in the terminal.`,
|
|
145
|
+
];
|
|
146
|
+
if (isGoogle) {
|
|
147
|
+
// The error carries a workspace/account filter (e.g. workspace=primary). If
|
|
148
|
+
// the user just connected but under a different label, the connection
|
|
149
|
+
// exists but doesn't match — `/mcp google list` surfaces that instead of
|
|
150
|
+
// sending them in a reconnect loop.
|
|
151
|
+
lines.push(` If they say they JUST connected, have them run \`/mcp google list\` first —`, ` the account may be connected under a different workspace than the tool asked for.`);
|
|
152
|
+
}
|
|
153
|
+
lines.push('2. Do NOT silently switch to another route to get the same data. If you can', ' reach it another way, say what you are about to do and why FIRST — a user', ' who is not told the connection is down will assume it worked.', '3. If the rest of the task does not depend on this server, continue with it', ' and report the broken connection alongside your result.');
|
|
154
|
+
return lines.join('\n');
|
|
141
155
|
}
|
|
142
156
|
/**
|
|
143
157
|
* Wrap an MCP invocation error, upgrading auth-shaped failures into recovery
|
|
@@ -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;;;AAkEH,wDAEC;AAgBD,gEAEC;AASD,oDAGC;AAeD,wDA2CC;AAMD,gDAUC;AA1KD;;;;;;;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;IACxB,4EAA4E;IAC5E,6EAA6E;IAC7E,yEAAyE;IACzE,yEAAyE;IACzE,wEAAwE;IACxE,2BAA2B;IAC3B,gGAAgG;IAChG,qGAAqG;IACrG,kCAAkC;CACnC,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,CAAC;AACzF,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,OAAe;IAClD,IAAI,CAAC,OAAO,EAAE,CAAC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