teapot-coding-agent 0.37.19 → 0.37.20
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/agent/mcp-oauth-manager.js +27 -14
- package/package.json +1 -1
- package/public/assets/index-u-RR9A0b.js +33 -0
- package/public/assets/index-u-RR9A0b.js.map +1 -0
- package/public/assets/{shiki-BXSMAdOU.js → shiki-CKHAk9Lj.js} +2 -2
- package/public/assets/{shiki-BXSMAdOU.js.map → shiki-CKHAk9Lj.js.map} +1 -1
- package/public/index.html +1 -1
- package/public/assets/index-CeflKG7d.js +0 -33
- package/public/assets/index-CeflKG7d.js.map +0 -1
|
@@ -144,19 +144,22 @@ export class ServerAuth {
|
|
|
144
144
|
if (uris.length === 0)
|
|
145
145
|
return false; // unknown is not wrong: older records omit the list
|
|
146
146
|
/**
|
|
147
|
-
* A PLACEHOLDER redirect
|
|
147
|
+
* A PLACEHOLDER redirect says NOTHING either way — so it must not be treated as stale.
|
|
148
148
|
*
|
|
149
|
-
* `authFor()` builds
|
|
150
|
-
* until a flow opens a listener
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
149
|
+
* `authFor()` builds every reconnect's provider with `http://127.0.0.1/callback`, no port,
|
|
150
|
+
* because none exists until a flow opens a listener. An earlier version called that
|
|
151
|
+
* unconditionally stale, which made `tokens()` DROP the grant on every reconnect: a server that
|
|
152
|
+
* had been authorized minutes earlier reported "needs a grant" again (MEASURED: Notion and
|
|
153
|
+
* Canva both lost their access token after a restart, with `teapot.theme`-style certainty that
|
|
154
|
+
* the authorization itself had worked).
|
|
154
155
|
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
156
|
+
* A placeholder can neither confirm nor refute a registration, so the honest answer is "I do not
|
|
157
|
+
* know" — and an unknown registration keeps its grant. A real mismatch (a listener-backed URL
|
|
158
|
+
* the record does not list) is still reported, which is the case that actually produced
|
|
159
|
+
* `Client ID mismatch`.
|
|
157
160
|
*/
|
|
158
161
|
if (!/:\d+\//.test(this.redirectUrl))
|
|
159
|
-
return
|
|
162
|
+
return false;
|
|
160
163
|
return !uris.includes(this.redirectUrl);
|
|
161
164
|
}
|
|
162
165
|
async saveClientInformation(info, _ctx) {
|
|
@@ -202,11 +205,21 @@ export class ServerAuth {
|
|
|
202
205
|
* Returning nothing makes the flow an honest "needs a grant" instead: the panel offers 🔑, and
|
|
203
206
|
* completing it issues a pair for the client that actually exists.
|
|
204
207
|
*/
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
/**
|
|
209
|
+
* A registration we cannot vouch for means DO NOT PRESENT the grant — never DELETE it.
|
|
210
|
+
*
|
|
211
|
+
* This used to clear the stored tokens here, and clearing is not the same as declining: the
|
|
212
|
+
* store persists on the next write, so an "I cannot verify this" answer from a placeholder
|
|
213
|
+
* provider ERASED a working grant minutes after it was obtained (MEASURED on this machine:
|
|
214
|
+
* both Notion's and Canva's `accessToken`/`refreshToken` were gone from mcp-oauth.json while the
|
|
215
|
+
* authorizations themselves had succeeded).
|
|
216
|
+
*
|
|
217
|
+
* Declining is reversible — the next connect that CAN verify the registration reads the tokens
|
|
218
|
+
* again. Erasing is not: it costs the operator a full re-authorization for a transient
|
|
219
|
+
* uncertainty.
|
|
220
|
+
*/
|
|
221
|
+
if (this.store.accessToken && this.registrationIsStale())
|
|
222
|
+
return undefined;
|
|
210
223
|
if (!this.store.accessToken)
|
|
211
224
|
return undefined;
|
|
212
225
|
return {
|