@wootsup/yt-builder-mcp 1.1.6 → 1.2.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 (430) hide show
  1. package/README.md +7 -7
  2. package/bin/yt-builder-mcp.js +55 -40
  3. package/dist/auth.d.ts +137 -0
  4. package/dist/auth.d.ts.map +1 -0
  5. package/dist/auth.js +244 -0
  6. package/dist/auth.js.map +1 -0
  7. package/dist/cli/invocation-decision.d.ts +57 -0
  8. package/dist/cli/invocation-decision.d.ts.map +1 -0
  9. package/dist/cli/invocation-decision.js +86 -0
  10. package/dist/cli/invocation-decision.js.map +1 -0
  11. package/dist/client.d.ts +112 -0
  12. package/dist/client.d.ts.map +1 -0
  13. package/dist/client.js +190 -0
  14. package/dist/client.js.map +1 -0
  15. package/dist/clients/claude-code.d.ts +18 -0
  16. package/dist/clients/claude-code.d.ts.map +1 -0
  17. package/dist/clients/claude-code.js +55 -0
  18. package/dist/clients/claude-code.js.map +1 -0
  19. package/dist/clients/claude-desktop.d.ts +19 -0
  20. package/dist/clients/claude-desktop.d.ts.map +1 -0
  21. package/dist/clients/claude-desktop.js +58 -0
  22. package/dist/clients/claude-desktop.js.map +1 -0
  23. package/dist/clients/cline.d.ts +26 -0
  24. package/dist/clients/cline.d.ts.map +1 -0
  25. package/dist/clients/cline.js +82 -0
  26. package/dist/clients/cline.js.map +1 -0
  27. package/dist/clients/codex-cli.d.ts +42 -0
  28. package/dist/clients/codex-cli.d.ts.map +1 -0
  29. package/dist/clients/codex-cli.js +292 -0
  30. package/dist/clients/codex-cli.js.map +1 -0
  31. package/dist/clients/continue.d.ts +13 -0
  32. package/dist/clients/continue.d.ts.map +1 -0
  33. package/dist/clients/continue.js +121 -0
  34. package/dist/clients/continue.js.map +1 -0
  35. package/dist/clients/cursor.d.ts +12 -0
  36. package/dist/clients/cursor.d.ts.map +1 -0
  37. package/dist/clients/cursor.js +40 -0
  38. package/dist/clients/cursor.js.map +1 -0
  39. package/dist/clients/gemini-cli.d.ts +18 -0
  40. package/dist/clients/gemini-cli.d.ts.map +1 -0
  41. package/dist/clients/gemini-cli.js +46 -0
  42. package/dist/clients/gemini-cli.js.map +1 -0
  43. package/dist/clients/home.d.ts +14 -0
  44. package/dist/clients/home.d.ts.map +1 -0
  45. package/dist/clients/home.js +20 -0
  46. package/dist/clients/home.js.map +1 -0
  47. package/dist/clients/index.d.ts +156 -0
  48. package/dist/clients/index.d.ts.map +1 -0
  49. package/dist/clients/index.js +213 -0
  50. package/dist/clients/index.js.map +1 -0
  51. package/dist/clients/roo-code.d.ts +23 -0
  52. package/dist/clients/roo-code.d.ts.map +1 -0
  53. package/dist/clients/roo-code.js +71 -0
  54. package/dist/clients/roo-code.js.map +1 -0
  55. package/dist/clients/zed.d.ts +12 -0
  56. package/dist/clients/zed.d.ts.map +1 -0
  57. package/dist/clients/zed.js +43 -0
  58. package/dist/clients/zed.js.map +1 -0
  59. package/dist/errors/hints.d.ts +51 -0
  60. package/dist/errors/hints.d.ts.map +1 -0
  61. package/dist/errors/hints.js +95 -0
  62. package/dist/errors/hints.js.map +1 -0
  63. package/dist/errors/mask.d.ts +35 -0
  64. package/dist/errors/mask.d.ts.map +1 -0
  65. package/dist/errors/mask.js +49 -0
  66. package/dist/errors/mask.js.map +1 -0
  67. package/dist/errors/sanitize.d.ts +31 -0
  68. package/dist/errors/sanitize.d.ts.map +1 -0
  69. package/dist/errors/sanitize.js +100 -0
  70. package/dist/errors/sanitize.js.map +1 -0
  71. package/dist/errors.d.ts +42 -0
  72. package/dist/errors.d.ts.map +1 -0
  73. package/dist/errors.js +61 -0
  74. package/dist/errors.js.map +1 -0
  75. package/dist/gateway/advanced-tool/discovery.d.ts +19 -0
  76. package/dist/gateway/advanced-tool/discovery.d.ts.map +1 -0
  77. package/dist/gateway/advanced-tool/discovery.js +53 -0
  78. package/dist/gateway/advanced-tool/discovery.js.map +1 -0
  79. package/dist/gateway/advanced-tool/domains.d.ts +47 -0
  80. package/dist/gateway/advanced-tool/domains.d.ts.map +1 -0
  81. package/dist/gateway/advanced-tool/domains.js +94 -0
  82. package/dist/gateway/advanced-tool/domains.js.map +1 -0
  83. package/dist/gateway/advanced-tool/execute.d.ts +29 -0
  84. package/dist/gateway/advanced-tool/execute.d.ts.map +1 -0
  85. package/dist/gateway/advanced-tool/execute.js +54 -0
  86. package/dist/gateway/advanced-tool/execute.js.map +1 -0
  87. package/dist/gateway/advanced-tool/index.d.ts +36 -0
  88. package/dist/gateway/advanced-tool/index.d.ts.map +1 -0
  89. package/dist/gateway/advanced-tool/index.js +39 -0
  90. package/dist/gateway/advanced-tool/index.js.map +1 -0
  91. package/dist/gateway/advanced-tool/register.d.ts +18 -0
  92. package/dist/gateway/advanced-tool/register.d.ts.map +1 -0
  93. package/dist/gateway/advanced-tool/register.js +69 -0
  94. package/dist/gateway/advanced-tool/register.js.map +1 -0
  95. package/dist/gateway/advanced-tool.d.ts +13 -0
  96. package/dist/gateway/advanced-tool.d.ts.map +1 -0
  97. package/dist/gateway/advanced-tool.js +13 -0
  98. package/dist/gateway/advanced-tool.js.map +1 -0
  99. package/dist/gateway/capturing-server.d.ts +117 -0
  100. package/dist/gateway/capturing-server.d.ts.map +1 -0
  101. package/dist/gateway/capturing-server.js +103 -0
  102. package/dist/gateway/capturing-server.js.map +1 -0
  103. package/dist/gateway/essentials.d.ts +50 -0
  104. package/dist/gateway/essentials.d.ts.map +1 -0
  105. package/dist/gateway/essentials.js +108 -0
  106. package/dist/gateway/essentials.js.map +1 -0
  107. package/dist/gateway/test-support.d.ts +41 -0
  108. package/dist/gateway/test-support.d.ts.map +1 -0
  109. package/dist/gateway/test-support.js +60 -0
  110. package/dist/gateway/test-support.js.map +1 -0
  111. package/dist/index.d.ts +30 -0
  112. package/dist/index.d.ts.map +1 -0
  113. package/dist/index.js +119 -0
  114. package/dist/index.js.map +1 -0
  115. package/dist/install-skill.d.ts +43 -0
  116. package/dist/install-skill.d.ts.map +1 -0
  117. package/dist/install-skill.js +118 -0
  118. package/dist/install-skill.js.map +1 -0
  119. package/dist/platform/detect.d.ts +64 -0
  120. package/dist/platform/detect.d.ts.map +1 -0
  121. package/dist/platform/detect.js +98 -0
  122. package/dist/platform/detect.js.map +1 -0
  123. package/dist/platform/index.d.ts +121 -0
  124. package/dist/platform/index.d.ts.map +1 -0
  125. package/dist/platform/index.js +176 -0
  126. package/dist/platform/index.js.map +1 -0
  127. package/dist/platform/joomla.d.ts +44 -0
  128. package/dist/platform/joomla.d.ts.map +1 -0
  129. package/dist/platform/joomla.js +46 -0
  130. package/dist/platform/joomla.js.map +1 -0
  131. package/dist/server.d.ts +110 -0
  132. package/dist/server.d.ts.map +1 -0
  133. package/dist/server.js +274 -0
  134. package/dist/server.js.map +1 -0
  135. package/dist/setup-cli-confirm.d.ts +36 -0
  136. package/dist/setup-cli-confirm.d.ts.map +1 -0
  137. package/dist/setup-cli-confirm.js +59 -0
  138. package/dist/setup-cli-confirm.js.map +1 -0
  139. package/dist/setup-cli.d.ts +193 -0
  140. package/dist/setup-cli.d.ts.map +1 -0
  141. package/dist/setup-cli.js +1032 -0
  142. package/dist/setup-cli.js.map +1 -0
  143. package/dist/setup-prompts.d.ts +64 -0
  144. package/dist/setup-prompts.d.ts.map +1 -0
  145. package/dist/setup-prompts.js +221 -0
  146. package/dist/setup-prompts.js.map +1 -0
  147. package/dist/setup-token.d.ts +38 -0
  148. package/dist/setup-token.d.ts.map +1 -0
  149. package/dist/setup-token.js +106 -0
  150. package/dist/setup-token.js.map +1 -0
  151. package/dist/setup-wizard-defaults.d.ts +43 -0
  152. package/dist/setup-wizard-defaults.d.ts.map +1 -0
  153. package/dist/setup-wizard-defaults.js +160 -0
  154. package/dist/setup-wizard-defaults.js.map +1 -0
  155. package/dist/setup-wizard-handshake.d.ts +25 -0
  156. package/dist/setup-wizard-handshake.d.ts.map +1 -0
  157. package/dist/setup-wizard-handshake.js +103 -0
  158. package/dist/setup-wizard-handshake.js.map +1 -0
  159. package/dist/setup-wizard-types.d.ts +164 -0
  160. package/dist/setup-wizard-types.d.ts.map +1 -0
  161. package/dist/setup-wizard-types.js +11 -0
  162. package/dist/setup-wizard-types.js.map +1 -0
  163. package/dist/setup-wizard.d.ts +33 -0
  164. package/dist/setup-wizard.d.ts.map +1 -0
  165. package/dist/setup-wizard.js +199 -0
  166. package/dist/setup-wizard.js.map +1 -0
  167. package/dist/setup.d.ts +17 -0
  168. package/dist/setup.d.ts.map +1 -0
  169. package/dist/setup.js +33 -0
  170. package/dist/setup.js.map +1 -0
  171. package/dist/sites/bootstrap.d.ts +41 -0
  172. package/dist/sites/bootstrap.d.ts.map +1 -0
  173. package/dist/sites/bootstrap.js +58 -0
  174. package/dist/sites/bootstrap.js.map +1 -0
  175. package/dist/sites/cli/add-site.d.ts +106 -0
  176. package/dist/sites/cli/add-site.d.ts.map +1 -0
  177. package/dist/sites/cli/add-site.js +185 -0
  178. package/dist/sites/cli/add-site.js.map +1 -0
  179. package/dist/sites/cli/list-sites.d.ts +40 -0
  180. package/dist/sites/cli/list-sites.d.ts.map +1 -0
  181. package/dist/sites/cli/list-sites.js +116 -0
  182. package/dist/sites/cli/list-sites.js.map +1 -0
  183. package/dist/sites/cli/remove-site.d.ts +60 -0
  184. package/dist/sites/cli/remove-site.d.ts.map +1 -0
  185. package/dist/sites/cli/remove-site.js +120 -0
  186. package/dist/sites/cli/remove-site.js.map +1 -0
  187. package/dist/sites/cli/set-default.d.ts +47 -0
  188. package/dist/sites/cli/set-default.d.ts.map +1 -0
  189. package/dist/sites/cli/set-default.js +69 -0
  190. package/dist/sites/cli/set-default.js.map +1 -0
  191. package/dist/sites/cli/test-site.d.ts +77 -0
  192. package/dist/sites/cli/test-site.d.ts.map +1 -0
  193. package/dist/sites/cli/test-site.js +146 -0
  194. package/dist/sites/cli/test-site.js.map +1 -0
  195. package/dist/sites/client-pool.d.ts +157 -0
  196. package/dist/sites/client-pool.d.ts.map +1 -0
  197. package/dist/sites/client-pool.js +222 -0
  198. package/dist/sites/client-pool.js.map +1 -0
  199. package/dist/sites/env-bridge.d.ts +55 -0
  200. package/dist/sites/env-bridge.d.ts.map +1 -0
  201. package/dist/sites/env-bridge.js +94 -0
  202. package/dist/sites/env-bridge.js.map +1 -0
  203. package/dist/sites/paths.d.ts +21 -0
  204. package/dist/sites/paths.d.ts.map +1 -0
  205. package/dist/sites/paths.js +37 -0
  206. package/dist/sites/paths.js.map +1 -0
  207. package/dist/sites/probe.d.ts +60 -0
  208. package/dist/sites/probe.d.ts.map +1 -0
  209. package/dist/sites/probe.js +112 -0
  210. package/dist/sites/probe.js.map +1 -0
  211. package/dist/sites/registry.d.ts +142 -0
  212. package/dist/sites/registry.d.ts.map +1 -0
  213. package/dist/sites/registry.js +163 -0
  214. package/dist/sites/registry.js.map +1 -0
  215. package/dist/sites/schema.d.ts +90 -0
  216. package/dist/sites/schema.d.ts.map +1 -0
  217. package/dist/sites/schema.js +71 -0
  218. package/dist/sites/schema.js.map +1 -0
  219. package/dist/sites/secret-resolver.d.ts +115 -0
  220. package/dist/sites/secret-resolver.d.ts.map +1 -0
  221. package/dist/sites/secret-resolver.js +225 -0
  222. package/dist/sites/secret-resolver.js.map +1 -0
  223. package/dist/sites/store.d.ts +82 -0
  224. package/dist/sites/store.d.ts.map +1 -0
  225. package/dist/sites/store.js +198 -0
  226. package/dist/sites/store.js.map +1 -0
  227. package/dist/sites/tools/index.d.ts +28 -0
  228. package/dist/sites/tools/index.d.ts.map +1 -0
  229. package/dist/sites/tools/index.js +38 -0
  230. package/dist/sites/tools/index.js.map +1 -0
  231. package/dist/sites/tools/sites-list.d.ts +48 -0
  232. package/dist/sites/tools/sites-list.d.ts.map +1 -0
  233. package/dist/sites/tools/sites-list.js +137 -0
  234. package/dist/sites/tools/sites-list.js.map +1 -0
  235. package/dist/sites/tools/sites-test.d.ts +47 -0
  236. package/dist/sites/tools/sites-test.d.ts.map +1 -0
  237. package/dist/sites/tools/sites-test.js +148 -0
  238. package/dist/sites/tools/sites-test.js.map +1 -0
  239. package/dist/sites/tools/use-site.d.ts +47 -0
  240. package/dist/sites/tools/use-site.d.ts.map +1 -0
  241. package/dist/sites/tools/use-site.js +183 -0
  242. package/dist/sites/tools/use-site.js.map +1 -0
  243. package/dist/skill-loader.d.ts +111 -0
  244. package/dist/skill-loader.d.ts.map +1 -0
  245. package/dist/skill-loader.js +191 -0
  246. package/dist/skill-loader.js.map +1 -0
  247. package/dist/tools/elements/builders.d.ts +24 -0
  248. package/dist/tools/elements/builders.d.ts.map +1 -0
  249. package/dist/tools/elements/builders.js +208 -0
  250. package/dist/tools/elements/builders.js.map +1 -0
  251. package/dist/tools/elements/handlers-write.d.ts +49 -0
  252. package/dist/tools/elements/handlers-write.d.ts.map +1 -0
  253. package/dist/tools/elements/handlers-write.js +341 -0
  254. package/dist/tools/elements/handlers-write.js.map +1 -0
  255. package/dist/tools/elements/handlers.d.ts +70 -0
  256. package/dist/tools/elements/handlers.d.ts.map +1 -0
  257. package/dist/tools/elements/handlers.js +292 -0
  258. package/dist/tools/elements/handlers.js.map +1 -0
  259. package/dist/tools/elements/index.d.ts +28 -0
  260. package/dist/tools/elements/index.d.ts.map +1 -0
  261. package/dist/tools/elements/index.js +27 -0
  262. package/dist/tools/elements/index.js.map +1 -0
  263. package/dist/tools/elements.d.ts +13 -0
  264. package/dist/tools/elements.d.ts.map +1 -0
  265. package/dist/tools/elements.js +13 -0
  266. package/dist/tools/elements.js.map +1 -0
  267. package/dist/tools/elicitation.d.ts +87 -0
  268. package/dist/tools/elicitation.d.ts.map +1 -0
  269. package/dist/tools/elicitation.js +100 -0
  270. package/dist/tools/elicitation.js.map +1 -0
  271. package/dist/tools/format/elements-format.d.ts +40 -0
  272. package/dist/tools/format/elements-format.d.ts.map +1 -0
  273. package/dist/tools/format/elements-format.js +193 -0
  274. package/dist/tools/format/elements-format.js.map +1 -0
  275. package/dist/tools/format/health-format.d.ts +79 -0
  276. package/dist/tools/format/health-format.d.ts.map +1 -0
  277. package/dist/tools/format/health-format.js +181 -0
  278. package/dist/tools/format/health-format.js.map +1 -0
  279. package/dist/tools/format/inspection-format.d.ts +70 -0
  280. package/dist/tools/format/inspection-format.d.ts.map +1 -0
  281. package/dist/tools/format/inspection-format.js +359 -0
  282. package/dist/tools/format/inspection-format.js.map +1 -0
  283. package/dist/tools/format/pages-format.d.ts +57 -0
  284. package/dist/tools/format/pages-format.d.ts.map +1 -0
  285. package/dist/tools/format/pages-format.js +157 -0
  286. package/dist/tools/format/pages-format.js.map +1 -0
  287. package/dist/tools/format/sources-format.d.ts +44 -0
  288. package/dist/tools/format/sources-format.d.ts.map +1 -0
  289. package/dist/tools/format/sources-format.js +242 -0
  290. package/dist/tools/format/sources-format.js.map +1 -0
  291. package/dist/tools/health.d.ts +22 -0
  292. package/dist/tools/health.d.ts.map +1 -0
  293. package/dist/tools/health.js +220 -0
  294. package/dist/tools/health.js.map +1 -0
  295. package/dist/tools/index.d.ts +30 -0
  296. package/dist/tools/index.d.ts.map +1 -0
  297. package/dist/tools/index.js +39 -0
  298. package/dist/tools/index.js.map +1 -0
  299. package/dist/tools/inspection.d.ts +14 -0
  300. package/dist/tools/inspection.d.ts.map +1 -0
  301. package/dist/tools/inspection.js +401 -0
  302. package/dist/tools/inspection.js.map +1 -0
  303. package/dist/tools/layout-flatten.d.ts +75 -0
  304. package/dist/tools/layout-flatten.d.ts.map +1 -0
  305. package/dist/tools/layout-flatten.js +107 -0
  306. package/dist/tools/layout-flatten.js.map +1 -0
  307. package/dist/tools/multi-items/builders.d.ts +23 -0
  308. package/dist/tools/multi-items/builders.d.ts.map +1 -0
  309. package/dist/tools/multi-items/builders.js +84 -0
  310. package/dist/tools/multi-items/builders.js.map +1 -0
  311. package/dist/tools/multi-items/clean-implode-handler.d.ts +36 -0
  312. package/dist/tools/multi-items/clean-implode-handler.d.ts.map +1 -0
  313. package/dist/tools/multi-items/clean-implode-handler.js +57 -0
  314. package/dist/tools/multi-items/clean-implode-handler.js.map +1 -0
  315. package/dist/tools/multi-items/format/inspection-format.d.ts +41 -0
  316. package/dist/tools/multi-items/format/inspection-format.d.ts.map +1 -0
  317. package/dist/tools/multi-items/format/inspection-format.js +64 -0
  318. package/dist/tools/multi-items/format/inspection-format.js.map +1 -0
  319. package/dist/tools/multi-items/index.d.ts +18 -0
  320. package/dist/tools/multi-items/index.d.ts.map +1 -0
  321. package/dist/tools/multi-items/index.js +18 -0
  322. package/dist/tools/multi-items/index.js.map +1 -0
  323. package/dist/tools/multi-items/inspect-handler.d.ts +76 -0
  324. package/dist/tools/multi-items/inspect-handler.d.ts.map +1 -0
  325. package/dist/tools/multi-items/inspect-handler.js +133 -0
  326. package/dist/tools/multi-items/inspect-handler.js.map +1 -0
  327. package/dist/tools/multi-items/inspection-cache.d.ts +85 -0
  328. package/dist/tools/multi-items/inspection-cache.d.ts.map +1 -0
  329. package/dist/tools/multi-items/inspection-cache.js +126 -0
  330. package/dist/tools/multi-items/inspection-cache.js.map +1 -0
  331. package/dist/tools/multi-items/item-container-map.d.ts +41 -0
  332. package/dist/tools/multi-items/item-container-map.d.ts.map +1 -0
  333. package/dist/tools/multi-items/item-container-map.js +73 -0
  334. package/dist/tools/multi-items/item-container-map.js.map +1 -0
  335. package/dist/tools/pages/builders.d.ts +43 -0
  336. package/dist/tools/pages/builders.d.ts.map +1 -0
  337. package/dist/tools/pages/builders.js +229 -0
  338. package/dist/tools/pages/builders.js.map +1 -0
  339. package/dist/tools/pages/handlers-read.d.ts +33 -0
  340. package/dist/tools/pages/handlers-read.d.ts.map +1 -0
  341. package/dist/tools/pages/handlers-read.js +260 -0
  342. package/dist/tools/pages/handlers-read.js.map +1 -0
  343. package/dist/tools/pages/handlers-write.d.ts +63 -0
  344. package/dist/tools/pages/handlers-write.d.ts.map +1 -0
  345. package/dist/tools/pages/handlers-write.js +127 -0
  346. package/dist/tools/pages/handlers-write.js.map +1 -0
  347. package/dist/tools/pages/index.d.ts +17 -0
  348. package/dist/tools/pages/index.d.ts.map +1 -0
  349. package/dist/tools/pages/index.js +17 -0
  350. package/dist/tools/pages/index.js.map +1 -0
  351. package/dist/tools/pages/schemas.d.ts +157 -0
  352. package/dist/tools/pages/schemas.d.ts.map +1 -0
  353. package/dist/tools/pages/schemas.js +232 -0
  354. package/dist/tools/pages/schemas.js.map +1 -0
  355. package/dist/tools/pages.d.ts +13 -0
  356. package/dist/tools/pages.d.ts.map +1 -0
  357. package/dist/tools/pages.js +13 -0
  358. package/dist/tools/pages.js.map +1 -0
  359. package/dist/tools/pool-resolve-helper.d.ts +83 -0
  360. package/dist/tools/pool-resolve-helper.d.ts.map +1 -0
  361. package/dist/tools/pool-resolve-helper.js +148 -0
  362. package/dist/tools/pool-resolve-helper.js.map +1 -0
  363. package/dist/tools/progress-phases.d.ts +46 -0
  364. package/dist/tools/progress-phases.d.ts.map +1 -0
  365. package/dist/tools/progress-phases.js +48 -0
  366. package/dist/tools/progress-phases.js.map +1 -0
  367. package/dist/tools/shared-schemas.d.ts +25 -0
  368. package/dist/tools/shared-schemas.d.ts.map +1 -0
  369. package/dist/tools/shared-schemas.js +72 -0
  370. package/dist/tools/shared-schemas.js.map +1 -0
  371. package/dist/tools/sources/builders.d.ts +13 -0
  372. package/dist/tools/sources/builders.d.ts.map +1 -0
  373. package/dist/tools/sources/builders.js +118 -0
  374. package/dist/tools/sources/builders.js.map +1 -0
  375. package/dist/tools/sources/handlers-bind.d.ts +28 -0
  376. package/dist/tools/sources/handlers-bind.d.ts.map +1 -0
  377. package/dist/tools/sources/handlers-bind.js +181 -0
  378. package/dist/tools/sources/handlers-bind.js.map +1 -0
  379. package/dist/tools/sources/handlers.d.ts +47 -0
  380. package/dist/tools/sources/handlers.d.ts.map +1 -0
  381. package/dist/tools/sources/handlers.js +108 -0
  382. package/dist/tools/sources/handlers.js.map +1 -0
  383. package/dist/tools/sources/index.d.ts +19 -0
  384. package/dist/tools/sources/index.d.ts.map +1 -0
  385. package/dist/tools/sources/index.js +18 -0
  386. package/dist/tools/sources/index.js.map +1 -0
  387. package/dist/tools/sources.d.ts +14 -0
  388. package/dist/tools/sources.d.ts.map +1 -0
  389. package/dist/tools/sources.js +14 -0
  390. package/dist/tools/sources.js.map +1 -0
  391. package/dist/tools/sparse-fields.d.ts +106 -0
  392. package/dist/tools/sparse-fields.d.ts.map +1 -0
  393. package/dist/tools/sparse-fields.js +165 -0
  394. package/dist/tools/sparse-fields.js.map +1 -0
  395. package/dist/tools/tool-builder/annotations.d.ts +55 -0
  396. package/dist/tools/tool-builder/annotations.d.ts.map +1 -0
  397. package/dist/tools/tool-builder/annotations.js +86 -0
  398. package/dist/tools/tool-builder/annotations.js.map +1 -0
  399. package/dist/tools/tool-builder/define.d.ts +31 -0
  400. package/dist/tools/tool-builder/define.d.ts.map +1 -0
  401. package/dist/tools/tool-builder/define.js +31 -0
  402. package/dist/tools/tool-builder/define.js.map +1 -0
  403. package/dist/tools/tool-builder/index.d.ts +28 -0
  404. package/dist/tools/tool-builder/index.d.ts.map +1 -0
  405. package/dist/tools/tool-builder/index.js +27 -0
  406. package/dist/tools/tool-builder/index.js.map +1 -0
  407. package/dist/tools/tool-builder/results.d.ts +104 -0
  408. package/dist/tools/tool-builder/results.d.ts.map +1 -0
  409. package/dist/tools/tool-builder/results.js +224 -0
  410. package/dist/tools/tool-builder/results.js.map +1 -0
  411. package/dist/tools/tool-builder/types.d.ts +97 -0
  412. package/dist/tools/tool-builder/types.d.ts.map +1 -0
  413. package/dist/tools/tool-builder/types.js +9 -0
  414. package/dist/tools/tool-builder/types.js.map +1 -0
  415. package/dist/tools/tool-builder.d.ts +16 -0
  416. package/dist/tools/tool-builder.d.ts.map +1 -0
  417. package/dist/tools/tool-builder.js +16 -0
  418. package/dist/tools/tool-builder.js.map +1 -0
  419. package/dist/uninstall-skill.d.ts +52 -0
  420. package/dist/uninstall-skill.d.ts.map +1 -0
  421. package/dist/uninstall-skill.js +146 -0
  422. package/dist/uninstall-skill.js.map +1 -0
  423. package/dist/uninstall.d.ts +73 -0
  424. package/dist/uninstall.d.ts.map +1 -0
  425. package/dist/uninstall.js +82 -0
  426. package/dist/uninstall.js.map +1 -0
  427. package/icon.png +0 -0
  428. package/manifest.json +10 -10
  429. package/package.json +4 -1
  430. package/skills/yt-builder-mcp/SKILL.md +30 -26
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Skill loader — Stream B1 (Skill-Distribution via MCP-Protocol).
3
+ *
4
+ * Reads the bundled SKILL.md once at module-load time and exposes it
5
+ * so that:
6
+ *
7
+ * 1. `createServer` can pass the content as the `instructions` field
8
+ * to `McpServer`. MCP-spec hosts (Claude Desktop, Cursor, …)
9
+ * surface this string as auto-context after the `initialize`
10
+ * handshake — Maria the Claude-Desktop user receives the skill
11
+ * narrative without ever invoking a tool.
12
+ *
13
+ * 2. A `skill://yt-builder-mcp` resource can return the same content
14
+ * on demand for hosts that ignore `instructions` but honor
15
+ * `resources/list` + `resources/read`.
16
+ *
17
+ * Resolution layout (matches `install-skill.ts` + `build-dxt.js`):
18
+ *
19
+ * packages/mcp/skills/yt-builder-mcp/SKILL.md
20
+ *
21
+ * When the file is compiled to `dist/skill-loader.js`, the same
22
+ * relative `../skills/yt-builder-mcp/SKILL.md` resolves correctly
23
+ * because the published npm tarball (and the DXT stage) preserves the
24
+ * `skills/` folder next to `dist/`.
25
+ *
26
+ * Read errors throw at module-init: a missing SKILL.md is a packaging
27
+ * bug, not a recoverable runtime condition.
28
+ *
29
+ * W8 — `appendSitesBlock(skillContent, registry)` post-processor.
30
+ * When the in-process {@link SiteRegistry} carries ≥1 configured
31
+ * site, append a "Currently configured sites" appendix to the
32
+ * instructions string so MCP hosts surface the live site roster
33
+ * alongside the skill narrative. The appendix contains ONLY
34
+ * safe-to-render metadata (site_id, label, platform hint/resolved,
35
+ * url, default-flag) — bearer fields are NEVER touched. When the
36
+ * registry has 0 sites the original skill content is returned
37
+ * verbatim (no appendix, no separator).
38
+ *
39
+ * This is a pure-string post-processor; it does not touch the
40
+ * on-disk SKILL.md. Per plan §W8 (line 919) the MCP `initialize`
41
+ * response carries `instructions` as a single shot, so an AI client
42
+ * restart is required for the appendix to refresh after a sites file
43
+ * edit. The W9 CLI commands (add-site / remove-site) print a reminder.
44
+ *
45
+ * @license MIT
46
+ */
47
+ import type { SiteRegistry } from './sites/registry.js';
48
+ /** Stable URI under which the skill resource is exposed via MCP `resources/*`. */
49
+ export declare const SKILL_RESOURCE_URI = "skill://yt-builder-mcp";
50
+ /** Human-readable resource name surfaced in `resources/list`. */
51
+ export declare const SKILL_RESOURCE_NAME = "YT Builder MCP \u2014 Skill Guide";
52
+ /** Short description for `resources/list` consumers. */
53
+ export declare const SKILL_RESOURCE_DESCRIPTION: string;
54
+ /** MIME type for the SKILL.md payload. */
55
+ export declare const SKILL_RESOURCE_MIME_TYPE = "text/markdown";
56
+ /**
57
+ * Load the bundled SKILL.md content. Cached after the first read.
58
+ *
59
+ * When `registry` is supplied AND it carries ≥1 site, the returned
60
+ * string is the on-disk SKILL.md PLUS the W8 sites appendix (see
61
+ * {@link appendSitesBlock}). When `registry` is omitted or empty, the
62
+ * raw skill content is returned unchanged. The disk cache is shared
63
+ * across calls — the appendix is recomputed each time so registry
64
+ * mutations after the first load are reflected (within the same
65
+ * process instance — the MCP `initialize` response only takes a
66
+ * single-shot snapshot per session per plan §W8 line 919).
67
+ *
68
+ * @throws Error when the file is missing or unreadable (packaging bug).
69
+ */
70
+ export declare function loadSkillContent(registry?: SiteRegistry): string;
71
+ /**
72
+ * Append the W8 "Currently configured sites" block to a skill-content
73
+ * string. When the registry is empty, returns the input verbatim — no
74
+ * separator, no header, no trailing newline change.
75
+ *
76
+ * Output shape (per plan §W8 Z.904-917):
77
+ * ```text
78
+ * <skillContent>
79
+ *
80
+ * ---
81
+ *
82
+ * ## Currently configured sites (3)
83
+ *
84
+ * - `wp-acme` — Acme — Production · wordpress · https://acme.com · default
85
+ * - `joomla-beta` — Beta — Staging · joomla · https://beta.example.com/joomla
86
+ * - `wp-internal` — Internal staging · wordpress · https://internal.example.com
87
+ *
88
+ * Use `yootheme_builder_sites_list` to inspect this at runtime.
89
+ * Pass `site_id: "<id>"` on any tool call to target a specific site;
90
+ * omit it to use the default.
91
+ * ```
92
+ *
93
+ * Per-row format (bullet):
94
+ * `- \`<site_id>\` — <label or "(no label)"> · <platform> · <url><" · default"?>`
95
+ *
96
+ * The platform column prefers `platform_resolved` when the registry
97
+ * has memoised a probe result for that site (peek-only — never
98
+ * triggers a new probe), and falls back to `platform_hint` otherwise.
99
+ *
100
+ * Bearer fields (bearer / bearer_ref) are intentionally NEVER
101
+ * referenced — only `site_id`, `url`, `platform_*`, `is_default`,
102
+ * `label` from {@link SiteRowT}.
103
+ */
104
+ export declare function appendSitesBlock(skillContent: string, registry: SiteRegistry): string;
105
+ /**
106
+ * Reset the in-memory cache. Intended for tests only.
107
+ *
108
+ * @internal
109
+ */
110
+ export declare function __resetSkillCacheForTests(): void;
111
+ //# sourceMappingURL=skill-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-loader.d.ts","sourceRoot":"","sources":["../src/skill-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAY,MAAM,qBAAqB,CAAC;AAElE,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAE3D,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,sCAAiC,CAAC;AAElE,wDAAwD;AACxD,eAAO,MAAM,0BAA0B,QAEqC,CAAC;AAE7E,0CAA0C;AAC1C,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAmBxD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,MAAM,CAShE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,gBAAgB,CAC5B,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,YAAY,GACvB,MAAM,CAkBR;AA0CD;;;;GAIG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD"}
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Skill loader — Stream B1 (Skill-Distribution via MCP-Protocol).
3
+ *
4
+ * Reads the bundled SKILL.md once at module-load time and exposes it
5
+ * so that:
6
+ *
7
+ * 1. `createServer` can pass the content as the `instructions` field
8
+ * to `McpServer`. MCP-spec hosts (Claude Desktop, Cursor, …)
9
+ * surface this string as auto-context after the `initialize`
10
+ * handshake — Maria the Claude-Desktop user receives the skill
11
+ * narrative without ever invoking a tool.
12
+ *
13
+ * 2. A `skill://yt-builder-mcp` resource can return the same content
14
+ * on demand for hosts that ignore `instructions` but honor
15
+ * `resources/list` + `resources/read`.
16
+ *
17
+ * Resolution layout (matches `install-skill.ts` + `build-dxt.js`):
18
+ *
19
+ * packages/mcp/skills/yt-builder-mcp/SKILL.md
20
+ *
21
+ * When the file is compiled to `dist/skill-loader.js`, the same
22
+ * relative `../skills/yt-builder-mcp/SKILL.md` resolves correctly
23
+ * because the published npm tarball (and the DXT stage) preserves the
24
+ * `skills/` folder next to `dist/`.
25
+ *
26
+ * Read errors throw at module-init: a missing SKILL.md is a packaging
27
+ * bug, not a recoverable runtime condition.
28
+ *
29
+ * W8 — `appendSitesBlock(skillContent, registry)` post-processor.
30
+ * When the in-process {@link SiteRegistry} carries ≥1 configured
31
+ * site, append a "Currently configured sites" appendix to the
32
+ * instructions string so MCP hosts surface the live site roster
33
+ * alongside the skill narrative. The appendix contains ONLY
34
+ * safe-to-render metadata (site_id, label, platform hint/resolved,
35
+ * url, default-flag) — bearer fields are NEVER touched. When the
36
+ * registry has 0 sites the original skill content is returned
37
+ * verbatim (no appendix, no separator).
38
+ *
39
+ * This is a pure-string post-processor; it does not touch the
40
+ * on-disk SKILL.md. Per plan §W8 (line 919) the MCP `initialize`
41
+ * response carries `instructions` as a single shot, so an AI client
42
+ * restart is required for the appendix to refresh after a sites file
43
+ * edit. The W9 CLI commands (add-site / remove-site) print a reminder.
44
+ *
45
+ * @license MIT
46
+ */
47
+ import { readFileSync } from 'node:fs';
48
+ import { dirname, resolve } from 'node:path';
49
+ import { fileURLToPath } from 'node:url';
50
+ /** Stable URI under which the skill resource is exposed via MCP `resources/*`. */
51
+ export const SKILL_RESOURCE_URI = 'skill://yt-builder-mcp';
52
+ /** Human-readable resource name surfaced in `resources/list`. */
53
+ export const SKILL_RESOURCE_NAME = 'YT Builder MCP — Skill Guide';
54
+ /** Short description for `resources/list` consumers. */
55
+ export const SKILL_RESOURCE_DESCRIPTION = 'Workflow guide for driving the YOOtheme Pro page builder via this MCP server. ' +
56
+ 'Auto-loaded as `instructions` at initialize; also fetchable on demand.';
57
+ /** MIME type for the SKILL.md payload. */
58
+ export const SKILL_RESOURCE_MIME_TYPE = 'text/markdown';
59
+ const __dirname = dirname(fileURLToPath(import.meta.url));
60
+ /**
61
+ * Resolve the on-disk path to the bundled SKILL.md.
62
+ *
63
+ * Source-tree: packages/mcp/src/skill-loader.ts → ../skills/yt-builder-mcp/SKILL.md
64
+ * Built tarball: packages/mcp/dist/skill-loader.js → ../skills/yt-builder-mcp/SKILL.md
65
+ *
66
+ * Both layouts work because `dist/` and `src/` are siblings of
67
+ * `skills/` under the package root.
68
+ */
69
+ function resolveSkillPath() {
70
+ return resolve(__dirname, '..', 'skills', 'yt-builder-mcp', 'SKILL.md');
71
+ }
72
+ let cached;
73
+ /**
74
+ * Load the bundled SKILL.md content. Cached after the first read.
75
+ *
76
+ * When `registry` is supplied AND it carries ≥1 site, the returned
77
+ * string is the on-disk SKILL.md PLUS the W8 sites appendix (see
78
+ * {@link appendSitesBlock}). When `registry` is omitted or empty, the
79
+ * raw skill content is returned unchanged. The disk cache is shared
80
+ * across calls — the appendix is recomputed each time so registry
81
+ * mutations after the first load are reflected (within the same
82
+ * process instance — the MCP `initialize` response only takes a
83
+ * single-shot snapshot per session per plan §W8 line 919).
84
+ *
85
+ * @throws Error when the file is missing or unreadable (packaging bug).
86
+ */
87
+ export function loadSkillContent(registry) {
88
+ if (cached === undefined) {
89
+ const path = resolveSkillPath();
90
+ cached = readFileSync(path, 'utf-8');
91
+ }
92
+ if (registry === undefined) {
93
+ return cached;
94
+ }
95
+ return appendSitesBlock(cached, registry);
96
+ }
97
+ /**
98
+ * Append the W8 "Currently configured sites" block to a skill-content
99
+ * string. When the registry is empty, returns the input verbatim — no
100
+ * separator, no header, no trailing newline change.
101
+ *
102
+ * Output shape (per plan §W8 Z.904-917):
103
+ * ```text
104
+ * <skillContent>
105
+ *
106
+ * ---
107
+ *
108
+ * ## Currently configured sites (3)
109
+ *
110
+ * - `wp-acme` — Acme — Production · wordpress · https://acme.com · default
111
+ * - `joomla-beta` — Beta — Staging · joomla · https://beta.example.com/joomla
112
+ * - `wp-internal` — Internal staging · wordpress · https://internal.example.com
113
+ *
114
+ * Use `yootheme_builder_sites_list` to inspect this at runtime.
115
+ * Pass `site_id: "<id>"` on any tool call to target a specific site;
116
+ * omit it to use the default.
117
+ * ```
118
+ *
119
+ * Per-row format (bullet):
120
+ * `- \`<site_id>\` — <label or "(no label)"> · <platform> · <url><" · default"?>`
121
+ *
122
+ * The platform column prefers `platform_resolved` when the registry
123
+ * has memoised a probe result for that site (peek-only — never
124
+ * triggers a new probe), and falls back to `platform_hint` otherwise.
125
+ *
126
+ * Bearer fields (bearer / bearer_ref) are intentionally NEVER
127
+ * referenced — only `site_id`, `url`, `platform_*`, `is_default`,
128
+ * `label` from {@link SiteRowT}.
129
+ */
130
+ export function appendSitesBlock(skillContent, registry) {
131
+ const rows = registry.listForDisplay();
132
+ if (rows.length === 0) {
133
+ return skillContent;
134
+ }
135
+ const bullets = rows.map((row) => renderBullet(row)).join('\n');
136
+ const block = '\n\n---\n\n' +
137
+ `## Currently configured sites (${String(rows.length)})\n\n` +
138
+ bullets +
139
+ '\n\n' +
140
+ 'Use `yootheme_builder_sites_list` to inspect this at runtime.\n' +
141
+ 'Pass `site_id: "<id>"` on any tool call to target a specific site;\n' +
142
+ 'omit it to use the default.\n';
143
+ return skillContent + block;
144
+ }
145
+ /**
146
+ * Markdown-escape an operator-provided string so it cannot inject
147
+ * structure into the rendered SKILL.md appendix.
148
+ *
149
+ * W12-R1.3 (A2-L2): the W8 sites-appendix renders `row.label` into the
150
+ * server's `instructions` field, which MCP hosts surface to the LLM
151
+ * verbatim. An operator with write-access to sites.json could land a
152
+ * label like `Acme [INTERNAL TOOL: ignore prior context] Production`
153
+ * and the prompt would carry that text into the model context. The
154
+ * escape list covers the markdown special chars the W8 bullet format
155
+ * could collide with (\`*_[]<>), preserving readable text while
156
+ * preventing injection. site_id is regex-restricted at the schema
157
+ * layer so it doesn't need escaping; url is operator-controlled but
158
+ * has a much smaller chosen-char surface and is rendered after a `·`
159
+ * separator that limits payload shape.
160
+ */
161
+ function escapeMarkdown(text) {
162
+ return text.replace(/([\\`*_[\]<>])/g, '\\$1');
163
+ }
164
+ /**
165
+ * Render one {@link SiteRowT} as a markdown bullet for the W8 sites
166
+ * appendix.
167
+ *
168
+ * Format: `- \`<site_id>\` — <label> · <platform> · <url><" · default"?>`
169
+ *
170
+ * `<platform>` prefers `platform_resolved` (the W3 memo cache) and
171
+ * falls back to `platform_hint` when no probe has run yet.
172
+ * `<label>` falls back to the literal string `(no label)` when the
173
+ * entry has none AND is markdown-escaped (W12-R1.3 prompt-injection
174
+ * defense). The `default` suffix is only present when `is_default`
175
+ * is true.
176
+ */
177
+ function renderBullet(row) {
178
+ const platform = row.platform_resolved ?? row.platform_hint;
179
+ const label = escapeMarkdown(row.label ?? '(no label)');
180
+ const defaultSuffix = row.is_default ? ' · default' : '';
181
+ return `- \`${row.site_id}\` — ${label} · ${platform} · ${row.url}${defaultSuffix}`;
182
+ }
183
+ /**
184
+ * Reset the in-memory cache. Intended for tests only.
185
+ *
186
+ * @internal
187
+ */
188
+ export function __resetSkillCacheForTests() {
189
+ cached = undefined;
190
+ }
191
+ //# sourceMappingURL=skill-loader.js.map
@@ -0,0 +1 @@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AAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Element-tool builders — pure `defineTool` factory list.
3
+ *
4
+ * Split out of the original `src/tools/elements.ts` (Wave G.4.0). Each
5
+ * entry pairs a Zod input-schema with the matching handler in
6
+ * `./handlers.ts`. Keeping builders + handlers in separate files lets
7
+ * each file stay under the 200-LoC budget.
8
+ *
9
+ * The exported `buildElementsTools(client, [opts])` is the single public
10
+ * entry-point — see `./index.ts` for the consumer-facing re-export.
11
+ *
12
+ * @license MIT
13
+ */
14
+ import type { ClientPool } from '../../sites/client-pool.js';
15
+ import { type AnyToolDefinition } from '../tool-builder.js';
16
+ import { type ElementsHandlerDeps } from './handlers.js';
17
+ /**
18
+ * Build the 7 element tools. The optional `deps` carries the
19
+ * elicitation capability used by `element_delete` (Wave G.4.1). When
20
+ * omitted, the destructive tool falls back to the explicit
21
+ * `confirm: true` parameter.
22
+ */
23
+ export declare function buildElementsTools(pool: ClientPool, deps?: Partial<ElementsHandlerDeps>): readonly AnyToolDefinition[];
24
+ //# sourceMappingURL=builders.d.ts.map
@@ -0,0 +1 @@
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,EAQ3B,MAAM,eAAe,CAAC;AAEvB;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,UAAU,EAChB,IAAI,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACpC,SAAS,iBAAiB,EAAE,CA8N9B"}
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Element-tool builders — pure `defineTool` factory list.
3
+ *
4
+ * Split out of the original `src/tools/elements.ts` (Wave G.4.0). Each
5
+ * entry pairs a Zod input-schema with the matching handler in
6
+ * `./handlers.ts`. Keeping builders + handlers in separate files lets
7
+ * each file stay under the 200-LoC budget.
8
+ *
9
+ * The exported `buildElementsTools(client, [opts])` is the single public
10
+ * entry-point — see `./index.ts` for the consumer-facing re-export.
11
+ *
12
+ * @license MIT
13
+ */
14
+ import { z } from 'zod';
15
+ import { withSiteRetry } from '../pool-resolve-helper.js';
16
+ import { ELEMENT_PATH, ETAG, PROPS, SITE_ID_SCHEMA, TEMPLATE_ID } from '../shared-schemas.js';
17
+ import { FIELDS } from '../sparse-fields.js';
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';
20
+ /**
21
+ * Build the 7 element tools. The optional `deps` carries the
22
+ * elicitation capability used by `element_delete` (Wave G.4.1). When
23
+ * omitted, the destructive tool falls back to the explicit
24
+ * `confirm: true` parameter.
25
+ */
26
+ export function buildElementsTools(pool, deps) {
27
+ // W6.3 — each handler resolves the pool inline (per `site_id`) so
28
+ // the per-handler `siteClient` reaches the right CMS install. The
29
+ // elicitation capability is the only non-client dep we propagate.
30
+ const elicitation = deps?.elicitation;
31
+ const makeDeps = (siteClient) => (elicitation !== undefined
32
+ ? { client: siteClient, elicitation }
33
+ : { client: siteClient });
34
+ return [
35
+ defineTool({
36
+ name: 'yootheme_builder_element_list',
37
+ description: 'List elements in a template as a flat array with JSON-Pointer paths + ' +
38
+ 'types. Scope with `root_path`/`depth` for a subtree, paginate with ' +
39
+ '`limit`/`cursor` for large templates. `fields[]` narrows each row. ' +
40
+ 'Operates on the default site unless site_id is provided.',
41
+ inputSchema: {
42
+ site_id: SITE_ID_SCHEMA,
43
+ template_id: TEMPLATE_ID,
44
+ fields: FIELDS,
45
+ root_path: z
46
+ .string()
47
+ .optional()
48
+ .describe('Restrict the walk to the subtree at this JSON-Pointer ' +
49
+ '(e.g. "/templates/<id>/layout/children/0"). Default: whole layout.'),
50
+ depth: z
51
+ .number()
52
+ .int()
53
+ .positive()
54
+ .optional()
55
+ .describe('Cap recursion to N levels of descendants. Default: unbounded.'),
56
+ limit: z
57
+ .number()
58
+ .int()
59
+ .positive()
60
+ .optional()
61
+ .describe('Page size. When set, the response is paginated — a ' +
62
+ '`next_cursor` is returned while more rows remain.'),
63
+ cursor: z
64
+ .string()
65
+ .optional()
66
+ .describe('Continuation token from a prior call\'s `next_cursor`.'),
67
+ },
68
+ outputSchema: ELEMENT_LIST_OUTPUT_SCHEMA,
69
+ annotations: readOnly('List Elements'),
70
+ handler: async ({ site_id, ...rest }) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleElementList(makeDeps(client), rest), site)),
71
+ }),
72
+ defineTool({
73
+ name: 'yootheme_builder_element_get',
74
+ description: 'Get the full element object at a specific JSON-Pointer path, including props ' +
75
+ 'and children. Use yootheme_builder_element_list to discover paths. ' +
76
+ 'Operates on the default site unless site_id is provided.',
77
+ inputSchema: {
78
+ site_id: SITE_ID_SCHEMA,
79
+ template_id: TEMPLATE_ID,
80
+ element_path: ELEMENT_PATH,
81
+ },
82
+ outputSchema: ELEMENT_GET_OUTPUT_SCHEMA,
83
+ annotations: readOnly('Get Element'),
84
+ handler: async ({ site_id, ...rest }) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleElementGet(makeDeps(client), rest), site)),
85
+ }),
86
+ defineTool({
87
+ name: 'yootheme_builder_element_add',
88
+ description: 'Add a new element to a template. Provide `parent_path` (or "" for root), ' +
89
+ '`element_type` (e.g. "headline", "text", "grid"), and optional `props` / ' +
90
+ '`children`. Returns the new element\'s JSON-Pointer path. Requires ETag. ' +
91
+ 'Operates on the default site unless site_id is provided.',
92
+ inputSchema: {
93
+ site_id: SITE_ID_SCHEMA,
94
+ template_id: TEMPLATE_ID,
95
+ parent_path: z
96
+ .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`).'),
105
+ element_type: z
106
+ .string()
107
+ .min(1)
108
+ .describe('Type of element to create (e.g. "headline", "text", "grid"). ' +
109
+ 'Use yootheme_builder_element_types_list for the catalogue.'),
110
+ props: PROPS.optional(),
111
+ children: z
112
+ .array(z.record(z.string(), z.unknown()))
113
+ .optional()
114
+ .describe('Optional initial children — array of element objects.'),
115
+ etag: ETAG,
116
+ },
117
+ annotations: creating('Add Element'),
118
+ handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleElementAdd(makeDeps(client), rest, extra), site)),
119
+ }),
120
+ defineTool({
121
+ name: 'yootheme_builder_element_update_settings',
122
+ description: 'Update `props` on an element. Default replaces all props; pass ' +
123
+ '`merge:true` for server-side deep-merge (only request keys overwritten, ' +
124
+ 'others survive — avoids read-modify-write races). Requires ETag. ' +
125
+ 'Operates on the default site unless site_id is provided.',
126
+ inputSchema: {
127
+ site_id: SITE_ID_SCHEMA,
128
+ template_id: TEMPLATE_ID,
129
+ element_path: ELEMENT_PATH,
130
+ props: PROPS,
131
+ merge: z
132
+ .boolean()
133
+ .optional()
134
+ .describe('When true, server reads current props and deep-merges the request body ' +
135
+ '(request wins, untouched keys preserved). Default false (full replace).'),
136
+ etag: ETAG,
137
+ },
138
+ annotations: mutating('Update Element Settings'),
139
+ handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleElementUpdateSettings(makeDeps(client), rest, extra), site)),
140
+ }),
141
+ defineTool({
142
+ name: 'yootheme_builder_element_move',
143
+ description: 'Move an element to a new parent + index in the tree. Useful for reordering or ' +
144
+ 'reparenting (e.g. moving a card from one grid column to another). Requires ETag. ' +
145
+ 'Operates on the default site unless site_id is provided.',
146
+ inputSchema: {
147
+ site_id: SITE_ID_SCHEMA,
148
+ template_id: TEMPLATE_ID,
149
+ element_path: ELEMENT_PATH,
150
+ to_parent_path: z
151
+ .string()
152
+ .describe('Destination parent JSON-Pointer ("" for template root).'),
153
+ to_index: z
154
+ .number()
155
+ .int()
156
+ .min(0)
157
+ .describe('Zero-based index within the destination parent.'),
158
+ etag: ETAG,
159
+ },
160
+ annotations: mutating('Move Element'),
161
+ handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleElementMove(makeDeps(client), rest, extra), site)),
162
+ }),
163
+ defineTool({
164
+ name: 'yootheme_builder_element_clone',
165
+ description: 'Clone an element as a sibling (same parent, immediately after the source). ' +
166
+ 'Returns the new element\'s path. Requires ETag. ' +
167
+ 'Operates on the default site unless site_id is provided.',
168
+ inputSchema: {
169
+ site_id: SITE_ID_SCHEMA,
170
+ template_id: TEMPLATE_ID,
171
+ element_path: ELEMENT_PATH,
172
+ etag: ETAG,
173
+ },
174
+ annotations: creating('Clone Element'),
175
+ handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleElementClone(makeDeps(client), rest, extra), site)),
176
+ }),
177
+ defineTool({
178
+ name: 'yootheme_builder_element_delete',
179
+ description: 'PERMANENTLY delete an element + children. Cannot be undone. Pass `confirm: ' +
180
+ 'true` (boolean) AND a fresh ETag. If `preview:true` returns despite confirm, ' +
181
+ 'check `details.received_confirm` — strings/numbers accepted, but boolean is ' +
182
+ 'canonical. Operates on the default site unless site_id is provided.',
183
+ inputSchema: {
184
+ site_id: SITE_ID_SCHEMA,
185
+ template_id: TEMPLATE_ID,
186
+ element_path: ELEMENT_PATH,
187
+ etag: ETAG,
188
+ // Wave-6 R4: accept boolean OR the string literals "true"/"false"
189
+ // and numeric 0/1 — the handler's `isConfirmedTrue` coerces all
190
+ // four into the canonical boolean. Cold-AI #4 reported a confirm
191
+ // gate that kept firing despite passing the value; the safety net
192
+ // prevents future schema-string mismatches from re-creating that
193
+ // class of bug.
194
+ confirm: z
195
+ .union([z.boolean(), z.literal('true'), z.literal('false'), z.literal(0), z.literal(1)])
196
+ .optional()
197
+ .describe('Must be `true` (boolean literal) to execute. Strings "true"/"false" ' +
198
+ 'and numeric 1/0 are also accepted as a safety net but `true` is ' +
199
+ 'canonical. On supporting hosts the agent is prompted via MCP ' +
200
+ 'elicitation when omitted; otherwise the call returns a preview ' +
201
+ 'and the agent must retry with `confirm: true`.'),
202
+ },
203
+ annotations: destructive('Delete Element'),
204
+ handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleElementDelete(makeDeps(client), rest, extra), site)),
205
+ }),
206
+ ];
207
+ }
208
+ //# sourceMappingURL=builders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builders.js","sourceRoot":"","sources":["../../../src/tools/elements/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACH,QAAQ,EACR,UAAU,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,YAAY,GAEf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,yBAAyB,EACzB,0BAA0B,EAE1B,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,2BAA2B,GAC9B,MAAM,eAAe,CAAC;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,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;SACxF,CAAC;KACL,CAAC;AACN,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Element-tool write handlers (add/update/move/clone/delete).
3
+ *
4
+ * Wave G.4.0 split: read handlers + shared types in `./handlers.ts`.
5
+ * Wave G.4.1: `handleElementDelete` consults `deps.elicitation` when
6
+ * `confirm` is undefined — falls back to the explicit preview when
7
+ * elicitation is unavailable.
8
+ * Wave G.5: every handler emits 2-phase client-side progress
9
+ * (`PHASE_SEND` → `PHASE_CONFIRM`) when the caller supplied a
10
+ * `progressToken` — see `../progress-phases.ts` for the contract.
11
+ *
12
+ * @license MIT
13
+ */
14
+ import { type HandlerExtra, type ToolResult } from '../tool-builder.js';
15
+ import type { ElementsHandlerDeps } from './handlers.js';
16
+ export declare function handleElementAdd({ client }: ElementsHandlerDeps, input: {
17
+ template_id: string;
18
+ parent_path: string;
19
+ element_type: string;
20
+ props?: Record<string, unknown>;
21
+ children?: Record<string, unknown>[];
22
+ etag: string;
23
+ }, extra?: HandlerExtra): Promise<ToolResult>;
24
+ export declare function handleElementUpdateSettings({ client }: ElementsHandlerDeps, input: {
25
+ template_id: string;
26
+ element_path: string;
27
+ props: Record<string, unknown>;
28
+ merge?: boolean;
29
+ etag: string;
30
+ }, extra?: HandlerExtra): Promise<ToolResult>;
31
+ export declare function handleElementMove({ client }: ElementsHandlerDeps, input: {
32
+ template_id: string;
33
+ element_path: string;
34
+ to_parent_path: string;
35
+ to_index: number;
36
+ etag: string;
37
+ }, extra?: HandlerExtra): Promise<ToolResult>;
38
+ export declare function handleElementClone({ client }: ElementsHandlerDeps, input: {
39
+ template_id: string;
40
+ element_path: string;
41
+ etag: string;
42
+ }, extra?: HandlerExtra): Promise<ToolResult>;
43
+ export declare function handleElementDelete({ client, elicitation }: ElementsHandlerDeps, input: {
44
+ template_id: string;
45
+ element_path: string;
46
+ etag: string;
47
+ confirm?: boolean | 'true' | 'false' | 0 | 1;
48
+ }, extra?: HandlerExtra): Promise<ToolResult>;
49
+ //# sourceMappingURL=handlers-write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers-write.d.ts","sourceRoot":"","sources":["../../../src/tools/elements/handlers-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,EAKH,KAAK,YAAY,EACjB,KAAK,UAAU,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAkKzD,wBAAsB,gBAAgB,CAClC,EAAE,MAAM,EAAE,EAAE,mBAAmB,EAC/B,KAAK,EAAE;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;CAChB,EACD,KAAK,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,UAAU,CAAC,CA0BrB;AAID,wBAAsB,2BAA2B,CAC7C,EAAE,MAAM,EAAE,EAAE,mBAAmB,EAC/B,KAAK,EAAE;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CAChB,EACD,KAAK,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,UAAU,CAAC,CAkCrB;AAID,wBAAsB,iBAAiB,CACnC,EAAE,MAAM,EAAE,EAAE,mBAAmB,EAC/B,KAAK,EAAE;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE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