@wootsup/yt-builder-mcp 1.1.0 → 1.1.5

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 (399) hide show
  1. package/manifest.json +15 -15
  2. package/package.json +2 -2
  3. package/skills/yt-builder-mcp/SKILL.md +23 -15
  4. package/dist/auth.d.ts +0 -119
  5. package/dist/auth.d.ts.map +0 -1
  6. package/dist/auth.js +0 -226
  7. package/dist/auth.js.map +0 -1
  8. package/dist/client.d.ts +0 -84
  9. package/dist/client.d.ts.map +0 -1
  10. package/dist/client.js +0 -151
  11. package/dist/client.js.map +0 -1
  12. package/dist/clients/claude-code.d.ts +0 -18
  13. package/dist/clients/claude-code.d.ts.map +0 -1
  14. package/dist/clients/claude-code.js +0 -53
  15. package/dist/clients/claude-code.js.map +0 -1
  16. package/dist/clients/claude-desktop.d.ts +0 -19
  17. package/dist/clients/claude-desktop.d.ts.map +0 -1
  18. package/dist/clients/claude-desktop.js +0 -56
  19. package/dist/clients/claude-desktop.js.map +0 -1
  20. package/dist/clients/cline.d.ts +0 -26
  21. package/dist/clients/cline.d.ts.map +0 -1
  22. package/dist/clients/cline.js +0 -80
  23. package/dist/clients/cline.js.map +0 -1
  24. package/dist/clients/codex-cli.d.ts +0 -42
  25. package/dist/clients/codex-cli.d.ts.map +0 -1
  26. package/dist/clients/codex-cli.js +0 -194
  27. package/dist/clients/codex-cli.js.map +0 -1
  28. package/dist/clients/continue.d.ts +0 -13
  29. package/dist/clients/continue.d.ts.map +0 -1
  30. package/dist/clients/continue.js +0 -52
  31. package/dist/clients/continue.js.map +0 -1
  32. package/dist/clients/cursor.d.ts +0 -12
  33. package/dist/clients/cursor.d.ts.map +0 -1
  34. package/dist/clients/cursor.js +0 -38
  35. package/dist/clients/cursor.js.map +0 -1
  36. package/dist/clients/gemini-cli.d.ts +0 -18
  37. package/dist/clients/gemini-cli.d.ts.map +0 -1
  38. package/dist/clients/gemini-cli.js +0 -44
  39. package/dist/clients/gemini-cli.js.map +0 -1
  40. package/dist/clients/home.d.ts +0 -14
  41. package/dist/clients/home.d.ts.map +0 -1
  42. package/dist/clients/home.js +0 -20
  43. package/dist/clients/home.js.map +0 -1
  44. package/dist/clients/index.d.ts +0 -52
  45. package/dist/clients/index.d.ts.map +0 -1
  46. package/dist/clients/index.js +0 -72
  47. package/dist/clients/index.js.map +0 -1
  48. package/dist/clients/roo-code.d.ts +0 -23
  49. package/dist/clients/roo-code.d.ts.map +0 -1
  50. package/dist/clients/roo-code.js +0 -69
  51. package/dist/clients/roo-code.js.map +0 -1
  52. package/dist/clients/zed.d.ts +0 -12
  53. package/dist/clients/zed.d.ts.map +0 -1
  54. package/dist/clients/zed.js +0 -41
  55. package/dist/clients/zed.js.map +0 -1
  56. package/dist/errors/hints.d.ts +0 -51
  57. package/dist/errors/hints.d.ts.map +0 -1
  58. package/dist/errors/hints.js +0 -95
  59. package/dist/errors/hints.js.map +0 -1
  60. package/dist/errors/mask.d.ts +0 -35
  61. package/dist/errors/mask.d.ts.map +0 -1
  62. package/dist/errors/mask.js +0 -49
  63. package/dist/errors/mask.js.map +0 -1
  64. package/dist/errors/sanitize.d.ts +0 -31
  65. package/dist/errors/sanitize.d.ts.map +0 -1
  66. package/dist/errors/sanitize.js +0 -100
  67. package/dist/errors/sanitize.js.map +0 -1
  68. package/dist/errors.d.ts +0 -42
  69. package/dist/errors.d.ts.map +0 -1
  70. package/dist/errors.js +0 -61
  71. package/dist/errors.js.map +0 -1
  72. package/dist/gateway/advanced-tool/discovery.d.ts +0 -19
  73. package/dist/gateway/advanced-tool/discovery.d.ts.map +0 -1
  74. package/dist/gateway/advanced-tool/discovery.js +0 -53
  75. package/dist/gateway/advanced-tool/discovery.js.map +0 -1
  76. package/dist/gateway/advanced-tool/domains.d.ts +0 -47
  77. package/dist/gateway/advanced-tool/domains.d.ts.map +0 -1
  78. package/dist/gateway/advanced-tool/domains.js +0 -94
  79. package/dist/gateway/advanced-tool/domains.js.map +0 -1
  80. package/dist/gateway/advanced-tool/execute.d.ts +0 -29
  81. package/dist/gateway/advanced-tool/execute.d.ts.map +0 -1
  82. package/dist/gateway/advanced-tool/execute.js +0 -54
  83. package/dist/gateway/advanced-tool/execute.js.map +0 -1
  84. package/dist/gateway/advanced-tool/index.d.ts +0 -36
  85. package/dist/gateway/advanced-tool/index.d.ts.map +0 -1
  86. package/dist/gateway/advanced-tool/index.js +0 -39
  87. package/dist/gateway/advanced-tool/index.js.map +0 -1
  88. package/dist/gateway/advanced-tool/register.d.ts +0 -18
  89. package/dist/gateway/advanced-tool/register.d.ts.map +0 -1
  90. package/dist/gateway/advanced-tool/register.js +0 -69
  91. package/dist/gateway/advanced-tool/register.js.map +0 -1
  92. package/dist/gateway/advanced-tool.d.ts +0 -13
  93. package/dist/gateway/advanced-tool.d.ts.map +0 -1
  94. package/dist/gateway/advanced-tool.js +0 -13
  95. package/dist/gateway/advanced-tool.js.map +0 -1
  96. package/dist/gateway/capturing-server.d.ts +0 -117
  97. package/dist/gateway/capturing-server.d.ts.map +0 -1
  98. package/dist/gateway/capturing-server.js +0 -103
  99. package/dist/gateway/capturing-server.js.map +0 -1
  100. package/dist/gateway/essentials.d.ts +0 -49
  101. package/dist/gateway/essentials.d.ts.map +0 -1
  102. package/dist/gateway/essentials.js +0 -92
  103. package/dist/gateway/essentials.js.map +0 -1
  104. package/dist/gateway/test-support.d.ts +0 -41
  105. package/dist/gateway/test-support.d.ts.map +0 -1
  106. package/dist/gateway/test-support.js +0 -60
  107. package/dist/gateway/test-support.js.map +0 -1
  108. package/dist/index.d.ts +0 -29
  109. package/dist/index.d.ts.map +0 -1
  110. package/dist/index.js +0 -113
  111. package/dist/index.js.map +0 -1
  112. package/dist/install-skill.d.ts +0 -43
  113. package/dist/install-skill.d.ts.map +0 -1
  114. package/dist/install-skill.js +0 -118
  115. package/dist/install-skill.js.map +0 -1
  116. package/dist/platform/detect.d.ts +0 -64
  117. package/dist/platform/detect.d.ts.map +0 -1
  118. package/dist/platform/detect.js +0 -98
  119. package/dist/platform/detect.js.map +0 -1
  120. package/dist/platform/index.d.ts +0 -121
  121. package/dist/platform/index.d.ts.map +0 -1
  122. package/dist/platform/index.js +0 -176
  123. package/dist/platform/index.js.map +0 -1
  124. package/dist/platform/joomla.d.ts +0 -44
  125. package/dist/platform/joomla.d.ts.map +0 -1
  126. package/dist/platform/joomla.js +0 -46
  127. package/dist/platform/joomla.js.map +0 -1
  128. package/dist/server.d.ts +0 -109
  129. package/dist/server.d.ts.map +0 -1
  130. package/dist/server.js +0 -237
  131. package/dist/server.js.map +0 -1
  132. package/dist/setup-cli-confirm.d.ts +0 -36
  133. package/dist/setup-cli-confirm.d.ts.map +0 -1
  134. package/dist/setup-cli-confirm.js +0 -59
  135. package/dist/setup-cli-confirm.js.map +0 -1
  136. package/dist/setup-cli.d.ts +0 -152
  137. package/dist/setup-cli.d.ts.map +0 -1
  138. package/dist/setup-cli.js +0 -870
  139. package/dist/setup-cli.js.map +0 -1
  140. package/dist/setup-prompts.d.ts +0 -41
  141. package/dist/setup-prompts.d.ts.map +0 -1
  142. package/dist/setup-prompts.js +0 -146
  143. package/dist/setup-prompts.js.map +0 -1
  144. package/dist/setup-token.d.ts +0 -38
  145. package/dist/setup-token.d.ts.map +0 -1
  146. package/dist/setup-token.js +0 -106
  147. package/dist/setup-token.js.map +0 -1
  148. package/dist/setup-wizard-defaults.d.ts +0 -43
  149. package/dist/setup-wizard-defaults.d.ts.map +0 -1
  150. package/dist/setup-wizard-defaults.js +0 -160
  151. package/dist/setup-wizard-defaults.js.map +0 -1
  152. package/dist/setup-wizard-handshake.d.ts +0 -25
  153. package/dist/setup-wizard-handshake.d.ts.map +0 -1
  154. package/dist/setup-wizard-handshake.js +0 -103
  155. package/dist/setup-wizard-handshake.js.map +0 -1
  156. package/dist/setup-wizard-types.d.ts +0 -164
  157. package/dist/setup-wizard-types.d.ts.map +0 -1
  158. package/dist/setup-wizard-types.js +0 -11
  159. package/dist/setup-wizard-types.js.map +0 -1
  160. package/dist/setup-wizard.d.ts +0 -33
  161. package/dist/setup-wizard.d.ts.map +0 -1
  162. package/dist/setup-wizard.js +0 -199
  163. package/dist/setup-wizard.js.map +0 -1
  164. package/dist/setup.d.ts +0 -17
  165. package/dist/setup.d.ts.map +0 -1
  166. package/dist/setup.js +0 -33
  167. package/dist/setup.js.map +0 -1
  168. package/dist/sites/cli/add-site.d.ts +0 -106
  169. package/dist/sites/cli/add-site.d.ts.map +0 -1
  170. package/dist/sites/cli/add-site.js +0 -185
  171. package/dist/sites/cli/add-site.js.map +0 -1
  172. package/dist/sites/cli/list-sites.d.ts +0 -40
  173. package/dist/sites/cli/list-sites.d.ts.map +0 -1
  174. package/dist/sites/cli/list-sites.js +0 -117
  175. package/dist/sites/cli/list-sites.js.map +0 -1
  176. package/dist/sites/cli/remove-site.d.ts +0 -60
  177. package/dist/sites/cli/remove-site.d.ts.map +0 -1
  178. package/dist/sites/cli/remove-site.js +0 -120
  179. package/dist/sites/cli/remove-site.js.map +0 -1
  180. package/dist/sites/cli/set-default.d.ts +0 -47
  181. package/dist/sites/cli/set-default.d.ts.map +0 -1
  182. package/dist/sites/cli/set-default.js +0 -69
  183. package/dist/sites/cli/set-default.js.map +0 -1
  184. package/dist/sites/cli/test-site.d.ts +0 -77
  185. package/dist/sites/cli/test-site.d.ts.map +0 -1
  186. package/dist/sites/cli/test-site.js +0 -146
  187. package/dist/sites/cli/test-site.js.map +0 -1
  188. package/dist/sites/client-pool.d.ts +0 -124
  189. package/dist/sites/client-pool.d.ts.map +0 -1
  190. package/dist/sites/client-pool.js +0 -172
  191. package/dist/sites/client-pool.js.map +0 -1
  192. package/dist/sites/env-bridge.d.ts +0 -55
  193. package/dist/sites/env-bridge.d.ts.map +0 -1
  194. package/dist/sites/env-bridge.js +0 -94
  195. package/dist/sites/env-bridge.js.map +0 -1
  196. package/dist/sites/paths.d.ts +0 -21
  197. package/dist/sites/paths.d.ts.map +0 -1
  198. package/dist/sites/paths.js +0 -37
  199. package/dist/sites/paths.js.map +0 -1
  200. package/dist/sites/probe.d.ts +0 -60
  201. package/dist/sites/probe.d.ts.map +0 -1
  202. package/dist/sites/probe.js +0 -112
  203. package/dist/sites/probe.js.map +0 -1
  204. package/dist/sites/registry.d.ts +0 -142
  205. package/dist/sites/registry.d.ts.map +0 -1
  206. package/dist/sites/registry.js +0 -163
  207. package/dist/sites/registry.js.map +0 -1
  208. package/dist/sites/schema.d.ts +0 -90
  209. package/dist/sites/schema.d.ts.map +0 -1
  210. package/dist/sites/schema.js +0 -71
  211. package/dist/sites/schema.js.map +0 -1
  212. package/dist/sites/secret-resolver.d.ts +0 -109
  213. package/dist/sites/secret-resolver.d.ts.map +0 -1
  214. package/dist/sites/secret-resolver.js +0 -189
  215. package/dist/sites/secret-resolver.js.map +0 -1
  216. package/dist/sites/store.d.ts +0 -82
  217. package/dist/sites/store.d.ts.map +0 -1
  218. package/dist/sites/store.js +0 -198
  219. package/dist/sites/store.js.map +0 -1
  220. package/dist/sites/tools/index.d.ts +0 -28
  221. package/dist/sites/tools/index.d.ts.map +0 -1
  222. package/dist/sites/tools/index.js +0 -30
  223. package/dist/sites/tools/index.js.map +0 -1
  224. package/dist/sites/tools/sites-list.d.ts +0 -48
  225. package/dist/sites/tools/sites-list.d.ts.map +0 -1
  226. package/dist/sites/tools/sites-list.js +0 -135
  227. package/dist/sites/tools/sites-list.js.map +0 -1
  228. package/dist/sites/tools/sites-test.d.ts +0 -47
  229. package/dist/sites/tools/sites-test.d.ts.map +0 -1
  230. package/dist/sites/tools/sites-test.js +0 -148
  231. package/dist/sites/tools/sites-test.js.map +0 -1
  232. package/dist/skill-loader.d.ts +0 -111
  233. package/dist/skill-loader.d.ts.map +0 -1
  234. package/dist/skill-loader.js +0 -191
  235. package/dist/skill-loader.js.map +0 -1
  236. package/dist/tools/elements/builders.d.ts +0 -24
  237. package/dist/tools/elements/builders.d.ts.map +0 -1
  238. package/dist/tools/elements/builders.js +0 -199
  239. package/dist/tools/elements/builders.js.map +0 -1
  240. package/dist/tools/elements/handlers-write.d.ts +0 -49
  241. package/dist/tools/elements/handlers-write.d.ts.map +0 -1
  242. package/dist/tools/elements/handlers-write.js +0 -148
  243. package/dist/tools/elements/handlers-write.js.map +0 -1
  244. package/dist/tools/elements/handlers.d.ts +0 -68
  245. package/dist/tools/elements/handlers.d.ts.map +0 -1
  246. package/dist/tools/elements/handlers.js +0 -206
  247. package/dist/tools/elements/handlers.js.map +0 -1
  248. package/dist/tools/elements/index.d.ts +0 -28
  249. package/dist/tools/elements/index.d.ts.map +0 -1
  250. package/dist/tools/elements/index.js +0 -27
  251. package/dist/tools/elements/index.js.map +0 -1
  252. package/dist/tools/elements.d.ts +0 -13
  253. package/dist/tools/elements.d.ts.map +0 -1
  254. package/dist/tools/elements.js +0 -13
  255. package/dist/tools/elements.js.map +0 -1
  256. package/dist/tools/elicitation.d.ts +0 -87
  257. package/dist/tools/elicitation.d.ts.map +0 -1
  258. package/dist/tools/elicitation.js +0 -100
  259. package/dist/tools/elicitation.js.map +0 -1
  260. package/dist/tools/format/elements-format.d.ts +0 -40
  261. package/dist/tools/format/elements-format.d.ts.map +0 -1
  262. package/dist/tools/format/elements-format.js +0 -194
  263. package/dist/tools/format/elements-format.js.map +0 -1
  264. package/dist/tools/format/health-format.d.ts +0 -79
  265. package/dist/tools/format/health-format.d.ts.map +0 -1
  266. package/dist/tools/format/health-format.js +0 -181
  267. package/dist/tools/format/health-format.js.map +0 -1
  268. package/dist/tools/format/inspection-format.d.ts +0 -58
  269. package/dist/tools/format/inspection-format.d.ts.map +0 -1
  270. package/dist/tools/format/inspection-format.js +0 -164
  271. package/dist/tools/format/inspection-format.js.map +0 -1
  272. package/dist/tools/format/pages-format.d.ts +0 -48
  273. package/dist/tools/format/pages-format.d.ts.map +0 -1
  274. package/dist/tools/format/pages-format.js +0 -137
  275. package/dist/tools/format/pages-format.js.map +0 -1
  276. package/dist/tools/format/sources-format.d.ts +0 -25
  277. package/dist/tools/format/sources-format.d.ts.map +0 -1
  278. package/dist/tools/format/sources-format.js +0 -208
  279. package/dist/tools/format/sources-format.js.map +0 -1
  280. package/dist/tools/health.d.ts +0 -22
  281. package/dist/tools/health.d.ts.map +0 -1
  282. package/dist/tools/health.js +0 -220
  283. package/dist/tools/health.js.map +0 -1
  284. package/dist/tools/index.d.ts +0 -30
  285. package/dist/tools/index.d.ts.map +0 -1
  286. package/dist/tools/index.js +0 -39
  287. package/dist/tools/index.js.map +0 -1
  288. package/dist/tools/inspection.d.ts +0 -14
  289. package/dist/tools/inspection.d.ts.map +0 -1
  290. package/dist/tools/inspection.js +0 -170
  291. package/dist/tools/inspection.js.map +0 -1
  292. package/dist/tools/layout-flatten.d.ts +0 -75
  293. package/dist/tools/layout-flatten.d.ts.map +0 -1
  294. package/dist/tools/layout-flatten.js +0 -107
  295. package/dist/tools/layout-flatten.js.map +0 -1
  296. package/dist/tools/multi-items/builders.d.ts +0 -23
  297. package/dist/tools/multi-items/builders.d.ts.map +0 -1
  298. package/dist/tools/multi-items/builders.js +0 -69
  299. package/dist/tools/multi-items/builders.js.map +0 -1
  300. package/dist/tools/multi-items/clean-implode-handler.d.ts +0 -28
  301. package/dist/tools/multi-items/clean-implode-handler.d.ts.map +0 -1
  302. package/dist/tools/multi-items/clean-implode-handler.js +0 -40
  303. package/dist/tools/multi-items/clean-implode-handler.js.map +0 -1
  304. package/dist/tools/multi-items/index.d.ts +0 -18
  305. package/dist/tools/multi-items/index.d.ts.map +0 -1
  306. package/dist/tools/multi-items/index.js +0 -18
  307. package/dist/tools/multi-items/index.js.map +0 -1
  308. package/dist/tools/multi-items/inspect-handler.d.ts +0 -41
  309. package/dist/tools/multi-items/inspect-handler.d.ts.map +0 -1
  310. package/dist/tools/multi-items/inspect-handler.js +0 -50
  311. package/dist/tools/multi-items/inspect-handler.js.map +0 -1
  312. package/dist/tools/multi-items/item-container-map.d.ts +0 -41
  313. package/dist/tools/multi-items/item-container-map.d.ts.map +0 -1
  314. package/dist/tools/multi-items/item-container-map.js +0 -73
  315. package/dist/tools/multi-items/item-container-map.js.map +0 -1
  316. package/dist/tools/pages/builders.d.ts +0 -14
  317. package/dist/tools/pages/builders.d.ts.map +0 -1
  318. package/dist/tools/pages/builders.js +0 -127
  319. package/dist/tools/pages/builders.js.map +0 -1
  320. package/dist/tools/pages/handlers-read.d.ts +0 -33
  321. package/dist/tools/pages/handlers-read.d.ts.map +0 -1
  322. package/dist/tools/pages/handlers-read.js +0 -171
  323. package/dist/tools/pages/handlers-read.js.map +0 -1
  324. package/dist/tools/pages/handlers-write.d.ts +0 -21
  325. package/dist/tools/pages/handlers-write.d.ts.map +0 -1
  326. package/dist/tools/pages/handlers-write.js +0 -52
  327. package/dist/tools/pages/handlers-write.js.map +0 -1
  328. package/dist/tools/pages/index.d.ts +0 -17
  329. package/dist/tools/pages/index.d.ts.map +0 -1
  330. package/dist/tools/pages/index.js +0 -17
  331. package/dist/tools/pages/index.js.map +0 -1
  332. package/dist/tools/pages/schemas.d.ts +0 -30
  333. package/dist/tools/pages/schemas.d.ts.map +0 -1
  334. package/dist/tools/pages/schemas.js +0 -48
  335. package/dist/tools/pages/schemas.js.map +0 -1
  336. package/dist/tools/pages.d.ts +0 -13
  337. package/dist/tools/pages.d.ts.map +0 -1
  338. package/dist/tools/pages.js +0 -13
  339. package/dist/tools/pages.js.map +0 -1
  340. package/dist/tools/pool-resolve-helper.d.ts +0 -83
  341. package/dist/tools/pool-resolve-helper.d.ts.map +0 -1
  342. package/dist/tools/pool-resolve-helper.js +0 -148
  343. package/dist/tools/pool-resolve-helper.js.map +0 -1
  344. package/dist/tools/progress-phases.d.ts +0 -46
  345. package/dist/tools/progress-phases.d.ts.map +0 -1
  346. package/dist/tools/progress-phases.js +0 -48
  347. package/dist/tools/progress-phases.js.map +0 -1
  348. package/dist/tools/shared-schemas.d.ts +0 -25
  349. package/dist/tools/shared-schemas.d.ts.map +0 -1
  350. package/dist/tools/shared-schemas.js +0 -48
  351. package/dist/tools/shared-schemas.js.map +0 -1
  352. package/dist/tools/sources/builders.d.ts +0 -13
  353. package/dist/tools/sources/builders.d.ts.map +0 -1
  354. package/dist/tools/sources/builders.js +0 -115
  355. package/dist/tools/sources/builders.js.map +0 -1
  356. package/dist/tools/sources/handlers-bind.d.ts +0 -28
  357. package/dist/tools/sources/handlers-bind.d.ts.map +0 -1
  358. package/dist/tools/sources/handlers-bind.js +0 -129
  359. package/dist/tools/sources/handlers-bind.js.map +0 -1
  360. package/dist/tools/sources/handlers.d.ts +0 -45
  361. package/dist/tools/sources/handlers.d.ts.map +0 -1
  362. package/dist/tools/sources/handlers.js +0 -91
  363. package/dist/tools/sources/handlers.js.map +0 -1
  364. package/dist/tools/sources/index.d.ts +0 -19
  365. package/dist/tools/sources/index.d.ts.map +0 -1
  366. package/dist/tools/sources/index.js +0 -18
  367. package/dist/tools/sources/index.js.map +0 -1
  368. package/dist/tools/sources.d.ts +0 -14
  369. package/dist/tools/sources.d.ts.map +0 -1
  370. package/dist/tools/sources.js +0 -14
  371. package/dist/tools/sources.js.map +0 -1
  372. package/dist/tools/sparse-fields.d.ts +0 -80
  373. package/dist/tools/sparse-fields.d.ts.map +0 -1
  374. package/dist/tools/sparse-fields.js +0 -144
  375. package/dist/tools/sparse-fields.js.map +0 -1
  376. package/dist/tools/tool-builder/annotations.d.ts +0 -55
  377. package/dist/tools/tool-builder/annotations.d.ts.map +0 -1
  378. package/dist/tools/tool-builder/annotations.js +0 -86
  379. package/dist/tools/tool-builder/annotations.js.map +0 -1
  380. package/dist/tools/tool-builder/define.d.ts +0 -31
  381. package/dist/tools/tool-builder/define.d.ts.map +0 -1
  382. package/dist/tools/tool-builder/define.js +0 -31
  383. package/dist/tools/tool-builder/define.js.map +0 -1
  384. package/dist/tools/tool-builder/index.d.ts +0 -28
  385. package/dist/tools/tool-builder/index.d.ts.map +0 -1
  386. package/dist/tools/tool-builder/index.js +0 -27
  387. package/dist/tools/tool-builder/index.js.map +0 -1
  388. package/dist/tools/tool-builder/results.d.ts +0 -93
  389. package/dist/tools/tool-builder/results.d.ts.map +0 -1
  390. package/dist/tools/tool-builder/results.js +0 -211
  391. package/dist/tools/tool-builder/results.js.map +0 -1
  392. package/dist/tools/tool-builder/types.d.ts +0 -82
  393. package/dist/tools/tool-builder/types.d.ts.map +0 -1
  394. package/dist/tools/tool-builder/types.js +0 -9
  395. package/dist/tools/tool-builder/types.js.map +0 -1
  396. package/dist/tools/tool-builder.d.ts +0 -16
  397. package/dist/tools/tool-builder.d.ts.map +0 -1
  398. package/dist/tools/tool-builder.js +0 -16
  399. package/dist/tools/tool-builder.js.map +0 -1
