@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,37 @@
|
|
|
1
|
+
import { createPreview } from "../preview/createPreview.js";
|
|
2
|
+
import { readRawBody } from "@plitzi/sdk-server/kernel";
|
|
3
|
+
//#region src/stages/preview.ts
|
|
4
|
+
var PREVIEW_PATH_DEFAULT = "/__preview";
|
|
5
|
+
var json = (ctx, status, payload) => {
|
|
6
|
+
ctx.res.setHeader("Content-Type", "application/json");
|
|
7
|
+
ctx.res.setStatus(status);
|
|
8
|
+
ctx.res.send(JSON.stringify(payload));
|
|
9
|
+
return true;
|
|
10
|
+
};
|
|
11
|
+
var previewStage = async (ctx) => {
|
|
12
|
+
const preview = ctx.config.preview;
|
|
13
|
+
const path = preview?.path ?? PREVIEW_PATH_DEFAULT;
|
|
14
|
+
if (!preview?.enabled || ctx.req.method !== "POST" || ctx.req.path !== path) return false;
|
|
15
|
+
if (preview.secret && ctx.req.headers["x-preview-secret"] !== preview.secret) return json(ctx, 403, {
|
|
16
|
+
error: "FORBIDDEN",
|
|
17
|
+
message: "Invalid or missing preview secret."
|
|
18
|
+
});
|
|
19
|
+
ctx.req.body = await readRawBody(ctx.raw);
|
|
20
|
+
let body;
|
|
21
|
+
try {
|
|
22
|
+
body = JSON.parse(ctx.req.body || "{}");
|
|
23
|
+
} catch {
|
|
24
|
+
return json(ctx, 400, {
|
|
25
|
+
error: "BAD_REQUEST",
|
|
26
|
+
message: "Request body must be JSON."
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (typeof body.spaceId !== "number") return json(ctx, 400, {
|
|
30
|
+
error: "BAD_REQUEST",
|
|
31
|
+
message: "spaceId (number) is required."
|
|
32
|
+
});
|
|
33
|
+
const result = await createPreview(body, ctx.config, ctx.renderFn, ctx.pluginManager, ctx.caches);
|
|
34
|
+
return json(ctx, result.ok ? 200 : 422, result);
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { previewStage };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { proxySettings } from "../modules/mcp/proxy/config.js";
|
|
2
|
+
import { handleProxyRequest } from "../modules/mcp/proxy/handler.js";
|
|
3
|
+
//#region src/stages/proxy.ts
|
|
4
|
+
var createWidgetProxyStage = (options = {}) => {
|
|
5
|
+
const settings = proxySettings(options.proxy);
|
|
6
|
+
return async (ctx) => {
|
|
7
|
+
if (!settings || ctx.req.path !== settings.path) return false;
|
|
8
|
+
ctx.operation = "proxy";
|
|
9
|
+
await handleProxyRequest(ctx.req, ctx.res, settings);
|
|
10
|
+
return true;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { createWidgetProxyStage };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type HttpProbeResult = {
|
|
2
|
+
status: number;
|
|
3
|
+
body: string;
|
|
4
|
+
};
|
|
5
|
+
/** Minimal HTTP client for the server-level tests. They drive a real listening server rather than calling a
|
|
6
|
+
* handler, because what is under test is the pipeline — which stage answers, and in what order. */
|
|
7
|
+
export declare const httpRequest: (port: number, method: string, path: string, headers?: Record<string, string>, body?: string) => Promise<HttpProbeResult>;
|
|
8
|
+
/** Headers every MCP JSON-RPC call needs: the Streamable HTTP transport refuses a request that does not accept
|
|
9
|
+
* both a JSON body and an SSE stream. */
|
|
10
|
+
export declare const RPC_HEADERS: {
|
|
11
|
+
'Content-Type': string;
|
|
12
|
+
Accept: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const jsonRpc: (method: string, params?: unknown, id?: number) => string;
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@plitzi/sdk-mcp",
|
|
3
|
+
"version": "0.33.0",
|
|
4
|
+
"license": "AGPL-3.0",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist",
|
|
7
|
+
"skills"
|
|
8
|
+
],
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./server": {
|
|
19
|
+
"types": "./dist/server.d.ts",
|
|
20
|
+
"import": "./dist/server.js",
|
|
21
|
+
"default": "./dist/server.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "https",
|
|
26
|
+
"url": "https://github.com/plitzi/plitzi-workspace.git"
|
|
27
|
+
},
|
|
28
|
+
"type": "module",
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@modelcontextprotocol/ext-apps": "^1.7.5",
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
33
|
+
"@plitzi/plitzi-sdk": "0.33.0",
|
|
34
|
+
"@plitzi/sdk-schema": "0.33.0",
|
|
35
|
+
"@plitzi/sdk-server": "0.33.0",
|
|
36
|
+
"@plitzi/sdk-shared": "0.33.0",
|
|
37
|
+
"ejs": "^6.0.1",
|
|
38
|
+
"esbuild": "^0.28.2",
|
|
39
|
+
"zod": "^4.4.3"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"react": "^19",
|
|
43
|
+
"react-dom": "^19"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/ejs": "^3.1.5",
|
|
47
|
+
"@types/jsdom": "^30.0.0",
|
|
48
|
+
"@types/node": "^26.2.0",
|
|
49
|
+
"@types/react": "^19.2.18",
|
|
50
|
+
"@vitejs/plugin-react": "^6.0.5",
|
|
51
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
52
|
+
"eslint": "^9.39.5",
|
|
53
|
+
"eslint-plugin-import": "^2.32.0",
|
|
54
|
+
"jsdom": "^30.0.1",
|
|
55
|
+
"react": "^19.2.8",
|
|
56
|
+
"react-dom": "^19.2.8",
|
|
57
|
+
"tsx": "^4.23.12",
|
|
58
|
+
"typescript": "^6.0.3",
|
|
59
|
+
"vite": "^8.2.1",
|
|
60
|
+
"vite-plugin-dts": "^5.0.3",
|
|
61
|
+
"vitest": "^4.1.10"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"start": "TSX_TSCONFIG_PATH=tsconfig.app.json node --import tsx dev/main.ts",
|
|
65
|
+
"start:dev": "TSX_TSCONFIG_PATH=tsconfig.app.json node --import tsx --watch dev/main.ts",
|
|
66
|
+
"start:inspect": "TSX_TSCONFIG_PATH=tsconfig.app.json node --import tsx --inspect dev/main.ts",
|
|
67
|
+
"inspector": "yarn dlx @modelcontextprotocol/inspector@latest",
|
|
68
|
+
"build:dev": "vite build --mode development",
|
|
69
|
+
"build:prod": "vite build",
|
|
70
|
+
"lint": "TIMING=1 eslint ./src ./dev",
|
|
71
|
+
"typecheck": "tsc -p tsconfig.app.json --noEmit",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"test:e2e": "vitest run src/modules/mcp/e2e",
|
|
74
|
+
"test:coverage": "vitest run --coverage",
|
|
75
|
+
"bench": "vitest bench --run"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plitzi-render
|
|
3
|
+
description: >-
|
|
4
|
+
Show answers as a rendered visual widget instead of plain text, using the Plitzi MCP's plitzi_render tool.
|
|
5
|
+
Use whenever the reply is naturally visual or structured — a recipe, a comparison, pricing tiers, a profile,
|
|
6
|
+
a menu, steps/checklist, a product card, a dashboard-like summary — or whenever the user asks to design,
|
|
7
|
+
build, show, or "make it look nice". Requires the Plitzi MCP server (the plitzi_render tool) to be connected.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Rendering answers as Plitzi widgets
|
|
11
|
+
|
|
12
|
+
`plitzi_render` renders a small, self-contained UI widget the user can SEE. It runs the Plitzi SDK offline — no
|
|
13
|
+
backend, no account, no space, so it works even on a connection with no credentials. Prefer **showing** a widget
|
|
14
|
+
over a long text answer whenever the content is naturally visual.
|
|
15
|
+
|
|
16
|
+
## When to reach for it
|
|
17
|
+
|
|
18
|
+
- **Something to design or build**: a card, hero, banner, form, pricing table — anything the user asks you to
|
|
19
|
+
"create / design / build / show / make look nice".
|
|
20
|
+
- **A naturally visual answer**: a recipe → a card with photo + ingredients; a comparison → side-by-side tiles;
|
|
21
|
+
steps → a checklist; a product, place or person → a profile card; options → a tiled menu.
|
|
22
|
+
|
|
23
|
+
Keep writing plain text when the answer is genuinely textual — an explanation, code, a discussion. One good widget
|
|
24
|
+
beats a wall of text, but a widget wrapping a paragraph helps no one.
|
|
25
|
+
|
|
26
|
+
## Before the first call
|
|
27
|
+
|
|
28
|
+
Read the MCP resource **`plitzi://render/guide`** once per conversation. It is the authoritative authoring model:
|
|
29
|
+
every operation, the element types and their props, the styling system, worked examples. `plitzi://render/types`
|
|
30
|
+
lists every element type with its description. Don't reconstruct the schema from memory — read the guide.
|
|
31
|
+
|
|
32
|
+
## The shape of a good call
|
|
33
|
+
|
|
34
|
+
Everything the widget needs travels in ONE call, as `operations`. Three ops carry almost every widget:
|
|
35
|
+
|
|
36
|
+
- **`upsertDefinitions`** — declare ALL the CSS classes at once, one class per *look* (not per property).
|
|
37
|
+
- **`upsertElement`** — build the whole tree in a single op, nesting with `children` under `pageRef: "render"`.
|
|
38
|
+
- **`repeatElement`** — the moment two siblings differ only in data, write the row ONCE as a template with
|
|
39
|
+
`{{item.field}}` placeholders and pass `items`. Rows come out numbered (`tile-1`, `tile-2`…). A list inside each
|
|
40
|
+
row is the same op: give a template node `repeat: { items: "{{item.<field>}}", template: … }`.
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"operations": [
|
|
45
|
+
{
|
|
46
|
+
"type": "upsertDefinitions",
|
|
47
|
+
"definitions": {
|
|
48
|
+
"panel": {
|
|
49
|
+
"desktop": {
|
|
50
|
+
"display": "flex",
|
|
51
|
+
"flex-direction": "column",
|
|
52
|
+
"gap": "12px",
|
|
53
|
+
"padding": "16px",
|
|
54
|
+
"min-width": "0",
|
|
55
|
+
"color": "var(--color-text-primary, light-dark(#0f172a, #e8eaed))"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"row": {
|
|
59
|
+
"desktop": { "display": "flex", "flex-wrap": "wrap", "gap": "12px", "min-width": "0" },
|
|
60
|
+
"mobile": { "flex-direction": "column" }
|
|
61
|
+
},
|
|
62
|
+
"tile": {
|
|
63
|
+
"desktop": {
|
|
64
|
+
"flex": "1 1 0%",
|
|
65
|
+
"min-width": "160px",
|
|
66
|
+
"padding": "12px",
|
|
67
|
+
"border-radius": "10px",
|
|
68
|
+
"border": "1px solid var(--color-border-primary, light-dark(#e2e8f0, #333a48))",
|
|
69
|
+
"background-color": "var(--color-background-secondary, light-dark(#ffffff, #1f2430))"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"tile-title": { "desktop": { "margin": "0", "font-size": "15px" } },
|
|
73
|
+
"tile-price": { "desktop": { "margin": "0", "font-size": "13px", "opacity": "0.75" } }
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"type": "upsertElement",
|
|
78
|
+
"pageRef": "render",
|
|
79
|
+
"element": {
|
|
80
|
+
"ref": "panel",
|
|
81
|
+
"type": "container",
|
|
82
|
+
"style": { "base": ["panel"] },
|
|
83
|
+
"children": [{ "ref": "title", "type": "heading", "subType": "h3", "props": { "content": "Plans" } }]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"type": "repeatElement",
|
|
88
|
+
"pageRef": "render",
|
|
89
|
+
"parentRef": "panel",
|
|
90
|
+
"ref": "plans",
|
|
91
|
+
"style": { "base": ["row"] },
|
|
92
|
+
"template": {
|
|
93
|
+
"ref": "tile",
|
|
94
|
+
"type": "container",
|
|
95
|
+
"style": { "base": ["tile"] },
|
|
96
|
+
"children": [
|
|
97
|
+
{
|
|
98
|
+
"ref": "name",
|
|
99
|
+
"type": "heading",
|
|
100
|
+
"subType": "h4",
|
|
101
|
+
"props": { "content": "{{item.name}}" },
|
|
102
|
+
"style": { "base": ["tile-title"] }
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"ref": "price",
|
|
106
|
+
"type": "paragraph",
|
|
107
|
+
"props": { "content": "{{item.price}}" },
|
|
108
|
+
"style": { "base": ["tile-price"] }
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"items": [
|
|
113
|
+
{ "name": "Starter", "price": "$0 / month" },
|
|
114
|
+
{ "name": "Team", "price": "$19 / month" },
|
|
115
|
+
{ "name": "Business", "price": "$49 / month" }
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## The five things that decide whether it looks good
|
|
123
|
+
|
|
124
|
+
1. **Width is free, height is scarce.** The widget renders in a side panel. A plain container stacks its children
|
|
125
|
+
vertically — that is the tall, half-empty default to avoid. Put peers (metrics, plans, options, image + text) in
|
|
126
|
+
a wrapping row (`display:flex` + `flex-wrap:wrap`, children `flex:1 1 0%` with a `min-width` as the wrap
|
|
127
|
+
threshold) or a grid with `grid-template-columns: repeat(auto-fit, minmax(160px, 1fr))`. Stack only what reads in
|
|
128
|
+
order: heading over paragraph, forms, steps, prose.
|
|
129
|
+
2. **The host may be in dark mode.** Never hardcode a light palette. Take colours from the host variables with a
|
|
130
|
+
`light-dark()` fallback, and always set `color` wherever you set `background-color`.
|
|
131
|
+
3. **Watch the SDK defaults.** Every container has `min-width`/`min-height: 50px` — set them to `0` for rails,
|
|
132
|
+
dividers, dots and any flex child that must shrink. Headings and paragraphs keep the browser's margins; zero
|
|
133
|
+
them and space with the parent's `gap`.
|
|
134
|
+
4. **Draw with inline SVG, on a budget.** A logo, a sparkline, a badge or a decorative shape goes in a `blockHtml`
|
|
135
|
+
element whose `props.content` is an `<svg>` — keep a `viewBox` with `width`/`height` `100%` so the element's
|
|
136
|
+
class sizes it, and `fill`/`stroke` `currentColor` so it follows the theme. A handful of paths, drawn once and
|
|
137
|
+
reused. Never a `data:` URI, and never a full illustration or a photo-real scene: that costs more than the rest
|
|
138
|
+
of the widget, so use an `https` image, a flat colour or a CSS gradient instead. Markup only — `<script>` and
|
|
139
|
+
inline `on*` handlers are rejected.
|
|
140
|
+
5. **Write CSS plainly.** Kebab-case properties, shorthands welcome (`padding: 8px 16px`, `border: 1px solid red`,
|
|
141
|
+
`font: bold 16px/1.5 Arial`) — they are expanded and stored as longhands, so a breakpoint or state can override
|
|
142
|
+
one property on its own.
|
|
143
|
+
|
|
144
|
+
## Iterating on a widget you already rendered
|
|
145
|
+
|
|
146
|
+
Every render answers with a **`renderId`**. To change that widget, do NOT rebuild it: call again with
|
|
147
|
+
`patch: true`, that `renderId`, and only the operations that differ (`patchElement`, `patchDefinition`,
|
|
148
|
+
`deleteElement`, a new `repeatElement`). Address rows by the refs you already know (`tile-1`, `tile-2`). The widget
|
|
149
|
+
merges the delta into the batch it was built from and reports back what it applied, errors included.
|
|
150
|
+
|
|
151
|
+
Patch **only** to modify that widget. A different subject, or a different kind of widget, is a fresh render with no
|
|
152
|
+
`patch` — the delta is merged into the previous batch, so patching a new idea leaves the user looking at both at
|
|
153
|
+
once. Rebuilding when you could have patched only costs tokens; patching when you should have rebuilt costs the
|
|
154
|
+
user a wrong widget.
|
|
155
|
+
|
|
156
|
+
If the answer says the widget could not be recovered (a surface that renders no widgets, a host that keeps no
|
|
157
|
+
storage, a conversation resumed elsewhere), send the whole batch again without `patch`.
|
|
158
|
+
|
|
159
|
+
## When a call fails
|
|
160
|
+
|
|
161
|
+
`plitzi_render` answers with `rendered: false` and `errors: [{ path, message, hint }]`, plus `warnings` for smaller
|
|
162
|
+
issues. The `path` names the operation, so fix that one and call again — you never lose the rest of the batch. An
|
|
163
|
+
unknown prop comes back as a warning naming the right one, so probing is safe.
|
|
164
|
+
|
|
165
|
+
## After it renders
|
|
166
|
+
|
|
167
|
+
The widget is shown to the user; you get a compact summary. Don't re-describe what they can already see — a short
|
|
168
|
+
caption or a follow-up question is enough.
|
|
169
|
+
|
|
170
|
+
## Going further
|
|
171
|
+
|
|
172
|
+
Widgets can be data-driven and interactive, not only static: an `apiContainer` fetches at runtime, `upsertBinding`
|
|
173
|
+
wires that data into elements, and `upsertInteractionFlow` makes them react to clicks. See the "Data &
|
|
174
|
+
interactivity" section of `plitzi://render/guide`.
|