agent-nuvira 3.4.0 → 3.5.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 +13 -13
- package/dist/agent-sdk/src/register.d.ts +23 -7
- package/dist/agent-sdk/src/register.d.ts.map +1 -1
- package/dist/agent-sdk/src/register.js +159 -5
- package/dist/agent-sdk/src/register.js.map +1 -1
- package/dist/agent-sdk/src/scaffold.d.ts +1 -1
- package/dist/agent-sdk/src/scaffold.js +1 -1
- package/dist/cli/agent.d.ts.map +1 -1
- package/dist/cli/agent.js +16 -3
- package/dist/cli/agent.js.map +1 -1
- package/dist/cli/chat.d.ts +202 -6
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +805 -34
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/config.d.ts +10 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +39 -0
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +18 -3
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/duties.d.ts +11 -0
- package/dist/cli/duties.d.ts.map +1 -1
- package/dist/cli/duties.js +31 -0
- package/dist/cli/duties.js.map +1 -1
- package/dist/cli/mcp.d.ts +50 -0
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +496 -49
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/memory.d.ts.map +1 -1
- package/dist/cli/memory.js +3 -2
- package/dist/cli/memory.js.map +1 -1
- package/dist/cli/models.d.ts.map +1 -1
- package/dist/cli/models.js +55 -0
- package/dist/cli/models.js.map +1 -1
- package/dist/cli/plugins.d.ts.map +1 -1
- package/dist/cli/plugins.js +26 -9
- package/dist/cli/plugins.js.map +1 -1
- package/dist/cli/sdk.d.ts.map +1 -1
- package/dist/cli/sdk.js +10 -3
- package/dist/cli/sdk.js.map +1 -1
- package/dist/cli/tool-install-prompt.d.ts.map +1 -1
- package/dist/cli/tool-install-prompt.js +23 -1
- package/dist/cli/tool-install-prompt.js.map +1 -1
- package/dist/cli/tools.d.ts +16 -0
- package/dist/cli/tools.d.ts.map +1 -1
- package/dist/cli/tools.js +101 -1
- package/dist/cli/tools.js.map +1 -1
- package/dist/config/manager.d.ts +6 -0
- package/dist/config/manager.d.ts.map +1 -1
- package/dist/config/manager.js +66 -0
- package/dist/config/manager.js.map +1 -1
- package/dist/config/types.d.ts +18 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/learning/auto-router.d.ts +28 -0
- package/dist/learning/auto-router.d.ts.map +1 -1
- package/dist/learning/auto-router.js +84 -5
- package/dist/learning/auto-router.js.map +1 -1
- package/dist/learning/duty-lease.d.ts +163 -0
- package/dist/learning/duty-lease.d.ts.map +1 -0
- package/dist/learning/duty-lease.js +301 -0
- package/dist/learning/duty-lease.js.map +1 -0
- package/dist/learning/exhaustion-report.d.ts +12 -0
- package/dist/learning/exhaustion-report.d.ts.map +1 -1
- package/dist/learning/exhaustion-report.js +3 -1
- package/dist/learning/exhaustion-report.js.map +1 -1
- package/dist/learning/model-capability.d.ts +33 -0
- package/dist/learning/model-capability.d.ts.map +1 -1
- package/dist/learning/model-capability.js +51 -0
- package/dist/learning/model-capability.js.map +1 -1
- package/dist/learning/model-first-router.d.ts +21 -22
- package/dist/learning/model-first-router.d.ts.map +1 -1
- package/dist/learning/model-first-router.js +61 -54
- package/dist/learning/model-first-router.js.map +1 -1
- package/dist/learning/model-selection.d.ts +27 -0
- package/dist/learning/model-selection.d.ts.map +1 -1
- package/dist/learning/model-selection.js +46 -0
- package/dist/learning/model-selection.js.map +1 -1
- package/dist/learning/model-warmup.d.ts +92 -0
- package/dist/learning/model-warmup.d.ts.map +1 -1
- package/dist/learning/model-warmup.js +137 -2
- package/dist/learning/model-warmup.js.map +1 -1
- package/dist/learning/reasoning-trace.d.ts +1 -1
- package/dist/learning/reasoning-trace.d.ts.map +1 -1
- package/dist/learning/reasoning-trace.js.map +1 -1
- package/dist/learning/resilient-call.d.ts +15 -1
- package/dist/learning/resilient-call.d.ts.map +1 -1
- package/dist/learning/resilient-call.js +38 -22
- package/dist/learning/resilient-call.js.map +1 -1
- package/dist/learning/retry-patience.d.ts +139 -0
- package/dist/learning/retry-patience.d.ts.map +1 -0
- package/dist/learning/retry-patience.js +169 -0
- package/dist/learning/retry-patience.js.map +1 -0
- package/dist/learning/working-state.d.ts +7 -0
- package/dist/learning/working-state.d.ts.map +1 -1
- package/dist/learning/working-state.js +23 -1
- package/dist/learning/working-state.js.map +1 -1
- package/dist/mcp/catalog.d.ts +206 -26
- package/dist/mcp/catalog.d.ts.map +1 -1
- package/dist/mcp/catalog.js +664 -52
- package/dist/mcp/catalog.js.map +1 -1
- package/dist/mcp/client.d.ts +6 -0
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js +35 -5
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/custom-server.d.ts +120 -0
- package/dist/mcp/custom-server.d.ts.map +1 -0
- package/dist/mcp/custom-server.js +330 -0
- package/dist/mcp/custom-server.js.map +1 -0
- package/dist/mcp/manager.d.ts +9 -1
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +15 -2
- package/dist/mcp/manager.js.map +1 -1
- package/dist/mcp/mcp-oauth.d.ts +28 -0
- package/dist/mcp/mcp-oauth.d.ts.map +1 -1
- package/dist/mcp/mcp-oauth.js +63 -8
- package/dist/mcp/mcp-oauth.js.map +1 -1
- package/dist/mcp/oauth-authorize.d.ts +51 -0
- package/dist/mcp/oauth-authorize.d.ts.map +1 -0
- package/dist/mcp/oauth-authorize.js +133 -0
- package/dist/mcp/oauth-authorize.js.map +1 -0
- package/dist/mcp/oauth-connect.d.ts +53 -0
- package/dist/mcp/oauth-connect.d.ts.map +1 -0
- package/dist/mcp/oauth-connect.js +103 -0
- package/dist/mcp/oauth-connect.js.map +1 -0
- package/dist/mcp/pin-verifier.d.ts +44 -0
- package/dist/mcp/pin-verifier.d.ts.map +1 -0
- package/dist/mcp/pin-verifier.js +102 -0
- package/dist/mcp/pin-verifier.js.map +1 -0
- package/dist/mcp/prereqs.d.ts +145 -0
- package/dist/mcp/prereqs.d.ts.map +1 -0
- package/dist/mcp/prereqs.js +245 -0
- package/dist/mcp/prereqs.js.map +1 -0
- package/dist/mcp/runtime.d.ts +59 -0
- package/dist/mcp/runtime.d.ts.map +1 -0
- package/dist/mcp/runtime.js +77 -0
- package/dist/mcp/runtime.js.map +1 -0
- package/dist/mcp/server.d.ts +21 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +29 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/settings.d.ts +164 -0
- package/dist/mcp/settings.d.ts.map +1 -0
- package/dist/mcp/settings.js +358 -0
- package/dist/mcp/settings.js.map +1 -0
- package/dist/mcp/types.d.ts +62 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js.map +1 -1
- package/dist/memory/vector-store.d.ts +12 -0
- package/dist/memory/vector-store.d.ts.map +1 -1
- package/dist/memory/vector-store.js +23 -0
- package/dist/memory/vector-store.js.map +1 -1
- package/dist/plugins/agent-plugin.d.ts +35 -0
- package/dist/plugins/agent-plugin.d.ts.map +1 -1
- package/dist/plugins/agent-plugin.js +142 -24
- package/dist/plugins/agent-plugin.js.map +1 -1
- package/dist/sandbox/manager.d.ts +12 -0
- package/dist/sandbox/manager.d.ts.map +1 -1
- package/dist/sandbox/manager.js +43 -2
- package/dist/sandbox/manager.js.map +1 -1
- package/dist/tools/modality/browser.d.ts +39 -3
- package/dist/tools/modality/browser.d.ts.map +1 -1
- package/dist/tools/modality/browser.js +113 -16
- package/dist/tools/modality/browser.js.map +1 -1
- package/dist/tools/optional-deps.d.ts +48 -0
- package/dist/tools/optional-deps.d.ts.map +1 -0
- package/dist/tools/optional-deps.js +42 -0
- package/dist/tools/optional-deps.js.map +1 -0
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +68 -11
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/remediation-ladder.d.ts.map +1 -1
- package/dist/tools/remediation-ladder.js +9 -1
- package/dist/tools/remediation-ladder.js.map +1 -1
- package/dist/tools/tool-loop.d.ts +41 -3
- package/dist/tools/tool-loop.d.ts.map +1 -1
- package/dist/tools/tool-loop.js +317 -9
- package/dist/tools/tool-loop.js.map +1 -1
- package/dist/web-dashboard/chat-retry.d.ts +11 -1
- package/dist/web-dashboard/chat-retry.d.ts.map +1 -1
- package/dist/web-dashboard/chat-retry.js +18 -4
- package/dist/web-dashboard/chat-retry.js.map +1 -1
- package/dist/web-dashboard/server.d.ts.map +1 -1
- package/dist/web-dashboard/server.js +349 -2
- package/dist/web-dashboard/server.js.map +1 -1
- package/package.json +6 -2
- package/src/web-dashboard/public/assets/{index-DeD3L0kG.js → index-Bik91KJh.js} +115 -89
- package/src/web-dashboard/public/assets/index-Bik91KJh.js.map +1 -0
- package/src/web-dashboard/public/index.html +1 -1
- package/src/web-dashboard/public/assets/index-DeD3L0kG.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-oauth.js","sourceRoot":"","sources":["../../src/mcp/mcp-oauth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"mcp-oauth.js","sourceRoot":"","sources":["../../src/mcp/mcp-oauth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAA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T EXISTS. `mcp-oauth.ts` can build an authorization URL and exchange a
|
|
5
|
+
* code, but nothing ever LISTENED for the redirect: the flow was reachable only
|
|
6
|
+
* through a tool that asked a human to paste a code back by hand, and the CLI had
|
|
7
|
+
* no way to authorize a remote server at all. So an OAuth server could be
|
|
8
|
+
* configured and never used. This module closes the loop — start a loopback
|
|
9
|
+
* server on the registered redirect URI, open the consent page, take the `code`
|
|
10
|
+
* the provider redirects with, exchange it, and store the tokens.
|
|
11
|
+
*
|
|
12
|
+
* THE REDIRECT URI IS THE CONTRACT. A provider only redirects to a URI registered
|
|
13
|
+
* on the OAuth client, so the DEFAULT (`http://localhost:3456/mcp/oauth/callback`)
|
|
14
|
+
* is stated in the printed instructions and overridable with `--redirect-uri`.
|
|
15
|
+
* Guessing a port would look like it worked and fail at the provider, which is
|
|
16
|
+
* why the URI is printed before the browser opens rather than after.
|
|
17
|
+
*
|
|
18
|
+
* The tokens land in the OAuth manager's store (never in a server config file),
|
|
19
|
+
* and the access token is refreshed silently afterwards by `oauth-connect.ts`.
|
|
20
|
+
*/
|
|
21
|
+
import { type OAuthConfig, type OAuthTokens } from './mcp-oauth.js';
|
|
22
|
+
/** The default loopback redirect — must match the OAuth client's registered URI. */
|
|
23
|
+
export declare const DEFAULT_REDIRECT_URI = "http://localhost:3456/mcp/oauth/callback";
|
|
24
|
+
export interface AuthorizeOptions {
|
|
25
|
+
/** Override the redirect URI (defaults to {@link DEFAULT_REDIRECT_URI}). */
|
|
26
|
+
redirectUri?: string;
|
|
27
|
+
/** How long to wait for the user to finish consent (default 5 minutes). */
|
|
28
|
+
timeoutMs?: number;
|
|
29
|
+
/** Try to open the consent page in a browser (default true). */
|
|
30
|
+
openBrowser?: boolean;
|
|
31
|
+
/** Progress/log sink. Defaults to writing to the terminal. */
|
|
32
|
+
log?: (line: string) => void;
|
|
33
|
+
/** Test seam: how the consent URL is visited. Defaults to a browser spawn. */
|
|
34
|
+
visit?: (url: string) => void;
|
|
35
|
+
}
|
|
36
|
+
export type AuthorizeResult = {
|
|
37
|
+
ok: true;
|
|
38
|
+
tokens: OAuthTokens;
|
|
39
|
+
redirectUri: string;
|
|
40
|
+
} | {
|
|
41
|
+
ok: false;
|
|
42
|
+
reason: string;
|
|
43
|
+
redirectUri: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Run the authorization-code flow for one server and store the resulting tokens.
|
|
47
|
+
* Resolves when the provider redirects back; rejects nothing — failures are
|
|
48
|
+
* returned as `{ ok: false, reason }` so the CLI can print them and exit non-zero.
|
|
49
|
+
*/
|
|
50
|
+
export declare function runAuthorizeFlow(serverName: string, oauth: OAuthConfig, options?: AuthorizeOptions): Promise<AuthorizeResult>;
|
|
51
|
+
//# sourceMappingURL=oauth-authorize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-authorize.d.ts","sourceRoot":"","sources":["../../src/mcp/oauth-authorize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,EAAsB,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAExF,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,6CAA6C,CAAC;AAE/E,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8DAA8D;IAC9D,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAED,MAAM,MAAM,eAAe,GACvB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAsBvD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,WAAW,EAClB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,eAAe,CAAC,CA6F1B"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `nuvira mcp authorize <server>` — the interactive half of OAuth for MCP.
|
|
3
|
+
*
|
|
4
|
+
* WHY IT EXISTS. `mcp-oauth.ts` can build an authorization URL and exchange a
|
|
5
|
+
* code, but nothing ever LISTENED for the redirect: the flow was reachable only
|
|
6
|
+
* through a tool that asked a human to paste a code back by hand, and the CLI had
|
|
7
|
+
* no way to authorize a remote server at all. So an OAuth server could be
|
|
8
|
+
* configured and never used. This module closes the loop — start a loopback
|
|
9
|
+
* server on the registered redirect URI, open the consent page, take the `code`
|
|
10
|
+
* the provider redirects with, exchange it, and store the tokens.
|
|
11
|
+
*
|
|
12
|
+
* THE REDIRECT URI IS THE CONTRACT. A provider only redirects to a URI registered
|
|
13
|
+
* on the OAuth client, so the DEFAULT (`http://localhost:3456/mcp/oauth/callback`)
|
|
14
|
+
* is stated in the printed instructions and overridable with `--redirect-uri`.
|
|
15
|
+
* Guessing a port would look like it worked and fail at the provider, which is
|
|
16
|
+
* why the URI is printed before the browser opens rather than after.
|
|
17
|
+
*
|
|
18
|
+
* The tokens land in the OAuth manager's store (never in a server config file),
|
|
19
|
+
* and the access token is refreshed silently afterwards by `oauth-connect.ts`.
|
|
20
|
+
*/
|
|
21
|
+
import { createServer } from 'node:http';
|
|
22
|
+
import { spawn } from 'node:child_process';
|
|
23
|
+
import { getMCPOAuthManager } from './mcp-oauth.js';
|
|
24
|
+
/** The default loopback redirect — must match the OAuth client's registered URI. */
|
|
25
|
+
export const DEFAULT_REDIRECT_URI = 'http://localhost:3456/mcp/oauth/callback';
|
|
26
|
+
/** Open a URL with the OS handler, best-effort (never throws, never blocks). */
|
|
27
|
+
function openInBrowser(url) {
|
|
28
|
+
const cmd = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'cmd' : 'xdg-open';
|
|
29
|
+
const args = process.platform === 'win32' ? ['/c', 'start', '', url] : [url];
|
|
30
|
+
try {
|
|
31
|
+
const child = spawn(cmd, args, { stdio: 'ignore', detached: true });
|
|
32
|
+
child.on('error', () => undefined);
|
|
33
|
+
child.unref();
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// A headless machine has no browser — the URL is already printed.
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** The tiny HTML the browser lands on, so a success does not look like a hang. */
|
|
40
|
+
function respondPage(message) {
|
|
41
|
+
return `<!DOCTYPE html><html><head><meta charset="utf-8"><title>Agent-Nuvira</title></head>
|
|
42
|
+
<body style="font-family: system-ui, sans-serif; margin: 3rem">
|
|
43
|
+
<h1>${message}</h1><p>You can close this tab and return to the terminal.</p></body></html>`;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Run the authorization-code flow for one server and store the resulting tokens.
|
|
47
|
+
* Resolves when the provider redirects back; rejects nothing — failures are
|
|
48
|
+
* returned as `{ ok: false, reason }` so the CLI can print them and exit non-zero.
|
|
49
|
+
*/
|
|
50
|
+
export async function runAuthorizeFlow(serverName, oauth, options = {}) {
|
|
51
|
+
const redirectUri = options.redirectUri ?? oauth.redirectUri ?? DEFAULT_REDIRECT_URI;
|
|
52
|
+
const log = options.log ?? ((line) => process.stdout.write(line + '\n'));
|
|
53
|
+
const timeoutMs = options.timeoutMs ?? 5 * 60 * 1000;
|
|
54
|
+
let url;
|
|
55
|
+
try {
|
|
56
|
+
url = new URL(redirectUri);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return { ok: false, redirectUri, reason: `'${redirectUri}' is not a valid redirect URI.` };
|
|
60
|
+
}
|
|
61
|
+
if (!oauth.authorizationEndpoint || !oauth.tokenEndpoint) {
|
|
62
|
+
return {
|
|
63
|
+
ok: false,
|
|
64
|
+
redirectUri,
|
|
65
|
+
reason: `'${serverName}' is missing an authorizationEndpoint or tokenEndpoint — check its oauth block.`,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (!oauth.clientId) {
|
|
69
|
+
return { ok: false, redirectUri, reason: `'${serverName}' has no oauth.clientId.` };
|
|
70
|
+
}
|
|
71
|
+
const listener = createServer();
|
|
72
|
+
const manager = getMCPOAuthManager();
|
|
73
|
+
// Persist the config FIRST: the state (PKCE verifier, state param, scopes) is
|
|
74
|
+
// written by startAuthorizationCodeFlow, and a refresh later needs the config.
|
|
75
|
+
manager.setConfig(serverName, { ...oauth, redirectUri });
|
|
76
|
+
const { authorizationUrl, state } = await manager.startAuthorizationCodeFlow(serverName, {
|
|
77
|
+
...oauth,
|
|
78
|
+
redirectUri,
|
|
79
|
+
});
|
|
80
|
+
const callbackPath = url.pathname;
|
|
81
|
+
const codePromise = new Promise((resolve) => {
|
|
82
|
+
listener.on('error', (err) => {
|
|
83
|
+
resolve({ code: '', state: '', error: `could not listen on ${redirectUri}: ${err.message}` });
|
|
84
|
+
});
|
|
85
|
+
listener.on('request', (req, res) => {
|
|
86
|
+
const requestUrl = new URL(req.url ?? '/', redirectUri);
|
|
87
|
+
if (requestUrl.pathname !== callbackPath) {
|
|
88
|
+
res.writeHead(404).end('Not the OAuth callback path.');
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const error = requestUrl.searchParams.get('error');
|
|
92
|
+
const code = requestUrl.searchParams.get('code') ?? '';
|
|
93
|
+
const returnedState = requestUrl.searchParams.get('state') ?? '';
|
|
94
|
+
res.writeHead(200, { 'content-type': 'text/html' }).end(respondPage(error ? `Authorization failed: ${error}` : 'Authorized — Agent-Nuvira can continue.'));
|
|
95
|
+
resolve({ code, state: returnedState, ...(error ? { error } : {}) });
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
await new Promise((resolve) => {
|
|
99
|
+
listener.listen(Number(url.port || 80), url.hostname === 'localhost' ? '127.0.0.1' : url.hostname, () => resolve());
|
|
100
|
+
});
|
|
101
|
+
log('');
|
|
102
|
+
log(`🔐 Authorizing '${serverName}' (${redirectUri} must be a registered redirect URI for this client).`);
|
|
103
|
+
log(` If the browser does not open, visit:\n ${authorizationUrl}`);
|
|
104
|
+
const open = options.visit ?? (options.openBrowser === false ? () => undefined : openInBrowser);
|
|
105
|
+
open(authorizationUrl);
|
|
106
|
+
const callback = await Promise.race([
|
|
107
|
+
codePromise,
|
|
108
|
+
new Promise((resolve) => {
|
|
109
|
+
const t = setTimeout(() => resolve({ code: '', state: '', error: `timed out after ${Math.round(timeoutMs / 1000)}s` }), timeoutMs);
|
|
110
|
+
t.unref?.();
|
|
111
|
+
}),
|
|
112
|
+
]);
|
|
113
|
+
listener.close();
|
|
114
|
+
if (callback.error)
|
|
115
|
+
return { ok: false, redirectUri, reason: `Authorization failed: ${callback.error}` };
|
|
116
|
+
if (!callback.code)
|
|
117
|
+
return { ok: false, redirectUri, reason: 'The provider did not return an authorization code.' };
|
|
118
|
+
if (callback.state !== state) {
|
|
119
|
+
return { ok: false, redirectUri, reason: 'OAuth state mismatch — the response did not come from this request.' };
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
const tokens = await manager.exchangeCode(serverName, callback.code, callback.state);
|
|
123
|
+
return { ok: true, tokens, redirectUri };
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
return {
|
|
127
|
+
ok: false,
|
|
128
|
+
redirectUri,
|
|
129
|
+
reason: `Token exchange failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=oauth-authorize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-authorize.js","sourceRoot":"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AQ,CAAC,KAAK,EAAE,CAAC;IAEjB,IAAI,QAAQ,CAAC,KAAK;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,yBAAyB,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;IACzG,IAAI,CAAC,QAAQ,CAAC,IAAI;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,oDAAoD,EAAE,CAAC;IACpH,IAAI,QAAQ,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;QAC7B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,qEAAqE,EAAE,CAAC;IACnH,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;QACrF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAC3C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,EAAE,EAAE,KAAK;YACT,WAAW;YACX,MAAM,EAAE,0BAA0B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;SACrF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth for MCP servers at CONNECT time — turning a server config's `oauth`
|
|
3
|
+
* block into the `Authorization: Bearer …` header the remote server expects.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS SEPARATELY. `mcp-oauth.ts` owns the FLOW (authorization code,
|
|
6
|
+
* PKCE, client credentials, token storage). It was reachable only through the
|
|
7
|
+
* `mcp_oauth` tool, so a remote server that authenticates with OAuth could be
|
|
8
|
+
* *configured* and never *connected*: nothing in the connect path looked for a
|
|
9
|
+
* token. This module is that missing link, and it is the difference between
|
|
10
|
+
* "we support OAuth" as a claim and as a behaviour.
|
|
11
|
+
*
|
|
12
|
+
* THE CONTRACT
|
|
13
|
+
* 1. A stored, unexpired token is used as-is (`getTokens()` already returns
|
|
14
|
+
* null for an expired one, with its own safety buffer).
|
|
15
|
+
* 2. An expired one is REFRESHED silently — a refresh token is the whole
|
|
16
|
+
* reason a remote MCP server keeps working across sessions.
|
|
17
|
+
* 3. `grant: 'client_credentials'` mints a token with no user involved.
|
|
18
|
+
* 4. Otherwise the failure is actionable: it names the exact command that
|
|
19
|
+
* obtains a token, instead of surfacing as an opaque 401 from the server.
|
|
20
|
+
*
|
|
21
|
+
* Nothing here logs a token value, and no token is ever written into a server
|
|
22
|
+
* config — the credential lives in the OAuth manager's own store.
|
|
23
|
+
*/
|
|
24
|
+
import { type OAuthConfig } from './mcp-oauth.js';
|
|
25
|
+
import type { MCPServerConfig, MCPOAuthServerConfig } from './types.js';
|
|
26
|
+
export interface OAuthTokenSuccess {
|
|
27
|
+
ok: true;
|
|
28
|
+
accessToken: string;
|
|
29
|
+
tokenType: string;
|
|
30
|
+
/** Where the token came from — recorded so a trace can explain a reconnect. */
|
|
31
|
+
how: 'stored' | 'refreshed' | 'client_credentials';
|
|
32
|
+
}
|
|
33
|
+
export interface OAuthTokenFailure {
|
|
34
|
+
ok: false;
|
|
35
|
+
/** Why no token could be produced, phrased for the user. */
|
|
36
|
+
reason: string;
|
|
37
|
+
how: 'not_configured' | 'needs_authorization' | 'refresh_failed' | 'client_credentials_failed';
|
|
38
|
+
}
|
|
39
|
+
export type OAuthTokenOutcome = OAuthTokenSuccess | OAuthTokenFailure;
|
|
40
|
+
/** The server config's `oauth` block in the shape `mcp-oauth` expects. */
|
|
41
|
+
export declare function toOAuthConfig(oauth: MCPOAuthServerConfig): OAuthConfig;
|
|
42
|
+
/**
|
|
43
|
+
* Resolve a usable access token for a server, or explain why there is none.
|
|
44
|
+
* Never throws: a connect path must be able to report a credential problem as a
|
|
45
|
+
* message rather than as a crash inside a transport.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveOAuthAccessToken(config: Pick<MCPServerConfig, 'name' | 'oauth'>): Promise<OAuthTokenOutcome>;
|
|
48
|
+
/** Merge an OAuth access token into a remote server's headers (explicit header wins). */
|
|
49
|
+
export declare function withOAuthHeader(headers: Record<string, string> | undefined, token: {
|
|
50
|
+
accessToken: string;
|
|
51
|
+
tokenType: string;
|
|
52
|
+
}): Record<string, string>;
|
|
53
|
+
//# sourceMappingURL=oauth-connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-connect.d.ts","sourceRoot":"","sources":["../../src/mcp/oauth-connect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,IAAI,CAAC;IACT,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,GAAG,EAAE,QAAQ,GAAG,WAAW,GAAG,oBAAoB,CAAC;CACpD;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,KAAK,CAAC;IACV,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,gBAAgB,GAAG,qBAAqB,GAAG,gBAAgB,GAAG,2BAA2B,CAAC;CAChG;AAED,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEtE,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,KAAK,EAAE,oBAAoB,GAAG,WAAW,CAStE;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,GAC9C,OAAO,CAAC,iBAAiB,CAAC,CA4D5B;AAED,yFAAyF;AACzF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAC3C,KAAK,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAChD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIxB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth for MCP servers at CONNECT time — turning a server config's `oauth`
|
|
3
|
+
* block into the `Authorization: Bearer …` header the remote server expects.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS SEPARATELY. `mcp-oauth.ts` owns the FLOW (authorization code,
|
|
6
|
+
* PKCE, client credentials, token storage). It was reachable only through the
|
|
7
|
+
* `mcp_oauth` tool, so a remote server that authenticates with OAuth could be
|
|
8
|
+
* *configured* and never *connected*: nothing in the connect path looked for a
|
|
9
|
+
* token. This module is that missing link, and it is the difference between
|
|
10
|
+
* "we support OAuth" as a claim and as a behaviour.
|
|
11
|
+
*
|
|
12
|
+
* THE CONTRACT
|
|
13
|
+
* 1. A stored, unexpired token is used as-is (`getTokens()` already returns
|
|
14
|
+
* null for an expired one, with its own safety buffer).
|
|
15
|
+
* 2. An expired one is REFRESHED silently — a refresh token is the whole
|
|
16
|
+
* reason a remote MCP server keeps working across sessions.
|
|
17
|
+
* 3. `grant: 'client_credentials'` mints a token with no user involved.
|
|
18
|
+
* 4. Otherwise the failure is actionable: it names the exact command that
|
|
19
|
+
* obtains a token, instead of surfacing as an opaque 401 from the server.
|
|
20
|
+
*
|
|
21
|
+
* Nothing here logs a token value, and no token is ever written into a server
|
|
22
|
+
* config — the credential lives in the OAuth manager's own store.
|
|
23
|
+
*/
|
|
24
|
+
import { getMCPOAuthManager } from './mcp-oauth.js';
|
|
25
|
+
/** The server config's `oauth` block in the shape `mcp-oauth` expects. */
|
|
26
|
+
export function toOAuthConfig(oauth) {
|
|
27
|
+
return {
|
|
28
|
+
clientId: oauth.clientId ?? '',
|
|
29
|
+
...(oauth.clientSecret ? { clientSecret: oauth.clientSecret } : {}),
|
|
30
|
+
authorizationEndpoint: oauth.authorizationEndpoint ?? '',
|
|
31
|
+
tokenEndpoint: oauth.tokenEndpoint,
|
|
32
|
+
...(oauth.scopes ? { scopes: oauth.scopes } : {}),
|
|
33
|
+
...(oauth.usePKCE !== undefined ? { usePKCE: oauth.usePKCE } : {}),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Resolve a usable access token for a server, or explain why there is none.
|
|
38
|
+
* Never throws: a connect path must be able to report a credential problem as a
|
|
39
|
+
* message rather than as a crash inside a transport.
|
|
40
|
+
*/
|
|
41
|
+
export async function resolveOAuthAccessToken(config) {
|
|
42
|
+
const oauth = config.oauth;
|
|
43
|
+
if (!oauth?.tokenEndpoint) {
|
|
44
|
+
return {
|
|
45
|
+
ok: false,
|
|
46
|
+
how: 'not_configured',
|
|
47
|
+
reason: `'${config.name}' has no OAuth configuration (a tokenEndpoint is required).`,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const manager = getMCPOAuthManager();
|
|
51
|
+
// Seed the manager's per-server config so a REFRESH works in a process that
|
|
52
|
+
// never ran the interactive flow (a scheduled turn, the gateway, the
|
|
53
|
+
// dashboard) — see MCPOAuthManager.setConfig. Deliberately does NOT touch
|
|
54
|
+
// tokens: this is the how, not the credential.
|
|
55
|
+
manager.setConfig(config.name, toOAuthConfig(oauth));
|
|
56
|
+
// 1) A live token, straight from the store. `getTokens()` returns null once
|
|
57
|
+
// the token is expired (its own 30s buffer), which is exactly the signal
|
|
58
|
+
// that a refresh is worth attempting.
|
|
59
|
+
const stored = manager.getTokens(config.name);
|
|
60
|
+
if (stored?.accessToken) {
|
|
61
|
+
return { ok: true, accessToken: stored.accessToken, tokenType: stored.tokenType || 'Bearer', how: 'stored' };
|
|
62
|
+
}
|
|
63
|
+
// 2) Silent refresh. Returns null when there is no refresh token to use.
|
|
64
|
+
const refreshed = await manager.refreshToken(config.name);
|
|
65
|
+
if (refreshed?.accessToken) {
|
|
66
|
+
return { ok: true, accessToken: refreshed.accessToken, tokenType: refreshed.tokenType || 'Bearer', how: 'refreshed' };
|
|
67
|
+
}
|
|
68
|
+
// 3) Server-to-server, no user involved.
|
|
69
|
+
if (oauth.grant === 'client_credentials') {
|
|
70
|
+
try {
|
|
71
|
+
const minted = await manager.startClientCredentialsFlow(config.name, toOAuthConfig(oauth));
|
|
72
|
+
return {
|
|
73
|
+
ok: true,
|
|
74
|
+
accessToken: minted.accessToken,
|
|
75
|
+
tokenType: minted.tokenType || 'Bearer',
|
|
76
|
+
how: 'client_credentials',
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
return {
|
|
81
|
+
ok: false,
|
|
82
|
+
how: 'client_credentials_failed',
|
|
83
|
+
reason: `'${config.name}': the client-credentials token request failed — ` +
|
|
84
|
+
`${err instanceof Error ? err.message : String(err)}. Verify clientId/clientSecret and the token endpoint.`,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// 4) The honest dead end, with the one command that fixes it.
|
|
89
|
+
return {
|
|
90
|
+
ok: false,
|
|
91
|
+
how: 'needs_authorization',
|
|
92
|
+
reason: `${config.name}: no valid OAuth token. Authorize it once with \`nuvira mcp authorize ${config.name}\` ` +
|
|
93
|
+
'(afterwards it refreshes automatically), or set an explicit Authorization header in its config.',
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/** Merge an OAuth access token into a remote server's headers (explicit header wins). */
|
|
97
|
+
export function withOAuthHeader(headers, token) {
|
|
98
|
+
const hasAuthorization = Object.keys(headers ?? {}).some((h) => h.toLowerCase() === 'authorization');
|
|
99
|
+
if (hasAuthorization)
|
|
100
|
+
return headers ?? {};
|
|
101
|
+
return { ...(headers ?? {}), Authorization: `${token.tokenType || 'Bearer'} ${token.accessToken}` };
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=oauth-connect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-connect.js","sourceRoot":"","sources":["../../src/mcp/oauth-connect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,kBAAkB,EAAoB,MAAM,gBAAgB,CAAC;AAoBtE,0EAA0E;AAC1E,MAAM,UAAU,aAAa,CAAC,KAA2B;IACvD,OAAO;QACL,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE;QAC9B,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnE,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,IAAI,EAAE;QACxD,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnE,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAA+C;IAE/C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC3B,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC;QAC1B,OAAO;YACL,EAAE,EAAE,KAAK;YACT,GAAG,EAAE,gBAAgB;YACrB,MAAM,EAAE,IAAI,MAAM,CAAC,I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BAAoB;aAC1B,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,GAAG,EAAE,2BAA2B;gBAChC,MAAM,EACJ,IAAI,MAAM,CAAC,IAAI,mDAAmD;oBAClE,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,wDAAwD;aAC9G,CAAC;QACJ,CAAC;IACH,CAAC;IAED,8DAA8D;IAC9D,OAAO;QACL,EAAE,EAAE,KAAK;QACT,GAAG,EAAE,qBAAqB;QAC1B,MAAM,EACJ,GAAG,MAAM,CAAC,IAAI,yEAAyE,MAAM,CAAC,IAAI,KAAK;YACvG,iGAAiG;KACpG,CAAC;AACJ,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,eAAe,CAC7B,OAA2C,EAC3C,KAAiD;IAEjD,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,eAAe,CAAC,CAAC;IACrG,IAAI,gBAAgB;QAAE,OAAO,OAAO,IAAI,EAAE,CAAC;IAC3C,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC,SAAS,IAAI,QAAQ,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;AACtG,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP pin verifier — does a catalog's exact npm spec actually exist?
|
|
3
|
+
*
|
|
4
|
+
* Assessment §2 is the reason this exists: four of six shipped pins resolved to
|
|
5
|
+
* nothing (`@modelcontextprotocol/server-fetch` is not on npm at all;
|
|
6
|
+
* `context7@1.5.2`, `server-memory@0.3.6` and
|
|
7
|
+
* `server-sequential-thinking@0.4.2` never existed). Exact-version pinning is
|
|
8
|
+
* the right policy — it makes a stale pin visible — but nothing CHECKED it, so
|
|
9
|
+
* the failure surfaced as a stdio child that never spawns, deep in a chat turn.
|
|
10
|
+
*
|
|
11
|
+
* The check lives at the install boundary (Phase 1), not in a hot path, and it
|
|
12
|
+
* is deliberately tolerant: no network ⇒ `checked: false`, the install proceeds
|
|
13
|
+
* and REPORTS that the pin is unverified. An offline user can still configure
|
|
14
|
+
* MCP; they are simply told that verification did not happen instead of being
|
|
15
|
+
* handed a silent claim that it did.
|
|
16
|
+
*
|
|
17
|
+
* Also surfaced: npm's own `deprecated` flag for the exact version. A deprecated
|
|
18
|
+
* package that still resolves (like `@modelcontextprotocol/server-github@0.6.2`,
|
|
19
|
+
* "no longer supported") is reported, because "it installs" and "it is
|
|
20
|
+
* maintained" are different facts.
|
|
21
|
+
*/
|
|
22
|
+
import type { PinVerdict } from './catalog.js';
|
|
23
|
+
/** Default registry lookup budget — short, because install is interactive. */
|
|
24
|
+
export declare const DEFAULT_PIN_TIMEOUT_MS = 5000;
|
|
25
|
+
export interface PinVerifyOptions {
|
|
26
|
+
/** Injectable fetch (tests never touch the network). */
|
|
27
|
+
fetchImpl?: typeof fetch;
|
|
28
|
+
timeoutMs?: number;
|
|
29
|
+
/** Registry base URL (defaults to the public npm registry). */
|
|
30
|
+
registry?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Split `@scope/name@1.2.3` → `{ name: '@scope/name', version: '1.2.3' }`. */
|
|
33
|
+
export declare function parseNpmSpec(spec: string): {
|
|
34
|
+
name: string;
|
|
35
|
+
version: string;
|
|
36
|
+
} | null;
|
|
37
|
+
/** Verify one exact npm spec. Never throws. */
|
|
38
|
+
export declare function verifyNpmSpec(spec: string, options?: PinVerifyOptions): Promise<PinVerdict>;
|
|
39
|
+
/**
|
|
40
|
+
* Verify several specs in parallel (best-effort). Returns a map keyed by spec so
|
|
41
|
+
* a caller can attribute a refusal to the exact pin it came from.
|
|
42
|
+
*/
|
|
43
|
+
export declare function verifyNpmSpecs(specs: string[], options?: PinVerifyOptions): Promise<Map<string, PinVerdict>>;
|
|
44
|
+
//# sourceMappingURL=pin-verifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pin-verifier.d.ts","sourceRoot":"","sources":["../../src/mcp/pin-verifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,8EAA8E;AAC9E,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAUnF;AAED,+CAA+C;AAC/C,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC,CAgDrG;AASD;;;GAGG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAGlC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP pin verifier — does a catalog's exact npm spec actually exist?
|
|
3
|
+
*
|
|
4
|
+
* Assessment §2 is the reason this exists: four of six shipped pins resolved to
|
|
5
|
+
* nothing (`@modelcontextprotocol/server-fetch` is not on npm at all;
|
|
6
|
+
* `context7@1.5.2`, `server-memory@0.3.6` and
|
|
7
|
+
* `server-sequential-thinking@0.4.2` never existed). Exact-version pinning is
|
|
8
|
+
* the right policy — it makes a stale pin visible — but nothing CHECKED it, so
|
|
9
|
+
* the failure surfaced as a stdio child that never spawns, deep in a chat turn.
|
|
10
|
+
*
|
|
11
|
+
* The check lives at the install boundary (Phase 1), not in a hot path, and it
|
|
12
|
+
* is deliberately tolerant: no network ⇒ `checked: false`, the install proceeds
|
|
13
|
+
* and REPORTS that the pin is unverified. An offline user can still configure
|
|
14
|
+
* MCP; they are simply told that verification did not happen instead of being
|
|
15
|
+
* handed a silent claim that it did.
|
|
16
|
+
*
|
|
17
|
+
* Also surfaced: npm's own `deprecated` flag for the exact version. A deprecated
|
|
18
|
+
* package that still resolves (like `@modelcontextprotocol/server-github@0.6.2`,
|
|
19
|
+
* "no longer supported") is reported, because "it installs" and "it is
|
|
20
|
+
* maintained" are different facts.
|
|
21
|
+
*/
|
|
22
|
+
/** Default registry lookup budget — short, because install is interactive. */
|
|
23
|
+
export const DEFAULT_PIN_TIMEOUT_MS = 5000;
|
|
24
|
+
/** Split `@scope/name@1.2.3` → `{ name: '@scope/name', version: '1.2.3' }`. */
|
|
25
|
+
export function parseNpmSpec(spec) {
|
|
26
|
+
const trimmed = String(spec ?? '').trim();
|
|
27
|
+
if (!trimmed)
|
|
28
|
+
return null;
|
|
29
|
+
// The version separator is the LAST '@' — the first may open a scope.
|
|
30
|
+
const at = trimmed.lastIndexOf('@');
|
|
31
|
+
if (at <= 0)
|
|
32
|
+
return null;
|
|
33
|
+
const name = trimmed.slice(0, at);
|
|
34
|
+
const version = trimmed.slice(at + 1);
|
|
35
|
+
if (!name || !version)
|
|
36
|
+
return null;
|
|
37
|
+
return { name, version };
|
|
38
|
+
}
|
|
39
|
+
/** Verify one exact npm spec. Never throws. */
|
|
40
|
+
export async function verifyNpmSpec(spec, options = {}) {
|
|
41
|
+
const parsed = parseNpmSpec(spec);
|
|
42
|
+
if (!parsed) {
|
|
43
|
+
return { checked: false, ok: false, reason: `'${spec}' is not an exact npm spec (expected pkg@1.2.3)` };
|
|
44
|
+
}
|
|
45
|
+
const doFetch = options.fetchImpl ?? globalThis.fetch;
|
|
46
|
+
if (typeof doFetch !== 'function') {
|
|
47
|
+
return { checked: false, ok: false, reason: 'no fetch implementation available' };
|
|
48
|
+
}
|
|
49
|
+
const registry = (options.registry ?? 'https://registry.npmjs.org').replace(/\/$/, '');
|
|
50
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_PIN_TIMEOUT_MS;
|
|
51
|
+
try {
|
|
52
|
+
const response = await doFetch(`${registry}/${encodeURIComponent(parsed.name).replace('%40', '@')}`, {
|
|
53
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
54
|
+
headers: { accept: 'application/json' },
|
|
55
|
+
});
|
|
56
|
+
if (response.status === 404) {
|
|
57
|
+
return { checked: true, ok: false, reason: `npm has no package '${parsed.name}'` };
|
|
58
|
+
}
|
|
59
|
+
if (!response.ok) {
|
|
60
|
+
return { checked: false, ok: false, reason: `registry returned HTTP ${response.status}` };
|
|
61
|
+
}
|
|
62
|
+
const body = (await response.json());
|
|
63
|
+
const versions = body.versions ?? {};
|
|
64
|
+
const entry = versions[parsed.version];
|
|
65
|
+
if (!entry) {
|
|
66
|
+
return {
|
|
67
|
+
checked: true,
|
|
68
|
+
ok: false,
|
|
69
|
+
reason: `npm has no '${parsed.name}@${parsed.version}' (published: ${summarizeVersions(versions)})`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const deprecated = entry.deprecated;
|
|
73
|
+
return {
|
|
74
|
+
checked: true,
|
|
75
|
+
ok: true,
|
|
76
|
+
...(deprecated ? { deprecated: typeof deprecated === 'string' ? deprecated : 'deprecated' } : {}),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
return {
|
|
81
|
+
checked: false,
|
|
82
|
+
ok: false,
|
|
83
|
+
reason: `registry unreachable (${err instanceof Error ? err.message : String(err)})`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** A short "…1.0.34, 2.0.0" tail so a refusal says what DOES exist. */
|
|
88
|
+
function summarizeVersions(versions, keep = 4) {
|
|
89
|
+
const keys = Object.keys(versions);
|
|
90
|
+
if (keys.length === 0)
|
|
91
|
+
return 'no versions published';
|
|
92
|
+
return keys.slice(-keep).join(', ');
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Verify several specs in parallel (best-effort). Returns a map keyed by spec so
|
|
96
|
+
* a caller can attribute a refusal to the exact pin it came from.
|
|
97
|
+
*/
|
|
98
|
+
export async function verifyNpmSpecs(specs, options = {}) {
|
|
99
|
+
const results = await Promise.all(specs.map(async (spec) => [spec, await verifyNpmSpec(spec, options)]));
|
|
100
|
+
return new Map(results);
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=pin-verifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pin-verifier.js","sourceRoot":"","sources":["../../src/mcp/pin-verifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAU3C,+EAA+E;AAC/E,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,sEAAsE;IACtE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,EAAE,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,EAA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