@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,161 @@
|
|
|
1
|
+
import { cloneSpace } from "../../helpers/space.js";
|
|
2
|
+
import { environment, operations } from "../operations/index.js";
|
|
3
|
+
import { applyOperations } from "./dispatch.js";
|
|
4
|
+
import { changedResources, conflictMessage, detectConflicts, resolvedElements } from "./writeResult.js";
|
|
5
|
+
import { expandOperations } from "../shared/expandOperations.js";
|
|
6
|
+
import { defineTool } from "../shared/tool.js";
|
|
7
|
+
import { validateOperations } from "../shared/validator/index.js";
|
|
8
|
+
import { auditResources } from "../shared/validator/audit.js";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { validateSchema } from "@plitzi/sdk-schema/helpers/schemaValidator";
|
|
11
|
+
//#region src/modules/mcp/tools/apply/index.ts
|
|
12
|
+
var applyShape = {
|
|
13
|
+
environment,
|
|
14
|
+
dryRun: z.boolean().optional().describe("Validate and apply in memory only, WITHOUT persisting. Returns the same result (changed versions + full element detail) so you can inspect the outcome and decide on more changes before committing for real."),
|
|
15
|
+
expectedResourceVersions: z.record(z.string(), z.string()).optional().describe("Resource URI → the stateVersion you read; guards against concurrent edits"),
|
|
16
|
+
operations
|
|
17
|
+
};
|
|
18
|
+
var noWarnings = (warnings) => warnings.length > 0 ? warnings : void 0;
|
|
19
|
+
var schemaErrorToValidation = (error) => ({
|
|
20
|
+
path: error.elementId ? `schema.${error.elementId}` : "schema",
|
|
21
|
+
message: error.message,
|
|
22
|
+
hint: "This batch would leave the schema inconsistent (broken parent/child link or a cycle); nothing was applied."
|
|
23
|
+
});
|
|
24
|
+
var apply = async (input, space, persisters) => {
|
|
25
|
+
const env = input.environment ?? "main";
|
|
26
|
+
const expansion = expandOperations(input.operations);
|
|
27
|
+
if (expansion.errors.length > 0) return {
|
|
28
|
+
applied: false,
|
|
29
|
+
persisted: false,
|
|
30
|
+
summary: {
|
|
31
|
+
created: 0,
|
|
32
|
+
updated: 0,
|
|
33
|
+
deleted: 0
|
|
34
|
+
},
|
|
35
|
+
changed: [],
|
|
36
|
+
errors: expansion.errors
|
|
37
|
+
};
|
|
38
|
+
const ops = expansion.operations;
|
|
39
|
+
const validation = validateOperations(space, ops);
|
|
40
|
+
if (!validation.valid) return {
|
|
41
|
+
applied: false,
|
|
42
|
+
persisted: false,
|
|
43
|
+
summary: {
|
|
44
|
+
created: 0,
|
|
45
|
+
updated: 0,
|
|
46
|
+
deleted: 0
|
|
47
|
+
},
|
|
48
|
+
changed: [],
|
|
49
|
+
errors: validation.errors,
|
|
50
|
+
warnings: noWarnings(validation.warnings)
|
|
51
|
+
};
|
|
52
|
+
const conflicts = detectConflicts(space, env, input.expectedResourceVersions);
|
|
53
|
+
if (conflicts.length > 0) return {
|
|
54
|
+
applied: false,
|
|
55
|
+
persisted: false,
|
|
56
|
+
summary: {
|
|
57
|
+
created: 0,
|
|
58
|
+
updated: 0,
|
|
59
|
+
deleted: 0
|
|
60
|
+
},
|
|
61
|
+
changed: [],
|
|
62
|
+
conflict: {
|
|
63
|
+
message: conflictMessage,
|
|
64
|
+
conflicts
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const draft = cloneSpace(space);
|
|
68
|
+
const outcome = applyOperations(draft, env, ops);
|
|
69
|
+
if (outcome.errors.length > 0) return {
|
|
70
|
+
applied: false,
|
|
71
|
+
persisted: false,
|
|
72
|
+
summary: {
|
|
73
|
+
created: 0,
|
|
74
|
+
updated: 0,
|
|
75
|
+
deleted: 0
|
|
76
|
+
},
|
|
77
|
+
changed: [],
|
|
78
|
+
errors: outcome.errors,
|
|
79
|
+
warnings: noWarnings(validation.warnings)
|
|
80
|
+
};
|
|
81
|
+
const integrity = validateSchema(draft.schema);
|
|
82
|
+
if (!integrity.valid) return {
|
|
83
|
+
applied: false,
|
|
84
|
+
persisted: false,
|
|
85
|
+
summary: {
|
|
86
|
+
created: 0,
|
|
87
|
+
updated: 0,
|
|
88
|
+
deleted: 0
|
|
89
|
+
},
|
|
90
|
+
changed: [],
|
|
91
|
+
errors: integrity.errors.map(schemaErrorToValidation),
|
|
92
|
+
warnings: noWarnings(validation.warnings)
|
|
93
|
+
};
|
|
94
|
+
const audit = auditResources(draft, ops);
|
|
95
|
+
const warnings = [...validation.warnings, ...audit.warnings];
|
|
96
|
+
if (audit.errors.length > 0) return {
|
|
97
|
+
applied: false,
|
|
98
|
+
persisted: false,
|
|
99
|
+
summary: {
|
|
100
|
+
created: 0,
|
|
101
|
+
updated: 0,
|
|
102
|
+
deleted: 0
|
|
103
|
+
},
|
|
104
|
+
changed: [],
|
|
105
|
+
errors: audit.errors,
|
|
106
|
+
warnings: noWarnings(warnings)
|
|
107
|
+
};
|
|
108
|
+
if (input.dryRun) return {
|
|
109
|
+
applied: false,
|
|
110
|
+
dryRun: true,
|
|
111
|
+
summary: {
|
|
112
|
+
created: outcome.created,
|
|
113
|
+
updated: outcome.updated,
|
|
114
|
+
deleted: outcome.deleted
|
|
115
|
+
},
|
|
116
|
+
changed: changedResources(draft, env, outcome.staleResources),
|
|
117
|
+
elements: resolvedElements(draft, env, outcome.elementRefs),
|
|
118
|
+
warnings: noWarnings(warnings)
|
|
119
|
+
};
|
|
120
|
+
let persisted = true;
|
|
121
|
+
if (outcome.changedSchema) {
|
|
122
|
+
if (persisters?.schema) await persisters.schema(draft.schema);
|
|
123
|
+
else persisted = false;
|
|
124
|
+
}
|
|
125
|
+
if (outcome.changedStyle) {
|
|
126
|
+
if (persisters?.style) await persisters.style(draft.style);
|
|
127
|
+
else persisted = false;
|
|
128
|
+
}
|
|
129
|
+
for (const id of outcome.changedConnectors) {
|
|
130
|
+
const entry = draft.connectors.find((item) => item.id === id);
|
|
131
|
+
if (entry && persisters?.saveConnector) await persisters.saveConnector(entry);
|
|
132
|
+
else persisted = false;
|
|
133
|
+
}
|
|
134
|
+
for (const id of outcome.deletedConnectors) if (persisters?.deleteConnector) await persisters.deleteConnector(id);
|
|
135
|
+
else persisted = false;
|
|
136
|
+
return {
|
|
137
|
+
applied: true,
|
|
138
|
+
persisted,
|
|
139
|
+
summary: {
|
|
140
|
+
created: outcome.created,
|
|
141
|
+
updated: outcome.updated,
|
|
142
|
+
deleted: outcome.deleted
|
|
143
|
+
},
|
|
144
|
+
changed: changedResources(draft, env, outcome.staleResources),
|
|
145
|
+
elements: resolvedElements(draft, env, outcome.elementRefs),
|
|
146
|
+
warnings: noWarnings(warnings)
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
var applyTool = defineTool({
|
|
150
|
+
name: "plitzi_apply",
|
|
151
|
+
title: "Apply",
|
|
152
|
+
description: "Validate, apply and persist a batch of operations atomically. Returns the changed resources and their new versions, plus the full detail of every element it created or updated. Pass dryRun to apply in memory only (inspect the outcome without committing). Rejects the whole batch on any error or version conflict — INCLUDING a pre-existing malformation in any resource the batch touches (fix it in the same batch to unblock the save).",
|
|
153
|
+
inputShape: applyShape,
|
|
154
|
+
access: "write",
|
|
155
|
+
run: (input, ctx) => apply({
|
|
156
|
+
...input,
|
|
157
|
+
environment: ctx.env
|
|
158
|
+
}, ctx.space, ctx.persisters)
|
|
159
|
+
});
|
|
160
|
+
//#endregion
|
|
161
|
+
export { apply, applyShape, applyTool };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Space } from '../../helpers';
|
|
2
|
+
import { ChangedResource, Conflict, Env, WriteElement } from '../../types';
|
|
3
|
+
export declare const detectConflicts: (space: Space, env: Env, expected: Record<string, string> | undefined) => Conflict[];
|
|
4
|
+
export declare const changedResources: (space: Space, env: Env, uris: string[]) => ChangedResource[];
|
|
5
|
+
/** Full detail of each created/updated element (by ref), skipping any that no longer resolve (e.g. deleted later
|
|
6
|
+
* in the same batch). Returns undefined when there is nothing, so the field stays off the response. */
|
|
7
|
+
export declare const resolvedElements: (space: Space, env: Env, refs: string[]) => WriteElement[] | undefined;
|
|
8
|
+
export declare const conflictMessage = "Cannot apply: your data is stale. Re-read the changed resources and retry.";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { elementUri } from "../../helpers/uris.js";
|
|
2
|
+
import { readResource, resourceVersion } from "../../resources/router.js";
|
|
3
|
+
//#region src/modules/mcp/tools/apply/writeResult.ts
|
|
4
|
+
var detectConflicts = (space, env, expected) => {
|
|
5
|
+
if (!expected) return [];
|
|
6
|
+
const conflicts = [];
|
|
7
|
+
for (const [uri, version] of Object.entries(expected)) {
|
|
8
|
+
const current = resourceVersion(space, env, uri);
|
|
9
|
+
if (current !== null && current !== version) conflicts.push({
|
|
10
|
+
resourceUri: uri,
|
|
11
|
+
expectedVersion: version,
|
|
12
|
+
currentVersion: current
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return conflicts;
|
|
16
|
+
};
|
|
17
|
+
var changedResources = (space, env, uris) => uris.map((uri) => ({
|
|
18
|
+
uri,
|
|
19
|
+
stateVersion: resourceVersion(space, env, uri) ?? ""
|
|
20
|
+
}));
|
|
21
|
+
/** Full detail of each created/updated element (by ref), skipping any that no longer resolve (e.g. deleted later
|
|
22
|
+
* in the same batch). Returns undefined when there is nothing, so the field stays off the response. */
|
|
23
|
+
var resolvedElements = (space, env, refs) => {
|
|
24
|
+
const elements = refs.map((ref) => {
|
|
25
|
+
const uri = elementUri(env, ref);
|
|
26
|
+
const res = readResource(space, env, uri);
|
|
27
|
+
return res ? {
|
|
28
|
+
uri,
|
|
29
|
+
stateVersion: res.stateVersion,
|
|
30
|
+
...res.data
|
|
31
|
+
} : void 0;
|
|
32
|
+
}).filter((el) => el !== void 0);
|
|
33
|
+
return elements.length > 0 ? elements : void 0;
|
|
34
|
+
};
|
|
35
|
+
var conflictMessage = "Cannot apply: your data is stale. Re-read the changed resources and retry.";
|
|
36
|
+
//#endregion
|
|
37
|
+
export { changedResources, conflictMessage, detectConflicts, resolvedElements };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ToolDef } from './shared/tool';
|
|
2
|
+
export { apply, applyShape } from './apply';
|
|
3
|
+
export { validate, validateShape } from './validate';
|
|
4
|
+
export { search, searchShape } from './search';
|
|
5
|
+
export { read, readShape } from './read';
|
|
6
|
+
export { previewShape } from './preview';
|
|
7
|
+
export { render, renderShape } from './render';
|
|
8
|
+
export { screenshotShape } from './screenshot';
|
|
9
|
+
export { applyOperations } from './apply/dispatch';
|
|
10
|
+
export { validateOperations } from './shared/validator';
|
|
11
|
+
export { operation } from './operations';
|
|
12
|
+
/** The MCP tool registry — the single source both hosts (the standalone server and the in-process AI bridge)
|
|
13
|
+
* register from. Adding a tool is: create its file with a ToolDef descriptor and append it here. */
|
|
14
|
+
export declare const tools: ToolDef[];
|
|
15
|
+
export type { ToolContext, ToolDef } from './shared/tool';
|
|
16
|
+
export type { OpResult } from '../helpers';
|
|
17
|
+
export type { DefinitionSlotInput, DefinitionSlotPatch, ElementInput, Operation, OperationType } from './operations';
|
|
18
|
+
export type { ApplyInput, ChangedResource, Conflict, Persisters, WriteElement, WriteResponse, ValidateInput, ValidationResult, MutationOutcome, SearchHit, SearchInput, SearchResponse, SearchPageHit, ReadInput, ReadResponse, ReadHit } from '../types';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { operation } from "./operations/index.js";
|
|
2
|
+
import { applyOperations } from "./apply/dispatch.js";
|
|
3
|
+
import { validateOperations } from "./shared/validator/index.js";
|
|
4
|
+
import { apply, applyShape, applyTool } from "./apply/index.js";
|
|
5
|
+
import { previewTool } from "./preview.js";
|
|
6
|
+
import { read, readShape, readTool } from "./read.js";
|
|
7
|
+
import { renderTool } from "./render.js";
|
|
8
|
+
import { screenshotTool } from "./screenshot.js";
|
|
9
|
+
import { search, searchShape, searchTool } from "./search.js";
|
|
10
|
+
import { validate, validateShape, validateTool } from "./validate.js";
|
|
11
|
+
//#region src/modules/mcp/tools/index.ts
|
|
12
|
+
/** The MCP tool registry — the single source both hosts (the standalone server and the in-process AI bridge)
|
|
13
|
+
* register from. Adding a tool is: create its file with a ToolDef descriptor and append it here. */
|
|
14
|
+
var tools = [
|
|
15
|
+
applyTool,
|
|
16
|
+
validateTool,
|
|
17
|
+
searchTool,
|
|
18
|
+
readTool,
|
|
19
|
+
renderTool,
|
|
20
|
+
previewTool,
|
|
21
|
+
screenshotTool
|
|
22
|
+
];
|
|
23
|
+
//#endregion
|
|
24
|
+
export { apply, applyOperations, applyShape, operation, read, readShape, search, searchShape, tools, validate, validateOperations, validateShape };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { OpResult, Space } from '../../../helpers';
|
|
3
|
+
import { Env } from '../../../types';
|
|
4
|
+
export declare const deleteConnectorOp: z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"deleteConnector">;
|
|
6
|
+
ref: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type DeleteConnector = z.infer<typeof deleteConnectorOp>;
|
|
9
|
+
export declare const deleteConnector: (space: Space, env: Env, op: DeleteConnector) => OpResult;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { findConnectorEntry } from "../../../helpers/space.js";
|
|
2
|
+
import { connectorUri, connectorsUri } from "../../../helpers/uris.js";
|
|
3
|
+
import { empty, fail } from "../../../helpers/opResult.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/modules/mcp/tools/operations/connectors/deleteConnector.ts
|
|
6
|
+
var deleteConnectorOp = z.object({
|
|
7
|
+
type: z.literal("deleteConnector"),
|
|
8
|
+
ref: z.string().describe("Identifier of the connector to remove")
|
|
9
|
+
}).describe("Remove a connector. Destructive and not undoable: every provider element pointing at it stops resolving and its page renders empty. Confirm with the user first.");
|
|
10
|
+
var deleteConnector = (space, env, op) => {
|
|
11
|
+
if (!findConnectorEntry(space, op.ref)) return fail("ref", `Connector "${op.ref}" does not exist`, `Read ${connectorsUri(env)} for the connectors this space has`, space.connectors.map((item) => item.id));
|
|
12
|
+
space.connectors = space.connectors.filter((item) => item.id !== op.ref);
|
|
13
|
+
return {
|
|
14
|
+
...empty(),
|
|
15
|
+
deleted: 1,
|
|
16
|
+
staleResources: [connectorsUri(env), connectorUri(env, op.ref)]
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { deleteConnector, deleteConnectorOp };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
export * from './upsertConnector';
|
|
2
|
+
export * from './patchConnector';
|
|
3
|
+
export * from './deleteConnector';
|
|
4
|
+
/** The connector write vocabulary, keyed by op type — feeds the discriminated union in tools/operations.ts. */
|
|
5
|
+
export declare const connectorOps: {
|
|
6
|
+
upsertConnector: import('zod').ZodObject<{
|
|
7
|
+
type: import('zod').ZodLiteral<"upsertConnector">;
|
|
8
|
+
ref: import('zod').ZodString;
|
|
9
|
+
name: import('zod').ZodString;
|
|
10
|
+
baseUrl: import('zod').ZodString;
|
|
11
|
+
connection: import('zod').ZodOptional<import('zod').ZodObject<{
|
|
12
|
+
credential: import('zod').ZodOptional<import('zod').ZodString>;
|
|
13
|
+
auth: import('zod').ZodOptional<import('zod').ZodObject<{
|
|
14
|
+
in: import('zod').ZodEnum<{
|
|
15
|
+
query: "query";
|
|
16
|
+
header: "header";
|
|
17
|
+
}>;
|
|
18
|
+
name: import('zod').ZodString;
|
|
19
|
+
value: import('zod').ZodString;
|
|
20
|
+
}, import('zod/v4/core').$strip>>;
|
|
21
|
+
headers: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
22
|
+
pagination: import('zod').ZodOptional<import('zod').ZodEnum<{
|
|
23
|
+
page: "page";
|
|
24
|
+
cursor: "cursor";
|
|
25
|
+
offset: "offset";
|
|
26
|
+
}>>;
|
|
27
|
+
operators: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
28
|
+
mediaBaseUrl: import('zod').ZodOptional<import('zod').ZodString>;
|
|
29
|
+
fields: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodEnum<{
|
|
30
|
+
number: "number";
|
|
31
|
+
file: "file";
|
|
32
|
+
text: "text";
|
|
33
|
+
color: "color";
|
|
34
|
+
link: "link";
|
|
35
|
+
image: "image";
|
|
36
|
+
video: "video";
|
|
37
|
+
switch: "switch";
|
|
38
|
+
email: "email";
|
|
39
|
+
date: "date";
|
|
40
|
+
richText: "richText";
|
|
41
|
+
multiImage: "multiImage";
|
|
42
|
+
phone: "phone";
|
|
43
|
+
option: "option";
|
|
44
|
+
}>>>;
|
|
45
|
+
projection: import('zod').ZodOptional<import('zod').ZodLiteral<"full">>;
|
|
46
|
+
}, import('zod/v4/core').$strip>>;
|
|
47
|
+
endpoints: import('zod').ZodObject<{
|
|
48
|
+
read: import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodObject<{
|
|
49
|
+
itemsPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
50
|
+
totalPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
51
|
+
idPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
52
|
+
valuesPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
53
|
+
path: import('zod').ZodString;
|
|
54
|
+
method: import('zod').ZodOptional<import('zod').ZodEnum<{
|
|
55
|
+
GET: "GET";
|
|
56
|
+
POST: "POST";
|
|
57
|
+
PUT: "PUT";
|
|
58
|
+
PATCH: "PATCH";
|
|
59
|
+
DELETE: "DELETE";
|
|
60
|
+
HEAD: "HEAD";
|
|
61
|
+
OPTIONS: "OPTIONS";
|
|
62
|
+
}>>;
|
|
63
|
+
query: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
64
|
+
headers: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
65
|
+
body: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
66
|
+
pagination: import('zod').ZodOptional<import('zod').ZodEnum<{
|
|
67
|
+
page: "page";
|
|
68
|
+
cursor: "cursor";
|
|
69
|
+
offset: "offset";
|
|
70
|
+
}>>;
|
|
71
|
+
}, import('zod/v4/core').$strip>>;
|
|
72
|
+
write: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodObject<{
|
|
73
|
+
method: import('zod').ZodEnum<{
|
|
74
|
+
GET: "GET";
|
|
75
|
+
POST: "POST";
|
|
76
|
+
PUT: "PUT";
|
|
77
|
+
PATCH: "PATCH";
|
|
78
|
+
DELETE: "DELETE";
|
|
79
|
+
HEAD: "HEAD";
|
|
80
|
+
OPTIONS: "OPTIONS";
|
|
81
|
+
}>;
|
|
82
|
+
path: import('zod').ZodString;
|
|
83
|
+
query: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
84
|
+
headers: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
85
|
+
bodyPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
86
|
+
response: import('zod').ZodOptional<import('zod').ZodObject<{
|
|
87
|
+
itemsPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
88
|
+
totalPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
89
|
+
idPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
90
|
+
valuesPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
91
|
+
}, import('zod/v4/core').$strip>>;
|
|
92
|
+
}, import('zod/v4/core').$strip>>>;
|
|
93
|
+
}, import('zod/v4/core').$strip>;
|
|
94
|
+
}, import('zod/v4/core').$strip>;
|
|
95
|
+
patchConnector: import('zod').ZodObject<{
|
|
96
|
+
type: import('zod').ZodLiteral<"patchConnector">;
|
|
97
|
+
ref: import('zod').ZodString;
|
|
98
|
+
name: import('zod').ZodOptional<import('zod').ZodString>;
|
|
99
|
+
baseUrl: import('zod').ZodOptional<import('zod').ZodString>;
|
|
100
|
+
connection: import('zod').ZodOptional<import('zod').ZodObject<{
|
|
101
|
+
credential: import('zod').ZodOptional<import('zod').ZodString>;
|
|
102
|
+
auth: import('zod').ZodOptional<import('zod').ZodObject<{
|
|
103
|
+
in: import('zod').ZodEnum<{
|
|
104
|
+
query: "query";
|
|
105
|
+
header: "header";
|
|
106
|
+
}>;
|
|
107
|
+
name: import('zod').ZodString;
|
|
108
|
+
value: import('zod').ZodString;
|
|
109
|
+
}, import('zod/v4/core').$strip>>;
|
|
110
|
+
headers: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
111
|
+
pagination: import('zod').ZodOptional<import('zod').ZodEnum<{
|
|
112
|
+
page: "page";
|
|
113
|
+
cursor: "cursor";
|
|
114
|
+
offset: "offset";
|
|
115
|
+
}>>;
|
|
116
|
+
operators: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
117
|
+
mediaBaseUrl: import('zod').ZodOptional<import('zod').ZodString>;
|
|
118
|
+
fields: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodEnum<{
|
|
119
|
+
number: "number";
|
|
120
|
+
file: "file";
|
|
121
|
+
text: "text";
|
|
122
|
+
color: "color";
|
|
123
|
+
link: "link";
|
|
124
|
+
image: "image";
|
|
125
|
+
video: "video";
|
|
126
|
+
switch: "switch";
|
|
127
|
+
email: "email";
|
|
128
|
+
date: "date";
|
|
129
|
+
richText: "richText";
|
|
130
|
+
multiImage: "multiImage";
|
|
131
|
+
phone: "phone";
|
|
132
|
+
option: "option";
|
|
133
|
+
}>>>;
|
|
134
|
+
projection: import('zod').ZodOptional<import('zod').ZodLiteral<"full">>;
|
|
135
|
+
}, import('zod/v4/core').$strip>>;
|
|
136
|
+
endpoints: import('zod').ZodOptional<import('zod').ZodObject<{
|
|
137
|
+
read: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodNullable<import('zod').ZodObject<{
|
|
138
|
+
itemsPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
139
|
+
totalPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
140
|
+
idPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
141
|
+
valuesPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
142
|
+
path: import('zod').ZodString;
|
|
143
|
+
method: import('zod').ZodOptional<import('zod').ZodEnum<{
|
|
144
|
+
GET: "GET";
|
|
145
|
+
POST: "POST";
|
|
146
|
+
PUT: "PUT";
|
|
147
|
+
PATCH: "PATCH";
|
|
148
|
+
DELETE: "DELETE";
|
|
149
|
+
HEAD: "HEAD";
|
|
150
|
+
OPTIONS: "OPTIONS";
|
|
151
|
+
}>>;
|
|
152
|
+
query: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
153
|
+
headers: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
154
|
+
body: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
155
|
+
pagination: import('zod').ZodOptional<import('zod').ZodEnum<{
|
|
156
|
+
page: "page";
|
|
157
|
+
cursor: "cursor";
|
|
158
|
+
offset: "offset";
|
|
159
|
+
}>>;
|
|
160
|
+
}, import('zod/v4/core').$strip>>>>;
|
|
161
|
+
write: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodNullable<import('zod').ZodObject<{
|
|
162
|
+
method: import('zod').ZodEnum<{
|
|
163
|
+
GET: "GET";
|
|
164
|
+
POST: "POST";
|
|
165
|
+
PUT: "PUT";
|
|
166
|
+
PATCH: "PATCH";
|
|
167
|
+
DELETE: "DELETE";
|
|
168
|
+
HEAD: "HEAD";
|
|
169
|
+
OPTIONS: "OPTIONS";
|
|
170
|
+
}>;
|
|
171
|
+
path: import('zod').ZodString;
|
|
172
|
+
query: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
173
|
+
headers: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>>;
|
|
174
|
+
bodyPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
175
|
+
response: import('zod').ZodOptional<import('zod').ZodObject<{
|
|
176
|
+
itemsPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
177
|
+
totalPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
178
|
+
idPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
179
|
+
valuesPath: import('zod').ZodOptional<import('zod').ZodString>;
|
|
180
|
+
}, import('zod/v4/core').$strip>>;
|
|
181
|
+
}, import('zod/v4/core').$strip>>>>;
|
|
182
|
+
}, import('zod/v4/core').$strip>>;
|
|
183
|
+
}, import('zod/v4/core').$strip>;
|
|
184
|
+
deleteConnector: import('zod').ZodObject<{
|
|
185
|
+
type: import('zod').ZodLiteral<"deleteConnector">;
|
|
186
|
+
ref: import('zod').ZodString;
|
|
187
|
+
}, import('zod/v4/core').$strip>;
|
|
188
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { deleteConnector, deleteConnectorOp } from "./deleteConnector.js";
|
|
2
|
+
import { patchConnector, patchConnectorOp } from "./patchConnector.js";
|
|
3
|
+
import { toManifest, upsertConnector, upsertConnectorOp } from "./upsertConnector.js";
|
|
4
|
+
//#region src/modules/mcp/tools/operations/connectors/index.ts
|
|
5
|
+
/** The connector write vocabulary, keyed by op type — feeds the discriminated union in tools/operations.ts. */
|
|
6
|
+
var connectorOps = {
|
|
7
|
+
upsertConnector: upsertConnectorOp,
|
|
8
|
+
patchConnector: patchConnectorOp,
|
|
9
|
+
deleteConnector: deleteConnectorOp
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { connectorOps, deleteConnector, deleteConnectorOp, patchConnector, patchConnectorOp, toManifest, upsertConnector, upsertConnectorOp };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const readEndpoint: z.ZodObject<{
|
|
3
|
+
itemsPath: z.ZodOptional<z.ZodString>;
|
|
4
|
+
totalPath: z.ZodOptional<z.ZodString>;
|
|
5
|
+
idPath: z.ZodOptional<z.ZodString>;
|
|
6
|
+
valuesPath: z.ZodOptional<z.ZodString>;
|
|
7
|
+
path: z.ZodString;
|
|
8
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
GET: "GET";
|
|
10
|
+
POST: "POST";
|
|
11
|
+
PUT: "PUT";
|
|
12
|
+
PATCH: "PATCH";
|
|
13
|
+
DELETE: "DELETE";
|
|
14
|
+
HEAD: "HEAD";
|
|
15
|
+
OPTIONS: "OPTIONS";
|
|
16
|
+
}>>;
|
|
17
|
+
query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
18
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
19
|
+
body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
20
|
+
pagination: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
page: "page";
|
|
22
|
+
cursor: "cursor";
|
|
23
|
+
offset: "offset";
|
|
24
|
+
}>>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export declare const writeEndpoint: z.ZodObject<{
|
|
27
|
+
method: z.ZodEnum<{
|
|
28
|
+
GET: "GET";
|
|
29
|
+
POST: "POST";
|
|
30
|
+
PUT: "PUT";
|
|
31
|
+
PATCH: "PATCH";
|
|
32
|
+
DELETE: "DELETE";
|
|
33
|
+
HEAD: "HEAD";
|
|
34
|
+
OPTIONS: "OPTIONS";
|
|
35
|
+
}>;
|
|
36
|
+
path: z.ZodString;
|
|
37
|
+
query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
38
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
39
|
+
bodyPath: z.ZodOptional<z.ZodString>;
|
|
40
|
+
response: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
itemsPath: z.ZodOptional<z.ZodString>;
|
|
42
|
+
totalPath: z.ZodOptional<z.ZodString>;
|
|
43
|
+
idPath: z.ZodOptional<z.ZodString>;
|
|
44
|
+
valuesPath: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
/**
|
|
48
|
+
* Everything that describes the link rather than one call.
|
|
49
|
+
*
|
|
50
|
+
* All optional, and the same schema serves both ops: on an upsert these are the connection to store, on a patch
|
|
51
|
+
* the parts of it to change.
|
|
52
|
+
*/
|
|
53
|
+
export declare const connectorConnection: z.ZodObject<{
|
|
54
|
+
credential: z.ZodOptional<z.ZodString>;
|
|
55
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
in: z.ZodEnum<{
|
|
57
|
+
query: "query";
|
|
58
|
+
header: "header";
|
|
59
|
+
}>;
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
value: z.ZodString;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
64
|
+
pagination: z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
page: "page";
|
|
66
|
+
cursor: "cursor";
|
|
67
|
+
offset: "offset";
|
|
68
|
+
}>>;
|
|
69
|
+
operators: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
70
|
+
mediaBaseUrl: z.ZodOptional<z.ZodString>;
|
|
71
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
72
|
+
number: "number";
|
|
73
|
+
file: "file";
|
|
74
|
+
text: "text";
|
|
75
|
+
color: "color";
|
|
76
|
+
link: "link";
|
|
77
|
+
image: "image";
|
|
78
|
+
video: "video";
|
|
79
|
+
switch: "switch";
|
|
80
|
+
email: "email";
|
|
81
|
+
date: "date";
|
|
82
|
+
richText: "richText";
|
|
83
|
+
multiImage: "multiImage";
|
|
84
|
+
phone: "phone";
|
|
85
|
+
option: "option";
|
|
86
|
+
}>>>;
|
|
87
|
+
projection: z.ZodOptional<z.ZodLiteral<"full">>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
export type ConnectorConnectionInput = z.infer<typeof connectorConnection>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CONNECTOR_HTTP_METHODS } from "@plitzi/sdk-shared/connectors";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/modules/mcp/tools/operations/connectors/manifest.ts
|
|
4
|
+
var templated = z.record(z.string(), z.string());
|
|
5
|
+
var pagination = z.enum([
|
|
6
|
+
"offset",
|
|
7
|
+
"page",
|
|
8
|
+
"cursor"
|
|
9
|
+
]);
|
|
10
|
+
var httpMethod = z.enum(CONNECTOR_HTTP_METHODS);
|
|
11
|
+
var responseMapping = {
|
|
12
|
+
itemsPath: z.string().optional().describe("Where the records array lives, e.g. \"data\". Omit if the response IS it"),
|
|
13
|
+
totalPath: z.string().optional().describe("Where the total count lives, e.g. \"meta.pagination.total\""),
|
|
14
|
+
idPath: z.string().optional().describe("Where a record id lives, relative to the record. Default \"id\""),
|
|
15
|
+
valuesPath: z.string().optional().describe("Where a record fields live, e.g. \"attributes\". Default \".\" (itself)")
|
|
16
|
+
};
|
|
17
|
+
var readEndpoint = z.object({
|
|
18
|
+
path: z.string().describe("Appended to baseUrl, templated, e.g. \"/api/{{resource}}\""),
|
|
19
|
+
method: httpMethod.optional().describe("Default GET. Reading through POST is how most search endpoints work"),
|
|
20
|
+
query: templated.optional().describe("Query parameters. An entry resolving to empty is dropped"),
|
|
21
|
+
headers: templated.optional(),
|
|
22
|
+
body: templated.optional().describe("Sent only by methods that carry one (POST/PUT/PATCH)"),
|
|
23
|
+
pagination: pagination.optional().describe("Paging for this endpoint when it differs from the connection default"),
|
|
24
|
+
...responseMapping
|
|
25
|
+
}).describe("A request returning records. Only reads can feed an element");
|
|
26
|
+
var writeEndpoint = z.object({
|
|
27
|
+
method: httpMethod,
|
|
28
|
+
path: z.string().describe("Appended to baseUrl, templated, e.g. \"/api/{{resource}}/{{id}}\""),
|
|
29
|
+
query: templated.optional(),
|
|
30
|
+
headers: templated.optional(),
|
|
31
|
+
bodyPath: z.string().optional().describe("Nests the values, e.g. \"data\" sends { \"data\": { … } }. Omit for root"),
|
|
32
|
+
response: z.object(responseMapping).optional().describe("Where the written record sits in the response")
|
|
33
|
+
}).describe("A request that CHANGES something. Reachable only through the writeRecord callback, never as a source");
|
|
34
|
+
/**
|
|
35
|
+
* Everything that describes the link rather than one call.
|
|
36
|
+
*
|
|
37
|
+
* All optional, and the same schema serves both ops: on an upsert these are the connection to store, on a patch
|
|
38
|
+
* the parts of it to change.
|
|
39
|
+
*/
|
|
40
|
+
var connectorConnection = z.object({
|
|
41
|
+
credential: z.string().optional().describe("Identifier of the stored secret to resolve into {{credential.*}}. YOU DO NOT CREATE OR SEE CREDENTIALS: the space owner does, in the builder. Leave it unset unless the user gave you the identifier — the connector still saves, and its requests go unauthenticated until they attach one."),
|
|
42
|
+
auth: z.object({
|
|
43
|
+
in: z.enum(["header", "query"]),
|
|
44
|
+
name: z.string().describe("Header or query-parameter name, e.g. \"Authorization\""),
|
|
45
|
+
value: z.string().describe("Template, e.g. \"Bearer {{credential.token}}\"")
|
|
46
|
+
}).optional().describe("How every request authenticates. The secret is never here — {{credential.x}} resolves it"),
|
|
47
|
+
headers: templated.optional().describe("Static headers sent on every request"),
|
|
48
|
+
pagination: pagination.optional().describe("Default paging style: offset+limit, page numbers, or an opaque cursor"),
|
|
49
|
+
operators: templated.optional().describe("Filter operators, each rendering ONE \"key=value\" query entry from {{field}} and {{value}}, e.g. { \"eq\": \"filters[{{field}}][$eq]={{value}}\" }. A filter naming an operator not declared here is DROPPED."),
|
|
50
|
+
mediaBaseUrl: z.string().optional().describe("Origin prepended to relative media paths (keys ending url/src/href)"),
|
|
51
|
+
fields: z.record(z.string(), z.enum([
|
|
52
|
+
"text",
|
|
53
|
+
"richText",
|
|
54
|
+
"image",
|
|
55
|
+
"multiImage",
|
|
56
|
+
"video",
|
|
57
|
+
"link",
|
|
58
|
+
"email",
|
|
59
|
+
"phone",
|
|
60
|
+
"number",
|
|
61
|
+
"date",
|
|
62
|
+
"switch",
|
|
63
|
+
"color",
|
|
64
|
+
"option",
|
|
65
|
+
"file"
|
|
66
|
+
])).optional().describe("Field types published to the builder for typed bindings. The only part a browser ever sees"),
|
|
67
|
+
projection: z.literal("full").optional().describe("Send every field instead of only the bound paths. Costs payload size; only for dynamic templates")
|
|
68
|
+
}).describe("Settings that apply to every call this connector makes");
|
|
69
|
+
//#endregion
|
|
70
|
+
export { connectorConnection, readEndpoint, writeEndpoint };
|