@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,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* W7 — `yootheme_builder_sites_list` L1 tool.
|
|
3
|
+
*
|
|
4
|
+
* Platform-agnostic registry inspection: lists the in-process
|
|
5
|
+
* {@link SiteRegistry} as a tabular result so an agent (or a Maria-class
|
|
6
|
+
* Claude-Desktop user) can discover which site_ids are wired into this
|
|
7
|
+
* MCP server WITHOUT a network round-trip.
|
|
8
|
+
*
|
|
9
|
+
* Why it does NOT call `pool.resolve()`:
|
|
10
|
+
* - The tool reads the registry verbatim and never touches bearers, the
|
|
11
|
+
* secret-resolver, or any HTTP endpoint. Resolving through the pool
|
|
12
|
+
* would force a default-site requirement that is exactly the
|
|
13
|
+
* bootstrap failure-mode the tool is meant to diagnose ("I added
|
|
14
|
+
* sites but forgot to mark a default"). For the same reason the
|
|
15
|
+
* handler intentionally skips `withSiteMeta` — there is no resolved
|
|
16
|
+
* site to stamp; instead we emit a `structuredContent._meta.tool_kind
|
|
17
|
+
* = 'registry'` marker so MCP hosts can route the result through a
|
|
18
|
+
* registry-aware UI if/when they grow one.
|
|
19
|
+
*
|
|
20
|
+
* Why `site_id` is exposed but unused:
|
|
21
|
+
* - The W5 SITE_ID_SCHEMA pin requires EVERY tool to expose the
|
|
22
|
+
* optional `site_id` field so legacy/scripted callers never trip a
|
|
23
|
+
* Zod parse on an extra-property. The W12-R1.3 DESCRIPTION_SUFFIX_EXEMPT
|
|
24
|
+
* list opts this tool out of the canonical description suffix
|
|
25
|
+
* because "operates on the default site" would imply per-row
|
|
26
|
+
* filtering that the handler does not perform.
|
|
27
|
+
*
|
|
28
|
+
* W12-R1.3 (A2-L4): `bearer_source` was previously projected into the
|
|
29
|
+
* output row + table column. Even though it carried only the literal
|
|
30
|
+
* `'plain'` / `'op'`, the `sites://current` resource already omits
|
|
31
|
+
* this field (see ADR rationale in server.ts) and the tool surface
|
|
32
|
+
* should match for cross-surface consistency. The field is dropped
|
|
33
|
+
* from both the structured row AND the table column.
|
|
34
|
+
*
|
|
35
|
+
* @license MIT
|
|
36
|
+
*/
|
|
37
|
+
import { tableResult } from '@getimo/mcp-toolkit';
|
|
38
|
+
import { z } from 'zod';
|
|
39
|
+
import { SITE_ID_SCHEMA } from '../../tools/shared-schemas.js';
|
|
40
|
+
import { defineTool, readOnly, structuredResult, } from '../../tools/tool-builder.js';
|
|
41
|
+
const SITES_LIST_OUTPUT_SCHEMA = z.object({
|
|
42
|
+
items: z.array(z.object({
|
|
43
|
+
site_id: z.string(),
|
|
44
|
+
url: z.string(),
|
|
45
|
+
platform_hint: z.enum(['wordpress', 'joomla', 'auto']),
|
|
46
|
+
platform_resolved: z.enum(['wordpress', 'joomla']).optional(),
|
|
47
|
+
is_default: z.boolean(),
|
|
48
|
+
label: z.string().optional(),
|
|
49
|
+
})),
|
|
50
|
+
total: z.number(),
|
|
51
|
+
default_site_id: z.string().nullable(),
|
|
52
|
+
_meta: z
|
|
53
|
+
.object({
|
|
54
|
+
tool_kind: z.string(),
|
|
55
|
+
})
|
|
56
|
+
.passthrough()
|
|
57
|
+
.optional(),
|
|
58
|
+
});
|
|
59
|
+
const TABLE_COLUMNS = [
|
|
60
|
+
{ key: 'site_id', label: 'SITE_ID', width: 20 },
|
|
61
|
+
{ key: 'url', label: 'URL', width: 36 },
|
|
62
|
+
{ key: 'platform', label: 'PLATFORM', width: 11 },
|
|
63
|
+
{ key: 'is_default', label: 'DEFAULT', width: 9 },
|
|
64
|
+
{ key: 'label', label: 'LABEL', width: 24 },
|
|
65
|
+
];
|
|
66
|
+
/**
|
|
67
|
+
* Build the W7 `yootheme_builder_sites_list` tool.
|
|
68
|
+
*
|
|
69
|
+
* Signature accepts the {@link SiteRegistry} directly — unlike other
|
|
70
|
+
* tool-builders, it does NOT need the {@link ClientPool} because it
|
|
71
|
+
* never resolves a site. Callers wire `buildSitesListTool(pool.registry)`
|
|
72
|
+
* from the W7 aggregator (`src/sites/tools/index.ts`).
|
|
73
|
+
*/
|
|
74
|
+
export function buildSitesListTool(registry) {
|
|
75
|
+
return defineTool({
|
|
76
|
+
name: 'yootheme_builder_sites_list',
|
|
77
|
+
description: 'List all sites configured in this multi-site MCP installation. ' +
|
|
78
|
+
'Returns site_id + URL + platform (wordpress|joomla) + default flag per row. ' +
|
|
79
|
+
'CALL THIS FIRST when working with a fresh MCP connection to discover available ' +
|
|
80
|
+
'site_ids before targeting one with any other tool. Read-only, no REST calls. ' +
|
|
81
|
+
'Keywords: list sites, list connections, list installations, discover site_id, ' +
|
|
82
|
+
'available sites, configured sites, what sites exist, multi-site index. ' +
|
|
83
|
+
'(site_id is accepted for schema-uniformity but ignored by this tool.)',
|
|
84
|
+
inputSchema: {
|
|
85
|
+
site_id: SITE_ID_SCHEMA,
|
|
86
|
+
},
|
|
87
|
+
outputSchema: SITES_LIST_OUTPUT_SCHEMA,
|
|
88
|
+
annotations: readOnly('Sites — List configured'),
|
|
89
|
+
handler: async () => {
|
|
90
|
+
const rows = registry.listForDisplay();
|
|
91
|
+
const defaultSiteId = registry.defaultSiteId();
|
|
92
|
+
// Map the registry row to a structured-content item with
|
|
93
|
+
// safe-to-render primitives ONLY (no bearer leakage). The
|
|
94
|
+
// `platform` projection collapses hint + resolved into a
|
|
95
|
+
// single display string so the table stays readable.
|
|
96
|
+
const items = rows.map((row) => ({
|
|
97
|
+
site_id: row.site_id,
|
|
98
|
+
url: row.url,
|
|
99
|
+
platform_hint: row.platform_hint,
|
|
100
|
+
...(row.platform_resolved !== undefined
|
|
101
|
+
? { platform_resolved: row.platform_resolved }
|
|
102
|
+
: {}),
|
|
103
|
+
is_default: row.is_default,
|
|
104
|
+
...(row.label !== undefined ? { label: row.label } : {}),
|
|
105
|
+
}));
|
|
106
|
+
// Table-side projection: humans see one `platform` column
|
|
107
|
+
// (resolved if known, hint otherwise) and a yes/no on
|
|
108
|
+
// is_default for legibility.
|
|
109
|
+
const tableRows = rows.map((row) => ({
|
|
110
|
+
site_id: row.site_id,
|
|
111
|
+
url: row.url,
|
|
112
|
+
platform: row.platform_resolved ?? row.platform_hint,
|
|
113
|
+
is_default: row.is_default ? 'yes' : 'no',
|
|
114
|
+
label: row.label ?? '',
|
|
115
|
+
}));
|
|
116
|
+
const toolkitResult = tableResult(tableRows, {
|
|
117
|
+
columns: TABLE_COLUMNS,
|
|
118
|
+
header: (count) => `${String(count)} configured site${count === 1 ? '' : 's'}` +
|
|
119
|
+
(defaultSiteId !== null ? ` (default: ${defaultSiteId})` : ' (no default configured)'),
|
|
120
|
+
footer: 'Use yootheme_builder_sites_test <site_id> to verify connectivity. ' +
|
|
121
|
+
'Pass `site_id: "<id>"` on any tool call to target a specific site.',
|
|
122
|
+
});
|
|
123
|
+
// The W6 `withSiteMeta` wrapper is intentionally NOT used —
|
|
124
|
+
// see the file header for rationale. We emit a stable
|
|
125
|
+
// `_meta.tool_kind: "registry"` marker so MCP hosts can
|
|
126
|
+
// distinguish registry tools from site-bound tools without
|
|
127
|
+
// string-matching the tool name.
|
|
128
|
+
return structuredResult(toolkitResult, {
|
|
129
|
+
items,
|
|
130
|
+
total: items.length,
|
|
131
|
+
default_site_id: defaultSiteId,
|
|
132
|
+
_meta: { tool_kind: 'registry' },
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=sites-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sites-list.js","sourceRoot":"","sources":["../../../src/sites/tools/sites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nC,CAAC,CAAC;QACP,CAAC;KACJ,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* W7 — `yootheme_builder_sites_test` L1 tool.
|
|
3
|
+
*
|
|
4
|
+
* Targeted connectivity probe for ONE site_id: runs `/health` (no auth
|
|
5
|
+
* required) + `/etag` (auth required) in parallel and returns a
|
|
6
|
+
* structured `{plugin_reachable, bearer_valid, platform, ...}` block.
|
|
7
|
+
*
|
|
8
|
+
* Why `site_id` is REQUIRED here (not optional):
|
|
9
|
+
* - Every other tool in the registry treats `site_id` as an optional
|
|
10
|
+
* selector that falls back to the default. `sites_test` is the
|
|
11
|
+
* exception: its raison d'être is to verify ONE specific id, so the
|
|
12
|
+
* schema upgrades from `.optional()` to required. The W5
|
|
13
|
+
* SITE_ID_SCHEMA pin-test in `tests/tools/site-id-schema.test.ts`
|
|
14
|
+
* explicitly skips this tool from its "every tool's site_id is
|
|
15
|
+
* optional" loop — see the SITES_TEST_EXEMPT_FROM_OPTIONAL set there.
|
|
16
|
+
*
|
|
17
|
+
* Why the result wraps `withSiteMeta`:
|
|
18
|
+
* - Once `pool.resolve(site_id)` succeeds we DO have a resolved-site
|
|
19
|
+
* descriptor, so the text-prefix `[<label> @ <host>] ` is the same
|
|
20
|
+
* site-awareness signal a Maria-class user already sees on every
|
|
21
|
+
* other tool. The W6.2 wrapper handles both green AND red results
|
|
22
|
+
* uniformly (it just stamps; no behaviour difference).
|
|
23
|
+
*
|
|
24
|
+
* Failure modes mapped:
|
|
25
|
+
* - `UnknownSiteError` → structured error `code: 'unknown_site'` with
|
|
26
|
+
* `available[]` hint (via `resolveSiteOrError`).
|
|
27
|
+
* - `NoDefaultSiteError` → cannot fire here because site_id is required
|
|
28
|
+
* and validated by Zod before the handler runs; left in the helper
|
|
29
|
+
* for defense-in-depth.
|
|
30
|
+
* - `/health` rejects → `plugin_reachable: false` + error message.
|
|
31
|
+
* - `/etag` 401/403 → `plugin_reachable: true` + `bearer_valid: false`.
|
|
32
|
+
* - `/etag` other reject → `plugin_reachable: true` + `bearer_valid:
|
|
33
|
+
* false` + raw error.
|
|
34
|
+
*
|
|
35
|
+
* @license MIT
|
|
36
|
+
*/
|
|
37
|
+
import { type AnyToolDefinition } from '../../tools/tool-builder.js';
|
|
38
|
+
import type { ClientPool } from '../client-pool.js';
|
|
39
|
+
/**
|
|
40
|
+
* Build the W7 `yootheme_builder_sites_test` tool.
|
|
41
|
+
*
|
|
42
|
+
* Signature accepts the {@link ClientPool} directly (no separate
|
|
43
|
+
* registry param) — `pool.resolve(site_id)` is the single source of
|
|
44
|
+
* truth and carries the registry inside.
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildSitesTestTool(pool: ClientPool): AnyToolDefinition;
|
|
47
|
+
//# sourceMappingURL=sites-test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sites-test.d.ts","sourceRoot":"","sources":["../../../src/sites/tools/sites-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAQH,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA2BpD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,iBAAiB,CA0DtE"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* W7 — `yootheme_builder_sites_test` L1 tool.
|
|
3
|
+
*
|
|
4
|
+
* Targeted connectivity probe for ONE site_id: runs `/health` (no auth
|
|
5
|
+
* required) + `/etag` (auth required) in parallel and returns a
|
|
6
|
+
* structured `{plugin_reachable, bearer_valid, platform, ...}` block.
|
|
7
|
+
*
|
|
8
|
+
* Why `site_id` is REQUIRED here (not optional):
|
|
9
|
+
* - Every other tool in the registry treats `site_id` as an optional
|
|
10
|
+
* selector that falls back to the default. `sites_test` is the
|
|
11
|
+
* exception: its raison d'être is to verify ONE specific id, so the
|
|
12
|
+
* schema upgrades from `.optional()` to required. The W5
|
|
13
|
+
* SITE_ID_SCHEMA pin-test in `tests/tools/site-id-schema.test.ts`
|
|
14
|
+
* explicitly skips this tool from its "every tool's site_id is
|
|
15
|
+
* optional" loop — see the SITES_TEST_EXEMPT_FROM_OPTIONAL set there.
|
|
16
|
+
*
|
|
17
|
+
* Why the result wraps `withSiteMeta`:
|
|
18
|
+
* - Once `pool.resolve(site_id)` succeeds we DO have a resolved-site
|
|
19
|
+
* descriptor, so the text-prefix `[<label> @ <host>] ` is the same
|
|
20
|
+
* site-awareness signal a Maria-class user already sees on every
|
|
21
|
+
* other tool. The W6.2 wrapper handles both green AND red results
|
|
22
|
+
* uniformly (it just stamps; no behaviour difference).
|
|
23
|
+
*
|
|
24
|
+
* Failure modes mapped:
|
|
25
|
+
* - `UnknownSiteError` → structured error `code: 'unknown_site'` with
|
|
26
|
+
* `available[]` hint (via `resolveSiteOrError`).
|
|
27
|
+
* - `NoDefaultSiteError` → cannot fire here because site_id is required
|
|
28
|
+
* and validated by Zod before the handler runs; left in the helper
|
|
29
|
+
* for defense-in-depth.
|
|
30
|
+
* - `/health` rejects → `plugin_reachable: false` + error message.
|
|
31
|
+
* - `/etag` 401/403 → `plugin_reachable: true` + `bearer_valid: false`.
|
|
32
|
+
* - `/etag` other reject → `plugin_reachable: true` + `bearer_valid:
|
|
33
|
+
* false` + raw error.
|
|
34
|
+
*
|
|
35
|
+
* @license MIT
|
|
36
|
+
*/
|
|
37
|
+
import { detailResult } from '@getimo/mcp-toolkit';
|
|
38
|
+
import { z } from 'zod';
|
|
39
|
+
import { resolveSiteOrError, } from '../../tools/pool-resolve-helper.js';
|
|
40
|
+
import { defineTool, readOnly, structuredResult, withSiteMeta, } from '../../tools/tool-builder.js';
|
|
41
|
+
import { probeSite } from '../probe.js';
|
|
42
|
+
const SITES_TEST_OUTPUT_SCHEMA = z.object({
|
|
43
|
+
site_id: z.string(),
|
|
44
|
+
site_url: z.string(),
|
|
45
|
+
platform: z.enum(['wordpress', 'joomla']),
|
|
46
|
+
plugin_reachable: z.boolean(),
|
|
47
|
+
bearer_valid: z.boolean(),
|
|
48
|
+
etag_received: z.boolean(),
|
|
49
|
+
plugin_error: z.string().optional(),
|
|
50
|
+
bearer_error: z.string().optional(),
|
|
51
|
+
summary: z.string(),
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Build the W7 `yootheme_builder_sites_test` tool.
|
|
55
|
+
*
|
|
56
|
+
* Signature accepts the {@link ClientPool} directly (no separate
|
|
57
|
+
* registry param) — `pool.resolve(site_id)` is the single source of
|
|
58
|
+
* truth and carries the registry inside.
|
|
59
|
+
*/
|
|
60
|
+
export function buildSitesTestTool(pool) {
|
|
61
|
+
return defineTool({
|
|
62
|
+
name: 'yootheme_builder_sites_test',
|
|
63
|
+
description: 'Verify connectivity to ONE site: probes /health (no auth) + ' +
|
|
64
|
+
'/etag (auth) in parallel; returns plugin_reachable + ' +
|
|
65
|
+
'bearer_valid. `site_id` is REQUIRED. Use sites_list to find IDs.',
|
|
66
|
+
inputSchema: {
|
|
67
|
+
site_id: z
|
|
68
|
+
.string()
|
|
69
|
+
.min(1)
|
|
70
|
+
.max(64)
|
|
71
|
+
.regex(/^[a-zA-Z0-9_-]+$/, 'site_id uses letters/digits/dash/underscore only')
|
|
72
|
+
.describe('Site to test (REQUIRED for this tool — overrides default). ' +
|
|
73
|
+
'Use yootheme_builder_sites_list to discover valid IDs.'),
|
|
74
|
+
},
|
|
75
|
+
outputSchema: SITES_TEST_OUTPUT_SCHEMA,
|
|
76
|
+
annotations: readOnly('Sites — Test connectivity'),
|
|
77
|
+
handler: async ({ site_id }) => {
|
|
78
|
+
const r = await resolveSiteOrError(pool, site_id);
|
|
79
|
+
if (!r.ok)
|
|
80
|
+
return r.error;
|
|
81
|
+
const { client: siteClient, site } = r;
|
|
82
|
+
// W12-R1.2: the parallel /health + /etag probe lives in
|
|
83
|
+
// sites/probe.ts so MCP-tool + CLI surfaces stay byte-for-byte
|
|
84
|
+
// in sync. The handler here only maps the structured probe
|
|
85
|
+
// result into the toolkit detail-card envelope and stamps
|
|
86
|
+
// site-awareness via withSiteMeta.
|
|
87
|
+
const probe = await probeSite(siteClient);
|
|
88
|
+
const checks = {
|
|
89
|
+
site_id: site.id,
|
|
90
|
+
site_url: site.url,
|
|
91
|
+
platform: site.platform.kind,
|
|
92
|
+
plugin_reachable: probe.plugin_reachable,
|
|
93
|
+
bearer_valid: probe.bearer_valid,
|
|
94
|
+
etag_received: probe.etag_received,
|
|
95
|
+
summary: probe.summary,
|
|
96
|
+
...(probe.plugin_error !== undefined ? { plugin_error: probe.plugin_error } : {}),
|
|
97
|
+
...(probe.bearer_error !== undefined ? { bearer_error: probe.bearer_error } : {}),
|
|
98
|
+
};
|
|
99
|
+
const toolkitResult = detailResult(buildTestDetail(checks));
|
|
100
|
+
const isError = !(checks.plugin_reachable && checks.bearer_valid);
|
|
101
|
+
const base = structuredResult(toolkitResult, {
|
|
102
|
+
...checks,
|
|
103
|
+
});
|
|
104
|
+
const wrapped = isError
|
|
105
|
+
? { ...base, isError: true }
|
|
106
|
+
: base;
|
|
107
|
+
return withSiteMeta(wrapped, site);
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Render a 2-group detail-card body from the structured `checks`. Group
|
|
113
|
+
* 1 = identity (site_id/url/platform), Group 2 = probe results
|
|
114
|
+
* (plugin_reachable + bearer_valid + etag_received + summary). Keeps the
|
|
115
|
+
* shape stable across green / partial / red so MCP-host Detail-Card
|
|
116
|
+
* renderers don't need to branch.
|
|
117
|
+
*/
|
|
118
|
+
function buildTestDetail(checks) {
|
|
119
|
+
const identityEntries = [
|
|
120
|
+
{ key: 'site_id', label: 'Site ID', value: checks.site_id, format: 'badge' },
|
|
121
|
+
{ key: 'site_url', label: 'Site URL', value: checks.site_url },
|
|
122
|
+
{ key: 'platform', label: 'Platform', value: checks.platform, format: 'badge' },
|
|
123
|
+
];
|
|
124
|
+
const probeEntries = [
|
|
125
|
+
{ key: 'plugin_reachable', label: 'Plugin reachable', value: checks.plugin_reachable, format: 'boolean' },
|
|
126
|
+
{ key: 'bearer_valid', label: 'Bearer valid', value: checks.bearer_valid, format: 'boolean' },
|
|
127
|
+
{ key: 'etag_received', label: 'ETag received', value: checks.etag_received, format: 'boolean' },
|
|
128
|
+
{ key: 'summary', label: 'Summary', value: checks.summary },
|
|
129
|
+
];
|
|
130
|
+
if (checks.plugin_error !== undefined) {
|
|
131
|
+
probeEntries.push({
|
|
132
|
+
key: 'plugin_error', label: 'Plugin error', value: checks.plugin_error, format: 'code',
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
if (checks.bearer_error !== undefined) {
|
|
136
|
+
probeEntries.push({
|
|
137
|
+
key: 'bearer_error', label: 'Bearer error', value: checks.bearer_error, format: 'code',
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
title: 'YT Builder MCP — Sites Test',
|
|
142
|
+
groups: [
|
|
143
|
+
{ label: 'Site', entries: identityEntries },
|
|
144
|
+
{ label: 'Probe', entries: probeEntries },
|
|
145
|
+
],
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=sites-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sites-test.js","sourceRoot":"","sources":["../../../src/sites/tools/sites-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,YAAY,EAAoB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACH,kBAAkB,GACrB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACH,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB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CAAC;IACP,CAAC;IACD,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACpC,YAAY,CAAC,IAAI,CAAC;YACd,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM;SACzF,CAAC,CAAC;IACP,CAAC;IAED,OAAO;QACH,KAAK,EAAE,6BAA6B;QACpC,MAAM,EAAE;YACJ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE;YAC3C,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE;SAC5C;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 3 — `yootheme_builder_use_site` L1 tool.
|
|
3
|
+
*
|
|
4
|
+
* Runtime active-site SWITCH. The multi-site analogue of api-mapper's
|
|
5
|
+
* `apimapper_use_profile`: it changes which configured site subsequent
|
|
6
|
+
* tool calls target by default, then (unless `probe: false`) verifies
|
|
7
|
+
* the new site is reachable.
|
|
8
|
+
*
|
|
9
|
+
* Why a tool (and not just the `site_id` param on every call):
|
|
10
|
+
* - Maria-the-Claude-Desktop-user works in long conversations against
|
|
11
|
+
* ONE client site at a time. Re-passing `site_id` on every call is
|
|
12
|
+
* error-prone. `sites_list` + `use_site` mirror the
|
|
13
|
+
* `list_profiles` + `use_profile` flow she already knows from
|
|
14
|
+
* api-mapper: discover, switch once, then work.
|
|
15
|
+
*
|
|
16
|
+
* How it reuses the existing engine (NO new multi-site machinery):
|
|
17
|
+
* - The {@link SiteRegistry} stays immutable; the switch moves the
|
|
18
|
+
* {@link ClientPool}'s in-memory active-site override
|
|
19
|
+
* (`setActiveSite`). `resolve(undefined)` consults that override
|
|
20
|
+
* before the registry default. Unknown id → `UnknownSiteError`,
|
|
21
|
+
* surfaced as a structured `code: 'unknown_site'` error via the
|
|
22
|
+
* shared `resolveSiteOrError` helper (so the wording matches every
|
|
23
|
+
* other site-bound tool). The pointer never moves on a bad switch.
|
|
24
|
+
* - The reachability check reuses {@link probeSite} (/health + /etag),
|
|
25
|
+
* the SAME probe `sites_test` and the CLI run.
|
|
26
|
+
*
|
|
27
|
+
* Soft-vs-hard contract (mirrors `apimapper_use_profile`):
|
|
28
|
+
* - An UNKNOWN site is a HARD error (pointer unchanged).
|
|
29
|
+
* - A reachable-but-degraded site (probe red) is a SOFT warning: the
|
|
30
|
+
* activation still succeeds and the pointer moves, because the user
|
|
31
|
+
* explicitly asked to switch — the probe is diagnostic, not a gate.
|
|
32
|
+
* `probe: false` skips the network round-trip entirely (offline
|
|
33
|
+
* activation).
|
|
34
|
+
*
|
|
35
|
+
* @license MIT
|
|
36
|
+
*/
|
|
37
|
+
import { type AnyToolDefinition } from '../../tools/tool-builder.js';
|
|
38
|
+
import type { ClientPool } from '../client-pool.js';
|
|
39
|
+
/**
|
|
40
|
+
* Build the Phase 3 `yootheme_builder_use_site` tool.
|
|
41
|
+
*
|
|
42
|
+
* Signature accepts the {@link ClientPool} directly — the switch lives
|
|
43
|
+
* on the pool (`setActiveSite`), and `resolveSiteOrError(pool, site_id)`
|
|
44
|
+
* validates the id + yields the `{client, site}` bundle for the probe.
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildUseSiteTool(pool: ClientPool): AnyToolDefinition;
|
|
47
|
+
//# sourceMappingURL=use-site.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-site.d.ts","sourceRoot":"","sources":["../../../src/sites/tools/use-site.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAKH,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAsBpD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,iBAAiB,CAqGpE"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 3 — `yootheme_builder_use_site` L1 tool.
|
|
3
|
+
*
|
|
4
|
+
* Runtime active-site SWITCH. The multi-site analogue of api-mapper's
|
|
5
|
+
* `apimapper_use_profile`: it changes which configured site subsequent
|
|
6
|
+
* tool calls target by default, then (unless `probe: false`) verifies
|
|
7
|
+
* the new site is reachable.
|
|
8
|
+
*
|
|
9
|
+
* Why a tool (and not just the `site_id` param on every call):
|
|
10
|
+
* - Maria-the-Claude-Desktop-user works in long conversations against
|
|
11
|
+
* ONE client site at a time. Re-passing `site_id` on every call is
|
|
12
|
+
* error-prone. `sites_list` + `use_site` mirror the
|
|
13
|
+
* `list_profiles` + `use_profile` flow she already knows from
|
|
14
|
+
* api-mapper: discover, switch once, then work.
|
|
15
|
+
*
|
|
16
|
+
* How it reuses the existing engine (NO new multi-site machinery):
|
|
17
|
+
* - The {@link SiteRegistry} stays immutable; the switch moves the
|
|
18
|
+
* {@link ClientPool}'s in-memory active-site override
|
|
19
|
+
* (`setActiveSite`). `resolve(undefined)` consults that override
|
|
20
|
+
* before the registry default. Unknown id → `UnknownSiteError`,
|
|
21
|
+
* surfaced as a structured `code: 'unknown_site'` error via the
|
|
22
|
+
* shared `resolveSiteOrError` helper (so the wording matches every
|
|
23
|
+
* other site-bound tool). The pointer never moves on a bad switch.
|
|
24
|
+
* - The reachability check reuses {@link probeSite} (/health + /etag),
|
|
25
|
+
* the SAME probe `sites_test` and the CLI run.
|
|
26
|
+
*
|
|
27
|
+
* Soft-vs-hard contract (mirrors `apimapper_use_profile`):
|
|
28
|
+
* - An UNKNOWN site is a HARD error (pointer unchanged).
|
|
29
|
+
* - A reachable-but-degraded site (probe red) is a SOFT warning: the
|
|
30
|
+
* activation still succeeds and the pointer moves, because the user
|
|
31
|
+
* explicitly asked to switch — the probe is diagnostic, not a gate.
|
|
32
|
+
* `probe: false` skips the network round-trip entirely (offline
|
|
33
|
+
* activation).
|
|
34
|
+
*
|
|
35
|
+
* @license MIT
|
|
36
|
+
*/
|
|
37
|
+
import { detailResult } from '@getimo/mcp-toolkit';
|
|
38
|
+
import { z } from 'zod';
|
|
39
|
+
import { defineTool, mutating, structuredResult, withSiteMeta, } from '../../tools/tool-builder.js';
|
|
40
|
+
import { resolveSiteOrError } from '../../tools/pool-resolve-helper.js';
|
|
41
|
+
import { probeSite } from '../probe.js';
|
|
42
|
+
const USE_SITE_OUTPUT_SCHEMA = z.object({
|
|
43
|
+
activated: z.boolean(),
|
|
44
|
+
active_site_id: z.string(),
|
|
45
|
+
site_url: z.string(),
|
|
46
|
+
platform: z.enum(['wordpress', 'joomla']),
|
|
47
|
+
probe: z
|
|
48
|
+
.object({
|
|
49
|
+
plugin_reachable: z.boolean(),
|
|
50
|
+
bearer_valid: z.boolean(),
|
|
51
|
+
etag_received: z.boolean(),
|
|
52
|
+
summary: z.string(),
|
|
53
|
+
plugin_error: z.string().optional(),
|
|
54
|
+
bearer_error: z.string().optional(),
|
|
55
|
+
})
|
|
56
|
+
.optional(),
|
|
57
|
+
note: z.string().optional(),
|
|
58
|
+
warnings: z.array(z.string()).optional(),
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* Build the Phase 3 `yootheme_builder_use_site` tool.
|
|
62
|
+
*
|
|
63
|
+
* Signature accepts the {@link ClientPool} directly — the switch lives
|
|
64
|
+
* on the pool (`setActiveSite`), and `resolveSiteOrError(pool, site_id)`
|
|
65
|
+
* validates the id + yields the `{client, site}` bundle for the probe.
|
|
66
|
+
*/
|
|
67
|
+
export function buildUseSiteTool(pool) {
|
|
68
|
+
return defineTool({
|
|
69
|
+
name: 'yootheme_builder_use_site',
|
|
70
|
+
description: 'Switch the ACTIVE site for this multi-site session. After this call, ' +
|
|
71
|
+
'every tool that omits `site_id` targets the site you picked here (until ' +
|
|
72
|
+
'you switch again or restart). Runs a /health + /etag probe by default; ' +
|
|
73
|
+
'pass `probe: false` to switch offline. A degraded site is a soft warning ' +
|
|
74
|
+
'(the switch still happens). `site_id` is REQUIRED. Keywords: switch site, ' +
|
|
75
|
+
'change site, set active site, select installation, use profile, activate ' +
|
|
76
|
+
'site, target site. Use yootheme_builder_sites_list first to find IDs.',
|
|
77
|
+
inputSchema: {
|
|
78
|
+
site_id: z
|
|
79
|
+
.string()
|
|
80
|
+
.min(1)
|
|
81
|
+
.max(64)
|
|
82
|
+
.regex(/^[a-zA-Z0-9_-]+$/, 'site_id uses letters/digits/dash/underscore only')
|
|
83
|
+
.describe('Site to make active (REQUIRED, e.g. "wp-acme"). ' +
|
|
84
|
+
'Use yootheme_builder_sites_list to discover valid IDs.'),
|
|
85
|
+
probe: z
|
|
86
|
+
.boolean()
|
|
87
|
+
.default(true)
|
|
88
|
+
.describe('Run the /health + /etag reachability probe after switching ' +
|
|
89
|
+
'(default true). Set false for offline activation when the ' +
|
|
90
|
+
'site is unreachable but you still want to target it.'),
|
|
91
|
+
},
|
|
92
|
+
outputSchema: USE_SITE_OUTPUT_SCHEMA,
|
|
93
|
+
annotations: mutating('Sites — Switch active'),
|
|
94
|
+
handler: async ({ site_id, probe = true }) => {
|
|
95
|
+
// 1. Validate the id through the shared resolver. Unknown /
|
|
96
|
+
// no-default errors come back as structured ToolResults
|
|
97
|
+
// (HARD error). The pointer has NOT moved yet, so a bad id
|
|
98
|
+
// leaves the session on its previous active site.
|
|
99
|
+
const r = await resolveSiteOrError(pool, site_id);
|
|
100
|
+
if (!r.ok)
|
|
101
|
+
return r.error;
|
|
102
|
+
const { client, site } = r;
|
|
103
|
+
// 2. Move the in-memory override. `setActiveSite` re-checks
|
|
104
|
+
// the id exists (defense-in-depth) and throws
|
|
105
|
+
// UnknownSiteError otherwise — but step 1 already
|
|
106
|
+
// guaranteed it, so this is a no-throw in practice.
|
|
107
|
+
pool.setActiveSite(site.id);
|
|
108
|
+
// 3. Offline path — skip the probe entirely.
|
|
109
|
+
if (!probe) {
|
|
110
|
+
const payload = {
|
|
111
|
+
activated: true,
|
|
112
|
+
active_site_id: site.id,
|
|
113
|
+
site_url: site.url,
|
|
114
|
+
platform: site.platform.kind,
|
|
115
|
+
note: 'Reachability probe skipped (probe=false). The active site ' +
|
|
116
|
+
'is now set but its plugin reachability was not verified.',
|
|
117
|
+
};
|
|
118
|
+
const detail = detailResult(buildUseSiteDetail(payload));
|
|
119
|
+
return withSiteMeta(structuredResult(detail, payload), site);
|
|
120
|
+
}
|
|
121
|
+
// 4. Probe the newly-active site. A failing probe is a SOFT
|
|
122
|
+
// warning — the switch already happened in step 2.
|
|
123
|
+
const probeResult = await probeSite(client);
|
|
124
|
+
const warnings = [];
|
|
125
|
+
if (!(probeResult.plugin_reachable && probeResult.bearer_valid)) {
|
|
126
|
+
warnings.push(`Switched to "${site.id}" but the reachability probe was not fully ` +
|
|
127
|
+
`green: ${probeResult.summary} The active site still points here — ` +
|
|
128
|
+
'run yootheme_builder_sites_test for a detailed diagnosis.');
|
|
129
|
+
}
|
|
130
|
+
const payload = {
|
|
131
|
+
activated: true,
|
|
132
|
+
active_site_id: site.id,
|
|
133
|
+
site_url: site.url,
|
|
134
|
+
platform: site.platform.kind,
|
|
135
|
+
probe: {
|
|
136
|
+
plugin_reachable: probeResult.plugin_reachable,
|
|
137
|
+
bearer_valid: probeResult.bearer_valid,
|
|
138
|
+
etag_received: probeResult.etag_received,
|
|
139
|
+
summary: probeResult.summary,
|
|
140
|
+
...(probeResult.plugin_error !== undefined
|
|
141
|
+
? { plugin_error: probeResult.plugin_error }
|
|
142
|
+
: {}),
|
|
143
|
+
...(probeResult.bearer_error !== undefined
|
|
144
|
+
? { bearer_error: probeResult.bearer_error }
|
|
145
|
+
: {}),
|
|
146
|
+
},
|
|
147
|
+
...(warnings.length > 0 ? { warnings } : {}),
|
|
148
|
+
};
|
|
149
|
+
const detail = detailResult(buildUseSiteDetail(payload));
|
|
150
|
+
return withSiteMeta(structuredResult(detail, payload), site);
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Render a detail-card body for the switch result. Group 1 = the active
|
|
156
|
+
* site, Group 2 = the probe outcome (omitted when probe was skipped).
|
|
157
|
+
*/
|
|
158
|
+
function buildUseSiteDetail(payload) {
|
|
159
|
+
const activeEntries = [
|
|
160
|
+
{ key: 'active_site_id', label: 'Active site', value: payload.active_site_id, format: 'badge' },
|
|
161
|
+
{ key: 'site_url', label: 'Site URL', value: payload.site_url },
|
|
162
|
+
{ key: 'platform', label: 'Platform', value: payload.platform, format: 'badge' },
|
|
163
|
+
];
|
|
164
|
+
const groups = [{ label: 'Active site', entries: activeEntries }];
|
|
165
|
+
if (payload.probe !== undefined) {
|
|
166
|
+
groups.push({
|
|
167
|
+
label: 'Probe',
|
|
168
|
+
entries: [
|
|
169
|
+
{ key: 'plugin_reachable', label: 'Plugin reachable', value: payload.probe.plugin_reachable, format: 'boolean' },
|
|
170
|
+
{ key: 'bearer_valid', label: 'Bearer valid', value: payload.probe.bearer_valid, format: 'boolean' },
|
|
171
|
+
{ key: 'summary', label: 'Summary', value: payload.probe.summary },
|
|
172
|
+
],
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
else if (payload.note !== undefined) {
|
|
176
|
+
groups.push({
|
|
177
|
+
label: 'Probe',
|
|
178
|
+
entries: [{ key: 'note', label: 'Note', value: payload.note }],
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
return { title: 'YT Builder MCP — Switch Active Site', groups };
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=use-site.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-site.js","sourceRoot":"","sources":["../../../src/sites/tools/use-site.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,YAAY,EAAoB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,CAAC,EAAE,MAAM,K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