@wootsup/yt-builder-mcp 1.1.6 → 1.2.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/README.md +7 -7
- package/bin/yt-builder-mcp.js +55 -40
- package/dist/auth.d.ts +137 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +244 -0
- package/dist/auth.js.map +1 -0
- package/dist/cli/invocation-decision.d.ts +57 -0
- package/dist/cli/invocation-decision.d.ts.map +1 -0
- package/dist/cli/invocation-decision.js +86 -0
- package/dist/cli/invocation-decision.js.map +1 -0
- package/dist/client.d.ts +112 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +190 -0
- package/dist/client.js.map +1 -0
- package/dist/clients/claude-code.d.ts +18 -0
- package/dist/clients/claude-code.d.ts.map +1 -0
- package/dist/clients/claude-code.js +55 -0
- package/dist/clients/claude-code.js.map +1 -0
- package/dist/clients/claude-desktop.d.ts +19 -0
- package/dist/clients/claude-desktop.d.ts.map +1 -0
- package/dist/clients/claude-desktop.js +58 -0
- package/dist/clients/claude-desktop.js.map +1 -0
- package/dist/clients/cline.d.ts +26 -0
- package/dist/clients/cline.d.ts.map +1 -0
- package/dist/clients/cline.js +82 -0
- package/dist/clients/cline.js.map +1 -0
- package/dist/clients/codex-cli.d.ts +42 -0
- package/dist/clients/codex-cli.d.ts.map +1 -0
- package/dist/clients/codex-cli.js +292 -0
- package/dist/clients/codex-cli.js.map +1 -0
- package/dist/clients/continue.d.ts +13 -0
- package/dist/clients/continue.d.ts.map +1 -0
- package/dist/clients/continue.js +121 -0
- package/dist/clients/continue.js.map +1 -0
- package/dist/clients/cursor.d.ts +12 -0
- package/dist/clients/cursor.d.ts.map +1 -0
- package/dist/clients/cursor.js +40 -0
- package/dist/clients/cursor.js.map +1 -0
- package/dist/clients/gemini-cli.d.ts +18 -0
- package/dist/clients/gemini-cli.d.ts.map +1 -0
- package/dist/clients/gemini-cli.js +46 -0
- package/dist/clients/gemini-cli.js.map +1 -0
- package/dist/clients/home.d.ts +14 -0
- package/dist/clients/home.d.ts.map +1 -0
- package/dist/clients/home.js +20 -0
- package/dist/clients/home.js.map +1 -0
- package/dist/clients/index.d.ts +156 -0
- package/dist/clients/index.d.ts.map +1 -0
- package/dist/clients/index.js +213 -0
- package/dist/clients/index.js.map +1 -0
- package/dist/clients/roo-code.d.ts +23 -0
- package/dist/clients/roo-code.d.ts.map +1 -0
- package/dist/clients/roo-code.js +71 -0
- package/dist/clients/roo-code.js.map +1 -0
- package/dist/clients/zed.d.ts +12 -0
- package/dist/clients/zed.d.ts.map +1 -0
- package/dist/clients/zed.js +43 -0
- package/dist/clients/zed.js.map +1 -0
- package/dist/errors/hints.d.ts +51 -0
- package/dist/errors/hints.d.ts.map +1 -0
- package/dist/errors/hints.js +95 -0
- package/dist/errors/hints.js.map +1 -0
- package/dist/errors/mask.d.ts +35 -0
- package/dist/errors/mask.d.ts.map +1 -0
- package/dist/errors/mask.js +49 -0
- package/dist/errors/mask.js.map +1 -0
- package/dist/errors/sanitize.d.ts +31 -0
- package/dist/errors/sanitize.d.ts.map +1 -0
- package/dist/errors/sanitize.js +100 -0
- package/dist/errors/sanitize.js.map +1 -0
- package/dist/errors.d.ts +42 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +61 -0
- package/dist/errors.js.map +1 -0
- package/dist/gateway/advanced-tool/discovery.d.ts +19 -0
- package/dist/gateway/advanced-tool/discovery.d.ts.map +1 -0
- package/dist/gateway/advanced-tool/discovery.js +53 -0
- package/dist/gateway/advanced-tool/discovery.js.map +1 -0
- package/dist/gateway/advanced-tool/domains.d.ts +47 -0
- package/dist/gateway/advanced-tool/domains.d.ts.map +1 -0
- package/dist/gateway/advanced-tool/domains.js +94 -0
- package/dist/gateway/advanced-tool/domains.js.map +1 -0
- package/dist/gateway/advanced-tool/execute.d.ts +29 -0
- package/dist/gateway/advanced-tool/execute.d.ts.map +1 -0
- package/dist/gateway/advanced-tool/execute.js +54 -0
- package/dist/gateway/advanced-tool/execute.js.map +1 -0
- package/dist/gateway/advanced-tool/index.d.ts +36 -0
- package/dist/gateway/advanced-tool/index.d.ts.map +1 -0
- package/dist/gateway/advanced-tool/index.js +39 -0
- package/dist/gateway/advanced-tool/index.js.map +1 -0
- package/dist/gateway/advanced-tool/register.d.ts +18 -0
- package/dist/gateway/advanced-tool/register.d.ts.map +1 -0
- package/dist/gateway/advanced-tool/register.js +69 -0
- package/dist/gateway/advanced-tool/register.js.map +1 -0
- package/dist/gateway/advanced-tool.d.ts +13 -0
- package/dist/gateway/advanced-tool.d.ts.map +1 -0
- package/dist/gateway/advanced-tool.js +13 -0
- package/dist/gateway/advanced-tool.js.map +1 -0
- package/dist/gateway/capturing-server.d.ts +117 -0
- package/dist/gateway/capturing-server.d.ts.map +1 -0
- package/dist/gateway/capturing-server.js +103 -0
- package/dist/gateway/capturing-server.js.map +1 -0
- package/dist/gateway/essentials.d.ts +50 -0
- package/dist/gateway/essentials.d.ts.map +1 -0
- package/dist/gateway/essentials.js +108 -0
- package/dist/gateway/essentials.js.map +1 -0
- package/dist/gateway/test-support.d.ts +41 -0
- package/dist/gateway/test-support.d.ts.map +1 -0
- package/dist/gateway/test-support.js +60 -0
- package/dist/gateway/test-support.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -0
- package/dist/index.js.map +1 -0
- package/dist/install-skill.d.ts +43 -0
- package/dist/install-skill.d.ts.map +1 -0
- package/dist/install-skill.js +118 -0
- package/dist/install-skill.js.map +1 -0
- package/dist/platform/detect.d.ts +64 -0
- package/dist/platform/detect.d.ts.map +1 -0
- package/dist/platform/detect.js +98 -0
- package/dist/platform/detect.js.map +1 -0
- package/dist/platform/index.d.ts +121 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +176 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/joomla.d.ts +44 -0
- package/dist/platform/joomla.d.ts.map +1 -0
- package/dist/platform/joomla.js +46 -0
- package/dist/platform/joomla.js.map +1 -0
- package/dist/server.d.ts +110 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +274 -0
- package/dist/server.js.map +1 -0
- package/dist/setup-cli-confirm.d.ts +36 -0
- package/dist/setup-cli-confirm.d.ts.map +1 -0
- package/dist/setup-cli-confirm.js +59 -0
- package/dist/setup-cli-confirm.js.map +1 -0
- package/dist/setup-cli.d.ts +193 -0
- package/dist/setup-cli.d.ts.map +1 -0
- package/dist/setup-cli.js +1032 -0
- package/dist/setup-cli.js.map +1 -0
- package/dist/setup-prompts.d.ts +64 -0
- package/dist/setup-prompts.d.ts.map +1 -0
- package/dist/setup-prompts.js +221 -0
- package/dist/setup-prompts.js.map +1 -0
- package/dist/setup-token.d.ts +38 -0
- package/dist/setup-token.d.ts.map +1 -0
- package/dist/setup-token.js +106 -0
- package/dist/setup-token.js.map +1 -0
- package/dist/setup-wizard-defaults.d.ts +43 -0
- package/dist/setup-wizard-defaults.d.ts.map +1 -0
- package/dist/setup-wizard-defaults.js +160 -0
- package/dist/setup-wizard-defaults.js.map +1 -0
- package/dist/setup-wizard-handshake.d.ts +25 -0
- package/dist/setup-wizard-handshake.d.ts.map +1 -0
- package/dist/setup-wizard-handshake.js +103 -0
- package/dist/setup-wizard-handshake.js.map +1 -0
- package/dist/setup-wizard-types.d.ts +164 -0
- package/dist/setup-wizard-types.d.ts.map +1 -0
- package/dist/setup-wizard-types.js +11 -0
- package/dist/setup-wizard-types.js.map +1 -0
- package/dist/setup-wizard.d.ts +33 -0
- package/dist/setup-wizard.d.ts.map +1 -0
- package/dist/setup-wizard.js +199 -0
- package/dist/setup-wizard.js.map +1 -0
- package/dist/setup.d.ts +17 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +33 -0
- package/dist/setup.js.map +1 -0
- package/dist/sites/bootstrap.d.ts +41 -0
- package/dist/sites/bootstrap.d.ts.map +1 -0
- package/dist/sites/bootstrap.js +58 -0
- package/dist/sites/bootstrap.js.map +1 -0
- package/dist/sites/cli/add-site.d.ts +106 -0
- package/dist/sites/cli/add-site.d.ts.map +1 -0
- package/dist/sites/cli/add-site.js +185 -0
- package/dist/sites/cli/add-site.js.map +1 -0
- package/dist/sites/cli/list-sites.d.ts +40 -0
- package/dist/sites/cli/list-sites.d.ts.map +1 -0
- package/dist/sites/cli/list-sites.js +116 -0
- package/dist/sites/cli/list-sites.js.map +1 -0
- package/dist/sites/cli/remove-site.d.ts +60 -0
- package/dist/sites/cli/remove-site.d.ts.map +1 -0
- package/dist/sites/cli/remove-site.js +120 -0
- package/dist/sites/cli/remove-site.js.map +1 -0
- package/dist/sites/cli/set-default.d.ts +47 -0
- package/dist/sites/cli/set-default.d.ts.map +1 -0
- package/dist/sites/cli/set-default.js +69 -0
- package/dist/sites/cli/set-default.js.map +1 -0
- package/dist/sites/cli/test-site.d.ts +77 -0
- package/dist/sites/cli/test-site.d.ts.map +1 -0
- package/dist/sites/cli/test-site.js +146 -0
- package/dist/sites/cli/test-site.js.map +1 -0
- package/dist/sites/client-pool.d.ts +157 -0
- package/dist/sites/client-pool.d.ts.map +1 -0
- package/dist/sites/client-pool.js +222 -0
- package/dist/sites/client-pool.js.map +1 -0
- package/dist/sites/env-bridge.d.ts +55 -0
- package/dist/sites/env-bridge.d.ts.map +1 -0
- package/dist/sites/env-bridge.js +94 -0
- package/dist/sites/env-bridge.js.map +1 -0
- package/dist/sites/paths.d.ts +21 -0
- package/dist/sites/paths.d.ts.map +1 -0
- package/dist/sites/paths.js +37 -0
- package/dist/sites/paths.js.map +1 -0
- package/dist/sites/probe.d.ts +60 -0
- package/dist/sites/probe.d.ts.map +1 -0
- package/dist/sites/probe.js +112 -0
- package/dist/sites/probe.js.map +1 -0
- package/dist/sites/registry.d.ts +142 -0
- package/dist/sites/registry.d.ts.map +1 -0
- package/dist/sites/registry.js +163 -0
- package/dist/sites/registry.js.map +1 -0
- package/dist/sites/schema.d.ts +90 -0
- package/dist/sites/schema.d.ts.map +1 -0
- package/dist/sites/schema.js +71 -0
- package/dist/sites/schema.js.map +1 -0
- package/dist/sites/secret-resolver.d.ts +115 -0
- package/dist/sites/secret-resolver.d.ts.map +1 -0
- package/dist/sites/secret-resolver.js +225 -0
- package/dist/sites/secret-resolver.js.map +1 -0
- package/dist/sites/store.d.ts +82 -0
- package/dist/sites/store.d.ts.map +1 -0
- package/dist/sites/store.js +198 -0
- package/dist/sites/store.js.map +1 -0
- package/dist/sites/tools/index.d.ts +28 -0
- package/dist/sites/tools/index.d.ts.map +1 -0
- package/dist/sites/tools/index.js +38 -0
- package/dist/sites/tools/index.js.map +1 -0
- package/dist/sites/tools/sites-list.d.ts +48 -0
- package/dist/sites/tools/sites-list.d.ts.map +1 -0
- package/dist/sites/tools/sites-list.js +137 -0
- package/dist/sites/tools/sites-list.js.map +1 -0
- package/dist/sites/tools/sites-test.d.ts +47 -0
- package/dist/sites/tools/sites-test.d.ts.map +1 -0
- package/dist/sites/tools/sites-test.js +148 -0
- package/dist/sites/tools/sites-test.js.map +1 -0
- package/dist/sites/tools/use-site.d.ts +47 -0
- package/dist/sites/tools/use-site.d.ts.map +1 -0
- package/dist/sites/tools/use-site.js +183 -0
- package/dist/sites/tools/use-site.js.map +1 -0
- package/dist/skill-loader.d.ts +111 -0
- package/dist/skill-loader.d.ts.map +1 -0
- package/dist/skill-loader.js +191 -0
- package/dist/skill-loader.js.map +1 -0
- package/dist/tools/elements/builders.d.ts +24 -0
- package/dist/tools/elements/builders.d.ts.map +1 -0
- package/dist/tools/elements/builders.js +208 -0
- package/dist/tools/elements/builders.js.map +1 -0
- package/dist/tools/elements/handlers-write.d.ts +49 -0
- package/dist/tools/elements/handlers-write.d.ts.map +1 -0
- package/dist/tools/elements/handlers-write.js +341 -0
- package/dist/tools/elements/handlers-write.js.map +1 -0
- package/dist/tools/elements/handlers.d.ts +70 -0
- package/dist/tools/elements/handlers.d.ts.map +1 -0
- package/dist/tools/elements/handlers.js +292 -0
- package/dist/tools/elements/handlers.js.map +1 -0
- package/dist/tools/elements/index.d.ts +28 -0
- package/dist/tools/elements/index.d.ts.map +1 -0
- package/dist/tools/elements/index.js +27 -0
- package/dist/tools/elements/index.js.map +1 -0
- package/dist/tools/elements.d.ts +13 -0
- package/dist/tools/elements.d.ts.map +1 -0
- package/dist/tools/elements.js +13 -0
- package/dist/tools/elements.js.map +1 -0
- package/dist/tools/elicitation.d.ts +87 -0
- package/dist/tools/elicitation.d.ts.map +1 -0
- package/dist/tools/elicitation.js +100 -0
- package/dist/tools/elicitation.js.map +1 -0
- package/dist/tools/format/elements-format.d.ts +40 -0
- package/dist/tools/format/elements-format.d.ts.map +1 -0
- package/dist/tools/format/elements-format.js +193 -0
- package/dist/tools/format/elements-format.js.map +1 -0
- package/dist/tools/format/health-format.d.ts +79 -0
- package/dist/tools/format/health-format.d.ts.map +1 -0
- package/dist/tools/format/health-format.js +181 -0
- package/dist/tools/format/health-format.js.map +1 -0
- package/dist/tools/format/inspection-format.d.ts +70 -0
- package/dist/tools/format/inspection-format.d.ts.map +1 -0
- package/dist/tools/format/inspection-format.js +359 -0
- package/dist/tools/format/inspection-format.js.map +1 -0
- package/dist/tools/format/pages-format.d.ts +57 -0
- package/dist/tools/format/pages-format.d.ts.map +1 -0
- package/dist/tools/format/pages-format.js +157 -0
- package/dist/tools/format/pages-format.js.map +1 -0
- package/dist/tools/format/sources-format.d.ts +44 -0
- package/dist/tools/format/sources-format.d.ts.map +1 -0
- package/dist/tools/format/sources-format.js +242 -0
- package/dist/tools/format/sources-format.js.map +1 -0
- package/dist/tools/health.d.ts +22 -0
- package/dist/tools/health.d.ts.map +1 -0
- package/dist/tools/health.js +220 -0
- package/dist/tools/health.js.map +1 -0
- package/dist/tools/index.d.ts +30 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +39 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/inspection.d.ts +14 -0
- package/dist/tools/inspection.d.ts.map +1 -0
- package/dist/tools/inspection.js +401 -0
- package/dist/tools/inspection.js.map +1 -0
- package/dist/tools/layout-flatten.d.ts +75 -0
- package/dist/tools/layout-flatten.d.ts.map +1 -0
- package/dist/tools/layout-flatten.js +107 -0
- package/dist/tools/layout-flatten.js.map +1 -0
- package/dist/tools/multi-items/builders.d.ts +23 -0
- package/dist/tools/multi-items/builders.d.ts.map +1 -0
- package/dist/tools/multi-items/builders.js +84 -0
- package/dist/tools/multi-items/builders.js.map +1 -0
- package/dist/tools/multi-items/clean-implode-handler.d.ts +36 -0
- package/dist/tools/multi-items/clean-implode-handler.d.ts.map +1 -0
- package/dist/tools/multi-items/clean-implode-handler.js +57 -0
- package/dist/tools/multi-items/clean-implode-handler.js.map +1 -0
- package/dist/tools/multi-items/format/inspection-format.d.ts +41 -0
- package/dist/tools/multi-items/format/inspection-format.d.ts.map +1 -0
- package/dist/tools/multi-items/format/inspection-format.js +64 -0
- package/dist/tools/multi-items/format/inspection-format.js.map +1 -0
- package/dist/tools/multi-items/index.d.ts +18 -0
- package/dist/tools/multi-items/index.d.ts.map +1 -0
- package/dist/tools/multi-items/index.js +18 -0
- package/dist/tools/multi-items/index.js.map +1 -0
- package/dist/tools/multi-items/inspect-handler.d.ts +76 -0
- package/dist/tools/multi-items/inspect-handler.d.ts.map +1 -0
- package/dist/tools/multi-items/inspect-handler.js +133 -0
- package/dist/tools/multi-items/inspect-handler.js.map +1 -0
- package/dist/tools/multi-items/inspection-cache.d.ts +85 -0
- package/dist/tools/multi-items/inspection-cache.d.ts.map +1 -0
- package/dist/tools/multi-items/inspection-cache.js +126 -0
- package/dist/tools/multi-items/inspection-cache.js.map +1 -0
- package/dist/tools/multi-items/item-container-map.d.ts +41 -0
- package/dist/tools/multi-items/item-container-map.d.ts.map +1 -0
- package/dist/tools/multi-items/item-container-map.js +73 -0
- package/dist/tools/multi-items/item-container-map.js.map +1 -0
- package/dist/tools/pages/builders.d.ts +43 -0
- package/dist/tools/pages/builders.d.ts.map +1 -0
- package/dist/tools/pages/builders.js +229 -0
- package/dist/tools/pages/builders.js.map +1 -0
- package/dist/tools/pages/handlers-read.d.ts +33 -0
- package/dist/tools/pages/handlers-read.d.ts.map +1 -0
- package/dist/tools/pages/handlers-read.js +260 -0
- package/dist/tools/pages/handlers-read.js.map +1 -0
- package/dist/tools/pages/handlers-write.d.ts +63 -0
- package/dist/tools/pages/handlers-write.d.ts.map +1 -0
- package/dist/tools/pages/handlers-write.js +127 -0
- package/dist/tools/pages/handlers-write.js.map +1 -0
- package/dist/tools/pages/index.d.ts +17 -0
- package/dist/tools/pages/index.d.ts.map +1 -0
- package/dist/tools/pages/index.js +17 -0
- package/dist/tools/pages/index.js.map +1 -0
- package/dist/tools/pages/schemas.d.ts +157 -0
- package/dist/tools/pages/schemas.d.ts.map +1 -0
- package/dist/tools/pages/schemas.js +232 -0
- package/dist/tools/pages/schemas.js.map +1 -0
- package/dist/tools/pages.d.ts +13 -0
- package/dist/tools/pages.d.ts.map +1 -0
- package/dist/tools/pages.js +13 -0
- package/dist/tools/pages.js.map +1 -0
- package/dist/tools/pool-resolve-helper.d.ts +83 -0
- package/dist/tools/pool-resolve-helper.d.ts.map +1 -0
- package/dist/tools/pool-resolve-helper.js +148 -0
- package/dist/tools/pool-resolve-helper.js.map +1 -0
- package/dist/tools/progress-phases.d.ts +46 -0
- package/dist/tools/progress-phases.d.ts.map +1 -0
- package/dist/tools/progress-phases.js +48 -0
- package/dist/tools/progress-phases.js.map +1 -0
- package/dist/tools/shared-schemas.d.ts +25 -0
- package/dist/tools/shared-schemas.d.ts.map +1 -0
- package/dist/tools/shared-schemas.js +72 -0
- package/dist/tools/shared-schemas.js.map +1 -0
- package/dist/tools/sources/builders.d.ts +13 -0
- package/dist/tools/sources/builders.d.ts.map +1 -0
- package/dist/tools/sources/builders.js +118 -0
- package/dist/tools/sources/builders.js.map +1 -0
- package/dist/tools/sources/handlers-bind.d.ts +28 -0
- package/dist/tools/sources/handlers-bind.d.ts.map +1 -0
- package/dist/tools/sources/handlers-bind.js +181 -0
- package/dist/tools/sources/handlers-bind.js.map +1 -0
- package/dist/tools/sources/handlers.d.ts +47 -0
- package/dist/tools/sources/handlers.d.ts.map +1 -0
- package/dist/tools/sources/handlers.js +108 -0
- package/dist/tools/sources/handlers.js.map +1 -0
- package/dist/tools/sources/index.d.ts +19 -0
- package/dist/tools/sources/index.d.ts.map +1 -0
- package/dist/tools/sources/index.js +18 -0
- package/dist/tools/sources/index.js.map +1 -0
- package/dist/tools/sources.d.ts +14 -0
- package/dist/tools/sources.d.ts.map +1 -0
- package/dist/tools/sources.js +14 -0
- package/dist/tools/sources.js.map +1 -0
- package/dist/tools/sparse-fields.d.ts +106 -0
- package/dist/tools/sparse-fields.d.ts.map +1 -0
- package/dist/tools/sparse-fields.js +165 -0
- package/dist/tools/sparse-fields.js.map +1 -0
- package/dist/tools/tool-builder/annotations.d.ts +55 -0
- package/dist/tools/tool-builder/annotations.d.ts.map +1 -0
- package/dist/tools/tool-builder/annotations.js +86 -0
- package/dist/tools/tool-builder/annotations.js.map +1 -0
- package/dist/tools/tool-builder/define.d.ts +31 -0
- package/dist/tools/tool-builder/define.d.ts.map +1 -0
- package/dist/tools/tool-builder/define.js +31 -0
- package/dist/tools/tool-builder/define.js.map +1 -0
- package/dist/tools/tool-builder/index.d.ts +28 -0
- package/dist/tools/tool-builder/index.d.ts.map +1 -0
- package/dist/tools/tool-builder/index.js +27 -0
- package/dist/tools/tool-builder/index.js.map +1 -0
- package/dist/tools/tool-builder/results.d.ts +104 -0
- package/dist/tools/tool-builder/results.d.ts.map +1 -0
- package/dist/tools/tool-builder/results.js +224 -0
- package/dist/tools/tool-builder/results.js.map +1 -0
- package/dist/tools/tool-builder/types.d.ts +97 -0
- package/dist/tools/tool-builder/types.d.ts.map +1 -0
- package/dist/tools/tool-builder/types.js +9 -0
- package/dist/tools/tool-builder/types.js.map +1 -0
- package/dist/tools/tool-builder.d.ts +16 -0
- package/dist/tools/tool-builder.d.ts.map +1 -0
- package/dist/tools/tool-builder.js +16 -0
- package/dist/tools/tool-builder.js.map +1 -0
- package/dist/uninstall-skill.d.ts +52 -0
- package/dist/uninstall-skill.d.ts.map +1 -0
- package/dist/uninstall-skill.js +146 -0
- package/dist/uninstall-skill.js.map +1 -0
- package/dist/uninstall.d.ts +73 -0
- package/dist/uninstall.d.ts.map +1 -0
- package/dist/uninstall.js +82 -0
- package/dist/uninstall.js.map +1 -0
- package/icon.png +0 -0
- package/manifest.json +10 -10
- package/package.json +4 -1
- package/skills/yt-builder-mcp/SKILL.md +30 -26
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InspectionCache — Wave-16 #34 (6.2).
|
|
3
|
+
*
|
|
4
|
+
* A tiny in-process TTL cache for `inspect_multi_items_binding` results.
|
|
5
|
+
* Keyed by `(template_id, element_path, etag)`:
|
|
6
|
+
*
|
|
7
|
+
* - `template_id` + `element_path` identify the element;
|
|
8
|
+
* - `etag` is the GLOBAL state ETag (from `GET /etag`). Every write
|
|
9
|
+
* tool bumps it (see ETAG schema note: "every successful write
|
|
10
|
+
* returns a NEW ETag"). So a write to ANY template surfaces a fresh
|
|
11
|
+
* etag → a NEW cache key → a guaranteed miss. The stale entry for a
|
|
12
|
+
* mutated template can never be served. This reuses the existing
|
|
13
|
+
* etag-bump mechanism rather than inventing a parallel invalidation
|
|
14
|
+
* channel.
|
|
15
|
+
*
|
|
16
|
+
* TTL is a hard 60s upper bound so an entry cannot live indefinitely
|
|
17
|
+
* even if the etag never changes (read-only sessions). The clock is
|
|
18
|
+
* injectable so the TTL behaviour is testable without sleeping.
|
|
19
|
+
*
|
|
20
|
+
* Bounded growth — Wave-16 Phase-6 nit. The key embeds the GLOBAL etag,
|
|
21
|
+
* and every write bumps it, so each `set()` lands under a NEW key while
|
|
22
|
+
* the old-etag entries are never re-queried (the handler always reads the
|
|
23
|
+
* current etag). Without a bound they would accumulate in the Map forever
|
|
24
|
+
* in a long-lived high-write session. Two cheap defenses keep it bounded:
|
|
25
|
+
*
|
|
26
|
+
* 1. Opportunistic sweep on every `set()`: drop entries already past
|
|
27
|
+
* the TTL. The TTL is a hard upper bound, so a past-TTL entry is dead
|
|
28
|
+
* and can never be served — sweeping it changes no observable
|
|
29
|
+
* behaviour, it only reclaims the slot.
|
|
30
|
+
* 2. Hard max-size cap with oldest-first eviction (belt-and-suspenders)
|
|
31
|
+
* for the pathological case where many DISTINCT keys all stay fresh
|
|
32
|
+
* (a read-only burst the sweep cannot reclaim). `Map` preserves
|
|
33
|
+
* insertion order, so the oldest entry is the first key.
|
|
34
|
+
*
|
|
35
|
+
* Concrete generic type `T` — no `any`. The cache stores whatever the
|
|
36
|
+
* handler computed (the structured inspect payload).
|
|
37
|
+
*
|
|
38
|
+
* @license MIT
|
|
39
|
+
*/
|
|
40
|
+
/** Hard TTL upper bound for a cached inspection entry (60 seconds). */
|
|
41
|
+
export declare const INSPECTION_CACHE_TTL_MS = 60000;
|
|
42
|
+
/**
|
|
43
|
+
* Hard ceiling on live entries. Reached only when many DISTINCT keys stay
|
|
44
|
+
* fresh inside the TTL (a read-only burst the TTL-sweep cannot reclaim);
|
|
45
|
+
* the normal write-driven etag churn is reclaimed by the sweep long before
|
|
46
|
+
* this. 256 covers a generous working set while keeping the Map tiny.
|
|
47
|
+
*/
|
|
48
|
+
export declare const INSPECTION_CACHE_MAX_ENTRIES = 256;
|
|
49
|
+
/** Monotonic-ish millisecond clock; defaults to `Date.now`. */
|
|
50
|
+
export type Clock = () => number;
|
|
51
|
+
export declare class InspectionCache<T> {
|
|
52
|
+
private readonly store;
|
|
53
|
+
private readonly now;
|
|
54
|
+
private readonly ttlMs;
|
|
55
|
+
private readonly maxEntries;
|
|
56
|
+
constructor(now?: Clock, ttlMs?: number, maxEntries?: number);
|
|
57
|
+
/** Build the composite cache key. Pipe-joined; the parts are
|
|
58
|
+
* server-controlled identifiers (template id, JSON-Pointer, quoted
|
|
59
|
+
* etag) so collision via a literal `|` in a value is not a concern. */
|
|
60
|
+
private key;
|
|
61
|
+
/** Read a fresh entry, or `undefined` on miss / expiry. Expired
|
|
62
|
+
* entries are evicted on access. */
|
|
63
|
+
get(templateId: string, elementPath: string, etag: string): T | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Store a value under the composite key, stamped with the clock.
|
|
66
|
+
*
|
|
67
|
+
* Bounds the Map first (sweep past-TTL entries, then enforce the
|
|
68
|
+
* max-size cap with oldest-first eviction) so a long-lived high-write
|
|
69
|
+
* session cannot leak old-etag keys. See class doc for the why.
|
|
70
|
+
*/
|
|
71
|
+
set(templateId: string, elementPath: string, etag: string, value: T): void;
|
|
72
|
+
/**
|
|
73
|
+
* Number of LIVE (non-expired) entries currently held. Counts rather
|
|
74
|
+
* than returns `store.size` so a caller (and the tests) sees the true
|
|
75
|
+
* working-set size even if a not-yet-swept dead entry lingers.
|
|
76
|
+
*/
|
|
77
|
+
size(): number;
|
|
78
|
+
/** Drop every entry whose TTL has elapsed. Cheap, and dead entries
|
|
79
|
+
* can never be served, so this changes no observable behaviour. */
|
|
80
|
+
private sweepExpired;
|
|
81
|
+
/** Evict oldest-first until the Map is within the max-size cap. `Map`
|
|
82
|
+
* iterates in insertion order, so the first key is the oldest. */
|
|
83
|
+
private enforceMaxEntries;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=inspection-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspection-cache.d.ts","sourceRoot":"","sources":["../../../src/tools/multi-items/inspection-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,+DAA+D;AAC/D,MAAM,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC;AAOjC,qBAAa,eAAe,CAAC,CAAC;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoC;IAC1D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAGhC,GAAG,GAAE,KAAgB,EACrB,KAAK,GAAE,MAAgC,EACvC,UAAU,GAAE,MAAqC;IAOrD;;2EAEuE;IACvE,OAAO,CAAC,GAAG;IAIX;wCACoC;IACpC,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAWzE;;;;;;OAMG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAO1E;;;;OAIG;IACH,IAAI,IAAI,MAAM;IASd;uEACmE;IACnE,OAAO,CAAC,YAAY;IASpB;sEACkE;IAClE,OAAO,CAAC,iBAAiB;CAO5B"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InspectionCache — Wave-16 #34 (6.2).
|
|
3
|
+
*
|
|
4
|
+
* A tiny in-process TTL cache for `inspect_multi_items_binding` results.
|
|
5
|
+
* Keyed by `(template_id, element_path, etag)`:
|
|
6
|
+
*
|
|
7
|
+
* - `template_id` + `element_path` identify the element;
|
|
8
|
+
* - `etag` is the GLOBAL state ETag (from `GET /etag`). Every write
|
|
9
|
+
* tool bumps it (see ETAG schema note: "every successful write
|
|
10
|
+
* returns a NEW ETag"). So a write to ANY template surfaces a fresh
|
|
11
|
+
* etag → a NEW cache key → a guaranteed miss. The stale entry for a
|
|
12
|
+
* mutated template can never be served. This reuses the existing
|
|
13
|
+
* etag-bump mechanism rather than inventing a parallel invalidation
|
|
14
|
+
* channel.
|
|
15
|
+
*
|
|
16
|
+
* TTL is a hard 60s upper bound so an entry cannot live indefinitely
|
|
17
|
+
* even if the etag never changes (read-only sessions). The clock is
|
|
18
|
+
* injectable so the TTL behaviour is testable without sleeping.
|
|
19
|
+
*
|
|
20
|
+
* Bounded growth — Wave-16 Phase-6 nit. The key embeds the GLOBAL etag,
|
|
21
|
+
* and every write bumps it, so each `set()` lands under a NEW key while
|
|
22
|
+
* the old-etag entries are never re-queried (the handler always reads the
|
|
23
|
+
* current etag). Without a bound they would accumulate in the Map forever
|
|
24
|
+
* in a long-lived high-write session. Two cheap defenses keep it bounded:
|
|
25
|
+
*
|
|
26
|
+
* 1. Opportunistic sweep on every `set()`: drop entries already past
|
|
27
|
+
* the TTL. The TTL is a hard upper bound, so a past-TTL entry is dead
|
|
28
|
+
* and can never be served — sweeping it changes no observable
|
|
29
|
+
* behaviour, it only reclaims the slot.
|
|
30
|
+
* 2. Hard max-size cap with oldest-first eviction (belt-and-suspenders)
|
|
31
|
+
* for the pathological case where many DISTINCT keys all stay fresh
|
|
32
|
+
* (a read-only burst the sweep cannot reclaim). `Map` preserves
|
|
33
|
+
* insertion order, so the oldest entry is the first key.
|
|
34
|
+
*
|
|
35
|
+
* Concrete generic type `T` — no `any`. The cache stores whatever the
|
|
36
|
+
* handler computed (the structured inspect payload).
|
|
37
|
+
*
|
|
38
|
+
* @license MIT
|
|
39
|
+
*/
|
|
40
|
+
/** Hard TTL upper bound for a cached inspection entry (60 seconds). */
|
|
41
|
+
export const INSPECTION_CACHE_TTL_MS = 60_000;
|
|
42
|
+
/**
|
|
43
|
+
* Hard ceiling on live entries. Reached only when many DISTINCT keys stay
|
|
44
|
+
* fresh inside the TTL (a read-only burst the TTL-sweep cannot reclaim);
|
|
45
|
+
* the normal write-driven etag churn is reclaimed by the sweep long before
|
|
46
|
+
* this. 256 covers a generous working set while keeping the Map tiny.
|
|
47
|
+
*/
|
|
48
|
+
export const INSPECTION_CACHE_MAX_ENTRIES = 256;
|
|
49
|
+
export class InspectionCache {
|
|
50
|
+
store = new Map();
|
|
51
|
+
now;
|
|
52
|
+
ttlMs;
|
|
53
|
+
maxEntries;
|
|
54
|
+
constructor(now = Date.now, ttlMs = INSPECTION_CACHE_TTL_MS, maxEntries = INSPECTION_CACHE_MAX_ENTRIES) {
|
|
55
|
+
this.now = now;
|
|
56
|
+
this.ttlMs = ttlMs;
|
|
57
|
+
this.maxEntries = maxEntries;
|
|
58
|
+
}
|
|
59
|
+
/** Build the composite cache key. Pipe-joined; the parts are
|
|
60
|
+
* server-controlled identifiers (template id, JSON-Pointer, quoted
|
|
61
|
+
* etag) so collision via a literal `|` in a value is not a concern. */
|
|
62
|
+
key(templateId, elementPath, etag) {
|
|
63
|
+
return `${templateId}|${elementPath}|${etag}`;
|
|
64
|
+
}
|
|
65
|
+
/** Read a fresh entry, or `undefined` on miss / expiry. Expired
|
|
66
|
+
* entries are evicted on access. */
|
|
67
|
+
get(templateId, elementPath, etag) {
|
|
68
|
+
const k = this.key(templateId, elementPath, etag);
|
|
69
|
+
const entry = this.store.get(k);
|
|
70
|
+
if (entry === undefined)
|
|
71
|
+
return undefined;
|
|
72
|
+
if (this.now() - entry.storedAt >= this.ttlMs) {
|
|
73
|
+
this.store.delete(k);
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
return entry.value;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Store a value under the composite key, stamped with the clock.
|
|
80
|
+
*
|
|
81
|
+
* Bounds the Map first (sweep past-TTL entries, then enforce the
|
|
82
|
+
* max-size cap with oldest-first eviction) so a long-lived high-write
|
|
83
|
+
* session cannot leak old-etag keys. See class doc for the why.
|
|
84
|
+
*/
|
|
85
|
+
set(templateId, elementPath, etag, value) {
|
|
86
|
+
const k = this.key(templateId, elementPath, etag);
|
|
87
|
+
this.sweepExpired();
|
|
88
|
+
this.store.set(k, { value, storedAt: this.now() });
|
|
89
|
+
this.enforceMaxEntries();
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Number of LIVE (non-expired) entries currently held. Counts rather
|
|
93
|
+
* than returns `store.size` so a caller (and the tests) sees the true
|
|
94
|
+
* working-set size even if a not-yet-swept dead entry lingers.
|
|
95
|
+
*/
|
|
96
|
+
size() {
|
|
97
|
+
let live = 0;
|
|
98
|
+
const cutoff = this.now();
|
|
99
|
+
for (const entry of this.store.values()) {
|
|
100
|
+
if (cutoff - entry.storedAt < this.ttlMs)
|
|
101
|
+
live++;
|
|
102
|
+
}
|
|
103
|
+
return live;
|
|
104
|
+
}
|
|
105
|
+
/** Drop every entry whose TTL has elapsed. Cheap, and dead entries
|
|
106
|
+
* can never be served, so this changes no observable behaviour. */
|
|
107
|
+
sweepExpired() {
|
|
108
|
+
const cutoff = this.now();
|
|
109
|
+
for (const [k, entry] of this.store) {
|
|
110
|
+
if (cutoff - entry.storedAt >= this.ttlMs) {
|
|
111
|
+
this.store.delete(k);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** Evict oldest-first until the Map is within the max-size cap. `Map`
|
|
116
|
+
* iterates in insertion order, so the first key is the oldest. */
|
|
117
|
+
enforceMaxEntries() {
|
|
118
|
+
while (this.store.size > this.maxEntries) {
|
|
119
|
+
const oldest = this.store.keys().next().value;
|
|
120
|
+
if (oldest === undefined)
|
|
121
|
+
break;
|
|
122
|
+
this.store.delete(oldest);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=inspection-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspection-cache.js","sourceRoot":"","sources":["../../../src/tools/multi-items/inspection-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAUhD,MAAM,OAAO,eAAe;IACP,KAAK,GAAG,IAAI,G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Mcp\Elements\ItemContainerMap` constant.
|
|
4
|
+
*
|
|
5
|
+
* YT-Pro 4.5.33+ implements `SourceTransform::repeatSource` which
|
|
6
|
+
* clones the *source-bearing element* N-times as siblings inside its
|
|
7
|
+
* parent. For "1 container with N children" the binding MUST live on
|
|
8
|
+
* the `*_item` child element, NEVER on the container.
|
|
9
|
+
*
|
|
10
|
+
* The PHP and TS maps MUST stay in lock-step — both files carry a
|
|
11
|
+
* pin-test that fails if the canonical pairings drift.
|
|
12
|
+
*
|
|
13
|
+
* @license MIT
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Live-verified against `themes/yootheme/packages/builder/elements/
|
|
17
|
+
* *_item/` on YT-Pro 4.5.33 (dev server, 2026-05-22). 16 pairs total.
|
|
18
|
+
*
|
|
19
|
+
* NB: There is NO `slider` / `slider_item` pair on YT-Pro 4.5.33 — the
|
|
20
|
+
* YT slider/carousel widgets render via `slideshow`, `overlay-slider`,
|
|
21
|
+
* and `panel-slider`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ITEM_CHILDREN_OF_CONTAINER: Readonly<Record<string, string>>;
|
|
24
|
+
/**
|
|
25
|
+
* Surface the `*_item` child type for a known container, or null when
|
|
26
|
+
* the input is not a known multi-item container.
|
|
27
|
+
*/
|
|
28
|
+
export declare function itemOf(containerType: string): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Surface the container type for a known `*_item`, or null otherwise.
|
|
31
|
+
*/
|
|
32
|
+
export declare function containerOf(itemType: string): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* `true` when $type is one of the multi-item-capable containers.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isContainer(type: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* `true` when $type is a `*_item` child of a multi-item container.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isItem(type: string): boolean;
|
|
41
|
+
//# sourceMappingURL=item-container-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-container-map.d.ts","sourceRoot":"","sources":["../../../src/tools/multi-items/item-container-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBtE,CAAC;AAEH;;;GAGG;AACH,wBAAgB,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI3D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO3D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5C"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-Items pattern — TypeScript mirror of the PHP
|
|
3
|
+
* `WootsUp\BuilderMcp\Elements\ItemContainerMap` constant.
|
|
4
|
+
*
|
|
5
|
+
* YT-Pro 4.5.33+ implements `SourceTransform::repeatSource` which
|
|
6
|
+
* clones the *source-bearing element* N-times as siblings inside its
|
|
7
|
+
* parent. For "1 container with N children" the binding MUST live on
|
|
8
|
+
* the `*_item` child element, NEVER on the container.
|
|
9
|
+
*
|
|
10
|
+
* The PHP and TS maps MUST stay in lock-step — both files carry a
|
|
11
|
+
* pin-test that fails if the canonical pairings drift.
|
|
12
|
+
*
|
|
13
|
+
* @license MIT
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Live-verified against `themes/yootheme/packages/builder/elements/
|
|
17
|
+
* *_item/` on YT-Pro 4.5.33 (dev server, 2026-05-22). 16 pairs total.
|
|
18
|
+
*
|
|
19
|
+
* NB: There is NO `slider` / `slider_item` pair on YT-Pro 4.5.33 — the
|
|
20
|
+
* YT slider/carousel widgets render via `slideshow`, `overlay-slider`,
|
|
21
|
+
* and `panel-slider`.
|
|
22
|
+
*/
|
|
23
|
+
export const ITEM_CHILDREN_OF_CONTAINER = Object.freeze({
|
|
24
|
+
accordion: 'accordion_item',
|
|
25
|
+
button: 'button_item',
|
|
26
|
+
description_list: 'description_list_item',
|
|
27
|
+
gallery: 'gallery_item',
|
|
28
|
+
grid: 'grid_item',
|
|
29
|
+
list: 'list_item',
|
|
30
|
+
map: 'map_item',
|
|
31
|
+
nav: 'nav_item',
|
|
32
|
+
'overlay-slider': 'overlay-slider_item',
|
|
33
|
+
'panel-slider': 'panel-slider_item',
|
|
34
|
+
popover: 'popover_item',
|
|
35
|
+
slideshow: 'slideshow_item',
|
|
36
|
+
social: 'social_item',
|
|
37
|
+
subnav: 'subnav_item',
|
|
38
|
+
switcher: 'switcher_item',
|
|
39
|
+
table: 'table_item',
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Surface the `*_item` child type for a known container, or null when
|
|
43
|
+
* the input is not a known multi-item container.
|
|
44
|
+
*/
|
|
45
|
+
export function itemOf(containerType) {
|
|
46
|
+
return Object.prototype.hasOwnProperty.call(ITEM_CHILDREN_OF_CONTAINER, containerType)
|
|
47
|
+
? ITEM_CHILDREN_OF_CONTAINER[containerType]
|
|
48
|
+
: null;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Surface the container type for a known `*_item`, or null otherwise.
|
|
52
|
+
*/
|
|
53
|
+
export function containerOf(itemType) {
|
|
54
|
+
for (const [container, item] of Object.entries(ITEM_CHILDREN_OF_CONTAINER)) {
|
|
55
|
+
if (item === itemType) {
|
|
56
|
+
return container;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* `true` when $type is one of the multi-item-capable containers.
|
|
63
|
+
*/
|
|
64
|
+
export function isContainer(type) {
|
|
65
|
+
return Object.prototype.hasOwnProperty.call(ITEM_CHILDREN_OF_CONTAINER, type);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* `true` when $type is a `*_item` child of a multi-item container.
|
|
69
|
+
*/
|
|
70
|
+
export function isItem(type) {
|
|
71
|
+
return Object.values(ITEM_CHILDREN_OF_CONTAINER).includes(type);
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=item-container-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-container-map.js","sourceRoot":"","sources":["../../../src/tools/multi-items/item-container-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAqC,MAAM,CAAC,MAAM,CAAC;IACtF,SAAS,EAAE,gBAAgB;IAC3B,MAAM,EAAE,aAAa;IACrB,gBAAgB,EAAE,uBAAuB;IACzC,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,UAAU;IACf,gBAAgB,EAAE,qBAAqB;IACvC,cAAc,EAAE,mBAAmB;IACnC,OAAO,EAAE,cAAc;IACvB,SAAS,EAAE,gBAAgB;IAC3B,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,aAAa;IACrB,QAAQ,EAAE,eAAe;IACzB,KAAK,EAAE,YAAY;CACtB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,aAAqB;IACxC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,0BAA0B,EAAE,aAAa,CAAC;QAClF,CAAC,CAAE,0BAA0B,CAAC,aAAa,CAAY;QACvD,CAAC,CAAC,IAAI,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IACxC,KAAK,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,0BAA0B,CAAC,EAAE,CAAC;QACzE,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACpB,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACpC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAAC;AAClF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,IAAY;IAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page-tool builders — pure `defineTool` factory list.
|
|
3
|
+
*
|
|
4
|
+
* Split out of `src/tools/pages.ts` (Round-2 R2-A2-CRIT1). Handler
|
|
5
|
+
* bodies live in `./handlers-read.ts` (pages_list, page_get_layout,
|
|
6
|
+
* page_get_schema, get_etag, template_summary) and `./handlers-write.ts`
|
|
7
|
+
* (page_save, page_publish, pages_create, pages_delete — 3-phase
|
|
8
|
+
* progress contract).
|
|
9
|
+
*
|
|
10
|
+
* Surface: 9 page-level tools (pre-C4: 7; v1.2 C4 added pages_create +
|
|
11
|
+
* pages_delete wrapping POST /pages and DELETE /pages/{id}).
|
|
12
|
+
*
|
|
13
|
+
* @license MIT
|
|
14
|
+
*/
|
|
15
|
+
import type { ClientPool } from '../../sites/client-pool.js';
|
|
16
|
+
import { type AnyToolDefinition } from '../tool-builder.js';
|
|
17
|
+
/**
|
|
18
|
+
* Render-context descriptor emitted by the page builders (Wave-16 #33-C).
|
|
19
|
+
*
|
|
20
|
+
* Gives the calling agent the page's template lineage, locale, and origin
|
|
21
|
+
* site in one place so it does not need a second round-trip to reason
|
|
22
|
+
* about where/how a page renders. `site_url` is always populated from the
|
|
23
|
+
* resolved site; `parent_template_id` and `locale` are `null` when the
|
|
24
|
+
* builder cannot reach them (rather than absent) so the shape is stable
|
|
25
|
+
* for consumers.
|
|
26
|
+
*/
|
|
27
|
+
export interface RenderContext {
|
|
28
|
+
readonly parent_template_id: string | null;
|
|
29
|
+
readonly locale: string | null;
|
|
30
|
+
readonly site_url: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Build the {@link RenderContext} from the data reachable in a page
|
|
34
|
+
* builder. Pure: no I/O, no `any`. Missing `parentTemplateId` / `locale`
|
|
35
|
+
* collapse to `null`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildRenderContext(input: {
|
|
38
|
+
siteUrl: string;
|
|
39
|
+
parentTemplateId?: string | null;
|
|
40
|
+
locale?: string | null;
|
|
41
|
+
}): RenderContext;
|
|
42
|
+
export declare function buildPagesTools(pool: ClientPool): readonly AnyToolDefinition[];
|
|
43
|
+
//# sourceMappingURL=builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/tools/pages/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAK7D,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAC;AAsC5B;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,GAAG,aAAa,CAMhB;AAyCD,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,iBAAiB,EAAE,CAqM9E"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page-tool builders — pure `defineTool` factory list.
|
|
3
|
+
*
|
|
4
|
+
* Split out of `src/tools/pages.ts` (Round-2 R2-A2-CRIT1). Handler
|
|
5
|
+
* bodies live in `./handlers-read.ts` (pages_list, page_get_layout,
|
|
6
|
+
* page_get_schema, get_etag, template_summary) and `./handlers-write.ts`
|
|
7
|
+
* (page_save, page_publish, pages_create, pages_delete — 3-phase
|
|
8
|
+
* progress contract).
|
|
9
|
+
*
|
|
10
|
+
* Surface: 9 page-level tools (pre-C4: 7; v1.2 C4 added pages_create +
|
|
11
|
+
* pages_delete wrapping POST /pages and DELETE /pages/{id}).
|
|
12
|
+
*
|
|
13
|
+
* @license MIT
|
|
14
|
+
*/
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
import { withSiteRetry } from '../pool-resolve-helper.js';
|
|
17
|
+
import { SITE_ID_SCHEMA, TEMPLATE_ID } from '../shared-schemas.js';
|
|
18
|
+
import { FIELDS, FLAT } from '../sparse-fields.js';
|
|
19
|
+
import { defineTool, mutating, readOnly, withSiteMeta, } from '../tool-builder.js';
|
|
20
|
+
import { handleGetEtag, handlePageGetLayout, handlePageGetSchema, handlePagesList, handleTemplateSummary, } from './handlers-read.js';
|
|
21
|
+
import { handlePagePublish, handlePagesCreate, handlePagesDelete, handlePageSave, } from './handlers-write.js';
|
|
22
|
+
import { ETAG_OUTPUT_SCHEMA, PAGES_CREATE_INPUT, PAGES_DELETE_INPUT, PAGES_DELETE_OUTPUT_SCHEMA, PAGES_LIST_OUTPUT_SCHEMA, SCHEMA_OUTPUT_SCHEMA, TEMPLATE_SUMMARY_OUTPUT_SCHEMA, } from './schemas.js';
|
|
23
|
+
// F-14: page-level save/publish accept OPTIONAL ETag (no precondition lock
|
|
24
|
+
// at template level — element/binding mutations REQUIRE one via the strict
|
|
25
|
+
// ETAG in shared-schemas.ts). Schema and description now agree: optional
|
|
26
|
+
// here, recommended for safety. When provided, 412 Precondition Failed is
|
|
27
|
+
// raised on stale snapshots; when omitted, the save proceeds unconditionally.
|
|
28
|
+
const ETAG = z
|
|
29
|
+
.string()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Optimistic-lock ETag (from yootheme_builder_get_etag). ' +
|
|
32
|
+
'Optional; when provided, optimistic-lock is enforced (412 on conflict). ' +
|
|
33
|
+
'When omitted, last-write-wins applies. Recommended for collaborative edits.');
|
|
34
|
+
/**
|
|
35
|
+
* Build the {@link RenderContext} from the data reachable in a page
|
|
36
|
+
* builder. Pure: no I/O, no `any`. Missing `parentTemplateId` / `locale`
|
|
37
|
+
* collapse to `null`.
|
|
38
|
+
*/
|
|
39
|
+
export function buildRenderContext(input) {
|
|
40
|
+
return {
|
|
41
|
+
parent_template_id: input.parentTemplateId ?? null,
|
|
42
|
+
locale: input.locale ?? null,
|
|
43
|
+
site_url: input.siteUrl,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Best-effort locale extraction from a resolved site. The registry does
|
|
48
|
+
* not (yet) carry an explicit locale, so we read it from the platform
|
|
49
|
+
* descriptor when present; otherwise `null` (the consumer-stable
|
|
50
|
+
* "unknown" value). Kept narrow + guarded so this stays `any`-free.
|
|
51
|
+
*/
|
|
52
|
+
function localeForSite(site) {
|
|
53
|
+
const platform = site.platform;
|
|
54
|
+
if (typeof platform === 'object' && platform !== null && 'locale' in platform) {
|
|
55
|
+
const value = platform.locale;
|
|
56
|
+
if (typeof value === 'string' && value !== '') {
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Stamp a {@link RenderContext} into a tool result's free-form
|
|
64
|
+
* result-level `_meta` (next to the site-meta `withSiteMeta` adds).
|
|
65
|
+
* Never touches `structuredContent` — that stays schema-pure so it keeps
|
|
66
|
+
* validating against the tool's `outputSchema`. Pure: returns a new
|
|
67
|
+
* result, does not mutate the input.
|
|
68
|
+
*/
|
|
69
|
+
function withRenderContext(result, ctx) {
|
|
70
|
+
const base = result._meta;
|
|
71
|
+
const mergedMeta = base !== undefined && base !== null && typeof base === 'object'
|
|
72
|
+
? { ...base, render_context: ctx }
|
|
73
|
+
: { render_context: ctx };
|
|
74
|
+
return { ...result, _meta: mergedMeta };
|
|
75
|
+
}
|
|
76
|
+
export function buildPagesTools(pool) {
|
|
77
|
+
return [
|
|
78
|
+
defineTool({
|
|
79
|
+
name: 'yootheme_builder_pages_list',
|
|
80
|
+
description: 'List all pages, templates, and layouts in the YOOtheme Pro builder. ' +
|
|
81
|
+
'Returns template_id, label, type, element count, and frontend_url per row. ' +
|
|
82
|
+
'CALL THIS FIRST to discover available template IDs before any tool that needs ' +
|
|
83
|
+
'a template_id (page_get_layout, element_list, page_get_schema, etc.). ' +
|
|
84
|
+
'Keywords: list pages, list templates, list layouts, discover template_id, ' +
|
|
85
|
+
'index, available templates, what pages exist. ' +
|
|
86
|
+
'Pass `fields:["id","label"]` to slim. ' +
|
|
87
|
+
'Returns ALL pages in one call (no pagination, typically <50 templates per site). ' +
|
|
88
|
+
'Operates on the default site unless site_id is provided.',
|
|
89
|
+
inputSchema: { site_id: SITE_ID_SCHEMA, fields: FIELDS },
|
|
90
|
+
outputSchema: PAGES_LIST_OUTPUT_SCHEMA,
|
|
91
|
+
annotations: readOnly('List Pages'),
|
|
92
|
+
handler: async ({ site_id, ...rest }) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handlePagesList(client, rest), site)),
|
|
93
|
+
}),
|
|
94
|
+
defineTool({
|
|
95
|
+
name: 'yootheme_builder_page_get_layout',
|
|
96
|
+
description: 'Get full layout tree for one template. Default nested `{layout, ' +
|
|
97
|
+
'etag}`. Set `flat:true` for depth-first array `{elements:[...], ' +
|
|
98
|
+
'etag}`; combine with `fields[]` to project per-element. ' +
|
|
99
|
+
'Operates on the default site unless site_id is provided.',
|
|
100
|
+
inputSchema: {
|
|
101
|
+
site_id: SITE_ID_SCHEMA,
|
|
102
|
+
template_id: TEMPLATE_ID,
|
|
103
|
+
flat: FLAT,
|
|
104
|
+
fields: FIELDS,
|
|
105
|
+
},
|
|
106
|
+
// No outputSchema: the response shape is a union (nested OR flat with
|
|
107
|
+
// optional projection) and the JSON-Pointer-keyed nested shape is
|
|
108
|
+
// structurally open-ended — modelling it precisely buys nothing here.
|
|
109
|
+
annotations: readOnly('Get Page Layout'),
|
|
110
|
+
handler: async ({ site_id, ...rest }) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handlePageGetLayout(client, rest), site)),
|
|
111
|
+
}),
|
|
112
|
+
defineTool({
|
|
113
|
+
name: 'yootheme_builder_page_get_schema',
|
|
114
|
+
description: 'Get the flat schema for a template — a list of nodes with their JSON-Pointer ' +
|
|
115
|
+
'paths and element types. Best entry-point for navigation: lighter than ' +
|
|
116
|
+
'page_get_layout, sufficient to locate elements before editing. ' +
|
|
117
|
+
'Operates on the default site unless site_id is provided.',
|
|
118
|
+
inputSchema: { site_id: SITE_ID_SCHEMA, template_id: TEMPLATE_ID },
|
|
119
|
+
outputSchema: SCHEMA_OUTPUT_SCHEMA,
|
|
120
|
+
annotations: readOnly('Get Page Schema'),
|
|
121
|
+
handler: async ({ site_id, ...rest }) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handlePageGetSchema(client, rest), site)),
|
|
122
|
+
}),
|
|
123
|
+
defineTool({
|
|
124
|
+
name: 'yootheme_builder_get_etag',
|
|
125
|
+
description: 'Get the current ETag (state revision) for the YOOtheme builder. ' +
|
|
126
|
+
'Returns sha256+revision string used for optimistic locking on writes. ' +
|
|
127
|
+
'Pass the returned value back as `etag` on any write tool (page_save, page_publish, ' +
|
|
128
|
+
'element_add, element_update_settings, element_clone, element_move, element_delete). ' +
|
|
129
|
+
'The server returns HTTP 412 if the ETag has changed since you read it. ' +
|
|
130
|
+
'Keywords: get etag, current etag, state revision, optimistic lock, version stamp. ' +
|
|
131
|
+
'Operates on the default site unless site_id is provided.',
|
|
132
|
+
inputSchema: { site_id: SITE_ID_SCHEMA },
|
|
133
|
+
outputSchema: ETAG_OUTPUT_SCHEMA,
|
|
134
|
+
annotations: readOnly('Get ETag'),
|
|
135
|
+
handler: async ({ site_id }) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleGetEtag(client), site)),
|
|
136
|
+
}),
|
|
137
|
+
defineTool({
|
|
138
|
+
name: 'yootheme_builder_template_summary',
|
|
139
|
+
description: 'Token-efficient template overview: element counts by type, binding ' +
|
|
140
|
+
'count, max nesting depth, and named landmark sections — computed ' +
|
|
141
|
+
'server-side in one call. Use this to grasp a large template before ' +
|
|
142
|
+
'pulling element_list or page_get_layout. ' +
|
|
143
|
+
'Operates on the default site unless site_id is provided.',
|
|
144
|
+
inputSchema: { site_id: SITE_ID_SCHEMA, template_id: TEMPLATE_ID },
|
|
145
|
+
outputSchema: TEMPLATE_SUMMARY_OUTPUT_SCHEMA,
|
|
146
|
+
annotations: readOnly('Template Summary'),
|
|
147
|
+
handler: async ({ site_id, ...rest }) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleTemplateSummary(client, rest), site)),
|
|
148
|
+
}),
|
|
149
|
+
defineTool({
|
|
150
|
+
name: 'yootheme_builder_page_save',
|
|
151
|
+
description: 'Re-run save-transforms + flush caches. Does NOT accept a layout — land edits ' +
|
|
152
|
+
'via element_add/update/bind/delete first. No-op if byte-identical. New pages: ' +
|
|
153
|
+
'pages_create. Publish: page_publish. ETag optional. ' +
|
|
154
|
+
'Operates on the default site unless site_id is provided.',
|
|
155
|
+
inputSchema: {
|
|
156
|
+
site_id: SITE_ID_SCHEMA,
|
|
157
|
+
template_id: TEMPLATE_ID,
|
|
158
|
+
etag: ETAG,
|
|
159
|
+
},
|
|
160
|
+
annotations: mutating('Save Page'),
|
|
161
|
+
handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withRenderContext(withSiteMeta(await handlePageSave(client, rest, extra), site), buildRenderContext({
|
|
162
|
+
siteUrl: site.url,
|
|
163
|
+
parentTemplateId: rest.template_id,
|
|
164
|
+
locale: localeForSite(site),
|
|
165
|
+
}))),
|
|
166
|
+
}),
|
|
167
|
+
defineTool({
|
|
168
|
+
name: 'yootheme_builder_page_publish',
|
|
169
|
+
description: 'Publish a template — persist state, flush YT + WP caches, snapshot the ' +
|
|
170
|
+
'published-state ETag. ETag optional — when provided, 412 on conflict; when ' +
|
|
171
|
+
'omitted, last-write-wins. Recommended for collaborative edits. ' +
|
|
172
|
+
'Operates on the default site unless site_id is provided.',
|
|
173
|
+
inputSchema: {
|
|
174
|
+
site_id: SITE_ID_SCHEMA,
|
|
175
|
+
template_id: TEMPLATE_ID,
|
|
176
|
+
etag: ETAG,
|
|
177
|
+
},
|
|
178
|
+
// Stream D3 T3: publish is idempotent — re-running on an
|
|
179
|
+
// unchanged template snapshots the same ETag and flushes
|
|
180
|
+
// the same caches. Matrix marks `idempotentHint:true`.
|
|
181
|
+
annotations: mutating('Publish Page'),
|
|
182
|
+
handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withRenderContext(withSiteMeta(await handlePagePublish(client, rest, extra), site), buildRenderContext({
|
|
183
|
+
siteUrl: site.url,
|
|
184
|
+
parentTemplateId: rest.template_id,
|
|
185
|
+
locale: localeForSite(site),
|
|
186
|
+
}))),
|
|
187
|
+
}),
|
|
188
|
+
// ─── C4 (v1.2) — pages_create + pages_delete ──────────────────
|
|
189
|
+
// First-class customer-facing page-level mutations. Both wrap
|
|
190
|
+
// Phase B REST endpoints (POST /pages, DELETE /pages/{id}) and
|
|
191
|
+
// are L1 essentials (see gateway/essentials.ts).
|
|
192
|
+
defineTool({
|
|
193
|
+
name: 'yootheme_builder_pages_create',
|
|
194
|
+
description: 'Create a new WordPress page with a YOOtheme per-page layout. Required: title. ' +
|
|
195
|
+
'Optional: slug (defaults to sanitize_title(title)), status (default: draft), ' +
|
|
196
|
+
'layout (JSON, default: {type:"layout",children:[]}). ' +
|
|
197
|
+
'Supports dry-run mode (dry_run:true) to preflight all hardening layers without persisting. ' +
|
|
198
|
+
'Returns page_id, slug (post-collision-resolved), template_id, etag, warnings. ' +
|
|
199
|
+
'Operates on the default site unless site_id is provided.',
|
|
200
|
+
inputSchema: { site_id: SITE_ID_SCHEMA, ...PAGES_CREATE_INPUT },
|
|
201
|
+
// No outputSchema: the response shape is a discriminated union
|
|
202
|
+
// (201 wet vs 200 dry-run). page_get_layout uses the same pattern.
|
|
203
|
+
annotations: mutating('Create Page'),
|
|
204
|
+
handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withRenderContext(withSiteMeta(await handlePagesCreate(client, rest, extra), site), buildRenderContext({
|
|
205
|
+
siteUrl: site.url,
|
|
206
|
+
// A new page has no caller-supplied parent
|
|
207
|
+
// template; null until the REST response carries
|
|
208
|
+
// one (kept stable rather than absent).
|
|
209
|
+
parentTemplateId: null,
|
|
210
|
+
locale: localeForSite(site),
|
|
211
|
+
}))),
|
|
212
|
+
}),
|
|
213
|
+
defineTool({
|
|
214
|
+
name: 'yootheme_builder_pages_delete',
|
|
215
|
+
description: 'Delete a WordPress page (with associated YOOtheme per-page layout). ' +
|
|
216
|
+
'Requires confirm:true (gate against accidental deletion). ' +
|
|
217
|
+
'Default behavior: wp_trash_post (recoverable via wp-admin). ' +
|
|
218
|
+
'With force:true: permanent wp_delete_post(force=true). ' +
|
|
219
|
+
'Refuses non-page post types with 403 (Layer 9 defense). ' +
|
|
220
|
+
'Returns deleted:true, page_id, force_deleted, bumped etag. ' +
|
|
221
|
+
'Operates on the default site unless site_id is provided.',
|
|
222
|
+
inputSchema: { site_id: SITE_ID_SCHEMA, ...PAGES_DELETE_INPUT },
|
|
223
|
+
outputSchema: PAGES_DELETE_OUTPUT_SCHEMA,
|
|
224
|
+
annotations: mutating('Delete Page'),
|
|
225
|
+
handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handlePagesDelete(client, rest, extra), site)),
|
|
226
|
+
}),
|
|
227
|
+
];
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=builders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.js","sourceRoot":"","sources":["../../../src/tools/pages/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACH,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,YAAY,GAEf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,8BAA8B,GACjC,MAAM,cAAc,CAAC;AAEtB,2EAA2E;AAC3E,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,8EAA8E;AAC9E,MAAM,IAAI,GAAG,CAAC;KACT,MAAM,EAAE;KACR,QAAQ,EAAE;KACV,QAAQ,CACL,yDAAyD;IACrD,0EAA0E;IAC1E,6EAA6E,CACpF,CAAC;AAkBN;;;;GAIG;AACH,MAAM,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