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":"express.test.js","sourceRoot":"","sources":["../../src/server/express.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,MAAM,EACN,6BAA6B,GAC9B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;IACpC,oBAAoB,EAAE,GAAG,EAAE,CACzB,CAAC,CAAC,IAAa,EAAE,IAAa,EAAE,IAAgB,EAAE,EAAE,CAClD,IAAI,EAAE,CAAmB;CAC9B,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;IACpC,cAAc,EAAE,CAAC,WAAoB,EAAE,EAAE,CACvC,CAAC,CAAC,IAAa,EAAE,IAAa,EAAE,IAAgB,EAAE,EAAE,CAClD,IAAI,EAAE,CAAmB;CAC9B,CAAC,CAAC,CAAC;AAEJ,KAAK,UAAU,MAAM,CAAC,GAA4C;IAChE,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAChE,MAAM,IAAI,GAAI,MAAM,CAAC,OAAO,EAAuB,CAAC,IAAI,CAAC;IACzD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC;AAED,IAAI,UAAmC,CAAC;AACxC,SAAS,CA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IAAI,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import http from \"node:http\";\nimport {\n Client,\n StreamableHTTPClientTransport,\n} from \"@modelcontextprotocol/client\";\nimport type { ErrorRequestHandler, RequestHandler } from \"express\";\nimport { afterEach, describe, expect, it, vi } from \"vitest\";\nimport { Skybridge } from \"./app.js\";\n\nvi.mock(\"@skybridge/devtools\", () => ({\n devtoolsStaticServer: () =>\n ((_req: unknown, _res: unknown, next: () => void) =>\n next()) as RequestHandler,\n}));\n\nvi.mock(\"./viewsDevServer.js\", () => ({\n viewsDevServer: (_httpServer: unknown) =>\n ((_req: unknown, _res: unknown, next: () => void) =>\n next()) as RequestHandler,\n}));\n\nasync function listen(app: Parameters<typeof http.createServer>[1]) {\n const server = http.createServer(app);\n await new Promise<void>((resolve) => server.listen(0, resolve));\n const port = (server.address() as { port: number }).port;\n return { port, server };\n}\n\nlet openServer: http.Server | undefined;\nafterEach(() => openServer?.close());\n\nasync function postMcp(port: number) {\n return fetch(`http://localhost:${port}/mcp`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ jsonrpc: \"2.0\", method: \"initialize\", id: 1 }),\n });\n}\n\nasync function postApi(port: number) {\n return fetch(`http://localhost:${port}/api/test`, { method: \"POST\" });\n}\n\ndescribe(\"Skybridge.express\", () => {\n it(\"exposes a ready Express app immediately after construction\", () => {\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n expect(app.express).toBeDefined();\n expect(typeof app.express.use).toBe(\"function\");\n expect(typeof app.express.get).toBe(\"function\");\n });\n\n it(\"app.express.get registers a route reachable alongside /mcp\", async () => {\n const { createApp } = await import(\"./express.js\");\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.express.get(\"/health\", (_req, res) => {\n res.json({ status: \"ok\" });\n });\n\n const httpServer = http.createServer();\n await createApp({ app, httpServer });\n const { port, server: listening } = await listen(app.express);\n openServer = listening;\n\n const health = await fetch(`http://localhost:${port}/health`);\n expect(health.status).toBe(200);\n expect(await health.json()).toEqual({ status: \"ok\" });\n\n // /mcp still works (POST returns 200/4xx, not 404)\n const mcp = await postMcp(port);\n expect(mcp.status).not.toBe(404);\n });\n\n it(\"app.use and app.express.use produce the same registration order\", async () => {\n const { createApp } = await import(\"./express.js\");\n const callsA: string[] = [];\n const callsB: string[] = [];\n\n const buildApp = () =>\n new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n\n const sA = buildApp();\n sA.use((_req, _res, next) => {\n callsA.push(\"first\");\n next();\n });\n sA.express.use((_req, _res, next) => {\n callsA.push(\"second\");\n next();\n });\n\n const sB = buildApp();\n sB.express.use((_req, _res, next) => {\n callsB.push(\"first\");\n next();\n });\n sB.use((_req, _res, next) => {\n callsB.push(\"second\");\n next();\n });\n\n for (const s of [sA, sB]) {\n s.express.get(\"/probe\", (_req, res) => res.json({ ok: true }));\n const httpServer = http.createServer();\n await createApp({ app: s, httpServer });\n const { port, server: listening } = await listen(s.express);\n openServer = listening;\n await fetch(`http://localhost:${port}/probe`);\n listening.close();\n }\n\n expect(callsA).toEqual([\"first\", \"second\"]);\n expect(callsB).toEqual([\"first\", \"second\"]);\n });\n\n it(\"useOnError still wraps thrown /mcp errors after the route is mounted\", async () => {\n const { createApp } = await import(\"./express.js\");\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n // Register the error handler BEFORE createApp — useOnError should still\n // apply it after /mcp, so /mcp errors hit it.\n const seen: string[] = [];\n app.useOnError((_err, _req, res, _next) => {\n seen.push(\"useOnError\");\n res.status(503).json({ from: \"useOnError\" });\n });\n\n // Force the /mcp handler to throw so the error pipeline runs.\n app.use(\"/mcp\", () => {\n throw new Error(\"boom\");\n });\n\n const httpServer = http.createServer();\n await createApp({\n app,\n httpServer,\n // Mirror what run() does: forward the app's useOnError handlers\n // to createApp so they get applied after /mcp.\n // biome-ignore lint/complexity/useLiteralKeys: test mirrors run() internals to verify useOnError ordering\n errorMiddleware: app[\"errorMiddleware\"],\n });\n const { port, server: listening } = await listen(app.express);\n openServer = listening;\n\n const res = await postMcp(port);\n expect(seen).toEqual([\"useOnError\"]);\n expect(res.status).toBe(503);\n expect(await res.json()).toEqual({ from: \"useOnError\" });\n });\n});\n\ndescribe(\"Skybridge JSON body parser options\", () => {\n const largeBody = JSON.stringify({ data: \"x\".repeat(200 * 1024) });\n\n async function postEcho(port: number, body: string) {\n return fetch(`http://localhost:${port}/echo`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body,\n });\n }\n\n it(\"forwards json options to express.json\", async () => {\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n json: { limit: \"10mb\" },\n handler: (server) => server,\n });\n app.express.post(\"/echo\", (req, res) => {\n res.json({ received: req.body.data.length });\n });\n const { port, server: listening } = await listen(app.express);\n openServer = listening;\n\n const res = await postEcho(port, largeBody);\n expect(res.status).toBe(200);\n expect(await res.json()).toEqual({ received: 200 * 1024 });\n });\n\n it(\"keeps the default 100kb limit when no options are passed\", async () => {\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.express.post(\"/echo\", (_req, res) => {\n res.json({ ok: true });\n });\n const { port, server: listening } = await listen(app.express);\n openServer = listening;\n\n const res = await postEcho(port, largeBody);\n expect(res.status).toBe(413);\n });\n});\n\ndescribe(\"createApp\", () => {\n it(\"runs global custom middleware before the /mcp handler\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mw: RequestHandler = (_req, _res, next) => {\n calls.push(\"custom\");\n next();\n };\n\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.use(mw);\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n\n const { port, server: httpListening } = await listen(expressApp);\n openServer = httpListening;\n\n await postMcp(port);\n expect(calls).toEqual([\"custom\"]);\n });\n\n it(\"runs path-scoped middleware on /mcp\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mw: RequestHandler = (_req, _res, next) => {\n calls.push(\"auth\");\n next();\n };\n\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.use(\"/mcp\", mw);\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n\n const { port, server: httpListening } = await listen(expressApp);\n openServer = httpListening;\n\n await postMcp(port);\n expect(calls).toEqual([\"auth\"]);\n });\n\n it(\"allows middleware to short-circuit with 401\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const reject: RequestHandler = (_req, res) => {\n calls.push(\"reject\");\n res.status(401).json({ error: \"Unauthorized\" });\n };\n\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.use(\"/mcp\", reject);\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n\n const { port, server: httpListening } = await listen(expressApp);\n openServer = httpListening;\n\n const res = await postMcp(port);\n expect(calls).toEqual([\"reject\"]);\n expect(res.status).toBe(401);\n expect(await res.json()).toEqual({ error: \"Unauthorized\" });\n });\n\n it(\"runs multiple global middleware in registration order\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mwA: RequestHandler = (_req, _res, next) => {\n calls.push(\"A\");\n next();\n };\n const mwB: RequestHandler = (_req, _res, next) => {\n calls.push(\"B\");\n next();\n };\n\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.use(mwA);\n app.use(mwB);\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n\n const { port, server: httpListening } = await listen(expressApp);\n openServer = httpListening;\n\n await postMcp(port);\n expect(calls).toEqual([\"A\", \"B\"]);\n });\n\n it(\"path-scoped middleware does not run on non-matching paths\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const apiMw: RequestHandler = (_req, _res, next) => {\n calls.push(\"api\");\n next();\n };\n\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.use(\"/api\", apiMw);\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n\n const { port, server: httpListening } = await listen(expressApp);\n openServer = httpListening;\n\n // Hit /mcp — the /api middleware should NOT fire\n await postMcp(port);\n expect(calls).toEqual([]);\n });\n\n it(\"supports Express Router via custom middleware\", async () => {\n const { createApp } = await import(\"./express.js\");\n const { Router } = await import(\"express\");\n\n const router = Router();\n router.get(\"/health\", (_req, res) => {\n res.json({ status: \"ok\" });\n });\n\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.use(router as RequestHandler);\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n\n const { port, server: httpListening } = await listen(expressApp);\n openServer = httpListening;\n\n const res = await fetch(`http://localhost:${port}/health`);\n expect(res.status).toBe(200);\n expect(await res.json()).toEqual({ status: \"ok\" });\n });\n\n it(\"supports path-prefixed Router\", async () => {\n const { createApp } = await import(\"./express.js\");\n const { Router } = await import(\"express\");\n\n const router = Router();\n router.get(\"/data\", (_req, res) => {\n res.json({ value: 42 });\n });\n\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.use(\"/api\", router as RequestHandler);\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n\n const { port, server: httpListening } = await listen(expressApp);\n openServer = httpListening;\n\n const res = await fetch(`http://localhost:${port}/api/data`);\n expect(res.status).toBe(200);\n expect(await res.json()).toEqual({ value: 42 });\n });\n\n it(\"server survives middleware errors without crashing\", async () => {\n const { createApp } = await import(\"./express.js\");\n\n const throwing: RequestHandler = () => {\n throw new Error(\"boom\");\n };\n\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.use(\"/explode\", throwing);\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n\n const { port, server: httpListening } = await listen(expressApp);\n openServer = httpListening;\n\n const res = await fetch(`http://localhost:${port}/explode`);\n expect(res.status).toBe(500);\n\n // Server process did not crash — it still accepts connections\n const followUp = await fetch(`http://localhost:${port}/explode`);\n expect(followUp.status).toBe(500);\n });\n\n it(\"returns 500 JSON-RPC error when the MCP handler throws and no error middleware is registered\", async () => {\n const { createApp } = await import(\"./express.js\");\n const consoleSpy = vi.spyOn(console, \"error\").mockImplementation(() => {});\n\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n // Force the express-level error path: make a /mcp middleware throw so the\n // error pipeline runs and lands in the default /mcp error handler.\n app.use(\"/mcp\", () => {\n throw new Error(\"boom\");\n });\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n const { port, server: httpListening } = await listen(expressApp);\n openServer = httpListening;\n\n const res = await postMcp(port);\n expect(res.status).toBe(500);\n expect(await res.json()).toEqual({\n jsonrpc: \"2.0\",\n error: { code: -32603, message: \"Internal server error\" },\n id: null,\n });\n expect(consoleSpy).toHaveBeenCalledWith(\n \"Error handling MCP request:\",\n expect.any(Error),\n );\n consoleSpy.mockRestore();\n });\n\n it(\"invokes a custom error handler when the MCP handler throws\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const errorHandler: ErrorRequestHandler = (_err, _req, res, _next) => {\n calls.push(\"error-handler\");\n res.status(503).json({ custom: true });\n };\n\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.use(\"/mcp\", () => {\n throw new Error(\"boom\");\n });\n\n const httpServer = http.createServer();\n const expressApp = await createApp({\n app,\n httpServer,\n errorMiddleware: [{ handlers: [errorHandler] }],\n });\n const { port, server: httpListening } = await listen(expressApp);\n openServer = httpListening;\n\n const res = await postMcp(port);\n expect(calls).toEqual([\"error-handler\"]);\n expect(res.status).toBe(503);\n expect(await res.json()).toEqual({ custom: true });\n });\n\n it(\"invokes a path-scoped error handler only for matching routes\", async () => {\n const { createApp } = await import(\"./express.js\");\n const calls: string[] = [];\n\n const mcpErrorHandler: ErrorRequestHandler = (_err, _req, res, _next) => {\n calls.push(\"mcp-error-handler\");\n res.status(503).json({ from: \"mcp-error-handler\" });\n };\n\n const throwingApiRoute: RequestHandler = (_req, _res, next) => {\n next(new Error(\"api error\"));\n };\n\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n app.use(\"/mcp\", () => {\n throw new Error(\"boom\");\n });\n app.use(\"/api/test\", throwingApiRoute);\n\n const httpServer = http.createServer();\n const expressApp = await createApp({\n app,\n httpServer,\n errorMiddleware: [{ path: \"/mcp\", handlers: [mcpErrorHandler] }],\n });\n const { port, server: httpListening } = await listen(expressApp);\n openServer = httpListening;\n\n const mcpRes = await postMcp(port);\n expect(calls).toEqual([\"mcp-error-handler\"]);\n expect(mcpRes.status).toBe(503);\n expect(await mcpRes.json()).toEqual({ from: \"mcp-error-handler\" });\n\n const consoleSpy = vi.spyOn(console, \"error\").mockImplementation(() => {});\n const apiRes = await postApi(port);\n expect(calls).toEqual([\"mcp-error-handler\"]);\n expect(apiRes.status).toBe(500);\n consoleSpy.mockRestore();\n });\n\n it(\"handles concurrent /mcp requests without 'Already connected to a transport'\", async () => {\n const { createApp } = await import(\"./express.js\");\n\n // Slow tool: keeps the underlying transport bound long enough to overlap\n // with concurrent requests, exposing the shared-McpServer race.\n const app = new Skybridge({\n name: \"concurrent-test\",\n version: \"0.0.0\",\n handler: (server) =>\n server.registerTool({ name: \"slow\", description: \"slow\" }, async () => {\n await new Promise((r) => setTimeout(r, 50));\n return { content: [{ type: \"text\" as const, text: \"done\" }] };\n }),\n });\n\n const consoleSpy = vi.spyOn(console, \"error\").mockImplementation(() => {});\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n const { port, server } = await listen(expressApp);\n openServer = server;\n\n const callBody = (id: number) =>\n JSON.stringify({\n jsonrpc: \"2.0\",\n method: \"tools/call\",\n id,\n params: { name: \"slow\", arguments: {} },\n });\n\n const N = 10;\n const responses = await Promise.all(\n Array.from({ length: N }, (_, i) =>\n fetch(`http://localhost:${port}/mcp`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json, text/event-stream\",\n },\n body: callBody(i + 1),\n }),\n ),\n );\n\n expect(responses.map((r) => r.status)).toEqual(Array(N).fill(200));\n expect(consoleSpy).not.toHaveBeenCalledWith(\n \"Error handling MCP request:\",\n expect.any(Error),\n );\n consoleSpy.mockRestore();\n });\n});\n\ndescribe(\"createApp Vercel mode\", () => {\n it(\"app.run() returns the Express app without binding a port when VERCEL=1\", async () => {\n const prevVercel = process.env.VERCEL;\n const prevEnv = process.env.NODE_ENV;\n process.env.VERCEL = \"1\";\n process.env.NODE_ENV = \"production\";\n try {\n vi.resetModules();\n const { Skybridge: Reloaded } = await import(\"./app.js\");\n const app = new Reloaded({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n const result = await app.run();\n expect(typeof result).toBe(\"function\");\n expect(result).toBe(app.express);\n const { port, server: listening } = await listen(app.express);\n openServer = listening;\n const res = await postMcp(port);\n expect(res.status).not.toBe(404);\n } finally {\n if (prevVercel === undefined) {\n delete process.env.VERCEL;\n } else {\n process.env.VERCEL = prevVercel;\n }\n process.env.NODE_ENV = prevEnv;\n vi.resetModules();\n }\n });\n});\n\ndescribe(\"createApp tunnel routes\", () => {\n it(\"proxies POST /__skybridge/tunnel to the cli control server in dev mode\", async () => {\n // Stand up a fake control listener that returns a known JSON body.\n const control = http.createServer((_req, res) => {\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end('{\"status\":\"idle\"}');\n });\n await new Promise<void>((resolve) =>\n control.listen(0, \"127.0.0.1\", resolve),\n );\n const controlAddr = control.address();\n if (typeof controlAddr === \"string\" || controlAddr === null) {\n control.close();\n throw new Error(\"control server has no address\");\n }\n const controlPort = controlAddr.port;\n\n const prev = process.env.__TUNNEL_CONTROL_PORT;\n process.env.__TUNNEL_CONTROL_PORT = String(controlPort);\n try {\n const { createApp } = await import(\"./express.js\");\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n const { port, server } = await listen(expressApp);\n openServer = server;\n\n const res = await fetch(`http://localhost:${port}/__skybridge/tunnel`, {\n method: \"POST\",\n });\n expect(res.status).toBe(200);\n expect(await res.json()).toEqual({ status: \"idle\" });\n } finally {\n if (prev === undefined) {\n delete process.env.__TUNNEL_CONTROL_PORT;\n } else {\n process.env.__TUNNEL_CONTROL_PORT = prev;\n }\n await new Promise<void>((resolve) => control.close(() => resolve()));\n }\n });\n\n it(\"does not expose /__skybridge/tunnel in production mode\", async () => {\n const prevEnv = process.env.NODE_ENV;\n process.env.NODE_ENV = \"production\";\n try {\n vi.resetModules();\n const { createApp } = await import(\"./express.js\");\n const { Skybridge: ReloadedSkybridge } = await import(\"./app.js\");\n const app = new ReloadedSkybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n const { port, server } = await listen(expressApp);\n openServer = server;\n\n const res = await fetch(`http://localhost:${port}/__skybridge/tunnel`, {\n method: \"POST\",\n });\n expect(res.status).toBe(404);\n } finally {\n process.env.NODE_ENV = prevEnv;\n vi.resetModules();\n }\n });\n});\n\ndescribe(\"createApp mount path\", () => {\n it(\"serves /mcp with the mount path intact on the request URL\", async () => {\n const { createApp } = await import(\"./express.js\");\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) =>\n server.registerTool(\n {\n name: \"echo-url\",\n description: \"Echoes the request URL.\",\n inputSchema: {},\n },\n (_args, extra) => ({\n content: [{ type: \"text\", text: extra.http?.req?.url ?? \"\" }],\n }),\n ),\n });\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n const { port, server } = await listen(expressApp);\n openServer = server;\n\n const client = new Client({ name: \"test-client\", version: \"0.0.0\" });\n await client.connect(\n new StreamableHTTPClientTransport(\n new URL(`http://localhost:${port}/mcp`),\n ),\n );\n const result = (await client.callTool({\n name: \"echo-url\",\n arguments: {},\n })) as unknown as { content: { text: string }[] };\n await client.close();\n\n expect(new URL(result.content[0]?.text ?? \"\").pathname).toBe(\"/mcp\");\n });\n});\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for a host-managed file reference passed between tools and views.
|
|
4
|
+
*
|
|
5
|
+
* Use it inside a tool's `inputSchema` or `outputSchema` so the host can
|
|
6
|
+
* recognize the field as a file and surface attach / preview affordances.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* server.registerTool({
|
|
11
|
+
* name: "summarize-document",
|
|
12
|
+
* inputSchema: { document: FileRef },
|
|
13
|
+
* }, async ({ document }) => {
|
|
14
|
+
* const res = await fetch(document.download_url);
|
|
15
|
+
* // …
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @see https://docs.skybridge.tech/api-reference/file-ref
|
|
20
|
+
*/
|
|
21
|
+
export declare const FileRef: z.ZodObject<{
|
|
22
|
+
file_id: z.ZodString;
|
|
23
|
+
download_url: z.ZodString;
|
|
24
|
+
mime_type: z.ZodOptional<z.ZodString>;
|
|
25
|
+
file_name: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
/** Inferred TypeScript type for {@link FileRef}. */
|
|
28
|
+
export type FileRef = z.infer<typeof FileRef>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for a host-managed file reference passed between tools and views.
|
|
4
|
+
*
|
|
5
|
+
* Use it inside a tool's `inputSchema` or `outputSchema` so the host can
|
|
6
|
+
* recognize the field as a file and surface attach / preview affordances.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* server.registerTool({
|
|
11
|
+
* name: "summarize-document",
|
|
12
|
+
* inputSchema: { document: FileRef },
|
|
13
|
+
* }, async ({ document }) => {
|
|
14
|
+
* const res = await fetch(document.download_url);
|
|
15
|
+
* // …
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @see https://docs.skybridge.tech/api-reference/file-ref
|
|
20
|
+
*/
|
|
21
|
+
export const FileRef = z.object({
|
|
22
|
+
file_id: z.string(),
|
|
23
|
+
download_url: z.string(),
|
|
24
|
+
mime_type: z.string().optional(),
|
|
25
|
+
file_name: z.string().optional(),
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=file-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-ref.js","sourceRoot":"","sources":["../../src/server/file-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC","sourcesContent":["import { z } from \"zod/v4\";\n\n/**\n * Zod schema for a host-managed file reference passed between tools and views.\n *\n * Use it inside a tool's `inputSchema` or `outputSchema` so the host can\n * recognize the field as a file and surface attach / preview affordances.\n *\n * @example\n * ```ts\n * server.registerTool({\n * name: \"summarize-document\",\n * inputSchema: { document: FileRef },\n * }, async ({ document }) => {\n * const res = await fetch(document.download_url);\n * // …\n * });\n * ```\n *\n * @see https://docs.skybridge.tech/api-reference/file-ref\n */\nexport const FileRef = z.object({\n file_id: z.string(),\n download_url: z.string(),\n mime_type: z.string().optional(),\n file_name: z.string().optional(),\n});\n\n/** Inferred TypeScript type for {@link FileRef}. */\nexport type FileRef = z.infer<typeof FileRef>;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function hostFromUserAgent(userAgent) {
|
|
2
|
+
const ua = (userAgent ?? "").toLowerCase();
|
|
3
|
+
if (ua.includes("openai") || ua.includes("chatgpt")) {
|
|
4
|
+
return "openai";
|
|
5
|
+
}
|
|
6
|
+
if (ua === "claude-user") {
|
|
7
|
+
return "claude";
|
|
8
|
+
}
|
|
9
|
+
return "unknown";
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/server/host.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAAC,SAA6B;IAC7D,MAAM,EAAE,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC3C,IAAI,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACpD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,EAAE,KAAK,aAAa,EAAE,CAAC;QACzB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["export type HostKind = \"openai\" | \"claude\" | \"unknown\";\n\nexport function hostFromUserAgent(userAgent: string | undefined): HostKind {\n const ua = (userAgent ?? \"\").toLowerCase();\n if (ua.includes(\"openai\") || ua.includes(\"chatgpt\")) {\n return \"openai\";\n }\n if (ua === \"claude-user\") {\n return \"claude\";\n }\n return \"unknown\";\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { hostFromUserAgent } from "./host.js";
|
|
3
|
+
describe("hostFromUserAgent", () => {
|
|
4
|
+
it("classifies known hosts case-insensitively and defaults to unknown", () => {
|
|
5
|
+
expect(hostFromUserAgent("openai-mcp/1.0")).toBe("openai");
|
|
6
|
+
expect(hostFromUserAgent("ChatGPT")).toBe("openai");
|
|
7
|
+
expect(hostFromUserAgent("claude-user")).toBe("claude");
|
|
8
|
+
expect(hostFromUserAgent("Claude-User/1.0")).toBe("unknown");
|
|
9
|
+
expect(hostFromUserAgent("Mozilla/5.0")).toBe("unknown");
|
|
10
|
+
expect(hostFromUserAgent(undefined)).toBe("unknown");
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=host.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.test.js","sourceRoot":"","sources":["../../src/server/host.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3D,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpD,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxD,MAAM,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7D,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { hostFromUserAgent } from \"./host.js\";\n\ndescribe(\"hostFromUserAgent\", () => {\n it(\"classifies known hosts case-insensitively and defaults to unknown\", () => {\n expect(hostFromUserAgent(\"openai-mcp/1.0\")).toBe(\"openai\");\n expect(hostFromUserAgent(\"ChatGPT\")).toBe(\"openai\");\n expect(hostFromUserAgent(\"claude-user\")).toBe(\"claude\");\n expect(hostFromUserAgent(\"Claude-User/1.0\")).toBe(\"unknown\");\n expect(hostFromUserAgent(\"Mozilla/5.0\")).toBe(\"unknown\");\n expect(hostFromUserAgent(undefined)).toBe(\"unknown\");\n });\n});\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { inputRequired, ProtocolError, ProtocolErrorCode, type StandardSchemaWithJSON, } from "@modelcontextprotocol/server";
|
|
2
|
+
export type { SkybridgeConfig, SkybridgeHandler, SkybridgeOAuthInput, } from "./app.js";
|
|
3
|
+
export { Skybridge } from "./app.js";
|
|
4
|
+
export type { OAuthConfig, OAuthProvider } from "./auth/index.js";
|
|
5
|
+
export { type Auth0Claims, auth0Provider } from "./auth/providers/auth0.js";
|
|
6
|
+
export { authplaneProvider } from "./auth/providers/authplane.js";
|
|
7
|
+
export { type ClerkClaims, clerkProvider } from "./auth/providers/clerk.js";
|
|
8
|
+
export { customProvider } from "./auth/providers/custom.js";
|
|
9
|
+
export { type DescopeClaims, descopeProvider, } from "./auth/providers/descope.js";
|
|
10
|
+
export { type StytchClaims, stytchProvider } from "./auth/providers/stytch.js";
|
|
11
|
+
export { type WorkosClaims, workosProvider } from "./auth/providers/workos.js";
|
|
12
|
+
export { createJwksVerifier, type JwksVerifyConfig, } from "./auth/verify.js";
|
|
13
|
+
export { type AuthInfo, type AuthMetadataOptions, type BearerAuthMiddlewareOptions, type ExtraClaims, mcpAuthMetadataRouter, OAuthError, OAuthErrorCode, optionalBearerAuth, requireBearerAuth, type TokenVerifier, } from "./auth.js";
|
|
14
|
+
export { audio, embeddedResource, image, resourceLink, text, } from "./content-helpers.js";
|
|
15
|
+
export { FileRef } from "./file-ref.js";
|
|
16
|
+
export type { AnyToolRegistry, InferTools, ToolInput, ToolNames, ToolOutput, ToolResponseMetadata, } from "./inferUtilityTypes.js";
|
|
17
|
+
export type { McpExtra, McpMethodString, McpMiddlewareFilter, McpMiddlewareFn, McpResultFor, McpTypedMiddlewareFn, McpWildcard, } from "./middleware.js";
|
|
18
|
+
export { getToolError } from "./middleware.js";
|
|
19
|
+
export type { HandlerContent, JsonOptions, KnownToolMeta, McpServerTypes, SecurityScheme, SkybridgeServerOptions, ToolDef, ToolMeta, ViewConfig, ViewCsp, ViewName, ViewNameRegistry, } from "./server.js";
|
|
20
|
+
export { __setBuildManifest, __setSkillsManifest, McpServer, normalizeContent, } from "./server.js";
|
|
21
|
+
export { discoverSkills, type Skill, type SkillsManifest, } from "./skills.js";
|
|
22
|
+
export { viewsDevServer } from "./viewsDevServer.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { inputRequired, ProtocolError, ProtocolErrorCode, } from "@modelcontextprotocol/server";
|
|
2
|
+
export { Skybridge } from "./app.js";
|
|
3
|
+
export { auth0Provider } from "./auth/providers/auth0.js";
|
|
4
|
+
export { authplaneProvider } from "./auth/providers/authplane.js";
|
|
5
|
+
export { clerkProvider } from "./auth/providers/clerk.js";
|
|
6
|
+
export { customProvider } from "./auth/providers/custom.js";
|
|
7
|
+
export { descopeProvider, } from "./auth/providers/descope.js";
|
|
8
|
+
export { stytchProvider } from "./auth/providers/stytch.js";
|
|
9
|
+
export { workosProvider } from "./auth/providers/workos.js";
|
|
10
|
+
export { createJwksVerifier, } from "./auth/verify.js";
|
|
11
|
+
export { mcpAuthMetadataRouter, OAuthError, OAuthErrorCode, optionalBearerAuth, requireBearerAuth, } from "./auth.js";
|
|
12
|
+
export { audio, embeddedResource, image, resourceLink, text, } from "./content-helpers.js";
|
|
13
|
+
export { FileRef } from "./file-ref.js";
|
|
14
|
+
export { getToolError } from "./middleware.js";
|
|
15
|
+
export { __setBuildManifest, __setSkillsManifest, McpServer, normalizeContent, } from "./server.js";
|
|
16
|
+
export { discoverSkills, } from "./skills.js";
|
|
17
|
+
export { viewsDevServer } from "./viewsDevServer.js";
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,aAAa,EACb,iBAAiB,GAElB,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAoB,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAoB,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAEL,eAAe,GAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAqB,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAqB,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EACL,kBAAkB,GAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAKL,qBAAqB,EACrB,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,iBAAiB,GAElB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAkBxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAe/C,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACT,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,GAGf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export {\n inputRequired,\n ProtocolError,\n ProtocolErrorCode,\n type StandardSchemaWithJSON,\n} from \"@modelcontextprotocol/server\";\nexport type {\n SkybridgeConfig,\n SkybridgeHandler,\n SkybridgeOAuthInput,\n} from \"./app.js\";\nexport { Skybridge } from \"./app.js\";\nexport type { OAuthConfig, OAuthProvider } from \"./auth/index.js\";\nexport { type Auth0Claims, auth0Provider } from \"./auth/providers/auth0.js\";\nexport { authplaneProvider } from \"./auth/providers/authplane.js\";\nexport { type ClerkClaims, clerkProvider } from \"./auth/providers/clerk.js\";\nexport { customProvider } from \"./auth/providers/custom.js\";\nexport {\n type DescopeClaims,\n descopeProvider,\n} from \"./auth/providers/descope.js\";\nexport { type StytchClaims, stytchProvider } from \"./auth/providers/stytch.js\";\nexport { type WorkosClaims, workosProvider } from \"./auth/providers/workos.js\";\nexport {\n createJwksVerifier,\n type JwksVerifyConfig,\n} from \"./auth/verify.js\";\nexport {\n type AuthInfo,\n type AuthMetadataOptions,\n type BearerAuthMiddlewareOptions,\n type ExtraClaims,\n mcpAuthMetadataRouter,\n OAuthError,\n OAuthErrorCode,\n optionalBearerAuth,\n requireBearerAuth,\n type TokenVerifier,\n} from \"./auth.js\";\nexport {\n audio,\n embeddedResource,\n image,\n resourceLink,\n text,\n} from \"./content-helpers.js\";\nexport { FileRef } from \"./file-ref.js\";\nexport type {\n AnyToolRegistry,\n InferTools,\n ToolInput,\n ToolNames,\n ToolOutput,\n ToolResponseMetadata,\n} from \"./inferUtilityTypes.js\";\nexport type {\n McpExtra,\n McpMethodString,\n McpMiddlewareFilter,\n McpMiddlewareFn,\n McpResultFor,\n McpTypedMiddlewareFn,\n McpWildcard,\n} from \"./middleware.js\";\nexport { getToolError } from \"./middleware.js\";\nexport type {\n HandlerContent,\n JsonOptions,\n KnownToolMeta,\n McpServerTypes,\n SecurityScheme,\n SkybridgeServerOptions,\n ToolDef,\n ToolMeta,\n ViewConfig,\n ViewCsp,\n ViewName,\n ViewNameRegistry,\n} from \"./server.js\";\nexport {\n __setBuildManifest,\n __setSkillsManifest,\n McpServer,\n normalizeContent,\n} from \"./server.js\";\nexport {\n discoverSkills,\n type Skill,\n type SkillsManifest,\n} from \"./skills.js\";\nexport { viewsDevServer } from \"./viewsDevServer.js\";\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { McpServerTypes, ToolDef } from "./server.js";
|
|
2
2
|
/**
|
|
3
|
-
* Any tool registry shape (includes both
|
|
3
|
+
* Any tool registry shape (includes both views and regular tools).
|
|
4
4
|
* Used as a constraint for type parameters that accept tool registries.
|
|
5
5
|
*/
|
|
6
6
|
export type AnyToolRegistry = Record<string, ToolDef>;
|
|
7
7
|
/**
|
|
8
8
|
* Extract the tool registry type from an McpServer instance.
|
|
9
|
-
* This includes both
|
|
9
|
+
* This includes both views (registered via view()) and regular tools (registered via registerTool()).
|
|
10
10
|
*
|
|
11
11
|
* Uses the `$types` property pattern for cross-package type inference.
|
|
12
12
|
* This works across package boundaries because TypeScript uses structural typing
|
|
@@ -24,7 +24,7 @@ export type InferTools<ServerType> = ServerType extends {
|
|
|
24
24
|
type ExtractTool<ServerType, K extends ToolNames<ServerType>> = InferTools<ServerType>[K];
|
|
25
25
|
/**
|
|
26
26
|
* Get a union of all tool names from an McpServer instance.
|
|
27
|
-
* This includes both
|
|
27
|
+
* This includes both views and regular tools.
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```ts
|
|
@@ -34,7 +34,7 @@ type ExtractTool<ServerType, K extends ToolNames<ServerType>> = InferTools<Serve
|
|
|
34
34
|
*/
|
|
35
35
|
export type ToolNames<ServerType> = keyof InferTools<ServerType> & string;
|
|
36
36
|
/**
|
|
37
|
-
* Get the input type for a specific tool (
|
|
37
|
+
* Get the input type for a specific tool (view or regular tool).
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* ```ts
|
|
@@ -43,7 +43,7 @@ export type ToolNames<ServerType> = keyof InferTools<ServerType> & string;
|
|
|
43
43
|
*/
|
|
44
44
|
export type ToolInput<ServerType, ToolName extends ToolNames<ServerType>> = ExtractTool<ServerType, ToolName>["input"];
|
|
45
45
|
/**
|
|
46
|
-
* Get the output type for a specific tool (
|
|
46
|
+
* Get the output type for a specific tool (view or regular tool).
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
49
|
* ```ts
|
|
@@ -52,7 +52,7 @@ export type ToolInput<ServerType, ToolName extends ToolNames<ServerType>> = Extr
|
|
|
52
52
|
*/
|
|
53
53
|
export type ToolOutput<ServerType, ToolName extends ToolNames<ServerType>> = ExtractTool<ServerType, ToolName>["output"];
|
|
54
54
|
/**
|
|
55
|
-
* Get the responseMetadata type for a specific tool (
|
|
55
|
+
* Get the responseMetadata type for a specific tool (view or regular tool).
|
|
56
56
|
* This is inferred from the `_meta` property of the tool callback's return value.
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inferUtilityTypes.js","sourceRoot":"","sources":["../../src/server/inferUtilityTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { McpServerTypes, ToolDef } from \"./server.js\";\n\n/**\n * Any tool registry shape (includes both views and regular tools).\n * Used as a constraint for type parameters that accept tool registries.\n */\nexport type AnyToolRegistry = Record<string, ToolDef>;\n\n/**\n * Extract the tool registry type from an McpServer instance.\n * This includes both views (registered via view()) and regular tools (registered via registerTool()).\n *\n * Uses the `$types` property pattern for cross-package type inference.\n * This works across package boundaries because TypeScript uses structural typing\n * on the shape of `$types`, rather than nominal typing on the McpServer class itself.\n *\n * @example\n * ```ts\n * type MyTools = InferTools<MyServer>;\n * // { \"search\": ToolDef<...>, \"calculate\": ToolDef<...> }\n * ```\n */\nexport type InferTools<ServerType> = ServerType extends {\n $types: McpServerTypes<infer W>;\n}\n ? W\n : never;\ntype ExtractTool<\n ServerType,\n K extends ToolNames<ServerType>,\n> = InferTools<ServerType>[K];\n\n/**\n * Get a union of all tool names from an McpServer instance.\n * This includes both views and regular tools.\n *\n * @example\n * ```ts\n * type Names = ToolNames<MyServer>;\n * // \"search\" | \"calculate\" | \"details\"\n * ```\n */\nexport type ToolNames<ServerType> = keyof InferTools<ServerType> & string;\n\n/**\n * Get the input type for a specific tool (view or regular tool).\n *\n * @example\n * ```ts\n * type SearchInput = ToolInput<MyServer, \"search\">;\n * ```\n */\nexport type ToolInput<\n ServerType,\n ToolName extends ToolNames<ServerType>,\n> = ExtractTool<ServerType, ToolName>[\"input\"];\n\n/**\n * Get the output type for a specific tool (view or regular tool).\n *\n * @example\n * ```ts\n * type SearchOutput = ToolOutput<MyServer, \"search\">;\n * ```\n */\nexport type ToolOutput<\n ServerType,\n ToolName extends ToolNames<ServerType>,\n> = ExtractTool<ServerType, ToolName>[\"output\"];\n\n/**\n * Get the responseMetadata type for a specific tool (view or regular tool).\n * This is inferred from the `_meta` property of the tool callback's return value.\n *\n * @example\n * ```ts\n * type SearchMeta = ToolResponseMetadata<MyServer, \"search\">;\n * ```\n */\nexport type ToolResponseMetadata<\n ServerType,\n ToolName extends ToolNames<ServerType>,\n> = ExtractTool<ServerType, ToolName>[\"responseMetadata\"];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// @vitest-environment node
|
|
2
|
+
import http from "node:http";
|
|
3
|
+
import { afterEach, expect, it, vi } from "vitest";
|
|
4
|
+
import { Skybridge } from "./app.js";
|
|
5
|
+
vi.mock("@skybridge/devtools", () => ({
|
|
6
|
+
devtoolsStaticServer: () => ((_r, _s, n) => n()),
|
|
7
|
+
}));
|
|
8
|
+
vi.mock("./viewsDevServer.js", () => ({
|
|
9
|
+
viewsDevServer: () => ((_r, _s, n) => n()),
|
|
10
|
+
}));
|
|
11
|
+
let openServer;
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
openServer?.close();
|
|
14
|
+
vi.restoreAllMocks();
|
|
15
|
+
});
|
|
16
|
+
it("reports a failure inside the MCP leg instead of swallowing it", async () => {
|
|
17
|
+
const { createApp } = await import("./express.js");
|
|
18
|
+
const app = new Skybridge({
|
|
19
|
+
name: "t",
|
|
20
|
+
version: "0.0.0",
|
|
21
|
+
handler: (server) => server,
|
|
22
|
+
});
|
|
23
|
+
vi.spyOn(app, "createServerInstance").mockImplementation(() => {
|
|
24
|
+
throw new Error("boom");
|
|
25
|
+
});
|
|
26
|
+
const errors = vi.spyOn(console, "error").mockImplementation(() => { });
|
|
27
|
+
const httpServer = http.createServer();
|
|
28
|
+
const expressApp = await createApp({ app, httpServer });
|
|
29
|
+
const listening = http.createServer(expressApp);
|
|
30
|
+
await new Promise((r) => listening.listen(0, r));
|
|
31
|
+
openServer = listening;
|
|
32
|
+
const port = listening.address().port;
|
|
33
|
+
const res = await fetch(`http://localhost:${port}/mcp`, {
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: { "content-type": "application/json" },
|
|
36
|
+
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "initialize" }),
|
|
37
|
+
});
|
|
38
|
+
expect(res.status).toBeGreaterThanOrEqual(500);
|
|
39
|
+
expect(errors.mock.calls.some(([msg]) => String(msg).includes("Error handling MCP request"))).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=m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AAC;AACf,CAAC,CAAC,CAAC","sourcesContent":["// @vitest-environment node\nimport http from \"node:http\";\nimport type { RequestHandler } from \"express\";\nimport { afterEach, expect, it, vi } from \"vitest\";\nimport { Skybridge } from \"./app.js\";\n\nvi.mock(\"@skybridge/devtools\", () => ({\n devtoolsStaticServer: () =>\n ((_r: unknown, _s: unknown, n: () => void) => n()) as RequestHandler,\n}));\nvi.mock(\"./viewsDevServer.js\", () => ({\n viewsDevServer: () =>\n ((_r: unknown, _s: unknown, n: () => void) => n()) as RequestHandler,\n}));\n\nlet openServer: http.Server | undefined;\nafterEach(() => {\n openServer?.close();\n vi.restoreAllMocks();\n});\n\nit(\"reports a failure inside the MCP leg instead of swallowing it\", async () => {\n const { createApp } = await import(\"./express.js\");\n const app = new Skybridge({\n name: \"t\",\n version: \"0.0.0\",\n handler: (server) => server,\n });\n vi.spyOn(app, \"createServerInstance\").mockImplementation(() => {\n throw new Error(\"boom\");\n });\n const errors = vi.spyOn(console, \"error\").mockImplementation(() => {});\n\n const httpServer = http.createServer();\n const expressApp = await createApp({ app, httpServer });\n const listening = http.createServer(expressApp);\n await new Promise<void>((r) => listening.listen(0, r));\n openServer = listening;\n const port = (listening.address() as { port: number }).port;\n\n const res = await fetch(`http://localhost:${port}/mcp`, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ jsonrpc: \"2.0\", id: 1, method: \"initialize\" }),\n });\n\n expect(res.status).toBeGreaterThanOrEqual(500);\n expect(\n errors.mock.calls.some(([msg]) =>\n String(msg).includes(\"Error handling MCP request\"),\n ),\n ).toBe(true);\n});\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { McpMiddlewareEntry } from "./middleware.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns an internal MCP middleware entry that emits a DogStatsD counter over UDP
|
|
4
|
+
* for every tool call. Enabled by default; respects the existing telemetry
|
|
5
|
+
* opt-out (SKYBRIDGE_TELEMETRY_DISABLED, DO_NOT_TRACK, or `skybridge telemetry disable`).
|
|
6
|
+
*
|
|
7
|
+
* Returns `null` when the version string contains "-dev" (e.g. development
|
|
8
|
+
* builds) or when the version cannot be parsed into major.minor, so that
|
|
9
|
+
* malformed data does not pollute production metrics.
|
|
10
|
+
*
|
|
11
|
+
* Metric (DogStatsD counter format with tags):
|
|
12
|
+
* Requests:1|c|#version:<major>.<minor> — every tools/call
|
|
13
|
+
*/
|
|
14
|
+
export declare function createMiddlewareEntry(): McpMiddlewareEntry | null;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createSocket } from "node:dgram";
|
|
2
|
+
import { isEnabled } from "../cli/telemetry.js";
|
|
3
|
+
import { VERSION } from "../version.js";
|
|
4
|
+
function parseMajorMinor(version) {
|
|
5
|
+
const parts = version.split(".");
|
|
6
|
+
if (parts.length < 2) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return `${parts[0]}.${parts[1]}`;
|
|
10
|
+
}
|
|
11
|
+
const isDev = VERSION.includes("-dev");
|
|
12
|
+
const versionTag = parseMajorMinor(VERSION);
|
|
13
|
+
const STATSD_HOST = "18.208.242.161";
|
|
14
|
+
const STATSD_PORT = 8125;
|
|
15
|
+
let socket = null;
|
|
16
|
+
function getSocket() {
|
|
17
|
+
if (!socket) {
|
|
18
|
+
socket = createSocket("udp4");
|
|
19
|
+
socket.unref();
|
|
20
|
+
}
|
|
21
|
+
return socket;
|
|
22
|
+
}
|
|
23
|
+
function sendMetric(metric) {
|
|
24
|
+
if (!STATSD_HOST) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const payload = Buffer.from(metric);
|
|
28
|
+
getSocket().send(payload, STATSD_PORT, STATSD_HOST, () => {
|
|
29
|
+
// fire-and-forget: errors are intentionally silenced
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns an internal MCP middleware entry that emits a DogStatsD counter over UDP
|
|
34
|
+
* for every tool call. Enabled by default; respects the existing telemetry
|
|
35
|
+
* opt-out (SKYBRIDGE_TELEMETRY_DISABLED, DO_NOT_TRACK, or `skybridge telemetry disable`).
|
|
36
|
+
*
|
|
37
|
+
* Returns `null` when the version string contains "-dev" (e.g. development
|
|
38
|
+
* builds) or when the version cannot be parsed into major.minor, so that
|
|
39
|
+
* malformed data does not pollute production metrics.
|
|
40
|
+
*
|
|
41
|
+
* Metric (DogStatsD counter format with tags):
|
|
42
|
+
* Requests:1|c|#version:<major>.<minor> — every tools/call
|
|
43
|
+
*/
|
|
44
|
+
export function createMiddlewareEntry() {
|
|
45
|
+
if (isDev || !versionTag) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const handler = async (_req, _extra, next) => {
|
|
49
|
+
// Check on every call so opt-out takes effect immediately without restart.
|
|
50
|
+
if (!isEnabled()) {
|
|
51
|
+
return next();
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
return await next();
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
sendMetric(`Requests:1|c|#version:${versionTag}`);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return { filter: "tools/call", handler };
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=metric.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metric.js","sourceRoot":"","sources":["../../src/server/metric.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,SAAS,eAAe,CAAC,OAAe;IACtC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC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EF,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["import { createSocket } from \"node:dgram\";\nimport { isEnabled } from \"../cli/telemetry.js\";\nimport { VERSION } from \"../version.js\";\nimport type { McpMiddlewareEntry, McpMiddlewareFn } from \"./middleware.js\";\n\nfunction parseMajorMinor(version: string): string | null {\n const parts = version.split(\".\");\n if (parts.length < 2) {\n return null;\n }\n return `${parts[0]}.${parts[1]}`;\n}\n\nconst isDev = VERSION.includes(\"-dev\");\nconst versionTag = parseMajorMinor(VERSION);\n\nconst STATSD_HOST = \"18.208.242.161\";\nconst STATSD_PORT = 8125;\n\nlet socket: ReturnType<typeof createSocket> | null = null;\n\nfunction getSocket() {\n if (!socket) {\n socket = createSocket(\"udp4\");\n socket.unref();\n }\n return socket;\n}\n\nfunction sendMetric(metric: string): void {\n if (!STATSD_HOST) {\n return;\n }\n const payload = Buffer.from(metric);\n getSocket().send(payload, STATSD_PORT, STATSD_HOST, () => {\n // fire-and-forget: errors are intentionally silenced\n });\n}\n\n/**\n * Returns an internal MCP middleware entry that emits a DogStatsD counter over UDP\n * for every tool call. Enabled by default; respects the existing telemetry\n * opt-out (SKYBRIDGE_TELEMETRY_DISABLED, DO_NOT_TRACK, or `skybridge telemetry disable`).\n *\n * Returns `null` when the version string contains \"-dev\" (e.g. development\n * builds) or when the version cannot be parsed into major.minor, so that\n * malformed data does not pollute production metrics.\n *\n * Metric (DogStatsD counter format with tags):\n * Requests:1|c|#version:<major>.<minor> — every tools/call\n */\nexport function createMiddlewareEntry(): McpMiddlewareEntry | null {\n if (isDev || !versionTag) {\n return null;\n }\n\n const handler: McpMiddlewareFn = async (_req, _extra, next) => {\n // Check on every call so opt-out takes effect immediately without restart.\n if (!isEnabled()) {\n return next();\n }\n\n try {\n return await next();\n } finally {\n sendMetric(`Requests:1|c|#version:${versionTag}`);\n }\n };\n\n return { filter: \"tools/call\", handler };\n}\n"]}
|