@wootsup/yt-builder-mcp 1.0.1 → 1.1.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 +18 -6
- package/bin/yt-builder-mcp.js +6 -0
- package/dist/auth.d.ts +119 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +226 -0
- package/dist/auth.js.map +1 -0
- package/dist/client.d.ts +84 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +151 -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 +53 -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 +56 -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 +80 -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 +194 -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 +52 -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 +38 -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 +44 -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 +52 -0
- package/dist/clients/index.d.ts.map +1 -0
- package/dist/clients/index.js +72 -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 +69 -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 +41 -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 +49 -0
- package/dist/gateway/essentials.d.ts.map +1 -0
- package/dist/gateway/essentials.js +92 -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 +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +113 -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 +109 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +237 -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 +152 -0
- package/dist/setup-cli.d.ts.map +1 -0
- package/dist/setup-cli.js +870 -0
- package/dist/setup-cli.js.map +1 -0
- package/dist/setup-prompts.d.ts +41 -0
- package/dist/setup-prompts.d.ts.map +1 -0
- package/dist/setup-prompts.js +146 -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/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 +117 -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 +124 -0
- package/dist/sites/client-pool.d.ts.map +1 -0
- package/dist/sites/client-pool.js +172 -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 +109 -0
- package/dist/sites/secret-resolver.d.ts.map +1 -0
- package/dist/sites/secret-resolver.js +189 -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 +30 -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 +135 -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/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 +199 -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 +148 -0
- package/dist/tools/elements/handlers-write.js.map +1 -0
- package/dist/tools/elements/handlers.d.ts +68 -0
- package/dist/tools/elements/handlers.d.ts.map +1 -0
- package/dist/tools/elements/handlers.js +206 -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 +194 -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 +58 -0
- package/dist/tools/format/inspection-format.d.ts.map +1 -0
- package/dist/tools/format/inspection-format.js +164 -0
- package/dist/tools/format/inspection-format.js.map +1 -0
- package/dist/tools/format/pages-format.d.ts +48 -0
- package/dist/tools/format/pages-format.d.ts.map +1 -0
- package/dist/tools/format/pages-format.js +137 -0
- package/dist/tools/format/pages-format.js.map +1 -0
- package/dist/tools/format/sources-format.d.ts +25 -0
- package/dist/tools/format/sources-format.d.ts.map +1 -0
- package/dist/tools/format/sources-format.js +208 -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 +170 -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 +69 -0
- package/dist/tools/multi-items/builders.js.map +1 -0
- package/dist/tools/multi-items/clean-implode-handler.d.ts +28 -0
- package/dist/tools/multi-items/clean-implode-handler.d.ts.map +1 -0
- package/dist/tools/multi-items/clean-implode-handler.js +40 -0
- package/dist/tools/multi-items/clean-implode-handler.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 +41 -0
- package/dist/tools/multi-items/inspect-handler.d.ts.map +1 -0
- package/dist/tools/multi-items/inspect-handler.js +50 -0
- package/dist/tools/multi-items/inspect-handler.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 +14 -0
- package/dist/tools/pages/builders.d.ts.map +1 -0
- package/dist/tools/pages/builders.js +127 -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 +171 -0
- package/dist/tools/pages/handlers-read.js.map +1 -0
- package/dist/tools/pages/handlers-write.d.ts +21 -0
- package/dist/tools/pages/handlers-write.d.ts.map +1 -0
- package/dist/tools/pages/handlers-write.js +52 -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 +30 -0
- package/dist/tools/pages/schemas.d.ts.map +1 -0
- package/dist/tools/pages/schemas.js +48 -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 +48 -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 +115 -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 +129 -0
- package/dist/tools/sources/handlers-bind.js.map +1 -0
- package/dist/tools/sources/handlers.d.ts +45 -0
- package/dist/tools/sources/handlers.d.ts.map +1 -0
- package/dist/tools/sources/handlers.js +91 -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 +80 -0
- package/dist/tools/sparse-fields.d.ts.map +1 -0
- package/dist/tools/sparse-fields.js +144 -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 +93 -0
- package/dist/tools/tool-builder/results.d.ts.map +1 -0
- package/dist/tools/tool-builder/results.js +211 -0
- package/dist/tools/tool-builder/results.js.map +1 -0
- package/dist/tools/tool-builder/types.d.ts +82 -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/manifest.json +27 -10
- package/package.json +3 -1
- package/skills/yt-builder-mcp/SKILL.md +397 -138
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout-flatten helper — depth-first walk that turns a nested YOOtheme
|
|
3
|
+
* layout tree into a flat array of `{ path, parent_path, depth,
|
|
4
|
+
* element_type, props }` records.
|
|
5
|
+
*
|
|
6
|
+
* Used by `yootheme_builder_page_get_layout` when called with
|
|
7
|
+
* `flat: true`. Per Design §4.4.1:
|
|
8
|
+
*
|
|
9
|
+
* - Walk-order: depth-first, parent BEFORE children, original child
|
|
10
|
+
* order preserved (no sort).
|
|
11
|
+
* - `path` uses JSON-Pointer-style notation rooted at `/layout/<key>`
|
|
12
|
+
* and descends via `/children/<index>` segments. The root segments
|
|
13
|
+
* mirror the keys the REST plugin produces (string keys "0","1",…
|
|
14
|
+
* when the top-level layout is an object; numeric indices when it
|
|
15
|
+
* happens to be an array).
|
|
16
|
+
* - `parent_path` is `null` for top-level entries.
|
|
17
|
+
* - The emitted record's `children` field is REMOVED — children become
|
|
18
|
+
* their own emitted entries with their own `path`. Keeping the nested
|
|
19
|
+
* array would defeat the purpose of flattening.
|
|
20
|
+
* - Non-object children are skipped silently but their index is
|
|
21
|
+
* preserved in the parent's child-numbering (the next valid sibling
|
|
22
|
+
* keeps its original index).
|
|
23
|
+
*
|
|
24
|
+
* Pure function — no I/O, no client dependency. Test-covered in
|
|
25
|
+
* `tests/tools/layout-flatten.test.ts`.
|
|
26
|
+
*
|
|
27
|
+
* @license MIT
|
|
28
|
+
*/
|
|
29
|
+
import { hasSourceBinding } from './format/elements-format.js';
|
|
30
|
+
/**
|
|
31
|
+
* Flatten a YOOtheme nested layout tree.
|
|
32
|
+
*
|
|
33
|
+
* @param layout - The top-level layout container. Accepts either an
|
|
34
|
+
* object keyed by stringified indices ("0","1",…) or an actual array.
|
|
35
|
+
* Returns `[]` for empty input or anything that isn't iterable.
|
|
36
|
+
*/
|
|
37
|
+
export function flattenLayout(layout) {
|
|
38
|
+
const out = [];
|
|
39
|
+
if (layout === null || typeof layout !== 'object') {
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
// Iterate top-level entries in insertion order. For arrays this gives
|
|
43
|
+
// numeric indices; for objects keyed by "0","1",… it gives the same
|
|
44
|
+
// ordering YT serialises.
|
|
45
|
+
const entries = Array.isArray(layout)
|
|
46
|
+
? layout.map((v, i) => [String(i), v])
|
|
47
|
+
: Object.entries(layout);
|
|
48
|
+
for (const [key, node] of entries) {
|
|
49
|
+
walk(node, `/layout/${key}`, null, 0, out);
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Depth-first walker. Emits the node, then recurses into its children.
|
|
55
|
+
* Skips non-object nodes silently while preserving child-index numbering.
|
|
56
|
+
*/
|
|
57
|
+
function walk(node, path, parentPath, depth, out) {
|
|
58
|
+
if (node === null || typeof node !== 'object' || Array.isArray(node)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const obj = node;
|
|
62
|
+
const elementType = typeof obj.type === 'string' ? obj.type : '';
|
|
63
|
+
const props = obj.props !== null && typeof obj.props === 'object' && !Array.isArray(obj.props)
|
|
64
|
+
? obj.props
|
|
65
|
+
: undefined;
|
|
66
|
+
// N-01: derive the projection-relevant fields up-front so a
|
|
67
|
+
// `fields:["rel_path","has_binding",...]` projection finds them.
|
|
68
|
+
// `rel_path` strips the `/layout` prefix; `has_binding` honours an
|
|
69
|
+
// explicit REST boolean else derives via the shared SSoT.
|
|
70
|
+
const relPath = path.replace(/^\/layout/, '') || '/';
|
|
71
|
+
const hasBinding = typeof obj.has_binding === 'boolean'
|
|
72
|
+
? obj.has_binding
|
|
73
|
+
: hasSourceBinding(obj);
|
|
74
|
+
// Build a passthrough shallow-clone WITHOUT the children field. We
|
|
75
|
+
// copy every other top-level key so future REST additions (label,
|
|
76
|
+
// …) survive the flatten.
|
|
77
|
+
const emitted = {
|
|
78
|
+
path,
|
|
79
|
+
rel_path: relPath,
|
|
80
|
+
parent_path: parentPath,
|
|
81
|
+
depth,
|
|
82
|
+
element_type: elementType,
|
|
83
|
+
has_binding: hasBinding,
|
|
84
|
+
};
|
|
85
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
86
|
+
if (k === 'children' || k === 'type' || k === 'props' || k === 'has_binding') {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
emitted[k] = v;
|
|
90
|
+
}
|
|
91
|
+
if (props !== undefined)
|
|
92
|
+
emitted.props = props;
|
|
93
|
+
out.push(emitted);
|
|
94
|
+
const children = obj.children;
|
|
95
|
+
if (Array.isArray(children)) {
|
|
96
|
+
for (let i = 0; i < children.length; i++) {
|
|
97
|
+
const child = children[i];
|
|
98
|
+
if (child === null || typeof child !== 'object' || Array.isArray(child)) {
|
|
99
|
+
// Skip non-object children; their index is preserved in
|
|
100
|
+
// the next sibling's path.
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
walk(child, `${path}/children/${String(i)}`, path, depth + 1, out);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=layout-flatten.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-flatten.js","sourceRoot":"","sources":["../../src/tools/layout-flatten.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-Items tool builders.
|
|
3
|
+
*
|
|
4
|
+
* Surfaces two tools that operate on the YT-Pro Multi-Items binding
|
|
5
|
+
* pattern (container ↔ `*_item` pairings — see
|
|
6
|
+
* `./item-container-map.ts`):
|
|
7
|
+
*
|
|
8
|
+
* yootheme_builder_inspect_multi_items_binding
|
|
9
|
+
* → Reports the binding level (none/container/item), the matching
|
|
10
|
+
* container/item pair, and whether legacy implode directives are
|
|
11
|
+
* attached. Surfaces a `recommended_fix` when the binding sits on
|
|
12
|
+
* the container level.
|
|
13
|
+
*
|
|
14
|
+
* yootheme_builder_clean_implode_directives
|
|
15
|
+
* → Removes every `props.source.props.*.implode` directive from
|
|
16
|
+
* the addressed element. Returns the audit log + new etag.
|
|
17
|
+
*
|
|
18
|
+
* @license MIT
|
|
19
|
+
*/
|
|
20
|
+
import type { ClientPool } from '../../sites/client-pool.js';
|
|
21
|
+
import { type AnyToolDefinition } from '../tool-builder.js';
|
|
22
|
+
export declare function buildMultiItemsTools(pool: ClientPool): readonly AnyToolDefinition[];
|
|
23
|
+
//# sourceMappingURL=builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/tools/multi-items/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAC;AAW5B,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,iBAAiB,EAAE,CAgDnF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-Items tool builders.
|
|
3
|
+
*
|
|
4
|
+
* Surfaces two tools that operate on the YT-Pro Multi-Items binding
|
|
5
|
+
* pattern (container ↔ `*_item` pairings — see
|
|
6
|
+
* `./item-container-map.ts`):
|
|
7
|
+
*
|
|
8
|
+
* yootheme_builder_inspect_multi_items_binding
|
|
9
|
+
* → Reports the binding level (none/container/item), the matching
|
|
10
|
+
* container/item pair, and whether legacy implode directives are
|
|
11
|
+
* attached. Surfaces a `recommended_fix` when the binding sits on
|
|
12
|
+
* the container level.
|
|
13
|
+
*
|
|
14
|
+
* yootheme_builder_clean_implode_directives
|
|
15
|
+
* → Removes every `props.source.props.*.implode` directive from
|
|
16
|
+
* the addressed element. Returns the audit log + new etag.
|
|
17
|
+
*
|
|
18
|
+
* @license MIT
|
|
19
|
+
*/
|
|
20
|
+
import { withSiteRetry } from '../pool-resolve-helper.js';
|
|
21
|
+
import { ELEMENT_PATH, ETAG, SITE_ID_SCHEMA, TEMPLATE_ID } from '../shared-schemas.js';
|
|
22
|
+
import { defineTool, mutating, readOnly, withSiteMeta, } from '../tool-builder.js';
|
|
23
|
+
import { CLEAN_IMPLODE_OUTPUT_SCHEMA, handleCleanImplodeDirectives, } from './clean-implode-handler.js';
|
|
24
|
+
import { INSPECT_MULTI_ITEMS_OUTPUT_SCHEMA, handleInspectMultiItemsBinding, } from './inspect-handler.js';
|
|
25
|
+
export function buildMultiItemsTools(pool) {
|
|
26
|
+
// W6.3 — per-handler resolveSiteOrError. The handlers consume a
|
|
27
|
+
// single-field `MultiItemsHandlerDeps`, so we synthesise it inline
|
|
28
|
+
// with the resolved client.
|
|
29
|
+
return [
|
|
30
|
+
defineTool({
|
|
31
|
+
name: 'yootheme_builder_inspect_multi_items_binding',
|
|
32
|
+
description: 'Reports Multi-Items binding state: container/item pair (grid↔grid_item, ' +
|
|
33
|
+
'slideshow↔slideshow_item, …), current binding level (none|container|item), ' +
|
|
34
|
+
'and a recommended_fix when the binding sits on the container instead of the child. ' +
|
|
35
|
+
'Operates on the default site unless site_id is provided.',
|
|
36
|
+
inputSchema: {
|
|
37
|
+
site_id: SITE_ID_SCHEMA,
|
|
38
|
+
template_id: TEMPLATE_ID,
|
|
39
|
+
element_path: ELEMENT_PATH,
|
|
40
|
+
},
|
|
41
|
+
outputSchema: INSPECT_MULTI_ITEMS_OUTPUT_SCHEMA,
|
|
42
|
+
annotations: readOnly('Inspect Multi-Items Binding'),
|
|
43
|
+
handler: async ({ site_id, ...rest }) => withSiteRetry(pool, site_id, async (client, site) => {
|
|
44
|
+
const deps = { client };
|
|
45
|
+
return withSiteMeta(await handleInspectMultiItemsBinding(deps, rest), site);
|
|
46
|
+
}),
|
|
47
|
+
}),
|
|
48
|
+
defineTool({
|
|
49
|
+
name: 'yootheme_builder_clean_implode_directives',
|
|
50
|
+
description: 'Strips `props.source.props.*.implode` directives from an element binding. ' +
|
|
51
|
+
'Returns audit log + new ETag. Idempotent (cleaned_count: 0 when nothing to ' +
|
|
52
|
+
'remove). Requires ETag. ' +
|
|
53
|
+
'Operates on the default site unless site_id is provided.',
|
|
54
|
+
inputSchema: {
|
|
55
|
+
site_id: SITE_ID_SCHEMA,
|
|
56
|
+
template_id: TEMPLATE_ID,
|
|
57
|
+
element_path: ELEMENT_PATH,
|
|
58
|
+
etag: ETAG,
|
|
59
|
+
},
|
|
60
|
+
outputSchema: CLEAN_IMPLODE_OUTPUT_SCHEMA,
|
|
61
|
+
annotations: mutating('Clean Implode Directives'),
|
|
62
|
+
handler: async ({ site_id, ...rest }) => withSiteRetry(pool, site_id, async (client, site) => {
|
|
63
|
+
const deps = { client };
|
|
64
|
+
return withSiteMeta(await handleCleanImplodeDirectives(deps, rest), site);
|
|
65
|
+
}),
|
|
66
|
+
}),
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=builders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.js","sourceRoot":"","sources":["../../../src/tools/multi-items/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EACH,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,YAAY,GAEf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,2BAA2B,EAC3B,4BAA4B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,iCAAiC,EACjC,8BAA8B,GAEjC,MAAM,sBAAsB,CAAC;AAE9B,MAAM,UAAU,oBAAoB,CAAC,IAAgB;IACjD,gEAAgE;IAChE,mEAAmE;IACnE,4BAA4B;IAC5B,OAAO;QACH,UAAU,CAAC;YACP,IAAI,EAAE,8CAA8C;YACpD,WAAW,EACP,0EAA0E;gBAC1E,6EAA6E;gBAC7E,qFAAqF;gBACrF,0DAA0D;YAC9D,WAAW,EAAE;gBACT,OAAO,EAAE,cAAc;gBACvB,WAAW,EAAE,WAAW;gBACxB,YAAY,EAAE,YAAY;aAC7B;YACD,YAAY,EAAE,iCAAiC;YAC/C,WAAW,EAAE,QAAQ,CAAC,6BAA6B,CAAC;YACpD,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CACpC,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;gBAChD,MAAM,IAAI,GAA0B,EAAE,MAAM,EAAE,CAAC;gBAC/C,OAAO,YAAY,CAAC,MAAM,8BAA8B,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;YAChF,CAAC,CAAC;SACT,CAAC;QAEF,UAAU,CAAC;YACP,IAAI,EAAE,2CAA2C;YACjD,WAAW,EACP,4EAA4E;gBAC5E,6EAA6E;gBAC7E,0BAA0B;gBAC1B,0DAA0D;YAC9D,WAAW,EAAE;gBACT,OAAO,EAAE,cAAc;gBACvB,WAAW,EAAE,WAAW;gBACxB,YAAY,EAAE,YAAY;gBAC1B,IAAI,EAAE,IAAI;aACb;YACD,YAAY,EAAE,2BAA2B;YACzC,WAAW,EAAE,QAAQ,CAAC,0BAA0B,CAAC;YACjD,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CACpC,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;gBAChD,MAAM,IAAI,GAA0B,EAAE,MAAM,EAAE,CAAC;gBAC/C,OAAO,YAAY,CAAC,MAAM,4BAA4B,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;YAC9E,CAAC,CAAC;SACT,CAAC;KACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `clean_implode_directives` handler — strip `props.source.props.*.implode`
|
|
3
|
+
* directives from an element binding via REST round-trip.
|
|
4
|
+
*
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { type RestClient } from '../../client.js';
|
|
9
|
+
import { type ToolResult } from '../tool-builder.js';
|
|
10
|
+
export declare const CLEAN_IMPLODE_OUTPUT_SCHEMA: z.ZodObject<{
|
|
11
|
+
template_id: z.ZodString;
|
|
12
|
+
element_path: z.ZodString;
|
|
13
|
+
cleaned_count: z.ZodNumber;
|
|
14
|
+
removed_directives: z.ZodArray<z.ZodObject<{
|
|
15
|
+
prop_name: z.ZodString;
|
|
16
|
+
directive: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
new_etag: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export interface CleanImplodeHandlerDeps {
|
|
21
|
+
readonly client: RestClient;
|
|
22
|
+
}
|
|
23
|
+
export declare function handleCleanImplodeDirectives({ client }: CleanImplodeHandlerDeps, { template_id, element_path, etag, }: {
|
|
24
|
+
template_id: string;
|
|
25
|
+
element_path: string;
|
|
26
|
+
etag: string;
|
|
27
|
+
}): Promise<ToolResult>;
|
|
28
|
+
//# sourceMappingURL=clean-implode-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean-implode-handler.d.ts","sourceRoot":"","sources":["../../../src/tools/multi-items/clean-implode-handler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhG,eAAO,MAAM,2BAA2B;;;;;;;;;iBAWtC,CAAC;AAEH,MAAM,WAAW,uBAAuB;IACpC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC/B;AAED,wBAAsB,4BAA4B,CAC9C,EAAE,MAAM,EAAE,EAAE,uBAAuB,EACnC,EACI,WAAW,EACX,YAAY,EACZ,IAAI,GACP,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/D,OAAO,CAAC,UAAU,CAAC,CAsBrB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `clean_implode_directives` handler — strip `props.source.props.*.implode`
|
|
3
|
+
* directives from an element binding via REST round-trip.
|
|
4
|
+
*
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { encodeElementPath } from '../../client.js';
|
|
9
|
+
import { errorResult, jsonResult, structuredResult } from '../tool-builder.js';
|
|
10
|
+
export const CLEAN_IMPLODE_OUTPUT_SCHEMA = z.object({
|
|
11
|
+
template_id: z.string(),
|
|
12
|
+
element_path: z.string(),
|
|
13
|
+
cleaned_count: z.number(),
|
|
14
|
+
removed_directives: z.array(z.object({
|
|
15
|
+
prop_name: z.string(),
|
|
16
|
+
directive: z.record(z.string(), z.unknown()),
|
|
17
|
+
})),
|
|
18
|
+
new_etag: z.string(),
|
|
19
|
+
});
|
|
20
|
+
export async function handleCleanImplodeDirectives({ client }, { template_id, element_path, etag, }) {
|
|
21
|
+
const encoded = encodeElementPath(element_path);
|
|
22
|
+
try {
|
|
23
|
+
const data = await client.post(`/pages/${encodeURIComponent(template_id)}/elements/${encoded}/multi-items/clean-implode`, { body: {}, etag });
|
|
24
|
+
// The REST endpoint returns the canonical CLEAN_IMPLODE_OUTPUT_SCHEMA
|
|
25
|
+
// shape ({template_id, element_path, cleaned_count, removed_directives,
|
|
26
|
+
// new_etag}) — pass it through as structuredContent so the declared
|
|
27
|
+
// outputSchema is satisfied (a tool with an outputSchema MUST emit
|
|
28
|
+
// structuredContent, else the MCP SDK rejects with -32602).
|
|
29
|
+
return structuredResult(jsonResult(data), data);
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
return errorResult({
|
|
33
|
+
error: e,
|
|
34
|
+
context: { template_id, element_path },
|
|
35
|
+
hint: 'On 412 refresh via yootheme_builder_get_etag and retry. On 404 verify the ' +
|
|
36
|
+
'element_path via yootheme_builder_element_list.',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=clean-implode-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean-implode-handler.js","sourceRoot":"","sources":["../../../src/tools/multi-items/clean-implode-handler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAmB,MAAM,oBAAoB,CAAC;AAEhG,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,kBAAkB,EAAE,CAAC,CAAC,KAAK,CACvB,CAAC,CAAC,MAAM,CAAC;QACL,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;KAC/C,CAAC,CACL;IACD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAMH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAC9C,EAAE,MAAM,EAA2B,EACnC,EACI,WAAW,EACX,YAAY,EACZ,IAAI,GACsD;IAE9D,MAAM,OAAO,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAChD,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAC1B,UAAU,kBAAkB,CAAC,WAAW,CAAC,aAAa,OAAO,4BAA4B,EACzF,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CACrB,CAAC;QACF,sEAAsE;QACtE,wEAAwE;QACxE,oEAAoE;QACpE,mEAAmE;QACnE,4DAA4D;QAC5D,OAAO,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,OAAO,WAAW,CAAC;YACf,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE;YACtC,IAAI,EACA,4EAA4E;gBAC5E,iDAAiD;SACxD,CAAC,CAAC;IACP,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-Items tool barrel — public entry-point for the YT-Pro
|
|
3
|
+
* Multi-Items binding pattern tools.
|
|
4
|
+
*
|
|
5
|
+
* yootheme_builder_inspect_multi_items_binding
|
|
6
|
+
* → Report the Multi-Items binding state for an element.
|
|
7
|
+
*
|
|
8
|
+
* yootheme_builder_clean_implode_directives
|
|
9
|
+
* → Remove legacy implode directives from an element binding.
|
|
10
|
+
*
|
|
11
|
+
* The canonical container ↔ item map lives in `./item-container-map.ts`
|
|
12
|
+
* (mirror of `WootsUp\BuilderMcp\Elements\ItemContainerMap`).
|
|
13
|
+
*
|
|
14
|
+
* @license MIT
|
|
15
|
+
*/
|
|
16
|
+
export { buildMultiItemsTools } from './builders.js';
|
|
17
|
+
export { ITEM_CHILDREN_OF_CONTAINER, containerOf, isContainer, isItem, itemOf, } from './item-container-map.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/multi-items/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACH,0BAA0B,EAC1B,WAAW,EACX,WAAW,EACX,MAAM,EACN,MAAM,GACT,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-Items tool barrel — public entry-point for the YT-Pro
|
|
3
|
+
* Multi-Items binding pattern tools.
|
|
4
|
+
*
|
|
5
|
+
* yootheme_builder_inspect_multi_items_binding
|
|
6
|
+
* → Report the Multi-Items binding state for an element.
|
|
7
|
+
*
|
|
8
|
+
* yootheme_builder_clean_implode_directives
|
|
9
|
+
* → Remove legacy implode directives from an element binding.
|
|
10
|
+
*
|
|
11
|
+
* The canonical container ↔ item map lives in `./item-container-map.ts`
|
|
12
|
+
* (mirror of `WootsUp\BuilderMcp\Elements\ItemContainerMap`).
|
|
13
|
+
*
|
|
14
|
+
* @license MIT
|
|
15
|
+
*/
|
|
16
|
+
export { buildMultiItemsTools } from './builders.js';
|
|
17
|
+
export { ITEM_CHILDREN_OF_CONTAINER, containerOf, isContainer, isItem, itemOf, } from './item-container-map.js';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/multi-items/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACH,0BAA0B,EAC1B,WAAW,EACX,WAAW,EACX,MAAM,EACN,MAAM,GACT,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `inspect_multi_items_binding` handler — surfaces Multi-Items binding
|
|
3
|
+
* state on an element via REST round-trip.
|
|
4
|
+
*
|
|
5
|
+
* Companion of the PHP `MultiItemsInspector` — see
|
|
6
|
+
* src/modules/builder-source-binding/src/MultiItemsInspector.php
|
|
7
|
+
* for the report shape.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
import { type RestClient } from '../../client.js';
|
|
13
|
+
import { type ToolResult } from '../tool-builder.js';
|
|
14
|
+
export declare const INSPECT_MULTI_ITEMS_OUTPUT_SCHEMA: z.ZodObject<{
|
|
15
|
+
template_id: z.ZodString;
|
|
16
|
+
report: z.ZodObject<{
|
|
17
|
+
element_path: z.ZodString;
|
|
18
|
+
element_type: z.ZodString;
|
|
19
|
+
is_container: z.ZodBoolean;
|
|
20
|
+
is_item: z.ZodBoolean;
|
|
21
|
+
container_type: z.ZodNullable<z.ZodString>;
|
|
22
|
+
item_type: z.ZodNullable<z.ZodString>;
|
|
23
|
+
current_binding_level: z.ZodEnum<{
|
|
24
|
+
none: "none";
|
|
25
|
+
container: "container";
|
|
26
|
+
item: "item";
|
|
27
|
+
}>;
|
|
28
|
+
has_implode_directives: z.ZodBoolean;
|
|
29
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
30
|
+
recommended_fix: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
etag: z.ZodString;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export interface MultiItemsHandlerDeps {
|
|
35
|
+
readonly client: RestClient;
|
|
36
|
+
}
|
|
37
|
+
export declare function handleInspectMultiItemsBinding({ client }: MultiItemsHandlerDeps, { template_id, element_path }: {
|
|
38
|
+
template_id: string;
|
|
39
|
+
element_path: string;
|
|
40
|
+
}): Promise<ToolResult>;
|
|
41
|
+
//# sourceMappingURL=inspect-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect-handler.d.ts","sourceRoot":"","sources":["../../../src/tools/multi-items/inspect-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhG,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;iBAe5C,CAAC;AAEH,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC/B;AAED,wBAAsB,8BAA8B,CAChD,EAAE,MAAM,EAAE,EAAE,qBAAqB,EACjC,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC7E,OAAO,CAAC,UAAU,CAAC,CAqBrB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `inspect_multi_items_binding` handler — surfaces Multi-Items binding
|
|
3
|
+
* state on an element via REST round-trip.
|
|
4
|
+
*
|
|
5
|
+
* Companion of the PHP `MultiItemsInspector` — see
|
|
6
|
+
* src/modules/builder-source-binding/src/MultiItemsInspector.php
|
|
7
|
+
* for the report shape.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
import { encodeElementPath } from '../../client.js';
|
|
13
|
+
import { errorResult, jsonResult, structuredResult } from '../tool-builder.js';
|
|
14
|
+
export const INSPECT_MULTI_ITEMS_OUTPUT_SCHEMA = z.object({
|
|
15
|
+
template_id: z.string(),
|
|
16
|
+
report: z.object({
|
|
17
|
+
element_path: z.string(),
|
|
18
|
+
element_type: z.string(),
|
|
19
|
+
is_container: z.boolean(),
|
|
20
|
+
is_item: z.boolean(),
|
|
21
|
+
container_type: z.string().nullable(),
|
|
22
|
+
item_type: z.string().nullable(),
|
|
23
|
+
current_binding_level: z.enum(['none', 'container', 'item']),
|
|
24
|
+
has_implode_directives: z.boolean(),
|
|
25
|
+
warning: z.string().optional(),
|
|
26
|
+
recommended_fix: z.string().optional(),
|
|
27
|
+
}),
|
|
28
|
+
etag: z.string(),
|
|
29
|
+
});
|
|
30
|
+
export async function handleInspectMultiItemsBinding({ client }, { template_id, element_path }) {
|
|
31
|
+
const encoded = encodeElementPath(element_path);
|
|
32
|
+
try {
|
|
33
|
+
const data = await client.get(`/pages/${encodeURIComponent(template_id)}/elements/${encoded}/multi-items/inspect`);
|
|
34
|
+
// The REST endpoint already returns the canonical
|
|
35
|
+
// {template_id, report, etag} shape — pass it through as
|
|
36
|
+
// structuredContent so the declared outputSchema is satisfied
|
|
37
|
+
// (a tool with an outputSchema MUST emit structuredContent, else
|
|
38
|
+
// the MCP SDK rejects the call with -32602).
|
|
39
|
+
return structuredResult(jsonResult(data), data);
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
return errorResult({
|
|
43
|
+
error: e,
|
|
44
|
+
context: { template_id, element_path },
|
|
45
|
+
hint: 'Verify element_path via yootheme_builder_element_list. Paths are JSON-Pointer ' +
|
|
46
|
+
'style ("/templates/<id>/layout/children/0").',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=inspect-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect-handler.js","sourceRoot":"","sources":["../../../src/tools/multi-items/inspect-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAmB,MAAM,oBAAoB,CAAC;AAEhG,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE;QACzB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;QACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,qBAAqB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;QAC5D,sBAAsB,EAAE,CAAC,CAAC,OAAO,EAAE;QACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC9B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACzC,CAAC;IACF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAMH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAChD,EAAE,MAAM,EAAyB,EACjC,EAAE,WAAW,EAAE,YAAY,EAAiD;IAE5E,MAAM,OAAO,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAChD,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CACzB,UAAU,kBAAkB,CAAC,WAAW,CAAC,aAAa,OAAO,sBAAsB,CACtF,CAAC;QACF,kDAAkD;QAClD,yDAAyD;QACzD,8DAA8D;QAC9D,iEAAiE;QACjE,6CAA6C;QAC7C,OAAO,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,OAAO,WAAW,CAAC;YACf,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE;YACtC,IAAI,EACA,gFAAgF;gBAChF,8CAA8C;SACrD,CAAC,CAAC;IACP,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 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,14 @@
|
|
|
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) and `./handlers-write.ts` (page_save,
|
|
7
|
+
* page_publish — 3-phase progress contract).
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
import type { ClientPool } from '../../sites/client-pool.js';
|
|
12
|
+
import { type AnyToolDefinition } from '../tool-builder.js';
|
|
13
|
+
export declare function buildPagesTools(pool: ClientPool): readonly AnyToolDefinition[];
|
|
14
|
+
//# 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;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI7D,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAC;AA6B5B,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,iBAAiB,EAAE,CA2H9E"}
|