@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
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { computeVersion } from "../mcp/helpers/computeVersion.js";
|
|
2
|
+
import { cloneSpace, findPageByRef, getPageElements } from "../mcp/helpers/space.js";
|
|
3
|
+
import { applyOperations } from "../mcp/tools/apply/dispatch.js";
|
|
4
|
+
import { validateOperations } from "../mcp/tools/shared/validator/index.js";
|
|
5
|
+
import { PREVIEW_TOKEN_PARAM } from "../mcp/constants.js";
|
|
6
|
+
import { buildBody } from "./buildBody.js";
|
|
7
|
+
import { randomUUID } from "node:crypto";
|
|
8
|
+
//#region src/modules/ssr/preview.ts
|
|
9
|
+
/** In-memory one-shot draft store — the default when the consumer injects none. Fine for a single replica;
|
|
10
|
+
* a multi-replica deployment must inject a shared store so a preview URL resolves on any replica. */
|
|
11
|
+
var createMemoryDraftStore = () => {
|
|
12
|
+
const store = /* @__PURE__ */ new Map();
|
|
13
|
+
return {
|
|
14
|
+
put(token, data, ttlMs) {
|
|
15
|
+
store.set(token, {
|
|
16
|
+
data,
|
|
17
|
+
expiresAt: Date.now() + ttlMs
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
take(token) {
|
|
21
|
+
const hit = store.get(token);
|
|
22
|
+
if (!hit) return;
|
|
23
|
+
store.delete(token);
|
|
24
|
+
return hit.expiresAt > Date.now() ? hit.data : void 0;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/** Consume the draft override for a render, if the request carries a valid preview token. Returns undefined on
|
|
29
|
+
* a normal request (renders persisted state) or when the token is unknown/expired (one-shot / TTL). */
|
|
30
|
+
var takeDraftOverride = async (req, config) => {
|
|
31
|
+
const token = req.query[PREVIEW_TOKEN_PARAM];
|
|
32
|
+
if (!token || !config.draftStore) return;
|
|
33
|
+
return config.draftStore.take(token);
|
|
34
|
+
};
|
|
35
|
+
var resolvePagePath = (schema, pageRef) => {
|
|
36
|
+
const pages = getPageElements(schema);
|
|
37
|
+
const page = pageRef ? findPageByRef(schema, pageRef) : pages.find((p) => p.attributes.default) ?? pages[0];
|
|
38
|
+
const slug = page && typeof page.attributes.slug === "string" ? page.attributes.slug : "";
|
|
39
|
+
return slug.startsWith("/") ? slug : `/${slug}`;
|
|
40
|
+
};
|
|
41
|
+
var syntheticRequest = (pagePath) => ({
|
|
42
|
+
method: "GET",
|
|
43
|
+
path: pagePath,
|
|
44
|
+
search: "",
|
|
45
|
+
url: pagePath,
|
|
46
|
+
hostname: "localhost",
|
|
47
|
+
protocol: "https",
|
|
48
|
+
headers: {},
|
|
49
|
+
query: {},
|
|
50
|
+
ctx: {}
|
|
51
|
+
});
|
|
52
|
+
/** Build a preview of a page: apply any unsaved `operations` to a clone (never persisted), render the resulting
|
|
53
|
+
* draft to full HTML via the SSR pipeline, and stash the draft under a one-shot token so a browser can fetch
|
|
54
|
+
* the exact same render at `?__pt=<token>` (for screenshots). With no operations it previews persisted state. */
|
|
55
|
+
var createPreview = async (body, config, renderFn, pluginManager, caches) => {
|
|
56
|
+
const env = body.env ?? "main";
|
|
57
|
+
const revision = 0;
|
|
58
|
+
const offlineData = await config.adapters.getOfflineData(body.spaceId, env, revision);
|
|
59
|
+
if (!offlineData) return {
|
|
60
|
+
ok: false,
|
|
61
|
+
error: "NO_DATA",
|
|
62
|
+
message: `No offline data for space ${body.spaceId} (${env}).`
|
|
63
|
+
};
|
|
64
|
+
let draftOffline = offlineData;
|
|
65
|
+
if (body.operations && body.operations.length > 0) {
|
|
66
|
+
const draft = cloneSpace({
|
|
67
|
+
schema: offlineData.schema,
|
|
68
|
+
style: offlineData.style
|
|
69
|
+
});
|
|
70
|
+
const validation = validateOperations(draft, body.operations);
|
|
71
|
+
if (!validation.valid) return {
|
|
72
|
+
ok: false,
|
|
73
|
+
error: "INVALID_OPERATIONS",
|
|
74
|
+
message: "The operations did not validate.",
|
|
75
|
+
errors: validation.errors
|
|
76
|
+
};
|
|
77
|
+
const outcome = applyOperations(draft, env, body.operations);
|
|
78
|
+
if (outcome.errors.length > 0) return {
|
|
79
|
+
ok: false,
|
|
80
|
+
error: "APPLY_FAILED",
|
|
81
|
+
message: "The operations could not be applied.",
|
|
82
|
+
errors: outcome.errors
|
|
83
|
+
};
|
|
84
|
+
draftOffline = {
|
|
85
|
+
...offlineData,
|
|
86
|
+
schema: draft.schema,
|
|
87
|
+
style: draft.style
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const pagePath = resolvePagePath(draftOffline.schema, body.pageRef);
|
|
91
|
+
const { body: html } = await buildBody(syntheticRequest(pagePath), config, body.spaceId, env, revision, renderFn, pluginManager, caches.offlineData, void 0, draftOffline);
|
|
92
|
+
let token;
|
|
93
|
+
if (config.draftStore) {
|
|
94
|
+
token = randomUUID();
|
|
95
|
+
await config.draftStore.put(token, draftOffline, config.preview?.ttlMs ?? 6e4);
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
ok: true,
|
|
99
|
+
token,
|
|
100
|
+
pagePath,
|
|
101
|
+
html: html ?? "",
|
|
102
|
+
stateVersion: computeVersion(draftOffline)
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
//#endregion
|
|
106
|
+
export { PREVIEW_TOKEN_PARAM, createMemoryDraftStore, createPreview, takeDraftOverride };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
1
|
import crypto from "node:crypto";
|
|
3
2
|
import fs from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
4
|
//#region src/modules/ssr/registerExternalPlugins.ts
|
|
5
5
|
var MANIFEST_TTL_MS = 600 * 1e3;
|
|
6
6
|
var manifestCache = /* @__PURE__ */ new Map();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { applySSRResult } from "./applySSRResult.js";
|
|
2
1
|
import Component from "./Component.js";
|
|
3
2
|
import { prepareRender } from "./prepareRender.js";
|
|
3
|
+
import { applySSRResult } from "./applySSRResult.js";
|
|
4
4
|
import { renderToPipeableStream } from "react-dom/server";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { Writable } from "node:stream";
|
|
7
7
|
//#region src/modules/ssr/streamBody.tsx
|
|
8
8
|
var SSR_SENTINEL = "<!--SSR_CONTENT-->";
|
|
9
|
-
var streamBody = async (req, res, config, spaceId, environment, revision, renderFn, pluginManager, offlineDataCache, htmlCache, cacheKey, metrics) => {
|
|
10
|
-
const prep = await prepareRender(req, config, spaceId, environment, revision, pluginManager, offlineDataCache, metrics);
|
|
9
|
+
var streamBody = async (req, res, config, spaceId, environment, revision, renderFn, pluginManager, offlineDataCache, htmlCache, cacheKey, metrics, offlineDataOverride) => {
|
|
10
|
+
const prep = await prepareRender(req, config, spaceId, environment, revision, pluginManager, offlineDataCache, metrics, offlineDataOverride);
|
|
11
11
|
const templateStart = metrics ? performance.now() : 0;
|
|
12
12
|
const fullTemplate = renderFn({
|
|
13
13
|
...prep.templateParams,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
2
|
import fs from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
4
|
import ejs from "ejs";
|
|
5
5
|
//#region src/modules/ssr/template.ts
|
|
6
6
|
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
11
11
|
<link rel="preconnect" href="https://cdn.plitzi.com" />
|
|
12
12
|
|
|
13
|
+
<% if (!locals.ssrOnly) { %>
|
|
13
14
|
<link rel="modulepreload" href="<%= locals.react || '' %>" crossorigin />
|
|
14
15
|
<link rel="modulepreload" href="<%= locals.reactDom || '' %>" crossorigin />
|
|
15
16
|
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
</script>
|
|
29
|
+
<% } %>
|
|
28
30
|
|
|
29
31
|
<link
|
|
30
32
|
rel="preload"
|
package/dist/plugins/compile.js
CHANGED
package/dist/plugins/copy.js
CHANGED
package/dist/plugins/manager.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { compilePlugin } from "./compile.js";
|
|
2
2
|
import { copyPlugin } from "./copy.js";
|
|
3
3
|
import { detectAction, isComponentSource } from "./detect.js";
|
|
4
|
-
import path from "node:path";
|
|
5
4
|
import fs from "node:fs/promises";
|
|
5
|
+
import path from "node:path";
|
|
6
6
|
//#region src/plugins/manager.ts
|
|
7
7
|
var META_FILE = "meta.json";
|
|
8
8
|
var DEFAULT_TTL_MS = 10080 * 60 * 1e3;
|
package/dist/server.js
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
|
-
import { createSSRServer } from "./core/
|
|
1
|
+
import { createSSRServer } from "./core/server/ssrServer.js";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { readFileSync } from "node:fs";
|
|
5
5
|
//#region src/standalone/server.ts
|
|
6
6
|
var PORT = parseInt(process.env.SSR_PORT ?? "3002", 10);
|
|
7
7
|
var HOST = process.env.SSR_HOST ?? "0.0.0.0";
|
|
8
|
+
var spacePath = () => path.resolve(__dirname, "schemas/basic", "space.json");
|
|
9
|
+
var stylePath = () => path.resolve(__dirname, "schemas/basic", "style.json");
|
|
10
|
+
var readSchema = () => JSON.parse(readFileSync(spacePath(), "utf-8")).schema;
|
|
11
|
+
var readStyle = () => JSON.parse(readFileSync(stylePath(), "utf-8"));
|
|
8
12
|
var getOfflineData = () => {
|
|
9
|
-
const fileSchema = JSON.parse(readFileSync(path.resolve(__dirname, "schemas/basic", "space.json"), "utf-8"));
|
|
10
|
-
const style = JSON.parse(readFileSync(path.resolve(__dirname, "schemas/basic", "style.json"), "utf-8"));
|
|
11
13
|
const offlineData = {
|
|
12
|
-
schema:
|
|
13
|
-
style
|
|
14
|
+
schema: readSchema(),
|
|
15
|
+
style: readStyle()
|
|
14
16
|
};
|
|
15
17
|
console.warn("[SSR] getOfflineData: using stub adapter — returning spaceId=1");
|
|
16
18
|
return Promise.resolve(offlineData);
|
|
17
19
|
};
|
|
20
|
+
var getSpaceId = () => Promise.resolve(1);
|
|
21
|
+
var getSchema = () => Promise.resolve(readSchema());
|
|
22
|
+
var getStyle = () => Promise.resolve(readStyle());
|
|
23
|
+
var saveSchema = (_spaceId, _environment, schema) => {
|
|
24
|
+
writeFileSync(spacePath(), JSON.stringify({ schema }, null, 2));
|
|
25
|
+
return Promise.resolve();
|
|
26
|
+
};
|
|
27
|
+
var saveStyle = (_spaceId, _environment, style) => {
|
|
28
|
+
writeFileSync(stylePath(), JSON.stringify(style, null, 2));
|
|
29
|
+
return Promise.resolve();
|
|
30
|
+
};
|
|
18
31
|
var getSpaceDeployment = () => {
|
|
19
32
|
console.warn("[SSR] getSpaceDeployment: using stub adapter — returning spaceId=1");
|
|
20
33
|
return Promise.resolve({
|
|
@@ -45,13 +58,24 @@ var getRscData = async (_req, _spaceId, _environment, _revision, user, ids) => {
|
|
|
45
58
|
};
|
|
46
59
|
return { serverData: ids?.length ? Object.fromEntries(ids.filter((id) => id in all).map((id) => [id, all[id]])) : all };
|
|
47
60
|
};
|
|
61
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
62
|
+
var __dirname = path.dirname(__filename);
|
|
63
|
+
var saveOfflineData = (_spaceId, _environment, data) => {
|
|
64
|
+
writeFileSync(spacePath(), JSON.stringify({ schema: data.schema }, null, 2));
|
|
65
|
+
writeFileSync(stylePath(), JSON.stringify(data.style, null, 2));
|
|
66
|
+
return Promise.resolve();
|
|
67
|
+
};
|
|
48
68
|
var adapters = {
|
|
49
69
|
getOfflineData,
|
|
50
70
|
getSpaceDeployment,
|
|
51
|
-
getRscData
|
|
71
|
+
getRscData,
|
|
72
|
+
saveOfflineData,
|
|
73
|
+
getSpaceId,
|
|
74
|
+
getSchema,
|
|
75
|
+
getStyle,
|
|
76
|
+
saveSchema,
|
|
77
|
+
saveStyle
|
|
52
78
|
};
|
|
53
|
-
var __filename = fileURLToPath(import.meta.url);
|
|
54
|
-
var __dirname = path.dirname(__filename);
|
|
55
79
|
createSSRServer({
|
|
56
80
|
port: PORT,
|
|
57
81
|
host: HOST,
|
|
@@ -59,6 +83,7 @@ createSSRServer({
|
|
|
59
83
|
devMode: false,
|
|
60
84
|
static: { "/sdk-assets": path.resolve(process.cwd(), "../sdk/dist") },
|
|
61
85
|
httpVersion: 1,
|
|
86
|
+
mcpAi: { enabled: true },
|
|
62
87
|
plugins: {
|
|
63
88
|
serverInfo: {
|
|
64
89
|
js: path.resolve(__dirname, "plugins/ServerInfo.tsx"),
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { SSRServer, SSRServerConfig } from '@plitzi/sdk-shared';
|
|
2
|
-
export
|
|
2
|
+
export { createSSRServer } from './server/ssrServer';
|
|
3
|
+
export { createMCPServer } from './server/mcpServer';
|
|
4
|
+
export { resolveServices } from './services/resolve';
|
|
5
|
+
export type { ResolvedServices } from './services/resolve';
|
|
6
|
+
export declare const createServer: (config: SSRServerConfig) => SSRServer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type HealthCheckApp = {
|
|
2
|
+
get: (path: string, handler: (...args: any[]) => void) => void;
|
|
3
|
+
};
|
|
4
|
+
export interface HealthIdentity {
|
|
5
|
+
role: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
version?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const buildHealthPayload: (identity?: Partial<HealthIdentity>) => Record<string, unknown>;
|
|
10
|
+
export declare const registerHealthCheck: (app: HealthCheckApp, identity: HealthIdentity) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseContext, Stage } from './types';
|
|
2
|
+
import { RawResponse } from '../../helpers/buildResponseHelpers';
|
|
3
|
+
import { Handler } from '../transports';
|
|
4
|
+
import { SSRRequest, SSRResponseHelpers } from '@plitzi/sdk-shared';
|
|
5
|
+
import { IncomingMessage } from 'node:http';
|
|
6
|
+
export type BuildContext<C extends BaseContext> = (raw: IncomingMessage, rawRes: RawResponse, req: SSRRequest, res: SSRResponseHelpers) => C;
|
|
7
|
+
export declare const makeHandler: <C extends BaseContext>(label: string, buildContext: BuildContext<C>, stages: Stage<C>[]) => Handler;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RawResponse } from '../../helpers/buildResponseHelpers';
|
|
2
|
+
import { ServerCaches } from '../../helpers/cache';
|
|
3
|
+
import { PluginManager } from '../../plugins/manager';
|
|
4
|
+
import { SSRRequest, SSRResponseHelpers, SSRServerConfig, SSRTemplateFn } from '@plitzi/sdk-shared';
|
|
5
|
+
import { IncomingMessage } from 'node:http';
|
|
6
|
+
export interface BaseContext {
|
|
7
|
+
raw: IncomingMessage;
|
|
8
|
+
rawRes: RawResponse;
|
|
9
|
+
req: SSRRequest;
|
|
10
|
+
res: SSRResponseHelpers;
|
|
11
|
+
config: SSRServerConfig;
|
|
12
|
+
port: number;
|
|
13
|
+
}
|
|
14
|
+
export interface SSRContext extends BaseContext {
|
|
15
|
+
renderFn: SSRTemplateFn;
|
|
16
|
+
caches: ServerCaches;
|
|
17
|
+
pluginManager: PluginManager;
|
|
18
|
+
}
|
|
19
|
+
export type Stage<C extends BaseContext = BaseContext> = (ctx: C) => boolean | Promise<boolean>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Handler } from '../transports';
|
|
2
|
+
import { CacheManager, PluginRegistry, SSRServer, SSRServerConfig } from '@plitzi/sdk-shared';
|
|
3
|
+
export interface HttpServerParts {
|
|
4
|
+
label: string;
|
|
5
|
+
cache: CacheManager | null;
|
|
6
|
+
plugins: PluginRegistry;
|
|
7
|
+
onDestroy?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const createHttpServer: (config: SSRServerConfig, makeHandlerForPort: (port: number) => Handler, parts: HttpServerParts) => SSRServer;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ResolvedServices } from './resolve';
|
|
2
|
+
import { BaseContext, SSRContext, Stage } from '../http/types';
|
|
3
|
+
export declare const buildSSRPipeline: (services: ResolvedServices) => Stage<SSRContext>[];
|
|
4
|
+
export declare const buildMCPPipeline: () => Stage<BaseContext>[];
|
|
@@ -6,13 +6,13 @@ export type CloseableServer = {
|
|
|
6
6
|
listen: (port: number, host: string, cb: () => void) => unknown;
|
|
7
7
|
};
|
|
8
8
|
export type Handler = (req: IncomingMessage, res: RawResponse) => void;
|
|
9
|
-
export declare const tlsOptions: (config: SSRServerConfig) => {
|
|
9
|
+
export declare const tlsOptions: (config: SSRServerConfig, label?: string) => {
|
|
10
10
|
key: string | Buffer<ArrayBufferLike>;
|
|
11
11
|
cert: string | Buffer<ArrayBufferLike>;
|
|
12
12
|
minVersion: "TLSv1.3";
|
|
13
13
|
};
|
|
14
14
|
export declare const protoLabel: (version: number, hasTls: boolean) => string;
|
|
15
|
-
export declare const buildTransport: (config: SSRServerConfig, handler: Handler, port: number) => {
|
|
15
|
+
export declare const buildTransport: (config: SSRServerConfig, handler: Handler, port: number, label?: string) => {
|
|
16
16
|
primary: CloseableServer;
|
|
17
17
|
h3?: CloseableServer;
|
|
18
18
|
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
export { createSSRServer } from './core/createServer';
|
|
1
|
+
export { createServer, createSSRServer, createMCPServer, resolveServices } from './core/createServer';
|
|
2
|
+
export { registerHealthCheck, buildHealthPayload } from './core/health';
|
|
3
|
+
export type { HealthCheckApp, HealthIdentity } from './core/health';
|
|
2
4
|
export { createJsonAdapters } from './adapters/jsonAdapters';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
+
export { AIEngine, toolResponseOk, toolResponseErr, zodToJsonSchema, getAllowedModes, bindTools, isToolActive, resolveToolHandler, isCallToolResult, toolResponseFromResult } from './modules/ai';
|
|
6
|
+
export { createMcpServer, handleMcp, serveMcp, readMcpBody, buildAgentGuide, createHttpPreviewClient, createHttpScreenshotClient } from './modules/mcp';
|
|
7
|
+
export { createPreview, createMemoryDraftStore, PREVIEW_TOKEN_PARAM } from './modules/ssr/preview';
|
|
8
|
+
export { apply, search, read, validate, applyShape, searchShape, readShape, validateShape, operation, tools } from './modules/mcp/tools';
|
|
5
9
|
export type { JsonAdaptersConfig } from './adapters/jsonAdapters';
|
|
10
|
+
export type { ResolvedServices } from './core/createServer';
|
|
11
|
+
export type { McpServerContext, PreviewClient, PreviewRequestBody, PreviewResult, HttpPreviewClientConfig, ScreenshotClient, ScreenshotImage, ScreenshotResult, Viewport, HttpScreenshotClientConfig } from './modules/mcp';
|
|
12
|
+
export type { ApplyInput, SearchInput, SearchResponse, SearchHit, ReadInput, ReadResponse, ReadHit, ValidateInput, WriteResponse, WriteElement, Persisters, Operation, ToolDef, ToolContext } from './modules/mcp/tools';
|
|
13
|
+
export type { Space } from './modules/mcp/helpers';
|
|
14
|
+
export type { Env } from './modules/mcp/types';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { default as AIEngine } from './AIEngine';
|
|
2
2
|
export * from './AIEngine';
|
|
3
|
+
export { zodToJsonSchema, getAllowedModes, toolResponseOk, toolResponseErr, bindTools, isToolActive, resolveToolHandler, isCallToolResult, toolResponseFromResult } from './toolkit';
|
|
3
4
|
export { AIEngine };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { AiMode, McpContent, McpTool, McpToolHandler, McpToolHandlerResult, ToolOperationType } from '@plitzi/sdk-shared';
|
|
3
|
+
/** Convert a Zod schema to the JSON Schema an AI provider (Anthropic / OpenAI) expects in a tool definition.
|
|
4
|
+
* Delegates to Zod v4's built-in converter — one implementation, so descriptions, literal discriminators,
|
|
5
|
+
* enums, nested objects and recursive (z.lazy) shapes all survive and the provider sees the same contract an
|
|
6
|
+
* MCP client does. `io: 'input'` describes what the agent must SEND; `unrepresentable: 'any'` degrades an
|
|
7
|
+
* exotic type to an empty schema instead of throwing, so one unusual tool never breaks the whole tool list. */
|
|
8
|
+
export declare const zodToJsonSchema: (schema: unknown) => Record<string, unknown>;
|
|
9
|
+
export declare const firstText: (content: McpContent[]) => string | undefined;
|
|
10
|
+
export declare const getAllowedModes: (operationType: ToolOperationType) => AiMode[];
|
|
11
|
+
export declare const toolResponseOk: (data: unknown, agentMessage?: string) => McpToolHandlerResult;
|
|
12
|
+
export declare const toolResponseErr: (error: Error | string) => McpToolHandlerResult;
|
|
13
|
+
export declare const isCallToolResult: (result: unknown) => result is CallToolResult;
|
|
14
|
+
export declare const toolResponseFromResult: (result: CallToolResult) => McpToolHandlerResult;
|
|
15
|
+
export declare const isToolActive: (tool: McpTool) => boolean;
|
|
16
|
+
export declare const resolveToolHandler: (tool: McpTool) => McpToolHandler | undefined;
|
|
17
|
+
export declare const bindTools: (tools: McpTool[]) => McpTool[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ParamSpec } from './paramSpec';
|
|
2
|
+
export interface BuiltinGlobalCallback {
|
|
3
|
+
source: string;
|
|
4
|
+
title: string;
|
|
5
|
+
strictParams: boolean;
|
|
6
|
+
params: ParamSpec;
|
|
7
|
+
}
|
|
8
|
+
export declare const BUILTIN_GLOBAL_CALLBACKS: Record<string, BuiltinGlobalCallback>;
|
|
9
|
+
/** The built-in globalCallback for an action, or undefined when the action is not a known built-in (a plugin
|
|
10
|
+
* callback whose source/schema is not knowable here). */
|
|
11
|
+
export declare const getGlobalCallback: (action: string) => BuiltinGlobalCallback | undefined;
|
|
12
|
+
/** Report the param keys the agent supplied that are not valid for a built-in callback: only for CLOSED
|
|
13
|
+
* (`strictParams`) callbacks; open ones (collection) accept arbitrary field keys so nothing is unknown. Returns []
|
|
14
|
+
* for an unknown action (a plugin callback whose schema is not known here). */
|
|
15
|
+
export declare const unknownBuiltinParams: (action: string, params: Record<string, unknown>) => string[];
|
|
16
|
+
/** Resolve a `globalCallback` action against the built-in catalog: returns the module id it is registered under
|
|
17
|
+
* (`source`) and the params reconciled to the callback's schema — unknown keys dropped for a closed callback, then
|
|
18
|
+
* missing defaults filled. An action the catalog does not know (e.g. a plugin callback) yields no source and
|
|
19
|
+
* unchanged params, so the caller keeps its own behavior for it. */
|
|
20
|
+
export declare const applyBuiltinCallback: (action: string, params: Record<string, unknown>) => {
|
|
21
|
+
source?: string;
|
|
22
|
+
params: Record<string, unknown>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ParamSpec } from './paramSpec';
|
|
2
|
+
export interface BuiltinElementCallback {
|
|
3
|
+
title: string;
|
|
4
|
+
strictParams: boolean;
|
|
5
|
+
params: ParamSpec;
|
|
6
|
+
}
|
|
7
|
+
export declare const BUILTIN_ELEMENT_CALLBACKS: Record<string, BuiltinElementCallback>;
|
|
8
|
+
/** The built-in element callback for an action, or undefined when the action is not a known built-in (an
|
|
9
|
+
* element-type-specific/plugin callback whose schema is not knowable here). */
|
|
10
|
+
export declare const getElementCallback: (action: string) => BuiltinElementCallback | undefined;
|
|
11
|
+
/** Param keys the agent supplied that are not valid for a built-in element callback (only for CLOSED sets). []
|
|
12
|
+
* for an unknown action (a plugin/element-specific callback whose schema is not known here). */
|
|
13
|
+
export declare const unknownElementCallbackParams: (action: string, params: Record<string, unknown>) => string[];
|
|
14
|
+
/** Reconcile a `callback` action against the element-callback catalog: unknown keys dropped for a closed callback,
|
|
15
|
+
* then missing defaults filled (category:"attribute", revertOnFinish:false). An unknown action yields unchanged
|
|
16
|
+
* params, so a plugin/element-specific callback keeps whatever the agent passed. */
|
|
17
|
+
export declare const applyElementCallback: (action: string, params: Record<string, unknown>) => {
|
|
18
|
+
known: boolean;
|
|
19
|
+
params: Record<string, unknown>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ParamSpec } from './paramSpec';
|
|
2
|
+
export interface BuiltinTransformer {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
strictParams: boolean;
|
|
6
|
+
params: ParamSpec;
|
|
7
|
+
}
|
|
8
|
+
export declare const BUILTIN_TRANSFORMERS: Record<string, BuiltinTransformer>;
|
|
9
|
+
/** The built-in transformer for an action, or undefined when the action is not a known built-in transformer. */
|
|
10
|
+
export declare const getTransformer: (action: string) => BuiltinTransformer | undefined;
|
|
11
|
+
/** The closest known transformer action to a mistyped one (substring match either way), so a wrong action like
|
|
12
|
+
* "template" teaches "twigTemplate". Undefined when nothing is close. */
|
|
13
|
+
export declare const suggestTransformer: (action: string) => string | undefined;
|
|
14
|
+
export interface TransformerInfo {
|
|
15
|
+
action: string;
|
|
16
|
+
title: string;
|
|
17
|
+
description: string;
|
|
18
|
+
params: {
|
|
19
|
+
name: string;
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
default?: string | number | boolean;
|
|
23
|
+
options?: string[];
|
|
24
|
+
}[];
|
|
25
|
+
}
|
|
26
|
+
/** The transformer catalog projected for the data-sources resource / primer, so the agent knows the exact action
|
|
27
|
+
* names and params up front (the real fix for the "agent can't write transformers" problem). */
|
|
28
|
+
export declare const transformerCatalog: () => TransformerInfo[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ParamSpec } from './paramSpec';
|
|
2
|
+
export interface BuiltinUtility {
|
|
3
|
+
title: string;
|
|
4
|
+
strictParams: boolean;
|
|
5
|
+
params: ParamSpec;
|
|
6
|
+
}
|
|
7
|
+
export declare const BUILTIN_UTILITIES: Record<string, BuiltinUtility>;
|
|
8
|
+
/** The built-in utility for an action, or undefined when the action is not a known built-in utility. */
|
|
9
|
+
export declare const getUtility: (action: string) => BuiltinUtility | undefined;
|
|
10
|
+
/** Param keys the agent supplied that are not valid for a built-in utility (only for CLOSED sets). [] for an unknown
|
|
11
|
+
* action (a utility whose schema is not known here). */
|
|
12
|
+
export declare const unknownUtilityParams: (action: string, params: Record<string, unknown>) => string[];
|
|
13
|
+
/** Reconcile a `utility` action against the utility catalog: unknown keys dropped for a closed utility, then missing
|
|
14
|
+
* defaults filled. An unknown action yields unchanged params. */
|
|
15
|
+
export declare const applyUtility: (action: string, params: Record<string, unknown>) => {
|
|
16
|
+
known: boolean;
|
|
17
|
+
params: Record<string, unknown>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CssProps } from '../types';
|
|
2
|
+
/** Every kebab-case CSS property Plitzi's style engine understands. Values written to a definition
|
|
3
|
+
* must use these exact keys — camelCase or unknown keys are rejected by the validator. */
|
|
4
|
+
export declare const cssProperties: string[];
|
|
5
|
+
export declare const isCssProperty: (key: string) => boolean;
|
|
6
|
+
/** If a camelCase key maps to a known kebab-case property, return it — used to teach the agent the correct key. */
|
|
7
|
+
export declare const suggestCssProperty: (key: string) => string | undefined;
|
|
8
|
+
export declare const COMPOUND_SHORTHANDS: Record<string, string[]>;
|
|
9
|
+
/** The atomic longhands to write instead of a compound shorthand, or undefined when the key is not a compound
|
|
10
|
+
* shorthand. `flex` layout in particular is NOT `display` + `flex-direction` (those are their own properties). */
|
|
11
|
+
export declare const compoundLonghands: (key: string) => string[] | undefined;
|
|
12
|
+
/** Expand supported CSS shorthands to their longhand keys. Explicit longhands in the same map win over any
|
|
13
|
+
* expansion (so `{ padding: 8, padding-left: 0 }` keeps padding-left: 0). Unrecognized keys pass through. */
|
|
14
|
+
export declare const expandShorthand: (css: CssProps) => CssProps;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './paramSpec';
|
|
2
|
+
export * from './builtinCallbacks';
|
|
3
|
+
export * from './builtinElementCallbacks';
|
|
4
|
+
export * from './builtinUtilities';
|
|
5
|
+
export * from './builtinTransformers';
|
|
6
|
+
export * from './builtinComponents';
|
|
7
|
+
export * from './cssCatalog';
|
|
8
|
+
export * from './observed';
|
|
9
|
+
export * from './registry';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { TransformerInfo } from './builtinTransformers';
|
|
2
|
+
import { AIInteractionNodeType } from '../types';
|
|
3
|
+
import { Schema } from '@plitzi/sdk-shared';
|
|
4
|
+
export interface BuiltinParamInfo {
|
|
5
|
+
name: string;
|
|
6
|
+
type: string;
|
|
7
|
+
description: string;
|
|
8
|
+
default?: string | number | boolean;
|
|
9
|
+
options?: string[];
|
|
10
|
+
conditional?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface BuiltinGlobalCallbackInfo {
|
|
13
|
+
action: string;
|
|
14
|
+
source: string;
|
|
15
|
+
title: string;
|
|
16
|
+
strictParams: boolean;
|
|
17
|
+
params: BuiltinParamInfo[];
|
|
18
|
+
}
|
|
19
|
+
export interface BuiltinActionInfo {
|
|
20
|
+
action: string;
|
|
21
|
+
title: string;
|
|
22
|
+
strictParams: boolean;
|
|
23
|
+
params: BuiltinParamInfo[];
|
|
24
|
+
}
|
|
25
|
+
export interface InteractionCatalog {
|
|
26
|
+
note: string;
|
|
27
|
+
actions: Record<string, string[]>;
|
|
28
|
+
globalCallbacksNote: string;
|
|
29
|
+
globalCallbacks: BuiltinGlobalCallbackInfo[];
|
|
30
|
+
elementCallbacksNote: string;
|
|
31
|
+
elementCallbacks: BuiltinActionInfo[];
|
|
32
|
+
utilitiesNote: string;
|
|
33
|
+
utilities: BuiltinActionInfo[];
|
|
34
|
+
flowCount: number;
|
|
35
|
+
}
|
|
36
|
+
export interface DataSourceCatalog {
|
|
37
|
+
note: string;
|
|
38
|
+
scopeNote: string;
|
|
39
|
+
sources: string[];
|
|
40
|
+
targets: Record<string, string[]>;
|
|
41
|
+
transformersNote: string;
|
|
42
|
+
transformers: TransformerInfo[];
|
|
43
|
+
}
|
|
44
|
+
export declare const buildInteractionCatalog: (schema: Schema) => InteractionCatalog;
|
|
45
|
+
export declare const buildDataSourceCatalog: (schema: Schema) => DataSourceCatalog;
|
|
46
|
+
export declare const observedInteractionActions: (schema: Schema) => Set<string>;
|
|
47
|
+
export declare const observedDataSources: (schema: Schema) => Set<string>;
|
|
48
|
+
export declare const INTERACTION_NODE_TYPES: AIInteractionNodeType[];
|