@plitzi/sdk-server 0.32.3 → 0.32.5
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 +18 -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 +11 -11
- package/dist/index.js +19 -6
- package/dist/modules/ai/AIEngine.js +4 -4
- package/dist/modules/ai/toolkit.js +58 -0
- package/dist/modules/mcp/constants.js +4 -0
- package/dist/modules/mcp/handler.js +15 -21
- package/dist/modules/mcp/helpers/computeVersion.js +16 -0
- package/dist/modules/mcp/helpers/guide.js +130 -0
- package/dist/modules/mcp/helpers/opResult.js +18 -0
- package/dist/modules/mcp/helpers/space.js +137 -0
- package/dist/modules/mcp/previewClient.js +31 -0
- package/dist/modules/mcp/resources/canonical.js +45 -0
- package/dist/modules/mcp/resources/core.js +14 -0
- package/dist/modules/mcp/resources/envelope.js +14 -0
- package/dist/modules/mcp/resources/primer.js +25 -0
- package/dist/modules/mcp/resources/register.js +142 -0
- package/dist/modules/mcp/resources/router.js +25 -0
- package/dist/modules/mcp/resources/schema.js +33 -0
- package/dist/modules/mcp/resources/style.js +27 -0
- package/dist/modules/mcp/screenshotClient.js +47 -0
- package/dist/modules/mcp/server.js +52 -20
- package/dist/modules/mcp/tools/apply/dispatch.js +83 -0
- package/dist/modules/mcp/tools/apply/index.js +121 -0
- package/dist/modules/mcp/tools/apply/writeResult.js +36 -0
- package/dist/modules/mcp/tools/index.js +20 -148
- package/dist/modules/mcp/tools/operations/index.js +30 -0
- package/dist/modules/mcp/tools/operations/schema/deleteElement.js +25 -0
- package/dist/modules/mcp/tools/operations/schema/deleteFolder.js +30 -0
- package/dist/modules/mcp/tools/operations/schema/deletePage.js +22 -0
- package/dist/modules/mcp/tools/operations/schema/deleteVariable.js +18 -0
- package/dist/modules/mcp/tools/operations/schema/moveElement.js +39 -0
- package/dist/modules/mcp/tools/operations/schema/operations.js +25 -0
- package/dist/modules/mcp/tools/operations/schema/patchElement.js +46 -0
- package/dist/modules/mcp/tools/operations/schema/registry.js +55 -0
- package/dist/modules/mcp/tools/operations/schema/shared.js +27 -0
- package/dist/modules/mcp/tools/operations/schema/translator.js +148 -0
- package/dist/modules/mcp/tools/operations/schema/upsertElement.js +59 -0
- package/dist/modules/mcp/tools/operations/schema/upsertFolder.js +49 -0
- package/dist/modules/mcp/tools/operations/schema/upsertPage.js +64 -0
- package/dist/modules/mcp/tools/operations/schema/upsertVariable.js +42 -0
- package/dist/modules/mcp/tools/operations/schema/write.js +44 -0
- package/dist/modules/mcp/tools/operations/style/cssCatalog.js +132 -0
- package/dist/modules/mcp/tools/operations/style/deleteDefinition.js +20 -0
- package/dist/modules/mcp/tools/operations/style/deleteGlobalStyle.js +20 -0
- package/dist/modules/mcp/tools/operations/style/deleteStyleVariable.js +21 -0
- package/dist/modules/mcp/tools/operations/style/operations.js +21 -0
- package/dist/modules/mcp/tools/operations/style/patchDefinition.js +27 -0
- package/dist/modules/mcp/tools/operations/style/patchGlobalStyle.js +27 -0
- package/dist/modules/mcp/tools/operations/style/shared.js +59 -0
- package/dist/modules/mcp/tools/operations/style/translator.js +77 -0
- package/dist/modules/mcp/tools/operations/style/upsertDefinition.js +23 -0
- package/dist/modules/mcp/tools/operations/style/upsertGlobalStyle.js +23 -0
- package/dist/modules/mcp/tools/operations/style/upsertStyleVariable.js +22 -0
- package/dist/modules/mcp/tools/operations/style/write.js +100 -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 +108 -0
- package/dist/modules/mcp/tools/shared/tool.js +26 -0
- package/dist/modules/mcp/tools/shared/validator.js +262 -0
- package/dist/modules/mcp/tools/validate.js +19 -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/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/constants.d.ts +1 -0
- package/dist/src/modules/mcp/handler.d.ts +6 -3
- package/dist/src/modules/mcp/helpers/computeVersion.d.ts +1 -0
- package/dist/src/modules/mcp/helpers/guide.d.ts +2 -0
- package/dist/src/modules/mcp/helpers/index.d.ts +4 -0
- package/dist/src/modules/mcp/helpers/opResult.d.ts +13 -0
- package/dist/src/modules/mcp/helpers/space.d.ts +49 -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 +7 -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 +8 -10
- package/dist/src/modules/mcp/resources/primer.d.ts +6 -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 +18 -3
- package/dist/src/modules/mcp/tools/apply/dispatch.d.ts +6 -0
- package/dist/src/modules/mcp/tools/apply/index.d.ts +231 -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 +449 -0
- package/dist/src/modules/mcp/tools/operations/schema/deleteElement.d.ts +10 -0
- package/dist/src/modules/mcp/tools/operations/schema/deleteFolder.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/schema/deletePage.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/schema/deleteVariable.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/schema/index.d.ts +14 -0
- package/dist/src/modules/mcp/tools/operations/schema/moveElement.d.ts +16 -0
- package/dist/src/modules/mcp/tools/operations/schema/operations.d.ts +79 -0
- package/dist/src/modules/mcp/tools/operations/schema/patchElement.d.ts +17 -0
- package/dist/src/modules/mcp/tools/operations/schema/registry.d.ts +22 -0
- package/dist/src/modules/mcp/tools/operations/schema/shared.d.ts +24 -0
- package/dist/src/modules/mcp/tools/operations/schema/translator.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/schema/upsertElement.d.ts +16 -0
- package/dist/src/modules/mcp/tools/operations/schema/upsertFolder.d.ts +12 -0
- package/dist/src/modules/mcp/tools/operations/schema/upsertPage.d.ts +13 -0
- package/dist/src/modules/mcp/tools/operations/schema/upsertVariable.d.ts +16 -0
- package/dist/src/modules/mcp/tools/operations/schema/write.d.ts +12 -0
- package/dist/src/modules/mcp/tools/operations/style/cssCatalog.d.ts +10 -0
- package/dist/src/modules/mcp/tools/operations/style/deleteDefinition.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/style/deleteGlobalStyle.d.ts +9 -0
- package/dist/src/modules/mcp/tools/operations/style/deleteStyleVariable.d.ts +15 -0
- package/dist/src/modules/mcp/tools/operations/style/index.d.ts +12 -0
- package/dist/src/modules/mcp/tools/operations/style/operations.d.ts +163 -0
- package/dist/src/modules/mcp/tools/operations/style/patchDefinition.d.ts +37 -0
- package/dist/src/modules/mcp/tools/operations/style/patchGlobalStyle.d.ts +37 -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 +9 -0
- package/dist/src/modules/mcp/tools/operations/style/upsertDefinition.d.ts +37 -0
- package/dist/src/modules/mcp/tools/operations/style/upsertGlobalStyle.d.ts +37 -0
- package/dist/src/modules/mcp/tools/operations/style/upsertStyleVariable.d.ts +20 -0
- package/dist/src/modules/mcp/tools/operations/style/write.d.ts +17 -0
- package/dist/src/modules/mcp/tools/preview.d.ts +226 -0
- package/dist/src/modules/mcp/tools/read.d.ts +8 -0
- package/dist/src/modules/mcp/tools/screenshot.d.ts +231 -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.d.ts +4 -0
- package/dist/src/modules/mcp/tools/validate.d.ts +228 -0
- package/dist/src/modules/mcp/types/aiSchema.d.ts +126 -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 +10 -10
- 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/resources/resources.test.d.ts +0 -1
- 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/segmentElements.test.d.ts +0 -1
- 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/segmentVariables.test.d.ts +0 -1
- 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 → mcp.test.d.ts} +0 -0
|
@@ -2,7 +2,7 @@ import { ComponentProps } from './Component';
|
|
|
2
2
|
import { TtlCache } from '../../helpers/cache';
|
|
3
3
|
import { RequestMetrics } from '../../helpers/metrics';
|
|
4
4
|
import { PluginManager } from '../../plugins/manager';
|
|
5
|
-
import { Environment, PluginEntry, SSRRequest, SSRServerConfig, SSRTemplateProps } from '@plitzi/sdk-shared';
|
|
5
|
+
import { Environment, OfflineDataRaw, PluginEntry, SSRRequest, SSRServerConfig, SSRTemplateProps } from '@plitzi/sdk-shared';
|
|
6
6
|
export type RenderPrep = {
|
|
7
7
|
componentProps: ComponentProps;
|
|
8
8
|
entries: PluginEntry[];
|
|
@@ -10,4 +10,4 @@ export type RenderPrep = {
|
|
|
10
10
|
offlineData: string;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
export declare const prepareRender: (req: SSRRequest, config: SSRServerConfig, spaceId: number, environment: Environment, revision: number, pluginManager: PluginManager, offlineDataCache?: TtlCache<string>, metrics?: RequestMetrics) => Promise<RenderPrep>;
|
|
13
|
+
export declare const prepareRender: (req: SSRRequest, config: SSRServerConfig, spaceId: number, environment: Environment, revision: number, pluginManager: PluginManager, offlineDataCache?: TtlCache<string>, metrics?: RequestMetrics, offlineDataOverride?: OfflineDataRaw) => Promise<RenderPrep>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PREVIEW_TOKEN_PARAM } from '../mcp/constants';
|
|
2
|
+
import { ServerCaches } from '../../helpers/cache';
|
|
3
|
+
import { PluginManager } from '../../plugins/manager';
|
|
4
|
+
import { PreviewRequestBody, PreviewResult } from '../mcp/types';
|
|
5
|
+
import { DraftStore, OfflineDataRaw, SSRRequest, SSRServerConfig, SSRTemplateFn } from '@plitzi/sdk-shared';
|
|
6
|
+
export { PREVIEW_TOKEN_PARAM };
|
|
7
|
+
/** In-memory one-shot draft store — the default when the consumer injects none. Fine for a single replica;
|
|
8
|
+
* a multi-replica deployment must inject a shared store so a preview URL resolves on any replica. */
|
|
9
|
+
export declare const createMemoryDraftStore: () => DraftStore;
|
|
10
|
+
/** Consume the draft override for a render, if the request carries a valid preview token. Returns undefined on
|
|
11
|
+
* a normal request (renders persisted state) or when the token is unknown/expired (one-shot / TTL). */
|
|
12
|
+
export declare const takeDraftOverride: (req: SSRRequest, config: SSRServerConfig) => Promise<OfflineDataRaw | undefined>;
|
|
13
|
+
/** Build a preview of a page: apply any unsaved `operations` to a clone (never persisted), render the resulting
|
|
14
|
+
* draft to full HTML via the SSR pipeline, and stash the draft under a one-shot token so a browser can fetch
|
|
15
|
+
* the exact same render at `?__pt=<token>` (for screenshots). With no operations it previews persisted state. */
|
|
16
|
+
export declare const createPreview: (body: PreviewRequestBody, config: SSRServerConfig, renderFn: SSRTemplateFn, pluginManager: PluginManager, caches: ServerCaches) => Promise<PreviewResult>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TtlCache } from '../../helpers/cache';
|
|
2
2
|
import { RequestMetrics } from '../../helpers/metrics';
|
|
3
3
|
import { PluginManager } from '../../plugins/manager';
|
|
4
|
-
import { Environment, SSRRequest, SSRResponseHelpers, SSRServerConfig, SSRTemplateFn } from '@plitzi/sdk-shared';
|
|
5
|
-
export declare const streamBody: (req: SSRRequest, res: SSRResponseHelpers, config: SSRServerConfig, spaceId: number, environment: Environment, revision: number, renderFn: SSRTemplateFn, pluginManager: PluginManager, offlineDataCache?: TtlCache<string>, htmlCache?: TtlCache<string>, cacheKey?: string, metrics?: RequestMetrics) => Promise<void>;
|
|
4
|
+
import { Environment, OfflineDataRaw, SSRRequest, SSRResponseHelpers, SSRServerConfig, SSRTemplateFn } from '@plitzi/sdk-shared';
|
|
5
|
+
export declare const streamBody: (req: SSRRequest, res: SSRResponseHelpers, config: SSRServerConfig, spaceId: number, environment: Environment, revision: number, renderFn: SSRTemplateFn, pluginManager: PluginManager, offlineDataCache?: TtlCache<string>, htmlCache?: TtlCache<string>, cacheKey?: string, metrics?: RequestMetrics, offlineDataOverride?: OfflineDataRaw) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-server",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.5",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
26
|
-
"@plitzi/plitzi-sdk": "0.32.
|
|
27
|
-
"@plitzi/sdk-shared": "0.32.
|
|
26
|
+
"@plitzi/plitzi-sdk": "0.32.5",
|
|
27
|
+
"@plitzi/sdk-shared": "0.32.5",
|
|
28
28
|
"ejs": "^6.0.1",
|
|
29
29
|
"esbuild": "^0.28.1",
|
|
30
30
|
"zod": "^4.4.3"
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/ejs": "^3.1.5",
|
|
38
|
-
"@types/node": "^26.
|
|
38
|
+
"@types/node": "^26.1.1",
|
|
39
39
|
"@types/react": "^19.2.17",
|
|
40
|
-
"@vitejs/plugin-react": "^6.0.
|
|
41
|
-
"@vitest/coverage-v8": "^4.1.
|
|
40
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
41
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
42
42
|
"eslint": "^9.39.4",
|
|
43
43
|
"eslint-plugin-import": "^2.32.0",
|
|
44
44
|
"react": "^19.2.7",
|
|
45
45
|
"react-dom": "^19.2.7",
|
|
46
|
-
"tsx": "^4.
|
|
46
|
+
"tsx": "^4.23.0",
|
|
47
47
|
"typescript": "^6.0.3",
|
|
48
|
-
"vite": "^8.
|
|
49
|
-
"vite-plugin-dts": "^5.0.
|
|
50
|
-
"vitest": "^4.1.
|
|
48
|
+
"vite": "^8.1.4",
|
|
49
|
+
"vite-plugin-dts": "^5.0.3",
|
|
50
|
+
"vitest": "^4.1.10"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"start:dev": "node --import ./src/standalone/register-alias.mjs --watch src/standalone/server.ts",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __exportAll = (all, no_symbols) => {
|
|
4
|
-
let target = {};
|
|
5
|
-
for (var name in all) __defProp(target, name, {
|
|
6
|
-
get: all[name],
|
|
7
|
-
enumerable: true
|
|
8
|
-
});
|
|
9
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
-
return target;
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
export { __exportAll };
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { parseRequest, readRawBody } from "./requestParser.js";
|
|
2
|
-
import { serveStatic } from "./staticFiles.js";
|
|
3
|
-
import { buildResponseHelpers } from "../helpers/buildResponseHelpers.js";
|
|
4
|
-
import { runMiddlewares } from "../helpers/runMiddlewares.js";
|
|
5
|
-
import { authMiddleware } from "../middlewares/auth.js";
|
|
6
|
-
import { basicAuthMiddleware } from "../middlewares/basicAuth.js";
|
|
7
|
-
import { spaceDeploymentMiddleware } from "../middlewares/spaceDeployment.js";
|
|
8
|
-
import { handleMcp } from "../modules/mcp/handler.js";
|
|
9
|
-
import { handleRsc } from "../modules/rsc/handler.js";
|
|
10
|
-
import { renderSSR } from "../modules/ssr/handler.js";
|
|
11
|
-
import path from "node:path";
|
|
12
|
-
import { fileURLToPath } from "node:url";
|
|
13
|
-
//#region src/core/requestHandler.ts
|
|
14
|
-
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
15
|
-
var BUILTIN_PUBLIC_DIR = path.resolve(__dirname, "../public");
|
|
16
|
-
var safeRedirectTarget = (req) => {
|
|
17
|
-
const redirectParam = req.query["redirect"];
|
|
18
|
-
return redirectParam && redirectParam.startsWith("/") && !redirectParam.startsWith("//") ? redirectParam : "/";
|
|
19
|
-
};
|
|
20
|
-
var handleRequest = async (raw, rawRes, config, port, renderFn, caches, pluginManager) => {
|
|
21
|
-
const req = parseRequest(raw);
|
|
22
|
-
const res = buildResponseHelpers(rawRes, req.headers["accept-encoding"]);
|
|
23
|
-
if (req.path === "\0") {
|
|
24
|
-
res.setStatus(400);
|
|
25
|
-
res.end();
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
29
|
-
res.setHeader("Referrer-Policy", "strict-origin-when-cross-origin");
|
|
30
|
-
res.setHeader("X-DNS-Prefetch-Control", "off");
|
|
31
|
-
const frameOptions = config.frameOptions === void 0 ? "DENY" : config.frameOptions;
|
|
32
|
-
if (frameOptions) if (Array.isArray(frameOptions)) res.setHeader("Content-Security-Policy", `frame-ancestors ${frameOptions.join(" ")}`);
|
|
33
|
-
else {
|
|
34
|
-
res.setHeader("X-Frame-Options", frameOptions);
|
|
35
|
-
res.setHeader("Content-Security-Policy", `frame-ancestors '${frameOptions === "DENY" ? "none" : "self"}'`);
|
|
36
|
-
}
|
|
37
|
-
if ((config.httpVersion ?? 2) >= 3) res.setHeader("Alt-Svc", `h3=":${port}"; ma=86400`);
|
|
38
|
-
if (serveStatic(req, res, BUILTIN_PUBLIC_DIR)) return;
|
|
39
|
-
if (config.publicDir && serveStatic(req, res, config.publicDir)) return;
|
|
40
|
-
if (req.path.startsWith("/.well-known/")) {
|
|
41
|
-
res.setStatus(404);
|
|
42
|
-
res.end();
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (req.path.startsWith(pluginManager.urlPrefix + "/")) {
|
|
46
|
-
const relative = req.path.slice(pluginManager.urlPrefix.length);
|
|
47
|
-
const pluginName = relative.split("/")[1];
|
|
48
|
-
if (pluginName && pluginManager.hasPlugin(pluginName)) {
|
|
49
|
-
await pluginManager.prepare(pluginName);
|
|
50
|
-
if (serveStatic({
|
|
51
|
-
...req,
|
|
52
|
-
path: relative
|
|
53
|
-
}, res, pluginManager.outputDir)) return;
|
|
54
|
-
}
|
|
55
|
-
res.setStatus(404);
|
|
56
|
-
res.send("Not found");
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const loginPath = config.loginPath === false ? null : config.loginPath ?? "/auth/login";
|
|
60
|
-
if (loginPath && req.method === "POST" && req.path === loginPath) {
|
|
61
|
-
req.body = await readRawBody(raw);
|
|
62
|
-
const isLoggedIn = await config.adapters.onLogin?.(req, res);
|
|
63
|
-
if (req.headers["sec-fetch-mode"] === "navigate") {
|
|
64
|
-
res.setStatus(303);
|
|
65
|
-
res.setHeader("Location", isLoggedIn ? safeRedirectTarget(req) : loginPath);
|
|
66
|
-
res.end();
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
res.setStatus(isLoggedIn ? 200 : 401);
|
|
70
|
-
res.end();
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const logoutPath = config.logoutPath === false ? null : config.logoutPath ?? "/auth/logout";
|
|
74
|
-
if (logoutPath && req.method === "POST" && req.path === logoutPath) {
|
|
75
|
-
req.body = await readRawBody(raw);
|
|
76
|
-
await config.adapters.onLogout?.(req, res);
|
|
77
|
-
if (req.headers["sec-fetch-mode"] === "navigate") {
|
|
78
|
-
res.setStatus(303);
|
|
79
|
-
res.setHeader("Location", safeRedirectTarget(req));
|
|
80
|
-
res.end();
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
res.setStatus(204);
|
|
84
|
-
res.end();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (config.static) for (const [prefix, rootDir] of Object.entries(config.static)) {
|
|
88
|
-
const normalizedPrefix = prefix.endsWith("/") ? prefix : `${prefix}/`;
|
|
89
|
-
if (req.path === prefix || req.path.startsWith(normalizedPrefix)) {
|
|
90
|
-
if (serveStatic({
|
|
91
|
-
...req,
|
|
92
|
-
path: req.path.slice(prefix.length) || "/"
|
|
93
|
-
}, res, rootDir)) return;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const mcpPath = config.mcp?.path ?? "/mcp";
|
|
97
|
-
if (config.mcp && (config.mcp.enabled ?? true) && req.path.startsWith(mcpPath)) {
|
|
98
|
-
await handleMcp(raw, rawRes, config.mcp);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
if (await runMiddlewares([
|
|
102
|
-
spaceDeploymentMiddleware(config.adapters),
|
|
103
|
-
basicAuthMiddleware({ cacheTtlMs: config.cacheTtlMs }),
|
|
104
|
-
authMiddleware(config.adapters),
|
|
105
|
-
...config.middlewares || []
|
|
106
|
-
], req, res) || res.status !== 200) return;
|
|
107
|
-
const rscPath = config.rsc?.path ?? "/_rsc";
|
|
108
|
-
if ((config.rsc?.enabled ?? !!config.adapters.getRscData) && req.method === "GET" && req.path === rscPath) {
|
|
109
|
-
await handleRsc(req, res, config, pluginManager, caches.rsc);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
await renderSSR(req, res, config, renderFn, pluginManager, caches);
|
|
113
|
-
};
|
|
114
|
-
var makeHandler = (config, port, renderFn, caches, pluginManager) => {
|
|
115
|
-
return (raw, rawRes) => {
|
|
116
|
-
handleRequest(raw, rawRes, config, port, renderFn, caches, pluginManager).catch((err) => {
|
|
117
|
-
console.error("[SSR] Unhandled error:", err);
|
|
118
|
-
try {
|
|
119
|
-
if (!rawRes.headersSent) rawRes.writeHead(500, { "Content-Type": "text/plain" });
|
|
120
|
-
rawRes.end("Internal Server Error");
|
|
121
|
-
} catch {}
|
|
122
|
-
});
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
//#endregion
|
|
126
|
-
export { makeHandler };
|
|
@@ -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 };
|