@plitzi/sdk-server 0.32.4 → 0.32.6
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 +19 -0
- package/dist/adapters/jsonAdapters.js +6 -1
- package/dist/core/createServer.js +8 -44
- package/dist/core/health.js +15 -0
- package/dist/core/http/dispatcher.js +29 -0
- package/dist/core/http/securityHeaders.js +15 -0
- package/dist/core/http/stages/authRoutes.js +41 -0
- package/dist/core/http/stages/health.js +12 -0
- package/dist/core/http/stages/middlewares.js +16 -0
- package/dist/core/http/stages/pluginAssets.js +20 -0
- package/dist/core/http/stages/static.js +30 -0
- package/dist/core/server/baseServer.js +29 -0
- package/dist/core/server/mcpServer.js +29 -0
- package/dist/core/server/ssrServer.js +54 -0
- package/dist/core/services/mcp.js +22 -0
- package/dist/core/services/preview.js +37 -0
- package/dist/core/services/registry.js +30 -0
- package/dist/core/services/resolve.js +12 -0
- package/dist/core/services/rsc.js +11 -0
- package/dist/core/services/ssr.js +13 -0
- package/dist/core/transports.js +9 -9
- package/dist/helpers/buildServerInfo.js +3 -9
- package/dist/index.js +20 -6
- package/dist/modules/ai/AIEngine.js +4 -4
- package/dist/modules/ai/toolkit.js +58 -0
- package/dist/modules/mcp/catalogs/builtinCallbacks.js +204 -0
- package/dist/modules/mcp/catalogs/builtinComponents.js +170 -0
- package/dist/modules/mcp/catalogs/builtinElementCallbacks.js +50 -0
- package/dist/modules/mcp/catalogs/builtinTransformers.js +148 -0
- package/dist/modules/mcp/catalogs/builtinUtilities.js +90 -0
- package/dist/modules/mcp/catalogs/cssCatalog.js +205 -0
- package/dist/modules/mcp/catalogs/observed.js +90 -0
- package/dist/modules/mcp/catalogs/paramSpec.js +69 -0
- package/dist/modules/mcp/catalogs/registry.js +89 -0
- package/dist/modules/mcp/constants.js +4 -0
- package/dist/modules/mcp/handler.js +24 -20
- package/dist/modules/mcp/helpers/agentPrompt.js +104 -0
- package/dist/modules/mcp/helpers/computeVersion.js +16 -0
- package/dist/modules/mcp/helpers/guide.js +449 -0
- package/dist/modules/mcp/helpers/interactions.js +123 -0
- package/dist/modules/mcp/helpers/log.js +54 -0
- package/dist/modules/mcp/helpers/opResult.js +18 -0
- package/dist/modules/mcp/helpers/space.js +262 -0
- package/dist/modules/mcp/helpers/uris.js +44 -0
- package/dist/modules/mcp/previewClient.js +31 -0
- package/dist/modules/mcp/resources/canonical.js +30 -0
- package/dist/modules/mcp/resources/core.js +15 -0
- package/dist/modules/mcp/resources/envelope.js +14 -0
- package/dist/modules/mcp/resources/primer.js +30 -0
- package/dist/modules/mcp/resources/register.js +174 -0
- package/dist/modules/mcp/resources/router.js +25 -0
- package/dist/modules/mcp/resources/schema.js +43 -0
- package/dist/modules/mcp/resources/style.js +34 -0
- package/dist/modules/mcp/screenshotClient.js +47 -0
- package/dist/modules/mcp/server.js +66 -20
- package/dist/modules/mcp/tools/apply/dispatch.js +103 -0
- package/dist/modules/mcp/tools/apply/index.js +136 -0
- package/dist/modules/mcp/tools/apply/writeResult.js +37 -0
- package/dist/modules/mcp/tools/index.js +20 -148
- package/dist/modules/mcp/tools/operations/index.js +41 -0
- package/dist/modules/mcp/tools/operations/schema/bindings/deleteBinding.js +32 -0
- package/dist/modules/mcp/tools/operations/schema/bindings/patchBinding.js +36 -0
- package/dist/modules/mcp/tools/operations/schema/bindings/upsertBinding.js +47 -0
- package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.js +29 -0
- package/dist/modules/mcp/tools/operations/schema/elements/moveElement.js +41 -0
- package/dist/modules/mcp/tools/operations/schema/elements/patchElement.js +58 -0
- package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.js +65 -0
- package/dist/modules/mcp/tools/operations/schema/folders/deleteFolder.js +30 -0
- package/dist/modules/mcp/tools/operations/schema/folders/upsertFolder.js +49 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/deleteInteraction.js +52 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.js +47 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.js +43 -0
- package/dist/modules/mcp/tools/operations/schema/operations.js +39 -0
- package/dist/modules/mcp/tools/operations/schema/pages/deletePage.js +25 -0
- package/dist/modules/mcp/tools/operations/schema/pages/upsertPage.js +75 -0
- package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.js +45 -0
- package/dist/modules/mcp/tools/operations/schema/shared.js +119 -0
- package/dist/modules/mcp/tools/operations/schema/translator.js +215 -0
- package/dist/modules/mcp/tools/operations/schema/variables/deleteVariable.js +18 -0
- package/dist/modules/mcp/tools/operations/schema/variables/upsertVariable.js +42 -0
- package/dist/modules/mcp/tools/operations/schema/write.js +109 -0
- package/dist/modules/mcp/tools/operations/style/definitions/deleteDefinition.js +21 -0
- package/dist/modules/mcp/tools/operations/style/definitions/patchDefinition.js +28 -0
- package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinition.js +24 -0
- package/dist/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.js +21 -0
- package/dist/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.js +28 -0
- package/dist/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.js +24 -0
- package/dist/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.js +21 -0
- package/dist/modules/mcp/tools/operations/style/idStyles/patchIdStyle.js +28 -0
- package/dist/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.js +24 -0
- package/dist/modules/mcp/tools/operations/style/operations.js +27 -0
- package/dist/modules/mcp/tools/operations/style/shared.js +59 -0
- package/dist/modules/mcp/tools/operations/style/translator.js +101 -0
- package/dist/modules/mcp/tools/operations/style/variables/deleteStyleVariable.js +21 -0
- package/dist/modules/mcp/tools/operations/style/variables/upsertStyleVariable.js +22 -0
- package/dist/modules/mcp/tools/operations/style/write.js +108 -0
- package/dist/modules/mcp/tools/preview.js +37 -0
- package/dist/modules/mcp/tools/read.js +33 -0
- package/dist/modules/mcp/tools/screenshot.js +83 -0
- package/dist/modules/mcp/tools/search.js +115 -0
- package/dist/modules/mcp/tools/shared/tool.js +26 -0
- package/dist/modules/mcp/tools/shared/validator/audit.js +124 -0
- package/dist/modules/mcp/tools/shared/validator/batch.js +30 -0
- package/dist/modules/mcp/tools/shared/validator/bindings.js +70 -0
- package/dist/modules/mcp/tools/shared/validator/context.js +35 -0
- package/dist/modules/mcp/tools/shared/validator/css.js +47 -0
- package/dist/modules/mcp/tools/shared/validator/elements.js +55 -0
- package/dist/modules/mcp/tools/shared/validator/index.js +226 -0
- package/dist/modules/mcp/tools/shared/validator/interactions.js +106 -0
- package/dist/modules/mcp/tools/shared/validator/refs.js +28 -0
- package/dist/modules/mcp/tools/validate.js +39 -0
- package/dist/modules/ssr/buildBody.js +2 -2
- package/dist/modules/ssr/handler.js +6 -4
- package/dist/modules/ssr/prepareRender.js +5 -5
- package/dist/modules/ssr/preview.js +106 -0
- package/dist/modules/ssr/registerExternalPlugins.js +1 -1
- package/dist/modules/ssr/streamBody.js +3 -3
- package/dist/modules/ssr/template.js +1 -1
- package/dist/modules/ssr/views/template.ejs +2 -0
- package/dist/plugins/compile.js +1 -1
- package/dist/plugins/copy.js +1 -1
- package/dist/plugins/manager.js +1 -1
- package/dist/server.js +34 -9
- package/dist/src/core/createServer.d.ts +5 -1
- package/dist/src/core/health.d.ts +10 -0
- package/dist/src/core/http/dispatcher.d.ts +7 -0
- package/dist/src/core/http/securityHeaders.d.ts +2 -0
- package/dist/src/core/http/stages/authRoutes.d.ts +4 -0
- package/dist/src/core/http/stages/health.d.ts +2 -0
- package/dist/src/core/http/stages/middlewares.d.ts +2 -0
- package/dist/src/core/http/stages/pluginAssets.d.ts +2 -0
- package/dist/src/core/http/stages/static.d.ts +5 -0
- package/dist/src/core/http/types.d.ts +19 -0
- package/dist/src/core/server/baseServer.d.ts +9 -0
- package/dist/src/core/server/mcpServer.d.ts +2 -0
- package/dist/src/core/server/ssrServer.d.ts +2 -0
- package/dist/src/core/services/mcp.d.ts +3 -0
- package/dist/src/core/services/preview.d.ts +2 -0
- package/dist/src/core/services/registry.d.ts +4 -0
- package/dist/src/core/services/resolve.d.ts +3 -0
- package/dist/src/core/services/rsc.d.ts +2 -0
- package/dist/src/core/services/ssr.d.ts +3 -0
- package/dist/src/core/transports.d.ts +2 -2
- package/dist/src/index.d.ts +12 -3
- package/dist/src/modules/ai/index.d.ts +1 -0
- package/dist/src/modules/ai/toolkit.d.ts +17 -0
- package/dist/src/modules/mcp/catalogs/builtinCallbacks.d.ts +23 -0
- package/dist/src/modules/mcp/catalogs/builtinComponents.d.ts +4 -0
- package/dist/src/modules/mcp/catalogs/builtinElementCallbacks.d.ts +20 -0
- package/dist/src/modules/mcp/catalogs/builtinTransformers.d.ts +28 -0
- package/dist/src/modules/mcp/catalogs/builtinUtilities.d.ts +18 -0
- package/dist/src/modules/mcp/catalogs/cssCatalog.d.ts +14 -0
- package/dist/src/modules/mcp/catalogs/index.d.ts +9 -0
- package/dist/src/modules/mcp/catalogs/observed.d.ts +48 -0
- package/dist/src/modules/mcp/catalogs/paramSpec.d.ts +42 -0
- package/dist/src/modules/mcp/catalogs/registry.d.ts +35 -0
- package/dist/src/modules/mcp/constants.d.ts +1 -0
- package/dist/src/modules/mcp/handler.d.ts +6 -3
- package/dist/src/modules/mcp/helpers/agentPrompt.d.ts +4 -0
- package/dist/src/modules/mcp/helpers/computeVersion.d.ts +1 -0
- package/dist/src/modules/mcp/helpers/guide.d.ts +3 -0
- package/dist/src/modules/mcp/helpers/index.d.ts +8 -0
- package/dist/src/modules/mcp/helpers/interactions.d.ts +30 -0
- package/dist/src/modules/mcp/helpers/log.d.ts +8 -0
- package/dist/src/modules/mcp/helpers/opResult.d.ts +13 -0
- package/dist/src/modules/mcp/helpers/space.d.ts +105 -0
- package/dist/src/modules/mcp/helpers/uris.d.ts +28 -0
- package/dist/src/modules/mcp/index.d.ts +12 -5
- package/dist/src/modules/mcp/previewClient.d.ts +13 -0
- package/dist/src/modules/mcp/resources/canonical.d.ts +6 -0
- package/dist/src/modules/mcp/resources/core.d.ts +5 -0
- package/dist/src/modules/mcp/resources/envelope.d.ts +10 -0
- package/dist/src/modules/mcp/resources/index.d.ts +7 -10
- package/dist/src/modules/mcp/resources/primer.d.ts +7 -0
- package/dist/src/modules/mcp/resources/register.d.ts +6 -0
- package/dist/src/modules/mcp/resources/router.d.ts +6 -0
- package/dist/src/modules/mcp/resources/schema.d.ts +5 -0
- package/dist/src/modules/mcp/resources/style.d.ts +5 -0
- package/dist/src/modules/mcp/screenshotClient.d.ts +13 -0
- package/dist/src/modules/mcp/server.d.ts +21 -3
- package/dist/src/modules/mcp/tools/apply/dispatch.d.ts +6 -0
- package/dist/src/modules/mcp/tools/apply/index.d.ts +420 -0
- package/dist/src/modules/mcp/tools/apply/writeResult.d.ts +8 -0
- package/dist/src/modules/mcp/tools/index.d.ts +17 -6
- package/dist/src/modules/mcp/tools/operations/index.d.ts +828 -0
- package/dist/src/modules/mcp/tools/operations/schema/bindings/deleteBinding.d.ts +17 -0
- package/dist/src/modules/mcp/tools/operations/schema/bindings/patchBinding.d.ts +25 -0
- package/dist/src/modules/mcp/tools/operations/schema/bindings/upsertBinding.d.ts +27 -0
- package/dist/src/modules/mcp/tools/operations/schema/elements/deleteElement.d.ts +10 -0
- package/dist/src/modules/mcp/tools/operations/schema/elements/moveElement.d.ts +16 -0
- package/dist/src/modules/mcp/tools/operations/schema/elements/patchElement.d.ts +22 -0
- package/dist/src/modules/mcp/tools/operations/schema/elements/upsertElement.d.ts +16 -0
- package/dist/src/modules/mcp/tools/operations/schema/folders/deleteFolder.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/schema/folders/upsertFolder.d.ts +12 -0
- package/dist/src/modules/mcp/tools/operations/schema/index.d.ts +20 -0
- package/dist/src/modules/mcp/tools/operations/schema/interactions/deleteInteraction.d.ts +12 -0
- package/dist/src/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.d.ts +18 -0
- package/dist/src/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.d.ts +27 -0
- package/dist/src/modules/mcp/tools/operations/schema/operations.d.ts +210 -0
- package/dist/src/modules/mcp/tools/operations/schema/pages/deletePage.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/schema/pages/upsertPage.d.ts +14 -0
- package/dist/src/modules/mcp/tools/operations/schema/settings/patchSettings.d.ts +34 -0
- package/dist/src/modules/mcp/tools/operations/schema/shared.d.ts +77 -0
- package/dist/src/modules/mcp/tools/operations/schema/translator.d.ts +12 -0
- package/dist/src/modules/mcp/tools/operations/schema/variables/deleteVariable.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/schema/variables/upsertVariable.d.ts +16 -0
- package/dist/src/modules/mcp/tools/operations/schema/write.d.ts +42 -0
- package/dist/src/modules/mcp/tools/operations/style/definitions/deleteDefinition.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/style/definitions/patchDefinition.d.ts +37 -0
- package/dist/src/modules/mcp/tools/operations/style/definitions/upsertDefinition.d.ts +37 -0
- package/dist/src/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.d.ts +37 -0
- package/dist/src/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.d.ts +37 -0
- package/dist/src/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/style/idStyles/patchIdStyle.d.ts +37 -0
- package/dist/src/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.d.ts +37 -0
- package/dist/src/modules/mcp/tools/operations/style/index.d.ts +14 -0
- package/dist/src/modules/mcp/tools/operations/style/operations.d.ts +231 -0
- package/dist/src/modules/mcp/tools/operations/style/shared.d.ts +115 -0
- package/dist/src/modules/mcp/tools/operations/style/translator.d.ts +12 -0
- package/dist/src/modules/mcp/tools/operations/style/variables/deleteStyleVariable.d.ts +15 -0
- package/dist/src/modules/mcp/tools/operations/style/variables/upsertStyleVariable.d.ts +20 -0
- package/dist/src/modules/mcp/tools/operations/style/write.d.ts +12 -0
- package/dist/src/modules/mcp/tools/preview.d.ts +415 -0
- package/dist/src/modules/mcp/tools/read.d.ts +8 -0
- package/dist/src/modules/mcp/tools/screenshot.d.ts +420 -0
- package/dist/src/modules/mcp/tools/search.d.ts +15 -0
- package/dist/src/modules/mcp/tools/shared/tool.d.ts +50 -0
- package/dist/src/modules/mcp/tools/shared/validator/audit.d.ts +4 -0
- package/dist/src/modules/mcp/tools/shared/validator/batch.d.ts +5 -0
- package/dist/src/modules/mcp/tools/shared/validator/bindings.d.ts +6 -0
- package/dist/src/modules/mcp/tools/shared/validator/context.d.ts +34 -0
- package/dist/src/modules/mcp/tools/shared/validator/css.d.ts +4 -0
- package/dist/src/modules/mcp/tools/shared/validator/elements.d.ts +6 -0
- package/dist/src/modules/mcp/tools/shared/validator/index.d.ts +8 -0
- package/dist/src/modules/mcp/tools/shared/validator/interactions.d.ts +3 -0
- package/dist/src/modules/mcp/tools/shared/validator/refs.d.ts +4 -0
- package/dist/src/modules/mcp/tools/validate.d.ts +417 -0
- package/dist/src/modules/mcp/types/aiSchema.d.ts +218 -0
- package/dist/src/modules/mcp/types/index.d.ts +4 -0
- package/dist/src/modules/mcp/types/previewTypes.d.ts +25 -0
- package/dist/src/modules/mcp/types/screenshotTypes.d.ts +29 -0
- package/dist/src/modules/mcp/types/toolTypes.d.ts +138 -0
- package/dist/src/modules/ssr/buildBody.d.ts +2 -2
- package/dist/src/modules/ssr/prepareRender.d.ts +2 -2
- package/dist/src/modules/ssr/preview.d.ts +16 -0
- package/dist/src/modules/ssr/streamBody.d.ts +2 -2
- package/package.json +16 -14
- package/dist/_virtual/_rolldown/runtime.js +0 -13
- package/dist/core/requestHandler.js +0 -126
- package/dist/modules/mcp/helpers.js +0 -75
- package/dist/modules/mcp/resources/glossary/binding.js +0 -73
- package/dist/modules/mcp/resources/glossary/collection.js +0 -76
- package/dist/modules/mcp/resources/glossary/displayMode.js +0 -50
- package/dist/modules/mcp/resources/glossary/element.js +0 -68
- package/dist/modules/mcp/resources/glossary/environment.js +0 -48
- package/dist/modules/mcp/resources/glossary/interaction.js +0 -62
- package/dist/modules/mcp/resources/glossary/page.js +0 -70
- package/dist/modules/mcp/resources/glossary/plugin.js +0 -96
- package/dist/modules/mcp/resources/glossary/resource.js +0 -75
- package/dist/modules/mcp/resources/glossary/schema.js +0 -69
- package/dist/modules/mcp/resources/glossary/schemaVariable.js +0 -60
- package/dist/modules/mcp/resources/glossary/segment.js +0 -59
- package/dist/modules/mcp/resources/glossary/space.js +0 -73
- package/dist/modules/mcp/resources/glossary/style.js +0 -81
- package/dist/modules/mcp/resources/glossary/styleSelector.js +0 -77
- package/dist/modules/mcp/resources/glossary/styleVariable.js +0 -72
- package/dist/modules/mcp/resources/index.js +0 -71
- package/dist/modules/mcp/resources/workflows/data.js +0 -49
- package/dist/modules/mcp/resources/workflows/elements.js +0 -53
- package/dist/modules/mcp/resources/workflows/segments.js +0 -55
- package/dist/modules/mcp/resources/workflows/styles.js +0 -91
- package/dist/modules/mcp/tools/collections/createCollection.js +0 -25
- package/dist/modules/mcp/tools/collections/createCollectionRecord.js +0 -27
- package/dist/modules/mcp/tools/collections/deleteCollection.js +0 -16
- package/dist/modules/mcp/tools/collections/deleteCollectionRecord.js +0 -16
- package/dist/modules/mcp/tools/collections/getCollection.js +0 -21
- package/dist/modules/mcp/tools/collections/getCollectionRecord.js +0 -25
- package/dist/modules/mcp/tools/collections/getCollectionRecords.js +0 -29
- package/dist/modules/mcp/tools/collections/getCollections.js +0 -19
- package/dist/modules/mcp/tools/collections/updateCollection.js +0 -28
- package/dist/modules/mcp/tools/collections/updateCollectionRecord.js +0 -31
- package/dist/modules/mcp/tools/docs/listResources.js +0 -16
- package/dist/modules/mcp/tools/docs/readResource.js +0 -23
- package/dist/modules/mcp/tools/plugins/addPlugin.js +0 -24
- package/dist/modules/mcp/tools/plugins/listPlugins.js +0 -20
- package/dist/modules/mcp/tools/plugins/removePlugin.js +0 -16
- package/dist/modules/mcp/tools/plugins/updatePlugin.js +0 -23
- package/dist/modules/mcp/tools/resources/addResource.js +0 -33
- package/dist/modules/mcp/tools/resources/getResource.js +0 -29
- package/dist/modules/mcp/tools/resources/getResources.js +0 -27
- package/dist/modules/mcp/tools/resources/moveResource.js +0 -30
- package/dist/modules/mcp/tools/resources/removeResource.js +0 -19
- package/dist/modules/mcp/tools/segment/createSegment.js +0 -27
- package/dist/modules/mcp/tools/segment/deleteSegment.js +0 -16
- package/dist/modules/mcp/tools/segment/getSegment.js +0 -19
- package/dist/modules/mcp/tools/segment/getSegments.js +0 -27
- package/dist/modules/mcp/tools/segment/schema/elements/createSegmentElement.js +0 -24
- package/dist/modules/mcp/tools/segment/schema/elements/deleteSegmentElement.js +0 -19
- package/dist/modules/mcp/tools/segment/schema/elements/moveSegmentElement.js +0 -28
- package/dist/modules/mcp/tools/segment/schema/elements/updateSegmentElement.js +0 -23
- package/dist/modules/mcp/tools/segment/schema/variables/createSegmentVariable.js +0 -41
- package/dist/modules/mcp/tools/segment/schema/variables/deleteSegmentVariable.js +0 -19
- package/dist/modules/mcp/tools/segment/schema/variables/updateSegmentVariable.js +0 -41
- package/dist/modules/mcp/tools/segment/style/variables/createSegmentStyleVariable.js +0 -34
- package/dist/modules/mcp/tools/segment/style/variables/deleteSegmentStyleVariable.js +0 -21
- package/dist/modules/mcp/tools/segment/style/variables/updateSegmentStyleVariable.js +0 -34
- package/dist/modules/mcp/tools/segment/updateSegment.js +0 -30
- package/dist/modules/mcp/tools/space/schema/applyPreview.js +0 -33
- package/dist/modules/mcp/tools/space/schema/elements/cloneElement.js +0 -34
- package/dist/modules/mcp/tools/space/schema/elements/createElement.js +0 -50
- package/dist/modules/mcp/tools/space/schema/elements/deleteElement.js +0 -16
- package/dist/modules/mcp/tools/space/schema/elements/getElement.js +0 -17
- package/dist/modules/mcp/tools/space/schema/elements/getElements.js +0 -21
- package/dist/modules/mcp/tools/space/schema/elements/listElements.js +0 -28
- package/dist/modules/mcp/tools/space/schema/elements/moveElement.js +0 -27
- package/dist/modules/mcp/tools/space/schema/elements/updateElement.js +0 -49
- package/dist/modules/mcp/tools/space/schema/getSpaceSettings.js +0 -46
- package/dist/modules/mcp/tools/space/schema/pageFolders/createPageFolder.js +0 -24
- package/dist/modules/mcp/tools/space/schema/pageFolders/deletePageFolder.js +0 -16
- package/dist/modules/mcp/tools/space/schema/pageFolders/getPageFolder.js +0 -17
- package/dist/modules/mcp/tools/space/schema/pageFolders/getPageFolders.js +0 -17
- package/dist/modules/mcp/tools/space/schema/pageFolders/updatePageFolder.js +0 -28
- package/dist/modules/mcp/tools/space/schema/pages/createPage.js +0 -37
- package/dist/modules/mcp/tools/space/schema/pages/deletePage.js +0 -16
- package/dist/modules/mcp/tools/space/schema/pages/getPage.js +0 -28
- package/dist/modules/mcp/tools/space/schema/pages/getPageBySlug.js +0 -17
- package/dist/modules/mcp/tools/space/schema/pages/getPages.js +0 -17
- package/dist/modules/mcp/tools/space/schema/pages/updatePage.js +0 -25
- package/dist/modules/mcp/tools/space/schema/schemas.js +0 -53
- package/dist/modules/mcp/tools/space/schema/updateSpaceSettings.js +0 -23
- package/dist/modules/mcp/tools/space/schema/variables/createVariable.js +0 -38
- package/dist/modules/mcp/tools/space/schema/variables/deleteVariable.js +0 -16
- package/dist/modules/mcp/tools/space/schema/variables/getVariable.js +0 -17
- package/dist/modules/mcp/tools/space/schema/variables/getVariables.js +0 -17
- package/dist/modules/mcp/tools/space/schema/variables/updateVariable.js +0 -38
- package/dist/modules/mcp/tools/space/style/selectors/createStyleSelector.js +0 -37
- package/dist/modules/mcp/tools/space/style/selectors/deleteStyleSelector.js +0 -24
- package/dist/modules/mcp/tools/space/style/selectors/getStyleSelectors.js +0 -20
- package/dist/modules/mcp/tools/space/style/selectors/updateStyleSelector.js +0 -37
- package/dist/modules/mcp/tools/space/style/variables/createStyleVariable.js +0 -33
- package/dist/modules/mcp/tools/space/style/variables/deleteStyleVariable.js +0 -20
- package/dist/modules/mcp/tools/space/style/variables/getStyleVariable.js +0 -19
- package/dist/modules/mcp/tools/space/style/variables/getStyleVariables.js +0 -16
- package/dist/modules/mcp/tools/space/style/variables/updateStyleVariable.js +0 -33
- package/dist/package.js +0 -77
- package/dist/package.json.d.ts +0 -67
- package/dist/src/core/requestHandler.d.ts +0 -5
- package/dist/src/modules/mcp/helpers.d.ts +0 -9
- package/dist/src/modules/mcp/resources/glossary/binding.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/collection.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/displayMode.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/element.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/environment.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/interaction.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/page.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/plugin.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/resource.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/schema.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/schemaVariable.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/segment.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/space.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/style.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/styleSelector.d.ts +0 -7
- package/dist/src/modules/mcp/resources/glossary/styleVariable.d.ts +0 -7
- package/dist/src/modules/mcp/resources/workflows/data.d.ts +0 -7
- package/dist/src/modules/mcp/resources/workflows/elements.d.ts +0 -7
- package/dist/src/modules/mcp/resources/workflows/segments.d.ts +0 -7
- package/dist/src/modules/mcp/resources/workflows/styles.d.ts +0 -7
- package/dist/src/modules/mcp/tools/collections/createCollection.d.ts +0 -3
- package/dist/src/modules/mcp/tools/collections/createCollectionRecord.d.ts +0 -3
- package/dist/src/modules/mcp/tools/collections/deleteCollection.d.ts +0 -3
- package/dist/src/modules/mcp/tools/collections/deleteCollectionRecord.d.ts +0 -3
- package/dist/src/modules/mcp/tools/collections/getCollection.d.ts +0 -3
- package/dist/src/modules/mcp/tools/collections/getCollectionRecord.d.ts +0 -3
- package/dist/src/modules/mcp/tools/collections/getCollectionRecords.d.ts +0 -3
- package/dist/src/modules/mcp/tools/collections/getCollections.d.ts +0 -3
- package/dist/src/modules/mcp/tools/collections/index.d.ts +0 -10
- package/dist/src/modules/mcp/tools/collections/updateCollection.d.ts +0 -3
- package/dist/src/modules/mcp/tools/collections/updateCollectionRecord.d.ts +0 -3
- package/dist/src/modules/mcp/tools/docs/index.d.ts +0 -2
- package/dist/src/modules/mcp/tools/docs/listResources.d.ts +0 -3
- package/dist/src/modules/mcp/tools/docs/readResource.d.ts +0 -3
- package/dist/src/modules/mcp/tools/plugins/addPlugin.d.ts +0 -3
- package/dist/src/modules/mcp/tools/plugins/index.d.ts +0 -5
- package/dist/src/modules/mcp/tools/plugins/listPlugins.d.ts +0 -3
- package/dist/src/modules/mcp/tools/plugins/removePlugin.d.ts +0 -3
- package/dist/src/modules/mcp/tools/plugins/updatePlugin.d.ts +0 -3
- package/dist/src/modules/mcp/tools/resources/addResource.d.ts +0 -3
- package/dist/src/modules/mcp/tools/resources/getResource.d.ts +0 -3
- package/dist/src/modules/mcp/tools/resources/getResources.d.ts +0 -3
- package/dist/src/modules/mcp/tools/resources/index.d.ts +0 -6
- package/dist/src/modules/mcp/tools/resources/moveResource.d.ts +0 -3
- package/dist/src/modules/mcp/tools/resources/removeResource.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/createSegment.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/deleteSegment.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/getSegment.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/getSegments.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/index.d.ts +0 -8
- package/dist/src/modules/mcp/tools/segment/schema/elements/createSegmentElement.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/schema/elements/deleteSegmentElement.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/schema/elements/index.d.ts +0 -5
- package/dist/src/modules/mcp/tools/segment/schema/elements/moveSegmentElement.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/schema/elements/updateSegmentElement.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/schema/index.d.ts +0 -2
- package/dist/src/modules/mcp/tools/segment/schema/variables/createSegmentVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/schema/variables/deleteSegmentVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/schema/variables/index.d.ts +0 -4
- package/dist/src/modules/mcp/tools/segment/schema/variables/updateSegmentVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/segment.test.d.ts +0 -1
- package/dist/src/modules/mcp/tools/segment/style/index.d.ts +0 -1
- package/dist/src/modules/mcp/tools/segment/style/variables/createSegmentStyleVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/style/variables/deleteSegmentStyleVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/style/variables/index.d.ts +0 -4
- package/dist/src/modules/mcp/tools/segment/style/variables/segmentStyleVariables.test.d.ts +0 -1
- package/dist/src/modules/mcp/tools/segment/style/variables/updateSegmentStyleVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/segment/updateSegment.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/index.d.ts +0 -2
- package/dist/src/modules/mcp/tools/space/schema/applyPreview.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/elements/cloneElement.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/elements/createElement.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/elements/deleteElement.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/elements/elements.test.d.ts +0 -1
- package/dist/src/modules/mcp/tools/space/schema/elements/getElement.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/elements/getElements.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/elements/index.d.ts +0 -9
- package/dist/src/modules/mcp/tools/space/schema/elements/listElements.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/elements/moveElement.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/elements/updateElement.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/getSpaceSettings.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/index.d.ts +0 -8
- package/dist/src/modules/mcp/tools/space/schema/pageFolders/createPageFolder.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/pageFolders/deletePageFolder.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/pageFolders/getPageFolder.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/pageFolders/getPageFolders.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/pageFolders/index.d.ts +0 -6
- package/dist/src/modules/mcp/tools/space/schema/pageFolders/pageFolders.test.d.ts +0 -1
- package/dist/src/modules/mcp/tools/space/schema/pageFolders/updatePageFolder.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/pages/createPage.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/pages/deletePage.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/pages/getPage.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/pages/getPageBySlug.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/pages/getPages.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/pages/index.d.ts +0 -7
- package/dist/src/modules/mcp/tools/space/schema/pages/pages.test.d.ts +0 -1
- package/dist/src/modules/mcp/tools/space/schema/pages/updatePage.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/schemas.d.ts +0 -66
- package/dist/src/modules/mcp/tools/space/schema/updateSpaceSettings.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/variables/createVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/variables/deleteVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/variables/getVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/variables/getVariables.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/variables/index.d.ts +0 -6
- package/dist/src/modules/mcp/tools/space/schema/variables/updateVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/schema/variables/variables.test.d.ts +0 -1
- package/dist/src/modules/mcp/tools/space/space.test.d.ts +0 -1
- package/dist/src/modules/mcp/tools/space/style/index.d.ts +0 -2
- package/dist/src/modules/mcp/tools/space/style/selectors/createStyleSelector.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/style/selectors/deleteStyleSelector.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/style/selectors/getStyleSelectors.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/style/selectors/index.d.ts +0 -5
- package/dist/src/modules/mcp/tools/space/style/selectors/styleSelectors.test.d.ts +0 -1
- package/dist/src/modules/mcp/tools/space/style/selectors/updateStyleSelector.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/style/variables/createStyleVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/style/variables/deleteStyleVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/style/variables/getStyleVariable.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/style/variables/getStyleVariables.d.ts +0 -3
- package/dist/src/modules/mcp/tools/space/style/variables/index.d.ts +0 -6
- package/dist/src/modules/mcp/tools/space/style/variables/styleVariables.test.d.ts +0 -1
- package/dist/src/modules/mcp/tools/space/style/variables/updateStyleVariable.d.ts +0 -3
- /package/dist/src/{modules/mcp/helpers.test.d.ts → core/server/mcpServer.test.d.ts} +0 -0
- /package/dist/src/modules/{mcp/tools/collections/collections.test.d.ts → ai/toolkit.test.d.ts} +0 -0
- /package/dist/src/modules/mcp/{tools/plugins/plugins.test.d.ts → catalogs/builtinTransformers.test.d.ts} +0 -0
- /package/dist/src/modules/mcp/{tools/resources/resources.test.d.ts → helpers/log.test.d.ts} +0 -0
- /package/dist/src/modules/mcp/{tools/segment/schema/elements/segmentElements.test.d.ts → mcp.bench.d.ts} +0 -0
- /package/dist/src/modules/mcp/{tools/segment/schema/variables/segmentVariables.test.d.ts → mcp.test.d.ts} +0 -0
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
//#region src/modules/mcp/helpers.ts
|
|
3
|
-
var zodToJsonSchema = (schema) => {
|
|
4
|
-
if (schema instanceof z.ZodObject) {
|
|
5
|
-
const properties = {};
|
|
6
|
-
const required = [];
|
|
7
|
-
for (const [key, value] of Object.entries(schema.shape)) {
|
|
8
|
-
properties[key] = zodToJsonSchema(value);
|
|
9
|
-
if (value instanceof z.ZodString || value instanceof z.ZodNumber || value instanceof z.ZodBoolean) {
|
|
10
|
-
if (!value.isOptional()) required.push(key);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
14
|
-
type: "object",
|
|
15
|
-
properties,
|
|
16
|
-
required: required.length > 0 ? required : []
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
if (schema instanceof z.ZodString) return { type: "string" };
|
|
20
|
-
if (schema instanceof z.ZodNumber) return { type: "number" };
|
|
21
|
-
if (schema instanceof z.ZodBoolean) return { type: "boolean" };
|
|
22
|
-
if (schema instanceof z.ZodEnum) return {
|
|
23
|
-
type: "string",
|
|
24
|
-
enum: schema.options
|
|
25
|
-
};
|
|
26
|
-
if (schema instanceof z.ZodOptional) return zodToJsonSchema(schema._def.innerType);
|
|
27
|
-
if (schema instanceof z.ZodUnion) return { oneOf: schema.options.map((opt) => zodToJsonSchema(opt)) };
|
|
28
|
-
if (schema instanceof z.ZodArray) return {
|
|
29
|
-
type: "array",
|
|
30
|
-
items: zodToJsonSchema(schema.element)
|
|
31
|
-
};
|
|
32
|
-
if (schema instanceof z.ZodRecord) return {
|
|
33
|
-
type: "object",
|
|
34
|
-
additionalProperties: zodToJsonSchema(schema.valueType)
|
|
35
|
-
};
|
|
36
|
-
return {};
|
|
37
|
-
};
|
|
38
|
-
var getAllowedModes = (operationType) => {
|
|
39
|
-
return operationType === "write" ? ["build"] : ["plan", "build"];
|
|
40
|
-
};
|
|
41
|
-
var toolResponseOk = (data, agentMessage) => {
|
|
42
|
-
return {
|
|
43
|
-
content: [{
|
|
44
|
-
type: "text",
|
|
45
|
-
text: agentMessage ?? JSON.stringify(data ?? null, null, 2)
|
|
46
|
-
}],
|
|
47
|
-
data
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
var toolResponseErr = (error) => ({
|
|
51
|
-
content: [{
|
|
52
|
-
type: "text",
|
|
53
|
-
text: error instanceof Error ? error.message : error
|
|
54
|
-
}],
|
|
55
|
-
isError: true
|
|
56
|
-
});
|
|
57
|
-
var isToolActive = (tool, adapters) => Boolean(tool.handler || tool.adapterName && adapters[tool.adapterName]);
|
|
58
|
-
var resolveToolHandler = (tool, adapters) => {
|
|
59
|
-
if (tool.handler) return tool.handler;
|
|
60
|
-
if (tool.adapterName) return adapterWrapper(tool.adapterName, adapters[tool.adapterName]);
|
|
61
|
-
};
|
|
62
|
-
var bindTools = (tools, adapters) => tools.filter((tool) => isToolActive(tool, adapters)).map((tool) => ({
|
|
63
|
-
...tool,
|
|
64
|
-
handler: resolveToolHandler(tool, adapters)
|
|
65
|
-
}));
|
|
66
|
-
var adapterWrapper = (adapterName, handler) => {
|
|
67
|
-
return async (args, ctx) => {
|
|
68
|
-
if (!handler) return toolResponseErr(`Adapter ${adapterName} not found`);
|
|
69
|
-
const result = await handler(args, ctx);
|
|
70
|
-
if ("error" in result) return toolResponseErr(result.error);
|
|
71
|
-
return toolResponseOk(result.data);
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
//#endregion
|
|
75
|
-
export { adapterWrapper, bindTools, getAllowedModes, isToolActive, resolveToolHandler, toolResponseErr, toolResponseOk, zodToJsonSchema };
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
//#region src/modules/mcp/resources/glossary/binding.ts
|
|
2
|
-
var bindingResource = {
|
|
3
|
-
uri: "plitzi://docs/binding",
|
|
4
|
-
name: "Plitzi Docs: Binding",
|
|
5
|
-
description: "Data bindings in Plitzi — connections that dynamically drive element attributes, style, or state from data sources.",
|
|
6
|
-
mimeType: "text/markdown",
|
|
7
|
-
content: `# Binding
|
|
8
|
-
|
|
9
|
-
A **Binding** connects a data source to an element property. At runtime, the bound value replaces the element's static attribute, style, or initial state. Bindings enable dynamic content — data from collections, variables, navigation params, or other elements can drive what is displayed or how it looks.
|
|
10
|
-
|
|
11
|
-
## TypeScript Shape
|
|
12
|
-
|
|
13
|
-
\`\`\`typescript
|
|
14
|
-
type BindingCategory = 'attributes' | 'style' | 'initialState';
|
|
15
|
-
|
|
16
|
-
type ElementBinding = {
|
|
17
|
-
id: string;
|
|
18
|
-
source: string; // Data source ID / reference
|
|
19
|
-
fromPath?: string; // Path within the source data (e.g. 'user.name')
|
|
20
|
-
transformers?: BindingTransformer[]; // Optional value transforms
|
|
21
|
-
when?: RuleGroup; // Conditional activation rule
|
|
22
|
-
enabled?: boolean;
|
|
23
|
-
toPath: string; // Target attribute/style/state path to overwrite
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
type BindingTransformer = {
|
|
27
|
-
type: 'utility' | 'unknown';
|
|
28
|
-
action: string; // Transform function name
|
|
29
|
-
params: { valueType: string; value: string };
|
|
30
|
-
};
|
|
31
|
-
\`\`\`
|
|
32
|
-
|
|
33
|
-
## Binding Categories
|
|
34
|
-
|
|
35
|
-
Bindings are grouped by what they target inside an element:
|
|
36
|
-
|
|
37
|
-
| Category | What it overwrites |
|
|
38
|
-
|---|---|
|
|
39
|
-
| \`attributes\` | Fields in \`element.attributes\` (e.g. \`text\`, \`src\`, \`href\`) |
|
|
40
|
-
| \`style\` | Style-related data (e.g. active style variant) |
|
|
41
|
-
| \`initialState\` | Initial runtime state values |
|
|
42
|
-
|
|
43
|
-
## Key Properties
|
|
44
|
-
|
|
45
|
-
- **\`source\`** — identifies the data source (a collection ID, a schema variable name, a navigation param key, etc.).
|
|
46
|
-
- **\`fromPath\`** — dot-notation path into the source data to extract the bound value (e.g. \`'record.title'\`).
|
|
47
|
-
- **\`toPath\`** — dot-notation path of the target property to set on the element (e.g. \`'text'\`, \`'src'\`).
|
|
48
|
-
- **\`transformers\`** — optional chain of value transforms applied before writing to \`toPath\`.
|
|
49
|
-
- **\`when\`** — a \`RuleGroup\` condition; the binding only applies when the condition evaluates to true.
|
|
50
|
-
|
|
51
|
-
## Where Bindings Are Stored
|
|
52
|
-
|
|
53
|
-
Bindings live inside \`element.definition.bindings\`:
|
|
54
|
-
|
|
55
|
-
\`\`\`typescript
|
|
56
|
-
element.definition.bindings = {
|
|
57
|
-
attributes: [
|
|
58
|
-
{ id: '...', source: 'collection-posts', fromPath: 'title', toPath: 'text', ... }
|
|
59
|
-
],
|
|
60
|
-
style: [...],
|
|
61
|
-
initialState: [...]
|
|
62
|
-
}
|
|
63
|
-
\`\`\`
|
|
64
|
-
|
|
65
|
-
## Relationships
|
|
66
|
-
|
|
67
|
-
- Bindings reference **Schema Variables** (source by variable name) or external data sources.
|
|
68
|
-
- Bindings are part of **Element** definitions.
|
|
69
|
-
- **Interactions** complement bindings by handling user-triggered events (click, change).
|
|
70
|
-
`
|
|
71
|
-
};
|
|
72
|
-
//#endregion
|
|
73
|
-
export { bindingResource };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
//#region src/modules/mcp/resources/glossary/collection.ts
|
|
2
|
-
var collectionResource = {
|
|
3
|
-
uri: "plitzi://docs/collection",
|
|
4
|
-
name: "Plitzi Docs: Collection",
|
|
5
|
-
description: "A CMS-style data store in Plitzi — a typed set of records with configurable fields.",
|
|
6
|
-
mimeType: "text/markdown",
|
|
7
|
-
content: `# Collection
|
|
8
|
-
|
|
9
|
-
A **Collection** is a CMS-style data store inside a Plitzi space. It has a defined field schema and holds typed records. Collections are used to manage dynamic content (blog posts, product listings, team members, etc.) that elements can bind to via data sources.
|
|
10
|
-
|
|
11
|
-
## TypeScript Shape
|
|
12
|
-
|
|
13
|
-
\`\`\`typescript
|
|
14
|
-
type Collection = {
|
|
15
|
-
id: string;
|
|
16
|
-
name: string; // Singular name (e.g. 'Post')
|
|
17
|
-
namePlural: string; // Plural name (e.g. 'Posts')
|
|
18
|
-
description: string;
|
|
19
|
-
privacy: 'public' | 'private';
|
|
20
|
-
fields: Record<string, CollectionField>; // Field schema keyed by field ID
|
|
21
|
-
records: CollectionRecord[];
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
type CollectionField = {
|
|
25
|
-
id: string;
|
|
26
|
-
name: string; // Human-readable label
|
|
27
|
-
machineName: string; // Programmatic key used in record values
|
|
28
|
-
type:
|
|
29
|
-
| 'text' | 'richText' | 'image' | 'multiImage'
|
|
30
|
-
| 'video' | 'link' | 'email' | 'phone'
|
|
31
|
-
| 'number' | 'date' | 'switch' | 'color'
|
|
32
|
-
| 'option' | 'file';
|
|
33
|
-
params: {
|
|
34
|
-
primary: boolean; // Whether this is the display/title field
|
|
35
|
-
required: boolean;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
type CollectionRecord = {
|
|
40
|
-
id: string;
|
|
41
|
-
values: Record<string, string | number | boolean>; // Keyed by field machineName
|
|
42
|
-
status: 'draft' | 'published' | 'archived';
|
|
43
|
-
createdAt: number;
|
|
44
|
-
updatedAt: number;
|
|
45
|
-
publishedAt?: number;
|
|
46
|
-
};
|
|
47
|
-
\`\`\`
|
|
48
|
-
|
|
49
|
-
## Key Properties
|
|
50
|
-
|
|
51
|
-
- **\`fields\`** — the schema of the collection. Each field has a \`machineName\` which is the key used in \`record.values\`.
|
|
52
|
-
- **\`CollectionField.type\`** — determines the data type and editor widget. Use \`richText\` for HTML content, \`image\` for single image uploads.
|
|
53
|
-
- **\`CollectionField.params.primary\`** — marks the main display field (title/name). Used in lists and pickers.
|
|
54
|
-
- **\`CollectionRecord.values\`** — the actual record data, keyed by \`field.machineName\`.
|
|
55
|
-
- **\`CollectionRecord.status\`** — content lifecycle. Only \`published\` records are visible in production.
|
|
56
|
-
|
|
57
|
-
## Relationships
|
|
58
|
-
|
|
59
|
-
- Elements can bind to collection data via **Bindings** (data source type \`collection\`).
|
|
60
|
-
- Collections belong to a **Space** and are available across all environments.
|
|
61
|
-
|
|
62
|
-
## Common Operations
|
|
63
|
-
|
|
64
|
-
- \`get_collections\` — list all collections in the space.
|
|
65
|
-
- \`get_collection\` — get a collection with its field schema.
|
|
66
|
-
- \`create_collection\` — define a new content type.
|
|
67
|
-
- \`update_collection\` — rename or modify a collection.
|
|
68
|
-
- \`delete_collection\` — remove collection and all records.
|
|
69
|
-
- \`get_collection_records\` — fetch records (optionally filtered by status).
|
|
70
|
-
- \`create_collection_record\` — add a new record.
|
|
71
|
-
- \`update_collection_record\` — edit an existing record.
|
|
72
|
-
- \`delete_collection_record\` — remove a record.
|
|
73
|
-
`
|
|
74
|
-
};
|
|
75
|
-
//#endregion
|
|
76
|
-
export { collectionResource };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//#region src/modules/mcp/resources/glossary/displayMode.ts
|
|
2
|
-
var displayModeResource = {
|
|
3
|
-
uri: "plitzi://docs/display-mode",
|
|
4
|
-
name: "Plitzi Docs: Display Mode",
|
|
5
|
-
description: "Responsive breakpoints in Plitzi — desktop, tablet, and mobile style layers.",
|
|
6
|
-
mimeType: "text/markdown",
|
|
7
|
-
content: `# Display Mode
|
|
8
|
-
|
|
9
|
-
A **Display Mode** represents a responsive breakpoint in the Plitzi style system. Styles are defined per display mode, allowing different visual rules at each screen size.
|
|
10
|
-
|
|
11
|
-
## Type
|
|
12
|
-
|
|
13
|
-
\`\`\`typescript
|
|
14
|
-
type DisplayMode = 'desktop' | 'tablet' | 'mobile';
|
|
15
|
-
\`\`\`
|
|
16
|
-
|
|
17
|
-
## Structure in Style
|
|
18
|
-
|
|
19
|
-
The \`Style.platform\` object holds one style layer per display mode:
|
|
20
|
-
|
|
21
|
-
\`\`\`typescript
|
|
22
|
-
style.platform = {
|
|
23
|
-
desktop: Record<string, StyleItem>, // Base styles (widest breakpoint)
|
|
24
|
-
tablet: Record<string, StyleItem>, // Overrides for tablet-width screens
|
|
25
|
-
mobile: Record<string, StyleItem> // Overrides for mobile-width screens
|
|
26
|
-
};
|
|
27
|
-
\`\`\`
|
|
28
|
-
|
|
29
|
-
Each mode contains the same set of CSS selectors (keyed by selector string). A selector defined only in \`desktop\` inherits its rules at all sizes unless overridden in \`tablet\` or \`mobile\`.
|
|
30
|
-
|
|
31
|
-
## Cascade Direction
|
|
32
|
-
|
|
33
|
-
- **Desktop-first** (default, \`style.mode === 'desktop-first'\`): \`desktop\` is the base. \`tablet\` overrides at medium widths. \`mobile\` overrides at narrow widths.
|
|
34
|
-
- **Mobile-first** (\`style.mode === 'mobile-first'\`): \`mobile\` is the base. \`tablet\` and \`desktop\` add styles as the viewport widens.
|
|
35
|
-
|
|
36
|
-
## In MCP Operations
|
|
37
|
-
|
|
38
|
-
MCP style tools that modify selectors accept a \`displayMode\` parameter:
|
|
39
|
-
|
|
40
|
-
\`\`\`typescript
|
|
41
|
-
createStyleSelector({ displayMode: 'mobile', selector: '.hero', ... })
|
|
42
|
-
updateStyleSelector({ displayMode: 'tablet', selector: '.hero', ... })
|
|
43
|
-
deleteStyleSelector({ displayMode: 'desktop', selector: '.hero' })
|
|
44
|
-
\`\`\`
|
|
45
|
-
|
|
46
|
-
Omitting \`displayMode\` typically defaults to \`desktop\`.
|
|
47
|
-
`
|
|
48
|
-
};
|
|
49
|
-
//#endregion
|
|
50
|
-
export { displayModeResource };
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
//#region src/modules/mcp/resources/glossary/element.ts
|
|
2
|
-
var elementResource = {
|
|
3
|
-
uri: "plitzi://docs/element",
|
|
4
|
-
name: "Plitzi Docs: Element",
|
|
5
|
-
description: "A single UI component instance in a Plitzi page — the building block of every schema.",
|
|
6
|
-
mimeType: "text/markdown",
|
|
7
|
-
content: `# Element
|
|
8
|
-
|
|
9
|
-
An \`Element\` is a single instance of a UI component in a Plitzi page. Every visual item — pages, containers, text blocks, forms, images — is an element. The entire page tree is stored as a flat dictionary of elements keyed by ID.
|
|
10
|
-
|
|
11
|
-
## TypeScript Shape
|
|
12
|
-
|
|
13
|
-
\`\`\`typescript
|
|
14
|
-
type Element<TAttributes = Record<string, unknown>> = {
|
|
15
|
-
id: string;
|
|
16
|
-
attributes: TAttributes & { subType?: string }; // Component-specific configuration
|
|
17
|
-
definition: ElementDefinition;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
type ElementDefinition = {
|
|
21
|
-
rootId: string; // ID of the page/root element this belongs to
|
|
22
|
-
label: string; // Human-readable name shown in the builder
|
|
23
|
-
type: string; // Element type identifier (e.g. 'container', 'text', 'image')
|
|
24
|
-
parentId?: string; // ID of the parent element (undefined = root)
|
|
25
|
-
items?: string[]; // Ordered array of child element IDs
|
|
26
|
-
styleSelectors: {
|
|
27
|
-
base: string; // Always present — the primary CSS class
|
|
28
|
-
[key: string]: string; // Additional sub-selectors (e.g. 'header', 'body', 'icon')
|
|
29
|
-
};
|
|
30
|
-
bindings?: Partial<Record<'attributes' | 'style' | 'initialState', ElementBinding[]>>;
|
|
31
|
-
interactions?: Record<string, ElementInteraction>;
|
|
32
|
-
initialState?: {
|
|
33
|
-
styleVariant?: Record<string, Record<string, string | string[]>>;
|
|
34
|
-
styleSelectors?: ElementDefinition['styleSelectors'];
|
|
35
|
-
visibility?: boolean;
|
|
36
|
-
[key: string]: unknown;
|
|
37
|
-
};
|
|
38
|
-
runtime?: 'server' | 'client' | 'shared'; // RSC render target
|
|
39
|
-
loadStrategy?: 'eager' | 'lazy' | 'visible'; // When to load/render
|
|
40
|
-
};
|
|
41
|
-
\`\`\`
|
|
42
|
-
|
|
43
|
-
## Key Properties
|
|
44
|
-
|
|
45
|
-
- **\`id\`** — unique identifier, used as the key in \`schema.flat\`.
|
|
46
|
-
- **\`attributes\`** — component-specific data (text content, URLs, settings). Shape varies by plugin type. \`subType\` selects a variant within the same plugin.
|
|
47
|
-
- **\`definition.type\`** — element type identifier that determines which component renders this element. Get valid values from \`get_builder_context\` (\`elementDefaults\` keys) or from the \`type\` field of existing elements in \`get_schema\`. This is NOT the plugin name from \`list_plugins\`.
|
|
48
|
-
- **\`definition.parentId\`** — parent element ID. Elements without \`parentId\` are root elements (pages).
|
|
49
|
-
- **\`definition.items\`** — ordered child IDs. Walk the tree by following \`items\` recursively.
|
|
50
|
-
- **\`definition.styleSelectors\`** — maps named selector slots to actual CSS class strings from the \`Style\`. \`base\` is always present.
|
|
51
|
-
- **\`definition.bindings\`** — data bindings that dynamically overwrite \`attributes\`, \`style\`, or \`initialState\` fields at runtime.
|
|
52
|
-
- **\`definition.interactions\`** — event handlers (onClick, onChange, etc.) mapping to configured actions.
|
|
53
|
-
- **\`definition.rootId\`** — always points to the page element this element belongs to.
|
|
54
|
-
|
|
55
|
-
## Relationships
|
|
56
|
-
|
|
57
|
-
- All elements live in \`schema.flat[id]\`.
|
|
58
|
-
- Parent–child links: \`definition.parentId\` (up) and \`definition.items\` (down).
|
|
59
|
-
- Style data for each element is found in \`style.platform[displayMode][styleSelector]\`.
|
|
60
|
-
- **Segment** elements have their own \`schema.flat\` but follow the same structure.
|
|
61
|
-
|
|
62
|
-
## Page Elements
|
|
63
|
-
|
|
64
|
-
A page is an element whose type corresponds to a page plugin. Its ID appears in \`schema.pages\`. Pages are the top-level roots; they have no \`parentId\` and their \`rootId\` points to themselves.
|
|
65
|
-
`
|
|
66
|
-
};
|
|
67
|
-
//#endregion
|
|
68
|
-
export { elementResource };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
//#region src/modules/mcp/resources/glossary/environment.ts
|
|
2
|
-
var environmentResource = {
|
|
3
|
-
uri: "plitzi://docs/environment",
|
|
4
|
-
name: "Plitzi Docs: Environment",
|
|
5
|
-
description: "Deployment environments in Plitzi — main (working copy), development, staging, and production.",
|
|
6
|
-
mimeType: "text/markdown",
|
|
7
|
-
content: `# Environment
|
|
8
|
-
|
|
9
|
-
An **Environment** in Plitzi is a named version of a space's schema, style, and segments. Each environment can be published independently to its own domain.
|
|
10
|
-
|
|
11
|
-
## Type
|
|
12
|
-
|
|
13
|
-
\`\`\`typescript
|
|
14
|
-
type Environment = 'production' | 'staging' | 'development' | 'main';
|
|
15
|
-
\`\`\`
|
|
16
|
-
|
|
17
|
-
## Environments
|
|
18
|
-
|
|
19
|
-
| Environment | Purpose |
|
|
20
|
-
|---|---|
|
|
21
|
-
| \`main\` | The live editing/working copy. Always present. All builder changes apply here. |
|
|
22
|
-
| \`development\` | Internal preview environment. Used for QA before staging. |
|
|
23
|
-
| \`staging\` | Pre-production review. Shown to stakeholders before going live. |
|
|
24
|
-
| \`production\` | The public-facing live site. Published from \`main\` when changes are ready. |
|
|
25
|
-
|
|
26
|
-
## Key Behaviors
|
|
27
|
-
|
|
28
|
-
- **All builder operations target \`main\`** unless explicitly scoped to another environment.
|
|
29
|
-
- Publishing copies the \`main\` schema/style to the target environment (e.g. \`production\`).
|
|
30
|
-
- Each environment can have a different domain and CDN deployment.
|
|
31
|
-
- Segments are also versioned per environment.
|
|
32
|
-
|
|
33
|
-
## In API and Tools
|
|
34
|
-
|
|
35
|
-
Most MCP tools accept an \`environment\` parameter (defaults to \`main\`) that scopes the read/write operation:
|
|
36
|
-
|
|
37
|
-
\`\`\`typescript
|
|
38
|
-
// Example: get schema for the staging environment
|
|
39
|
-
getSchema({ environment: 'staging' })
|
|
40
|
-
\`\`\`
|
|
41
|
-
|
|
42
|
-
## AI Context
|
|
43
|
-
|
|
44
|
-
The \`AiContext.environment\` field tells the AI agent which environment the current session is operating in. This affects which schema/style data is read and which changes are applied.
|
|
45
|
-
`
|
|
46
|
-
};
|
|
47
|
-
//#endregion
|
|
48
|
-
export { environmentResource };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
//#region src/modules/mcp/resources/glossary/interaction.ts
|
|
2
|
-
var interactionResource = {
|
|
3
|
-
uri: "plitzi://docs/interaction",
|
|
4
|
-
name: "Plitzi Docs: Interaction",
|
|
5
|
-
description: "Event-driven action handlers in Plitzi — connect user events (click, change, submit) to platform actions.",
|
|
6
|
-
mimeType: "text/markdown",
|
|
7
|
-
content: `# Interaction
|
|
8
|
-
|
|
9
|
-
An **Interaction** is an event handler attached to an element. When a user triggers an event (click, change, form submit, etc.), the interaction executes a configured action — navigation, state mutation, data operation, animation, etc.
|
|
10
|
-
|
|
11
|
-
## TypeScript Shape
|
|
12
|
-
|
|
13
|
-
\`\`\`typescript
|
|
14
|
-
type ElementInteraction = {
|
|
15
|
-
id: string;
|
|
16
|
-
title: string; // Human-readable name
|
|
17
|
-
type: InteractionCallbackType; // Event type (e.g. 'onClick', 'onChange')
|
|
18
|
-
action: string; // Action identifier (e.g. 'navigate', 'setVariable')
|
|
19
|
-
params: InteractionCallbackParamValues; // Action-specific parameters
|
|
20
|
-
preview: Record<string, unknown>; // Preview data for the builder
|
|
21
|
-
elementId: string; // Element this interaction belongs to
|
|
22
|
-
beforeNode: string; // Flow order: ID of preceding step
|
|
23
|
-
afterNode: string; // Flow order: ID of following step
|
|
24
|
-
flowId: string; // Groups interactions in the same flow
|
|
25
|
-
enabled: boolean;
|
|
26
|
-
when?: RuleGroup; // Conditional: only fire when rule matches
|
|
27
|
-
};
|
|
28
|
-
\`\`\`
|
|
29
|
-
|
|
30
|
-
## Key Properties
|
|
31
|
-
|
|
32
|
-
- **\`type\`** — the DOM or lifecycle event to listen on (e.g. \`onClick\`, \`onChange\`, \`onSubmit\`, \`onLoad\`).
|
|
33
|
-
- **\`action\`** — the platform action to execute. Common actions: \`navigate\`, \`setSchemaVariable\`, \`toggleVisibility\`, \`submitForm\`, \`openModal\`.
|
|
34
|
-
- **\`params\`** — action-specific configuration object. Shape depends on \`action\`.
|
|
35
|
-
- **\`flowId\` + \`beforeNode\` / \`afterNode\`** — interactions can be chained into a sequential flow. Multiple interactions sharing a \`flowId\` form an ordered chain.
|
|
36
|
-
- **\`when\`** — a \`RuleGroup\` condition; the interaction only fires when the condition is true.
|
|
37
|
-
|
|
38
|
-
## Where Interactions Are Stored
|
|
39
|
-
|
|
40
|
-
Interactions are stored in \`element.definition.interactions\` as a record keyed by interaction ID:
|
|
41
|
-
|
|
42
|
-
\`\`\`typescript
|
|
43
|
-
element.definition.interactions = {
|
|
44
|
-
'inter-abc': {
|
|
45
|
-
id: 'inter-abc',
|
|
46
|
-
type: 'onClick',
|
|
47
|
-
action: 'navigate',
|
|
48
|
-
params: { url: '/dashboard' },
|
|
49
|
-
...
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
\`\`\`
|
|
53
|
-
|
|
54
|
-
## Relationships
|
|
55
|
-
|
|
56
|
-
- Interactions belong to **Elements**.
|
|
57
|
-
- **Bindings** handle passive data-driven updates; interactions handle active user-triggered events.
|
|
58
|
-
- Interactions can mutate **Schema Variables** (via \`setSchemaVariable\` action), which then propagate through bindings.
|
|
59
|
-
`
|
|
60
|
-
};
|
|
61
|
-
//#endregion
|
|
62
|
-
export { interactionResource };
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
//#region src/modules/mcp/resources/glossary/page.ts
|
|
2
|
-
var pageResource = {
|
|
3
|
-
uri: "plitzi://docs/page",
|
|
4
|
-
name: "Plitzi Docs: Page",
|
|
5
|
-
description: "A top-level page in a Plitzi space — a root element whose ID appears in schema.pages.",
|
|
6
|
-
mimeType: "text/markdown",
|
|
7
|
-
content: `# Page
|
|
8
|
-
|
|
9
|
-
A **Page** in Plitzi is a root-level element. It is stored in \`schema.flat\` like any other element, but its ID is listed in \`schema.pages\` to identify it as a navigable page. Pages are the containers that hold all other elements.
|
|
10
|
-
|
|
11
|
-
## Structure
|
|
12
|
-
|
|
13
|
-
Pages are regular \`Element\` objects:
|
|
14
|
-
|
|
15
|
-
\`\`\`typescript
|
|
16
|
-
// A page element in schema.flat
|
|
17
|
-
{
|
|
18
|
-
id: 'page-abc123',
|
|
19
|
-
attributes: { title: 'Home', slug: '/' }, // Page-specific attributes
|
|
20
|
-
definition: {
|
|
21
|
-
rootId: 'page-abc123', // Points to itself — pages are their own root
|
|
22
|
-
label: 'Home',
|
|
23
|
-
type: 'page', // Type matches the page plugin identifier
|
|
24
|
-
items: ['section-1', 'section-2'], // Top-level child elements
|
|
25
|
-
styleSelectors: { base: '.page-home' }
|
|
26
|
-
// No parentId — pages have no parent
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Referenced in schema.pages
|
|
31
|
-
schema.pages = ['page-abc123', 'page-def456', ...]
|
|
32
|
-
\`\`\`
|
|
33
|
-
|
|
34
|
-
## Key Properties
|
|
35
|
-
|
|
36
|
-
- **\`schema.pages\`** — ordered array of page element IDs. The order controls navigation/sidebar ordering.
|
|
37
|
-
- **\`definition.rootId === id\`** — a page's \`rootId\` always points to itself.
|
|
38
|
-
- **\`definition.parentId\`** — absent (undefined) for pages; they are top-level.
|
|
39
|
-
- **\`attributes.slug\`** — the URL path segment for this page (e.g. \`/about\`).
|
|
40
|
-
|
|
41
|
-
## Page Folders
|
|
42
|
-
|
|
43
|
-
Pages can be organized into **page folders** (\`schema.pageFolders\`):
|
|
44
|
-
|
|
45
|
-
\`\`\`typescript
|
|
46
|
-
type PageFolder = {
|
|
47
|
-
id: string;
|
|
48
|
-
name: string;
|
|
49
|
-
slug: string;
|
|
50
|
-
parentId?: string; // Nested folders supported
|
|
51
|
-
};
|
|
52
|
-
\`\`\`
|
|
53
|
-
|
|
54
|
-
Folders only affect visual organization in the builder sidebar — they do not affect routing.
|
|
55
|
-
|
|
56
|
-
## Relationships
|
|
57
|
-
|
|
58
|
-
- Pages are a special-case of **Element** — same structure, just listed in \`schema.pages\`.
|
|
59
|
-
- All child elements are regular elements in \`schema.flat\`, linked via \`definition.parentId\` / \`definition.items\`.
|
|
60
|
-
|
|
61
|
-
## Common Operations
|
|
62
|
-
|
|
63
|
-
- \`create_page\` — add a new page element.
|
|
64
|
-
- \`update_page\` — rename or modify a page.
|
|
65
|
-
- \`delete_page\` — remove a page and all its children.
|
|
66
|
-
- \`create_page_folder\` / \`update_page_folder\` / \`delete_page_folder\` — manage page folder hierarchy.
|
|
67
|
-
`
|
|
68
|
-
};
|
|
69
|
-
//#endregion
|
|
70
|
-
export { pageResource };
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
//#region src/modules/mcp/resources/glossary/plugin.ts
|
|
2
|
-
var pluginResource = {
|
|
3
|
-
uri: "plitzi://docs/plugin",
|
|
4
|
-
name: "Plitzi Docs: Plugin",
|
|
5
|
-
description: "An external UI component definition in Plitzi — a packaged React component with manifest, assets, and builder constraints.",
|
|
6
|
-
mimeType: "text/markdown",
|
|
7
|
-
content: `# Plugin
|
|
8
|
-
|
|
9
|
-
A **Plugin** is a packaged UI component definition loaded into a Plitzi space. Plugins provide the React component code that renders elements.
|
|
10
|
-
|
|
11
|
-
**Important distinction:** A *plugin* is what you install in a space. An *element type identifier* is what you pass as \`type\` when creating elements. The two are related (each plugin exposes one or more element types), but they are accessed differently:
|
|
12
|
-
- \`list_plugins\` returns installed plugins with their name, version, and description — it does NOT return element type identifiers.
|
|
13
|
-
- Element type identifiers are the keys of \`elementDefaults\` in \`get_builder_context\`, or the \`type\` field on existing elements from \`get_schema\`.
|
|
14
|
-
|
|
15
|
-
## TypeScript Shape
|
|
16
|
-
|
|
17
|
-
\`\`\`typescript
|
|
18
|
-
type Plugin = {
|
|
19
|
-
type: string; // Plugin type ID — matches element.definition.type
|
|
20
|
-
scope: string; // Module federation scope name
|
|
21
|
-
module: string; // Module federation module name
|
|
22
|
-
resource: string; // CDN URL of the plugin bundle
|
|
23
|
-
manifest: PluginManifest;
|
|
24
|
-
assets: Asset[];
|
|
25
|
-
assetsSettings: Asset[];
|
|
26
|
-
attributes: ComponentDefinition['attributes']; // Attribute schema
|
|
27
|
-
defaultStyle: ComponentDefinition['defaultStyle'];
|
|
28
|
-
builder: PluginBuilder; // Visual editor constraints
|
|
29
|
-
settings: Record<string, unknown>;
|
|
30
|
-
subPlugins?: string[]; // Other plugin types this can contain
|
|
31
|
-
isMain?: boolean;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
type PluginManifest = {
|
|
35
|
-
version: string;
|
|
36
|
-
author: string;
|
|
37
|
-
icon?: string;
|
|
38
|
-
definition: {
|
|
39
|
-
name: string;
|
|
40
|
-
backgroundColor: string;
|
|
41
|
-
category: string;
|
|
42
|
-
icon: string;
|
|
43
|
-
license: string;
|
|
44
|
-
owner: string;
|
|
45
|
-
verified: boolean;
|
|
46
|
-
website: string;
|
|
47
|
-
};
|
|
48
|
-
pluginSchema: Record<string, PluginSchema>; // Schema per subType
|
|
49
|
-
assets: Record<string, ManifestAsset>;
|
|
50
|
-
assetsSettings: Record<string, ManifestAsset>;
|
|
51
|
-
root: string;
|
|
52
|
-
runtime: { module: string; scope: string };
|
|
53
|
-
created: string;
|
|
54
|
-
updated: string;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
type PluginBuilder = {
|
|
58
|
-
canDelete?: boolean;
|
|
59
|
-
canDragDrop?: boolean;
|
|
60
|
-
canSelect?: boolean;
|
|
61
|
-
canMove?: boolean;
|
|
62
|
-
canTemplate?: boolean;
|
|
63
|
-
itemsAllowed?: string[]; // Which plugin types can be children
|
|
64
|
-
itemsNotAllowed?: string[];
|
|
65
|
-
};
|
|
66
|
-
\`\`\`
|
|
67
|
-
|
|
68
|
-
## Key Properties
|
|
69
|
-
|
|
70
|
-
- **\`type\`** — internal identifier that links this plugin to elements. When an element has \`definition.type === plugin.type\`, that plugin renders it. You do not reference this directly — use \`elementDefaults\` keys from \`get_builder_context\` to get valid element type values.
|
|
71
|
-
- **\`manifest.pluginSchema\`** — per-subType attribute schema. Controls what fields appear in the builder panel for each element variant (\`attributes.subType\`).
|
|
72
|
-
- **\`builder\`** — constraints for the visual editor. \`itemsAllowed\` restricts which plugin types can be dropped as children.
|
|
73
|
-
- **\`subPlugins\`** — additional plugin types bundled with this one (loaded together).
|
|
74
|
-
- **\`scope\` / \`module\` / \`resource\`** — Module Federation coordinates used to load the component at runtime.
|
|
75
|
-
|
|
76
|
-
## Relationship to Elements
|
|
77
|
-
|
|
78
|
-
When a page renders, each element is matched to its plugin by \`definition.type\`. The plugin provides:
|
|
79
|
-
1. The React component for rendering.
|
|
80
|
-
2. The builder UI for editing \`attributes\`.
|
|
81
|
-
3. The default style selectors and style structure.
|
|
82
|
-
|
|
83
|
-
## Resource Type
|
|
84
|
-
|
|
85
|
-
Plugins can also be stored as CDN **Resources** with \`type: 'plugin'\`. In that case, the resource includes a \`metadata\` field containing the \`PluginManifest\`.
|
|
86
|
-
|
|
87
|
-
## Common Operations
|
|
88
|
-
|
|
89
|
-
- \`list_plugins\` — list all plugins installed in the space.
|
|
90
|
-
- \`add_plugin\` — install a plugin from the resource library.
|
|
91
|
-
- \`update_plugin\` — update plugin settings or version.
|
|
92
|
-
- \`remove_plugin\` — uninstall a plugin.
|
|
93
|
-
`
|
|
94
|
-
};
|
|
95
|
-
//#endregion
|
|
96
|
-
export { pluginResource };
|