@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.
Files changed (249) hide show
  1. package/README.md +14 -10
  2. package/bin/yt-builder-mcp.js +55 -40
  3. package/dist/auth.d.ts +18 -0
  4. package/dist/auth.d.ts.map +1 -1
  5. package/dist/auth.js +18 -0
  6. package/dist/auth.js.map +1 -1
  7. package/dist/catalog/build-catalog.d.ts +63 -0
  8. package/dist/catalog/build-catalog.d.ts.map +1 -0
  9. package/dist/catalog/build-catalog.js +166 -0
  10. package/dist/catalog/build-catalog.js.map +1 -0
  11. package/dist/cli/invocation-decision.d.ts +57 -0
  12. package/dist/cli/invocation-decision.d.ts.map +1 -0
  13. package/dist/cli/invocation-decision.js +86 -0
  14. package/dist/cli/invocation-decision.js.map +1 -0
  15. package/dist/client.d.ts +28 -0
  16. package/dist/client.d.ts.map +1 -1
  17. package/dist/client.js +40 -1
  18. package/dist/client.js.map +1 -1
  19. package/dist/clients/claude-code.d.ts.map +1 -1
  20. package/dist/clients/claude-code.js +3 -1
  21. package/dist/clients/claude-code.js.map +1 -1
  22. package/dist/clients/claude-desktop.d.ts.map +1 -1
  23. package/dist/clients/claude-desktop.js +3 -1
  24. package/dist/clients/claude-desktop.js.map +1 -1
  25. package/dist/clients/cline.d.ts.map +1 -1
  26. package/dist/clients/cline.js +3 -1
  27. package/dist/clients/cline.js.map +1 -1
  28. package/dist/clients/codex-cli.d.ts +1 -1
  29. package/dist/clients/codex-cli.d.ts.map +1 -1
  30. package/dist/clients/codex-cli.js +98 -0
  31. package/dist/clients/codex-cli.js.map +1 -1
  32. package/dist/clients/continue.d.ts.map +1 -1
  33. package/dist/clients/continue.js +70 -1
  34. package/dist/clients/continue.js.map +1 -1
  35. package/dist/clients/cursor.d.ts.map +1 -1
  36. package/dist/clients/cursor.js +3 -1
  37. package/dist/clients/cursor.js.map +1 -1
  38. package/dist/clients/gemini-cli.d.ts.map +1 -1
  39. package/dist/clients/gemini-cli.js +3 -1
  40. package/dist/clients/gemini-cli.js.map +1 -1
  41. package/dist/clients/index.d.ts +104 -0
  42. package/dist/clients/index.d.ts.map +1 -1
  43. package/dist/clients/index.js +141 -0
  44. package/dist/clients/index.js.map +1 -1
  45. package/dist/clients/roo-code.d.ts.map +1 -1
  46. package/dist/clients/roo-code.js +3 -1
  47. package/dist/clients/roo-code.js.map +1 -1
  48. package/dist/clients/zed.d.ts.map +1 -1
  49. package/dist/clients/zed.js +3 -1
  50. package/dist/clients/zed.js.map +1 -1
  51. package/dist/gateway/advanced-read-tool.d.ts +37 -0
  52. package/dist/gateway/advanced-read-tool.d.ts.map +1 -0
  53. package/dist/gateway/advanced-read-tool.js +156 -0
  54. package/dist/gateway/advanced-read-tool.js.map +1 -0
  55. package/dist/gateway/advanced-tool/domains.d.ts +18 -3
  56. package/dist/gateway/advanced-tool/domains.d.ts.map +1 -1
  57. package/dist/gateway/advanced-tool/domains.js +28 -9
  58. package/dist/gateway/advanced-tool/domains.js.map +1 -1
  59. package/dist/gateway/advanced-tool/register.d.ts.map +1 -1
  60. package/dist/gateway/advanced-tool/register.js +43 -11
  61. package/dist/gateway/advanced-tool/register.js.map +1 -1
  62. package/dist/gateway/essentials.d.ts +14 -4
  63. package/dist/gateway/essentials.d.ts.map +1 -1
  64. package/dist/gateway/essentials.js +55 -5
  65. package/dist/gateway/essentials.js.map +1 -1
  66. package/dist/gateway/test-support.d.ts +3 -3
  67. package/dist/gateway/test-support.js +3 -3
  68. package/dist/index.d.ts +2 -1
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +19 -1
  71. package/dist/index.js.map +1 -1
  72. package/dist/install-skill.js +1 -1
  73. package/dist/proxy/bridge.d.ts +36 -0
  74. package/dist/proxy/bridge.d.ts.map +1 -0
  75. package/dist/proxy/bridge.js +129 -0
  76. package/dist/proxy/bridge.js.map +1 -0
  77. package/dist/proxy/mode.d.ts +10 -0
  78. package/dist/proxy/mode.d.ts.map +1 -0
  79. package/dist/proxy/mode.js +20 -0
  80. package/dist/proxy/mode.js.map +1 -0
  81. package/dist/server.d.ts +6 -4
  82. package/dist/server.d.ts.map +1 -1
  83. package/dist/server.js +14 -4
  84. package/dist/server.js.map +1 -1
  85. package/dist/setup-cli.d.ts +41 -0
  86. package/dist/setup-cli.d.ts.map +1 -1
  87. package/dist/setup-cli.js +163 -1
  88. package/dist/setup-cli.js.map +1 -1
  89. package/dist/setup-prompts.d.ts +23 -0
  90. package/dist/setup-prompts.d.ts.map +1 -1
  91. package/dist/setup-prompts.js +76 -1
  92. package/dist/setup-prompts.js.map +1 -1
  93. package/dist/setup-wizard.d.ts.map +1 -1
  94. package/dist/setup-wizard.js +7 -0
  95. package/dist/setup-wizard.js.map +1 -1
  96. package/dist/sites/bootstrap.d.ts +41 -0
  97. package/dist/sites/bootstrap.d.ts.map +1 -0
  98. package/dist/sites/bootstrap.js +58 -0
  99. package/dist/sites/bootstrap.js.map +1 -0
  100. package/dist/sites/client-pool.d.ts +33 -0
  101. package/dist/sites/client-pool.d.ts.map +1 -1
  102. package/dist/sites/client-pool.js +69 -1
  103. package/dist/sites/client-pool.js.map +1 -1
  104. package/dist/sites/registry.d.ts +30 -0
  105. package/dist/sites/registry.d.ts.map +1 -1
  106. package/dist/sites/registry.js.map +1 -1
  107. package/dist/sites/store.d.ts +8 -1
  108. package/dist/sites/store.d.ts.map +1 -1
  109. package/dist/sites/store.js +17 -2
  110. package/dist/sites/store.js.map +1 -1
  111. package/dist/sites/tools/index.d.ts.map +1 -1
  112. package/dist/sites/tools/index.js +9 -1
  113. package/dist/sites/tools/index.js.map +1 -1
  114. package/dist/sites/tools/use-site.d.ts +47 -0
  115. package/dist/sites/tools/use-site.d.ts.map +1 -0
  116. package/dist/sites/tools/use-site.js +203 -0
  117. package/dist/sites/tools/use-site.js.map +1 -0
  118. package/dist/tools/bind-guidance.d.ts +80 -0
  119. package/dist/tools/bind-guidance.d.ts.map +1 -0
  120. package/dist/tools/bind-guidance.js +95 -0
  121. package/dist/tools/bind-guidance.js.map +1 -0
  122. package/dist/tools/elements/builders.d.ts.map +1 -1
  123. package/dist/tools/elements/builders.js +75 -18
  124. package/dist/tools/elements/builders.js.map +1 -1
  125. package/dist/tools/elements/handlers-write.d.ts +20 -3
  126. package/dist/tools/elements/handlers-write.d.ts.map +1 -1
  127. package/dist/tools/elements/handlers-write.js +372 -10
  128. package/dist/tools/elements/handlers-write.js.map +1 -1
  129. package/dist/tools/elements/handlers.d.ts +6 -1
  130. package/dist/tools/elements/handlers.d.ts.map +1 -1
  131. package/dist/tools/elements/handlers.js +77 -10
  132. package/dist/tools/elements/handlers.js.map +1 -1
  133. package/dist/tools/elements/layout-hierarchy-rules.d.ts +62 -0
  134. package/dist/tools/elements/layout-hierarchy-rules.d.ts.map +1 -0
  135. package/dist/tools/elements/layout-hierarchy-rules.js +154 -0
  136. package/dist/tools/elements/layout-hierarchy-rules.js.map +1 -0
  137. package/dist/tools/format/elements-format.d.ts +35 -0
  138. package/dist/tools/format/elements-format.d.ts.map +1 -1
  139. package/dist/tools/format/elements-format.js +134 -12
  140. package/dist/tools/format/elements-format.js.map +1 -1
  141. package/dist/tools/format/inspection-format.d.ts +29 -0
  142. package/dist/tools/format/inspection-format.d.ts.map +1 -1
  143. package/dist/tools/format/inspection-format.js +99 -22
  144. package/dist/tools/format/inspection-format.js.map +1 -1
  145. package/dist/tools/format/pages-format.d.ts.map +1 -1
  146. package/dist/tools/format/pages-format.js +7 -0
  147. package/dist/tools/format/pages-format.js.map +1 -1
  148. package/dist/tools/format/sources-format.d.ts +8 -0
  149. package/dist/tools/format/sources-format.d.ts.map +1 -1
  150. package/dist/tools/format/sources-format.js +10 -0
  151. package/dist/tools/format/sources-format.js.map +1 -1
  152. package/dist/tools/health.d.ts.map +1 -1
  153. package/dist/tools/health.js +24 -0
  154. package/dist/tools/health.js.map +1 -1
  155. package/dist/tools/index.d.ts.map +1 -1
  156. package/dist/tools/index.js +4 -0
  157. package/dist/tools/index.js.map +1 -1
  158. package/dist/tools/inspection.d.ts +24 -0
  159. package/dist/tools/inspection.d.ts.map +1 -1
  160. package/dist/tools/inspection.js +297 -5
  161. package/dist/tools/inspection.js.map +1 -1
  162. package/dist/tools/layout-flatten.d.ts +11 -8
  163. package/dist/tools/layout-flatten.d.ts.map +1 -1
  164. package/dist/tools/layout-flatten.js +17 -6
  165. package/dist/tools/layout-flatten.js.map +1 -1
  166. package/dist/tools/multi-items/builders.d.ts.map +1 -1
  167. package/dist/tools/multi-items/builders.js +18 -3
  168. package/dist/tools/multi-items/builders.js.map +1 -1
  169. package/dist/tools/multi-items/clean-implode-handler.d.ts.map +1 -1
  170. package/dist/tools/multi-items/clean-implode-handler.js +2 -2
  171. package/dist/tools/multi-items/clean-implode-handler.js.map +1 -1
  172. package/dist/tools/multi-items/format/inspection-format.d.ts +41 -0
  173. package/dist/tools/multi-items/format/inspection-format.d.ts.map +1 -0
  174. package/dist/tools/multi-items/format/inspection-format.js +64 -0
  175. package/dist/tools/multi-items/format/inspection-format.js.map +1 -0
  176. package/dist/tools/multi-items/inspect-handler.d.ts +50 -2
  177. package/dist/tools/multi-items/inspect-handler.d.ts.map +1 -1
  178. package/dist/tools/multi-items/inspect-handler.js +237 -10
  179. package/dist/tools/multi-items/inspect-handler.js.map +1 -1
  180. package/dist/tools/multi-items/inspection-cache.d.ts +85 -0
  181. package/dist/tools/multi-items/inspection-cache.d.ts.map +1 -0
  182. package/dist/tools/multi-items/inspection-cache.js +126 -0
  183. package/dist/tools/multi-items/inspection-cache.js.map +1 -0
  184. package/dist/tools/pages/builders.d.ts +31 -2
  185. package/dist/tools/pages/builders.d.ts.map +1 -1
  186. package/dist/tools/pages/builders.js +173 -17
  187. package/dist/tools/pages/builders.js.map +1 -1
  188. package/dist/tools/pages/handlers-read.d.ts +6 -2
  189. package/dist/tools/pages/handlers-read.d.ts.map +1 -1
  190. package/dist/tools/pages/handlers-read.js +228 -26
  191. package/dist/tools/pages/handlers-read.js.map +1 -1
  192. package/dist/tools/pages/handlers-write.d.ts +143 -7
  193. package/dist/tools/pages/handlers-write.d.ts.map +1 -1
  194. package/dist/tools/pages/handlers-write.js +215 -11
  195. package/dist/tools/pages/handlers-write.js.map +1 -1
  196. package/dist/tools/pages/index.d.ts +1 -1
  197. package/dist/tools/pages/index.d.ts.map +1 -1
  198. package/dist/tools/pages/index.js +1 -1
  199. package/dist/tools/pages/index.js.map +1 -1
  200. package/dist/tools/pages/schemas.d.ts +166 -0
  201. package/dist/tools/pages/schemas.d.ts.map +1 -1
  202. package/dist/tools/pages/schemas.js +347 -0
  203. package/dist/tools/pages/schemas.js.map +1 -1
  204. package/dist/tools/shared-schemas.d.ts.map +1 -1
  205. package/dist/tools/shared-schemas.js +26 -11
  206. package/dist/tools/shared-schemas.js.map +1 -1
  207. package/dist/tools/sources/builders.d.ts.map +1 -1
  208. package/dist/tools/sources/builders.js +64 -6
  209. package/dist/tools/sources/builders.js.map +1 -1
  210. package/dist/tools/sources/handlers-bind.d.ts +13 -1
  211. package/dist/tools/sources/handlers-bind.d.ts.map +1 -1
  212. package/dist/tools/sources/handlers-bind.js +219 -5
  213. package/dist/tools/sources/handlers-bind.js.map +1 -1
  214. package/dist/tools/sources/handlers.d.ts +3 -0
  215. package/dist/tools/sources/handlers.d.ts.map +1 -1
  216. package/dist/tools/sources/handlers.js +45 -8
  217. package/dist/tools/sources/handlers.js.map +1 -1
  218. package/dist/tools/sparse-fields.d.ts +23 -0
  219. package/dist/tools/sparse-fields.d.ts.map +1 -1
  220. package/dist/tools/sparse-fields.js +29 -0
  221. package/dist/tools/sparse-fields.js.map +1 -1
  222. package/dist/tools/sublayout/builders.d.ts +23 -0
  223. package/dist/tools/sublayout/builders.d.ts.map +1 -0
  224. package/dist/tools/sublayout/builders.js +54 -0
  225. package/dist/tools/sublayout/builders.js.map +1 -0
  226. package/dist/tools/sublayout/index.d.ts +13 -0
  227. package/dist/tools/sublayout/index.d.ts.map +1 -0
  228. package/dist/tools/sublayout/index.js +13 -0
  229. package/dist/tools/sublayout/index.js.map +1 -0
  230. package/dist/tools/sublayout/inspect-sublayout-handler.d.ts +95 -0
  231. package/dist/tools/sublayout/inspect-sublayout-handler.d.ts.map +1 -0
  232. package/dist/tools/sublayout/inspect-sublayout-handler.js +181 -0
  233. package/dist/tools/sublayout/inspect-sublayout-handler.js.map +1 -0
  234. package/dist/tools/tool-builder/results.d.ts +31 -0
  235. package/dist/tools/tool-builder/results.d.ts.map +1 -1
  236. package/dist/tools/tool-builder/results.js +95 -4
  237. package/dist/tools/tool-builder/results.js.map +1 -1
  238. package/dist/uninstall-skill.d.ts +52 -0
  239. package/dist/uninstall-skill.d.ts.map +1 -0
  240. package/dist/uninstall-skill.js +146 -0
  241. package/dist/uninstall-skill.js.map +1 -0
  242. package/dist/uninstall.d.ts +73 -0
  243. package/dist/uninstall.d.ts.map +1 -0
  244. package/dist/uninstall.js +82 -0
  245. package/dist/uninstall.js.map +1 -0
  246. package/icon.png +0 -0
  247. package/manifest.json +10 -10
  248. package/package.json +7 -3
  249. package/skills/yt-builder-mcp/SKILL.md +157 -88
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Phase 3 — `yootheme_builder_use_site` L1 tool.
3
+ *
4
+ * Runtime active-site SWITCH. The multi-site analogue of api-mapper's
5
+ * `apimapper_use_profile`: it changes which configured site subsequent
6
+ * tool calls target by default, then (unless `probe: false`) verifies
7
+ * the new site is reachable.
8
+ *
9
+ * Why a tool (and not just the `site_id` param on every call):
10
+ * - Maria-the-Claude-Desktop-user works in long conversations against
11
+ * ONE client site at a time. Re-passing `site_id` on every call is
12
+ * error-prone. `sites_list` + `use_site` mirror the
13
+ * `list_profiles` + `use_profile` flow she already knows from
14
+ * api-mapper: discover, switch once, then work.
15
+ *
16
+ * How it reuses the existing engine (NO new multi-site machinery):
17
+ * - The {@link SiteRegistry} stays immutable; the switch moves the
18
+ * {@link ClientPool}'s in-memory active-site override
19
+ * (`setActiveSite`). `resolve(undefined)` consults that override
20
+ * before the registry default. Unknown id → `UnknownSiteError`,
21
+ * surfaced as a structured `code: 'unknown_site'` error via the
22
+ * shared `resolveSiteOrError` helper (so the wording matches every
23
+ * other site-bound tool). The pointer never moves on a bad switch.
24
+ * - The reachability check reuses {@link probeSite} (/health + /etag),
25
+ * the SAME probe `sites_test` and the CLI run.
26
+ *
27
+ * Soft-vs-hard contract (mirrors `apimapper_use_profile`):
28
+ * - An UNKNOWN site is a HARD error (pointer unchanged).
29
+ * - A reachable-but-degraded site (probe red) is a SOFT warning: the
30
+ * activation still succeeds and the pointer moves, because the user
31
+ * explicitly asked to switch — the probe is diagnostic, not a gate.
32
+ * `probe: false` skips the network round-trip entirely (offline
33
+ * activation).
34
+ *
35
+ * @license MIT
36
+ */
37
+ import { type AnyToolDefinition } from '../../tools/tool-builder.js';
38
+ import type { ClientPool } from '../client-pool.js';
39
+ /**
40
+ * Build the Phase 3 `yootheme_builder_use_site` tool.
41
+ *
42
+ * Signature accepts the {@link ClientPool} directly — the switch lives
43
+ * on the pool (`setActiveSite`), and `resolveSiteOrError(pool, site_id)`
44
+ * validates the id + yields the `{client, site}` bundle for the probe.
45
+ */
46
+ export declare function buildUseSiteTool(pool: ClientPool): AnyToolDefinition;
47
+ //# sourceMappingURL=use-site.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-site.d.ts","sourceRoot":"","sources":["../../../src/sites/tools/use-site.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAKH,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAwCpD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,iBAAiB,CAyGpE"}
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Phase 3 — `yootheme_builder_use_site` L1 tool.
3
+ *
4
+ * Runtime active-site SWITCH. The multi-site analogue of api-mapper's
5
+ * `apimapper_use_profile`: it changes which configured site subsequent
6
+ * tool calls target by default, then (unless `probe: false`) verifies
7
+ * the new site is reachable.
8
+ *
9
+ * Why a tool (and not just the `site_id` param on every call):
10
+ * - Maria-the-Claude-Desktop-user works in long conversations against
11
+ * ONE client site at a time. Re-passing `site_id` on every call is
12
+ * error-prone. `sites_list` + `use_site` mirror the
13
+ * `list_profiles` + `use_profile` flow she already knows from
14
+ * api-mapper: discover, switch once, then work.
15
+ *
16
+ * How it reuses the existing engine (NO new multi-site machinery):
17
+ * - The {@link SiteRegistry} stays immutable; the switch moves the
18
+ * {@link ClientPool}'s in-memory active-site override
19
+ * (`setActiveSite`). `resolve(undefined)` consults that override
20
+ * before the registry default. Unknown id → `UnknownSiteError`,
21
+ * surfaced as a structured `code: 'unknown_site'` error via the
22
+ * shared `resolveSiteOrError` helper (so the wording matches every
23
+ * other site-bound tool). The pointer never moves on a bad switch.
24
+ * - The reachability check reuses {@link probeSite} (/health + /etag),
25
+ * the SAME probe `sites_test` and the CLI run.
26
+ *
27
+ * Soft-vs-hard contract (mirrors `apimapper_use_profile`):
28
+ * - An UNKNOWN site is a HARD error (pointer unchanged).
29
+ * - A reachable-but-degraded site (probe red) is a SOFT warning: the
30
+ * activation still succeeds and the pointer moves, because the user
31
+ * explicitly asked to switch — the probe is diagnostic, not a gate.
32
+ * `probe: false` skips the network round-trip entirely (offline
33
+ * activation).
34
+ *
35
+ * @license MIT
36
+ */
37
+ import { detailResult } from '@getimo/mcp-toolkit';
38
+ import { z } from 'zod';
39
+ import { defineTool, mutating, structuredResult, withSiteMeta, } from '../../tools/tool-builder.js';
40
+ import { resolveSiteOrError } from '../../tools/pool-resolve-helper.js';
41
+ import { probeSite } from '../probe.js';
42
+ const USE_SITE_OUTPUT_SCHEMA = z.object({
43
+ activated: z.boolean(),
44
+ active_site_id: z.string(),
45
+ site_url: z.string(),
46
+ platform: z.enum(['wordpress', 'joomla']),
47
+ probe: z
48
+ .object({
49
+ plugin_reachable: z.boolean(),
50
+ bearer_valid: z.boolean(),
51
+ etag_received: z.boolean(),
52
+ summary: z.string(),
53
+ plugin_error: z.string().optional(),
54
+ bearer_error: z.string().optional(),
55
+ })
56
+ .optional(),
57
+ note: z.string().optional(),
58
+ warnings: z.array(z.string()).optional(),
59
+ // F178: every switch echoes the process-wide-default caveat so the
60
+ // agent is reminded that concurrent clients of the same stdio server
61
+ // share this pointer.
62
+ concurrency_warning: z.string().optional(),
63
+ });
64
+ /**
65
+ * F178 — the constant caveat echoed on every `use_site` switch. The
66
+ * active-site default lives in process memory (`ClientPool.activeOverride`)
67
+ * and a single stdio server process is shared by every MCP client that
68
+ * connected to it. So when client A switches, client B's NEXT call that
69
+ * omits `site_id` silently inherits A's choice. The only isolation
70
+ * guarantee is passing `site_id` explicitly per call.
71
+ */
72
+ const CONCURRENCY_WARNING = 'This sets a PROCESS-WIDE default: every concurrent client sharing this '
73
+ + 'MCP server process inherits it on calls that omit `site_id`. For '
74
+ + 'isolation between parallel agents, pass `site_id` explicitly on each '
75
+ + 'tool call instead of relying on this shared switch.';
76
+ /**
77
+ * Build the Phase 3 `yootheme_builder_use_site` tool.
78
+ *
79
+ * Signature accepts the {@link ClientPool} directly — the switch lives
80
+ * on the pool (`setActiveSite`), and `resolveSiteOrError(pool, site_id)`
81
+ * validates the id + yields the `{client, site}` bundle for the probe.
82
+ */
83
+ export function buildUseSiteTool(pool) {
84
+ return defineTool({
85
+ name: 'yootheme_builder_use_site',
86
+ description: 'Switch the ACTIVE site for this multi-site session. After this call, ' +
87
+ 'every tool that omits `site_id` targets the site you picked here. NOTE: ' +
88
+ 'this default is PROCESS-WIDE — concurrent clients sharing this MCP server ' +
89
+ 'inherit it; pass `site_id` per call for isolation between parallel agents. ' +
90
+ 'Runs a /health + /etag probe by default; pass `probe: false` to switch ' +
91
+ 'offline. A degraded site is a soft warning (the switch still happens). ' +
92
+ '`site_id` is REQUIRED. Keywords: switch/change/set active/target site, ' +
93
+ 'select installation, use profile. Use yootheme_builder_sites_list first ' +
94
+ 'to find IDs.',
95
+ inputSchema: {
96
+ site_id: z
97
+ .string()
98
+ .min(1)
99
+ .max(64)
100
+ .regex(/^[a-zA-Z0-9_-]+$/, 'site_id uses letters/digits/dash/underscore only')
101
+ .describe('Site to make active (REQUIRED, e.g. "wp-acme"). ' +
102
+ 'Use yootheme_builder_sites_list to discover valid IDs.'),
103
+ probe: z
104
+ .boolean()
105
+ .default(true)
106
+ .describe('Run the /health + /etag reachability probe after switching ' +
107
+ '(default true). Set false for offline activation when the ' +
108
+ 'site is unreachable but you still want to target it.'),
109
+ },
110
+ outputSchema: USE_SITE_OUTPUT_SCHEMA,
111
+ annotations: mutating('Sites — Switch active'),
112
+ handler: async ({ site_id, probe = true }) => {
113
+ // 1. Validate the id through the shared resolver. Unknown /
114
+ // no-default errors come back as structured ToolResults
115
+ // (HARD error). The pointer has NOT moved yet, so a bad id
116
+ // leaves the session on its previous active site.
117
+ const r = await resolveSiteOrError(pool, site_id);
118
+ if (!r.ok)
119
+ return r.error;
120
+ const { client, site } = r;
121
+ // 2. Move the in-memory override. `setActiveSite` re-checks
122
+ // the id exists (defense-in-depth) and throws
123
+ // UnknownSiteError otherwise — but step 1 already
124
+ // guaranteed it, so this is a no-throw in practice.
125
+ pool.setActiveSite(site.id);
126
+ // 3. Offline path — skip the probe entirely.
127
+ if (!probe) {
128
+ const payload = {
129
+ activated: true,
130
+ active_site_id: site.id,
131
+ site_url: site.url,
132
+ platform: site.platform.kind,
133
+ note: 'Reachability probe skipped (probe=false). The active site ' +
134
+ 'is now set but its plugin reachability was not verified.',
135
+ concurrency_warning: CONCURRENCY_WARNING,
136
+ };
137
+ const detail = detailResult(buildUseSiteDetail(payload));
138
+ return withSiteMeta(structuredResult(detail, payload), site);
139
+ }
140
+ // 4. Probe the newly-active site. A failing probe is a SOFT
141
+ // warning — the switch already happened in step 2.
142
+ const probeResult = await probeSite(client);
143
+ const warnings = [];
144
+ if (!(probeResult.plugin_reachable && probeResult.bearer_valid)) {
145
+ warnings.push(`Switched to "${site.id}" but the reachability probe was not fully ` +
146
+ `green: ${probeResult.summary} The active site still points here — ` +
147
+ 'run yootheme_builder_sites_test for a detailed diagnosis.');
148
+ }
149
+ const payload = {
150
+ activated: true,
151
+ active_site_id: site.id,
152
+ site_url: site.url,
153
+ platform: site.platform.kind,
154
+ probe: {
155
+ plugin_reachable: probeResult.plugin_reachable,
156
+ bearer_valid: probeResult.bearer_valid,
157
+ etag_received: probeResult.etag_received,
158
+ summary: probeResult.summary,
159
+ ...(probeResult.plugin_error !== undefined
160
+ ? { plugin_error: probeResult.plugin_error }
161
+ : {}),
162
+ ...(probeResult.bearer_error !== undefined
163
+ ? { bearer_error: probeResult.bearer_error }
164
+ : {}),
165
+ },
166
+ concurrency_warning: CONCURRENCY_WARNING,
167
+ ...(warnings.length > 0 ? { warnings } : {}),
168
+ };
169
+ const detail = detailResult(buildUseSiteDetail(payload));
170
+ return withSiteMeta(structuredResult(detail, payload), site);
171
+ },
172
+ });
173
+ }
174
+ /**
175
+ * Render a detail-card body for the switch result. Group 1 = the active
176
+ * site, Group 2 = the probe outcome (omitted when probe was skipped).
177
+ */
178
+ function buildUseSiteDetail(payload) {
179
+ const activeEntries = [
180
+ { key: 'active_site_id', label: 'Active site', value: payload.active_site_id, format: 'badge' },
181
+ { key: 'site_url', label: 'Site URL', value: payload.site_url },
182
+ { key: 'platform', label: 'Platform', value: payload.platform, format: 'badge' },
183
+ ];
184
+ const groups = [{ label: 'Active site', entries: activeEntries }];
185
+ if (payload.probe !== undefined) {
186
+ groups.push({
187
+ label: 'Probe',
188
+ entries: [
189
+ { key: 'plugin_reachable', label: 'Plugin reachable', value: payload.probe.plugin_reachable, format: 'boolean' },
190
+ { key: 'bearer_valid', label: 'Bearer valid', value: payload.probe.bearer_valid, format: 'boolean' },
191
+ { key: 'summary', label: 'Summary', value: payload.probe.summary },
192
+ ],
193
+ });
194
+ }
195
+ else if (payload.note !== undefined) {
196
+ groups.push({
197
+ label: 'Probe',
198
+ entries: [{ key: 'note', label: 'Note', value: payload.note }],
199
+ });
200
+ }
201
+ return { title: 'YT Builder MCP — Switch Active Site', groups };
202
+ }
203
+ //# sourceMappingURL=use-site.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-site.js","sourceRoot":"","sources":["../../../src/sites/tools/use-site.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,YAAY,EAAoB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACH,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,YAAY,GAEf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IACzC,KAAK,EAAE,CAAC;SACH,MAAM,CAAC;QACJ,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE;QAC7B,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE;QACzB,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE;QAC1B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACnC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACtC,CAAC;SACD,QAAQ,EAAE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* gateway) to **L1** by F116 (2026-06-11) — it is now a FIRST-CLASS entry in
6
+ * `tools/list` (see `gateway/essentials.ts`: it is in ESSENTIAL_TOOLS). The
7
+ * CapturingServer enforces a DISJOINT-LANE invariant, so the tool is NOT in
8
+ * the advanced registry: calling `yootheme_builder_advanced({ tool:
9
+ * "yootheme_builder_element_bind_source" })` returns `unknown_tool` on a
10
+ * current build. An agent that follows OLD guidance saying "wrap the bind
11
+ * call in the advanced gateway" therefore hits an `invalid_value` /
12
+ * `unknown tool` dead end (F176: cage agents reproduced this 4× in R3).
13
+ *
14
+ * Every binding hint, schema annotation, and error message therefore now
15
+ * instructs a DIRECT call through this single source of truth. Centralising
16
+ * the phrasing keeps the ~dozen call-sites in lock-step and lets
17
+ * `bind-guidance.test.ts` + `l1-no-gateway-wrap-pin.test.ts` pin the shape.
18
+ *
19
+ * Back-compat: a customer on a PRE-F116 server build (where the tool was
20
+ * still L2) can reach it via `yootheme_builder_advanced({ tool:
21
+ * "yootheme_builder_element_bind_source", arguments: {…} })`. That fallback
22
+ * lives only in customer-facing skill docs, never in the runtime guidance
23
+ * strings below.
24
+ *
25
+ * @license MIT
26
+ */
27
+ /** The gateway tool that reaches every advanced (L2) tool. */
28
+ export declare const ADVANCED_GATEWAY_TOOL = "yootheme_builder_advanced";
29
+ /** The bind tool — a first-class L1 entry in `tools/list` since F116. */
30
+ export declare const BIND_SOURCE_TOOL = "yootheme_builder_element_bind_source";
31
+ /**
32
+ * A runnable one-line example of the DIRECT bind call. Kept short so it can
33
+ * ride inside error strings + schema descriptions without bloating the
34
+ * payload. (Named *_VIA_GATEWAY_* for source-compat with the ~dozen existing
35
+ * import sites; the value is now a direct call — see file header / F176.)
36
+ */
37
+ export declare const BIND_VIA_GATEWAY_EXAMPLE = "yootheme_builder_element_bind_source({ template_id, element_path, source_name, field_mappings })";
38
+ /**
39
+ * The canonical hint string. Use verbatim wherever guidance previously said
40
+ * "use element_bind_source". It states that the bind tool is first-class
41
+ * (call it directly) and shows the exact call shape.
42
+ */
43
+ export declare const BIND_VIA_GATEWAY_HINT: string;
44
+ /**
45
+ * Compose a hint for a specific reason, e.g.
46
+ * `bindViaGateway('to bind the grid_item child')`. Produces:
47
+ * "<reason>, call yootheme_builder_element_bind_source({ … }) directly —
48
+ * it is a first-class tool in tools/list."
49
+ */
50
+ export declare function bindViaGateway(reason: string): string;
51
+ /**
52
+ * F189 (2026-06-12) — the three canonical Multi-Items binding-correctness
53
+ * steering texts, grounded in the YT5 renderer truth table (SourceTransform.php
54
+ * + element templates, code+empirically verified). Centralised here so the bind
55
+ * handler, the inspect handler, and the tool descriptions stay in lock-step and
56
+ * `bind-guidance.test.ts` can pin them.
57
+ *
58
+ * The ONE rule: a `…List` source renders nested children ONLY when the element
59
+ * carrying it is a CONTAINER whose template renders `$children` (column /
60
+ * fragment / row / section / grid). `grid_item` and every `*_item` atom are
61
+ * LEAF renderers — repeatSource clones them per row, but their children are
62
+ * NEVER rendered. `item.source.props` maps row fields onto the element's OWN
63
+ * slots only (last-write-wins, no merge).
64
+ */
65
+ /**
66
+ * Reject text — a `…List` on a grid_item that carries nested children. The
67
+ * children are render-dead; only the item's own slots paint.
68
+ */
69
+ export declare const GRID_ITEM_ITERATOR_REJECT: string;
70
+ /**
71
+ * Canonical multi-leaf form — iterate on a CONTAINER, one #parent leaf per
72
+ * field; no leaf limit.
73
+ */
74
+ export declare const CANONICAL_MULTI_LEAF_FORM: string;
75
+ /**
76
+ * Slot-collision text — two fields cannot bind to the same prop slot on one
77
+ * element (last-write-wins drops one).
78
+ */
79
+ export declare const SLOT_COLLISION_STEERING: string;
80
+ //# sourceMappingURL=bind-guidance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bind-guidance.d.ts","sourceRoot":"","sources":["../../src/tools/bind-guidance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,8DAA8D;AAC9D,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AAEjE,yEAAyE;AACzE,eAAO,MAAM,gBAAgB,yCAAyC,CAAC;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,qGACgD,CAAC;AAEtF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAEqB,CAAC;AAExD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKrD;AAED;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAKgD,CAAC;AAEvF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAKmD,CAAC;AAE1F;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAIG,CAAC"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Canonical binding-guidance phrasing (C6 2026-06-10; F176 2026-06-12).
3
+ *
4
+ * `yootheme_builder_element_bind_source` was promoted from L2 (advanced
5
+ * gateway) to **L1** by F116 (2026-06-11) — it is now a FIRST-CLASS entry in
6
+ * `tools/list` (see `gateway/essentials.ts`: it is in ESSENTIAL_TOOLS). The
7
+ * CapturingServer enforces a DISJOINT-LANE invariant, so the tool is NOT in
8
+ * the advanced registry: calling `yootheme_builder_advanced({ tool:
9
+ * "yootheme_builder_element_bind_source" })` returns `unknown_tool` on a
10
+ * current build. An agent that follows OLD guidance saying "wrap the bind
11
+ * call in the advanced gateway" therefore hits an `invalid_value` /
12
+ * `unknown tool` dead end (F176: cage agents reproduced this 4× in R3).
13
+ *
14
+ * Every binding hint, schema annotation, and error message therefore now
15
+ * instructs a DIRECT call through this single source of truth. Centralising
16
+ * the phrasing keeps the ~dozen call-sites in lock-step and lets
17
+ * `bind-guidance.test.ts` + `l1-no-gateway-wrap-pin.test.ts` pin the shape.
18
+ *
19
+ * Back-compat: a customer on a PRE-F116 server build (where the tool was
20
+ * still L2) can reach it via `yootheme_builder_advanced({ tool:
21
+ * "yootheme_builder_element_bind_source", arguments: {…} })`. That fallback
22
+ * lives only in customer-facing skill docs, never in the runtime guidance
23
+ * strings below.
24
+ *
25
+ * @license MIT
26
+ */
27
+ /** The gateway tool that reaches every advanced (L2) tool. */
28
+ export const ADVANCED_GATEWAY_TOOL = 'yootheme_builder_advanced';
29
+ /** The bind tool — a first-class L1 entry in `tools/list` since F116. */
30
+ export const BIND_SOURCE_TOOL = 'yootheme_builder_element_bind_source';
31
+ /**
32
+ * A runnable one-line example of the DIRECT bind call. Kept short so it can
33
+ * ride inside error strings + schema descriptions without bloating the
34
+ * payload. (Named *_VIA_GATEWAY_* for source-compat with the ~dozen existing
35
+ * import sites; the value is now a direct call — see file header / F176.)
36
+ */
37
+ export const BIND_VIA_GATEWAY_EXAMPLE = `${BIND_SOURCE_TOOL}({ template_id, element_path, source_name, field_mappings })`;
38
+ /**
39
+ * The canonical hint string. Use verbatim wherever guidance previously said
40
+ * "use element_bind_source". It states that the bind tool is first-class
41
+ * (call it directly) and shows the exact call shape.
42
+ */
43
+ export const BIND_VIA_GATEWAY_HINT = `call \`${BIND_SOURCE_TOOL}\` directly — it is a first-class tool in tools/list ` +
44
+ `(since F116). Shape: ${BIND_VIA_GATEWAY_EXAMPLE}.`;
45
+ /**
46
+ * Compose a hint for a specific reason, e.g.
47
+ * `bindViaGateway('to bind the grid_item child')`. Produces:
48
+ * "<reason>, call yootheme_builder_element_bind_source({ … }) directly —
49
+ * it is a first-class tool in tools/list."
50
+ */
51
+ export function bindViaGateway(reason) {
52
+ return (`${reason}, call ${BIND_VIA_GATEWAY_EXAMPLE} directly ` +
53
+ `— \`${BIND_SOURCE_TOOL}\` is a first-class tool in tools/list (since F116).`);
54
+ }
55
+ /**
56
+ * F189 (2026-06-12) — the three canonical Multi-Items binding-correctness
57
+ * steering texts, grounded in the YT5 renderer truth table (SourceTransform.php
58
+ * + element templates, code+empirically verified). Centralised here so the bind
59
+ * handler, the inspect handler, and the tool descriptions stay in lock-step and
60
+ * `bind-guidance.test.ts` can pin them.
61
+ *
62
+ * The ONE rule: a `…List` source renders nested children ONLY when the element
63
+ * carrying it is a CONTAINER whose template renders `$children` (column /
64
+ * fragment / row / section / grid). `grid_item` and every `*_item` atom are
65
+ * LEAF renderers — repeatSource clones them per row, but their children are
66
+ * NEVER rendered. `item.source.props` maps row fields onto the element's OWN
67
+ * slots only (last-write-wins, no merge).
68
+ */
69
+ /**
70
+ * Reject text — a `…List` on a grid_item that carries nested children. The
71
+ * children are render-dead; only the item's own slots paint.
72
+ */
73
+ export const GRID_ITEM_ITERATOR_REJECT = 'A list source on a grid_item makes it repeat per row, but a grid_item only ' +
74
+ 'renders its OWN slots (title, meta, content, image, link) — it NEVER renders ' +
75
+ 'nested child elements, so they are dropped and you see placeholders. Fix: ' +
76
+ '(1) map fields onto the item\'s slots props:{title,meta,content,image}, or ' +
77
+ '(2) move the List onto a container (column/fragment/row) and use #parent leaves.';
78
+ /**
79
+ * Canonical multi-leaf form — iterate on a CONTAINER, one #parent leaf per
80
+ * field; no leaf limit.
81
+ */
82
+ export const CANONICAL_MULTI_LEAF_FORM = 'To render more fields per row than an item has slots, iterate on a CONTAINER: ' +
83
+ 'put source:{query:{name:"…List"}} on a column (or fragment/row), then add one ' +
84
+ 'leaf element per field inside, each with source:{query:{name:"#parent"}, ' +
85
+ 'props:{<slot>:{name:"<field>"}}}. <slot> is content for headline/text, or ' +
86
+ 'title/meta/image for panel. There is no leaf limit. A fragment wrapper is optional.';
87
+ /**
88
+ * Slot-collision text — two fields cannot bind to the same prop slot on one
89
+ * element (last-write-wins drops one).
90
+ */
91
+ export const SLOT_COLLISION_STEERING = 'Two fields cannot bind to the same prop slot on one element — YT5 mapSource ' +
92
+ 'does last-write-wins and one value is lost. Give each field its own leaf ' +
93
+ 'element, or map them to DISTINCT slots of a multi-slot element ' +
94
+ '(e.g. panel\'s title/meta/image).';
95
+ //# sourceMappingURL=bind-guidance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bind-guidance.js","sourceRoot":"","sources":["../../src/tools/bind-guidance.ts"],"names":[],"mappings":"AAAA;;;;;;;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AgB,kBAAkB,CAC9B,IAAI,EAAE,UAAU,EAChB,IAAI,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACpC,SAAS,iBAAiB,EAAE,CAqN9B"}
1
+ {"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/tools/elements/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI7D,OAAO,EAOH,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGH,KAAK,mBAAmB,EAS3B,MAAM,eAAe,CAAC;AAEvB;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,UAAU,EAChB,IAAI,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACpC,SAAS,iBAAiB,EAAE,CAwR9B"}
@@ -16,7 +16,7 @@ import { withSiteRetry } from '../pool-resolve-helper.js';
16
16
  import { ELEMENT_PATH, ETAG, PROPS, SITE_ID_SCHEMA, TEMPLATE_ID } from '../shared-schemas.js';
