@plitzi/sdk-mcp 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +175 -0
- package/dist/createServer.d.ts +11 -0
- package/dist/createServer.js +36 -0
- package/dist/createServer.test.d.ts +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +21 -0
- package/dist/modules/ai/AIEngine.d.ts +20 -0
- package/dist/modules/ai/AIEngine.js +120 -0
- package/dist/modules/ai/index.d.ts +4 -0
- package/dist/modules/ai/toolkit.d.ts +17 -0
- package/dist/modules/ai/toolkit.js +59 -0
- package/dist/modules/ai/toolkit.test.d.ts +1 -0
- package/dist/modules/mcp/apps/apps.test.d.ts +1 -0
- package/dist/modules/mcp/apps/example/index.d.ts +8 -0
- package/dist/modules/mcp/apps/example/view/index.tsx +70 -0
- package/dist/modules/mcp/apps/index.d.ts +11 -0
- package/dist/modules/mcp/apps/index.js +16 -0
- package/dist/modules/mcp/apps/render/index.d.ts +4 -0
- package/dist/modules/mcp/apps/render/index.js +17 -0
- package/dist/modules/mcp/apps/render/styles.d.ts +10 -0
- package/dist/modules/mcp/apps/render/styles.js +54 -0
- package/dist/modules/mcp/apps/render/styles.test.d.ts +1 -0
- package/dist/modules/mcp/apps/render/view/heldBatch.ts +107 -0
- package/dist/modules/mcp/apps/render/view/index.tsx +314 -0
- package/dist/modules/mcp/apps/render/view/streamProgress.ts +137 -0
- package/dist/modules/mcp/apps/shared/assets.d.ts +10 -0
- package/dist/modules/mcp/apps/shared/assets.js +10 -0
- package/dist/modules/mcp/apps/shared/bundle.d.ts +4 -0
- package/dist/modules/mcp/apps/shared/bundle.js +23 -0
- package/dist/modules/mcp/apps/shared/index.d.ts +3 -0
- package/dist/modules/mcp/apps/shared/page.d.ts +2 -0
- package/dist/modules/mcp/apps/shared/page.js +34 -0
- package/dist/modules/mcp/apps/shared/registerApp.d.ts +5 -0
- package/dist/modules/mcp/apps/shared/registerApp.js +43 -0
- package/dist/modules/mcp/apps/shared/resolve.d.ts +1 -0
- package/dist/modules/mcp/apps/shared/resolve.js +5 -0
- package/dist/modules/mcp/apps/shared/shell.ejs +59 -0
- package/dist/modules/mcp/apps/shared/zodEnglishOnly.d.ts +4 -0
- package/dist/modules/mcp/apps/shared/zodEnglishOnly.js +23 -0
- package/dist/modules/mcp/catalogs/builtinCallbacks.d.ts +19 -0
- package/dist/modules/mcp/catalogs/builtinCallbacks.js +139 -0
- package/dist/modules/mcp/catalogs/builtinComponents.d.ts +4 -0
- package/dist/modules/mcp/catalogs/builtinComponents.js +165 -0
- package/dist/modules/mcp/catalogs/builtinElementCallbacks.d.ts +17 -0
- package/dist/modules/mcp/catalogs/builtinElementCallbacks.js +50 -0
- package/dist/modules/mcp/catalogs/builtinTransformers.d.ts +28 -0
- package/dist/modules/mcp/catalogs/builtinTransformers.js +148 -0
- package/dist/modules/mcp/catalogs/builtinTransformers.test.d.ts +1 -0
- package/dist/modules/mcp/catalogs/builtinUtilities.d.ts +15 -0
- package/dist/modules/mcp/catalogs/builtinUtilities.js +90 -0
- package/dist/modules/mcp/catalogs/cssCatalog/border.d.ts +4 -0
- package/dist/modules/mcp/catalogs/cssCatalog/border.js +30 -0
- package/dist/modules/mcp/catalogs/cssCatalog/box.d.ts +4 -0
- package/dist/modules/mcp/catalogs/cssCatalog/box.js +31 -0
- package/dist/modules/mcp/catalogs/cssCatalog/cssCatalog.test.d.ts +1 -0
- package/dist/modules/mcp/catalogs/cssCatalog/helpers.d.ts +34 -0
- package/dist/modules/mcp/catalogs/cssCatalog/helpers.js +185 -0
- package/dist/modules/mcp/catalogs/cssCatalog/index.d.ts +18 -0
- package/dist/modules/mcp/catalogs/cssCatalog/index.js +131 -0
- package/dist/modules/mcp/catalogs/cssCatalog/layout.d.ts +9 -0
- package/dist/modules/mcp/catalogs/cssCatalog/layout.js +99 -0
- package/dist/modules/mcp/catalogs/cssCatalog/visual.d.ts +8 -0
- package/dist/modules/mcp/catalogs/cssCatalog/visual.js +147 -0
- package/dist/modules/mcp/catalogs/index.d.ts +9 -0
- package/dist/modules/mcp/catalogs/observed.d.ts +46 -0
- package/dist/modules/mcp/catalogs/observed.js +90 -0
- package/dist/modules/mcp/catalogs/paramSpec.d.ts +39 -0
- package/dist/modules/mcp/catalogs/paramSpec.js +69 -0
- package/dist/modules/mcp/catalogs/registry.d.ts +35 -0
- package/dist/modules/mcp/catalogs/registry.js +89 -0
- package/dist/modules/mcp/e2e/connector.test.d.ts +1 -0
- package/dist/modules/mcp/e2e/host.test.d.ts +1 -0
- package/dist/modules/mcp/e2e/index.d.ts +6 -0
- package/dist/modules/mcp/e2e/mcpEndpoint.d.ts +27 -0
- package/dist/modules/mcp/e2e/oauthConnector.test.d.ts +1 -0
- package/dist/modules/mcp/e2e/postMessageChannel.d.ts +22 -0
- package/dist/modules/mcp/e2e/renderingHost.d.ts +39 -0
- package/dist/modules/mcp/handler.d.ts +22 -0
- package/dist/modules/mcp/handler.js +83 -0
- package/dist/modules/mcp/helpers/agentPrompt.d.ts +4 -0
- package/dist/modules/mcp/helpers/agentPrompt.js +104 -0
- package/dist/modules/mcp/helpers/computeVersion.d.ts +1 -0
- package/dist/modules/mcp/helpers/computeVersion.js +16 -0
- package/dist/modules/mcp/helpers/guide.d.ts +4 -0
- package/dist/modules/mcp/helpers/guide.js +608 -0
- package/dist/modules/mcp/helpers/index.d.ts +8 -0
- package/dist/modules/mcp/helpers/interactions.d.ts +30 -0
- package/dist/modules/mcp/helpers/interactions.js +123 -0
- package/dist/modules/mcp/helpers/log.d.ts +8 -0
- package/dist/modules/mcp/helpers/log.js +64 -0
- package/dist/modules/mcp/helpers/log.test.d.ts +1 -0
- package/dist/modules/mcp/helpers/opResult.d.ts +13 -0
- package/dist/modules/mcp/helpers/opResult.js +18 -0
- package/dist/modules/mcp/helpers/space.d.ts +126 -0
- package/dist/modules/mcp/helpers/space.js +314 -0
- package/dist/modules/mcp/helpers/uris.d.ts +33 -0
- package/dist/modules/mcp/helpers/uris.js +50 -0
- package/dist/modules/mcp/index.d.ts +13 -0
- package/dist/modules/mcp/mcp.bench.d.ts +1 -0
- package/dist/modules/mcp/previewClient.d.ts +13 -0
- package/dist/modules/mcp/previewClient.js +31 -0
- package/dist/modules/mcp/proxy/config.d.ts +20 -0
- package/dist/modules/mcp/proxy/config.js +62 -0
- package/dist/modules/mcp/proxy/endpoint.test.d.ts +1 -0
- package/dist/modules/mcp/proxy/fetch.d.ts +18 -0
- package/dist/modules/mcp/proxy/fetch.js +91 -0
- package/dist/modules/mcp/proxy/grant.d.ts +25 -0
- package/dist/modules/mcp/proxy/grant.js +67 -0
- package/dist/modules/mcp/proxy/guard.d.ts +6 -0
- package/dist/modules/mcp/proxy/guard.js +38 -0
- package/dist/modules/mcp/proxy/handler.d.ts +8 -0
- package/dist/modules/mcp/proxy/handler.js +99 -0
- package/dist/modules/mcp/proxy/index.d.ts +8 -0
- package/dist/modules/mcp/proxy/payload.d.ts +8 -0
- package/dist/modules/mcp/proxy/payload.js +29 -0
- package/dist/modules/mcp/proxy/proxy.test.d.ts +1 -0
- package/dist/modules/mcp/proxy/rewrite.d.ts +18 -0
- package/dist/modules/mcp/proxy/rewrite.js +138 -0
- package/dist/modules/mcp/proxy/sign.d.ts +6 -0
- package/dist/modules/mcp/proxy/sign.js +15 -0
- package/dist/modules/mcp/proxy/types.d.ts +45 -0
- package/dist/modules/mcp/proxy/types.js +9 -0
- package/dist/modules/mcp/proxy/wiring.test.d.ts +1 -0
- package/dist/modules/mcp/resources/canonical.d.ts +6 -0
- package/dist/modules/mcp/resources/canonical.js +30 -0
- package/dist/modules/mcp/resources/connectors.d.ts +22 -0
- package/dist/modules/mcp/resources/connectors.js +46 -0
- package/dist/modules/mcp/resources/core.d.ts +5 -0
- package/dist/modules/mcp/resources/core.js +18 -0
- package/dist/modules/mcp/resources/envelope.d.ts +10 -0
- package/dist/modules/mcp/resources/envelope.js +14 -0
- package/dist/modules/mcp/resources/index.d.ts +9 -0
- package/dist/modules/mcp/resources/primer.d.ts +7 -0
- package/dist/modules/mcp/resources/primer.js +33 -0
- package/dist/modules/mcp/resources/register.d.ts +10 -0
- package/dist/modules/mcp/resources/register.js +205 -0
- package/dist/modules/mcp/resources/renderGuide.d.ts +10 -0
- package/dist/modules/mcp/resources/renderGuide.js +451 -0
- package/dist/modules/mcp/resources/router.d.ts +10 -0
- package/dist/modules/mcp/resources/router.js +39 -0
- package/dist/modules/mcp/resources/schema.d.ts +5 -0
- package/dist/modules/mcp/resources/schema.js +43 -0
- package/dist/modules/mcp/resources/style.d.ts +5 -0
- package/dist/modules/mcp/resources/style.js +34 -0
- package/dist/modules/mcp/screenshotClient.d.ts +13 -0
- package/dist/modules/mcp/screenshotClient.js +47 -0
- package/dist/modules/mcp/server.d.ts +31 -0
- package/dist/modules/mcp/server.js +127 -0
- package/dist/modules/mcp/tests/apply.test.d.ts +1 -0
- package/dist/modules/mcp/tests/bindings.test.d.ts +1 -0
- package/dist/modules/mcp/tests/connectors.test.d.ts +1 -0
- package/dist/modules/mcp/tests/css.test.d.ts +1 -0
- package/dist/modules/mcp/tests/helpers.d.ts +13 -0
- package/dist/modules/mcp/tests/interactions.test.d.ts +1 -0
- package/dist/modules/mcp/tests/pages.test.d.ts +1 -0
- package/dist/modules/mcp/tests/reads.test.d.ts +1 -0
- package/dist/modules/mcp/tests/schemaIds.test.d.ts +1 -0
- package/dist/modules/mcp/tests/search.test.d.ts +1 -0
- package/dist/modules/mcp/tests/skill.test.d.ts +1 -0
- package/dist/modules/mcp/tests/styles.test.d.ts +1 -0
- package/dist/modules/mcp/tests/tools.test.d.ts +1 -0
- package/dist/modules/mcp/tests/validation.test.d.ts +1 -0
- package/dist/modules/mcp/tools/apply/dispatch.d.ts +6 -0
- package/dist/modules/mcp/tools/apply/dispatch.js +128 -0
- package/dist/modules/mcp/tools/apply/index.d.ts +656 -0
- package/dist/modules/mcp/tools/apply/index.js +161 -0
- package/dist/modules/mcp/tools/apply/writeResult.d.ts +8 -0
- package/dist/modules/mcp/tools/apply/writeResult.js +37 -0
- package/dist/modules/mcp/tools/index.d.ts +18 -0
- package/dist/modules/mcp/tools/index.js +24 -0
- package/dist/modules/mcp/tools/operations/connectors/deleteConnector.d.ts +9 -0
- package/dist/modules/mcp/tools/operations/connectors/deleteConnector.js +20 -0
- package/dist/modules/mcp/tools/operations/connectors/index.d.ts +188 -0
- package/dist/modules/mcp/tools/operations/connectors/index.js +12 -0
- package/dist/modules/mcp/tools/operations/connectors/manifest.d.ts +89 -0
- package/dist/modules/mcp/tools/operations/connectors/manifest.js +70 -0
- package/dist/modules/mcp/tools/operations/connectors/patchConnector.d.ts +94 -0
- package/dist/modules/mcp/tools/operations/connectors/patchConnector.js +58 -0
- package/dist/modules/mcp/tools/operations/connectors/upsertConnector.d.ts +98 -0
- package/dist/modules/mcp/tools/operations/connectors/upsertConnector.js +64 -0
- package/dist/modules/mcp/tools/operations/index.d.ts +2235 -0
- package/dist/modules/mcp/tools/operations/index.js +55 -0
- package/dist/modules/mcp/tools/operations/schema/bindings/deleteBinding.d.ts +17 -0
- package/dist/modules/mcp/tools/operations/schema/bindings/deleteBinding.js +32 -0
- package/dist/modules/mcp/tools/operations/schema/bindings/patchBinding.d.ts +25 -0
- package/dist/modules/mcp/tools/operations/schema/bindings/patchBinding.js +36 -0
- package/dist/modules/mcp/tools/operations/schema/bindings/upsertBinding.d.ts +27 -0
- package/dist/modules/mcp/tools/operations/schema/bindings/upsertBinding.js +47 -0
- package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.d.ts +10 -0
- package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.js +29 -0
- package/dist/modules/mcp/tools/operations/schema/elements/moveElement.d.ts +16 -0
- package/dist/modules/mcp/tools/operations/schema/elements/moveElement.js +41 -0
- package/dist/modules/mcp/tools/operations/schema/elements/patchElement.d.ts +27 -0
- package/dist/modules/mcp/tools/operations/schema/elements/patchElement.js +60 -0
- package/dist/modules/mcp/tools/operations/schema/elements/repeatElement.d.ts +55 -0
- package/dist/modules/mcp/tools/operations/schema/elements/repeatElement.js +148 -0
- package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.d.ts +16 -0
- package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.js +66 -0
- package/dist/modules/mcp/tools/operations/schema/folders/deleteFolder.d.ts +9 -0
- package/dist/modules/mcp/tools/operations/schema/folders/deleteFolder.js +32 -0
- package/dist/modules/mcp/tools/operations/schema/folders/upsertFolder.d.ts +12 -0
- package/dist/modules/mcp/tools/operations/schema/folders/upsertFolder.js +49 -0
- package/dist/modules/mcp/tools/operations/schema/index.d.ts +21 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/deleteInteraction.d.ts +12 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/deleteInteraction.js +52 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.d.ts +18 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.js +47 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.d.ts +27 -0
- package/dist/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.js +44 -0
- package/dist/modules/mcp/tools/operations/schema/operations.d.ts +236 -0
- package/dist/modules/mcp/tools/operations/schema/operations.js +41 -0
- package/dist/modules/mcp/tools/operations/schema/pages/deletePage.d.ts +9 -0
- package/dist/modules/mcp/tools/operations/schema/pages/deletePage.js +25 -0
- package/dist/modules/mcp/tools/operations/schema/pages/upsertPage.d.ts +14 -0
- package/dist/modules/mcp/tools/operations/schema/pages/upsertPage.js +77 -0
- package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.d.ts +36 -0
- package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.js +44 -0
- package/dist/modules/mcp/tools/operations/schema/shared.d.ts +106 -0
- package/dist/modules/mcp/tools/operations/schema/shared.js +131 -0
- package/dist/modules/mcp/tools/operations/schema/translator.d.ts +12 -0
- package/dist/modules/mcp/tools/operations/schema/translator.js +216 -0
- package/dist/modules/mcp/tools/operations/schema/variables/deleteVariable.d.ts +9 -0
- package/dist/modules/mcp/tools/operations/schema/variables/deleteVariable.js +18 -0
- package/dist/modules/mcp/tools/operations/schema/variables/upsertVariable.d.ts +16 -0
- package/dist/modules/mcp/tools/operations/schema/variables/upsertVariable.js +42 -0
- package/dist/modules/mcp/tools/operations/schema/write.d.ts +42 -0
- package/dist/modules/mcp/tools/operations/schema/write.js +112 -0
- package/dist/modules/mcp/tools/operations/schemaIds.d.ts +6 -0
- package/dist/modules/mcp/tools/operations/schemaIds.js +58 -0
- package/dist/modules/mcp/tools/operations/style/definitions/deleteDefinition.d.ts +9 -0
- package/dist/modules/mcp/tools/operations/style/definitions/deleteDefinition.js +21 -0
- package/dist/modules/mcp/tools/operations/style/definitions/patchDefinition.d.ts +37 -0
- package/dist/modules/mcp/tools/operations/style/definitions/patchDefinition.js +28 -0
- package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinition.d.ts +37 -0
- package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinition.js +24 -0
- package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinitions.d.ts +41 -0
- package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinitions.js +40 -0
- package/dist/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.d.ts +9 -0
- package/dist/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.js +21 -0
- package/dist/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.d.ts +37 -0
- package/dist/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.js +28 -0
- package/dist/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.d.ts +37 -0
- package/dist/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.js +24 -0
- package/dist/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.d.ts +9 -0
- package/dist/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.js +21 -0
- package/dist/modules/mcp/tools/operations/style/idStyles/patchIdStyle.d.ts +37 -0
- package/dist/modules/mcp/tools/operations/style/idStyles/patchIdStyle.js +28 -0
- package/dist/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.d.ts +37 -0
- package/dist/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.js +24 -0
- package/dist/modules/mcp/tools/operations/style/index.d.ts +15 -0
- package/dist/modules/mcp/tools/operations/style/operations.d.ts +264 -0
- package/dist/modules/mcp/tools/operations/style/operations.js +29 -0
- package/dist/modules/mcp/tools/operations/style/shared.d.ts +116 -0
- package/dist/modules/mcp/tools/operations/style/shared.js +59 -0
- package/dist/modules/mcp/tools/operations/style/translator.d.ts +12 -0
- package/dist/modules/mcp/tools/operations/style/translator.js +101 -0
- package/dist/modules/mcp/tools/operations/style/variables/deleteStyleVariable.d.ts +15 -0
- package/dist/modules/mcp/tools/operations/style/variables/deleteStyleVariable.js +21 -0
- package/dist/modules/mcp/tools/operations/style/variables/upsertStyleVariable.d.ts +20 -0
- package/dist/modules/mcp/tools/operations/style/variables/upsertStyleVariable.js +22 -0
- package/dist/modules/mcp/tools/operations/style/write.d.ts +12 -0
- package/dist/modules/mcp/tools/operations/style/write.js +108 -0
- package/dist/modules/mcp/tools/preview.d.ts +472 -0
- package/dist/modules/mcp/tools/preview.js +37 -0
- package/dist/modules/mcp/tools/read.d.ts +9 -0
- package/dist/modules/mcp/tools/read.js +51 -0
- package/dist/modules/mcp/tools/render.d.ts +506 -0
- package/dist/modules/mcp/tools/render.js +184 -0
- package/dist/modules/mcp/tools/render.test.d.ts +1 -0
- package/dist/modules/mcp/tools/screenshot.d.ts +656 -0
- package/dist/modules/mcp/tools/screenshot.js +83 -0
- package/dist/modules/mcp/tools/search.d.ts +15 -0
- package/dist/modules/mcp/tools/search.js +115 -0
- package/dist/modules/mcp/tools/shared/expandOperations.d.ts +13 -0
- package/dist/modules/mcp/tools/shared/expandOperations.js +44 -0
- package/dist/modules/mcp/tools/shared/tool.d.ts +72 -0
- package/dist/modules/mcp/tools/shared/tool.js +33 -0
- package/dist/modules/mcp/tools/shared/validator/audit.d.ts +4 -0
- package/dist/modules/mcp/tools/shared/validator/audit.js +124 -0
- package/dist/modules/mcp/tools/shared/validator/batch.d.ts +5 -0
- package/dist/modules/mcp/tools/shared/validator/batch.js +39 -0
- package/dist/modules/mcp/tools/shared/validator/bindings.d.ts +6 -0
- package/dist/modules/mcp/tools/shared/validator/bindings.js +70 -0
- package/dist/modules/mcp/tools/shared/validator/connectors.d.ts +19 -0
- package/dist/modules/mcp/tools/shared/validator/connectors.js +76 -0
- package/dist/modules/mcp/tools/shared/validator/context.d.ts +38 -0
- package/dist/modules/mcp/tools/shared/validator/context.js +35 -0
- package/dist/modules/mcp/tools/shared/validator/css.d.ts +4 -0
- package/dist/modules/mcp/tools/shared/validator/css.js +39 -0
- package/dist/modules/mcp/tools/shared/validator/elements.d.ts +7 -0
- package/dist/modules/mcp/tools/shared/validator/elements.js +68 -0
- package/dist/modules/mcp/tools/shared/validator/index.d.ts +8 -0
- package/dist/modules/mcp/tools/shared/validator/index.js +268 -0
- package/dist/modules/mcp/tools/shared/validator/interactions.d.ts +3 -0
- package/dist/modules/mcp/tools/shared/validator/interactions.js +103 -0
- package/dist/modules/mcp/tools/shared/validator/refs.d.ts +4 -0
- package/dist/modules/mcp/tools/shared/validator/refs.js +28 -0
- package/dist/modules/mcp/tools/validate.d.ts +653 -0
- package/dist/modules/mcp/tools/validate.js +47 -0
- package/dist/modules/mcp/types/aiSchema.d.ts +226 -0
- package/dist/modules/mcp/types/appTypes.d.ts +26 -0
- package/dist/modules/mcp/types/index.d.ts +5 -0
- package/dist/modules/mcp/types/previewTypes.d.ts +25 -0
- package/dist/modules/mcp/types/screenshotTypes.d.ts +29 -0
- package/dist/modules/mcp/types/toolTypes.d.ts +145 -0
- package/dist/modules/oauth/authorize.d.ts +7 -0
- package/dist/modules/oauth/authorize.js +177 -0
- package/dist/modules/oauth/challenge.d.ts +11 -0
- package/dist/modules/oauth/challenge.js +33 -0
- package/dist/modules/oauth/consentPage.d.ts +7 -0
- package/dist/modules/oauth/consentPage.js +118 -0
- package/dist/modules/oauth/metadata.d.ts +40 -0
- package/dist/modules/oauth/metadata.js +69 -0
- package/dist/modules/oauth/oauth.test.d.ts +1 -0
- package/dist/modules/oauth/params.d.ts +5 -0
- package/dist/modules/oauth/params.js +5 -0
- package/dist/modules/oauth/pkce.d.ts +6 -0
- package/dist/modules/oauth/pkce.js +15 -0
- package/dist/modules/oauth/records.d.ts +71 -0
- package/dist/modules/oauth/records.js +46 -0
- package/dist/modules/oauth/register.d.ts +5 -0
- package/dist/modules/oauth/register.js +55 -0
- package/dist/modules/oauth/respond.d.ts +13 -0
- package/dist/modules/oauth/respond.js +44 -0
- package/dist/modules/oauth/token.d.ts +5 -0
- package/dist/modules/oauth/token.js +100 -0
- package/dist/options.d.ts +73 -0
- package/dist/packageBoundary.test.d.ts +1 -0
- package/dist/pipeline.d.ts +12 -0
- package/dist/pipeline.js +29 -0
- package/dist/pipeline.test.d.ts +1 -0
- package/dist/preview/createPreview.d.ts +10 -0
- package/dist/preview/createPreview.js +83 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.js +7 -0
- package/dist/stages/mcp.d.ts +4 -0
- package/dist/stages/mcp.js +30 -0
- package/dist/stages/oauth.d.ts +19 -0
- package/dist/stages/oauth.js +114 -0
- package/dist/stages/preview.d.ts +2 -0
- package/dist/stages/preview.js +37 -0
- package/dist/stages/proxy.d.ts +3 -0
- package/dist/stages/proxy.js +14 -0
- package/dist/tests/httpRequest.d.ts +14 -0
- package/package.json +77 -0
- package/skills/plitzi-render/SKILL.md +174 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { deleteBindingOp } from "./bindings/deleteBinding.js";
|
|
2
|
+
import { patchBindingOp } from "./bindings/patchBinding.js";
|
|
3
|
+
import { upsertBindingOp } from "./bindings/upsertBinding.js";
|
|
4
|
+
import { deleteElementOp } from "./elements/deleteElement.js";
|
|
5
|
+
import { moveElementOp } from "./elements/moveElement.js";
|
|
6
|
+
import { patchElementOp } from "./elements/patchElement.js";
|
|
7
|
+
import { repeatElementOp } from "./elements/repeatElement.js";
|
|
8
|
+
import { upsertElementOp } from "./elements/upsertElement.js";
|
|
9
|
+
import { deleteFolderOp } from "./folders/deleteFolder.js";
|
|
10
|
+
import { upsertFolderOp } from "./folders/upsertFolder.js";
|
|
11
|
+
import { deleteInteractionOp } from "./interactions/deleteInteraction.js";
|
|
12
|
+
import { patchInteractionNodeOp } from "./interactions/patchInteractionNode.js";
|
|
13
|
+
import { upsertInteractionFlowOp } from "./interactions/upsertInteractionFlow.js";
|
|
14
|
+
import { deletePageOp } from "./pages/deletePage.js";
|
|
15
|
+
import { upsertPageOp } from "./pages/upsertPage.js";
|
|
16
|
+
import { patchSettingsOp } from "./settings/patchSettings.js";
|
|
17
|
+
import { deleteVariableOp } from "./variables/deleteVariable.js";
|
|
18
|
+
import { upsertVariableOp } from "./variables/upsertVariable.js";
|
|
19
|
+
//#region src/modules/mcp/tools/operations/schema/operations.ts
|
|
20
|
+
var elementOps = {
|
|
21
|
+
upsertElement: upsertElementOp,
|
|
22
|
+
repeatElement: repeatElementOp,
|
|
23
|
+
patchElement: patchElementOp,
|
|
24
|
+
deleteElement: deleteElementOp,
|
|
25
|
+
moveElement: moveElementOp,
|
|
26
|
+
upsertPage: upsertPageOp,
|
|
27
|
+
deletePage: deletePageOp,
|
|
28
|
+
upsertFolder: upsertFolderOp,
|
|
29
|
+
deleteFolder: deleteFolderOp,
|
|
30
|
+
upsertVariable: upsertVariableOp,
|
|
31
|
+
deleteVariable: deleteVariableOp,
|
|
32
|
+
upsertBinding: upsertBindingOp,
|
|
33
|
+
patchBinding: patchBindingOp,
|
|
34
|
+
deleteBinding: deleteBindingOp,
|
|
35
|
+
upsertInteractionFlow: upsertInteractionFlowOp,
|
|
36
|
+
patchInteractionNode: patchInteractionNodeOp,
|
|
37
|
+
deleteInteraction: deleteInteractionOp,
|
|
38
|
+
patchSettings: patchSettingsOp
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { elementOps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Space, OpResult } from '../../../../helpers';
|
|
3
|
+
import { Env } from '../../../../types';
|
|
4
|
+
export declare const deletePageOp: z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"deletePage">;
|
|
6
|
+
ref: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type DeletePage = z.infer<typeof deletePageOp>;
|
|
9
|
+
export declare const deletePage: (space: Space, env: Env, op: DeletePage) => OpResult;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { descendantIds, findPageByRef, indexRemovePage } from "../../../../helpers/space.js";
|
|
2
|
+
import { pageUri, pagesUri } from "../../../../helpers/uris.js";
|
|
3
|
+
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/modules/mcp/tools/operations/schema/pages/deletePage.ts
|
|
6
|
+
var deletePageOp = z.object({
|
|
7
|
+
type: z.literal("deletePage"),
|
|
8
|
+
ref: z.string().describe("Page ref or id")
|
|
9
|
+
}).describe("Delete a page and every element on it.");
|
|
10
|
+
var deletePage = (space, env, op) => {
|
|
11
|
+
const page = findPageByRef(space.schema, op.ref);
|
|
12
|
+
if (!page) return fail("ref", `Page "${op.ref}" not found`, "Read the pages resource for valid refs");
|
|
13
|
+
const descendantElementIds = descendantIds(space.schema, page.id);
|
|
14
|
+
const descendants = descendantElementIds.map((id) => space.schema.flat[id]);
|
|
15
|
+
for (const id of [...descendantElementIds, page.id]) Reflect.deleteProperty(space.schema.flat, id);
|
|
16
|
+
space.schema.pages = space.schema.pages.filter((id) => id !== page.id);
|
|
17
|
+
indexRemovePage(space.schema, page, descendants);
|
|
18
|
+
return {
|
|
19
|
+
...empty(),
|
|
20
|
+
deleted: 1,
|
|
21
|
+
staleResources: [pageUri(env, op.ref), pagesUri(env)]
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { deletePage, deletePageOp };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Space, OpResult } from '../../../../helpers';
|
|
3
|
+
import { Env } from '../../../../types';
|
|
4
|
+
export declare const upsertPageOp: z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"upsertPage">;
|
|
6
|
+
ref: z.ZodString;
|
|
7
|
+
label: z.ZodOptional<z.ZodString>;
|
|
8
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
9
|
+
folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
+
default: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type UpsertPage = z.infer<typeof upsertPageOp>;
|
|
14
|
+
export declare const upsertPage: (space: Space, env: Env, op: UpsertPage) => OpResult;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { findFolderByRef, findPageByRef, generateObjectId, indexAddPage, indexReRefPage, pageRefOf } from "../../../../helpers/space.js";
|
|
2
|
+
import { pageUri, pagesUri } from "../../../../helpers/uris.js";
|
|
3
|
+
import { empty, fail } from "../../../../helpers/opResult.js";
|
|
4
|
+
import { guardNewRef } from "../write.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
//#region src/modules/mcp/tools/operations/schema/pages/upsertPage.ts
|
|
7
|
+
var upsertPageOp = z.object({
|
|
8
|
+
type: z.literal("upsertPage"),
|
|
9
|
+
ref: z.string().describe("Page id/slug to update, or a new id you choose to create one. On a new page it is stored as its idRef: starts with a letter, then letters, numbers, hyphens and underscores (\"pricing\"), unique across the space."),
|
|
10
|
+
label: z.string().optional(),
|
|
11
|
+
slug: z.string().optional().describe("The page URL path, RELATIVE — never start it with \"/\" (parent folder slugs prepend it; a leading \"/\" is stripped). Set one on create for a stable route: \"pricing\", \"posts/:postId\". A \":name\" segment is a route param, readable as {{name}} and as navigation.routeParams.name. Omitted → the page ref is used."),
|
|
12
|
+
folder: z.string().nullable().optional().describe("Ref of an existing folder to place this page in; \"\" or null moves it to the root. Unknown → error"),
|
|
13
|
+
default: z.boolean().optional(),
|
|
14
|
+
enabled: z.boolean().optional().describe("false disables the page in the published SDK runtime (not routable/accessible to end users); it stays editable here. Defaults to true")
|
|
15
|
+
}).describe("Create a page, or update it when ref already exists (only the fields you pass change).");
|
|
16
|
+
var upsertPage = (space, env, op) => {
|
|
17
|
+
const slug = op.slug === void 0 ? void 0 : op.slug.replace(/^\/+/, "");
|
|
18
|
+
let folderValue;
|
|
19
|
+
if (op.folder !== void 0) {
|
|
20
|
+
if (op.folder === null || op.folder === "") folderValue = "";
|
|
21
|
+
else {
|
|
22
|
+
const resolved = findFolderByRef(space.schema, op.folder);
|
|
23
|
+
if (!resolved) return fail("folder", `Folder "${op.folder}" not found`, "Create it with upsertFolder, or read plitzi://folders");
|
|
24
|
+
folderValue = resolved.id;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const existing = findPageByRef(space.schema, op.ref);
|
|
28
|
+
if (existing) {
|
|
29
|
+
const oldRef = pageRefOf(existing);
|
|
30
|
+
existing.attributes = {
|
|
31
|
+
...existing.attributes,
|
|
32
|
+
...slug !== void 0 ? { slug } : {},
|
|
33
|
+
...op.label !== void 0 ? { name: op.label } : {},
|
|
34
|
+
...op.default !== void 0 ? { default: op.default } : {},
|
|
35
|
+
...op.enabled !== void 0 ? { enabled: op.enabled } : {},
|
|
36
|
+
...folderValue !== void 0 ? { folder: folderValue } : {}
|
|
37
|
+
};
|
|
38
|
+
indexReRefPage(space.schema, existing, oldRef);
|
|
39
|
+
return {
|
|
40
|
+
...empty(),
|
|
41
|
+
updated: 1,
|
|
42
|
+
staleResources: [pageUri(env, op.ref), pagesUri(env)]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const guard = guardNewRef(space, op.ref, "ref");
|
|
46
|
+
if (guard) return guard;
|
|
47
|
+
const id = generateObjectId();
|
|
48
|
+
const attributes = {
|
|
49
|
+
slug: slug ?? op.ref,
|
|
50
|
+
name: op.label ?? op.ref,
|
|
51
|
+
default: op.default ?? false,
|
|
52
|
+
enabled: op.enabled ?? true,
|
|
53
|
+
folder: folderValue ?? ""
|
|
54
|
+
};
|
|
55
|
+
const page = {
|
|
56
|
+
id,
|
|
57
|
+
idRef: op.ref,
|
|
58
|
+
attributes,
|
|
59
|
+
definition: {
|
|
60
|
+
rootId: id,
|
|
61
|
+
label: op.label ?? op.ref,
|
|
62
|
+
type: "page",
|
|
63
|
+
items: [],
|
|
64
|
+
styleSelectors: { base: "" }
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
space.schema.flat[id] = page;
|
|
68
|
+
space.schema.pages.push(id);
|
|
69
|
+
indexAddPage(space.schema, page);
|
|
70
|
+
return {
|
|
71
|
+
...empty(),
|
|
72
|
+
created: 1,
|
|
73
|
+
staleResources: [pageUri(env, op.ref), pagesUri(env)]
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
export { upsertPage, upsertPageOp };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Space, OpResult } from '../../../../helpers';
|
|
3
|
+
import { Env } from '../../../../types';
|
|
4
|
+
export declare const patchSettingsOp: z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"patchSettings">;
|
|
6
|
+
customCss: z.ZodOptional<z.ZodString>;
|
|
7
|
+
keepState: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
stateStorage: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
localStorage: "localStorage";
|
|
10
|
+
sessionStorage: "sessionStorage";
|
|
11
|
+
}>>;
|
|
12
|
+
userProvider: z.ZodOptional<z.ZodString>;
|
|
13
|
+
tokenStorage: z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
"": "";
|
|
15
|
+
localStorage: "localStorage";
|
|
16
|
+
sessionStorage: "sessionStorage";
|
|
17
|
+
}>>;
|
|
18
|
+
loginUrl: z.ZodOptional<z.ZodString>;
|
|
19
|
+
userUrl: z.ZodOptional<z.ZodString>;
|
|
20
|
+
refreshUrl: z.ZodOptional<z.ZodString>;
|
|
21
|
+
logoutUrl: z.ZodOptional<z.ZodString>;
|
|
22
|
+
detailsPath: z.ZodOptional<z.ZodString>;
|
|
23
|
+
tokenPath: z.ZodOptional<z.ZodString>;
|
|
24
|
+
refreshTokenPath: z.ZodOptional<z.ZodString>;
|
|
25
|
+
expirationTimePath: z.ZodOptional<z.ZodString>;
|
|
26
|
+
refreshExpirationTimePath: z.ZodOptional<z.ZodString>;
|
|
27
|
+
sessionHintCookie: z.ZodOptional<z.ZodString>;
|
|
28
|
+
sessionExchangeUrl: z.ZodOptional<z.ZodString>;
|
|
29
|
+
sessionGate: z.ZodOptional<z.ZodEnum<{
|
|
30
|
+
optimistic: "optimistic";
|
|
31
|
+
strict: "strict";
|
|
32
|
+
}>>;
|
|
33
|
+
sessionRevalidateSeconds: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type PatchSettings = z.infer<typeof patchSettingsOp>;
|
|
36
|
+
export declare const patchSettings: (space: Space, env: Env, op: PatchSettings) => OpResult;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { settingsUri } from "../../../../helpers/uris.js";
|
|
2
|
+
import { empty } from "../../../../helpers/opResult.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/modules/mcp/tools/operations/schema/settings/patchSettings.ts
|
|
5
|
+
var userProvider = z.string();
|
|
6
|
+
var storage = z.enum([
|
|
7
|
+
"localStorage",
|
|
8
|
+
"sessionStorage",
|
|
9
|
+
""
|
|
10
|
+
]);
|
|
11
|
+
var patchSettingsOp = z.object({
|
|
12
|
+
type: z.literal("patchSettings"),
|
|
13
|
+
customCss: z.string().optional().describe("Raw global CSS for the whole space (keyframes, @font-face, resets)"),
|
|
14
|
+
keepState: z.boolean().optional().describe("Persist element state across reloads"),
|
|
15
|
+
stateStorage: z.enum(["localStorage", "sessionStorage"]).optional(),
|
|
16
|
+
userProvider: userProvider.optional().describe("Auth provider: \"basic\" for an HTTP+JSON backend, a registered name, or \"\" to disable auth"),
|
|
17
|
+
tokenStorage: storage.optional(),
|
|
18
|
+
loginUrl: z.string().optional(),
|
|
19
|
+
userUrl: z.string().optional(),
|
|
20
|
+
refreshUrl: z.string().optional(),
|
|
21
|
+
logoutUrl: z.string().optional(),
|
|
22
|
+
detailsPath: z.string().optional(),
|
|
23
|
+
tokenPath: z.string().optional(),
|
|
24
|
+
refreshTokenPath: z.string().optional(),
|
|
25
|
+
expirationTimePath: z.string().optional(),
|
|
26
|
+
refreshExpirationTimePath: z.string().optional(),
|
|
27
|
+
sessionHintCookie: z.string().optional().describe("Readable cookie holding only session expiries, so a page can tell nobody is signed in with no request"),
|
|
28
|
+
sessionExchangeUrl: z.string().optional().describe("Where to hand a browser-obtained credential so the server issues its own session (client-side IdPs)"),
|
|
29
|
+
sessionGate: z.enum(["optimistic", "strict"]).optional().describe("Render from the stored session and confirm behind it (default), or wait for the confirmation"),
|
|
30
|
+
sessionRevalidateSeconds: z.number().optional()
|
|
31
|
+
}).describe("Merge space-level settings: the global CSS (customCss) and the state/auth (user-provider) configuration. Only the fields you pass change; the rest are preserved. Use customCss for site-wide CSS, never to style one element (attach a definition for that).");
|
|
32
|
+
var patchSettings = (space, env, op) => {
|
|
33
|
+
const { type, ...patch } = op;
|
|
34
|
+
const next = { ...space.schema.settings };
|
|
35
|
+
for (const [key, value] of Object.entries(patch)) next[key] = value;
|
|
36
|
+
space.schema.settings = next;
|
|
37
|
+
return {
|
|
38
|
+
...empty(),
|
|
39
|
+
updated: 1,
|
|
40
|
+
staleResources: [settingsUri(env)]
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { patchSettings, patchSettingsOp };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { RuleGroup } from '@plitzi/plitzi-ui/QueryBuilder';
|
|
3
|
+
import { ElementRuntime } from '@plitzi/sdk-shared';
|
|
4
|
+
export declare const ruleGroup: z.ZodType<RuleGroup>;
|
|
5
|
+
export interface InitialStateInput {
|
|
6
|
+
styleVariant?: Record<string, Record<string, string | string[]>>;
|
|
7
|
+
visibility?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ElementInput {
|
|
10
|
+
ref: string;
|
|
11
|
+
type: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
subType?: string;
|
|
14
|
+
props?: Record<string, unknown>;
|
|
15
|
+
style?: {
|
|
16
|
+
base?: string[];
|
|
17
|
+
slots?: Record<string, string[]>;
|
|
18
|
+
};
|
|
19
|
+
initialState?: InitialStateInput;
|
|
20
|
+
runtime?: ElementRuntime;
|
|
21
|
+
children?: ElementInput[];
|
|
22
|
+
}
|
|
23
|
+
export declare const styleRefs: z.ZodObject<{
|
|
24
|
+
base: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
+
slots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const styleVariantInput: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
28
|
+
/** Where an element renders. It is the switch that decides whether an `apiContainer` fetches from the BROWSER
|
|
29
|
+
* (its `query` URL, with anything it authenticates with visible to the visitor) or from the SERVER through a
|
|
30
|
+
* connector — so a CMS integration is not wired until this says `server`. */
|
|
31
|
+
export declare const elementRuntime: z.ZodEnum<{
|
|
32
|
+
server: "server";
|
|
33
|
+
client: "client";
|
|
34
|
+
shared: "shared";
|
|
35
|
+
}>;
|
|
36
|
+
export declare const initialStateInput: z.ZodObject<{
|
|
37
|
+
styleVariant: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>>;
|
|
38
|
+
visibility: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export declare const elementShape: {
|
|
41
|
+
ref: z.ZodString;
|
|
42
|
+
type: z.ZodString;
|
|
43
|
+
label: z.ZodOptional<z.ZodString>;
|
|
44
|
+
subType: z.ZodOptional<z.ZodString>;
|
|
45
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
46
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
base: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
+
slots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
initialState: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
styleVariant: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>>;
|
|
52
|
+
visibility: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
runtime: z.ZodOptional<z.ZodEnum<{
|
|
55
|
+
server: "server";
|
|
56
|
+
client: "client";
|
|
57
|
+
shared: "shared";
|
|
58
|
+
}>>;
|
|
59
|
+
};
|
|
60
|
+
export declare const elementInput: z.ZodType<ElementInput>;
|
|
61
|
+
export declare const position: z.ZodEnum<{
|
|
62
|
+
inside: "inside";
|
|
63
|
+
before: "before";
|
|
64
|
+
after: "after";
|
|
65
|
+
}>;
|
|
66
|
+
export declare const scalar: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
67
|
+
export declare const bindingCategory: z.ZodEnum<{
|
|
68
|
+
attributes: "attributes";
|
|
69
|
+
style: "style";
|
|
70
|
+
initialState: "initialState";
|
|
71
|
+
}>;
|
|
72
|
+
export declare const bindingInput: z.ZodObject<{
|
|
73
|
+
to: z.ZodString;
|
|
74
|
+
source: z.ZodString;
|
|
75
|
+
id: z.ZodOptional<z.ZodString>;
|
|
76
|
+
transformers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
77
|
+
action: z.ZodString;
|
|
78
|
+
params: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
79
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
}, z.core.$strip>>>;
|
|
81
|
+
when: z.ZodOptional<z.ZodType<RuleGroup, unknown, z.core.$ZodTypeInternals<RuleGroup, unknown>>>;
|
|
82
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
export declare const interactionNodeType: z.ZodEnum<{
|
|
85
|
+
trigger: "trigger";
|
|
86
|
+
globalCallback: "globalCallback";
|
|
87
|
+
callback: "callback";
|
|
88
|
+
utility: "utility";
|
|
89
|
+
}>;
|
|
90
|
+
export declare const interactionNode: z.ZodObject<{
|
|
91
|
+
id: z.ZodOptional<z.ZodString>;
|
|
92
|
+
title: z.ZodString;
|
|
93
|
+
nodeType: z.ZodEnum<{
|
|
94
|
+
trigger: "trigger";
|
|
95
|
+
globalCallback: "globalCallback";
|
|
96
|
+
callback: "callback";
|
|
97
|
+
utility: "utility";
|
|
98
|
+
}>;
|
|
99
|
+
action: z.ZodString;
|
|
100
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
101
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
when: z.ZodOptional<z.ZodType<RuleGroup, unknown, z.core.$ZodTypeInternals<RuleGroup, unknown>>>;
|
|
103
|
+
elementId: z.ZodOptional<z.ZodString>;
|
|
104
|
+
preview: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
export type InteractionNodeInput = z.infer<typeof interactionNode>;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/modules/mcp/tools/operations/schema/shared.ts
|
|
3
|
+
var combinator = z.enum(["and", "or"]);
|
|
4
|
+
var operator = z.enum([
|
|
5
|
+
"",
|
|
6
|
+
"=",
|
|
7
|
+
"!=",
|
|
8
|
+
"<",
|
|
9
|
+
">",
|
|
10
|
+
"<=",
|
|
11
|
+
">=",
|
|
12
|
+
"contains",
|
|
13
|
+
"doesNotContain",
|
|
14
|
+
"beginsWith",
|
|
15
|
+
"doesNotBeginWith",
|
|
16
|
+
"endsWith",
|
|
17
|
+
"doesNotEndWith",
|
|
18
|
+
"empty",
|
|
19
|
+
"notEmpty",
|
|
20
|
+
"in",
|
|
21
|
+
"notIn",
|
|
22
|
+
"between",
|
|
23
|
+
"notBetween"
|
|
24
|
+
]);
|
|
25
|
+
var ruleValue = z.union([
|
|
26
|
+
z.string(),
|
|
27
|
+
z.number(),
|
|
28
|
+
z.boolean(),
|
|
29
|
+
z.null(),
|
|
30
|
+
z.record(z.string(), z.unknown()),
|
|
31
|
+
z.array(z.unknown())
|
|
32
|
+
]);
|
|
33
|
+
var ruleBase = {
|
|
34
|
+
id: z.string().optional(),
|
|
35
|
+
field: z.string().describe("The data field the rule tests"),
|
|
36
|
+
operator,
|
|
37
|
+
enabled: z.boolean().optional()
|
|
38
|
+
};
|
|
39
|
+
var rule = z.union([z.object({
|
|
40
|
+
...ruleBase,
|
|
41
|
+
isBinding: z.literal(true),
|
|
42
|
+
value: z.string()
|
|
43
|
+
}), z.object({
|
|
44
|
+
...ruleBase,
|
|
45
|
+
isBinding: z.literal(false).optional(),
|
|
46
|
+
value: ruleValue
|
|
47
|
+
})]);
|
|
48
|
+
var ruleGroup = z.lazy(() => z.object({
|
|
49
|
+
id: z.string().optional(),
|
|
50
|
+
combinator,
|
|
51
|
+
rules: z.array(z.union([rule, ruleGroup])),
|
|
52
|
+
enabled: z.boolean().optional()
|
|
53
|
+
}));
|
|
54
|
+
var styleRefs = z.object({
|
|
55
|
+
base: z.array(z.string()).optional(),
|
|
56
|
+
slots: z.record(z.string(), z.array(z.string())).optional()
|
|
57
|
+
});
|
|
58
|
+
var styleVariantInput = z.record(z.string(), z.record(z.string(), z.union([z.string(), z.array(z.string())])));
|
|
59
|
+
/** Where an element renders. It is the switch that decides whether an `apiContainer` fetches from the BROWSER
|
|
60
|
+
* (its `query` URL, with anything it authenticates with visible to the visitor) or from the SERVER through a
|
|
61
|
+
* connector — so a CMS integration is not wired until this says `server`. */
|
|
62
|
+
var elementRuntime = z.enum([
|
|
63
|
+
"server",
|
|
64
|
+
"client",
|
|
65
|
+
"shared"
|
|
66
|
+
]).describe("Where this element renders: \"shared\" (default, both), \"client\" (browser only), or \"server\" (SSR only). An apiContainer MUST be \"server\" to read through a connector — a client one calls its own `query` URL instead.");
|
|
67
|
+
var initialStateInput = z.object({
|
|
68
|
+
styleVariant: styleVariantInput.optional().describe("Variant each attached class uses: { className: { base|slot: variantName | [names] } }"),
|
|
69
|
+
visibility: z.boolean().optional().describe("Initial visibility of the element")
|
|
70
|
+
});
|
|
71
|
+
var elementShape = {
|
|
72
|
+
ref: z.string().describe("Semantic id you choose, or an existing element ref/id. On a new element it becomes the idRef everything addresses it by: its data source is `<type>_<ref>`, and interactions target it by this ref. Letters, digits, `-` and `_`, starting with a letter — a dot would break the `<type>_<idRef>.<field>` grammar. Unique across the space."),
|
|
73
|
+
type: z.string().describe("Type from plitzi://types"),
|
|
74
|
+
label: z.string().optional(),
|
|
75
|
+
subType: z.string().optional(),
|
|
76
|
+
props: z.record(z.string(), z.unknown()).optional().describe("Full replacement on update"),
|
|
77
|
+
style: styleRefs.optional().describe("Definition refs per slot; style the element by attaching a definition"),
|
|
78
|
+
initialState: initialStateInput.optional().describe("Applied style variant(s) and initial visibility (see plitzi://guide styling)"),
|
|
79
|
+
runtime: elementRuntime.optional()
|
|
80
|
+
};
|
|
81
|
+
var elementInput = z.lazy(() => z.object({
|
|
82
|
+
...elementShape,
|
|
83
|
+
children: z.array(elementInput).optional()
|
|
84
|
+
}));
|
|
85
|
+
var position = z.enum([
|
|
86
|
+
"inside",
|
|
87
|
+
"before",
|
|
88
|
+
"after"
|
|
89
|
+
]).describe("Placement relative to the anchor: \"inside\" nests it as a child (default), \"before\"/\"after\" as a sibling");
|
|
90
|
+
var scalar = z.union([
|
|
91
|
+
z.string(),
|
|
92
|
+
z.number(),
|
|
93
|
+
z.boolean()
|
|
94
|
+
]);
|
|
95
|
+
var bindingCategory = z.enum([
|
|
96
|
+
"attributes",
|
|
97
|
+
"style",
|
|
98
|
+
"initialState"
|
|
99
|
+
]).describe("What the value feeds: a prop (attributes), a style value (style), or an initialState key");
|
|
100
|
+
var bindingTransformer = z.object({
|
|
101
|
+
action: z.string().describe("Transformer action name"),
|
|
102
|
+
params: z.record(z.string(), z.string()),
|
|
103
|
+
enabled: z.boolean().optional().describe("Set false to keep the transformer in the chain but skip it at runtime (defaults to true)")
|
|
104
|
+
});
|
|
105
|
+
var bindingInput = z.object({
|
|
106
|
+
to: z.string().describe("Target field the value feeds (a prop key, style value, or initialState key)"),
|
|
107
|
+
source: z.string().describe("Data source path, e.g. \"apiContainer_x.data\" — see plitzi://data-sources"),
|
|
108
|
+
id: z.string().optional().describe("Stable binding id; generated when omitted"),
|
|
109
|
+
transformers: z.array(bindingTransformer).optional(),
|
|
110
|
+
when: ruleGroup.optional().describe("QueryBuilder RuleGroup gating the binding (validated structurally)"),
|
|
111
|
+
enabled: z.boolean().optional()
|
|
112
|
+
});
|
|
113
|
+
var interactionNodeType = z.enum([
|
|
114
|
+
"trigger",
|
|
115
|
+
"globalCallback",
|
|
116
|
+
"callback",
|
|
117
|
+
"utility"
|
|
118
|
+
]).describe("trigger starts a flow (must be first); the rest run in order after it");
|
|
119
|
+
var interactionNode = z.object({
|
|
120
|
+
id: z.string().optional().describe("Existing node id to preserve; generated when omitted"),
|
|
121
|
+
title: z.string().describe("Human label for the step"),
|
|
122
|
+
nodeType: interactionNodeType,
|
|
123
|
+
action: z.string().describe("Action name, e.g. \"onClick\", \"login\" — see plitzi://interactions"),
|
|
124
|
+
params: z.record(z.string(), z.unknown()).optional(),
|
|
125
|
+
enabled: z.boolean().optional(),
|
|
126
|
+
when: ruleGroup.optional().describe("QueryBuilder RuleGroup gating this step (validated structurally)"),
|
|
127
|
+
elementId: z.string().optional().describe("Element whose callback this step invokes; defaults to this element. Its ref or raw id — a raw id is normalised to the idRef the runtime looks callbacks up by, and a target without one is given it."),
|
|
128
|
+
preview: z.record(z.string(), z.unknown()).optional()
|
|
129
|
+
});
|
|
130
|
+
//#endregion
|
|
131
|
+
export { bindingCategory, bindingInput, elementInput, elementRuntime, elementShape, initialStateInput, interactionNode, interactionNodeType, position, ruleGroup, scalar, styleRefs, styleVariantInput };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ElementVersion } from '../../../helpers';
|
|
2
|
+
import { AIElementDetail, AIFolder, AIPageSkeleton, AIPageStyles, AIPageSummary, AISchemaVariable, AISettings } from '../../../types';
|
|
3
|
+
import { Element, Schema, Style } from '@plitzi/sdk-shared';
|
|
4
|
+
export declare const pageSummariesToAI: (schema: Schema) => AIPageSummary[];
|
|
5
|
+
export declare const foldersToAI: (schema: Schema) => AIFolder[];
|
|
6
|
+
export declare const folderRefToAI: (schema: Schema, ref: string) => AIFolder | undefined;
|
|
7
|
+
export declare const elementView: (schema: Schema, el: Element, style: Style) => ElementVersion;
|
|
8
|
+
export declare const pageSkeletonToAI: (schema: Schema, pageEl: Element, style?: Style) => AIPageSkeleton;
|
|
9
|
+
export declare const pageStylesToAI: (schema: Schema, style: Style, pageEl: Element) => AIPageStyles;
|
|
10
|
+
export declare const elementDetailToAI: (schema: Schema, el: Element, style?: Style) => AIElementDetail;
|
|
11
|
+
export declare const schemaVariablesToAI: (schema: Schema, includeSubValues?: boolean) => Record<string, AISchemaVariable>;
|
|
12
|
+
export declare const settingsToAI: (schema: Schema) => AISettings;
|