@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,47 @@
|
|
|
1
|
+
import { cloneSpace } from "../helpers/space.js";
|
|
2
|
+
import { environment, operations } from "./operations/index.js";
|
|
3
|
+
import { applyOperations } from "./apply/dispatch.js";
|
|
4
|
+
import { expandOperations } from "./shared/expandOperations.js";
|
|
5
|
+
import { defineTool } from "./shared/tool.js";
|
|
6
|
+
import { validateOperations } from "./shared/validator/index.js";
|
|
7
|
+
import { auditResources } from "./shared/validator/audit.js";
|
|
8
|
+
//#region src/modules/mcp/tools/validate.ts
|
|
9
|
+
var validateShape = {
|
|
10
|
+
environment,
|
|
11
|
+
operations
|
|
12
|
+
};
|
|
13
|
+
var validate = (input, space) => {
|
|
14
|
+
const expansion = expandOperations(input.operations);
|
|
15
|
+
if (expansion.errors.length > 0) return {
|
|
16
|
+
valid: false,
|
|
17
|
+
errors: expansion.errors,
|
|
18
|
+
warnings: []
|
|
19
|
+
};
|
|
20
|
+
const ops = expansion.operations;
|
|
21
|
+
const validation = validateOperations(space, ops);
|
|
22
|
+
if (!validation.valid) return validation;
|
|
23
|
+
const env = input.environment ?? "main";
|
|
24
|
+
const draft = cloneSpace(space);
|
|
25
|
+
const outcome = applyOperations(draft, env, ops);
|
|
26
|
+
if (outcome.errors.length > 0) return {
|
|
27
|
+
valid: false,
|
|
28
|
+
errors: outcome.errors,
|
|
29
|
+
warnings: validation.warnings
|
|
30
|
+
};
|
|
31
|
+
const audit = auditResources(draft, ops);
|
|
32
|
+
return {
|
|
33
|
+
valid: audit.errors.length === 0,
|
|
34
|
+
errors: audit.errors,
|
|
35
|
+
warnings: [...validation.warnings, ...audit.warnings]
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
var validateTool = defineTool({
|
|
39
|
+
name: "plitzi_validate",
|
|
40
|
+
title: "Validate",
|
|
41
|
+
description: "Check a batch of operations without executing them. Returns teachable errors and warnings — including any PRE-EXISTING malformation in a resource the batch touches (which blocks a save until fixed).",
|
|
42
|
+
inputShape: validateShape,
|
|
43
|
+
access: "read",
|
|
44
|
+
run: (input, ctx) => validate(input, ctx.space)
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { validate, validateShape, validateTool };
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { ElementRuntime, Environment } from '@plitzi/sdk-shared';
|
|
2
|
+
export type Env = Environment;
|
|
3
|
+
/** CSS declarations for one selector state. Keys are kebab-case CSS properties (see plitzi://css-properties). */
|
|
4
|
+
export type CssProps = Record<string, string | number>;
|
|
5
|
+
export interface DisplayModeCss {
|
|
6
|
+
desktop?: CssProps;
|
|
7
|
+
tablet?: CssProps;
|
|
8
|
+
mobile?: CssProps;
|
|
9
|
+
}
|
|
10
|
+
export interface ResourceEnvelope<T> {
|
|
11
|
+
stateVersion: string;
|
|
12
|
+
data: T;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Read projections follow a filesystem model: list cheap summaries/skeletons, then read one element's detail
|
|
16
|
+
* on demand. Heavy per-element data (props, style) lives only in AIElementDetail, never in the listings.
|
|
17
|
+
*/
|
|
18
|
+
export interface AIPageSummary {
|
|
19
|
+
ref: string;
|
|
20
|
+
label: string;
|
|
21
|
+
slug: string;
|
|
22
|
+
default: boolean;
|
|
23
|
+
/** Whether the page is served by the published SDK runtime. A disabled page (`false`) is not routable/accessible
|
|
24
|
+
* to end users, but stays fully editable here. Defaults to true. */
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
/** The ref of the folder this page lives in (a PageFolder id), or undefined for a root-level page. */
|
|
27
|
+
folder?: string;
|
|
28
|
+
elementCount: number;
|
|
29
|
+
}
|
|
30
|
+
/** A page folder in the sidebar tree. `ref` is the folder's id (there is no separate idRef); pages reference it
|
|
31
|
+
* by that id via their `folder`, and nested folders via `parentId`. */
|
|
32
|
+
export interface AIFolder {
|
|
33
|
+
ref: string;
|
|
34
|
+
name: string;
|
|
35
|
+
slug: string;
|
|
36
|
+
parentId?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface AISkeletonNode {
|
|
39
|
+
ref: string;
|
|
40
|
+
type: string;
|
|
41
|
+
label: string;
|
|
42
|
+
subType?: string;
|
|
43
|
+
/** This element's version — identical to the stateVersion a direct element read or search hit returns for it. Diff
|
|
44
|
+
* it against a version you already hold to re-read (plitzi_read) only the nodes that actually changed. */
|
|
45
|
+
stateVersion?: string;
|
|
46
|
+
/** The class refs this node attaches on its base selector — names only, no CSS. Lets an agent map element →
|
|
47
|
+
* class straight from the page skeleton, without a per-element read just to learn which class it uses. */
|
|
48
|
+
base?: string[];
|
|
49
|
+
/** Class refs attached on non-base slots (slot → class refs), names only. */
|
|
50
|
+
slots?: Record<string, string[]>;
|
|
51
|
+
childCount: number;
|
|
52
|
+
children?: AISkeletonNode[];
|
|
53
|
+
}
|
|
54
|
+
export interface AIPageSkeleton {
|
|
55
|
+
ref: string;
|
|
56
|
+
label: string;
|
|
57
|
+
slug: string;
|
|
58
|
+
default: boolean;
|
|
59
|
+
/** Whether the page is served by the published SDK runtime. A disabled page (`false`) is not routable/accessible
|
|
60
|
+
* to end users, but stays fully editable here. Defaults to true. */
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
/** Route params bound by the slug (e.g. ":spaceId" → ["spaceId"]). Valid as {{name}} references on this page,
|
|
63
|
+
* alongside the space-level plitzi://schema-variables. */
|
|
64
|
+
routeParams: string[];
|
|
65
|
+
tree: AISkeletonNode[];
|
|
66
|
+
}
|
|
67
|
+
/** Every style a page uses in one payload: the class definitions its elements attach (deduplicated, with CSS)
|
|
68
|
+
* and the global element selectors that affect any element type present on the page. Collapses "what styles
|
|
69
|
+
* does this page use" to a single read, with no reliance on a shared class-naming prefix. */
|
|
70
|
+
export interface AIPageStyles {
|
|
71
|
+
ref: string;
|
|
72
|
+
definitions: AIDefinition[];
|
|
73
|
+
globalStyles: AIGlobalStyle[];
|
|
74
|
+
}
|
|
75
|
+
/** Which variant each attached class/selector currently uses on this element (element.definition.initialState
|
|
76
|
+
* .styleVariant). Outer key = class ref, inner key = selector (`base` or a slot), value = variant name(s). */
|
|
77
|
+
export type AIStyleVariantSelection = Record<string, Record<string, string | string[]>>;
|
|
78
|
+
/** The element's initial (default) state overrides. `styleVariant` picks which variant of its classes is active;
|
|
79
|
+
* `visibility` hides/shows it initially. Kept minimal — the two fields agents actually set. */
|
|
80
|
+
export interface AIInitialState {
|
|
81
|
+
styleVariant?: AIStyleVariantSelection;
|
|
82
|
+
visibility?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/** One data binding: connect a data `source` to the element field named by `to` (a prop, a style value, or an
|
|
85
|
+
* initial-state key, per its category). `transformers` reshape the value; `when` gates the binding. */
|
|
86
|
+
export interface AIBinding {
|
|
87
|
+
id: string;
|
|
88
|
+
to: string;
|
|
89
|
+
source: string;
|
|
90
|
+
transformers?: Array<{
|
|
91
|
+
action: string;
|
|
92
|
+
params: Record<string, string>;
|
|
93
|
+
enabled?: boolean;
|
|
94
|
+
}>;
|
|
95
|
+
when?: unknown;
|
|
96
|
+
enabled?: boolean;
|
|
97
|
+
}
|
|
98
|
+
/** Data bindings on an element, grouped by what they feed: element props (`attributes`), style values (`style`),
|
|
99
|
+
* or initial-state keys (`initialState`). */
|
|
100
|
+
export type AIBindings = Partial<Record<'attributes' | 'style' | 'initialState', AIBinding[]>>;
|
|
101
|
+
export type AIInteractionNodeType = 'trigger' | 'globalCallback' | 'callback' | 'utility';
|
|
102
|
+
/** One step of an interaction flow, projected from the stored doubly-linked node. Order is conveyed by the
|
|
103
|
+
* position in `AIInteractionFlow.nodes`; the stored beforeNode/afterNode/flowId links are computed on write. */
|
|
104
|
+
export interface AIInteractionNode {
|
|
105
|
+
id: string;
|
|
106
|
+
title: string;
|
|
107
|
+
nodeType: AIInteractionNodeType;
|
|
108
|
+
action: string;
|
|
109
|
+
params?: Record<string, unknown>;
|
|
110
|
+
enabled?: boolean;
|
|
111
|
+
when?: unknown;
|
|
112
|
+
/** Source element the callback targets (globalCallback/utility). Defaults to this element on write. */
|
|
113
|
+
elementId?: string;
|
|
114
|
+
preview?: Record<string, unknown>;
|
|
115
|
+
}
|
|
116
|
+
/** One interaction flow on an element: a trigger (first node) followed by the callbacks/utilities it runs, in
|
|
117
|
+
* order. `flowId` equals the trigger node id. */
|
|
118
|
+
export interface AIInteractionFlow {
|
|
119
|
+
flowId: string;
|
|
120
|
+
nodes: AIInteractionNode[];
|
|
121
|
+
}
|
|
122
|
+
export interface AIElementDetail {
|
|
123
|
+
ref: string;
|
|
124
|
+
type: string;
|
|
125
|
+
subType?: string;
|
|
126
|
+
label: string;
|
|
127
|
+
pageRef: string;
|
|
128
|
+
parentRef?: string;
|
|
129
|
+
props?: Record<string, unknown>;
|
|
130
|
+
style: {
|
|
131
|
+
base: string[];
|
|
132
|
+
slots: Record<string, string[]>;
|
|
133
|
+
};
|
|
134
|
+
/** CSS of the definitions referenced by `style` (keyed by class ref), inlined so an edit needs no follow-up
|
|
135
|
+
* read of each definition. Present only for refs that resolve to a definition. */
|
|
136
|
+
resolvedStyle?: Record<string, AIDefinition>;
|
|
137
|
+
/** Global (type 'element') styles that also affect this element because they target its type — every element of
|
|
138
|
+
* the type inherits them. Read-only here (not editable as definitions); shown so the effective CSS is complete. */
|
|
139
|
+
globalStyles?: AIGlobalStyle[];
|
|
140
|
+
/** Id rule (type 'id') targeting this element by its DOM `id` attribute (`#id`). Present only when the element
|
|
141
|
+
* carries an `id` that a rule matches. Edit it with the id-style tools (never as a definition). */
|
|
142
|
+
idStyle?: AIIdStyle;
|
|
143
|
+
/** Variant names each attached class exposes (deduped across its selectors), so the agent knows a class HAS a
|
|
144
|
+
* variant (e.g. a button class with "primary") before applying it via `initialState.styleVariant`. */
|
|
145
|
+
availableVariants?: Record<string, string[]>;
|
|
146
|
+
/** Where this element renders, when it is not the default 'shared'. An apiContainer reading through a connector
|
|
147
|
+
* is 'server'; one showing 'client' (or nothing) fetches from the browser instead and ignores its connector. */
|
|
148
|
+
runtime?: ElementRuntime;
|
|
149
|
+
/** Which variant/visibility this element applies today (element.definition.initialState). */
|
|
150
|
+
initialState?: AIInitialState;
|
|
151
|
+
/** Data bindings on this element, grouped by category. */
|
|
152
|
+
bindings?: AIBindings;
|
|
153
|
+
/** Interaction flows on this element (event → ordered callbacks). */
|
|
154
|
+
interactions?: AIInteractionFlow[];
|
|
155
|
+
childRefs?: string[];
|
|
156
|
+
}
|
|
157
|
+
/** A global element style (a type 'element' StyleItem): its CSS applies to every element whose type equals
|
|
158
|
+
* `appliesToType`. It is not an addressable class definition — editing it would change every such element. */
|
|
159
|
+
export interface AIGlobalStyle extends AIDefinition {
|
|
160
|
+
appliesToType: string;
|
|
161
|
+
}
|
|
162
|
+
/** An id rule (a type 'id' StyleItem): its CSS targets the single element whose DOM `id` equals `targetId`
|
|
163
|
+
* (the CSS equivalent of `#id { … }`). Style one element by giving it an `id` attribute and writing this rule;
|
|
164
|
+
* prefer a class definition when the styling could be reused. */
|
|
165
|
+
export interface AIIdStyle extends AIDefinition {
|
|
166
|
+
targetId: string;
|
|
167
|
+
}
|
|
168
|
+
export interface AIDefinitionSlot extends DisplayModeCss {
|
|
169
|
+
states?: Record<string, DisplayModeCss>;
|
|
170
|
+
variants?: Record<string, DisplayModeCss>;
|
|
171
|
+
}
|
|
172
|
+
export interface AIDefinition extends AIDefinitionSlot {
|
|
173
|
+
ref: string;
|
|
174
|
+
slots?: Record<string, AIDefinitionSlot>;
|
|
175
|
+
}
|
|
176
|
+
export type StyleVariableCategory = 'color' | 'spacing' | 'shadow' | 'custom';
|
|
177
|
+
export type StyleVariableValue = string | number | {
|
|
178
|
+
light?: string;
|
|
179
|
+
dark?: string;
|
|
180
|
+
default?: string;
|
|
181
|
+
};
|
|
182
|
+
export interface AIStyleVariable {
|
|
183
|
+
name: string;
|
|
184
|
+
reference: string;
|
|
185
|
+
value: StyleVariableValue;
|
|
186
|
+
}
|
|
187
|
+
export interface AISchemaVariable {
|
|
188
|
+
name: string;
|
|
189
|
+
reference: string;
|
|
190
|
+
category: string;
|
|
191
|
+
type: string;
|
|
192
|
+
value: string | number | boolean;
|
|
193
|
+
subValues?: Array<{
|
|
194
|
+
when: unknown;
|
|
195
|
+
value: string | number | boolean;
|
|
196
|
+
}>;
|
|
197
|
+
}
|
|
198
|
+
/** Space-level settings: the arbitrary global CSS (`customCss`), state persistence, and the user/auth provider
|
|
199
|
+
* configuration. Every field is optional — a patch changes only the keys it sends. */
|
|
200
|
+
export interface AISettings {
|
|
201
|
+
customCss?: string;
|
|
202
|
+
keepState?: boolean;
|
|
203
|
+
stateStorage?: 'localStorage' | 'sessionStorage';
|
|
204
|
+
/** `basic` covers any HTTP+JSON backend by configuration; anything else is a name someone registered. */
|
|
205
|
+
userProvider?: 'basic' | 'custom' | '' | (string & {});
|
|
206
|
+
tokenStorage?: 'localStorage' | 'sessionStorage' | '';
|
|
207
|
+
loginUrl?: string;
|
|
208
|
+
userUrl?: string;
|
|
209
|
+
refreshUrl?: string;
|
|
210
|
+
logoutUrl?: string;
|
|
211
|
+
detailsPath?: string;
|
|
212
|
+
tokenPath?: string;
|
|
213
|
+
refreshTokenPath?: string;
|
|
214
|
+
expirationTimePath?: string;
|
|
215
|
+
refreshExpirationTimePath?: string;
|
|
216
|
+
sessionHintCookie?: string;
|
|
217
|
+
sessionExchangeUrl?: string;
|
|
218
|
+
sessionGate?: 'optimistic' | 'strict';
|
|
219
|
+
sessionRevalidateSeconds?: number;
|
|
220
|
+
}
|
|
221
|
+
export interface ValidationError {
|
|
222
|
+
path: string;
|
|
223
|
+
message: string;
|
|
224
|
+
hint: string;
|
|
225
|
+
validValues?: unknown[];
|
|
226
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { McpUiResourceCsp } from '@modelcontextprotocol/ext-apps';
|
|
2
|
+
/** A `ui://` page the host renders in a sandboxed iframe, linked from a tool through `_meta.ui.resourceUri`. */
|
|
3
|
+
export interface McpApp {
|
|
4
|
+
uri: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
title: string;
|
|
8
|
+
/** Absolute path to the view: the app's browser entry. */
|
|
9
|
+
entry: string;
|
|
10
|
+
/** CSS to inline in the page, in order. Lazy, and the app produces the text itself: what a view needs is not
|
|
11
|
+
* always a file as it sits on disk (the render app leaves the icon fonts out of its stylesheet). */
|
|
12
|
+
styles?: () => string[];
|
|
13
|
+
csp?: McpUiResourceCsp;
|
|
14
|
+
}
|
|
15
|
+
/** Deployment switches the page hands to the view. They travel in the HTML rather than the bundle so a server
|
|
16
|
+
* that serves both settings still builds the (expensive) browser bundle once. The view reads them off
|
|
17
|
+
* `window.__PLITZI_VIEW__`, and must treat every one as optional: an older page carries none. */
|
|
18
|
+
export interface McpViewSettings {
|
|
19
|
+
/** May the view paint from tool arguments the host is still streaming? See `mcpAi.renderStreaming`. */
|
|
20
|
+
streaming: boolean;
|
|
21
|
+
/** Absolute resource endpoint of the server that served the page, when it serves one (see `mcpAi.proxy`). It
|
|
22
|
+
* shapes the PAGE rather than the view: its origin is what the resource CSP declares, so the URLs a render
|
|
23
|
+
* rewrote to it are allowed to load. The view needs nothing from it — every URL is rewritten server-side,
|
|
24
|
+
* where the signing secret is. */
|
|
25
|
+
proxyEndpoint?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ValidationError } from './aiSchema';
|
|
2
|
+
import { Operation } from '../tools/operations';
|
|
3
|
+
export type PreviewRequestBody = {
|
|
4
|
+
spaceId: number;
|
|
5
|
+
env?: string;
|
|
6
|
+
pageRef?: string;
|
|
7
|
+
operations?: Operation[];
|
|
8
|
+
};
|
|
9
|
+
export type PreviewResult = {
|
|
10
|
+
ok: true;
|
|
11
|
+
token?: string;
|
|
12
|
+
pagePath: string;
|
|
13
|
+
html: string;
|
|
14
|
+
stateVersion: string;
|
|
15
|
+
} | {
|
|
16
|
+
ok: false;
|
|
17
|
+
error: string;
|
|
18
|
+
message: string;
|
|
19
|
+
errors?: ValidationError[];
|
|
20
|
+
};
|
|
21
|
+
/** How the MCP tools reach the renderer. The consumer injects an implementation (an HTTP client to the SSR
|
|
22
|
+
* `/preview` endpoint, or an in-process call when co-located); absent means preview is not wired. */
|
|
23
|
+
export type PreviewClient = {
|
|
24
|
+
render: (body: PreviewRequestBody) => Promise<PreviewResult>;
|
|
25
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type Viewport = {
|
|
2
|
+
label: string;
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
};
|
|
6
|
+
export type ScreenshotImage = {
|
|
7
|
+
label: string;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
data: string;
|
|
10
|
+
};
|
|
11
|
+
export type ScreenshotResult = {
|
|
12
|
+
ok: true;
|
|
13
|
+
images: ScreenshotImage[];
|
|
14
|
+
} | {
|
|
15
|
+
ok: false;
|
|
16
|
+
error: string;
|
|
17
|
+
message: string;
|
|
18
|
+
};
|
|
19
|
+
export type ScreenshotInput = {
|
|
20
|
+
pagePath: string;
|
|
21
|
+
token?: string;
|
|
22
|
+
viewports: Viewport[];
|
|
23
|
+
};
|
|
24
|
+
/** How plitzi_screenshot reaches the headless-browser service. The consumer injects an implementation (an HTTP
|
|
25
|
+
* client to the dedicated browser pod); absent → the tool is not registered. A capture that fails (pod down)
|
|
26
|
+
* returns `ok:false` rather than throwing, so the tool can degrade to the HTML preview. */
|
|
27
|
+
export type ScreenshotClient = {
|
|
28
|
+
capture: (input: ScreenshotInput) => Promise<ScreenshotResult>;
|
|
29
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { AIDefinition, AIElementDetail, ValidationError } from './aiSchema';
|
|
2
|
+
import { Operation } from '../tools/operations';
|
|
3
|
+
import { ConnectorEntry, Schema, Style } from '@plitzi/sdk-shared';
|
|
4
|
+
/** The element schema, the style schema and the connectors persist independently (Space model / Style model / one
|
|
5
|
+
* row per connector), so each has its own optional persister. When one is absent, that store is applied in memory
|
|
6
|
+
* but reported unsaved. Connectors save and delete a row at a time — a batch touching two of them saves those two
|
|
7
|
+
* and nothing else. */
|
|
8
|
+
export interface Persisters {
|
|
9
|
+
schema?: (schema: Schema) => Promise<void>;
|
|
10
|
+
style?: (style: Style) => Promise<void>;
|
|
11
|
+
saveConnector?: (entry: ConnectorEntry) => Promise<void>;
|
|
12
|
+
deleteConnector?: (connectorId: string) => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export interface Conflict {
|
|
15
|
+
resourceUri: string;
|
|
16
|
+
expectedVersion: string;
|
|
17
|
+
currentVersion: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ChangedResource {
|
|
20
|
+
uri: string;
|
|
21
|
+
stateVersion: string;
|
|
22
|
+
}
|
|
23
|
+
/** Full detail of a created/updated element, plus its own uri and stateVersion so a follow-up edit of the same
|
|
24
|
+
* element can guard with optimistic concurrency without an intermediate read. */
|
|
25
|
+
export type WriteElement = AIElementDetail & {
|
|
26
|
+
uri: string;
|
|
27
|
+
stateVersion: string;
|
|
28
|
+
};
|
|
29
|
+
/** Write result: what changed and the new versions, plus the full detail of every element created/updated (with
|
|
30
|
+
* its uri + stateVersion) so the caller has that context without a follow-up read. Other resources (pages,
|
|
31
|
+
* definitions, variables) still report only uri+version — re-read them if needed. */
|
|
32
|
+
export interface WriteResponse {
|
|
33
|
+
applied: boolean;
|
|
34
|
+
dryRun?: boolean;
|
|
35
|
+
persisted?: boolean;
|
|
36
|
+
summary: {
|
|
37
|
+
created: number;
|
|
38
|
+
updated: number;
|
|
39
|
+
deleted: number;
|
|
40
|
+
};
|
|
41
|
+
changed: ChangedResource[];
|
|
42
|
+
elements?: WriteElement[];
|
|
43
|
+
warnings?: string[];
|
|
44
|
+
errors?: ValidationError[];
|
|
45
|
+
conflict?: {
|
|
46
|
+
message: string;
|
|
47
|
+
conflicts: Conflict[];
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** The outcome of applying a batch to the space in memory: counts, which schema(s) changed (so the caller can
|
|
51
|
+
* persist each independently), the invalidated resource URIs and the refs of the elements it created/updated. */
|
|
52
|
+
export interface MutationOutcome {
|
|
53
|
+
created: number;
|
|
54
|
+
updated: number;
|
|
55
|
+
deleted: number;
|
|
56
|
+
staleResources: string[];
|
|
57
|
+
elementRefs: string[];
|
|
58
|
+
errors: ValidationError[];
|
|
59
|
+
changedSchema: boolean;
|
|
60
|
+
changedStyle: boolean;
|
|
61
|
+
/** Ids of the connectors the batch created or updated, and of those it removed — each persists as its own row. */
|
|
62
|
+
changedConnectors: string[];
|
|
63
|
+
deletedConnectors: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface ApplyInput {
|
|
66
|
+
environment?: string;
|
|
67
|
+
dryRun?: boolean;
|
|
68
|
+
expectedResourceVersions?: Record<string, string>;
|
|
69
|
+
operations: Operation[];
|
|
70
|
+
}
|
|
71
|
+
export interface ValidateInput {
|
|
72
|
+
environment?: string;
|
|
73
|
+
operations: Operation[];
|
|
74
|
+
}
|
|
75
|
+
export interface ValidationResult {
|
|
76
|
+
valid: boolean;
|
|
77
|
+
errors: ValidationError[];
|
|
78
|
+
warnings: string[];
|
|
79
|
+
}
|
|
80
|
+
export interface SearchInput {
|
|
81
|
+
query: string;
|
|
82
|
+
filters?: {
|
|
83
|
+
type?: string;
|
|
84
|
+
pageRef?: string;
|
|
85
|
+
};
|
|
86
|
+
/** 'detail' inlines each hit's full props/style so an edit needs no follow-up read. */
|
|
87
|
+
include?: 'detail';
|
|
88
|
+
/** Max element hits to return in this page (default 50). */
|
|
89
|
+
limit?: number;
|
|
90
|
+
/** Element hits to skip before this page (default 0). */
|
|
91
|
+
offset?: number;
|
|
92
|
+
}
|
|
93
|
+
export interface SearchHit {
|
|
94
|
+
pageRef: string;
|
|
95
|
+
ref: string;
|
|
96
|
+
uri: string;
|
|
97
|
+
pageUri: string;
|
|
98
|
+
stateVersion: string;
|
|
99
|
+
parentRef?: string;
|
|
100
|
+
/** Ancestor labels from the page down to and including this element. */
|
|
101
|
+
path: string[];
|
|
102
|
+
label: string;
|
|
103
|
+
type: string;
|
|
104
|
+
matches: string[];
|
|
105
|
+
detail?: AIElementDetail;
|
|
106
|
+
}
|
|
107
|
+
export interface SearchPageHit {
|
|
108
|
+
ref: string;
|
|
109
|
+
uri: string;
|
|
110
|
+
stateVersion: string;
|
|
111
|
+
label: string;
|
|
112
|
+
slug: string;
|
|
113
|
+
matches: string[];
|
|
114
|
+
}
|
|
115
|
+
export interface SearchResponse {
|
|
116
|
+
results: SearchHit[];
|
|
117
|
+
/** Total element hits matching the query across all pages, before offset/limit. */
|
|
118
|
+
total: number;
|
|
119
|
+
/** Element hits skipped before this page (echoes the request's offset, defaulted). */
|
|
120
|
+
offset: number;
|
|
121
|
+
/** Page size applied to element hits (echoes the request's limit, defaulted). */
|
|
122
|
+
limit: number;
|
|
123
|
+
/** The offset to pass next to fetch the following page. Present only while more hits remain past this page. */
|
|
124
|
+
nextOffset?: number;
|
|
125
|
+
/** Style definitions whose ref matches the query, with their full CSS — so finding a class by name closes the
|
|
126
|
+
* loop to its style without a separate read. Present only when at least one definition matches. */
|
|
127
|
+
definitions?: AIDefinition[];
|
|
128
|
+
/** Pages whose name or slug matches the query (element hits never include pages). Each carries the page uri +
|
|
129
|
+
* stateVersion, ready to open or edit. Present only when at least one page matches. */
|
|
130
|
+
pages?: SearchPageHit[];
|
|
131
|
+
}
|
|
132
|
+
export interface ReadInput {
|
|
133
|
+
uris: string[];
|
|
134
|
+
}
|
|
135
|
+
export interface ReadHit {
|
|
136
|
+
uri: string;
|
|
137
|
+
stateVersion?: string;
|
|
138
|
+
data?: unknown;
|
|
139
|
+
error?: string;
|
|
140
|
+
message?: string;
|
|
141
|
+
hint?: string;
|
|
142
|
+
}
|
|
143
|
+
export interface ReadResponse {
|
|
144
|
+
results: ReadHit[];
|
|
145
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OAuthParams } from './params';
|
|
2
|
+
import { OAuthConfig, SSRResponseHelpers } from '@plitzi/sdk-shared';
|
|
3
|
+
/** GET /authorize — the entry point a host opens in the user's browser. */
|
|
4
|
+
export declare const handleAuthorizeStart: (config: OAuthConfig, res: SSRResponseHelpers, params: OAuthParams) => Promise<void>;
|
|
5
|
+
/** POST /authorize — both steps of the form land here: the credentials submit, and the grant submit that carries
|
|
6
|
+
* the `pending` id proving the credentials step already passed. */
|
|
7
|
+
export declare const handleAuthorizeSubmit: (config: OAuthConfig, res: SSRResponseHelpers, params: OAuthParams) => Promise<void>;
|