skybridge 0.0.0-dev.ecf87cf → 0.0.0-dev.ed005a8
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/LICENSE +21 -0
- package/README.md +155 -0
- package/bin/run.js +5 -0
- package/dist/cli/build-helpers.d.ts +11 -0
- package/dist/cli/build-helpers.js +107 -0
- package/dist/cli/build-helpers.js.map +1 -0
- package/dist/cli/build-helpers.test.js +132 -0
- package/dist/cli/build-helpers.test.js.map +1 -0
- package/dist/cli/build-steps.d.ts +2 -0
- package/dist/cli/build-steps.js +73 -0
- package/dist/cli/build-steps.js.map +1 -0
- package/dist/cli/build-steps.test.js +52 -0
- package/dist/cli/build-steps.test.js.map +1 -0
- package/dist/cli/detect-port.d.ts +18 -0
- package/dist/cli/detect-port.js +49 -0
- package/dist/cli/detect-port.js.map +1 -0
- package/dist/cli/header.d.ts +4 -0
- package/dist/cli/header.js +6 -0
- package/dist/cli/header.js.map +1 -0
- package/dist/cli/resolve-skybridge-config.d.ts +5 -0
- package/dist/cli/resolve-skybridge-config.js +18 -0
- package/dist/cli/resolve-skybridge-config.js.map +1 -0
- package/dist/cli/run-command.d.ts +2 -0
- package/dist/cli/run-command.js +43 -0
- package/dist/cli/run-command.js.map +1 -0
- package/dist/cli/run-plain.d.ts +18 -0
- package/dist/cli/run-plain.js +89 -0
- package/dist/cli/run-plain.js.map +1 -0
- package/dist/cli/telemetry.d.ts +7 -0
- package/dist/cli/telemetry.js +123 -0
- package/dist/cli/telemetry.js.map +1 -0
- package/dist/cli/tunnel-control-server.d.ts +9 -0
- package/dist/cli/tunnel-control-server.js +31 -0
- package/dist/cli/tunnel-control-server.js.map +1 -0
- package/dist/cli/tunnel-control-server.test.js +39 -0
- package/dist/cli/tunnel-control-server.test.js.map +1 -0
- package/dist/cli/tunnel-handler.d.ts +3 -0
- package/dist/cli/tunnel-handler.js +48 -0
- package/dist/cli/tunnel-handler.js.map +1 -0
- package/dist/cli/tunnel-handler.test.js +105 -0
- package/dist/cli/tunnel-handler.test.js.map +1 -0
- package/dist/cli/tunnel.d.ts +57 -0
- package/dist/cli/tunnel.js +154 -0
- package/dist/cli/tunnel.js.map +1 -0
- package/dist/cli/tunnel.test.js +190 -0
- package/dist/cli/tunnel.test.js.map +1 -0
- package/dist/cli/types.d.ts +5 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/use-execute-steps.d.ts +11 -0
- package/dist/cli/use-execute-steps.js +36 -0
- package/dist/cli/use-execute-steps.js.map +1 -0
- package/dist/cli/use-messages.d.ts +3 -0
- package/dist/cli/use-messages.js +11 -0
- package/dist/cli/use-messages.js.map +1 -0
- package/dist/cli/use-nodemon.d.ts +16 -0
- package/dist/cli/use-nodemon.js +92 -0
- package/dist/cli/use-nodemon.js.map +1 -0
- package/dist/cli/use-open-browser.d.ts +1 -0
- package/dist/cli/use-open-browser.js +44 -0
- package/dist/cli/use-open-browser.js.map +1 -0
- package/dist/cli/use-tunnel.d.ts +14 -0
- package/dist/cli/use-tunnel.js +131 -0
- package/dist/cli/use-tunnel.js.map +1 -0
- package/dist/cli/use-typescript-check.d.ts +15 -0
- package/dist/cli/use-typescript-check.js +97 -0
- package/dist/cli/use-typescript-check.js.map +1 -0
- package/dist/commands/build.d.ts +6 -0
- package/dist/commands/build.js +31 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/create.d.ts +9 -0
- package/dist/commands/create.js +30 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/dev.d.ts +13 -0
- package/dist/commands/dev.js +128 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/start.d.ts +9 -0
- package/dist/commands/start.js +55 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/telemetry/disable.d.ts +5 -0
- package/dist/commands/telemetry/disable.js +14 -0
- package/dist/commands/telemetry/disable.js.map +1 -0
- package/dist/commands/telemetry/enable.d.ts +5 -0
- package/dist/commands/telemetry/enable.js +14 -0
- package/dist/commands/telemetry/enable.js.map +1 -0
- package/dist/commands/telemetry/status.d.ts +5 -0
- package/dist/commands/telemetry/status.js +14 -0
- package/dist/commands/telemetry/status.js.map +1 -0
- package/dist/context-warnings.d.ts +5 -0
- package/dist/context-warnings.js +31 -0
- package/dist/context-warnings.js.map +1 -0
- package/dist/context-warnings.test.js +28 -0
- package/dist/context-warnings.test.js.map +1 -0
- package/dist/server/app.d.ts +194 -0
- package/dist/server/app.js +266 -0
- package/dist/server/app.js.map +1 -0
- package/dist/server/app.test.js +97 -0
- package/dist/server/app.test.js.map +1 -0
- package/dist/server/asset-base-url-transform-plugin.d.ts +11 -0
- package/dist/server/asset-base-url-transform-plugin.js +48 -0
- package/dist/server/asset-base-url-transform-plugin.js.map +1 -0
- package/dist/server/asset-base-url-transform-plugin.test.js +134 -0
- package/dist/server/asset-base-url-transform-plugin.test.js.map +1 -0
- package/dist/server/auth/discovery.d.ts +33 -0
- package/dist/server/auth/discovery.js +56 -0
- package/dist/server/auth/discovery.js.map +1 -0
- package/dist/server/auth/discovery.test.js +93 -0
- package/dist/server/auth/discovery.test.js.map +1 -0
- package/dist/server/auth/index.d.ts +48 -0
- package/dist/server/auth/index.js +2 -0
- package/dist/server/auth/index.js.map +1 -0
- package/dist/server/auth/providers/auth0.d.ts +40 -0
- package/dist/server/auth/providers/auth0.js +36 -0
- package/dist/server/auth/providers/auth0.js.map +1 -0
- package/dist/server/auth/providers/auth0.test.js +50 -0
- package/dist/server/auth/providers/auth0.test.js.map +1 -0
- package/dist/server/auth/providers/authplane.d.ts +49 -0
- package/dist/server/auth/providers/authplane.js +57 -0
- package/dist/server/auth/providers/authplane.js.map +1 -0
- package/dist/server/auth/providers/authplane.test.js +143 -0
- package/dist/server/auth/providers/authplane.test.js.map +1 -0
- package/dist/server/auth/providers/clerk.d.ts +51 -0
- package/dist/server/auth/providers/clerk.js +19 -0
- package/dist/server/auth/providers/clerk.js.map +1 -0
- package/dist/server/auth/providers/clerk.test.js +30 -0
- package/dist/server/auth/providers/clerk.test.js.map +1 -0
- package/dist/server/auth/providers/custom.d.ts +40 -0
- package/dist/server/auth/providers/custom.js +59 -0
- package/dist/server/auth/providers/custom.js.map +1 -0
- package/dist/server/auth/providers/custom.test.js +161 -0
- package/dist/server/auth/providers/custom.test.js.map +1 -0
- package/dist/server/auth/providers/descope.d.ts +44 -0
- package/dist/server/auth/providers/descope.js +44 -0
- package/dist/server/auth/providers/descope.js.map +1 -0
- package/dist/server/auth/providers/descope.test.js +62 -0
- package/dist/server/auth/providers/descope.test.js.map +1 -0
- package/dist/server/auth/providers/shared.d.ts +2 -0
- package/dist/server/auth/providers/shared.js +6 -0
- package/dist/server/auth/providers/shared.js.map +1 -0
- package/dist/server/auth/providers/shared.test.js +10 -0
- package/dist/server/auth/providers/shared.test.js.map +1 -0
- package/dist/server/auth/providers/stytch.d.ts +25 -0
- package/dist/server/auth/providers/stytch.js +16 -0
- package/dist/server/auth/providers/stytch.js.map +1 -0
- package/dist/server/auth/providers/verify-spy.d.ts +12 -0
- package/dist/server/auth/providers/verify-spy.js +21 -0
- package/dist/server/auth/providers/verify-spy.js.map +1 -0
- package/dist/server/auth/providers/workos.d.ts +33 -0
- package/dist/server/auth/providers/workos.js +15 -0
- package/dist/server/auth/providers/workos.js.map +1 -0
- package/dist/server/auth/security-schemes.d.ts +23 -0
- package/dist/server/auth/security-schemes.js +64 -0
- package/dist/server/auth/security-schemes.js.map +1 -0
- package/dist/server/auth/security-schemes.test.js +99 -0
- package/dist/server/auth/security-schemes.test.js.map +1 -0
- package/dist/server/auth/setup.d.ts +6 -0
- package/dist/server/auth/setup.js +91 -0
- package/dist/server/auth/setup.js.map +1 -0
- package/dist/server/auth/setup.test.js +514 -0
- package/dist/server/auth/setup.test.js.map +1 -0
- package/dist/server/auth/verify.d.ts +46 -0
- package/dist/server/auth/verify.js +62 -0
- package/dist/server/auth/verify.js.map +1 -0
- package/dist/server/auth/verify.test.js +149 -0
- package/dist/server/auth/verify.test.js.map +1 -0
- package/dist/server/auth-extra.test-d.js +130 -0
- package/dist/server/auth-extra.test-d.js.map +1 -0
- package/dist/server/auth.d.ts +57 -0
- package/dist/server/auth.js +27 -0
- package/dist/server/auth.js.map +1 -0
- package/dist/server/build-manifest.test.js +28 -0
- package/dist/server/build-manifest.test.js.map +1 -0
- package/dist/server/content-helpers.d.ts +67 -0
- package/dist/server/content-helpers.js +79 -0
- package/dist/server/content-helpers.js.map +1 -0
- package/dist/server/content-helpers.test.d.ts +1 -0
- package/dist/server/content-helpers.test.js +70 -0
- package/dist/server/content-helpers.test.js.map +1 -0
- package/dist/server/express.d.ts +31 -0
- package/dist/server/express.js +107 -0
- package/dist/server/express.js.map +1 -0
- package/dist/server/express.test.d.ts +1 -0
- package/dist/server/express.test.js +608 -0
- package/dist/server/express.test.js.map +1 -0
- package/dist/server/file-ref.d.ts +28 -0
- package/dist/server/file-ref.js +27 -0
- package/dist/server/file-ref.js.map +1 -0
- package/dist/server/host.d.ts +2 -0
- package/dist/server/host.js +11 -0
- package/dist/server/host.js.map +1 -0
- package/dist/server/host.test.d.ts +1 -0
- package/dist/server/host.test.js +13 -0
- package/dist/server/host.test.js.map +1 -0
- package/dist/server/index.d.ts +22 -0
- package/dist/server/index.js +18 -0
- package/dist/server/index.js.map +1 -0
- package/dist/{src/server → server}/inferUtilityTypes.d.ts +6 -6
- package/dist/server/inferUtilityTypes.js.map +1 -0
- package/dist/server/mcp-errors.test.d.ts +1 -0
- package/dist/server/mcp-errors.test.js +41 -0
- package/dist/server/mcp-errors.test.js.map +1 -0
- package/dist/server/metric.d.ts +14 -0
- package/dist/server/metric.js +62 -0
- package/dist/server/metric.js.map +1 -0
- package/dist/server/middleware.d.ts +162 -0
- package/dist/server/middleware.js +126 -0
- package/dist/server/middleware.js.map +1 -0
- package/dist/server/middleware.test-d.d.ts +1 -0
- package/dist/server/middleware.test-d.js +75 -0
- package/dist/server/middleware.test-d.js.map +1 -0
- package/dist/server/middleware.test.d.ts +1 -0
- package/dist/server/middleware.test.js +601 -0
- package/dist/server/middleware.test.js.map +1 -0
- package/dist/server/register-tool.test.d.ts +1 -0
- package/dist/server/register-tool.test.js +27 -0
- package/dist/server/register-tool.test.js.map +1 -0
- package/dist/server/requestOrigin.d.ts +7 -0
- package/dist/server/requestOrigin.js +25 -0
- package/dist/server/requestOrigin.js.map +1 -0
- package/dist/server/server.d.ts +420 -0
- package/dist/server/server.js +546 -0
- package/dist/server/server.js.map +1 -0
- package/dist/server/skills-integration.test.d.ts +1 -0
- package/dist/server/skills-integration.test.js +86 -0
- package/dist/server/skills-integration.test.js.map +1 -0
- package/dist/server/skills.d.ts +27 -0
- package/dist/server/skills.js +188 -0
- package/dist/server/skills.js.map +1 -0
- package/dist/server/skills.test.d.ts +1 -0
- package/dist/server/skills.test.js +243 -0
- package/dist/server/skills.test.js.map +1 -0
- package/dist/{src/server → server}/templateHelper.d.ts +2 -7
- package/dist/server/templateHelper.js +11 -0
- package/dist/server/templateHelper.js.map +1 -0
- package/dist/server/templates.generated.d.ts +4 -0
- package/dist/server/templates.generated.js +43 -0
- package/dist/server/templates.generated.js.map +1 -0
- package/dist/server/tool-extra.test.d.ts +1 -0
- package/dist/server/tool-extra.test.js +88 -0
- package/dist/server/tool-extra.test.js.map +1 -0
- package/dist/server/tunnel-proxy-router.d.ts +7 -0
- package/dist/server/tunnel-proxy-router.js +110 -0
- package/dist/server/tunnel-proxy-router.js.map +1 -0
- package/dist/server/tunnel-proxy-router.test.d.ts +1 -0
- package/dist/server/tunnel-proxy-router.test.js +229 -0
- package/dist/server/tunnel-proxy-router.test.js.map +1 -0
- package/dist/server/view-name.test-d.d.ts +1 -0
- package/dist/server/view-name.test-d.js +8 -0
- package/dist/server/view-name.test-d.js.map +1 -0
- package/dist/server/view-resource-resolution.test.d.ts +6 -0
- package/dist/server/view-resource-resolution.test.js +176 -0
- package/dist/server/view-resource-resolution.test.js.map +1 -0
- package/dist/server/viewsDevServer.d.ts +14 -0
- package/dist/server/viewsDevServer.js +48 -0
- package/dist/server/viewsDevServer.js.map +1 -0
- package/dist/{src/test → test}/utils.d.ts +21 -31
- package/dist/test/utils.js +266 -0
- package/dist/test/utils.js.map +1 -0
- package/dist/test/view.test.d.ts +1 -0
- package/dist/test/view.test.js +540 -0
- package/dist/test/view.test.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/dist/views/index.d.ts +10 -0
- package/dist/views/index.js +3 -0
- package/dist/views/index.js.map +1 -0
- package/dist/views/scan-views.d.ts +16 -0
- package/dist/views/scan-views.js +88 -0
- package/dist/views/scan-views.js.map +1 -0
- package/dist/views/scan-views.test.d.ts +1 -0
- package/dist/views/scan-views.test.js +99 -0
- package/dist/views/scan-views.test.js.map +1 -0
- package/dist/views/validate-view.d.ts +1 -0
- package/dist/views/validate-view.js +9 -0
- package/dist/views/validate-view.js.map +1 -0
- package/dist/views/validate-view.test.d.ts +1 -0
- package/dist/views/validate-view.test.js +24 -0
- package/dist/views/validate-view.test.js.map +1 -0
- package/dist/web/bridges/adaptor.d.ts +51 -0
- package/dist/web/bridges/adaptor.js +327 -0
- package/dist/web/bridges/adaptor.js.map +1 -0
- package/dist/web/bridges/adaptor.test.d.ts +1 -0
- package/dist/web/bridges/adaptor.test.js +225 -0
- package/dist/web/bridges/adaptor.test.js.map +1 -0
- package/dist/web/bridges/apps-sdk/bridge.d.ts +15 -0
- package/dist/web/bridges/apps-sdk/bridge.js +58 -0
- package/dist/web/bridges/apps-sdk/bridge.js.map +1 -0
- package/dist/web/bridges/apps-sdk/index.d.ts +4 -0
- package/dist/web/bridges/apps-sdk/index.js +4 -0
- package/dist/web/bridges/apps-sdk/index.js.map +1 -0
- package/dist/web/bridges/apps-sdk/types.d.ts +133 -0
- package/dist/{src/web → web/bridges/apps-sdk}/types.js +0 -1
- package/dist/web/bridges/apps-sdk/types.js.map +1 -0
- package/dist/web/bridges/apps-sdk/use-apps-sdk-context.d.ts +13 -0
- package/dist/web/bridges/apps-sdk/use-apps-sdk-context.js +18 -0
- package/dist/web/bridges/apps-sdk/use-apps-sdk-context.js.map +1 -0
- package/dist/web/bridges/get-adaptor.d.ts +9 -0
- package/dist/web/bridges/get-adaptor.js +10 -0
- package/dist/web/bridges/get-adaptor.js.map +1 -0
- package/dist/web/bridges/get-adaptor.test.d.ts +1 -0
- package/dist/web/bridges/get-adaptor.test.js +32 -0
- package/dist/web/bridges/get-adaptor.test.js.map +1 -0
- package/dist/web/bridges/index.d.ts +5 -0
- package/dist/web/bridges/index.js +6 -0
- package/dist/web/bridges/index.js.map +1 -0
- package/dist/web/bridges/mcp-app/bridge.d.ts +39 -0
- package/dist/web/bridges/mcp-app/bridge.js +168 -0
- package/dist/web/bridges/mcp-app/bridge.js.map +1 -0
- package/dist/web/bridges/mcp-app/bridge.test.d.ts +1 -0
- package/dist/web/bridges/mcp-app/bridge.test.js +17 -0
- package/dist/web/bridges/mcp-app/bridge.test.js.map +1 -0
- package/dist/web/bridges/mcp-app/index.d.ts +3 -0
- package/dist/web/bridges/mcp-app/index.js +3 -0
- package/dist/web/bridges/mcp-app/index.js.map +1 -0
- package/dist/web/bridges/mcp-app/types.d.ts +10 -0
- package/dist/web/bridges/mcp-app/types.js +2 -0
- package/dist/web/bridges/mcp-app/types.js.map +1 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.d.ts +19 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.js +19 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.js.map +1 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.test.d.ts +1 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js +26 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js.map +1 -0
- package/dist/web/bridges/mcp-app/view-tools.test.d.ts +1 -0
- package/dist/web/bridges/mcp-app/view-tools.test.js +143 -0
- package/dist/web/bridges/mcp-app/view-tools.test.js.map +1 -0
- package/dist/web/bridges/types.d.ts +219 -0
- package/dist/web/bridges/types.js +15 -0
- package/dist/web/bridges/types.js.map +1 -0
- package/dist/web/bridges/types.test.d.ts +1 -0
- package/dist/web/bridges/types.test.js +19 -0
- package/dist/web/bridges/types.test.js.map +1 -0
- package/dist/web/bridges/use-host-context.d.ts +7 -0
- package/dist/web/bridges/use-host-context.js +13 -0
- package/dist/web/bridges/use-host-context.js.map +1 -0
- package/dist/web/components/modal-provider.d.ts +4 -0
- package/dist/web/components/modal-provider.js +46 -0
- package/dist/web/components/modal-provider.js.map +1 -0
- package/dist/web/create-store.d.ts +29 -0
- package/dist/web/create-store.js +64 -0
- package/dist/web/create-store.js.map +1 -0
- package/dist/web/create-store.test.d.ts +1 -0
- package/dist/web/create-store.test.js +132 -0
- package/dist/web/create-store.test.js.map +1 -0
- package/dist/web/data-llm.d.ts +47 -0
- package/dist/{src/web → web}/data-llm.js +39 -7
- package/dist/web/data-llm.js.map +1 -0
- package/dist/web/data-llm.test.d.ts +1 -0
- package/dist/web/data-llm.test.js +155 -0
- package/dist/web/data-llm.test.js.map +1 -0
- package/dist/{src/web → web}/generate-helpers.d.ts +41 -32
- package/dist/{src/web → web}/generate-helpers.js +36 -28
- package/dist/web/generate-helpers.js.map +1 -0
- package/dist/web/generate-helpers.test-d.d.ts +1 -0
- package/dist/{src/web → web}/generate-helpers.test-d.js +35 -30
- package/dist/web/generate-helpers.test-d.js.map +1 -0
- package/dist/web/generate-helpers.test.d.ts +1 -0
- package/dist/{src/web → web}/generate-helpers.test.js +2 -2
- package/dist/web/generate-helpers.test.js.map +1 -0
- package/dist/{src/web → web}/helpers/state.d.ts +2 -2
- package/dist/web/helpers/state.js +45 -0
- package/dist/web/helpers/state.js.map +1 -0
- package/dist/web/helpers/state.test.d.ts +1 -0
- package/dist/{src/web → web}/helpers/state.test.js +9 -9
- package/dist/web/helpers/state.test.js.map +1 -0
- package/dist/web/hooks/index.d.ts +16 -0
- package/dist/web/hooks/index.js +17 -0
- package/dist/web/hooks/index.js.map +1 -0
- package/dist/web/hooks/test/utils.d.ts +21 -0
- package/dist/web/hooks/test/utils.js +75 -0
- package/dist/web/hooks/test/utils.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-call-tool.d.ts +47 -1
- package/dist/web/hooks/use-call-tool.js +96 -0
- package/dist/web/hooks/use-call-tool.js.map +1 -0
- package/dist/web/hooks/use-call-tool.test-d.d.ts +1 -0
- package/dist/web/hooks/use-call-tool.test-d.js.map +1 -0
- package/dist/web/hooks/use-call-tool.test.d.ts +1 -0
- package/dist/{src/web → web}/hooks/use-call-tool.test.js +84 -24
- package/dist/web/hooks/use-call-tool.test.js.map +1 -0
- package/dist/web/hooks/use-display-mode.d.ts +24 -0
- package/dist/web/hooks/use-display-mode.js +29 -0
- package/dist/web/hooks/use-display-mode.js.map +1 -0
- package/dist/web/hooks/use-display-mode.test-d.d.ts +1 -0
- package/dist/web/hooks/use-display-mode.test-d.js +8 -0
- package/dist/web/hooks/use-display-mode.test-d.js.map +1 -0
- package/dist/web/hooks/use-display-mode.test.d.ts +1 -0
- package/dist/web/hooks/use-display-mode.test.js +77 -0
- package/dist/web/hooks/use-display-mode.test.js.map +1 -0
- package/dist/web/hooks/use-download.d.ts +3 -0
- package/dist/web/hooks/use-download.js +7 -0
- package/dist/web/hooks/use-download.js.map +1 -0
- package/dist/web/hooks/use-download.test.d.ts +1 -0
- package/dist/web/hooks/use-download.test.js +103 -0
- package/dist/web/hooks/use-download.test.js.map +1 -0
- package/dist/web/hooks/use-files.d.ts +39 -0
- package/dist/web/hooks/use-files.js +42 -0
- package/dist/web/hooks/use-files.js.map +1 -0
- package/dist/web/hooks/use-files.test.d.ts +1 -0
- package/dist/web/hooks/use-files.test.js +62 -0
- package/dist/web/hooks/use-files.test.js.map +1 -0
- package/dist/web/hooks/use-host.d.ts +22 -0
- package/dist/web/hooks/use-host.js +30 -0
- package/dist/web/hooks/use-host.js.map +1 -0
- package/dist/web/hooks/use-host.test.d.ts +1 -0
- package/dist/web/hooks/use-host.test.js +59 -0
- package/dist/web/hooks/use-host.test.js.map +1 -0
- package/dist/web/hooks/use-open-external.d.ts +20 -0
- package/dist/web/hooks/use-open-external.js +24 -0
- package/dist/web/hooks/use-open-external.js.map +1 -0
- package/dist/web/hooks/use-open-external.test.d.ts +1 -0
- package/dist/web/hooks/use-open-external.test.js +75 -0
- package/dist/web/hooks/use-open-external.test.js.map +1 -0
- package/dist/web/hooks/use-register-view-tool.d.ts +37 -0
- package/dist/web/hooks/use-register-view-tool.js +50 -0
- package/dist/web/hooks/use-register-view-tool.js.map +1 -0
- package/dist/web/hooks/use-request-close.d.ts +16 -0
- package/dist/web/hooks/use-request-close.js +21 -0
- package/dist/web/hooks/use-request-close.js.map +1 -0
- package/dist/web/hooks/use-request-close.test.d.ts +1 -0
- package/dist/web/hooks/use-request-close.test.js +47 -0
- package/dist/web/hooks/use-request-close.test.js.map +1 -0
- package/dist/web/hooks/use-request-modal.d.ts +24 -0
- package/dist/web/hooks/use-request-modal.js +31 -0
- package/dist/web/hooks/use-request-modal.js.map +1 -0
- package/dist/web/hooks/use-request-modal.test.d.ts +1 -0
- package/dist/{src/web → web}/hooks/use-request-modal.test.js +16 -2
- package/dist/web/hooks/use-request-modal.test.js.map +1 -0
- package/dist/web/hooks/use-request-size.d.ts +20 -0
- package/dist/web/hooks/use-request-size.js +24 -0
- package/dist/web/hooks/use-request-size.js.map +1 -0
- package/dist/web/hooks/use-request-size.test.d.ts +1 -0
- package/dist/web/hooks/use-request-size.test.js +47 -0
- package/dist/web/hooks/use-request-size.test.js.map +1 -0
- package/dist/web/hooks/use-send-follow-up-message.d.ts +19 -0
- package/dist/web/hooks/use-send-follow-up-message.js +25 -0
- package/dist/web/hooks/use-send-follow-up-message.js.map +1 -0
- package/dist/web/hooks/use-set-open-in-app-url.d.ts +18 -0
- package/dist/web/hooks/use-set-open-in-app-url.js +25 -0
- package/dist/web/hooks/use-set-open-in-app-url.js.map +1 -0
- package/dist/web/hooks/use-set-open-in-app-url.test.d.ts +1 -0
- package/dist/web/hooks/use-set-open-in-app-url.test.js +57 -0
- package/dist/web/hooks/use-set-open-in-app-url.test.js.map +1 -0
- package/dist/web/hooks/use-tool-info.d.ts +68 -0
- package/dist/web/hooks/use-tool-info.js +48 -0
- package/dist/web/hooks/use-tool-info.js.map +1 -0
- package/dist/web/hooks/use-tool-info.test-d.d.ts +1 -0
- package/dist/{src/web → web}/hooks/use-tool-info.test-d.js +19 -6
- package/dist/web/hooks/use-tool-info.test-d.js.map +1 -0
- package/dist/web/hooks/use-tool-info.test.d.ts +1 -0
- package/dist/web/hooks/use-tool-info.test.js +135 -0
- package/dist/web/hooks/use-tool-info.test.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-user.d.ts +5 -2
- package/dist/web/hooks/use-user.js +38 -0
- package/dist/web/hooks/use-user.js.map +1 -0
- package/dist/web/hooks/use-user.test.d.ts +1 -0
- package/dist/web/hooks/use-user.test.js +170 -0
- package/dist/web/hooks/use-user.test.js.map +1 -0
- package/dist/web/hooks/use-view-state.d.ts +25 -0
- package/dist/web/hooks/use-view-state.js +42 -0
- package/dist/web/hooks/use-view-state.js.map +1 -0
- package/dist/web/hooks/use-view-state.test.d.ts +1 -0
- package/dist/web/hooks/use-view-state.test.js +212 -0
- package/dist/web/hooks/use-view-state.test.js.map +1 -0
- package/dist/web/hooks/use-viewport.d.ts +20 -0
- package/dist/web/hooks/use-viewport.js +21 -0
- package/dist/web/hooks/use-viewport.js.map +1 -0
- package/dist/web/hooks/use-viewport.test.d.ts +1 -0
- package/dist/web/hooks/use-viewport.test.js +109 -0
- package/dist/web/hooks/use-viewport.test.js.map +1 -0
- package/dist/{src/web → web}/index.d.ts +1 -2
- package/dist/{src/web → web}/index.js +1 -2
- package/dist/web/index.js.map +1 -0
- package/dist/web/mount-view.d.ts +21 -0
- package/dist/web/mount-view.js +43 -0
- package/dist/web/mount-view.js.map +1 -0
- package/dist/{src/web → web}/proxy.js +0 -1
- package/dist/web/proxy.js.map +1 -0
- package/dist/web/types.d.ts +20 -0
- package/dist/web/types.js +2 -0
- package/dist/web/types.js.map +1 -0
- package/package.json +86 -41
- package/tsconfig.base.json +33 -0
- package/dist/src/server/devtoolsStaticServer.d.ts +0 -15
- package/dist/src/server/devtoolsStaticServer.js +0 -38
- package/dist/src/server/devtoolsStaticServer.js.map +0 -1
- package/dist/src/server/index.d.ts +0 -5
- package/dist/src/server/index.js +0 -4
- package/dist/src/server/index.js.map +0 -1
- package/dist/src/server/inferUtilityTypes.js.map +0 -1
- package/dist/src/server/server.d.ts +0 -74
- package/dist/src/server/server.js +0 -82
- package/dist/src/server/server.js.map +0 -1
- package/dist/src/server/templateHelper.js +0 -30
- package/dist/src/server/templateHelper.js.map +0 -1
- package/dist/src/server/templates/development.hbs +0 -13
- package/dist/src/server/templates/production.hbs +0 -7
- package/dist/src/server/widgetsDevServer.d.ts +0 -12
- package/dist/src/server/widgetsDevServer.js +0 -39
- package/dist/src/server/widgetsDevServer.js.map +0 -1
- package/dist/src/test/utils.js +0 -242
- package/dist/src/test/utils.js.map +0 -1
- package/dist/src/test/widget.test.js +0 -146
- package/dist/src/test/widget.test.js.map +0 -1
- package/dist/src/web/bridges/apps-sdk-adapter.d.ts +0 -2
- package/dist/src/web/bridges/apps-sdk-adapter.js +0 -4
- package/dist/src/web/bridges/apps-sdk-adapter.js.map +0 -1
- package/dist/src/web/bridges/apps-sdk-bridge.d.ts +0 -8
- package/dist/src/web/bridges/apps-sdk-bridge.js +0 -41
- package/dist/src/web/bridges/apps-sdk-bridge.js.map +0 -1
- package/dist/src/web/bridges/get-bridge-methods.d.ts +0 -2
- package/dist/src/web/bridges/get-bridge-methods.js +0 -8
- package/dist/src/web/bridges/get-bridge-methods.js.map +0 -1
- package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.d.ts +0 -2
- package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.js +0 -7
- package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.js.map +0 -1
- package/dist/src/web/bridges/hooks/use-bridge.d.ts +0 -2
- package/dist/src/web/bridges/hooks/use-bridge.js +0 -90
- package/dist/src/web/bridges/hooks/use-bridge.js.map +0 -1
- package/dist/src/web/bridges/hooks/use-mcp-app-bridge.d.ts +0 -4
- package/dist/src/web/bridges/hooks/use-mcp-app-bridge.js +0 -7
- package/dist/src/web/bridges/hooks/use-mcp-app-bridge.js.map +0 -1
- package/dist/src/web/bridges/hooks/use-mcp-app-bridge.test.js +0 -58
- package/dist/src/web/bridges/hooks/use-mcp-app-bridge.test.js.map +0 -1
- package/dist/src/web/bridges/index.d.ts +0 -4
- package/dist/src/web/bridges/index.js +0 -5
- package/dist/src/web/bridges/index.js.map +0 -1
- package/dist/src/web/bridges/mcp-app-adapter.d.ts +0 -2
- package/dist/src/web/bridges/mcp-app-adapter.js +0 -12
- package/dist/src/web/bridges/mcp-app-adapter.js.map +0 -1
- package/dist/src/web/bridges/mcp-app-bridge.d.ts +0 -30
- package/dist/src/web/bridges/mcp-app-bridge.js +0 -139
- package/dist/src/web/bridges/mcp-app-bridge.js.map +0 -1
- package/dist/src/web/bridges/types.d.ts +0 -32
- package/dist/src/web/bridges/types.js.map +0 -1
- package/dist/src/web/create-store.d.ts +0 -3
- package/dist/src/web/create-store.js +0 -25
- package/dist/src/web/create-store.js.map +0 -1
- package/dist/src/web/create-store.test.js +0 -70
- package/dist/src/web/create-store.test.js.map +0 -1
- package/dist/src/web/data-llm.d.ts +0 -14
- package/dist/src/web/data-llm.js.map +0 -1
- package/dist/src/web/data-llm.test.js +0 -76
- package/dist/src/web/data-llm.test.js.map +0 -1
- package/dist/src/web/generate-helpers.js.map +0 -1
- package/dist/src/web/generate-helpers.test-d.js.map +0 -1
- package/dist/src/web/generate-helpers.test.js.map +0 -1
- package/dist/src/web/helpers/state.js +0 -40
- package/dist/src/web/helpers/state.js.map +0 -1
- package/dist/src/web/helpers/state.test.js.map +0 -1
- package/dist/src/web/hooks/index.d.ts +0 -11
- package/dist/src/web/hooks/index.js +0 -12
- package/dist/src/web/hooks/index.js.map +0 -1
- package/dist/src/web/hooks/use-call-tool.js +0 -60
- package/dist/src/web/hooks/use-call-tool.js.map +0 -1
- package/dist/src/web/hooks/use-call-tool.test-d.js.map +0 -1
- package/dist/src/web/hooks/use-call-tool.test.js.map +0 -1
- package/dist/src/web/hooks/use-display-mode.d.ts +0 -4
- package/dist/src/web/hooks/use-display-mode.js +0 -10
- package/dist/src/web/hooks/use-display-mode.js.map +0 -1
- package/dist/src/web/hooks/use-display-mode.test.js +0 -41
- package/dist/src/web/hooks/use-display-mode.test.js.map +0 -1
- package/dist/src/web/hooks/use-files.d.ts +0 -10
- package/dist/src/web/hooks/use-files.js +0 -7
- package/dist/src/web/hooks/use-files.js.map +0 -1
- package/dist/src/web/hooks/use-files.test.js +0 -29
- package/dist/src/web/hooks/use-files.test.js.map +0 -1
- package/dist/src/web/hooks/use-layout.d.ts +0 -22
- package/dist/src/web/hooks/use-layout.js +0 -23
- package/dist/src/web/hooks/use-layout.js.map +0 -1
- package/dist/src/web/hooks/use-layout.test.js +0 -46
- package/dist/src/web/hooks/use-layout.test.js.map +0 -1
- package/dist/src/web/hooks/use-open-external.d.ts +0 -1
- package/dist/src/web/hooks/use-open-external.js +0 -6
- package/dist/src/web/hooks/use-open-external.js.map +0 -1
- package/dist/src/web/hooks/use-open-external.test.js +0 -24
- package/dist/src/web/hooks/use-open-external.test.js.map +0 -1
- package/dist/src/web/hooks/use-openai-global.d.ts +0 -3
- package/dist/src/web/hooks/use-openai-global.js +0 -6
- package/dist/src/web/hooks/use-openai-global.js.map +0 -1
- package/dist/src/web/hooks/use-request-modal.d.ts +0 -9
- package/dist/src/web/hooks/use-request-modal.js +0 -14
- package/dist/src/web/hooks/use-request-modal.js.map +0 -1
- package/dist/src/web/hooks/use-request-modal.test.js.map +0 -1
- package/dist/src/web/hooks/use-send-follow-up-message.d.ts +0 -1
- package/dist/src/web/hooks/use-send-follow-up-message.js +0 -11
- package/dist/src/web/hooks/use-send-follow-up-message.js.map +0 -1
- package/dist/src/web/hooks/use-tool-info.d.ts +0 -25
- package/dist/src/web/hooks/use-tool-info.js +0 -20
- package/dist/src/web/hooks/use-tool-info.js.map +0 -1
- package/dist/src/web/hooks/use-tool-info.test-d.js.map +0 -1
- package/dist/src/web/hooks/use-tool-info.test.js +0 -60
- package/dist/src/web/hooks/use-tool-info.test.js.map +0 -1
- package/dist/src/web/hooks/use-user.js +0 -19
- package/dist/src/web/hooks/use-user.js.map +0 -1
- package/dist/src/web/hooks/use-user.test.js +0 -44
- package/dist/src/web/hooks/use-user.test.js.map +0 -1
- package/dist/src/web/hooks/use-widget-state.d.ts +0 -4
- package/dist/src/web/hooks/use-widget-state.js +0 -32
- package/dist/src/web/hooks/use-widget-state.js.map +0 -1
- package/dist/src/web/hooks/use-widget-state.test.js +0 -61
- package/dist/src/web/hooks/use-widget-state.test.js.map +0 -1
- package/dist/src/web/index.js.map +0 -1
- package/dist/src/web/mount-widget.d.ts +0 -1
- package/dist/src/web/mount-widget.js +0 -19
- package/dist/src/web/mount-widget.js.map +0 -1
- package/dist/src/web/plugin/data-llm.test.js +0 -81
- package/dist/src/web/plugin/data-llm.test.js.map +0 -1
- package/dist/src/web/plugin/plugin.d.ts +0 -2
- package/dist/src/web/plugin/plugin.js +0 -39
- package/dist/src/web/plugin/plugin.js.map +0 -1
- package/dist/src/web/plugin/transform-data-llm.d.ts +0 -12
- package/dist/src/web/plugin/transform-data-llm.js +0 -93
- package/dist/src/web/plugin/transform-data-llm.js.map +0 -1
- package/dist/src/web/plugin/transform-data-llm.test.js +0 -81
- package/dist/src/web/plugin/transform-data-llm.test.js.map +0 -1
- package/dist/src/web/proxy.js.map +0 -1
- package/dist/src/web/types.d.ts +0 -151
- package/dist/src/web/types.js.map +0 -1
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.config.js +0 -8
- package/dist/vitest.config.js.map +0 -1
- /package/dist/{src/test/widget.test.d.ts → cli/build-helpers.test.d.ts} +0 -0
- /package/dist/{src/web/bridges/hooks/use-mcp-app-bridge.test.d.ts → cli/build-steps.test.d.ts} +0 -0
- /package/dist/{src/web/create-store.test.d.ts → cli/tunnel-control-server.test.d.ts} +0 -0
- /package/dist/{src/web/data-llm.test.d.ts → cli/tunnel-handler.test.d.ts} +0 -0
- /package/dist/{src/web/generate-helpers.test-d.d.ts → cli/tunnel.test.d.ts} +0 -0
- /package/dist/{src/web/bridges → cli}/types.js +0 -0
- /package/dist/{src/web/generate-helpers.test.d.ts → context-warnings.test.d.ts} +0 -0
- /package/dist/{src/web/helpers/state.test.d.ts → server/app.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-call-tool.test-d.d.ts → server/asset-base-url-transform-plugin.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-display-mode.test.d.ts → server/auth/discovery.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-files.test.d.ts → server/auth/providers/auth0.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-layout.test.d.ts → server/auth/providers/authplane.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-open-external.test.d.ts → server/auth/providers/clerk.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-request-modal.test.d.ts → server/auth/providers/custom.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-tool-info.test-d.d.ts → server/auth/providers/descope.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-tool-info.test.d.ts → server/auth/providers/shared.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-user.test.d.ts → server/auth/security-schemes.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-widget-state.test.d.ts → server/auth/setup.test.d.ts} +0 -0
- /package/dist/{src/web/plugin/data-llm.test.d.ts → server/auth/verify.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-call-tool.test.d.ts → server/auth-extra.test-d.d.ts} +0 -0
- /package/dist/{src/web/plugin/transform-data-llm.test.d.ts → server/build-manifest.test.d.ts} +0 -0
- /package/dist/{src/server → server}/inferUtilityTypes.js +0 -0
- /package/dist/{src/web → web}/hooks/use-call-tool.test-d.js +0 -0
- /package/dist/{src/web → web}/proxy.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.test.js","sourceRoot":"","sources":["../../src/server/middleware.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,YAAY,EAIZ,aAAa,GACd,MAAM,iBAAiB,CAAC;AAEzB,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAC9E,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;QAC9B,MAAM,CAAC,aAAa,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,aAAa,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,CAAC,aAAa,CAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,MAAM,CAAC,aAAa,CAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,E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V,cAAc,CAAC;YACb,gBAAgB,EAAE,EAAE;YACpB,qBAAqB,EAAE,EAAE;SACjB,CAAC,CACZ,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG;YACX,gBAAgB,EAAE,MAAM;YACxB,qBAAqB,EAAE,QAAQ;SAChC,CAAC;QACF,MAAM,MAAM,GAAG,cAAc,CAAC,IAAa,CAAC,CAAC;QAC7C,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Client, InMemoryTransport } from \"@modelcontextprotocol/client\";\nimport { describe, expect, it, vi } from \"vitest\";\nimport { z } from \"zod\";\nimport { Skybridge } from \"./app.js\";\nimport {\n buildMiddlewareChain,\n getHandlerMaps,\n getToolError,\n type McpExtra,\n type McpMiddlewareEntry,\n type McpMiddlewareFn,\n matchesFilter,\n} from \"./middleware.js\";\n\n// ---------------------------------------------------------------------------\n// matchesFilter\n// ---------------------------------------------------------------------------\ndescribe(\"matchesFilter\", () => {\n it(\"matches exact method\", () => {\n expect(matchesFilter(\"tools/call\", \"tools/call\", false)).toBe(true);\n });\n\n it(\"rejects non-matching exact method\", () => {\n expect(matchesFilter(\"tools/list\", \"tools/call\", false)).toBe(false);\n });\n\n it(\"matches wildcard\", () => {\n expect(matchesFilter(\"tools/call\", \"tools/*\", false)).toBe(true);\n expect(matchesFilter(\"tools/list\", \"tools/*\", false)).toBe(true);\n });\n\n it(\"rejects non-matching wildcard\", () => {\n expect(matchesFilter(\"resources/read\", \"tools/*\", false)).toBe(false);\n });\n\n it('category \"request\" matches when isNotification=false', () => {\n expect(matchesFilter(\"tools/call\", \"request\", false)).toBe(true);\n });\n\n it('category \"request\" rejects when isNotification=true', () => {\n expect(matchesFilter(\"notifications/initialized\", \"request\", true)).toBe(\n false,\n );\n });\n\n it('category \"notification\" matches when isNotification=true', () => {\n expect(\n matchesFilter(\"notifications/initialized\", \"notification\", true),\n ).toBe(true);\n });\n\n it('category \"notification\" rejects when isNotification=false', () => {\n expect(matchesFilter(\"tools/call\", \"notification\", false)).toBe(false);\n });\n});\n\n// ---------------------------------------------------------------------------\n// buildMiddlewareChain\n// ---------------------------------------------------------------------------\ndescribe(\"buildMiddlewareChain\", () => {\n const fakeExtra = {} as McpExtra;\n\n const makeHandler = (returnValue: unknown) => vi.fn(async () => returnValue);\n\n const makeEntry = (\n filter: McpMiddlewareEntry[\"filter\"],\n handler: McpMiddlewareFn,\n ): McpMiddlewareEntry => ({ filter, handler });\n\n it(\"returns original handler when no middleware applies\", () => {\n const original = makeHandler(\"result\");\n const chain = buildMiddlewareChain(\"tools/call\", false, original, [\n makeEntry(\"resources/*\", async (_req, _extra, next) => next()),\n ]);\n expect(chain).toBe(original);\n });\n\n it(\"catch-all middleware runs for any method\", async () => {\n const original = makeHandler(\"ok\");\n const spy = vi.fn();\n const chain = buildMiddlewareChain(\"tools/call\", false, original, [\n makeEntry(null, async (request, _extra, next) => {\n spy(request.method);\n return next();\n }),\n ]);\n const result = await chain({ method: \"tools/call\", params: {} }, fakeExtra);\n expect(spy).toHaveBeenCalledWith(\"tools/call\");\n expect(result).toBe(\"ok\");\n });\n\n it(\"method-scoped middleware only runs for matching methods\", async () => {\n const original = makeHandler(\"ok\");\n const spy = vi.fn();\n const entries = [\n makeEntry(\"tools/call\", async (_req, _extra, next) => {\n spy(\"tools/call\");\n return next();\n }),\n ];\n\n // Matching\n const chain1 = buildMiddlewareChain(\"tools/call\", false, original, entries);\n await chain1({ method: \"tools/call\", params: {} }, fakeExtra);\n expect(spy).toHaveBeenCalledTimes(1);\n\n // Non-matching — returns original handler directly\n const chain2 = buildMiddlewareChain(\"tools/list\", false, original, entries);\n expect(chain2).toBe(original);\n });\n\n it(\"executes middleware in registration order (onion model)\", async () => {\n const calls: string[] = [];\n const original = makeHandler(\"result\");\n\n const chain = buildMiddlewareChain(\"tools/call\", false, original, [\n makeEntry(null, async (_req, _extra, next) => {\n calls.push(\"A:before\");\n const result = await next();\n calls.push(\"A:after\");\n return result;\n }),\n makeEntry(null, async (_req, _extra, next) => {\n calls.push(\"B:before\");\n const result = await next();\n calls.push(\"B:after\");\n return result;\n }),\n ]);\n\n await chain({ method: \"tools/call\", params: {} }, fakeExtra);\n expect(calls).toEqual([\"A:before\", \"B:before\", \"B:after\", \"A:after\"]);\n });\n\n it(\"short-circuit (no next() call) skips handler\", async () => {\n const original = makeHandler(\"original\");\n const chain = buildMiddlewareChain(\"tools/call\", false, original, [\n makeEntry(null, async () => \"short-circuited\"),\n ]);\n const result = await chain({ method: \"tools/call\", params: {} }, fakeExtra);\n expect(result).toBe(\"short-circuited\");\n expect(original).not.toHaveBeenCalled();\n });\n\n it(\"middleware can modify result post-next()\", async () => {\n const original = makeHandler({ value: 1 });\n const chain = buildMiddlewareChain(\"tools/call\", false, original, [\n makeEntry(null, async (_req, _extra, next) => {\n const result = (await next()) as { value: number };\n return { value: result.value + 10 };\n }),\n ]);\n const result = await chain({ method: \"tools/call\", params: {} }, fakeExtra);\n expect(result).toEqual({ value: 11 });\n });\n\n it(\"throws on double next() call\", async () => {\n const original = makeHandler(\"ok\");\n const chain = buildMiddlewareChain(\"tools/call\", false, original, [\n makeEntry(null, async (_req, _extra, next) => {\n await next();\n return next(); // double call\n }),\n ]);\n await expect(\n chain({ method: \"tools/call\", params: {} }, fakeExtra),\n ).rejects.toThrow(\"next() called multiple times\");\n });\n\n it(\"propagates errors from handler and middleware\", async () => {\n // Error from original handler bubbles through middleware\n const failingHandler = vi.fn(async () => {\n throw new Error(\"handler boom\");\n });\n const chain1 = buildMiddlewareChain(\"tools/call\", false, failingHandler, [\n makeEntry(null, async (_req, _extra, next) => next()),\n ]);\n await expect(\n chain1({ method: \"tools/call\", params: {} }, fakeExtra),\n ).rejects.toThrow(\"handler boom\");\n\n // Error thrown inside middleware propagates\n const chain2 = buildMiddlewareChain(\n \"tools/call\",\n false,\n makeHandler(\"ok\"),\n [\n makeEntry(null, async () => {\n throw new Error(\"middleware boom\");\n }),\n ],\n );\n await expect(\n chain2({ method: \"tools/call\", params: {} }, fakeExtra),\n ).rejects.toThrow(\"middleware boom\");\n });\n\n it(\"passes extra as undefined for notifications (isNotification=true)\", async () => {\n const original = makeHandler(undefined);\n let capturedExtra: McpExtra | undefined = {} as McpExtra;\n const chain = buildMiddlewareChain(\n \"notifications/initialized\",\n true,\n original,\n [\n makeEntry(null, async (_req, extra, next) => {\n capturedExtra = extra;\n return next();\n }),\n ],\n );\n await chain({ method: \"notifications/initialized\" });\n expect(capturedExtra).toBeUndefined();\n });\n\n it(\"defaults params to empty object when rawRequest has no params\", async () => {\n const original = makeHandler(\"ok\");\n let capturedParams: Record<string, unknown> | undefined;\n const chain = buildMiddlewareChain(\"tools/call\", false, original, [\n makeEntry(null, async (request, _extra, next) => {\n capturedParams = request.params;\n return next();\n }),\n ]);\n await chain({ method: \"tools/call\" }, fakeExtra);\n expect(capturedParams).toEqual({});\n });\n\n it(\"propagates in-place param mutation to original handler\", async () => {\n let handlerReceivedName = \"\";\n const original = vi.fn(async (rawReq: { params: { name: string } }) => {\n handlerReceivedName = rawReq.params.name;\n return \"ok\";\n });\n\n const chain = buildMiddlewareChain(\n \"tools/call\",\n false,\n original as unknown as (...args: unknown[]) => Promise<unknown>,\n [\n makeEntry(null, async (request, _extra, next) => {\n request.params.name = \"mutated\";\n return next();\n }),\n ],\n );\n\n await chain({ params: { name: \"original\" } }, fakeExtra);\n expect(handlerReceivedName).toBe(\"mutated\");\n });\n\n it(\"propagates full param replacement to original handler\", async () => {\n let handlerReceivedParams: Record<string, unknown> = {};\n const original = vi.fn(\n async (rawReq: { params: Record<string, unknown> }) => {\n handlerReceivedParams = rawReq.params;\n return \"ok\";\n },\n );\n\n const chain = buildMiddlewareChain(\n \"tools/call\",\n false,\n original as unknown as (...args: unknown[]) => Promise<unknown>,\n [\n makeEntry(null, async (request, _extra, next) => {\n request.params = { replaced: true };\n return next();\n }),\n ],\n );\n\n await chain({ params: { original: true } }, fakeExtra);\n expect(handlerReceivedParams).toEqual({ replaced: true });\n });\n});\n\n// ---------------------------------------------------------------------------\n// McpServer.mcpMiddleware() integration tests\n// ---------------------------------------------------------------------------\ndescribe(\"McpServer.mcpMiddleware()\", () => {\n function createClient() {\n return new Client({ name: \"test-client\", version: \"1.0.0\" });\n }\n\n it(\"returns this for chaining\", () => {\n new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) => {\n const result = server.mcpMiddleware(async (_req, _extra, next) =>\n next(),\n );\n expect(result).toBe(server);\n return server;\n },\n });\n });\n\n it(\"intercepts tools/call and exposes request params\", async () => {\n let capturedMethod = \"\";\n let capturedParams: Record<string, unknown> = {};\n\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) => {\n server.registerTool(\n {\n name: \"greet\",\n description: \"greet\",\n inputSchema: { name: z.string() },\n },\n (args) => ({\n content: [{ type: \"text\" as const, text: `hi ${args.name}` }],\n }),\n );\n server.mcpMiddleware(\"tools/call\", async (request, _extra, next) => {\n capturedMethod = request.method;\n capturedParams = request.params;\n return next();\n });\n\n return server;\n },\n });\n\n const client = createClient();\n const [clientTransport, serverTransport] =\n InMemoryTransport.createLinkedPair();\n const instance = await app.createServerInstance();\n await instance.connect(serverTransport);\n await client.connect(clientTransport);\n\n const result = await client.callTool({\n name: \"greet\",\n arguments: { name: \"World\" },\n });\n expect(capturedMethod).toBe(\"tools/call\");\n expect(capturedParams).toMatchObject({\n name: \"greet\",\n arguments: { name: \"World\" },\n });\n expect(result.content).toEqual([{ type: \"text\", text: \"hi World\" }]);\n\n await client.close();\n await instance.close();\n });\n\n it(\"array filter works\", async () => {\n const matchedMethods: string[] = [];\n\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) => {\n server.registerTool({ name: \"t1\", description: \"t1\" }, () => ({\n content: [{ type: \"text\" as const, text: \"ok\" }],\n }));\n server.mcpMiddleware(\n [\"tools/call\", \"tools/list\"],\n async (request, _extra, next) => {\n matchedMethods.push(request.method);\n return next();\n },\n );\n\n return server;\n },\n });\n\n const client = createClient();\n const [clientTransport, serverTransport] =\n InMemoryTransport.createLinkedPair();\n const instance = await app.createServerInstance();\n await instance.connect(serverTransport);\n await client.connect(clientTransport);\n\n await client.listTools();\n await client.callTool({ name: \"t1\" });\n\n expect(matchedMethods).toEqual([\"tools/list\", \"tools/call\"]);\n\n await client.close();\n await instance.close();\n });\n\n it(\"throws when filter provided without handler\", async () => {\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) =>\n // @ts-expect-error intentionally passing filter without handler\n server.mcpMiddleware(\"tools/call\"),\n });\n await expect(app.createServerInstance()).rejects.toThrow(\n \"mcpMiddleware requires a handler function\",\n );\n });\n\n it(\"catch-all middleware + filtered middleware stack correctly\", async () => {\n const calls: string[] = [];\n\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) => {\n server.registerTool({ name: \"t1\", description: \"t1\" }, () => ({\n content: [{ type: \"text\" as const, text: \"ok\" }],\n }));\n server\n .mcpMiddleware(async (request, _extra, next) => {\n calls.push(`global:${request.method}`);\n return next();\n })\n .mcpMiddleware(\"tools/call\", async (_req, _extra, next) => {\n calls.push(\"tools-only\");\n return next();\n });\n\n return server;\n },\n });\n\n const client = createClient();\n const [clientTransport, serverTransport] =\n InMemoryTransport.createLinkedPair();\n const instance = await app.createServerInstance();\n await instance.connect(serverTransport);\n await client.connect(clientTransport);\n\n await client.listTools();\n await client.callTool({ name: \"t1\" });\n\n // Catch-all also intercepts initialize + notifications/initialized from handshake.\n // tools/list: only global middleware runs\n // tools/call: global + tools-only both run\n expect(calls).toContain(\"global:tools/list\");\n expect(calls).toContain(\"global:tools/call\");\n expect(calls).toContain(\"tools-only\");\n // \"tools-only\" must come right after \"global:tools/call\"\n const toolsCallIdx = calls.indexOf(\"global:tools/call\");\n expect(calls[toolsCallIdx + 1]).toBe(\"tools-only\");\n\n await client.close();\n await instance.close();\n });\n\n it(\"notification middleware receives extra as undefined\", async () => {\n let capturedExtra: unknown = \"sentinel\";\n\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) => {\n server.registerTool({ name: \"t1\", description: \"t1\" }, () => ({\n content: [{ type: \"text\" as const, text: \"ok\" }],\n }));\n server.mcpMiddleware(\"notification\", async (_request, extra, next) => {\n capturedExtra = extra;\n return next();\n });\n\n return server;\n },\n });\n\n const client = createClient();\n const [clientTransport, serverTransport] =\n InMemoryTransport.createLinkedPair();\n const instance = await app.createServerInstance();\n await instance.connect(serverTransport);\n await client.connect(clientTransport);\n\n // The client sends notifications/initialized automatically on connect.\n await client.listTools();\n expect(capturedExtra).toBeUndefined();\n\n await client.close();\n await instance.close();\n });\n\n it(\"wildcard filter intercepts matching methods only\", async () => {\n const matchedMethods: string[] = [];\n\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) => {\n server.registerTool({ name: \"t1\", description: \"t1\" }, () => ({\n content: [{ type: \"text\" as const, text: \"ok\" }],\n }));\n server.mcpMiddleware(\"tools/*\", async (request, _extra, next) => {\n matchedMethods.push(request.method);\n return next();\n });\n\n return server;\n },\n });\n\n const client = createClient();\n const [clientTransport, serverTransport] =\n InMemoryTransport.createLinkedPair();\n const instance = await app.createServerInstance();\n await instance.connect(serverTransport);\n await client.connect(clientTransport);\n\n await client.listTools();\n await client.callTool({ name: \"t1\" });\n\n expect(matchedMethods).toContain(\"tools/list\");\n expect(matchedMethods).toContain(\"tools/call\");\n // Should not match initialize or notifications\n expect(matchedMethods).not.toContain(\"initialize\");\n expect(matchedMethods).not.toContain(\"notifications/initialized\");\n\n await client.close();\n await instance.close();\n });\n\n it(\"middleware can modify tool result via Skybridge integration\", async () => {\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) => {\n server.registerTool(\n {\n name: \"greet\",\n description: \"greet\",\n inputSchema: { name: z.string() },\n },\n (args) => ({\n content: [{ type: \"text\" as const, text: `hi ${args.name}` }],\n }),\n );\n server.mcpMiddleware(\"tools/call\", async (_req, _extra, next) => {\n const result = (await next()) as {\n content: { type: string; text: string }[];\n };\n return {\n ...result,\n content: [\n ...result.content,\n { type: \"text\" as const, text: \" (modified)\" },\n ],\n };\n });\n\n return server;\n },\n });\n\n const client = createClient();\n const [clientTransport, serverTransport] =\n InMemoryTransport.createLinkedPair();\n const instance = await app.createServerInstance();\n await instance.connect(serverTransport);\n await client.connect(clientTransport);\n\n const result = await client.callTool({\n name: \"greet\",\n arguments: { name: \"World\" },\n });\n expect(result.content).toEqual([\n { type: \"text\", text: \"hi World\" },\n { type: \"text\", text: \" (modified)\" },\n ]);\n\n await client.close();\n await instance.close();\n });\n\n it(\"middleware can short-circuit via Skybridge integration\", async () => {\n const handlerCalled = vi.fn();\n\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) => {\n server.registerTool({ name: \"t1\", description: \"t1\" }, () => {\n handlerCalled();\n return {\n content: [{ type: \"text\" as const, text: \"original\" }],\n };\n });\n server.mcpMiddleware(\"tools/call\", async () => ({\n content: [{ type: \"text\" as const, text: \"short-circuited\" }],\n }));\n\n return server;\n },\n });\n\n const client = createClient();\n const [clientTransport, serverTransport] =\n InMemoryTransport.createLinkedPair();\n const instance = await app.createServerInstance();\n await instance.connect(serverTransport);\n await client.connect(clientTransport);\n\n const result = await client.callTool({ name: \"t1\" });\n expect(result.content).toEqual([{ type: \"text\", text: \"short-circuited\" }]);\n expect(handlerCalled).not.toHaveBeenCalled();\n\n await client.close();\n await instance.close();\n });\n\n it(\"exposes a thrown tool error to middleware via getToolError\", async () => {\n const schemaError = new Error(\"boom with schema\");\n const schemalessError = new Error(\"boom without schema\");\n let captured: unknown;\n\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) => {\n server.registerTool(\n {\n name: \"withSchema\",\n description: \"withSchema\",\n inputSchema: { name: z.string() },\n },\n () => {\n throw schemaError;\n },\n );\n server.registerTool(\n { name: \"withoutSchema\", description: \"withoutSchema\" },\n () => {\n throw schemalessError;\n },\n );\n server.mcpMiddleware(\"tools/call\", async (_request, extra, next) => {\n const result = await next();\n captured = getToolError(extra);\n return result;\n });\n\n return server;\n },\n });\n\n const client = createClient();\n const [clientTransport, serverTransport] =\n InMemoryTransport.createLinkedPair();\n const instance = await app.createServerInstance();\n await instance.connect(serverTransport);\n await client.connect(clientTransport);\n\n const withSchema = await client.callTool({\n name: \"withSchema\",\n arguments: { name: \"World\" },\n });\n expect(withSchema.isError).toBe(true);\n expect(captured).toBe(schemaError);\n\n const withoutSchema = await client.callTool({ name: \"withoutSchema\" });\n expect(withoutSchema.isError).toBe(true);\n expect(captured).toBe(schemalessError);\n\n await client.close();\n await instance.close();\n });\n\n it(\"middleware can mutate tool call params via Skybridge integration\", async () => {\n let receivedName = \"\";\n\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) => {\n server.registerTool(\n {\n name: \"greet\",\n description: \"greet\",\n inputSchema: { name: z.string() },\n },\n (args) => {\n receivedName = args.name;\n return {\n content: [{ type: \"text\" as const, text: `hi ${args.name}` }],\n };\n },\n );\n server.mcpMiddleware(\"tools/call\", async (request, _extra, next) => {\n request.params.arguments = { name: \"Overridden\" };\n return next();\n });\n\n return server;\n },\n });\n\n const client = createClient();\n const [clientTransport, serverTransport] =\n InMemoryTransport.createLinkedPair();\n const instance = await app.createServerInstance();\n await instance.connect(serverTransport);\n await client.connect(clientTransport);\n\n await client.callTool({\n name: \"greet\",\n arguments: { name: \"Original\" },\n });\n expect(receivedName).toBe(\"Overridden\");\n\n await client.close();\n await instance.close();\n });\n\n it(\"category 'request' filter matches requests but not notifications\", async () => {\n const matchedMethods: string[] = [];\n\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) => {\n server.registerTool({ name: \"t1\", description: \"t1\" }, () => ({\n content: [{ type: \"text\" as const, text: \"ok\" }],\n }));\n server.mcpMiddleware(\"request\", async (request, _extra, next) => {\n matchedMethods.push(request.method);\n return next();\n });\n\n return server;\n },\n });\n\n const client = createClient();\n const [clientTransport, serverTransport] =\n InMemoryTransport.createLinkedPair();\n const instance = await app.createServerInstance();\n await instance.connect(serverTransport);\n await client.connect(clientTransport);\n\n await client.listTools();\n await client.callTool({ name: \"t1\" });\n\n expect(matchedMethods).toContain(\"tools/list\");\n expect(matchedMethods).toContain(\"tools/call\");\n expect(matchedMethods).not.toContain(\"notifications/initialized\");\n\n await client.close();\n await instance.close();\n });\n});\n\n// ---------------------------------------------------------------------------\n// getHandlerMaps\n// ---------------------------------------------------------------------------\ndescribe(\"getHandlerMaps\", () => {\n it(\"throws for incompatible server objects\", () => {\n // Empty object\n expect(() => getHandlerMaps({} as never)).toThrow(\n \"Incompatible MCP SDK version\",\n );\n // Only _requestHandlers (missing _notificationHandlers)\n expect(() =>\n getHandlerMaps({ _requestHandlers: new Map() } as never),\n ).toThrow(\"Incompatible MCP SDK version\");\n // Non-Map values\n expect(() =>\n getHandlerMaps({\n _requestHandlers: {},\n _notificationHandlers: {},\n } as never),\n ).toThrow(\"Incompatible MCP SDK version\");\n });\n\n it(\"returns handler maps from valid server\", () => {\n const reqMap = new Map();\n const notifMap = new Map();\n const fake = {\n _requestHandlers: reqMap,\n _notificationHandlers: notifMap,\n };\n const result = getHandlerMaps(fake as never);\n expect(result.requestHandlers).toBe(reqMap);\n expect(result.notificationHandlers).toBe(notifMap);\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Client, InMemoryTransport } from "@modelcontextprotocol/client";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { Skybridge } from "./app.js";
|
|
4
|
+
describe("registerTool handler invocation", () => {
|
|
5
|
+
it("passes empty args and a usable extra to a schema-less tool handler", async () => {
|
|
6
|
+
let received;
|
|
7
|
+
const app = new Skybridge({
|
|
8
|
+
name: "test",
|
|
9
|
+
version: "1.0.0",
|
|
10
|
+
handler: (server) => server.registerTool({ name: "no-input", description: "no-input" }, async (args, extra) => {
|
|
11
|
+
received = { args, extra };
|
|
12
|
+
return { content: [{ type: "text", text: "ok" }] };
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
const instance = await app.createServerInstance();
|
|
16
|
+
const client = new Client({ name: "client", version: "1.0.0" });
|
|
17
|
+
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
|
|
18
|
+
await instance.connect(serverTransport);
|
|
19
|
+
await client.connect(clientTransport);
|
|
20
|
+
await client.callTool({ name: "no-input" });
|
|
21
|
+
expect(received?.args).toEqual({});
|
|
22
|
+
expect(received?.extra).toHaveProperty("mcpReq.send");
|
|
23
|
+
await client.close();
|
|
24
|
+
await instance.close();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=register-tool.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-tool.test.js","sourceRoot":"","sources":["../../src/server/register-tool.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC/C,EAAE,CAAC,oEAAoE,EAAE,KAAK,IAAI,EA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AAC","sourcesContent":["import { Client, InMemoryTransport } from \"@modelcontextprotocol/client\";\nimport { describe, expect, it } from \"vitest\";\nimport { Skybridge } from \"./app.js\";\n\ndescribe(\"registerTool handler invocation\", () => {\n it(\"passes empty args and a usable extra to a schema-less tool handler\", async () => {\n let received: { args: unknown; extra: unknown } | undefined;\n const app = new Skybridge({\n name: \"test\",\n version: \"1.0.0\",\n handler: (server) =>\n server.registerTool(\n { name: \"no-input\", description: \"no-input\" },\n async (args, extra) => {\n received = { args, extra };\n return { content: [{ type: \"text\", text: \"ok\" }] };\n },\n ),\n });\n const instance = await app.createServerInstance();\n\n const client = new Client({ name: \"client\", version: \"1.0.0\" });\n const [clientTransport, serverTransport] =\n InMemoryTransport.createLinkedPair();\n await instance.connect(serverTransport);\n await client.connect(clientTransport);\n\n await client.callTool({ name: \"no-input\" });\n\n expect(received?.args).toEqual({});\n expect(received?.extra).toHaveProperty(\"mcpReq.send\");\n\n await client.close();\n await instance.close();\n });\n});\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves this server's public origin from request headers, in precedence
|
|
3
|
+
* `x-forwarded-host` → `host` → localhost dev fallback. Shared by view serving
|
|
4
|
+
* and OAuth metadata so the two can't drift. `Origin` is deliberately ignored:
|
|
5
|
+
* it carries the *caller's* site, not this server's.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveServerOrigin(header: (key: string) => string | undefined): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves this server's public origin from request headers, in precedence
|
|
3
|
+
* `x-forwarded-host` → `host` → localhost dev fallback. Shared by view serving
|
|
4
|
+
* and OAuth metadata so the two can't drift. `Origin` is deliberately ignored:
|
|
5
|
+
* it carries the *caller's* site, not this server's.
|
|
6
|
+
*/
|
|
7
|
+
export function resolveServerOrigin(header) {
|
|
8
|
+
// Proxies may send X-Forwarded-* as a comma-separated chain; the client-facing
|
|
9
|
+
// hop is the first entry.
|
|
10
|
+
const firstHop = (value) => value?.split(",")[0]?.trim();
|
|
11
|
+
const forwardedHost = firstHop(header("x-forwarded-host"));
|
|
12
|
+
if (forwardedHost) {
|
|
13
|
+
const proto = firstHop(header("x-forwarded-proto")) || "https";
|
|
14
|
+
return `${proto}://${forwardedHost}`;
|
|
15
|
+
}
|
|
16
|
+
const host = header("host");
|
|
17
|
+
if (host) {
|
|
18
|
+
const proto = ["127.0.0.1:", "localhost:"].some((p) => host.startsWith(p))
|
|
19
|
+
? "http"
|
|
20
|
+
: "https";
|
|
21
|
+
return `${proto}://${host}`;
|
|
22
|
+
}
|
|
23
|
+
return `http://localhost:${process.env.__PORT || "3000"}`;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=requestOrigin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestOrigin.js","sourceRoot":"","sources":["../../src/server/requestOrigin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAA2C;IAE3C,+EAA+E;IAC/E,0BAA0B;IAC1B,MAAM,QAAQ,GAAG,CAAC,KAAyB,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IAC7E,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC3D,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,IAAI,OAAO,CAAC;QAC/D,OAAO,GAAG,KAAK,MAAM,aAAa,EAAE,CAAC;IACvC,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5B,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,KAAK,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACxE,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,OAAO,CAAC;QACZ,OAAO,GAAG,KAAK,MAAM,IAAI,EAAE,CAAC;IAC9B,CAAC;IACD,OAAO,oBAAoB,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;AAC5D,CAAC","sourcesContent":["/**\n * Resolves this server's public origin from request headers, in precedence\n * `x-forwarded-host` → `host` → localhost dev fallback. Shared by view serving\n * and OAuth metadata so the two can't drift. `Origin` is deliberately ignored:\n * it carries the *caller's* site, not this server's.\n */\nexport function resolveServerOrigin(\n header: (key: string) => string | undefined,\n): string {\n // Proxies may send X-Forwarded-* as a comma-separated chain; the client-facing\n // hop is the first entry.\n const firstHop = (value: string | undefined) => value?.split(\",\")[0]?.trim();\n const forwardedHost = firstHop(header(\"x-forwarded-host\"));\n if (forwardedHost) {\n const proto = firstHop(header(\"x-forwarded-proto\")) || \"https\";\n return `${proto}://${forwardedHost}`;\n }\n const host = header(\"host\");\n if (host) {\n const proto = [\"127.0.0.1:\", \"localhost:\"].some((p) => host.startsWith(p))\n ? \"http\"\n : \"https\";\n return `${proto}://${host}`;\n }\n return `http://localhost:${process.env.__PORT || \"3000\"}`;\n}\n"]}
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import type { McpUiToolMeta } from "@modelcontextprotocol/ext-apps";
|
|
2
|
+
import { type ContentBlock, type Implementation, McpServer as McpServerBase, type RequestMeta, type ServerOptions, type ServerResult, type StandardSchemaV1, type StandardSchemaWithJSON, type ToolAnnotations } from "@modelcontextprotocol/server";
|
|
3
|
+
import type express from "express";
|
|
4
|
+
import type { ResourceMetadataUrlResolver } from "./auth/setup.js";
|
|
5
|
+
import type { ExtraClaims } from "./auth.js";
|
|
6
|
+
import type { McpExtra, McpExtraFor, McpMethodString, McpMiddlewareEntry, McpMiddlewareFilter, McpMiddlewareFn, McpResultFor, McpTypedMiddlewareFn, McpWildcard } from "./middleware.js";
|
|
7
|
+
import { type SkillsManifest } from "./skills.js";
|
|
8
|
+
/**
|
|
9
|
+
* Type marker for a registered tool — carries its input, output, and response
|
|
10
|
+
* metadata shapes so views can infer types from `typeof server`.
|
|
11
|
+
*
|
|
12
|
+
* You normally never construct this by hand; it is produced by `registerTool`
|
|
13
|
+
* and consumed by helpers like {@link InferTools} and {@link generateHelpers}.
|
|
14
|
+
*/
|
|
15
|
+
export type ToolDef<TInput = unknown, TOutput = unknown, TResponseMetadata = unknown> = {
|
|
16
|
+
input: TInput;
|
|
17
|
+
output: TOutput;
|
|
18
|
+
responseMetadata: TResponseMetadata;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Content Security Policy origins attached to a view's resource. Each list is
|
|
22
|
+
* passed through to the host's CSP for the view iframe; omit a field to inherit
|
|
23
|
+
* the host's default for that directive.
|
|
24
|
+
*/
|
|
25
|
+
export interface ViewCsp {
|
|
26
|
+
/** Origins for static assets (images, fonts, scripts, styles). */
|
|
27
|
+
resourceDomains?: string[];
|
|
28
|
+
/** Origins the view may contact via fetch/XHR. */
|
|
29
|
+
connectDomains?: string[];
|
|
30
|
+
/** Origins allowed for iframe embeds (opts into stricter app review). */
|
|
31
|
+
frameDomains?: string[];
|
|
32
|
+
/** Origins that can receive openExternal redirects without the safe-link modal. */
|
|
33
|
+
redirectDomains?: string[];
|
|
34
|
+
/** Origins allowed in `<base href>` tags (mcp-apps only). */
|
|
35
|
+
baseUriDomains?: string[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Registry of view component names. The Skybridge Vite plugin augments this
|
|
39
|
+
* interface in the generated `.skybridge/views.d.ts` with one key per view
|
|
40
|
+
* file, which narrows {@link ViewName} from `string` to the concrete union.
|
|
41
|
+
*/
|
|
42
|
+
export interface ViewNameRegistry {
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Resolve view component names from a registry: the union of its keys, or
|
|
46
|
+
* `string` when the registry is empty. The empty case happens before
|
|
47
|
+
* `.skybridge/views.d.ts` is generated; falling back to `string` keeps valid
|
|
48
|
+
* view names from erroring on a fresh checkout, and narrowing kicks in once
|
|
49
|
+
* the generated file augments the registry.
|
|
50
|
+
*/
|
|
51
|
+
export type ViewNameFor<Registry> = [keyof Registry & string] extends [never] ? string : keyof Registry & string;
|
|
52
|
+
/** Union of valid view component names. Narrowed by {@link ViewNameRegistry}. */
|
|
53
|
+
export type ViewName = ViewNameFor<ViewNameRegistry>;
|
|
54
|
+
/**
|
|
55
|
+
* Pass under `view` in a tool's `registerTool` config to render the tool's
|
|
56
|
+
* result through a Skybridge view instead of a plain text response.
|
|
57
|
+
*/
|
|
58
|
+
export interface ViewConfig {
|
|
59
|
+
/** Filename of the view module (without extension) — matches a file in your `viewsDir`. */
|
|
60
|
+
component: ViewName;
|
|
61
|
+
/** Human-readable label the host may show alongside the view. */
|
|
62
|
+
description?: string;
|
|
63
|
+
/** Request a visible border around the view (forwarded as `ui.prefersBorder`). */
|
|
64
|
+
prefersBorder?: boolean;
|
|
65
|
+
/** Override the iframe's served domain (advanced; forwarded as `ui.domain`). */
|
|
66
|
+
domain?: string;
|
|
67
|
+
/** Per-view CSP overrides — see {@link ViewCsp}. */
|
|
68
|
+
csp?: ViewCsp;
|
|
69
|
+
/** Free-form metadata forwarded on the view resource's `_meta`. */
|
|
70
|
+
_meta?: Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
export type SecurityScheme = {
|
|
73
|
+
type: "noauth";
|
|
74
|
+
} | {
|
|
75
|
+
type: "oauth2";
|
|
76
|
+
scopes?: string[];
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Declarative per-tool auth. Enforced when the server has an `oauth` provider:
|
|
80
|
+
* anonymous or under-scoped calls are rejected before the handler runs. Omit
|
|
81
|
+
* `auth` entirely for the secure default (sign-in required, no specific scope).
|
|
82
|
+
*/
|
|
83
|
+
export type ToolAuth = {
|
|
84
|
+
/**
|
|
85
|
+
* When `true`, the tool is callable signed out; the token is still used when
|
|
86
|
+
* one is present. Omit (or `false`) to require sign-in.
|
|
87
|
+
*/
|
|
88
|
+
allowsAnonymous?: boolean;
|
|
89
|
+
/** OAuth scopes the caller's token must carry to invoke the tool. */
|
|
90
|
+
scopes?: string[];
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Options forwarded to the built-in `express.json()` body parser. Derived
|
|
94
|
+
* from Express's own types so the public API doesn't depend on `body-parser`.
|
|
95
|
+
*/
|
|
96
|
+
export type JsonOptions = NonNullable<Parameters<typeof express.json>[0]>;
|
|
97
|
+
/**
|
|
98
|
+
* The Skybridge-specific options an {@link McpServer} is built with. A
|
|
99
|
+
* {@link Skybridge} app derives them from its config; pass them directly only
|
|
100
|
+
* when constructing an `McpServer` by hand.
|
|
101
|
+
*/
|
|
102
|
+
export interface SkybridgeServerOptions {
|
|
103
|
+
/** Whether an OAuth provider guards `/mcp`; enables per-tool scheme enforcement. */
|
|
104
|
+
oauth?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* @experimental Serve Agent Skills from `src/skills` over MCP (SEP-2640).
|
|
107
|
+
* API may change.
|
|
108
|
+
*/
|
|
109
|
+
skills?: boolean;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Well-known keys recognized by host runtimes when set on a tool's `_meta`.
|
|
113
|
+
* Use {@link ToolMeta} to also pass arbitrary custom metadata alongside these.
|
|
114
|
+
*
|
|
115
|
+
* @see https://developers.openai.com/apps-sdk/reference#tool-descriptor-parameters
|
|
116
|
+
*/
|
|
117
|
+
export interface KnownToolMeta {
|
|
118
|
+
/** Apps SDK: allow the rendered view to call this tool from inside its iframe. */
|
|
119
|
+
"openai/widgetAccessible"?: boolean;
|
|
120
|
+
/** Apps SDK: status text shown while the tool is running (e.g. `"Searching trips"`). */
|
|
121
|
+
"openai/toolInvocation/invoking"?: string;
|
|
122
|
+
/** Apps SDK: status text shown once the tool returns (e.g. `"Found 3 trips"`). */
|
|
123
|
+
"openai/toolInvocation/invoked"?: string;
|
|
124
|
+
/** Apps SDK: input parameters that hold file references — the host attaches uploaded files to them. */
|
|
125
|
+
"openai/fileParams"?: string[];
|
|
126
|
+
/** MCP Apps: control whether the tool is exposed to the model, the app, or both. */
|
|
127
|
+
ui?: Pick<McpUiToolMeta, "visibility">;
|
|
128
|
+
}
|
|
129
|
+
/** {@link KnownToolMeta} merged with arbitrary string-keyed metadata for custom flags. */
|
|
130
|
+
export type ToolMeta = KnownToolMeta & Record<string, unknown>;
|
|
131
|
+
/**
|
|
132
|
+
* Convenient return type for tool handlers — a plain string, a single
|
|
133
|
+
* {@link ContentBlock}, or an array. Skybridge normalizes it to the MCP
|
|
134
|
+
* `content: ContentBlock[]` shape before responding.
|
|
135
|
+
*/
|
|
136
|
+
export type HandlerContent = string | ContentBlock | ContentBlock[];
|
|
137
|
+
/**
|
|
138
|
+
* Type-level marker interface for cross-package type inference.
|
|
139
|
+
*
|
|
140
|
+
* Consumers infer tool types via the structural `$types` property rather than
|
|
141
|
+
* the `McpServer` class generic, because class-generic inference breaks when
|
|
142
|
+
* `McpServer` comes from different package installations (e.g. a consumer
|
|
143
|
+
* with its own `skybridge` dep vs. the in-tree workspace version).
|
|
144
|
+
*
|
|
145
|
+
* Inspired by tRPC's `_def` pattern and Hono's type markers.
|
|
146
|
+
*/
|
|
147
|
+
export interface McpServerTypes<TTools extends Record<string, ToolDef>> {
|
|
148
|
+
readonly tools: TTools;
|
|
149
|
+
}
|
|
150
|
+
type Simplify<T> = {
|
|
151
|
+
[K in keyof T]: T[K];
|
|
152
|
+
};
|
|
153
|
+
type ShapeOutput<Shape extends Record<string, StandardSchemaWithJSON>> = Simplify<{
|
|
154
|
+
[K in keyof Shape as undefined extends StandardSchemaV1.InferOutput<Shape[K]> ? never : K]: StandardSchemaV1.InferOutput<Shape[K]>;
|
|
155
|
+
} & {
|
|
156
|
+
[K in keyof Shape as undefined extends StandardSchemaV1.InferOutput<Shape[K]> ? K : never]?: StandardSchemaV1.InferOutput<Shape[K]>;
|
|
157
|
+
}>;
|
|
158
|
+
type ExtractStructuredContent<T> = T extends {
|
|
159
|
+
structuredContent: infer SC;
|
|
160
|
+
} ? Simplify<SC> : never;
|
|
161
|
+
type ExtractMeta<T> = [Extract<T, {
|
|
162
|
+
_meta: unknown;
|
|
163
|
+
}>] extends [never] ? unknown : Extract<T, {
|
|
164
|
+
_meta: unknown;
|
|
165
|
+
}> extends {
|
|
166
|
+
_meta: infer M;
|
|
167
|
+
} ? Simplify<M> : unknown;
|
|
168
|
+
type AddTool<TTools, TName extends string, TInput extends Record<string, StandardSchemaWithJSON>, TOutput, TResponseMetadata = unknown, TAuthExtra extends ExtraClaims = ExtraClaims> = McpServer<TTools & {
|
|
169
|
+
[K in TName]: ToolDef<ShapeOutput<TInput>, TOutput, TResponseMetadata>;
|
|
170
|
+
}, TAuthExtra>;
|
|
171
|
+
interface ToolConfigBase<TInput extends Record<string, StandardSchemaWithJSON> | StandardSchemaWithJSON> {
|
|
172
|
+
name: string;
|
|
173
|
+
title?: string;
|
|
174
|
+
description?: string;
|
|
175
|
+
inputSchema?: TInput;
|
|
176
|
+
outputSchema?: Record<string, StandardSchemaWithJSON> | StandardSchemaWithJSON;
|
|
177
|
+
annotations?: ToolAnnotations;
|
|
178
|
+
view?: ViewConfig;
|
|
179
|
+
_meta?: ToolMeta;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The auth face of a tool config: either the high-level `auth` shorthand or the
|
|
183
|
+
* low-level `securitySchemes` escape hatch, never both.
|
|
184
|
+
*/
|
|
185
|
+
type ToolAuthConfig = {
|
|
186
|
+
auth?: ToolAuth;
|
|
187
|
+
securitySchemes?: never;
|
|
188
|
+
} | {
|
|
189
|
+
auth?: never;
|
|
190
|
+
/**
|
|
191
|
+
* Declares which auth schemes this tool supports (e.g. `noauth`, `oauth2`).
|
|
192
|
+
* Lets clients label tools that require sign-in before calling, and pass
|
|
193
|
+
* the right scopes through the OAuth flow. Listing both `noauth` and
|
|
194
|
+
* `oauth2` signals that the tool works for anonymous callers and gives
|
|
195
|
+
* enhanced behavior to authenticated ones.
|
|
196
|
+
*/
|
|
197
|
+
securitySchemes?: SecurityScheme[];
|
|
198
|
+
};
|
|
199
|
+
type ToolConfig<TInput extends Record<string, StandardSchemaWithJSON> | StandardSchemaWithJSON> = ToolConfigBase<TInput> & ToolAuthConfig;
|
|
200
|
+
/**
|
|
201
|
+
* Optional client-supplied hints attached to `params._meta` on every tool call
|
|
202
|
+
* by the Apps SDK host. Hints only: never use for authorization, and tolerate
|
|
203
|
+
* absence.
|
|
204
|
+
* @see https://developers.openai.com/apps-sdk/reference#_meta-fields-the-client-provides
|
|
205
|
+
*/
|
|
206
|
+
export interface ClientHintsMeta {
|
|
207
|
+
/** Requested locale (BCP-47, e.g. `"en-US"`). */
|
|
208
|
+
"openai/locale"?: string;
|
|
209
|
+
/** Browser user-agent */
|
|
210
|
+
"openai/userAgent"?: string;
|
|
211
|
+
/** Coarse user location. May be partially populated. */
|
|
212
|
+
"openai/userLocation"?: {
|
|
213
|
+
city?: string;
|
|
214
|
+
region?: string;
|
|
215
|
+
country?: string;
|
|
216
|
+
timezone?: string;
|
|
217
|
+
longitude?: number;
|
|
218
|
+
latitude?: number;
|
|
219
|
+
};
|
|
220
|
+
/** Anonymized user id. */
|
|
221
|
+
"openai/subject"?: string;
|
|
222
|
+
/** Anonymized conversation id, stable within a ChatGPT session. */
|
|
223
|
+
"openai/session"?: string;
|
|
224
|
+
/** Anonymized organization id, when the user account is part of an organization. */
|
|
225
|
+
"openai/organization"?: string;
|
|
226
|
+
/** Stable id for the currently mounted widget instance. */
|
|
227
|
+
"openai/widgetSessionId"?: string;
|
|
228
|
+
}
|
|
229
|
+
type ToolHandlerExtra<TAuthExtra extends ExtraClaims = ExtraClaims> = Omit<McpExtra<TAuthExtra>, "mcpReq"> & {
|
|
230
|
+
mcpReq: Omit<McpExtra<TAuthExtra>["mcpReq"], "_meta"> & {
|
|
231
|
+
_meta?: RequestMeta & ClientHintsMeta;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
type ToolHandler<TInput extends Record<string, StandardSchemaWithJSON>, TReturn extends {
|
|
235
|
+
content?: HandlerContent;
|
|
236
|
+
} = {
|
|
237
|
+
content?: HandlerContent;
|
|
238
|
+
}, TAuthExtra extends ExtraClaims = ExtraClaims> = (args: ShapeOutput<TInput>, extra: ToolHandlerExtra<TAuthExtra>) => TReturn | Promise<TReturn>;
|
|
239
|
+
/**
|
|
240
|
+
* Coerce a tool handler's return value into an MCP `content` array. Strings
|
|
241
|
+
* become a single `TextContent`; a single block is wrapped in an array;
|
|
242
|
+
* `undefined` produces `[]`. Mostly used internally — exported so consumers
|
|
243
|
+
* who build content lazily can apply the same normalization.
|
|
244
|
+
*/
|
|
245
|
+
export declare function normalizeContent(content: HandlerContent | undefined): ContentBlock[];
|
|
246
|
+
interface McpServerBaseOmitted extends Omit<McpServerBase, "registerTool" | "connect"> {
|
|
247
|
+
}
|
|
248
|
+
declare const McpServerBaseOmitted: new (...args: ConstructorParameters<typeof McpServerBase>) => McpServerBaseOmitted;
|
|
249
|
+
/**
|
|
250
|
+
* Prime the build-time Vite manifest before user code constructs its
|
|
251
|
+
* `McpServer`. Called from the generated `dist/__entry.js`; not part of the
|
|
252
|
+
* user-facing API.
|
|
253
|
+
*
|
|
254
|
+
* @internal
|
|
255
|
+
*/
|
|
256
|
+
export declare function __setBuildManifest(manifest: Record<string, {
|
|
257
|
+
file: string;
|
|
258
|
+
}>): void;
|
|
259
|
+
export declare function __setSkillsManifest(manifest: SkillsManifest): void;
|
|
260
|
+
/**
|
|
261
|
+
* Typed registration sugar over the MCP SDK's `McpServer`: a tool registry
|
|
262
|
+
* that carries input/output/meta shapes, view resources, per-tool security
|
|
263
|
+
* schemes, and prompt/resource registration. A {@link Skybridge} app builds
|
|
264
|
+
* one of these per request and hands it to your `handler`; chain
|
|
265
|
+
* {@link McpServer.registerTool} calls on it and return the result.
|
|
266
|
+
*
|
|
267
|
+
* The `TTools` generic accumulates each registered tool's input/output/meta
|
|
268
|
+
* shape, so `typeof app` carries enough information for view-side helpers
|
|
269
|
+
* like {@link generateHelpers} to produce fully-typed hooks.
|
|
270
|
+
*
|
|
271
|
+
* @typeParam TTools - Accumulated tool registry. Filled in by `registerTool`
|
|
272
|
+
* chaining; you almost never set this manually.
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```ts
|
|
276
|
+
* export const app = new Skybridge({
|
|
277
|
+
* name: "my-app",
|
|
278
|
+
* version: "1.0.0",
|
|
279
|
+
* handler: (server) =>
|
|
280
|
+
* server.registerTool({
|
|
281
|
+
* name: "search",
|
|
282
|
+
* inputSchema: { query: z.string() },
|
|
283
|
+
* view: { component: "search" },
|
|
284
|
+
* }, async ({ query }) => ({ content: `Results for ${query}` })),
|
|
285
|
+
* });
|
|
286
|
+
* ```
|
|
287
|
+
*
|
|
288
|
+
* @see https://docs.skybridge.tech/api-reference/mcp-server
|
|
289
|
+
*/
|
|
290
|
+
export declare class McpServer<TTools extends Record<string, ToolDef> = Record<never, ToolDef>, TAuthExtra extends ExtraClaims = ExtraClaims> extends McpServerBaseOmitted {
|
|
291
|
+
readonly $types: McpServerTypes<TTools>;
|
|
292
|
+
private claimedViews;
|
|
293
|
+
private viewMetaBuilders;
|
|
294
|
+
/**
|
|
295
|
+
* Maps a view resource's query-less path to its canonical registered URI
|
|
296
|
+
* (the one carrying the `?v=` cache key). Lets `resources/read` resolve the
|
|
297
|
+
* underlying view no matter which version param the consumer sends, since
|
|
298
|
+
* the param is only a cache key, not part of the resource's identity.
|
|
299
|
+
*/
|
|
300
|
+
private viewUriByPath;
|
|
301
|
+
private viteManifest;
|
|
302
|
+
private oauthEnabled;
|
|
303
|
+
private resolveResourceMetadataUrl?;
|
|
304
|
+
private readonly toolSecuritySchemes;
|
|
305
|
+
private readonly userMiddlewareEntries;
|
|
306
|
+
constructor(serverInfo: Implementation, options?: ServerOptions, skybridgeOptions?: SkybridgeServerOptions);
|
|
307
|
+
/**
|
|
308
|
+
* The per-tool security schemes collected during registration, keyed by tool
|
|
309
|
+
* name. Read by the OAuth layer to decide whether anonymous requests are
|
|
310
|
+
* allowed and which schemes gate a given `tools/call`.
|
|
311
|
+
*
|
|
312
|
+
* @internal
|
|
313
|
+
*/
|
|
314
|
+
get securitySchemesByTool(): ReadonlyMap<string, SecurityScheme[] | undefined>;
|
|
315
|
+
/**
|
|
316
|
+
* Inject the resolver the app uses to build the protected-resource metadata
|
|
317
|
+
* URL, so tool handlers can emit in-band auth challenges.
|
|
318
|
+
*
|
|
319
|
+
* @internal
|
|
320
|
+
*/
|
|
321
|
+
setResourceMetadataUrlResolver(resolve: ResourceMetadataUrlResolver): this;
|
|
322
|
+
private setupSkills;
|
|
323
|
+
/** Register MCP protocol-level middleware (catch-all). */
|
|
324
|
+
mcpMiddleware(handler: McpMiddlewareFn<TAuthExtra>): this;
|
|
325
|
+
/** Register MCP protocol-level middleware for all requests (`extra` is `McpExtra`). */
|
|
326
|
+
mcpMiddleware(filter: "request", handler: (request: {
|
|
327
|
+
method: string;
|
|
328
|
+
params: Record<string, unknown>;
|
|
329
|
+
}, extra: McpExtra<TAuthExtra>, next: () => Promise<ServerResult>) => Promise<unknown> | unknown): this;
|
|
330
|
+
/** Register MCP protocol-level middleware for all notifications (`extra` is `undefined`). */
|
|
331
|
+
mcpMiddleware(filter: "notification", handler: (request: {
|
|
332
|
+
method: string;
|
|
333
|
+
params: Record<string, unknown>;
|
|
334
|
+
}, extra: undefined, next: () => Promise<undefined>) => Promise<unknown> | unknown): this;
|
|
335
|
+
/**
|
|
336
|
+
* Register MCP protocol-level middleware for an exact method.
|
|
337
|
+
* Narrows `params`, `extra`, and `next()` result based on the method string.
|
|
338
|
+
*/
|
|
339
|
+
mcpMiddleware<M extends McpMethodString>(filter: M, handler: McpTypedMiddlewareFn<M, TAuthExtra>): this;
|
|
340
|
+
/**
|
|
341
|
+
* Register MCP protocol-level middleware for a wildcard pattern (e.g. `"tools/*"`).
|
|
342
|
+
* `next()` returns the union of result types for matching methods.
|
|
343
|
+
*/
|
|
344
|
+
mcpMiddleware<W extends McpWildcard>(filter: W, handler: (request: {
|
|
345
|
+
method: string;
|
|
346
|
+
params: Record<string, unknown>;
|
|
347
|
+
}, extra: McpExtraFor<W, TAuthExtra>, next: () => Promise<McpResultFor<W>>) => Promise<unknown> | unknown): this;
|
|
348
|
+
/**
|
|
349
|
+
* Register MCP protocol-level middleware with a method filter.
|
|
350
|
+
* Filter can be an exact method (`"tools/call"`), wildcard (`"tools/*"`),
|
|
351
|
+
* category (`"request"` | `"notification"`), or an array of those.
|
|
352
|
+
*/
|
|
353
|
+
mcpMiddleware(filter: McpMiddlewareFilter, handler: McpMiddlewareFn<TAuthExtra>): this;
|
|
354
|
+
/**
|
|
355
|
+
* This instance's protocol-level middleware: the framework's own entries
|
|
356
|
+
* (view `_meta` on `resources/list`, version-agnostic view resolution on
|
|
357
|
+
* `resources/read`, the top-level `securitySchemes` mirror on `tools/list`)
|
|
358
|
+
* followed by the ones registered via {@link McpServer.mcpMiddleware}.
|
|
359
|
+
*
|
|
360
|
+
* @internal
|
|
361
|
+
*/
|
|
362
|
+
protocolMiddlewareEntries(): McpMiddlewareEntry[];
|
|
363
|
+
private enforceOneToolPerView;
|
|
364
|
+
private resolveViewRequestContext;
|
|
365
|
+
private registerViewResources;
|
|
366
|
+
private registerViewResource;
|
|
367
|
+
private serveLegacyAppsSdkUrl;
|
|
368
|
+
private decorateToolHandler;
|
|
369
|
+
private computeViewVersionParam;
|
|
370
|
+
private lookupViewFile;
|
|
371
|
+
private lookupDistFile;
|
|
372
|
+
/**
|
|
373
|
+
* Inject the Vite manifest as a value rather than letting `readManifest()`
|
|
374
|
+
* load it from disk. Required for runtimes without a usable filesystem
|
|
375
|
+
* (Cloudflare Workers, etc.) — the user's `skybridge build` emits the
|
|
376
|
+
* manifest as a JS module which the entry imports and passes here.
|
|
377
|
+
*/
|
|
378
|
+
setViteManifest(manifest: Record<string, {
|
|
379
|
+
file: string;
|
|
380
|
+
}>): this;
|
|
381
|
+
private readManifest;
|
|
382
|
+
/**
|
|
383
|
+
* Register a tool. Pass a `config` describing the tool (name, schemas,
|
|
384
|
+
* optional {@link ViewConfig}, optional {@link ToolMeta}) and a handler that
|
|
385
|
+
* returns the tool's result.
|
|
386
|
+
*
|
|
387
|
+
* Chain calls to build up a server: each call returns a new `McpServer`
|
|
388
|
+
* type that captures the tool's input/output/`_meta` shape so the
|
|
389
|
+
* resulting `typeof server` can drive {@link generateHelpers}.
|
|
390
|
+
*
|
|
391
|
+
* The handler's return shape determines the output types: the
|
|
392
|
+
* `structuredContent` field becomes the tool's typed output, and `_meta`
|
|
393
|
+
* becomes its `responseMetadata`. The `content` field is normalized through
|
|
394
|
+
* {@link normalizeContent}.
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* ```ts
|
|
398
|
+
* server.registerTool({
|
|
399
|
+
* name: "search",
|
|
400
|
+
* inputSchema: { query: z.string() },
|
|
401
|
+
* outputSchema: { results: z.array(z.string()) },
|
|
402
|
+
* view: { component: "search" },
|
|
403
|
+
* }, async ({ query }) => ({
|
|
404
|
+
* content: `Found results for ${query}`,
|
|
405
|
+
* structuredContent: { results: [...] },
|
|
406
|
+
* }));
|
|
407
|
+
* ```
|
|
408
|
+
*
|
|
409
|
+
* @see https://docs.skybridge.tech/api-reference/register-tool
|
|
410
|
+
*/
|
|
411
|
+
registerTool<TName extends string, InputArgs extends Record<string, StandardSchemaWithJSON>, TReturn extends {
|
|
412
|
+
content?: HandlerContent;
|
|
413
|
+
}>(config: ToolConfig<InputArgs> & {
|
|
414
|
+
name: TName;
|
|
415
|
+
}, cb: ToolHandler<InputArgs, TReturn, TAuthExtra>): AddTool<TTools, TName, InputArgs, ExtractStructuredContent<TReturn>, ExtractMeta<TReturn>, TAuthExtra>;
|
|
416
|
+
registerTool<InputArgs extends Record<string, StandardSchemaWithJSON>>(config: ToolConfig<InputArgs>, cb: ToolHandler<InputArgs, {
|
|
417
|
+
content?: HandlerContent;
|
|
418
|
+
}, TAuthExtra>): this;
|
|
419
|
+
}
|
|
420
|
+
export {};
|