@plitzi/sdk-server 0.32.25 → 0.33.1
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 +21 -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,115 +0,0 @@
|
|
|
1
|
-
import { AIElementDetail } from '../types';
|
|
2
|
-
import { ComponentCatalog, Element, PageFolder, Schema, Style } from '@plitzi/sdk-shared';
|
|
3
|
-
/** The working view the tools read and mutate: the two Plitzi schemas (elements + style), which the platform
|
|
4
|
-
* stores and persists as separate documents (Space model / Style model). `catalog` is read-only reference data
|
|
5
|
-
* (plugin element-type semantics), not persisted — used only to enrich the plitzi://types resource. */
|
|
6
|
-
export interface Space {
|
|
7
|
-
schema: Schema;
|
|
8
|
-
style: Style;
|
|
9
|
-
catalog?: ComponentCatalog;
|
|
10
|
-
}
|
|
11
|
-
export declare const cloneSpace: (space: Space) => Space;
|
|
12
|
-
export declare const emptySpace: () => Space;
|
|
13
|
-
export declare const slugify: (value: string) => string;
|
|
14
|
-
/** A value when it is a string, otherwise undefined — for the many attributes typed as `unknown` that are strings
|
|
15
|
-
* in practice (name, slug, subType, dom id…). */
|
|
16
|
-
export declare const strOr: (value: unknown) => string | undefined;
|
|
17
|
-
/** Display name of a page or element: its `name` attribute when set, otherwise its definition label. */
|
|
18
|
-
export declare const nameOf: (el: Element) => string;
|
|
19
|
-
/** Stable, human-readable ref for a page: its idRef, then slug, then a slugified label. A page without an idRef is
|
|
20
|
-
* still addressable — unlike a data source, a page ref has meaningful fallbacks the agent can read off the tree. */
|
|
21
|
-
export declare const pageRefOf: (el: Element) => string;
|
|
22
|
-
/** Stable ref for ADDRESSING a non-page element in the tree: its idRef when present, otherwise the opaque id so an
|
|
23
|
-
* element without one is still reachable — the agent needs to name it to give it an idRef in the first place.
|
|
24
|
-
* This is not the wiring key: the runtime wires interactions and data sources by idRef only, so an element
|
|
25
|
-
* addressed here by its id alone publishes no source and takes no interactions (see `getSourceName`). */
|
|
26
|
-
export declare const elementRefOf: (el: Element) => string;
|
|
27
|
-
/** A memoized element projection: its full detail and the stateVersion (content hash) derived from it, plus the
|
|
28
|
-
* style object they were computed against (a different style ref forces a recompute). */
|
|
29
|
-
export interface ElementVersion {
|
|
30
|
-
style: Style;
|
|
31
|
-
detail: AIElementDetail;
|
|
32
|
-
version: string;
|
|
33
|
-
}
|
|
34
|
-
export interface SpaceIndex {
|
|
35
|
-
/** Ids of the page elements (schema.pages ∪ every element whose type is 'page'). */
|
|
36
|
-
pageIds: Set<string>;
|
|
37
|
-
/** The page elements, in schema.flat insertion order (what getPageElements returns). */
|
|
38
|
-
pageElements: Element[];
|
|
39
|
-
/** page ref (idRef/slug/label) AND raw page id → the page element. First writer wins on a ref collision. */
|
|
40
|
-
pageByRef: Map<string, Element>;
|
|
41
|
-
/** non-page idRef AND raw id → the element. First writer wins on a ref collision. */
|
|
42
|
-
elementByRef: Map<string, Element>;
|
|
43
|
-
/** Any element id (page root or nested descendant) → the id of the page it belongs to. */
|
|
44
|
-
pageOf: Map<string, string>;
|
|
45
|
-
/** element id → its memoized detail/version, so a page-skeleton hash, a search hit and a follow-up element read
|
|
46
|
-
* all resolve the same element once. Populated lazily by `elementView`; dropped whole on `invalidateIndex`. */
|
|
47
|
-
detailCache: Map<string, ElementVersion>;
|
|
48
|
-
}
|
|
49
|
-
/** The index for a schema, built once and memoized on the schema object. */
|
|
50
|
-
export declare const spaceIndex: (schema: Schema) => SpaceIndex;
|
|
51
|
-
/** Drop the memoized index wholesale. A correctness fallback for a mutation with no dedicated incremental updater;
|
|
52
|
-
* the next scanner rebuilds against current state. Prefer the index* helpers below, which keep a built index in
|
|
53
|
-
* step in O(1) — a large structural batch would otherwise pay an O(flat) rebuild after every op. */
|
|
54
|
-
export declare const invalidateIndex: (schema: Schema) => void;
|
|
55
|
-
/** A new non-page element was created under `pageId`. */
|
|
56
|
-
export declare const indexAddElement: (schema: Schema, el: Element, pageId: string) => void;
|
|
57
|
-
/** These non-page elements were deleted (an element and its descendants). */
|
|
58
|
-
export declare const indexRemoveElements: (schema: Schema, els: Element[]) => void;
|
|
59
|
-
/** An existing element was just given an idRef (it had none), so it becomes addressable by that ref. */
|
|
60
|
-
export declare const indexReRefElement: (schema: Schema, el: Element) => void;
|
|
61
|
-
/** A new page element was created. */
|
|
62
|
-
export declare const indexAddPage: (schema: Schema, page: Element) => void;
|
|
63
|
-
/** A page and its `descendants` (its non-page elements) were deleted. */
|
|
64
|
-
export declare const indexRemovePage: (schema: Schema, page: Element, descendants: Element[]) => void;
|
|
65
|
-
/** A page's slug/name/default changed; re-key its pageByRef entry if that changed its ref. `oldRef` is the ref
|
|
66
|
-
* computed BEFORE the attribute change. */
|
|
67
|
-
export declare const indexReRefPage: (schema: Schema, page: Element, oldRef: string) => void;
|
|
68
|
-
/** A move reparented an element within its page: the ref/page maps are unchanged, but the moved element's
|
|
69
|
-
* parentRef and both parents' childRefs did change, so their memoized detail must be dropped. */
|
|
70
|
-
export declare const indexInvalidateDetails: (schema: Schema) => void;
|
|
71
|
-
export declare const isPageElement: (schema: Schema, el: Element) => boolean;
|
|
72
|
-
export declare const getPageElements: (schema: Schema) => Element[];
|
|
73
|
-
/** Finds a page by its semantic ref (idRef/slug/…) or its raw id, so legacy schemas without an idRef still resolve. */
|
|
74
|
-
export declare const findPageByRef: (schema: Schema, pageRef: string) => Element | undefined;
|
|
75
|
-
/** Find any non-page element by its semantic ref (idRef) or raw id, across the whole space. */
|
|
76
|
-
export declare const findElementByRef: (schema: Schema, ref: string) => Element | undefined;
|
|
77
|
-
export declare const pageFoldersOf: (schema: Schema) => PageFolder[];
|
|
78
|
-
/** Resolve a folder by its id, or (for agent convenience) by an exact name or slug when that is unambiguous. */
|
|
79
|
-
export declare const findFolderByRef: (schema: Schema, ref: string) => PageFolder | undefined;
|
|
80
|
-
/** Order folders so every parent precedes its children — the invariant the schema validator enforces on
|
|
81
|
-
* pageFolders (a parentId must appear earlier in the array). Cycles (rejected upstream) are left in place. */
|
|
82
|
-
export declare const sortFolders: (folders: PageFolder[]) => PageFolder[];
|
|
83
|
-
/** Ancestor ids of a folder (following parentId), stopping on a cycle. Used to reject a parent change that would
|
|
84
|
-
* make a folder its own ancestor. */
|
|
85
|
-
export declare const folderAncestorIds: (folders: PageFolder[], startParentId: string | undefined) => string[];
|
|
86
|
-
/** Route params a page's slug binds (e.g. ":spaceId/update/*" → ["spaceId"]). These are valid {{name}}
|
|
87
|
-
* references on that page even though they are not space-level schema variables. */
|
|
88
|
-
export declare const slugRouteParams: (slug: string) => string[];
|
|
89
|
-
/** Every route param bound by any page slug in the space (union), so {{name}} validation does not false-flag a
|
|
90
|
-
* page-scoped dynamic binding. */
|
|
91
|
-
export declare const routeParamNames: (schema: Schema) => string[];
|
|
92
|
-
/** Indexed lookup that reflects the runtime reality: a flat id may be dangling (rsc placeholders, stale items). */
|
|
93
|
-
export declare const elementById: (schema: Schema, id: string) => Element | undefined;
|
|
94
|
-
export declare const descendantIds: (schema: Schema, pageRootId: string) => string[];
|
|
95
|
-
/** Resolve a ref to a concrete element within a page subtree (or the page root itself). Accepts either the
|
|
96
|
-
* semantic ref (idRef) or the raw element id, so schemas predating idRef keep working through their ids. */
|
|
97
|
-
export declare const resolveRef: (schema: Schema, page: Element, ref: string) => Element | undefined;
|
|
98
|
-
/** Ordered children of an element, honoring definition.items and skipping dangling ids. */
|
|
99
|
-
export declare const orderedChildren: (schema: Schema, el: Element) => Element[];
|
|
100
|
-
/** The page ref an element belongs to. 'unknown' when it has no page ancestor. */
|
|
101
|
-
export declare const pageRefOfElement: (schema: Schema, el: Element) => string;
|
|
102
|
-
/** Total number of descendant elements under a subtree (excluding the root). */
|
|
103
|
-
export declare const descendantCount: (schema: Schema, rootId: string) => number;
|
|
104
|
-
export declare const emptySpaceMessage = "Space data not available";
|
|
105
|
-
/** The code a space-dependent answer carries when the connection reaches no space, so both the agent and a host UI
|
|
106
|
-
* can tell "this connection cannot do that" from "the call failed". */
|
|
107
|
-
export declare const noSpaceError = "NO_SPACE_ATTACHED";
|
|
108
|
-
export declare const unauthorizedSpaceMessage: string;
|
|
109
|
-
/** Raised when a space-dependent operation runs on a connection that resolves no spaceId. A type of its own so the
|
|
110
|
-
* host answers it as a STATE of the connection — a plain result the agent reads — instead of letting it surface as
|
|
111
|
-
* a failed call, which hosts render to the user as "cannot connect to this server". */
|
|
112
|
-
export declare class NoSpaceError extends Error {
|
|
113
|
-
constructor();
|
|
114
|
-
}
|
|
115
|
-
export declare const generateObjectId: () => string;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Env } from '../types';
|
|
2
|
-
export declare const guideUri = "plitzi://guide";
|
|
3
|
-
export declare const typesUri = "plitzi://types";
|
|
4
|
-
export declare const cssPropertiesUri = "plitzi://css-properties";
|
|
5
|
-
export declare const primerUri: (env: Env) => string;
|
|
6
|
-
export declare const pagesUri: (env: Env) => string;
|
|
7
|
-
export declare const pageUri: (env: Env, ref: string) => string;
|
|
8
|
-
export declare const pageStylesUri: (env: Env, ref: string) => string;
|
|
9
|
-
export declare const elementUri: (env: Env, ref: string) => string;
|
|
10
|
-
export declare const schemaVarsUri: (env: Env) => string;
|
|
11
|
-
export declare const settingsUri: (env: Env) => string;
|
|
12
|
-
export declare const interactionsUri: (env: Env) => string;
|
|
13
|
-
export declare const dataSourcesUri: (env: Env) => string;
|
|
14
|
-
export declare const foldersUri: (env: Env) => string;
|
|
15
|
-
export declare const folderUri: (env: Env, ref: string) => string;
|
|
16
|
-
export declare const defsUri: (env: Env) => string;
|
|
17
|
-
export declare const defUri: (env: Env, ref: string) => string;
|
|
18
|
-
export declare const globalsUri: (env: Env) => string;
|
|
19
|
-
export declare const globalUri: (env: Env, componentType: string) => string;
|
|
20
|
-
export declare const idsUri: (env: Env) => string;
|
|
21
|
-
export declare const idUri: (env: Env, targetId: string) => string;
|
|
22
|
-
export declare const styleVarsUri: (env: Env) => string;
|
|
23
|
-
export declare const styleVarUri: (env: Env, category: string) => string;
|
|
24
|
-
export declare const aliasedRoots: string[];
|
|
25
|
-
export declare const itemTemplates: (env: Env) => string[];
|
|
26
|
-
/** The remainder of `uri` after `prefix`, or undefined when it does not start with it — so a resolver matches a
|
|
27
|
-
* family and extracts its ref in one step, without repeating the prefix string for both the startsWith and slice. */
|
|
28
|
-
export declare const afterPrefix: (uri: string, prefix: string) => string | undefined;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { createMcpServer, handleMcp, serveMcp, readMcpBody } from './handler';
|
|
2
|
-
export { readResource, resourceVersion, registerResources, buildTypeRegistry, cssProperties } from './resources';
|
|
3
|
-
export { apply, validate, search, read, validateOperations, operation, tools } from './tools';
|
|
4
|
-
export { computeVersion, buildAgentGuide } from './helpers';
|
|
5
|
-
export { createHttpPreviewClient } from './previewClient';
|
|
6
|
-
export { createHttpScreenshotClient } from './screenshotClient';
|
|
7
|
-
export type { McpRequestOptions } from './handler';
|
|
8
|
-
export type { HttpPreviewClientConfig } from './previewClient';
|
|
9
|
-
export type { HttpScreenshotClientConfig } from './screenshotClient';
|
|
10
|
-
export type { McpServerContext } from './server';
|
|
11
|
-
export type { ApplyInput, WriteResponse, Persisters, SearchInput, ReadInput, ReadResponse, ValidateInput, Operation, ToolDef, ToolContext } from './tools';
|
|
12
|
-
export type { Space } from './helpers';
|
|
13
|
-
export type * from './types';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PreviewClient } from './types';
|
|
2
|
-
export type HttpPreviewClientConfig = {
|
|
3
|
-
/** Absolute URL of the SSR `/preview` endpoint. */
|
|
4
|
-
url: string;
|
|
5
|
-
/** Shared secret sent as `x-preview-secret`; must match the SSR server's `preview.secret`. */
|
|
6
|
-
secret?: string;
|
|
7
|
-
/** Injectable fetch (tests / non-global runtimes). Defaults to the global fetch. */
|
|
8
|
-
fetchImpl?: typeof fetch;
|
|
9
|
-
};
|
|
10
|
-
/** Default `PreviewClient`: POSTs the preview request to the SSR `/preview` endpoint over HTTP. Used when the
|
|
11
|
-
* MCP server is a separate process from the SSR renderer (the common case). A network/HTTP failure surfaces as
|
|
12
|
-
* an `ok:false` result rather than throwing, so the calling tool can degrade gracefully. */
|
|
13
|
-
export declare const createHttpPreviewClient: ({ url, secret, fetchImpl }: HttpPreviewClientConfig) => PreviewClient;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ResourceProxy, ResourceProxySettings } from './types';
|
|
2
|
-
import { SSRRequest, SSRServerConfig } from '@plitzi/sdk-shared';
|
|
3
|
-
export declare const PROXY_PATH = "/__proxy";
|
|
4
|
-
/** What this deployment serves at its widget endpoint, or undefined when it serves none. A secret is what turns it
|
|
5
|
-
* on: without one the endpoint could not tell its own widgets' URLs from anyone else's, and an unsigned fetcher
|
|
6
|
-
* on a public origin is an open proxy. */
|
|
7
|
-
export declare const proxySettings: (config: SSRServerConfig) => ResourceProxySettings | undefined;
|
|
8
|
-
/** The proxy a tool rewrites through. The grants it mints carry the fingerprint of THIS request's credential, so
|
|
9
|
-
* they belong to this connection. */
|
|
10
|
-
export declare const requestProxy: (config: SSRServerConfig, req: SSRRequest) => ResourceProxy | undefined;
|
|
11
|
-
/** The proxy the ENDPOINT itself mints with, while serving an API answer that carries URLs of its own. The request
|
|
12
|
-
* it is serving comes from a sandboxed iframe and presents no credential, so the connection is the one signed into
|
|
13
|
-
* the grant being served — the widget's own — rather than one read off a header. */
|
|
14
|
-
export declare const grantingProxy: (settings: ResourceProxySettings, req: SSRRequest, identity: string) => ResourceProxy | undefined;
|
|
15
|
-
/** The proxy THIS tool may use, or undefined — the single place that decides it, so a tool cannot reach the
|
|
16
|
-
* endpoint by being wired to it later. A render authors a throwaway widget, so rewriting its URLs is invisible
|
|
17
|
-
* and lasts as long as the widget does; a tool that WRITES a space (plitzi_apply) would persist those URLs into
|
|
18
|
-
* content the user owns, which is why it is not on the list unless a deployment puts it there deliberately. */
|
|
19
|
-
export declare const proxyForTool: (proxy: ResourceProxy | undefined, tool: string) => ResourceProxy | undefined;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ProxyKind } from './types';
|
|
2
|
-
export type FetchFailure = {
|
|
3
|
-
ok: false;
|
|
4
|
-
status: number;
|
|
5
|
-
reason: string;
|
|
6
|
-
};
|
|
7
|
-
export type FetchSuccess = {
|
|
8
|
-
ok: true;
|
|
9
|
-
contentType: string;
|
|
10
|
-
contentLength?: number;
|
|
11
|
-
body: Response['body'];
|
|
12
|
-
};
|
|
13
|
-
export type FetchResult = FetchFailure | FetchSuccess;
|
|
14
|
-
/** Fetch a remote resource on the widget's behalf. Redirects are followed by hand rather than by fetch, because
|
|
15
|
-
* each hop is a new host that has to pass the same guard — an allowed URL that redirects into the private network
|
|
16
|
-
* would otherwise walk straight through it. (It is also what makes the redirect-based image services work at
|
|
17
|
-
* all: the sandbox loses the redirect, this does not.) */
|
|
18
|
-
export declare const fetchResource: (target: string, kind: ProxyKind, maxBytes: number) => Promise<FetchResult>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ProxyKind, ResourceProxy } from './types';
|
|
2
|
-
/** What a widget was granted. The kind is signed in too, so a URL minted for an image cannot be replayed as an
|
|
3
|
-
* API call (they answer with different content types, cache rules and request headers). The connection comes back
|
|
4
|
-
* out because a data answer may carry URLs of its own, and the grants minted for those belong to the same one. */
|
|
5
|
-
export type Grant = {
|
|
6
|
-
kind: ProxyKind;
|
|
7
|
-
target: string;
|
|
8
|
-
identity: string;
|
|
9
|
-
};
|
|
10
|
-
/** Mint the URL a widget will load this target from: this server's endpoint, carrying the target, the kind it was
|
|
11
|
-
* granted for, when the grant stops working and which connection minted it — all covered by one signature. */
|
|
12
|
-
export declare const grantUrl: (target: string, proxy: ResourceProxy, kind?: ProxyKind) => string;
|
|
13
|
-
/** What this endpoint was asked to fetch, or undefined when the parameter is missing, malformed, expired or not
|
|
14
|
-
* signed here — which is what keeps it from being an open proxy for anyone who finds it: it serves the URLs this
|
|
15
|
-
* server rewrote, for as long as it said, and nothing else.
|
|
16
|
-
*
|
|
17
|
-
* Takes the parameter as the query parser hands it over — decoded exactly once, which is the form that was
|
|
18
|
-
* signed. Decoding it again would corrupt every target that legitimately carries a percent-escape (an API URL
|
|
19
|
-
* with a nested URL in its query) and reject it as unsigned. */
|
|
20
|
-
export declare const readGrant: (param: string | undefined, secret: string) => Grant | undefined;
|
|
21
|
-
export declare const PROXY_PARAM = "i";
|
|
22
|
-
/** Is this URL one the widget can already reach? Absolute http(s) URLs are the ones a sandbox CSP blocks;
|
|
23
|
-
* `data:`/`blob:` carry their own bytes, and a relative URL has no origin to reach in the first place. */
|
|
24
|
-
export declare const isRemote: (url: string) => boolean;
|
|
25
|
-
export declare const isGranted: (url: string, proxy: ResourceProxy) => boolean;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const isPrivateAddress: (address: string) => boolean;
|
|
2
|
-
/** Does this hostname resolve somewhere on the public internet? The endpoint fetches URLs an agent authored, so
|
|
3
|
-
* without this it would be a way to read whatever the pod itself can reach — the cluster's services, the cloud
|
|
4
|
-
* metadata endpoint, a database on the node. Both the literal address and every address the name resolves to are
|
|
5
|
-
* checked; a name that does not resolve is refused rather than handed to fetch. */
|
|
6
|
-
export declare const isPublicHost: (hostname: string) => Promise<boolean>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ResourceProxySettings } from './types';
|
|
2
|
-
import { SSRRequest, SSRResponseHelpers } from '@plitzi/sdk-shared';
|
|
3
|
-
/** Serve one external resource on behalf of a widget: check the grant this server signed, fetch the target, and
|
|
4
|
-
* stream it back under this origin — the one the CSP declares. Read-only, credential-free and CORS-open, because
|
|
5
|
-
* it answers the host's sandboxed iframe: a browser that has no origin of its own and can present nothing. The
|
|
6
|
-
* grant is what stands in for a caller identity — it is unforgeable, it names one target (or one host, for a
|
|
7
|
-
* templated API URL), it names the kind, it expires, and it carries the connection that minted it. */
|
|
8
|
-
export declare const handleProxyRequest: (req: SSRRequest, res: SSRResponseHelpers, settings: ResourceProxySettings) => Promise<void>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { grantingProxy, PROXY_PATH, proxyForTool, proxySettings, requestProxy } from './config';
|
|
2
|
-
export { grantUrl, isGranted, isRemote, PROXY_PARAM, readGrant } from './grant';
|
|
3
|
-
export { handleProxyRequest } from './handler';
|
|
4
|
-
export { rewritablePayload, rewritePayload } from './payload';
|
|
5
|
-
export { looksLikeAsset, proxifyResources, rewriteText } from './rewrite';
|
|
6
|
-
export { connectionId, sign, verify } from './sign';
|
|
7
|
-
export { DEFAULT_PROXY_TOOLS } from './types';
|
|
8
|
-
export type { ProxyKind, ResourceProxy, ResourceProxySettings } from './types';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ResourceProxy } from './types';
|
|
2
|
-
/** Is this what the endpoint fetched a body it can rewrite? Only JSON: it is what an apiContainer binds against,
|
|
3
|
-
* and re-serializing anything else would risk changing a document to fix a URL that may not even be loaded. */
|
|
4
|
-
export declare const rewritablePayload: (contentType: string) => boolean;
|
|
5
|
-
/** Rewrite the asset URLs an API answer carries so the widget loads them through this endpoint too. Returns the
|
|
6
|
-
* body untouched when it is not the JSON it claimed to be — the widget asked for that response, and serving it
|
|
7
|
-
* as it came is better than failing the fetch over a rewrite. */
|
|
8
|
-
export declare const rewritePayload: (body: string, proxy: ResourceProxy) => string;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ResourceProxy } from './types';
|
|
2
|
-
import { Schema, Style } from '@plitzi/sdk-shared';
|
|
3
|
-
/** Does this URL name a file the widget loads, judged by its path alone? Used where nothing else says what a URL is
|
|
4
|
-
* for — an interaction param, a field of an API answer — so the extension is the evidence and its absence is a
|
|
5
|
-
* reason to leave the URL alone. */
|
|
6
|
-
export declare const looksLikeAsset: (url: string) => boolean;
|
|
7
|
-
/** Rewrite every remote URL embedded in a string: `url(…)` in CSS, `src="…"` in markup, `` in markdown. */
|
|
8
|
-
export declare const rewriteText: (text: string, proxy: ResourceProxy) => string;
|
|
9
|
-
/** Point everything an authored widget loads from outside — images, media, fonts, the data an apiContainer fetches
|
|
10
|
-
* and the URLs its interactions swap in later — at this server's endpoint, in place. The AGENT never sees this: it
|
|
11
|
-
* authors the real URL and this runs
|
|
12
|
-
* afterwards, on the throwaway space a render builds (so nothing shared is mutated) and before the global style
|
|
13
|
-
* cache is compiled (so the concatenated CSS comes out already rewritten). Returns what could not be rewritten,
|
|
14
|
-
* which is the only part the model hears about. */
|
|
15
|
-
export declare const proxifyResources: (space: {
|
|
16
|
-
schema: Schema;
|
|
17
|
-
style: Style;
|
|
18
|
-
}, proxy: ResourceProxy) => string[];
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const sign: (payload: string, secret: string) => string;
|
|
2
|
-
export declare const verify: (payload: string, signature: string, secret: string) => boolean;
|
|
3
|
-
/** A short, stable fingerprint of the MCP credential a request carried — the connection a grant belongs to.
|
|
4
|
-
* Derived through the same secret, so it identifies without echoing any part of the token; a request with no
|
|
5
|
-
* credential (the public widgets surface) gets the shared anonymous identity. */
|
|
6
|
-
export declare const connectionId: (authorization: string | undefined, secret: string) => string;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/** What a widget is loading. Both ride the same endpoint but are not the same thing: an asset is immutable and
|
|
2
|
-
* cached hard, data is an API answer that must never be served stale, and each accepts its own content types. */
|
|
3
|
-
export type ProxyKind = 'asset' | 'data';
|
|
4
|
-
/** How a widget reaches ANYTHING outside its sandbox — an image, a font, a video, an API.
|
|
5
|
-
*
|
|
6
|
-
* An MCP App runs in an iframe on the HOST's origin under a CSP the host builds from the domains this server
|
|
7
|
-
* declares, and that declaration belongs to the `ui://` RESOURCE: it is read (and may be cached) before any
|
|
8
|
-
* widget exists, the spec types `csp` as `never` on the tool meta, and plitzi_render is stateless, so the origins
|
|
9
|
-
* an agent is about to author can never be listed there. The one origin that CAN be declared up front is this
|
|
10
|
-
* server's own, so every external URL a render authored is rewritten to point here and this server fetches the
|
|
11
|
-
* original — which also settles the redirects, hotlink rules and missing CORS headers a null-origin sandbox
|
|
12
|
-
* cannot. Nothing is stored: the URL carries its own signed grant, so any replica answers any request. */
|
|
13
|
-
export interface ResourceProxy {
|
|
14
|
-
/** Absolute endpoint the browser fetches from, e.g. `https://mcp.plitzi.app/__proxy`. */
|
|
15
|
-
endpoint: string;
|
|
16
|
-
/** Signs the grant, so the endpoint serves what this server rewrote and not whatever a caller asks for. */
|
|
17
|
-
secret: string;
|
|
18
|
-
/** Fingerprint of the MCP credential the render was called with (see `connectionId`). It is signed into every
|
|
19
|
-
* URL, so the grants one connection minted are distinct from another's and a widget's URLs cannot be pooled. */
|
|
20
|
-
identity: string;
|
|
21
|
-
/** How long a minted URL stays valid, in seconds. A widget outlives the call that made it (it sits in the
|
|
22
|
-
* conversation), so this is days rather than minutes — but not forever, so a leaked URL stops working. */
|
|
23
|
-
ttl: number;
|
|
24
|
-
/** The tools allowed to rewrite through this endpoint (see {@link DEFAULT_PROXY_TOOLS}). Carried here because
|
|
25
|
-
* the decision is made once, where each tool's context is built. */
|
|
26
|
-
tools: readonly string[];
|
|
27
|
-
}
|
|
28
|
-
/** The tools a proxy may be handed to. `plitzi_render` alone by default, and that default is a guard, not a
|
|
29
|
-
* convenience: a render is a THROWAWAY widget, so rewriting its URLs changes nothing that outlives the call —
|
|
30
|
-
* while plitzi_apply writes to the user's real space, where a rewritten URL would be PERSISTED and the space
|
|
31
|
-
* would come to depend on this server's endpoint for content it owns. Nothing else should be added here without
|
|
32
|
-
* that being the intention. */
|
|
33
|
-
export declare const DEFAULT_PROXY_TOOLS: string[];
|
|
34
|
-
/** The endpoint's own side of the same feature: where it answers and what it will carry. */
|
|
35
|
-
export interface ResourceProxySettings {
|
|
36
|
-
path: string;
|
|
37
|
-
secret: string;
|
|
38
|
-
maxBytes: number;
|
|
39
|
-
ttl: number;
|
|
40
|
-
/** Which tools rewrite their URLs through the endpoint (see {@link DEFAULT_PROXY_TOOLS}). */
|
|
41
|
-
tools: readonly string[];
|
|
42
|
-
/** Absolute base to build widget URLs from. Empty → the origin each request arrived on, which is right whenever
|
|
43
|
-
* the MCP server owns its sub-domain. */
|
|
44
|
-
baseUrl?: string;
|
|
45
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Env } from '../types';
|
|
2
|
-
export declare const canonicalUri: (env: Env, uri: string) => string;
|
|
3
|
-
/** Teachable message for a URI that read as null. Distinguishes a well-formed URI whose ref does not resolve (the
|
|
4
|
-
* resource may be stale/deleted) from a URI whose shape matches no template at all (malformed — echo the valid
|
|
5
|
-
* templates so the agent stops hand-building URIs). See RFC 0004 I2. */
|
|
6
|
-
export declare const resourceErrorMessage: (env: Env, uri: string) => string;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Space } from '../helpers';
|
|
2
|
-
import { ResourceEnvelope } from '../types';
|
|
3
|
-
/** Space-independent singletons: the usage guide, the observed type registry and the CSS property catalog.
|
|
4
|
-
* Returns undefined when the URI is not one of these, so the router falls through to the next resolver. */
|
|
5
|
-
export declare const readCoreResource: (space: Space, uri: string) => ResourceEnvelope<unknown> | undefined;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ResourceEnvelope } from '../types';
|
|
2
|
-
/** Wrap any read projection with the version its optimistic-concurrency checks key on. */
|
|
3
|
-
export declare const envelope: <T>(data: T) => ResourceEnvelope<T>;
|
|
4
|
-
export declare const jsonContents: (uri: string, data: unknown) => {
|
|
5
|
-
contents: {
|
|
6
|
-
uri: string;
|
|
7
|
-
mimeType: string;
|
|
8
|
-
text: string;
|
|
9
|
-
}[];
|
|
10
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { readPublicResource, readResource, resourceVersion } from './router';
|
|
2
|
-
export { registerResources } from './register';
|
|
3
|
-
export { resourceErrorMessage } from './canonical';
|
|
4
|
-
export { RENDER_GUIDE_URI, RENDER_TYPES_URI } from './renderGuide';
|
|
5
|
-
export { buildTypeRegistry, cssProperties, cssShorthands, expandShorthand, isCssProperty, suggestCssProperty } from '../catalogs';
|
|
6
|
-
export type { TypeInfo, TypePropInfo, TypeRegistry } from '../catalogs';
|
|
7
|
-
export * from '../tools/operations/schema/translator';
|
|
8
|
-
export * from '../tools/operations/style/translator';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Space } from '../helpers';
|
|
2
|
-
import { Env, ResourceEnvelope } from '../types';
|
|
3
|
-
/** The cold-start bundle: everything the guide says to read before the first write, in one round-trip.
|
|
4
|
-
* Summaries only — never full page/element trees (those are opened on demand), so it stays cheap even on a
|
|
5
|
-
* large space. Carries the condensed `guideQuickstart` (not the full guideText, which the agent reads on demand at
|
|
6
|
-
* plitzi://guide) to keep the bundle small. Returns undefined when the URI is not the primer. */
|
|
7
|
-
export declare const readPrimerResource: (space: Space, env: Env, uri: string) => ResourceEnvelope<unknown> | undefined;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { McpLog, Space } from '../helpers';
|
|
2
|
-
import { Env } from '../types';
|
|
3
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
-
/** Register every resource on the MCP server: fixed listings plus templated per-item reads. The space is
|
|
5
|
-
* loaded lazily via getSpace, so listing resources never touches the store — only reading one does.
|
|
6
|
-
*
|
|
7
|
-
* `hasSpace` is false when the connection reaches no space (a guest / widgets-only grant): the space-dependent
|
|
8
|
-
* families are then not registered at all, so the catalog the agent browses holds only what it can actually
|
|
9
|
-
* open — no listing that answers every read with the same refusal. */
|
|
10
|
-
export declare const registerResources: (server: McpServer, getSpace: () => Promise<Space>, env: Env, log: McpLog, hasSpace: boolean) => void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { McpLog } from '../helpers';
|
|
2
|
-
import { ResourceEnvelope } from '../types';
|
|
3
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
-
export declare const RENDER_GUIDE_URI = "plitzi://render/guide";
|
|
5
|
-
export declare const RENDER_TYPES_URI = "plitzi://render/types";
|
|
6
|
-
/** The same two documents through the READ path (the router, hence plitzi_read), not only as MCP resources: an
|
|
7
|
-
* agent that reaches for the batch-read tool — the reflex the guide itself teaches — must not be told its own
|
|
8
|
-
* authoring guide does not exist. Space-independent, like the core singletons. */
|
|
9
|
-
export declare const readRenderResource: (uri: string) => ResourceEnvelope<unknown> | undefined;
|
|
10
|
-
export declare const registerRenderResources: (server: McpServer, log: McpLog) => void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Space } from '../helpers';
|
|
2
|
-
import { Env, ResourceEnvelope } from '../types';
|
|
3
|
-
/** Resolve a resource URI to its versioned envelope, or null if unknown / not found. */
|
|
4
|
-
export declare const readResource: (space: Space, env: Env, rawUri: string) => ResourceEnvelope<unknown> | null;
|
|
5
|
-
/** What a connection carrying NO space (a guest / widgets-only grant) can still read: the space-independent
|
|
6
|
-
* singletons and the render docs. Undefined for everything else, so the caller says the connection has no space
|
|
7
|
-
* instead of answering out of an empty one — an empty page list would read as "this space has no pages". */
|
|
8
|
-
export declare const readPublicResource: (env: Env, rawUri: string) => ResourceEnvelope<unknown> | undefined;
|
|
9
|
-
/** Current version of a resource, for optimistic-concurrency checks. Null when the URI is unknown. */
|
|
10
|
-
export declare const resourceVersion: (space: Space, env: Env, uri: string) => string | null;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Space } from '../helpers';
|
|
2
|
-
import { Env, ResourceEnvelope } from '../types';
|
|
3
|
-
/** Element-schema reads: page listings/skeletons/styles, folders, single elements and schema variables. Returns
|
|
4
|
-
* undefined when the URI belongs to another domain, null when the shape is ours but the ref does not resolve. */
|
|
5
|
-
export declare const readSchemaResource: (space: Space, env: Env, uri: string) => ResourceEnvelope<unknown> | null | undefined;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Space } from '../helpers';
|
|
2
|
-
import { Env, ResourceEnvelope } from '../types';
|
|
3
|
-
/** Style-schema reads: definitions, global (per-type) styles and design-token variables by category. Returns
|
|
4
|
-
* undefined when the URI belongs to another domain, null when the shape is ours but the ref does not resolve. */
|
|
5
|
-
export declare const readStyleResource: (space: Space, env: Env, uri: string) => ResourceEnvelope<unknown> | null | undefined;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ScreenshotClient } from './types';
|
|
2
|
-
export type HttpScreenshotClientConfig = {
|
|
3
|
-
/** Browser service that turns a URL into PNG(s): POST { url, viewports } → { images }. */
|
|
4
|
-
serviceUrl: string;
|
|
5
|
-
/** SSR base the browser navigates to; the page path and the one-shot `__pt` token are appended. */
|
|
6
|
-
renderBaseUrl: string;
|
|
7
|
-
/** Injectable fetch (tests / non-global runtimes). Defaults to the global fetch. */
|
|
8
|
-
fetchImpl?: typeof fetch;
|
|
9
|
-
};
|
|
10
|
-
/** Default `ScreenshotClient`: composes the navigable preview URL (renderBaseUrl + pagePath + `?__pt=token`) and
|
|
11
|
-
* POSTs it to the browser service. Any network/HTTP failure surfaces as `ok:false` so the tool can fall back to
|
|
12
|
-
* the HTML preview instead of hard-failing. */
|
|
13
|
-
export declare const createHttpScreenshotClient: ({ serviceUrl, renderBaseUrl, fetchImpl }: HttpScreenshotClientConfig) => ScreenshotClient;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { ResourceProxy } from './proxy';
|
|
3
|
-
import { PreviewClient, ScreenshotClient } from './types';
|
|
4
|
-
import { SSRAdapters, ServerLogger } from '@plitzi/sdk-shared';
|
|
5
|
-
/** The MCP service is stateless: every request resolves its own `spaceId` (from the request JWT) and reads the
|
|
6
|
-
* space fresh through the adapters — schema and style are two documents, read/written independently. The spaceId
|
|
7
|
-
* is resolved once per request, up front, because it decides what this connection IS: with a space, the full
|
|
8
|
-
* editing server; without one (no auth, a guest connection, a widgets-only grant), a widget server that offers
|
|
9
|
-
* only what works there. The space documents themselves still load lazily — the handshake and the listings never
|
|
10
|
-
* touch the store. */
|
|
11
|
-
export interface McpServerContext {
|
|
12
|
-
adapters: SSRAdapters;
|
|
13
|
-
getSpaceId: () => Promise<number | undefined>;
|
|
14
|
-
/** How the visual-preview tools (plitzi_preview / plitzi_screenshot) reach the renderer. Absent → those tools
|
|
15
|
-
* report PREVIEW_UNAVAILABLE, so an MCP-only deployment without a renderer still runs every other tool. */
|
|
16
|
-
preview?: PreviewClient;
|
|
17
|
-
/** The dedicated browser service for plitzi_screenshot. Absent → the tool is not registered (only the HTML
|
|
18
|
-
* plitzi_preview is offered). */
|
|
19
|
-
screenshot?: ScreenshotClient;
|
|
20
|
-
/** Structured request-log sink. When set, every tool call and resource read emits an McpLogEvent to it (the
|
|
21
|
-
* consumer renders them); otherwise logging falls back to the console when MCP_DEBUG=1. */
|
|
22
|
-
logger?: ServerLogger;
|
|
23
|
-
/** May the plitzi_render view paint from tool arguments the host is still streaming (see `mcpAi.renderStreaming`)?
|
|
24
|
-
* Defaults to true. */
|
|
25
|
-
renderStreaming?: boolean;
|
|
26
|
-
/** Where a rendered widget loads everything external from (see `mcpAi.proxy`). It reaches two places: the render
|
|
27
|
-
* tool, which rewrites the URLs the agent authored, and the App's CSP, which declares the origin those URLs
|
|
28
|
-
* point at. Absent → neither happens, and a widget's resources load only where the host allows their origin. */
|
|
29
|
-
proxy?: ResourceProxy;
|
|
30
|
-
}
|
|
31
|
-
export declare const createMcpServer: ({ adapters, getSpaceId, preview, screenshot, logger, renderStreaming, proxy }: McpServerContext) => Promise<McpServer>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Space } from '../helpers';
|
|
2
|
-
import { Operation } from '../tools';
|
|
3
|
-
import { Persisters } from '../types';
|
|
4
|
-
declare const buildSpace: () => Space;
|
|
5
|
-
declare const capturing: (space: Space) => {
|
|
6
|
-
persisters: Persisters;
|
|
7
|
-
saved: () => Space;
|
|
8
|
-
};
|
|
9
|
-
declare const spaceWithRoute: () => Space;
|
|
10
|
-
declare const varOp: (pageRef: string, type: string, value: string) => Operation;
|
|
11
|
-
declare const scopeSpace: () => Space;
|
|
12
|
-
declare const malformedSpace: () => Space;
|
|
13
|
-
export { buildSpace, capturing, spaceWithRoute, varOp, scopeSpace, malformedSpace };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Space } from '../../helpers';
|
|
2
|
-
import { Env, MutationOutcome } from '../../types';
|
|
3
|
-
import { Operation } from '../operations';
|
|
4
|
-
/** Apply operations in order to the space (mutating it). Records which schema(s) changed so the caller can
|
|
5
|
-
* persist each independently. Stops collecting counts for a failed op but records its errors. */
|
|
6
|
-
export declare const applyOperations: (space: Space, env: Env, ops: Operation[]) => MutationOutcome;
|