@plitzi/sdk-server 0.32.24 → 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 +22 -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 -46
- package/dist/modules/mcp/proxy/fetch.js +0 -91
- package/dist/modules/mcp/proxy/grant.js +0 -65
- package/dist/modules/mcp/proxy/guard.js +0 -38
- package/dist/modules/mcp/proxy/handler.js +0 -68
- package/dist/modules/mcp/proxy/rewrite.js +0 -72
- 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 -17
- package/dist/src/modules/mcp/proxy/fetch.d.ts +0 -18
- package/dist/src/modules/mcp/proxy/grant.d.ts +0 -23
- 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 -7
- package/dist/src/modules/mcp/proxy/rewrite.d.ts +0 -13
- 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,218 +0,0 @@
|
|
|
1
|
-
import { Environment } from '@plitzi/sdk-shared';
|
|
2
|
-
export type Env = Environment;
|
|
3
|
-
/** CSS declarations for one selector state. Keys are kebab-case CSS properties (see plitzi://css-properties). */
|
|
4
|
-
export type CssProps = Record<string, string | number>;
|
|
5
|
-
export interface DisplayModeCss {
|
|
6
|
-
desktop?: CssProps;
|
|
7
|
-
tablet?: CssProps;
|
|
8
|
-
mobile?: CssProps;
|
|
9
|
-
}
|
|
10
|
-
export interface ResourceEnvelope<T> {
|
|
11
|
-
stateVersion: string;
|
|
12
|
-
data: T;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Read projections follow a filesystem model: list cheap summaries/skeletons, then read one element's detail
|
|
16
|
-
* on demand. Heavy per-element data (props, style) lives only in AIElementDetail, never in the listings.
|
|
17
|
-
*/
|
|
18
|
-
export interface AIPageSummary {
|
|
19
|
-
ref: string;
|
|
20
|
-
label: string;
|
|
21
|
-
slug: string;
|
|
22
|
-
default: boolean;
|
|
23
|
-
/** Whether the page is served by the published SDK runtime. A disabled page (`false`) is not routable/accessible
|
|
24
|
-
* to end users, but stays fully editable here. Defaults to true. */
|
|
25
|
-
enabled: boolean;
|
|
26
|
-
/** The ref of the folder this page lives in (a PageFolder id), or undefined for a root-level page. */
|
|
27
|
-
folder?: string;
|
|
28
|
-
elementCount: number;
|
|
29
|
-
}
|
|
30
|
-
/** A page folder in the sidebar tree. `ref` is the folder's id (there is no separate idRef); pages reference it
|
|
31
|
-
* by that id via their `folder`, and nested folders via `parentId`. */
|
|
32
|
-
export interface AIFolder {
|
|
33
|
-
ref: string;
|
|
34
|
-
name: string;
|
|
35
|
-
slug: string;
|
|
36
|
-
parentId?: string;
|
|
37
|
-
}
|
|
38
|
-
export interface AISkeletonNode {
|
|
39
|
-
ref: string;
|
|
40
|
-
type: string;
|
|
41
|
-
label: string;
|
|
42
|
-
subType?: string;
|
|
43
|
-
/** This element's version — identical to the stateVersion a direct element read or search hit returns for it. Diff
|
|
44
|
-
* it against a version you already hold to re-read (plitzi_read) only the nodes that actually changed. */
|
|
45
|
-
stateVersion?: string;
|
|
46
|
-
/** The class refs this node attaches on its base selector — names only, no CSS. Lets an agent map element →
|
|
47
|
-
* class straight from the page skeleton, without a per-element read just to learn which class it uses. */
|
|
48
|
-
base?: string[];
|
|
49
|
-
/** Class refs attached on non-base slots (slot → class refs), names only. */
|
|
50
|
-
slots?: Record<string, string[]>;
|
|
51
|
-
childCount: number;
|
|
52
|
-
children?: AISkeletonNode[];
|
|
53
|
-
}
|
|
54
|
-
export interface AIPageSkeleton {
|
|
55
|
-
ref: string;
|
|
56
|
-
label: string;
|
|
57
|
-
slug: string;
|
|
58
|
-
default: boolean;
|
|
59
|
-
/** Whether the page is served by the published SDK runtime. A disabled page (`false`) is not routable/accessible
|
|
60
|
-
* to end users, but stays fully editable here. Defaults to true. */
|
|
61
|
-
enabled: boolean;
|
|
62
|
-
/** Route params bound by the slug (e.g. ":spaceId" → ["spaceId"]). Valid as {{name}} references on this page,
|
|
63
|
-
* alongside the space-level plitzi://schema-variables. */
|
|
64
|
-
routeParams: string[];
|
|
65
|
-
tree: AISkeletonNode[];
|
|
66
|
-
}
|
|
67
|
-
/** Every style a page uses in one payload: the class definitions its elements attach (deduplicated, with CSS)
|
|
68
|
-
* and the global element selectors that affect any element type present on the page. Collapses "what styles
|
|
69
|
-
* does this page use" to a single read, with no reliance on a shared class-naming prefix. */
|
|
70
|
-
export interface AIPageStyles {
|
|
71
|
-
ref: string;
|
|
72
|
-
definitions: AIDefinition[];
|
|
73
|
-
globalStyles: AIGlobalStyle[];
|
|
74
|
-
}
|
|
75
|
-
/** Which variant each attached class/selector currently uses on this element (element.definition.initialState
|
|
76
|
-
* .styleVariant). Outer key = class ref, inner key = selector (`base` or a slot), value = variant name(s). */
|
|
77
|
-
export type AIStyleVariantSelection = Record<string, Record<string, string | string[]>>;
|
|
78
|
-
/** The element's initial (default) state overrides. `styleVariant` picks which variant of its classes is active;
|
|
79
|
-
* `visibility` hides/shows it initially. Kept minimal — the two fields agents actually set. */
|
|
80
|
-
export interface AIInitialState {
|
|
81
|
-
styleVariant?: AIStyleVariantSelection;
|
|
82
|
-
visibility?: boolean;
|
|
83
|
-
}
|
|
84
|
-
/** One data binding: connect a data `source` to the element field named by `to` (a prop, a style value, or an
|
|
85
|
-
* initial-state key, per its category). `transformers` reshape the value; `when` gates the binding. */
|
|
86
|
-
export interface AIBinding {
|
|
87
|
-
id: string;
|
|
88
|
-
to: string;
|
|
89
|
-
source: string;
|
|
90
|
-
transformers?: Array<{
|
|
91
|
-
action: string;
|
|
92
|
-
params: Record<string, string>;
|
|
93
|
-
enabled?: boolean;
|
|
94
|
-
}>;
|
|
95
|
-
when?: unknown;
|
|
96
|
-
enabled?: boolean;
|
|
97
|
-
}
|
|
98
|
-
/** Data bindings on an element, grouped by what they feed: element props (`attributes`), style values (`style`),
|
|
99
|
-
* or initial-state keys (`initialState`). */
|
|
100
|
-
export type AIBindings = Partial<Record<'attributes' | 'style' | 'initialState', AIBinding[]>>;
|
|
101
|
-
export type AIInteractionNodeType = 'trigger' | 'globalCallback' | 'callback' | 'utility';
|
|
102
|
-
/** One step of an interaction flow, projected from the stored doubly-linked node. Order is conveyed by the
|
|
103
|
-
* position in `AIInteractionFlow.nodes`; the stored beforeNode/afterNode/flowId links are computed on write. */
|
|
104
|
-
export interface AIInteractionNode {
|
|
105
|
-
id: string;
|
|
106
|
-
title: string;
|
|
107
|
-
nodeType: AIInteractionNodeType;
|
|
108
|
-
action: string;
|
|
109
|
-
params?: Record<string, unknown>;
|
|
110
|
-
enabled?: boolean;
|
|
111
|
-
when?: unknown;
|
|
112
|
-
/** Source element the callback targets (globalCallback/utility). Defaults to this element on write. */
|
|
113
|
-
elementId?: string;
|
|
114
|
-
preview?: Record<string, unknown>;
|
|
115
|
-
}
|
|
116
|
-
/** One interaction flow on an element: a trigger (first node) followed by the callbacks/utilities it runs, in
|
|
117
|
-
* order. `flowId` equals the trigger node id. */
|
|
118
|
-
export interface AIInteractionFlow {
|
|
119
|
-
flowId: string;
|
|
120
|
-
nodes: AIInteractionNode[];
|
|
121
|
-
}
|
|
122
|
-
export interface AIElementDetail {
|
|
123
|
-
ref: string;
|
|
124
|
-
type: string;
|
|
125
|
-
subType?: string;
|
|
126
|
-
label: string;
|
|
127
|
-
pageRef: string;
|
|
128
|
-
parentRef?: string;
|
|
129
|
-
props?: Record<string, unknown>;
|
|
130
|
-
style: {
|
|
131
|
-
base: string[];
|
|
132
|
-
slots: Record<string, string[]>;
|
|
133
|
-
};
|
|
134
|
-
/** CSS of the definitions referenced by `style` (keyed by class ref), inlined so an edit needs no follow-up
|
|
135
|
-
* read of each definition. Present only for refs that resolve to a definition. */
|
|
136
|
-
resolvedStyle?: Record<string, AIDefinition>;
|
|
137
|
-
/** Global (type 'element') styles that also affect this element because they target its type — every element of
|
|
138
|
-
* the type inherits them. Read-only here (not editable as definitions); shown so the effective CSS is complete. */
|
|
139
|
-
globalStyles?: AIGlobalStyle[];
|
|
140
|
-
/** Id rule (type 'id') targeting this element by its DOM `id` attribute (`#id`). Present only when the element
|
|
141
|
-
* carries an `id` that a rule matches. Edit it with the id-style tools (never as a definition). */
|
|
142
|
-
idStyle?: AIIdStyle;
|
|
143
|
-
/** Variant names each attached class exposes (deduped across its selectors), so the agent knows a class HAS a
|
|
144
|
-
* variant (e.g. a button class with "primary") before applying it via `initialState.styleVariant`. */
|
|
145
|
-
availableVariants?: Record<string, string[]>;
|
|
146
|
-
/** Which variant/visibility this element applies today (element.definition.initialState). */
|
|
147
|
-
initialState?: AIInitialState;
|
|
148
|
-
/** Data bindings on this element, grouped by category. */
|
|
149
|
-
bindings?: AIBindings;
|
|
150
|
-
/** Interaction flows on this element (event → ordered callbacks). */
|
|
151
|
-
interactions?: AIInteractionFlow[];
|
|
152
|
-
childRefs?: string[];
|
|
153
|
-
}
|
|
154
|
-
/** A global element style (a type 'element' StyleItem): its CSS applies to every element whose type equals
|
|
155
|
-
* `appliesToType`. It is not an addressable class definition — editing it would change every such element. */
|
|
156
|
-
export interface AIGlobalStyle extends AIDefinition {
|
|
157
|
-
appliesToType: string;
|
|
158
|
-
}
|
|
159
|
-
/** An id rule (a type 'id' StyleItem): its CSS targets the single element whose DOM `id` equals `targetId`
|
|
160
|
-
* (the CSS equivalent of `#id { … }`). Style one element by giving it an `id` attribute and writing this rule;
|
|
161
|
-
* prefer a class definition when the styling could be reused. */
|
|
162
|
-
export interface AIIdStyle extends AIDefinition {
|
|
163
|
-
targetId: string;
|
|
164
|
-
}
|
|
165
|
-
export interface AIDefinitionSlot extends DisplayModeCss {
|
|
166
|
-
states?: Record<string, DisplayModeCss>;
|
|
167
|
-
variants?: Record<string, DisplayModeCss>;
|
|
168
|
-
}
|
|
169
|
-
export interface AIDefinition extends AIDefinitionSlot {
|
|
170
|
-
ref: string;
|
|
171
|
-
slots?: Record<string, AIDefinitionSlot>;
|
|
172
|
-
}
|
|
173
|
-
export type StyleVariableCategory = 'color' | 'spacing' | 'shadow' | 'custom';
|
|
174
|
-
export type StyleVariableValue = string | number | {
|
|
175
|
-
light?: string;
|
|
176
|
-
dark?: string;
|
|
177
|
-
default?: string;
|
|
178
|
-
};
|
|
179
|
-
export interface AIStyleVariable {
|
|
180
|
-
name: string;
|
|
181
|
-
reference: string;
|
|
182
|
-
value: StyleVariableValue;
|
|
183
|
-
}
|
|
184
|
-
export interface AISchemaVariable {
|
|
185
|
-
name: string;
|
|
186
|
-
reference: string;
|
|
187
|
-
category: string;
|
|
188
|
-
type: string;
|
|
189
|
-
value: string | number | boolean;
|
|
190
|
-
subValues?: Array<{
|
|
191
|
-
when: unknown;
|
|
192
|
-
value: string | number | boolean;
|
|
193
|
-
}>;
|
|
194
|
-
}
|
|
195
|
-
/** Space-level settings: the arbitrary global CSS (`customCss`), state persistence, and the user/auth provider
|
|
196
|
-
* configuration. Every field is optional — a patch changes only the keys it sends. */
|
|
197
|
-
export interface AISettings {
|
|
198
|
-
customCss?: string;
|
|
199
|
-
keepState?: boolean;
|
|
200
|
-
stateStorage?: 'localStorage' | 'sessionStorage';
|
|
201
|
-
userProvider?: 'auth0' | 'basic' | 'custom' | '';
|
|
202
|
-
auth0Domain?: string;
|
|
203
|
-
auth0ClientId?: string;
|
|
204
|
-
tokenStorage?: 'localStorage' | 'sessionStorage' | '';
|
|
205
|
-
loginUrl?: string;
|
|
206
|
-
userUrl?: string;
|
|
207
|
-
refreshUrl?: string;
|
|
208
|
-
logoutUrl?: string;
|
|
209
|
-
detailsPath?: string;
|
|
210
|
-
tokenPath?: string;
|
|
211
|
-
expirationTimePath?: string;
|
|
212
|
-
}
|
|
213
|
-
export interface ValidationError {
|
|
214
|
-
path: string;
|
|
215
|
-
message: string;
|
|
216
|
-
hint: string;
|
|
217
|
-
validValues?: unknown[];
|
|
218
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { McpUiResourceCsp } from '@modelcontextprotocol/ext-apps';
|
|
2
|
-
/** A `ui://` page the host renders in a sandboxed iframe, linked from a tool through `_meta.ui.resourceUri`. */
|
|
3
|
-
export interface McpApp {
|
|
4
|
-
uri: string;
|
|
5
|
-
name: string;
|
|
6
|
-
description: string;
|
|
7
|
-
title: string;
|
|
8
|
-
/** Absolute path to the view: the app's browser entry. */
|
|
9
|
-
entry: string;
|
|
10
|
-
/** CSS to inline in the page, in order. Lazy, and the app produces the text itself: what a view needs is not
|
|
11
|
-
* always a file as it sits on disk (the render app leaves the icon fonts out of its stylesheet). */
|
|
12
|
-
styles?: () => string[];
|
|
13
|
-
csp?: McpUiResourceCsp;
|
|
14
|
-
}
|
|
15
|
-
/** Deployment switches the page hands to the view. They travel in the HTML rather than the bundle so a server
|
|
16
|
-
* that serves both settings still builds the (expensive) browser bundle once. The view reads them off
|
|
17
|
-
* `window.__PLITZI_VIEW__`, and must treat every one as optional: an older page carries none. */
|
|
18
|
-
export interface McpViewSettings {
|
|
19
|
-
/** May the view paint from tool arguments the host is still streaming? See `mcpAi.renderStreaming`. */
|
|
20
|
-
streaming: boolean;
|
|
21
|
-
/** Absolute resource endpoint of the server that served the page, when it serves one (see `mcpAi.proxy`). It
|
|
22
|
-
* shapes the PAGE rather than the view: its origin is what the resource CSP declares, so the URLs a render
|
|
23
|
-
* rewrote to it are allowed to load. The view needs nothing from it — every URL is rewritten server-side,
|
|
24
|
-
* where the signing secret is. */
|
|
25
|
-
proxyEndpoint?: string;
|
|
26
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ValidationError } from './aiSchema';
|
|
2
|
-
import { Operation } from '../tools/operations';
|
|
3
|
-
export type PreviewRequestBody = {
|
|
4
|
-
spaceId: number;
|
|
5
|
-
env?: string;
|
|
6
|
-
pageRef?: string;
|
|
7
|
-
operations?: Operation[];
|
|
8
|
-
};
|
|
9
|
-
export type PreviewResult = {
|
|
10
|
-
ok: true;
|
|
11
|
-
token?: string;
|
|
12
|
-
pagePath: string;
|
|
13
|
-
html: string;
|
|
14
|
-
stateVersion: string;
|
|
15
|
-
} | {
|
|
16
|
-
ok: false;
|
|
17
|
-
error: string;
|
|
18
|
-
message: string;
|
|
19
|
-
errors?: ValidationError[];
|
|
20
|
-
};
|
|
21
|
-
/** How the MCP tools reach the renderer. The consumer injects an implementation (an HTTP client to the SSR
|
|
22
|
-
* `/preview` endpoint, or an in-process call when co-located); absent means preview is not wired. */
|
|
23
|
-
export type PreviewClient = {
|
|
24
|
-
render: (body: PreviewRequestBody) => Promise<PreviewResult>;
|
|
25
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export type Viewport = {
|
|
2
|
-
label: string;
|
|
3
|
-
width: number;
|
|
4
|
-
height: number;
|
|
5
|
-
};
|
|
6
|
-
export type ScreenshotImage = {
|
|
7
|
-
label: string;
|
|
8
|
-
mimeType: string;
|
|
9
|
-
data: string;
|
|
10
|
-
};
|
|
11
|
-
export type ScreenshotResult = {
|
|
12
|
-
ok: true;
|
|
13
|
-
images: ScreenshotImage[];
|
|
14
|
-
} | {
|
|
15
|
-
ok: false;
|
|
16
|
-
error: string;
|
|
17
|
-
message: string;
|
|
18
|
-
};
|
|
19
|
-
export type ScreenshotInput = {
|
|
20
|
-
pagePath: string;
|
|
21
|
-
token?: string;
|
|
22
|
-
viewports: Viewport[];
|
|
23
|
-
};
|
|
24
|
-
/** How plitzi_screenshot reaches the headless-browser service. The consumer injects an implementation (an HTTP
|
|
25
|
-
* client to the dedicated browser pod); absent → the tool is not registered. A capture that fails (pod down)
|
|
26
|
-
* returns `ok:false` rather than throwing, so the tool can degrade to the HTML preview. */
|
|
27
|
-
export type ScreenshotClient = {
|
|
28
|
-
capture: (input: ScreenshotInput) => Promise<ScreenshotResult>;
|
|
29
|
-
};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { AIDefinition, AIElementDetail, ValidationError } from './aiSchema';
|
|
2
|
-
import { Operation } from '../tools/operations';
|
|
3
|
-
import { Schema, Style } from '@plitzi/sdk-shared';
|
|
4
|
-
/** The element schema and the style schema persist independently (Space model / Style model), so each has
|
|
5
|
-
* its own optional persister. When one is absent, that schema is applied in memory but reported unsaved. */
|
|
6
|
-
export interface Persisters {
|
|
7
|
-
schema?: (schema: Schema) => Promise<void>;
|
|
8
|
-
style?: (style: Style) => Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export interface Conflict {
|
|
11
|
-
resourceUri: string;
|
|
12
|
-
expectedVersion: string;
|
|
13
|
-
currentVersion: string;
|
|
14
|
-
}
|
|
15
|
-
export interface ChangedResource {
|
|
16
|
-
uri: string;
|
|
17
|
-
stateVersion: string;
|
|
18
|
-
}
|
|
19
|
-
/** Full detail of a created/updated element, plus its own uri and stateVersion so a follow-up edit of the same
|
|
20
|
-
* element can guard with optimistic concurrency without an intermediate read. */
|
|
21
|
-
export type WriteElement = AIElementDetail & {
|
|
22
|
-
uri: string;
|
|
23
|
-
stateVersion: string;
|
|
24
|
-
};
|
|
25
|
-
/** Write result: what changed and the new versions, plus the full detail of every element created/updated (with
|
|
26
|
-
* its uri + stateVersion) so the caller has that context without a follow-up read. Other resources (pages,
|
|
27
|
-
* definitions, variables) still report only uri+version — re-read them if needed. */
|
|
28
|
-
export interface WriteResponse {
|
|
29
|
-
applied: boolean;
|
|
30
|
-
dryRun?: boolean;
|
|
31
|
-
persisted?: boolean;
|
|
32
|
-
summary: {
|
|
33
|
-
created: number;
|
|
34
|
-
updated: number;
|
|
35
|
-
deleted: number;
|
|
36
|
-
};
|
|
37
|
-
changed: ChangedResource[];
|
|
38
|
-
elements?: WriteElement[];
|
|
39
|
-
warnings?: string[];
|
|
40
|
-
errors?: ValidationError[];
|
|
41
|
-
conflict?: {
|
|
42
|
-
message: string;
|
|
43
|
-
conflicts: Conflict[];
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
/** The outcome of applying a batch to the space in memory: counts, which schema(s) changed (so the caller can
|
|
47
|
-
* persist each independently), the invalidated resource URIs and the refs of the elements it created/updated. */
|
|
48
|
-
export interface MutationOutcome {
|
|
49
|
-
created: number;
|
|
50
|
-
updated: number;
|
|
51
|
-
deleted: number;
|
|
52
|
-
staleResources: string[];
|
|
53
|
-
elementRefs: string[];
|
|
54
|
-
errors: ValidationError[];
|
|
55
|
-
changedSchema: boolean;
|
|
56
|
-
changedStyle: boolean;
|
|
57
|
-
}
|
|
58
|
-
export interface ApplyInput {
|
|
59
|
-
environment?: string;
|
|
60
|
-
dryRun?: boolean;
|
|
61
|
-
expectedResourceVersions?: Record<string, string>;
|
|
62
|
-
operations: Operation[];
|
|
63
|
-
}
|
|
64
|
-
export interface ValidateInput {
|
|
65
|
-
environment?: string;
|
|
66
|
-
operations: Operation[];
|
|
67
|
-
}
|
|
68
|
-
export interface ValidationResult {
|
|
69
|
-
valid: boolean;
|
|
70
|
-
errors: ValidationError[];
|
|
71
|
-
warnings: string[];
|
|
72
|
-
}
|
|
73
|
-
export interface SearchInput {
|
|
74
|
-
query: string;
|
|
75
|
-
filters?: {
|
|
76
|
-
type?: string;
|
|
77
|
-
pageRef?: string;
|
|
78
|
-
};
|
|
79
|
-
/** 'detail' inlines each hit's full props/style so an edit needs no follow-up read. */
|
|
80
|
-
include?: 'detail';
|
|
81
|
-
/** Max element hits to return in this page (default 50). */
|
|
82
|
-
limit?: number;
|
|
83
|
-
/** Element hits to skip before this page (default 0). */
|
|
84
|
-
offset?: number;
|
|
85
|
-
}
|
|
86
|
-
export interface SearchHit {
|
|
87
|
-
pageRef: string;
|
|
88
|
-
ref: string;
|
|
89
|
-
uri: string;
|
|
90
|
-
pageUri: string;
|
|
91
|
-
stateVersion: string;
|
|
92
|
-
parentRef?: string;
|
|
93
|
-
/** Ancestor labels from the page down to and including this element. */
|
|
94
|
-
path: string[];
|
|
95
|
-
label: string;
|
|
96
|
-
type: string;
|
|
97
|
-
matches: string[];
|
|
98
|
-
detail?: AIElementDetail;
|
|
99
|
-
}
|
|
100
|
-
export interface SearchPageHit {
|
|
101
|
-
ref: string;
|
|
102
|
-
uri: string;
|
|
103
|
-
stateVersion: string;
|
|
104
|
-
label: string;
|
|
105
|
-
slug: string;
|
|
106
|
-
matches: string[];
|
|
107
|
-
}
|
|
108
|
-
export interface SearchResponse {
|
|
109
|
-
results: SearchHit[];
|
|
110
|
-
/** Total element hits matching the query across all pages, before offset/limit. */
|
|
111
|
-
total: number;
|
|
112
|
-
/** Element hits skipped before this page (echoes the request's offset, defaulted). */
|
|
113
|
-
offset: number;
|
|
114
|
-
/** Page size applied to element hits (echoes the request's limit, defaulted). */
|
|
115
|
-
limit: number;
|
|
116
|
-
/** The offset to pass next to fetch the following page. Present only while more hits remain past this page. */
|
|
117
|
-
nextOffset?: number;
|
|
118
|
-
/** Style definitions whose ref matches the query, with their full CSS — so finding a class by name closes the
|
|
119
|
-
* loop to its style without a separate read. Present only when at least one definition matches. */
|
|
120
|
-
definitions?: AIDefinition[];
|
|
121
|
-
/** Pages whose name or slug matches the query (element hits never include pages). Each carries the page uri +
|
|
122
|
-
* stateVersion, ready to open or edit. Present only when at least one page matches. */
|
|
123
|
-
pages?: SearchPageHit[];
|
|
124
|
-
}
|
|
125
|
-
export interface ReadInput {
|
|
126
|
-
uris: string[];
|
|
127
|
-
}
|
|
128
|
-
export interface ReadHit {
|
|
129
|
-
uri: string;
|
|
130
|
-
stateVersion?: string;
|
|
131
|
-
data?: unknown;
|
|
132
|
-
error?: string;
|
|
133
|
-
message?: string;
|
|
134
|
-
hint?: string;
|
|
135
|
-
}
|
|
136
|
-
export interface ReadResponse {
|
|
137
|
-
results: ReadHit[];
|
|
138
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OAuthParams } from './params';
|
|
2
|
-
import { OAuthConfig, SSRResponseHelpers } from '@plitzi/sdk-shared';
|
|
3
|
-
/** GET /authorize — the entry point a host opens in the user's browser. */
|
|
4
|
-
export declare const handleAuthorizeStart: (config: OAuthConfig, res: SSRResponseHelpers, params: OAuthParams) => Promise<void>;
|
|
5
|
-
/** POST /authorize — both steps of the form land here: the credentials submit, and the grant submit that carries
|
|
6
|
-
* the `pending` id proving the credentials step already passed. */
|
|
7
|
-
export declare const handleAuthorizeSubmit: (config: OAuthConfig, res: SSRResponseHelpers, params: OAuthParams) => Promise<void>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { OAuthConfig, SSRRequest, SSRResponseHelpers } from '@plitzi/sdk-shared';
|
|
2
|
-
/** The credential on an MCP request. `Authorization: Bearer` is what RFC 6750 defines and what a remote host
|
|
3
|
-
* sends; `x-access-token` is the platform's own header, which the builder and the CLI already use — a request
|
|
4
|
-
* carrying either presents a credential, and the same verification decides whether it is a good one. */
|
|
5
|
-
export declare const bearerOf: (req: SSRRequest) => string;
|
|
6
|
-
/** RFC 6750 §3 — the answer to an MCP request that presents no usable credential, and the only thing that starts
|
|
7
|
-
* an authorization flow: a host runs OAuth off a 401 whose `WWW-Authenticate` names the resource metadata, and
|
|
8
|
-
* IGNORES the header on a 200. Answering such a request with the anonymous surface instead is what leaves a
|
|
9
|
-
* connector unable to attach the grant it just completed — the flow succeeds and the host still reports that
|
|
10
|
-
* authorization failed. `scope` states what to ask for, so consent is not widened to everything advertised. */
|
|
11
|
-
export declare const sendChallenge: (config: OAuthConfig, req: SSRRequest, res: SSRResponseHelpers, description: string) => void;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OAuthConsentView } from '@plitzi/sdk-shared';
|
|
2
|
-
/** The built-in consent screen: a credentials step, then a step to pick what the client gets access to. Replace it
|
|
3
|
-
* wholesale via `oauth.renderConsent` — the field names read back here are the contract, not the markup. */
|
|
4
|
-
export declare const renderConsentPage: (view: OAuthConsentView) => string;
|
|
5
|
-
/** The dead end for a request that cannot be redirected back — a bad `redirect_uri` or an unknown client. Bouncing
|
|
6
|
-
* those to the client would make this server an open redirector, so the user is told here instead. */
|
|
7
|
-
export declare const renderErrorPage: (title: string, detail: string) => string;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { OAuthConfig, SSRRequest } from '@plitzi/sdk-shared';
|
|
2
|
-
export declare const AUTHORIZE_PATH = "/authorize";
|
|
3
|
-
export declare const TOKEN_PATH = "/token";
|
|
4
|
-
export declare const REGISTER_PATH = "/register";
|
|
5
|
-
export declare const PROTECTED_RESOURCE_PATH = "/.well-known/oauth-protected-resource";
|
|
6
|
-
export declare const AUTHORIZATION_SERVER_PATH = "/.well-known/oauth-authorization-server";
|
|
7
|
-
/** The identifier the two documents agree on. This server is both the protected resource and its own
|
|
8
|
-
* authorization server, so one origin names both. Derived from the request unless pinned, which keeps a
|
|
9
|
-
* deployment correct across its dev, staging and production hosts without per-environment config. */
|
|
10
|
-
export declare const issuerOf: (config: OAuthConfig, req: SSRRequest) => string;
|
|
11
|
-
export declare const scopesOf: (config: OAuthConfig) => string[];
|
|
12
|
-
/** Where the challenge points a host, for an MCP endpoint served at `req.path`. RFC 9728 §3.1 appends the
|
|
13
|
-
* resource's own path to the well-known path, and a host that reads the document back expects its `resource` to
|
|
14
|
-
* name the URL it was configured with — so a server mounted at /mcp must be pointed at the suffixed document,
|
|
15
|
-
* not the bare one. */
|
|
16
|
-
export declare const resourceMetadataUrl: (config: OAuthConfig, req: SSRRequest) => string;
|
|
17
|
-
/** RFC 9728. The document Claude Desktop asks for FIRST, and the one whose absence ends the flow before anything
|
|
18
|
-
* else is tried — a 404 here is what a host reports as `mcp_auth_start_failed`.
|
|
19
|
-
*
|
|
20
|
-
* `resource` echoes the path the document was asked for: Claude requires it to match the server URL the user
|
|
21
|
-
* typed, path included, and a dedicated MCP server answers JSON-RPC on every path — so `/.well-known/…/mcp`
|
|
22
|
-
* describes `https://host/mcp` while the bare path describes the origin.
|
|
23
|
-
*
|
|
24
|
-
* A server mounted at the ORIGIN is `https://host/`, WITH the trailing slash: a host parses the URL the user
|
|
25
|
-
* typed before it does anything with it, and an empty path renders as `/` — Claude's connector was observed
|
|
26
|
-
* asking for exactly `resource=https%3A%2F%2Fhost%2F`, so that is the form the document must claim.
|
|
27
|
-
*
|
|
28
|
-
* It does NOT make a bare-origin connector work, and nothing here can. Claude's remote-connector service will
|
|
29
|
-
* not open a session against an MCP endpoint whose URL has no path: the whole grant succeeds — discovery,
|
|
30
|
-
* registration, consent, a 200 from /token with the scope it asked for — and then it reports
|
|
31
|
-
* `McpAuthorizationError` ("the integration rejected the credentials it just issued") without ever presenting
|
|
32
|
-
* the bearer. Verified against the same deployment, minutes apart: at /mcp the token is followed by
|
|
33
|
-
* `initialize`, at / nothing follows it, in the ingress log as well as this server's. Claiming `https://host/mcp`
|
|
34
|
-
* from the bare document would only fail sooner — a client checks that the resource it is handed is no MORE
|
|
35
|
-
* specific than the URL it holds. Publish the connector URL WITH its path. */
|
|
36
|
-
export declare const protectedResourceMetadata: (config: OAuthConfig, req: SSRRequest) => Record<string, unknown>;
|
|
37
|
-
/** RFC 8414. Public clients with PKCE only: a desktop host stores no secret, so `none` is the sole endpoint auth
|
|
38
|
-
* method and S256 the sole challenge method. `offline_access` is advertised whenever refresh grants are issued,
|
|
39
|
-
* which is the signal a host looks for before asking for one. */
|
|
40
|
-
export declare const authorizationServerMetadata: (config: OAuthConfig, req: SSRRequest) => Record<string, unknown>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** Query-string or form fields as they arrive from a client: every name is optional, and an absent one is not
|
|
2
|
-
* distinguishable from an empty one — both mean "the client did not send this". */
|
|
3
|
-
export type OAuthParams = Record<string, string | undefined>;
|
|
4
|
-
export declare const field: (params: OAuthParams, name: string) => string;
|
|
5
|
-
export declare const optionalField: (params: OAuthParams, name: string) => string | undefined;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** An unguessable, URL-safe identifier for the values this layer hands out (codes, refresh tokens, client ids).
|
|
2
|
-
* 256 bits from the CSPRNG, so they are also unguessable by anyone who collects a few of them. */
|
|
3
|
-
export declare const randomId: () => string;
|
|
4
|
-
/** RFC 7636 S256, the only method this server accepts — `plain` puts the verifier on the wire, and a public
|
|
5
|
-
* client on a desktop host has no other proof it is the one that started the flow. */
|
|
6
|
-
export declare const verifyChallenge: (verifier: string, challenge: string) => boolean;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { OAuthGrantTarget, OAuthStore, OAuthUser } from '@plitzi/sdk-shared';
|
|
2
|
-
/** A client that registered itself through RFC 7591. Public clients only — a desktop host cannot keep a secret,
|
|
3
|
-
* so the token endpoint authenticates the exchange with PKCE instead. */
|
|
4
|
-
export type ClientRecord = {
|
|
5
|
-
clientId: string;
|
|
6
|
-
clientName: string;
|
|
7
|
-
redirectUris: string[];
|
|
8
|
-
/** When this registration was first handed out, so re-registering the same client keeps reporting its real age. */
|
|
9
|
-
issuedAt: number;
|
|
10
|
-
};
|
|
11
|
-
/** The authorization request, parked while the user logs in. `challenge` binds the eventual code to the client
|
|
12
|
-
* that started the flow. */
|
|
13
|
-
export type PendingRecord = {
|
|
14
|
-
clientId: string;
|
|
15
|
-
redirectUri: string;
|
|
16
|
-
challenge: string;
|
|
17
|
-
state?: string;
|
|
18
|
-
scope?: string;
|
|
19
|
-
user: OAuthUser;
|
|
20
|
-
};
|
|
21
|
-
/** A code, redeemable once, for the token it already resolves to. Minting the bearer at consent time (rather than
|
|
22
|
-
* at redemption) means a failure the user could act on — no space, revoked access — surfaces on the consent
|
|
23
|
-
* screen instead of as an opaque `invalid_grant` inside the host. */
|
|
24
|
-
export type CodeRecord = {
|
|
25
|
-
clientId: string;
|
|
26
|
-
redirectUri: string;
|
|
27
|
-
challenge: string;
|
|
28
|
-
token: string;
|
|
29
|
-
expiresInSeconds?: number;
|
|
30
|
-
scope?: string;
|
|
31
|
-
user: OAuthUser;
|
|
32
|
-
target: OAuthGrantTarget;
|
|
33
|
-
};
|
|
34
|
-
/** A refresh grant: everything needed to mint a fresh bearer without asking the user again. */
|
|
35
|
-
export type RefreshRecord = {
|
|
36
|
-
clientId: string;
|
|
37
|
-
scope?: string;
|
|
38
|
-
user: OAuthUser;
|
|
39
|
-
target: OAuthGrantTarget;
|
|
40
|
-
};
|
|
41
|
-
/** A bearer this server handed out. The token a client holds is an opaque handle minted here, and this record is
|
|
42
|
-
* what it stands for — including `credential`, the thing the deployment's own adapters understand, which never
|
|
43
|
-
* leaves the server: a platform token is usually good against more than the MCP endpoint, and a remote host has
|
|
44
|
-
* no business holding one. The record expires with the bearer, which is what turns an expired one into the 401 a
|
|
45
|
-
* host answers by refreshing; dropping it early revokes the bearer outright. */
|
|
46
|
-
export type AccessRecord = {
|
|
47
|
-
/** What {@link OAuthAdapters.issueToken} returned — swapped back onto the request once the bearer checks out.
|
|
48
|
-
* Absent only in a record written before the bearer and the credential were separate things, where the bearer
|
|
49
|
-
* WAS the credential: a live connector must survive that upgrade, so the reader falls back to the token itself. */
|
|
50
|
-
credential?: string;
|
|
51
|
-
clientId: string;
|
|
52
|
-
user: OAuthUser;
|
|
53
|
-
target: OAuthGrantTarget;
|
|
54
|
-
};
|
|
55
|
-
export declare const putClient: (store: OAuthStore, client: ClientRecord) => Promise<void>;
|
|
56
|
-
export declare const getClient: (store: OAuthStore, clientId: string) => Promise<ClientRecord | undefined>;
|
|
57
|
-
/** The id already handed out for an identical registration. Keyed by what the client asked to be registered AS,
|
|
58
|
-
* so the same request always resolves to the same client — see handleRegister for why that matters. */
|
|
59
|
-
export declare const getClientByFingerprint: (store: OAuthStore, fingerprint: string) => Promise<ClientRecord | undefined>;
|
|
60
|
-
export declare const putClientFingerprint: (store: OAuthStore, fingerprint: string, clientId: string) => Promise<void>;
|
|
61
|
-
export declare const putPending: (store: OAuthStore, id: string, pending: PendingRecord) => Promise<void>;
|
|
62
|
-
export declare const getPending: (store: OAuthStore, id: string) => Promise<PendingRecord | undefined>;
|
|
63
|
-
export declare const dropPending: (store: OAuthStore, id: string) => Promise<void>;
|
|
64
|
-
export declare const putCode: (store: OAuthStore, code: string, record: CodeRecord, ttlSeconds: number) => Promise<void>;
|
|
65
|
-
export declare const getCode: (store: OAuthStore, code: string) => Promise<CodeRecord | undefined>;
|
|
66
|
-
export declare const dropCode: (store: OAuthStore, code: string) => Promise<void>;
|
|
67
|
-
export declare const putRefresh: (store: OAuthStore, token: string, record: RefreshRecord, ttlSeconds: number) => Promise<void>;
|
|
68
|
-
export declare const getRefresh: (store: OAuthStore, token: string) => Promise<RefreshRecord | undefined>;
|
|
69
|
-
export declare const dropRefresh: (store: OAuthStore, token: string) => Promise<void>;
|
|
70
|
-
export declare const putAccess: (store: OAuthStore, token: string, record: AccessRecord, ttlSeconds: number) => Promise<void>;
|
|
71
|
-
export declare const getAccess: (store: OAuthStore, token: string) => Promise<AccessRecord | undefined>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { OAuthConfig, SSRResponseHelpers } from '@plitzi/sdk-shared';
|
|
2
|
-
/** RFC 7591 dynamic client registration. A remote host has no way to be configured into this server ahead of
|
|
3
|
-
* time, so it registers itself on first connect; the record it gets back is only ever used to pin the redirect
|
|
4
|
-
* target, since a public client authenticates with PKCE rather than with credentials. */
|
|
5
|
-
export declare const handleRegister: (config: OAuthConfig, res: SSRResponseHelpers, body: unknown) => Promise<void>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SSRResponseHelpers } from '@plitzi/sdk-shared';
|
|
2
|
-
/** The error codes RFC 6749 defines for the responses this server produces. */
|
|
3
|
-
export type OAuthErrorCode = 'invalid_request' | 'invalid_client' | 'invalid_grant' | 'unauthorized_client' | 'unsupported_grant_type' | 'unsupported_response_type' | 'invalid_scope' | 'access_denied' | 'server_error';
|
|
4
|
-
export declare const sendJson: (res: SSRResponseHelpers, status: number, body: unknown) => void;
|
|
5
|
-
export declare const sendHtml: (res: SSRResponseHelpers, status: number, html: string) => void;
|
|
6
|
-
export declare const sendErrorJson: (res: SSRResponseHelpers, status: number, error: OAuthErrorCode, description: string) => void;
|
|
7
|
-
/** Shown when the authorization request itself is unusable — an unknown client, a `redirect_uri` that is not
|
|
8
|
-
* registered. Redirecting those back would turn the endpoint into an open redirector. */
|
|
9
|
-
export declare const sendErrorPage: (res: SSRResponseHelpers, title: string, detail: string) => void;
|
|
10
|
-
/** The other half of RFC 6749 error handling: once the redirect target is known to be legitimate, failures go
|
|
11
|
-
* back to the client so the host can report them, carrying `state` so it can match the response to its request. */
|
|
12
|
-
export declare const redirectWithError: (res: SSRResponseHelpers, redirectUri: string, error: OAuthErrorCode, description: string, state?: string) => void;
|
|
13
|
-
export declare const redirectWithCode: (res: SSRResponseHelpers, redirectUri: string, code: string, state?: string) => void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { OAuthParams } from './params';
|
|
2
|
-
import { OAuthConfig, SSRResponseHelpers } from '@plitzi/sdk-shared';
|
|
3
|
-
/** POST /token. Public clients only, so there is no client authentication to check — PKCE is what proves the
|
|
4
|
-
* caller is the one that started the flow. */
|
|
5
|
-
export declare const handleToken: (config: OAuthConfig, res: SSRResponseHelpers, params: OAuthParams) => Promise<void>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TtlCache } from '../../helpers/cache';
|
|
2
|
-
import { RequestMetrics } from '../../helpers/metrics';
|
|
3
|
-
import { PluginManager } from '../../plugins/manager';
|
|
4
|
-
import { Environment, OfflineDataRaw, SSRRenderResult, SSRRequest, SSRServerConfig, SSRTemplateFn } from '@plitzi/sdk-shared';
|
|
5
|
-
export type BuildBodyResult = {
|
|
6
|
-
body?: string;
|
|
7
|
-
result: SSRRenderResult;
|
|
8
|
-
};
|
|
9
|
-
export declare const buildBody: (req: SSRRequest, config: SSRServerConfig, spaceId: number, environment: Environment, revision: number, renderFn: SSRTemplateFn, pluginManager: PluginManager, offlineDataCache?: TtlCache<string>, metrics?: RequestMetrics, offlineDataOverride?: OfflineDataRaw) => Promise<BuildBodyResult>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ServerCaches } from '../../helpers/cache';
|
|
2
|
-
import { PluginManager } from '../../plugins/manager';
|
|
3
|
-
import { SSRRequest, SSRResponseHelpers, SSRServerConfig, SSRTemplateFn } from '@plitzi/sdk-shared';
|
|
4
|
-
export declare const renderSSR: (req: SSRRequest, res: SSRResponseHelpers, config: SSRServerConfig, renderFn: SSRTemplateFn, pluginManager: PluginManager, caches: ServerCaches) => Promise<void>;
|