package/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "dxt_version": "0.1",
3
3
  "name": "@wootsup/yt-builder-mcp",
4
4
  "display_name": "YT Builder MCP for YOOtheme Pro (unofficial)",
5
- "version": "1.1.0",
5
+ "version": "1.1.5",
6
6
  "description": "Drive your YOOtheme Pro Page Builder programmatically from Claude, Cursor, Codex, Gemini and 5 other MCP-capable AI assistants — read layouts, edit settings, add elements, bind dynamic sources. Works on WordPress and Joomla 5/6. Built for YOOtheme Pro 4.0+. Independent third-party project, not affiliated with YOOtheme GmbH.",
7
7
  "long_description": "YT Builder MCP gives AI assistants a typed, scoped, and idempotent surface for your YOOtheme Pro Page Builder, on either WordPress or Joomla 5/6. Tools cover page discovery, layout inspection, element CRUD, source binding, and diagnostics. Bearer auth, optimistic locking via ETag, scope hierarchy (read < write < admin), and structured-error responses keep the agent safe and the workflow correct on first try. Independent third-party project — YOOtheme® is a registered trademark of YOOtheme GmbH (yootheme.com); YT Builder MCP is built by WootsUp (getimo productions) and is not affiliated with, endorsed by, or sponsored by YOOtheme.",
