skybridge 0.0.0-dev.e2cf49b → 0.0.0-dev.e31b2fa
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 -674
- package/README.md +126 -169
- 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 +90 -0
- package/dist/cli/run-plain.js.map +1 -0
- package/dist/cli/telemetry.d.ts +7 -0
- package/dist/cli/telemetry.js +125 -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 +2 -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 +26 -0
- package/dist/cli/use-nodemon.js +106 -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.d.ts +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.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 +42 -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.d.ts +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.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 +34 -0
- package/dist/server/auth/providers/workos.js +16 -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 +91 -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 +514 -0
- package/dist/server/auth/setup.test.js.map +1 -0
- package/dist/server/auth/verify.d.ts +48 -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 +165 -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.d.ts +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/events.d.ts +113 -0
- package/dist/server/events.js +318 -0
- package/dist/server/events.js.map +1 -0
- package/dist/server/events.test.d.ts +1 -0
- package/dist/server/events.test.js +172 -0
- package/dist/server/events.test.js.map +1 -0
- package/dist/server/express.d.ts +31 -0
- package/dist/server/express.js +112 -0
- package/dist/server/express.js.map +1 -0
- package/dist/server/express.test.d.ts +1 -0
- package/dist/server/express.test.js +609 -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/form-input.d.ts +120 -0
- package/dist/server/form-input.js +89 -0
- package/dist/server/form-input.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 +24 -0
- package/dist/server/index.js +20 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/inferUtilityTypes.d.ts +64 -0
- package/dist/server/inferUtilityTypes.js +2 -0
- 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 +230 -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 +664 -0
- package/dist/server/server.js +799 -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 -4
- 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 +167 -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/test/utils.d.ts +125 -0
- 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 +62 -0
- package/dist/web/bridges/adaptor.js +471 -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 +264 -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/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 +175 -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 +25 -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 +272 -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/web/data-llm.js +101 -0
- 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 +161 -0
- package/dist/web/data-llm.test.js.map +1 -0
- package/dist/web/generate-helpers.d.ts +124 -0
- package/dist/web/generate-helpers.js +119 -0
- package/dist/web/generate-helpers.js.map +1 -0
- package/dist/web/generate-helpers.test-d.d.ts +1 -0
- package/dist/web/generate-helpers.test-d.js +211 -0
- package/dist/web/generate-helpers.test-d.js.map +1 -0
- package/dist/web/generate-helpers.test.d.ts +1 -0
- package/dist/web/generate-helpers.test.js +17 -0
- package/dist/web/generate-helpers.test.js.map +1 -0
- package/dist/web/helpers/state.d.ts +7 -0
- 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/web/helpers/state.test.js +53 -0
- package/dist/web/helpers/state.test.js.map +1 -0
- package/dist/web/hooks/index.d.ts +20 -0
- package/dist/web/hooks/index.js +21 -0
- package/dist/web/hooks/index.js.map +1 -0
- package/dist/web/hooks/openai-extensions.test.d.ts +1 -0
- package/dist/web/hooks/openai-extensions.test.js +107 -0
- package/dist/web/hooks/openai-extensions.test.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/web/hooks/use-call-tool.d.ts +146 -0
- package/dist/web/hooks/use-call-tool.js +101 -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 +104 -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/web/hooks/use-call-tool.test.js +236 -0
- package/dist/web/hooks/use-call-tool.test.js.map +1 -0
- package/dist/web/hooks/use-deep-link.d.ts +22 -0
- package/dist/web/hooks/use-deep-link.js +34 -0
- package/dist/web/hooks/use-deep-link.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-file-resource.d.ts +37 -0
- package/dist/web/hooks/use-file-resource.js +98 -0
- package/dist/web/hooks/use-file-resource.js.map +1 -0
- package/dist/web/hooks/use-file-resource.test.d.ts +1 -0
- package/dist/web/hooks/use-file-resource.test.js +65 -0
- package/dist/web/hooks/use-file-resource.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 +44 -0
- package/dist/web/hooks/use-host.js +45 -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-model-context.d.ts +44 -0
- package/dist/web/hooks/use-model-context.js +63 -0
- package/dist/web/hooks/use-model-context.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-open-file.d.ts +20 -0
- package/dist/web/hooks/use-open-file.js +25 -0
- package/dist/web/hooks/use-open-file.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/web/hooks/use-request-modal.test.js +71 -0
- 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 +25 -0
- package/dist/web/hooks/use-send-follow-up-message.js +31 -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/web/hooks/use-tool-info.test-d.js +86 -0
- 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/web/hooks/use-user.d.ts +21 -0
- 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/web/index.d.ts +7 -0
- package/dist/web/index.js +8 -0
- 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/web/proxy.d.ts +1 -0
- package/dist/web/proxy.js +52 -0
- 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 +94 -35
- package/tsconfig.base.json +33 -0
- package/dist/src/server/index.d.ts +0 -2
- package/dist/src/server/index.js +0 -3
- package/dist/src/server/index.js.map +0 -1
- package/dist/src/server/server.d.ts +0 -13
- package/dist/src/server/server.js +0 -54
- package/dist/src/server/server.js.map +0 -1
- package/dist/src/server/templateHelper.js +0 -29
- package/dist/src/server/templateHelper.js.map +0 -1
- package/dist/src/server/templates/development.hbs +0 -12
- package/dist/src/server/templates/production.hbs +0 -6
- 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/setup.js +0 -9
- package/dist/src/test/setup.js.map +0 -1
- package/dist/src/test/utils.d.ts +0 -28
- package/dist/src/test/utils.js +0 -43
- package/dist/src/test/utils.js.map +0 -1
- package/dist/src/test/widget.test.js +0 -90
- package/dist/src/test/widget.test.js.map +0 -1
- package/dist/src/web/hooks/index.d.ts +0 -13
- package/dist/src/web/hooks/index.js +0 -14
- package/dist/src/web/hooks/index.js.map +0 -1
- package/dist/src/web/hooks/use-call-tool.d.ts +0 -62
- package/dist/src/web/hooks/use-call-tool.js +0 -66
- package/dist/src/web/hooks/use-call-tool.js.map +0 -1
- package/dist/src/web/hooks/use-call-tool.test.js +0 -104
- 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 -7
- package/dist/src/web/hooks/use-display-mode.js.map +0 -1
- package/dist/src/web/hooks/use-display-mode.test.js +0 -40
- package/dist/src/web/hooks/use-display-mode.test.js.map +0 -1
- package/dist/src/web/hooks/use-locale.d.ts +0 -1
- package/dist/src/web/hooks/use-locale.js +0 -5
- package/dist/src/web/hooks/use-locale.js.map +0 -1
- package/dist/src/web/hooks/use-locale.test.js +0 -21
- package/dist/src/web/hooks/use-locale.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 -2
- package/dist/src/web/hooks/use-openai-global.js +0 -21
- package/dist/src/web/hooks/use-openai-global.js.map +0 -1
- package/dist/src/web/hooks/use-request-modal.d.ts +0 -5
- package/dist/src/web/hooks/use-request-modal.js +0 -9
- package/dist/src/web/hooks/use-request-modal.js.map +0 -1
- package/dist/src/web/hooks/use-request-modal.test.js +0 -24
- 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-theme.d.ts +0 -1
- package/dist/src/web/hooks/use-theme.js +0 -5
- package/dist/src/web/hooks/use-theme.js.map +0 -1
- package/dist/src/web/hooks/use-theme.test.js +0 -26
- package/dist/src/web/hooks/use-theme.test.js.map +0 -1
- package/dist/src/web/hooks/use-tool-info.d.ts +0 -5
- package/dist/src/web/hooks/use-tool-info.js +0 -9
- package/dist/src/web/hooks/use-tool-info.js.map +0 -1
- package/dist/src/web/hooks/use-tool-info.test.js +0 -38
- package/dist/src/web/hooks/use-tool-info.test.js.map +0 -1
- package/dist/src/web/hooks/use-tool-output.d.ts +0 -4
- package/dist/src/web/hooks/use-tool-output.js +0 -9
- package/dist/src/web/hooks/use-tool-output.js.map +0 -1
- package/dist/src/web/hooks/use-tool-response-metadata.d.ts +0 -4
- package/dist/src/web/hooks/use-tool-response-metadata.js +0 -8
- package/dist/src/web/hooks/use-tool-response-metadata.js.map +0 -1
- package/dist/src/web/hooks/use-user-agent.d.ts +0 -1
- package/dist/src/web/hooks/use-user-agent.js +0 -5
- package/dist/src/web/hooks/use-user-agent.js.map +0 -1
- package/dist/src/web/hooks/use-user-agent.test.js +0 -31
- package/dist/src/web/hooks/use-user-agent.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 -30
- 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.d.ts +0 -4
- package/dist/src/web/index.js +0 -5
- 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 -14
- package/dist/src/web/mount-widget.js.map +0 -1
- package/dist/src/web/plugin.d.ts +0 -2
- package/dist/src/web/plugin.js +0 -28
- package/dist/src/web/plugin.js.map +0 -1
- package/dist/src/web/types.d.ts +0 -110
- package/dist/src/web/types.js.map +0 -1
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.config.js +0 -9
- package/dist/vitest.config.js.map +0 -1
- /package/dist/{src/test/setup.d.ts → cli/build-helpers.test.d.ts} +0 -0
- /package/dist/{src/test/widget.test.d.ts → cli/build-steps.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-call-tool.test.d.ts → cli/tunnel-control-server.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-display-mode.test.d.ts → cli/tunnel-handler.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-locale.test.d.ts → cli/tunnel.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-open-external.test.d.ts → context-warnings.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-request-modal.test.d.ts → server/app.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-theme.test.d.ts → server/asset-base-url-transform-plugin.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-user-agent.test.d.ts → server/auth/discovery.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-widget-state.test.d.ts → server/auth/providers/auth0.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-tool-info.test.d.ts → server/auth-extra.test-d.d.ts} +0 -0
- /package/dist/{src/web → web/bridges/apps-sdk}/types.js +0 -0
|
@@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AG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,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(health.headers.get(\"x-powered-by\")).toBe(\"skybridge\");\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,120 @@
|
|
|
1
|
+
import { type ElicitRequestFormParams, type Icon, type InputRequiredResult, type PrimitiveSchemaDefinition, type Resource, type StringSchema } from "@modelcontextprotocol/server";
|
|
2
|
+
/** A titled choice, with an optional description and thumbnail. */
|
|
3
|
+
export interface OpenAIFormOption {
|
|
4
|
+
const: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
/** An HTTPS URL or a base64 data URI. */
|
|
8
|
+
"x-openai-thumbnail"?: Icon;
|
|
9
|
+
}
|
|
10
|
+
/** A string field that accepts a `pattern` and suggested values. */
|
|
11
|
+
export type OpenAIFormStringField = StringSchema & {
|
|
12
|
+
pattern?: string;
|
|
13
|
+
"x-openai-suggestions"?: OpenAIFormOption[];
|
|
14
|
+
};
|
|
15
|
+
/** Resources the user picks from, or adds, in a resource field. */
|
|
16
|
+
export interface OpenAIResourceInput {
|
|
17
|
+
type: "resource";
|
|
18
|
+
/** Multi-select only. Defaults to `"explicit"`. */
|
|
19
|
+
selection?: "explicit" | "implicit";
|
|
20
|
+
options: Resource[];
|
|
21
|
+
userOptions?: {
|
|
22
|
+
kind?: "file" | "directory";
|
|
23
|
+
accept?: string[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
type FieldText = {
|
|
27
|
+
title?: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
};
|
|
30
|
+
type ArrayBounds = FieldText & {
|
|
31
|
+
minItems?: number;
|
|
32
|
+
maxItems?: number;
|
|
33
|
+
};
|
|
34
|
+
/** One field of an {@link OpenAIForm}. */
|
|
35
|
+
export type OpenAIFormField = PrimitiveSchemaDefinition | OpenAIFormStringField | (FieldText & {
|
|
36
|
+
type: "string";
|
|
37
|
+
oneOf: OpenAIFormOption[];
|
|
38
|
+
default?: string;
|
|
39
|
+
}) | (ArrayBounds & {
|
|
40
|
+
type: "array";
|
|
41
|
+
items: {
|
|
42
|
+
anyOf: OpenAIFormOption[];
|
|
43
|
+
};
|
|
44
|
+
default?: string[];
|
|
45
|
+
}) | (ArrayBounds & {
|
|
46
|
+
type: "array";
|
|
47
|
+
uniqueItems?: boolean;
|
|
48
|
+
items: OpenAIFormStringField;
|
|
49
|
+
default?: string[];
|
|
50
|
+
}) | (FieldText & {
|
|
51
|
+
type: "string";
|
|
52
|
+
format: "uri";
|
|
53
|
+
"x-openai-input": Omit<OpenAIResourceInput, "selection">;
|
|
54
|
+
default?: string;
|
|
55
|
+
}) | (ArrayBounds & {
|
|
56
|
+
type: "array";
|
|
57
|
+
items: {
|
|
58
|
+
type: "string";
|
|
59
|
+
format: "uri";
|
|
60
|
+
};
|
|
61
|
+
"x-openai-input": OpenAIResourceInput;
|
|
62
|
+
default?: string[];
|
|
63
|
+
});
|
|
64
|
+
/** A form for ChatGPT, from the OpenAI MCP extensions. */
|
|
65
|
+
export interface OpenAIForm {
|
|
66
|
+
type: "object";
|
|
67
|
+
properties: Record<string, OpenAIFormField>;
|
|
68
|
+
required?: string[];
|
|
69
|
+
}
|
|
70
|
+
export type OpenAIFormInputParams = Omit<ElicitRequestFormParams, "mode" | "requestedSchema"> & {
|
|
71
|
+
/** Identifies the form across the two calls of the tool. */
|
|
72
|
+
key: string;
|
|
73
|
+
requestedSchema: OpenAIForm;
|
|
74
|
+
requestState?: string;
|
|
75
|
+
};
|
|
76
|
+
/** The user's answer to an {@link OpenAIForm}. */
|
|
77
|
+
export type OpenAIFormResult = {
|
|
78
|
+
action: "accept";
|
|
79
|
+
content: Record<string, string | number | boolean | string[]>;
|
|
80
|
+
} | {
|
|
81
|
+
action: "decline" | "cancel";
|
|
82
|
+
};
|
|
83
|
+
type FormInputExtra = {
|
|
84
|
+
mcpReq: {
|
|
85
|
+
envelope?: object;
|
|
86
|
+
inputResponses?: Record<string, unknown>;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Ask the user to fill a form in ChatGPT, from the OpenAI MCP extensions.
|
|
91
|
+
* Return the result when it is an `input_required` result: ChatGPT shows the
|
|
92
|
+
* form, then calls the tool again, and the same call returns the user's answer.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* server.registerTool({ name: "pick-part" }, (_args, extra) => {
|
|
97
|
+
* const result = requestFormInput(extra, {
|
|
98
|
+
* key: "part",
|
|
99
|
+
* message: "Choose a part",
|
|
100
|
+
* requestedSchema: {
|
|
101
|
+
* type: "object",
|
|
102
|
+
* properties: {
|
|
103
|
+
* part: { type: "string", oneOf: [{ const: "bolt", title: "M6 bolt" }] },
|
|
104
|
+
* },
|
|
105
|
+
* required: ["part"],
|
|
106
|
+
* },
|
|
107
|
+
* });
|
|
108
|
+
* if ("resultType" in result) {
|
|
109
|
+
* return result;
|
|
110
|
+
* }
|
|
111
|
+
* return {
|
|
112
|
+
* content: result.action === "accept" ? `Picked ${result.content.part}` : "Nothing picked",
|
|
113
|
+
* };
|
|
114
|
+
* });
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* @see https://docs.skybridge.tech/api-reference/request-form-input
|
|
118
|
+
*/
|
|
119
|
+
export declare function requestFormInput(extra: FormInputExtra, { key, requestedSchema, requestState, _meta, ...params }: OpenAIFormInputParams): InputRequiredResult | OpenAIFormResult;
|
|
120
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { fromJsonSchema, } from "@modelcontextprotocol/server";
|
|
2
|
+
function supportsOpenAIForms(envelope) {
|
|
3
|
+
const { "io.modelcontextprotocol/protocolVersion": version, "io.modelcontextprotocol/clientCapabilities": capabilities, } = (envelope ?? {});
|
|
4
|
+
return (version !== undefined &&
|
|
5
|
+
version >= "2026-07-28" &&
|
|
6
|
+
capabilities?.elicitation?.form !== undefined &&
|
|
7
|
+
capabilities.extensions?.["openai/elicitation"]?.form !== undefined);
|
|
8
|
+
}
|
|
9
|
+
function picksOfferedResources(field, value) {
|
|
10
|
+
if (!("x-openai-input" in field) || value === undefined) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
const input = field["x-openai-input"];
|
|
14
|
+
if (input.userOptions !== undefined ||
|
|
15
|
+
("selection" in input && input.selection === "implicit")) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
return [value]
|
|
19
|
+
.flat()
|
|
20
|
+
.every((uri) => input.options.some((option) => option.uri === uri));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Ask the user to fill a form in ChatGPT, from the OpenAI MCP extensions.
|
|
24
|
+
* Return the result when it is an `input_required` result: ChatGPT shows the
|
|
25
|
+
* form, then calls the tool again, and the same call returns the user's answer.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* server.registerTool({ name: "pick-part" }, (_args, extra) => {
|
|
30
|
+
* const result = requestFormInput(extra, {
|
|
31
|
+
* key: "part",
|
|
32
|
+
* message: "Choose a part",
|
|
33
|
+
* requestedSchema: {
|
|
34
|
+
* type: "object",
|
|
35
|
+
* properties: {
|
|
36
|
+
* part: { type: "string", oneOf: [{ const: "bolt", title: "M6 bolt" }] },
|
|
37
|
+
* },
|
|
38
|
+
* required: ["part"],
|
|
39
|
+
* },
|
|
40
|
+
* });
|
|
41
|
+
* if ("resultType" in result) {
|
|
42
|
+
* return result;
|
|
43
|
+
* }
|
|
44
|
+
* return {
|
|
45
|
+
* content: result.action === "accept" ? `Picked ${result.content.part}` : "Nothing picked",
|
|
46
|
+
* };
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @see https://docs.skybridge.tech/api-reference/request-form-input
|
|
51
|
+
*/
|
|
52
|
+
export function requestFormInput(extra, { key, requestedSchema, requestState, _meta, ...params }) {
|
|
53
|
+
if (!supportsOpenAIForms(extra.mcpReq.envelope)) {
|
|
54
|
+
throw new Error("OpenAI forms need MCP 2026-07-28 or newer and a client that supports openai/elicitation forms.");
|
|
55
|
+
}
|
|
56
|
+
const responses = extra.mcpReq.inputResponses;
|
|
57
|
+
if (responses !== undefined && Object.hasOwn(responses, key)) {
|
|
58
|
+
const response = responses[key];
|
|
59
|
+
if (response?.action === "decline" || response?.action === "cancel") {
|
|
60
|
+
return { action: response.action };
|
|
61
|
+
}
|
|
62
|
+
if (response?.action !== "accept") {
|
|
63
|
+
throw new Error(`The answer to form "${key}" has no valid action.`);
|
|
64
|
+
}
|
|
65
|
+
const validated = fromJsonSchema(requestedSchema)["~standard"].validate(response.content);
|
|
66
|
+
if ("then" in validated ||
|
|
67
|
+
validated.issues ||
|
|
68
|
+
!Object.entries(requestedSchema.properties).every(([name, field]) => picksOfferedResources(field, validated.value?.[name]))) {
|
|
69
|
+
throw new Error(`The answer to form "${key}" does not match its schema.`);
|
|
70
|
+
}
|
|
71
|
+
return { action: "accept", content: validated.value };
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
resultType: "input_required",
|
|
75
|
+
inputRequests: {
|
|
76
|
+
[key]: {
|
|
77
|
+
method: "elicitation/create",
|
|
78
|
+
params: {
|
|
79
|
+
...params,
|
|
80
|
+
mode: "form",
|
|
81
|
+
requestedSchema: { type: "object", properties: {} },
|
|
82
|
+
_meta: { ..._meta, "openai/elicitation": { requestedSchema } },
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
...(requestState !== undefined && { requestState }),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=form-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-input.js","sourceRoot":"","sources":["../../src/server/form-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,GAMf,MAAM,8BAA8B,CAAC;AA8FtC,SAAS,mBAAmB,CAAC,QAA4B;IACvD,MAAM,EACJ,yCAAyC,EAAE,OAAO,EAClD,4CAA4C,EAAE,YAAY,GAC3D,GAAG,CAAC,QAAQ,IAAI,EAAE,CAMlB,CAAC;IACF,OAAO,CACL,OAAO,KAAK,SAAS;QACrB,OAAO,IAAI,YAAY;QACvB,YAAY,EAAE,WAAW,EAAE,IAAI,KAAK,SAAS;QAC7C,YAAY,CAAC,UAAU,EAAE,CAAC,oBAAoB,CAAC,EAAE,IAAI,KAAK,SAAS,CACpE,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAsB,EAAE,KAAc;IACnE,IAAI,CAAC,CAAC,gBAAgB,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACtC,IACE,KAAK,CAAC,WAAW,KAAK,SAAS;QAC/B,CAAC,WAAW,IAAI,KAAK,IAAI,KAAK,CAAC,SAAS,KAAK,UAAU,CAAC,EACxD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,KAAK,CAAC;SACX,IAAI,EAAE;SACN,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC;AACxE,CAAC;AAED;;;;;;;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B,GAAG,8BAA8B,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC;IACxD,CAAC;IACD,OAAO;QACL,UAAU,EAAE,gBAAgB;QAC5B,aAAa,EAAE;YACb,CAAC,GAAG,CAAC,EAAE;gBACL,MAAM,EAAE,oBAAoB;gBAC5B,MAAM,EAAE;oBACN,GAAG,MAAM;oBACT,IAAI,EAAE,MAAM;oBACZ,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;oBACnD,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,oBAAoB,EAAE,EAAE,eAAe,EAAE,EAAE;iBAC/D;aACF;SACF;QACD,GAAG,CAAC,YAAY,KAAK,SAAS,IAAI,EAAE,YAAY,EAAE,CAAC;KACpD,CAAC;AACJ,CAAC","sourcesContent":["import {\n type ElicitRequestFormParams,\n type ElicitResult,\n fromJsonSchema,\n type Icon,\n type InputRequiredResult,\n type PrimitiveSchemaDefinition,\n type Resource,\n type StringSchema,\n} from \"@modelcontextprotocol/server\";\n\n/** A titled choice, with an optional description and thumbnail. */\nexport interface OpenAIFormOption {\n const: string;\n title: string;\n description?: string;\n /** An HTTPS URL or a base64 data URI. */\n \"x-openai-thumbnail\"?: Icon;\n}\n\n/** A string field that accepts a `pattern` and suggested values. */\nexport type OpenAIFormStringField = StringSchema & {\n pattern?: string;\n \"x-openai-suggestions\"?: OpenAIFormOption[];\n};\n\n/** Resources the user picks from, or adds, in a resource field. */\nexport interface OpenAIResourceInput {\n type: \"resource\";\n /** Multi-select only. Defaults to `\"explicit\"`. */\n selection?: \"explicit\" | \"implicit\";\n options: Resource[];\n userOptions?: { kind?: \"file\" | \"directory\"; accept?: string[] };\n}\n\ntype FieldText = { title?: string; description?: string };\ntype ArrayBounds = FieldText & { minItems?: number; maxItems?: number };\n\n/** One field of an {@link OpenAIForm}. */\nexport type OpenAIFormField =\n | PrimitiveSchemaDefinition\n | OpenAIFormStringField\n | (FieldText & {\n type: \"string\";\n oneOf: OpenAIFormOption[];\n default?: string;\n })\n | (ArrayBounds & {\n type: \"array\";\n items: { anyOf: OpenAIFormOption[] };\n default?: string[];\n })\n | (ArrayBounds & {\n type: \"array\";\n uniqueItems?: boolean;\n items: OpenAIFormStringField;\n default?: string[];\n })\n | (FieldText & {\n type: \"string\";\n format: \"uri\";\n \"x-openai-input\": Omit<OpenAIResourceInput, \"selection\">;\n default?: string;\n })\n | (ArrayBounds & {\n type: \"array\";\n items: { type: \"string\"; format: \"uri\" };\n \"x-openai-input\": OpenAIResourceInput;\n default?: string[];\n });\n\n/** A form for ChatGPT, from the OpenAI MCP extensions. */\nexport interface OpenAIForm {\n type: \"object\";\n properties: Record<string, OpenAIFormField>;\n required?: string[];\n}\n\nexport type OpenAIFormInputParams = Omit<\n ElicitRequestFormParams,\n \"mode\" | \"requestedSchema\"\n> & {\n /** Identifies the form across the two calls of the tool. */\n key: string;\n requestedSchema: OpenAIForm;\n requestState?: string;\n};\n\n/** The user's answer to an {@link OpenAIForm}. */\nexport type OpenAIFormResult =\n | {\n action: \"accept\";\n content: Record<string, string | number | boolean | string[]>;\n }\n | { action: \"decline\" | \"cancel\" };\n\ntype FormInputExtra = {\n mcpReq: {\n envelope?: object;\n inputResponses?: Record<string, unknown>;\n };\n};\n\nfunction supportsOpenAIForms(envelope: object | undefined): boolean {\n const {\n \"io.modelcontextprotocol/protocolVersion\": version,\n \"io.modelcontextprotocol/clientCapabilities\": capabilities,\n } = (envelope ?? {}) as {\n \"io.modelcontextprotocol/protocolVersion\"?: string;\n \"io.modelcontextprotocol/clientCapabilities\"?: {\n elicitation?: { form?: object };\n extensions?: { \"openai/elicitation\"?: { form?: object } };\n };\n };\n return (\n version !== undefined &&\n version >= \"2026-07-28\" &&\n capabilities?.elicitation?.form !== undefined &&\n capabilities.extensions?.[\"openai/elicitation\"]?.form !== undefined\n );\n}\n\nfunction picksOfferedResources(field: OpenAIFormField, value: unknown) {\n if (!(\"x-openai-input\" in field) || value === undefined) {\n return true;\n }\n const input = field[\"x-openai-input\"];\n if (\n input.userOptions !== undefined ||\n (\"selection\" in input && input.selection === \"implicit\")\n ) {\n return true;\n }\n return [value]\n .flat()\n .every((uri) => input.options.some((option) => option.uri === uri));\n}\n\n/**\n * Ask the user to fill a form in ChatGPT, from the OpenAI MCP extensions.\n * Return the result when it is an `input_required` result: ChatGPT shows the\n * form, then calls the tool again, and the same call returns the user's answer.\n *\n * @example\n * ```ts\n * server.registerTool({ name: \"pick-part\" }, (_args, extra) => {\n * const result = requestFormInput(extra, {\n * key: \"part\",\n * message: \"Choose a part\",\n * requestedSchema: {\n * type: \"object\",\n * properties: {\n * part: { type: \"string\", oneOf: [{ const: \"bolt\", title: \"M6 bolt\" }] },\n * },\n * required: [\"part\"],\n * },\n * });\n * if (\"resultType\" in result) {\n * return result;\n * }\n * return {\n * content: result.action === \"accept\" ? `Picked ${result.content.part}` : \"Nothing picked\",\n * };\n * });\n * ```\n *\n * @see https://docs.skybridge.tech/api-reference/request-form-input\n */\nexport function requestFormInput(\n extra: FormInputExtra,\n {\n key,\n requestedSchema,\n requestState,\n _meta,\n ...params\n }: OpenAIFormInputParams,\n): InputRequiredResult | OpenAIFormResult {\n if (!supportsOpenAIForms(extra.mcpReq.envelope)) {\n throw new Error(\n \"OpenAI forms need MCP 2026-07-28 or newer and a client that supports openai/elicitation forms.\",\n );\n }\n const responses = extra.mcpReq.inputResponses;\n if (responses !== undefined && Object.hasOwn(responses, key)) {\n const response = responses[key] as Partial<ElicitResult> | null;\n if (response?.action === \"decline\" || response?.action === \"cancel\") {\n return { action: response.action };\n }\n if (response?.action !== \"accept\") {\n throw new Error(`The answer to form \"${key}\" has no valid action.`);\n }\n const validated = fromJsonSchema<\n Extract<OpenAIFormResult, { action: \"accept\" }>[\"content\"]\n >(requestedSchema as object)[\"~standard\"].validate(response.content);\n if (\n \"then\" in validated ||\n validated.issues ||\n !Object.entries(requestedSchema.properties).every(([name, field]) =>\n picksOfferedResources(field, validated.value?.[name]),\n )\n ) {\n throw new Error(`The answer to form \"${key}\" does not match its schema.`);\n }\n return { action: \"accept\", content: validated.value };\n }\n return {\n resultType: \"input_required\",\n inputRequests: {\n [key]: {\n method: \"elicitation/create\",\n params: {\n ...params,\n mode: \"form\",\n requestedSchema: { type: \"object\", properties: {} },\n _meta: { ..._meta, \"openai/elicitation\": { requestedSchema } },\n },\n },\n },\n ...(requestState !== undefined && { requestState }),\n };\n}\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,24 @@
|
|
|
1
|
+
export { inputRequired, ProtocolError, ProtocolErrorCode, ResourceTemplate, 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 { type DeliveryResult, deliverEvent, type EventConfig, type EventHooks, type EventOccurrence, type EventSubscription, } from "./events.js";
|
|
16
|
+
export { FileRef } from "./file-ref.js";
|
|
17
|
+
export { type OpenAIForm, type OpenAIFormField, type OpenAIFormInputParams, type OpenAIFormOption, type OpenAIFormResult, type OpenAIResourceInput, requestFormInput, } from "./form-input.js";
|
|
18
|
+
export type { AnyToolRegistry, InferTools, ToolInput, ToolNames, ToolOutput, ToolResponseMetadata, } from "./inferUtilityTypes.js";
|
|
19
|
+
export type { McpExtra, McpMethodString, McpMiddlewareFilter, McpMiddlewareFn, McpResultFor, McpTypedMiddlewareFn, McpWildcard, } from "./middleware.js";
|
|
20
|
+
export { getToolError } from "./middleware.js";
|
|
21
|
+
export type { HandlerContent, JsonOptions, KnownToolMeta, McpServerTypes, OpenAIDisplayMode, OpenAIEntrypoint, OpenAIFileViewerConfig, OpenAIMentionsConfig, OpenAIQuickAction, OpenAISettingsConfig, OpenAISettingsValues, OpenAIToolConfig, SecurityScheme, SkybridgeServerOptions, ToolDef, ToolMeta, ViewConfig, ViewCsp, ViewName, ViewNameRegistry, } from "./server.js";
|
|
22
|
+
export { __setBuildManifest, __setSkillsManifest, McpServer, normalizeContent, } from "./server.js";
|
|
23
|
+
export { discoverSkills, type Skill, type SkillsManifest, } from "./skills.js";
|
|
24
|
+
export { viewsDevServer } from "./viewsDevServer.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { inputRequired, ProtocolError, ProtocolErrorCode, ResourceTemplate, } 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 { deliverEvent, } from "./events.js";
|
|
14
|
+
export { FileRef } from "./file-ref.js";
|
|
15
|
+
export { requestFormInput, } from "./form-input.js";
|
|
16
|
+
export { getToolError } from "./middleware.js";
|
|
17
|
+
export { __setBuildManifest, __setSkillsManifest, McpServer, normalizeContent, } from "./server.js";
|
|
18
|
+
export { discoverSkills, } from "./skills.js";
|
|
19
|
+
export { viewsDevServer } from "./viewsDevServer.js";
|
|
20
|
+
//# 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,EACjB,gBAAgB,GAEjB,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,EAEL,YAAY,GAKb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAOL,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAkBzB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAuB/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 ResourceTemplate,\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 {\n type DeliveryResult,\n deliverEvent,\n type EventConfig,\n type EventHooks,\n type EventOccurrence,\n type EventSubscription,\n} from \"./events.js\";\nexport { FileRef } from \"./file-ref.js\";\nexport {\n type OpenAIForm,\n type OpenAIFormField,\n type OpenAIFormInputParams,\n type OpenAIFormOption,\n type OpenAIFormResult,\n type OpenAIResourceInput,\n requestFormInput,\n} from \"./form-input.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 OpenAIDisplayMode,\n OpenAIEntrypoint,\n OpenAIFileViewerConfig,\n OpenAIMentionsConfig,\n OpenAIQuickAction,\n OpenAISettingsConfig,\n OpenAISettingsValues,\n OpenAIToolConfig,\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"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { McpServerTypes, ToolDef } from "./server.js";
|
|
2
|
+
/**
|
|
3
|
+
* Any tool registry shape (includes both views and regular tools).
|
|
4
|
+
* Used as a constraint for type parameters that accept tool registries.
|
|
5
|
+
*/
|
|
6
|
+
export type AnyToolRegistry = Record<string, ToolDef>;
|
|
7
|
+
/**
|
|
8
|
+
* Extract the tool registry type from an McpServer instance.
|
|
9
|
+
* This includes both views (registered via view()) and regular tools (registered via registerTool()).
|
|
10
|
+
*
|
|
11
|
+
* Uses the `$types` property pattern for cross-package type inference.
|
|
12
|
+
* This works across package boundaries because TypeScript uses structural typing
|
|
13
|
+
* on the shape of `$types`, rather than nominal typing on the McpServer class itself.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* type MyTools = InferTools<MyServer>;
|
|
18
|
+
* // { "search": ToolDef<...>, "calculate": ToolDef<...> }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export type InferTools<ServerType> = ServerType extends {
|
|
22
|
+
$types: McpServerTypes<infer W>;
|
|
23
|
+
} ? W : never;
|
|
24
|
+
type ExtractTool<ServerType, K extends ToolNames<ServerType>> = InferTools<ServerType>[K];
|
|
25
|
+
/**
|
|
26
|
+
* Get a union of all tool names from an McpServer instance.
|
|
27
|
+
* This includes both views and regular tools.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* type Names = ToolNames<MyServer>;
|
|
32
|
+
* // "search" | "calculate" | "details"
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export type ToolNames<ServerType> = keyof InferTools<ServerType> & string;
|
|
36
|
+
/**
|
|
37
|
+
* Get the input type for a specific tool (view or regular tool).
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* type SearchInput = ToolInput<MyServer, "search">;
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export type ToolInput<ServerType, ToolName extends ToolNames<ServerType>> = ExtractTool<ServerType, ToolName>["input"];
|
|
45
|
+
/**
|
|
46
|
+
* Get the output type for a specific tool (view or regular tool).
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* type SearchOutput = ToolOutput<MyServer, "search">;
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export type ToolOutput<ServerType, ToolName extends ToolNames<ServerType>> = ExtractTool<ServerType, ToolName>["output"];
|
|
54
|
+
/**
|
|
55
|
+
* Get the responseMetadata type for a specific tool (view or regular tool).
|
|
56
|
+
* This is inferred from the `_meta` property of the tool callback's return value.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* type SearchMeta = ToolResponseMetadata<MyServer, "search">;
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export type ToolResponseMetadata<ServerType, ToolName extends ToolNames<ServerType>> = ExtractTool<ServerType, ToolName>["responseMetadata"];
|
|
64
|
+
export {};
|
|
@@ -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 {};
|