17
17
  import { FIELDS } from '../sparse-fields.js';
18
18
  import { creating, defineTool, destructive, mutating, readOnly, withSiteMeta, } from '../tool-builder.js';
19
- import { ELEMENT_GET_OUTPUT_SCHEMA, ELEMENT_LIST_OUTPUT_SCHEMA, handleElementAdd, handleElementClone, handleElementDelete, handleElementGet, handleElementList, handleElementMove, handleElementUpdateSettings, } from './handlers.js';
19
+ import { ELEMENT_GET_OUTPUT_SCHEMA, ELEMENT_LIST_OUTPUT_SCHEMA, handleElementAdd, handleElementClone, handleElementDelete, handleElementGet, handleElementList, handleElementMove, handleElementUpdateSettings, handleScaffoldSection, } from './handlers.js';
20
20
  /**
21
21
  * Build the 7 element tools. The optional `deps` carries the
22
22
  * elicitation capability used by `element_delete` (Wave G.4.1). When
@@ -87,31 +87,55 @@ export function buildElementsTools(pool, deps) {
87
87
  name: 'yootheme_builder_element_add',
88
88
  description: 'Add a new element to a template. Provide `parent_path` (or "" for root), ' +
89
89
  '`element_type` (e.g. "headline", "text", "grid"), and optional `props` / ' +
90
- '`children`. Returns the new element\'s JSON-Pointer path. Requires ETag. ' +
90
+ '`children`. Appends by default; pass `index` (0 = first) to insert before ' +
91
+ 'siblings. Returns the new element\'s JSON-Pointer path. Requires ETag. ' +
91
92
  'Operates on the default site unless site_id is provided.',
92
93
  inputSchema: {
93
94
  site_id: SITE_ID_SCHEMA,
94
95
  template_id: TEMPLATE_ID,
95
96
  parent_path: z
96
97
  .string()
97
- .default('')
98
- .describe('JSON-Pointer of the parent node. Accepts EITHER "" for ' +
99
- 'template root, a `rel_path` from `element_list` ' +
100
- '(`/children/0`, `/children/0/children/2`) — the server ' +
101
- 'resolves it within this template — OR a fully-qualified ' +
102
- 'pointer (`/templates/<id>/layout/children/0/...`). The ' +
103
- 'rel_path form is preferred (copy-paste straight from ' +
104
- '`element_list`).'),
98
+ .optional()
99
+ .describe('JSON-Pointer of the parent node. Default "" (template root). ' +
100
+ 'Preferred: a `rel_path` value from element_list (e.g. ' +
101
+ '`/children/0`) — copy it straight back.'),
105
102
  element_type: z
106
103
  .string()
107
104
  .min(1)
105
+ .optional()
108
106
  .describe('Type of element to create (e.g. "headline", "text", "grid"). ' +
109
- 'Use yootheme_builder_element_types_list for the catalogue.'),
107
+ 'Use yootheme_builder_element_types_list for the catalogue. ' +
108
+ 'Canonical key; `type_name` is accepted as an alias.'),
109
+ // F165 — accept the natural-but-wrong alias `type_name`
110
+ // (mirrors element_type_get_schema). Normalised to
111
+ // `element_type` server-side; never forwarded verbatim.
112
+ type_name: z
113
+ .string()
114
+ .min(1)
115
+ .optional()
116
+ .describe('Alias of `element_type` — use `element_type`. Accepted so a ' +
117
+ 'verbatim call with the wrong key still lands.'),
110
118
  props: PROPS.optional(),
111
119
  children: z
112
120
  .array(z.record(z.string(), z.unknown()))
113
121
  .optional()
114
122
  .describe('Optional initial children — array of element objects.'),
123
+ // F70 (2026-06-10): optional insertion index. Default (absent)
124
+ // appends. 0 = first child; an over-shot index is clamped to
125
+ // the end server-side. `position` is accepted as an alias.
126
+ index: z
127
+ .number()
128
+ .int()
129
+ .min(0)
130
+ .optional()
131
+ .describe('Insertion position among children (0 = first). Omit to append; ' +
132
+ 'past-end clamps to last. Alias: `position`.'),
133
+ position: z
134
+ .number()
135
+ .int()
136
+ .min(0)
137
+ .optional()
138
+ .describe('Alias of `index`.'),
115
139
  etag: ETAG,
116
140
  },
117
141
  annotations: creating('Add Element'),
@@ -174,22 +198,55 @@ export function buildElementsTools(pool, deps) {
174
198
  annotations: creating('Clone Element'),
175
199
  handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleElementClone(makeDeps(client), rest, extra), site)),
176
200
  }),
201
+ defineTool({
202
+ name: 'yootheme_builder_scaffold_section',
203
+ description: 'Create a VALID section → row → column hull in ONE atomic call and return the ' +
204
+ 'column JSON-Pointer path(s) to drop content into. This is the EASIEST correct ' +
205
+ 'way to start a new layout block: YOOtheme content must live in ' +
206
+ 'section → row → column, and adding content anywhere else (root, bare section, ' +
207
+ 'bare row) is rejected. Pass `columns` (1-12, default 1) for a multi-column row. ' +
208
+ 'Requires ETag. Operates on the default site unless site_id is provided.',
209
+ inputSchema: {
210
+ site_id: SITE_ID_SCHEMA,
211
+ template_id: TEMPLATE_ID,
212
+ columns: z
213
+ .number()
214
+ .int()
215
+ .min(1)
216
+ .max(12)
217
+ .default(1)
218
+ .describe('Number of columns in the row (1-12; default 1). An out-of-range ' +
219
+ 'value is clamped server-side, never errors.'),
220
+ etag: ETAG,
221
+ },
222
+ annotations: creating('Scaffold Section'),
223
+ handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleScaffoldSection(makeDeps(client), rest, extra), site)),
224
+ }),
177
225
  defineTool({
178
226
  name: 'yootheme_builder_element_delete',
179
- description: 'PERMANENTLY delete an element and all its children. Cannot be undone. Always ' +
180
- 'ask the user to confirm first, then call again with `confirm: true`. Requires ' +
181
- 'ETag. Operates on the default site unless site_id is provided.',
227
+ description: 'PERMANENTLY delete an element + children. Cannot be undone. Pass `confirm: ' +
228
+ 'true` (boolean) AND a fresh ETag. If `preview:true` returns despite confirm, ' +
229
+ 'check `details.received_confirm` strings/numbers accepted, but boolean is ' +
230
+ 'canonical. Operates on the default site unless site_id is provided.',
182
231
  inputSchema: {
183
232
  site_id: SITE_ID_SCHEMA,
184
233
  template_id: TEMPLATE_ID,
185
234
  element_path: ELEMENT_PATH,
186
235
  etag: ETAG,
236
+ // Wave-6 R4: accept boolean OR the string literals "true"/"false"
237
+ // and numeric 0/1 — the handler's `isConfirmedTrue` coerces all
238
+ // four into the canonical boolean. Cold-AI #4 reported a confirm
239
+ // gate that kept firing despite passing the value; the safety net
240
+ // prevents future schema-string mismatches from re-creating that
241
+ // class of bug.
187
242
  confirm: z
188
- .boolean()
243
+ .union([z.boolean(), z.literal('true'), z.literal('false'), z.literal(0), z.literal(1)])
189
244
  .optional()
190
- .describe('Must be true to execute. On supporting hosts the agent is prompted ' +
191
- 'via MCP elicitation when omitted; otherwise the call returns a ' +
192
- 'preview and the agent must retry with `confirm: true`.'),
245
+ .describe('Must be `true` (boolean literal) to execute. Strings "true"/"false" ' +
246
+ 'and numeric 1/0 are also accepted as a safety net but `true` is ' +
247
+ 'canonical. On supporting hosts the agent is prompted via MCP ' +
248
+ 'elicitation when omitted; otherwise the call returns a preview ' +
249
+ 'and the agent must retry with `confirm: true`.'),
193
250
  },
194
251
  annotations: destructive('Delete Element'),
195
252
  handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleElementDelete(makeDeps(client), rest, extra), site)),
@@ -1 +1 @@
1
- {"version":3,"file":"builders.js","sourceRoot":"","sources":["../../../src/tools/elements/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KA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