@plitzi/sdk-server 0.32.25 → 0.33.0
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/CHANGELOG.md +12 -0
- package/README.md +326 -162
- package/dist/adapters/authAdapters.d.ts +21 -0
- package/dist/adapters/authAdapters.js +12 -0
- package/dist/adapters/jsonAdapters.d.ts +15 -0
- package/dist/adapters/jsonAdapters.js +9 -4
- package/dist/core/auth/api.d.ts +148 -0
- package/dist/core/auth/api.js +286 -0
- package/dist/core/auth/authorize.d.ts +96 -0
- package/dist/core/auth/authorize.js +92 -0
- package/dist/core/auth/createAuth.d.ts +165 -0
- package/dist/core/auth/createAuth.js +105 -0
- package/dist/core/auth/credentials.d.ts +29 -0
- package/dist/core/auth/credentials.js +48 -0
- package/dist/core/auth/domains.d.ts +41 -0
- package/dist/core/auth/domains.js +78 -0
- package/dist/core/auth/identity.d.ts +108 -0
- package/dist/core/auth/identity.js +164 -0
- package/dist/core/auth/oauth/client.d.ts +5 -0
- package/dist/core/auth/oauth/client.js +47 -0
- package/dist/core/auth/oauth/index.d.ts +78 -0
- package/dist/core/auth/oauth/index.js +113 -0
- package/dist/core/auth/oauth/providers/github.d.ts +2 -0
- package/dist/core/auth/oauth/providers/github.js +48 -0
- package/dist/core/auth/oauth/providers/google.d.ts +2 -0
- package/dist/core/auth/oauth/providers/google.js +30 -0
- package/dist/core/auth/oauth/state.d.ts +23 -0
- package/dist/core/auth/oauth/state.js +55 -0
- package/dist/core/auth/oauth/types.d.ts +51 -0
- package/dist/core/auth/oauth/types.js +13 -0
- package/dist/core/auth/routes.d.ts +50 -0
- package/dist/core/auth/routes.js +129 -0
- package/dist/core/auth/session.d.ts +128 -0
- package/dist/core/auth/session.js +165 -0
- package/dist/core/auth/spaceTokens.d.ts +137 -0
- package/dist/core/auth/spaceTokens.js +212 -0
- package/dist/core/auth/tokens.d.ts +151 -0
- package/dist/core/auth/tokens.js +221 -0
- package/dist/core/createServer.d.ts +29 -0
- package/dist/core/createServer.js +28 -14
- package/dist/core/handlers/authMiddleware.d.ts +27 -0
- package/dist/core/handlers/authMiddleware.js +38 -0
- package/dist/core/handlers/authRouteHandlers.d.ts +46 -0
- package/dist/core/handlers/authRouteHandlers.js +75 -0
- package/dist/core/handlers/types.d.ts +37 -0
- package/dist/{src/core → core}/http/dispatcher.d.ts +2 -2
- package/dist/core/http/dispatcher.js +8 -6
- package/dist/core/http/navigation.d.ts +11 -0
- package/dist/core/http/navigation.js +16 -0
- package/dist/core/http/securityHeaders.js +6 -4
- package/dist/core/http/stages/authApi.d.ts +17 -0
- package/dist/core/http/stages/authApi.js +66 -0
- package/dist/core/http/stages/authRoutes.js +40 -11
- package/dist/core/http/stages/exchangeRoute.d.ts +15 -0
- package/dist/core/http/stages/exchangeRoute.js +67 -0
- package/dist/core/http/stages/health.d.ts +11 -0
- package/dist/core/http/stages/health.js +25 -3
- package/dist/core/http/stages/middlewares.d.ts +2 -0
- package/dist/core/http/stages/static.d.ts +13 -0
- package/dist/core/http/stages/static.js +21 -6
- package/dist/core/http/types.d.ts +35 -0
- package/dist/{modules/mcp/constants.js → core/previewToken.js} +1 -1
- package/dist/core/sdkAssets.d.ts +16 -0
- package/dist/core/sdkAssets.js +46 -0
- package/dist/core/server/baseServer.js +40 -5
- package/dist/core/server/pageServer.d.ts +7 -0
- package/dist/core/server/pageServer.js +13 -17
- package/dist/core/services/action.d.ts +9 -0
- package/dist/core/services/action.js +21 -0
- package/dist/core/services/registry.d.ts +3 -0
- package/dist/core/services/registry.js +9 -19
- package/dist/{src/core → core}/services/resolve.d.ts +1 -0
- package/dist/core/services/resolve.js +6 -4
- package/dist/core/services/rsc.js +3 -2
- package/dist/core/staticFiles.js +1 -1
- package/dist/{src/core → core}/transports.d.ts +3 -0
- package/dist/core/transports.js +7 -6
- package/dist/handlers.d.ts +58 -0
- package/dist/handlers.js +3 -0
- package/dist/{src/helpers → helpers}/buildResponseHelpers.d.ts +2 -1
- package/dist/helpers/buildResponseHelpers.js +13 -4
- package/dist/helpers/buildServerInfo.d.ts +3 -0
- package/dist/helpers/buildServerInfo.js +25 -3
- package/dist/{src/helpers → helpers}/cache/keys.d.ts +5 -1
- package/dist/helpers/cache/keys.js +1 -1
- package/dist/helpers/compress.d.ts +18 -0
- package/dist/helpers/compress.js +47 -11
- package/dist/helpers/offlineDataLoader.d.ts +11 -0
- package/dist/helpers/offlineDataLoader.js +15 -0
- package/dist/helpers/resolveDebugMode.d.ts +10 -0
- package/dist/helpers/resolveDebugMode.js +13 -0
- package/dist/index.d.ts +16 -2
- package/dist/index.js +9 -20
- package/dist/kernel.d.ts +41 -0
- package/dist/kernel.js +22 -0
- package/dist/middlewares/spaceDeployment.d.ts +2 -0
- package/dist/middlewares/spaceDeployment.js +2 -1
- package/dist/modules/actions/handler.d.ts +11 -0
- package/dist/modules/actions/handler.js +77 -0
- package/dist/modules/connectors/engine.d.ts +42 -0
- package/dist/modules/connectors/engine.js +221 -0
- package/dist/modules/connectors/getByPath.d.ts +8 -0
- package/dist/modules/connectors/getByPath.js +21 -0
- package/dist/modules/connectors/index.d.ts +7 -0
- package/dist/modules/connectors/projection.d.ts +18 -0
- package/dist/modules/connectors/projection.js +108 -0
- package/dist/modules/connectors/resolver.d.ts +18 -0
- package/dist/modules/connectors/resolver.js +68 -0
- package/dist/modules/connectors/types.d.ts +19 -0
- package/dist/{src/modules → modules}/rsc/handler.d.ts +2 -2
- package/dist/modules/rsc/handler.js +54 -2
- package/dist/modules/rsc/resolveRscData.d.ts +35 -0
- package/dist/modules/rsc/resolveRscData.js +74 -0
- package/dist/{src/modules → modules}/ssr/Component.d.ts +4 -1
- package/dist/modules/ssr/Component.js +10 -3
- package/dist/modules/ssr/buildBody.d.ts +9 -0
- package/dist/modules/ssr/handler.d.ts +4 -0
- package/dist/modules/ssr/handler.js +18 -1
- package/dist/{src/modules → modules}/ssr/loadPluginComponents.d.ts +5 -2
- package/dist/modules/ssr/loadPluginComponents.js +20 -2
- package/dist/{src/modules → modules}/ssr/prepareRender.d.ts +2 -2
- package/dist/modules/ssr/prepareRender.js +24 -7
- package/dist/modules/ssr/preview.d.ts +10 -0
- package/dist/modules/ssr/preview.js +5 -78
- package/dist/modules/ssr/registerExternalPlugins.js +1 -1
- package/dist/modules/ssr/streamBody.d.ts +5 -0
- package/dist/modules/ssr/streamBody.js +1 -1
- package/dist/modules/ssr/template.d.ts +2 -0
- package/dist/modules/ssr/template.js +1 -1
- package/dist/plugins/compile.js +1 -1
- package/dist/plugins/manager.js +12 -8
- package/dist/ssr.d.ts +15 -0
- package/dist/ssr.js +4 -0
- package/package.json +29 -25
- package/dist/.gitkeep +0 -0
- package/dist/core/server/mcpServer.js +0 -29
- package/dist/core/services/mcp.js +0 -27
- package/dist/core/services/oauth.js +0 -116
- package/dist/core/services/preview.js +0 -37
- package/dist/core/services/proxy.js +0 -12
- package/dist/mcp.d.ts +0 -2
- package/dist/mcp.js +0 -7
- package/dist/modules/ai/AIEngine.js +0 -120
- package/dist/modules/ai/toolkit.js +0 -59
- package/dist/modules/mcp/apps/example/view/index.tsx +0 -70
- package/dist/modules/mcp/apps/index.js +0 -16
- package/dist/modules/mcp/apps/render/index.js +0 -17
- package/dist/modules/mcp/apps/render/styles.js +0 -54
- package/dist/modules/mcp/apps/render/view/heldBatch.ts +0 -107
- package/dist/modules/mcp/apps/render/view/index.tsx +0 -314
- package/dist/modules/mcp/apps/render/view/streamProgress.ts +0 -137
- package/dist/modules/mcp/apps/shared/assets.js +0 -10
- package/dist/modules/mcp/apps/shared/bundle.js +0 -23
- package/dist/modules/mcp/apps/shared/page.js +0 -34
- package/dist/modules/mcp/apps/shared/registerApp.js +0 -43
- package/dist/modules/mcp/apps/shared/resolve.js +0 -5
- package/dist/modules/mcp/apps/shared/shell.ejs +0 -59
- package/dist/modules/mcp/apps/shared/zodEnglishOnly.js +0 -23
- package/dist/modules/mcp/catalogs/builtinCallbacks.js +0 -204
- package/dist/modules/mcp/catalogs/builtinComponents.js +0 -170
- package/dist/modules/mcp/catalogs/builtinElementCallbacks.js +0 -50
- package/dist/modules/mcp/catalogs/builtinTransformers.js +0 -148
- package/dist/modules/mcp/catalogs/builtinUtilities.js +0 -90
- package/dist/modules/mcp/catalogs/cssCatalog/border.js +0 -30
- package/dist/modules/mcp/catalogs/cssCatalog/box.js +0 -31
- package/dist/modules/mcp/catalogs/cssCatalog/helpers.js +0 -185
- package/dist/modules/mcp/catalogs/cssCatalog/index.js +0 -131
- package/dist/modules/mcp/catalogs/cssCatalog/layout.js +0 -98
- package/dist/modules/mcp/catalogs/cssCatalog/visual.js +0 -144
- package/dist/modules/mcp/catalogs/observed.js +0 -90
- package/dist/modules/mcp/catalogs/paramSpec.js +0 -69
- package/dist/modules/mcp/catalogs/registry.js +0 -89
- package/dist/modules/mcp/handler.js +0 -83
- package/dist/modules/mcp/helpers/agentPrompt.js +0 -104
- package/dist/modules/mcp/helpers/computeVersion.js +0 -16
- package/dist/modules/mcp/helpers/guide.js +0 -467
- package/dist/modules/mcp/helpers/interactions.js +0 -123
- package/dist/modules/mcp/helpers/log.js +0 -64
- package/dist/modules/mcp/helpers/opResult.js +0 -18
- package/dist/modules/mcp/helpers/space.js +0 -300
- package/dist/modules/mcp/helpers/uris.js +0 -44
- package/dist/modules/mcp/previewClient.js +0 -31
- package/dist/modules/mcp/proxy/config.js +0 -63
- package/dist/modules/mcp/proxy/fetch.js +0 -91
- package/dist/modules/mcp/proxy/grant.js +0 -67
- package/dist/modules/mcp/proxy/guard.js +0 -38
- package/dist/modules/mcp/proxy/handler.js +0 -99
- package/dist/modules/mcp/proxy/payload.js +0 -29
- package/dist/modules/mcp/proxy/rewrite.js +0 -138
- package/dist/modules/mcp/proxy/sign.js +0 -15
- package/dist/modules/mcp/proxy/types.js +0 -9
- package/dist/modules/mcp/resources/canonical.js +0 -30
- package/dist/modules/mcp/resources/core.js +0 -18
- package/dist/modules/mcp/resources/envelope.js +0 -14
- package/dist/modules/mcp/resources/primer.js +0 -31
- package/dist/modules/mcp/resources/register.js +0 -190
- package/dist/modules/mcp/resources/renderGuide.js +0 -451
- package/dist/modules/mcp/resources/router.js +0 -37
- package/dist/modules/mcp/resources/schema.js +0 -43
- package/dist/modules/mcp/resources/style.js +0 -34
- package/dist/modules/mcp/screenshotClient.js +0 -47
- package/dist/modules/mcp/server.js +0 -113
- package/dist/modules/mcp/tools/apply/dispatch.js +0 -105
- package/dist/modules/mcp/tools/apply/index.js +0 -150
- package/dist/modules/mcp/tools/apply/writeResult.js +0 -37
- package/dist/modules/mcp/tools/index.js +0 -24
- package/dist/modules/mcp/tools/operations/index.js +0 -45
- package/dist/modules/mcp/tools/operations/schema/bindings/deleteBinding.js +0 -32
- package/dist/modules/mcp/tools/operations/schema/bindings/patchBinding.js +0 -36
- package/dist/modules/mcp/tools/operations/schema/bindings/upsertBinding.js +0 -47
- package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.js +0 -29
- package/dist/modules/mcp/tools/operations/schema/elements/moveElement.js +0 -41
- package/dist/modules/mcp/tools/operations/schema/elements/patchElement.js +0 -58
- package/dist/modules/mcp/tools/operations/schema/elements/repeatElement.js +0 -148
- package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.js +0 -65
- package/dist/modules/mcp/tools/operations/schema/folders/deleteFolder.js +0 -30
- package/dist/modules/mcp/tools/operations/schema/folders/upsertFolder.js +0 -49
- package/dist/modules/mcp/tools/operations/schema/interactions/deleteInteraction.js +0 -52
- package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.js +0 -47
- package/dist/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.js +0 -44
- package/dist/modules/mcp/tools/operations/schema/operations.js +0 -41
- package/dist/modules/mcp/tools/operations/schema/pages/deletePage.js +0 -25
- package/dist/modules/mcp/tools/operations/schema/pages/upsertPage.js +0 -75
- package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.js +0 -45
- package/dist/modules/mcp/tools/operations/schema/shared.js +0 -122
- package/dist/modules/mcp/tools/operations/schema/translator.js +0 -215
- package/dist/modules/mcp/tools/operations/schema/variables/deleteVariable.js +0 -18
- package/dist/modules/mcp/tools/operations/schema/variables/upsertVariable.js +0 -42
- package/dist/modules/mcp/tools/operations/schema/write.js +0 -109
- package/dist/modules/mcp/tools/operations/schemaIds.js +0 -54
- package/dist/modules/mcp/tools/operations/style/definitions/deleteDefinition.js +0 -21
- package/dist/modules/mcp/tools/operations/style/definitions/patchDefinition.js +0 -28
- package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinition.js +0 -24
- package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinitions.js +0 -40
- package/dist/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.js +0 -21
- package/dist/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.js +0 -28
- package/dist/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.js +0 -24
- package/dist/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.js +0 -21
- package/dist/modules/mcp/tools/operations/style/idStyles/patchIdStyle.js +0 -28
- package/dist/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.js +0 -24
- package/dist/modules/mcp/tools/operations/style/operations.js +0 -29
- package/dist/modules/mcp/tools/operations/style/shared.js +0 -59
- package/dist/modules/mcp/tools/operations/style/translator.js +0 -101
- package/dist/modules/mcp/tools/operations/style/variables/deleteStyleVariable.js +0 -21
- package/dist/modules/mcp/tools/operations/style/variables/upsertStyleVariable.js +0 -22
- package/dist/modules/mcp/tools/operations/style/write.js +0 -108
- package/dist/modules/mcp/tools/preview.js +0 -37
- package/dist/modules/mcp/tools/read.js +0 -51
- package/dist/modules/mcp/tools/render.js +0 -184
- package/dist/modules/mcp/tools/screenshot.js +0 -83
- package/dist/modules/mcp/tools/search.js +0 -115
- package/dist/modules/mcp/tools/shared/expandOperations.js +0 -44
- package/dist/modules/mcp/tools/shared/tool.js +0 -33
- package/dist/modules/mcp/tools/shared/validator/audit.js +0 -124
- package/dist/modules/mcp/tools/shared/validator/batch.js +0 -39
- package/dist/modules/mcp/tools/shared/validator/bindings.js +0 -70
- package/dist/modules/mcp/tools/shared/validator/context.js +0 -35
- package/dist/modules/mcp/tools/shared/validator/css.js +0 -39
- package/dist/modules/mcp/tools/shared/validator/elements.js +0 -68
- package/dist/modules/mcp/tools/shared/validator/index.js +0 -246
- package/dist/modules/mcp/tools/shared/validator/interactions.js +0 -103
- package/dist/modules/mcp/tools/shared/validator/refs.js +0 -28
- package/dist/modules/mcp/tools/validate.js +0 -47
- package/dist/modules/oauth/authorize.js +0 -177
- package/dist/modules/oauth/challenge.js +0 -33
- package/dist/modules/oauth/consentPage.js +0 -118
- package/dist/modules/oauth/metadata.js +0 -69
- package/dist/modules/oauth/params.js +0 -5
- package/dist/modules/oauth/pkce.js +0 -15
- package/dist/modules/oauth/records.js +0 -46
- package/dist/modules/oauth/register.js +0 -55
- package/dist/modules/oauth/respond.js +0 -44
- package/dist/modules/oauth/token.js +0 -100
- package/dist/public/.gitkeep +0 -0
- package/dist/src/adapters/jsonAdapters.d.ts +0 -7
- package/dist/src/core/createServer.d.ts +0 -14
- package/dist/src/core/http/stages/health.d.ts +0 -2
- package/dist/src/core/http/stages/middlewares.d.ts +0 -2
- package/dist/src/core/http/stages/static.d.ts +0 -5
- package/dist/src/core/http/types.d.ts +0 -22
- package/dist/src/core/server/mcpServer.d.ts +0 -2
- package/dist/src/core/server/pageServer.d.ts +0 -10
- package/dist/src/core/services/mcp.d.ts +0 -3
- package/dist/src/core/services/oauth.d.ts +0 -18
- package/dist/src/core/services/preview.d.ts +0 -2
- package/dist/src/core/services/proxy.d.ts +0 -2
- package/dist/src/core/services/registry.d.ts +0 -4
- package/dist/src/helpers/buildServerInfo.d.ts +0 -2
- package/dist/src/helpers/compress.d.ts +0 -3
- package/dist/src/index.d.ts +0 -15
- package/dist/src/mcp.d.ts +0 -14
- package/dist/src/middlewares/spaceDeployment.d.ts +0 -2
- package/dist/src/modules/ai/AIEngine.d.ts +0 -20
- package/dist/src/modules/ai/index.d.ts +0 -4
- package/dist/src/modules/ai/toolkit.d.ts +0 -17
- package/dist/src/modules/mcp/apps/example/index.d.ts +0 -8
- package/dist/src/modules/mcp/apps/index.d.ts +0 -11
- package/dist/src/modules/mcp/apps/render/index.d.ts +0 -4
- package/dist/src/modules/mcp/apps/render/styles.d.ts +0 -10
- package/dist/src/modules/mcp/apps/shared/assets.d.ts +0 -10
- package/dist/src/modules/mcp/apps/shared/bundle.d.ts +0 -4
- package/dist/src/modules/mcp/apps/shared/index.d.ts +0 -3
- package/dist/src/modules/mcp/apps/shared/page.d.ts +0 -2
- package/dist/src/modules/mcp/apps/shared/registerApp.d.ts +0 -5
- package/dist/src/modules/mcp/apps/shared/resolve.d.ts +0 -1
- package/dist/src/modules/mcp/apps/shared/zodEnglishOnly.d.ts +0 -4
- package/dist/src/modules/mcp/catalogs/builtinCallbacks.d.ts +0 -23
- package/dist/src/modules/mcp/catalogs/builtinComponents.d.ts +0 -4
- package/dist/src/modules/mcp/catalogs/builtinElementCallbacks.d.ts +0 -20
- package/dist/src/modules/mcp/catalogs/builtinTransformers.d.ts +0 -28
- package/dist/src/modules/mcp/catalogs/builtinUtilities.d.ts +0 -18
- package/dist/src/modules/mcp/catalogs/cssCatalog/border.d.ts +0 -4
- package/dist/src/modules/mcp/catalogs/cssCatalog/box.d.ts +0 -4
- package/dist/src/modules/mcp/catalogs/cssCatalog/helpers.d.ts +0 -34
- package/dist/src/modules/mcp/catalogs/cssCatalog/index.d.ts +0 -19
- package/dist/src/modules/mcp/catalogs/cssCatalog/layout.d.ts +0 -9
- package/dist/src/modules/mcp/catalogs/cssCatalog/visual.d.ts +0 -8
- package/dist/src/modules/mcp/catalogs/index.d.ts +0 -9
- package/dist/src/modules/mcp/catalogs/observed.d.ts +0 -48
- package/dist/src/modules/mcp/catalogs/paramSpec.d.ts +0 -42
- package/dist/src/modules/mcp/catalogs/registry.d.ts +0 -35
- package/dist/src/modules/mcp/e2e/index.d.ts +0 -6
- package/dist/src/modules/mcp/e2e/mcpEndpoint.d.ts +0 -27
- package/dist/src/modules/mcp/e2e/postMessageChannel.d.ts +0 -22
- package/dist/src/modules/mcp/e2e/renderingHost.d.ts +0 -34
- package/dist/src/modules/mcp/handler.d.ts +0 -22
- package/dist/src/modules/mcp/helpers/agentPrompt.d.ts +0 -4
- package/dist/src/modules/mcp/helpers/computeVersion.d.ts +0 -1
- package/dist/src/modules/mcp/helpers/guide.d.ts +0 -4
- package/dist/src/modules/mcp/helpers/index.d.ts +0 -8
- package/dist/src/modules/mcp/helpers/interactions.d.ts +0 -30
- package/dist/src/modules/mcp/helpers/log.d.ts +0 -8
- package/dist/src/modules/mcp/helpers/opResult.d.ts +0 -13
- package/dist/src/modules/mcp/helpers/space.d.ts +0 -115
- package/dist/src/modules/mcp/helpers/uris.d.ts +0 -28
- package/dist/src/modules/mcp/index.d.ts +0 -13
- package/dist/src/modules/mcp/previewClient.d.ts +0 -13
- package/dist/src/modules/mcp/proxy/config.d.ts +0 -19
- package/dist/src/modules/mcp/proxy/fetch.d.ts +0 -18
- package/dist/src/modules/mcp/proxy/grant.d.ts +0 -25
- package/dist/src/modules/mcp/proxy/guard.d.ts +0 -6
- package/dist/src/modules/mcp/proxy/handler.d.ts +0 -8
- package/dist/src/modules/mcp/proxy/index.d.ts +0 -8
- package/dist/src/modules/mcp/proxy/payload.d.ts +0 -8
- package/dist/src/modules/mcp/proxy/rewrite.d.ts +0 -18
- package/dist/src/modules/mcp/proxy/sign.d.ts +0 -6
- package/dist/src/modules/mcp/proxy/types.d.ts +0 -45
- package/dist/src/modules/mcp/resources/canonical.d.ts +0 -6
- package/dist/src/modules/mcp/resources/core.d.ts +0 -5
- package/dist/src/modules/mcp/resources/envelope.d.ts +0 -10
- package/dist/src/modules/mcp/resources/index.d.ts +0 -8
- package/dist/src/modules/mcp/resources/primer.d.ts +0 -7
- package/dist/src/modules/mcp/resources/register.d.ts +0 -10
- package/dist/src/modules/mcp/resources/renderGuide.d.ts +0 -10
- package/dist/src/modules/mcp/resources/router.d.ts +0 -10
- package/dist/src/modules/mcp/resources/schema.d.ts +0 -5
- package/dist/src/modules/mcp/resources/style.d.ts +0 -5
- package/dist/src/modules/mcp/screenshotClient.d.ts +0 -13
- package/dist/src/modules/mcp/server.d.ts +0 -31
- package/dist/src/modules/mcp/tests/helpers.d.ts +0 -13
- package/dist/src/modules/mcp/tools/apply/dispatch.d.ts +0 -6
- package/dist/src/modules/mcp/tools/apply/index.d.ts +0 -470
- package/dist/src/modules/mcp/tools/apply/writeResult.d.ts +0 -8
- package/dist/src/modules/mcp/tools/index.d.ts +0 -18
- package/dist/src/modules/mcp/tools/operations/index.d.ts +0 -928
- package/dist/src/modules/mcp/tools/operations/schema/bindings/deleteBinding.d.ts +0 -17
- package/dist/src/modules/mcp/tools/operations/schema/bindings/patchBinding.d.ts +0 -25
- package/dist/src/modules/mcp/tools/operations/schema/bindings/upsertBinding.d.ts +0 -27
- package/dist/src/modules/mcp/tools/operations/schema/elements/deleteElement.d.ts +0 -10
- package/dist/src/modules/mcp/tools/operations/schema/elements/moveElement.d.ts +0 -16
- package/dist/src/modules/mcp/tools/operations/schema/elements/patchElement.d.ts +0 -22
- package/dist/src/modules/mcp/tools/operations/schema/elements/repeatElement.d.ts +0 -55
- package/dist/src/modules/mcp/tools/operations/schema/elements/upsertElement.d.ts +0 -16
- package/dist/src/modules/mcp/tools/operations/schema/folders/deleteFolder.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/schema/folders/upsertFolder.d.ts +0 -12
- package/dist/src/modules/mcp/tools/operations/schema/index.d.ts +0 -21
- package/dist/src/modules/mcp/tools/operations/schema/interactions/deleteInteraction.d.ts +0 -12
- package/dist/src/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.d.ts +0 -18
- package/dist/src/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.d.ts +0 -27
- package/dist/src/modules/mcp/tools/operations/schema/operations.d.ts +0 -229
- package/dist/src/modules/mcp/tools/operations/schema/pages/deletePage.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/schema/pages/upsertPage.d.ts +0 -14
- package/dist/src/modules/mcp/tools/operations/schema/settings/patchSettings.d.ts +0 -34
- package/dist/src/modules/mcp/tools/operations/schema/shared.d.ts +0 -92
- package/dist/src/modules/mcp/tools/operations/schema/translator.d.ts +0 -12
- package/dist/src/modules/mcp/tools/operations/schema/variables/deleteVariable.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/schema/variables/upsertVariable.d.ts +0 -16
- package/dist/src/modules/mcp/tools/operations/schema/write.d.ts +0 -42
- package/dist/src/modules/mcp/tools/operations/schemaIds.d.ts +0 -6
- package/dist/src/modules/mcp/tools/operations/style/definitions/deleteDefinition.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/style/definitions/patchDefinition.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/definitions/upsertDefinition.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/definitions/upsertDefinitions.d.ts +0 -41
- package/dist/src/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/style/idStyles/patchIdStyle.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/index.d.ts +0 -15
- package/dist/src/modules/mcp/tools/operations/style/operations.d.ts +0 -264
- package/dist/src/modules/mcp/tools/operations/style/shared.d.ts +0 -116
- package/dist/src/modules/mcp/tools/operations/style/translator.d.ts +0 -12
- package/dist/src/modules/mcp/tools/operations/style/variables/deleteStyleVariable.d.ts +0 -15
- package/dist/src/modules/mcp/tools/operations/style/variables/upsertStyleVariable.d.ts +0 -20
- package/dist/src/modules/mcp/tools/operations/style/write.d.ts +0 -12
- package/dist/src/modules/mcp/tools/preview.d.ts +0 -465
- package/dist/src/modules/mcp/tools/read.d.ts +0 -9
- package/dist/src/modules/mcp/tools/render.d.ts +0 -499
- package/dist/src/modules/mcp/tools/render.test.d.ts +0 -1
- package/dist/src/modules/mcp/tools/screenshot.d.ts +0 -470
- package/dist/src/modules/mcp/tools/search.d.ts +0 -15
- package/dist/src/modules/mcp/tools/shared/expandOperations.d.ts +0 -13
- package/dist/src/modules/mcp/tools/shared/tool.d.ts +0 -72
- package/dist/src/modules/mcp/tools/shared/validator/audit.d.ts +0 -4
- package/dist/src/modules/mcp/tools/shared/validator/batch.d.ts +0 -5
- package/dist/src/modules/mcp/tools/shared/validator/bindings.d.ts +0 -6
- package/dist/src/modules/mcp/tools/shared/validator/context.d.ts +0 -38
- package/dist/src/modules/mcp/tools/shared/validator/css.d.ts +0 -4
- package/dist/src/modules/mcp/tools/shared/validator/elements.d.ts +0 -7
- package/dist/src/modules/mcp/tools/shared/validator/index.d.ts +0 -8
- package/dist/src/modules/mcp/tools/shared/validator/interactions.d.ts +0 -3
- package/dist/src/modules/mcp/tools/shared/validator/refs.d.ts +0 -4
- package/dist/src/modules/mcp/tools/validate.d.ts +0 -467
- package/dist/src/modules/mcp/types/aiSchema.d.ts +0 -218
- package/dist/src/modules/mcp/types/appTypes.d.ts +0 -26
- package/dist/src/modules/mcp/types/index.d.ts +0 -5
- package/dist/src/modules/mcp/types/previewTypes.d.ts +0 -25
- package/dist/src/modules/mcp/types/screenshotTypes.d.ts +0 -29
- package/dist/src/modules/mcp/types/toolTypes.d.ts +0 -138
- package/dist/src/modules/oauth/authorize.d.ts +0 -7
- package/dist/src/modules/oauth/challenge.d.ts +0 -11
- package/dist/src/modules/oauth/consentPage.d.ts +0 -7
- package/dist/src/modules/oauth/metadata.d.ts +0 -40
- package/dist/src/modules/oauth/params.d.ts +0 -5
- package/dist/src/modules/oauth/pkce.d.ts +0 -6
- package/dist/src/modules/oauth/records.d.ts +0 -71
- package/dist/src/modules/oauth/register.d.ts +0 -5
- package/dist/src/modules/oauth/respond.d.ts +0 -13
- package/dist/src/modules/oauth/token.d.ts +0 -5
- package/dist/src/modules/ssr/buildBody.d.ts +0 -9
- package/dist/src/modules/ssr/handler.d.ts +0 -4
- package/dist/src/modules/ssr/preview.d.ts +0 -16
- package/dist/src/modules/ssr/streamBody.d.ts +0 -5
- package/dist/src/modules/ssr/template.d.ts +0 -6
- package/dist/src/standalone/alias-loader.d.mts +0 -2
- package/dist/src/standalone/plugins/ClientInfo.d.ts +0 -2
- package/dist/src/standalone/plugins/ServerInfo.d.ts +0 -2
- package/dist/src/standalone/plugins/SharedInfo.d.ts +0 -2
- package/dist/src/standalone/plugins/styles.d.ts +0 -5
- package/dist/src/standalone/register-alias.d.mts +0 -1
- package/dist/src/standalone/server.d.ts +0 -1
- package/dist/src/standalone/stubs/react-syntax-highlighter.d.mts +0 -31
- package/skills/plitzi-render/SKILL.md +0 -174
- /package/dist/{src/core/http/dispatcher.test.d.ts → core/auth/api.test.d.ts} +0 -0
- /package/dist/{src/core/server/mcpServer.test.d.ts → core/auth/authorize.test.d.ts} +0 -0
- /package/dist/{src/modules/ai/toolkit.test.d.ts → core/auth/createAuth.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/apps/apps.test.d.ts → core/auth/domains.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/apps/render/styles.test.d.ts → core/auth/identity.test.d.ts} +0 -0
- /package/dist/{src/modules → core/auth}/oauth/oauth.test.d.ts +0 -0
- /package/dist/{src/modules/mcp/catalogs/builtinTransformers.test.d.ts → core/auth/routes.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/catalogs/cssCatalog/cssCatalog.test.d.ts → core/auth/session.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/e2e/connector.test.d.ts → core/auth/spaceTokens.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/e2e/host.test.d.ts → core/auth/tokens.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/e2e/oauthConnector.test.d.ts → core/createServer.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/helpers/log.test.d.ts → core/handlers/handlers.test.d.ts} +0 -0
- /package/dist/{src/core → core}/health.d.ts +0 -0
- /package/dist/{src/modules/mcp/mcp.bench.d.ts → core/http/dispatcher.test.d.ts} +0 -0
- /package/dist/{src/core → core}/http/securityHeaders.d.ts +0 -0
- /package/dist/{src/core → core}/http/stages/authRoutes.d.ts +0 -0
- /package/dist/{src/core → core}/http/stages/pluginAssets.d.ts +0 -0
- /package/dist/{src/core → core}/mimeTypes.d.ts +0 -0
- /package/dist/{src/modules/mcp/constants.d.ts → core/previewToken.d.ts} +0 -0
- /package/dist/{src/core → core}/requestParser.d.ts +0 -0
- /package/dist/{src/core → core}/server/baseServer.d.ts +0 -0
- /package/dist/{src/modules/mcp/proxy/endpoint.test.d.ts → core/server/baseServer.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/proxy/proxy.test.d.ts → core/services/resolve.test.d.ts} +0 -0
- /package/dist/{src/core → core}/services/rsc.d.ts +0 -0
- /package/dist/{src/core → core}/services/ssr.d.ts +0 -0
- /package/dist/{src/core → core}/staticFiles.d.ts +0 -0
- /package/dist/{src/modules/mcp/proxy/wiring.test.d.ts → helpers/buildResponseHelpers.test.d.ts} +0 -0
- /package/dist/{src/helpers → helpers}/cache/TtlCache.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/cache/cacheManager.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/cache/defaults.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/cache/index.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/apply.test.d.ts → helpers/cache/keys.test.d.ts} +0 -0
- /package/dist/{src/helpers → helpers}/cache/serverCaches.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/bindings.test.d.ts → helpers/compress.test.d.ts} +0 -0
- /package/dist/{src/helpers → helpers}/escapeJson.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/metrics.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/normalizePlugins.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/css.test.d.ts → helpers/offlineDataLoader.test.d.ts} +0 -0
- /package/dist/{src/helpers → helpers}/readCookie.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/interactions.test.d.ts → helpers/resolveDebugMode.test.d.ts} +0 -0
- /package/dist/{src/helpers → helpers}/runMiddlewares.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/serverLog.d.ts +0 -0
- /package/dist/{src/middlewares → middlewares}/auth.d.ts +0 -0
- /package/dist/{src/middlewares → middlewares}/basicAuth.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/pages.test.d.ts → middlewares/spaceDeployment.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/reads.test.d.ts → modules/actions/handler.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/schemaIds.test.d.ts → modules/connectors/engine.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/search.test.d.ts → modules/connectors/projection.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/skill.test.d.ts → modules/connectors/resolver.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/styles.test.d.ts → modules/rsc/resolveRscData.test.d.ts} +0 -0
- /package/dist/{src/modules → modules}/ssr/applySSRResult.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/tools.test.d.ts → modules/ssr/loadPluginComponents.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/validation.test.d.ts → modules/ssr/metering.test.d.ts} +0 -0
- /package/dist/{src/modules → modules}/ssr/registerExternalPlugins.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/compile.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/copy.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/detect.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/manager.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/validate.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/validate.test.d.ts +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { randomId } from "./pkce.js";
|
|
2
|
-
import { getClientByFingerprint, putClient, putClientFingerprint } from "./records.js";
|
|
3
|
-
import { sendErrorJson, sendJson } from "./respond.js";
|
|
4
|
-
import { createHash } from "node:crypto";
|
|
5
|
-
//#region src/modules/oauth/register.ts
|
|
6
|
-
var isUsableRedirectUri = (value) => {
|
|
7
|
-
let url;
|
|
8
|
-
try {
|
|
9
|
-
url = new URL(value);
|
|
10
|
-
} catch {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
if (url.protocol === "https:") return true;
|
|
14
|
-
return url.protocol === "http:" && (url.hostname === "localhost" || url.hostname === "127.0.0.1");
|
|
15
|
-
};
|
|
16
|
-
var stringList = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
|
|
17
|
-
var nowSeconds = () => Math.floor(Date.now() / 1e3);
|
|
18
|
-
var fingerprintOf = (clientName, redirectUris) => createHash("sha256").update(JSON.stringify([clientName, [...redirectUris].sort()])).digest("base64url");
|
|
19
|
-
/** RFC 7591 dynamic client registration. A remote host has no way to be configured into this server ahead of
|
|
20
|
-
* time, so it registers itself on first connect; the record it gets back is only ever used to pin the redirect
|
|
21
|
-
* target, since a public client authenticates with PKCE rather than with credentials. */
|
|
22
|
-
var handleRegister = async (config, res, body) => {
|
|
23
|
-
if (typeof body !== "object" || body === null) {
|
|
24
|
-
sendErrorJson(res, 400, "invalid_request", "Expected a JSON client metadata object.");
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const metadata = body;
|
|
28
|
-
const redirectUris = stringList(metadata["redirect_uris"]).filter(isUsableRedirectUri);
|
|
29
|
-
if (redirectUris.length === 0) {
|
|
30
|
-
sendErrorJson(res, 400, "invalid_request", "redirect_uris must list at least one https (or loopback) URI.");
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const clientName = typeof metadata["client_name"] === "string" ? metadata["client_name"] : "MCP client";
|
|
34
|
-
const { store } = config.adapters;
|
|
35
|
-
const fingerprint = fingerprintOf(clientName, redirectUris);
|
|
36
|
-
const client = await getClientByFingerprint(store, fingerprint) ?? {
|
|
37
|
-
clientId: randomId(),
|
|
38
|
-
clientName,
|
|
39
|
-
redirectUris,
|
|
40
|
-
issuedAt: nowSeconds()
|
|
41
|
-
};
|
|
42
|
-
await putClient(store, client);
|
|
43
|
-
await putClientFingerprint(store, fingerprint, client.clientId);
|
|
44
|
-
sendJson(res, 201, {
|
|
45
|
-
client_id: client.clientId,
|
|
46
|
-
client_id_issued_at: client.issuedAt,
|
|
47
|
-
client_name: clientName,
|
|
48
|
-
redirect_uris: redirectUris,
|
|
49
|
-
grant_types: config.refreshTtlSeconds === 0 ? ["authorization_code"] : ["authorization_code", "refresh_token"],
|
|
50
|
-
response_types: ["code"],
|
|
51
|
-
token_endpoint_auth_method: "none"
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
//#endregion
|
|
55
|
-
export { handleRegister };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { renderErrorPage } from "./consentPage.js";
|
|
2
|
-
//#region src/modules/oauth/respond.ts
|
|
3
|
-
var sendJson = (res, status, body) => {
|
|
4
|
-
res.setStatus(status);
|
|
5
|
-
res.setHeader("Content-Type", "application/json");
|
|
6
|
-
res.setHeader("Cache-Control", "no-store, no-transform");
|
|
7
|
-
res.send(JSON.stringify(body));
|
|
8
|
-
};
|
|
9
|
-
var sendHtml = (res, status, html) => {
|
|
10
|
-
res.setStatus(status);
|
|
11
|
-
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
12
|
-
res.setHeader("Cache-Control", "no-store, no-transform");
|
|
13
|
-
res.send(html);
|
|
14
|
-
};
|
|
15
|
-
var sendErrorJson = (res, status, error, description) => sendJson(res, status, {
|
|
16
|
-
error,
|
|
17
|
-
error_description: description
|
|
18
|
-
});
|
|
19
|
-
/** Shown when the authorization request itself is unusable — an unknown client, a `redirect_uri` that is not
|
|
20
|
-
* registered. Redirecting those back would turn the endpoint into an open redirector. */
|
|
21
|
-
var sendErrorPage = (res, title, detail) => sendHtml(res, 400, renderErrorPage(title, detail));
|
|
22
|
-
/** The other half of RFC 6749 error handling: once the redirect target is known to be legitimate, failures go
|
|
23
|
-
* back to the client so the host can report them, carrying `state` so it can match the response to its request. */
|
|
24
|
-
var redirectWithError = (res, redirectUri, error, description, state) => {
|
|
25
|
-
const url = new URL(redirectUri);
|
|
26
|
-
url.searchParams.set("error", error);
|
|
27
|
-
url.searchParams.set("error_description", description);
|
|
28
|
-
if (state !== void 0) url.searchParams.set("state", state);
|
|
29
|
-
res.setStatus(302);
|
|
30
|
-
res.setHeader("Location", url.toString());
|
|
31
|
-
res.setHeader("Cache-Control", "no-store, no-transform");
|
|
32
|
-
res.end();
|
|
33
|
-
};
|
|
34
|
-
var redirectWithCode = (res, redirectUri, code, state) => {
|
|
35
|
-
const url = new URL(redirectUri);
|
|
36
|
-
url.searchParams.set("code", code);
|
|
37
|
-
if (state !== void 0) url.searchParams.set("state", state);
|
|
38
|
-
res.setStatus(302);
|
|
39
|
-
res.setHeader("Location", url.toString());
|
|
40
|
-
res.setHeader("Cache-Control", "no-store, no-transform");
|
|
41
|
-
res.end();
|
|
42
|
-
};
|
|
43
|
-
//#endregion
|
|
44
|
-
export { redirectWithCode, redirectWithError, sendErrorJson, sendErrorPage, sendHtml, sendJson };
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { scopesOf } from "./metadata.js";
|
|
2
|
-
import { field, optionalField } from "./params.js";
|
|
3
|
-
import { randomId, verifyChallenge } from "./pkce.js";
|
|
4
|
-
import { dropCode, dropRefresh, getCode, getRefresh, putAccess, putRefresh } from "./records.js";
|
|
5
|
-
import { sendErrorJson, sendJson } from "./respond.js";
|
|
6
|
-
//#region src/modules/oauth/token.ts
|
|
7
|
-
var DEFAULT_REFRESH_TTL_SECONDS = 2592e3;
|
|
8
|
-
var DEFAULT_ACCESS_TTL_SECONDS = 2592e3;
|
|
9
|
-
var refreshTtlOf = (config) => config.refreshTtlSeconds ?? DEFAULT_REFRESH_TTL_SECONDS;
|
|
10
|
-
var scopeOf = (config, requested) => requested ?? scopesOf(config).join(" ");
|
|
11
|
-
/** The token response, plus a rotated refresh grant when refresh is enabled. Rotation is unconditional: a refresh
|
|
12
|
-
* token is a long-lived credential, so the one just used never stays valid. */
|
|
13
|
-
var sendTokens = async (config, res, credential, expiresInSeconds, grant) => {
|
|
14
|
-
const ttl = refreshTtlOf(config);
|
|
15
|
-
const bearer = randomId();
|
|
16
|
-
await putAccess(config.adapters.store, bearer, {
|
|
17
|
-
credential,
|
|
18
|
-
clientId: grant.clientId,
|
|
19
|
-
user: grant.user,
|
|
20
|
-
target: grant.target
|
|
21
|
-
}, Math.max(expiresInSeconds ?? DEFAULT_ACCESS_TTL_SECONDS, 1));
|
|
22
|
-
const body = {
|
|
23
|
-
access_token: bearer,
|
|
24
|
-
token_type: "Bearer",
|
|
25
|
-
scope: scopeOf(config, grant.scope)
|
|
26
|
-
};
|
|
27
|
-
if (expiresInSeconds !== void 0) body["expires_in"] = expiresInSeconds;
|
|
28
|
-
if (ttl > 0) {
|
|
29
|
-
const refreshToken = randomId();
|
|
30
|
-
await putRefresh(config.adapters.store, refreshToken, grant, ttl);
|
|
31
|
-
body["refresh_token"] = refreshToken;
|
|
32
|
-
}
|
|
33
|
-
sendJson(res, 200, body);
|
|
34
|
-
};
|
|
35
|
-
var exchangeCode = async (config, res, params) => {
|
|
36
|
-
const code = field(params, "code");
|
|
37
|
-
const record = code ? await getCode(config.adapters.store, code) : void 0;
|
|
38
|
-
if (!record) {
|
|
39
|
-
sendErrorJson(res, 400, "invalid_grant", "The authorization code is unknown or has expired.");
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
await dropCode(config.adapters.store, code);
|
|
43
|
-
if (record.clientId !== field(params, "client_id")) {
|
|
44
|
-
sendErrorJson(res, 400, "invalid_grant", "The authorization code was issued to another client.");
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const redirectUri = optionalField(params, "redirect_uri");
|
|
48
|
-
if (redirectUri !== void 0 && redirectUri !== record.redirectUri) {
|
|
49
|
-
sendErrorJson(res, 400, "invalid_grant", "redirect_uri does not match the authorization request.");
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (!verifyChallenge(field(params, "code_verifier"), record.challenge)) {
|
|
53
|
-
sendErrorJson(res, 400, "invalid_grant", "The PKCE code verifier does not match the challenge.");
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
await sendTokens(config, res, record.token, record.expiresInSeconds, {
|
|
57
|
-
clientId: record.clientId,
|
|
58
|
-
scope: record.scope,
|
|
59
|
-
user: record.user,
|
|
60
|
-
target: record.target
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
var exchangeRefresh = async (config, res, params) => {
|
|
64
|
-
if (refreshTtlOf(config) === 0) {
|
|
65
|
-
sendErrorJson(res, 400, "unsupported_grant_type", "This server issues no refresh tokens.");
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const refreshToken = field(params, "refresh_token");
|
|
69
|
-
const record = refreshToken ? await getRefresh(config.adapters.store, refreshToken) : void 0;
|
|
70
|
-
if (!record) {
|
|
71
|
-
sendErrorJson(res, 400, "invalid_grant", "The refresh token is unknown or has expired.");
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
await dropRefresh(config.adapters.store, refreshToken);
|
|
75
|
-
if (record.clientId !== field(params, "client_id")) {
|
|
76
|
-
sendErrorJson(res, 400, "invalid_grant", "The refresh token was issued to another client.");
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const issued = await config.adapters.issueToken(record.user, record.target);
|
|
80
|
-
if (!issued) {
|
|
81
|
-
sendErrorJson(res, 400, "invalid_grant", "The account no longer has access to this resource.");
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
await sendTokens(config, res, issued.token, issued.expiresInSeconds, record);
|
|
85
|
-
};
|
|
86
|
-
/** POST /token. Public clients only, so there is no client authentication to check — PKCE is what proves the
|
|
87
|
-
* caller is the one that started the flow. */
|
|
88
|
-
var handleToken = async (config, res, params) => {
|
|
89
|
-
switch (field(params, "grant_type")) {
|
|
90
|
-
case "authorization_code":
|
|
91
|
-
await exchangeCode(config, res, params);
|
|
92
|
-
return;
|
|
93
|
-
case "refresh_token":
|
|
94
|
-
await exchangeRefresh(config, res, params);
|
|
95
|
-
return;
|
|
96
|
-
default: sendErrorJson(res, 400, "unsupported_grant_type", "Supported grants: authorization_code, refresh_token.");
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
//#endregion
|
|
100
|
-
export { handleToken };
|
package/dist/public/.gitkeep
DELETED
|
File without changes
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SSRAdapters, SSRRequest, SSRSpaceDeployment, SSRUser } from '@plitzi/sdk-shared';
|
|
2
|
-
export type JsonAdaptersConfig = {
|
|
3
|
-
offlineData: string | ((spaceId: number, environment: string, revision?: number) => string);
|
|
4
|
-
deployment?: string | SSRSpaceDeployment | Record<string, SSRSpaceDeployment>;
|
|
5
|
-
user?: SSRUser | ((req: SSRRequest) => SSRUser | undefined | Promise<SSRUser | undefined>);
|
|
6
|
-
};
|
|
7
|
-
export declare const createJsonAdapters: (config: JsonAdaptersConfig) => SSRAdapters;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SSRServer, SSRServerConfig } from '@plitzi/sdk-shared';
|
|
2
|
-
export { createSSRServer } from './server/pageServer';
|
|
3
|
-
export { createMCPServer } from './server/mcpServer';
|
|
4
|
-
export { resolveServices } from './services/resolve';
|
|
5
|
-
export type { ResolvedServices } from './services/resolve';
|
|
6
|
-
/** The general server: mounts whatever the config asks for — SSR, RSC and MCP together, if that is what it
|
|
7
|
-
* enables — and is what a deployment reaches for when it serves more than one surface from a single port (the
|
|
8
|
-
* package's own standalone harness does exactly that).
|
|
9
|
-
*
|
|
10
|
-
* Prefer the surface-specific factories whenever the surface IS known, so the process states what it serves by
|
|
11
|
-
* the name it calls: createSSRServer for pages + RSC, createMCPServer for a dedicated MCP server. An MCP-only
|
|
12
|
-
* config is handed to the latter here, since the lean pipeline builds none of the render template, caches or
|
|
13
|
-
* plugin manager a page server would carry unused. */
|
|
14
|
-
export declare const createServer: (config: SSRServerConfig) => SSRServer;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { RawResponse } from '../../helpers/buildResponseHelpers';
|
|
2
|
-
import { ServerCaches } from '../../helpers/cache';
|
|
3
|
-
import { PluginManager } from '../../plugins/manager';
|
|
4
|
-
import { SSRRequest, SSRResponseHelpers, SSRServerConfig, SSRTemplateFn } from '@plitzi/sdk-shared';
|
|
5
|
-
import { IncomingMessage } from 'node:http';
|
|
6
|
-
export interface BaseContext {
|
|
7
|
-
raw: IncomingMessage;
|
|
8
|
-
rawRes: RawResponse;
|
|
9
|
-
req: SSRRequest;
|
|
10
|
-
res: SSRResponseHelpers;
|
|
11
|
-
config: SSRServerConfig;
|
|
12
|
-
port: number;
|
|
13
|
-
/** Set by the stage that answers when the path alone does not identify the work (the MCP endpoint serves every
|
|
14
|
-
* JSON-RPC method on the same URL). The dispatcher folds it into the access log. */
|
|
15
|
-
operation?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface SSRContext extends BaseContext {
|
|
18
|
-
renderFn: SSRTemplateFn;
|
|
19
|
-
caches: ServerCaches;
|
|
20
|
-
pluginManager: PluginManager;
|
|
21
|
-
}
|
|
22
|
-
export type Stage<C extends BaseContext = BaseContext> = (ctx: C) => boolean | Promise<boolean>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ResolvedServices } from '../services/resolve';
|
|
2
|
-
import { SSRServer, SSRServerConfig } from '@plitzi/sdk-shared';
|
|
3
|
-
/** The page-serving machinery: html/rsc caches, the render template and the plugin manager, driving the page
|
|
4
|
-
* pipeline. Which services it mounts is the CALLER's decision — {@link createServer} passes whatever the config
|
|
5
|
-
* enables, createSSRServer pins the page surface — so this unit never second-guesses a factory's promise. */
|
|
6
|
-
export declare const createPageServer: (config: SSRServerConfig, services: ResolvedServices) => SSRServer;
|
|
7
|
-
/** The page server: SSR and RSC, and nothing else. MCP is pinned OFF here even when the config asks for it —
|
|
8
|
-
* what a factory named after a surface mounts must be readable from its name alone. A deployment that wants
|
|
9
|
-
* both surfaces in one process asks {@link createServer} for them; a dedicated MCP server is createMCPServer. */
|
|
10
|
-
export declare const createSSRServer: (config: SSRServerConfig) => SSRServer;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Stage } from '../http/types';
|
|
2
|
-
/** OAuth 2.1 authorization for the MCP server, mounted ONLY when a deployment configures `oauth`. Without it the
|
|
3
|
-
* stage falls straight through and the server keeps its anonymous contract: discovery 404s, the public surface
|
|
4
|
-
* (handshake, listings, the guide, plitzi_render) answers without a token, and nothing below changes.
|
|
5
|
-
*
|
|
6
|
-
* It sits before the MCP stage because that one answers every path on a dedicated MCP server — these endpoints
|
|
7
|
-
* would otherwise be swallowed by the JSON-RPC transport, which is exactly the 406 a host hits on /register. */
|
|
8
|
-
export declare const oauthStage: Stage;
|
|
9
|
-
/** The protected-resource half of OAuth: an MCP call that presents no bearer this server can verify is refused
|
|
10
|
-
* with RFC 6750's challenge instead of being served the anonymous surface. That 401 is the whole handshake — it
|
|
11
|
-
* is how a host learns the server needs authorization, where its metadata lives and which scopes to ask for, and
|
|
12
|
-
* a 200 tells it none of that. Only the JSON-RPC POST is guarded: the CORS preflight, the GET 405 and the
|
|
13
|
-
* discovery probes carry no credential and must keep answering as they do.
|
|
14
|
-
*
|
|
15
|
-
* Mounted only when `oauth` is configured. A deployment that configures none keeps the open server it had, where
|
|
16
|
-
* the whole public surface — handshake, listings, the guide, plitzi_render — answers without a token; with OAuth
|
|
17
|
-
* on, the grant that carries no space is what covers that same ground. */
|
|
18
|
-
export declare const oauthGuardStage: Stage;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ResolvedServices } from './resolve';
|
|
2
|
-
import { BaseContext, SSRContext, Stage } from '../http/types';
|
|
3
|
-
export declare const buildPagePipeline: (services: ResolvedServices) => Stage<SSRContext>[];
|
|
4
|
-
export declare const buildMCPPipeline: () => Stage<BaseContext>[];
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { createServer, createSSRServer, createMCPServer, resolveServices } from './core/createServer';
|
|
2
|
-
export { registerHealthCheck, buildHealthPayload } from './core/health';
|
|
3
|
-
export { consoleLogger, renderLogEvent } from './helpers/serverLog';
|
|
4
|
-
export type { HealthCheckApp, HealthIdentity } from './core/health';
|
|
5
|
-
export { createJsonAdapters } from './adapters/jsonAdapters';
|
|
6
|
-
export { AIEngine, toolResponseOk, toolResponseErr, zodToJsonSchema, getAllowedModes, bindTools, isToolActive, resolveToolHandler, isCallToolResult, toolResponseFromResult } from './modules/ai';
|
|
7
|
-
export { createMcpServer, handleMcp, serveMcp, readMcpBody, buildAgentGuide, createHttpPreviewClient, createHttpScreenshotClient } from './modules/mcp';
|
|
8
|
-
export { createPreview, createMemoryDraftStore, PREVIEW_TOKEN_PARAM } from './modules/ssr/preview';
|
|
9
|
-
export { apply, search, read, validate, applyShape, searchShape, readShape, validateShape, operation, tools } from './modules/mcp/tools';
|
|
10
|
-
export type { JsonAdaptersConfig } from './adapters/jsonAdapters';
|
|
11
|
-
export type { ResolvedServices } from './core/createServer';
|
|
12
|
-
export type { McpServerContext, McpRequestOptions, PreviewClient, PreviewRequestBody, PreviewResult, HttpPreviewClientConfig, ScreenshotClient, ScreenshotImage, ScreenshotResult, Viewport, HttpScreenshotClientConfig } from './modules/mcp';
|
|
13
|
-
export type { ApplyInput, SearchInput, SearchResponse, SearchHit, ReadInput, ReadResponse, ReadHit, ValidateInput, WriteResponse, WriteElement, Persisters, Operation, ToolDef, ToolContext } from './modules/mcp/tools';
|
|
14
|
-
export type { Space } from './modules/mcp/helpers';
|
|
15
|
-
export type { Env } from './modules/mcp/types';
|
package/dist/src/mcp.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** The MCP role's entry point: everything an MCP deployment wires, and nothing else.
|
|
2
|
-
*
|
|
3
|
-
* Import it as `@plitzi/sdk-server/mcp`. The package root is a barrel over every service (SSR, RSC, plugins, the
|
|
4
|
-
* AI engine…), so pulling `createMCPServer` from there makes the process load that whole graph — including the
|
|
5
|
-
* React element packages its types come from — where this entry loads only the MCP server. */
|
|
6
|
-
export { createMCPServer } from './core/server/mcpServer';
|
|
7
|
-
export { consoleLogger, renderLogEvent } from './helpers/serverLog';
|
|
8
|
-
export { createMcpServer, handleMcp, serveMcp, readMcpBody } from './modules/mcp/handler';
|
|
9
|
-
export { createHttpPreviewClient } from './modules/mcp/previewClient';
|
|
10
|
-
export { createHttpScreenshotClient } from './modules/mcp/screenshotClient';
|
|
11
|
-
export type { McpRequestOptions } from './modules/mcp/handler';
|
|
12
|
-
export type { McpServerContext } from './modules/mcp/server';
|
|
13
|
-
export type { PreviewClient, ScreenshotClient } from './modules/mcp/types';
|
|
14
|
-
export type { HealthIdentity } from './core/health';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { AiMode, AiContext, McpPromptHandler, McpToolHandler, McpToolLifecycleHooks, StreamCallbacks, McpTool, McpToolHandlerResult } from '@plitzi/sdk-shared';
|
|
2
|
-
declare class AIEngine implements McpToolLifecycleHooks {
|
|
3
|
-
private readonly mode;
|
|
4
|
-
readonly callbacks: StreamCallbacks;
|
|
5
|
-
private toolsAvailables;
|
|
6
|
-
private toolsAvailablesMap;
|
|
7
|
-
ctx: AiContext;
|
|
8
|
-
constructor(mode: AiMode | undefined, callbacks: StreamCallbacks, ctx: Omit<AiContext, 'mode'>);
|
|
9
|
-
readonly readResource: (name: string, uri: string) => void;
|
|
10
|
-
readonly setToolsAvailables: (tools: McpTool[]) => void;
|
|
11
|
-
readonly can: (name: string) => boolean;
|
|
12
|
-
readonly before: (name: string, args: Record<string, unknown>) => Promise<boolean>;
|
|
13
|
-
readonly after: (name: string, args: Record<string, unknown>, result: McpToolHandlerResult) => Promise<void>;
|
|
14
|
-
private readonly validateToolInput;
|
|
15
|
-
private readonly validateToolOutput;
|
|
16
|
-
private readonly runPipeline;
|
|
17
|
-
readonly execute: (name: string, handlerFn?: McpToolHandler) => (args: Record<string, unknown>) => Promise<McpToolHandlerResult>;
|
|
18
|
-
readonly executePrompt: (_name: string, handlerFn: McpPromptHandler) => (args: Record<string, unknown>) => Promise<import('@plitzi/sdk-shared').McpPromptHandlerResult>;
|
|
19
|
-
}
|
|
20
|
-
export default AIEngine;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { default as AIEngine } from './AIEngine';
|
|
2
|
-
export * from './AIEngine';
|
|
3
|
-
export { zodToJsonSchema, getAllowedModes, toolResponseOk, toolResponseErr, bindTools, isToolActive, resolveToolHandler, isCallToolResult, toolResponseFromResult } from './toolkit';
|
|
4
|
-
export { AIEngine };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { AiMode, McpContent, McpTool, McpToolHandler, McpToolHandlerResult, ToolOperationType } from '@plitzi/sdk-shared';
|
|
3
|
-
/** Convert a Zod schema to the JSON Schema an AI provider (Anthropic / OpenAI) expects in a tool definition.
|
|
4
|
-
* Delegates to Zod v4's built-in converter — one implementation, so descriptions, literal discriminators,
|
|
5
|
-
* enums, nested objects and recursive (z.lazy) shapes all survive and the provider sees the same contract an
|
|
6
|
-
* MCP client does. `io: 'input'` describes what the agent must SEND; `unrepresentable: 'any'` degrades an
|
|
7
|
-
* exotic type to an empty schema instead of throwing, so one unusual tool never breaks the whole tool list. */
|
|
8
|
-
export declare const zodToJsonSchema: (schema: unknown) => Record<string, unknown>;
|
|
9
|
-
export declare const firstText: (content: McpContent[]) => string | undefined;
|
|
10
|
-
export declare const getAllowedModes: (operationType: ToolOperationType) => AiMode[];
|
|
11
|
-
export declare const toolResponseOk: (data: unknown, agentMessage?: string) => McpToolHandlerResult;
|
|
12
|
-
export declare const toolResponseErr: (error: Error | string) => McpToolHandlerResult;
|
|
13
|
-
export declare const isCallToolResult: (result: unknown) => result is CallToolResult;
|
|
14
|
-
export declare const toolResponseFromResult: (result: CallToolResult) => McpToolHandlerResult;
|
|
15
|
-
export declare const isToolActive: (tool: McpTool) => boolean;
|
|
16
|
-
export declare const resolveToolHandler: (tool: McpTool) => McpToolHandler | undefined;
|
|
17
|
-
export declare const bindTools: (tools: McpTool[]) => McpTool[];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { McpApp } from '../../types';
|
|
2
|
-
/** The reference app: the smallest definition that works, kept as the template a new app is copied from.
|
|
3
|
-
*
|
|
4
|
-
* It is deliberately NOT in the `apps` list — nothing renders it, since no tool points at it — so it costs a
|
|
5
|
-
* real deployment nothing while the test suite still builds it, which is what keeps it from rotting. To turn it
|
|
6
|
-
* into a real app: add it to `apps` in ../index.ts and give a tool `ui: { resourceUri: EXAMPLE_APP_URI }`. */
|
|
7
|
-
export declare const EXAMPLE_APP_URI = "ui://plitzi/example.html";
|
|
8
|
-
export declare const exampleApp: McpApp;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { McpApp, McpViewSettings } from '../types';
|
|
2
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
-
/** What a view gets when the deployment says nothing: streaming on, because a host that streams no arguments
|
|
4
|
-
* paints exactly what it painted before. */
|
|
5
|
-
export declare const DEFAULT_VIEW_SETTINGS: McpViewSettings;
|
|
6
|
-
/** Every MCP App this server serves. A new one is a folder beside `render/` (its definition + its view) and one
|
|
7
|
-
* line here — the tool that opens it points at its `uri` through `ui: { resourceUri }`. Start from `example/`,
|
|
8
|
-
* which is that same shape stripped to the minimum. */
|
|
9
|
-
export declare const apps: McpApp[];
|
|
10
|
-
export declare const registerApps: (server: McpServer, settings?: McpViewSettings) => void;
|
|
11
|
-
export { iconFontCss, RENDER_APP_URI } from './render';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Lifts every @font-face block out of a stylesheet. Brace counting rather than a CSS parser: a @font-face body is
|
|
2
|
-
* plain declarations, and base64 payloads and url() values carry no braces of their own. */
|
|
3
|
-
export declare const splitFontFaces: (css: string) => {
|
|
4
|
-
base: string;
|
|
5
|
-
fonts: string;
|
|
6
|
-
};
|
|
7
|
-
/** What the page shell inlines: the SDK stylesheet without the icon fonts. */
|
|
8
|
-
export declare const widgetCss: () => string;
|
|
9
|
-
/** The icon fonts, for the renders that draw one. */
|
|
10
|
-
export declare const iconFontCss: () => string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** The one folder of an app that ships to dist as SOURCE: its browser entry (`view/index.tsx`) and every module
|
|
2
|
-
* that entry bundles. The server builds it with esbuild at request time, so none of it is in the module graph the
|
|
3
|
-
* library build compiles — a view-side module that does not travel verbatim is simply missing at runtime, which
|
|
4
|
-
* the package only finds out when a host asks for the page. Everything else in an app (its definition) compiles
|
|
5
|
-
* like any other module. */
|
|
6
|
-
export declare const VIEW_DIR = "view";
|
|
7
|
-
/** Does this file ship as source? The build's copy step asks it, and `apps.test.ts` asks it of every real input of
|
|
8
|
-
* every app's bundle — so a view that grows a sibling module either lives in `view/` or fails the suite, instead
|
|
9
|
-
* of failing a deployment. Tests stay behind; the page shell travels with the views it renders. */
|
|
10
|
-
export declare const shipsAsSource: (file: string) => boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const bundle: (entry: string) => Promise<string>;
|
|
2
|
-
/** Every file the view pulls in, resolved by the build that serves it. The suite asks for this to check each one
|
|
3
|
-
* ships as source: a view-side module the package leaves behind resolves here, in the repo, and nowhere else. */
|
|
4
|
-
export declare const bundleInputs: (entry: string) => Promise<string[]>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { McpApp, McpViewSettings } from '../../types';
|
|
2
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
-
/** Serves the app as a self-contained page: no import map, no asset mounts, no cross-origin fetches, so the
|
|
4
|
-
* strictest host sandbox runs it and no deployment has to serve anything extra. */
|
|
5
|
-
export declare const registerApp: (server: McpServer, app: McpApp, settings: McpViewSettings) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const require: NodeJS.Require;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'esbuild';
|
|
2
|
-
/** Drops zod's ~40 translations (194 KB): they are re-exported as a namespace, which no bundler can tree-shake.
|
|
3
|
-
* English survives because zod imports `locales/en.js` directly, not through this index. */
|
|
4
|
-
export declare const zodEnglishOnly: Plugin;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ParamSpec } from './paramSpec';
|
|
2
|
-
export interface BuiltinGlobalCallback {
|
|
3
|
-
source: string;
|
|
4
|
-
title: string;
|
|
5
|
-
strictParams: boolean;
|
|
6
|
-
params: ParamSpec;
|
|
7
|
-
}
|
|
8
|
-
export declare const BUILTIN_GLOBAL_CALLBACKS: Record<string, BuiltinGlobalCallback>;
|
|
9
|
-
/** The built-in globalCallback for an action, or undefined when the action is not a known built-in (a plugin
|
|
10
|
-
* callback whose source/schema is not knowable here). */
|
|
11
|
-
export declare const getGlobalCallback: (action: string) => BuiltinGlobalCallback | undefined;
|
|
12
|
-
/** Report the param keys the agent supplied that are not valid for a built-in callback: only for CLOSED
|
|
13
|
-
* (`strictParams`) callbacks; open ones (collection) accept arbitrary field keys so nothing is unknown. Returns []
|
|
14
|
-
* for an unknown action (a plugin callback whose schema is not known here). */
|
|
15
|
-
export declare const unknownBuiltinParams: (action: string, params: Record<string, unknown>) => string[];
|
|
16
|
-
/** Resolve a `globalCallback` action against the built-in catalog: returns the module id it is registered under
|
|
17
|
-
* (`source`) and the params reconciled to the callback's schema — unknown keys dropped for a closed callback, then
|
|
18
|
-
* missing defaults filled. An action the catalog does not know (e.g. a plugin callback) yields no source and
|
|
19
|
-
* unchanged params, so the caller keeps its own behavior for it. */
|
|
20
|
-
export declare const applyBuiltinCallback: (action: string, params: Record<string, unknown>) => {
|
|
21
|
-
source?: string;
|
|
22
|
-
params: Record<string, unknown>;
|
|
23
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ParamSpec } from './paramSpec';
|
|
2
|
-
export interface BuiltinElementCallback {
|
|
3
|
-
title: string;
|
|
4
|
-
strictParams: boolean;
|
|
5
|
-
params: ParamSpec;
|
|
6
|
-
}
|
|
7
|
-
export declare const BUILTIN_ELEMENT_CALLBACKS: Record<string, BuiltinElementCallback>;
|
|
8
|
-
/** The built-in element callback for an action, or undefined when the action is not a known built-in (an
|
|
9
|
-
* element-type-specific/plugin callback whose schema is not knowable here). */
|
|
10
|
-
export declare const getElementCallback: (action: string) => BuiltinElementCallback | undefined;
|
|
11
|
-
/** Param keys the agent supplied that are not valid for a built-in element callback (only for CLOSED sets). []
|
|
12
|
-
* for an unknown action (a plugin/element-specific callback whose schema is not known here). */
|
|
13
|
-
export declare const unknownElementCallbackParams: (action: string, params: Record<string, unknown>) => string[];
|
|
14
|
-
/** Reconcile a `callback` action against the element-callback catalog: unknown keys dropped for a closed callback,
|
|
15
|
-
* then missing defaults filled (category:"attribute", revertOnFinish:false). An unknown action yields unchanged
|
|
16
|
-
* params, so a plugin/element-specific callback keeps whatever the agent passed. */
|
|
17
|
-
export declare const applyElementCallback: (action: string, params: Record<string, unknown>) => {
|
|
18
|
-
known: boolean;
|
|
19
|
-
params: Record<string, unknown>;
|
|
20
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ParamSpec } from './paramSpec';
|
|
2
|
-
export interface BuiltinTransformer {
|
|
3
|
-
title: string;
|
|
4
|
-
description: string;
|
|
5
|
-
strictParams: boolean;
|
|
6
|
-
params: ParamSpec;
|
|
7
|
-
}
|
|
8
|
-
export declare const BUILTIN_TRANSFORMERS: Record<string, BuiltinTransformer>;
|
|
9
|
-
/** The built-in transformer for an action, or undefined when the action is not a known built-in transformer. */
|
|
10
|
-
export declare const getTransformer: (action: string) => BuiltinTransformer | undefined;
|
|
11
|
-
/** The closest known transformer action to a mistyped one (substring match either way), so a wrong action like
|
|
12
|
-
* "template" teaches "twigTemplate". Undefined when nothing is close. */
|
|
13
|
-
export declare const suggestTransformer: (action: string) => string | undefined;
|
|
14
|
-
export interface TransformerInfo {
|
|
15
|
-
action: string;
|
|
16
|
-
title: string;
|
|
17
|
-
description: string;
|
|
18
|
-
params: {
|
|
19
|
-
name: string;
|
|
20
|
-
type: string;
|
|
21
|
-
description: string;
|
|
22
|
-
default?: string | number | boolean;
|
|
23
|
-
options?: string[];
|
|
24
|
-
}[];
|
|
25
|
-
}
|
|
26
|
-
/** The transformer catalog projected for the data-sources resource / primer, so the agent knows the exact action
|
|
27
|
-
* names and params up front (the real fix for the "agent can't write transformers" problem). */
|
|
28
|
-
export declare const transformerCatalog: () => TransformerInfo[];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ParamSpec } from './paramSpec';
|
|
2
|
-
export interface BuiltinUtility {
|
|
3
|
-
title: string;
|
|
4
|
-
strictParams: boolean;
|
|
5
|
-
params: ParamSpec;
|
|
6
|
-
}
|
|
7
|
-
export declare const BUILTIN_UTILITIES: Record<string, BuiltinUtility>;
|
|
8
|
-
/** The built-in utility for an action, or undefined when the action is not a known built-in utility. */
|
|
9
|
-
export declare const getUtility: (action: string) => BuiltinUtility | undefined;
|
|
10
|
-
/** Param keys the agent supplied that are not valid for a built-in utility (only for CLOSED sets). [] for an unknown
|
|
11
|
-
* action (a utility whose schema is not known here). */
|
|
12
|
-
export declare const unknownUtilityParams: (action: string, params: Record<string, unknown>) => string[];
|
|
13
|
-
/** Reconcile a `utility` action against the utility catalog: unknown keys dropped for a closed utility, then missing
|
|
14
|
-
* defaults filled. An unknown action yields unchanged params. */
|
|
15
|
-
export declare const applyUtility: (action: string, params: Record<string, unknown>) => {
|
|
16
|
-
known: boolean;
|
|
17
|
-
params: Record<string, unknown>;
|
|
18
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { CssProps } from '../../types';
|
|
2
|
-
export declare const classifyBorderTokens: (value: string) => Record<"width" | "style" | "color", string>;
|
|
3
|
-
export declare const expandBorder: (key: string, value: string, out: CssProps) => void;
|
|
4
|
-
export declare const expandBorderGroup: (suffix: string, value: string, out: CssProps) => void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { CssProps } from '../../types';
|
|
2
|
-
export declare const expandBox: (key: string, value: string, out: CssProps) => void;
|
|
3
|
-
export declare const expandBorderRadius: (value: string, out: CssProps) => void;
|
|
4
|
-
export declare const expandGap: (value: string, out: CssProps) => void;
|