@frontmcp/sdk 1.11.1-rc.1 → 1.11.1-rc.2
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/app/instances/app.esm.instance.d.ts.map +1 -1
- package/app/instances/empty-app-registries.d.ts +1 -0
- package/app/instances/empty-app-registries.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts +5 -0
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.connect.flow.d.ts +4 -2
- package/auth/flows/oauth.connect.flow.d.ts.map +1 -1
- package/auth/vault/auth-providers.providers.d.ts +7 -16
- package/auth/vault/auth-providers.providers.d.ts.map +1 -1
- package/auth/vault/index.d.ts +1 -2
- package/auth/vault/index.d.ts.map +1 -1
- package/auth/vault/unconfigured-auth-providers.d.ts +4 -0
- package/auth/vault/unconfigured-auth-providers.d.ts.map +1 -0
- package/browser/app/instances/app.esm.instance.mjs +2 -0
- package/browser/app/instances/empty-app-registries.mjs +2 -0
- package/browser/auth/flows/oauth.callback.flow.mjs +26 -1
- package/browser/auth/flows/oauth.connect.flow.mjs +31 -24
- package/browser/auth/vault/auth-providers.providers.mjs +96 -0
- package/browser/auth/vault/credential-cache.mjs +5 -0
- package/browser/auth/vault/unconfigured-auth-providers.mjs +21 -0
- package/browser/common/entries/scope.entry.mjs +23 -4
- package/browser/common/interfaces/execution-context.interface.mjs +5 -0
- package/browser/common/interfaces/server.interface.mjs +2 -0
- package/browser/common/metadata/front-mcp.metadata.mjs +3 -0
- package/browser/common/tokens/front-mcp.tokens.mjs +1 -0
- package/browser/direct/direct-client.mjs +2 -1
- package/browser/direct/token-auth-info.mjs +2 -0
- package/browser/elicitation/helpers/elicit.helper.mjs +10 -7
- package/browser/errors/index.mjs +1 -1
- package/browser/errors/misconfiguration.mjs +3 -1
- package/browser/errors/plugin.errors.mjs +20 -0
- package/browser/errors/tool-credentials-required.error.mjs +18 -5
- package/browser/front-mcp/front-mcp.mjs +1 -3
- package/browser/health/health.service.mjs +14 -10
- package/browser/index.cjs +2846 -2335
- package/browser/index.mjs +9 -3
- package/browser/notification/notification.service.mjs +5 -5
- package/browser/plugin/plugin.registry.mjs +39 -2
- package/browser/provider/provider.registry.mjs +2 -0
- package/browser/scope/dev-events-observability.mjs +9 -5
- package/browser/scope/scope.instance.mjs +9 -2
- package/browser/skill/errors/skill-bundle-not-loaded.error.mjs +21 -0
- package/browser/skill/flows/load-skill.flow.mjs +13 -9
- package/browser/skill/flows/search-skills.flow.mjs +10 -2
- package/browser/skill/index.mjs +2 -0
- package/browser/skill/sep-2640/resources/skill-index.resource.mjs +2 -0
- package/browser/skill/sep-2640/sep-2640.resource-helpers.mjs +5 -2
- package/browser/skill/skill-catalog-source.mjs +33 -1
- package/browser/skill/skill-instructions.helper.mjs +14 -14
- package/browser/skill/skill.registry.mjs +6 -0
- package/browser/surface/index.mjs +6 -0
- package/browser/surface/list-change-batch.mjs +51 -0
- package/browser/surface/live-surface.mjs +2 -2
- package/browser/tool/flows/call-tool.flow.mjs +18 -4
- package/browser/tool/flows/tool-credentials.gate.mjs +60 -10
- package/browser/tool/tool.registry.mjs +9 -2
- package/browser/transport/mcp-20260728/mrtr.mjs +13 -6
- package/browser/transport/mcp-20260728/subscriptions.mjs +6 -6
- package/browser/transport/mcp-handlers/skills-list-request.handler.mjs +19 -7
- package/browser/transport/mcp-handlers/skills-mcp.types.mjs +6 -4
- package/browser/transport/web-fetch-handler.mjs +6 -8
- package/common/entries/scope.entry.d.ts +15 -3
- package/common/entries/scope.entry.d.ts.map +1 -1
- package/common/interfaces/execution-context.interface.d.ts +3 -1
- package/common/interfaces/execution-context.interface.d.ts.map +1 -1
- package/common/interfaces/server.interface.d.ts +2 -0
- package/common/interfaces/server.interface.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +304 -92
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/types/options/elicitation/schema.d.ts +1 -1
- package/common/types/options/redis/schema.d.ts +3 -3
- package/common/types/options/redis/schema.d.ts.map +1 -1
- package/common/types/options/skills-http/schema.d.ts +2 -2
- package/common/types/options/transport/schema.d.ts +4 -4
- package/context/frontmcp-context.d.ts +1 -1
- package/context/frontmcp-context.d.ts.map +1 -1
- package/direct/client.types.d.ts +48 -28
- package/direct/client.types.d.ts.map +1 -1
- package/direct/index.d.ts +1 -1
- package/direct/index.d.ts.map +1 -1
- package/direct/token-auth-info.d.ts +5 -1
- package/direct/token-auth-info.d.ts.map +1 -1
- package/elicitation/helpers/elicit.helper.d.ts +5 -0
- package/elicitation/helpers/elicit.helper.d.ts.map +1 -1
- package/errors/error-handler.d.ts +1 -0
- package/errors/error-handler.d.ts.map +1 -1
- package/errors/mcp.error.d.ts +2 -0
- package/errors/mcp.error.d.ts.map +1 -1
- package/errors/misconfiguration.d.ts.map +1 -1
- package/errors/plugin.errors.d.ts +8 -0
- package/errors/plugin.errors.d.ts.map +1 -1
- package/errors/tool-credentials-required.error.d.ts +10 -2
- package/errors/tool-credentials-required.error.d.ts.map +1 -1
- package/esm/index.mjs +31 -31
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/health/health.service.d.ts +8 -4
- package/health/health.service.d.ts.map +1 -1
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js +38 -38
- package/package.json +10 -10
- package/plugin/plugin.registry.d.ts +3 -1
- package/plugin/plugin.registry.d.ts.map +1 -1
- package/provider/provider.registry.d.ts.map +1 -1
- package/scope/dev-events-observability.d.ts +2 -0
- package/scope/dev-events-observability.d.ts.map +1 -1
- package/scope/scope.instance.d.ts.map +1 -1
- package/server/adapters/utf8-json.parser.d.ts +2 -0
- package/server/adapters/utf8-json.parser.d.ts.map +1 -1
- package/skill/errors/index.d.ts +1 -0
- package/skill/errors/index.d.ts.map +1 -1
- package/skill/errors/skill-bundle-not-loaded.error.d.ts +16 -0
- package/skill/errors/skill-bundle-not-loaded.error.d.ts.map +1 -0
- package/skill/flows/load-skill.flow.d.ts +2 -2
- package/skill/flows/load-skill.flow.d.ts.map +1 -1
- package/skill/flows/search-skills.flow.d.ts +5 -1
- package/skill/flows/search-skills.flow.d.ts.map +1 -1
- package/skill/index.d.ts +1 -0
- package/skill/index.d.ts.map +1 -1
- package/skill/sep-2640/resources/skill-index.resource.d.ts.map +1 -1
- package/skill/sep-2640/sep-2640.resource-helpers.d.ts +2 -1
- package/skill/sep-2640/sep-2640.resource-helpers.d.ts.map +1 -1
- package/skill/skill-catalog-source.d.ts +24 -2
- package/skill/skill-catalog-source.d.ts.map +1 -1
- package/skill/skill-instructions.helper.d.ts +5 -0
- package/skill/skill-instructions.helper.d.ts.map +1 -1
- package/skill/skill.registry.d.ts +9 -0
- package/skill/skill.registry.d.ts.map +1 -1
- package/surface/index.d.ts +1 -0
- package/surface/index.d.ts.map +1 -1
- package/surface/list-change-batch.d.ts +28 -0
- package/surface/list-change-batch.d.ts.map +1 -0
- package/tool/flows/call-tool.flow.d.ts +5 -2
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tool-credentials.gate.d.ts +26 -0
- package/tool/flows/tool-credentials.gate.d.ts.map +1 -1
- package/tool/tool.registry.d.ts +2 -0
- package/tool/tool.registry.d.ts.map +1 -1
- package/transport/mcp-20260728/mrtr.d.ts +6 -2
- package/transport/mcp-20260728/mrtr.d.ts.map +1 -1
- package/transport/mcp-20260728/subscriptions.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-list-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-mcp.types.d.ts +3 -1
- package/transport/mcp-handlers/skills-mcp.types.d.ts.map +1 -1
- package/auth/vault/auth-providers.context-extension.d.ts +0 -68
- package/auth/vault/auth-providers.context-extension.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.esm.instance.d.ts","sourceRoot":"","sources":["../../../src/app/instances/app.esm.instance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EAER,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EAGd,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EAEvB,MAAM,cAAc,CAAC;AActB,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAGxG,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,gBAAgB,MAAM,kCAAkC,CAAC;AAErE,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEzE,OAAO,YAAY,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"app.esm.instance.d.ts","sourceRoot":"","sources":["../../../src/app/instances/app.esm.instance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EAER,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EAGd,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EAEvB,MAAM,cAAc,CAAC;AActB,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAGxG,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,gBAAgB,MAAM,kCAAkC,CAAC;AAErE,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEzE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAsGpD;;;;;;;;;;GAUG;AACH,qBAAa,cAAe,SAAQ,QAAQ,CAAC,iBAAiB,CAAC;IAC7D,SAAkB,EAAE,EAAE,MAAM,CAAC;IAE7B,IAAa,QAAQ,IAAI,OAAO,CAE/B;IAED,OAAO,CAAC,QAAQ,CAAC,cAAc,CA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olean;
|
|
32
32
|
count(): Promise<number>;
|
|
33
33
|
subscribe(): () => void;
|
|
34
|
+
notifyListChanged(): void;
|
|
34
35
|
getCapabilities(): {};
|
|
35
36
|
validateAllTools(): Promise<{
|
|
36
37
|
results: never[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-app-registries.d.ts","sourceRoot":"","sources":["../../../src/app/instances/empty-app-registries.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEzE,0GAA0G;AAC1G,qBAAa,mBAAoB,YAAW,uBAAuB;IACjE,UAAU,IAAI,cAAc,EAAE;IAI9B,cAAc,IAAI,MAAM,EAAE;CAG3B;AAED,uDAAuD;AACvD,qBAAa,oBAAqB,YAAW,wBAAwB;IACnE,WAAW,IAAI,YAAY,EAAE;CAG9B;AAED,2EAA2E;AAC3E,qBAAa,kBAAmB,YAAW,sBAAsB;IAC/D,QAAQ,CAAC,KAAK;;;;MAAoE;IAClF,SAAS,IAAI,UAAU,EAAE;IAGzB,mBAAmB,IAAI,UAAU,EAAE;IAGnC,sBAAsB,IAAI,UAAU,EAAE;IAGtC,UAAU,IAAI,UAAU,GAAG,SAAS;IAGpC,mBAAmB,IAAI,UAAU,GAAG,SAAS;IAGvC,MAAM,IAAI,OAAO,CAAC,EAAE,CAAC;IAGrB,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC;IAG/B,UAAU;;;;;IAGhB,MAAM,IAAI,OAAO;IAGX,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;IAG9B,SAAS,IAAI,MAAM,IAAI;IAGvB,eAAe;IAGT,gBAAgB;;;;;;;IAUhB,cAAc;IAIpB,mBAAmB;IAGnB,mBAAmB;IAGnB,mBAAmB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B;IAGnB,mBAAmB;IAGnB,mBAAmB;IAGb,oBAAoB,IAAI,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC;IAGhF,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;CAG1C"}
|
|
@@ -160,6 +160,11 @@ export default class OauthCallbackFlow extends FlowBase<typeof name> {
|
|
|
160
160
|
*/
|
|
161
161
|
handleFederatedAuth(): Promise<void>;
|
|
162
162
|
createAuthorizationCode(): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* A sign-in that stores no credential still starts empty: it rotates the vault the subject has, if any.
|
|
165
|
+
* False when the rotation failed, so the old vault could still serve the new session.
|
|
166
|
+
*/
|
|
167
|
+
private rotateExistingVault;
|
|
163
168
|
redirectToClient(): Promise<void>;
|
|
164
169
|
/**
|
|
165
170
|
* Reserved OAuth/flow control params that must never be treated as custom
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.callback.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.callback.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAoBH,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAUpD,OAAO,EAIL,QAAQ,EAQR,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAatB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AAEpC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA8Df,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAAgD,CAAC;AAEnE,QAAA,MAAM,IAAI;;;CAG2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,gBAAgB,EAAE,cAAc,CAC9B,iBAAiB,EACjB,OAAO,I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AC,OAAO,IAAI,CAAC;IAClE,OAAO,CAAC,MAAM,CAAgD;IAE9D;;;;;;;;;OASG;IACH,OAAO,CAAC,aAAa;IAOf,aAAa;IAKb,YAAY;IAKZ,UAAU;IA4EV,mBAAmB;IA+bzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IAEG,qBAAqB;IA2D3B;;;;;;OAMG;IAEG,mBAAmB;IAiInB,uBAAuB;IAmH7B;;;OAGG;YACW,mBAAmB;IAe3B,gBAAgB;IAyDtB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAqB1C;IAEH;;;;;OAKG;IACH;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAUrB,0EAA0E;IAC1E,OAAO,CAAC,SAAS;IAOjB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,uBAAuB;IA4B/B,OAAO,CAAC,kBAAkB;IAqB1B;;;;OAIG;YACW,eAAe;IAgC7B;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAQpB;;;;OAIG;YACW,iBAAiB;IAoB/B;;;;;;;OAOG;IACH,OAAO,CAAC,yBAAyB;IAYjC;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAmB5B;;;;;;;;;OASG;YACW,sBAAsB;IAgFpC;;;;;;;;;;;;OAYG;YACW,oBAAoB;IA4BlC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,mBAAmB;IA0C3B,8EAA8E;IAC9E,OAAO,CAAC,QAAQ;IAIhB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAQvB;;OAEG;IACH,OAAO,CAAC,eAAe;CAqDxB;AAYD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -10,8 +10,10 @@
|
|
|
10
10
|
* - POST /oauth/connect → re-verify the token, re-invoke the
|
|
11
11
|
* configured `authenticate({ fields, resume: { sub, key, context } })`
|
|
12
12
|
* verifier, and ADDITIVELY store the returned credential into the user's
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* vault, creating it when the signed subject has none yet (a sign-in that
|
|
14
|
+
* stored no credential, or a restart of an in-memory vault).
|
|
15
|
+
* - A link signed for an anonymous caller is refused on both: there is no
|
|
16
|
+
* signed-in subject to store a credential for.
|
|
15
17
|
*
|
|
16
18
|
* This is auth-internal: it lives on the existing OAuth flow surface (registered
|
|
17
19
|
* by LocalPrimaryAuth), not via the public custom-route feature.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.connect.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.connect.flow.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"oauth.connect.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.connect.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAmBH,OAAO,EAIL,QAAQ,EAMR,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAGtB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AAEpC,QAAA,MAAM,WAAW;;;;gCAOf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;gCAAiB,CAAC;AAEpC,QAAA,MAAM,IAAI;;;CAG2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,eAAe,EAAE,cAAc,CAC7B,gBAAgB,EAChB,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,eAAwB,CAAC;AAiBtC,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IACjE,OAAO,CAAC,MAAM,CAA+C;IAGvD,aAAa;IAKb,YAAY;IAKZ,UAAU;IAeV,aAAa;IAkHnB,yFAAyF;IACzF,OAAO,CAAC,WAAW;IAKnB,qGAAqG;IACrG,OAAO,CAAC,mBAAmB;IAW3B,8EAA8E;IAC9E,OAAO,CAAC,QAAQ;IAIhB,+EAA+E;IAC/E,OAAO,CAAC,iBAAiB;IAoBzB;;;OAGG;YACW,eAAe;IA4B7B,+FAA+F;IAC/F,OAAO,CAAC,YAAY;IAQpB,sGAAsG;IACtG,OAAO,CAAC,sBAAsB;IAQ9B,4DAA4D;IAC5D,OAAO,CAAC,UAAU;IAyBlB,+FAA+F;IAC/F,OAAO,CAAC,aAAa;IAerB,2CAA2C;IAC3C,OAAO,CAAC,WAAW;CAQpB;AAMD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -5,23 +5,13 @@
|
|
|
5
5
|
* These providers are registered at scope initialization when AuthProviders is enabled.
|
|
6
6
|
*/
|
|
7
7
|
import { LazyCredentialLoader, type AuthorizationVault, type AuthProvidersVaultOptions } from '@frontmcp/auth';
|
|
8
|
-
import {
|
|
8
|
+
import { type Token } from '@frontmcp/di';
|
|
9
|
+
import { type ProviderType } from '../../common';
|
|
10
|
+
import type ProviderRegistry from '../../provider/provider.registry';
|
|
9
11
|
/**
|
|
10
12
|
* Token for lazy loader (internal use)
|
|
11
13
|
*/
|
|
12
14
|
export declare const LAZY_CREDENTIAL_LOADER: Token<LazyCredentialLoader>;
|
|
13
|
-
/**
|
|
14
|
-
* Provider definition type for AuthProviders system.
|
|
15
|
-
* Extended to include scope at top level for SDK compatibility.
|
|
16
|
-
*/
|
|
17
|
-
interface AuthProvidersProviderDef {
|
|
18
|
-
provide: Token;
|
|
19
|
-
scope: ProviderScope;
|
|
20
|
-
name?: string;
|
|
21
|
-
useFactory?: (...args: any[]) => any;
|
|
22
|
-
useValue?: unknown;
|
|
23
|
-
inject?: () => readonly Token[];
|
|
24
|
-
}
|
|
25
15
|
/**
|
|
26
16
|
* Create providers for AuthProviders vault system
|
|
27
17
|
*
|
|
@@ -29,10 +19,11 @@ interface AuthProvidersProviderDef {
|
|
|
29
19
|
* @param baseVault - Base AuthorizationVault for storage
|
|
30
20
|
* @returns Array of provider definitions
|
|
31
21
|
*/
|
|
32
|
-
export declare function createAuthProvidersProviders(options: AuthProvidersVaultOptions, baseVault: AuthorizationVault):
|
|
22
|
+
export declare function createAuthProvidersProviders(options: AuthProvidersVaultOptions, baseVault: AuthorizationVault): ProviderType[];
|
|
33
23
|
/**
|
|
34
24
|
* Check if AuthProviders should be enabled based on options
|
|
35
25
|
*/
|
|
36
|
-
export declare function isAuthProvidersEnabled(options?: AuthProvidersVaultOptions):
|
|
37
|
-
|
|
26
|
+
export declare function isAuthProvidersEnabled(options?: AuthProvidersVaultOptions): options is AuthProvidersVaultOptions;
|
|
27
|
+
/** Register the providers behind `this.authProviders` in a scope, when `@FrontMcp({ authProvidersVault })` enables them. */
|
|
28
|
+
export declare function registerAuthProvidersVault(providers: ProviderRegistry, options: AuthProvidersVaultOptions | undefined): Promise<void>;
|
|
38
29
|
//# sourceMappingURL=auth-providers.providers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-providers.providers.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/auth-providers.providers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"auth-providers.providers.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/auth-providers.providers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAUL,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAE/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAiB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjE,OAAO,KAAK,gBAAgB,MAAM,kCAAkC,CAAC;AAIrE;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAoD,KAAK,CAAC,oBAAoB,CAAC,CAAC;AAEnH;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,yBAAyB,EAClC,SAAS,EAAE,kBAAkB,GAC5B,YAAY,EAAE,CAiFhB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,IAAI,yBAAyB,CAWhH;AAED,4HAA4H;AAC5H,wBAAsB,0BAA0B,CAC9C,SAAS,EAAE,gBAAgB,EAC3B,OAAO,EAAE,yBAAyB,GAAG,SAAS,GAC7C,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
package/auth/vault/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { CREDENTIAL_CACHE } from './credential-cache';
|
|
2
|
-
export { createAuthProvidersProviders, isAuthProvidersEnabled, LAZY_CREDENTIAL_LOADER, } from './auth-providers.providers';
|
|
3
|
-
export { authProvidersContextExtension, getAuthProviders, tryGetAuthProviders, } from './auth-providers.context-extension';
|
|
2
|
+
export { createAuthProvidersProviders, isAuthProvidersEnabled, LAZY_CREDENTIAL_LOADER, registerAuthProvidersVault, } from './auth-providers.providers';
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type AuthProvidersAccessor } from '@frontmcp/auth';
|
|
2
|
+
/** `this.authProviders` on a server that registers no auth providers: a credential read names the provider it asked for. */
|
|
3
|
+
export declare const unconfiguredAuthProviders: AuthProvidersAccessor;
|
|
4
|
+
//# sourceMappingURL=unconfigured-auth-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unconfigured-auth-providers.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/unconfigured-auth-providers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAM7F,4HAA4H;AAC5H,eAAO,MAAM,yBAAyB,EAAE,qBAYvC,CAAC"}
|
|
@@ -598,7 +598,8 @@ var OauthCallbackFlow = class extends FlowBase {
|
|
|
598
598
|
// Checkpoint 3a \u2014 custom claims from authenticate()
|
|
599
599
|
customClaims,
|
|
600
600
|
// Checkpoint 3b \u2014 credentials from authenticate()
|
|
601
|
-
credentials
|
|
601
|
+
credentials,
|
|
602
|
+
isIncremental
|
|
602
603
|
} = this.state;
|
|
603
604
|
if (!clientId || !redirectUri || !codeChallenge || !userSub) {
|
|
604
605
|
const missingFields = [
|
|
@@ -617,6 +618,13 @@ var OauthCallbackFlow = class extends FlowBase {
|
|
|
617
618
|
return;
|
|
618
619
|
}
|
|
619
620
|
const localAuth = this.scope.auth;
|
|
621
|
+
const startsWithEmptyVault = (!credentials || credentials.length === 0) && !isIncremental;
|
|
622
|
+
if (startsWithEmptyVault && !await this.rotateExistingVault(localAuth, userSub)) {
|
|
623
|
+
this.respond(
|
|
624
|
+
this.htmlPage(this.renderErrorPage("server_error", "Could not start a new session. Please try again."), 500)
|
|
625
|
+
);
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
620
628
|
const code = await localAuth.createAuthorizationCode({
|
|
621
629
|
clientId,
|
|
622
630
|
redirectUri,
|
|
@@ -663,6 +671,23 @@ var OauthCallbackFlow = class extends FlowBase {
|
|
|
663
671
|
}
|
|
664
672
|
}
|
|
665
673
|
}
|
|
674
|
+
/**
|
|
675
|
+
* A sign-in that stores no credential still starts empty: it rotates the vault the subject has, if any.
|
|
676
|
+
* False when the rotation failed, so the old vault could still serve the new session.
|
|
677
|
+
*/
|
|
678
|
+
async rotateExistingVault(localAuth, userSub) {
|
|
679
|
+
const vault = localAuth.credentialVault;
|
|
680
|
+
if (!vault) return true;
|
|
681
|
+
try {
|
|
682
|
+
if (await vault.getVaultId(userSub)) {
|
|
683
|
+
await vault.rotateVault(userSub);
|
|
684
|
+
}
|
|
685
|
+
return true;
|
|
686
|
+
} catch (err) {
|
|
687
|
+
this.logger.error(`Failed to rotate the session vault: ${err instanceof Error ? err.message : String(err)}`);
|
|
688
|
+
return false;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
666
691
|
async redirectToClient() {
|
|
667
692
|
const { redirectUri, authorizationCode, originalState, isIncremental, targetAppId } = this.state;
|
|
668
693
|
if (!redirectUri || !authorizationCode) {
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
buildConnectSuccessPage,
|
|
16
16
|
builtInAuthPageHeaders,
|
|
17
17
|
escapeHtml,
|
|
18
|
+
isAnonymousSubject,
|
|
18
19
|
toLoginExtraFields,
|
|
19
20
|
verifyCredentialResumeToken
|
|
20
21
|
} from "@frontmcp/auth";
|
|
@@ -80,6 +81,18 @@ var OauthConnectFlow = class extends FlowBase {
|
|
|
80
81
|
);
|
|
81
82
|
return;
|
|
82
83
|
}
|
|
84
|
+
if (isAnonymousSubject(payload.sub)) {
|
|
85
|
+
this.respond(
|
|
86
|
+
this.htmlPage(
|
|
87
|
+
this.renderError(
|
|
88
|
+
"login_required",
|
|
89
|
+
"Connecting a credential needs a signed-in account. Sign in to this server, then run the tool again to get a new connect link."
|
|
90
|
+
),
|
|
91
|
+
403
|
|
92
|
+
)
|
|
93
|
+
);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
83
96
|
const localOptions = localAuth.options;
|
|
84
97
|
if (method === "GET") {
|
|
85
98
|
this.respond(this.htmlPage(this.renderConnectPage(payload, localOptions.login, token)));
|
|
@@ -108,36 +121,27 @@ var OauthConnectFlow = class extends FlowBase {
|
|
|
108
121
|
);
|
|
109
122
|
return;
|
|
110
123
|
}
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
this.respond(this.htmlPage(this.renderError("server_error", "Credential storage is not configured."), 500));
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
const vaultId = await vault.getVaultId(payload.sub);
|
|
117
|
-
if (!vaultId) {
|
|
118
|
-
this.logger.warn("Connect attempted with no live vault for subject; refusing");
|
|
119
|
-
this.respond(
|
|
120
|
-
this.htmlPage(
|
|
121
|
-
this.renderError("invalid_request", "Your session is no longer active. Please sign in again."),
|
|
122
|
-
409
|
|
123
|
-
)
|
|
124
|
-
);
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
let stored = 0;
|
|
128
|
-
for (const cred of credentials) {
|
|
129
|
-
if (!cred || typeof cred.key !== "string" || typeof cred.secret !== "string") continue;
|
|
130
|
-
await vault.store(payload.sub, vaultId, cred.key, { secret: cred.secret, metadata: cred.metadata });
|
|
131
|
-
stored++;
|
|
132
|
-
}
|
|
133
|
-
if (stored === 0) {
|
|
124
|
+
const storableCredentials = credentials.filter(isStorableCredential);
|
|
125
|
+
if (storableCredentials.length === 0) {
|
|
134
126
|
this.logger.warn("Connect produced no storable credentials (all returned entries were malformed)");
|
|
135
127
|
this.respond(
|
|
136
128
|
this.htmlPage(this.renderError("invalid_request", "No valid credential was returned. Please try again."), 400)
|
|
137
129
|
);
|
|
138
130
|
return;
|
|
139
131
|
}
|
|
140
|
-
|
|
132
|
+
const vault = localAuth.credentialVault;
|
|
133
|
+
if (!vault) {
|
|
134
|
+
this.respond(this.htmlPage(this.renderError("server_error", "Credential storage is not configured."), 500));
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const vaultId = await vault.ensureVault(payload.sub);
|
|
138
|
+
for (const credential of storableCredentials) {
|
|
139
|
+
await vault.store(payload.sub, vaultId, credential.key, {
|
|
140
|
+
secret: credential.secret,
|
|
141
|
+
metadata: credential.metadata
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
this.logger.info(`Connected ${storableCredentials.length} credential(s) mid-session for key "${payload.key}"`);
|
|
141
145
|
this.notifyResourcesUpdated(payload.key);
|
|
142
146
|
this.respond(this.htmlPage(buildConnectSuccessPage({ key: payload.key })));
|
|
143
147
|
}
|
|
@@ -291,6 +295,9 @@ OauthConnectFlow = __decorateClass([
|
|
|
291
295
|
}
|
|
292
296
|
})
|
|
293
297
|
], OauthConnectFlow);
|
|
298
|
+
function isStorableCredential(credential) {
|
|
299
|
+
return !!credential && typeof credential.key === "string" && typeof credential.secret === "string";
|
|
300
|
+
}
|
|
294
301
|
export {
|
|
295
302
|
OauthConnectFlow,
|
|
296
303
|
OauthConnectFlow as default
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// libs/sdk/src/auth/vault/auth-providers.providers.ts
|
|
2
|
+
import {
|
|
3
|
+
AUTH_PROVIDERS_ACCESSOR,
|
|
4
|
+
AUTH_PROVIDERS_REGISTRY,
|
|
5
|
+
AUTH_PROVIDERS_VAULT,
|
|
6
|
+
AuthProvidersAccessorImpl,
|
|
7
|
+
AuthProvidersRegistry,
|
|
8
|
+
AuthProvidersVault,
|
|
9
|
+
CredentialCache,
|
|
10
|
+
InMemoryAuthorizationVault,
|
|
11
|
+
isAnonymousSubject,
|
|
12
|
+
LazyCredentialLoader
|
|
13
|
+
} from "@frontmcp/auth";
|
|
14
|
+
import { ProviderScope } from "@frontmcp/di";
|
|
15
|
+
import { randomUUID } from "@frontmcp/utils";
|
|
16
|
+
import { FrontMcpLogger } from "../../common/index.mjs";
|
|
17
|
+
import { FRONTMCP_CONTEXT } from "../../context/frontmcp-context.provider.mjs";
|
|
18
|
+
import { sessionScopeIdentity } from "../session-scope-identity.mjs";
|
|
19
|
+
import { CREDENTIAL_CACHE } from "./credential-cache.mjs";
|
|
20
|
+
var LAZY_CREDENTIAL_LOADER = /* @__PURE__ */ Symbol.for("frontmcp:LAZY_CREDENTIAL_LOADER");
|
|
21
|
+
function createAuthProvidersProviders(options, baseVault) {
|
|
22
|
+
const providers = [];
|
|
23
|
+
providers.push({
|
|
24
|
+
provide: AUTH_PROVIDERS_REGISTRY,
|
|
25
|
+
scope: ProviderScope.GLOBAL,
|
|
26
|
+
name: "AuthProvidersRegistry",
|
|
27
|
+
useFactory: () => new AuthProvidersRegistry(options)
|
|
28
|
+
});
|
|
29
|
+
providers.push({
|
|
30
|
+
provide: AUTH_PROVIDERS_VAULT,
|
|
31
|
+
scope: ProviderScope.GLOBAL,
|
|
32
|
+
name: "AuthProvidersVault",
|
|
33
|
+
useFactory: (logger) => new AuthProvidersVault(baseVault, options.namespace ?? "authproviders:", logger),
|
|
34
|
+
inject: () => [FrontMcpLogger]
|
|
35
|
+
});
|
|
36
|
+
providers.push({
|
|
37
|
+
provide: CREDENTIAL_CACHE,
|
|
38
|
+
scope: ProviderScope.CONTEXT,
|
|
39
|
+
name: "CredentialCache",
|
|
40
|
+
useFactory: () => new CredentialCache(options.maxCredentialsPerSession ?? 100)
|
|
41
|
+
});
|
|
42
|
+
providers.push({
|
|
43
|
+
provide: LAZY_CREDENTIAL_LOADER,
|
|
44
|
+
scope: ProviderScope.CONTEXT,
|
|
45
|
+
name: "LazyCredentialLoader",
|
|
46
|
+
useFactory: (logger) => new LazyCredentialLoader(logger),
|
|
47
|
+
inject: () => [FrontMcpLogger]
|
|
48
|
+
});
|
|
49
|
+
providers.push({
|
|
50
|
+
provide: AUTH_PROVIDERS_ACCESSOR,
|
|
51
|
+
scope: ProviderScope.CONTEXT,
|
|
52
|
+
name: "AuthProvidersAccessor",
|
|
53
|
+
useFactory: (registry, vault, cache, loader, ctx, logger) => {
|
|
54
|
+
const user = ctx.authInfo?.user;
|
|
55
|
+
const signedIn = user && !isAnonymousSubject(user.sub) ? user : void 0;
|
|
56
|
+
const factoryContext = {
|
|
57
|
+
sessionId: sessionScopeIdentity(ctx) ?? `unidentified:${randomUUID()}`,
|
|
58
|
+
userSub: signedIn?.sub,
|
|
59
|
+
userEmail: signedIn?.email,
|
|
60
|
+
userName: signedIn?.name,
|
|
61
|
+
// appId and toolId are not available in FrontMcpContext,
|
|
62
|
+
// they can be set by the tool flow when calling the accessor
|
|
63
|
+
vault: baseVault
|
|
64
|
+
};
|
|
65
|
+
return new AuthProvidersAccessorImpl(registry, vault, cache, loader, factoryContext, logger);
|
|
66
|
+
},
|
|
67
|
+
inject: () => [
|
|
68
|
+
AUTH_PROVIDERS_REGISTRY,
|
|
69
|
+
AUTH_PROVIDERS_VAULT,
|
|
70
|
+
CREDENTIAL_CACHE,
|
|
71
|
+
LAZY_CREDENTIAL_LOADER,
|
|
72
|
+
FRONTMCP_CONTEXT,
|
|
73
|
+
FrontMcpLogger
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
return providers;
|
|
77
|
+
}
|
|
78
|
+
function isAuthProvidersEnabled(options) {
|
|
79
|
+
if (options?.enabled === false) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
if (options?.enabled === true) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
return (options?.providers?.length ?? 0) > 0;
|
|
86
|
+
}
|
|
87
|
+
async function registerAuthProvidersVault(providers, options) {
|
|
88
|
+
if (!isAuthProvidersEnabled(options)) return;
|
|
89
|
+
await providers.addDynamicProviders(createAuthProvidersProviders(options, new InMemoryAuthorizationVault()));
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
LAZY_CREDENTIAL_LOADER,
|
|
93
|
+
createAuthProvidersProviders,
|
|
94
|
+
isAuthProvidersEnabled,
|
|
95
|
+
registerAuthProvidersVault
|
|
96
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// libs/sdk/src/auth/vault/unconfigured-auth-providers.ts
|
|
2
|
+
import { AuthProvidersNotConfiguredError } from "@frontmcp/auth";
|
|
3
|
+
function notConfigured(providerName) {
|
|
4
|
+
throw new AuthProvidersNotConfiguredError(providerName);
|
|
5
|
+
}
|
|
6
|
+
var unconfiguredAuthProviders = {
|
|
7
|
+
get: async (providerName) => notConfigured(providerName),
|
|
8
|
+
getMany: async (providerNames) => notConfigured(providerNames[0]),
|
|
9
|
+
headers: async (providerName) => notConfigured(providerName),
|
|
10
|
+
headersMany: async (providerNames) => notConfigured(providerNames[0]),
|
|
11
|
+
refresh: async (providerName) => notConfigured(providerName),
|
|
12
|
+
has: async () => false,
|
|
13
|
+
isRegistered: () => false,
|
|
14
|
+
invalidate: () => void 0,
|
|
15
|
+
invalidateAll: () => void 0,
|
|
16
|
+
listProviders: () => [],
|
|
17
|
+
listAvailable: async () => []
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
unconfiguredAuthProviders
|
|
21
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// libs/sdk/src/common/entries/scope.entry.ts
|
|
2
|
+
import { runListChangeBatch } from "../../surface/list-change-batch.mjs";
|
|
2
3
|
import { normalizeEntryPrefix, normalizeScopeBase } from "../utils/index.mjs";
|
|
3
4
|
import { BaseEntry } from "./base.entry.mjs";
|
|
4
5
|
var ScopeEntry = class extends BaseEntry {
|
|
@@ -30,17 +31,35 @@ var ScopeEntry = class extends BaseEntry {
|
|
|
30
31
|
await cb();
|
|
31
32
|
}
|
|
32
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Run `change`, such as a plugin swapping the entries it registered, and send connected clients one `list_changed`
|
|
36
|
+
* for each list it changed (tools, resources, prompts, skills) once it ends, also when it throws, instead of one per
|
|
37
|
+
* registry change. A change that undoes itself, such as a rollback, calls `batch.listsRestored()` so nothing is sent.
|
|
38
|
+
* A batch run inside another hands what it changed to the outer one. Changes made outside it, such as another
|
|
39
|
+
* request's, are sent as they happen.
|
|
40
|
+
*/
|
|
41
|
+
batchListChanges(change) {
|
|
42
|
+
return runListChangeBatch(this, change);
|
|
43
|
+
}
|
|
33
44
|
addedHealthProbes = [];
|
|
34
45
|
/**
|
|
35
46
|
* Add a check to the server's `/readyz` readiness probe, run with the built-in ones and the
|
|
36
|
-
* `health.probes` the server configures.
|
|
37
|
-
*
|
|
47
|
+
* `health.probes` the server configures. A check added at any time, while the server starts or after it,
|
|
48
|
+
* runs from the next `/readyz` on; a check already running finishes with the checks it started with.
|
|
49
|
+
* Two checks with one name both run, and `/readyz` shows the later one's result.
|
|
50
|
+
*
|
|
51
|
+
* @returns A function that removes the check.
|
|
38
52
|
*/
|
|
39
53
|
registerHealthProbe(probe) {
|
|
40
|
-
|
|
54
|
+
const registration = { name: probe.name, check: () => probe.check() };
|
|
55
|
+
this.addedHealthProbes.push(registration);
|
|
56
|
+
return () => {
|
|
57
|
+
const index = this.addedHealthProbes.indexOf(registration);
|
|
58
|
+
if (index !== -1) this.addedHealthProbes.splice(index, 1);
|
|
59
|
+
};
|
|
41
60
|
}
|
|
42
61
|
/**
|
|
43
|
-
* The checks added with registerHealthProbe().
|
|
62
|
+
* The checks added with registerHealthProbe() and not removed. The health service reads it at every check.
|
|
44
63
|
* @internal
|
|
45
64
|
*/
|
|
46
65
|
get healthProbes() {
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
providerHeadersCredentials
|
|
7
7
|
} from "@frontmcp/auth";
|
|
8
8
|
import { getRuntimeContext, randomUUID } from "@frontmcp/utils";
|
|
9
|
+
import { unconfiguredAuthProviders } from "../../auth/vault/unconfigured-auth-providers.mjs";
|
|
9
10
|
import { ConfigService } from "../../builtin/config/providers/config.service.mjs";
|
|
10
11
|
import { FRONTMCP_CONTEXT } from "../../context/index.mjs";
|
|
11
12
|
import { workerEnvOf } from "../../context/frontmcp-context-storage.mjs";
|
|
@@ -188,6 +189,10 @@ var ExecutionContextBase = class {
|
|
|
188
189
|
return void 0;
|
|
189
190
|
}
|
|
190
191
|
}
|
|
192
|
+
/** The credentials of the providers `@FrontMcp({ authProvidersVault })` registers, read for the current caller. */
|
|
193
|
+
get authProviders() {
|
|
194
|
+
return this.tryGet(AUTH_PROVIDERS_ACCESSOR) ?? unconfiguredAuthProviders;
|
|
195
|
+
}
|
|
191
196
|
/**
|
|
192
197
|
* Invoke another registered tool from inside the current execution context.
|
|
193
198
|
*
|
|
@@ -6,6 +6,8 @@ var ServerRequest = class extends IncomingMessage {
|
|
|
6
6
|
/** Path parameters of the matched route (`:providerId` in `/oauth/provider/:providerId/callback`). */
|
|
7
7
|
params;
|
|
8
8
|
body;
|
|
9
|
+
/** The bytes `body` was parsed from, as received: for a check over the exact body, such as a digest. */
|
|
10
|
+
bodyBytes;
|
|
9
11
|
authSession;
|
|
10
12
|
};
|
|
11
13
|
var ServerResponse = class extends HttpServerResponse {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// libs/sdk/src/common/metadata/front-mcp.metadata.ts
|
|
2
|
+
import { authProvidersVaultOptionsSchema } from "@frontmcp/auth";
|
|
2
3
|
import { guardConfigSchema } from "@frontmcp/guard";
|
|
3
4
|
import { internalZ as z } from "@frontmcp/lazy-zod";
|
|
4
5
|
import { MAX_CONCURRENT_TASKS_PER_SESSION } from "../../task/task.types.mjs";
|
|
@@ -60,6 +61,7 @@ var frontMcpBaseSchema = z.object({
|
|
|
60
61
|
instructionsBudget: instructionsBudgetOptionsSchema.optional(),
|
|
61
62
|
manifest: serverManifestOptionSchema.optional(),
|
|
62
63
|
providers: z.array(annotatedFrontMcpProvidersSchema).optional().default([]),
|
|
64
|
+
authProvidersVault: authProvidersVaultOptionsSchema.optional(),
|
|
63
65
|
lifecycle: lifecycleOptionsSchema.optional(),
|
|
64
66
|
offload: offloadOptionsSchema.optional(),
|
|
65
67
|
devtools: devtoolsOptionsSchema.optional(),
|
|
@@ -242,6 +244,7 @@ var frontMcpLiteSchema = z.object({
|
|
|
242
244
|
instructionsBudget: instructionsBudgetOptionsSchema.optional(),
|
|
243
245
|
manifest: serverManifestOptionSchema.optional(),
|
|
244
246
|
providers: z.array(annotatedFrontMcpProvidersSchema).optional().default([]),
|
|
247
|
+
authProvidersVault: authProvidersVaultOptionsSchema.optional(),
|
|
245
248
|
lifecycle: lifecycleOptionsSchema.optional(),
|
|
246
249
|
offload: offloadOptionsSchema.optional(),
|
|
247
250
|
devtools: devtoolsOptionsSchema.optional(),
|
|
@@ -21,6 +21,7 @@ var FrontMcpTokens = {
|
|
|
21
21
|
logging: tokenFactory.meta("logging"),
|
|
22
22
|
// global scoped providers
|
|
23
23
|
providers: tokenFactory.meta("providers"),
|
|
24
|
+
authProvidersVault: tokenFactory.meta("authProvidersVault"),
|
|
24
25
|
// provider lifecycle hooks (onShutdown timeout)
|
|
25
26
|
lifecycle: tokenFactory.meta("lifecycle"),
|
|
26
27
|
offload: tokenFactory.meta("offload"),
|
|
@@ -318,7 +318,7 @@ var DirectClientImpl = class _DirectClientImpl {
|
|
|
318
318
|
* Response is validated using `SkillsLoadResultSchema`.
|
|
319
319
|
*/
|
|
320
320
|
async loadSkills(skillIds, options) {
|
|
321
|
-
|
|
321
|
+
const result = await this.mcpClient.request(
|
|
322
322
|
{
|
|
323
323
|
method: "skills/load",
|
|
324
324
|
params: {
|
|
@@ -328,6 +328,7 @@ var DirectClientImpl = class _DirectClientImpl {
|
|
|
328
328
|
},
|
|
329
329
|
SkillsLoadResultSchema
|
|
330
330
|
);
|
|
331
|
+
return result;
|
|
331
332
|
}
|
|
332
333
|
/**
|
|
333
334
|
* List available skills with optional filtering and pagination.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// libs/sdk/src/direct/token-auth-info.ts
|
|
2
2
|
import { isAnonymousSubject } from "@frontmcp/auth";
|
|
3
|
+
import { DirectPublicAuth } from "../auth/direct-public-auth.mjs";
|
|
3
4
|
import {
|
|
4
5
|
authInfoFromAuthorization,
|
|
5
6
|
normalizeEntryPrefix,
|
|
@@ -7,6 +8,7 @@ import {
|
|
|
7
8
|
} from "../common/index.mjs";
|
|
8
9
|
import { PublicMcpError, SessionVerificationFailedError, UnauthorizedError } from "../errors/index.mjs";
|
|
9
10
|
async function authInfoForToken(scope, token) {
|
|
11
|
+
if (scope.auth instanceof DirectPublicAuth) return {};
|
|
10
12
|
const mcpPath = `${normalizeEntryPrefix(scope.entryPath)}${normalizeScopeBase(scope.routeBase)}` || "/";
|
|
11
13
|
const request = {
|
|
12
14
|
method: "POST",
|
|
@@ -31,13 +31,16 @@ async function performElicit(deps, message, requestedSchema, options) {
|
|
|
31
31
|
}
|
|
32
32
|
if (mrtr) {
|
|
33
33
|
const zodSchema = requestedSchema instanceof z.ZodType ? requestedSchema : z.object(requestedSchema);
|
|
34
|
-
const answer2 = mrtr.resolveElicitation(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
const answer2 = mrtr.resolveElicitation(
|
|
35
|
+
{
|
|
36
|
+
message,
|
|
37
|
+
requestedSchema: toJSONSchema(zodSchema),
|
|
38
|
+
...elicitOptions?.mode ? { mode: elicitOptions.mode } : {},
|
|
39
|
+
...elicitOptions?.url ? { url: elicitOptions.url } : {},
|
|
40
|
+
...elicitOptions?.elicitationId ? { elicitationId: elicitOptions.elicitationId } : {}
|
|
41
|
+
},
|
|
42
|
+
deps.inputKey
|
|
43
|
+
);
|
|
41
44
|
if (answer2.status !== "accept") {
|
|
42
45
|
return answer2;
|
|
43
46
|
}
|
package/browser/errors/index.mjs
CHANGED
|
@@ -260,7 +260,7 @@ import {
|
|
|
260
260
|
CallRecorderConfigurationError
|
|
261
261
|
} from "./sdk.errors.mjs";
|
|
262
262
|
export { DynamicJobRegistrationDisabledError, JobAdmissionTimeoutError, JobCancelledError, JobInterruptedError, JobNotAuthorizedError, JobRunFinishedError, JobRunNotCancellableError, JobRunNotFoundError, JobRunnerBootError, JobRunnerUnavailableError, JobStoreNotSupportedError, JobTimeoutError } from "./job.errors.mjs";
|
|
263
|
-
export { DuplicatePluginError, UnenforcedMetadataError } from "./plugin.errors.mjs";
|
|
263
|
+
export { DuplicatePluginEntryError, DuplicatePluginError, PluginConfiguredTwiceError, UnenforcedMetadataError } from "./plugin.errors.mjs";
|
|
264
264
|
export {
|
|
265
265
|
AgentCallDepthExceededError,
|
|
266
266
|
AgentConfigKeyNotFoundError,
|
|
@@ -7,7 +7,9 @@ var MISCONFIGURATION_REMEDIES = {
|
|
|
7
7
|
UNENFORCED_METADATA: "An entry declares a field only a plugin enforces (approval, featureFlag, ...) and no installed plugin that enforces it reaches the entry, so the server refuses to start. Install the plugin or remove the field; the server log names the entries.",
|
|
8
8
|
AUTH_CONFIGURATION_ERROR: "The auth or authorities configuration is invalid (for example, entries declare authorities and the server has no authorities option, or a rule checks nothing), so the server refuses to start. The server log names the entries.",
|
|
9
9
|
TOOL_ALIAS_CONFLICT: "A tool alias (`@Tool({ aliases })`) is also the name of a tool or the alias of another tool, so the server refuses to start. Give each alias to one tool; the server log names the conflicts.",
|
|
10
|
-
DUPLICATE_PLUGIN: "A plugin that can be installed once per server is installed twice (in one plugins list, or by the server and an app, or by two apps), so the server refuses to start. Install it once; the server log names the plugin."
|
|
10
|
+
DUPLICATE_PLUGIN: "A plugin that can be installed once per server is installed twice (in one plugins list, or by the server and an app, or by two apps), so the server refuses to start. Install it once; the server log names the plugin.",
|
|
11
|
+
DUPLICATE_PLUGIN_ENTRY: "One plugins list names a plugin twice, so the server refuses to start. List it once with all its options, or install the other configuration on another app; the server log names the plugin, the list and both entries.",
|
|
12
|
+
PLUGIN_CONFIGURED_TWICE: "A server option (such as `observability`) installs a plugin that the server plugins list names too, so the server refuses to start. Configure the plugin in one place; the server log names the option and the plugin."
|
|
11
13
|
};
|
|
12
14
|
function findMisconfiguration(error) {
|
|
13
15
|
let current = error;
|