@wootsup/yt-builder-mcp 1.1.0 → 1.1.6
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 +56 -55
- package/manifest.json +15 -15
- package/package.json +2 -2
- package/skills/yt-builder-mcp/SKILL.md +130 -121
- 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
package/dist/platform/index.d.ts
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform abstraction — Wave G.0.
|
|
3
|
-
*
|
|
4
|
-
* A `Platform` is the seam between the MCP server and a host CMS. Today
|
|
5
|
-
* the only concrete impl is `WordPressPlatform`; `joomla` is reserved
|
|
6
|
-
* as a typed seam-marker so Wave G.4+ can land Joomla without rippling
|
|
7
|
-
* through every call site.
|
|
8
|
-
*
|
|
9
|
-
* Why an interface instead of a tagged union?
|
|
10
|
-
* - Each platform owns its REST-namespace path verbatim (WP uses
|
|
11
|
-
* `/wp-json/<ns>`, Joomla will use `/index.php?option=com_ajax&…`).
|
|
12
|
-
* - Adding a platform = implement the interface + add a `PlatformKind`
|
|
13
|
-
* member. No switch statements to update.
|
|
14
|
-
*
|
|
15
|
-
* The `RestClient` accepts EITHER a `Platform` OR the legacy
|
|
16
|
-
* `{baseUrl}` form (which internally builds a `WordPressPlatform`),
|
|
17
|
-
* so existing callers keep working unchanged.
|
|
18
|
-
*
|
|
19
|
-
* @license MIT
|
|
20
|
-
*/
|
|
21
|
-
/** Tagged union of supported host platforms. */
|
|
22
|
-
export type PlatformKind = 'wordpress' | 'joomla';
|
|
23
|
-
/**
|
|
24
|
-
* A `Platform` describes WHERE and HOW the MCP server reaches the
|
|
25
|
-
* REST surface of the host CMS.
|
|
26
|
-
*/
|
|
27
|
-
export interface Platform {
|
|
28
|
-
/** Discriminator for runtime checks. */
|
|
29
|
-
readonly kind: PlatformKind;
|
|
30
|
-
/** Origin (scheme + host + optional port). No trailing-slash normalisation here. */
|
|
31
|
-
readonly baseUrl: string;
|
|
32
|
-
/** Path prefix appended to baseUrl to form the REST root (must start with `/`). */
|
|
33
|
-
readonly restNamespacePath: string;
|
|
34
|
-
}
|
|
35
|
-
/** Canonical WordPress REST-namespace path for this plugin. */
|
|
36
|
-
export declare const WORDPRESS_REST_NAMESPACE_PATH = "/wp-json/yt-builder-mcp/v1";
|
|
37
|
-
/**
|
|
38
|
-
* WordPress platform implementation.
|
|
39
|
-
*
|
|
40
|
-
* `restNamespacePath` is fixed to the plugin's namespace; the caller
|
|
41
|
-
* supplies only the site origin.
|
|
42
|
-
*/
|
|
43
|
-
export declare class WordPressPlatform implements Platform {
|
|
44
|
-
readonly kind: "wordpress";
|
|
45
|
-
readonly baseUrl: string;
|
|
46
|
-
readonly restNamespacePath: string;
|
|
47
|
-
constructor(baseUrl: string);
|
|
48
|
-
}
|
|
49
|
-
export { JoomlaPlatform, JOOMLA_REST_NAMESPACE_PATH } from './joomla.js';
|
|
50
|
-
/**
|
|
51
|
-
* Detect which {@link Platform} a base URL targets based on the URL
|
|
52
|
-
* shape alone (no network call).
|
|
53
|
-
*
|
|
54
|
-
* - pathname starts with `/wp-json/` → `'wordpress'`
|
|
55
|
-
* - pathname starts with `/api/index.php/` → `'joomla'`
|
|
56
|
-
* - otherwise → `null` (ambiguous — caller may probe `/identity`)
|
|
57
|
-
*
|
|
58
|
-
* Round-6 A1 polish: detection switched from `String.includes` to a
|
|
59
|
-
* proper `URL`-parse + `pathname.startsWith` so query-string payloads
|
|
60
|
-
* cannot cause mis-detection (e.g. a Joomla site URL like
|
|
61
|
-
* `https://example.com/?redirect=/wp-json/foo` no longer pretends to
|
|
62
|
-
* be WordPress). Malformed URLs that the `URL` constructor rejects
|
|
63
|
-
* gracefully fall back to the legacy substring scan so callers that
|
|
64
|
-
* accidentally pass a host-only string (e.g. `example.com`) keep
|
|
65
|
-
* working — they would have already failed the actual network call
|
|
66
|
-
* with a clearer error before this function was reached in practice.
|
|
67
|
-
*
|
|
68
|
-
* Cookbook §3.7.1 — the runtime tie-breaker (when this returns `null`)
|
|
69
|
-
* is the `/identity` endpoint, which returns
|
|
70
|
-
* `{ product: 'yt-builder-mcp', platform: 'wordpress'|'joomla', ... }`
|
|
71
|
-
* on both platforms.
|
|
72
|
-
*/
|
|
73
|
-
export declare function detectPlatformFromUrl(url: string): PlatformKind | null;
|
|
74
|
-
/**
|
|
75
|
-
* Construct the right {@link Platform} for a base URL.
|
|
76
|
-
*
|
|
77
|
-
* When the URL shape gives an unambiguous hint via
|
|
78
|
-
* {@link detectPlatformFromUrl}, that wins. Otherwise the caller can
|
|
79
|
-
* pass an explicit `hint` (e.g. from a config flag) or fall back to
|
|
80
|
-
* the default (`'wordpress'` for back-compat — Joomla support landed
|
|
81
|
-
* in Wave 7, so existing WordPress installs never need to flag).
|
|
82
|
-
*
|
|
83
|
-
* Synchronous variant — kept for back-compat with callers that cannot
|
|
84
|
-
* (or do not need to) probe over the network. Prefer
|
|
85
|
-
* {@link platformForUrlAsync} when running in the server boot path:
|
|
86
|
-
* it adds a runtime probe that disambiguates origin-only / subfolder
|
|
87
|
-
* URLs (e.g. `https://example.com/joomla`) where the URL shape alone
|
|
88
|
-
* is silent.
|
|
89
|
-
*/
|
|
90
|
-
export declare function platformForUrl(baseUrl: string, hint?: PlatformKind): Platform;
|
|
91
|
-
/**
|
|
92
|
-
* Async variant of {@link platformForUrl} that adds a runtime probe
|
|
93
|
-
* step for URLs the URL-shape heuristic cannot disambiguate.
|
|
94
|
-
*
|
|
95
|
-
* Resolution order (first match wins):
|
|
96
|
-
* 1. Explicit `hint` from `YTB_MCP_PLATFORM` env var → no probe.
|
|
97
|
-
* 2. URL-shape via {@link detectPlatformFromUrl} (clear `/wp-json/`
|
|
98
|
-
* or `/api/index.php/` marker) → no probe.
|
|
99
|
-
* 3. Runtime probe via `detectPlatformAtRuntime` (the F-Platform-
|
|
100
|
-
* Detect-Probe fix — handles subfolder installs like
|
|
101
|
-
* `https://dev.example.com/joomla` where steps 1+2 return null).
|
|
102
|
-
* 4. Final fallback: `'wordpress'` (back-compat).
|
|
103
|
-
*
|
|
104
|
-
* The probe step is what unblocks origin-only Joomla customers without
|
|
105
|
-
* forcing them to manually set `YTB_MCP_PLATFORM=joomla` — the DXT
|
|
106
|
-
* default of `auto` finally lives up to its name.
|
|
107
|
-
*
|
|
108
|
-
* If both probes fail (server unreachable, plugin not installed, etc.)
|
|
109
|
-
* we fall back to the wordpress default and emit a single stderr note
|
|
110
|
-
* so the customer at least sees *why* the next authenticated call may
|
|
111
|
-
* 404; the real diagnosis still belongs to the first authenticated
|
|
112
|
-
* tool invocation.
|
|
113
|
-
*
|
|
114
|
-
* @param opts.probe Optional probe override (tests / DI).
|
|
115
|
-
* @param opts.logger Optional stderr writer (defaults to `process.stderr.write`).
|
|
116
|
-
*/
|
|
117
|
-
export declare function platformForUrlAsync(baseUrl: string, hint?: PlatformKind, opts?: {
|
|
118
|
-
readonly probe?: (url: string) => Promise<PlatformKind | null>;
|
|
119
|
-
readonly logger?: (msg: string) => void;
|
|
120
|
-
}): Promise<Platform>;
|
|
121
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;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/platform/index.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform abstraction — Wave G.0.
|
|
3
|
-
*
|
|
4
|
-
* A `Platform` is the seam between the MCP server and a host CMS. Today
|
|
5
|
-
* the only concrete impl is `WordPressPlatform`; `joomla` is reserved
|
|
6
|
-
* as a typed seam-marker so Wave G.4+ can land Joomla without rippling
|
|
7
|
-
* through every call site.
|
|
8
|
-
*
|
|
9
|
-
* Why an interface instead of a tagged union?
|
|
10
|
-
* - Each platform owns its REST-namespace path verbatim (WP uses
|
|
11
|
-
* `/wp-json/<ns>`, Joomla will use `/index.php?option=com_ajax&…`).
|
|
12
|
-
* - Adding a platform = implement the interface + add a `PlatformKind`
|
|
13
|
-
* member. No switch statements to update.
|
|
14
|
-
*
|
|
15
|
-
* The `RestClient` accepts EITHER a `Platform` OR the legacy
|
|
16
|
-
* `{baseUrl}` form (which internally builds a `WordPressPlatform`),
|
|
17
|
-
* so existing callers keep working unchanged.
|
|
18
|
-
*
|
|
19
|
-
* @license MIT
|
|
20
|
-
*/
|
|
21
|
-
/** Canonical WordPress REST-namespace path for this plugin. */
|
|
22
|
-
export const WORDPRESS_REST_NAMESPACE_PATH = '/wp-json/yt-builder-mcp/v1';
|
|
23
|
-
/**
|
|
24
|
-
* WordPress platform implementation.
|
|
25
|
-
*
|
|
26
|
-
* `restNamespacePath` is fixed to the plugin's namespace; the caller
|
|
27
|
-
* supplies only the site origin.
|
|
28
|
-
*/
|
|
29
|
-
export class WordPressPlatform {
|
|
30
|
-
kind = 'wordpress';
|
|
31
|
-
baseUrl;
|
|
32
|
-
restNamespacePath;
|
|
33
|
-
constructor(baseUrl) {
|
|
34
|
-
this.baseUrl = baseUrl;
|
|
35
|
-
this.restNamespacePath = WORDPRESS_REST_NAMESPACE_PATH;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// Local import keeps the symbol in scope for `platformForUrl` below;
|
|
39
|
-
// the re-export immediately after surfaces it to outside callers so
|
|
40
|
-
// the platform barrel remains the single import point (cookbook
|
|
41
|
-
// Ch1 Finding 2).
|
|
42
|
-
import { JoomlaPlatform } from './joomla.js';
|
|
43
|
-
export { JoomlaPlatform, JOOMLA_REST_NAMESPACE_PATH } from './joomla.js';
|
|
44
|
-
/**
|
|
45
|
-
* Detect which {@link Platform} a base URL targets based on the URL
|
|
46
|
-
* shape alone (no network call).
|
|
47
|
-
*
|
|
48
|
-
* - pathname starts with `/wp-json/` → `'wordpress'`
|
|
49
|
-
* - pathname starts with `/api/index.php/` → `'joomla'`
|
|
50
|
-
* - otherwise → `null` (ambiguous — caller may probe `/identity`)
|
|
51
|
-
*
|
|
52
|
-
* Round-6 A1 polish: detection switched from `String.includes` to a
|
|
53
|
-
* proper `URL`-parse + `pathname.startsWith` so query-string payloads
|
|
54
|
-
* cannot cause mis-detection (e.g. a Joomla site URL like
|
|
55
|
-
* `https://example.com/?redirect=/wp-json/foo` no longer pretends to
|
|
56
|
-
* be WordPress). Malformed URLs that the `URL` constructor rejects
|
|
57
|
-
* gracefully fall back to the legacy substring scan so callers that
|
|
58
|
-
* accidentally pass a host-only string (e.g. `example.com`) keep
|
|
59
|
-
* working — they would have already failed the actual network call
|
|
60
|
-
* with a clearer error before this function was reached in practice.
|
|
61
|
-
*
|
|
62
|
-
* Cookbook §3.7.1 — the runtime tie-breaker (when this returns `null`)
|
|
63
|
-
* is the `/identity` endpoint, which returns
|
|
64
|
-
* `{ product: 'yt-builder-mcp', platform: 'wordpress'|'joomla', ... }`
|
|
65
|
-
* on both platforms.
|
|
66
|
-
*/
|
|
67
|
-
export function detectPlatformFromUrl(url) {
|
|
68
|
-
let pathname;
|
|
69
|
-
try {
|
|
70
|
-
pathname = new URL(url).pathname;
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
// Fallback for inputs the URL constructor rejects (host-only
|
|
74
|
-
// strings, relative paths). Preserves the legacy substring
|
|
75
|
-
// behaviour as a defensive net.
|
|
76
|
-
if (url.includes('/wp-json/'))
|
|
77
|
-
return 'wordpress';
|
|
78
|
-
if (url.includes('/api/index.php/'))
|
|
79
|
-
return 'joomla';
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
if (pathname.startsWith('/wp-json/'))
|
|
83
|
-
return 'wordpress';
|
|
84
|
-
if (pathname.startsWith('/api/index.php/'))
|
|
85
|
-
return 'joomla';
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Construct the right {@link Platform} for a base URL.
|
|
90
|
-
*
|
|
91
|
-
* When the URL shape gives an unambiguous hint via
|
|
92
|
-
* {@link detectPlatformFromUrl}, that wins. Otherwise the caller can
|
|
93
|
-
* pass an explicit `hint` (e.g. from a config flag) or fall back to
|
|
94
|
-
* the default (`'wordpress'` for back-compat — Joomla support landed
|
|
95
|
-
* in Wave 7, so existing WordPress installs never need to flag).
|
|
96
|
-
*
|
|
97
|
-
* Synchronous variant — kept for back-compat with callers that cannot
|
|
98
|
-
* (or do not need to) probe over the network. Prefer
|
|
99
|
-
* {@link platformForUrlAsync} when running in the server boot path:
|
|
100
|
-
* it adds a runtime probe that disambiguates origin-only / subfolder
|
|
101
|
-
* URLs (e.g. `https://example.com/joomla`) where the URL shape alone
|
|
102
|
-
* is silent.
|
|
103
|
-
*/
|
|
104
|
-
export function platformForUrl(baseUrl, hint) {
|
|
105
|
-
const detected = detectPlatformFromUrl(baseUrl);
|
|
106
|
-
const kind = detected ?? hint ?? 'wordpress';
|
|
107
|
-
return kind === 'joomla'
|
|
108
|
-
? new JoomlaPlatform(baseUrl)
|
|
109
|
-
: new WordPressPlatform(baseUrl);
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Async variant of {@link platformForUrl} that adds a runtime probe
|
|
113
|
-
* step for URLs the URL-shape heuristic cannot disambiguate.
|
|
114
|
-
*
|
|
115
|
-
* Resolution order (first match wins):
|
|
116
|
-
* 1. Explicit `hint` from `YTB_MCP_PLATFORM` env var → no probe.
|
|
117
|
-
* 2. URL-shape via {@link detectPlatformFromUrl} (clear `/wp-json/`
|
|
118
|
-
* or `/api/index.php/` marker) → no probe.
|
|
119
|
-
* 3. Runtime probe via `detectPlatformAtRuntime` (the F-Platform-
|
|
120
|
-
* Detect-Probe fix — handles subfolder installs like
|
|
121
|
-
* `https://dev.example.com/joomla` where steps 1+2 return null).
|
|
122
|
-
* 4. Final fallback: `'wordpress'` (back-compat).
|
|
123
|
-
*
|
|
124
|
-
* The probe step is what unblocks origin-only Joomla customers without
|
|
125
|
-
* forcing them to manually set `YTB_MCP_PLATFORM=joomla` — the DXT
|
|
126
|
-
* default of `auto` finally lives up to its name.
|
|
127
|
-
*
|
|
128
|
-
* If both probes fail (server unreachable, plugin not installed, etc.)
|
|
129
|
-
* we fall back to the wordpress default and emit a single stderr note
|
|
130
|
-
* so the customer at least sees *why* the next authenticated call may
|
|
131
|
-
* 404; the real diagnosis still belongs to the first authenticated
|
|
132
|
-
* tool invocation.
|
|
133
|
-
*
|
|
134
|
-
* @param opts.probe Optional probe override (tests / DI).
|
|
135
|
-
* @param opts.logger Optional stderr writer (defaults to `process.stderr.write`).
|
|
136
|
-
*/
|
|
137
|
-
export async function platformForUrlAsync(baseUrl, hint, opts = {}) {
|
|
138
|
-
// 1. Explicit hint wins — probe-less, by design (user override).
|
|
139
|
-
if (hint !== undefined) {
|
|
140
|
-
return hint === 'joomla'
|
|
141
|
-
? new JoomlaPlatform(baseUrl)
|
|
142
|
-
: new WordPressPlatform(baseUrl);
|
|
143
|
-
}
|
|
144
|
-
// 2. Static URL-shape heuristic.
|
|
145
|
-
const detected = detectPlatformFromUrl(baseUrl);
|
|
146
|
-
if (detected !== null) {
|
|
147
|
-
return detected === 'joomla'
|
|
148
|
-
? new JoomlaPlatform(baseUrl)
|
|
149
|
-
: new WordPressPlatform(baseUrl);
|
|
150
|
-
}
|
|
151
|
-
// 3. Runtime probe. Lazy-imported so the sync `platformForUrl`
|
|
152
|
-
// barrel above stays free of any fetch dependency for callers
|
|
153
|
-
// that do not opt-in.
|
|
154
|
-
const probe = opts.probe
|
|
155
|
-
?? (async (url) => {
|
|
156
|
-
const mod = await import('./detect.js');
|
|
157
|
-
return mod.detectPlatformAtRuntime(url);
|
|
158
|
-
});
|
|
159
|
-
const probed = await probe(baseUrl);
|
|
160
|
-
if (probed !== null) {
|
|
161
|
-
return probed === 'joomla'
|
|
162
|
-
? new JoomlaPlatform(baseUrl)
|
|
163
|
-
: new WordPressPlatform(baseUrl);
|
|
164
|
-
}
|
|
165
|
-
// 4. Final fallback — emit a single soft note so the user knows
|
|
166
|
-
// we tried and that explicit YTB_MCP_PLATFORM may rescue.
|
|
167
|
-
const logger = opts.logger
|
|
168
|
-
?? ((msg) => {
|
|
169
|
-
process.stderr.write(msg);
|
|
170
|
-
});
|
|
171
|
-
logger('[yt-builder-mcp] notice: platform auto-detection probe failed for '
|
|
172
|
-
+ `${baseUrl} — falling back to wordpress. Set YTB_MCP_PLATFORM=joomla `
|
|
173
|
-
+ 'if this is a Joomla install.\n');
|
|
174
|
-
return new WordPressPlatform(baseUrl);
|
|
175
|
-
}
|
|
176
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAkBH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,6BAA6B,GAAG,4BAA4B,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,OAAO,iBAAiB;IACV,IAAI,GAAG,WAAoB,CAAC;IAC5B,OAAO,CAAS;IAChB,iBAAiB,CAAS;IAE1C,YAAY,OAAe;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,iBAAiB,GAAG,6BAA6B,CAAC;IAC3D,CAAC;CACJ;AAED,qEAAqE;AACrE,oEAAoE;AACpE,gEAAgE;AAChE,kBAAkB;AAClB,OAAO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,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Joomla 5/6 platform implementation — Wave 7 prep.
|
|
3
|
-
*
|
|
4
|
-
* Mirrors {@link WordPressPlatform} but targets the Joomla Web Services
|
|
5
|
-
* API surface registered by `plg_system_ytbmcp` (see
|
|
6
|
-
* `src/packaging/joomla/extensions/plg_system_ytbmcp/src/Extension/Ytbmcp.php`
|
|
7
|
-
* — `onBeforeApiRoute()` mounts the routes under
|
|
8
|
-
* `v1/yt-builder-mcp/...` against `com_ytbmcp`).
|
|
9
|
-
*
|
|
10
|
-
* The full request URL composed by {@link RestClient} is:
|
|
11
|
-
*
|
|
12
|
-
* {baseUrl}/api/index.php/v1/yt-builder-mcp/{path}
|
|
13
|
-
*
|
|
14
|
-
* — where `{baseUrl}` is the Joomla site origin (e.g. `https://example.com`
|
|
15
|
-
* or `https://example.com/joomla` for a subfolder install) and `{path}`
|
|
16
|
-
* is the per-tool REST path (e.g. `/health`, `/pages`, `/etag`).
|
|
17
|
-
*
|
|
18
|
-
* Cookbook Ch1 Finding 2: the `PlatformKind` union already declared
|
|
19
|
-
* `'joomla'` in Wave G.0; this class fills the seam so no tool handler
|
|
20
|
-
* has to change.
|
|
21
|
-
*
|
|
22
|
-
* Cookbook §3.7 (cross-platform parity): the REST byte-shape returned
|
|
23
|
-
* by every endpoint is identical across platforms — only the route
|
|
24
|
-
* prefix differs.
|
|
25
|
-
*
|
|
26
|
-
* @license MIT
|
|
27
|
-
*/
|
|
28
|
-
import type { Platform } from './index.js';
|
|
29
|
-
/** Canonical Joomla REST namespace prefix for this plugin. */
|
|
30
|
-
export declare const JOOMLA_REST_NAMESPACE_PATH = "/api/index.php/v1/yt-builder-mcp";
|
|
31
|
-
/**
|
|
32
|
-
* Joomla platform implementation.
|
|
33
|
-
*
|
|
34
|
-
* `restNamespacePath` is fixed to the Web Services API mount point that
|
|
35
|
-
* `plg_system_ytbmcp::onBeforeApiRoute()` registers; the caller supplies
|
|
36
|
-
* only the site origin.
|
|
37
|
-
*/
|
|
38
|
-
export declare class JoomlaPlatform implements Platform {
|
|
39
|
-
readonly kind: "joomla";
|
|
40
|
-
readonly baseUrl: string;
|
|
41
|
-
readonly restNamespacePath: string;
|
|
42
|
-
constructor(baseUrl: string);
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=joomla.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"joomla.d.ts","sourceRoot":"","sources":["../../src/platform/joomla.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,8DAA8D;AAC9D,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAE7E;;;;;;GAMG;AACH,qBAAa,cAAe,YAAW,QAAQ;IAC3C,SAAgB,IAAI,EAAG,QAAQ,CAAU;IACzC,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,iBAAiB,EAAE,MAAM,CAAC;gBAE9B,OAAO,EAAE,MAAM;CAI9B"}
|
package/dist/platform/joomla.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Joomla 5/6 platform implementation — Wave 7 prep.
|
|
3
|
-
*
|
|
4
|
-
* Mirrors {@link WordPressPlatform} but targets the Joomla Web Services
|
|
5
|
-
* API surface registered by `plg_system_ytbmcp` (see
|
|
6
|
-
* `src/packaging/joomla/extensions/plg_system_ytbmcp/src/Extension/Ytbmcp.php`
|
|
7
|
-
* — `onBeforeApiRoute()` mounts the routes under
|
|
8
|
-
* `v1/yt-builder-mcp/...` against `com_ytbmcp`).
|
|
9
|
-
*
|
|
10
|
-
* The full request URL composed by {@link RestClient} is:
|
|
11
|
-
*
|
|
12
|
-
* {baseUrl}/api/index.php/v1/yt-builder-mcp/{path}
|
|
13
|
-
*
|
|
14
|
-
* — where `{baseUrl}` is the Joomla site origin (e.g. `https://example.com`
|
|
15
|
-
* or `https://example.com/joomla` for a subfolder install) and `{path}`
|
|
16
|
-
* is the per-tool REST path (e.g. `/health`, `/pages`, `/etag`).
|
|
17
|
-
*
|
|
18
|
-
* Cookbook Ch1 Finding 2: the `PlatformKind` union already declared
|
|
19
|
-
* `'joomla'` in Wave G.0; this class fills the seam so no tool handler
|
|
20
|
-
* has to change.
|
|
21
|
-
*
|
|
22
|
-
* Cookbook §3.7 (cross-platform parity): the REST byte-shape returned
|
|
23
|
-
* by every endpoint is identical across platforms — only the route
|
|
24
|
-
* prefix differs.
|
|
25
|
-
*
|
|
26
|
-
* @license MIT
|
|
27
|
-
*/
|
|
28
|
-
/** Canonical Joomla REST namespace prefix for this plugin. */
|
|
29
|
-
export const JOOMLA_REST_NAMESPACE_PATH = '/api/index.php/v1/yt-builder-mcp';
|
|
30
|
-
/**
|
|
31
|
-
* Joomla platform implementation.
|
|
32
|
-
*
|
|
33
|
-
* `restNamespacePath` is fixed to the Web Services API mount point that
|
|
34
|
-
* `plg_system_ytbmcp::onBeforeApiRoute()` registers; the caller supplies
|
|
35
|
-
* only the site origin.
|
|
36
|
-
*/
|
|
37
|
-
export class JoomlaPlatform {
|
|
38
|
-
kind = 'joomla';
|
|
39
|
-
baseUrl;
|
|
40
|
-
restNamespacePath;
|
|
41
|
-
constructor(baseUrl) {
|
|
42
|
-
this.baseUrl = baseUrl;
|
|
43
|
-
this.restNamespacePath = JOOMLA_REST_NAMESPACE_PATH;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=joomla.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"joomla.js","sourceRoot":"","sources":["../../src/platform/joomla.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,kCAAkC,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,OAAO,cAAc;IACP,IAAI,GAAG,QAAiB,CAAC;IACzB,OAAO,CAAS;IAChB,iBAAiB,CAAS;IAE1C,YAAY,OAAe;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,iBAAiB,GAAG,0BAA0B,CAAC;IACxD,CAAC;CACJ"}
|
package/dist/server.d.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP server factory — Wave G.1 / Gateway-Hub edition.
|
|
3
|
-
*
|
|
4
|
-
* `createServer({client})` builds a configured `McpServer` with a 3-lane
|
|
5
|
-
* tool registration:
|
|
6
|
-
*
|
|
7
|
-
* L3 — direct top-level (yootheme_builder_health + yootheme_builder_diagnose)
|
|
8
|
-
* Registered FIRST, BEFORE the CapturingServer wraps the real server.
|
|
9
|
-
* These tools must reach the LLM even when the gateway itself
|
|
10
|
-
* misbehaves (chicken-and-egg: the LLM diagnoses gateway breakage
|
|
11
|
-
* via these two).
|
|
12
|
-
*
|
|
13
|
-
* L1 — essential forwarded (7 tools)
|
|
14
|
-
* Routed through the CapturingServer to the real server. Appear in
|
|
15
|
-
* `tools/list` as first-class entries (Cursor-cap-safe).
|
|
16
|
-
*
|
|
17
|
-
* L2 — advanced captured (12 tools)
|
|
18
|
-
* Routed through the CapturingServer into its in-process advanced
|
|
19
|
-
* registry; reachable via the single `yootheme_builder_advanced`
|
|
20
|
-
* gateway tool. Hidden from `tools/list`.
|
|
21
|
-
*
|
|
22
|
-
* Gateway — `yootheme_builder_advanced`
|
|
23
|
-
* Registered LAST on the real server, after every L1/L2 tool is
|
|
24
|
-
* placed and the advanced registry is final.
|
|
25
|
-
*
|
|
26
|
-
* Result: `tools/list.length === 10` (7 L1 + 2 L3 + 1 gateway), and the
|
|
27
|
-
* full tool surface is 22 (collectAllRegisteredTools).
|
|
28
|
-
*
|
|
29
|
-
* @license MIT
|
|
30
|
-
*/
|
|
31
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
32
|
-
import { CapturingServer } from './gateway/capturing-server.js';
|
|
33
|
-
import type { ClientPool } from './sites/client-pool.js';
|
|
34
|
-
import type { SiteRegistry } from './sites/registry.js';
|
|
35
|
-
import { type ToolDefinition } from './tools/index.js';
|
|
36
|
-
export declare const SERVER_NAME = "@wootsup/yt-builder-mcp";
|
|
37
|
-
export declare const SERVER_VERSION = "0.2.0-alpha.2";
|
|
38
|
-
/**
|
|
39
|
-
* W8 — stable URI under which the live sites snapshot is exposed via
|
|
40
|
-
* MCP `resources/*`. Single fixed resource (no list-changed needed) —
|
|
41
|
-
* MCP hosts can fetch the current registry roster on demand without
|
|
42
|
-
* having to invoke a tool.
|
|
43
|
-
*/
|
|
44
|
-
export declare const SITES_RESOURCE_URI = "sites://current";
|
|
45
|
-
/** Human-readable resource name surfaced in `resources/list`. */
|
|
46
|
-
export declare const SITES_RESOURCE_NAME = "Currently configured sites";
|
|
47
|
-
/** Short description for `resources/list` consumers. */
|
|
48
|
-
export declare const SITES_RESOURCE_DESCRIPTION: string;
|
|
49
|
-
/** MIME type for the `sites://current` payload. */
|
|
50
|
-
export declare const SITES_RESOURCE_MIME_TYPE = "application/json";
|
|
51
|
-
/**
|
|
52
|
-
* Bearer-redacted JSON payload shape for the W8 `sites://current`
|
|
53
|
-
* resource. Mirrors the structured-content shape of the
|
|
54
|
-
* `yootheme_builder_sites_list` tool but never reveals bearer or
|
|
55
|
-
* bearer_ref — only safe-to-render display fields land in the
|
|
56
|
-
* `sites[]` rows.
|
|
57
|
-
*/
|
|
58
|
-
export interface SitesResourcePayload {
|
|
59
|
-
readonly default_site_id: string | null;
|
|
60
|
-
readonly sites: readonly SitesResourceRow[];
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* One row inside {@link SitesResourcePayload.sites}. Strictly the
|
|
64
|
-
* fields enumerated by plan §W8 Z.929 — no bearer / bearer_ref /
|
|
65
|
-
* bearer_source. `label` and `platform_resolved` are optional (only
|
|
66
|
-
* present when the underlying registry entry / probe carries them).
|
|
67
|
-
*/
|
|
68
|
-
export interface SitesResourceRow {
|
|
69
|
-
readonly site_id: string;
|
|
70
|
-
readonly url: string;
|
|
71
|
-
readonly platform: 'wordpress' | 'joomla' | 'auto';
|
|
72
|
-
readonly is_default: boolean;
|
|
73
|
-
readonly label?: string;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Build the JSON payload served by the `sites://current` resource.
|
|
77
|
-
*
|
|
78
|
-
* Field projection (per plan §W8 Z.925-933):
|
|
79
|
-
* - `default_site_id` from {@link SiteRegistry.defaultSiteId}.
|
|
80
|
-
* - `sites[].site_id` / `url` / `is_default` / `label` verbatim.
|
|
81
|
-
* - `sites[].platform` prefers the resolved kind from the W3 memo
|
|
82
|
-
* cache (peek-only, no probe) and falls back to the configured
|
|
83
|
-
* hint when no probe has run.
|
|
84
|
-
*
|
|
85
|
-
* Bearer fields are NEVER referenced. The `bearer_source` hint that
|
|
86
|
-
* the W7 `sites_list` tool exposes is intentionally omitted from this
|
|
87
|
-
* resource: even the "plain" vs "op" hint hints at storage layout,
|
|
88
|
-
* and the resource is positioned as a host-facing public roster.
|
|
89
|
-
*/
|
|
90
|
-
export declare function buildSitesResourcePayload(registry: SiteRegistry): SitesResourcePayload;
|
|
91
|
-
export interface CreateServerOptions {
|
|
92
|
-
/**
|
|
93
|
-
* Multi-site client pool — replaces the single `client` parameter
|
|
94
|
-
* shipped pre-W6. Each tool handler asks `pool.resolve(site_id)`
|
|
95
|
-
* for the per-call REST client + resolved site descriptor.
|
|
96
|
-
*/
|
|
97
|
-
readonly pool: ClientPool;
|
|
98
|
-
/** Override the tool set (defaults to `buildAllTools`). */
|
|
99
|
-
readonly tools?: readonly ToolDefinition[];
|
|
100
|
-
}
|
|
101
|
-
export interface CreatedServer {
|
|
102
|
-
readonly mcp: McpServer;
|
|
103
|
-
/** The full set of tool definitions registered across all 3 lanes + gateway. */
|
|
104
|
-
readonly tools: readonly ToolDefinition[];
|
|
105
|
-
/** The CapturingServer wrapping `mcp` — exposed for test helpers. */
|
|
106
|
-
readonly capturing: CapturingServer;
|
|
107
|
-
}
|
|
108
|
-
export declare function createServer(options: CreateServerOptions): CreatedServer;
|
|
109
|
-
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,OAAO,EAAE,eAAe,EAAsB,MAAM,+BAA+B,CAAC;AAEpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASxD,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE,eAAO,MAAM,WAAW,4BAA4B,CAAC;AACrD,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,oBAAoB,CAAC;AAEpD,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE,wDAAwD;AACxD,eAAO,MAAM,0BAA0B,QAGsB,CAAC;AAE9D,mDAAmD;AACnD,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC/C;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ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