@n24q02m/hull 0.4.0-beta.9 → 0.5.0-beta.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 +47 -16
- package/build/cli/build-cli.d.ts +5 -6
- package/build/cli/build-cli.d.ts.map +1 -1
- package/build/cli/build-cli.js +4 -61
- package/build/cli/build-cli.js.map +1 -1
- package/build/crypto/index.d.ts +1 -1
- package/build/crypto/index.d.ts.map +1 -1
- package/build/crypto/index.js +1 -1
- package/build/crypto/index.js.map +1 -1
- package/build/crypto/kdf.d.ts +0 -13
- package/build/crypto/kdf.d.ts.map +1 -1
- package/build/crypto/kdf.js +3 -18
- package/build/crypto/kdf.js.map +1 -1
- package/build/index.d.ts +1 -11
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -16
- package/build/index.js.map +1 -1
- package/build/storage/account-registry.d.ts +53 -0
- package/build/storage/account-registry.d.ts.map +1 -0
- package/build/storage/account-registry.js +148 -0
- package/build/storage/account-registry.js.map +1 -0
- package/build/storage/backends.d.ts +0 -26
- package/build/storage/backends.d.ts.map +1 -1
- package/build/storage/backends.js +0 -65
- package/build/storage/backends.js.map +1 -1
- package/build/storage/config-file.d.ts +2 -19
- package/build/storage/config-file.d.ts.map +1 -1
- package/build/storage/config-file.js +2 -23
- package/build/storage/config-file.js.map +1 -1
- package/build/storage/credential-store.d.ts +1 -9
- package/build/storage/credential-store.d.ts.map +1 -1
- package/build/storage/credential-store.js +4 -16
- package/build/storage/credential-store.js.map +1 -1
- package/build/storage/data-dir.d.ts +2 -2
- package/build/storage/data-dir.js +2 -2
- package/build/storage/encryption.d.ts.map +1 -1
- package/build/storage/encryption.js +4 -0
- package/build/storage/encryption.js.map +1 -1
- package/build/storage/index.d.ts +5 -3
- package/build/storage/index.d.ts.map +1 -1
- package/build/storage/index.js +5 -3
- package/build/storage/index.js.map +1 -1
- package/build/storage/key-pool-crypto.d.ts +44 -0
- package/build/storage/key-pool-crypto.d.ts.map +1 -0
- package/build/storage/key-pool-crypto.js +132 -0
- package/build/storage/key-pool-crypto.js.map +1 -0
- package/build/storage/key-pool-store.d.ts +134 -0
- package/build/storage/key-pool-store.d.ts.map +1 -0
- package/build/storage/key-pool-store.js +470 -0
- package/build/storage/key-pool-store.js.map +1 -0
- package/build/storage/key-pool.d.ts +172 -0
- package/build/storage/key-pool.d.ts.map +1 -0
- package/build/storage/key-pool.js +374 -0
- package/build/storage/key-pool.js.map +1 -0
- package/build/storage/resolver.js +1 -1
- package/build/storage/resolver.js.map +1 -1
- package/build/token-auth/index.d.ts +1 -1
- package/build/token-auth/index.js +1 -1
- package/build/transport/index.d.ts +1 -2
- package/build/transport/index.d.ts.map +1 -1
- package/build/transport/index.js +1 -2
- package/build/transport/index.js.map +1 -1
- package/build/transport/local-server.d.ts +12 -128
- package/build/transport/local-server.d.ts.map +1 -1
- package/build/transport/local-server.js +20 -262
- package/build/transport/local-server.js.map +1 -1
- package/build/transport/streamable-http.d.ts +6 -7
- package/build/transport/streamable-http.d.ts.map +1 -1
- package/build/transport/streamable-http.js +6 -6
- package/build/transport/streamable-http.js.map +1 -1
- package/build/util/browser.d.ts.map +1 -0
- package/build/{relay → util}/browser.js +2 -2
- package/build/util/browser.js.map +1 -0
- package/package.json +4 -21
- package/build/auth/credential-form.d.ts +0 -163
- package/build/auth/credential-form.d.ts.map +0 -1
- package/build/auth/credential-form.js +0 -1869
- package/build/auth/credential-form.js.map +0 -1
- package/build/auth/delegated-oauth-app.d.ts +0 -90
- package/build/auth/delegated-oauth-app.d.ts.map +0 -1
- package/build/auth/delegated-oauth-app.js +0 -881
- package/build/auth/delegated-oauth-app.js.map +0 -1
- package/build/auth/index.d.ts +0 -12
- package/build/auth/index.d.ts.map +0 -1
- package/build/auth/index.js +0 -12
- package/build/auth/index.js.map +0 -1
- package/build/auth/local-oauth-app.d.ts +0 -152
- package/build/auth/local-oauth-app.d.ts.map +0 -1
- package/build/auth/local-oauth-app.js +0 -975
- package/build/auth/local-oauth-app.js.map +0 -1
- package/build/auth/relay-login.d.ts +0 -46
- package/build/auth/relay-login.d.ts.map +0 -1
- package/build/auth/relay-login.js +0 -197
- package/build/auth/relay-login.js.map +0 -1
- package/build/auth/router.d.ts +0 -18
- package/build/auth/router.d.ts.map +0 -1
- package/build/auth/router.js +0 -62
- package/build/auth/router.js.map +0 -1
- package/build/auth/session-store.d.ts +0 -49
- package/build/auth/session-store.d.ts.map +0 -1
- package/build/auth/session-store.js +0 -94
- package/build/auth/session-store.js.map +0 -1
- package/build/auth/stable-sub.d.ts +0 -27
- package/build/auth/stable-sub.d.ts.map +0 -1
- package/build/auth/stable-sub.js +0 -38
- package/build/auth/stable-sub.js.map +0 -1
- package/build/auth/well-known.d.ts +0 -4
- package/build/auth/well-known.d.ts.map +0 -1
- package/build/auth/well-known.js +0 -26
- package/build/auth/well-known.js.map +0 -1
- package/build/oauth/cache.d.ts +0 -22
- package/build/oauth/cache.d.ts.map +0 -1
- package/build/oauth/cache.js +0 -24
- package/build/oauth/cache.js.map +0 -1
- package/build/oauth/index.d.ts +0 -6
- package/build/oauth/index.d.ts.map +0 -1
- package/build/oauth/index.js +0 -6
- package/build/oauth/index.js.map +0 -1
- package/build/oauth/jwt-issuer.d.ts +0 -87
- package/build/oauth/jwt-issuer.d.ts.map +0 -1
- package/build/oauth/jwt-issuer.js +0 -205
- package/build/oauth/jwt-issuer.js.map +0 -1
- package/build/oauth/pkce.d.ts +0 -10
- package/build/oauth/pkce.d.ts.map +0 -1
- package/build/oauth/pkce.js +0 -34
- package/build/oauth/pkce.js.map +0 -1
- package/build/oauth/provider.d.ts +0 -52
- package/build/oauth/provider.d.ts.map +0 -1
- package/build/oauth/provider.js +0 -98
- package/build/oauth/provider.js.map +0 -1
- package/build/oauth/user-store.d.ts +0 -25
- package/build/oauth/user-store.d.ts.map +0 -1
- package/build/oauth/user-store.js +0 -85
- package/build/oauth/user-store.js.map +0 -1
- package/build/relay/browser.d.ts.map +0 -1
- package/build/relay/browser.js.map +0 -1
- package/build/relay/client.d.ts +0 -36
- package/build/relay/client.d.ts.map +0 -1
- package/build/relay/client.js +0 -135
- package/build/relay/client.js.map +0 -1
- package/build/relay/session.d.ts +0 -12
- package/build/relay/session.d.ts.map +0 -1
- package/build/relay/session.js +0 -55
- package/build/relay/session.js.map +0 -1
- package/build/relay/tool-helpers.d.ts +0 -85
- package/build/relay/tool-helpers.d.ts.map +0 -1
- package/build/relay/tool-helpers.js +0 -103
- package/build/relay/tool-helpers.js.map +0 -1
- package/build/relay/wordlist.d.ts +0 -2
- package/build/relay/wordlist.d.ts.map +0 -1
- package/build/relay/wordlist.js +0 -7782
- package/build/relay/wordlist.js.map +0 -1
- package/build/schema/types.d.ts +0 -67
- package/build/schema/types.d.ts.map +0 -1
- package/build/schema/types.js +0 -2
- package/build/schema/types.js.map +0 -1
- package/build/storage/mode.d.ts +0 -23
- package/build/storage/mode.d.ts.map +0 -1
- package/build/storage/mode.js +0 -46
- package/build/storage/mode.js.map +0 -1
- package/build/storage/session-lock.d.ts +0 -19
- package/build/storage/session-lock.d.ts.map +0 -1
- package/build/storage/session-lock.js +0 -105
- package/build/storage/session-lock.js.map +0 -1
- package/build/transport/oauth-middleware.d.ts +0 -45
- package/build/transport/oauth-middleware.d.ts.map +0 -1
- package/build/transport/oauth-middleware.js +0 -86
- package/build/transport/oauth-middleware.js.map +0 -1
- /package/build/{relay → util}/browser.d.ts +0 -0
|
@@ -1,37 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Local MCP server entry point combining
|
|
2
|
+
* Local MCP server entry point combining token-table auth + Streamable HTTP transport.
|
|
3
3
|
*
|
|
4
4
|
* Composes:
|
|
5
|
-
* 1.
|
|
6
|
-
*
|
|
7
|
-
* 2. MCP Streamable HTTP transport -- serves /mcp with optional Bearer auth
|
|
5
|
+
* 1. Token-table auth (no-auth / token / multi) via Authenticator + guardRequest
|
|
6
|
+
* 2. MCP Streamable HTTP transport -- serves /mcp with per-session management
|
|
8
7
|
* 3. /health endpoint -- liveness probe
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
* omitted: only /mcp (unauthenticated) and /health are served.
|
|
12
|
-
*
|
|
13
|
-
* This is a TypeScript port of ``core-py``'s ``local_server.py``. Route layout,
|
|
14
|
-
* Bearer enforcement, and lifecycle semantics are kept identical.
|
|
9
|
+
* This is the TypeScript counterpart of core-py's `hull_core.server.http`.
|
|
15
10
|
*/
|
|
16
11
|
import { type IncomingMessage, type ServerResponse } from 'node:http';
|
|
17
12
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
18
|
-
import type { JWTPayload } from 'jose';
|
|
19
|
-
import type { RelayConfigSchema } from '../auth/credential-form.js';
|
|
20
|
-
import { type DelegatedOAuthAppOptions } from '../auth/delegated-oauth-app.js';
|
|
21
|
-
import { type CredentialsCallback, type StepCallback } from '../auth/local-oauth-app.js';
|
|
22
|
-
import type { JWTIssuer } from '../oauth/jwt-issuer.js';
|
|
23
13
|
import { type HttpAuthConfig } from '../token-auth/authenticator.js';
|
|
24
|
-
|
|
25
|
-
export type JWTClaims = JWTPayload & {
|
|
26
|
-
anonymous?: boolean;
|
|
27
|
-
};
|
|
14
|
+
export declare function jsonResponse(res: ServerResponse, status: number, body: unknown): void;
|
|
28
15
|
/**
|
|
29
16
|
* A route a consumer registers on the same port ``runHttpServer`` serves.
|
|
30
17
|
*
|
|
31
18
|
* The built-in ``/mcp`` and ``/health`` routes are matched FIRST and cannot be
|
|
32
19
|
* overridden -- a consumer cannot accidentally shadow the MCP transport or the
|
|
33
|
-
* liveness probe.
|
|
34
|
-
* OAuth app, which is a catch-all for the remaining paths.
|
|
20
|
+
* liveness probe.
|
|
35
21
|
*/
|
|
36
22
|
export interface HttpRoute {
|
|
37
23
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
@@ -39,113 +25,20 @@ export interface HttpRoute {
|
|
|
39
25
|
handler: (req: IncomingMessage, res: ServerResponse) => Promise<void> | void;
|
|
40
26
|
}
|
|
41
27
|
export interface RunHttpServerOptions {
|
|
42
|
-
/** Identifier used for
|
|
28
|
+
/** Identifier used for credential storage and lifecycle locks. */
|
|
43
29
|
serverName: string;
|
|
44
|
-
/** If undefined, server has NO auth (e.g., godot). */
|
|
45
|
-
relaySchema?: RelayConfigSchema;
|
|
46
|
-
/** Optional pre-created issuer, primarily for isolated tests and custom key storage. */
|
|
47
|
-
jwtIssuer?: JWTIssuer;
|
|
48
|
-
/**
|
|
49
|
-
* Mutually exclusive with `relaySchema`. When set, the OAuth app is the
|
|
50
|
-
* delegated provider (upstream redirect or device_code) instead of the local
|
|
51
|
-
* credential form. The `serverName` and `jwtIssuer` are supplied by this
|
|
52
|
-
* function; callers provide only `flow`, `upstream`, and `onTokenReceived`.
|
|
53
|
-
*/
|
|
54
|
-
delegatedOAuth?: Omit<DelegatedOAuthAppOptions, 'serverName' | 'jwtIssuer'>;
|
|
55
30
|
/** 0 = auto-find a free port. Default: 0. */
|
|
56
31
|
port?: number;
|
|
57
32
|
/** Host to bind. Default '127.0.0.1'. */
|
|
58
33
|
host?: string;
|
|
59
|
-
/**
|
|
60
|
-
onCredentialsSaved?: CredentialsCallback;
|
|
61
|
-
/** Optional callback invoked with step data after POST /otp. */
|
|
62
|
-
onStepSubmitted?: StepCallback;
|
|
63
|
-
/**
|
|
64
|
-
* Called after server ready so callers can wire background tasks (e.g.
|
|
65
|
-
* GDrive device code poll) to the form's ``/setup-status`` endpoint.
|
|
66
|
-
*
|
|
67
|
-
* Accepts either arity for backward compatibility:
|
|
68
|
-
* - Legacy 1-arg: ``hook(markComplete)`` -- success-only (older consumers).
|
|
69
|
-
* - New 2-arg: ``hook(markComplete, markFailed)`` -- surfaces upstream
|
|
70
|
-
* errors (``invalid_grant`` / ``expired_token`` / ``access_denied``)
|
|
71
|
-
* to the browser form so it stops polling and shows the error.
|
|
72
|
-
*
|
|
73
|
-
* Prefer the 2-arg form for new code. Arity is detected via
|
|
74
|
-
* ``Function.prototype.length``.
|
|
75
|
-
*/
|
|
76
|
-
setupCompleteHook?: ((markComplete: (key?: string) => void) => void) | ((markComplete: (key?: string) => void, markFailed: (key?: string, error?: string) => void) => void);
|
|
77
|
-
/**
|
|
78
|
-
* Optional renderer used in place of the default credential form on GET
|
|
79
|
-
* /authorize. Passed through to ``createLocalOAuthApp``.
|
|
80
|
-
*/
|
|
81
|
-
customCredentialFormHtml?: (schema: RelayConfigSchema, options: {
|
|
82
|
-
submitUrl: string;
|
|
83
|
-
prefill?: Record<string, string>;
|
|
84
|
-
}) => string;
|
|
85
|
-
/** Forwarded to the local OAuth app; see LocalOAuthAppOptions.stableSubEnabled. */
|
|
86
|
-
stableSubEnabled?: boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Optional middleware invoked after JWT verification and before the MCP
|
|
89
|
-
* transport handles the request. Called with verified claims and a ``next``
|
|
90
|
-
* function that invokes the MCP transport. Consumers use this to wrap the
|
|
91
|
-
* request in AsyncLocalStorage (e.g., for per-user token lookup).
|
|
92
|
-
*/
|
|
93
|
-
authScope?: (claims: JWTClaims, next: () => Promise<void>) => Promise<void>;
|
|
94
|
-
/**
|
|
95
|
-
* When `true`, skip Bearer token validation on the MCP endpoint and treat
|
|
96
|
-
* the caller as anonymous. Intended for deployments behind an external
|
|
97
|
-
* auth boundary (reverse proxy, API gateway like agentgateway/Zitadel) that
|
|
98
|
-
* already enforces authentication. The deployer is responsible for ensuring
|
|
99
|
-
* the network in front of this server is locked down — anyone who can
|
|
100
|
-
* reach `/mcp` directly will get tool access.
|
|
101
|
-
*
|
|
102
|
-
* Wire via env var: `authDisabled: process.env.MCP_AUTH_DISABLE === '1'`.
|
|
103
|
-
*
|
|
104
|
-
* When set, `authScope` (if provided) receives anonymous claims
|
|
105
|
-
* `{ sub: 'anonymous', anonymous: true }`.
|
|
106
|
-
*/
|
|
107
|
-
authDisabled?: boolean;
|
|
108
|
-
/**
|
|
109
|
-
* Whether to auto-open the setup URL in the user's browser when the stored
|
|
110
|
-
* config is not yet complete. Default ``true`` -- first-run setup for the
|
|
111
|
-
* servers built on this function depends on it.
|
|
112
|
-
*
|
|
113
|
-
* Set ``false`` when the consumer already hands the setup URL to the user by
|
|
114
|
-
* another route (a tool-call result, a log line, its own UI). Otherwise there
|
|
115
|
-
* are two entry points into the SAME temporary server, so the user starts two
|
|
116
|
-
* consent flows: whichever finishes first resolves the flow and closes the
|
|
117
|
-
* server, and the other tab's redirect then lands on a dead port
|
|
118
|
-
* (ERR_CONNECTION_REFUSED). The user is left with one "Setup complete" page
|
|
119
|
-
* and one connection error, unable to tell which one counted.
|
|
120
|
-
*/
|
|
121
|
-
openBrowser?: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Extra HTTP routes served on the same port, matched by exact pathname and
|
|
124
|
-
* method. Tried after ``/mcp`` and ``/health`` (which always win) and before
|
|
125
|
-
* the OAuth app, whose handler is a catch-all for every other path -- so a
|
|
126
|
-
* route registered here is the only way for a consumer to own an endpoint
|
|
127
|
-
* inside this process. Used by servers that need their own OAuth callback,
|
|
128
|
-
* e.g. adding a second upstream account to an already-authenticated subject.
|
|
129
|
-
*/
|
|
34
|
+
/** Extra HTTP routes served on the same port. */
|
|
130
35
|
extraRoutes?: HttpRoute[];
|
|
131
36
|
/**
|
|
132
37
|
* Token-table HTTP auth, the core-py `[server] auth` modes:
|
|
133
38
|
*
|
|
134
|
-
* - `{ mode: 'no-auth' }` -- no Authorization header;
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* - `{ mode: 'token', tokenHash, rpm? }` -- one shared bearer token checked
|
|
138
|
-
* against a `scrypt$...` hash; caller `uid` is `"shared"`.
|
|
139
|
-
* - `{ mode: 'multi', usersFile?, users? }` -- users.toml table (default
|
|
140
|
-
* `~/.hull/users.toml`); 401 wrong token, 403 disabled user, 429 over the
|
|
141
|
-
* user's `limits.rpm`.
|
|
142
|
-
*
|
|
143
|
-
* The guard runs before routing for every path except `/health` (so `/mcp`
|
|
144
|
-
* and `extraRoutes` both see the caller via `currentUser()`), and rejects
|
|
145
|
-
* with core-py's JSON body and `WWW-Authenticate: Bearer` on 401. The config
|
|
146
|
-
* is validated before the port is bound. Mutually exclusive with the
|
|
147
|
-
* OAuth/relay options (`relaySchema`, `delegatedOAuth`, `jwtIssuer`,
|
|
148
|
-
* `authDisabled`, `authScope`).
|
|
39
|
+
* - `{ mode: 'no-auth' }` (default) -- no Authorization header; loopback only.
|
|
40
|
+
* - `{ mode: 'token', tokenHash, rpm? }` -- one shared bearer token.
|
|
41
|
+
* - `{ mode: 'multi', usersFile?, users? }` -- users.toml table.
|
|
149
42
|
*/
|
|
150
43
|
auth?: HttpAuthConfig;
|
|
151
44
|
}
|
|
@@ -158,16 +51,7 @@ export interface HttpServerHandle {
|
|
|
158
51
|
close: () => Promise<void>;
|
|
159
52
|
}
|
|
160
53
|
/**
|
|
161
|
-
* Start an HTTP
|
|
162
|
-
*
|
|
163
|
-
* Behavior:
|
|
164
|
-
* - If ``relaySchema`` is provided, serves OAuth routes (/authorize, /token,
|
|
165
|
-
* /otp, /setup-status, /.well-known/*) AND /mcp with Bearer auth.
|
|
166
|
-
* - If ``relaySchema`` is undefined (e.g., godot), serves ONLY /mcp without
|
|
167
|
-
* auth (plus /health).
|
|
168
|
-
* - Binds to ``host:port``. Port 0 auto-assigns via the OS.
|
|
169
|
-
* - Returns a handle for lifecycle management; the server runs in the
|
|
170
|
-
* background until ``close()`` is called.
|
|
54
|
+
* Start an HTTP MCP server on ``host:port``.
|
|
171
55
|
*/
|
|
172
56
|
export declare function runHttpServer(serverFactory: () => McpServer, options: RunHttpServerOptions): Promise<HttpServerHandle>;
|
|
173
57
|
//# sourceMappingURL=local-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-server.d.ts","sourceRoot":"","sources":["../../src/transport/local-server.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"local-server.d.ts","sourceRoot":"","sources":["../../src/transport/local-server.ts"],"names":[],"mappings":"AA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|
|
2
|
-
* Local MCP server entry point combining
|
|
2
|
+
* Local MCP server entry point combining token-table auth + Streamable HTTP transport.
|
|
3
3
|
*
|
|
4
4
|
* Composes:
|
|
5
|
-
* 1.
|
|
6
|
-
*
|
|
7
|
-
* 2. MCP Streamable HTTP transport -- serves /mcp with optional Bearer auth
|
|
5
|
+
* 1. Token-table auth (no-auth / token / multi) via Authenticator + guardRequest
|
|
6
|
+
* 2. MCP Streamable HTTP transport -- serves /mcp with per-session management
|
|
8
7
|
* 3. /health endpoint -- liveness probe
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
* omitted: only /mcp (unauthenticated) and /health are served.
|
|
12
|
-
*
|
|
13
|
-
* This is a TypeScript port of ``core-py``'s ``local_server.py``. Route layout,
|
|
14
|
-
* Bearer enforcement, and lifecycle semantics are kept identical.
|
|
9
|
+
* This is the TypeScript counterpart of core-py's `hull_core.server.http`.
|
|
15
10
|
*/
|
|
16
11
|
import { randomUUID } from 'node:crypto';
|
|
17
12
|
import * as fs from 'node:fs';
|
|
@@ -20,105 +15,29 @@ import * as os from 'node:os';
|
|
|
20
15
|
import * as path from 'node:path';
|
|
21
16
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
22
17
|
import { isInitializeRequest } from '@modelcontextprotocol/sdk/types.js';
|
|
23
|
-
import { isSchemaComplete } from '../auth/credential-form.js';
|
|
24
|
-
import { createDelegatedOAuthApp } from '../auth/delegated-oauth-app.js';
|
|
25
|
-
import { createLocalOAuthApp } from '../auth/local-oauth-app.js';
|
|
26
|
-
import { jsonResponse } from '../auth/router.js';
|
|
27
18
|
import { refreshLockTimestamp, sweepStaleLocks, writeLockFile } from '../lifecycle/lock.js';
|
|
28
|
-
import { tryOpenBrowser } from '../relay/browser.js';
|
|
29
|
-
import { readStoredConfig } from '../storage/credential-store.js';
|
|
30
19
|
import { Authenticator } from '../token-auth/authenticator.js';
|
|
31
20
|
import { guardRequest } from '../token-auth/http-guard.js';
|
|
32
21
|
import { assertNoAuthLoopback } from '../token-auth/loopback.js';
|
|
33
|
-
|
|
22
|
+
export function jsonResponse(res, status, body) {
|
|
23
|
+
const payload = JSON.stringify(body);
|
|
24
|
+
res.writeHead(status, {
|
|
25
|
+
'Content-Type': 'application/json',
|
|
26
|
+
'Content-Length': Buffer.byteLength(payload)
|
|
27
|
+
});
|
|
28
|
+
res.end(payload);
|
|
29
|
+
}
|
|
34
30
|
/**
|
|
35
|
-
* Start an HTTP
|
|
36
|
-
*
|
|
37
|
-
* Behavior:
|
|
38
|
-
* - If ``relaySchema`` is provided, serves OAuth routes (/authorize, /token,
|
|
39
|
-
* /otp, /setup-status, /.well-known/*) AND /mcp with Bearer auth.
|
|
40
|
-
* - If ``relaySchema`` is undefined (e.g., godot), serves ONLY /mcp without
|
|
41
|
-
* auth (plus /health).
|
|
42
|
-
* - Binds to ``host:port``. Port 0 auto-assigns via the OS.
|
|
43
|
-
* - Returns a handle for lifecycle management; the server runs in the
|
|
44
|
-
* background until ``close()`` is called.
|
|
31
|
+
* Start an HTTP MCP server on ``host:port``.
|
|
45
32
|
*/
|
|
46
33
|
export async function runHttpServer(serverFactory, options) {
|
|
47
34
|
const host = options.host ?? '127.0.0.1';
|
|
48
35
|
const wantedPort = options.port ?? 0;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const conflicting = ['relaySchema', 'delegatedOAuth', 'jwtIssuer', 'authDisabled', 'authScope'].filter((key) => options[key] !== undefined && options[key] !== false);
|
|
54
|
-
if (conflicting.length > 0) {
|
|
55
|
-
throw new Error(`\`auth\` is mutually exclusive with ${conflicting.map((key) => `\`${key}\``).join(', ')}`);
|
|
56
|
-
}
|
|
57
|
-
tokenAuth = new Authenticator(options.auth);
|
|
58
|
-
if (tokenAuth.mode === 'no-auth')
|
|
59
|
-
assertNoAuthLoopback(host);
|
|
60
|
-
}
|
|
61
|
-
// Edge auth deployment warning (per spec 2026-05-01-stdio-pure-http-multiuser
|
|
62
|
-
// §4.2.1). When ``PUBLIC_URL`` points to a non-localhost host but
|
|
63
|
-
// ``MCP_RELAY_PASSWORD`` is empty, the relay form is reachable from the
|
|
64
|
-
// public Internet without authentication — that's the wedge this gate
|
|
65
|
-
// closes. Operators running single-user dev on localhost intentionally
|
|
66
|
-
// skip the password; everyone else gets a startup warning so the misconfig
|
|
67
|
-
// doesn't pass silently.
|
|
68
|
-
const publicUrl = process.env.PUBLIC_URL ?? '';
|
|
69
|
-
const relayPassword = process.env.MCP_RELAY_PASSWORD ?? '';
|
|
70
|
-
const isLocalhost = /^https?:\/\/(localhost|127\.0\.0\.1)/.test(publicUrl);
|
|
71
|
-
if (tokenAuth === null && publicUrl && !isLocalhost && !relayPassword) {
|
|
72
|
-
console.warn('[hull] WARNING: HTTP mode public deployment without MCP_RELAY_PASSWORD — relay form is open to Internet');
|
|
36
|
+
const authConfig = options.auth ?? { mode: 'no-auth' };
|
|
37
|
+
const tokenAuth = new Authenticator(authConfig);
|
|
38
|
+
if (tokenAuth.mode === 'no-auth') {
|
|
39
|
+
assertNoAuthLoopback(host);
|
|
73
40
|
}
|
|
74
|
-
let oauthApp = null;
|
|
75
|
-
let jwtIssuer = null;
|
|
76
|
-
if (options.relaySchema && options.delegatedOAuth) {
|
|
77
|
-
throw new Error('`relaySchema` and `delegatedOAuth` are mutually exclusive');
|
|
78
|
-
}
|
|
79
|
-
if (options.delegatedOAuth) {
|
|
80
|
-
oauthApp = await createDelegatedOAuthApp({
|
|
81
|
-
serverName: options.serverName,
|
|
82
|
-
flow: options.delegatedOAuth.flow,
|
|
83
|
-
upstream: options.delegatedOAuth.upstream,
|
|
84
|
-
onTokenReceived: options.delegatedOAuth.onTokenReceived,
|
|
85
|
-
sessionKv: options.delegatedOAuth.sessionKv,
|
|
86
|
-
jwtIssuer: options.jwtIssuer
|
|
87
|
-
});
|
|
88
|
-
jwtIssuer = oauthApp.jwtIssuer;
|
|
89
|
-
}
|
|
90
|
-
else if (options.relaySchema) {
|
|
91
|
-
oauthApp = await createLocalOAuthApp({
|
|
92
|
-
serverName: options.serverName,
|
|
93
|
-
relaySchema: options.relaySchema,
|
|
94
|
-
onCredentialsSaved: options.onCredentialsSaved,
|
|
95
|
-
onStepSubmitted: options.onStepSubmitted,
|
|
96
|
-
customCredentialFormHtml: options.customCredentialFormHtml,
|
|
97
|
-
stableSubEnabled: options.stableSubEnabled,
|
|
98
|
-
jwtIssuer: options.jwtIssuer
|
|
99
|
-
});
|
|
100
|
-
jwtIssuer = oauthApp.jwtIssuer;
|
|
101
|
-
}
|
|
102
|
-
// MCP per-session pattern (mirrors Python's StreamableHTTPSessionManager):
|
|
103
|
-
//
|
|
104
|
-
// - Each MCP client gets its own ``StreamableHTTPServerTransport`` keyed by
|
|
105
|
-
// Mcp-Session-Id, plus its own ``McpServer`` instance.
|
|
106
|
-
// - The first POST (initialize) has no session header; we mint a UUID via
|
|
107
|
-
// ``sessionIdGenerator`` and register the transport in ``onsessioninitialized``.
|
|
108
|
-
// - Subsequent POSTs (notifications/initialized, tools/list, tools/call)
|
|
109
|
-
// carry Mcp-Session-Id and are routed to the same transport, so the SDK's
|
|
110
|
-
// ``_initialized`` flag is in the right state for ``validateSession`` /
|
|
111
|
-
// ``validateProtocolVersion`` to accept the request.
|
|
112
|
-
// - Anything else -- an ID we never issued, or no ID on a request that
|
|
113
|
-
// cannot open a session -- is refused without building anything. Only
|
|
114
|
-
// ``initialize`` may open a session, which is what keeps the count of
|
|
115
|
-
// live ``McpServer`` instances tied to sessions rather than to requests.
|
|
116
|
-
//
|
|
117
|
-
// Stateless mode (sessionIdGenerator: undefined) was an earlier attempt; it
|
|
118
|
-
// returned HTTP 500 on the SDK-mandatory ``notifications/initialized`` POST
|
|
119
|
-
// because each request landed on a fresh transport with ``_initialized=false``
|
|
120
|
-
// and the SDK had no session manager to bridge them. Per-session routing is
|
|
121
|
-
// the same architecture the SDK examples + Python core-py use.
|
|
122
41
|
const transports = new Map();
|
|
123
42
|
const servers = new Map();
|
|
124
43
|
/** JSON-RPC error envelope, shaped like core-py's session manager replies. */
|
|
@@ -129,19 +48,6 @@ export async function runHttpServer(serverFactory, options) {
|
|
|
129
48
|
error: { code, message }
|
|
130
49
|
});
|
|
131
50
|
}
|
|
132
|
-
/**
|
|
133
|
-
* Buffer and parse the body of a request that carries no session ID.
|
|
134
|
-
*
|
|
135
|
-
* Only the bootstrap path pays this cost. Once a session exists the request
|
|
136
|
-
* stream is handed to the SDK untouched, as before -- we need the body here
|
|
137
|
-
* solely to tell an ``initialize`` apart from a request that has no business
|
|
138
|
-
* opening a session, and the SDK cannot re-read a stream we consumed, so the
|
|
139
|
-
* parsed value is passed on to ``handleRequest``.
|
|
140
|
-
*
|
|
141
|
-
* The size ceiling matches the SDK transport's own ``maximumMessageSize``
|
|
142
|
-
* default; without one, this buffer is an unbounded allocation reachable
|
|
143
|
-
* before any session exists.
|
|
144
|
-
*/
|
|
145
51
|
async function readBootstrapBody(req) {
|
|
146
52
|
const MAX_BYTES = 4 * 1024 * 1024;
|
|
147
53
|
const chunks = [];
|
|
@@ -167,18 +73,12 @@ export async function runHttpServer(serverFactory, options) {
|
|
|
167
73
|
if (incomingSessionId) {
|
|
168
74
|
const known = transports.get(incomingSessionId);
|
|
169
75
|
if (!known) {
|
|
170
|
-
// 404 is the spec's signal for "that session is gone" and the status
|
|
171
|
-
// core-py returns. A client that lost its session to a restart reads
|
|
172
|
-
// it as "open a new one"; a 400 would read as "your request is
|
|
173
|
-
// malformed" and it would retry the dead ID.
|
|
174
76
|
jsonRpcError(res, 404, -32600, 'Session not found');
|
|
175
77
|
return;
|
|
176
78
|
}
|
|
177
79
|
await known.handleRequest(req, res);
|
|
178
80
|
return;
|
|
179
81
|
}
|
|
180
|
-
// No session ID. GET (opens the server-to-client SSE stream) and DELETE
|
|
181
|
-
// (closes a session) both presuppose one, so only a POST can get further.
|
|
182
82
|
if (req.method !== 'POST') {
|
|
183
83
|
jsonRpcError(res, 400, -32600, 'Bad Request: Mcp-Session-Id header is required');
|
|
184
84
|
return;
|
|
@@ -211,85 +111,11 @@ export async function runHttpServer(serverFactory, options) {
|
|
|
211
111
|
await server.connect(transport);
|
|
212
112
|
await transport.handleRequest(req, res, parsed.body);
|
|
213
113
|
}
|
|
214
|
-
// Derive the RFC 9728 protected-resource-metadata URL for the Bearer
|
|
215
|
-
// challenge. Mirrors ``local-oauth-app.ts``'s ``getBaseUrl`` PUBLIC_URL-first
|
|
216
|
-
// convention: the deployed servers (oci-vm-prod behind CF Tunnel -> Caddy)
|
|
217
|
-
// set ``PUBLIC_URL`` so the advertised metadata URL is the public HTTPS host
|
|
218
|
-
// rather than the internal HTTP socket address. When unset, fall back to the
|
|
219
|
-
// request Host + ``X-Forwarded-Proto`` (or the socket ``encrypted`` flag).
|
|
220
|
-
function resourceMetadataUrl(req) {
|
|
221
|
-
const envPublicUrl = process.env.PUBLIC_URL;
|
|
222
|
-
let base;
|
|
223
|
-
if (envPublicUrl !== undefined && envPublicUrl.length > 0) {
|
|
224
|
-
base = envPublicUrl.replace(/\/+$/, '');
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
const reqHost = req.headers.host ?? 'localhost';
|
|
228
|
-
const encrypted = req.socket.encrypted === true;
|
|
229
|
-
const forwardedProto = req.headers['x-forwarded-proto'];
|
|
230
|
-
let protocol = encrypted ? 'https' : 'http';
|
|
231
|
-
if (typeof forwardedProto === 'string' && forwardedProto.length > 0) {
|
|
232
|
-
const commaIdx = forwardedProto.indexOf(',');
|
|
233
|
-
protocol = (commaIdx !== -1 ? forwardedProto.substring(0, commaIdx) : forwardedProto).trim();
|
|
234
|
-
}
|
|
235
|
-
base = `${protocol}://${reqHost}`;
|
|
236
|
-
}
|
|
237
|
-
return `${base}/.well-known/oauth-protected-resource`;
|
|
238
|
-
}
|
|
239
|
-
async function mcpHandler(req, res) {
|
|
240
|
-
// Bearer auth bypass for deployments behind an external auth boundary.
|
|
241
|
-
// Caller (reverse proxy, API gateway) is trusted to enforce auth upstream.
|
|
242
|
-
if (jwtIssuer && options.authDisabled) {
|
|
243
|
-
const anonymousClaims = { sub: 'anonymous', anonymous: true };
|
|
244
|
-
if (options.authScope) {
|
|
245
|
-
await options.authScope(anonymousClaims, async () => {
|
|
246
|
-
await handleSessionRequest(req, res);
|
|
247
|
-
});
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
await handleSessionRequest(req, res);
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
// Bearer auth if configured.
|
|
254
|
-
if (jwtIssuer) {
|
|
255
|
-
const authHeader = req.headers.authorization;
|
|
256
|
-
const token = extractBearerToken(authHeader);
|
|
257
|
-
if (!token) {
|
|
258
|
-
res.writeHead(401, {
|
|
259
|
-
'WWW-Authenticate': `Bearer resource_metadata="${resourceMetadataUrl(req)}"`
|
|
260
|
-
});
|
|
261
|
-
res.end();
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
let claims;
|
|
265
|
-
try {
|
|
266
|
-
claims = await jwtIssuer.verifyAccessToken(token);
|
|
267
|
-
}
|
|
268
|
-
catch {
|
|
269
|
-
res.writeHead(401, {
|
|
270
|
-
'WWW-Authenticate': `Bearer resource_metadata="${resourceMetadataUrl(req)}", error="invalid_token"`
|
|
271
|
-
});
|
|
272
|
-
res.end();
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
if (options.authScope) {
|
|
276
|
-
await options.authScope(claims, async () => {
|
|
277
|
-
await handleSessionRequest(req, res);
|
|
278
|
-
});
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
// Delegate to per-session MCP transport.
|
|
283
|
-
await handleSessionRequest(req, res);
|
|
284
|
-
}
|
|
285
114
|
async function dispatch(req, res, pathname) {
|
|
286
|
-
// Route /mcp to MCP transport (with optional Bearer auth).
|
|
287
115
|
if (pathname === '/mcp') {
|
|
288
|
-
await
|
|
116
|
+
await handleSessionRequest(req, res);
|
|
289
117
|
return;
|
|
290
118
|
}
|
|
291
|
-
// Consumer-registered routes. After the built-ins (which win) and before
|
|
292
|
-
// the OAuth app, whose handler is a catch-all for the remaining paths.
|
|
293
119
|
if (options.extraRoutes) {
|
|
294
120
|
for (const route of options.extraRoutes) {
|
|
295
121
|
if (route.path === pathname && route.method === req.method) {
|
|
@@ -298,29 +124,16 @@ export async function runHttpServer(serverFactory, options) {
|
|
|
298
124
|
}
|
|
299
125
|
}
|
|
300
126
|
}
|
|
301
|
-
// Route everything else to OAuth app if present.
|
|
302
|
-
if (oauthApp) {
|
|
303
|
-
await oauthApp.handler(req, res);
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
// No OAuth app and no match -- 404.
|
|
307
127
|
jsonResponse(res, 404, { error: 'not_found' });
|
|
308
128
|
}
|
|
309
129
|
const handler = async (req, res) => {
|
|
310
130
|
const url = new URL(req.url ?? '/', `http://${req.headers.host ?? 'localhost'}`);
|
|
311
131
|
const pathname = url.pathname;
|
|
312
|
-
// Liveness probe. Always available, never behind token auth.
|
|
313
132
|
if (pathname === '/health') {
|
|
314
133
|
jsonResponse(res, 200, { status: 'ok', server: options.serverName });
|
|
315
134
|
return;
|
|
316
135
|
}
|
|
317
|
-
|
|
318
|
-
// AuthContext for the rest of the request (read via currentUser()).
|
|
319
|
-
if (tokenAuth !== null) {
|
|
320
|
-
await guardRequest(tokenAuth, req, res, () => dispatch(req, res, pathname));
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
await dispatch(req, res, pathname);
|
|
136
|
+
await guardRequest(tokenAuth, req, res, () => dispatch(req, res, pathname));
|
|
324
137
|
};
|
|
325
138
|
const httpServer = createServer((req, res) => {
|
|
326
139
|
handler(req, res).catch(() => {
|
|
@@ -339,79 +152,24 @@ export async function runHttpServer(serverFactory, options) {
|
|
|
339
152
|
});
|
|
340
153
|
const addr = httpServer.address();
|
|
341
154
|
const actualPort = addr.port;
|
|
342
|
-
// Sweep stale locks for our server name BEFORE writing our own. Without
|
|
343
|
-
// this, abnormal-exit residue (Windows OOM, taskkill, signal) can pile up
|
|
344
|
-
// dozens of `<server>-<port>.lock` files — see 2026-04-28 wet-mcp 11-stale-lock incident.
|
|
345
155
|
const swept = sweepStaleLocks(options.serverName);
|
|
346
156
|
if (swept > 0) {
|
|
347
157
|
console.error(`[runHttpServer] cleaned ${swept} stale lock(s) for ${options.serverName}`);
|
|
348
158
|
}
|
|
349
|
-
const proxyToken = jwtIssuer ? await jwtIssuer.issueAccessToken('proxy', 31536000) : '';
|
|
350
159
|
const lockDirPath = path.join(os.homedir(), '.config', 'mcp', 'locks');
|
|
351
160
|
fs.mkdirSync(lockDirPath, { recursive: true, mode: 0o700 });
|
|
352
161
|
if (process.platform !== 'win32') {
|
|
353
162
|
fs.chmodSync(lockDirPath, 0o700);
|
|
354
163
|
}
|
|
355
|
-
const lockFile = writeLockFile(options.serverName, actualPort,
|
|
356
|
-
// Refresh the lock timestamp hourly so the 24h TTL sweep does not kill
|
|
357
|
-
// long-running daemons. Cancelled in `close()`.
|
|
164
|
+
const lockFile = writeLockFile(options.serverName, actualPort, '', lockDirPath);
|
|
358
165
|
const lockRefreshInterval = setInterval(() => refreshLockTimestamp(lockFile), 3600 * 1000);
|
|
359
166
|
if (typeof lockRefreshInterval.unref === 'function') {
|
|
360
167
|
lockRefreshInterval.unref();
|
|
361
168
|
}
|
|
362
|
-
// Auto-open the credential form in the user's browser when no creds exist
|
|
363
|
-
// yet. We open the root URL ("/") which auto-bootstraps PKCE and redirects
|
|
364
|
-
// to /authorize with valid params; opening /authorize directly returns
|
|
365
|
-
// invalid_request because it requires client_id/redirect_uri/state/
|
|
366
|
-
// code_challenge. See `local-oauth-app.ts` root handler docstring.
|
|
367
|
-
// Best-effort: any failure surfaces via tryOpenBrowser's ASCII fallback banner.
|
|
368
|
-
// ``openBrowser: false`` opts out entirely -- see the option's docstring for
|
|
369
|
-
// why a consumer that already published the URL must not get a second tab.
|
|
370
|
-
if (oauthApp && options.openBrowser !== false) {
|
|
371
|
-
try {
|
|
372
|
-
const existingConfig = await readStoredConfig(options.serverName);
|
|
373
|
-
// Use schema completeness instead of "config === null" so peer-share
|
|
374
|
-
// paths writing partial entries (e.g. wet inheriting CRG cloud keys)
|
|
375
|
-
// do not suppress the relay form when required fields are missing.
|
|
376
|
-
const configComplete = options.relaySchema
|
|
377
|
-
? isSchemaComplete(existingConfig, options.relaySchema)
|
|
378
|
-
: existingConfig !== null;
|
|
379
|
-
if (!configComplete && process.env.NODE_ENV !== 'test') {
|
|
380
|
-
const setupUrl = `http://${host}:${actualPort}/`;
|
|
381
|
-
await tryOpenBrowser(setupUrl);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
catch {
|
|
385
|
-
/* best-effort: never crash startup on browser-open failure */
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
// Invoke setup hook. Supports legacy 1-arg (success-only) and new 2-arg
|
|
389
|
-
// (success + failure) signatures via Function.prototype.length so upstream
|
|
390
|
-
// errors (invalid_grant / expired_token / access_denied) propagate to the
|
|
391
|
-
// browser form instead of leaving the spinner waiting forever.
|
|
392
|
-
if (options.setupCompleteHook && oauthApp) {
|
|
393
|
-
const markSetupFailed = 'markSetupFailed' in oauthApp && typeof oauthApp.markSetupFailed === 'function'
|
|
394
|
-
? oauthApp.markSetupFailed
|
|
395
|
-
: undefined;
|
|
396
|
-
if (options.setupCompleteHook.length >= 2 && markSetupFailed !== undefined) {
|
|
397
|
-
;
|
|
398
|
-
options.setupCompleteHook(oauthApp.markSetupComplete, markSetupFailed);
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
;
|
|
402
|
-
options.setupCompleteHook(oauthApp.markSetupComplete);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
169
|
return {
|
|
406
170
|
port: actualPort,
|
|
407
171
|
host,
|
|
408
172
|
close: async () => {
|
|
409
|
-
if (oauthApp && 'shutdown' in oauthApp) {
|
|
410
|
-
await oauthApp.shutdown();
|
|
411
|
-
}
|
|
412
|
-
// Drain per-session transports + servers so their open SSE streams
|
|
413
|
-
// and tool-call timers don't keep the event loop alive after the
|
|
414
|
-
// HTTP server closes.
|
|
415
173
|
for (const transport of transports.values()) {
|
|
416
174
|
try {
|
|
417
175
|
await transport.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-server.js","sourceRoot":"","sources":["../../src/transport/local-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAA;AAEhG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAGjC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAGxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EACL,uBAAuB,EAGxB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAEL,mBAAmB,EAGpB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAE3F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,aAAa,EAAuB,MAAM,gCAAgC,CAAA;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AA8I1D;;;;;;;;;;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