@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,46 @@
1
+ /**
2
+ * Joomla 5/6 platform implementation — Wave 7 prep.
3
+ *
4
+ * Mirrors {@link WordPressPlatform} but targets the Joomla Web Services
5
+ * API surface registered by `plg_system_ytbmcp` (see
6
+ * `src/packaging/joomla/extensions/plg_system_ytbmcp/src/Extension/Ytbmcp.php`
7
+ * — `onBeforeApiRoute()` mounts the routes under
8
+ * `v1/yt-builder-mcp/...` against `com_ytbmcp`).
9
+ *
10
+ * The full request URL composed by {@link RestClient} is:
11
+ *
12
+ * {baseUrl}/api/index.php/v1/yt-builder-mcp/{path}
13
+ *
14
+ * — where `{baseUrl}` is the Joomla site origin (e.g. `https://example.com`
15
+ * or `https://example.com/joomla` for a subfolder install) and `{path}`
16
+ * is the per-tool REST path (e.g. `/health`, `/pages`, `/etag`).
17
+ *
18
+ * Cookbook Ch1 Finding 2: the `PlatformKind` union already declared
19
+ * `'joomla'` in Wave G.0; this class fills the seam so no tool handler
20
+ * has to change.
21
+ *
22
+ * Cookbook §3.7 (cross-platform parity): the REST byte-shape returned
23
+ * by every endpoint is identical across platforms — only the route
24
+ * prefix differs.
25
+ *
26
+ * @license MIT
27
+ */
28
+ /** Canonical Joomla REST namespace prefix for this plugin. */
29
+ export const JOOMLA_REST_NAMESPACE_PATH = '/api/index.php/v1/yt-builder-mcp';
30
+ /**
31
+ * Joomla platform implementation.
32
+ *
33
+ * `restNamespacePath` is fixed to the Web Services API mount point that
34
+ * `plg_system_ytbmcp::onBeforeApiRoute()` registers; the caller supplies
35
+ * only the site origin.
36
+ */
37
+ export class JoomlaPlatform {
38
+ kind = 'joomla';
39
+ baseUrl;
40
+ restNamespacePath;
41
+ constructor(baseUrl) {
42
+ this.baseUrl = baseUrl;
43
+ this.restNamespacePath = JOOMLA_REST_NAMESPACE_PATH;
44
+ }
45
+ }
46
+ //# sourceMappingURL=joomla.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joomla.js","sourceRoot":"","sources":["../../src/platform/joomla.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,kCAAkC,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,OAAO,cAAc;IACP,IAAI,GAAG,QAAiB,CAAC;IACzB,OAAO,CAAS;IAChB,iBAAiB,CAAS;IAE1C,YAAY,OAAe;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,iBAAiB,GAAG,0BAA0B,CAAC;IACxD,CAAC;CACJ"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * MCP server factory — Wave G.1 / Gateway-Hub edition.
3
+ *
4
+ * `createServer({client})` builds a configured `McpServer` with a 3-lane
5
+ * tool registration:
6
+ *
7
+ * L3 — direct top-level (yootheme_builder_health + yootheme_builder_diagnose)
8
+ * Registered FIRST, BEFORE the CapturingServer wraps the real server.
9
+ * These tools must reach the LLM even when the gateway itself
10
+ * misbehaves (chicken-and-egg: the LLM diagnoses gateway breakage
11
+ * via these two).
12
+ *
13
+ * L1 — essential forwarded (20 tools)
14
+ * Routed through the CapturingServer to the real server. Appear in
15
+ * `tools/list` as first-class entries (Cursor-cap-safe).
16
+ *
17
+ * L2 — advanced captured (7 tools)
18
+ * Routed through the CapturingServer into its in-process advanced
19
+ * registry; reachable via the single `yootheme_builder_advanced`
20
+ * gateway tool. Hidden from `tools/list`.
21
+ *
22
+ * Gateway — `yootheme_builder_advanced`
23
+ * Registered LAST on the real server, after every L1/L2 tool is
24
+ * placed and the advanced registry is final.
25
+ *
26
+ * Result: `tools/list.length === 23` (20 L1 + 2 L3 + 1 gateway), and the
27
+ * full callable tool surface is 30 (23 advertised + 7 advanced reachable
28
+ * through the gateway).
29
+ *
30
+ * @license MIT
31
+ */
32
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
33
+ import { CapturingServer } from './gateway/capturing-server.js';
34
+ import type { ClientPool } from './sites/client-pool.js';
35
+ import type { SiteRegistry } from './sites/registry.js';
36
+ import { type ToolDefinition } from './tools/index.js';
37
+ export declare const SERVER_NAME = "@wootsup/yt-builder-mcp";
38
+ export declare const SERVER_VERSION: string;
39
+ /**
40
+ * W8 — stable URI under which the live sites snapshot is exposed via
41
+ * MCP `resources/*`. Single fixed resource (no list-changed needed) —
42
+ * MCP hosts can fetch the current registry roster on demand without
43
+ * having to invoke a tool.
44
+ */
45
+ export declare const SITES_RESOURCE_URI = "sites://current";
46
+ /** Human-readable resource name surfaced in `resources/list`. */
47
+ export declare const SITES_RESOURCE_NAME = "Currently configured sites";
48
+ /** Short description for `resources/list` consumers. */
49
+ export declare const SITES_RESOURCE_DESCRIPTION: string;
50
+ /** MIME type for the `sites://current` payload. */
51
+ export declare const SITES_RESOURCE_MIME_TYPE = "application/json";
52
+ /**
53
+ * Bearer-redacted JSON payload shape for the W8 `sites://current`
54
+ * resource. Mirrors the structured-content shape of the
55
+ * `yootheme_builder_sites_list` tool but never reveals bearer or
56
+ * bearer_ref — only safe-to-render display fields land in the
57
+ * `sites[]` rows.
58
+ */
59
+ export interface SitesResourcePayload {
60
+ readonly default_site_id: string | null;
61
+ readonly sites: readonly SitesResourceRow[];
62
+ }
63
+ /**
64
+ * One row inside {@link SitesResourcePayload.sites}. Strictly the
65
+ * fields enumerated by plan §W8 Z.929 — no bearer / bearer_ref /
66
+ * bearer_source. `label` and `platform_resolved` are optional (only
67
+ * present when the underlying registry entry / probe carries them).
68
+ */
69
+ export interface SitesResourceRow {
70
+ readonly site_id: string;
71
+ readonly url: string;
72
+ readonly platform: 'wordpress' | 'joomla' | 'auto';
73
+ readonly is_default: boolean;
74
+ readonly label?: string;
75
+ }
76
+ /**
77
+ * Build the JSON payload served by the `sites://current` resource.
78
+ *
79
+ * Field projection (per plan §W8 Z.925-933):
80
+ * - `default_site_id` from {@link SiteRegistry.defaultSiteId}.
81
+ * - `sites[].site_id` / `url` / `is_default` / `label` verbatim.
82
+ * - `sites[].platform` prefers the resolved kind from the W3 memo
83
+ * cache (peek-only, no probe) and falls back to the configured
84
+ * hint when no probe has run.
85
+ *
86
+ * Bearer fields are NEVER referenced. The `bearer_source` hint that
87
+ * the W7 `sites_list` tool exposes is intentionally omitted from this
88
+ * resource: even the "plain" vs "op" hint hints at storage layout,
89
+ * and the resource is positioned as a host-facing public roster.
90
+ */
91
+ export declare function buildSitesResourcePayload(registry: SiteRegistry): SitesResourcePayload;
92
+ export interface CreateServerOptions {
93
+ /**
94
+ * Multi-site client pool — replaces the single `client` parameter
95
+ * shipped pre-W6. Each tool handler asks `pool.resolve(site_id)`
96
+ * for the per-call REST client + resolved site descriptor.
97
+ */
98
+ readonly pool: ClientPool;
99
+ /** Override the tool set (defaults to `buildAllTools`). */
100
+ readonly tools?: readonly ToolDefinition[];
101
+ }
102
+ export interface CreatedServer {
103
+ readonly mcp: McpServer;
104
+ /** The full set of tool definitions registered across all 3 lanes + gateway. */
105
+ readonly tools: readonly ToolDefinition[];
106
+ /** The CapturingServer wrapping `mcp` — exposed for test helpers. */
107
+ readonly capturing: CapturingServer;
108
+ }
109
+ export declare function createServer(options: CreateServerOptions): CreatedServer;
110
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAMH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,OAAO,EAAE,eAAe,EAAsB,MAAM,+BAA+B,CAAC;AAEpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CA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;IAC1C,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;CACvC;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,aAAa,CAuIxE"}
package/dist/server.js ADDED
@@ -0,0 +1,274 @@
1
+ /**
2
+ * MCP server factory — Wave G.1 / Gateway-Hub edition.
3
+ *
4
+ * `createServer({client})` builds a configured `McpServer` with a 3-lane
5
+ * tool registration:
6
+ *
7
+ * L3 — direct top-level (yootheme_builder_health + yootheme_builder_diagnose)
8
+ * Registered FIRST, BEFORE the CapturingServer wraps the real server.
9
+ * These tools must reach the LLM even when the gateway itself
10
+ * misbehaves (chicken-and-egg: the LLM diagnoses gateway breakage
11
+ * via these two).
12
+ *
13
+ * L1 — essential forwarded (20 tools)
14
+ * Routed through the CapturingServer to the real server. Appear in
15
+ * `tools/list` as first-class entries (Cursor-cap-safe).
16
+ *
17
+ * L2 — advanced captured (7 tools)
18
+ * Routed through the CapturingServer into its in-process advanced
19
+ * registry; reachable via the single `yootheme_builder_advanced`
20
+ * gateway tool. Hidden from `tools/list`.
21
+ *
22
+ * Gateway — `yootheme_builder_advanced`
23
+ * Registered LAST on the real server, after every L1/L2 tool is
24
+ * placed and the advanced registry is final.
25
+ *
26
+ * Result: `tools/list.length === 23` (20 L1 + 2 L3 + 1 gateway), and the
27
+ * full callable tool surface is 30 (23 advertised + 7 advanced reachable
28
+ * through the gateway).
29
+ *
30
+ * @license MIT
31
+ */
32
+ import { readFileSync } from 'node:fs';
33
+ import { dirname, resolve } from 'node:path';
34
+ import { fileURLToPath } from 'node:url';
35
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
36
+ import { registerAdvancedTool } from './gateway/advanced-tool.js';
37
+ import { CapturingServer } from './gateway/capturing-server.js';
38
+ import { isDirectTopLevel } from './gateway/essentials.js';
39
+ import { loadSkillContent, SKILL_RESOURCE_DESCRIPTION, SKILL_RESOURCE_MIME_TYPE, SKILL_RESOURCE_NAME, SKILL_RESOURCE_URI, } from './skill-loader.js';
40
+ import { toElicitationCapability } from './tools/elicitation.js';
41
+ import { buildAllTools } from './tools/index.js';
42
+ export const SERVER_NAME = '@wootsup/yt-builder-mcp';
43
+ /**
44
+ * Read `version` from the package.json that ships alongside `dist/` (and
45
+ * `src/` in the source tree). Resolved at module-init from
46
+ *
47
+ * src-tree: packages/mcp/src/server.ts → ../package.json
48
+ * tarball: packages/mcp/dist/server.js → ../package.json
49
+ *
50
+ * Both layouts work because `package.json` lives at the package root and
51
+ * `src/` / `dist/` are siblings. Bumping `package.json#version` (e.g. via
52
+ * `php scripts/release.php release yt-builder-mcp patch`) is the SINGLE
53
+ * source of truth — the value reported on MCP `initialize.serverInfo`
54
+ * follows automatically. No hardcoded string to drift out of sync.
55
+ */
56
+ function readPackageVersion() {
57
+ const here = dirname(fileURLToPath(import.meta.url));
58
+ const pkgPath = resolve(here, '..', 'package.json');
59
+ const raw = readFileSync(pkgPath, 'utf-8');
60
+ const parsed = JSON.parse(raw);
61
+ if (typeof parsed.version !== 'string' || parsed.version.length === 0) {
62
+ throw new Error(`yt-builder-mcp: package.json at ${pkgPath} is missing a string "version" field`);
63
+ }
64
+ return parsed.version;
65
+ }
66
+ export const SERVER_VERSION = readPackageVersion();
67
+ /**
68
+ * W8 — stable URI under which the live sites snapshot is exposed via
69
+ * MCP `resources/*`. Single fixed resource (no list-changed needed) —
70
+ * MCP hosts can fetch the current registry roster on demand without
71
+ * having to invoke a tool.
72
+ */
73
+ export const SITES_RESOURCE_URI = 'sites://current';
74
+ /** Human-readable resource name surfaced in `resources/list`. */
75
+ export const SITES_RESOURCE_NAME = 'Currently configured sites';
76
+ /** Short description for `resources/list` consumers. */
77
+ export const SITES_RESOURCE_DESCRIPTION = 'Live snapshot of sites wired into this MCP server (site_id, URL, ' +
78
+ 'platform, default flag, label). Bearer fields are redacted. ' +
79
+ 'Mirrors what `yootheme_builder_sites_list` would print.';
80
+ /** MIME type for the `sites://current` payload. */
81
+ export const SITES_RESOURCE_MIME_TYPE = 'application/json';
82
+ /**
83
+ * Build the JSON payload served by the `sites://current` resource.
84
+ *
85
+ * Field projection (per plan §W8 Z.925-933):
86
+ * - `default_site_id` from {@link SiteRegistry.defaultSiteId}.
87
+ * - `sites[].site_id` / `url` / `is_default` / `label` verbatim.
88
+ * - `sites[].platform` prefers the resolved kind from the W3 memo
89
+ * cache (peek-only, no probe) and falls back to the configured
90
+ * hint when no probe has run.
91
+ *
92
+ * Bearer fields are NEVER referenced. The `bearer_source` hint that
93
+ * the W7 `sites_list` tool exposes is intentionally omitted from this
94
+ * resource: even the "plain" vs "op" hint hints at storage layout,
95
+ * and the resource is positioned as a host-facing public roster.
96
+ */
97
+ export function buildSitesResourcePayload(registry) {
98
+ const rows = registry.listForDisplay();
99
+ return {
100
+ default_site_id: registry.defaultSiteId(),
101
+ sites: rows.map((row) => {
102
+ const platform = row.platform_resolved ?? row.platform_hint;
103
+ const out = {
104
+ site_id: row.site_id,
105
+ url: row.url,
106
+ platform,
107
+ is_default: row.is_default,
108
+ };
109
+ if (row.label !== undefined) {
110
+ out.label = row.label;
111
+ }
112
+ return out;
113
+ }),
114
+ };
115
+ }
116
+ export function createServer(options) {
117
+ // Stream B1 — Skill-Distribution via MCP-Protocol.
118
+ //
119
+ // The bundled SKILL.md is published through two MCP-native channels:
120
+ //
121
+ // (a) `instructions` field on the `initialize` response. MCP-spec
122
+ // hosts (Claude Desktop, Cursor, …) surface this string as
123
+ // auto-context so Maria-the-Claude-Desktop-user receives the
124
+ // skill narrative without ever calling a tool.
125
+ //
126
+ // (b) `skill://yt-builder-mcp` resource exposed via
127
+ // `resources/list` + `resources/read`. Backup for hosts that
128
+ // ignore `instructions` but honor the resources API.
129
+ //
130
+ // Reading SKILL.md is synchronous (small file, ~17 KB) and cached
131
+ // after first call by `loadSkillContent` — no async cost.
132
+ //
133
+ // W8 — pass the pool's registry so loadSkillContent can append the
134
+ // live "Currently configured sites" block. When the registry is
135
+ // empty (fresh install, no sites yet) the appendix is silently
136
+ // omitted and the host receives the unchanged skill content.
137
+ // Bearer fields are never touched by the appendix (see
138
+ // {@link appendSitesBlock} in skill-loader.ts).
139
+ const instructions = loadSkillContent(options.pool.registry);
140
+ const mcp = new McpServer({
141
+ name: SERVER_NAME,
142
+ version: SERVER_VERSION,
143
+ }, {
144
+ instructions,
145
+ });
146
+ // Register the SKILL.md as a static MCP resource. The capability
147
+ // (`resources: { listChanged: true }` etc.) is auto-advertised by
148
+ // McpServer the moment the first resource is registered, so MCP
149
+ // hosts see `resources` in `initialize.capabilities`.
150
+ mcp.registerResource(SKILL_RESOURCE_NAME, SKILL_RESOURCE_URI, {
151
+ title: SKILL_RESOURCE_NAME,
152
+ description: SKILL_RESOURCE_DESCRIPTION,
153
+ mimeType: SKILL_RESOURCE_MIME_TYPE,
154
+ }, async (uri) => ({
155
+ contents: [
156
+ {
157
+ uri: uri.toString(),
158
+ mimeType: SKILL_RESOURCE_MIME_TYPE,
159
+ text: instructions,
160
+ },
161
+ ],
162
+ }));
163
+ // W8 — `sites://current` resource: live registry snapshot as JSON.
164
+ //
165
+ // The payload is computed on every read (cheap — listForDisplay()
166
+ // is in-memory) so hosts that re-fetch after a sites file edit see
167
+ // up-to-date data. We do NOT emit `notifications/resources/updated`
168
+ // since the only mutation path is the W9 CLI which itself requires
169
+ // an AI-client restart (per plan §W8 line 919) — the resource is
170
+ // structurally static for the lifetime of the MCP session.
171
+ //
172
+ // Bearer / bearer_ref are NEVER referenced (see
173
+ // {@link buildSitesResourcePayload}). The resource intentionally
174
+ // omits the `bearer_source` hint that the `sites_list` tool
175
+ // surfaces; a host-facing roster should not even hint at storage
176
+ // layout.
177
+ const registry = options.pool.registry;
178
+ mcp.registerResource(SITES_RESOURCE_NAME, SITES_RESOURCE_URI, {
179
+ title: SITES_RESOURCE_NAME,
180
+ description: SITES_RESOURCE_DESCRIPTION,
181
+ mimeType: SITES_RESOURCE_MIME_TYPE,
182
+ }, async (uri) => ({
183
+ contents: [
184
+ {
185
+ uri: uri.toString(),
186
+ mimeType: SITES_RESOURCE_MIME_TYPE,
187
+ text: JSON.stringify(buildSitesResourcePayload(registry), null, 2),
188
+ },
189
+ ],
190
+ }));
191
+ // Wave G.4.5 — MCP elicitation capability wiring.
192
+ //
193
+ // `toElicitationCapability(mcp)` bridges the SDK's stricter
194
+ // discriminated `ElicitRequestFormParams` to the toolkit's looser
195
+ // `ElicitInputParams`. The 3 elicitation-aware tools
196
+ // (`element_delete`, `element_unbind_source`, `element_bind_source`)
197
+ // consume this capability through their `*HandlerDeps`; the other 19
198
+ // tools never see it. When the host the SDK connects to does not
199
+ // advertise the elicitation capability, the toolkit's `elicitChoice` /
200
+ // `elicitConfirmation` return `null` / `false` and the tool falls
201
+ // back to the structured-error / preview path (no hang, no guess).
202
+ const elicitation = toElicitationCapability(mcp);
203
+ const tools = options.tools ?? buildAllTools(options.pool, { elicitation });
204
+ // L3 — direct top-level: registered FIRST on the real McpServer, before
205
+ // the CapturingServer wraps it. These names get a no-op route inside
206
+ // the CapturingServer (see capturing-server.ts), so the SDK never sees
207
+ // a duplicate registration when the builder list is later replayed.
208
+ for (const tool of tools) {
209
+ if (isDirectTopLevel(tool.name)) {
210
+ registerToolOn(mcp, tool);
211
+ }
212
+ }
213
+ // L1 / L2 — every other tool is routed through the CapturingServer,
214
+ // which forwards essentials to the real server and captures the rest
215
+ // into its advanced registry.
216
+ const capturing = new CapturingServer(mcp);
217
+ for (const tool of tools) {
218
+ if (isDirectTopLevel(tool.name))
219
+ continue;
220
+ registerToolOn(capturing, tool);
221
+ }
222
+ // Gateway — registered LAST so the advanced registry is final.
223
+ registerAdvancedTool(mcp, capturing.getAdvancedRegistry());
224
+ return { mcp, tools, capturing };
225
+ }
226
+ /**
227
+ * Registers a `ToolDefinition` on a `ToolRegistrar`. A real `McpServer`
228
+ * satisfies `ToolRegistrar` structurally (its `registerTool` returns
229
+ * `RegisteredTool`, which is assignable to the `ToolRegistrar` declared
230
+ * `void` return type), so call-sites pass either a real server (for L3
231
+ * + the gateway, which need not be captured) or a `CapturingServer`
232
+ * (for L1 + L2 routing).
233
+ */
234
+ function registerToolOn(registrar, tool) {
235
+ // F-203 follow-up (Audit 2026-05-26 reviewer Gap 2): when the tool
236
+ // ships a refined `inputObjectSchema` (a full `z.object(...).refine(...)`
237
+ // built from the same shape as `inputSchema`), forward THAT to the
238
+ // SDK so its built-in pre-handler validation enforces cross-field
239
+ // rules and raises a JSON-RPC `-32602 InvalidParams` envelope on
240
+ // violation — BEFORE the handler ever runs. Otherwise fall back to
241
+ // the raw `ZodRawShape`, which the SDK auto-wraps with
242
+ // `objectFromShape()` (no `.refine`).
243
+ const inputSchema = tool.inputObjectSchema !== undefined
244
+ ? tool.inputObjectSchema
245
+ : tool.inputSchema;
246
+ // outputSchema is optional — tools migrated to structured-content (Wave
247
+ // G.2) declare a Zod schema describing the `structuredContent` payload.
248
+ // The SDK accepts a `ZodTypeAny` (v3/v4) via `AnySchema`; we forward our
249
+ // schema verbatim. Hosts that support MCP structured output validate
250
+ // responses against this schema.
251
+ const outputSchema = tool.outputSchema !== undefined
252
+ ? tool.outputSchema
253
+ : undefined;
254
+ registrar.registerTool(tool.name, {
255
+ description: tool.description,
256
+ inputSchema,
257
+ ...(outputSchema !== undefined ? { outputSchema } : {}),
258
+ annotations: tool.annotations,
259
+ },
260
+ // Wave G.5 — forward the SDK-supplied `extra` (RequestHandlerExtra)
261
+ // as the 2nd argument to every handler. Write-handlers consume
262
+ // `extra._meta.progressToken` + `extra.sendNotification` via the
263
+ // local `createProgressReporter` helper; read-handlers ignore it
264
+ // (their handler signature still binds `extra` to `HandlerExtra |
265
+ // undefined`, so no runtime coupling for non-progress tools).
266
+ // F-203 follow-up: cross-field input refinement (when present on
267
+ // `tool.inputObjectSchema`) is enforced by the SDK pre-handler;
268
+ // see the `inputSchema` selection above.
269
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK generic narrows to inferred shape; safe because zod validates upstream
270
+ (async (args, extra) => {
271
+ return tool.handler(args, extra);
272
+ }));
273
+ }
274
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAsB,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EACH,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAuB,MAAM,kBAAkB,CAAC;AAEtE,MAAM,CAAC,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,SAAS,kBAAkB;IACvB,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IACpD,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA0B,CAAC;IACxD,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,IAAI,M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@@ -0,0 +1,36 @@
1
+ /**
2
+ * W12-R2A — TTY confirm prompt for destructive CLI subcommands.
3
+ *
4
+ * Hosts `confirmTTY(prompt)`, the y/N readline callback the W9
5
+ * dispatcher wires into the `removeSiteCommand` / `setDefaultCommand`
6
+ * deps bag. Lives in its own file so the dispatcher stays a thin
7
+ * routing layer and so tests can mock the prompt without touching the
8
+ * subcommand factories.
9
+ *
10
+ * Contract:
11
+ *
12
+ * - Returns `true` ONLY when stdin is a TTY AND the operator types
13
+ * "y", "Y", or "yes" (case-insensitive). Anything else (incl. EOF,
14
+ * empty line, Ctrl-D) returns `false` → caller treats this as a
15
+ * cancel and skips the write.
16
+ *
17
+ * - When stdin is NOT a TTY (CI, piped input, MCP-server stdio), the
18
+ * function does NOT block — it returns `false` immediately and
19
+ * writes a one-line hint to stderr telling the operator to pass
20
+ * `--yes` for non-interactive use. The dispatcher then surfaces a
21
+ * typed `CONFIRM_REQUIRED` / `SET_DEFAULT_CONFIRM_REQUIRED` error
22
+ * via the subcommand factory (which fails closed when no confirm
23
+ * hook AND no --yes is in play).
24
+ *
25
+ * - No external deps; uses Node's built-in `node:readline` so the
26
+ * package keeps the same dep-graph as Round-1.
27
+ *
28
+ * @license MIT
29
+ */
30
+ /**
31
+ * Read one line via readline and resolve `true` on y/Y/yes,
32
+ * `false` otherwise. Stdin-not-a-TTY short-circuits to `false` with a
33
+ * stderr hint so a piped invocation can't silently hang.
34
+ */
35
+ export declare function confirmTTY(prompt: string): Promise<boolean>;
36
+ //# sourceMappingURL=setup-cli-confirm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-cli-confirm.d.ts","sourceRoot":"","sources":["../src/setup-cli-confirm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBjE"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * W12-R2A — TTY confirm prompt for destructive CLI subcommands.
3
+ *
4
+ * Hosts `confirmTTY(prompt)`, the y/N readline callback the W9
5
+ * dispatcher wires into the `removeSiteCommand` / `setDefaultCommand`
6
+ * deps bag. Lives in its own file so the dispatcher stays a thin
7
+ * routing layer and so tests can mock the prompt without touching the
8
+ * subcommand factories.
9
+ *
10
+ * Contract:
11
+ *
12
+ * - Returns `true` ONLY when stdin is a TTY AND the operator types
13
+ * "y", "Y", or "yes" (case-insensitive). Anything else (incl. EOF,
14
+ * empty line, Ctrl-D) returns `false` → caller treats this as a
15
+ * cancel and skips the write.
16
+ *
17
+ * - When stdin is NOT a TTY (CI, piped input, MCP-server stdio), the
18
+ * function does NOT block — it returns `false` immediately and
19
+ * writes a one-line hint to stderr telling the operator to pass
20
+ * `--yes` for non-interactive use. The dispatcher then surfaces a
21
+ * typed `CONFIRM_REQUIRED` / `SET_DEFAULT_CONFIRM_REQUIRED` error
22
+ * via the subcommand factory (which fails closed when no confirm
23
+ * hook AND no --yes is in play).
24
+ *
25
+ * - No external deps; uses Node's built-in `node:readline` so the
26
+ * package keeps the same dep-graph as Round-1.
27
+ *
28
+ * @license MIT
29
+ */
30
+ import { createInterface } from 'node:readline';
31
+ /**
32
+ * Read one line via readline and resolve `true` on y/Y/yes,
33
+ * `false` otherwise. Stdin-not-a-TTY short-circuits to `false` with a
34
+ * stderr hint so a piped invocation can't silently hang.
35
+ */
36
+ export async function confirmTTY(prompt) {
37
+ // process.stdin.isTTY is `true | undefined` per Node's typings —
38
+ // explicit !== true guards against both undefined and false.
39
+ if (process.stdin.isTTY !== true) {
40
+ process.stderr.write('yt-builder-mcp: no TTY available for confirmation. '
41
+ + 'Pass --yes to run this subcommand non-interactively.\n');
42
+ return false;
43
+ }
44
+ const rl = createInterface({
45
+ input: process.stdin,
46
+ output: process.stderr,
47
+ });
48
+ try {
49
+ const answer = await new Promise((resolve) => {
50
+ rl.question(`${prompt} [y/N] `, (line) => resolve(line));
51
+ });
52
+ const normalised = answer.trim().toLowerCase();
53
+ return normalised === 'y' || normalised === 'yes';
54
+ }
55
+ finally {
56
+ rl.close();
57
+ }
58
+ }
59
+ //# sourceMappingURL=setup-cli-confirm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-cli-confirm.js","sourceRoot":"","sources":["../src/setup-cli-confirm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAc;IAC3C,iEAAiE;IACjE,6DAA6D;IAC7D,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAChB,qDAAqD;cAC/C,wDAAwD,CACjE,CAAC;QACF,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,EAAE,GAAG,eAAe,CAAC;QACvB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACzB,CAAC,CAAC;IACH,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;YACjD,EAAE,CAAC,QAAQ,CAAC,GAAG,MAAM,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC/C,OAAO,UAAU,KAAK,GAAG,IAAI,UAAU,KAAK,KAAK,CAAC;IACtD,CAAC;YAAS,CAAC;QACP,EAAE,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;AACL,CAAC"}