@wootsup/yt-builder-mcp 0.2.0-alpha.2
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/LICENSE +21 -0
- package/README.md +221 -0
- package/bin/yt-builder-mcp.js +59 -0
- package/dist/auth.d.ts +39 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +93 -0
- package/dist/auth.js.map +1 -0
- package/dist/client.d.ts +84 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +151 -0
- package/dist/client.js.map +1 -0
- package/dist/clients/claude-code.d.ts +18 -0
- package/dist/clients/claude-code.d.ts.map +1 -0
- package/dist/clients/claude-code.js +53 -0
- package/dist/clients/claude-code.js.map +1 -0
- package/dist/clients/claude-desktop.d.ts +19 -0
- package/dist/clients/claude-desktop.d.ts.map +1 -0
- package/dist/clients/claude-desktop.js +56 -0
- package/dist/clients/claude-desktop.js.map +1 -0
- package/dist/clients/cline.d.ts +26 -0
- package/dist/clients/cline.d.ts.map +1 -0
- package/dist/clients/cline.js +80 -0
- package/dist/clients/cline.js.map +1 -0
- package/dist/clients/codex-cli.d.ts +42 -0
- package/dist/clients/codex-cli.d.ts.map +1 -0
- package/dist/clients/codex-cli.js +194 -0
- package/dist/clients/codex-cli.js.map +1 -0
- package/dist/clients/continue.d.ts +13 -0
- package/dist/clients/continue.d.ts.map +1 -0
- package/dist/clients/continue.js +52 -0
- package/dist/clients/continue.js.map +1 -0
- package/dist/clients/cursor.d.ts +12 -0
- package/dist/clients/cursor.d.ts.map +1 -0
- package/dist/clients/cursor.js +38 -0
- package/dist/clients/cursor.js.map +1 -0
- package/dist/clients/gemini-cli.d.ts +18 -0
- package/dist/clients/gemini-cli.d.ts.map +1 -0
- package/dist/clients/gemini-cli.js +44 -0
- package/dist/clients/gemini-cli.js.map +1 -0
- package/dist/clients/home.d.ts +14 -0
- package/dist/clients/home.d.ts.map +1 -0
- package/dist/clients/home.js +20 -0
- package/dist/clients/home.js.map +1 -0
- package/dist/clients/index.d.ts +52 -0
- package/dist/clients/index.d.ts.map +1 -0
- package/dist/clients/index.js +72 -0
- package/dist/clients/index.js.map +1 -0
- package/dist/clients/roo-code.d.ts +23 -0
- package/dist/clients/roo-code.d.ts.map +1 -0
- package/dist/clients/roo-code.js +69 -0
- package/dist/clients/roo-code.js.map +1 -0
- package/dist/clients/zed.d.ts +12 -0
- package/dist/clients/zed.d.ts.map +1 -0
- package/dist/clients/zed.js +41 -0
- package/dist/clients/zed.js.map +1 -0
- package/dist/errors/hints.d.ts +51 -0
- package/dist/errors/hints.d.ts.map +1 -0
- package/dist/errors/hints.js +95 -0
- package/dist/errors/hints.js.map +1 -0
- package/dist/errors/mask.d.ts +35 -0
- package/dist/errors/mask.d.ts.map +1 -0
- package/dist/errors/mask.js +49 -0
- package/dist/errors/mask.js.map +1 -0
- package/dist/errors/sanitize.d.ts +31 -0
- package/dist/errors/sanitize.d.ts.map +1 -0
- package/dist/errors/sanitize.js +90 -0
- package/dist/errors/sanitize.js.map +1 -0
- package/dist/errors.d.ts +42 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +61 -0
- package/dist/errors.js.map +1 -0
- package/dist/gateway/advanced-tool/discovery.d.ts +19 -0
- package/dist/gateway/advanced-tool/discovery.d.ts.map +1 -0
- package/dist/gateway/advanced-tool/discovery.js +53 -0
- package/dist/gateway/advanced-tool/discovery.js.map +1 -0
- package/dist/gateway/advanced-tool/domains.d.ts +42 -0
- package/dist/gateway/advanced-tool/domains.d.ts.map +1 -0
- package/dist/gateway/advanced-tool/domains.js +88 -0
- package/dist/gateway/advanced-tool/domains.js.map +1 -0
- package/dist/gateway/advanced-tool/execute.d.ts +29 -0
- package/dist/gateway/advanced-tool/execute.d.ts.map +1 -0
- package/dist/gateway/advanced-tool/execute.js +54 -0
- package/dist/gateway/advanced-tool/execute.js.map +1 -0
- package/dist/gateway/advanced-tool/index.d.ts +36 -0
- package/dist/gateway/advanced-tool/index.d.ts.map +1 -0
- package/dist/gateway/advanced-tool/index.js +39 -0
- package/dist/gateway/advanced-tool/index.js.map +1 -0
- package/dist/gateway/advanced-tool/register.d.ts +18 -0
- package/dist/gateway/advanced-tool/register.d.ts.map +1 -0
- package/dist/gateway/advanced-tool/register.js +62 -0
- package/dist/gateway/advanced-tool/register.js.map +1 -0
- package/dist/gateway/advanced-tool.d.ts +13 -0
- package/dist/gateway/advanced-tool.d.ts.map +1 -0
- package/dist/gateway/advanced-tool.js +13 -0
- package/dist/gateway/advanced-tool.js.map +1 -0
- package/dist/gateway/capturing-server.d.ts +117 -0
- package/dist/gateway/capturing-server.d.ts.map +1 -0
- package/dist/gateway/capturing-server.js +103 -0
- package/dist/gateway/capturing-server.js.map +1 -0
- package/dist/gateway/essentials.d.ts +49 -0
- package/dist/gateway/essentials.d.ts.map +1 -0
- package/dist/gateway/essentials.js +62 -0
- package/dist/gateway/essentials.js.map +1 -0
- package/dist/gateway/test-support.d.ts +41 -0
- package/dist/gateway/test-support.d.ts.map +1 -0
- package/dist/gateway/test-support.js +60 -0
- package/dist/gateway/test-support.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -0
- package/dist/install-skill.d.ts +35 -0
- package/dist/install-skill.d.ts.map +1 -0
- package/dist/install-skill.js +107 -0
- package/dist/install-skill.js.map +1 -0
- package/dist/platform/index.d.ts +49 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +38 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/server.d.ts +50 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +117 -0
- package/dist/server.js.map +1 -0
- package/dist/setup-cli.d.ts +100 -0
- package/dist/setup-cli.d.ts.map +1 -0
- package/dist/setup-cli.js +355 -0
- package/dist/setup-cli.js.map +1 -0
- package/dist/setup-prompts.d.ts +41 -0
- package/dist/setup-prompts.d.ts.map +1 -0
- package/dist/setup-prompts.js +142 -0
- package/dist/setup-prompts.js.map +1 -0
- package/dist/setup-token.d.ts +38 -0
- package/dist/setup-token.d.ts.map +1 -0
- package/dist/setup-token.js +106 -0
- package/dist/setup-token.js.map +1 -0
- package/dist/setup-wizard-defaults.d.ts +43 -0
- package/dist/setup-wizard-defaults.d.ts.map +1 -0
- package/dist/setup-wizard-defaults.js +160 -0
- package/dist/setup-wizard-defaults.js.map +1 -0
- package/dist/setup-wizard-handshake.d.ts +25 -0
- package/dist/setup-wizard-handshake.d.ts.map +1 -0
- package/dist/setup-wizard-handshake.js +103 -0
- package/dist/setup-wizard-handshake.js.map +1 -0
- package/dist/setup-wizard-types.d.ts +148 -0
- package/dist/setup-wizard-types.d.ts.map +1 -0
- package/dist/setup-wizard-types.js +11 -0
- package/dist/setup-wizard-types.js.map +1 -0
- package/dist/setup-wizard.d.ts +33 -0
- package/dist/setup-wizard.d.ts.map +1 -0
- package/dist/setup-wizard.js +166 -0
- package/dist/setup-wizard.js.map +1 -0
- package/dist/setup.d.ts +17 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +33 -0
- package/dist/setup.js.map +1 -0
- package/dist/tools/elements/builders.d.ts +24 -0
- package/dist/tools/elements/builders.d.ts.map +1 -0
- package/dist/tools/elements/builders.js +150 -0
- package/dist/tools/elements/builders.js.map +1 -0
- package/dist/tools/elements/handlers-write.d.ts +48 -0
- package/dist/tools/elements/handlers-write.d.ts.map +1 -0
- package/dist/tools/elements/handlers-write.js +141 -0
- package/dist/tools/elements/handlers-write.js.map +1 -0
- package/dist/tools/elements/handlers.d.ts +56 -0
- package/dist/tools/elements/handlers.d.ts.map +1 -0
- package/dist/tools/elements/handlers.js +113 -0
- package/dist/tools/elements/handlers.js.map +1 -0
- package/dist/tools/elements/index.d.ts +28 -0
- package/dist/tools/elements/index.d.ts.map +1 -0
- package/dist/tools/elements/index.js +27 -0
- package/dist/tools/elements/index.js.map +1 -0
- package/dist/tools/elements.d.ts +13 -0
- package/dist/tools/elements.d.ts.map +1 -0
- package/dist/tools/elements.js +13 -0
- package/dist/tools/elements.js.map +1 -0
- package/dist/tools/elicitation.d.ts +87 -0
- package/dist/tools/elicitation.d.ts.map +1 -0
- package/dist/tools/elicitation.js +100 -0
- package/dist/tools/elicitation.js.map +1 -0
- package/dist/tools/format/elements-format.d.ts +34 -0
- package/dist/tools/format/elements-format.d.ts.map +1 -0
- package/dist/tools/format/elements-format.js +112 -0
- package/dist/tools/format/elements-format.js.map +1 -0
- package/dist/tools/format/health-format.d.ts +73 -0
- package/dist/tools/format/health-format.d.ts.map +1 -0
- package/dist/tools/format/health-format.js +178 -0
- package/dist/tools/format/health-format.js.map +1 -0
- package/dist/tools/format/inspection-format.d.ts +45 -0
- package/dist/tools/format/inspection-format.d.ts.map +1 -0
- package/dist/tools/format/inspection-format.js +125 -0
- package/dist/tools/format/inspection-format.js.map +1 -0
- package/dist/tools/format/pages-format.d.ts +39 -0
- package/dist/tools/format/pages-format.d.ts.map +1 -0
- package/dist/tools/format/pages-format.js +110 -0
- package/dist/tools/format/pages-format.js.map +1 -0
- package/dist/tools/format/sources-format.d.ts +25 -0
- package/dist/tools/format/sources-format.d.ts.map +1 -0
- package/dist/tools/format/sources-format.js +113 -0
- package/dist/tools/format/sources-format.js.map +1 -0
- package/dist/tools/health.d.ts +22 -0
- package/dist/tools/health.d.ts.map +1 -0
- package/dist/tools/health.js +147 -0
- package/dist/tools/health.js.map +1 -0
- package/dist/tools/index.d.ts +23 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +23 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/inspection.d.ts +14 -0
- package/dist/tools/inspection.d.ts.map +1 -0
- package/dist/tools/inspection.js +115 -0
- package/dist/tools/inspection.js.map +1 -0
- package/dist/tools/layout-flatten.d.ts +63 -0
- package/dist/tools/layout-flatten.d.ts.map +1 -0
- package/dist/tools/layout-flatten.js +95 -0
- package/dist/tools/layout-flatten.js.map +1 -0
- package/dist/tools/pages/builders.d.ts +14 -0
- package/dist/tools/pages/builders.d.ts.map +1 -0
- package/dist/tools/pages/builders.js +97 -0
- package/dist/tools/pages/builders.js.map +1 -0
- package/dist/tools/pages/handlers-read.d.ts +24 -0
- package/dist/tools/pages/handlers-read.d.ts.map +1 -0
- package/dist/tools/pages/handlers-read.js +141 -0
- package/dist/tools/pages/handlers-read.js.map +1 -0
- package/dist/tools/pages/handlers-write.d.ts +21 -0
- package/dist/tools/pages/handlers-write.d.ts.map +1 -0
- package/dist/tools/pages/handlers-write.js +52 -0
- package/dist/tools/pages/handlers-write.js.map +1 -0
- package/dist/tools/pages/index.d.ts +17 -0
- package/dist/tools/pages/index.d.ts.map +1 -0
- package/dist/tools/pages/index.js +17 -0
- package/dist/tools/pages/index.js.map +1 -0
- package/dist/tools/pages/schemas.d.ts +30 -0
- package/dist/tools/pages/schemas.d.ts.map +1 -0
- package/dist/tools/pages/schemas.js +30 -0
- package/dist/tools/pages/schemas.js.map +1 -0
- package/dist/tools/pages.d.ts +13 -0
- package/dist/tools/pages.d.ts.map +1 -0
- package/dist/tools/pages.js +13 -0
- package/dist/tools/pages.js.map +1 -0
- package/dist/tools/progress-phases.d.ts +46 -0
- package/dist/tools/progress-phases.d.ts.map +1 -0
- package/dist/tools/progress-phases.js +48 -0
- package/dist/tools/progress-phases.js.map +1 -0
- package/dist/tools/shared-schemas.d.ts +15 -0
- package/dist/tools/shared-schemas.d.ts.map +1 -0
- package/dist/tools/shared-schemas.js +30 -0
- package/dist/tools/shared-schemas.js.map +1 -0
- package/dist/tools/sources/builders.d.ts +13 -0
- package/dist/tools/sources/builders.d.ts.map +1 -0
- package/dist/tools/sources/builders.js +88 -0
- package/dist/tools/sources/builders.js.map +1 -0
- package/dist/tools/sources/handlers-bind.d.ts +26 -0
- package/dist/tools/sources/handlers-bind.d.ts.map +1 -0
- package/dist/tools/sources/handlers-bind.js +123 -0
- package/dist/tools/sources/handlers-bind.js.map +1 -0
- package/dist/tools/sources/handlers.d.ts +45 -0
- package/dist/tools/sources/handlers.d.ts.map +1 -0
- package/dist/tools/sources/handlers.js +84 -0
- package/dist/tools/sources/handlers.js.map +1 -0
- package/dist/tools/sources/index.d.ts +19 -0
- package/dist/tools/sources/index.d.ts.map +1 -0
- package/dist/tools/sources/index.js +18 -0
- package/dist/tools/sources/index.js.map +1 -0
- package/dist/tools/sources.d.ts +14 -0
- package/dist/tools/sources.d.ts.map +1 -0
- package/dist/tools/sources.js +14 -0
- package/dist/tools/sources.js.map +1 -0
- package/dist/tools/sparse-fields.d.ts +80 -0
- package/dist/tools/sparse-fields.d.ts.map +1 -0
- package/dist/tools/sparse-fields.js +144 -0
- package/dist/tools/sparse-fields.js.map +1 -0
- package/dist/tools/tool-builder/annotations.d.ts +22 -0
- package/dist/tools/tool-builder/annotations.d.ts.map +1 -0
- package/dist/tools/tool-builder/annotations.js +35 -0
- package/dist/tools/tool-builder/annotations.js.map +1 -0
- package/dist/tools/tool-builder/define.d.ts +31 -0
- package/dist/tools/tool-builder/define.d.ts.map +1 -0
- package/dist/tools/tool-builder/define.js +31 -0
- package/dist/tools/tool-builder/define.js.map +1 -0
- package/dist/tools/tool-builder/index.d.ts +28 -0
- package/dist/tools/tool-builder/index.d.ts.map +1 -0
- package/dist/tools/tool-builder/index.js +27 -0
- package/dist/tools/tool-builder/index.js.map +1 -0
- package/dist/tools/tool-builder/results.d.ts +59 -0
- package/dist/tools/tool-builder/results.d.ts.map +1 -0
- package/dist/tools/tool-builder/results.js +125 -0
- package/dist/tools/tool-builder/results.js.map +1 -0
- package/dist/tools/tool-builder/types.d.ts +82 -0
- package/dist/tools/tool-builder/types.d.ts.map +1 -0
- package/dist/tools/tool-builder/types.js +9 -0
- package/dist/tools/tool-builder/types.js.map +1 -0
- package/dist/tools/tool-builder.d.ts +16 -0
- package/dist/tools/tool-builder.d.ts.map +1 -0
- package/dist/tools/tool-builder.js +16 -0
- package/dist/tools/tool-builder.js.map +1 -0
- package/icon.png +0 -0
- package/manifest.json +63 -0
- package/package.json +81 -0
- package/skills/yootheme-builder/SKILL.md +582 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wave G.5 + Round-1.5 — shared progress labels for write handlers.
|
|
3
|
+
*
|
|
4
|
+
* Two contracts coexist:
|
|
5
|
+
*
|
|
6
|
+
* ─── 2-phase (element_* mutations) ───────────────────────────────────
|
|
7
|
+
*
|
|
8
|
+
* 0/2 PHASE_SEND — before the REST call,
|
|
9
|
+
* 2/2 PHASE_CONFIRM — after a 2xx response.
|
|
10
|
+
*
|
|
11
|
+
* Used by the five element_* write tools (add / update_settings / move /
|
|
12
|
+
* clone / delete). Each is a single shallow `wp_option('yootheme')` write
|
|
13
|
+
* — the request completes in tens of milliseconds and there is no
|
|
14
|
+
* client-observable window between dispatch and confirmation that would
|
|
15
|
+
* benefit from a synthetic intermediate event.
|
|
16
|
+
*
|
|
17
|
+
* ─── 3-phase (page_save / page_publish) ──────────────────────────────
|
|
18
|
+
*
|
|
19
|
+
* 0/3 PHASE_SEND — before the REST call,
|
|
20
|
+
* 1/3 PHASE_SERVER — synthetic intermediate, emitted AFTER dispatch
|
|
21
|
+
* starts but BEFORE the await resolves; lets the
|
|
22
|
+
* MCP-client UI render a mid-flight indicator
|
|
23
|
+
* matching the reference UX intent without
|
|
24
|
+
* requiring an SSE-streaming REST endpoint.
|
|
25
|
+
* 2/3 PHASE_CONFIRM — after a 2xx response.
|
|
26
|
+
*
|
|
27
|
+
* Reserved for the two page-level mutations (`page_save` /
|
|
28
|
+
* `page_publish`). Both trigger a save-transform pass + a full layout
|
|
29
|
+
* re-serialisation on the PHP side; on large templates this can take
|
|
30
|
+
* 500-3000 ms — well over the perceptual threshold where a mid-flight
|
|
31
|
+
* progress signal materially improves the operator experience.
|
|
32
|
+
*
|
|
33
|
+
* Round-1.5 revert: an earlier Round-1 audit amendment collapsed the
|
|
34
|
+
* page_save / page_publish handlers down to 2-phase on the grounds that
|
|
35
|
+
* the synthetic intermediate was "theatre". Thomas-mandate 2026-05-22
|
|
36
|
+
* reinstates the 3-phase contract: the intermediate is honest if it
|
|
37
|
+
* marks an observable boundary (dispatch-start → await-resolved is one
|
|
38
|
+
* such boundary even without server-side streaming, because the
|
|
39
|
+
* dispatch itself is non-blocking from the host UI's perspective).
|
|
40
|
+
*
|
|
41
|
+
* @license MIT
|
|
42
|
+
*/
|
|
43
|
+
export declare const PHASE_SEND = "Sending write request";
|
|
44
|
+
export declare const PHASE_CONFIRM = "Confirmed by server";
|
|
45
|
+
export declare const PHASE_SERVER = "Server processing";
|
|
46
|
+
//# sourceMappingURL=progress-phases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-phases.d.ts","sourceRoot":"","sources":["../../src/tools/progress-phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,eAAO,MAAM,UAAU,0BAA0B,CAAC;AAClD,eAAO,MAAM,aAAa,wBAAwB,CAAC;AAGnD,eAAO,MAAM,YAAY,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wave G.5 + Round-1.5 — shared progress labels for write handlers.
|
|
3
|
+
*
|
|
4
|
+
* Two contracts coexist:
|
|
5
|
+
*
|
|
6
|
+
* ─── 2-phase (element_* mutations) ───────────────────────────────────
|
|
7
|
+
*
|
|
8
|
+
* 0/2 PHASE_SEND — before the REST call,
|
|
9
|
+
* 2/2 PHASE_CONFIRM — after a 2xx response.
|
|
10
|
+
*
|
|
11
|
+
* Used by the five element_* write tools (add / update_settings / move /
|
|
12
|
+
* clone / delete). Each is a single shallow `wp_option('yootheme')` write
|
|
13
|
+
* — the request completes in tens of milliseconds and there is no
|
|
14
|
+
* client-observable window between dispatch and confirmation that would
|
|
15
|
+
* benefit from a synthetic intermediate event.
|
|
16
|
+
*
|
|
17
|
+
* ─── 3-phase (page_save / page_publish) ──────────────────────────────
|
|
18
|
+
*
|
|
19
|
+
* 0/3 PHASE_SEND — before the REST call,
|
|
20
|
+
* 1/3 PHASE_SERVER — synthetic intermediate, emitted AFTER dispatch
|
|
21
|
+
* starts but BEFORE the await resolves; lets the
|
|
22
|
+
* MCP-client UI render a mid-flight indicator
|
|
23
|
+
* matching the reference UX intent without
|
|
24
|
+
* requiring an SSE-streaming REST endpoint.
|
|
25
|
+
* 2/3 PHASE_CONFIRM — after a 2xx response.
|
|
26
|
+
*
|
|
27
|
+
* Reserved for the two page-level mutations (`page_save` /
|
|
28
|
+
* `page_publish`). Both trigger a save-transform pass + a full layout
|
|
29
|
+
* re-serialisation on the PHP side; on large templates this can take
|
|
30
|
+
* 500-3000 ms — well over the perceptual threshold where a mid-flight
|
|
31
|
+
* progress signal materially improves the operator experience.
|
|
32
|
+
*
|
|
33
|
+
* Round-1.5 revert: an earlier Round-1 audit amendment collapsed the
|
|
34
|
+
* page_save / page_publish handlers down to 2-phase on the grounds that
|
|
35
|
+
* the synthetic intermediate was "theatre". Thomas-mandate 2026-05-22
|
|
36
|
+
* reinstates the 3-phase contract: the intermediate is honest if it
|
|
37
|
+
* marks an observable boundary (dispatch-start → await-resolved is one
|
|
38
|
+
* such boundary even without server-side streaming, because the
|
|
39
|
+
* dispatch itself is non-blocking from the host UI's perspective).
|
|
40
|
+
*
|
|
41
|
+
* @license MIT
|
|
42
|
+
*/
|
|
43
|
+
// ── 2-phase (element_*) ─────────────────────────────────────────────
|
|
44
|
+
export const PHASE_SEND = 'Sending write request';
|
|
45
|
+
export const PHASE_CONFIRM = 'Confirmed by server';
|
|
46
|
+
// ── 3-phase intermediate (page_save / page_publish only) ────────────
|
|
47
|
+
export const PHASE_SERVER = 'Server processing';
|
|
48
|
+
//# sourceMappingURL=progress-phases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-phases.js","sourceRoot":"","sources":["../../src/tools/progress-phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,UAAU,GAAG,uBAAuB,CAAC;AAClD,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAEnD,uEAAuE;AACvE,MAAM,CAAC,MAAM,YAAY,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Zod schemas — Wave-6 Fix 20.
|
|
3
|
+
*
|
|
4
|
+
* Centralises the schema definitions reused across pages, elements and
|
|
5
|
+
* sources tool builders, so a description tweak lands in one place
|
|
6
|
+
* instead of three.
|
|
7
|
+
*
|
|
8
|
+
* @license MIT
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
export declare const TEMPLATE_ID: z.ZodString;
|
|
12
|
+
export declare const ELEMENT_PATH: z.ZodString;
|
|
13
|
+
export declare const ETAG: z.ZodString;
|
|
14
|
+
export declare const PROPS: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
15
|
+
//# sourceMappingURL=shared-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-schemas.d.ts","sourceRoot":"","sources":["../../src/tools/shared-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,WAAW,aAKnB,CAAC;AAEN,eAAO,MAAM,YAAY,aAMpB,CAAC;AAEN,eAAO,MAAM,IAAI,aAOZ,CAAC;AAEN,eAAO,MAAM,KAAK,wCAKb,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Zod schemas — Wave-6 Fix 20.
|
|
3
|
+
*
|
|
4
|
+
* Centralises the schema definitions reused across pages, elements and
|
|
5
|
+
* sources tool builders, so a description tweak lands in one place
|
|
6
|
+
* instead of three.
|
|
7
|
+
*
|
|
8
|
+
* @license MIT
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
export const TEMPLATE_ID = z
|
|
12
|
+
.string()
|
|
13
|
+
.min(1)
|
|
14
|
+
.describe('Template ID (e.g. "default"). Use yootheme_builder_pages_list to discover.');
|
|
15
|
+
export const ELEMENT_PATH = z
|
|
16
|
+
.string()
|
|
17
|
+
.min(1)
|
|
18
|
+
.describe('JSON-Pointer path to the element (e.g. "/0/children/2"). Use ' +
|
|
19
|
+
'yootheme_builder_element_list to discover available paths.');
|
|
20
|
+
export const ETAG = z
|
|
21
|
+
.string()
|
|
22
|
+
.min(1)
|
|
23
|
+
.describe('Optimistic-lock ETag from yootheme_builder_get_etag. Required to ' +
|
|
24
|
+
'detect concurrent edits — call get_etag first, pass the value here. ' +
|
|
25
|
+
'On 412 Precondition Failed, re-fetch the ETag and retry.');
|
|
26
|
+
export const PROPS = z
|
|
27
|
+
.record(z.string(), z.unknown())
|
|
28
|
+
.describe('Element props object (e.g. `{title: "Hello", margin: "default"}`). ' +
|
|
29
|
+
'Use yootheme_builder_element_type_get_schema to discover available keys.');
|
|
30
|
+
//# sourceMappingURL=shared-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-schemas.js","sourceRoot":"","sources":["../../src/tools/shared-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACvB,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ,CACL,4EAA4E,CAC/E,CAAC;AAEN,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KACxB,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ,CACL,+DAA+D;IAC3D,4DAA4D,CACnE,CAAC;AAEN,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC;KAChB,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ,CACL,mEAAmE;IAC/D,sEAAsE;IACtE,0DAA0D,CACjE,CAAC;AAEN,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC;KACjB,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;KAC/B,QAAQ,CACL,qEAAqE;IACjE,0EAA0E,CACjF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-tool builders — pure `defineTool` factory list.
|
|
3
|
+
*
|
|
4
|
+
* Split out of `src/tools/sources.ts` (Wave G.4.0b). See `./handlers.ts`
|
|
5
|
+
* for the handler bodies.
|
|
6
|
+
*
|
|
7
|
+
* @license MIT
|
|
8
|
+
*/
|
|
9
|
+
import type { RestClient } from '../../client.js';
|
|
10
|
+
import { type AnyToolDefinition } from '../tool-builder.js';
|
|
11
|
+
import { type SourcesHandlerDeps } from './handlers.js';
|
|
12
|
+
export declare function buildSourcesTools(client: RestClient, deps?: Partial<SourcesHandlerDeps>): readonly AnyToolDefinition[];
|
|
13
|
+
//# sourceMappingURL=builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/tools/sources/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGH,KAAK,kBAAkB,EAK1B,MAAM,eAAe,CAAC;AAEvB,wBAAgB,iBAAiB,CAC7B,MAAM,EAAE,UAAU,EAClB,IAAI,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,GACnC,SAAS,iBAAiB,EAAE,CAuF9B"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-tool builders — pure `defineTool` factory list.
|
|
3
|
+
*
|
|
4
|
+
* Split out of `src/tools/sources.ts` (Wave G.4.0b). See `./handlers.ts`
|
|
5
|
+
* for the handler bodies.
|
|
6
|
+
*
|
|
7
|
+
* @license MIT
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { ELEMENT_PATH, ETAG, TEMPLATE_ID } from '../shared-schemas.js';
|
|
11
|
+
import { FIELDS } from '../sparse-fields.js';
|
|
12
|
+
import { defineTool, destructive, mutating, readOnly, } from '../tool-builder.js';
|
|
13
|
+
import { BINDING_OUTPUT_SCHEMA, SOURCES_LIST_OUTPUT_SCHEMA, handleElementBindSource, handleElementGetBinding, handleElementUnbindSource, handleSourcesList, } from './handlers.js';
|
|
14
|
+
export function buildSourcesTools(client, deps) {
|
|
15
|
+
const handlerDeps = {
|
|
16
|
+
client,
|
|
17
|
+
elicitation: deps?.elicitation,
|
|
18
|
+
};
|
|
19
|
+
return [
|
|
20
|
+
defineTool({
|
|
21
|
+
name: 'yootheme_builder_sources_list',
|
|
22
|
+
description: 'List Builder sources grouped by origin (apimapper/wordpress/' +
|
|
23
|
+
'essentials). Returns name+label per source — pick one for ' +
|
|
24
|
+
'`element_bind_source`. Pass `fields[]` to narrow each row.',
|
|
25
|
+
inputSchema: {
|
|
26
|
+
fields: FIELDS,
|
|
27
|
+
},
|
|
28
|
+
outputSchema: SOURCES_LIST_OUTPUT_SCHEMA,
|
|
29
|
+
annotations: readOnly('List Sources'),
|
|
30
|
+
handler: (input) => handleSourcesList(handlerDeps, input),
|
|
31
|
+
}),
|
|
32
|
+
defineTool({
|
|
33
|
+
name: 'yootheme_builder_element_get_binding',
|
|
34
|
+
description: 'Read the source binding (and source_config/source_args/etc.) attached to an ' +
|
|
35
|
+
'element. Returns the empty object if the element is not bound.',
|
|
36
|
+
inputSchema: {
|
|
37
|
+
template_id: TEMPLATE_ID,
|
|
38
|
+
element_path: ELEMENT_PATH,
|
|
39
|
+
},
|
|
40
|
+
outputSchema: BINDING_OUTPUT_SCHEMA,
|
|
41
|
+
annotations: readOnly('Get Source Binding'),
|
|
42
|
+
handler: (input) => handleElementGetBinding(handlerDeps, input),
|
|
43
|
+
}),
|
|
44
|
+
defineTool({
|
|
45
|
+
name: 'yootheme_builder_element_bind_source',
|
|
46
|
+
description: 'Bind a Builder source to an element (sets `props.source`). Pass ' +
|
|
47
|
+
'source_name from sources_list; pass source_id to disambiguate ' +
|
|
48
|
+
'cross-plugin name collisions. Requires ETag.',
|
|
49
|
+
inputSchema: {
|
|
50
|
+
template_id: TEMPLATE_ID,
|
|
51
|
+
element_path: ELEMENT_PATH,
|
|
52
|
+
source_name: z
|
|
53
|
+
.string()
|
|
54
|
+
.min(1)
|
|
55
|
+
.describe('Source name as listed by yootheme_builder_sources_list ' +
|
|
56
|
+
'(e.g. "wp_posts", "apimapper_my-flow").'),
|
|
57
|
+
source_id: z
|
|
58
|
+
.string()
|
|
59
|
+
.optional()
|
|
60
|
+
.describe('Optional explicit "<origin>:<name>" id; skips ambiguity ' +
|
|
61
|
+
'resolution when ≥2 sources share `source_name`.'),
|
|
62
|
+
etag: ETAG,
|
|
63
|
+
},
|
|
64
|
+
annotations: mutating('Bind Source'),
|
|
65
|
+
handler: (input) => handleElementBindSource(handlerDeps, input),
|
|
66
|
+
}),
|
|
67
|
+
defineTool({
|
|
68
|
+
name: 'yootheme_builder_element_unbind_source',
|
|
69
|
+
description: 'Remove the source binding from an element. Clears `props.source`. Destructive ' +
|
|
70
|
+
'in the sense that it may break dynamic-content rendering — always ask the ' +
|
|
71
|
+
'user to confirm. Requires ETag.',
|
|
72
|
+
inputSchema: {
|
|
73
|
+
template_id: TEMPLATE_ID,
|
|
74
|
+
element_path: ELEMENT_PATH,
|
|
75
|
+
etag: ETAG,
|
|
76
|
+
confirm: z
|
|
77
|
+
.boolean()
|
|
78
|
+
.optional()
|
|
79
|
+
.describe('Must be true to execute. On supporting hosts the agent is prompted ' +
|
|
80
|
+
'via MCP elicitation when omitted; otherwise the call returns a ' +
|
|
81
|
+
'preview and the agent must retry with `confirm: true`.'),
|
|
82
|
+
},
|
|
83
|
+
annotations: destructive('Unbind Source'),
|
|
84
|
+
handler: (input) => handleElementUnbindSource(handlerDeps, input),
|
|
85
|
+
}),
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=builders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.js","sourceRoot":"","sources":["../../../src/tools/sources/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACH,UAAU,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,GAEX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,qBAAqB,EACrB,0BAA0B,EAE1B,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,GACpB,MAAM,eAAe,CAAC;AAEvB,MAAM,UAAU,iBAAiB,CAC7B,MAAkB,EAClB,IAAkC;IAElC,MAAM,WAAW,GAAuB;QACpC,MAAM;QACN,WAAW,EAAE,IAAI,EAAE,WAAW;KACjC,CAAC;IAEF,OAAO;QACH,UAAU,CAAC;YACP,IAAI,EAAE,+BAA+B;YACrC,WAAW,EACP,8DAA8D;gBAC9D,4DAA4D;gBAC5D,4DAA4D;YAChE,WAAW,EAAE;gBACT,MAAM,EAAE,MAAM;aACjB;YACD,YAAY,EAAE,0BAA0B;YACxC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC;YACrC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC;SAC5D,CAAC;QAE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AAW,EAAE,WAAW,CAAC,eAAe,CAAC;YACzC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,yBAAyB,CAAC,WAAW,EAAE,KAAK,CAAC;SACpE,CAAC;KACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-binding write handlers (`element_bind_source`,
|
|
3
|
+
* `element_unbind_source`).
|
|
4
|
+
*
|
|
5
|
+
* Split out of `./handlers.ts` to keep each file under the 200-LoC
|
|
6
|
+
* budget. Wave G.4.2 adds destructive-confirm elicitation;
|
|
7
|
+
* Wave G.4.3 adds ambiguity-resolution elicitation.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
import { type ToolResult } from '../tool-builder.js';
|
|
12
|
+
import type { SourcesHandlerDeps } from './handlers.js';
|
|
13
|
+
export declare function handleElementBindSource({ client, elicitation }: SourcesHandlerDeps, input: {
|
|
14
|
+
template_id: string;
|
|
15
|
+
element_path: string;
|
|
16
|
+
source_name: string;
|
|
17
|
+
source_id?: string;
|
|
18
|
+
etag: string;
|
|
19
|
+
}): Promise<ToolResult>;
|
|
20
|
+
export declare function handleElementUnbindSource({ client, elicitation }: SourcesHandlerDeps, input: {
|
|
21
|
+
template_id: string;
|
|
22
|
+
element_path: string;
|
|
23
|
+
etag: string;
|
|
24
|
+
confirm?: boolean;
|
|
25
|
+
}): Promise<ToolResult>;
|
|
26
|
+
//# sourceMappingURL=handlers-bind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers-bind.d.ts","sourceRoot":"","sources":["../../../src/tools/sources/handlers-bind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAcH,OAAO,EAIH,KAAK,UAAU,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAwBxD,wBAAsB,uBAAuB,CACzC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,kBAAkB,EAC3C,KAAK,EAAE;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CAChB,GACF,OAAO,CAAC,UAAU,CAAC,CAiErB;AAID,wBAAsB,yBAAyB,CAC3C,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,kBAAkB,EAC3C,KAAK,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GACtF,OAAO,CAAC,UAAU,CAAC,CAoCrB"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-binding write handlers (`element_bind_source`,
|
|
3
|
+
* `element_unbind_source`).
|
|
4
|
+
*
|
|
5
|
+
* Split out of `./handlers.ts` to keep each file under the 200-LoC
|
|
6
|
+
* budget. Wave G.4.2 adds destructive-confirm elicitation;
|
|
7
|
+
* Wave G.4.3 adds ambiguity-resolution elicitation.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
import { elicitChoice, elicitConfirmation } from '@getimo/mcp-toolkit';
|
|
12
|
+
import { encodeElementPath } from '../../client.js';
|
|
13
|
+
import { flattenSourcesPayload, mapSourceRow, } from '../format/sources-format.js';
|
|
14
|
+
import { ambiguityFallbackError, } from '../elicitation.js';
|
|
15
|
+
import { confirmGuard, errorResult, jsonResult, } from '../tool-builder.js';
|
|
16
|
+
// ─── element_bind_source (G.4.3 — ambiguity resolution) ─────────────
|
|
17
|
+
/**
|
|
18
|
+
* Look up sources matching `source_name`. Returns at most one row per
|
|
19
|
+
* (name + origin) tuple; cross-plugin name collisions yield multiple
|
|
20
|
+
* candidates that need disambiguation.
|
|
21
|
+
*
|
|
22
|
+
* TODO(v0.3): cache /sources per session to avoid the round-trip on
|
|
23
|
+
* every bind. The current "fetch on every bind" call is the only REST
|
|
24
|
+
* round-trip introduced by ambiguity resolution and dominates bind
|
|
25
|
+
* latency — see tests/perf/bind-latency.test.ts for the pin.
|
|
26
|
+
*/
|
|
27
|
+
async function fetchSourceCandidates(client, source_name) {
|
|
28
|
+
const data = await client.get('/sources');
|
|
29
|
+
const payload = data.sources ?? data;
|
|
30
|
+
const flat = flattenSourcesPayload(payload);
|
|
31
|
+
return flat.map(mapSourceRow).filter((r) => r.name === source_name);
|
|
32
|
+
}
|
|
33
|
+
export async function handleElementBindSource({ client, elicitation }, input) {
|
|
34
|
+
const { template_id, element_path, source_name, source_id, etag } = input;
|
|
35
|
+
const encoded = encodeElementPath(element_path);
|
|
36
|
+
// Wave G.4.3 — ambiguity resolution.
|
|
37
|
+
//
|
|
38
|
+
// If `source_id` is supplied, the caller has already disambiguated;
|
|
39
|
+
// skip the /sources lookup entirely.
|
|
40
|
+
//
|
|
41
|
+
// Otherwise look up rows matching `source_name`:
|
|
42
|
+
// - 0 matches: fall through to the bind call; the REST plugin
|
|
43
|
+
// returns its own structured 404 with a precise hint (sources
|
|
44
|
+
// can be added between the lookup and the call).
|
|
45
|
+
// - 1 match: unique → bind directly.
|
|
46
|
+
// - ≥2 matches: cross-plugin collision (e.g. an apimapper flow
|
|
47
|
+
// AND a wordpress source both named "Posts"). Elicit a choice
|
|
48
|
+
// on supporting hosts; on unsupported hosts, return a
|
|
49
|
+
// structured `ambiguityFallbackError` listing every candidate
|
|
50
|
+
// so the agent can retry with `source_id`.
|
|
51
|
+
let resolvedBody = { source_name };
|
|
52
|
+
if (source_id === undefined) {
|
|
53
|
+
const candidates = await fetchSourceCandidates(client, source_name);
|
|
54
|
+
if (candidates.length > 1) {
|
|
55
|
+
const elicitCandidates = candidates.map((c) => ({
|
|
56
|
+
id: `${c.origin}:${c.name}`,
|
|
57
|
+
label: `${c.label || c.name} (${c.origin}${c.kind ? `/${c.kind}` : ''})`,
|
|
58
|
+
}));
|
|
59
|
+
const picked = elicitation
|
|
60
|
+
? await elicitChoice(elicitation, `Multiple sources named "${source_name}" exist. Pick which ` +
|
|
61
|
+
`one to bind to "${element_path}".`, elicitCandidates.map((c) => c.id))
|
|
62
|
+
: null;
|
|
63
|
+
if (picked === null) {
|
|
64
|
+
return ambiguityFallbackError({
|
|
65
|
+
code: 'source_ambiguous',
|
|
66
|
+
paramName: 'source_id',
|
|
67
|
+
what: 'sources',
|
|
68
|
+
candidates: elicitCandidates,
|
|
69
|
+
context: { template_id, element_path, source_name },
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
resolvedBody = { source_name, source_id: picked };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
resolvedBody = { source_name, source_id };
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
const data = await client.put(`/pages/${encodeURIComponent(template_id)}/elements/${encoded}/binding`, { body: resolvedBody, etag });
|
|
80
|
+
return jsonResult(data);
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
return errorResult({
|
|
84
|
+
error: e,
|
|
85
|
+
context: { template_id, element_path, source_name, ...(source_id ? { source_id } : {}) },
|
|
86
|
+
hint: 'Verify source_name via yootheme_builder_sources_list. On 412 ' +
|
|
87
|
+
'refresh ETag and retry.',
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// ─── element_unbind_source (destructive — G.4.2) ────────────────────
|
|
92
|
+
export async function handleElementUnbindSource({ client, elicitation }, input) {
|
|
93
|
+
const { template_id, element_path, etag, confirm } = input;
|
|
94
|
+
if (confirm !== true) {
|
|
95
|
+
if (confirm === false || !elicitation) {
|
|
96
|
+
return confirmGuard({
|
|
97
|
+
operation: 'unbind source',
|
|
98
|
+
details: { template_id, element_path },
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
const accepted = await elicitConfirmation(elicitation, `Unbind the dynamic source from element "${element_path}" in template ` +
|
|
102
|
+
`"${template_id}"? This may break dynamic-content rendering.`);
|
|
103
|
+
if (!accepted) {
|
|
104
|
+
return confirmGuard({
|
|
105
|
+
operation: 'unbind source',
|
|
106
|
+
details: { template_id, element_path },
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const encoded = encodeElementPath(element_path);
|
|
111
|
+
try {
|
|
112
|
+
const data = await client.delete(`/pages/${encodeURIComponent(template_id)}/elements/${encoded}/binding`, { etag });
|
|
113
|
+
return jsonResult(data);
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
return errorResult({
|
|
117
|
+
error: e,
|
|
118
|
+
context: { template_id, element_path },
|
|
119
|
+
hint: 'On 412 refresh via yootheme_builder_get_etag and retry.',
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=handlers-bind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers-bind.js","sourceRoot":"","sources":["../../../src/tools/sources/handlers-bind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EACH,qBAAqB,EACrB,YAAY,GAEf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACH,sBAAsB,GAEzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,YAAY,EACZ,WAAW,EACX,UAAU,GAEb,MAAM,oBAAoB,CAAC;AAG5B,uEAAuE;AAEvE;;;;;;;;;GASG;AACH,KAAK,UAAU,qBAAqB,CAChC,MAAkB,EAClB,WAAmB;IAEnB,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAwB,UAAU,CAAC,CAAC;IACjE,M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P,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-binding read handlers + shared types/schemas.
|
|
3
|
+
*
|
|
4
|
+
* Split out of `src/tools/sources.ts` (Wave G.4.0b). Write handlers
|
|
5
|
+
* (`element_bind_source` with G.4.3 ambiguity resolution,
|
|
6
|
+
* `element_unbind_source` with G.4.2 elicit-confirm) live in
|
|
7
|
+
* `./handlers-bind.ts`.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
import { type RestClient } from '../../client.js';
|
|
13
|
+
import type { McpServerWithElicitation } from '../elicitation.js';
|
|
14
|
+
import { type ToolResult } from '../tool-builder.js';
|
|
15
|
+
export declare const SOURCES_LIST_OUTPUT_SCHEMA: z.ZodObject<{
|
|
16
|
+
items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
17
|
+
total: z.ZodNumber;
|
|
18
|
+
projected_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export declare const BINDING_OUTPUT_SCHEMA: z.ZodObject<{
|
|
21
|
+
template_id: z.ZodString;
|
|
22
|
+
element_path: z.ZodString;
|
|
23
|
+
binding: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
24
|
+
has_binding: z.ZodBoolean;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export interface SourcesHandlerDeps {
|
|
27
|
+
readonly client: RestClient;
|
|
28
|
+
/**
|
|
29
|
+
* Optional MCP elicitation capability. When present,
|
|
30
|
+
* `element_unbind_source` prompts for destructive confirmation and
|
|
31
|
+
* `element_bind_source` prompts for cross-plugin disambiguation
|
|
32
|
+
* via the elicitation channel. When absent, both fall back to
|
|
33
|
+
* structured-error / preview flows.
|
|
34
|
+
*/
|
|
35
|
+
readonly elicitation?: McpServerWithElicitation;
|
|
36
|
+
}
|
|
37
|
+
export declare function handleSourcesList({ client }: SourcesHandlerDeps, { fields }: {
|
|
38
|
+
fields?: readonly string[];
|
|
39
|
+
}): Promise<ToolResult>;
|
|
40
|
+
export declare function handleElementGetBinding({ client }: SourcesHandlerDeps, { template_id, element_path }: {
|
|
41
|
+
template_id: string;
|
|
42
|
+
element_path: string;
|
|
43
|
+
}): Promise<ToolResult>;
|
|
44
|
+
export { handleElementBindSource, handleElementUnbindSource, } from './handlers-bind.js';
|
|
45
|
+
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/tools/sources/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAOrE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAMlE,OAAO,EAGH,KAAK,UAAU,EAClB,MAAM,oBAAoB,CAAC;AAI5B,eAAO,MAAM,0BAA0B;;;;iBAIrC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;iBAKhC,CAAC;AAEH,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,wBAAwB,CAAC;CACnD;AAID,wBAAsB,iBAAiB,CACnC,EAAE,MAAM,EAAE,EAAE,kBAAkB,EAC9B,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC3C,OAAO,CAAC,UAAU,CAAC,CA0BrB;AAID,wBAAsB,uBAAuB,CACzC,EAAE,MAAM,EAAE,EAAE,kBAAkB,EAC9B,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC7E,OAAO,CAAC,UAAU,CAAC,CAyBrB;AAID,OAAO,EACH,uBAAuB,EACvB,yBAAyB,GAC5B,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-binding read handlers + shared types/schemas.
|
|
3
|
+
*
|
|
4
|
+
* Split out of `src/tools/sources.ts` (Wave G.4.0b). Write handlers
|
|
5
|
+
* (`element_bind_source` with G.4.3 ambiguity resolution,
|
|
6
|
+
* `element_unbind_source` with G.4.2 elicit-confirm) live in
|
|
7
|
+
* `./handlers-bind.ts`.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
import { detailResult, tableResult } from '@getimo/mcp-toolkit';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { encodeElementPath } from '../../client.js';
|
|
14
|
+
import { SOURCES_TABLE_COLUMNS, buildBindingDetail, flattenSourcesPayload, mapSourceRow, } from '../format/sources-format.js';
|
|
15
|
+
import { DEFAULT_FIELDS_SOURCES_LIST, projectFields, projectedFieldsEcho, } from '../sparse-fields.js';
|
|
16
|
+
import { errorResult, structuredResult, } from '../tool-builder.js';
|
|
17
|
+
// ─── outputSchemas (Wave G.2 §4) ─────────────────────────────────────
|
|
18
|
+
export const SOURCES_LIST_OUTPUT_SCHEMA = z.object({
|
|
19
|
+
items: z.array(z.record(z.string(), z.unknown())),
|
|
20
|
+
total: z.number(),
|
|
21
|
+
projected_fields: z.array(z.string()).optional(),
|
|
22
|
+
});
|
|
23
|
+
export const BINDING_OUTPUT_SCHEMA = z.object({
|
|
24
|
+
template_id: z.string(),
|
|
25
|
+
element_path: z.string(),
|
|
26
|
+
binding: z.record(z.string(), z.unknown()),
|
|
27
|
+
has_binding: z.boolean(),
|
|
28
|
+
});
|
|
29
|
+
// ─── sources_list ────────────────────────────────────────────────────
|
|
30
|
+
export async function handleSourcesList({ client }, { fields }) {
|
|
31
|
+
try {
|
|
32
|
+
const data = await client.get('/sources');
|
|
33
|
+
const payload = data.sources ?? data;
|
|
34
|
+
const flat = flattenSourcesPayload(payload);
|
|
35
|
+
const mapped = flat.map(mapSourceRow);
|
|
36
|
+
const mappedRecords = mapped;
|
|
37
|
+
const items = projectFields(mappedRecords, fields, DEFAULT_FIELDS_SOURCES_LIST);
|
|
38
|
+
const echo = projectedFieldsEcho(fields, DEFAULT_FIELDS_SOURCES_LIST);
|
|
39
|
+
const toolkitResult = tableResult(mappedRecords, {
|
|
40
|
+
columns: [...SOURCES_TABLE_COLUMNS],
|
|
41
|
+
header: (count) => `${String(count)} sources`,
|
|
42
|
+
footer: 'Use yootheme_builder_element_bind_source to bind one.',
|
|
43
|
+
});
|
|
44
|
+
return structuredResult(toolkitResult, {
|
|
45
|
+
items,
|
|
46
|
+
total: items.length,
|
|
47
|
+
...(echo !== undefined ? { projected_fields: [...echo] } : {}),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
return errorResult({
|
|
52
|
+
error: e,
|
|
53
|
+
context: {},
|
|
54
|
+
hint: 'Run yootheme_builder_diagnose to verify auth.',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// ─── element_get_binding ─────────────────────────────────────────────
|
|
59
|
+
export async function handleElementGetBinding({ client }, { template_id, element_path }) {
|
|
60
|
+
const encoded = encodeElementPath(element_path);
|
|
61
|
+
try {
|
|
62
|
+
const data = await client.get(`/pages/${encodeURIComponent(template_id)}/elements/${encoded}/binding`);
|
|
63
|
+
const binding = data !== null && typeof data === 'object' ? data : {};
|
|
64
|
+
const hasBinding = typeof binding.source_name === 'string' && binding.source_name.length > 0;
|
|
65
|
+
const toolkitResult = detailResult(buildBindingDetail({ template_id, element_path, binding }));
|
|
66
|
+
return structuredResult(toolkitResult, {
|
|
67
|
+
template_id,
|
|
68
|
+
element_path,
|
|
69
|
+
binding,
|
|
70
|
+
has_binding: hasBinding,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
return errorResult({
|
|
75
|
+
error: e,
|
|
76
|
+
context: { template_id, element_path },
|
|
77
|
+
hint: 'Verify element_path via yootheme_builder_element_list.',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Re-export write handlers so builders can import everything from this
|
|
82
|
+
// barrel and we keep a single `SourcesHandlerDeps` definition.
|
|
83
|
+
export { handleElementBindSource, handleElementUnbindSource, } from './handlers-bind.js';
|
|
84
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../../src/tools/sources/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EACH,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,GACf,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACH,2BAA2B,EAC3B,aAAa,EACb,mBAAmB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,WAAW,EACX,gBAAgB,GAEnB,MAAM,oBAAoB,CAAC;AAE5B,wEAAwE;AAExE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACjD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,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E,YAAY,EAAE;YACtC,IAAI,EAAE,wDAAwD;SACjE,CAAC,CAAC;IACP,CAAC;AACL,CAAC;AAED,uEAAuE;AACvE,+DAA+D;AAC/D,OAAO,EACH,uBAAuB,EACvB,yBAAyB,GAC5B,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-tool barrel — public entry-point for the 4 source-binding tools.
|
|
3
|
+
*
|
|
4
|
+
* yootheme_builder_sources_list
|
|
5
|
+
* → list available Builder sources
|
|
6
|
+
* yootheme_builder_element_get_binding
|
|
7
|
+
* → read source binding on an element
|
|
8
|
+
* yootheme_builder_element_bind_source
|
|
9
|
+
* → set source binding (PUT; G.4.3 ambiguity resolution)
|
|
10
|
+
* yootheme_builder_element_unbind_source
|
|
11
|
+
* → remove binding (DELETE; G.4.2 elicit-confirm)
|
|
12
|
+
*
|
|
13
|
+
* Wave G.4.0b — split out of the original `src/tools/sources.ts`.
|
|
14
|
+
*
|
|
15
|
+
* @license MIT
|
|
16
|
+
*/
|
|
17
|
+
export { buildSourcesTools } from './builders.js';
|
|
18
|
+
export type { SourcesHandlerDeps } from './handlers.js';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/sources/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-tool barrel — public entry-point for the 4 source-binding tools.
|
|
3
|
+
*
|
|
4
|
+
* yootheme_builder_sources_list
|
|
5
|
+
* → list available Builder sources
|
|
6
|
+
* yootheme_builder_element_get_binding
|
|
7
|
+
* → read source binding on an element
|
|
8
|
+
* yootheme_builder_element_bind_source
|
|
9
|
+
* → set source binding (PUT; G.4.3 ambiguity resolution)
|
|
10
|
+
* yootheme_builder_element_unbind_source
|
|
11
|
+
* → remove binding (DELETE; G.4.2 elicit-confirm)
|
|
12
|
+
*
|
|
13
|
+
* Wave G.4.0b — split out of the original `src/tools/sources.ts`.
|
|
14
|
+
*
|
|
15
|
+
* @license MIT
|
|
16
|
+
*/
|
|
17
|
+
export { buildSourcesTools } from './builders.js';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/sources/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backwards-compatible re-export shim.
|
|
3
|
+
*
|
|
4
|
+
* Wave G.4.0b split the original 228-LoC `sources.ts` into
|
|
5
|
+
* `./sources/{index, handlers, builders}.ts` after Wave G.4.2/G.4.3
|
|
6
|
+
* added elicitation + ambiguity-resolution logic that pushed it well
|
|
7
|
+
* over the 200-LoC budget. This shim keeps the legacy import path
|
|
8
|
+
* (`from '../tools/sources.js'`) working for downstream callers and
|
|
9
|
+
* tests. New code should import from `./sources/index.js` directly.
|
|
10
|
+
*
|
|
11
|
+
* @license MIT
|
|
12
|
+
*/
|
|
13
|
+
export { buildSourcesTools } from './sources/index.js';
|
|
14
|
+
//# sourceMappingURL=sources.d.ts.map
|