@wootsup/yt-builder-mcp 1.1.0 → 1.1.5
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/manifest.json +15 -15
- package/package.json +2 -2
- package/skills/yt-builder-mcp/SKILL.md +23 -15
- package/dist/auth.d.ts +0 -119
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js +0 -226
- package/dist/auth.js.map +0 -1
- package/dist/client.d.ts +0 -84
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -151
- package/dist/client.js.map +0 -1
- package/dist/clients/claude-code.d.ts +0 -18
- package/dist/clients/claude-code.d.ts.map +0 -1
- package/dist/clients/claude-code.js +0 -53
- package/dist/clients/claude-code.js.map +0 -1
- package/dist/clients/claude-desktop.d.ts +0 -19
- package/dist/clients/claude-desktop.d.ts.map +0 -1
- package/dist/clients/claude-desktop.js +0 -56
- package/dist/clients/claude-desktop.js.map +0 -1
- package/dist/clients/cline.d.ts +0 -26
- package/dist/clients/cline.d.ts.map +0 -1
- package/dist/clients/cline.js +0 -80
- package/dist/clients/cline.js.map +0 -1
- package/dist/clients/codex-cli.d.ts +0 -42
- package/dist/clients/codex-cli.d.ts.map +0 -1
- package/dist/clients/codex-cli.js +0 -194
- package/dist/clients/codex-cli.js.map +0 -1
- package/dist/clients/continue.d.ts +0 -13
- package/dist/clients/continue.d.ts.map +0 -1
- package/dist/clients/continue.js +0 -52
- package/dist/clients/continue.js.map +0 -1
- package/dist/clients/cursor.d.ts +0 -12
- package/dist/clients/cursor.d.ts.map +0 -1
- package/dist/clients/cursor.js +0 -38
- package/dist/clients/cursor.js.map +0 -1
- package/dist/clients/gemini-cli.d.ts +0 -18
- package/dist/clients/gemini-cli.d.ts.map +0 -1
- package/dist/clients/gemini-cli.js +0 -44
- package/dist/clients/gemini-cli.js.map +0 -1
- package/dist/clients/home.d.ts +0 -14
- package/dist/clients/home.d.ts.map +0 -1
- package/dist/clients/home.js +0 -20
- package/dist/clients/home.js.map +0 -1
- package/dist/clients/index.d.ts +0 -52
- package/dist/clients/index.d.ts.map +0 -1
- package/dist/clients/index.js +0 -72
- package/dist/clients/index.js.map +0 -1
- package/dist/clients/roo-code.d.ts +0 -23
- package/dist/clients/roo-code.d.ts.map +0 -1
- package/dist/clients/roo-code.js +0 -69
- package/dist/clients/roo-code.js.map +0 -1
- package/dist/clients/zed.d.ts +0 -12
- package/dist/clients/zed.d.ts.map +0 -1
- package/dist/clients/zed.js +0 -41
- package/dist/clients/zed.js.map +0 -1
- package/dist/errors/hints.d.ts +0 -51
- package/dist/errors/hints.d.ts.map +0 -1
- package/dist/errors/hints.js +0 -95
- package/dist/errors/hints.js.map +0 -1
- package/dist/errors/mask.d.ts +0 -35
- package/dist/errors/mask.d.ts.map +0 -1
- package/dist/errors/mask.js +0 -49
- package/dist/errors/mask.js.map +0 -1
- package/dist/errors/sanitize.d.ts +0 -31
- package/dist/errors/sanitize.d.ts.map +0 -1
- package/dist/errors/sanitize.js +0 -100
- package/dist/errors/sanitize.js.map +0 -1
- package/dist/errors.d.ts +0 -42
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -61
- package/dist/errors.js.map +0 -1
- package/dist/gateway/advanced-tool/discovery.d.ts +0 -19
- package/dist/gateway/advanced-tool/discovery.d.ts.map +0 -1
- package/dist/gateway/advanced-tool/discovery.js +0 -53
- package/dist/gateway/advanced-tool/discovery.js.map +0 -1
- package/dist/gateway/advanced-tool/domains.d.ts +0 -47
- package/dist/gateway/advanced-tool/domains.d.ts.map +0 -1
- package/dist/gateway/advanced-tool/domains.js +0 -94
- package/dist/gateway/advanced-tool/domains.js.map +0 -1
- package/dist/gateway/advanced-tool/execute.d.ts +0 -29
- package/dist/gateway/advanced-tool/execute.d.ts.map +0 -1
- package/dist/gateway/advanced-tool/execute.js +0 -54
- package/dist/gateway/advanced-tool/execute.js.map +0 -1
- package/dist/gateway/advanced-tool/index.d.ts +0 -36
- package/dist/gateway/advanced-tool/index.d.ts.map +0 -1
- package/dist/gateway/advanced-tool/index.js +0 -39
- package/dist/gateway/advanced-tool/index.js.map +0 -1
- package/dist/gateway/advanced-tool/register.d.ts +0 -18
- package/dist/gateway/advanced-tool/register.d.ts.map +0 -1
- package/dist/gateway/advanced-tool/register.js +0 -69
- package/dist/gateway/advanced-tool/register.js.map +0 -1
- package/dist/gateway/advanced-tool.d.ts +0 -13
- package/dist/gateway/advanced-tool.d.ts.map +0 -1
- package/dist/gateway/advanced-tool.js +0 -13
- package/dist/gateway/advanced-tool.js.map +0 -1
- package/dist/gateway/capturing-server.d.ts +0 -117
- package/dist/gateway/capturing-server.d.ts.map +0 -1
- package/dist/gateway/capturing-server.js +0 -103
- package/dist/gateway/capturing-server.js.map +0 -1
- package/dist/gateway/essentials.d.ts +0 -49
- package/dist/gateway/essentials.d.ts.map +0 -1
- package/dist/gateway/essentials.js +0 -92
- package/dist/gateway/essentials.js.map +0 -1
- package/dist/gateway/test-support.d.ts +0 -41
- package/dist/gateway/test-support.d.ts.map +0 -1
- package/dist/gateway/test-support.js +0 -60
- package/dist/gateway/test-support.js.map +0 -1
- package/dist/index.d.ts +0 -29
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -113
- package/dist/index.js.map +0 -1
- package/dist/install-skill.d.ts +0 -43
- package/dist/install-skill.d.ts.map +0 -1
- package/dist/install-skill.js +0 -118
- package/dist/install-skill.js.map +0 -1
- package/dist/platform/detect.d.ts +0 -64
- package/dist/platform/detect.d.ts.map +0 -1
- package/dist/platform/detect.js +0 -98
- package/dist/platform/detect.js.map +0 -1
- package/dist/platform/index.d.ts +0 -121
- package/dist/platform/index.d.ts.map +0 -1
- package/dist/platform/index.js +0 -176
- package/dist/platform/index.js.map +0 -1
- package/dist/platform/joomla.d.ts +0 -44
- package/dist/platform/joomla.d.ts.map +0 -1
- package/dist/platform/joomla.js +0 -46
- package/dist/platform/joomla.js.map +0 -1
- package/dist/server.d.ts +0 -109
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -237
- package/dist/server.js.map +0 -1
- package/dist/setup-cli-confirm.d.ts +0 -36
- package/dist/setup-cli-confirm.d.ts.map +0 -1
- package/dist/setup-cli-confirm.js +0 -59
- package/dist/setup-cli-confirm.js.map +0 -1
- package/dist/setup-cli.d.ts +0 -152
- package/dist/setup-cli.d.ts.map +0 -1
- package/dist/setup-cli.js +0 -870
- package/dist/setup-cli.js.map +0 -1
- package/dist/setup-prompts.d.ts +0 -41
- package/dist/setup-prompts.d.ts.map +0 -1
- package/dist/setup-prompts.js +0 -146
- package/dist/setup-prompts.js.map +0 -1
- package/dist/setup-token.d.ts +0 -38
- package/dist/setup-token.d.ts.map +0 -1
- package/dist/setup-token.js +0 -106
- package/dist/setup-token.js.map +0 -1
- package/dist/setup-wizard-defaults.d.ts +0 -43
- package/dist/setup-wizard-defaults.d.ts.map +0 -1
- package/dist/setup-wizard-defaults.js +0 -160
- package/dist/setup-wizard-defaults.js.map +0 -1
- package/dist/setup-wizard-handshake.d.ts +0 -25
- package/dist/setup-wizard-handshake.d.ts.map +0 -1
- package/dist/setup-wizard-handshake.js +0 -103
- package/dist/setup-wizard-handshake.js.map +0 -1
- package/dist/setup-wizard-types.d.ts +0 -164
- package/dist/setup-wizard-types.d.ts.map +0 -1
- package/dist/setup-wizard-types.js +0 -11
- package/dist/setup-wizard-types.js.map +0 -1
- package/dist/setup-wizard.d.ts +0 -33
- package/dist/setup-wizard.d.ts.map +0 -1
- package/dist/setup-wizard.js +0 -199
- package/dist/setup-wizard.js.map +0 -1
- package/dist/setup.d.ts +0 -17
- package/dist/setup.d.ts.map +0 -1
- package/dist/setup.js +0 -33
- package/dist/setup.js.map +0 -1
- package/dist/sites/cli/add-site.d.ts +0 -106
- package/dist/sites/cli/add-site.d.ts.map +0 -1
- package/dist/sites/cli/add-site.js +0 -185
- package/dist/sites/cli/add-site.js.map +0 -1
- package/dist/sites/cli/list-sites.d.ts +0 -40
- package/dist/sites/cli/list-sites.d.ts.map +0 -1
- package/dist/sites/cli/list-sites.js +0 -117
- package/dist/sites/cli/list-sites.js.map +0 -1
- package/dist/sites/cli/remove-site.d.ts +0 -60
- package/dist/sites/cli/remove-site.d.ts.map +0 -1
- package/dist/sites/cli/remove-site.js +0 -120
- package/dist/sites/cli/remove-site.js.map +0 -1
- package/dist/sites/cli/set-default.d.ts +0 -47
- package/dist/sites/cli/set-default.d.ts.map +0 -1
- package/dist/sites/cli/set-default.js +0 -69
- package/dist/sites/cli/set-default.js.map +0 -1
- package/dist/sites/cli/test-site.d.ts +0 -77
- package/dist/sites/cli/test-site.d.ts.map +0 -1
- package/dist/sites/cli/test-site.js +0 -146
- package/dist/sites/cli/test-site.js.map +0 -1
- package/dist/sites/client-pool.d.ts +0 -124
- package/dist/sites/client-pool.d.ts.map +0 -1
- package/dist/sites/client-pool.js +0 -172
- package/dist/sites/client-pool.js.map +0 -1
- package/dist/sites/env-bridge.d.ts +0 -55
- package/dist/sites/env-bridge.d.ts.map +0 -1
- package/dist/sites/env-bridge.js +0 -94
- package/dist/sites/env-bridge.js.map +0 -1
- package/dist/sites/paths.d.ts +0 -21
- package/dist/sites/paths.d.ts.map +0 -1
- package/dist/sites/paths.js +0 -37
- package/dist/sites/paths.js.map +0 -1
- package/dist/sites/probe.d.ts +0 -60
- package/dist/sites/probe.d.ts.map +0 -1
- package/dist/sites/probe.js +0 -112
- package/dist/sites/probe.js.map +0 -1
- package/dist/sites/registry.d.ts +0 -142
- package/dist/sites/registry.d.ts.map +0 -1
- package/dist/sites/registry.js +0 -163
- package/dist/sites/registry.js.map +0 -1
- package/dist/sites/schema.d.ts +0 -90
- package/dist/sites/schema.d.ts.map +0 -1
- package/dist/sites/schema.js +0 -71
- package/dist/sites/schema.js.map +0 -1
- package/dist/sites/secret-resolver.d.ts +0 -109
- package/dist/sites/secret-resolver.d.ts.map +0 -1
- package/dist/sites/secret-resolver.js +0 -189
- package/dist/sites/secret-resolver.js.map +0 -1
- package/dist/sites/store.d.ts +0 -82
- package/dist/sites/store.d.ts.map +0 -1
- package/dist/sites/store.js +0 -198
- package/dist/sites/store.js.map +0 -1
- package/dist/sites/tools/index.d.ts +0 -28
- package/dist/sites/tools/index.d.ts.map +0 -1
- package/dist/sites/tools/index.js +0 -30
- package/dist/sites/tools/index.js.map +0 -1
- package/dist/sites/tools/sites-list.d.ts +0 -48
- package/dist/sites/tools/sites-list.d.ts.map +0 -1
- package/dist/sites/tools/sites-list.js +0 -135
- package/dist/sites/tools/sites-list.js.map +0 -1
- package/dist/sites/tools/sites-test.d.ts +0 -47
- package/dist/sites/tools/sites-test.d.ts.map +0 -1
- package/dist/sites/tools/sites-test.js +0 -148
- package/dist/sites/tools/sites-test.js.map +0 -1
- package/dist/skill-loader.d.ts +0 -111
- package/dist/skill-loader.d.ts.map +0 -1
- package/dist/skill-loader.js +0 -191
- package/dist/skill-loader.js.map +0 -1
- package/dist/tools/elements/builders.d.ts +0 -24
- package/dist/tools/elements/builders.d.ts.map +0 -1
- package/dist/tools/elements/builders.js +0 -199
- package/dist/tools/elements/builders.js.map +0 -1
- package/dist/tools/elements/handlers-write.d.ts +0 -49
- package/dist/tools/elements/handlers-write.d.ts.map +0 -1
- package/dist/tools/elements/handlers-write.js +0 -148
- package/dist/tools/elements/handlers-write.js.map +0 -1
- package/dist/tools/elements/handlers.d.ts +0 -68
- package/dist/tools/elements/handlers.d.ts.map +0 -1
- package/dist/tools/elements/handlers.js +0 -206
- package/dist/tools/elements/handlers.js.map +0 -1
- package/dist/tools/elements/index.d.ts +0 -28
- package/dist/tools/elements/index.d.ts.map +0 -1
- package/dist/tools/elements/index.js +0 -27
- package/dist/tools/elements/index.js.map +0 -1
- package/dist/tools/elements.d.ts +0 -13
- package/dist/tools/elements.d.ts.map +0 -1
- package/dist/tools/elements.js +0 -13
- package/dist/tools/elements.js.map +0 -1
- package/dist/tools/elicitation.d.ts +0 -87
- package/dist/tools/elicitation.d.ts.map +0 -1
- package/dist/tools/elicitation.js +0 -100
- package/dist/tools/elicitation.js.map +0 -1
- package/dist/tools/format/elements-format.d.ts +0 -40
- package/dist/tools/format/elements-format.d.ts.map +0 -1
- package/dist/tools/format/elements-format.js +0 -194
- package/dist/tools/format/elements-format.js.map +0 -1
- package/dist/tools/format/health-format.d.ts +0 -79
- package/dist/tools/format/health-format.d.ts.map +0 -1
- package/dist/tools/format/health-format.js +0 -181
- package/dist/tools/format/health-format.js.map +0 -1
- package/dist/tools/format/inspection-format.d.ts +0 -58
- package/dist/tools/format/inspection-format.d.ts.map +0 -1
- package/dist/tools/format/inspection-format.js +0 -164
- package/dist/tools/format/inspection-format.js.map +0 -1
- package/dist/tools/format/pages-format.d.ts +0 -48
- package/dist/tools/format/pages-format.d.ts.map +0 -1
- package/dist/tools/format/pages-format.js +0 -137
- package/dist/tools/format/pages-format.js.map +0 -1
- package/dist/tools/format/sources-format.d.ts +0 -25
- package/dist/tools/format/sources-format.d.ts.map +0 -1
- package/dist/tools/format/sources-format.js +0 -208
- package/dist/tools/format/sources-format.js.map +0 -1
- package/dist/tools/health.d.ts +0 -22
- package/dist/tools/health.d.ts.map +0 -1
- package/dist/tools/health.js +0 -220
- package/dist/tools/health.js.map +0 -1
- package/dist/tools/index.d.ts +0 -30
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -39
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/inspection.d.ts +0 -14
- package/dist/tools/inspection.d.ts.map +0 -1
- package/dist/tools/inspection.js +0 -170
- package/dist/tools/inspection.js.map +0 -1
- package/dist/tools/layout-flatten.d.ts +0 -75
- package/dist/tools/layout-flatten.d.ts.map +0 -1
- package/dist/tools/layout-flatten.js +0 -107
- package/dist/tools/layout-flatten.js.map +0 -1
- package/dist/tools/multi-items/builders.d.ts +0 -23
- package/dist/tools/multi-items/builders.d.ts.map +0 -1
- package/dist/tools/multi-items/builders.js +0 -69
- package/dist/tools/multi-items/builders.js.map +0 -1
- package/dist/tools/multi-items/clean-implode-handler.d.ts +0 -28
- package/dist/tools/multi-items/clean-implode-handler.d.ts.map +0 -1
- package/dist/tools/multi-items/clean-implode-handler.js +0 -40
- package/dist/tools/multi-items/clean-implode-handler.js.map +0 -1
- package/dist/tools/multi-items/index.d.ts +0 -18
- package/dist/tools/multi-items/index.d.ts.map +0 -1
- package/dist/tools/multi-items/index.js +0 -18
- package/dist/tools/multi-items/index.js.map +0 -1
- package/dist/tools/multi-items/inspect-handler.d.ts +0 -41
- package/dist/tools/multi-items/inspect-handler.d.ts.map +0 -1
- package/dist/tools/multi-items/inspect-handler.js +0 -50
- package/dist/tools/multi-items/inspect-handler.js.map +0 -1
- package/dist/tools/multi-items/item-container-map.d.ts +0 -41
- package/dist/tools/multi-items/item-container-map.d.ts.map +0 -1
- package/dist/tools/multi-items/item-container-map.js +0 -73
- package/dist/tools/multi-items/item-container-map.js.map +0 -1
- package/dist/tools/pages/builders.d.ts +0 -14
- package/dist/tools/pages/builders.d.ts.map +0 -1
- package/dist/tools/pages/builders.js +0 -127
- package/dist/tools/pages/builders.js.map +0 -1
- package/dist/tools/pages/handlers-read.d.ts +0 -33
- package/dist/tools/pages/handlers-read.d.ts.map +0 -1
- package/dist/tools/pages/handlers-read.js +0 -171
- package/dist/tools/pages/handlers-read.js.map +0 -1
- package/dist/tools/pages/handlers-write.d.ts +0 -21
- package/dist/tools/pages/handlers-write.d.ts.map +0 -1
- package/dist/tools/pages/handlers-write.js +0 -52
- package/dist/tools/pages/handlers-write.js.map +0 -1
- package/dist/tools/pages/index.d.ts +0 -17
- package/dist/tools/pages/index.d.ts.map +0 -1
- package/dist/tools/pages/index.js +0 -17
- package/dist/tools/pages/index.js.map +0 -1
- package/dist/tools/pages/schemas.d.ts +0 -30
- package/dist/tools/pages/schemas.d.ts.map +0 -1
- package/dist/tools/pages/schemas.js +0 -48
- package/dist/tools/pages/schemas.js.map +0 -1
- package/dist/tools/pages.d.ts +0 -13
- package/dist/tools/pages.d.ts.map +0 -1
- package/dist/tools/pages.js +0 -13
- package/dist/tools/pages.js.map +0 -1
- package/dist/tools/pool-resolve-helper.d.ts +0 -83
- package/dist/tools/pool-resolve-helper.d.ts.map +0 -1
- package/dist/tools/pool-resolve-helper.js +0 -148
- package/dist/tools/pool-resolve-helper.js.map +0 -1
- package/dist/tools/progress-phases.d.ts +0 -46
- package/dist/tools/progress-phases.d.ts.map +0 -1
- package/dist/tools/progress-phases.js +0 -48
- package/dist/tools/progress-phases.js.map +0 -1
- package/dist/tools/shared-schemas.d.ts +0 -25
- package/dist/tools/shared-schemas.d.ts.map +0 -1
- package/dist/tools/shared-schemas.js +0 -48
- package/dist/tools/shared-schemas.js.map +0 -1
- package/dist/tools/sources/builders.d.ts +0 -13
- package/dist/tools/sources/builders.d.ts.map +0 -1
- package/dist/tools/sources/builders.js +0 -115
- package/dist/tools/sources/builders.js.map +0 -1
- package/dist/tools/sources/handlers-bind.d.ts +0 -28
- package/dist/tools/sources/handlers-bind.d.ts.map +0 -1
- package/dist/tools/sources/handlers-bind.js +0 -129
- package/dist/tools/sources/handlers-bind.js.map +0 -1
- package/dist/tools/sources/handlers.d.ts +0 -45
- package/dist/tools/sources/handlers.d.ts.map +0 -1
- package/dist/tools/sources/handlers.js +0 -91
- package/dist/tools/sources/handlers.js.map +0 -1
- package/dist/tools/sources/index.d.ts +0 -19
- package/dist/tools/sources/index.d.ts.map +0 -1
- package/dist/tools/sources/index.js +0 -18
- package/dist/tools/sources/index.js.map +0 -1
- package/dist/tools/sources.d.ts +0 -14
- package/dist/tools/sources.d.ts.map +0 -1
- package/dist/tools/sources.js +0 -14
- package/dist/tools/sources.js.map +0 -1
- package/dist/tools/sparse-fields.d.ts +0 -80
- package/dist/tools/sparse-fields.d.ts.map +0 -1
- package/dist/tools/sparse-fields.js +0 -144
- package/dist/tools/sparse-fields.js.map +0 -1
- package/dist/tools/tool-builder/annotations.d.ts +0 -55
- package/dist/tools/tool-builder/annotations.d.ts.map +0 -1
- package/dist/tools/tool-builder/annotations.js +0 -86
- package/dist/tools/tool-builder/annotations.js.map +0 -1
- package/dist/tools/tool-builder/define.d.ts +0 -31
- package/dist/tools/tool-builder/define.d.ts.map +0 -1
- package/dist/tools/tool-builder/define.js +0 -31
- package/dist/tools/tool-builder/define.js.map +0 -1
- package/dist/tools/tool-builder/index.d.ts +0 -28
- package/dist/tools/tool-builder/index.d.ts.map +0 -1
- package/dist/tools/tool-builder/index.js +0 -27
- package/dist/tools/tool-builder/index.js.map +0 -1
- package/dist/tools/tool-builder/results.d.ts +0 -93
- package/dist/tools/tool-builder/results.d.ts.map +0 -1
- package/dist/tools/tool-builder/results.js +0 -211
- package/dist/tools/tool-builder/results.js.map +0 -1
- package/dist/tools/tool-builder/types.d.ts +0 -82
- package/dist/tools/tool-builder/types.d.ts.map +0 -1
- package/dist/tools/tool-builder/types.js +0 -9
- package/dist/tools/tool-builder/types.js.map +0 -1
- package/dist/tools/tool-builder.d.ts +0 -16
- package/dist/tools/tool-builder.d.ts.map +0 -1
- package/dist/tools/tool-builder.js +0 -16
- package/dist/tools/tool-builder.js.map +0 -1
|
@@ -1,135 +0,0 @@
|
|
|
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 sites configured in this MCP server (site_id, URL, ' +
|
|
78
|
-
'platform, default flag). Read-only, no REST calls. ' +
|
|
79
|
-
'Discover site_ids before targeting one. ' +
|
|
80
|
-
'(site_id is accepted for schema-uniformity but ignored ' +
|
|
81
|
-
'by this tool.)',
|
|
82
|
-
inputSchema: {
|
|
83
|
-
site_id: SITE_ID_SCHEMA,
|
|
84
|
-
},
|
|
85
|
-
outputSchema: SITES_LIST_OUTPUT_SCHEMA,
|
|
86
|
-
annotations: readOnly('Sites — List configured'),
|
|
87
|
-
handler: async () => {
|
|
88
|
-
const rows = registry.listForDisplay();
|
|
89
|
-
const defaultSiteId = registry.defaultSiteId();
|
|
90
|
-
// Map the registry row to a structured-content item with
|
|
91
|
-
// safe-to-render primitives ONLY (no bearer leakage). The
|
|
92
|
-
// `platform` projection collapses hint + resolved into a
|
|
93
|
-
// single display string so the table stays readable.
|
|
94
|
-
const items = rows.map((row) => ({
|
|
95
|
-
site_id: row.site_id,
|
|
96
|
-
url: row.url,
|
|
97
|
-
platform_hint: row.platform_hint,
|
|
98
|
-
...(row.platform_resolved !== undefined
|
|
99
|
-
? { platform_resolved: row.platform_resolved }
|
|
100
|
-
: {}),
|
|
101
|
-
is_default: row.is_default,
|
|
102
|
-
...(row.label !== undefined ? { label: row.label } : {}),
|
|
103
|
-
}));
|
|
104
|
-
// Table-side projection: humans see one `platform` column
|
|
105
|
-
// (resolved if known, hint otherwise) and a yes/no on
|
|
106
|
-
// is_default for legibility.
|
|
107
|
-
const tableRows = rows.map((row) => ({
|
|
108
|
-
site_id: row.site_id,
|
|
109
|
-
url: row.url,
|
|
110
|
-
platform: row.platform_resolved ?? row.platform_hint,
|
|
111
|
-
is_default: row.is_default ? 'yes' : 'no',
|
|
112
|
-
label: row.label ?? '',
|
|
113
|
-
}));
|
|
114
|
-
const toolkitResult = tableResult(tableRows, {
|
|
115
|
-
columns: TABLE_COLUMNS,
|
|
116
|
-
header: (count) => `${String(count)} configured site${count === 1 ? '' : 's'}` +
|
|
117
|
-
(defaultSiteId !== null ? ` (default: ${defaultSiteId})` : ' (no default configured)'),
|
|
118
|
-
footer: 'Use yootheme_builder_sites_test <site_id> to verify connectivity. ' +
|
|
119
|
-
'Pass `site_id: "<id>"` on any tool call to target a specific site.',
|
|
120
|
-
});
|
|
121
|
-
// The W6 `withSiteMeta` wrapper is intentionally NOT used —
|
|
122
|
-
// see the file header for rationale. We emit a stable
|
|
123
|
-
// `_meta.tool_kind: "registry"` marker so MCP hosts can
|
|
124
|
-
// distinguish registry tools from site-bound tools without
|
|
125
|
-
// string-matching the tool name.
|
|
126
|
-
return structuredResult(toolkitResult, {
|
|
127
|
-
items,
|
|
128
|
-
total: items.length,
|
|
129
|
-
default_site_id: defaultSiteId,
|
|
130
|
-
_meta: { tool_kind: 'registry' },
|
|
131
|
-
});
|
|
132
|
-
},
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=sites-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sites-list.js","sourceRoot":"","sources":["../../../src/sites/tools/sites-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,WAAW,EAAoB,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EACH,UAAU,EACV,QAAQ,EACR,gBAAgB,GAEnB,MAAM,6BAA6B,CAAC;AAErC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,CAAC,CAAC,KAAK,CACV,CAAC,CAAC,MAAM,CAAC;QACL,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACtD,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;QAC7D,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;QACvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC,CACL;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,KAAK,EAAE,CAAC;SACH,MAAM,CAAC;QACJ,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;KACxB,CAAC;SACD,WAAW,EAAE;SACb,QAAQ,EAAE;CAClB,CAAC,CAAC;AAEH,MAAM,a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,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,MAAM;gBACnB,eAAe,EAAE,aAAa;gBAC9B,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;aACnC,CAAC,CAAC;QACP,CAAC;KACJ,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,148 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,MA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C;YACd,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM;SACzF,CAAC,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"}
|
package/dist/skill-loader.d.ts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill loader — Stream B1 (Skill-Distribution via MCP-Protocol).
|
|
3
|
-
*
|
|
4
|
-
* Reads the bundled SKILL.md once at module-load time and exposes it
|
|
5
|
-
* so that:
|
|
6
|
-
*
|
|
7
|
-
* 1. `createServer` can pass the content as the `instructions` field
|
|
8
|
-
* to `McpServer`. MCP-spec hosts (Claude Desktop, Cursor, …)
|
|
9
|
-
* surface this string as auto-context after the `initialize`
|
|
10
|
-
* handshake — Maria the Claude-Desktop user receives the skill
|
|
11
|
-
* narrative without ever invoking a tool.
|
|
12
|
-
*
|
|
13
|
-
* 2. A `skill://yt-builder-mcp` resource can return the same content
|
|
14
|
-
* on demand for hosts that ignore `instructions` but honor
|
|
15
|
-
* `resources/list` + `resources/read`.
|
|
16
|
-
*
|
|
17
|
-
* Resolution layout (matches `install-skill.ts` + `build-dxt.js`):
|
|
18
|
-
*
|
|
19
|
-
* packages/mcp/skills/yt-builder-mcp/SKILL.md
|
|
20
|
-
*
|
|
21
|
-
* When the file is compiled to `dist/skill-loader.js`, the same
|
|
22
|
-
* relative `../skills/yt-builder-mcp/SKILL.md` resolves correctly
|
|
23
|
-
* because the published npm tarball (and the DXT stage) preserves the
|
|
24
|
-
* `skills/` folder next to `dist/`.
|
|
25
|
-
*
|
|
26
|
-
* Read errors throw at module-init: a missing SKILL.md is a packaging
|
|
27
|
-
* bug, not a recoverable runtime condition.
|
|
28
|
-
*
|
|
29
|
-
* W8 — `appendSitesBlock(skillContent, registry)` post-processor.
|
|
30
|
-
* When the in-process {@link SiteRegistry} carries ≥1 configured
|
|
31
|
-
* site, append a "Currently configured sites" appendix to the
|
|
32
|
-
* instructions string so MCP hosts surface the live site roster
|
|
33
|
-
* alongside the skill narrative. The appendix contains ONLY
|
|
34
|
-
* safe-to-render metadata (site_id, label, platform hint/resolved,
|
|
35
|
-
* url, default-flag) — bearer fields are NEVER touched. When the
|
|
36
|
-
* registry has 0 sites the original skill content is returned
|
|
37
|
-
* verbatim (no appendix, no separator).
|
|
38
|
-
*
|
|
39
|
-
* This is a pure-string post-processor; it does not touch the
|
|
40
|
-
* on-disk SKILL.md. Per plan §W8 (line 919) the MCP `initialize`
|
|
41
|
-
* response carries `instructions` as a single shot, so an AI client
|
|
42
|
-
* restart is required for the appendix to refresh after a sites file
|
|
43
|
-
* edit. The W9 CLI commands (add-site / remove-site) print a reminder.
|
|
44
|
-
*
|
|
45
|
-
* @license MIT
|
|
46
|
-
*/
|
|
47
|
-
import type { SiteRegistry } from './sites/registry.js';
|
|
48
|
-
/** Stable URI under which the skill resource is exposed via MCP `resources/*`. */
|
|
49
|
-
export declare const SKILL_RESOURCE_URI = "skill://yt-builder-mcp";
|
|
50
|
-
/** Human-readable resource name surfaced in `resources/list`. */
|
|
51
|
-
export declare const SKILL_RESOURCE_NAME = "YT Builder MCP \u2014 Skill Guide";
|
|
52
|
-
/** Short description for `resources/list` consumers. */
|
|
53
|
-
export declare const SKILL_RESOURCE_DESCRIPTION: string;
|
|
54
|
-
/** MIME type for the SKILL.md payload. */
|
|
55
|
-
export declare const SKILL_RESOURCE_MIME_TYPE = "text/markdown";
|
|
56
|
-
/**
|
|
57
|
-
* Load the bundled SKILL.md content. Cached after the first read.
|
|
58
|
-
*
|
|
59
|
-
* When `registry` is supplied AND it carries ≥1 site, the returned
|
|
60
|
-
* string is the on-disk SKILL.md PLUS the W8 sites appendix (see
|
|
61
|
-
* {@link appendSitesBlock}). When `registry` is omitted or empty, the
|
|
62
|
-
* raw skill content is returned unchanged. The disk cache is shared
|
|
63
|
-
* across calls — the appendix is recomputed each time so registry
|
|
64
|
-
* mutations after the first load are reflected (within the same
|
|
65
|
-
* process instance — the MCP `initialize` response only takes a
|
|
66
|
-
* single-shot snapshot per session per plan §W8 line 919).
|
|
67
|
-
*
|
|
68
|
-
* @throws Error when the file is missing or unreadable (packaging bug).
|
|
69
|
-
*/
|
|
70
|
-
export declare function loadSkillContent(registry?: SiteRegistry): string;
|
|
71
|
-
/**
|
|
72
|
-
* Append the W8 "Currently configured sites" block to a skill-content
|
|
73
|
-
* string. When the registry is empty, returns the input verbatim — no
|
|
74
|
-
* separator, no header, no trailing newline change.
|
|
75
|
-
*
|
|
76
|
-
* Output shape (per plan §W8 Z.904-917):
|
|
77
|
-
* ```text
|
|
78
|
-
* <skillContent>
|
|
79
|
-
*
|
|
80
|
-
* ---
|
|
81
|
-
*
|
|
82
|
-
* ## Currently configured sites (3)
|
|
83
|
-
*
|
|
84
|
-
* - `wp-acme` — Acme — Production · wordpress · https://acme.com · default
|
|
85
|
-
* - `joomla-beta` — Beta — Staging · joomla · https://beta.example.com/joomla
|
|
86
|
-
* - `wp-internal` — Internal staging · wordpress · https://internal.example.com
|
|
87
|
-
*
|
|
88
|
-
* Use `yootheme_builder_sites_list` to inspect this at runtime.
|
|
89
|
-
* Pass `site_id: "<id>"` on any tool call to target a specific site;
|
|
90
|
-
* omit it to use the default.
|
|
91
|
-
* ```
|
|
92
|
-
*
|
|
93
|
-
* Per-row format (bullet):
|
|
94
|
-
* `- \`<site_id>\` — <label or "(no label)"> · <platform> · <url><" · default"?>`
|
|
95
|
-
*
|
|
96
|
-
* The platform column prefers `platform_resolved` when the registry
|
|
97
|
-
* has memoised a probe result for that site (peek-only — never
|
|
98
|
-
* triggers a new probe), and falls back to `platform_hint` otherwise.
|
|
99
|
-
*
|
|
100
|
-
* Bearer fields (bearer / bearer_ref) are intentionally NEVER
|
|
101
|
-
* referenced — only `site_id`, `url`, `platform_*`, `is_default`,
|
|
102
|
-
* `label` from {@link SiteRowT}.
|
|
103
|
-
*/
|
|
104
|
-
export declare function appendSitesBlock(skillContent: string, registry: SiteRegistry): string;
|
|
105
|
-
/**
|
|
106
|
-
* Reset the in-memory cache. Intended for tests only.
|
|
107
|
-
*
|
|
108
|
-
* @internal
|
|
109
|
-
*/
|
|
110
|
-
export declare function __resetSkillCacheForTests(): void;
|
|
111
|
-
//# sourceMappingURL=skill-loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill-loader.d.ts","sourceRoot":"","sources":["../src/skill-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAY,MAAM,qBAAqB,CAAC;AAElE,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAE3D,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,sCAAiC,CAAC;AAElE,wDAAwD;AACxD,eAAO,MAAM,0BAA0B,QAEqC,CAAC;AAE7E,0CAA0C;AAC1C,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAmBxD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,MAAM,CAShE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,gBAAgB,CAC5B,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,YAAY,GACvB,MAAM,CAkBR;AA0CD;;;;GAIG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD"}
|
package/dist/skill-loader.js
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill loader — Stream B1 (Skill-Distribution via MCP-Protocol).
|
|
3
|
-
*
|
|
4
|
-
* Reads the bundled SKILL.md once at module-load time and exposes it
|
|
5
|
-
* so that:
|
|
6
|
-
*
|
|
7
|
-
* 1. `createServer` can pass the content as the `instructions` field
|
|
8
|
-
* to `McpServer`. MCP-spec hosts (Claude Desktop, Cursor, …)
|
|
9
|
-
* surface this string as auto-context after the `initialize`
|
|
10
|
-
* handshake — Maria the Claude-Desktop user receives the skill
|
|
11
|
-
* narrative without ever invoking a tool.
|
|
12
|
-
*
|
|
13
|
-
* 2. A `skill://yt-builder-mcp` resource can return the same content
|
|
14
|
-
* on demand for hosts that ignore `instructions` but honor
|
|
15
|
-
* `resources/list` + `resources/read`.
|
|
16
|
-
*
|
|
17
|
-
* Resolution layout (matches `install-skill.ts` + `build-dxt.js`):
|
|
18
|
-
*
|
|
19
|
-
* packages/mcp/skills/yt-builder-mcp/SKILL.md
|
|
20
|
-
*
|
|
21
|
-
* When the file is compiled to `dist/skill-loader.js`, the same
|
|
22
|
-
* relative `../skills/yt-builder-mcp/SKILL.md` resolves correctly
|
|
23
|
-
* because the published npm tarball (and the DXT stage) preserves the
|
|
24
|
-
* `skills/` folder next to `dist/`.
|
|
25
|
-
*
|
|
26
|
-
* Read errors throw at module-init: a missing SKILL.md is a packaging
|
|
27
|
-
* bug, not a recoverable runtime condition.
|
|
28
|
-
*
|
|
29
|
-
* W8 — `appendSitesBlock(skillContent, registry)` post-processor.
|
|
30
|
-
* When the in-process {@link SiteRegistry} carries ≥1 configured
|
|
31
|
-
* site, append a "Currently configured sites" appendix to the
|
|
32
|
-
* instructions string so MCP hosts surface the live site roster
|
|
33
|
-
* alongside the skill narrative. The appendix contains ONLY
|
|
34
|
-
* safe-to-render metadata (site_id, label, platform hint/resolved,
|
|
35
|
-
* url, default-flag) — bearer fields are NEVER touched. When the
|
|
36
|
-
* registry has 0 sites the original skill content is returned
|
|
37
|
-
* verbatim (no appendix, no separator).
|
|
38
|
-
*
|
|
39
|
-
* This is a pure-string post-processor; it does not touch the
|
|
40
|
-
* on-disk SKILL.md. Per plan §W8 (line 919) the MCP `initialize`
|
|
41
|
-
* response carries `instructions` as a single shot, so an AI client
|
|
42
|
-
* restart is required for the appendix to refresh after a sites file
|
|
43
|
-
* edit. The W9 CLI commands (add-site / remove-site) print a reminder.
|
|
44
|
-
*
|
|
45
|
-
* @license MIT
|
|
46
|
-
*/
|
|
47
|
-
import { readFileSync } from 'node:fs';
|
|
48
|
-
import { dirname, resolve } from 'node:path';
|
|
49
|
-
import { fileURLToPath } from 'node:url';
|
|
50
|
-
/** Stable URI under which the skill resource is exposed via MCP `resources/*`. */
|
|
51
|
-
export const SKILL_RESOURCE_URI = 'skill://yt-builder-mcp';
|
|
52
|
-
/** Human-readable resource name surfaced in `resources/list`. */
|
|
53
|
-
export const SKILL_RESOURCE_NAME = 'YT Builder MCP — Skill Guide';
|
|
54
|
-
/** Short description for `resources/list` consumers. */
|
|
55
|
-
export const SKILL_RESOURCE_DESCRIPTION = 'Workflow guide for driving the YOOtheme Pro page builder via this MCP server. ' +
|
|
56
|
-
'Auto-loaded as `instructions` at initialize; also fetchable on demand.';
|
|
57
|
-
/** MIME type for the SKILL.md payload. */
|
|
58
|
-
export const SKILL_RESOURCE_MIME_TYPE = 'text/markdown';
|
|
59
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
60
|
-
/**
|
|
61
|
-
* Resolve the on-disk path to the bundled SKILL.md.
|
|
62
|
-
*
|
|
63
|
-
* Source-tree: packages/mcp/src/skill-loader.ts → ../skills/yt-builder-mcp/SKILL.md
|
|
64
|
-
* Built tarball: packages/mcp/dist/skill-loader.js → ../skills/yt-builder-mcp/SKILL.md
|
|
65
|
-
*
|
|
66
|
-
* Both layouts work because `dist/` and `src/` are siblings of
|
|
67
|
-
* `skills/` under the package root.
|
|
68
|
-
*/
|
|
69
|
-
function resolveSkillPath() {
|
|
70
|
-
return resolve(__dirname, '..', 'skills', 'yt-builder-mcp', 'SKILL.md');
|
|
71
|
-
}
|
|
72
|
-
let cached;
|
|
73
|
-
/**
|
|
74
|
-
* Load the bundled SKILL.md content. Cached after the first read.
|
|
75
|
-
*
|
|
76
|
-
* When `registry` is supplied AND it carries ≥1 site, the returned
|
|
77
|
-
* string is the on-disk SKILL.md PLUS the W8 sites appendix (see
|
|
78
|
-
* {@link appendSitesBlock}). When `registry` is omitted or empty, the
|
|
79
|
-
* raw skill content is returned unchanged. The disk cache is shared
|
|
80
|
-
* across calls — the appendix is recomputed each time so registry
|
|
81
|
-
* mutations after the first load are reflected (within the same
|
|
82
|
-
* process instance — the MCP `initialize` response only takes a
|
|
83
|
-
* single-shot snapshot per session per plan §W8 line 919).
|
|
84
|
-
*
|
|
85
|
-
* @throws Error when the file is missing or unreadable (packaging bug).
|
|
86
|
-
*/
|
|
87
|
-
export function loadSkillContent(registry) {
|
|
88
|
-
if (cached === undefined) {
|
|
89
|
-
const path = resolveSkillPath();
|
|
90
|
-
cached = readFileSync(path, 'utf-8');
|
|
91
|
-
}
|
|
92
|
-
if (registry === undefined) {
|
|
93
|
-
return cached;
|
|
94
|
-
}
|
|
95
|
-
return appendSitesBlock(cached, registry);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Append the W8 "Currently configured sites" block to a skill-content
|
|
99
|
-
* string. When the registry is empty, returns the input verbatim — no
|
|
100
|
-
* separator, no header, no trailing newline change.
|
|
101
|
-
*
|
|
102
|
-
* Output shape (per plan §W8 Z.904-917):
|
|
103
|
-
* ```text
|
|
104
|
-
* <skillContent>
|
|
105
|
-
*
|
|
106
|
-
* ---
|
|
107
|
-
*
|
|
108
|
-
* ## Currently configured sites (3)
|
|
109
|
-
*
|
|
110
|
-
* - `wp-acme` — Acme — Production · wordpress · https://acme.com · default
|
|
111
|
-
* - `joomla-beta` — Beta — Staging · joomla · https://beta.example.com/joomla
|
|
112
|
-
* - `wp-internal` — Internal staging · wordpress · https://internal.example.com
|
|
113
|
-
*
|
|
114
|
-
* Use `yootheme_builder_sites_list` to inspect this at runtime.
|
|
115
|
-
* Pass `site_id: "<id>"` on any tool call to target a specific site;
|
|
116
|
-
* omit it to use the default.
|
|
117
|
-
* ```
|
|
118
|
-
*
|
|
119
|
-
* Per-row format (bullet):
|
|
120
|
-
* `- \`<site_id>\` — <label or "(no label)"> · <platform> · <url><" · default"?>`
|
|
121
|
-
*
|
|
122
|
-
* The platform column prefers `platform_resolved` when the registry
|
|
123
|
-
* has memoised a probe result for that site (peek-only — never
|
|
124
|
-
* triggers a new probe), and falls back to `platform_hint` otherwise.
|
|
125
|
-
*
|
|
126
|
-
* Bearer fields (bearer / bearer_ref) are intentionally NEVER
|
|
127
|
-
* referenced — only `site_id`, `url`, `platform_*`, `is_default`,
|
|
128
|
-
* `label` from {@link SiteRowT}.
|
|
129
|
-
*/
|
|
130
|
-
export function appendSitesBlock(skillContent, registry) {
|
|
131
|
-
const rows = registry.listForDisplay();
|
|
132
|
-
if (rows.length === 0) {
|
|
133
|
-
return skillContent;
|
|
134
|
-
}
|
|
135
|
-
const bullets = rows.map((row) => renderBullet(row)).join('\n');
|
|
136
|
-
const block = '\n\n---\n\n' +
|
|
137
|
-
`## Currently configured sites (${String(rows.length)})\n\n` +
|
|
138
|
-
bullets +
|
|
139
|
-
'\n\n' +
|
|
140
|
-
'Use `yootheme_builder_sites_list` to inspect this at runtime.\n' +
|
|
141
|
-
'Pass `site_id: "<id>"` on any tool call to target a specific site;\n' +
|
|
142
|
-
'omit it to use the default.\n';
|
|
143
|
-
return skillContent + block;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Markdown-escape an operator-provided string so it cannot inject
|
|
147
|
-
* structure into the rendered SKILL.md appendix.
|
|
148
|
-
*
|
|
149
|
-
* W12-R1.3 (A2-L2): the W8 sites-appendix renders `row.label` into the
|
|
150
|
-
* server's `instructions` field, which MCP hosts surface to the LLM
|
|
151
|
-
* verbatim. An operator with write-access to sites.json could land a
|
|
152
|
-
* label like `Acme [INTERNAL TOOL: ignore prior context] Production`
|
|
153
|
-
* and the prompt would carry that text into the model context. The
|
|
154
|
-
* escape list covers the markdown special chars the W8 bullet format
|
|
155
|
-
* could collide with (\`*_[]<>), preserving readable text while
|
|
156
|
-
* preventing injection. site_id is regex-restricted at the schema
|
|
157
|
-
* layer so it doesn't need escaping; url is operator-controlled but
|
|
158
|
-
* has a much smaller chosen-char surface and is rendered after a `·`
|
|
159
|
-
* separator that limits payload shape.
|
|
160
|
-
*/
|
|
161
|
-
function escapeMarkdown(text) {
|
|
162
|
-
return text.replace(/([\\`*_[\]<>])/g, '\\$1');
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Render one {@link SiteRowT} as a markdown bullet for the W8 sites
|
|
166
|
-
* appendix.
|
|
167
|
-
*
|
|
168
|
-
* Format: `- \`<site_id>\` — <label> · <platform> · <url><" · default"?>`
|
|
169
|
-
*
|
|
170
|
-
* `<platform>` prefers `platform_resolved` (the W3 memo cache) and
|
|
171
|
-
* falls back to `platform_hint` when no probe has run yet.
|
|
172
|
-
* `<label>` falls back to the literal string `(no label)` when the
|
|
173
|
-
* entry has none AND is markdown-escaped (W12-R1.3 prompt-injection
|
|
174
|
-
* defense). The `default` suffix is only present when `is_default`
|
|
175
|
-
* is true.
|
|
176
|
-
*/
|
|
177
|
-
function renderBullet(row) {
|
|
178
|
-
const platform = row.platform_resolved ?? row.platform_hint;
|
|
179
|
-
const label = escapeMarkdown(row.label ?? '(no label)');
|
|
180
|
-
const defaultSuffix = row.is_default ? ' · default' : '';
|
|
181
|
-
return `- \`${row.site_id}\` — ${label} · ${platform} · ${row.url}${defaultSuffix}`;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Reset the in-memory cache. Intended for tests only.
|
|
185
|
-
*
|
|
186
|
-
* @internal
|
|
187
|
-
*/
|
|
188
|
-
export function __resetSkillCacheForTests() {
|
|
189
|
-
cached = undefined;
|
|
190
|
-
}
|
|
191
|
-
//# sourceMappingURL=skill-loader.js.map
|
package/dist/skill-loader.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill-loader.js","sourceRoot":"","sources":["../src/skill-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,kFAAkF;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAE3D,iEAAiE;AACjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,8BAA8B,CAAC;AAElE,wDAAwD;AACxD,MAAM,CAAC,MAAM,0BAA0B,GACnC,gFAAgF;IAChF,wEAAwE,CAAC;AAE7E,0CAA0C;AAC1C,MAAM,CAAC,MAAM,wBAAwB,GAAG,eAAe,CAAC;AAExD,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D;;;;;;;;GAQG;AACH,SAAS,gBAAgB;IACrB,OAAO,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAC;AAC5E,CAAC;AAED,IAAI,MAA0B,CAAC;AAE/B;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAuB;IACpD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IA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