@wootsup/yt-builder-mcp 1.1.7 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -10
- package/bin/yt-builder-mcp.js +55 -40
- package/dist/auth.d.ts +18 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +18 -0
- package/dist/auth.js.map +1 -1
- package/dist/catalog/build-catalog.d.ts +63 -0
- package/dist/catalog/build-catalog.d.ts.map +1 -0
- package/dist/catalog/build-catalog.js +166 -0
- package/dist/catalog/build-catalog.js.map +1 -0
- package/dist/cli/invocation-decision.d.ts +57 -0
- package/dist/cli/invocation-decision.d.ts.map +1 -0
- package/dist/cli/invocation-decision.js +86 -0
- package/dist/cli/invocation-decision.js.map +1 -0
- package/dist/client.d.ts +28 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +40 -1
- package/dist/client.js.map +1 -1
- package/dist/clients/claude-code.d.ts.map +1 -1
- package/dist/clients/claude-code.js +3 -1
- package/dist/clients/claude-code.js.map +1 -1
- package/dist/clients/claude-desktop.d.ts.map +1 -1
- package/dist/clients/claude-desktop.js +3 -1
- package/dist/clients/claude-desktop.js.map +1 -1
- package/dist/clients/cline.d.ts.map +1 -1
- package/dist/clients/cline.js +3 -1
- package/dist/clients/cline.js.map +1 -1
- package/dist/clients/codex-cli.d.ts +1 -1
- package/dist/clients/codex-cli.d.ts.map +1 -1
- package/dist/clients/codex-cli.js +98 -0
- package/dist/clients/codex-cli.js.map +1 -1
- package/dist/clients/continue.d.ts.map +1 -1
- package/dist/clients/continue.js +70 -1
- package/dist/clients/continue.js.map +1 -1
- package/dist/clients/cursor.d.ts.map +1 -1
- package/dist/clients/cursor.js +3 -1
- package/dist/clients/cursor.js.map +1 -1
- package/dist/clients/gemini-cli.d.ts.map +1 -1
- package/dist/clients/gemini-cli.js +3 -1
- package/dist/clients/gemini-cli.js.map +1 -1
- package/dist/clients/index.d.ts +104 -0
- package/dist/clients/index.d.ts.map +1 -1
- package/dist/clients/index.js +141 -0
- package/dist/clients/index.js.map +1 -1
- package/dist/clients/roo-code.d.ts.map +1 -1
- package/dist/clients/roo-code.js +3 -1
- package/dist/clients/roo-code.js.map +1 -1
- package/dist/clients/zed.d.ts.map +1 -1
- package/dist/clients/zed.js +3 -1
- package/dist/clients/zed.js.map +1 -1
- package/dist/gateway/advanced-read-tool.d.ts +37 -0
- package/dist/gateway/advanced-read-tool.d.ts.map +1 -0
- package/dist/gateway/advanced-read-tool.js +156 -0
- package/dist/gateway/advanced-read-tool.js.map +1 -0
- package/dist/gateway/advanced-tool/domains.d.ts +18 -3
- package/dist/gateway/advanced-tool/domains.d.ts.map +1 -1
- package/dist/gateway/advanced-tool/domains.js +28 -9
- package/dist/gateway/advanced-tool/domains.js.map +1 -1
- package/dist/gateway/advanced-tool/register.d.ts.map +1 -1
- package/dist/gateway/advanced-tool/register.js +43 -11
- package/dist/gateway/advanced-tool/register.js.map +1 -1
- package/dist/gateway/essentials.d.ts +14 -4
- package/dist/gateway/essentials.d.ts.map +1 -1
- package/dist/gateway/essentials.js +55 -5
- package/dist/gateway/essentials.js.map +1 -1
- package/dist/gateway/test-support.d.ts +3 -3
- package/dist/gateway/test-support.js +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/install-skill.js +1 -1
- package/dist/proxy/bridge.d.ts +36 -0
- package/dist/proxy/bridge.d.ts.map +1 -0
- package/dist/proxy/bridge.js +129 -0
- package/dist/proxy/bridge.js.map +1 -0
- package/dist/proxy/mode.d.ts +10 -0
- package/dist/proxy/mode.d.ts.map +1 -0
- package/dist/proxy/mode.js +20 -0
- package/dist/proxy/mode.js.map +1 -0
- package/dist/server.d.ts +6 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +14 -4
- package/dist/server.js.map +1 -1
- package/dist/setup-cli.d.ts +41 -0
- package/dist/setup-cli.d.ts.map +1 -1
- package/dist/setup-cli.js +163 -1
- package/dist/setup-cli.js.map +1 -1
- package/dist/setup-prompts.d.ts +23 -0
- package/dist/setup-prompts.d.ts.map +1 -1
- package/dist/setup-prompts.js +76 -1
- package/dist/setup-prompts.js.map +1 -1
- package/dist/setup-wizard.d.ts.map +1 -1
- package/dist/setup-wizard.js +7 -0
- package/dist/setup-wizard.js.map +1 -1
- package/dist/sites/bootstrap.d.ts +41 -0
- package/dist/sites/bootstrap.d.ts.map +1 -0
- package/dist/sites/bootstrap.js +58 -0
- package/dist/sites/bootstrap.js.map +1 -0
- package/dist/sites/client-pool.d.ts +33 -0
- package/dist/sites/client-pool.d.ts.map +1 -1
- package/dist/sites/client-pool.js +69 -1
- package/dist/sites/client-pool.js.map +1 -1
- package/dist/sites/registry.d.ts +30 -0
- package/dist/sites/registry.d.ts.map +1 -1
- package/dist/sites/registry.js.map +1 -1
- package/dist/sites/store.d.ts +8 -1
- package/dist/sites/store.d.ts.map +1 -1
- package/dist/sites/store.js +17 -2
- package/dist/sites/store.js.map +1 -1
- package/dist/sites/tools/index.d.ts.map +1 -1
- package/dist/sites/tools/index.js +9 -1
- package/dist/sites/tools/index.js.map +1 -1
- package/dist/sites/tools/use-site.d.ts +47 -0
- package/dist/sites/tools/use-site.d.ts.map +1 -0
- package/dist/sites/tools/use-site.js +203 -0
- package/dist/sites/tools/use-site.js.map +1 -0
- package/dist/tools/bind-guidance.d.ts +80 -0
- package/dist/tools/bind-guidance.d.ts.map +1 -0
- package/dist/tools/bind-guidance.js +95 -0
- package/dist/tools/bind-guidance.js.map +1 -0
- package/dist/tools/elements/builders.d.ts.map +1 -1
- package/dist/tools/elements/builders.js +75 -18
- package/dist/tools/elements/builders.js.map +1 -1
- package/dist/tools/elements/handlers-write.d.ts +20 -3
- package/dist/tools/elements/handlers-write.d.ts.map +1 -1
- package/dist/tools/elements/handlers-write.js +372 -10
- package/dist/tools/elements/handlers-write.js.map +1 -1
- package/dist/tools/elements/handlers.d.ts +6 -1
- package/dist/tools/elements/handlers.d.ts.map +1 -1
- package/dist/tools/elements/handlers.js +77 -10
- package/dist/tools/elements/handlers.js.map +1 -1
- package/dist/tools/elements/layout-hierarchy-rules.d.ts +62 -0
- package/dist/tools/elements/layout-hierarchy-rules.d.ts.map +1 -0
- package/dist/tools/elements/layout-hierarchy-rules.js +154 -0
- package/dist/tools/elements/layout-hierarchy-rules.js.map +1 -0
- package/dist/tools/format/elements-format.d.ts +35 -0
- package/dist/tools/format/elements-format.d.ts.map +1 -1
- package/dist/tools/format/elements-format.js +134 -12
- package/dist/tools/format/elements-format.js.map +1 -1
- package/dist/tools/format/inspection-format.d.ts +29 -0
- package/dist/tools/format/inspection-format.d.ts.map +1 -1
- package/dist/tools/format/inspection-format.js +99 -22
- package/dist/tools/format/inspection-format.js.map +1 -1
- package/dist/tools/format/pages-format.d.ts.map +1 -1
- package/dist/tools/format/pages-format.js +7 -0
- package/dist/tools/format/pages-format.js.map +1 -1
- package/dist/tools/format/sources-format.d.ts +8 -0
- package/dist/tools/format/sources-format.d.ts.map +1 -1
- package/dist/tools/format/sources-format.js +10 -0
- package/dist/tools/format/sources-format.js.map +1 -1
- package/dist/tools/health.d.ts.map +1 -1
- package/dist/tools/health.js +24 -0
- package/dist/tools/health.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/inspection.d.ts +24 -0
- package/dist/tools/inspection.d.ts.map +1 -1
- package/dist/tools/inspection.js +297 -5
- package/dist/tools/inspection.js.map +1 -1
- package/dist/tools/layout-flatten.d.ts +11 -8
- package/dist/tools/layout-flatten.d.ts.map +1 -1
- package/dist/tools/layout-flatten.js +17 -6
- package/dist/tools/layout-flatten.js.map +1 -1
- package/dist/tools/multi-items/builders.d.ts.map +1 -1
- package/dist/tools/multi-items/builders.js +18 -3
- package/dist/tools/multi-items/builders.js.map +1 -1
- package/dist/tools/multi-items/clean-implode-handler.d.ts.map +1 -1
- package/dist/tools/multi-items/clean-implode-handler.js +2 -2
- package/dist/tools/multi-items/clean-implode-handler.js.map +1 -1
- package/dist/tools/multi-items/format/inspection-format.d.ts +41 -0
- package/dist/tools/multi-items/format/inspection-format.d.ts.map +1 -0
- package/dist/tools/multi-items/format/inspection-format.js +64 -0
- package/dist/tools/multi-items/format/inspection-format.js.map +1 -0
- package/dist/tools/multi-items/inspect-handler.d.ts +50 -2
- package/dist/tools/multi-items/inspect-handler.d.ts.map +1 -1
- package/dist/tools/multi-items/inspect-handler.js +237 -10
- package/dist/tools/multi-items/inspect-handler.js.map +1 -1
- package/dist/tools/multi-items/inspection-cache.d.ts +85 -0
- package/dist/tools/multi-items/inspection-cache.d.ts.map +1 -0
- package/dist/tools/multi-items/inspection-cache.js +126 -0
- package/dist/tools/multi-items/inspection-cache.js.map +1 -0
- package/dist/tools/pages/builders.d.ts +31 -2
- package/dist/tools/pages/builders.d.ts.map +1 -1
- package/dist/tools/pages/builders.js +173 -17
- package/dist/tools/pages/builders.js.map +1 -1
- package/dist/tools/pages/handlers-read.d.ts +6 -2
- package/dist/tools/pages/handlers-read.d.ts.map +1 -1
- package/dist/tools/pages/handlers-read.js +228 -26
- package/dist/tools/pages/handlers-read.js.map +1 -1
- package/dist/tools/pages/handlers-write.d.ts +143 -7
- package/dist/tools/pages/handlers-write.d.ts.map +1 -1
- package/dist/tools/pages/handlers-write.js +215 -11
- package/dist/tools/pages/handlers-write.js.map +1 -1
- package/dist/tools/pages/index.d.ts +1 -1
- package/dist/tools/pages/index.d.ts.map +1 -1
- package/dist/tools/pages/index.js +1 -1
- package/dist/tools/pages/index.js.map +1 -1
- package/dist/tools/pages/schemas.d.ts +166 -0
- package/dist/tools/pages/schemas.d.ts.map +1 -1
- package/dist/tools/pages/schemas.js +347 -0
- package/dist/tools/pages/schemas.js.map +1 -1
- package/dist/tools/shared-schemas.d.ts.map +1 -1
- package/dist/tools/shared-schemas.js +26 -11
- package/dist/tools/shared-schemas.js.map +1 -1
- package/dist/tools/sources/builders.d.ts.map +1 -1
- package/dist/tools/sources/builders.js +64 -6
- package/dist/tools/sources/builders.js.map +1 -1
- package/dist/tools/sources/handlers-bind.d.ts +13 -1
- package/dist/tools/sources/handlers-bind.d.ts.map +1 -1
- package/dist/tools/sources/handlers-bind.js +219 -5
- package/dist/tools/sources/handlers-bind.js.map +1 -1
- package/dist/tools/sources/handlers.d.ts +3 -0
- package/dist/tools/sources/handlers.d.ts.map +1 -1
- package/dist/tools/sources/handlers.js +45 -8
- package/dist/tools/sources/handlers.js.map +1 -1
- package/dist/tools/sparse-fields.d.ts +23 -0
- package/dist/tools/sparse-fields.d.ts.map +1 -1
- package/dist/tools/sparse-fields.js +29 -0
- package/dist/tools/sparse-fields.js.map +1 -1
- package/dist/tools/sublayout/builders.d.ts +23 -0
- package/dist/tools/sublayout/builders.d.ts.map +1 -0
- package/dist/tools/sublayout/builders.js +54 -0
- package/dist/tools/sublayout/builders.js.map +1 -0
- package/dist/tools/sublayout/index.d.ts +13 -0
- package/dist/tools/sublayout/index.d.ts.map +1 -0
- package/dist/tools/sublayout/index.js +13 -0
- package/dist/tools/sublayout/index.js.map +1 -0
- package/dist/tools/sublayout/inspect-sublayout-handler.d.ts +95 -0
- package/dist/tools/sublayout/inspect-sublayout-handler.d.ts.map +1 -0
- package/dist/tools/sublayout/inspect-sublayout-handler.js +181 -0
- package/dist/tools/sublayout/inspect-sublayout-handler.js.map +1 -0
- package/dist/tools/tool-builder/results.d.ts +31 -0
- package/dist/tools/tool-builder/results.d.ts.map +1 -1
- package/dist/tools/tool-builder/results.js +95 -4
- package/dist/tools/tool-builder/results.js.map +1 -1
- package/dist/uninstall-skill.d.ts +52 -0
- package/dist/uninstall-skill.d.ts.map +1 -0
- package/dist/uninstall-skill.js +146 -0
- package/dist/uninstall-skill.js.map +1 -0
- package/dist/uninstall.d.ts +73 -0
- package/dist/uninstall.d.ts.map +1 -0
- package/dist/uninstall.js +82 -0
- package/dist/uninstall.js.map +1 -0
- package/icon.png +0 -0
- package/manifest.json +10 -10
- package/package.json +7 -3
- package/skills/yt-builder-mcp/SKILL.md +157 -88
|
@@ -22,21 +22,26 @@
|
|
|
22
22
|
export const DOMAIN_ORDER = ['pages', 'elements', 'sources', 'multi-items', 'inspection'];
|
|
23
23
|
/**
|
|
24
24
|
* Prefix→domain routing table. Each domain accepts plural
|
|
25
|
-
* (`pages_list`) + singular (`
|
|
26
|
-
* stems via `stem.startsWith(prefix + '_')` or full-equality.
|
|
27
|
-
* outside the taxonomy falls through to 'misc'.
|
|
25
|
+
* (`pages_list`) + singular (`page_get_schema`, `element_unbind_source`,
|
|
26
|
+
* `source_…`) stems via `stem.startsWith(prefix + '_')` or full-equality.
|
|
27
|
+
* Anything outside the taxonomy falls through to 'misc'.
|
|
28
28
|
*
|
|
29
29
|
* The `multi-items` domain captures the YT-Pro Multi-Items binding
|
|
30
30
|
* pattern tools (inspect / clean-implode). Stems used:
|
|
31
31
|
* - `inspect_multi_items_binding` → starts with `inspect_multi_items`
|
|
32
32
|
* - `clean_implode_directives` → starts with `clean_implode`
|
|
33
|
+
*
|
|
34
|
+
* The `inspection` domain captures layout inspectors that surface a
|
|
35
|
+
* YT-Pro footgun the raw layout tree hides. Stems used:
|
|
36
|
+
* - `inspect_sublayout` (F154) → full-equality `inspect_sublayout`
|
|
37
|
+
* (the YT5 `< SUBLAYOUT` fragment-subtree + inner-grid-gate inspector).
|
|
33
38
|
*/
|
|
34
39
|
export const DOMAIN_PREFIX_MAP = {
|
|
35
40
|
pages: ['pages', 'page'],
|
|
36
41
|
elements: ['elements', 'element'],
|
|
37
42
|
sources: ['sources', 'source'],
|
|
38
43
|
'multi-items': ['inspect_multi_items', 'clean_implode'],
|
|
39
|
-
inspection: ['inspection'],
|
|
44
|
+
inspection: ['inspection', 'inspect_sublayout'],
|
|
40
45
|
};
|
|
41
46
|
export const TOOL_PREFIX = 'yootheme_builder_';
|
|
42
47
|
/** Maps a tool name to its display domain (the first underscore-segment after the prefix). */
|
|
@@ -76,6 +81,16 @@ export function renderGroupedList(toolNames) {
|
|
|
76
81
|
}
|
|
77
82
|
return lines.join('\n');
|
|
78
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* F176 (2026-06-12): the former "★ Bind a source" callout was removed. The
|
|
86
|
+
* bind tool (`yootheme_builder_element_bind_source`) plus `page_save` /
|
|
87
|
+
* `page_publish` were promoted to L1 by F116 and live in `tools/list` as
|
|
88
|
+
* first-class entries; the DISJOINT-LANE invariant guarantees they are NEVER
|
|
89
|
+
* in the advanced registry, so the gateway description must not advertise a
|
|
90
|
+
* gateway wrap for them (it would steer agents into an `unknown_tool` dead
|
|
91
|
+
* end on a current build). The binding workflow is now discoverable directly
|
|
92
|
+
* in `tools/list`.
|
|
93
|
+
*/
|
|
79
94
|
/** Builds the gateway tool's description, grouping every advanced tool by domain. */
|
|
80
95
|
export function buildDescription(toolNames) {
|
|
81
96
|
const toolCount = toolNames.length;
|
|
@@ -84,11 +99,15 @@ export function buildDescription(toolNames) {
|
|
|
84
99
|
const domainList = domains.join(', ');
|
|
85
100
|
return (`Routes to ${String(toolCount)} advanced YOOtheme Builder tools across ${String(domainCount)} ` +
|
|
86
101
|
`domain${domainCount === 1 ? '' : 's'}${domainCount > 0 ? ` (${domainList})` : ''}. ` +
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
'
|
|
102
|
+
// F214: stop the model habitually routing first-class tools through the
|
|
103
|
+
// gateway (a wasted invalid_arguments cycle each time). State the scope
|
|
104
|
+
// boundary up front, before the grouped-tool list.
|
|
105
|
+
'ONLY for the advanced tools listed below — every tool that appears ' +
|
|
106
|
+
'directly in tools/list is FIRST-CLASS: call it directly, never via this gateway. ' +
|
|
107
|
+
'Call { tool } for its schema, or { tool, arguments } to run it ' +
|
|
108
|
+
'(the target\'s own confirm guards stay in effect).' +
|
|
109
|
+
'\n\nAvailable advanced tools by domain:\n' +
|
|
91
110
|
`${renderGroupedList(toolNames)}\n\n` +
|
|
92
|
-
'
|
|
111
|
+
'Connectivity: yootheme_builder_health / yootheme_builder_diagnose.');
|
|
93
112
|
}
|
|
94
113
|
//# sourceMappingURL=domains.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domains.js","sourceRoot":"","sources":["../../../src/gateway/advanced-tool/domains.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,CAAU,CAAC;AAEnG
|
|
1
|
+
{"version":3,"file":"domains.js","sourceRoot":"","sources":["../../../src/gateway/advanced-tool/domains.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,CAAU,CAAC;AAEnG;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA6D;IACvF,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;IACjC,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC9B,aAAa,EAAE,CAAC,qBAAqB,EAAE,eAAe,CAAC;IACvD,UAAU,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;CAClD,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAAC;AAE/C,8FAA8F;AAC9F,MAAM,UAAU,QAAQ,CAAC,QAAgB;IACrC,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC9F,KAAK,MAAM,MAA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,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;;GASG;AAEH,qFAAqF;AACrF,MAAM,UAAU,gBAAgB,CAAC,SAAmB;IAChD,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC;IACnC,MAAM,OAAO,GAAG,CAAC,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACrD,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IACnC,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,CACH,aAAa,MAAM,CAAC,SAAS,CAAC,2CAA2C,MAAM,CAAC,WAAW,CAAC,GAAG;QAC/F,SAAS,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI;QACrF,wEAAwE;QACxE,wEAAwE;QACxE,mDAAmD;QACnD,qEAAqE;QACrE,mFAAmF;QACnF,iEAAiE;QACjE,oDAAoD;QACpD,2CAA2C;QAC3C,GAAG,iBAAiB,CAAC,SAAS,CAAC,MAAM;QACrC,oEAAoE,CACvE,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/gateway/advanced-tool/register.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/gateway/advanced-tool/register.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AA0ChE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,SAAS,EACrB,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,GACjD,IAAI,CAyDN"}
|
|
@@ -7,16 +7,37 @@
|
|
|
7
7
|
* @license MIT
|
|
8
8
|
*/
|
|
9
9
|
import { z } from 'zod';
|
|
10
|
+
import { isEssential, isDirectTopLevel } from '../essentials.js';
|
|
10
11
|
import { buildDescription, renderGroupedList } from './domains.js';
|
|
11
12
|
import { discoveryResult } from './discovery.js';
|
|
12
13
|
import { errorResult, executeAdvancedTool } from './execute.js';
|
|
13
|
-
/**
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Builds the gateway tool's Zod inputSchema.
|
|
16
|
+
*
|
|
17
|
+
* F205 (P2): `tool` is a free z.string(), NOT a z.enum of the advanced names.
|
|
18
|
+
* The MCP SDK validates the gateway inputSchema BEFORE our handler runs; an
|
|
19
|
+
* enum rejected every first-class tool name (yootheme_builder_health,
|
|
20
|
+
* yootheme_builder_template_summary, ...) with a raw McpError -32602, so the
|
|
21
|
+
* handler's unknown_tool / first_class_tool steering never ran. A plain string
|
|
22
|
+
* lets every name reach the handler. renderGroupedList in the description stays
|
|
23
|
+
* the load-bearing discovery surface.
|
|
24
|
+
*/
|
|
25
|
+
function gatewayInputSchema() {
|
|
15
26
|
return {
|
|
16
|
-
tool: z.
|
|
27
|
+
tool: z.string().describe('Advanced tool to route to (e.g. "yootheme_builder_page_get_schema"). ' +
|
|
28
|
+
'Must be one of the advanced tools listed in this description — ' +
|
|
29
|
+
'first-class tools (yootheme_builder_health, ...) are called ' +
|
|
30
|
+
'DIRECTLY, not through this gateway. ' +
|
|
17
31
|
'Omit `arguments` to discover its schema first.'),
|
|
18
32
|
arguments: z.record(z.string(), z.unknown()).optional().describe('Arguments for the target tool. Omit for discovery mode ' +
|
|
19
33
|
"(returns the tool's schema + annotations)."),
|
|
34
|
+
// `input` is a tolerated ALIAS for `arguments`. Some agents (and older
|
|
35
|
+
// skill docs) pass the target arguments under `input:`. Without this the
|
|
36
|
+
// key would be dropped by the SDK's zod validation, leaving `arguments`
|
|
37
|
+
// undefined → the gateway silently fell into discovery mode and never
|
|
38
|
+
// executed the write (F107). Accepting it keeps verbatim callers working;
|
|
39
|
+
// `arguments` still wins when both are present.
|
|
40
|
+
input: z.record(z.string(), z.unknown()).optional().describe('Alias for `arguments` (tolerated for back-compat). Prefer `arguments`.'),
|
|
20
41
|
};
|
|
21
42
|
}
|
|
22
43
|
/**
|
|
@@ -27,15 +48,10 @@ function gatewayInputSchema(enumValues) {
|
|
|
27
48
|
*/
|
|
28
49
|
export function registerAdvancedTool(realServer, advancedRegistry) {
|
|
29
50
|
const advancedNames = [...advancedRegistry.keys()].sort();
|
|
30
|
-
// z.enum needs a non-empty tuple. The empty-registry arm is exercised
|
|
31
|
-
// only by defensive test wiring; production always populates the
|
|
32
|
-
// registry. Keeping the guard means a zero-tool wiring still yields a
|
|
33
|
-
// valid (if inert) gateway schema rather than a z.enum crash.
|
|
34
|
-
const enumValues = advancedNames.length > 0 ? advancedNames : ['__none__'];
|
|
35
51
|
realServer.registerTool('yootheme_builder_advanced', {
|
|
36
52
|
title: 'Advanced Tool Gateway',
|
|
37
53
|
description: buildDescription(advancedNames),
|
|
38
|
-
inputSchema: gatewayInputSchema(
|
|
54
|
+
inputSchema: gatewayInputSchema(),
|
|
39
55
|
// Stream D3 T3: gateway is the only L1 tool that retains
|
|
40
56
|
// `openWorldHint:true` — its effective behaviour is
|
|
41
57
|
// dynamic (target tool decided at call-time). Conservative
|
|
@@ -52,6 +68,20 @@ export function registerAdvancedTool(realServer, advancedRegistry) {
|
|
|
52
68
|
}, async (args, extra) => {
|
|
53
69
|
const entry = advancedRegistry.get(args.tool);
|
|
54
70
|
if (!entry) {
|
|
71
|
+
// F205: a name that is a first-class tool (L1 essential or L3
|
|
72
|
+
// direct top-level) is a different error than a typo — steer the
|
|
73
|
+
// caller to call it DIRECTLY instead of routing it through the
|
|
74
|
+
// gateway.
|
|
75
|
+
if (isEssential(args.tool) || isDirectTopLevel(args.tool)) {
|
|
76
|
+
return errorResult({
|
|
77
|
+
message: `"${args.tool}" is a FIRST-CLASS tool — it appears directly in tools/list.`,
|
|
78
|
+
code: 'first_class_tool',
|
|
79
|
+
suggestion: `Call "${args.tool}" directly instead of routing it through ` +
|
|
80
|
+
'yootheme_builder_advanced. This gateway only routes the advanced ' +
|
|
81
|
+
'tools listed in its description.',
|
|
82
|
+
details: { tool: args.tool },
|
|
83
|
+
});
|
|
84
|
+
}
|
|
55
85
|
return errorResult({
|
|
56
86
|
message: `Unknown advanced tool: "${args.tool}".`,
|
|
57
87
|
code: 'unknown_tool',
|
|
@@ -61,9 +91,11 @@ export function registerAdvancedTool(realServer, advancedRegistry) {
|
|
|
61
91
|
details: { valid_tools_by_domain: renderGroupedList(advancedNames) },
|
|
62
92
|
});
|
|
63
93
|
}
|
|
64
|
-
|
|
94
|
+
// `arguments` is canonical; `input` is a tolerated alias (F107).
|
|
95
|
+
const callArgs = args.arguments ?? args.input;
|
|
96
|
+
if (callArgs === undefined)
|
|
65
97
|
return discoveryResult(args.tool, entry);
|
|
66
|
-
return executeAdvancedTool(args.tool, entry,
|
|
98
|
+
return executeAdvancedTool(args.tool, entry, callArgs, extra);
|
|
67
99
|
});
|
|
68
100
|
}
|
|
69
101
|
//# sourceMappingURL=register.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/gateway/advanced-tool/register.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,gBAAgB,EAAE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AC3D,qDAAqD;oBACrD,oCAAoC,iBAAiB,CAAC,aAAa,CAAC,EAAE;gBAC1E,OAAO,EAAE,EAAE,qBAAqB,EAAE,iBAAiB,CAAC,aAAa,CAAC,EAAE;aACvE,CAAC,CAAC;QACP,CAAC;QACD,iEAAiE;QACjE,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC;QAC9C,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACrE,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAClE,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -16,11 +16,21 @@
|
|
|
16
16
|
* SDK never sees a duplicate registration.
|
|
17
17
|
*
|
|
18
18
|
* Why this split: Cursor caps MCP servers at ~40 tools. This adapter
|
|
19
|
-
* declares
|
|
20
|
-
* The 3-lane shape keeps `tools/list` at
|
|
21
|
-
*
|
|
19
|
+
* declares 31 callable tools (26 domain L1/L3 + 4 advanced L2 + 1 gateway).
|
|
20
|
+
* The 3-lane shape keeps `tools/list` at 24 (L1) + 2 (L3) + 1 (gateway) =
|
|
21
|
+
* 27 entries, well under the cap, while every tool stays fully reachable
|
|
22
22
|
* (advanced tools through `yootheme_builder_advanced`).
|
|
23
23
|
*
|
|
24
|
+
* F116 (2026-06-11): the bind→save→publish chain (element_bind_source,
|
|
25
|
+
* page_save, page_publish) was promoted from the advanced lane to L1. It is
|
|
26
|
+
* the #1 dynamic-content workflow; hiding it behind the gateway made an agent
|
|
27
|
+
* listing tools see element_add but neither bind nor publish — a likely
|
|
28
|
+
* "can't publish" deadend. L1 20→23, advanced 7→4.
|
|
29
|
+
*
|
|
30
|
+
* P-G (Goldstandard wave 3): page_dynamize was added as a new registered tool
|
|
31
|
+
* and promoted to L1 (the one-call dynamize-existing-section path). With the
|
|
32
|
+
* F116 trio it brings L1 to 24, advanced stays 4, surface to 27.
|
|
33
|
+
*
|
|
24
34
|
* Health + diagnose live in L3 because they MUST be the first thing an
|
|
25
35
|
* LLM-host calls when something is broken; routing them through a gateway
|
|
26
36
|
* would create a chicken-and-egg loop (the LLM would have to discover
|
|
@@ -32,7 +42,7 @@
|
|
|
32
42
|
* L1 — Tools kept as first-class entries in `tools/list`.
|
|
33
43
|
* Forwarded by the CapturingServer to the real McpServer.
|
|
34
44
|
*/
|
|
35
|
-
export declare const ESSENTIAL_TOOLS: readonly ["yootheme_builder_pages_list", "yootheme_builder_get_etag", "yootheme_builder_element_list", "yootheme_builder_element_add", "yootheme_builder_element_update_settings", "yootheme_builder_sources_list", "yootheme_builder_element_types_list", "yootheme_builder_inspect_multi_items_binding", "yootheme_builder_element_get", "yootheme_builder_element_delete", "yootheme_builder_element_clone", "yootheme_builder_element_move", "yootheme_builder_page_get_layout", "yootheme_builder_template_summary", "yootheme_builder_element_type_get_schema", "yootheme_builder_sites_list", "yootheme_builder_sites_test"];
|
|
45
|
+
export declare const ESSENTIAL_TOOLS: readonly ["yootheme_builder_pages_list", "yootheme_builder_get_etag", "yootheme_builder_element_list", "yootheme_builder_element_add", "yootheme_builder_element_update_settings", "yootheme_builder_sources_list", "yootheme_builder_element_types_list", "yootheme_builder_inspect_multi_items_binding", "yootheme_builder_element_get", "yootheme_builder_element_delete", "yootheme_builder_element_clone", "yootheme_builder_element_move", "yootheme_builder_page_get_layout", "yootheme_builder_template_summary", "yootheme_builder_element_type_get_schema", "yootheme_builder_sites_list", "yootheme_builder_sites_test", "yootheme_builder_use_site", "yootheme_builder_pages_create", "yootheme_builder_pages_delete", "yootheme_builder_element_bind_source", "yootheme_builder_page_save", "yootheme_builder_page_publish", "yootheme_builder_page_dynamize", "yootheme_builder_scaffold_section"];
|
|
36
46
|
/**
|
|
37
47
|
* L3 — Tools registered DIRECTLY on the real McpServer, BEFORE the
|
|
38
48
|
* CapturingServer wraps it. The CapturingServer treats these names as a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"essentials.d.ts","sourceRoot":"","sources":["../../src/gateway/essentials.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"essentials.d.ts","sourceRoot":"","sources":["../../src/gateway/essentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe,k3BA+ElB,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,mEAGzB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAC7D,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD"}
|
|
@@ -16,11 +16,21 @@
|
|
|
16
16
|
* SDK never sees a duplicate registration.
|
|
17
17
|
*
|
|
18
18
|
* Why this split: Cursor caps MCP servers at ~40 tools. This adapter
|
|
19
|
-
* declares
|
|
20
|
-
* The 3-lane shape keeps `tools/list` at
|
|
21
|
-
*
|
|
19
|
+
* declares 31 callable tools (26 domain L1/L3 + 4 advanced L2 + 1 gateway).
|
|
20
|
+
* The 3-lane shape keeps `tools/list` at 24 (L1) + 2 (L3) + 1 (gateway) =
|
|
21
|
+
* 27 entries, well under the cap, while every tool stays fully reachable
|
|
22
22
|
* (advanced tools through `yootheme_builder_advanced`).
|
|
23
23
|
*
|
|
24
|
+
* F116 (2026-06-11): the bind→save→publish chain (element_bind_source,
|
|
25
|
+
* page_save, page_publish) was promoted from the advanced lane to L1. It is
|
|
26
|
+
* the #1 dynamic-content workflow; hiding it behind the gateway made an agent
|
|
27
|
+
* listing tools see element_add but neither bind nor publish — a likely
|
|
28
|
+
* "can't publish" deadend. L1 20→23, advanced 7→4.
|
|
29
|
+
*
|
|
30
|
+
* P-G (Goldstandard wave 3): page_dynamize was added as a new registered tool
|
|
31
|
+
* and promoted to L1 (the one-call dynamize-existing-section path). With the
|
|
32
|
+
* F116 trio it brings L1 to 24, advanced stays 4, surface to 27.
|
|
33
|
+
*
|
|
24
34
|
* Health + diagnose live in L3 because they MUST be the first thing an
|
|
25
35
|
* LLM-host calls when something is broken; routing them through a gateway
|
|
26
36
|
* would create a chicken-and-egg loop (the LLM would have to discover
|
|
@@ -48,8 +58,9 @@ export const ESSENTIAL_TOOLS = [
|
|
|
48
58
|
// F-16 hot-path promotions (Maria-Audit v2 re-confirmed) — the 5
|
|
49
59
|
// most-used read/mutate operations skip the advanced-router
|
|
50
60
|
// discovery roundtrip. Cursor cap is ~40; with the W7 sites_list +
|
|
51
|
-
// sites_test additions
|
|
52
|
-
//
|
|
61
|
+
// sites_test additions (plus later C4, config-harmonization, the
|
|
62
|
+
// F116 bind→save→publish promotion and the P-G page_dynamize tool) we
|
|
63
|
+
// sit at 24 L1 + 2 L3 + 1 gateway = 27, comfortable below the limit.
|
|
53
64
|
'yootheme_builder_element_get',
|
|
54
65
|
'yootheme_builder_element_delete',
|
|
55
66
|
'yootheme_builder_element_clone',
|
|
@@ -71,6 +82,45 @@ export const ESSENTIAL_TOOLS = [
|
|
|
71
82
|
// sites_test probes /health + /etag for ONE site). L1 surface 15 → 17.
|
|
72
83
|
'yootheme_builder_sites_list',
|
|
73
84
|
'yootheme_builder_sites_test',
|
|
85
|
+
// Phase 3 (config harmonization) — use_site is the runtime active-
|
|
86
|
+
// site SWITCH (mirrors api-mapper's apimapper_use_profile). It must
|
|
87
|
+
// be L1 so an agent can discover + call it directly the same way it
|
|
88
|
+
// reaches sites_list, instead of routing through the advanced
|
|
89
|
+
// gateway. L1 surface 19 → 20.
|
|
90
|
+
'yootheme_builder_use_site',
|
|
91
|
+
// C4 (v1.2) — pages_create + pages_delete are first-class customer-
|
|
92
|
+
// facing page-level mutations (POST /pages, DELETE /pages/{id}).
|
|
93
|
+
// Both must be discoverable directly in tools/list, not behind the
|
|
94
|
+
// advanced-gateway router — they're high-frequency mutations agents
|
|
95
|
+
// reach for whenever the user says "create a new page" or "delete
|
|
96
|
+
// this page". L1 surface 17 → 19.
|
|
97
|
+
'yootheme_builder_pages_create',
|
|
98
|
+
'yootheme_builder_pages_delete',
|
|
99
|
+
// F116 (2026-06-11) — the bind→save→publish chain. element_bind_source is the
|
|
100
|
+
// #1 dynamic-content operation (wire a published source field onto an
|
|
101
|
+
// element); page_save + page_publish persist + go live. All three were
|
|
102
|
+
// advanced-lane only, so an agent listing tools saw element_add but
|
|
103
|
+
// neither bind nor publish — a likely "can't publish" deadend and a
|
|
104
|
+
// 2-call discovery tax (find the gateway, then route). Promoting them to
|
|
105
|
+
// L1 makes the canonical dynamic-content workflow first-class and
|
|
106
|
+
// directly callable. L1 surface 20 → 23.
|
|
107
|
+
'yootheme_builder_element_bind_source',
|
|
108
|
+
'yootheme_builder_page_save',
|
|
109
|
+
'yootheme_builder_page_publish',
|
|
110
|
+
// P-G (Goldstandard wave 3) — page_dynamize is THE canonical one-call
|
|
111
|
+
// path to dynamize an existing designed section (copy byte-identically,
|
|
112
|
+
// swap only mapped queries + leaf names). It MUST be L1 so an agent
|
|
113
|
+
// reaches it directly INSTEAD of discovering it through the advanced
|
|
114
|
+
// gateway and then hand-editing layout JSON (the failure mode the
|
|
115
|
+
// recipe-as-code exists to prevent). With the F116 trio L1 23 → 24.
|
|
116
|
+
'yootheme_builder_page_dynamize',
|
|
117
|
+
// WF2 Option C (2026-06-13) — scaffold_section is the positive-steering
|
|
118
|
+
// counterpart to the structural-hierarchy guard: it creates a VALID
|
|
119
|
+
// section → row → column hull in ONE atomic call and returns the column
|
|
120
|
+
// pointer(s) to drop content into. It MUST be L1 so an agent reaches it
|
|
121
|
+
// directly INSTEAD of hand-building (and tripping the guard on) an
|
|
122
|
+
// invalid root/section/row placement. With the prior set L1 24 → 25.
|
|
123
|
+
'yootheme_builder_scaffold_section',
|
|
74
124
|
];
|
|
75
125
|
/**
|
|
76
126
|
* L3 — Tools registered DIRECTLY on the real McpServer, BEFORE the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"essentials.js","sourceRoot":"","sources":["../../src/gateway/essentials.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"essentials.js","sourceRoot":"","sources":["../../src/gateway/essentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,6BAA6B;IAC7B,2BAA2B;IAC3B,+BAA+B;IAC/B,8BAA8B;IAC9B,0CAA0C;IAC1C,+BAA+B;IAC/B,qCAAqC;IACrC,6DAA6D;IAC7D,kEAAkE;IAClE,6DAA6D;IAC7D,yCAAyC;IACzC,8CAA8C;IAC9C,iEAAiE;IACjE,4DAA4D;IAC5D,mEAAmE;IACnE,iEAAiE;IACjE,sEAAsE;IACtE,qEAAqE;IACrE,8BAA8B;IAC9B,iCAAiC;IACjC,gCAAgC;IAChC,+BAA+B;IAC/B,kCAAkC;IAClC,oEAAoE;IACpE,sEAAsE;IACtE,mCAAmC;IACnC,iEAAiE;IACjE,iEAAiE;IACjE,iEAAiE;IACjE,4DAA4D;IAC5D,4DAA4D;IAC5D,0CAA0C;IAC1C,mEAAmE;IACnE,oEAAoE;IACpE,mEAAmE;IACnE,kEAAkE;IAClE,uEAAuE;IACvE,6BAA6B;IAC7B,6BAA6B;IAC7B,mEAAmE;IACnE,oEAAoE;IACpE,oEAAoE;IACpE,8DAA8D;IAC9D,+BAA+B;IAC/B,2BAA2B;IAC3B,oEAAoE;IACpE,iEAAiE;IACjE,mEAAmE;IACnE,oEAAoE;IACpE,kEAAkE;IAClE,kCAAkC;IAClC,+BAA+B;IAC/B,+BAA+B;IAC/B,8EAA8E;IAC9E,sEAAsE;IACtE,uEAAuE;IACvE,oEAAoE;IACpE,oEAAoE;IACpE,yEAAyE;IACzE,kEAAkE;IAClE,yCAAyC;IACzC,sCAAsC;IACtC,4BAA4B;IAC5B,+BAA+B;IAC/B,sEAAsE;IACtE,wEAAwE;IACxE,oEAAoE;IACpE,qEAAqE;IACrE,kEAAkE;IAClE,oEAAoE;IACpE,gCAAgC;IAChC,wEAAwE;IACxE,oEAAoE;IACpE,wEAAwE;IACxE,wEAAwE;IACxE,mEAAmE;IACnE,qEAAqE;IACrE,mCAAmC;CAC7B,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,yBAAyB;IACzB,2BAA2B;CACrB,CAAC;AAKX,gEAAgE;AAChE,MAAM,UAAU,WAAW,CAAC,IAAY;IACpC,OAAQ,eAAqC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,gBAAgB,CAAC,IAAY;IACzC,OAAQ,sBAA4C,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -31,9 +31,9 @@ export interface CollectedTool {
|
|
|
31
31
|
* name. The CapturingServer must have been used to register the L1/L2
|
|
32
32
|
* tools, and `registerAdvancedTool` must have run, before this is called.
|
|
33
33
|
*
|
|
34
|
-
* Production size =
|
|
35
|
-
*
|
|
36
|
-
* + 2 L3 direct (real server) + 1 gateway (real server) =
|
|
34
|
+
* Production size = 30 (post-F116):
|
|
35
|
+
* 23 L1 essentials (real server) + 4 L2 advanced (registry)
|
|
36
|
+
* + 2 L3 direct (real server) + 1 gateway (real server) = 30.
|
|
37
37
|
*/
|
|
38
38
|
export declare function collectAllRegisteredTools(server: McpServer, capturing: CapturingServer): Record<string, CollectedTool>;
|
|
39
39
|
/** By-name lookup over a `collectAllRegisteredTools` map. */
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
* name. The CapturingServer must have been used to register the L1/L2
|
|
21
21
|
* tools, and `registerAdvancedTool` must have run, before this is called.
|
|
22
22
|
*
|
|
23
|
-
* Production size =
|
|
24
|
-
*
|
|
25
|
-
* + 2 L3 direct (real server) + 1 gateway (real server) =
|
|
23
|
+
* Production size = 30 (post-F116):
|
|
24
|
+
* 23 L1 essentials (real server) + 4 L2 advanced (registry)
|
|
25
|
+
* + 2 L3 direct (real server) + 1 gateway (real server) = 30.
|
|
26
26
|
*/
|
|
27
27
|
export function collectAllRegisteredTools(server, capturing) {
|
|
28
28
|
const result = {};
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export { createServer, SERVER_NAME, SERVER_VERSION } from './server.js';
|
|
15
15
|
export { RestClient, REST_NAMESPACE_PATH, encodeElementPath } from './client.js';
|
|
16
|
-
export { loadConfig, loadRegistry, isTestMode, ENV_SITE_URL, ENV_WP_URL, ENV_BEARER, ENV_SITES_FILE, ENV_TEST_MODE, } from './auth.js';
|
|
16
|
+
export { loadConfig, loadRegistry, isTestMode, ENV_SITE_URL, ENV_WP_URL, ENV_BEARER, ENV_SITES_FILE, ENV_PLATFORM, ENV_PROFILE, ENV_TEST_MODE, } from './auth.js';
|
|
17
|
+
export { bootstrapActiveSite } from './sites/bootstrap.js';
|
|
17
18
|
export { ConfigError, RestError, NetworkError } from './errors.js';
|
|
18
19
|
export { buildAllTools } from './tools/index.js';
|
|
19
20
|
export { ClientPool, NoDefaultSiteError, UnknownSiteError } from './sites/client-pool.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[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|
|
|
14
14
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
15
15
|
import { isTestMode, loadRegistry } from './auth.js';
|
|
16
16
|
import { ConfigError } from './errors.js';
|
|
17
|
+
import { bootstrapActiveSite } from './sites/bootstrap.js';
|
|
17
18
|
import { ClientPool } from './sites/client-pool.js';
|
|
18
19
|
import { SiteRegistry } from './sites/registry.js';
|
|
19
20
|
import { defaultSecretResolver } from './sites/secret-resolver.js';
|
|
20
21
|
import { createServer } from './server.js';
|
|
21
22
|
export { createServer, SERVER_NAME, SERVER_VERSION } from './server.js';
|
|
22
23
|
export { RestClient, REST_NAMESPACE_PATH, encodeElementPath } from './client.js';
|
|
23
|
-
export { loadConfig, loadRegistry, isTestMode, ENV_SITE_URL, ENV_WP_URL, ENV_BEARER, ENV_SITES_FILE, ENV_TEST_MODE, } from './auth.js';
|
|
24
|
+
export { loadConfig, loadRegistry, isTestMode, ENV_SITE_URL, ENV_WP_URL, ENV_BEARER, ENV_SITES_FILE, ENV_PLATFORM, ENV_PROFILE, ENV_TEST_MODE, } from './auth.js';
|
|
25
|
+
export { bootstrapActiveSite } from './sites/bootstrap.js';
|
|
24
26
|
export { ConfigError, RestError, NetworkError } from './errors.js';
|
|
25
27
|
export { buildAllTools } from './tools/index.js';
|
|
26
28
|
// W6 — multi-site primitives exported for dist consumers (scripts,
|
|
@@ -34,6 +36,16 @@ export { CapturingServer, } from './gateway/capturing-server.js';
|
|
|
34
36
|
export { registerAdvancedTool } from './gateway/advanced-tool.js';
|
|
35
37
|
export { collectAllRegisteredTools, findTool, } from './gateway/test-support.js';
|
|
36
38
|
async function main() {
|
|
39
|
+
// Proxy mode: forward stdio 1:1 to the plugin-served PHP MCP endpoint and
|
|
40
|
+
// stop here — the fat catalog below is bypassed entirely. Default (fat) is
|
|
41
|
+
// unchanged. The dynamic import is gated on the env so the fat path never
|
|
42
|
+
// loads the proxy module (and the SDK client transport it pulls in) — keeps
|
|
43
|
+
// fat-mode startup lean and avoids loading proxy code when it can't apply.
|
|
44
|
+
if (process.env.YTB_MCP_MODE === 'proxy') {
|
|
45
|
+
const { maybeRunProxy } = await import('./proxy/bridge.js');
|
|
46
|
+
if (await maybeRunProxy(process.env))
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
37
49
|
const testMode = isTestMode();
|
|
38
50
|
// W10 — multi-site bootstrap is now centralised in
|
|
39
51
|
// `auth.loadRegistry()`. The canonical resolution order is:
|
|
@@ -79,6 +91,12 @@ async function main() {
|
|
|
79
91
|
}
|
|
80
92
|
const secretResolver = defaultSecretResolver();
|
|
81
93
|
const pool = new ClientPool(registry, secretResolver);
|
|
94
|
+
// Phase 3 — honour YTB_MCP_PROFILE: seed the pool's active-site
|
|
95
|
+
// override so a multi-client config (one MCP entry per site, each
|
|
96
|
+
// with its own profile) boots on the right site without a first
|
|
97
|
+
// tool call. No-op when unset / "default" / unknown — mirrors
|
|
98
|
+
// api-mapper's bootstrapActiveProfile. Pure in-memory pointer move.
|
|
99
|
+
bootstrapActiveSite(pool);
|
|
82
100
|
const { mcp, tools } = createServer({ pool });
|
|
83
101
|
if (testMode) {
|
|
84
102
|
// Print a one-line per tool summary to stderr (stdout is reserved
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,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
27
|
— the universal-marker path recognised by Claude Desktop and other AI
|
|
28
28
|
clients that follow the \`~/AGENTS.md\` discovery protocol.
|
|
29
29
|
|
|
30
|
-
It documents the
|
|
30
|
+
It documents the 30 MCP tools (29 domain + 1 gateway, 26 entries in
|
|
31
31
|
\`tools/list\`), the 5 canonical workflows (build hero, bind dynamic
|
|
32
32
|
source, clone section, diagnose 401, add custom element), and the
|
|
33
33
|
gateway routing model. Source: https://github.com/wootsup/yt-builder-mcp.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
2
|
+
/**
|
|
3
|
+
* Wire two MCP transports into a transparent pipe: every message from one side
|
|
4
|
+
* is relayed verbatim to the other, and a close/error on either side tears down
|
|
5
|
+
* the other. No transformation — the PHP server owns the protocol semantics.
|
|
6
|
+
* The caller is responsible for start()ing both transports.
|
|
7
|
+
*
|
|
8
|
+
* `StreamableHTTPClientTransport.send()` re-throws on any upstream failure
|
|
9
|
+
* (401/5xx/connection refused / missing PHP endpoint). The forwarders MUST NOT
|
|
10
|
+
* fire-and-forget that rejection: an unhandled rejection crashes the Node
|
|
11
|
+
* process, so a wrong key / unreachable site would kill the proxy on the first
|
|
12
|
+
* `initialize` instead of surfacing an actionable error. Each direction
|
|
13
|
+
* therefore `.catch()`es its `send()`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function bridgeTransports(local: Transport, remote: Transport): void;
|
|
16
|
+
/** Build the real transports + bridge them; resolves when EITHER side closes. */
|
|
17
|
+
export declare function runProxy(config: {
|
|
18
|
+
endpointUrl: URL;
|
|
19
|
+
token: string;
|
|
20
|
+
}, deps?: {
|
|
21
|
+
makeTransports?: (c: {
|
|
22
|
+
endpointUrl: URL;
|
|
23
|
+
token: string;
|
|
24
|
+
}) => {
|
|
25
|
+
local: Transport;
|
|
26
|
+
remote: Transport;
|
|
27
|
+
};
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
/** Returns true if proxy mode handled the run; false → caller continues with fat. */
|
|
30
|
+
export declare function maybeRunProxy(env: NodeJS.ProcessEnv, deps?: {
|
|
31
|
+
runProxy?: (c: {
|
|
32
|
+
endpointUrl: URL;
|
|
33
|
+
token: string;
|
|
34
|
+
}) => Promise<void>;
|
|
35
|
+
}): Promise<boolean>;
|
|
36
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/proxy/bridge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AA6B/E;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CA2C1E;AAcD,iFAAiF;AACjF,wBAAsB,QAAQ,CAC5B,MAAM,EAAE;IAAE,WAAW,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAC3C,IAAI,GAAE;IACJ,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,WAAW,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK;QAC3D,KAAK,EAAE,SAAS,CAAC;QACjB,MAAM,EAAE,SAAS,CAAC;KACnB,CAAC;CACE,GACL,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED,qFAAqF;AACrF,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,WAAW,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAAO,GAClF,OAAO,CAAC,OAAO,CAAC,CAMlB"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
2
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
3
|
+
import { resolveMode } from './mode.js';
|
|
4
|
+
/** Narrow an unknown caught value to a human-readable message (no `any`). */
|
|
5
|
+
function errorMessage(err) {
|
|
6
|
+
if (err instanceof Error)
|
|
7
|
+
return err.message;
|
|
8
|
+
if (typeof err === 'string')
|
|
9
|
+
return err;
|
|
10
|
+
try {
|
|
11
|
+
return String(err);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return 'unknown error';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A forwarded message is request-shaped (and therefore answerable with a
|
|
19
|
+
* JSON-RPC error) iff it carries a non-null `id`. Notifications have no `id`.
|
|
20
|
+
*/
|
|
21
|
+
function requestId(msg) {
|
|
22
|
+
if (msg !== null && typeof msg === 'object' && 'id' in msg) {
|
|
23
|
+
const id = msg.id;
|
|
24
|
+
if (typeof id === 'string' || typeof id === 'number')
|
|
25
|
+
return id;
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Wire two MCP transports into a transparent pipe: every message from one side
|
|
31
|
+
* is relayed verbatim to the other, and a close/error on either side tears down
|
|
32
|
+
* the other. No transformation — the PHP server owns the protocol semantics.
|
|
33
|
+
* The caller is responsible for start()ing both transports.
|
|
34
|
+
*
|
|
35
|
+
* `StreamableHTTPClientTransport.send()` re-throws on any upstream failure
|
|
36
|
+
* (401/5xx/connection refused / missing PHP endpoint). The forwarders MUST NOT
|
|
37
|
+
* fire-and-forget that rejection: an unhandled rejection crashes the Node
|
|
38
|
+
* process, so a wrong key / unreachable site would kill the proxy on the first
|
|
39
|
+
* `initialize` instead of surfacing an actionable error. Each direction
|
|
40
|
+
* therefore `.catch()`es its `send()`.
|
|
41
|
+
*/
|
|
42
|
+
export function bridgeTransports(local, remote) {
|
|
43
|
+
local.onmessage = (msg) => {
|
|
44
|
+
remote.send(msg).catch((err) => {
|
|
45
|
+
const message = errorMessage(err);
|
|
46
|
+
// stderr only — stdout is the JSON-RPC channel.
|
|
47
|
+
console.error('[yt-builder-proxy] upstream send failed:', message);
|
|
48
|
+
const id = requestId(msg);
|
|
49
|
+
if (id !== null) {
|
|
50
|
+
// Hand the client an actionable error instead of a dead pipe.
|
|
51
|
+
const frame = {
|
|
52
|
+
jsonrpc: '2.0',
|
|
53
|
+
id,
|
|
54
|
+
error: {
|
|
55
|
+
code: -32000,
|
|
56
|
+
message: `Proxy upstream error: ${message}. Check YTB_MCP_SITE_URL / YTB_MCP_BEARER_TOKEN.`,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
local.send(frame).catch((sendErr) => {
|
|
60
|
+
console.error('[yt-builder-proxy] failed to deliver error frame:', errorMessage(sendErr));
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
// A notification has no id to answer — tear the pipe down instead.
|
|
65
|
+
void remote.close();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
remote.onmessage = (msg) => {
|
|
70
|
+
local.send(msg).catch((err) => {
|
|
71
|
+
console.error('[yt-builder-proxy] downstream send failed:', errorMessage(err));
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
local.onclose = () => {
|
|
75
|
+
void remote.close();
|
|
76
|
+
};
|
|
77
|
+
remote.onclose = () => {
|
|
78
|
+
void local.close();
|
|
79
|
+
};
|
|
80
|
+
local.onerror = (err) => {
|
|
81
|
+
console.error('[yt-builder-proxy] local transport error:', err.message);
|
|
82
|
+
};
|
|
83
|
+
remote.onerror = (err) => {
|
|
84
|
+
console.error('[yt-builder-proxy] remote transport error:', err.message);
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** Injection seam for tests — production builds the real SDK transports. */
|
|
88
|
+
function defaultTransports(config) {
|
|
89
|
+
const remote = new StreamableHTTPClientTransport(config.endpointUrl, {
|
|
90
|
+
requestInit: { headers: { Authorization: `Bearer ${config.token}` } },
|
|
91
|
+
});
|
|
92
|
+
const local = new StdioServerTransport();
|
|
93
|
+
return { local, remote };
|
|
94
|
+
}
|
|
95
|
+
/** Build the real transports + bridge them; resolves when EITHER side closes. */
|
|
96
|
+
export async function runProxy(config, deps = {}) {
|
|
97
|
+
const { local, remote } = (deps.makeTransports ?? defaultTransports)(config);
|
|
98
|
+
// Resolve the moment EITHER transport closes — never hang if the remote
|
|
99
|
+
// (upstream) drops first. Capture the bridge's own onclose handlers so the
|
|
100
|
+
// cross-teardown wiring still runs.
|
|
101
|
+
const closed = new Promise((resolve) => {
|
|
102
|
+
bridgeTransports(local, remote);
|
|
103
|
+
const prevLocalClose = local.onclose;
|
|
104
|
+
const prevRemoteClose = remote.onclose;
|
|
105
|
+
local.onclose = () => {
|
|
106
|
+
prevLocalClose?.();
|
|
107
|
+
resolve();
|
|
108
|
+
};
|
|
109
|
+
remote.onclose = () => {
|
|
110
|
+
prevRemoteClose?.();
|
|
111
|
+
resolve();
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
// Start LOCAL (stdio) first so the listener is installed before any client
|
|
115
|
+
// message can race in; only then open the upstream connection.
|
|
116
|
+
await local.start();
|
|
117
|
+
await remote.start();
|
|
118
|
+
await closed;
|
|
119
|
+
}
|
|
120
|
+
/** Returns true if proxy mode handled the run; false → caller continues with fat. */
|
|
121
|
+
export async function maybeRunProxy(env, deps = {}) {
|
|
122
|
+
const resolved = resolveMode(env);
|
|
123
|
+
if (resolved.mode !== 'proxy')
|
|
124
|
+
return false;
|
|
125
|
+
const run = deps.runProxy ?? runProxy;
|
|
126
|
+
await run({ endpointUrl: resolved.endpointUrl, token: resolved.token });
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=bridge.js.map
|