skybridge 0.0.0-dev.b348f85 → 0.0.0-dev.b34b4f0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -7
- 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 +2 -2
- package/dist/cli/detect-port.js +8 -20
- package/dist/cli/detect-port.js.map +1 -1
- package/dist/cli/header.d.ts +1 -1
- package/dist/cli/resolve-skybridge-config.d.ts +5 -0
- package/dist/cli/resolve-skybridge-config.js +18 -0
- package/dist/cli/resolve-skybridge-config.js.map +1 -0
- package/dist/cli/run-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.js +2 -0
- package/dist/cli/telemetry.js.map +1 -1
- package/dist/cli/use-execute-steps.d.ts +1 -1
- package/dist/cli/use-nodemon.d.ts +25 -1
- package/dist/cli/use-nodemon.js +96 -63
- package/dist/cli/use-nodemon.js.map +1 -1
- package/dist/cli/use-typescript-check.d.ts +8 -2
- package/dist/cli/use-typescript-check.js +71 -68
- package/dist/cli/use-typescript-check.js.map +1 -1
- package/dist/commands/build.d.ts +0 -3
- package/dist/commands/build.js +2 -73
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/dev.d.ts +1 -0
- package/dist/commands/dev.js +51 -3
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/start.js +7 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/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/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.d.ts +1 -0
- package/dist/server/auth/discovery.test.js +93 -0
- package/dist/server/auth/discovery.test.js.map +1 -0
- package/dist/server/auth/index.d.ts +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.d.ts +1 -0
- package/dist/server/auth/providers/auth0.test.js +50 -0
- package/dist/server/auth/providers/auth0.test.js.map +1 -0
- package/dist/server/auth/providers/authplane.d.ts +49 -0
- package/dist/server/auth/providers/authplane.js +57 -0
- package/dist/server/auth/providers/authplane.js.map +1 -0
- package/dist/server/auth/providers/authplane.test.d.ts +1 -0
- package/dist/server/auth/providers/authplane.test.js +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 +43 -6
- package/dist/server/auth.js +4 -5
- package/dist/server/auth.js.map +1 -1
- 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 +41 -1
- package/dist/server/content-helpers.js +33 -0
- package/dist/server/content-helpers.js.map +1 -1
- package/dist/server/express.d.ts +23 -3
- package/dist/server/express.js +38 -32
- package/dist/server/express.js.map +1 -1
- package/dist/server/express.test.js +268 -90
- package/dist/server/express.test.js.map +1 -1
- package/dist/server/file-ref.d.ts +21 -1
- package/dist/server/file-ref.js +20 -1
- package/dist/server/file-ref.js.map +1 -1
- 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 +17 -3
- package/dist/server/index.js +14 -2
- package/dist/server/index.js.map +1 -1
- 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/middleware.d.ts +51 -13
- package/dist/server/middleware.js +33 -0
- package/dist/server/middleware.js.map +1 -1
- package/dist/server/middleware.test-d.js +1 -1
- package/dist/server/middleware.test-d.js.map +1 -1
- package/dist/server/middleware.test.js +242 -134
- package/dist/server/middleware.test.js.map +1 -1
- package/dist/server/register-tool.test.d.ts +1 -0
- package/dist/server/register-tool.test.js +110 -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 +358 -71
- package/dist/server/server.js +461 -316
- package/dist/server/server.js.map +1 -1
- package/dist/server/skills-integration.test.d.ts +1 -0
- package/dist/server/skills-integration.test.js +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/server/templateHelper.d.ts +0 -3
- package/dist/server/templateHelper.js.map +1 -1
- package/dist/server/templates.generated.js +4 -8
- package/dist/server/templates.generated.js.map +1 -1
- package/dist/server/tool-extra.test.d.ts +1 -0
- package/dist/server/tool-extra.test.js +88 -0
- package/dist/server/tool-extra.test.js.map +1 -0
- package/dist/server/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.js +4 -1
- package/dist/server/viewsDevServer.js.map +1 -1
- package/dist/test/utils.d.ts +9 -11
- package/dist/test/utils.js +220 -201
- package/dist/test/utils.js.map +1 -1
- package/dist/test/view.test.js +123 -106
- package/dist/test/view.test.js.map +1 -1
- 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/{web/plugin → views}/scan-views.js +1 -1
- 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.map +1 -0
- package/dist/views/validate-view.d.ts +1 -0
- package/dist/{web/plugin → views}/validate-view.js +2 -2
- 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.map +1 -0
- package/dist/web/bridges/adaptor.d.ts +61 -0
- package/dist/web/bridges/adaptor.js +476 -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 +6 -1
- package/dist/web/bridges/apps-sdk/bridge.js +15 -3
- package/dist/web/bridges/apps-sdk/bridge.js.map +1 -1
- package/dist/web/bridges/apps-sdk/index.d.ts +0 -1
- package/dist/web/bridges/apps-sdk/index.js +0 -1
- package/dist/web/bridges/apps-sdk/index.js.map +1 -1
- package/dist/web/bridges/apps-sdk/use-apps-sdk-context.d.ts +11 -0
- package/dist/web/bridges/apps-sdk/use-apps-sdk-context.js +11 -0
- package/dist/web/bridges/apps-sdk/use-apps-sdk-context.js.map +1 -1
- package/dist/web/bridges/get-adaptor.d.ts +7 -0
- package/dist/web/bridges/get-adaptor.js +9 -7
- package/dist/web/bridges/get-adaptor.js.map +1 -1
- package/dist/web/bridges/get-adaptor.test.d.ts +1 -0
- package/dist/web/bridges/get-adaptor.test.js +32 -0
- package/dist/web/bridges/get-adaptor.test.js.map +1 -0
- package/dist/web/bridges/mcp-app/bridge.d.ts +15 -2
- package/dist/web/bridges/mcp-app/bridge.js +80 -7
- package/dist/web/bridges/mcp-app/bridge.js.map +1 -1
- package/dist/web/bridges/mcp-app/bridge.test.d.ts +1 -0
- package/dist/web/bridges/mcp-app/bridge.test.js +17 -0
- package/dist/web/bridges/mcp-app/bridge.test.js.map +1 -0
- package/dist/web/bridges/mcp-app/index.d.ts +0 -1
- package/dist/web/bridges/mcp-app/index.js +0 -1
- package/dist/web/bridges/mcp-app/index.js.map +1 -1
- package/dist/web/bridges/mcp-app/types.d.ts +25 -2
- package/dist/web/bridges/mcp-app/types.js.map +1 -1
- package/dist/web/bridges/mcp-app/use-mcp-app-context.d.ts +13 -1
- package/dist/web/bridges/mcp-app/use-mcp-app-context.js +12 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.js.map +1 -1
- package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js +1 -1
- package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js.map +1 -1
- package/dist/web/bridges/mcp-app/view-tools.test.d.ts +1 -0
- package/dist/web/bridges/mcp-app/view-tools.test.js +143 -0
- package/dist/web/bridges/mcp-app/view-tools.test.js.map +1 -0
- package/dist/web/bridges/types.d.ts +156 -5
- package/dist/web/bridges/types.js +14 -1
- package/dist/web/bridges/types.js.map +1 -1
- package/dist/web/bridges/types.test.d.ts +1 -0
- package/dist/web/bridges/types.test.js +19 -0
- package/dist/web/bridges/types.test.js.map +1 -0
- package/dist/web/bridges/use-host-context.d.ts +5 -0
- package/dist/web/bridges/use-host-context.js +5 -0
- package/dist/web/bridges/use-host-context.js.map +1 -1
- package/dist/web/components/modal-provider.d.ts +1 -1
- package/dist/web/components/modal-provider.js +4 -3
- package/dist/web/components/modal-provider.js.map +1 -1
- package/dist/web/create-store.d.ts +26 -0
- package/dist/web/create-store.js +26 -0
- package/dist/web/create-store.js.map +1 -1
- package/dist/web/create-store.test.js +10 -7
- package/dist/web/create-store.test.js.map +1 -1
- package/dist/web/data-llm.d.ts +34 -1
- package/dist/web/data-llm.js +31 -2
- package/dist/web/data-llm.js.map +1 -1
- package/dist/web/data-llm.test.js +26 -7
- package/dist/web/data-llm.test.js.map +1 -1
- package/dist/web/generate-helpers.d.ts +25 -19
- package/dist/web/generate-helpers.js +23 -17
- package/dist/web/generate-helpers.js.map +1 -1
- package/dist/web/generate-helpers.test-d.js +7 -5
- package/dist/web/generate-helpers.test-d.js.map +1 -1
- package/dist/web/generate-helpers.test.js +2 -2
- package/dist/web/generate-helpers.test.js.map +1 -1
- package/dist/web/hooks/index.d.ts +7 -1
- package/dist/web/hooks/index.js +7 -1
- package/dist/web/hooks/index.js.map +1 -1
- package/dist/web/hooks/openai-extensions.test.d.ts +1 -0
- package/dist/web/hooks/openai-extensions.test.js +114 -0
- package/dist/web/hooks/openai-extensions.test.js.map +1 -0
- package/dist/web/hooks/test/utils.d.ts +2 -1
- package/dist/web/hooks/test/utils.js +1 -1
- package/dist/web/hooks/test/utils.js.map +1 -1
- package/dist/web/hooks/use-call-tool.d.ts +47 -2
- package/dist/web/hooks/use-call-tool.js +43 -10
- package/dist/web/hooks/use-call-tool.js.map +1 -1
- package/dist/web/hooks/use-call-tool.test.js +50 -25
- package/dist/web/hooks/use-call-tool.test.js.map +1 -1
- package/dist/web/hooks/use-deep-link.d.ts +22 -0
- package/dist/web/hooks/use-deep-link.js +59 -0
- package/dist/web/hooks/use-deep-link.js.map +1 -0
- package/dist/web/hooks/use-display-mode.d.ts +20 -0
- package/dist/web/hooks/use-display-mode.js +20 -0
- package/dist/web/hooks/use-display-mode.js.map +1 -1
- package/dist/web/hooks/use-display-mode.test.js +57 -21
- package/dist/web/hooks/use-display-mode.test.js.map +1 -1
- package/dist/web/hooks/use-download.d.ts +1 -3
- package/dist/web/hooks/use-download.js +1 -2
- package/dist/web/hooks/use-download.js.map +1 -1
- package/dist/web/hooks/use-download.test.js +18 -10
- package/dist/web/hooks/use-download.test.js.map +1 -1
- package/dist/web/hooks/use-file-resource.d.ts +37 -0
- package/dist/web/hooks/use-file-resource.js +101 -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 +32 -0
- package/dist/web/hooks/use-files.js +32 -0
- package/dist/web/hooks/use-files.js.map +1 -1
- package/dist/web/hooks/use-files.test.js +11 -3
- package/dist/web/hooks/use-files.test.js.map +1 -1
- 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 +62 -0
- package/dist/web/hooks/use-model-context.js.map +1 -0
- package/dist/web/hooks/use-open-external.d.ts +17 -0
- package/dist/web/hooks/use-open-external.js +16 -0
- package/dist/web/hooks/use-open-external.js.map +1 -1
- package/dist/web/hooks/use-open-external.test.js +15 -5
- package/dist/web/hooks/use-open-external.test.js.map +1 -1
- package/dist/web/hooks/use-open-file.d.ts +19 -0
- package/dist/web/hooks/use-open-file.js +24 -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 +14 -0
- package/dist/web/hooks/use-request-close.js +13 -0
- package/dist/web/hooks/use-request-close.js.map +1 -1
- package/dist/web/hooks/use-request-close.test.js +35 -40
- package/dist/web/hooks/use-request-close.test.js.map +1 -1
- package/dist/web/hooks/use-request-modal.d.ts +16 -1
- package/dist/web/hooks/use-request-modal.js +16 -1
- package/dist/web/hooks/use-request-modal.js.map +1 -1
- package/dist/web/hooks/use-request-modal.test.js +11 -1
- package/dist/web/hooks/use-request-modal.test.js.map +1 -1
- package/dist/web/hooks/use-request-size.d.ts +17 -0
- package/dist/web/hooks/use-request-size.js +16 -0
- package/dist/web/hooks/use-request-size.js.map +1 -1
- package/dist/web/hooks/use-request-size.test.js +35 -53
- package/dist/web/hooks/use-request-size.test.js.map +1 -1
- package/dist/web/hooks/use-send-follow-up-message.d.ts +25 -2
- package/dist/web/hooks/use-send-follow-up-message.js +23 -0
- package/dist/web/hooks/use-send-follow-up-message.js.map +1 -1
- package/dist/web/hooks/use-set-open-in-app-url.d.ts +17 -0
- package/dist/web/hooks/use-set-open-in-app-url.js +17 -0
- package/dist/web/hooks/use-set-open-in-app-url.js.map +1 -1
- package/dist/web/hooks/use-set-open-in-app-url.test.js +26 -12
- package/dist/web/hooks/use-set-open-in-app-url.test.js.map +1 -1
- package/dist/web/hooks/use-tool-info.d.ts +46 -14
- package/dist/web/hooks/use-tool-info.js +29 -7
- package/dist/web/hooks/use-tool-info.js.map +1 -1
- package/dist/web/hooks/use-tool-info.test-d.js +11 -34
- package/dist/web/hooks/use-tool-info.test-d.js.map +1 -1
- package/dist/web/hooks/use-tool-info.test.js +42 -37
- package/dist/web/hooks/use-tool-info.test.js.map +1 -1
- package/dist/web/hooks/use-user.d.ts +5 -2
- package/dist/web/hooks/use-user.js +6 -3
- package/dist/web/hooks/use-user.js.map +1 -1
- package/dist/web/hooks/use-user.test.js +85 -37
- package/dist/web/hooks/use-user.test.js.map +1 -1
- package/dist/web/hooks/use-view-state.d.ts +21 -0
- package/dist/web/hooks/use-view-state.js +19 -9
- package/dist/web/hooks/use-view-state.js.map +1 -1
- package/dist/web/hooks/use-view-state.test.js +39 -4
- package/dist/web/hooks/use-view-state.test.js.map +1 -1
- 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/mount-view.d.ts +20 -0
- package/dist/web/mount-view.js +22 -6
- package/dist/web/mount-view.js.map +1 -1
- package/dist/web/types.d.ts +4 -0
- package/dist/web/types.js.map +1 -1
- package/package.json +32 -26
- package/dist/web/bridges/apps-sdk/adaptor.d.ts +0 -27
- package/dist/web/bridges/apps-sdk/adaptor.js +0 -112
- package/dist/web/bridges/apps-sdk/adaptor.js.map +0 -1
- package/dist/web/bridges/mcp-app/adaptor.d.ts +0 -51
- package/dist/web/bridges/mcp-app/adaptor.js +0 -279
- package/dist/web/bridges/mcp-app/adaptor.js.map +0 -1
- package/dist/web/hooks/use-layout.d.ts +0 -22
- package/dist/web/hooks/use-layout.js +0 -23
- package/dist/web/hooks/use-layout.js.map +0 -1
- package/dist/web/hooks/use-layout.test.js +0 -96
- package/dist/web/hooks/use-layout.test.js.map +0 -1
- package/dist/web/plugin/data-llm.test.js +0 -81
- package/dist/web/plugin/data-llm.test.js.map +0 -1
- package/dist/web/plugin/plugin.d.ts +0 -5
- package/dist/web/plugin/plugin.js +0 -163
- package/dist/web/plugin/plugin.js.map +0 -1
- package/dist/web/plugin/scan-views.js.map +0 -1
- package/dist/web/plugin/scan-views.test.js.map +0 -1
- package/dist/web/plugin/transform-data-llm.d.ts +0 -12
- package/dist/web/plugin/transform-data-llm.js +0 -96
- package/dist/web/plugin/transform-data-llm.js.map +0 -1
- package/dist/web/plugin/transform-data-llm.test.js +0 -81
- package/dist/web/plugin/transform-data-llm.test.js.map +0 -1
- package/dist/web/plugin/validate-view.d.ts +0 -1
- package/dist/web/plugin/validate-view.js.map +0 -1
- package/dist/web/plugin/validate-view.test.js.map +0 -1
- /package/dist/{web/hooks/use-layout.test.d.ts → cli/build-helpers.test.d.ts} +0 -0
- /package/dist/{web/plugin/data-llm.test.d.ts → cli/build-steps.test.d.ts} +0 -0
- /package/dist/{web/plugin/scan-views.test.d.ts → context-warnings.test.d.ts} +0 -0
- /package/dist/{web/plugin/transform-data-llm.test.d.ts → server/app.test.d.ts} +0 -0
- /package/dist/{web/plugin/validate-view.test.d.ts → server/auth-extra.test-d.d.ts} +0 -0
- /package/dist/{web/plugin → views}/scan-views.d.ts +0 -0
- /package/dist/{web/plugin → views}/scan-views.test.js +0 -0
- /package/dist/{web/plugin → views}/validate-view.test.js +0 -0
package/dist/server/server.d.ts
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import type { McpUiToolMeta } from "@modelcontextprotocol/ext-apps";
|
|
2
|
-
import { type ServerOptions } from "@modelcontextprotocol/
|
|
3
|
-
import
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import { type
|
|
8
|
-
|
|
2
|
+
import { type ContentBlock, type Icon, type Implementation, McpServer as McpServerBase, type RequestMeta, type ResourceLink, type ServerOptions, type ServerResult, type StandardSchemaV1, type StandardSchemaWithJSON, type ToolAnnotations } from "@modelcontextprotocol/server";
|
|
3
|
+
import type express from "express";
|
|
4
|
+
import type { ResourceMetadataUrlResolver } from "./auth/setup.js";
|
|
5
|
+
import type { ExtraClaims } from "./auth.js";
|
|
6
|
+
import type { McpExtra, McpExtraFor, McpMethodString, McpMiddlewareEntry, McpMiddlewareFilter, McpMiddlewareFn, McpResultFor, McpTypedMiddlewareFn, McpWildcard } from "./middleware.js";
|
|
7
|
+
import { type SkillsManifest } from "./skills.js";
|
|
8
|
+
/**
|
|
9
|
+
* Type marker for a registered tool — carries its input, output, and response
|
|
10
|
+
* metadata shapes so views can infer types from `typeof server`.
|
|
11
|
+
*
|
|
12
|
+
* You normally never construct this by hand; it is produced by `registerTool`
|
|
13
|
+
* and consumed by helpers like {@link InferTools} and {@link generateHelpers}.
|
|
14
|
+
*/
|
|
9
15
|
export type ToolDef<TInput = unknown, TOutput = unknown, TResponseMetadata = unknown> = {
|
|
10
16
|
input: TInput;
|
|
11
17
|
output: TOutput;
|
|
12
18
|
responseMetadata: TResponseMetadata;
|
|
13
19
|
};
|
|
14
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Content Security Policy origins attached to a view's resource. Each list is
|
|
22
|
+
* passed through to the host's CSP for the view iframe; omit a field to inherit
|
|
23
|
+
* the host's default for that directive.
|
|
24
|
+
*/
|
|
15
25
|
export interface ViewCsp {
|
|
16
26
|
/** Origins for static assets (images, fonts, scripts, styles). */
|
|
17
27
|
resourceDomains?: string[];
|
|
@@ -24,16 +34,39 @@ export interface ViewCsp {
|
|
|
24
34
|
/** Origins allowed in `<base href>` tags (mcp-apps only). */
|
|
25
35
|
baseUriDomains?: string[];
|
|
26
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Registry of view component names. The Skybridge Vite plugin augments this
|
|
39
|
+
* interface in the generated `.skybridge/views.d.ts` with one key per view
|
|
40
|
+
* file, which narrows {@link ViewName} from `string` to the concrete union.
|
|
41
|
+
*/
|
|
27
42
|
export interface ViewNameRegistry {
|
|
28
43
|
}
|
|
29
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Resolve view component names from a registry: the union of its keys, or
|
|
46
|
+
* `string` when the registry is empty. The empty case happens before
|
|
47
|
+
* `.skybridge/views.d.ts` is generated; falling back to `string` keeps valid
|
|
48
|
+
* view names from erroring on a fresh checkout, and narrowing kicks in once
|
|
49
|
+
* the generated file augments the registry.
|
|
50
|
+
*/
|
|
51
|
+
export type ViewNameFor<Registry> = [keyof Registry & string] extends [never] ? string : keyof Registry & string;
|
|
52
|
+
/** Union of valid view component names. Narrowed by {@link ViewNameRegistry}. */
|
|
53
|
+
export type ViewName = ViewNameFor<ViewNameRegistry>;
|
|
54
|
+
/**
|
|
55
|
+
* Pass under `view` in a tool's `registerTool` config to render the tool's
|
|
56
|
+
* result through a Skybridge view instead of a plain text response.
|
|
57
|
+
*/
|
|
30
58
|
export interface ViewConfig {
|
|
59
|
+
/** Filename of the view module (without extension) — matches a file in your `viewsDir`. */
|
|
31
60
|
component: ViewName;
|
|
61
|
+
/** Human-readable label the host may show alongside the view. */
|
|
32
62
|
description?: string;
|
|
33
|
-
|
|
63
|
+
/** Request a visible border around the view (forwarded as `ui.prefersBorder`). */
|
|
34
64
|
prefersBorder?: boolean;
|
|
65
|
+
/** Override the iframe's served domain (advanced; forwarded as `ui.domain`). */
|
|
35
66
|
domain?: string;
|
|
67
|
+
/** Per-view CSP overrides — see {@link ViewCsp}. */
|
|
36
68
|
csp?: ViewCsp;
|
|
69
|
+
/** Free-form metadata forwarded on the view resource's `_meta`. */
|
|
37
70
|
_meta?: Record<string, unknown>;
|
|
38
71
|
}
|
|
39
72
|
export type SecurityScheme = {
|
|
@@ -42,15 +75,123 @@ export type SecurityScheme = {
|
|
|
42
75
|
type: "oauth2";
|
|
43
76
|
scopes?: string[];
|
|
44
77
|
};
|
|
78
|
+
/** A display mode ChatGPT can render a view in. ChatGPT doesn't support `pip`. */
|
|
79
|
+
export type OpenAIDisplayMode = "inline" | "fullscreen";
|
|
80
|
+
/** A sidebar shortcut that calls another tool of the same server. */
|
|
81
|
+
export interface OpenAIQuickAction {
|
|
82
|
+
title: string;
|
|
83
|
+
icons: [Icon, ...Icon[]];
|
|
84
|
+
target: {
|
|
85
|
+
type: "tool";
|
|
86
|
+
name: string;
|
|
87
|
+
arguments?: Record<string, unknown>;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A place in ChatGPT where users can open the tool's view without the model.
|
|
92
|
+
*
|
|
93
|
+
* - `global`: an entry in the sidebar, opened fullscreen.
|
|
94
|
+
* - `thread`: a tab in a conversation's side panel.
|
|
95
|
+
* - `file`: a viewer for files with these extensions, such as `".stl"`.
|
|
96
|
+
* ChatGPT calls the tool with `{ file: { name, resourceUri } }`.
|
|
97
|
+
* - `settings`: an entry in the plugin settings.
|
|
98
|
+
*
|
|
99
|
+
* ChatGPT calls the tool with `{}` for global and thread entrypoints, so the
|
|
100
|
+
* tool must not require any input.
|
|
101
|
+
*/
|
|
102
|
+
export type OpenAIEntrypoint = {
|
|
103
|
+
type: "global";
|
|
104
|
+
quickAction?: OpenAIQuickAction;
|
|
105
|
+
} | {
|
|
106
|
+
type: "thread";
|
|
107
|
+
} | {
|
|
108
|
+
type: "file";
|
|
109
|
+
extensions: string[];
|
|
110
|
+
} | {
|
|
111
|
+
type: "settings";
|
|
112
|
+
searchTerms?: string[];
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* ChatGPT-only tool options, emitted as `_meta["openai/ui"]` on the tool and
|
|
116
|
+
* on its view resource. Every field is optional: ChatGPT applies the defaults
|
|
117
|
+
* of the OpenAI MCP extensions spec when one is omitted. Requires `view`.
|
|
118
|
+
*
|
|
119
|
+
* @see https://github.com/openai/mcp-extensions/blob/main/docs/spec.md
|
|
120
|
+
*/
|
|
121
|
+
export interface OpenAIToolConfig {
|
|
122
|
+
/** Places where users can open the view directly. */
|
|
123
|
+
entrypoints?: OpenAIEntrypoint[];
|
|
124
|
+
/**
|
|
125
|
+
* Display modes the view supports, read before the view loads. Defaults to
|
|
126
|
+
* `[preferredDisplayMode]` when that is set, otherwise to both modes.
|
|
127
|
+
*/
|
|
128
|
+
availableDisplayModes?: OpenAIDisplayMode[];
|
|
129
|
+
/**
|
|
130
|
+
* Display mode the view prefers to open in. Setting it alone makes it the
|
|
131
|
+
* only available mode, so also set `availableDisplayModes` to keep the other.
|
|
132
|
+
*/
|
|
133
|
+
preferredDisplayMode?: OpenAIDisplayMode;
|
|
134
|
+
/** Display mode the view opens in first when the model calls the tool. */
|
|
135
|
+
preferredModelDisplayMode?: OpenAIDisplayMode;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Declarative per-tool auth. Enforced when the server has an `oauth` provider:
|
|
139
|
+
* anonymous or under-scoped calls are rejected before the handler runs. Omit
|
|
140
|
+
* `auth` entirely for the secure default (sign-in required, no specific scope).
|
|
141
|
+
*/
|
|
142
|
+
export type ToolAuth = {
|
|
143
|
+
/**
|
|
144
|
+
* When `true`, the tool is callable signed out; the token is still used when
|
|
145
|
+
* one is present. Omit (or `false`) to require sign-in.
|
|
146
|
+
*/
|
|
147
|
+
allowsAnonymous?: boolean;
|
|
148
|
+
/** OAuth scopes the caller's token must carry to invoke the tool. */
|
|
149
|
+
scopes?: string[];
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Options forwarded to the built-in `express.json()` body parser. Derived
|
|
153
|
+
* from Express's own types so the public API doesn't depend on `body-parser`.
|
|
154
|
+
*/
|
|
155
|
+
export type JsonOptions = NonNullable<Parameters<typeof express.json>[0]>;
|
|
156
|
+
/**
|
|
157
|
+
* The Skybridge-specific options an {@link McpServer} is built with. A
|
|
158
|
+
* {@link Skybridge} app derives them from its config; pass them directly only
|
|
159
|
+
* when constructing an `McpServer` by hand.
|
|
160
|
+
*/
|
|
161
|
+
export interface SkybridgeServerOptions {
|
|
162
|
+
/** Whether an OAuth provider guards `/mcp`; enables per-tool scheme enforcement. */
|
|
163
|
+
oauth?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* @experimental Serve Agent Skills from `src/skills` over MCP (SEP-2640).
|
|
166
|
+
* API may change.
|
|
167
|
+
*/
|
|
168
|
+
skills?: boolean;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Well-known keys recognized by host runtimes when set on a tool's `_meta`.
|
|
172
|
+
* Use {@link ToolMeta} to also pass arbitrary custom metadata alongside these.
|
|
173
|
+
*
|
|
174
|
+
* @see https://developers.openai.com/apps-sdk/reference#tool-descriptor-parameters
|
|
175
|
+
*/
|
|
45
176
|
export interface KnownToolMeta {
|
|
177
|
+
/** Apps SDK: allow the rendered view to call this tool from inside its iframe. */
|
|
46
178
|
"openai/widgetAccessible"?: boolean;
|
|
179
|
+
/** Apps SDK: status text shown while the tool is running (e.g. `"Searching trips"`). */
|
|
47
180
|
"openai/toolInvocation/invoking"?: string;
|
|
181
|
+
/** Apps SDK: status text shown once the tool returns (e.g. `"Found 3 trips"`). */
|
|
48
182
|
"openai/toolInvocation/invoked"?: string;
|
|
183
|
+
/** Apps SDK: input parameters that hold file references — the host attaches uploaded files to them. */
|
|
49
184
|
"openai/fileParams"?: string[];
|
|
185
|
+
/** MCP Apps: control whether the tool is exposed to the model, the app, or both. */
|
|
50
186
|
ui?: Pick<McpUiToolMeta, "visibility">;
|
|
51
|
-
securitySchemes?: SecurityScheme[];
|
|
52
187
|
}
|
|
188
|
+
/** {@link KnownToolMeta} merged with arbitrary string-keyed metadata for custom flags. */
|
|
53
189
|
export type ToolMeta = KnownToolMeta & Record<string, unknown>;
|
|
190
|
+
/**
|
|
191
|
+
* Convenient return type for tool handlers — a plain string, a single
|
|
192
|
+
* {@link ContentBlock}, or an array. Skybridge normalizes it to the MCP
|
|
193
|
+
* `content: ContentBlock[]` shape before responding.
|
|
194
|
+
*/
|
|
54
195
|
export type HandlerContent = string | ContentBlock | ContentBlock[];
|
|
55
196
|
/**
|
|
56
197
|
* Type-level marker interface for cross-package type inference.
|
|
@@ -68,10 +209,10 @@ export interface McpServerTypes<TTools extends Record<string, ToolDef>> {
|
|
|
68
209
|
type Simplify<T> = {
|
|
69
210
|
[K in keyof T]: T[K];
|
|
70
211
|
};
|
|
71
|
-
type ShapeOutput<Shape extends
|
|
72
|
-
[K in keyof Shape as undefined extends
|
|
212
|
+
type ShapeOutput<Shape extends Record<string, StandardSchemaWithJSON>> = Simplify<{
|
|
213
|
+
[K in keyof Shape as undefined extends StandardSchemaV1.InferOutput<Shape[K]> ? never : K]: StandardSchemaV1.InferOutput<Shape[K]>;
|
|
73
214
|
} & {
|
|
74
|
-
[K in keyof Shape as undefined extends
|
|
215
|
+
[K in keyof Shape as undefined extends StandardSchemaV1.InferOutput<Shape[K]> ? K : never]?: StandardSchemaV1.InferOutput<Shape[K]>;
|
|
75
216
|
}>;
|
|
76
217
|
type ExtractStructuredContent<T> = T extends {
|
|
77
218
|
structuredContent: infer SC;
|
|
@@ -83,17 +224,36 @@ type ExtractMeta<T> = [Extract<T, {
|
|
|
83
224
|
}> extends {
|
|
84
225
|
_meta: infer M;
|
|
85
226
|
} ? Simplify<M> : unknown;
|
|
86
|
-
type AddTool<TTools, TName extends string, TInput extends
|
|
227
|
+
type AddTool<TTools, TName extends string, TInput extends Record<string, StandardSchemaWithJSON>, TOutput, TResponseMetadata = unknown, TAuthExtra extends ExtraClaims = ExtraClaims> = McpServer<TTools & {
|
|
87
228
|
[K in TName]: ToolDef<ShapeOutput<TInput>, TOutput, TResponseMetadata>;
|
|
88
|
-
}>;
|
|
89
|
-
interface
|
|
229
|
+
}, TAuthExtra>;
|
|
230
|
+
interface ToolConfigBase<TInput extends Record<string, StandardSchemaWithJSON> | StandardSchemaWithJSON> {
|
|
90
231
|
name: string;
|
|
91
232
|
title?: string;
|
|
92
233
|
description?: string;
|
|
93
234
|
inputSchema?: TInput;
|
|
94
|
-
outputSchema?:
|
|
235
|
+
outputSchema?: Record<string, StandardSchemaWithJSON> | StandardSchemaWithJSON;
|
|
95
236
|
annotations?: ToolAnnotations;
|
|
237
|
+
/**
|
|
238
|
+
* Icons for the tool, a standard MCP field. Hosts choose whether and where
|
|
239
|
+
* to show them. ChatGPT asks for them on every entrypoint tool, as a
|
|
240
|
+
* monochrome SVG on a 20x20 viewport that uses `currentColor`.
|
|
241
|
+
*/
|
|
242
|
+
icons?: Icon[];
|
|
96
243
|
view?: ViewConfig;
|
|
244
|
+
/** ChatGPT-only options. See {@link OpenAIToolConfig}. */
|
|
245
|
+
openai?: OpenAIToolConfig;
|
|
246
|
+
_meta?: ToolMeta;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* The auth face of a tool config: either the high-level `auth` shorthand or the
|
|
250
|
+
* low-level `securitySchemes` escape hatch, never both.
|
|
251
|
+
*/
|
|
252
|
+
type ToolAuthConfig = {
|
|
253
|
+
auth?: ToolAuth;
|
|
254
|
+
securitySchemes?: never;
|
|
255
|
+
} | {
|
|
256
|
+
auth?: never;
|
|
97
257
|
/**
|
|
98
258
|
* Declares which auth schemes this tool supports (e.g. `noauth`, `oauth2`).
|
|
99
259
|
* Lets clients label tools that require sign-in before calling, and pass
|
|
@@ -102,8 +262,8 @@ interface ToolConfig<TInput extends ZodRawShapeCompat | AnySchema> {
|
|
|
102
262
|
* enhanced behavior to authenticated ones.
|
|
103
263
|
*/
|
|
104
264
|
securitySchemes?: SecurityScheme[];
|
|
105
|
-
|
|
106
|
-
|
|
265
|
+
};
|
|
266
|
+
type ToolConfig<TInput extends Record<string, StandardSchemaWithJSON> | StandardSchemaWithJSON> = ToolConfigBase<TInput> & ToolAuthConfig;
|
|
107
267
|
/**
|
|
108
268
|
* Optional client-supplied hints attached to `params._meta` on every tool call
|
|
109
269
|
* by the Apps SDK host. Hints only: never use for authorization, and tolerate
|
|
@@ -132,53 +292,131 @@ export interface ClientHintsMeta {
|
|
|
132
292
|
"openai/organization"?: string;
|
|
133
293
|
/** Stable id for the currently mounted widget instance. */
|
|
134
294
|
"openai/widgetSessionId"?: string;
|
|
295
|
+
/**
|
|
296
|
+
* Set by ChatGPT desktop on tool calls from a view opened through a file
|
|
297
|
+
* entrypoint. `path` is the absolute path of the opened file. Any MCP client
|
|
298
|
+
* can send this key: never use it for authorization, and resolve the path
|
|
299
|
+
* and keep it inside an allowed directory before touching the filesystem.
|
|
300
|
+
*/
|
|
301
|
+
"openai/resource"?: {
|
|
302
|
+
path?: string;
|
|
303
|
+
};
|
|
135
304
|
}
|
|
136
|
-
type ToolHandlerExtra = Omit<
|
|
137
|
-
_meta
|
|
305
|
+
type ToolHandlerExtra<TAuthExtra extends ExtraClaims = ExtraClaims> = Omit<McpExtra<TAuthExtra>, "mcpReq"> & {
|
|
306
|
+
mcpReq: Omit<McpExtra<TAuthExtra>["mcpReq"], "_meta"> & {
|
|
307
|
+
_meta?: RequestMeta & ClientHintsMeta;
|
|
308
|
+
};
|
|
138
309
|
};
|
|
139
|
-
|
|
310
|
+
/** Composer at-mention search, registered with `server.registerMentions`. */
|
|
311
|
+
export interface OpenAIMentionsConfig<TAuthExtra extends ExtraClaims = ExtraClaims> {
|
|
312
|
+
/** Name of the tool ChatGPT calls for each search. */
|
|
313
|
+
name: string;
|
|
314
|
+
description?: string;
|
|
315
|
+
/** Returns the items matching the typed text, which may be empty. */
|
|
316
|
+
handler: (params: {
|
|
317
|
+
query: string;
|
|
318
|
+
}, extra: ToolHandlerExtra<TAuthExtra>) => Promise<{
|
|
319
|
+
items: ResourceLink[];
|
|
320
|
+
}> | {
|
|
321
|
+
items: ResourceLink[];
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
type ToolHandler<TInput extends Record<string, StandardSchemaWithJSON>, TReturn extends {
|
|
140
325
|
content?: HandlerContent;
|
|
141
326
|
} = {
|
|
142
327
|
content?: HandlerContent;
|
|
143
|
-
}> = (args: ShapeOutput<TInput>, extra: ToolHandlerExtra) => TReturn | Promise<TReturn>;
|
|
328
|
+
}, TAuthExtra extends ExtraClaims = ExtraClaims> = (args: ShapeOutput<TInput>, extra: ToolHandlerExtra<TAuthExtra>) => TReturn | Promise<TReturn>;
|
|
329
|
+
/**
|
|
330
|
+
* Coerce a tool handler's return value into an MCP `content` array. Strings
|
|
331
|
+
* become a single `TextContent`; a single block is wrapped in an array;
|
|
332
|
+
* `undefined` produces `[]`. Mostly used internally — exported so consumers
|
|
333
|
+
* who build content lazily can apply the same normalization.
|
|
334
|
+
*/
|
|
144
335
|
export declare function normalizeContent(content: HandlerContent | undefined): ContentBlock[];
|
|
145
336
|
interface McpServerBaseOmitted extends Omit<McpServerBase, "registerTool" | "connect"> {
|
|
146
337
|
}
|
|
147
338
|
declare const McpServerBaseOmitted: new (...args: ConstructorParameters<typeof McpServerBase>) => McpServerBaseOmitted;
|
|
148
|
-
|
|
339
|
+
/**
|
|
340
|
+
* Prime the build-time Vite manifest before user code constructs its
|
|
341
|
+
* `McpServer`. Called from the generated `dist/__entry.js`; not part of the
|
|
342
|
+
* user-facing API.
|
|
343
|
+
*
|
|
344
|
+
* @internal
|
|
345
|
+
*/
|
|
346
|
+
export declare function __setBuildManifest(manifest: Record<string, {
|
|
347
|
+
file: string;
|
|
348
|
+
}>): void;
|
|
349
|
+
export declare function __setSkillsManifest(manifest: SkillsManifest): void;
|
|
350
|
+
/**
|
|
351
|
+
* Typed registration sugar over the MCP SDK's `McpServer`: a tool registry
|
|
352
|
+
* that carries input/output/meta shapes, view resources, per-tool security
|
|
353
|
+
* schemes, and prompt/resource registration. A {@link Skybridge} app builds
|
|
354
|
+
* one of these per request and hands it to your `handler`; chain
|
|
355
|
+
* {@link McpServer.registerTool} calls on it and return the result.
|
|
356
|
+
*
|
|
357
|
+
* The `TTools` generic accumulates each registered tool's input/output/meta
|
|
358
|
+
* shape, so `typeof app` carries enough information for view-side helpers
|
|
359
|
+
* like {@link generateHelpers} to produce fully-typed hooks.
|
|
360
|
+
*
|
|
361
|
+
* @typeParam TTools - Accumulated tool registry. Filled in by `registerTool`
|
|
362
|
+
* chaining; you almost never set this manually.
|
|
363
|
+
*
|
|
364
|
+
* @example
|
|
365
|
+
* ```ts
|
|
366
|
+
* export const app = new Skybridge({
|
|
367
|
+
* name: "my-app",
|
|
368
|
+
* version: "1.0.0",
|
|
369
|
+
* handler: (server) =>
|
|
370
|
+
* server.registerTool({
|
|
371
|
+
* name: "search",
|
|
372
|
+
* inputSchema: { query: z.string() },
|
|
373
|
+
* view: { component: "search" },
|
|
374
|
+
* }, async ({ query }) => ({ content: `Results for ${query}` })),
|
|
375
|
+
* });
|
|
376
|
+
* ```
|
|
377
|
+
*
|
|
378
|
+
* @see https://docs.skybridge.tech/api-reference/mcp-server
|
|
379
|
+
*/
|
|
380
|
+
export declare class McpServer<TTools extends Record<string, ToolDef> = Record<never, ToolDef>, TAuthExtra extends ExtraClaims = ExtraClaims> extends McpServerBaseOmitted {
|
|
149
381
|
readonly $types: McpServerTypes<TTools>;
|
|
382
|
+
private claimedViews;
|
|
383
|
+
private viewMetaBuilders;
|
|
384
|
+
/**
|
|
385
|
+
* Maps a view resource's query-less path to its canonical registered URI
|
|
386
|
+
* (the one carrying the `?v=` cache key). Lets `resources/read` resolve the
|
|
387
|
+
* underlying view no matter which version param the consumer sends, since
|
|
388
|
+
* the param is only a cache key, not part of the resource's identity.
|
|
389
|
+
*/
|
|
390
|
+
private viewUriByPath;
|
|
391
|
+
private viteManifest;
|
|
392
|
+
private oauthEnabled;
|
|
393
|
+
private resolveResourceMetadataUrl?;
|
|
394
|
+
private readonly toolSecuritySchemes;
|
|
395
|
+
private readonly userMiddlewareEntries;
|
|
396
|
+
constructor(serverInfo: Implementation, options?: ServerOptions, skybridgeOptions?: SkybridgeServerOptions);
|
|
150
397
|
/**
|
|
151
|
-
* The
|
|
152
|
-
*
|
|
153
|
-
* `
|
|
398
|
+
* The per-tool security schemes collected during registration, keyed by tool
|
|
399
|
+
* name. Read by the OAuth layer to decide whether anonymous requests are
|
|
400
|
+
* allowed and which schemes gate a given `tools/call`.
|
|
154
401
|
*
|
|
155
|
-
*
|
|
156
|
-
|
|
157
|
-
|
|
402
|
+
* @internal
|
|
403
|
+
*/
|
|
404
|
+
get securitySchemesByTool(): ReadonlyMap<string, SecurityScheme[] | undefined>;
|
|
405
|
+
/**
|
|
406
|
+
* Inject the resolver the app uses to build the protected-resource metadata
|
|
407
|
+
* URL, so tool handlers can emit in-band auth challenges.
|
|
158
408
|
*
|
|
159
|
-
*
|
|
160
|
-
* locally and on self-hosted deployments.
|
|
409
|
+
* @internal
|
|
161
410
|
*/
|
|
162
|
-
|
|
163
|
-
private
|
|
164
|
-
private mcpMiddlewareEntries;
|
|
165
|
-
private mcpMiddlewareApplied;
|
|
166
|
-
private claimedViews;
|
|
167
|
-
private viteManifest;
|
|
168
|
-
private readonly serverInfo;
|
|
169
|
-
private readonly serverOptions?;
|
|
170
|
-
constructor(serverInfo: Implementation, options?: ServerOptions);
|
|
171
|
-
use(...handlers: RequestHandler[]): this;
|
|
172
|
-
use(path: string, ...handlers: RequestHandler[]): this;
|
|
173
|
-
useOnError(...handlers: ErrorRequestHandler[]): this;
|
|
174
|
-
useOnError(path: string, ...handlers: ErrorRequestHandler[]): this;
|
|
411
|
+
setResourceMetadataUrlResolver(resolve: ResourceMetadataUrlResolver): this;
|
|
412
|
+
private setupSkills;
|
|
175
413
|
/** Register MCP protocol-level middleware (catch-all). */
|
|
176
|
-
mcpMiddleware(handler: McpMiddlewareFn): this;
|
|
414
|
+
mcpMiddleware(handler: McpMiddlewareFn<TAuthExtra>): this;
|
|
177
415
|
/** Register MCP protocol-level middleware for all requests (`extra` is `McpExtra`). */
|
|
178
416
|
mcpMiddleware(filter: "request", handler: (request: {
|
|
179
417
|
method: string;
|
|
180
418
|
params: Record<string, unknown>;
|
|
181
|
-
}, extra: McpExtra
|
|
419
|
+
}, extra: McpExtra<TAuthExtra>, next: () => Promise<ServerResult>) => Promise<unknown> | unknown): this;
|
|
182
420
|
/** Register MCP protocol-level middleware for all notifications (`extra` is `undefined`). */
|
|
183
421
|
mcpMiddleware(filter: "notification", handler: (request: {
|
|
184
422
|
method: string;
|
|
@@ -188,7 +426,7 @@ export declare class McpServer<TTools extends Record<string, ToolDef> = Record<n
|
|
|
188
426
|
* Register MCP protocol-level middleware for an exact method.
|
|
189
427
|
* Narrows `params`, `extra`, and `next()` result based on the method string.
|
|
190
428
|
*/
|
|
191
|
-
mcpMiddleware<M extends McpMethodString>(filter: M, handler: McpTypedMiddlewareFn<M>): this;
|
|
429
|
+
mcpMiddleware<M extends McpMethodString>(filter: M, handler: McpTypedMiddlewareFn<M, TAuthExtra>): this;
|
|
192
430
|
/**
|
|
193
431
|
* Register MCP protocol-level middleware for a wildcard pattern (e.g. `"tools/*"`).
|
|
194
432
|
* `next()` returns the union of result types for matching methods.
|
|
@@ -196,33 +434,28 @@ export declare class McpServer<TTools extends Record<string, ToolDef> = Record<n
|
|
|
196
434
|
mcpMiddleware<W extends McpWildcard>(filter: W, handler: (request: {
|
|
197
435
|
method: string;
|
|
198
436
|
params: Record<string, unknown>;
|
|
199
|
-
}, extra: McpExtraFor<W>, next: () => Promise<McpResultFor<W>>) => Promise<unknown> | unknown): this;
|
|
437
|
+
}, extra: McpExtraFor<W, TAuthExtra>, next: () => Promise<McpResultFor<W>>) => Promise<unknown> | unknown): this;
|
|
200
438
|
/**
|
|
201
439
|
* Register MCP protocol-level middleware with a method filter.
|
|
202
440
|
* Filter can be an exact method (`"tools/call"`), wildcard (`"tools/*"`),
|
|
203
441
|
* category (`"request"` | `"notification"`), or an array of those.
|
|
204
442
|
*/
|
|
205
|
-
mcpMiddleware(filter: McpMiddlewareFilter, handler: McpMiddlewareFn): this;
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
* no public API to inject handler maps. `getHandlerMaps` validates the
|
|
216
|
-
* read side and fails fast on SDK field renames.
|
|
217
|
-
*/
|
|
218
|
-
connectStatelessTransport(transport: Parameters<typeof McpServerBase.prototype.connect>[0]): Promise<void>;
|
|
219
|
-
run(): Promise<{
|
|
220
|
-
fetch: (...args: unknown[]) => unknown;
|
|
221
|
-
} | undefined>;
|
|
443
|
+
mcpMiddleware(filter: McpMiddlewareFilter, handler: McpMiddlewareFn<TAuthExtra>): this;
|
|
444
|
+
/**
|
|
445
|
+
* This instance's protocol-level middleware: the framework's own entries
|
|
446
|
+
* (view `_meta` on `resources/list`, version-agnostic view resolution on
|
|
447
|
+
* `resources/read`, the top-level `securitySchemes` mirror on `tools/list`)
|
|
448
|
+
* followed by the ones registered via {@link McpServer.mcpMiddleware}.
|
|
449
|
+
*
|
|
450
|
+
* @internal
|
|
451
|
+
*/
|
|
452
|
+
protocolMiddlewareEntries(): McpMiddlewareEntry[];
|
|
222
453
|
private enforceOneToolPerView;
|
|
454
|
+
private resolveViewRequestContext;
|
|
223
455
|
private registerViewResources;
|
|
224
456
|
private registerViewResource;
|
|
225
|
-
private
|
|
457
|
+
private serveLegacyAppsSdkUrl;
|
|
458
|
+
private decorateToolHandler;
|
|
226
459
|
private computeViewVersionParam;
|
|
227
460
|
private lookupViewFile;
|
|
228
461
|
private lookupDistFile;
|
|
@@ -236,11 +469,65 @@ export declare class McpServer<TTools extends Record<string, ToolDef> = Record<n
|
|
|
236
469
|
file: string;
|
|
237
470
|
}>): this;
|
|
238
471
|
private readManifest;
|
|
239
|
-
|
|
472
|
+
/**
|
|
473
|
+
* Register the composer at-mention search for ChatGPT, from the OpenAI MCP
|
|
474
|
+
* extensions. When the user types `@` and your app name, ChatGPT calls
|
|
475
|
+
* `handler` with the typed text and lists the returned resource links.
|
|
476
|
+
* Skybridge registers it as a tool hidden from the model.
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* ```ts
|
|
480
|
+
* server.registerMentions({
|
|
481
|
+
* name: "search_parts",
|
|
482
|
+
* handler: async ({ query }) => ({
|
|
483
|
+
* items: findParts(query).map((part) => ({
|
|
484
|
+
* type: "resource_link",
|
|
485
|
+
* uri: `parts://${part.id}`,
|
|
486
|
+
* name: part.name,
|
|
487
|
+
* })),
|
|
488
|
+
* }),
|
|
489
|
+
* });
|
|
490
|
+
* ```
|
|
491
|
+
*
|
|
492
|
+
* @see https://docs.skybridge.tech/api-reference/register-mentions
|
|
493
|
+
*/
|
|
494
|
+
registerMentions(config: OpenAIMentionsConfig<TAuthExtra>): this;
|
|
495
|
+
/**
|
|
496
|
+
* Register a tool. Pass a `config` describing the tool (name, schemas,
|
|
497
|
+
* optional {@link ViewConfig}, optional {@link ToolMeta}) and a handler that
|
|
498
|
+
* returns the tool's result.
|
|
499
|
+
*
|
|
500
|
+
* Chain calls to build up a server: each call returns a new `McpServer`
|
|
501
|
+
* type that captures the tool's input/output/`_meta` shape so the
|
|
502
|
+
* resulting `typeof server` can drive {@link generateHelpers}.
|
|
503
|
+
*
|
|
504
|
+
* The handler's return shape determines the output types: the
|
|
505
|
+
* `structuredContent` field becomes the tool's typed output, and `_meta`
|
|
506
|
+
* becomes its `responseMetadata`. The `content` field is normalized through
|
|
507
|
+
* {@link normalizeContent}.
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* ```ts
|
|
511
|
+
* server.registerTool({
|
|
512
|
+
* name: "search",
|
|
513
|
+
* inputSchema: { query: z.string() },
|
|
514
|
+
* outputSchema: { results: z.array(z.string()) },
|
|
515
|
+
* view: { component: "search" },
|
|
516
|
+
* }, async ({ query }) => ({
|
|
517
|
+
* content: `Found results for ${query}`,
|
|
518
|
+
* structuredContent: { results: [...] },
|
|
519
|
+
* }));
|
|
520
|
+
* ```
|
|
521
|
+
*
|
|
522
|
+
* @see https://docs.skybridge.tech/api-reference/register-tool
|
|
523
|
+
*/
|
|
524
|
+
registerTool<TName extends string, InputArgs extends Record<string, StandardSchemaWithJSON>, TReturn extends {
|
|
240
525
|
content?: HandlerContent;
|
|
241
526
|
}>(config: ToolConfig<InputArgs> & {
|
|
242
527
|
name: TName;
|
|
243
|
-
}, cb: ToolHandler<InputArgs, TReturn>): AddTool<TTools, TName, InputArgs, ExtractStructuredContent<TReturn>, ExtractMeta<TReturn
|
|
244
|
-
registerTool<InputArgs extends
|
|
528
|
+
}, cb: ToolHandler<InputArgs, TReturn, TAuthExtra>): AddTool<TTools, TName, InputArgs, ExtractStructuredContent<TReturn>, ExtractMeta<TReturn>, TAuthExtra>;
|
|
529
|
+
registerTool<InputArgs extends Record<string, StandardSchemaWithJSON>>(config: ToolConfig<InputArgs>, cb: ToolHandler<InputArgs, {
|
|
530
|
+
content?: HandlerContent;
|
|
531
|
+
}, TAuthExtra>): this;
|
|
245
532
|
}
|
|
246
533
|
export {};
|