skybridge 0.0.0-dev.e3c0d0b → 0.0.0-dev.e3d51c6
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 +87 -113
- 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.d.ts +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.d.ts +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 +2 -2
- package/dist/cli/detect-port.js +9 -20
- package/dist/cli/detect-port.js.map +1 -1
- package/dist/cli/header.d.ts +1 -1
- package/dist/cli/header.js.map +1 -1
- 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.js.map +1 -1
- 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.js.map +1 -1
- package/dist/cli/tunnel-control-server.js.map +1 -1
- package/dist/cli/tunnel-control-server.test.js.map +1 -1
- package/dist/cli/tunnel-handler.js.map +1 -1
- package/dist/cli/tunnel-handler.test.js.map +1 -1
- package/dist/cli/tunnel.js +2 -2
- package/dist/cli/tunnel.js.map +1 -1
- package/dist/cli/tunnel.test.js.map +1 -1
- package/dist/cli/types.js.map +1 -1
- package/dist/cli/use-execute-steps.js.map +1 -1
- package/dist/cli/use-messages.js.map +1 -1
- package/dist/cli/use-nodemon.d.ts +14 -0
- package/dist/cli/use-nodemon.js +72 -52
- package/dist/cli/use-nodemon.js.map +1 -1
- 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.js.map +1 -1
- package/dist/cli/use-typescript-check.d.ts +8 -2
- package/dist/cli/use-typescript-check.js +71 -68
- package/dist/cli/use-typescript-check.js.map +1 -1
- package/dist/commands/build.d.ts +0 -3
- package/dist/commands/build.js +2 -38
- package/dist/commands/build.js.map +1 -1
- 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 +2 -0
- package/dist/commands/dev.js +55 -0
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/start.js +7 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/telemetry/disable.js.map +1 -1
- package/dist/commands/telemetry/enable.js.map +1 -1
- package/dist/commands/telemetry/status.js.map +1 -1
- 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.d.ts +1 -0
- package/dist/context-warnings.test.js +28 -0
- package/dist/context-warnings.test.js.map +1 -0
- package/dist/server/asset-base-url-transform-plugin.d.ts +1 -0
- package/dist/server/asset-base-url-transform-plugin.js +16 -1
- package/dist/server/asset-base-url-transform-plugin.js.map +1 -1
- package/dist/server/asset-base-url-transform-plugin.test.js +51 -1
- package/dist/server/asset-base-url-transform-plugin.test.js.map +1 -1
- package/dist/server/auth/discovery.d.ts +32 -0
- package/dist/server/auth/discovery.js +56 -0
- package/dist/server/auth/discovery.js.map +1 -0
- package/dist/server/auth/discovery.test.d.ts +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 +44 -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 +31 -0
- package/dist/server/auth/providers/auth0.js.map +1 -0
- package/dist/server/auth/providers/auth0.test.d.ts +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.d.ts +1 -0
- package/dist/server/auth/providers/authplane.test.js +140 -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.d.ts +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 +56 -0
- package/dist/server/auth/providers/custom.js.map +1 -0
- package/dist/server/auth/providers/custom.test.d.ts +1 -0
- package/dist/server/auth/providers/custom.test.js +158 -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.d.ts +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.d.ts +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.d.ts +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 +92 -0
- package/dist/server/auth/setup.js.map +1 -0
- package/dist/server/auth/setup.test.d.ts +1 -0
- package/dist/server/auth/setup.test.js +508 -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.d.ts +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.d.ts +1 -0
- package/dist/server/auth-extra.test-d.js +82 -0
- package/dist/server/auth-extra.test-d.js.map +1 -0
- package/dist/server/auth.d.ts +58 -0
- package/dist/server/auth.js +28 -0
- package/dist/server/auth.js.map +1 -0
- package/dist/server/build-manifest.test.d.ts +1 -0
- package/dist/server/build-manifest.test.js +27 -0
- package/dist/server/build-manifest.test.js.map +1 -0
- package/dist/server/content-helpers.d.ts +40 -0
- package/dist/server/content-helpers.js +33 -0
- package/dist/server/content-helpers.js.map +1 -1
- package/dist/server/content-helpers.test.js.map +1 -1
- package/dist/server/express.d.ts +1 -5
- package/dist/server/express.js +13 -7
- package/dist/server/express.js.map +1 -1
- package/dist/server/express.test.js +214 -71
- package/dist/server/express.test.js.map +1 -1
- 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 +15 -2
- package/dist/server/index.js +13 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/inferUtilityTypes.js.map +1 -1
- package/dist/server/metric.js.map +1 -1
- package/dist/server/middleware.d.ts +47 -9
- package/dist/server/middleware.js +33 -0
- package/dist/server/middleware.js.map +1 -1
- package/dist/server/middleware.test-d.js.map +1 -1
- package/dist/server/middleware.test.js +37 -1
- package/dist/server/middleware.test.js.map +1 -1
- 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 +312 -20
- package/dist/server/server.js +492 -186
- package/dist/server/server.js.map +1 -1
- package/dist/server/skills-integration.test.d.ts +1 -0
- package/dist/server/skills-integration.test.js +79 -0
- package/dist/server/skills-integration.test.js.map +1 -0
- package/dist/server/skills.d.ts +29 -0
- package/dist/server/skills.js +195 -0
- package/dist/server/skills.js.map +1 -0
- package/dist/server/skills.test.d.ts +1 -0
- package/dist/server/skills.test.js +247 -0
- package/dist/server/skills.test.js.map +1 -0
- package/dist/server/templateHelper.d.ts +0 -2
- package/dist/server/templateHelper.js +3 -22
- package/dist/server/templateHelper.js.map +1 -1
- package/dist/server/templates.generated.d.ts +4 -0
- package/dist/server/templates.generated.js +47 -0
- package/dist/server/templates.generated.js.map +1 -0
- package/dist/server/tunnel-proxy-router.js.map +1 -1
- package/dist/server/tunnel-proxy-router.test.js.map +1 -1
- 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 +171 -0
- package/dist/server/view-resource-resolution.test.js.map +1 -0
- package/dist/server/viewsDevServer.js +4 -1
- package/dist/server/viewsDevServer.js.map +1 -1
- package/dist/test/utils.d.ts +3 -3
- package/dist/test/utils.js.map +1 -1
- package/dist/test/view.test.js +125 -96
- package/dist/test/view.test.js.map +1 -1
- package/dist/version.js +1 -3
- package/dist/version.js.map +1 -1
- 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 +6 -1
- package/dist/web/bridges/apps-sdk/bridge.js +15 -3
- package/dist/web/bridges/apps-sdk/bridge.js.map +1 -1
- package/dist/web/bridges/apps-sdk/index.d.ts +0 -1
- package/dist/web/bridges/apps-sdk/index.js +0 -1
- package/dist/web/bridges/apps-sdk/index.js.map +1 -1
- package/dist/web/bridges/apps-sdk/types.d.ts +8 -1
- package/dist/web/bridges/apps-sdk/types.js.map +1 -1
- package/dist/web/bridges/apps-sdk/use-apps-sdk-context.d.ts +11 -0
- package/dist/web/bridges/apps-sdk/use-apps-sdk-context.js +11 -0
- package/dist/web/bridges/apps-sdk/use-apps-sdk-context.js.map +1 -1
- package/dist/web/bridges/get-adaptor.d.ts +7 -0
- package/dist/web/bridges/get-adaptor.js +9 -7
- package/dist/web/bridges/get-adaptor.js.map +1 -1
- 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.js.map +1 -1
- package/dist/web/bridges/mcp-app/bridge.d.ts +15 -2
- package/dist/web/bridges/mcp-app/bridge.js +73 -7
- package/dist/web/bridges/mcp-app/bridge.js.map +1 -1
- 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 +0 -1
- package/dist/web/bridges/mcp-app/index.js +0 -1
- package/dist/web/bridges/mcp-app/index.js.map +1 -1
- package/dist/web/bridges/mcp-app/types.d.ts +2 -0
- package/dist/web/bridges/mcp-app/types.js.map +1 -1
- package/dist/web/bridges/mcp-app/use-mcp-app-context.d.ts +12 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.js +12 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.js.map +1 -1
- package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js.map +1 -1
- 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 +108 -3
- package/dist/web/bridges/types.js +14 -1
- package/dist/web/bridges/types.js.map +1 -1
- 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 +5 -0
- package/dist/web/bridges/use-host-context.js +5 -0
- package/dist/web/bridges/use-host-context.js.map +1 -1
- package/dist/web/components/modal-provider.d.ts +1 -1
- package/dist/web/components/modal-provider.js +4 -3
- package/dist/web/components/modal-provider.js.map +1 -1
- package/dist/web/create-store.d.ts +26 -0
- package/dist/web/create-store.js +26 -0
- package/dist/web/create-store.js.map +1 -1
- package/dist/web/create-store.test.js +8 -5
- package/dist/web/create-store.test.js.map +1 -1
- package/dist/web/data-llm.d.ts +34 -1
- package/dist/web/data-llm.js +28 -0
- package/dist/web/data-llm.js.map +1 -1
- package/dist/web/data-llm.test.js +18 -5
- package/dist/web/data-llm.test.js.map +1 -1
- package/dist/web/generate-helpers.d.ts +2 -0
- package/dist/web/generate-helpers.js +2 -0
- package/dist/web/generate-helpers.js.map +1 -1
- package/dist/web/generate-helpers.test-d.js +4 -2
- package/dist/web/generate-helpers.test-d.js.map +1 -1
- package/dist/web/generate-helpers.test.js.map +1 -1
- package/dist/web/helpers/state.js.map +1 -1
- package/dist/web/helpers/state.test.js.map +1 -1
- package/dist/web/hooks/index.d.ts +5 -0
- package/dist/web/hooks/index.js +5 -0
- package/dist/web/hooks/index.js.map +1 -1
- package/dist/web/hooks/test/utils.d.ts +7 -2
- package/dist/web/hooks/test/utils.js +14 -3
- package/dist/web/hooks/test/utils.js.map +1 -1
- package/dist/web/hooks/use-call-tool.d.ts +45 -0
- package/dist/web/hooks/use-call-tool.js +28 -0
- package/dist/web/hooks/use-call-tool.js.map +1 -1
- package/dist/web/hooks/use-call-tool.test-d.js.map +1 -1
- package/dist/web/hooks/use-call-tool.test.js +62 -27
- package/dist/web/hooks/use-call-tool.test.js.map +1 -1
- package/dist/web/hooks/use-display-mode.d.ts +20 -0
- package/dist/web/hooks/use-display-mode.js +20 -0
- package/dist/web/hooks/use-display-mode.js.map +1 -1
- package/dist/web/hooks/use-display-mode.test-d.js.map +1 -1
- package/dist/web/hooks/use-display-mode.test.js +56 -20
- package/dist/web/hooks/use-display-mode.test.js.map +1 -1
- package/dist/web/hooks/use-download.d.ts +5 -0
- package/dist/web/hooks/use-download.js +8 -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 +32 -0
- package/dist/web/hooks/use-files.js +32 -0
- package/dist/web/hooks/use-files.js.map +1 -1
- package/dist/web/hooks/use-files.test.js +10 -2
- package/dist/web/hooks/use-files.test.js.map +1 -1
- package/dist/web/hooks/use-host-info.d.ts +22 -0
- package/dist/web/hooks/use-host-info.js +30 -0
- package/dist/web/hooks/use-host-info.js.map +1 -0
- package/dist/web/hooks/use-host-info.test.d.ts +1 -0
- package/dist/web/hooks/use-host-info.test.js +59 -0
- package/dist/web/hooks/use-host-info.test.js.map +1 -0
- package/dist/web/hooks/use-layout.d.ts +2 -0
- package/dist/web/hooks/use-layout.js +2 -0
- package/dist/web/hooks/use-layout.js.map +1 -1
- package/dist/web/hooks/use-layout.test.js +59 -26
- package/dist/web/hooks/use-layout.test.js.map +1 -1
- package/dist/web/hooks/use-open-external.d.ts +17 -0
- package/dist/web/hooks/use-open-external.js +16 -0
- package/dist/web/hooks/use-open-external.js.map +1 -1
- package/dist/web/hooks/use-open-external.test.js +13 -3
- package/dist/web/hooks/use-open-external.test.js.map +1 -1
- package/dist/web/hooks/use-register-view-tool.d.ts +38 -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 +16 -1
- package/dist/web/hooks/use-request-modal.js +16 -1
- package/dist/web/hooks/use-request-modal.js.map +1 -1
- package/dist/web/hooks/use-request-modal.test.js +10 -0
- package/dist/web/hooks/use-request-modal.test.js.map +1 -1
- 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 -1
- package/dist/web/hooks/use-send-follow-up-message.js +19 -2
- package/dist/web/hooks/use-send-follow-up-message.js.map +1 -1
- package/dist/web/hooks/use-set-open-in-app-url.d.ts +17 -0
- package/dist/web/hooks/use-set-open-in-app-url.js +17 -0
- package/dist/web/hooks/use-set-open-in-app-url.js.map +1 -1
- package/dist/web/hooks/use-set-open-in-app-url.test.js +28 -8
- package/dist/web/hooks/use-set-open-in-app-url.test.js.map +1 -1
- package/dist/web/hooks/use-tool-info.d.ts +53 -2
- package/dist/web/hooks/use-tool-info.js +30 -7
- package/dist/web/hooks/use-tool-info.js.map +1 -1
- package/dist/web/hooks/use-tool-info.test-d.js +11 -29
- package/dist/web/hooks/use-tool-info.test-d.js.map +1 -1
- package/dist/web/hooks/use-tool-info.test.js +42 -32
- package/dist/web/hooks/use-tool-info.test.js.map +1 -1
- package/dist/web/hooks/use-user.d.ts +2 -0
- package/dist/web/hooks/use-user.js +2 -0
- package/dist/web/hooks/use-user.js.map +1 -1
- package/dist/web/hooks/use-user.test.js +81 -35
- package/dist/web/hooks/use-user.test.js.map +1 -1
- package/dist/web/hooks/use-view-state.d.ts +21 -0
- package/dist/web/hooks/use-view-state.js +19 -9
- package/dist/web/hooks/use-view-state.js.map +1 -1
- package/dist/web/hooks/use-view-state.test.js +37 -2
- package/dist/web/hooks/use-view-state.test.js.map +1 -1
- package/dist/web/index.js.map +1 -1
- package/dist/web/mount-view.d.ts +19 -0
- package/dist/web/mount-view.js +19 -0
- package/dist/web/mount-view.js.map +1 -1
- package/dist/web/plugin/data-llm.test.js.map +1 -1
- package/dist/web/plugin/plugin-build.test.d.ts +1 -0
- package/dist/web/plugin/plugin-build.test.js +54 -0
- package/dist/web/plugin/plugin-build.test.js.map +1 -0
- package/dist/web/plugin/plugin.d.ts +34 -0
- package/dist/web/plugin/plugin.js +52 -15
- package/dist/web/plugin/plugin.js.map +1 -1
- package/dist/web/plugin/plugin.test.d.ts +1 -0
- package/dist/web/plugin/plugin.test.js +61 -0
- package/dist/web/plugin/plugin.test.js.map +1 -0
- package/dist/web/plugin/scan-views.js.map +1 -1
- package/dist/web/plugin/scan-views.test.js.map +1 -1
- package/dist/web/plugin/transform-data-llm.js.map +1 -1
- package/dist/web/plugin/transform-data-llm.test.js.map +1 -1
- package/dist/web/plugin/validate-view.js.map +1 -1
- package/dist/web/plugin/validate-view.test.js.map +1 -1
- package/dist/web/proxy.js.map +1 -1
- package/dist/web/types.d.ts +4 -0
- package/dist/web/types.js.map +1 -1
- package/package.json +33 -22
- package/dist/server/templates/development.hbs +0 -12
- package/dist/server/templates/production.hbs +0 -6
- package/dist/web/bridges/apps-sdk/adaptor.d.ts +0 -24
- package/dist/web/bridges/apps-sdk/adaptor.js +0 -93
- package/dist/web/bridges/apps-sdk/adaptor.js.map +0 -1
- package/dist/web/bridges/mcp-app/adaptor.d.ts +0 -48
- package/dist/web/bridges/mcp-app/adaptor.js +0 -268
- package/dist/web/bridges/mcp-app/adaptor.js.map +0 -1
package/dist/server/server.d.ts
CHANGED
|
@@ -1,16 +1,37 @@
|
|
|
1
|
+
import type { McpUiToolMeta } from "@modelcontextprotocol/ext-apps";
|
|
1
2
|
import { type ServerOptions } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
3
|
import { McpServer as McpServerBase } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
4
|
import type { AnySchema, SchemaOutput, ZodRawShapeCompat } from "@modelcontextprotocol/sdk/server/zod-compat.js";
|
|
4
5
|
import type { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
5
|
-
import type { ContentBlock, Implementation, ServerNotification, ServerRequest, ServerResult, ToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
|
|
6
|
-
import
|
|
6
|
+
import type { ContentBlock, Implementation, RequestMeta, ServerNotification, ServerRequest, ServerResult, ToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
+
import express, { type ErrorRequestHandler, type Express, type RequestHandler } from "express";
|
|
8
|
+
import type { OAuthConfig } from "./auth/index.js";
|
|
9
|
+
import type { AuthInfo, ExtraClaims } from "./auth.js";
|
|
7
10
|
import type { McpExtra, McpExtraFor, McpMethodString, McpMiddlewareFilter, McpMiddlewareFn, McpResultFor, McpTypedMiddlewareFn, McpWildcard } from "./middleware.js";
|
|
11
|
+
import { type SkillsManifest } from "./skills.js";
|
|
12
|
+
/**
|
|
13
|
+
* Type marker for a registered tool — carries its input, output, and response
|
|
14
|
+
* metadata shapes so views can infer types from `typeof server`.
|
|
15
|
+
*
|
|
16
|
+
* You normally never construct this by hand; it is produced by `registerTool`
|
|
17
|
+
* and consumed by helpers like {@link InferTools} and {@link generateHelpers}.
|
|
18
|
+
*/
|
|
8
19
|
export type ToolDef<TInput = unknown, TOutput = unknown, TResponseMetadata = unknown> = {
|
|
9
20
|
input: TInput;
|
|
10
21
|
output: TOutput;
|
|
11
22
|
responseMetadata: TResponseMetadata;
|
|
12
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Views now always emit a single ext-apps resource; host targeting
|
|
26
|
+
* no longer applies. Retained for backwards compatibility; will be removed in a
|
|
27
|
+
* future major.
|
|
28
|
+
*/
|
|
13
29
|
export type ViewHostType = "apps-sdk" | "mcp-app";
|
|
30
|
+
/**
|
|
31
|
+
* Content Security Policy origins attached to a view's resource. Each list is
|
|
32
|
+
* passed through to the host's CSP for the view iframe; omit a field to inherit
|
|
33
|
+
* the host's default for that directive.
|
|
34
|
+
*/
|
|
14
35
|
export interface ViewCsp {
|
|
15
36
|
/** Origins for static assets (images, fonts, scripts, styles). */
|
|
16
37
|
resourceDomains?: string[];
|
|
@@ -23,24 +44,115 @@ export interface ViewCsp {
|
|
|
23
44
|
/** Origins allowed in `<base href>` tags (mcp-apps only). */
|
|
24
45
|
baseUriDomains?: string[];
|
|
25
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Registry of view component names. The Skybridge Vite plugin augments this
|
|
49
|
+
* interface in the generated `.skybridge/views.d.ts` with one key per view
|
|
50
|
+
* file, which narrows {@link ViewName} from `string` to the concrete union.
|
|
51
|
+
*/
|
|
26
52
|
export interface ViewNameRegistry {
|
|
27
53
|
}
|
|
28
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Resolve view component names from a registry: the union of its keys, or
|
|
56
|
+
* `string` when the registry is empty. The empty case happens before
|
|
57
|
+
* `.skybridge/views.d.ts` is generated; falling back to `string` keeps valid
|
|
58
|
+
* view names from erroring on a fresh checkout, and narrowing kicks in once
|
|
59
|
+
* the generated file augments the registry.
|
|
60
|
+
*/
|
|
61
|
+
export type ViewNameFor<Registry> = [keyof Registry & string] extends [never] ? string : keyof Registry & string;
|
|
62
|
+
/** Union of valid view component names. Narrowed by {@link ViewNameRegistry}. */
|
|
63
|
+
export type ViewName = ViewNameFor<ViewNameRegistry>;
|
|
64
|
+
/**
|
|
65
|
+
* Pass under `view` in a tool's `registerTool` config to render the tool's
|
|
66
|
+
* result through a Skybridge view instead of a plain text response.
|
|
67
|
+
*/
|
|
29
68
|
export interface ViewConfig {
|
|
69
|
+
/** Filename of the view module (without extension) — matches a file in your `viewsDir`. */
|
|
30
70
|
component: ViewName;
|
|
71
|
+
/** Human-readable label the host may show alongside the view. */
|
|
31
72
|
description?: string;
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated No-op. Every view emits a single ext-apps resource regardless
|
|
75
|
+
* of this value. Will be removed in a future major.
|
|
76
|
+
*/
|
|
32
77
|
hosts?: ViewHostType[];
|
|
78
|
+
/** Request a visible border around the view (forwarded as `ui.prefersBorder`). */
|
|
33
79
|
prefersBorder?: boolean;
|
|
80
|
+
/** Override the iframe's served domain (advanced; forwarded as `ui.domain`). */
|
|
34
81
|
domain?: string;
|
|
82
|
+
/** Per-view CSP overrides — see {@link ViewCsp}. */
|
|
35
83
|
csp?: ViewCsp;
|
|
84
|
+
/** Free-form metadata forwarded on the view resource's `_meta`. */
|
|
36
85
|
_meta?: Record<string, unknown>;
|
|
37
86
|
}
|
|
87
|
+
export type SecurityScheme = {
|
|
88
|
+
type: "noauth";
|
|
89
|
+
} | {
|
|
90
|
+
type: "oauth2";
|
|
91
|
+
scopes?: string[];
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Declarative per-tool auth. Enforced when the server has an `oauth` provider:
|
|
95
|
+
* anonymous or under-scoped calls are rejected before the handler runs. Omit
|
|
96
|
+
* `auth` entirely for the secure default (sign-in required, no specific scope).
|
|
97
|
+
*/
|
|
98
|
+
export type ToolAuth = {
|
|
99
|
+
/**
|
|
100
|
+
* When `true`, the tool is callable signed out; the token is still used when
|
|
101
|
+
* one is present. Omit (or `false`) to require sign-in.
|
|
102
|
+
*/
|
|
103
|
+
allowsAnonymous?: boolean;
|
|
104
|
+
/** OAuth scopes the caller's token must carry to invoke the tool. */
|
|
105
|
+
scopes?: string[];
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Options forwarded to the built-in `express.json()` body parser. Derived
|
|
109
|
+
* from Express's own types so the public API doesn't depend on `body-parser`.
|
|
110
|
+
*/
|
|
111
|
+
export type JsonOptions = NonNullable<Parameters<typeof express.json>[0]>;
|
|
112
|
+
/**
|
|
113
|
+
* Skybridge-specific server options, passed as the third `McpServer` constructor
|
|
114
|
+
* argument.
|
|
115
|
+
*
|
|
116
|
+
* @typeParam TAuthExtra - Claims the `oauth` verifier populates. Inferred from
|
|
117
|
+
* the config a provider returns, and carried on to tool handlers.
|
|
118
|
+
*/
|
|
119
|
+
export interface SkybridgeServerOptions<TAuthExtra extends ExtraClaims = ExtraClaims> {
|
|
120
|
+
/** Options for the built-in `express.json()` middleware, e.g. `{ limit: "10mb" }`. */
|
|
121
|
+
json?: JsonOptions;
|
|
122
|
+
/** Resource-server OAuth config. When set, mounts well-known metadata and bearer auth on `/mcp`. */
|
|
123
|
+
oauth?: OAuthConfig<TAuthExtra>;
|
|
124
|
+
/**
|
|
125
|
+
* @experimental Serve Agent Skills from `src/skills` over MCP (SEP-2640).
|
|
126
|
+
* API may change.
|
|
127
|
+
*/
|
|
128
|
+
skills?: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Well-known keys recognized by host runtimes when set on a tool's `_meta`.
|
|
132
|
+
* Use {@link ToolMeta} to also pass arbitrary custom metadata alongside these.
|
|
133
|
+
*
|
|
134
|
+
* @see https://developers.openai.com/apps-sdk/reference#tool-descriptor-parameters
|
|
135
|
+
*/
|
|
38
136
|
export interface KnownToolMeta {
|
|
137
|
+
/** Apps SDK: allow the rendered view to call this tool from inside its iframe. */
|
|
39
138
|
"openai/widgetAccessible"?: boolean;
|
|
139
|
+
/** Apps SDK: status text shown while the tool is running (e.g. `"Searching trips"`). */
|
|
40
140
|
"openai/toolInvocation/invoking"?: string;
|
|
141
|
+
/** Apps SDK: status text shown once the tool returns (e.g. `"Found 3 trips"`). */
|
|
41
142
|
"openai/toolInvocation/invoked"?: string;
|
|
143
|
+
/** Apps SDK: input parameters that hold file references — the host attaches uploaded files to them. */
|
|
144
|
+
"openai/fileParams"?: string[];
|
|
145
|
+
/** MCP Apps: control whether the tool is exposed to the model, the app, or both. */
|
|
146
|
+
ui?: Pick<McpUiToolMeta, "visibility">;
|
|
147
|
+
securitySchemes?: SecurityScheme[];
|
|
42
148
|
}
|
|
149
|
+
/** {@link KnownToolMeta} merged with arbitrary string-keyed metadata for custom flags. */
|
|
43
150
|
export type ToolMeta = KnownToolMeta & Record<string, unknown>;
|
|
151
|
+
/**
|
|
152
|
+
* Convenient return type for tool handlers — a plain string, a single
|
|
153
|
+
* {@link ContentBlock}, or an array. Skybridge normalizes it to the MCP
|
|
154
|
+
* `content: ContentBlock[]` shape before responding.
|
|
155
|
+
*/
|
|
44
156
|
export type HandlerContent = string | ContentBlock | ContentBlock[];
|
|
45
157
|
/**
|
|
46
158
|
* Type-level marker interface for cross-package type inference.
|
|
@@ -73,10 +185,10 @@ type ExtractMeta<T> = [Extract<T, {
|
|
|
73
185
|
}> extends {
|
|
74
186
|
_meta: infer M;
|
|
75
187
|
} ? Simplify<M> : unknown;
|
|
76
|
-
type AddTool<TTools, TName extends string, TInput extends ZodRawShapeCompat, TOutput, TResponseMetadata = unknown> = McpServer<TTools & {
|
|
188
|
+
type AddTool<TTools, TName extends string, TInput extends ZodRawShapeCompat, TOutput, TResponseMetadata = unknown, TAuthExtra extends ExtraClaims = ExtraClaims> = McpServer<TTools & {
|
|
77
189
|
[K in TName]: ToolDef<ShapeOutput<TInput>, TOutput, TResponseMetadata>;
|
|
78
|
-
}>;
|
|
79
|
-
interface
|
|
190
|
+
}, TAuthExtra>;
|
|
191
|
+
interface ToolConfigBase<TInput extends ZodRawShapeCompat | AnySchema> {
|
|
80
192
|
name: string;
|
|
81
193
|
title?: string;
|
|
82
194
|
description?: string;
|
|
@@ -86,37 +198,153 @@ interface ToolConfig<TInput extends ZodRawShapeCompat | AnySchema> {
|
|
|
86
198
|
view?: ViewConfig;
|
|
87
199
|
_meta?: ToolMeta;
|
|
88
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* The auth face of a tool config: either the high-level `auth` shorthand or the
|
|
203
|
+
* low-level `securitySchemes` escape hatch, never both.
|
|
204
|
+
*/
|
|
205
|
+
type ToolAuthConfig = {
|
|
206
|
+
auth?: ToolAuth;
|
|
207
|
+
securitySchemes?: never;
|
|
208
|
+
} | {
|
|
209
|
+
auth?: never;
|
|
210
|
+
/**
|
|
211
|
+
* Declares which auth schemes this tool supports (e.g. `noauth`, `oauth2`).
|
|
212
|
+
* Lets clients label tools that require sign-in before calling, and pass
|
|
213
|
+
* the right scopes through the OAuth flow. Listing both `noauth` and
|
|
214
|
+
* `oauth2` signals that the tool works for anonymous callers and gives
|
|
215
|
+
* enhanced behavior to authenticated ones.
|
|
216
|
+
*/
|
|
217
|
+
securitySchemes?: SecurityScheme[];
|
|
218
|
+
};
|
|
219
|
+
type ToolConfig<TInput extends ZodRawShapeCompat | AnySchema> = ToolConfigBase<TInput> & ToolAuthConfig;
|
|
220
|
+
/**
|
|
221
|
+
* Optional client-supplied hints attached to `params._meta` on every tool call
|
|
222
|
+
* by the Apps SDK host. Hints only: never use for authorization, and tolerate
|
|
223
|
+
* absence.
|
|
224
|
+
* @see https://developers.openai.com/apps-sdk/reference#_meta-fields-the-client-provides
|
|
225
|
+
*/
|
|
226
|
+
export interface ClientHintsMeta {
|
|
227
|
+
/** Requested locale (BCP-47, e.g. `"en-US"`). */
|
|
228
|
+
"openai/locale"?: string;
|
|
229
|
+
/** Browser user-agent */
|
|
230
|
+
"openai/userAgent"?: string;
|
|
231
|
+
/** Coarse user location. May be partially populated. */
|
|
232
|
+
"openai/userLocation"?: {
|
|
233
|
+
city?: string;
|
|
234
|
+
region?: string;
|
|
235
|
+
country?: string;
|
|
236
|
+
timezone?: string;
|
|
237
|
+
longitude?: number;
|
|
238
|
+
latitude?: number;
|
|
239
|
+
};
|
|
240
|
+
/** Anonymized user id. */
|
|
241
|
+
"openai/subject"?: string;
|
|
242
|
+
/** Anonymized conversation id, stable within a ChatGPT session. */
|
|
243
|
+
"openai/session"?: string;
|
|
244
|
+
/** Anonymized organization id, when the user account is part of an organization. */
|
|
245
|
+
"openai/organization"?: string;
|
|
246
|
+
/** Stable id for the currently mounted widget instance. */
|
|
247
|
+
"openai/widgetSessionId"?: string;
|
|
248
|
+
}
|
|
249
|
+
type ToolHandlerExtra<TAuthExtra extends ExtraClaims = ExtraClaims> = Omit<RequestHandlerExtra<ServerRequest, ServerNotification>, "_meta" | "authInfo"> & {
|
|
250
|
+
_meta?: RequestMeta & ClientHintsMeta;
|
|
251
|
+
authInfo?: AuthInfo<TAuthExtra>;
|
|
252
|
+
};
|
|
89
253
|
type ToolHandler<TInput extends ZodRawShapeCompat, TReturn extends {
|
|
90
254
|
content?: HandlerContent;
|
|
91
255
|
} = {
|
|
92
256
|
content?: HandlerContent;
|
|
93
|
-
}> = (args: ShapeOutput<TInput>, extra:
|
|
257
|
+
}, TAuthExtra extends ExtraClaims = ExtraClaims> = (args: ShapeOutput<TInput>, extra: ToolHandlerExtra<TAuthExtra>) => TReturn | Promise<TReturn>;
|
|
258
|
+
/**
|
|
259
|
+
* Coerce a tool handler's return value into an MCP `content` array. Strings
|
|
260
|
+
* become a single `TextContent`; a single block is wrapped in an array;
|
|
261
|
+
* `undefined` produces `[]`. Mostly used internally — exported so consumers
|
|
262
|
+
* who build content lazily can apply the same normalization.
|
|
263
|
+
*/
|
|
94
264
|
export declare function normalizeContent(content: HandlerContent | undefined): ContentBlock[];
|
|
95
265
|
interface McpServerBaseOmitted extends Omit<McpServerBase, "registerTool" | "connect"> {
|
|
96
266
|
}
|
|
97
267
|
declare const McpServerBaseOmitted: new (...args: ConstructorParameters<typeof McpServerBase>) => McpServerBaseOmitted;
|
|
98
|
-
|
|
268
|
+
/**
|
|
269
|
+
* Prime the build-time Vite manifest before user code constructs its
|
|
270
|
+
* `McpServer`. Called from the generated `dist/__entry.js`; not part of the
|
|
271
|
+
* user-facing API.
|
|
272
|
+
*
|
|
273
|
+
* @internal
|
|
274
|
+
*/
|
|
275
|
+
export declare function __setBuildManifest(manifest: Record<string, {
|
|
276
|
+
file: string;
|
|
277
|
+
}>): void;
|
|
278
|
+
export declare function __setSkillsManifest(manifest: SkillsManifest): void;
|
|
279
|
+
export declare class McpServer<TTools extends Record<string, ToolDef> = Record<never, ToolDef>, TAuthExtra extends ExtraClaims = ExtraClaims> extends McpServerBaseOmitted {
|
|
99
280
|
readonly $types: McpServerTypes<TTools>;
|
|
100
|
-
|
|
101
|
-
|
|
281
|
+
/**
|
|
282
|
+
* The underlying Express app. Use this to extend the HTTP server with
|
|
283
|
+
* custom routes, middleware, or settings — e.g.
|
|
284
|
+
* `server.express.get("/health", ...)`.
|
|
285
|
+
*
|
|
286
|
+
* `express.json()` is pre-applied — tune it via the constructor's third
|
|
287
|
+
* argument, e.g. `new McpServer(info, {}, { json: { limit: "10mb" } })`.
|
|
288
|
+
* Register your handlers before `run()`;
|
|
289
|
+
* after `run()`, dev-mode middleware, the `/mcp` route, and the default
|
|
290
|
+
* error handler are appended in that order.
|
|
291
|
+
*
|
|
292
|
+
* Note: Alpic Cloud only routes traffic to `/mcp` — custom routes work
|
|
293
|
+
* locally and on self-hosted deployments.
|
|
294
|
+
*/
|
|
295
|
+
readonly express: Express;
|
|
102
296
|
private customErrorMiddleware;
|
|
103
297
|
private mcpMiddlewareEntries;
|
|
104
298
|
private mcpMiddlewareApplied;
|
|
105
299
|
private claimedViews;
|
|
300
|
+
private viewMetaBuilders;
|
|
301
|
+
/**
|
|
302
|
+
* Maps a view resource's query-less path to its canonical registered URI
|
|
303
|
+
* (the one carrying the `?v=` cache key). Lets `resources/read` resolve the
|
|
304
|
+
* underlying view no matter which version param the consumer sends, since
|
|
305
|
+
* the param is only a cache key, not part of the resource's identity.
|
|
306
|
+
*/
|
|
307
|
+
private viewUriByPath;
|
|
308
|
+
private viteManifest;
|
|
106
309
|
private readonly serverInfo;
|
|
107
310
|
private readonly serverOptions?;
|
|
108
|
-
|
|
311
|
+
private oauthEnabled;
|
|
312
|
+
private resolveResourceMetadataUrl?;
|
|
313
|
+
private securitySchemesByTool;
|
|
314
|
+
constructor(serverInfo: Implementation, options?: ServerOptions, skybridgeOptions?: SkybridgeServerOptions<TAuthExtra>);
|
|
315
|
+
private setupSkills;
|
|
316
|
+
/**
|
|
317
|
+
* Register Express middleware on the underlying app. Mirrors `app.use` —
|
|
318
|
+
* pass handlers directly or a path-prefixed handler list. Register before
|
|
319
|
+
* {@link McpServer.run}; ordering matches Express.
|
|
320
|
+
*
|
|
321
|
+
* Note: Alpic Cloud only routes traffic to `/mcp`. Custom paths work
|
|
322
|
+
* locally and on self-hosted deployments.
|
|
323
|
+
*/
|
|
109
324
|
use(...handlers: RequestHandler[]): this;
|
|
110
325
|
use(path: string, ...handlers: RequestHandler[]): this;
|
|
326
|
+
/**
|
|
327
|
+
* Register Express error-handling middleware to run after the built-in
|
|
328
|
+
* `/mcp` route (or your custom route). Use this to log or transform errors
|
|
329
|
+
* thrown by tool handlers before the default error handler responds.
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* ```ts
|
|
333
|
+
* server.useOnError((err, _req, _res, next) => {
|
|
334
|
+
* logger.error(err);
|
|
335
|
+
* next(err);
|
|
336
|
+
* });
|
|
337
|
+
* ```
|
|
338
|
+
*/
|
|
111
339
|
useOnError(...handlers: ErrorRequestHandler[]): this;
|
|
112
340
|
useOnError(path: string, ...handlers: ErrorRequestHandler[]): this;
|
|
113
341
|
/** Register MCP protocol-level middleware (catch-all). */
|
|
114
|
-
mcpMiddleware(handler: McpMiddlewareFn): this;
|
|
342
|
+
mcpMiddleware(handler: McpMiddlewareFn<TAuthExtra>): this;
|
|
115
343
|
/** Register MCP protocol-level middleware for all requests (`extra` is `McpExtra`). */
|
|
116
344
|
mcpMiddleware(filter: "request", handler: (request: {
|
|
117
345
|
method: string;
|
|
118
346
|
params: Record<string, unknown>;
|
|
119
|
-
}, extra: McpExtra
|
|
347
|
+
}, extra: McpExtra<TAuthExtra>, next: () => Promise<ServerResult>) => Promise<unknown> | unknown): this;
|
|
120
348
|
/** Register MCP protocol-level middleware for all notifications (`extra` is `undefined`). */
|
|
121
349
|
mcpMiddleware(filter: "notification", handler: (request: {
|
|
122
350
|
method: string;
|
|
@@ -126,7 +354,7 @@ export declare class McpServer<TTools extends Record<string, ToolDef> = Record<n
|
|
|
126
354
|
* Register MCP protocol-level middleware for an exact method.
|
|
127
355
|
* Narrows `params`, `extra`, and `next()` result based on the method string.
|
|
128
356
|
*/
|
|
129
|
-
mcpMiddleware<M extends McpMethodString>(filter: M, handler: McpTypedMiddlewareFn<M>): this;
|
|
357
|
+
mcpMiddleware<M extends McpMethodString>(filter: M, handler: McpTypedMiddlewareFn<M, TAuthExtra>): this;
|
|
130
358
|
/**
|
|
131
359
|
* Register MCP protocol-level middleware for a wildcard pattern (e.g. `"tools/*"`).
|
|
132
360
|
* `next()` returns the union of result types for matching methods.
|
|
@@ -134,14 +362,22 @@ export declare class McpServer<TTools extends Record<string, ToolDef> = Record<n
|
|
|
134
362
|
mcpMiddleware<W extends McpWildcard>(filter: W, handler: (request: {
|
|
135
363
|
method: string;
|
|
136
364
|
params: Record<string, unknown>;
|
|
137
|
-
}, extra: McpExtraFor<W>, next: () => Promise<McpResultFor<W>>) => Promise<unknown> | unknown): this;
|
|
365
|
+
}, extra: McpExtraFor<W, TAuthExtra>, next: () => Promise<McpResultFor<W>>) => Promise<unknown> | unknown): this;
|
|
138
366
|
/**
|
|
139
367
|
* Register MCP protocol-level middleware with a method filter.
|
|
140
368
|
* Filter can be an exact method (`"tools/call"`), wildcard (`"tools/*"`),
|
|
141
369
|
* category (`"request"` | `"notification"`), or an array of those.
|
|
142
370
|
*/
|
|
143
|
-
mcpMiddleware(filter: McpMiddlewareFilter, handler: McpMiddlewareFn): this;
|
|
371
|
+
mcpMiddleware(filter: McpMiddlewareFilter, handler: McpMiddlewareFn<TAuthExtra>): this;
|
|
144
372
|
private applyMcpMiddleware;
|
|
373
|
+
/**
|
|
374
|
+
* Connect to an MCP transport (override of the SDK's `connect`). Use this
|
|
375
|
+
* when you're embedding Skybridge in a host that already manages its own
|
|
376
|
+
* transport (e.g. stdio for desktop apps); for HTTP, prefer {@link McpServer.run}
|
|
377
|
+
* which sets the transport up for you. Locks in any middleware registered
|
|
378
|
+
* via {@link McpServer.mcpMiddleware} — further calls to that method will
|
|
379
|
+
* throw afterwards.
|
|
380
|
+
*/
|
|
145
381
|
connect(transport: Parameters<typeof McpServerBase.prototype.connect>[0]): Promise<void>;
|
|
146
382
|
/**
|
|
147
383
|
* Per-request stateless connect. The SDK's `Protocol` only allows one
|
|
@@ -154,20 +390,76 @@ export declare class McpServer<TTools extends Record<string, ToolDef> = Record<n
|
|
|
154
390
|
* read side and fails fast on SDK field renames.
|
|
155
391
|
*/
|
|
156
392
|
connectStatelessTransport(transport: Parameters<typeof McpServerBase.prototype.connect>[0]): Promise<void>;
|
|
157
|
-
|
|
393
|
+
/**
|
|
394
|
+
* Start the HTTP server. Listens on `process.env.__PORT` (default `3000`),
|
|
395
|
+
* mounts the `/mcp` route, applies any custom Express middleware registered
|
|
396
|
+
* via {@link McpServer.use} / {@link McpServer.useOnError}, and locks in
|
|
397
|
+
* any MCP middleware registered via {@link McpServer.mcpMiddleware}.
|
|
398
|
+
*
|
|
399
|
+
* On Cloudflare Workers / workerd, returns an object exposing `fetch` so
|
|
400
|
+
* the runtime can bridge incoming requests to the Node HTTP server. On
|
|
401
|
+
* Vercel (`VERCEL === "1"`), returns the Express app directly so the
|
|
402
|
+
* serverless function entry can call it as a `(req, res)` handler. On
|
|
403
|
+
* Node, returns `undefined` once listening.
|
|
404
|
+
*/
|
|
405
|
+
run(): Promise<{
|
|
406
|
+
fetch: (...args: unknown[]) => unknown;
|
|
407
|
+
} | Express | undefined>;
|
|
158
408
|
private enforceOneToolPerView;
|
|
409
|
+
private resolveViewRequestContext;
|
|
159
410
|
private registerViewResources;
|
|
160
411
|
private registerViewResource;
|
|
161
|
-
private
|
|
412
|
+
private serveLegacyAppsSdkUrl;
|
|
413
|
+
private decorateToolHandler;
|
|
162
414
|
private computeViewVersionParam;
|
|
163
415
|
private lookupViewFile;
|
|
164
416
|
private lookupDistFile;
|
|
417
|
+
/**
|
|
418
|
+
* Inject the Vite manifest as a value rather than letting `readManifest()`
|
|
419
|
+
* load it from disk. Required for runtimes without a usable filesystem
|
|
420
|
+
* (Cloudflare Workers, etc.) — the user's `skybridge build` emits the
|
|
421
|
+
* manifest as a JS module which the entry imports and passes here.
|
|
422
|
+
*/
|
|
423
|
+
setViteManifest(manifest: Record<string, {
|
|
424
|
+
file: string;
|
|
425
|
+
}>): this;
|
|
165
426
|
private readManifest;
|
|
427
|
+
/**
|
|
428
|
+
* Register a tool. Pass a `config` describing the tool (name, schemas,
|
|
429
|
+
* optional {@link ViewConfig}, optional {@link ToolMeta}) and a handler that
|
|
430
|
+
* returns the tool's result.
|
|
431
|
+
*
|
|
432
|
+
* Chain calls to build up a server: each call returns a new `McpServer`
|
|
433
|
+
* type that captures the tool's input/output/`_meta` shape so the
|
|
434
|
+
* resulting `typeof server` can drive {@link generateHelpers}.
|
|
435
|
+
*
|
|
436
|
+
* The handler's return shape determines the output types: the
|
|
437
|
+
* `structuredContent` field becomes the tool's typed output, and `_meta`
|
|
438
|
+
* becomes its `responseMetadata`. The `content` field is normalized through
|
|
439
|
+
* {@link normalizeContent}.
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* ```ts
|
|
443
|
+
* server.registerTool({
|
|
444
|
+
* name: "search",
|
|
445
|
+
* inputSchema: { query: z.string() },
|
|
446
|
+
* outputSchema: { results: z.array(z.string()) },
|
|
447
|
+
* view: { component: "search" },
|
|
448
|
+
* }, async ({ query }) => ({
|
|
449
|
+
* content: `Found results for ${query}`,
|
|
450
|
+
* structuredContent: { results: [...] },
|
|
451
|
+
* }));
|
|
452
|
+
* ```
|
|
453
|
+
*
|
|
454
|
+
* @see https://docs.skybridge.tech/api-reference/register-tool
|
|
455
|
+
*/
|
|
166
456
|
registerTool<TName extends string, InputArgs extends ZodRawShapeCompat, TReturn extends {
|
|
167
457
|
content?: HandlerContent;
|
|
168
458
|
}>(config: ToolConfig<InputArgs> & {
|
|
169
459
|
name: TName;
|
|
170
|
-
}, cb: ToolHandler<InputArgs, TReturn>): AddTool<TTools, TName, InputArgs, ExtractStructuredContent<TReturn>, ExtractMeta<TReturn
|
|
171
|
-
registerTool<InputArgs extends ZodRawShapeCompat>(config: ToolConfig<InputArgs>, cb: ToolHandler<InputArgs
|
|
460
|
+
}, cb: ToolHandler<InputArgs, TReturn, TAuthExtra>): AddTool<TTools, TName, InputArgs, ExtractStructuredContent<TReturn>, ExtractMeta<TReturn>, TAuthExtra>;
|
|
461
|
+
registerTool<InputArgs extends ZodRawShapeCompat>(config: ToolConfig<InputArgs>, cb: ToolHandler<InputArgs, {
|
|
462
|
+
content?: HandlerContent;
|
|
463
|
+
}, TAuthExtra>): this;
|
|
172
464
|
}
|
|
173
465
|
export {};
|