8
8
  "icon": "icon.png",
@@ -47,31 +47,31 @@
47
47
  }
48
48
  },
49
49
  "user_config": {
50
- "YTB_MCP_SITES_FILE": {
50
+ "YTB_MCP_SITE_URL": {
51
51
  "type": "string",
52
- "title": "Sites registry file (multi-site mode)",
53
- "description": "Path to sites.json for multi-site setups (e.g. ~/.config/yt-builder-mcp/sites.json). When set, the legacy YTB_MCP_SITE_URL / YTB_MCP_BEARER_TOKEN fields are ignored. Create via `npx -y @wootsup/yt-builder-mcp add-site`.",
52
+ "title": "Site URL (connect one site)",
53
+ "description": "Fill this if you connect a SINGLE site (most people). The address of your YOOtheme site, e.g. https://example.com, or https://example.com/wordpress if WordPress runs in a subfolder. No trailing slash. Leave empty if you use the Sites file below.",
54
54
  "required": false
55
55
  },
56
- "YTB_MCP_SITE_URL": {
56
+ "YTB_MCP_BEARER_TOKEN": {
57
57
  "type": "string",
58
- "title": "Site URL",
59
- "description": "Base URL of the site (e.g. https://example.com, https://example.com/wordpress for subdir WordPress, https://example.com/joomla for subdir Joomla). Without trailing slash.",
60
- "required": false
58
+ "title": "Bearer token (for that one site)",
59
+ "description": "Fill this if you connect a SINGLE site. Paste the key you generated in your CMS admin: WordPress under Tools, YT Builder MCP; Joomla under Components, YT Builder MCP, then Generate Key. The 'write' scope is enough. Leave empty if you use the Sites file below.",
60
+ "required": false,
61
+ "sensitive": true
61
62
  },
62
63
  "YTB_MCP_PLATFORM": {
63
64
  "type": "string",
64
- "title": "Platform (optional)",
65
- "description": "CMS platform hint. Allowed values: \"auto\" (default auto-detect from URL path and, if ambiguous, runtime-probe both platforms' /health endpoints), \"wordpress\", or \"joomla\". Set explicitly only to override auto-detection (e.g. when the host blocks anonymous health probes).",
65
+ "title": "Platform (one site, optional)",
66
+ "description": "Leave this on 'auto'. The server detects WordPress or Joomla by itself. Only set 'wordpress' or 'joomla' if your host blocks the automatic check.",
66
67
  "required": false,
67
68
  "default": "auto"
68
69
  },
69
- "YTB_MCP_BEARER_TOKEN": {
70
+ "YTB_MCP_SITES_FILE": {
70
71
  "type": "string",
71
- "title": "Bearer token",
72
- "description": "Bearer token generated in the YT Builder MCP admin UI (WordPress: Tools YT Builder MCP; Joomla: Components YT Builder MCP) Generate Key. Scope: write is sufficient for most agent workflows; admin only for key-management.",
73
- "required": false,
74
- "sensitive": true
72
+ "title": "Sites file (connect many sites, advanced)",
73
+ "description": "Only for managing several sites from one install (agencies). Path to a sites.json, e.g. /Users/you/.config/yt-builder-mcp/sites.json. Create and fill it with: npx -y @wootsup/yt-builder-mcp add-site (do not hand-edit). When set, the three single-site fields above are ignored. Most people leave this empty.",
74
+ "required": false
75
75
  }
76
76
  },
77
77
  "compatibility": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wootsup/yt-builder-mcp",
3
- "version": "1.1.0",
3
+ "version": "1.1.5",
4
4
  "type": "module",
5
5
  "description": "YT Builder MCP — drive your page builder from Claude, Cursor, Codex, Gemini and 5 other MCP-capable AI assistants. Built for YOOtheme Pro 4.0+. Independent third-party project, not affiliated with YOOtheme GmbH.",
6
6
  "license": "MIT",
@@ -66,6 +66,7 @@
66
66
  "@modelcontextprotocol/sdk": "^1.27.0",
67
67
  "@clack/prompts": "^0.7.0",
68
68
  "pino": "^10.3.1",
69
+ "proper-lockfile": "^4.1.2",
69
70
  "zod": "^4.3.6"
70
71
  },
71
72
  "devDependencies": {
@@ -75,7 +76,6 @@
75
76
  "@typescript-eslint/parser": "^8.0.0",
76
77
  "@vitest/coverage-v8": "^1.4.0",
77
78
  "eslint": "^9.0.0",
78
- "proper-lockfile": "^4.1.2",
79
79
  "typescript": "^5.4.0",
80
80
  "typescript-eslint": "^8.0.0",
81
81
  "vitest": "^1.4.0"
@@ -12,12 +12,12 @@ description: Drive the YOOtheme Pro Page Builder on WordPress or Joomla 5/6 —
12
12
  > WordPress and Joomla 5/6.
13
13
 
14
14
  This skill helps AI assistants drive the YOOtheme Pro Page Builder through the
15
- `@wootsup/yt-builder-mcp` server. The server exposes 26 typed, scoped, idempotent
16
- tools. 20 of them advertised as first-class entries in `tools/list` (17 essential
17
- L1 forwards + 2 direct L3 entries + 1 gateway), and 7 advanced tools reachable
18
- through the single `yootheme_builder_advanced` gateway. This 3-lane split keeps
19
- `tools/list` well below the ~40-tool Cursor cap while every catalogued tool stays
20
- fully reachable.
15
+ `@wootsup/yt-builder-mcp` server. The server exposes 27 typed, scoped, idempotent
16
+ callable tools. 20 of them advertised as first-class entries in `tools/list`
17
+ (17 essential L1 forwards + 2 direct L3 entries + 1 gateway), and 7 advanced
18
+ tools reachable through the single `yootheme_builder_advanced` gateway. This
19
+ 3-lane split keeps `tools/list` well below the ~40-tool Cursor cap while every
20
+ catalogued tool stays fully reachable.
21
21
 
22
22
  ## How to use this MCP server
23
23
 
@@ -86,9 +86,11 @@ The server exposes:
86
86
  gateway tool: `yootheme_builder_advanced({ tool: "<name>", input: { ... } })`.
87
87
  - **1 gateway tool** — `yootheme_builder_advanced`.
88
88
 
89
- `tools/list` therefore advertises 20 names (17 + 2 + 1) for a total catalogue
90
- of 26. If the AI client reports "tool not found", you are almost certainly
91
- calling an advanced tool by its raw name. Wrap it in
89
+ `tools/list` therefore advertises 20 names (17 + 2 + 1) that's 17 L1
90
+ essentials + 2 L3 direct + 1 gateway. The total callable surface is 27
91
+ (20 advertised + 7 advanced reachable through the gateway). If the AI
92
+ client reports "tool not found", you are almost certainly calling an
93
+ advanced tool by its raw name. Wrap it in
92
94
  `yootheme_builder_advanced({ tool, input })` instead.
93
95
 
94
96
  ## Site and frontend URLs (for deep-linking and verification)
@@ -131,6 +133,12 @@ Do not loop on auth errors.
131
133
  > capabilities like `manage_options` gate the admin settings page only; the
132
134
  > REST API surface is Bearer-gated.
133
135
 
136
+ > **Joomla L2 articles surface.** The Joomla plugin ships `/v1/articles*`
137
+ > REST endpoints for per-article custom layouts, but they are NOT exposed
138
+ > via MCP tools in v1.x. To use that surface, call the REST endpoints
139
+ > directly with the Bearer key. MCP tool coverage for L2 articles is
140
+ > planned for v1.2.0.
141
+
134
142
  ---
135
143
 
136
144
  ## Working with multiple sites
@@ -812,7 +820,7 @@ Joomla administrator access." Don't fabricate tool calls.
812
820
 
813
821
  <!-- TOOL-CATALOG:BEGIN -->
814
822
 
815
- **26 tools** generated by `scripts/extract-tools.mjs` from the compiled `buildAllTools()` registry. Do not hand-edit this section; re-run `npm run build && node scripts/extract-tools.mjs` after changing tool definitions.
823
+ **26 catalogued tools** plus the `yootheme_builder_advanced` gateway = **27 reachable via `tools/list`** (17 L1 + 2 L3 + 1 gateway = 20 advertised; the gateway routes to 7 additional advanced tools, bringing the total to 27 callable). Generated by `scripts/extract-tools.mjs` from the compiled `buildAllTools()` registry. Do not hand-edit this section; re-run `npm run build && node scripts/extract-tools.mjs` after changing tool definitions.
816
824
 
817
825
  | Tool | Kind | Input keys | Description |
818
826
  | --- | --- | --- | --- |
@@ -830,17 +838,17 @@ Joomla administrator access." Don't fabricate tool calls.
830
838
  | `yootheme_builder_element_types_list` | read+idempotent | `fields`, `site_id` | List element types registered on this site (built-ins + YOOessentials/uEssentials extras). Names feed `element_type` of element_add. Pass `fields[]` to narrow each row. Operates on the default site unless site_id is provided. |
831
839
  | `yootheme_builder_element_unbind_source` | destructive | `confirm`, `element_path`, `etag`, `site_id`, `template_id` | Remove the source binding from an element. Clears `props.source`. Destructive in the sense that it may break dynamic-content rendering — always ask the user to confirm. Requires ETag. Operates on the default site unless site_id is provided. |
832
840
  | `yootheme_builder_element_update_settings` | idempotent | `element_path`, `etag`, `merge`, `props`, `site_id`, `template_id` | Update `props` on an element. Default replaces all props; pass `merge:true` for server-side deep-merge (only request keys overwritten, others survive — avoids read-modify-write races). Requires ETag. Operates on the default site unless site_id is provided. |
833
- | `yootheme_builder_get_etag` | read+idempotent | `site_id` | Get the current top-level state ETag. Pass it back via `etag` on any write tool (page_save/page_publish/element_set/binding_set) to enforce optimistic-locking the server returns 412 when the ETag has changed since you read it. Operates on the default site unless site_id is provided. |
841
+ | `yootheme_builder_get_etag` | read+idempotent | `site_id` | Get the current ETag (state revision) for the YOOtheme builder. Returns sha256+revision string used for optimistic locking on writes. Pass the returned value back as `etag` on any write tool (page_save, page_publish, element_add, element_update_settings, element_clone, element_move, element_delete). The server returns HTTP 412 if the ETag has changed since you read it. Keywords: get etag, current etag, state revision, optimistic lock, version stamp. Operates on the default site unless site_id is provided. |
834
842
  | `yootheme_builder_health` | read+idempotent | `site_id` | Check plugin installed/reachable. Returns plugin version, YT Pro version, REST endpoints. Authenticated payload adds site_url + home_url for deep-linking. See yootheme_builder_diagnose for Bearer-validity + connectivity summary. Operates on the default site unless site_id is provided. |
835
843
  | `yootheme_builder_inspect_multi_items_binding` | read+idempotent | `element_path`, `site_id`, `template_id` | Reports Multi-Items binding state: container/item pair (grid↔grid_item, slideshow↔slideshow_item, …), current binding level (none\|container\|item), and a recommended_fix when the binding sits on the container instead of the child. Operates on the default site unless site_id is provided. |
836
844
  | `yootheme_builder_page_get_layout` | read+idempotent | `fields`, `flat`, `site_id`, `template_id` | Get full layout tree for one template. Default nested `{layout, etag}`. Set `flat:true` for depth-first array `{elements:[...], etag}`; combine with `fields[]` to project per-element. Operates on the default site unless site_id is provided. |
837
845
  | `yootheme_builder_page_get_schema` | read+idempotent | `site_id`, `template_id` | Get the flat schema for a template — a list of nodes with their JSON-Pointer paths and element types. Best entry-point for navigation: lighter than page_get_layout, sufficient to locate elements before editing. Operates on the default site unless site_id is provided. |
838
846
  | `yootheme_builder_page_publish` | idempotent | `etag`, `site_id`, `template_id` | Publish a template — persist state, flush YT + WP caches, snapshot the published-state ETag. ETag optional — when provided, 412 on conflict; when omitted, last-write-wins. Recommended for collaborative edits. Operates on the default site unless site_id is provided. |
839
847
  | `yootheme_builder_page_save` | idempotent | `etag`, `site_id`, `template_id` | Re-run save-transforms and persist. ETag optional — when provided, 412 on conflict; when omitted, last-write-wins. Recommended for collaborative edits. No-op when state is byte-identical (returns `no_changes:true`, ETag unchanged). Operates on the default site unless site_id is provided. |
840
- | `yootheme_builder_pages_list` | read+idempotent | `fields`, `site_id` | List YT templates. Returns id, label, usage meta + per-row `frontend_url` (permalink when public) and `frontend_url_template` (pattern for search / 404 / ID-based templates). Pass `fields:["id","label"]` to slim. Site URL: diagnose. Operates on the default site unless site_id is provided. |
841
- | `yootheme_builder_sites_list` | read+idempotent | `site_id` | List every site configured in this MCP server (site_id, URL, platform, default flag, bearer source). Platform-agnostic. Never calls a REST endpoint, never resolves a bearer. Useful when the agent needs to discover available site_ids before targeting one with `site_id: "<id>"`. (`site_id` is accepted for schema-uniformity but ignored by this tool.) |
842
- | `yootheme_builder_sites_test` | read+idempotent | `site_id` | Verify connectivity to ONE configured site: probes `/health` (unauthenticated) and `/etag` (authenticated) in parallel and returns plugin_reachable + bearer_valid in a single call. `site_id` is REQUIRED (this tool exists to test a specific id, never the default). Use `yootheme_builder_sites_list` to discover available IDs first. |
843
- | `yootheme_builder_sources_list` | read+idempotent | `fields`, `site_id` | List Builder sources grouped by origin (apimapper/wordpress/essentials). Returns name+label per source pick one for `element_bind_source`. Pass `fields[]` to narrow each row. Operates on the default site unless site_id is provided. |
848
+ | `yootheme_builder_pages_list` | read+idempotent | `fields`, `site_id` | List all pages, templates, and layouts in the YOOtheme Pro builder. Returns template_id, label, type, element count, and frontend_url per row. CALL THIS FIRST to discover available template IDs before any tool that needs a template_id (page_get_layout, element_list, page_get_schema, etc.). Keywords: list pages, list templates, list layouts, discover template_id, index, available templates, what pages exist. Pass `fields:["id","label"]` to slim. Returns ALL pages in one call (no pagination, typically <50 templates per site). Operates on the default site unless site_id is provided. |
849
+ | `yootheme_builder_sites_list` | read+idempotent | `site_id` | List all sites configured in this multi-site MCP installation. Returns site_id + URL + platform (wordpress\|joomla) + default flag per row. CALL THIS FIRST when working with a fresh MCP connection to discover available site_ids before targeting one with any other tool. Read-only, no REST calls. Keywords: list sites, list connections, list installations, discover site_id, available sites, configured sites, what sites exist, multi-site index. (site_id is accepted for schema-uniformity but ignored by this tool.) |
850
+ | `yootheme_builder_sites_test` | read+idempotent | `site_id` | Verify connectivity to ONE site: probes /health (no auth) + /etag (auth) in parallel; returns plugin_reachable + bearer_valid. `site_id` is REQUIRED. Use sites_list to find IDs. |
851
+ | `yootheme_builder_sources_list` | read+idempotent | `fields`, `site_id` | List all data sources, feeds, and dynamic content sources available in the YOOtheme Pro builder. Returns name + label + origin (apimapper / wordpress / joomla / essentials) per source. CALL THIS BEFORE binding any element to a data source. Pick a source name from the list and pass it to `element_bind_source`. Keywords: list sources, list data sources, list feeds, list bindings, dynamic content, available data, what sources exist. Pass `fields[]` to narrow each row. Operates on the default site unless site_id is provided. |
844
852
  | `yootheme_builder_template_summary` | read+idempotent | `site_id`, `template_id` | Token-efficient template overview: element counts by type, binding count, max nesting depth, and named landmark sections — computed server-side in one call. Use this to grasp a large template before pulling element_list or page_get_layout. Operates on the default site unless site_id is provided. |
845
853
 
846
854
  <!-- TOOL-CATALOG:END -->
package/dist/auth.d.ts DELETED
@@ -1,119 +0,0 @@
1
- /**
2
- * Auth / configuration loading for the MCP server.
3
- *
4
- * The MCP server reads two environment variables on startup:
5
- *
6
- * YTB_MCP_SITE_URL — base URL of the host CMS install (WordPress
7
- * OR Joomla), e.g. `https://example.com`.
8
- * The per-platform REST namespace
9
- * (`/wp-json/yt-builder-mcp/v1` for WP,
10
- * `/api/index.php/v1/yt-builder-mcp` for
11
- * Joomla) is appended internally based on
12
- * runtime platform detection.
13
- * YTB_MCP_WP_URL — DEPRECATED alias for YTB_MCP_SITE_URL,
14
- * kept for back-compat with pre-Wave 7
15
- * configurations. A non-fatal deprecation
16
- * notice is written to stderr when the
17
- * legacy var is used in non-test mode.
18
- * YTB_MCP_BEARER_TOKEN — the Bearer key generated by the plugin
19
- * Settings page (`wp-admin → YT Builder MCP`
20
- * on WordPress, `Components → YT Builder MCP`
21
- * on Joomla).
22
- *
23
- * `loadConfig()` throws `ConfigError` if either is missing, so the
24
- * server fails fast with a useful message rather than emitting cryptic
25
- * 401/Network errors deep in the request stack.
26
- *
27
- * @license MIT
28
- */
29
- import { SiteRegistry } from './sites/registry.js';
30
- export interface ServerConfig {
31
- /** Base URL of the host-CMS install (no trailing slash). */
32
- readonly baseUrl: string;
33
- /** Bearer key. */
34
- readonly bearerToken: string;
35
- /** Network timeout (ms) for REST calls. */
36
- readonly timeoutMs: number;
37
- /**
38
- * Optional explicit platform hint from {@link ENV_PLATFORM}.
39
- * `undefined` lets the consumer rely on URL-shape detection.
40
- */
41
- readonly platformHint?: 'wordpress' | 'joomla';
42
- }
43
- export interface LoadConfigOptions {
44
- /** Allow the bearer-token to be empty (for health-only smoke tests). */
45
- readonly allowMissingToken?: boolean;
46
- /** Source of env vars (defaults to process.env). */
47
- readonly env?: NodeJS.ProcessEnv;
48
- }
49
- /**
50
- * Canonical env-var name for the host-CMS base URL (Wave 7+: covers
51
- * both WordPress and Joomla). Prefer this for all new configurations.
52
- */
53
- export declare const ENV_SITE_URL = "YTB_MCP_SITE_URL";
54
- /**
55
- * Legacy env-var name kept for back-compat. Pre-Wave-7 configurations
56
- * (every release through v1.0.x) used `YTB_MCP_WP_URL`. New code should
57
- * use {@link ENV_SITE_URL}; this constant is retained so the wizard,
58
- * tests, and error hints can still reference the legacy name.
59
- */
60
- export declare const ENV_WP_URL = "YTB_MCP_WP_URL";
61
- export declare const ENV_BEARER = "YTB_MCP_BEARER_TOKEN";
62
- export declare const ENV_TIMEOUT = "YTB_MCP_TIMEOUT_MS";
63
- export declare const ENV_TEST_MODE = "YTB_MCP_TEST_MODE";
64
- /**
65
- * Optional platform hint env var — `'wordpress'` or `'joomla'`. When
66
- * unset, the server auto-detects from the URL shape (cookbook §3.7.1):
67
- * - URL contains `/wp-json/` → wordpress
68
- * - URL contains `/api/index.php/` → joomla
69
- * - origin-only URL → defaults to wordpress (back-compat)
70
- *
71
- * Set this to `'joomla'` when your YTB_MCP_SITE_URL is an origin-only
72
- * Joomla URL like `https://example.com/joomla`.
73
- */
74
- export declare const ENV_PLATFORM = "YTB_MCP_PLATFORM";
75
- /**
76
- * W10 — canonical env-var name for the multi-site registry file. When
77
- * set, {@link loadRegistry} loads + validates the JSON at this path and
78
- * the legacy {@link ENV_SITE_URL} / {@link ENV_BEARER} pair is ignored.
79
- * When unset, the env-bridge falls back to building a one-site registry
80
- * from the legacy single-site pair.
81
- */
82
- export declare const ENV_SITES_FILE = "YTB_MCP_SITES_FILE";
83
- export declare function loadConfig(options?: LoadConfigOptions): ServerConfig;
84
- export declare function isTestMode(env?: NodeJS.ProcessEnv): boolean;
85
- /**
86
- * Options accepted by {@link loadRegistry}.
87
- */
88
- export interface LoadRegistryOptions {
89
- /** Source of env vars (defaults to process.env). */
90
- readonly env?: NodeJS.ProcessEnv;
91
- }
92
- /**
93
- * W10 — canonical boot-time registry loader.
94
- *
95
- * Resolution order:
96
- * 1. **Sites file** — if {@link ENV_SITES_FILE} is set to a non-empty
97
- * string, parse + validate the JSON at that path and wrap it in a
98
- * {@link SiteRegistry}. Schema failures bubble up as
99
- * `SitesFileError` (the store does not swallow them); the caller
100
- * decides whether to fail-fast or fall back. Wave 10 chooses
101
- * fail-fast — explicit file = explicit intent.
102
- *
103
- * 2. **Legacy env-bridge** — synthesise a one-site registry from the
104
- * pre-W10 single-site env-vars ({@link ENV_SITE_URL} +
105
- * {@link ENV_BEARER}, with {@link ENV_PLATFORM} as optional hint).
106
- * Preserves the single-site UX for every customer who has not
107
- * migrated to a sites.json yet.
108
- *
109
- * 3. **Hard fail** — neither configured. Surface a {@link ConfigError}
110
- * with the three setup options so the operator knows exactly which
111
- * knob to turn.
112
- *
113
- * This function replaces {@link loadConfig} on the main boot path.
114
- * `loadConfig` is intentionally retained for the test-mode fallback in
115
- * `index.ts` (`--test-mode` smoke probes) and for any embedded consumer
116
- * that still wants a flat `ServerConfig`.
117
- */
118
- export declare function loadRegistry(opts?: LoadRegistryOptions): Promise<SiteRegistry>;
119
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,MAAM,WAAW,YAAY;IACzB,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,kBAAkB;IAClB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;CAClD;AAED,MAAM,WAAW,iBAAiB;IAC9B,wEAAwE;IACxE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,oDAAoD;IACpD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACpC;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C;;;;;GAKG;AACH,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,UAAU,yBAAyB,CAAC;AACjD,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAChD,eAAO,MAAM,aAAa,sBAAsB,CAAC;AACjD;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,uBAAuB,CAAC;AAkCnD,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,YAAY,CA8ExE;AAED,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAExE;AAMD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,oDAAoD;IACpD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAC9B,IAAI,GAAE,mBAAwB,GAC/B,OAAO,CAAC,YAAY,CAAC,CA8CvB"}
package/dist/auth.js DELETED
@@ -1,226 +0,0 @@
1
- /**
2
- * Auth / configuration loading for the MCP server.
3
- *
4
- * The MCP server reads two environment variables on startup:
5
- *
6
- * YTB_MCP_SITE_URL — base URL of the host CMS install (WordPress
7
- * OR Joomla), e.g. `https://example.com`.
8
- * The per-platform REST namespace
9
- * (`/wp-json/yt-builder-mcp/v1` for WP,
10
- * `/api/index.php/v1/yt-builder-mcp` for
11
- * Joomla) is appended internally based on
12
- * runtime platform detection.
13
- * YTB_MCP_WP_URL — DEPRECATED alias for YTB_MCP_SITE_URL,
14
- * kept for back-compat with pre-Wave 7
15
- * configurations. A non-fatal deprecation
16
- * notice is written to stderr when the
17
- * legacy var is used in non-test mode.
18
- * YTB_MCP_BEARER_TOKEN — the Bearer key generated by the plugin
19
- * Settings page (`wp-admin → YT Builder MCP`
20
- * on WordPress, `Components → YT Builder MCP`
21
- * on Joomla).
22
- *
23
- * `loadConfig()` throws `ConfigError` if either is missing, so the
24
- * server fails fast with a useful message rather than emitting cryptic
25
- * 401/Network errors deep in the request stack.
26
- *
27
- * @license MIT
28
- */
29
- import { z } from 'zod';
30
- import { ConfigError } from './errors.js';
31
- import { synthesiseFromEnv } from './sites/env-bridge.js';
32
- import { SiteRegistry } from './sites/registry.js';
33
- import { SitesFile } from './sites/schema.js';
34
- import { loadSitesFile } from './sites/store.js';
35
- /**
36
- * Canonical env-var name for the host-CMS base URL (Wave 7+: covers
37
- * both WordPress and Joomla). Prefer this for all new configurations.
38
- */
39
- export const ENV_SITE_URL = 'YTB_MCP_SITE_URL';
40
- /**
41
- * Legacy env-var name kept for back-compat. Pre-Wave-7 configurations
42
- * (every release through v1.0.x) used `YTB_MCP_WP_URL`. New code should
43
- * use {@link ENV_SITE_URL}; this constant is retained so the wizard,
44
- * tests, and error hints can still reference the legacy name.
45
- */
46
- export const ENV_WP_URL = 'YTB_MCP_WP_URL';
47
- export const ENV_BEARER = 'YTB_MCP_BEARER_TOKEN';
48
- export const ENV_TIMEOUT = 'YTB_MCP_TIMEOUT_MS';
49
- export const ENV_TEST_MODE = 'YTB_MCP_TEST_MODE';
50
- /**
51
- * Optional platform hint env var — `'wordpress'` or `'joomla'`. When
52
- * unset, the server auto-detects from the URL shape (cookbook §3.7.1):
53
- * - URL contains `/wp-json/` → wordpress
54
- * - URL contains `/api/index.php/` → joomla
55
- * - origin-only URL → defaults to wordpress (back-compat)
56
- *
57
- * Set this to `'joomla'` when your YTB_MCP_SITE_URL is an origin-only
58
- * Joomla URL like `https://example.com/joomla`.
59
- */
60
- export const ENV_PLATFORM = 'YTB_MCP_PLATFORM';
61
- /**
62
- * W10 — canonical env-var name for the multi-site registry file. When
63
- * set, {@link loadRegistry} loads + validates the JSON at this path and
64
- * the legacy {@link ENV_SITE_URL} / {@link ENV_BEARER} pair is ignored.
65
- * When unset, the env-bridge falls back to building a one-site registry
66
- * from the legacy single-site pair.
67
- */
68
- export const ENV_SITES_FILE = 'YTB_MCP_SITES_FILE';
69
- const DEFAULT_TIMEOUT_MS = 15_000;
70
- /**
71
- * Maximum accepted length for a Bearer token (defense-in-depth bound;
72
- * the real plugin keys are ~150-300 bytes, the 512 ceiling protects
73
- * against accidental file-pastes / log dumps / memory abuse).
74
- */
75
- const BEARER_MAX_LEN = 512;
76
- /**
77
- * Bearer-token format check — matches the plugin's `KeyService.php`
78
- * `PREFIX = ytb_live_` (and the planned `ytb_test_` future variant).
79
- * Token shape: `ytb_(live|test)_<payloadB64Url>.<sigB64Url>` where
80
- * base64url uses `[A-Za-z0-9_-]` (no dots inside the payload or sig).
81
- *
82
- * Round-1 audit I7 fix (2026-05-22): the earlier `.trim()` + empty-check
83
- * was not enough to catch the most common config mistakes — the leading
84
- * `Bearer ` prefix accidentally pasted into the env var, copy-paste
85
- * truncation (no `.` separator), or a totally wrong token style. We
86
- * fail-fast here so the client never sends a known-bad value upstream.
87
- */
88
- const BEARER_FORMAT_SCHEMA = z
89
- .string()
90
- .max(BEARER_MAX_LEN, `Bearer too long (max ${String(BEARER_MAX_LEN)} chars). The env var YTB_MCP_BEARER_TOKEN seems to contain something other than a plain key — strip leading "Bearer " or paste only the key copied from wp-admin → "YT Builder MCP" → Settings.`)
91
- .regex(/^ytb_(live|test)_[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/, 'Bearer must match ytb_(live|test)_<payloadB64Url>.<sigB64Url> format (copy the key as shown in wp-admin → "YT Builder MCP" → Settings; do NOT prepend "Bearer ").');
92
- export function loadConfig(options = {}) {
93
- const env = options.env ?? process.env;
94
- // Wave 7: YTB_MCP_SITE_URL is canonical (covers both WP + Joomla);
95
- // YTB_MCP_WP_URL is retained as a deprecated back-compat alias.
96
- // Resolution order: SITE_URL wins; legacy WP_URL fallback emits a
97
- // soft deprecation note in non-test mode.
98
- const rawSiteUrl = (env[ENV_SITE_URL] ?? '').trim();
99
- const rawLegacyUrl = (env[ENV_WP_URL] ?? '').trim();
100
- const rawUrl = rawSiteUrl !== '' ? rawSiteUrl : rawLegacyUrl;
101
- // Soft deprecation notice — only when the loader is being used in
102
- // its real-server role (env defaulted to process.env). Programmatic
103
- // callers (tests, embedded uses) pass `options.env` explicitly and
104
- // are silently treated as opt-in to the legacy var.
105
- if (rawSiteUrl === ''
106
- && rawLegacyUrl !== ''
107
- && options.env === undefined
108
- && !isTestMode(env)) {
109
- process.stderr.write(`[yt-builder-mcp] notice: ${ENV_WP_URL} is deprecated — ` +
110
- `set ${ENV_SITE_URL} instead (same value; covers WordPress + Joomla).\n`);
111
- }
112
- const rawToken = (env[ENV_BEARER] ?? '').trim();
113
- const rawTimeout = (env[ENV_TIMEOUT] ?? '').trim();
114
- if (rawUrl === '') {
115
- throw new ConfigError(`Missing ${ENV_SITE_URL}. Set it to your CMS base URL ` +
116
- '(e.g. https://example.com — WordPress or Joomla). ' +
117
- 'Run `yt-builder-mcp setup` to configure.');
118
- }
119
- if (!options.allowMissingToken && rawToken === '') {
120
- throw new ConfigError(`Missing ${ENV_BEARER}. Generate a Bearer key in wp-admin → "YT Builder MCP" → ` +
121
- 'Settings, then run `yt-builder-mcp setup`.');
122
- }
123
- // I7-fix: enforce the Bearer-format contract before the client
124
- // makes any request. Empty token is allowed only via
125
- // `allowMissingToken` (the health-only smoke path); any other
126
- // non-empty value MUST match the plugin's KeyService format.
127
- if (rawToken !== '') {
128
- const parsed = BEARER_FORMAT_SCHEMA.safeParse(rawToken);
129
- if (!parsed.success) {
130
- const issueMsg = parsed.error.issues
131
- .map((iss) => iss.message)
132
- .join(' ');
133
- throw new ConfigError(`Invalid ${ENV_BEARER}: ${issueMsg}`);
134
- }
135
- }
136
- let timeoutMs = DEFAULT_TIMEOUT_MS;
137
- if (rawTimeout !== '') {
138
- const parsed = Number.parseInt(rawTimeout, 10);
139
- if (Number.isFinite(parsed) && parsed > 0) {
140
- timeoutMs = parsed;
141
- }
142
- }
143
- const rawPlatform = (env[ENV_PLATFORM] ?? '').trim().toLowerCase();
144
- const platformHint = rawPlatform === 'wordpress' || rawPlatform === 'joomla'
145
- ? rawPlatform
146
- : undefined;
147
- return {
148
- baseUrl: stripTrailingSlash(rawUrl),
149
- bearerToken: rawToken,
150
- timeoutMs,
151
- ...(platformHint !== undefined ? { platformHint } : {}),
152
- };
153
- }
154
- export function isTestMode(env = process.env) {
155
- return (env[ENV_TEST_MODE] ?? '') === '1';
156
- }
157
- function stripTrailingSlash(url) {
158
- return url.replace(/\/+$/, '');
159
- }
160
- /**
161
- * W10 — canonical boot-time registry loader.
162
- *
163
- * Resolution order:
164
- * 1. **Sites file** — if {@link ENV_SITES_FILE} is set to a non-empty
165
- * string, parse + validate the JSON at that path and wrap it in a
166
- * {@link SiteRegistry}. Schema failures bubble up as
167
- * `SitesFileError` (the store does not swallow them); the caller
168
- * decides whether to fail-fast or fall back. Wave 10 chooses
169
- * fail-fast — explicit file = explicit intent.
170
- *
171
- * 2. **Legacy env-bridge** — synthesise a one-site registry from the
172
- * pre-W10 single-site env-vars ({@link ENV_SITE_URL} +
173
- * {@link ENV_BEARER}, with {@link ENV_PLATFORM} as optional hint).
174
- * Preserves the single-site UX for every customer who has not
175
- * migrated to a sites.json yet.
176
- *
177
- * 3. **Hard fail** — neither configured. Surface a {@link ConfigError}
178
- * with the three setup options so the operator knows exactly which
179
- * knob to turn.
180
- *
181
- * This function replaces {@link loadConfig} on the main boot path.
182
- * `loadConfig` is intentionally retained for the test-mode fallback in
183
- * `index.ts` (`--test-mode` smoke probes) and for any embedded consumer
184
- * that still wants a flat `ServerConfig`.
185
- */
186
- export async function loadRegistry(opts = {}) {
187
- const env = opts.env ?? process.env;
188
- // (1) sites file (preferred).
189
- const sitesFilePath = (env[ENV_SITES_FILE] ?? '').trim();
190
- if (sitesFilePath !== '') {
191
- // loadSitesFile handles both "file present" and "file absent"
192
- // (the latter returns an emptySitesFile). When the file is
193
- // empty (no sites), fall through to env-bridge instead of
194
- // booting with an empty registry — operators who set
195
- // SITES_FILE to a not-yet-populated path should still get the
196
- // legacy env-var ramp until they run `add-site`.
197
- const file = await loadSitesFile(sitesFilePath);
198
- if (file.sites.length > 0) {
199
- return new SiteRegistry(file);
200
- }
201
- }
202
- // (2) legacy env-bridge. The bridge already enforces URL/bearer
203
- // non-emptiness and platform-hint validity, but we re-validate the
204
- // full file shape through the W1 Zod schema before handing it to
205
- // the registry. Defense-in-depth: a future env-bridge change cannot
206
- // introduce a SitesFileT-shape regression that lands on the
207
- // registry path without first failing this gate.
208
- const synth = synthesiseFromEnv(env);
209
- if (synth !== null) {
210
- const parsed = SitesFile.safeParse(synth);
211
- if (!parsed.success) {
212
- const issues = parsed.error.issues
213
- .map((i) => `${i.path.join('.')}: ${i.message}`)
214
- .join('; ');
215
- throw new ConfigError(`Env-bridge synthesised an invalid sites file: ${issues}`);
216
- }
217
- return new SiteRegistry(parsed.data);
218
- }
219
- // (3) fail-fast.
220
- throw new ConfigError('No sites configured. Either: '
221
- + '(a) set YTB_MCP_SITES_FILE to your sites.json path, or '
222
- + '(b) set YTB_MCP_SITE_URL + YTB_MCP_BEARER_TOKEN for '
223
- + 'single-site mode, or '
224
- + '(c) run `npx -y @wootsup/yt-builder-mcp setup` interactively.');
225
- }
226
- //# sourceMappingURL=auth.js.map
package/dist/auth.js.map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C,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;iBAC/C,IAAI,CAAC,IAAI,CAAC,CAAC;YAChB,MAAM,IAAI,WAAW,CACjB,iDAAiD,MAAM,EAAE,CAC5D,CAAC;QACN,CAAC;QACD,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,iBAAiB;IACjB,MAAM,IAAI,WAAW,CACjB,+BAA+B;UAC7B,yDAAyD;UACzD,sDAAsD;UACtD,uBAAuB;UACvB,+DAA+D,CACpE,CAAC;AACN,CAAC"}
package/dist/client.d.ts DELETED
@@ -1,84 +0,0 @@
1
- /**
2
- * `RestClient` — thin wrapper around `fetch` that targets the
3
- * `yt-builder-mcp/v1` REST namespace.
4
- *
5
- * Responsibilities:
6
- * - Compose final URLs (`{baseUrl}/wp-json/yt-builder-mcp/v1{path}`)
7
- * - Attach `Authorization: Bearer …`
8
- * - Encode JSON bodies + propagate `If-Match` etag headers
9
- * - Map non-2xx into `RestError` with status / `code` / message
10
- * - Map network failures into `NetworkError`
11
- *
12
- * The client deliberately keeps zero state beyond constructor config
13
- * so each tool can hold a reference and call `.get/.post/.put/.delete`
14
- * without coordinating sessions.
15
- *
16
- * @license MIT
17
- */
18
- import type { Platform } from './platform/index.js';
19
- /**
20
- * Canonical WordPress REST-namespace path. Re-exported for backward
21
- * compat — new code should reach for `Platform.restNamespacePath`.
22
- */
23
- export declare const REST_NAMESPACE_PATH = "/wp-json/yt-builder-mcp/v1";
24
- /**
25
- * Legacy single-platform options shape. Kept so existing call-sites
26
- * continue working without touching every entry point.
27
- */
28
- export interface LegacyRestClientOptions {
29
- readonly baseUrl: string;
30
- readonly bearerToken: string;
31
- readonly timeoutMs?: number;
32
- /** Injected for tests. Defaults to `globalThis.fetch`. */
33
- readonly fetch?: typeof fetch;
34
- }
35
- /**
36
- * Platform-aware options shape (Wave G.0+).
37
- * Pass an instance of `WordPressPlatform` (or any future `Platform`)
38
- * instead of a bare `baseUrl`.
39
- */
40
- export interface PlatformRestClientOptions {
41
- readonly platform: Platform;
42
- readonly bearerToken: string;
43
- readonly timeoutMs?: number;
44
- /** Injected for tests. Defaults to `globalThis.fetch`. */
45
- readonly fetch?: typeof fetch;
46
- }
47
- /** Discriminated union: callers pick whichever shape suits them. */
48
- export type RestClientOptions = LegacyRestClientOptions | PlatformRestClientOptions;
49
- export interface RequestOptions {
50
- /** Optional ETag for optimistic-lock (`If-Match` header). */
51
- readonly etag?: string;
52
- /** JSON body. */
53
- readonly body?: unknown;
54
- /** Extra headers. */
55
- readonly headers?: Record<string, string>;
56
- /** Optional AbortSignal. */
57
- readonly signal?: AbortSignal;
58
- }
59
- export declare class RestClient {
60
- private readonly platform;
61
- private readonly baseUrl;
62
- private readonly bearerToken;
63
- private readonly timeoutMs;
64
- private readonly fetchImpl;
65
- constructor(options: RestClientOptions);
66
- /** Expose the underlying platform (used by tools that need restNamespacePath/kind). */
67
- getPlatform(): Platform;
68
- get<T = unknown>(path: string, options?: RequestOptions): Promise<T>;
69
- post<T = unknown>(path: string, options?: RequestOptions): Promise<T>;
70
- put<T = unknown>(path: string, options?: RequestOptions): Promise<T>;
71
- delete<T = unknown>(path: string, options?: RequestOptions): Promise<T>;
72
- request<T = unknown>(method: string, path: string, options?: RequestOptions): Promise<T>;
73
- private buildUrl;
74
- }
75
- /**
76
- * URL-encode a JSON-Pointer-style element path for use in the route.
77
- *
78
- * The plugin's regex captures everything after `/elements/`, so the
79
- * raw `/grid/1/columns/0` path can be passed as-is — but each segment
80
- * must be percent-encoded so reserved chars like `~` (used in
81
- * JSON-Pointer escapes) don't collide with WordPress' router.
82
- */
83
- export declare function encodeElementPath(pointer: string): string;
84
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;G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