@frontmcp/sdk 1.2.1 → 1.4.0
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 +65 -60
- package/agent/agent.scope.d.ts +164 -0
- package/agent/agent.scope.d.ts.map +1 -1
- package/app/instances/app.esm.instance.d.ts.map +1 -1
- package/app/instances/app.remote.instance.d.ts.map +1 -1
- package/auth/auth-ui/auth-ui.contract.d.ts +149 -0
- package/auth/auth-ui/auth-ui.contract.d.ts.map +1 -0
- package/auth/auth-ui/auth-ui.registry.d.ts +151 -0
- package/auth/auth-ui/auth-ui.registry.d.ts.map +1 -0
- package/auth/auth-ui/auth-ui.render.d.ts +49 -0
- package/auth/auth-ui/auth-ui.render.d.ts.map +1 -0
- package/auth/auth-ui/auth-ui.state.d.ts +62 -0
- package/auth/auth-ui/auth-ui.state.d.ts.map +1 -0
- package/auth/auth-ui/index.d.ts +24 -0
- package/auth/auth-ui/index.d.ts.map +1 -0
- package/auth/auth.registry.d.ts.map +1 -1
- package/auth/authorized-apps.utils.d.ts +51 -0
- package/auth/authorized-apps.utils.d.ts.map +1 -0
- package/auth/consent-tools.helper.d.ts +26 -0
- package/auth/consent-tools.helper.d.ts.map +1 -0
- package/auth/consent.utils.d.ts +62 -0
- package/auth/consent.utils.d.ts.map +1 -0
- package/auth/credentials/credentials.context-extension.d.ts +63 -0
- package/auth/credentials/credentials.context-extension.d.ts.map +1 -0
- package/auth/credentials/credentials.providers.d.ts +40 -0
- package/auth/credentials/credentials.providers.d.ts.map +1 -0
- package/auth/credentials/index.d.ts +3 -0
- package/auth/credentials/index.d.ts.map +1 -0
- package/auth/flows/auth.verify.flow.d.ts.map +1 -1
- package/auth/flows/oauth.auth-ui.flow.d.ts +53 -0
- package/auth/flows/oauth.auth-ui.flow.d.ts.map +1 -0
- package/auth/flows/oauth.authorize.flow.d.ts +51 -9
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts +118 -5
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.connect.flow.d.ts +89 -0
- package/auth/flows/oauth.connect.flow.d.ts.map +1 -0
- package/auth/flows/oauth.provider-callback.flow.d.ts +34 -4
- package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.register.flow.d.ts +16 -20
- package/auth/flows/oauth.register.flow.d.ts.map +1 -1
- package/auth/flows/oauth.token.flow.d.ts +2 -2
- package/auth/flows/oauth.token.flow.d.ts.map +1 -1
- package/auth/flows/oauth.userinfo.flow.d.ts +67 -0
- package/auth/flows/oauth.userinfo.flow.d.ts.map +1 -0
- package/auth/flows/session.verify.flow.d.ts +2 -2
- package/auth/flows/session.verify.flow.d.ts.map +1 -1
- package/auth/flows/well-known.jwks.flow.d.ts +3 -3
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts +3 -2
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts.map +1 -1
- package/auth/flows/well-known.prm.flow.d.ts +1 -1
- package/auth/flows/well-known.prm.flow.d.ts.map +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +226 -12
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/secure-store/index.d.ts +3 -0
- package/auth/secure-store/index.d.ts.map +1 -0
- package/auth/secure-store/secure-store.context-extension.d.ts +61 -0
- package/auth/secure-store/secure-store.context-extension.d.ts.map +1 -0
- package/auth/secure-store/secure-store.providers.d.ts +36 -0
- package/auth/secure-store/secure-store.providers.d.ts.map +1 -0
- package/auth/session/session-store.factory.d.ts +25 -5
- package/auth/session/session-store.factory.d.ts.map +1 -1
- package/common/decorators/agent.decorator.d.ts +32 -0
- package/common/decorators/agent.decorator.d.ts.map +1 -1
- package/common/decorators/app.decorator.d.ts.map +1 -1
- package/common/decorators/front-mcp.decorator.d.ts.map +1 -1
- package/common/decorators/skill.decorator.d.ts +26 -9
- package/common/decorators/skill.decorator.d.ts.map +1 -1
- package/common/decorators/tool.decorator.d.ts +44 -0
- package/common/decorators/tool.decorator.d.ts.map +1 -1
- package/common/entries/scope.entry.d.ts +7 -0
- package/common/entries/scope.entry.d.ts.map +1 -1
- package/common/entries/skill.entry.d.ts +22 -1
- package/common/entries/skill.entry.d.ts.map +1 -1
- package/common/entries/tool.entry.d.ts +17 -0
- package/common/entries/tool.entry.d.ts.map +1 -1
- package/common/interfaces/internal/primary-auth-provider.interface.d.ts +18 -0
- package/common/interfaces/internal/primary-auth-provider.interface.d.ts.map +1 -1
- package/common/interfaces/skill.interface.d.ts +17 -4
- package/common/interfaces/skill.interface.d.ts.map +1 -1
- package/common/interfaces/tool.interface.d.ts +26 -0
- package/common/interfaces/tool.interface.d.ts.map +1 -1
- package/common/metadata/agent.metadata.d.ts +10 -0
- package/common/metadata/agent.metadata.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +472 -0
- package/common/metadata/app.metadata.d.ts.map +1 -1
- package/common/metadata/channel.metadata.d.ts +10 -0
- package/common/metadata/channel.metadata.d.ts.map +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +2103 -49
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/metadata/index.d.ts +1 -0
- package/common/metadata/index.d.ts.map +1 -1
- package/common/metadata/output-policy.d.ts +82 -0
- package/common/metadata/output-policy.d.ts.map +1 -0
- package/common/metadata/prompt.metadata.d.ts +10 -0
- package/common/metadata/prompt.metadata.d.ts.map +1 -1
- package/common/metadata/resource.metadata.d.ts +20 -0
- package/common/metadata/resource.metadata.d.ts.map +1 -1
- package/common/metadata/skill.metadata.d.ts +55 -1
- package/common/metadata/skill.metadata.d.ts.map +1 -1
- package/common/metadata/tool-ui.metadata.d.ts +1 -1
- package/common/metadata/tool-ui.metadata.d.ts.map +1 -1
- package/common/metadata/tool.metadata.d.ts +75 -0
- package/common/metadata/tool.metadata.d.ts.map +1 -1
- package/common/records/skill.record.d.ts +2 -0
- package/common/records/skill.record.d.ts.map +1 -1
- package/common/schemas/http-output.schema.d.ts +25 -25
- package/common/schemas/http-output.schema.d.ts.map +1 -1
- package/common/tokens/app.tokens.d.ts.map +1 -1
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/tokens/skill.tokens.d.ts +10 -0
- package/common/tokens/skill.tokens.d.ts.map +1 -1
- package/common/tokens/tool.tokens.d.ts +1 -0
- package/common/tokens/tool.tokens.d.ts.map +1 -1
- package/common/types/auth/session.types.d.ts +2 -2
- package/common/types/options/auth/index.d.ts +4 -4
- package/common/types/options/auth/index.d.ts.map +1 -1
- package/common/types/options/auth/interfaces.d.ts +1 -1
- package/common/types/options/auth/interfaces.d.ts.map +1 -1
- package/common/types/options/auth/orchestrated.schema.d.ts +1 -1
- package/common/types/options/auth/orchestrated.schema.d.ts.map +1 -1
- package/common/types/options/auth/shared.schemas.d.ts +2 -2
- package/common/types/options/auth/shared.schemas.d.ts.map +1 -1
- package/common/types/options/http/index.d.ts +1 -1
- package/common/types/options/http/index.d.ts.map +1 -1
- package/common/types/options/http/interfaces.d.ts +88 -1
- package/common/types/options/http/interfaces.d.ts.map +1 -1
- package/common/types/options/http/schema.d.ts +17 -0
- package/common/types/options/http/schema.d.ts.map +1 -1
- package/common/types/options/index.d.ts +1 -0
- package/common/types/options/index.d.ts.map +1 -1
- package/common/types/options/metrics/index.d.ts +3 -0
- package/common/types/options/metrics/index.d.ts.map +1 -0
- package/common/types/options/metrics/interfaces.d.ts +154 -0
- package/common/types/options/metrics/interfaces.d.ts.map +1 -0
- package/common/types/options/metrics/schema.d.ts +33 -0
- package/common/types/options/metrics/schema.d.ts.map +1 -0
- package/common/types/options/session/schema.d.ts +3 -3
- package/common/types/options/sqlite/index.d.ts +2 -0
- package/common/types/options/sqlite/index.d.ts.map +1 -1
- package/common/types/options/sqlite/interfaces.d.ts +7 -2
- package/common/types/options/sqlite/interfaces.d.ts.map +1 -1
- package/common/types/options/sqlite/resolve.d.ts +29 -0
- package/common/types/options/sqlite/resolve.d.ts.map +1 -0
- package/common/types/options/sqlite/schema.d.ts +1 -1
- package/common/types/options/sqlite/schema.d.ts.map +1 -1
- package/common/types/options/transport/interfaces.d.ts +23 -7
- package/common/types/options/transport/interfaces.d.ts.map +1 -1
- package/common/types/options/transport/schema.d.ts +24 -5
- package/common/types/options/transport/schema.d.ts.map +1 -1
- package/common/utils/caller-dir.utils.d.ts +15 -0
- package/common/utils/caller-dir.utils.d.ts.map +1 -0
- package/common/utils/index.d.ts +1 -0
- package/common/utils/index.d.ts.map +1 -1
- package/direct/client.types.d.ts +10 -0
- package/direct/client.types.d.ts.map +1 -1
- package/elicitation/store/elicitation-store.factory.d.ts +19 -5
- package/elicitation/store/elicitation-store.factory.d.ts.map +1 -1
- package/errors/index.d.ts +4 -2
- package/errors/index.d.ts.map +1 -1
- package/errors/mcp.error.d.ts +79 -4
- package/errors/mcp.error.d.ts.map +1 -1
- package/errors/sdk.errors.d.ts +13 -0
- package/errors/sdk.errors.d.ts.map +1 -1
- package/errors/tool-credentials-required.error.d.ts +70 -0
- package/errors/tool-credentials-required.error.d.ts.map +1 -0
- package/esm/index.mjs +7689 -3080
- package/flows/flow.instance.d.ts.map +1 -1
- package/front-mcp/front-mcp.d.ts +61 -32
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/front-mcp/front-mcp.providers.d.ts +804 -12
- package/front-mcp/front-mcp.providers.d.ts.map +1 -1
- package/index.d.ts +35 -8
- package/index.d.ts.map +1 -1
- package/index.js +8264 -3675
- package/job/index.d.ts +1 -0
- package/job/index.d.ts.map +1 -1
- package/metrics/index.d.ts +4 -0
- package/metrics/index.d.ts.map +1 -0
- package/metrics/metrics.errors.d.ts +18 -0
- package/metrics/metrics.errors.d.ts.map +1 -0
- package/metrics/metrics.routes.d.ts +30 -0
- package/metrics/metrics.routes.d.ts.map +1 -0
- package/metrics/metrics.service.d.ts +66 -0
- package/metrics/metrics.service.d.ts.map +1 -0
- package/package.json +30 -11
- package/prompt/prompt.registry.d.ts +5 -0
- package/prompt/prompt.registry.d.ts.map +1 -1
- package/resource/resource.registry.d.ts +5 -0
- package/resource/resource.registry.d.ts.map +1 -1
- package/scope/flows/http.request.flow.d.ts +18 -1
- package/scope/flows/http.request.flow.d.ts.map +1 -1
- package/scope/optional-dependency.util.d.ts +39 -0
- package/scope/optional-dependency.util.d.ts.map +1 -0
- package/scope/scope.instance.d.ts +30 -0
- package/scope/scope.instance.d.ts.map +1 -1
- package/scope/scope.utils.d.ts.map +1 -1
- package/server/adapters/express.host.adapter.d.ts +16 -0
- package/server/adapters/express.host.adapter.d.ts.map +1 -1
- package/server/adapters/polyfills/browser-express-host.d.ts +3 -0
- package/server/adapters/polyfills/browser-express-host.d.ts.map +1 -1
- package/server/adapters/polyfills/node-express-host.d.ts +1 -1
- package/server/adapters/polyfills/node-express-host.d.ts.map +1 -1
- package/server/custom-routes.helper.d.ts +81 -0
- package/server/custom-routes.helper.d.ts.map +1 -0
- package/server/server.instance.d.ts +16 -0
- package/server/server.instance.d.ts.map +1 -1
- package/skill/flows/http/llm-full-txt.flow.d.ts +1 -1
- package/skill/flows/http/llm-txt.flow.d.ts +1 -1
- package/skill/flows/http/skills-api.flow.d.ts +18 -1
- package/skill/flows/http/skills-api.flow.d.ts.map +1 -1
- package/skill/flows/load-skill.flow.d.ts +7 -0
- package/skill/flows/load-skill.flow.d.ts.map +1 -1
- package/skill/flows/search-skills.flow.d.ts +13 -0
- 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-file.resource.d.ts.map +1 -1
- package/skill/sep-2640/resources/skill-index.resource.d.ts.map +1 -1
- package/skill/sep-2640/resources/skill-md.resource.d.ts.map +1 -1
- package/skill/sep-2640/sep-2640.per-skill.d.ts.map +1 -1
- package/skill/skill-authorities.helper.d.ts +100 -0
- package/skill/skill-authorities.helper.d.ts.map +1 -0
- package/skill/skill.instance.d.ts.map +1 -1
- package/skill/skill.registry.d.ts +34 -0
- package/skill/skill.registry.d.ts.map +1 -1
- package/skill/skill.utils.d.ts.map +1 -1
- package/task/helpers/cli-task-runner.d.ts.map +1 -1
- package/tool/flows/call-tool.flow.d.ts +26 -1
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tool-credentials.gate.d.ts +31 -0
- package/tool/flows/tool-credentials.gate.d.ts.map +1 -0
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- package/tool/tool.instance.d.ts.map +1 -1
- package/tool/tool.registry.d.ts +6 -0
- package/tool/tool.registry.d.ts.map +1 -1
- package/tool/ui/index.d.ts +1 -1
- package/tool/ui/index.d.ts.map +1 -1
- package/tool/ui/ui-resource.handler.d.ts.map +1 -1
- package/tool/ui/ui-shared.d.ts +33 -1
- package/tool/ui/ui-shared.d.ts.map +1 -1
- package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
- package/transport/event-stores/event-store.factory.d.ts.map +1 -1
- package/transport/flows/handle.sse.flow.d.ts +1 -1
- package/transport/flows/handle.streamable-http.flow.d.ts +58 -1
- package/transport/flows/handle.streamable-http.flow.d.ts.map +1 -1
- package/transport/mcp-handlers/call-tool-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/index.d.ts.map +1 -1
- package/transport/mcp-handlers/read-resource-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-list-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-load-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-search-request.handler.d.ts.map +1 -1
- package/transport/transport.registry.d.ts +24 -3
- package/transport/transport.registry.d.ts.map +1 -1
- package/workflow/index.d.ts +1 -0
- package/workflow/index.d.ts.map +1 -1
package/job/index.d.ts
CHANGED
package/job/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/job/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/job/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAI1B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { MetricsService, createProcessStatsCollectorIfEnabled, type MetricsResponse, type MetricsServiceOptions, } from './metrics.service';
|
|
2
|
+
export { registerMetricsRoutes, type MetricsRouteServer, type MetricsResponseLike } from './metrics.routes';
|
|
3
|
+
export { MetricsPathConflictError, MetricsTokenNotConfiguredError } from './metrics.errors';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metrics/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,oCAAoC,EACpC,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5G,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InternalMcpError } from '../errors/mcp.error';
|
|
2
|
+
/**
|
|
3
|
+
* Raised when `metrics.path` collides with an MCP transport route prefix
|
|
4
|
+
* (`/mcp`, `/sse`, `/messages`).
|
|
5
|
+
*/
|
|
6
|
+
export declare class MetricsPathConflictError extends InternalMcpError {
|
|
7
|
+
readonly conflictingPath: string;
|
|
8
|
+
constructor(conflictingPath: string);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Raised when `metrics.auth === 'token'` is configured but the env var
|
|
12
|
+
* named by `metrics.tokenEnv` is unset.
|
|
13
|
+
*/
|
|
14
|
+
export declare class MetricsTokenNotConfiguredError extends InternalMcpError {
|
|
15
|
+
readonly tokenEnv: string;
|
|
16
|
+
constructor(tokenEnv: string);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=metrics.errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.errors.d.ts","sourceRoot":"","sources":["../../src/metrics/metrics.errors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,gBAAgB;IAC5D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;gBAErB,eAAe,EAAE,MAAM;CAOpC;AAED;;;GAGG;AACH,qBAAa,8BAA+B,SAAQ,gBAAgB;IAClE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,QAAQ,EAAE,MAAM;CAO7B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file metrics.routes.ts
|
|
3
|
+
* @description HTTP route registration for the `/metrics` endpoint (issue #397).
|
|
4
|
+
*/
|
|
5
|
+
import type { MetricsOptionsInterface } from '../common';
|
|
6
|
+
import type { MetricsService } from './metrics.service';
|
|
7
|
+
/**
|
|
8
|
+
* Minimal server interface for route registration. Mirrors `HealthRouteServer`
|
|
9
|
+
* to avoid importing the full `FrontMcpServerInstance` (circular dependencies).
|
|
10
|
+
*/
|
|
11
|
+
export interface MetricsRouteServer {
|
|
12
|
+
registerRoute(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD', path: string, handler: (req: {
|
|
13
|
+
headers?: Record<string, string | string[] | undefined>;
|
|
14
|
+
}, res: MetricsResponseLike) => Promise<void> | void): void;
|
|
15
|
+
}
|
|
16
|
+
/** Subset of the Express-style response object the route uses. */
|
|
17
|
+
export interface MetricsResponseLike {
|
|
18
|
+
status(code: number): MetricsResponseLike;
|
|
19
|
+
setHeader?(name: string, value: string): MetricsResponseLike | void;
|
|
20
|
+
type?(contentType: string): MetricsResponseLike;
|
|
21
|
+
send?(body: string): MetricsResponseLike | void;
|
|
22
|
+
json(payload: unknown): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Register the `GET <path>` metrics endpoint. No-op when the config has
|
|
26
|
+
* `enabled !== true` — callers should already have gated this call but the
|
|
27
|
+
* extra guard keeps `prepare()` simple.
|
|
28
|
+
*/
|
|
29
|
+
export declare function registerMetricsRoutes(server: MetricsRouteServer, service: MetricsService, config: MetricsOptionsInterface): void;
|
|
30
|
+
//# sourceMappingURL=metrics.routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.routes.d.ts","sourceRoot":"","sources":["../../src/metrics/metrics.routes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,CACX,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,EACxE,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CACP,GAAG,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAA;KAAE,EAChE,GAAG,EAAE,mBAAmB,KACrB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GACxB,IAAI,CAAC;CACT;AAED,kEAAkE;AAClE,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAC1C,SAAS,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAAC;IACpE,IAAI,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAChD,IAAI,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAWD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,uBAAuB,GAC9B,IAAI,CAkDN"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file metrics.service.ts
|
|
3
|
+
* @description Core service backing the `/metrics` endpoint (issue #397).
|
|
4
|
+
*/
|
|
5
|
+
import type { MetricsOptionsInterface } from '../common';
|
|
6
|
+
interface CounterSnapshotEntry {
|
|
7
|
+
name: string;
|
|
8
|
+
count: number;
|
|
9
|
+
attributes: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
interface GaugeSnapshotEntry {
|
|
12
|
+
name: string;
|
|
13
|
+
value: number;
|
|
14
|
+
attributes?: Record<string, string>;
|
|
15
|
+
help?: string;
|
|
16
|
+
}
|
|
17
|
+
interface ProcessStatsCollector {
|
|
18
|
+
collect(): GaugeSnapshotEntry[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Lazily build a `ProcessStatsCollector` when the metrics config selects the
|
|
22
|
+
* `process` category (or omits `include` entirely, which means "every
|
|
23
|
+
* category"). Returns `undefined` when process metrics are filtered out so
|
|
24
|
+
* the per-scrape `process.cpuUsage()` / `monitorEventLoopDelay()` calls don't
|
|
25
|
+
* run for nothing.
|
|
26
|
+
*
|
|
27
|
+
* Uses the same lazy `require('@frontmcp/observability')` as the snapshot
|
|
28
|
+
* source so the SDK ↔ observability import cycle stays broken at module
|
|
29
|
+
* init.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createProcessStatsCollectorIfEnabled(config: MetricsOptionsInterface): ProcessStatsCollector | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Resolved metrics body + content type, returned by `getMetrics()`.
|
|
34
|
+
*/
|
|
35
|
+
export interface MetricsResponse {
|
|
36
|
+
contentType: string;
|
|
37
|
+
body: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Test-injection seam for the counter snapshot source — production callers
|
|
41
|
+
* never set this.
|
|
42
|
+
*/
|
|
43
|
+
export interface MetricsServiceOptions {
|
|
44
|
+
snapshotSource?: () => CounterSnapshotEntry[];
|
|
45
|
+
}
|
|
46
|
+
export declare class MetricsService {
|
|
47
|
+
private readonly config;
|
|
48
|
+
private readonly processCollector?;
|
|
49
|
+
private readonly snapshotSource;
|
|
50
|
+
private readonly resolvedToken?;
|
|
51
|
+
constructor(config: MetricsOptionsInterface, processCollector?: ProcessStatsCollector, options?: MetricsServiceOptions);
|
|
52
|
+
/**
|
|
53
|
+
* Render the current metrics scrape in the configured format.
|
|
54
|
+
*/
|
|
55
|
+
getMetrics(): MetricsResponse;
|
|
56
|
+
/**
|
|
57
|
+
* Check the supplied `Authorization` header against the configured auth
|
|
58
|
+
* policy. Returns the HTTP status the route should respond with:
|
|
59
|
+
* - 200 — the request is allowed to read metrics
|
|
60
|
+
* - 401 — missing credentials when token auth is configured
|
|
61
|
+
* - 403 — wrong credentials
|
|
62
|
+
*/
|
|
63
|
+
authorize(authorizationHeader: string | undefined): 200 | 401 | 403;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=metrics.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.service.d.ts","sourceRoot":"","sources":["../../src/metrics/metrics.service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAmB,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAQ1E,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,qBAAqB;IAC7B,OAAO,IAAI,kBAAkB,EAAE,CAAC;CACjC;AAwCD;;;;;;;;;;GAUG;AACH,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,uBAAuB,GAC9B,qBAAqB,GAAG,SAAS,CAMnC;AAgBD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,cAAc,CAAC,EAAE,MAAM,oBAAoB,EAAE,CAAC;CAC/C;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IACjD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAwB;IAC1D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA+B;IAC9D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAS;gBAGtC,MAAM,EAAE,uBAAuB,EAC/B,gBAAgB,CAAC,EAAE,qBAAqB,EACxC,OAAO,GAAE,qBAA0B;IAyBrC;;OAEG;IACH,UAAU,IAAI,eAAe;IAgC7B;;;;;;OAMG;IACH,SAAS,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG;CAUpE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "FrontMCP SDK",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://docs.agentfront.dev",
|
|
@@ -60,22 +60,41 @@
|
|
|
60
60
|
"default": "./esm/transport/index.mjs"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
+
"./job/tools": {
|
|
64
|
+
"require": {
|
|
65
|
+
"types": "./job/tools/index.d.ts",
|
|
66
|
+
"default": "./job/tools/index.js"
|
|
67
|
+
},
|
|
68
|
+
"import": {
|
|
69
|
+
"types": "./job/tools/index.d.ts",
|
|
70
|
+
"default": "./esm/job/tools/index.mjs"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"./workflow/tools": {
|
|
74
|
+
"require": {
|
|
75
|
+
"types": "./workflow/tools/index.d.ts",
|
|
76
|
+
"default": "./workflow/tools/index.js"
|
|
77
|
+
},
|
|
78
|
+
"import": {
|
|
79
|
+
"types": "./workflow/tools/index.d.ts",
|
|
80
|
+
"default": "./esm/workflow/tools/index.mjs"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
63
83
|
"./esm": null
|
|
64
84
|
},
|
|
65
85
|
"engines": {
|
|
66
86
|
"node": ">=24.0.0"
|
|
67
87
|
},
|
|
68
88
|
"peerDependencies": {
|
|
69
|
-
"zod": "^4.0.0",
|
|
70
89
|
"express": "^4.18.0 || ^5.0.0",
|
|
71
90
|
"cors": "^2.8.5",
|
|
72
91
|
"raw-body": "^3.0.0",
|
|
73
92
|
"content-type": "^1.0.5",
|
|
74
93
|
"@vercel/kv": "^3.0.0",
|
|
75
|
-
"@frontmcp/storage-sqlite": "1.
|
|
94
|
+
"@frontmcp/storage-sqlite": "1.4.0",
|
|
76
95
|
"openai": "^4.0.0 || ^5.0.0 || ^6.0.0",
|
|
77
96
|
"@anthropic-ai/sdk": "^0.30.0 || ^0.78.0",
|
|
78
|
-
"@frontmcp/observability": "1.
|
|
97
|
+
"@frontmcp/observability": "1.4.0",
|
|
79
98
|
"@enclave-vm/core": "^2.13.0",
|
|
80
99
|
"vectoriadb": "^2.2.0",
|
|
81
100
|
"@opentelemetry/api": "^1.9.0",
|
|
@@ -112,13 +131,13 @@
|
|
|
112
131
|
},
|
|
113
132
|
"dependencies": {
|
|
114
133
|
"@types/cors": "^2.8.17",
|
|
115
|
-
"@frontmcp/utils": "1.
|
|
116
|
-
"@frontmcp/guard": "1.
|
|
117
|
-
"@frontmcp/di": "1.
|
|
118
|
-
"@frontmcp/lazy-zod": "1.
|
|
119
|
-
"@frontmcp/uipack": "1.
|
|
120
|
-
"@frontmcp/auth": "1.
|
|
121
|
-
"@frontmcp/protocol": "1.
|
|
134
|
+
"@frontmcp/utils": "1.4.0",
|
|
135
|
+
"@frontmcp/guard": "1.4.0",
|
|
136
|
+
"@frontmcp/di": "1.4.0",
|
|
137
|
+
"@frontmcp/lazy-zod": "1.4.0",
|
|
138
|
+
"@frontmcp/uipack": "1.4.0",
|
|
139
|
+
"@frontmcp/auth": "1.4.0",
|
|
140
|
+
"@frontmcp/protocol": "1.4.0",
|
|
122
141
|
"ioredis": "^5.8.0",
|
|
123
142
|
"js-yaml": "^4.1.1",
|
|
124
143
|
"jose": "^6.1.3",
|
|
@@ -108,6 +108,11 @@ PromptRecord, PromptType[]> {
|
|
|
108
108
|
/**
|
|
109
109
|
* Get the MCP capabilities for prompts.
|
|
110
110
|
* These are reported to clients during initialization.
|
|
111
|
+
*
|
|
112
|
+
* Issue #407: we always advertise the `prompts` capability so the MCP SDK
|
|
113
|
+
* accepts the always-registered `prompts/list` handler (see
|
|
114
|
+
* `createMcpHandlers`). `listChanged` still reflects whether anything is
|
|
115
|
+
* actually registered.
|
|
111
116
|
*/
|
|
112
117
|
getCapabilities(): Partial<ServerCapabilities>;
|
|
113
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.registry.d.ts","sourceRoot":"","sources":["../../src/prompt/prompt.registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,gBAAgB,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAK5E,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAA8B,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAM1G,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,gBAAgB,CAC1D,cAAc,EAAE,qCAAqC;AACrD,YAAY,EACZ,UAAU,EAAE,CACb;IACC,oDAAoD;IACpD,KAAK,EAAE,aAAa,CAAC;IAErB,8EAA8E;IAC9E,OAA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
|
121
121
|
* These are reported to clients during initialization.
|
|
122
|
+
*
|
|
123
|
+
* Issue #407: we always advertise the `resources` capability so the MCP SDK
|
|
124
|
+
* accepts the always-registered `resources/list` and `resources/templates/list`
|
|
125
|
+
* handlers (see `createMcpHandlers`). `subscribe` and `listChanged` reflect
|
|
126
|
+
* whether anything is actually registered.
|
|
122
127
|
*/
|
|
123
128
|
getCapabilities(): Partial<ServerCapabilities>;
|
|
124
129
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.registry.d.ts","sourceRoot":"","sources":["../../src/resource/resource.registry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAElB,MAAM,WAAW,CAAC;AAInB,OAAO,KAAK,gBAAgB,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAQ5E,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAgC,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAQlH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,gBAAgB,CAC5D,gBAAgB,EAAE,uCAAuC;AACzD,AADkB,uCAAuC;AACzD,cAAc,GAAG,sBAAsB,EACvC,YAAY,EAAE,CACf;IACC,oDAAoD;IACpD,KAAK,EAAE,aAAa,CAAC;IAErB,gFAAgF;IAChF,OAAO,CAAC,SAAS,CAAyB;IAE1C,wFAAwF;IACxF,OAAO,CAAC,OAAO,CAAkD;IAEjE,wCAAwC;IACxC,OAAO,CAAC,QAAQ,CAA+B;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SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,OAAO,CAAA;KAAE,EACrE,EAAE,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,IAAI,GACrC,MAAM,IAAI;IAab;;;;;OAKG;IACH,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAUvC,OAAO,CAAC,IAAI;IAOZ,mCAAmC;IACnC,OAAO,CAAC,OAAO;IAyBf,6FAA6F;IAC7F,OAAO,CAAC,SAAS;IAsBjB,kDAAkD;IAClD,OAAO,CAAC,YAAY;IAsBpB,qEAAqE;IACrE,MAAM,IAAI,OAAO;IAIjB;;;;OAIG;IACH,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI;IA0C5D;;;;;;;;OAQG;IACH,eAAe,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAW9C;;;;;;;;;;;OAWG;IACH,wBAAwB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAmCvD;;;;;;;OAOG;IACH,uBAAuB,CAAC,WAAW,EAAE,YAAY,GAAG,cAAc,GAAG,sBAAsB,GAAG,IAAI;CA0DnG"}
|
|
@@ -44,11 +44,11 @@ export declare const httpRequestStateSchema: import("@frontmcp/lazy-zod").ZodObj
|
|
|
44
44
|
isPublic: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
45
45
|
platformType: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodEnum<{
|
|
46
46
|
unknown: "unknown";
|
|
47
|
+
continue: "continue";
|
|
47
48
|
openai: "openai";
|
|
48
49
|
claude: "claude";
|
|
49
50
|
gemini: "gemini";
|
|
50
51
|
cursor: "cursor";
|
|
51
|
-
continue: "continue";
|
|
52
52
|
cody: "cody";
|
|
53
53
|
"generic-mcp": "generic-mcp";
|
|
54
54
|
"ext-apps": "ext-apps";
|
|
@@ -92,6 +92,23 @@ export default class HttpRequestFlow extends FlowBase<typeof name> {
|
|
|
92
92
|
traceRequest(): Promise<void>;
|
|
93
93
|
acquireQuota(): Promise<void>;
|
|
94
94
|
checkAuthorization(): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Build a live {@link OrchestratedAuthAccessorAdapter} for the verified request
|
|
97
|
+
* and register it under {@link ORCHESTRATED_AUTH_ACCESSOR} so tools can read
|
|
98
|
+
* upstream provider tokens via `this.orchestration.getToken(id)`.
|
|
99
|
+
*
|
|
100
|
+
* `session:verify` returns a lightweight authorization (`{ token, user, … }`)
|
|
101
|
+
* rather than a full OrchestratedAuthorization, so we reconstruct one here from
|
|
102
|
+
* the verified JWT + the primary auth's encrypted token store (the same store
|
|
103
|
+
* the federated provider-callback flow wrote upstream tokens into, keyed by
|
|
104
|
+
* `deriveAuthorizationId(token)`). No-op unless the scope is in orchestrated
|
|
105
|
+
* mode with a token store and a non-empty bearer token — so public/transparent
|
|
106
|
+
* and anonymous requests are unaffected.
|
|
107
|
+
*
|
|
108
|
+
* Security: tokens stay server-side and AES-GCM-encrypted at rest; only the
|
|
109
|
+
* non-PII provider ids are read here to project the authorization.
|
|
110
|
+
*/
|
|
111
|
+
private bindOrchestrationAccessor;
|
|
95
112
|
router(): Promise<void>;
|
|
96
113
|
handleLegacySse(): Promise<void>;
|
|
97
114
|
handleSse(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.request.flow.d.ts","sourceRoot":"","sources":["../../../src/scope/flows/http.request.flow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http.request.flow.d.ts","sourceRoot":"","sources":["../../../src/scope/flows/http.request.flow.ts"],"names":[],"mappings":"AAYA,OAAO,EAIL,QAAQ,EAGR,eAAe,EACf,gBAAgB,EAShB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAGtB,QAAA,MAAM,IAAI;;;;;CA8B2B,CAAC;AAEtC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAIjC,CAAC;AAEH,QAAA,MAAM,IAAI,EAAG,cAAuB,CAAC;AAGrC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,cAAc,EAAE,cAAc,CAC5B,eAAe,EACf,OAAO,IAAI,EACX,OAAO,eAAe,EACtB,OAAO,gBAAgB,EACvB,OAAO,sBAAsB,CAC9B,CAAC;KACH;CACF;AAYD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IAChE,MAAM,wCAA8C;IACpD,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,SAAS,CAAM;IAEvB,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU;IActD,YAAY;IAkDZ,YAAY;IA8BZ,kBAAkB;IAmDxB;;;;;;;;;;;;;;;OAeG;YACW,yBAAyB;IAwCjC,MAAM;IAsNN,eAAe;IAuBf,SAAS;IAuBT,oBAAoB;IAuBpB,kBAAkB;IAuBlB,mBAAmB;IAuBnB,mBAAmB;IAgDnB,QAAQ;IAcd;;;OAGG;IACH,OAAO,CAAC,QAAQ;CA8CjB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for probing optional peer dependencies that are loaded lazily via
|
|
3
|
+
* `require()` (e.g. `@frontmcp/observability`).
|
|
4
|
+
*
|
|
5
|
+
* A bare `try { require(pkg) } catch { warn("not installed") }` is misleading:
|
|
6
|
+
* `require()` throws for many reasons OTHER than the package being absent — an
|
|
7
|
+
* export-condition or transpile mismatch (a dev runtime such as tsx resolving a
|
|
8
|
+
* package's TS source entry under yarn), a missing transitive peer, or a load-time
|
|
9
|
+
* error in the module itself. In all of those the package IS installed and
|
|
10
|
+
* resolvable, yet the user is told to reinstall it, which never helps (#453).
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Outcome of classifying a failed `require()` of an optional dependency.
|
|
14
|
+
*/
|
|
15
|
+
export interface OptionalDependencyProbe {
|
|
16
|
+
/**
|
|
17
|
+
* - `not-installed` — the module is genuinely unresolvable (reinstalling helps).
|
|
18
|
+
* - `load-failed` — the module resolves but `require()` threw (a load / export
|
|
19
|
+
* condition / transpile / peer mismatch; reinstalling will NOT help).
|
|
20
|
+
*/
|
|
21
|
+
status: 'not-installed' | 'load-failed';
|
|
22
|
+
/** Path returned by the runtime resolver, present only when `load-failed`. */
|
|
23
|
+
resolvedPath?: string;
|
|
24
|
+
/** Message from the original `require()` error. */
|
|
25
|
+
error: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Classify why `require(moduleName)` failed by re-probing with the SAME resolver
|
|
29
|
+
* the runtime uses, so the verdict matches reality instead of always blaming a
|
|
30
|
+
* missing install.
|
|
31
|
+
*
|
|
32
|
+
* @param moduleName - the specifier that failed to `require()`.
|
|
33
|
+
* @param loadError - the error thrown by the failed `require()`.
|
|
34
|
+
* @param resolve - resolver to probe existence with. Pass `require.resolve` from
|
|
35
|
+
* the caller; kept injectable so this stays unit-testable and ESM-safe (the
|
|
36
|
+
* helper module itself never references `require`).
|
|
37
|
+
*/
|
|
38
|
+
export declare function probeOptionalDependency(moduleName: string, loadError: unknown, resolve: (id: string) => string): OptionalDependencyProbe;
|
|
39
|
+
//# sourceMappingURL=optional-dependency.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-dependency.util.d.ts","sourceRoot":"","sources":["../../src/scope/optional-dependency.util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,MAAM,EAAE,eAAe,GAAG,aAAa,CAAC;IACxC,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAC9B,uBAAuB,CAWzB"}
|
|
@@ -3,6 +3,7 @@ import { type GuardManager } from '@frontmcp/guard';
|
|
|
3
3
|
import { type EventStore } from '@frontmcp/protocol';
|
|
4
4
|
import AgentRegistry from '../agent/agent.registry';
|
|
5
5
|
import AppRegistry from '../app/app.registry';
|
|
6
|
+
import { AuthUiRegistry } from '../auth/auth-ui';
|
|
6
7
|
import { AuthRegistry } from '../auth/auth.registry';
|
|
7
8
|
import { type ChannelNotificationService } from '../channel/channel-notification.service';
|
|
8
9
|
import type ChannelRegistry from '../channel/channel.registry';
|
|
@@ -44,14 +45,19 @@ export declare class Scope extends ScopeEntry {
|
|
|
44
45
|
notificationService: NotificationService;
|
|
45
46
|
haManager?: HaManager;
|
|
46
47
|
private toolUIRegistry;
|
|
48
|
+
private authUiRegistry?;
|
|
47
49
|
readonly entryPath: string;
|
|
48
50
|
readonly routeBase: string;
|
|
49
51
|
readonly orchestrated: boolean;
|
|
50
52
|
readonly server: FrontMcpServer;
|
|
51
53
|
/** Lazy-initialized elicitation store for distributed elicitation support */
|
|
52
54
|
private _elicitationStore?;
|
|
55
|
+
/** Backend type for the elicitation store (used by the orphan-sqlite WARN guard). */
|
|
56
|
+
private elicitationBackendType?;
|
|
53
57
|
/** Task store for MCP 2025-11-25 background tasks (optional). */
|
|
54
58
|
private _taskStore?;
|
|
59
|
+
/** Backend type for the task store (used by the orphan-sqlite WARN guard). */
|
|
60
|
+
private taskBackendType?;
|
|
55
61
|
/** Per-process task registry (AbortControllers + capability projection). */
|
|
56
62
|
private _taskRegistry?;
|
|
57
63
|
/** Optional skill session manager for tool authorization enforcement */
|
|
@@ -81,11 +87,34 @@ export declare class Scope extends ScopeEntry {
|
|
|
81
87
|
private readonly cliMode;
|
|
82
88
|
constructor(rec: ScopeRecord, globalProviders: ProviderRegistry);
|
|
83
89
|
protected initialize(): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Resolve the top-level `sqlite` config, filling in a default `path`
|
|
92
|
+
* when the user provided the block without one (issue #401). Also
|
|
93
|
+
* ensures the parent directory exists so better-sqlite3 doesn't fail
|
|
94
|
+
* to open. Returns `undefined` if the user didn't set the block at
|
|
95
|
+
* all. The returned object is a SHALLOW COPY — never mutate the
|
|
96
|
+
* caller's metadata.
|
|
97
|
+
*/
|
|
98
|
+
private resolveTopLevelSqlite;
|
|
84
99
|
/**
|
|
85
100
|
* Pre-compile UI widgets for tools with UI configs.
|
|
86
101
|
* Extracted from initialize() for readability.
|
|
87
102
|
*/
|
|
88
103
|
private compileUIWidgets;
|
|
104
|
+
/**
|
|
105
|
+
* Build the custom auth-UI registry (#469) PER SCOPE from this scope's resolved
|
|
106
|
+
* auth options (`auth.ui` / `auth.extras`). The parent multi-app scope reads
|
|
107
|
+
* the top-level `@FrontMcp({ auth })`, and each `splitByApp` scope reads its own
|
|
108
|
+
* `@App({ auth })` (resolved into `this.metadata.auth` by `normalizeAppScope`),
|
|
109
|
+
* so a split app gets ITS OWN auth UI.
|
|
110
|
+
*
|
|
111
|
+
* No-op (leaves {@link authUiRegistry} undefined) when neither is declared, so
|
|
112
|
+
* the OAuth flows serve the built-in HTML pages exactly as before. When custom
|
|
113
|
+
* slots ARE declared, their SSR + hydration bundles are pre-built at startup
|
|
114
|
+
* (mirroring `compileUIWidgets`); build failures are logged + cached, never
|
|
115
|
+
* thrown, so a broken component degrades to the built-in page.
|
|
116
|
+
*/
|
|
117
|
+
private buildAuthUiRegistry;
|
|
89
118
|
private formatScopeSummary;
|
|
90
119
|
private get defaultScopeProviders();
|
|
91
120
|
get auth(): FrontMcpAuth;
|
|
@@ -95,6 +124,7 @@ export declare class Scope extends ScopeEntry {
|
|
|
95
124
|
get apps(): AppRegistry;
|
|
96
125
|
get tools(): ToolRegistry;
|
|
97
126
|
get toolUI(): ToolUIRegistry;
|
|
127
|
+
get authUi(): AuthUiRegistry | undefined;
|
|
98
128
|
get resources(): ResourceRegistry;
|
|
99
129
|
get prompts(): PromptRegistry;
|
|
100
130
|
get agents(): AgentRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.instance.d.ts","sourceRoot":"","sources":["../../src/scope/scope.instance.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,aAAa,MAAM,yBAAyB,CAAC;AAEpD,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAE1F,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAI3E,OAAO,EACL,cAAc,EACd,cAAc,EAEd,UAAU,EAEV,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,IAAI,EACV,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"scope.instance.d.ts","sourceRoot":"","sources":["../../src/scope/scope.instance.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;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,OAAO,EAChB,QAAQ,EAAE,sBAAsB,GAAG,wBAAwB,GAC1D,WAAW,
|
|
1
|
+
{"version":3,"file":"scope.utils.d.ts","sourceRoot":"","sources":["../../src/scope/scope.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAE7B,KAAK,WAAW,EACjB,MAAM,WAAW,CAAC;AAInB;;;;;GAKG;AAEH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,sBAAsB,GAAG,wBAAwB,GAC1D,WAAW,CA2Bb;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,sBAAsB,GAAG,WAAW,CAU7G;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,KAAK,EAAE,CAO5D"}
|
|
@@ -2,6 +2,12 @@ import express from 'express';
|
|
|
2
2
|
import { type CorsOptions, type HttpMethod, type ServerRequestHandler } from '../../common';
|
|
3
3
|
import type { SecurityOptions } from '../../common/types/options/http/interfaces';
|
|
4
4
|
import { HostServerAdapter } from './base.host.adapter';
|
|
5
|
+
/**
|
|
6
|
+
* Default request body size for the Express host. Lifts body-parser's silent
|
|
7
|
+
* 100KB default, which routinely rejected base64-encoded PDFs, DOCXes, and
|
|
8
|
+
* large HTML inputs before they reached MCP tool handlers (issue #410).
|
|
9
|
+
*/
|
|
10
|
+
export declare const DEFAULT_EXPRESS_BODY_LIMIT = "4mb";
|
|
5
11
|
/**
|
|
6
12
|
* Options for ExpressHostAdapter.
|
|
7
13
|
*/
|
|
@@ -17,6 +23,16 @@ export interface ExpressHostAdapterOptions {
|
|
|
17
23
|
* Includes bind address and DNS rebinding protection.
|
|
18
24
|
*/
|
|
19
25
|
security?: SecurityOptions;
|
|
26
|
+
/**
|
|
27
|
+
* Maximum body size for `express.json()`. Accepts a number of bytes or a
|
|
28
|
+
* body-parser-compatible string ('4mb', '500kb', etc.). Defaults to '4mb'.
|
|
29
|
+
*/
|
|
30
|
+
bodyLimit?: number | string;
|
|
31
|
+
/**
|
|
32
|
+
* Maximum body size for `express.urlencoded()`. Falls back to `bodyLimit`
|
|
33
|
+
* when omitted.
|
|
34
|
+
*/
|
|
35
|
+
urlencodedLimit?: number | string;
|
|
20
36
|
}
|
|
21
37
|
export declare class ExpressHostAdapter extends HostServerAdapter {
|
|
22
38
|
private app;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.host.adapter.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/express.host.adapter.ts"],"names":[],"mappings":"AAIA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EAEf,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"express.host.adapter.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/express.host.adapter.ts"],"names":[],"mappings":"AAIA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EAEf,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAGlF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QAAQ,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC;AAED,qBAAa,kBAAmB,SAAQ,iBAAiB;IACvD,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,QAAQ,CAAS;gBAEb,OAAO,CAAC,EAAE,yBAAyB;IAmG/C,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB;IAI7E,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB;IAInE,eAAe,CAAC,OAAO,EAAE,oBAAoB,IACnC,KAAK,OAAO,CAAC,OAAO,EAAE,KAAK,OAAO,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,YAAY;IAQjF;;;;OAIG;IACH,OAAO,IAAI,IAAI;IAMf;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,WAAW;IAK3B,KAAK,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;YAqCrD,kBAAkB;CASjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-express-host.d.ts","sourceRoot":"","sources":["../../../../src/server/adapters/polyfills/browser-express-host.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"browser-express-host.d.ts","sourceRoot":"","sources":["../../../../src/server/adapters/polyfills/browser-express-host.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC;AAED,qBAAa,kBAAkB;gBACjB,QAAQ,CAAC,EAAE,yBAAyB;CAGjD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ExpressHostAdapter, type ExpressHostAdapterOptions } from '../express.host.adapter';
|
|
1
|
+
export { DEFAULT_EXPRESS_BODY_LIMIT, ExpressHostAdapter, type ExpressHostAdapterOptions, } from '../express.host.adapter';
|
|
2
2
|
//# sourceMappingURL=node-express-host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-express-host.d.ts","sourceRoot":"","sources":["../../../../src/server/adapters/polyfills/node-express-host.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"node-express-host.d.ts","sourceRoot":"","sources":["../../../../src/server/adapters/polyfills/node-express-host.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,KAAK,yBAAyB,GAC/B,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type FrontMcpLogger, type FrontMcpServer, type HttpRouteConfig, type ServerRequest, type ServerRequestHandler } from '../common';
|
|
2
|
+
/** Shape of the `session:verify` flow output we care about here. */
|
|
3
|
+
export type VerifyResult = {
|
|
4
|
+
kind: 'authorized';
|
|
5
|
+
authorization: unknown;
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'unauthorized';
|
|
8
|
+
prmMetadataHeader: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'forbidden';
|
|
11
|
+
prmMetadataHeader: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Dispatch the MCP `session:verify` flow for a request. The scope passes a thin
|
|
15
|
+
* closure over its generic `runFlow` so this helper stays decoupled from the
|
|
16
|
+
* scope's flow-name typing.
|
|
17
|
+
*/
|
|
18
|
+
export type VerifySessionFn = (request: ServerRequest) => Promise<VerifyResult | undefined>;
|
|
19
|
+
export interface RegisterCustomHttpRoutesArgs {
|
|
20
|
+
/** Custom routes from `http.routes`. */
|
|
21
|
+
routes: HttpRouteConfig[] | undefined;
|
|
22
|
+
/** Active host server to register routes on. */
|
|
23
|
+
server: FrontMcpServer;
|
|
24
|
+
/** Runs `session:verify` for `auth: true` routes. */
|
|
25
|
+
verifySession: VerifySessionFn;
|
|
26
|
+
/** Resolved gateway entry path (e.g. `''` or `'/mcp'`). */
|
|
27
|
+
entryPath: string;
|
|
28
|
+
/** Per-app / per-scope route base (e.g. `''` or `'/billing'`). */
|
|
29
|
+
routeBase: string;
|
|
30
|
+
logger: FrontMcpLogger;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Error thrown when a custom `http.routes` path collides with a FrontMCP
|
|
34
|
+
* reserved surface. Fail-fast at startup rather than silently shadowing (or
|
|
35
|
+
* being shadowed by) the MCP endpoint / discovery / health surfaces.
|
|
36
|
+
*/
|
|
37
|
+
export declare class ReservedRouteCollisionError extends Error {
|
|
38
|
+
readonly method: string;
|
|
39
|
+
readonly path: string;
|
|
40
|
+
readonly reserved: string;
|
|
41
|
+
constructor(method: string, path: string, reserved: string);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Build the exact-match + prefix reserved-path set for the resolved MCP base.
|
|
45
|
+
*
|
|
46
|
+
* - Exact matches: the MCP base itself, `<base>/sse`, `<base>/message`,
|
|
47
|
+
* `/health`, `/metrics`.
|
|
48
|
+
* - Prefix matches: `/oauth`, `/.well-known` (any sub-path is reserved).
|
|
49
|
+
*/
|
|
50
|
+
export declare function computeReservedPaths(entryPath: string, routeBase: string): {
|
|
51
|
+
exact: Set<string>;
|
|
52
|
+
prefixes: string[];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Throw {@link ReservedRouteCollisionError} when `path` collides with a
|
|
56
|
+
* reserved FrontMCP surface. Express path params (`:id`) and wildcards in the
|
|
57
|
+
* *custom* path are compared literally — only the static prefix matters for the
|
|
58
|
+
* reserved-surface check, so a route like `/files/:id` never collides unless it
|
|
59
|
+
* is literally under `/oauth`, `/.well-known`, etc.
|
|
60
|
+
*/
|
|
61
|
+
export declare function assertNotReserved(method: string, path: string, reserved: {
|
|
62
|
+
exact: Set<string>;
|
|
63
|
+
prefixes: string[];
|
|
64
|
+
}): void;
|
|
65
|
+
/**
|
|
66
|
+
* Wrap a user route handler in the MCP `session:verify` auth flow. On
|
|
67
|
+
* unauthorized/forbidden the request is short-circuited with a 401/403 carrying
|
|
68
|
+
* the `WWW-Authenticate` header (mirroring `http.request.flow.ts`); on success
|
|
69
|
+
* the verified authorization is attached to `req.authSession` (and the internal
|
|
70
|
+
* auth token) before the user handler runs.
|
|
71
|
+
*/
|
|
72
|
+
export declare function wrapWithAuth(handler: ServerRequestHandler, verifySession: VerifySessionFn, logger: FrontMcpLogger): ServerRequestHandler;
|
|
73
|
+
/**
|
|
74
|
+
* Register all configured custom HTTP routes on the active server.
|
|
75
|
+
*
|
|
76
|
+
* No-op when `routes` is empty/undefined. Throws {@link ReservedRouteCollisionError}
|
|
77
|
+
* (fail-fast) on the first path that collides with a reserved surface — so a
|
|
78
|
+
* misconfiguration aborts boot instead of silently mis-mounting.
|
|
79
|
+
*/
|
|
80
|
+
export declare function registerCustomHttpRoutes(args: RegisterCustomHttpRoutesArgs): void;
|
|
81
|
+
//# sourceMappingURL=custom-routes.helper.d.ts.map
|