@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,23 @@
|
|
|
1
|
+
import { require } from "./resolve.js";
|
|
2
|
+
import { zodEnglishOnly } from "./zodEnglishOnly.js";
|
|
3
|
+
import { build } from "esbuild";
|
|
4
|
+
//#region src/modules/mcp/apps/shared/bundle.ts
|
|
5
|
+
var options = (entry) => ({
|
|
6
|
+
entryPoints: [entry],
|
|
7
|
+
bundle: true,
|
|
8
|
+
write: false,
|
|
9
|
+
format: "iife",
|
|
10
|
+
platform: "browser",
|
|
11
|
+
target: "es2022",
|
|
12
|
+
jsx: "automatic",
|
|
13
|
+
minify: true,
|
|
14
|
+
alias: { "@plitzi/plitzi-sdk": require.resolve("@plitzi/plitzi-sdk") },
|
|
15
|
+
define: { "process.env.NODE_ENV": "\"production\"" },
|
|
16
|
+
plugins: [zodEnglishOnly],
|
|
17
|
+
logLevel: "silent"
|
|
18
|
+
});
|
|
19
|
+
var bundle = async (entry) => {
|
|
20
|
+
return (await build(options(entry))).outputFiles[0].text;
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { bundle };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { bundle } from "./bundle.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
import ejs from "ejs";
|
|
6
|
+
//#region src/modules/mcp/apps/shared/page.ts
|
|
7
|
+
var SHELL = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "shell.ejs");
|
|
8
|
+
var template = () => ejs.compile(readFileSync(SHELL, "utf-8"), { filename: SHELL });
|
|
9
|
+
var scripts = /* @__PURE__ */ new Map();
|
|
10
|
+
var pages = /* @__PURE__ */ new Map();
|
|
11
|
+
var script = (entry) => {
|
|
12
|
+
let built = scripts.get(entry);
|
|
13
|
+
if (!built) {
|
|
14
|
+
built = bundle(entry);
|
|
15
|
+
scripts.set(entry, built);
|
|
16
|
+
}
|
|
17
|
+
return built;
|
|
18
|
+
};
|
|
19
|
+
var page = (app, settings) => {
|
|
20
|
+
const key = `${app.uri}|${JSON.stringify(settings)}`;
|
|
21
|
+
let html = pages.get(key);
|
|
22
|
+
if (!html) {
|
|
23
|
+
html = script(app.entry).then((code) => template()({
|
|
24
|
+
title: app.title,
|
|
25
|
+
app: code,
|
|
26
|
+
css: (app.styles?.() ?? []).join("\n"),
|
|
27
|
+
settings: JSON.stringify(settings)
|
|
28
|
+
}));
|
|
29
|
+
pages.set(key, html);
|
|
30
|
+
}
|
|
31
|
+
return html;
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { page };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { McpApp, McpViewSettings } from '../../types';
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
/** Serves the app as a self-contained page: no import map, no asset mounts, no cross-origin fetches, so the
|
|
4
|
+
* strictest host sandbox runs it and no deployment has to serve anything extra. */
|
|
5
|
+
export declare const registerApp: (server: McpServer, app: McpApp, settings: McpViewSettings) => void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { page } from "./page.js";
|
|
2
|
+
import { RESOURCE_MIME_TYPE, registerAppResource } from "@modelcontextprotocol/ext-apps/server";
|
|
3
|
+
//#region src/modules/mcp/apps/shared/registerApp.ts
|
|
4
|
+
var WILDCARDS = [
|
|
5
|
+
"*",
|
|
6
|
+
"https:",
|
|
7
|
+
"https://*"
|
|
8
|
+
];
|
|
9
|
+
var defaultCsp = (proxyOrigin) => proxyOrigin ? {
|
|
10
|
+
resourceDomains: [proxyOrigin],
|
|
11
|
+
connectDomains: [proxyOrigin]
|
|
12
|
+
} : {
|
|
13
|
+
resourceDomains: [
|
|
14
|
+
...WILDCARDS,
|
|
15
|
+
"data:",
|
|
16
|
+
"blob:"
|
|
17
|
+
],
|
|
18
|
+
connectDomains: [...WILDCARDS]
|
|
19
|
+
};
|
|
20
|
+
var originOf = (endpoint) => {
|
|
21
|
+
if (!endpoint) return;
|
|
22
|
+
try {
|
|
23
|
+
return new URL(endpoint).origin;
|
|
24
|
+
} catch {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
/** Serves the app as a self-contained page: no import map, no asset mounts, no cross-origin fetches, so the
|
|
29
|
+
* strictest host sandbox runs it and no deployment has to serve anything extra. */
|
|
30
|
+
var registerApp = (server, app, settings) => {
|
|
31
|
+
const meta = { ui: { csp: app.csp ?? defaultCsp(originOf(settings.proxyEndpoint)) } };
|
|
32
|
+
registerAppResource(server, app.name, app.uri, {
|
|
33
|
+
description: app.description,
|
|
34
|
+
_meta: meta
|
|
35
|
+
}, async () => ({ contents: [{
|
|
36
|
+
uri: app.uri,
|
|
37
|
+
mimeType: RESOURCE_MIME_TYPE,
|
|
38
|
+
text: await page(app, settings),
|
|
39
|
+
_meta: meta
|
|
40
|
+
}] }));
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { registerApp };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const require: NodeJS.Require;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<%#
|
|
2
|
+
The page shell every MCP App shares. The host renders it in a sandboxed iframe on ITS OWN origin: the app and
|
|
3
|
+
its styles are inlined, so the page fetches NOTHING and runs under a deny-by-default sandbox CSP.
|
|
4
|
+
-%>
|
|
5
|
+
<!doctype html>
|
|
6
|
+
<html lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<meta charset="utf-8" />
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
|
+
<title><%= title %></title>
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
/*
|
|
14
|
+
The page inherits the HOST's theme, which may be dark: nothing here paints a surface, so an app that sets no
|
|
15
|
+
colours would otherwise draw the browser's black default text over the host's own background — unreadable in
|
|
16
|
+
a dark chat. `light-dark()` picks the right side of every pair; `color-scheme` is what tells it which side,
|
|
17
|
+
and it follows the OS until useHostStyles replaces it with the theme the host actually reported (that hook
|
|
18
|
+
also fills the --color-* variables in, so the var() fallbacks below only apply on a host that sends none).
|
|
19
|
+
*/
|
|
20
|
+
html {
|
|
21
|
+
color-scheme: light dark;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
html,
|
|
25
|
+
body {
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
body {
|
|
30
|
+
background-color: transparent;
|
|
31
|
+
color: var(--color-text-primary, light-dark(#0f172a, #e8eaed));
|
|
32
|
+
font-family: var(--font-sans, system-ui, sans-serif);
|
|
33
|
+
}
|
|
34
|
+
/* The app renders nothing until the host pushes the tool result in. */
|
|
35
|
+
#app:empty::after {
|
|
36
|
+
content: 'Rendering…';
|
|
37
|
+
display: block;
|
|
38
|
+
padding: 16px;
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
color: var(--color-text-tertiary, light-dark(#64748b, #9aa4b2));
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
43
|
+
<style>
|
|
44
|
+
<%- css %>
|
|
45
|
+
</style>
|
|
46
|
+
</head>
|
|
47
|
+
<body>
|
|
48
|
+
<div id="app"></div>
|
|
49
|
+
|
|
50
|
+
<%# Deployment switches, before the app so the view reads them as it mounts. They ride in the page, not the
|
|
51
|
+
bundle, so a server serving both settings still builds the browser bundle once. -%>
|
|
52
|
+
<script id="plitzi-view-settings">
|
|
53
|
+
window.__PLITZI_VIEW__ = <%- settings %>;
|
|
54
|
+
</script>
|
|
55
|
+
<script>
|
|
56
|
+
<%- app %>
|
|
57
|
+
</script>
|
|
58
|
+
</body>
|
|
59
|
+
</html>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Plugin } from 'esbuild';
|
|
2
|
+
/** Drops zod's ~40 translations (194 KB): they are re-exported as a namespace, which no bundler can tree-shake.
|
|
3
|
+
* English survives because zod imports `locales/en.js` directly, not through this index. */
|
|
4
|
+
export declare const zodEnglishOnly: Plugin;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/modules/mcp/apps/shared/zodEnglishOnly.ts
|
|
2
|
+
var NAMESPACE = "zod-locales-stub";
|
|
3
|
+
var ZOD_PACKAGE = /node_modules[/\\]zod[/\\]/u;
|
|
4
|
+
/** Drops zod's ~40 translations (194 KB): they are re-exported as a namespace, which no bundler can tree-shake.
|
|
5
|
+
* English survives because zod imports `locales/en.js` directly, not through this index. */
|
|
6
|
+
var zodEnglishOnly = {
|
|
7
|
+
name: "zod-english-only",
|
|
8
|
+
setup(builder) {
|
|
9
|
+
builder.onResolve({ filter: /locales[/\\]index\.js$/ }, (args) => ZOD_PACKAGE.test(args.importer) ? {
|
|
10
|
+
path: args.path,
|
|
11
|
+
namespace: NAMESPACE
|
|
12
|
+
} : void 0);
|
|
13
|
+
builder.onLoad({
|
|
14
|
+
filter: /.*/,
|
|
15
|
+
namespace: NAMESPACE
|
|
16
|
+
}, () => ({
|
|
17
|
+
contents: "export {};",
|
|
18
|
+
loader: "js"
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { zodEnglishOnly };
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
/** Resolve a `globalCallback` action against the built-in catalog: returns the module id it is registered under
|
|
13
|
+
* (`source`) and the params reconciled to the callback's schema — unknown keys dropped for a closed callback, then
|
|
14
|
+
* missing defaults filled. An action the catalog does not know (e.g. a plugin callback) yields no source and
|
|
15
|
+
* unchanged params, so the caller keeps its own behavior for it. */
|
|
16
|
+
export declare const applyBuiltinCallback: (action: string, params: Record<string, unknown>) => {
|
|
17
|
+
source?: string;
|
|
18
|
+
params: Record<string, unknown>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { reconcileParams } from "./paramSpec.js";
|
|
2
|
+
//#region src/modules/mcp/catalogs/builtinCallbacks.ts
|
|
3
|
+
var BUILTIN_GLOBAL_CALLBACKS = {
|
|
4
|
+
addNotification: {
|
|
5
|
+
source: "space",
|
|
6
|
+
title: "Add Notification",
|
|
7
|
+
strictParams: true,
|
|
8
|
+
params: {
|
|
9
|
+
content: {
|
|
10
|
+
type: "textarea",
|
|
11
|
+
description: "The notification text shown to the user — this is the message body. There is no separate title/message/type param.",
|
|
12
|
+
default: "Content"
|
|
13
|
+
},
|
|
14
|
+
placement: {
|
|
15
|
+
type: "select",
|
|
16
|
+
description: "Where the toast appears on screen.",
|
|
17
|
+
default: "top-right",
|
|
18
|
+
options: [
|
|
19
|
+
"top-right",
|
|
20
|
+
"top-center",
|
|
21
|
+
"top-left",
|
|
22
|
+
"bottom-right",
|
|
23
|
+
"bottom-center",
|
|
24
|
+
"bottom-left"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
appeareance: {
|
|
28
|
+
type: "select",
|
|
29
|
+
description: "Visual style of the notification. NOTE: the key is spelled \"appeareance\".",
|
|
30
|
+
default: "success",
|
|
31
|
+
options: [
|
|
32
|
+
"success",
|
|
33
|
+
"danger",
|
|
34
|
+
"warning",
|
|
35
|
+
"info"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
autoDismiss: {
|
|
39
|
+
type: "boolean",
|
|
40
|
+
description: "Whether the notification dismisses itself after a timeout.",
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
autoDismissTimeout: {
|
|
44
|
+
type: "number",
|
|
45
|
+
description: "Milliseconds before auto-dismiss. Only applies when autoDismiss is true.",
|
|
46
|
+
default: 5e3,
|
|
47
|
+
when: (params) => params.autoDismiss === true
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
setState: {
|
|
52
|
+
source: "state",
|
|
53
|
+
title: "Set State",
|
|
54
|
+
strictParams: true,
|
|
55
|
+
params: {
|
|
56
|
+
key: {
|
|
57
|
+
type: "text",
|
|
58
|
+
description: "The state key/path to set.",
|
|
59
|
+
default: ""
|
|
60
|
+
},
|
|
61
|
+
type: {
|
|
62
|
+
type: "select",
|
|
63
|
+
description: "The value type.",
|
|
64
|
+
options: [
|
|
65
|
+
"boolean",
|
|
66
|
+
"number",
|
|
67
|
+
"text"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
value: {
|
|
71
|
+
type: "scalar",
|
|
72
|
+
description: "The value to store — its type follows the `type` param (a real boolean/number, or text).",
|
|
73
|
+
when: (params) => Boolean(params.type)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
clearState: {
|
|
78
|
+
source: "state",
|
|
79
|
+
title: "Clear State",
|
|
80
|
+
strictParams: true,
|
|
81
|
+
params: {}
|
|
82
|
+
},
|
|
83
|
+
navigate: {
|
|
84
|
+
source: "navigation",
|
|
85
|
+
title: "Navigate",
|
|
86
|
+
strictParams: true,
|
|
87
|
+
params: {
|
|
88
|
+
urlType: {
|
|
89
|
+
type: "select",
|
|
90
|
+
description: "Target kind: a space page, an internal space path, or an external URL.",
|
|
91
|
+
options: [
|
|
92
|
+
"page",
|
|
93
|
+
"internal",
|
|
94
|
+
"external"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
url: {
|
|
98
|
+
type: "text",
|
|
99
|
+
description: "Destination — a page id when urlType is \"page\", otherwise a URL/path.",
|
|
100
|
+
when: (params) => Boolean(params.urlType)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
authLogin: {
|
|
105
|
+
source: "auth",
|
|
106
|
+
title: "Auth Login",
|
|
107
|
+
strictParams: true,
|
|
108
|
+
params: {}
|
|
109
|
+
},
|
|
110
|
+
authLogout: {
|
|
111
|
+
source: "auth",
|
|
112
|
+
title: "Auth Logout",
|
|
113
|
+
strictParams: true,
|
|
114
|
+
params: {}
|
|
115
|
+
},
|
|
116
|
+
authRefreshDetails: {
|
|
117
|
+
source: "auth",
|
|
118
|
+
title: "Auth Refresh Details",
|
|
119
|
+
strictParams: true,
|
|
120
|
+
params: {}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
/** The built-in globalCallback for an action, or undefined when the action is not a known built-in (a plugin
|
|
124
|
+
* callback whose source/schema is not knowable here). */
|
|
125
|
+
var getGlobalCallback = (action) => Object.hasOwn(BUILTIN_GLOBAL_CALLBACKS, action) ? BUILTIN_GLOBAL_CALLBACKS[action] : void 0;
|
|
126
|
+
/** Resolve a `globalCallback` action against the built-in catalog: returns the module id it is registered under
|
|
127
|
+
* (`source`) and the params reconciled to the callback's schema — unknown keys dropped for a closed callback, then
|
|
128
|
+
* missing defaults filled. An action the catalog does not know (e.g. a plugin callback) yields no source and
|
|
129
|
+
* unchanged params, so the caller keeps its own behavior for it. */
|
|
130
|
+
var applyBuiltinCallback = (action, params) => {
|
|
131
|
+
if (!(action in BUILTIN_GLOBAL_CALLBACKS)) return { params };
|
|
132
|
+
const builtin = BUILTIN_GLOBAL_CALLBACKS[action];
|
|
133
|
+
return {
|
|
134
|
+
source: builtin.source,
|
|
135
|
+
params: reconcileParams(params, builtin.params, builtin.strictParams)
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
//#endregion
|
|
139
|
+
export { BUILTIN_GLOBAL_CALLBACKS, applyBuiltinCallback, getGlobalCallback };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
//#region src/modules/mcp/catalogs/builtinComponents.ts
|
|
2
|
+
var BUILTIN_COMPONENTS = {
|
|
3
|
+
container: {
|
|
4
|
+
label: "Container",
|
|
5
|
+
category: "structure",
|
|
6
|
+
description: "Generic layout box (a div). The primary building block for structure: groups and positions child elements with flex/grid. Reach for it whenever you need to wrap or arrange other elements."
|
|
7
|
+
},
|
|
8
|
+
list: {
|
|
9
|
+
label: "List",
|
|
10
|
+
category: "structure",
|
|
11
|
+
description: "Repeats a template (its listItem/link child) once per entry of a data array — the way to render a dynamic collection. Bind its items to a data source (e.g. an apiContainer response)."
|
|
12
|
+
},
|
|
13
|
+
listItem: {
|
|
14
|
+
label: "List Item",
|
|
15
|
+
category: "structure",
|
|
16
|
+
description: "The repeated template rendered once per row inside a list; its fields bind to each array entry."
|
|
17
|
+
},
|
|
18
|
+
dialogContainer: {
|
|
19
|
+
label: "Dialog Container",
|
|
20
|
+
category: "structure",
|
|
21
|
+
description: "A native <dialog> container shown or hidden through interactions (e.g. an onClick open/close)."
|
|
22
|
+
},
|
|
23
|
+
modalContainer: {
|
|
24
|
+
label: "Modal Container",
|
|
25
|
+
category: "structure",
|
|
26
|
+
description: "A modal overlay container opened and closed through interactions; use for dialogs over the page."
|
|
27
|
+
},
|
|
28
|
+
tabContainer: {
|
|
29
|
+
label: "Tab Container",
|
|
30
|
+
category: "structure",
|
|
31
|
+
description: "A tabbed container that switches between panels; composed of header/body/item parts."
|
|
32
|
+
},
|
|
33
|
+
tabContainerHeader: {
|
|
34
|
+
label: "Tab Container Header",
|
|
35
|
+
category: "structure",
|
|
36
|
+
description: "The row of tab triggers inside a tabContainer."
|
|
37
|
+
},
|
|
38
|
+
tabContainerBody: {
|
|
39
|
+
label: "Tab Container Body",
|
|
40
|
+
category: "structure",
|
|
41
|
+
description: "The panel area inside a tabContainer that shows the active tab item."
|
|
42
|
+
},
|
|
43
|
+
tabContainerItem: {
|
|
44
|
+
label: "Tab Container Item",
|
|
45
|
+
category: "structure",
|
|
46
|
+
description: "One selectable tab (trigger + panel) inside a tabContainer."
|
|
47
|
+
},
|
|
48
|
+
apiContainer: {
|
|
49
|
+
label: "Api Container",
|
|
50
|
+
category: "provider",
|
|
51
|
+
description: "Fetches data from a backend HTTP API (its `query`/`method`/`credentials`) and exposes the response as a data source ITS DESCENDANTS bind to (source `apiContainer_<idRef>.data`; only elements inside it can consume it). This is how you get backend data into the frontend. Its `mockData` prop is builder-only sample data — the published runtime fetches the real `query`, so always set a real query for production."
|
|
52
|
+
},
|
|
53
|
+
text: {
|
|
54
|
+
label: "Text",
|
|
55
|
+
category: "basic",
|
|
56
|
+
description: "Inline plain-text content. Use for short runs of copy; bind its content to data for dynamic text."
|
|
57
|
+
},
|
|
58
|
+
paragraph: {
|
|
59
|
+
label: "Paragraph",
|
|
60
|
+
category: "basic",
|
|
61
|
+
description: "A block of body text (a <p>). Use for longer prose passages."
|
|
62
|
+
},
|
|
63
|
+
heading: {
|
|
64
|
+
label: "Heading",
|
|
65
|
+
category: "basic",
|
|
66
|
+
description: "A section heading (<h1>–<h6>) for titles and document hierarchy."
|
|
67
|
+
},
|
|
68
|
+
button: {
|
|
69
|
+
label: "Button",
|
|
70
|
+
category: "basic",
|
|
71
|
+
description: "A clickable button. On its own it only renders; wire an interaction flow (trigger onClick → callbacks) to make it DO something."
|
|
72
|
+
},
|
|
73
|
+
link: {
|
|
74
|
+
label: "Link",
|
|
75
|
+
category: "basic",
|
|
76
|
+
description: "Navigation. Moves the user between pages of the site or to an external URL (its `mode`/`href` decide which). Use this to go page-to-page rather than a button + interaction."
|
|
77
|
+
},
|
|
78
|
+
markdown: {
|
|
79
|
+
label: "Markdown",
|
|
80
|
+
category: "basic",
|
|
81
|
+
description: "Renders a Markdown source string as formatted HTML."
|
|
82
|
+
},
|
|
83
|
+
dropdown: {
|
|
84
|
+
label: "Dropdown",
|
|
85
|
+
category: "basic",
|
|
86
|
+
description: "A trigger that toggles an attached popup panel (dropdownPopup) — menus, selects, flyouts."
|
|
87
|
+
},
|
|
88
|
+
dropdownPopup: {
|
|
89
|
+
label: "Dropdown Popup",
|
|
90
|
+
category: "basic",
|
|
91
|
+
description: "The floating panel revealed by a dropdown."
|
|
92
|
+
},
|
|
93
|
+
form: {
|
|
94
|
+
label: "Form",
|
|
95
|
+
category: "form",
|
|
96
|
+
description: "A <form> that groups form controls and handles submission; wire its submit through an interaction flow."
|
|
97
|
+
},
|
|
98
|
+
formControl: {
|
|
99
|
+
label: "Form Control",
|
|
100
|
+
category: "form",
|
|
101
|
+
description: "A single labelled input (text/select/checkbox/… per its subType) inside a form; captures one field of user input."
|
|
102
|
+
},
|
|
103
|
+
image: {
|
|
104
|
+
label: "Image",
|
|
105
|
+
category: "media",
|
|
106
|
+
description: "Displays an image from a URL."
|
|
107
|
+
},
|
|
108
|
+
video: {
|
|
109
|
+
label: "Video",
|
|
110
|
+
category: "media",
|
|
111
|
+
description: "Embeds a video from a URL."
|
|
112
|
+
},
|
|
113
|
+
fontAwesome: {
|
|
114
|
+
label: "Font Awesome",
|
|
115
|
+
category: "media",
|
|
116
|
+
description: "Renders a Font Awesome icon by its icon name."
|
|
117
|
+
},
|
|
118
|
+
page: {
|
|
119
|
+
label: "Page",
|
|
120
|
+
category: "internal",
|
|
121
|
+
description: "The root of a routable screen. Managed through the page ops (upsertPage/deletePage), not added as a child element."
|
|
122
|
+
},
|
|
123
|
+
layoutContainer: {
|
|
124
|
+
label: "Layout Container",
|
|
125
|
+
category: "internal",
|
|
126
|
+
description: "A reusable layout shell (header/footer chrome) shared across pages."
|
|
127
|
+
},
|
|
128
|
+
notFound: {
|
|
129
|
+
label: "Not Found",
|
|
130
|
+
category: "internal",
|
|
131
|
+
description: "The 404 screen shown when no route matches."
|
|
132
|
+
},
|
|
133
|
+
loading: {
|
|
134
|
+
label: "Loading",
|
|
135
|
+
category: "internal",
|
|
136
|
+
description: "A loading placeholder shown while data or a suspense boundary resolves."
|
|
137
|
+
},
|
|
138
|
+
reference: {
|
|
139
|
+
label: "Reference",
|
|
140
|
+
category: "advanced",
|
|
141
|
+
description: "Reuses another element or template by id, rendering it in place."
|
|
142
|
+
},
|
|
143
|
+
custom: {
|
|
144
|
+
label: "Custom",
|
|
145
|
+
category: "advanced",
|
|
146
|
+
description: "A custom element slot whose behaviour is supplied by a host/plugin component."
|
|
147
|
+
},
|
|
148
|
+
blockHtml: {
|
|
149
|
+
label: "HTML Block",
|
|
150
|
+
category: "advanced",
|
|
151
|
+
description: "Renders an arbitrary raw HTML string as a block. Escape hatch when no structured element fits."
|
|
152
|
+
},
|
|
153
|
+
nodeHtml: {
|
|
154
|
+
label: "Html Node",
|
|
155
|
+
category: "advanced",
|
|
156
|
+
description: "A single raw HTML tag with custom attributes."
|
|
157
|
+
},
|
|
158
|
+
blockJsx: {
|
|
159
|
+
label: "Block JSX",
|
|
160
|
+
category: "advanced",
|
|
161
|
+
description: "A compiled JSX block for advanced authoring."
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
//#endregion
|
|
165
|
+
export { BUILTIN_COMPONENTS };
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
/** Reconcile a `callback` action against the element-callback catalog: unknown keys dropped for a closed callback,
|
|
12
|
+
* then missing defaults filled (category:"attribute", revertOnFinish:false). An unknown action yields unchanged
|
|
13
|
+
* params, so a plugin/element-specific callback keeps whatever the agent passed. */
|
|
14
|
+
export declare const applyElementCallback: (action: string, params: Record<string, unknown>) => {
|
|
15
|
+
known: boolean;
|
|
16
|
+
params: Record<string, unknown>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { reconcileParams } from "./paramSpec.js";
|
|
2
|
+
//#region src/modules/mcp/catalogs/builtinElementCallbacks.ts
|
|
3
|
+
var BUILTIN_ELEMENT_CALLBACKS = { setState: {
|
|
4
|
+
title: "Update Element (set attribute / state)",
|
|
5
|
+
strictParams: true,
|
|
6
|
+
params: {
|
|
7
|
+
category: {
|
|
8
|
+
type: "select",
|
|
9
|
+
description: "What to change on the element: \"attribute\" sets one of its props (the common case — e.g. content, disabled); \"state\" sets element state (visibility or a style selector). REQUIRED — always set it.",
|
|
10
|
+
default: "attribute",
|
|
11
|
+
options: ["attribute", "state"],
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
key: {
|
|
15
|
+
type: "text",
|
|
16
|
+
description: "The field to set. When category=\"attribute\", an attribute/prop key of THIS element (e.g. \"content\", \"disabled\"). When category=\"state\", \"visibility\" or \"styleSelectors.<selector>\". REQUIRED.",
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
value: {
|
|
20
|
+
type: "scalar",
|
|
21
|
+
description: "The value to set — its type follows the target attribute: a real boolean (true/false) for a boolean attribute, a number for a numeric one, otherwise a string (the strings \"true\"/\"false\" also coerce). There is NO separate `type` param (that belongs to the global state setState, not this one). REQUIRED.",
|
|
22
|
+
when: (params) => Boolean(params.category),
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
revertOnFinish: {
|
|
26
|
+
type: "boolean",
|
|
27
|
+
description: "When true, this change is UNDONE automatically when the whole flow finishes. Use it for a TEMPORARY change (a \"loading…\" label, disabling a button while it works) instead of adding manual restore steps at the end of the flow.",
|
|
28
|
+
default: false
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
} };
|
|
32
|
+
/** The built-in element callback for an action, or undefined when the action is not a known built-in (an
|
|
33
|
+
* element-type-specific/plugin callback whose schema is not knowable here). */
|
|
34
|
+
var getElementCallback = (action) => Object.hasOwn(BUILTIN_ELEMENT_CALLBACKS, action) ? BUILTIN_ELEMENT_CALLBACKS[action] : void 0;
|
|
35
|
+
/** Reconcile a `callback` action against the element-callback catalog: unknown keys dropped for a closed callback,
|
|
36
|
+
* then missing defaults filled (category:"attribute", revertOnFinish:false). An unknown action yields unchanged
|
|
37
|
+
* params, so a plugin/element-specific callback keeps whatever the agent passed. */
|
|
38
|
+
var applyElementCallback = (action, params) => {
|
|
39
|
+
const builtin = getElementCallback(action);
|
|
40
|
+
if (!builtin) return {
|
|
41
|
+
known: false,
|
|
42
|
+
params
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
known: true,
|
|
46
|
+
params: reconcileParams(params, builtin.params, builtin.strictParams)
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { BUILTIN_ELEMENT_CALLBACKS, applyElementCallback, getElementCallback };
|
|
@@ -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[];
|