@chrischall/mcp-utils 0.17.1 → 0.18.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/README.md +1 -1
- package/dist/auth/index.d.ts +89 -6
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +62 -4
- package/dist/auth/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/auth/index.d.ts
CHANGED
|
@@ -32,10 +32,63 @@
|
|
|
32
32
|
* actionable `.hint` verbatim ("make sure a signed-in tab is open… reload
|
|
33
33
|
* the extension…") instead of the generic truncated wrap. This absorbs the
|
|
34
34
|
* `classifyBridgeError(e) === 'bridge_down'` branch the fleet copies of this
|
|
35
|
-
* skeleton hand-rolled, and
|
|
36
|
-
* creditkarma migrations onto this resolver in a later wave.
|
|
35
|
+
* skeleton hand-rolled, and unblocked the ofw migration (ofw-mcp#255).
|
|
37
36
|
* ({@link resolveAuthPattern} never had the gap — it propagates a configured
|
|
38
37
|
* path's errors unwrapped, so an injected fetchproxy path's hint survives.)
|
|
38
|
+
*
|
|
39
|
+
* ## Who can actually adopt these, and who cannot
|
|
40
|
+
*
|
|
41
|
+
* The "later wave" this header used to promise turned out to be one repo. All
|
|
42
|
+
* nine candidates were surveyed in 2026-08; the results are recorded here so
|
|
43
|
+
* nobody re-derives them:
|
|
44
|
+
*
|
|
45
|
+
* - **ofw** — adopted {@link resolveAuthPattern} (ofw-mcp#255). Its order
|
|
46
|
+
* (sessionScrape → fetchproxy) is a prefix of the fixed one, so nothing
|
|
47
|
+
* moved. It is the worked example.
|
|
48
|
+
* - **evite** — CANNOT, without changing behaviour. It runs sessionScrape
|
|
49
|
+
* BEFORE its env token, documented as "the user's documented default
|
|
50
|
+
* (username/password first)". The fixed order below is token → oauth →
|
|
51
|
+
* sessionScrape, which would silently invert which credential wins when
|
|
52
|
+
* both are set.
|
|
53
|
+
* - **canvas-parent** — CANNOT, same reason on a different pair: it runs
|
|
54
|
+
* sessionScrape before OAuth and says so ("Takes precedence over OAuth").
|
|
55
|
+
* - **signupgenius** — CANNOT, on the result shape rather than the order. Its
|
|
56
|
+
* resolution returns `{ account, refresh }` — a strategy, not a credential —
|
|
57
|
+
* and deliberately does NOT resolve at resolve time, because a
|
|
58
|
+
* startup-captured JWT dies at the 30-minute cliff and a boot-time lift
|
|
59
|
+
* failure sticks for the life of the process. A {@link PathResolver} must
|
|
60
|
+
* RETURN a credential, so adopting it reintroduces both bugs.
|
|
61
|
+
* - **infinitecampus** — CANNOT, for signupgenius's reason exactly: its
|
|
62
|
+
* resolution returns `{ account, refresh }` and defers the lift on purpose,
|
|
63
|
+
* because JSESSIONID is a short-idle Java servlet session and a fetchproxy
|
|
64
|
+
* account has no credentials to re-login with. A value captured once at
|
|
65
|
+
* process start is dead by the first request.
|
|
66
|
+
* - **creditkarma** — CANNOT, and this one is the subtlest refusal. Its
|
|
67
|
+
* shape fits: two paths (`CK_COOKIES` → fetchproxy, since `ck_set_session`
|
|
68
|
+
* writes the env var and re-enters at path 1) returning
|
|
69
|
+
* `{ cookies, source }`, which is {@link ResolvedCredential} under another
|
|
70
|
+
* name. What blocks it is the ERROR contract: `resolveAuth` throws a typed
|
|
71
|
+
* `CkAuthError` carrying a `reason`, and `tools/sync.ts` branches on
|
|
72
|
+
* `isCkAuthError(err, 'session_rejected')` to decide whether to
|
|
73
|
+
* re-bootstrap. These resolvers throw `createHelpfulError` /
|
|
74
|
+
* `SessionNotAuthenticatedError`, so that branch would stop matching and a
|
|
75
|
+
* retry path would change behaviour silently.
|
|
76
|
+
* - **vibo / artsonia / resy** — nothing to adopt. Each has a single auth
|
|
77
|
+
* path, so there is no ordering to share.
|
|
78
|
+
*
|
|
79
|
+
* Three different things blocked adoption, which is the useful part: the
|
|
80
|
+
* ORDER (evite, canvas-parent), the RESULT SHAPE (signupgenius,
|
|
81
|
+
* infinitecampus) and the ERROR CONTRACT (creditkarma). A repo can match this
|
|
82
|
+
* module on two of the three and still be unable to use it, so check all
|
|
83
|
+
* three before starting.
|
|
84
|
+
*
|
|
85
|
+
* On the first of them: **the fixed order is a design stance, not a
|
|
86
|
+
* default.** "This is the only ordering — it never
|
|
87
|
+
* branches on which site is calling" is what makes this shared, and it is also
|
|
88
|
+
* what makes it inapplicable to a site whose own order was chosen for a
|
|
89
|
+
* documented reason. Before migrating anything else, check its order against
|
|
90
|
+
* the one below; where they differ, the repo is telling you something and the
|
|
91
|
+
* answer is not to reorder it silently.
|
|
39
92
|
*/
|
|
40
93
|
import { type EnvSource } from '../config/index.js';
|
|
41
94
|
/** A `@fetchproxy/bootstrap` session blob: declared cookies / storage, by key. */
|
|
@@ -56,7 +109,27 @@ export interface ResolvedCredential {
|
|
|
56
109
|
credential: string;
|
|
57
110
|
/** Which path produced it. Diagnostics / cache-keying only — do not branch on it. */
|
|
58
111
|
source: 'env' | 'fetchproxy';
|
|
112
|
+
/**
|
|
113
|
+
* When the credential stops being valid, if the source knew. Absent on the
|
|
114
|
+
* env path (an env var carries no expiry) and on any `parseTokens` that
|
|
115
|
+
* returns a bare string.
|
|
116
|
+
*
|
|
117
|
+
* It exists because every hand-rolled resolver this module was written to
|
|
118
|
+
* absorb carries one — a signed-in tab stores it (OFW keeps
|
|
119
|
+
* `localStorage["tokenExpiry"]` beside the token), and 401-replay logic is
|
|
120
|
+
* smarter for having it. Without somewhere to put it, adopting this resolver
|
|
121
|
+
* meant discarding it silently, and none of those eight migrated.
|
|
122
|
+
*/
|
|
123
|
+
expiresAt?: Date;
|
|
59
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* What {@link AuthResolverOptions.parseTokens} may return: the credential
|
|
127
|
+
* alone, or the credential with the expiry the session carried beside it.
|
|
128
|
+
*/
|
|
129
|
+
export type ParsedCredential = string | {
|
|
130
|
+
credential: string;
|
|
131
|
+
expiresAt?: Date;
|
|
132
|
+
};
|
|
60
133
|
/** Options for {@link createAuthResolver}. */
|
|
61
134
|
export interface AuthResolverOptions {
|
|
62
135
|
/** Env var holding the credential when the user supplies it directly (path 1). */
|
|
@@ -71,11 +144,15 @@ export interface AuthResolverOptions {
|
|
|
71
144
|
/** The opts object passed verbatim to {@link bootstrap} (domains, declare, …). */
|
|
72
145
|
bootstrapOptions: unknown;
|
|
73
146
|
/**
|
|
74
|
-
* Lift the credential out of the fetchproxy session blob.
|
|
75
|
-
* credential string, or `
|
|
76
|
-
*
|
|
147
|
+
* Lift the credential out of the fetchproxy session blob. Return either the
|
|
148
|
+
* credential string, or `{ credential, expiresAt }` when the session carried
|
|
149
|
+
* an expiry beside it (see {@link ResolvedCredential.expiresAt}).
|
|
150
|
+
*
|
|
151
|
+
* `undefined`, `''`, or `{ credential: '' }` all mean the signed-in tab did
|
|
152
|
+
* not carry the credential — the emptiness check is on the credential in
|
|
153
|
+
* every form — and are surfaced as a "sign in" error.
|
|
77
154
|
*/
|
|
78
|
-
parseTokens: (session: FetchproxySession) =>
|
|
155
|
+
parseTokens: (session: FetchproxySession) => ParsedCredential | undefined;
|
|
79
156
|
/** Human-readable service name for the not-signed-in error (e.g. "Zola"). */
|
|
80
157
|
serviceName?: string;
|
|
81
158
|
/** Host to point the user at when the browser session is missing (e.g. "zola.com"). */
|
|
@@ -105,6 +182,12 @@ export interface PatternResult {
|
|
|
105
182
|
credential: string;
|
|
106
183
|
/** Which path produced it. Diagnostics only — callers should not branch on it. */
|
|
107
184
|
source: string;
|
|
185
|
+
/**
|
|
186
|
+
* When the credential stops being valid, if the path knew. Passed straight
|
|
187
|
+
* through — {@link resolveAuthPattern} returns whatever the winning resolver
|
|
188
|
+
* produced. See {@link ResolvedCredential.expiresAt}.
|
|
189
|
+
*/
|
|
190
|
+
expiresAt?: Date;
|
|
108
191
|
}
|
|
109
192
|
/** A single path resolver. Returning a value claims the path; throwing aborts. */
|
|
110
193
|
export type PathResolver = () => Promise<PatternResult>;
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AAEH,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAY9E,kFAAkF;AAClF,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAExE,wFAAwF;AACxF,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,MAAM,EAAE,KAAK,GAAG,YAAY,CAAC;IAC7B;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEjF,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IAClC,kFAAkF;IAClF,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mFAAmF;IACnF,SAAS,EAAE,WAAW,CAAC;IACvB,kFAAkF;IAClF,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;;;;;;;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,CAAC;IACtB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAWD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,sBAAsB,GAC3B,MAAM,OAAO,CAAC,mBAAmB,CAAC,CA0EpC;AAMD,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
package/dist/auth/index.js
CHANGED
|
@@ -32,10 +32,63 @@
|
|
|
32
32
|
* actionable `.hint` verbatim ("make sure a signed-in tab is open… reload
|
|
33
33
|
* the extension…") instead of the generic truncated wrap. This absorbs the
|
|
34
34
|
* `classifyBridgeError(e) === 'bridge_down'` branch the fleet copies of this
|
|
35
|
-
* skeleton hand-rolled, and
|
|
36
|
-
* creditkarma migrations onto this resolver in a later wave.
|
|
35
|
+
* skeleton hand-rolled, and unblocked the ofw migration (ofw-mcp#255).
|
|
37
36
|
* ({@link resolveAuthPattern} never had the gap — it propagates a configured
|
|
38
37
|
* path's errors unwrapped, so an injected fetchproxy path's hint survives.)
|
|
38
|
+
*
|
|
39
|
+
* ## Who can actually adopt these, and who cannot
|
|
40
|
+
*
|
|
41
|
+
* The "later wave" this header used to promise turned out to be one repo. All
|
|
42
|
+
* nine candidates were surveyed in 2026-08; the results are recorded here so
|
|
43
|
+
* nobody re-derives them:
|
|
44
|
+
*
|
|
45
|
+
* - **ofw** — adopted {@link resolveAuthPattern} (ofw-mcp#255). Its order
|
|
46
|
+
* (sessionScrape → fetchproxy) is a prefix of the fixed one, so nothing
|
|
47
|
+
* moved. It is the worked example.
|
|
48
|
+
* - **evite** — CANNOT, without changing behaviour. It runs sessionScrape
|
|
49
|
+
* BEFORE its env token, documented as "the user's documented default
|
|
50
|
+
* (username/password first)". The fixed order below is token → oauth →
|
|
51
|
+
* sessionScrape, which would silently invert which credential wins when
|
|
52
|
+
* both are set.
|
|
53
|
+
* - **canvas-parent** — CANNOT, same reason on a different pair: it runs
|
|
54
|
+
* sessionScrape before OAuth and says so ("Takes precedence over OAuth").
|
|
55
|
+
* - **signupgenius** — CANNOT, on the result shape rather than the order. Its
|
|
56
|
+
* resolution returns `{ account, refresh }` — a strategy, not a credential —
|
|
57
|
+
* and deliberately does NOT resolve at resolve time, because a
|
|
58
|
+
* startup-captured JWT dies at the 30-minute cliff and a boot-time lift
|
|
59
|
+
* failure sticks for the life of the process. A {@link PathResolver} must
|
|
60
|
+
* RETURN a credential, so adopting it reintroduces both bugs.
|
|
61
|
+
* - **infinitecampus** — CANNOT, for signupgenius's reason exactly: its
|
|
62
|
+
* resolution returns `{ account, refresh }` and defers the lift on purpose,
|
|
63
|
+
* because JSESSIONID is a short-idle Java servlet session and a fetchproxy
|
|
64
|
+
* account has no credentials to re-login with. A value captured once at
|
|
65
|
+
* process start is dead by the first request.
|
|
66
|
+
* - **creditkarma** — CANNOT, and this one is the subtlest refusal. Its
|
|
67
|
+
* shape fits: two paths (`CK_COOKIES` → fetchproxy, since `ck_set_session`
|
|
68
|
+
* writes the env var and re-enters at path 1) returning
|
|
69
|
+
* `{ cookies, source }`, which is {@link ResolvedCredential} under another
|
|
70
|
+
* name. What blocks it is the ERROR contract: `resolveAuth` throws a typed
|
|
71
|
+
* `CkAuthError` carrying a `reason`, and `tools/sync.ts` branches on
|
|
72
|
+
* `isCkAuthError(err, 'session_rejected')` to decide whether to
|
|
73
|
+
* re-bootstrap. These resolvers throw `createHelpfulError` /
|
|
74
|
+
* `SessionNotAuthenticatedError`, so that branch would stop matching and a
|
|
75
|
+
* retry path would change behaviour silently.
|
|
76
|
+
* - **vibo / artsonia / resy** — nothing to adopt. Each has a single auth
|
|
77
|
+
* path, so there is no ordering to share.
|
|
78
|
+
*
|
|
79
|
+
* Three different things blocked adoption, which is the useful part: the
|
|
80
|
+
* ORDER (evite, canvas-parent), the RESULT SHAPE (signupgenius,
|
|
81
|
+
* infinitecampus) and the ERROR CONTRACT (creditkarma). A repo can match this
|
|
82
|
+
* module on two of the three and still be unable to use it, so check all
|
|
83
|
+
* three before starting.
|
|
84
|
+
*
|
|
85
|
+
* On the first of them: **the fixed order is a design stance, not a
|
|
86
|
+
* default.** "This is the only ordering — it never
|
|
87
|
+
* branches on which site is calling" is what makes this shared, and it is also
|
|
88
|
+
* what makes it inapplicable to a site whose own order was chosen for a
|
|
89
|
+
* documented reason. Before migrating anything else, check its order against
|
|
90
|
+
* the one below; where they differ, the repo is telling you something and the
|
|
91
|
+
* answer is not to reorder it silently.
|
|
39
92
|
*/
|
|
40
93
|
import { readEnvVar, parseBoolEnv } from '../config/index.js';
|
|
41
94
|
import { truncateErrorMessage, SessionNotAuthenticatedError, createHelpfulError, } from '../errors/index.js';
|
|
@@ -109,9 +162,14 @@ export function createAuthResolver(opts) {
|
|
|
109
162
|
// hatch. Redact + truncate the underlying message.
|
|
110
163
|
throw createHelpfulError(`Auth: no ${envVar} set, and fetchproxy fallback failed: ${truncateErrorMessage(messageOf(e))}`, { hint: `Set ${envVar}, or sign in in your browser and retry.` });
|
|
111
164
|
}
|
|
112
|
-
|
|
165
|
+
// A bare string and `{ credential, expiresAt }` are both accepted; the
|
|
166
|
+
// emptiness check is on the CREDENTIAL either way, so an object carrying
|
|
167
|
+
// an empty one means "not signed in" exactly as an empty string does.
|
|
168
|
+
const parsed = parseTokens(session);
|
|
169
|
+
const credential = typeof parsed === 'string' ? parsed : parsed?.credential;
|
|
113
170
|
if (credential) {
|
|
114
|
-
|
|
171
|
+
const expiresAt = typeof parsed === 'string' ? undefined : parsed?.expiresAt;
|
|
172
|
+
return { credential, source: 'fetchproxy', ...(expiresAt ? { expiresAt } : {}) };
|
|
115
173
|
}
|
|
116
174
|
// Bootstrap succeeded but the declared key wasn't present → the browser
|
|
117
175
|
// tab isn't signed in. This is the stable "go authenticate" condition.
|
package/dist/auth/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../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E,CAAC;YAC9B,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO,GAAG,CAAC,CAAC;gBACZ,IAAI,OAAO,GAAG,UAAU;oBAAE,MAAM,KAAK,CAAC,YAAY,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;QACD,MAAM,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,SAAS,OAAO;QACrB,wEAAwE;QACxE,0DAA0D;QAC1D,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAC9B,MAAM,CAAC,GAAG,iBAAiB,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;YACzC,IAAI,QAAQ,KAAK,CAAC;gBAAE,QAAQ,GAAG,IAAI,CAAC;QACtC,CAAC,CAAC,CAAC;QACH,QAAQ,GAAG,CAAC,CAAC;QACb,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,GAAY;IAC7B,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrischall/mcp-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Shared scaffolding for the chrischall MCP fleet — server bootstrap, tool-result formatting, helpful errors, hardened env/config, a bearer API-client kit, zod atoms, session registries, a fetchproxy transport adapter, auth resolver skeletons, an in-memory test harness, and opt-in HTML helpers. The generic MCP glue hoisted out of ~19 sibling servers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsc -b",
|
|
49
49
|
"typecheck": "tsc -b --noEmit false",
|
|
50
|
-
"test": "vitest run",
|
|
50
|
+
"test": "npm run typecheck && vitest run",
|
|
51
51
|
"test:watch": "vitest"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|