@wootsup/yt-builder-mcp 1.1.0 → 1.1.6

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 (400) hide show
  1. package/README.md +56 -55
  2. package/manifest.json +15 -15
  3. package/package.json +2 -2
  4. package/skills/yt-builder-mcp/SKILL.md +130 -121
  5. package/dist/auth.d.ts +0 -119
  6. package/dist/auth.d.ts.map +0 -1
  7. package/dist/auth.js +0 -226
  8. package/dist/auth.js.map +0 -1
  9. package/dist/client.d.ts +0 -84
  10. package/dist/client.d.ts.map +0 -1
  11. package/dist/client.js +0 -151
  12. package/dist/client.js.map +0 -1
  13. package/dist/clients/claude-code.d.ts +0 -18
  14. package/dist/clients/claude-code.d.ts.map +0 -1
  15. package/dist/clients/claude-code.js +0 -53
  16. package/dist/clients/claude-code.js.map +0 -1
  17. package/dist/clients/claude-desktop.d.ts +0 -19
  18. package/dist/clients/claude-desktop.d.ts.map +0 -1
  19. package/dist/clients/claude-desktop.js +0 -56
  20. package/dist/clients/claude-desktop.js.map +0 -1
  21. package/dist/clients/cline.d.ts +0 -26
  22. package/dist/clients/cline.d.ts.map +0 -1
  23. package/dist/clients/cline.js +0 -80
  24. package/dist/clients/cline.js.map +0 -1
  25. package/dist/clients/codex-cli.d.ts +0 -42
  26. package/dist/clients/codex-cli.d.ts.map +0 -1
  27. package/dist/clients/codex-cli.js +0 -194
  28. package/dist/clients/codex-cli.js.map +0 -1
  29. package/dist/clients/continue.d.ts +0 -13
  30. package/dist/clients/continue.d.ts.map +0 -1
  31. package/dist/clients/continue.js +0 -52
  32. package/dist/clients/continue.js.map +0 -1
  33. package/dist/clients/cursor.d.ts +0 -12
  34. package/dist/clients/cursor.d.ts.map +0 -1
  35. package/dist/clients/cursor.js +0 -38
  36. package/dist/clients/cursor.js.map +0 -1
  37. package/dist/clients/gemini-cli.d.ts +0 -18
  38. package/dist/clients/gemini-cli.d.ts.map +0 -1
  39. package/dist/clients/gemini-cli.js +0 -44
  40. package/dist/clients/gemini-cli.js.map +0 -1
  41. package/dist/clients/home.d.ts +0 -14
  42. package/dist/clients/home.d.ts.map +0 -1
  43. package/dist/clients/home.js +0 -20
  44. package/dist/clients/home.js.map +0 -1
  45. package/dist/clients/index.d.ts +0 -52
  46. package/dist/clients/index.d.ts.map +0 -1
  47. package/dist/clients/index.js +0 -72
  48. package/dist/clients/index.js.map +0 -1
  49. package/dist/clients/roo-code.d.ts +0 -23
  50. package/dist/clients/roo-code.d.ts.map +0 -1
  51. package/dist/clients/roo-code.js +0 -69
  52. package/dist/clients/roo-code.js.map +0 -1
  53. package/dist/clients/zed.d.ts +0 -12
  54. package/dist/clients/zed.d.ts.map +0 -1
  55. package/dist/clients/zed.js +0 -41
  56. package/dist/clients/zed.js.map +0 -1
  57. package/dist/errors/hints.d.ts +0 -51
  58. package/dist/errors/hints.d.ts.map +0 -1
  59. package/dist/errors/hints.js +0 -95
  60. package/dist/errors/hints.js.map +0 -1
  61. package/dist/errors/mask.d.ts +0 -35
  62. package/dist/errors/mask.d.ts.map +0 -1
  63. package/dist/errors/mask.js +0 -49
  64. package/dist/errors/mask.js.map +0 -1
  65. package/dist/errors/sanitize.d.ts +0 -31
  66. package/dist/errors/sanitize.d.ts.map +0 -1
  67. package/dist/errors/sanitize.js +0 -100
  68. package/dist/errors/sanitize.js.map +0 -1
  69. package/dist/errors.d.ts +0 -42
  70. package/dist/errors.d.ts.map +0 -1
  71. package/dist/errors.js +0 -61
  72. package/dist/errors.js.map +0 -1
  73. package/dist/gateway/advanced-tool/discovery.d.ts +0 -19
  74. package/dist/gateway/advanced-tool/discovery.d.ts.map +0 -1
  75. package/dist/gateway/advanced-tool/discovery.js +0 -53
  76. package/dist/gateway/advanced-tool/discovery.js.map +0 -1
  77. package/dist/gateway/advanced-tool/domains.d.ts +0 -47
  78. package/dist/gateway/advanced-tool/domains.d.ts.map +0 -1
  79. package/dist/gateway/advanced-tool/domains.js +0 -94
  80. package/dist/gateway/advanced-tool/domains.js.map +0 -1
  81. package/dist/gateway/advanced-tool/execute.d.ts +0 -29
  82. package/dist/gateway/advanced-tool/execute.d.ts.map +0 -1
  83. package/dist/gateway/advanced-tool/execute.js +0 -54
  84. package/dist/gateway/advanced-tool/execute.js.map +0 -1
  85. package/dist/gateway/advanced-tool/index.d.ts +0 -36
  86. package/dist/gateway/advanced-tool/index.d.ts.map +0 -1
  87. package/dist/gateway/advanced-tool/index.js +0 -39
  88. package/dist/gateway/advanced-tool/index.js.map +0 -1
  89. package/dist/gateway/advanced-tool/register.d.ts +0 -18
  90. package/dist/gateway/advanced-tool/register.d.ts.map +0 -1
  91. package/dist/gateway/advanced-tool/register.js +0 -69
  92. package/dist/gateway/advanced-tool/register.js.map +0 -1
  93. package/dist/gateway/advanced-tool.d.ts +0 -13
  94. package/dist/gateway/advanced-tool.d.ts.map +0 -1
  95. package/dist/gateway/advanced-tool.js +0 -13
  96. package/dist/gateway/advanced-tool.js.map +0 -1
  97. package/dist/gateway/capturing-server.d.ts +0 -117
  98. package/dist/gateway/capturing-server.d.ts.map +0 -1
  99. package/dist/gateway/capturing-server.js +0 -103
  100. package/dist/gateway/capturing-server.js.map +0 -1
  101. package/dist/gateway/essentials.d.ts +0 -49
  102. package/dist/gateway/essentials.d.ts.map +0 -1
  103. package/dist/gateway/essentials.js +0 -92
  104. package/dist/gateway/essentials.js.map +0 -1
  105. package/dist/gateway/test-support.d.ts +0 -41
  106. package/dist/gateway/test-support.d.ts.map +0 -1
  107. package/dist/gateway/test-support.js +0 -60
  108. package/dist/gateway/test-support.js.map +0 -1
  109. package/dist/index.d.ts +0 -29
  110. package/dist/index.d.ts.map +0 -1
  111. package/dist/index.js +0 -113
  112. package/dist/index.js.map +0 -1
  113. package/dist/install-skill.d.ts +0 -43
  114. package/dist/install-skill.d.ts.map +0 -1
  115. package/dist/install-skill.js +0 -118
  116. package/dist/install-skill.js.map +0 -1
  117. package/dist/platform/detect.d.ts +0 -64
  118. package/dist/platform/detect.d.ts.map +0 -1
  119. package/dist/platform/detect.js +0 -98
  120. package/dist/platform/detect.js.map +0 -1
  121. package/dist/platform/index.d.ts +0 -121
  122. package/dist/platform/index.d.ts.map +0 -1
  123. package/dist/platform/index.js +0 -176
  124. package/dist/platform/index.js.map +0 -1
  125. package/dist/platform/joomla.d.ts +0 -44
  126. package/dist/platform/joomla.d.ts.map +0 -1
  127. package/dist/platform/joomla.js +0 -46
  128. package/dist/platform/joomla.js.map +0 -1
  129. package/dist/server.d.ts +0 -109
  130. package/dist/server.d.ts.map +0 -1
  131. package/dist/server.js +0 -237
  132. package/dist/server.js.map +0 -1
  133. package/dist/setup-cli-confirm.d.ts +0 -36
  134. package/dist/setup-cli-confirm.d.ts.map +0 -1
  135. package/dist/setup-cli-confirm.js +0 -59
  136. package/dist/setup-cli-confirm.js.map +0 -1
  137. package/dist/setup-cli.d.ts +0 -152
  138. package/dist/setup-cli.d.ts.map +0 -1
  139. package/dist/setup-cli.js +0 -870
  140. package/dist/setup-cli.js.map +0 -1
  141. package/dist/setup-prompts.d.ts +0 -41
  142. package/dist/setup-prompts.d.ts.map +0 -1
  143. package/dist/setup-prompts.js +0 -146
  144. package/dist/setup-prompts.js.map +0 -1
  145. package/dist/setup-token.d.ts +0 -38
  146. package/dist/setup-token.d.ts.map +0 -1
  147. package/dist/setup-token.js +0 -106
  148. package/dist/setup-token.js.map +0 -1
  149. package/dist/setup-wizard-defaults.d.ts +0 -43
  150. package/dist/setup-wizard-defaults.d.ts.map +0 -1
  151. package/dist/setup-wizard-defaults.js +0 -160
  152. package/dist/setup-wizard-defaults.js.map +0 -1
  153. package/dist/setup-wizard-handshake.d.ts +0 -25
  154. package/dist/setup-wizard-handshake.d.ts.map +0 -1
  155. package/dist/setup-wizard-handshake.js +0 -103
  156. package/dist/setup-wizard-handshake.js.map +0 -1
  157. package/dist/setup-wizard-types.d.ts +0 -164
  158. package/dist/setup-wizard-types.d.ts.map +0 -1
  159. package/dist/setup-wizard-types.js +0 -11
  160. package/dist/setup-wizard-types.js.map +0 -1
  161. package/dist/setup-wizard.d.ts +0 -33
  162. package/dist/setup-wizard.d.ts.map +0 -1
  163. package/dist/setup-wizard.js +0 -199
  164. package/dist/setup-wizard.js.map +0 -1
  165. package/dist/setup.d.ts +0 -17
  166. package/dist/setup.d.ts.map +0 -1
  167. package/dist/setup.js +0 -33
  168. package/dist/setup.js.map +0 -1
  169. package/dist/sites/cli/add-site.d.ts +0 -106
  170. package/dist/sites/cli/add-site.d.ts.map +0 -1
  171. package/dist/sites/cli/add-site.js +0 -185
  172. package/dist/sites/cli/add-site.js.map +0 -1
  173. package/dist/sites/cli/list-sites.d.ts +0 -40
  174. package/dist/sites/cli/list-sites.d.ts.map +0 -1
  175. package/dist/sites/cli/list-sites.js +0 -117
  176. package/dist/sites/cli/list-sites.js.map +0 -1
  177. package/dist/sites/cli/remove-site.d.ts +0 -60
  178. package/dist/sites/cli/remove-site.d.ts.map +0 -1
  179. package/dist/sites/cli/remove-site.js +0 -120
  180. package/dist/sites/cli/remove-site.js.map +0 -1
  181. package/dist/sites/cli/set-default.d.ts +0 -47
  182. package/dist/sites/cli/set-default.d.ts.map +0 -1
  183. package/dist/sites/cli/set-default.js +0 -69
  184. package/dist/sites/cli/set-default.js.map +0 -1
  185. package/dist/sites/cli/test-site.d.ts +0 -77
  186. package/dist/sites/cli/test-site.d.ts.map +0 -1
  187. package/dist/sites/cli/test-site.js +0 -146
  188. package/dist/sites/cli/test-site.js.map +0 -1
  189. package/dist/sites/client-pool.d.ts +0 -124
  190. package/dist/sites/client-pool.d.ts.map +0 -1
  191. package/dist/sites/client-pool.js +0 -172
  192. package/dist/sites/client-pool.js.map +0 -1
  193. package/dist/sites/env-bridge.d.ts +0 -55
  194. package/dist/sites/env-bridge.d.ts.map +0 -1
  195. package/dist/sites/env-bridge.js +0 -94
  196. package/dist/sites/env-bridge.js.map +0 -1
  197. package/dist/sites/paths.d.ts +0 -21
  198. package/dist/sites/paths.d.ts.map +0 -1
  199. package/dist/sites/paths.js +0 -37
  200. package/dist/sites/paths.js.map +0 -1
  201. package/dist/sites/probe.d.ts +0 -60
  202. package/dist/sites/probe.d.ts.map +0 -1
  203. package/dist/sites/probe.js +0 -112
  204. package/dist/sites/probe.js.map +0 -1
  205. package/dist/sites/registry.d.ts +0 -142
  206. package/dist/sites/registry.d.ts.map +0 -1
  207. package/dist/sites/registry.js +0 -163
  208. package/dist/sites/registry.js.map +0 -1
  209. package/dist/sites/schema.d.ts +0 -90
  210. package/dist/sites/schema.d.ts.map +0 -1
  211. package/dist/sites/schema.js +0 -71
  212. package/dist/sites/schema.js.map +0 -1
  213. package/dist/sites/secret-resolver.d.ts +0 -109
  214. package/dist/sites/secret-resolver.d.ts.map +0 -1
  215. package/dist/sites/secret-resolver.js +0 -189
  216. package/dist/sites/secret-resolver.js.map +0 -1
  217. package/dist/sites/store.d.ts +0 -82
  218. package/dist/sites/store.d.ts.map +0 -1
  219. package/dist/sites/store.js +0 -198
  220. package/dist/sites/store.js.map +0 -1
  221. package/dist/sites/tools/index.d.ts +0 -28
  222. package/dist/sites/tools/index.d.ts.map +0 -1
  223. package/dist/sites/tools/index.js +0 -30
  224. package/dist/sites/tools/index.js.map +0 -1
  225. package/dist/sites/tools/sites-list.d.ts +0 -48
  226. package/dist/sites/tools/sites-list.d.ts.map +0 -1
  227. package/dist/sites/tools/sites-list.js +0 -135
  228. package/dist/sites/tools/sites-list.js.map +0 -1
  229. package/dist/sites/tools/sites-test.d.ts +0 -47
  230. package/dist/sites/tools/sites-test.d.ts.map +0 -1
  231. package/dist/sites/tools/sites-test.js +0 -148
  232. package/dist/sites/tools/sites-test.js.map +0 -1
  233. package/dist/skill-loader.d.ts +0 -111
  234. package/dist/skill-loader.d.ts.map +0 -1
  235. package/dist/skill-loader.js +0 -191
  236. package/dist/skill-loader.js.map +0 -1
  237. package/dist/tools/elements/builders.d.ts +0 -24
  238. package/dist/tools/elements/builders.d.ts.map +0 -1
  239. package/dist/tools/elements/builders.js +0 -199
  240. package/dist/tools/elements/builders.js.map +0 -1
  241. package/dist/tools/elements/handlers-write.d.ts +0 -49
  242. package/dist/tools/elements/handlers-write.d.ts.map +0 -1
  243. package/dist/tools/elements/handlers-write.js +0 -148
  244. package/dist/tools/elements/handlers-write.js.map +0 -1
  245. package/dist/tools/elements/handlers.d.ts +0 -68
  246. package/dist/tools/elements/handlers.d.ts.map +0 -1
  247. package/dist/tools/elements/handlers.js +0 -206
  248. package/dist/tools/elements/handlers.js.map +0 -1
  249. package/dist/tools/elements/index.d.ts +0 -28
  250. package/dist/tools/elements/index.d.ts.map +0 -1
  251. package/dist/tools/elements/index.js +0 -27
  252. package/dist/tools/elements/index.js.map +0 -1
  253. package/dist/tools/elements.d.ts +0 -13
  254. package/dist/tools/elements.d.ts.map +0 -1
  255. package/dist/tools/elements.js +0 -13
  256. package/dist/tools/elements.js.map +0 -1
  257. package/dist/tools/elicitation.d.ts +0 -87
  258. package/dist/tools/elicitation.d.ts.map +0 -1
  259. package/dist/tools/elicitation.js +0 -100
  260. package/dist/tools/elicitation.js.map +0 -1
  261. package/dist/tools/format/elements-format.d.ts +0 -40
  262. package/dist/tools/format/elements-format.d.ts.map +0 -1
  263. package/dist/tools/format/elements-format.js +0 -194
  264. package/dist/tools/format/elements-format.js.map +0 -1
  265. package/dist/tools/format/health-format.d.ts +0 -79
  266. package/dist/tools/format/health-format.d.ts.map +0 -1
  267. package/dist/tools/format/health-format.js +0 -181
  268. package/dist/tools/format/health-format.js.map +0 -1
  269. package/dist/tools/format/inspection-format.d.ts +0 -58
  270. package/dist/tools/format/inspection-format.d.ts.map +0 -1
  271. package/dist/tools/format/inspection-format.js +0 -164
  272. package/dist/tools/format/inspection-format.js.map +0 -1
  273. package/dist/tools/format/pages-format.d.ts +0 -48
  274. package/dist/tools/format/pages-format.d.ts.map +0 -1
  275. package/dist/tools/format/pages-format.js +0 -137
  276. package/dist/tools/format/pages-format.js.map +0 -1
  277. package/dist/tools/format/sources-format.d.ts +0 -25
  278. package/dist/tools/format/sources-format.d.ts.map +0 -1
  279. package/dist/tools/format/sources-format.js +0 -208
  280. package/dist/tools/format/sources-format.js.map +0 -1
  281. package/dist/tools/health.d.ts +0 -22
  282. package/dist/tools/health.d.ts.map +0 -1
  283. package/dist/tools/health.js +0 -220
  284. package/dist/tools/health.js.map +0 -1
  285. package/dist/tools/index.d.ts +0 -30
  286. package/dist/tools/index.d.ts.map +0 -1
  287. package/dist/tools/index.js +0 -39
  288. package/dist/tools/index.js.map +0 -1
  289. package/dist/tools/inspection.d.ts +0 -14
  290. package/dist/tools/inspection.d.ts.map +0 -1
  291. package/dist/tools/inspection.js +0 -170
  292. package/dist/tools/inspection.js.map +0 -1
  293. package/dist/tools/layout-flatten.d.ts +0 -75
  294. package/dist/tools/layout-flatten.d.ts.map +0 -1
  295. package/dist/tools/layout-flatten.js +0 -107
  296. package/dist/tools/layout-flatten.js.map +0 -1
  297. package/dist/tools/multi-items/builders.d.ts +0 -23
  298. package/dist/tools/multi-items/builders.d.ts.map +0 -1
  299. package/dist/tools/multi-items/builders.js +0 -69
  300. package/dist/tools/multi-items/builders.js.map +0 -1
  301. package/dist/tools/multi-items/clean-implode-handler.d.ts +0 -28
  302. package/dist/tools/multi-items/clean-implode-handler.d.ts.map +0 -1
  303. package/dist/tools/multi-items/clean-implode-handler.js +0 -40
  304. package/dist/tools/multi-items/clean-implode-handler.js.map +0 -1
  305. package/dist/tools/multi-items/index.d.ts +0 -18
  306. package/dist/tools/multi-items/index.d.ts.map +0 -1
  307. package/dist/tools/multi-items/index.js +0 -18
  308. package/dist/tools/multi-items/index.js.map +0 -1
  309. package/dist/tools/multi-items/inspect-handler.d.ts +0 -41
  310. package/dist/tools/multi-items/inspect-handler.d.ts.map +0 -1
  311. package/dist/tools/multi-items/inspect-handler.js +0 -50
  312. package/dist/tools/multi-items/inspect-handler.js.map +0 -1
  313. package/dist/tools/multi-items/item-container-map.d.ts +0 -41
  314. package/dist/tools/multi-items/item-container-map.d.ts.map +0 -1
  315. package/dist/tools/multi-items/item-container-map.js +0 -73
  316. package/dist/tools/multi-items/item-container-map.js.map +0 -1
  317. package/dist/tools/pages/builders.d.ts +0 -14
  318. package/dist/tools/pages/builders.d.ts.map +0 -1
  319. package/dist/tools/pages/builders.js +0 -127
  320. package/dist/tools/pages/builders.js.map +0 -1
  321. package/dist/tools/pages/handlers-read.d.ts +0 -33
  322. package/dist/tools/pages/handlers-read.d.ts.map +0 -1
  323. package/dist/tools/pages/handlers-read.js +0 -171
  324. package/dist/tools/pages/handlers-read.js.map +0 -1
  325. package/dist/tools/pages/handlers-write.d.ts +0 -21
  326. package/dist/tools/pages/handlers-write.d.ts.map +0 -1
  327. package/dist/tools/pages/handlers-write.js +0 -52
  328. package/dist/tools/pages/handlers-write.js.map +0 -1
  329. package/dist/tools/pages/index.d.ts +0 -17
  330. package/dist/tools/pages/index.d.ts.map +0 -1
  331. package/dist/tools/pages/index.js +0 -17
  332. package/dist/tools/pages/index.js.map +0 -1
  333. package/dist/tools/pages/schemas.d.ts +0 -30
  334. package/dist/tools/pages/schemas.d.ts.map +0 -1
  335. package/dist/tools/pages/schemas.js +0 -48
  336. package/dist/tools/pages/schemas.js.map +0 -1
  337. package/dist/tools/pages.d.ts +0 -13
  338. package/dist/tools/pages.d.ts.map +0 -1
  339. package/dist/tools/pages.js +0 -13
  340. package/dist/tools/pages.js.map +0 -1
  341. package/dist/tools/pool-resolve-helper.d.ts +0 -83
  342. package/dist/tools/pool-resolve-helper.d.ts.map +0 -1
  343. package/dist/tools/pool-resolve-helper.js +0 -148
  344. package/dist/tools/pool-resolve-helper.js.map +0 -1
  345. package/dist/tools/progress-phases.d.ts +0 -46
  346. package/dist/tools/progress-phases.d.ts.map +0 -1
  347. package/dist/tools/progress-phases.js +0 -48
  348. package/dist/tools/progress-phases.js.map +0 -1
  349. package/dist/tools/shared-schemas.d.ts +0 -25
  350. package/dist/tools/shared-schemas.d.ts.map +0 -1
  351. package/dist/tools/shared-schemas.js +0 -48
  352. package/dist/tools/shared-schemas.js.map +0 -1
  353. package/dist/tools/sources/builders.d.ts +0 -13
  354. package/dist/tools/sources/builders.d.ts.map +0 -1
  355. package/dist/tools/sources/builders.js +0 -115
  356. package/dist/tools/sources/builders.js.map +0 -1
  357. package/dist/tools/sources/handlers-bind.d.ts +0 -28
  358. package/dist/tools/sources/handlers-bind.d.ts.map +0 -1
  359. package/dist/tools/sources/handlers-bind.js +0 -129
  360. package/dist/tools/sources/handlers-bind.js.map +0 -1
  361. package/dist/tools/sources/handlers.d.ts +0 -45
  362. package/dist/tools/sources/handlers.d.ts.map +0 -1
  363. package/dist/tools/sources/handlers.js +0 -91
  364. package/dist/tools/sources/handlers.js.map +0 -1
  365. package/dist/tools/sources/index.d.ts +0 -19
  366. package/dist/tools/sources/index.d.ts.map +0 -1
  367. package/dist/tools/sources/index.js +0 -18
  368. package/dist/tools/sources/index.js.map +0 -1
  369. package/dist/tools/sources.d.ts +0 -14
  370. package/dist/tools/sources.d.ts.map +0 -1
  371. package/dist/tools/sources.js +0 -14
  372. package/dist/tools/sources.js.map +0 -1
  373. package/dist/tools/sparse-fields.d.ts +0 -80
  374. package/dist/tools/sparse-fields.d.ts.map +0 -1
  375. package/dist/tools/sparse-fields.js +0 -144
  376. package/dist/tools/sparse-fields.js.map +0 -1
  377. package/dist/tools/tool-builder/annotations.d.ts +0 -55
  378. package/dist/tools/tool-builder/annotations.d.ts.map +0 -1
  379. package/dist/tools/tool-builder/annotations.js +0 -86
  380. package/dist/tools/tool-builder/annotations.js.map +0 -1
  381. package/dist/tools/tool-builder/define.d.ts +0 -31
  382. package/dist/tools/tool-builder/define.d.ts.map +0 -1
  383. package/dist/tools/tool-builder/define.js +0 -31
  384. package/dist/tools/tool-builder/define.js.map +0 -1
  385. package/dist/tools/tool-builder/index.d.ts +0 -28
  386. package/dist/tools/tool-builder/index.d.ts.map +0 -1
  387. package/dist/tools/tool-builder/index.js +0 -27
  388. package/dist/tools/tool-builder/index.js.map +0 -1
  389. package/dist/tools/tool-builder/results.d.ts +0 -93
  390. package/dist/tools/tool-builder/results.d.ts.map +0 -1
  391. package/dist/tools/tool-builder/results.js +0 -211
  392. package/dist/tools/tool-builder/results.js.map +0 -1
  393. package/dist/tools/tool-builder/types.d.ts +0 -82
  394. package/dist/tools/tool-builder/types.d.ts.map +0 -1
  395. package/dist/tools/tool-builder/types.js +0 -9
  396. package/dist/tools/tool-builder/types.js.map +0 -1
  397. package/dist/tools/tool-builder.d.ts +0 -16
  398. package/dist/tools/tool-builder.d.ts.map +0 -1
  399. package/dist/tools/tool-builder.js +0 -16
  400. package/dist/tools/tool-builder.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-support.d.ts","sourceRoot":"","sources":["../../src/gateway/test-support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,sEAAsE;AACtE,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,CACL,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,CAAC,EAAE,OAAO,KACd,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAkBD;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACrC,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,eAAe,GAC3B,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAuC/B;AAED,6DAA6D;AAC7D,wBAAgB,QAAQ,CACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACpC,IAAI,EAAE,MAAM,GACb,aAAa,GAAG,SAAS,CAE3B"}
@@ -1,60 +0,0 @@
1
- /**
2
- * Gateway test helpers — Wave G.1.
3
- *
4
- * After the gateway lands, tests that previously looked tools up from
5
- * `McpServer._registeredTools` no longer find advanced tools (they're
6
- * captured in the advanced registry, not on the real server). These
7
- * helpers expose a unified view across all three lanes:
8
- *
9
- * - L1 essentials → real server's `_registeredTools`
10
- * - L2 advanced → CapturingServer's `getAdvancedRegistry()`
11
- * - L3 + gateway → real server's `_registeredTools`
12
- *
13
- * Test-only: never imported by any runtime path.
14
- *
15
- * @license MIT
16
- */
17
- /**
18
- * Returns every tool — essentials + gateway on the real McpServer plus
19
- * the advanced tools captured by the CapturingServer — keyed by tool
20
- * name. The CapturingServer must have been used to register the L1/L2
21
- * tools, and `registerAdvancedTool` must have run, before this is called.
22
- *
23
- * Production size = 22:
24
- * 7 L1 essentials (real server) + 12 L2 advanced (registry)
25
- * + 2 L3 direct (real server) + 1 gateway (real server) = 22.
26
- */
27
- export function collectAllRegisteredTools(server, capturing) {
28
- const result = {};
29
- // The SDK changed the internal field name from `handler` to `callback`
30
- // over its 1.x lifetime; accept either to keep the helper resilient.
31
- const real = server;
32
- for (const [name, tool] of Object.entries(real._registeredTools)) {
33
- const callback = 'callback' in tool && typeof tool.callback === 'function'
34
- ? tool.callback
35
- : tool.handler;
36
- result[name] = {
37
- handler: callback,
38
- title: tool.title,
39
- description: tool.description,
40
- inputSchema: tool.inputSchema,
41
- annotations: tool.annotations,
42
- };
43
- }
44
- for (const [name, entry] of capturing.getAdvancedRegistry()) {
45
- const cfg = entry.config;
46
- result[name] = {
47
- handler: entry.handler,
48
- title: cfg.title,
49
- description: cfg.description,
50
- inputSchema: cfg.inputSchema,
51
- annotations: cfg.annotations,
52
- };
53
- }
54
- return result;
55
- }
56
- /** By-name lookup over a `collectAllRegisteredTools` map. */
57
- export function findTool(tools, name) {
58
- return tools[name];
59
- }
60
- //# sourceMappingURL=test-support.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-support.js","sourceRoot":"","sources":["../../src/gateway/test-support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAmCH;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CACrC,MAAiB,EACjB,SAA0B;IAE1B,MAAM,MAAM,GAAkC,EAAE,CAAC;IAEjD,uEAAuE;IACvE,qEAAqE;IACrE,MAAM,IAAI,GAAG,MAEZ,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC/D,MAAM,QAAQ,GACV,UAAU,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,UAAU;YACrD,CAAC,CAAC,IAAI,CAAC,QAAQ;YACf,CAAC,CAAE,IAAiC,CAAC,OAAO,CAAC;QACrD,MAAM,CAAC,IAAI,CAAC,GAAG;YACX,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;SAChC,CAAC;IACN,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,SAAS,CAAC,mBAAmB,EAAE,EAAE,CAAC;QAC1D,MAAM,GAAG,GAAG,KAAK,CAAC,MAKjB,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,GAAG;YACX,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,WAAW,EAAE,GAAG,CAAC,WAAW;SAC/B,CAAC;IACN,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,QAAQ,CACpB,KAAoC,EACpC,IAAY;IAEZ,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,29 +0,0 @@
1
- /**
2
- * MCP server entrypoint (stdio transport).
3
- *
4
- * Reads config from environment variables (see `auth.ts`), spins up a
5
- * `McpServer` with all tools registered, connects to stdio, and lets
6
- * the host (Claude Desktop / Cursor / Zed / …) drive.
7
- *
8
- * `YTB_MCP_TEST_MODE=1` short-circuits: prints the tool registry and
9
- * exits 0. Used by the smoke test and by `release.php` to validate
10
- * that the bundled `dist/` is loadable on the target Node version.
11
- *
12
- * @license MIT
13
- */
14
- export { createServer, SERVER_NAME, SERVER_VERSION } from './server.js';
15
- export { RestClient, REST_NAMESPACE_PATH, encodeElementPath } from './client.js';
16
- export { loadConfig, loadRegistry, isTestMode, ENV_SITE_URL, ENV_WP_URL, ENV_BEARER, ENV_SITES_FILE, ENV_TEST_MODE, } from './auth.js';
17
- export { ConfigError, RestError, NetworkError } from './errors.js';
18
- export { buildAllTools } from './tools/index.js';
19
- export { ClientPool, NoDefaultSiteError, UnknownSiteError } from './sites/client-pool.js';
20
- export { SiteRegistry } from './sites/registry.js';
21
- export { synthesiseFromEnv } from './sites/env-bridge.js';
22
- export { defaultSecretResolver, PlainSecretResolver } from './sites/secret-resolver.js';
23
- export { ESSENTIAL_TOOLS, DIRECT_TOP_LEVEL_TOOLS, isEssential, isDirectTopLevel, } from './gateway/essentials.js';
24
- export { CapturingServer, type AdvancedToolEntry, type CapturedToolHandler, type ToolRegistrar, } from './gateway/capturing-server.js';
25
- export { registerAdvancedTool } from './gateway/advanced-tool.js';
26
- export { collectAllRegisteredTools, findTool, type CollectedTool, } from './gateway/test-support.js';
27
- declare function main(): Promise<void>;
28
- export { main };
29
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAWH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EACH,UAAU,EACV,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,cAAc,EACd,aAAa,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EACH,eAAe,EACf,sBAAsB,EACtB,WAAW,EACX,gBAAgB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,aAAa,GACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACH,yBAAyB,EACzB,QAAQ,EACR,KAAK,aAAa,GACrB,MAAM,2BAA2B,CAAC;AAEnC,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAkEnC;AAkBD,OAAO,EAAE,IAAI,EAAE,CAAC"}
package/dist/index.js DELETED
@@ -1,113 +0,0 @@
1
- /**
2
- * MCP server entrypoint (stdio transport).
3
- *
4
- * Reads config from environment variables (see `auth.ts`), spins up a
5
- * `McpServer` with all tools registered, connects to stdio, and lets
6
- * the host (Claude Desktop / Cursor / Zed / …) drive.
7
- *
8
- * `YTB_MCP_TEST_MODE=1` short-circuits: prints the tool registry and
9
- * exits 0. Used by the smoke test and by `release.php` to validate
10
- * that the bundled `dist/` is loadable on the target Node version.
11
- *
12
- * @license MIT
13
- */
14
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
15
- import { isTestMode, loadConfig, loadRegistry } from './auth.js';
16
- import { ConfigError } from './errors.js';
17
- import { ClientPool } from './sites/client-pool.js';
18
- import { SiteRegistry } from './sites/registry.js';
19
- import { defaultSecretResolver } from './sites/secret-resolver.js';
20
- import { createServer } from './server.js';
21
- export { createServer, SERVER_NAME, SERVER_VERSION } from './server.js';
22
- export { RestClient, REST_NAMESPACE_PATH, encodeElementPath } from './client.js';
23
- export { loadConfig, loadRegistry, isTestMode, ENV_SITE_URL, ENV_WP_URL, ENV_BEARER, ENV_SITES_FILE, ENV_TEST_MODE, } from './auth.js';
24
- export { ConfigError, RestError, NetworkError } from './errors.js';
25
- export { buildAllTools } from './tools/index.js';
26
- // W6 — multi-site primitives exported for dist consumers (scripts,
27
- // embedded uses). The `ClientPool` is the new wiring contract.
28
- export { ClientPool, NoDefaultSiteError, UnknownSiteError } from './sites/client-pool.js';
29
- export { SiteRegistry } from './sites/registry.js';
30
- export { synthesiseFromEnv } from './sites/env-bridge.js';
31
- export { defaultSecretResolver, PlainSecretResolver } from './sites/secret-resolver.js';
32
- export { ESSENTIAL_TOOLS, DIRECT_TOP_LEVEL_TOOLS, isEssential, isDirectTopLevel, } from './gateway/essentials.js';
33
- export { CapturingServer, } from './gateway/capturing-server.js';
34
- export { registerAdvancedTool } from './gateway/advanced-tool.js';
35
- export { collectAllRegisteredTools, findTool, } from './gateway/test-support.js';
36
- async function main() {
37
- const testMode = isTestMode();
38
- // W10 — multi-site bootstrap is now centralised in
39
- // `auth.loadRegistry()`. The canonical resolution order is:
40
- // 1. YTB_MCP_SITES_FILE → loadSitesFile + SiteRegistry
41
- // 2. env-bridge (YTB_MCP_SITE_URL + YTB_MCP_BEARER_TOKEN)
42
- // 3. ConfigError("No sites configured.")
43
- //
44
- // The single exception lives here: `--test-mode` smoke probes
45
- // (release.php, CI tool-list dumps) must boot even when neither
46
- // path is configured. We honor loadRegistry first, then trap the
47
- // ConfigError in test-mode and synthesise an empty registry so the
48
- // tool list still prints. Tools will refuse to run, which is
49
- // expected — `--test-mode` never invokes them.
50
- let registry;
51
- try {
52
- registry = await loadRegistry();
53
- }
54
- catch (e) {
55
- if (testMode && e instanceof ConfigError) {
56
- // Mirror legacy test-mode behaviour: try loadConfig with
57
- // the back-compat permissive flag so the print-tools probe
58
- // still boots even with no sites at all. If loadConfig
59
- // *also* throws, surface the more specific message.
60
- try {
61
- loadConfig({ allowMissingToken: true });
62
- }
63
- catch (cfgErr) {
64
- if (cfgErr instanceof ConfigError) {
65
- process.stderr.write(`[yt-builder-mcp] ${cfgErr.message}\n`);
66
- process.exit(1);
67
- }
68
- throw cfgErr;
69
- }
70
- registry = new SiteRegistry({
71
- schema_version: 1,
72
- default_site_id: null,
73
- sites: [],
74
- });
75
- }
76
- else {
77
- const msg = e instanceof Error ? e.message : String(e);
78
- process.stderr.write(`[yt-builder-mcp] ${msg}\n`);
79
- process.exit(1);
80
- }
81
- }
82
- const secretResolver = defaultSecretResolver();
83
- const pool = new ClientPool(registry, secretResolver);
84
- const { mcp, tools } = createServer({ pool });
85
- if (testMode) {
86
- // Print a one-line per tool summary to stderr (stdout is reserved
87
- // for the JSON-RPC frame in real runs) and exit cleanly.
88
- process.stderr.write(`[yt-builder-mcp] test mode — ${String(tools.length)} tools registered:\n`);
89
- for (const tool of tools) {
90
- process.stderr.write(` - ${tool.name}\n`);
91
- }
92
- process.exit(0);
93
- }
94
- const transport = new StdioServerTransport();
95
- await mcp.connect(transport);
96
- }
97
- /**
98
- * Auto-run unless explicitly disabled. Tests set `YTB_MCP_NO_AUTORUN=1`
99
- * to import the module without firing up the stdio server.
100
- *
101
- * The bin dispatcher (`bin/yt-builder-mcp.js`) imports
102
- * `dist/index.js` dynamically and expects `main()` to take over — so by
103
- * default we run on import.
104
- */
105
- if (process.env.YTB_MCP_NO_AUTORUN !== '1') {
106
- main().catch((e) => {
107
- const message = e instanceof Error ? e.message : String(e);
108
- process.stderr.write(`[yt-builder-mcp] fatal: ${message}\n`);
109
- process.exit(1);
110
- });
111
- }
112
- export { main };
113
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EACH,UAAU,EACV,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,cAAc,EACd,aAAa,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,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G,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;;GAOG;AACH,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,GAAG,EAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;QACxB,MAAM,OAAO,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC3D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,OAAO,IAAI,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACP,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"}
@@ -1,43 +0,0 @@
1
- /**
2
- * `install-skill` subcommand for `@wootsup/yt-builder-mcp`.
3
- *
4
- * Copies the bundled `skills/yt-builder-mcp/` directory into the user's
5
- * agent-skill folder (typically `~/.claude/skills/`) and appends a marker
6
- * block to `~/AGENTS.md` so other AI clients pick it up automatically.
7
- *
8
- * Idempotent: re-running overwrites existing skill files and skips the
9
- * AGENTS.md append when the marker is already present.
10
- *
11
- * Mirrors the pattern from `@wootsup/mcp install-skill` so users on both
12
- * products get the same workflow.
13
- *
14
- * @license MIT
15
- */
16
- export declare const MARKER_LINE = "<!-- yt-builder-mcp:skill-installed -->";
17
- export interface InstallSkillOptions {
18
- /**
19
- * Package root that contains the bundled `skills/` dir. Defaults to
20
- * walking up from this file (works in both source and `dist/` layouts).
21
- */
22
- readonly pkgRoot?: string;
23
- /** Target dir where the `yt-builder-mcp/` skill folder will land. */
24
- readonly targetSkillsDir?: string;
25
- /**
26
- * 1.0.1 Wave-R: when `true` (default), the installer removes any
27
- * legacy `yootheme-builder/` directory left behind by pre-1.0.1
28
- * installs so the user doesn't end up with two side-by-side skill
29
- * copies under the same `~/.claude/skills/` root. Set to `false` to
30
- * keep the legacy dir.
31
- */
32
- readonly removeLegacyDir?: boolean;
33
- /** Target AGENTS.md file to append the marker to. */
34
- readonly targetAgentsFile?: string;
35
- }
36
- export interface InstallSkillResult {
37
- readonly copied: boolean;
38
- readonly markerAlreadyPresent: boolean;
39
- readonly skillTargetDir: string;
40
- readonly agentsFile: string;
41
- }
42
- export declare function installSkill(options?: InstallSkillOptions): Promise<InstallSkillResult>;
43
- //# sourceMappingURL=install-skill.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install-skill.d.ts","sourceRoot":"","sources":["../src/install-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,eAAO,MAAM,WAAW,4CAA4C,CAAC;AAiBrE,MAAM,WAAW,mBAAmB;IAChC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,qDAAqD;IACrD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC/B;AAwCD,wBAAsB,YAAY,CAC9B,OAAO,GAAE,mBAAwB,GAClC,OAAO,CAAC,kBAAkB,CAAC,CAmD7B"}
@@ -1,118 +0,0 @@
1
- /**
2
- * `install-skill` subcommand for `@wootsup/yt-builder-mcp`.
3
- *
4
- * Copies the bundled `skills/yt-builder-mcp/` directory into the user's
5
- * agent-skill folder (typically `~/.claude/skills/`) and appends a marker
6
- * block to `~/AGENTS.md` so other AI clients pick it up automatically.
7
- *
8
- * Idempotent: re-running overwrites existing skill files and skips the
9
- * AGENTS.md append when the marker is already present.
10
- *
11
- * Mirrors the pattern from `@wootsup/mcp install-skill` so users on both
12
- * products get the same workflow.
13
- *
14
- * @license MIT
15
- */
16
- import { appendFileSync, copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, } from 'node:fs';
17
- import { homedir } from 'node:os';
18
- import { dirname, join, resolve } from 'node:path';
19
- import { fileURLToPath } from 'node:url';
20
- export const MARKER_LINE = '<!-- yt-builder-mcp:skill-installed -->';
21
- const MARKER_BLOCK = `
22
-
23
- ## YT Builder MCP
24
-
25
- ${MARKER_LINE}
26
- The YT Builder MCP skill is installed at \`~/.claude/skills/yt-builder-mcp/\`
27
- — the universal-marker path recognised by Claude Desktop and other AI
28
- clients that follow the \`~/AGENTS.md\` discovery protocol.
29
-
30
- It documents the 24 MCP tools (23 domain + 1 gateway, 11 entries in
31
- \`tools/list\`), the 5 canonical workflows (build hero, bind dynamic
32
- source, clone section, diagnose 401, add custom element), and the
33
- gateway routing model. Source: https://github.com/wootsup/yt-builder-mcp.
34
- `;
35
- function defaultPkgRoot() {
36
- // src/install-skill.ts → pkg root is one level up.
37
- // When running from dist/install-skill.js the layout is identical
38
- // (TypeScript emits `dist/install-skill.js` mirroring `src/`).
39
- const here = dirname(fileURLToPath(import.meta.url));
40
- return resolve(here, '..');
41
- }
42
- function copyDirRecursive(src, dst) {
43
- if (!existsSync(dst))
44
- mkdirSync(dst, { recursive: true });
45
- for (const entry of readdirSync(src)) {
46
- const sPath = join(src, entry);
47
- const dPath = join(dst, entry);
48
- const stat = statSync(sPath);
49
- if (stat.isDirectory()) {
50
- copyDirRecursive(sPath, dPath);
51
- }
52
- else {
53
- copyFileSync(sPath, dPath);
54
- }
55
- }
56
- }
57
- /**
58
- * Locate the bundled `skills/yt-builder-mcp` directory.
59
- *
60
- * Production layout: the skill folder is bundled INSIDE the npm package
61
- * (`packages/mcp/skills/yt-builder-mcp/`), next to `dist/`. The same
62
- * layout exists in the source tree (per Design-Doc §13.1) so source-mode
63
- * smoke tests and the published tarball use the same single path.
64
- *
65
- * Earlier drafts walked `../..` up to a monorepo-root `skills/` dir;
66
- * that layout was eliminated in Round-1 audit fix C1 because it produced
67
- * a tarball without `skills/` (skill-not-found at first run).
68
- */
69
- function findSkillSource(pkgRoot) {
70
- return join(pkgRoot, 'skills', 'yt-builder-mcp');
71
- }
72
- export async function installSkill(options = {}) {
73
- const pkgRoot = options.pkgRoot ?? defaultPkgRoot();
74
- const targetSkillsDir = options.targetSkillsDir ?? join(homedir(), '.claude', 'skills');
75
- const targetAgentsFile = options.targetAgentsFile ?? join(homedir(), 'AGENTS.md');
76
- const srcSkillDir = findSkillSource(pkgRoot);
77
- if (!existsSync(srcSkillDir)) {
78
- throw new Error(`Bundled skill not found at ${srcSkillDir}. ` +
79
- `Is the package installed correctly? (pkgRoot=${pkgRoot})`);
80
- }
81
- if (!existsSync(targetSkillsDir)) {
82
- mkdirSync(targetSkillsDir, { recursive: true });
83
- }
84
- const skillTargetDir = join(targetSkillsDir, 'yt-builder-mcp');
85
- copyDirRecursive(srcSkillDir, skillTargetDir);
86
- // 1.0.1 Wave-R: clean up the legacy directory created by pre-1.0.1
87
- // installs so the user doesn't end up with two side-by-side skill
88
- // copies (`yootheme-builder/` AND `yt-builder-mcp/`) under the same
89
- // `~/.claude/skills/` root.
90
- const removeLegacy = options.removeLegacyDir ?? true;
91
- if (removeLegacy) {
92
- const legacyDir = join(targetSkillsDir, 'yootheme-builder');
93
- if (existsSync(legacyDir) && legacyDir !== skillTargetDir) {
94
- rmSync(legacyDir, { recursive: true, force: true });
95
- }
96
- }
97
- let markerAlreadyPresent = false;
98
- if (existsSync(targetAgentsFile)) {
99
- const existing = readFileSync(targetAgentsFile, 'utf-8');
100
- if (existing.includes(MARKER_LINE)) {
101
- markerAlreadyPresent = true;
102
- }
103
- else {
104
- appendFileSync(targetAgentsFile, MARKER_BLOCK);
105
- }
106
- }
107
- else {
108
- // Create with a sensible top-line and the marker block (trimmed).
109
- writeFileSync(targetAgentsFile, MARKER_BLOCK.trimStart(), 'utf-8');
110
- }
111
- return {
112
- copied: true,
113
- markerAlreadyPresent,
114
- skillTargetDir,
115
- agentsFile: targetAgentsFile,
116
- };
117
- }
118
- //# sourceMappingURL=install-skill.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install-skill.js","sourceRoot":"","sources":["../src/install-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACH,cAAc,EACd,YAAY,EACZ,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,aAAa,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,yCAAyC,CAAC;AAErE,MAAM,YAAY,GAAG;;;;EAInB,WAAW;;;;;;;;;CASZ,CAAC;AA6BF,SAAS,cAAc;IACnB,mDAAmD;IACnD,kEAAkE;IAClE,+DAA+D;IAC/D,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACrD,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAW,EAAE,GAAW;IAC9C,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,KAAK,GAA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EAAE,gBAAgB,CAAC,CAAC;IAC/D,gBAAgB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAE9C,mEAAmE;IACnE,kEAAkE;IAClE,oEAAoE;IACpE,4BAA4B;IAC5B,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,IAAI,IAAI,CAAC;IACrD,IAAI,YAAY,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC;QAC5D,IAAI,UAAU,CAAC,SAAS,CAAC,IAAI,SAAS,KAAK,cAAc,EAAE,CAAC;YACxD,MAAM,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;IAED,IAAI,oBAAoB,GAAG,KAAK,CAAC;IACjC,IAAI,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC/B,MAAM,QAAQ,GAAG,YAAY,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;QACzD,IAAI,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YACjC,oBAAoB,GAAG,IAAI,CAAC;QAChC,CAAC;aAAM,CAAC;YACJ,cAAc,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,kEAAkE;QAClE,aAAa,CAAC,gBAAgB,EAAE,YAAY,CAAC,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;IAED,OAAO;QACH,MAAM,EAAE,IAAI;QACZ,oBAAoB;QACpB,cAAc;QACd,UAAU,EAAE,gBAAgB;KAC/B,CAAC;AACN,CAAC"}
@@ -1,64 +0,0 @@
1
- /**
2
- * Runtime platform detection — F-Platform-Detect-Probe (P0 customer fix).
3
- *
4
- * The static URL-shape heuristic in `detectPlatformFromUrl()` only works
5
- * when the user-supplied base URL already carries `/wp-json/` or
6
- * `/api/index.php/` in its path. That is RARELY the case in practice —
7
- * the DXT/manifest tells the user to enter the **site origin** (or a
8
- * subfolder install like `https://dev.example.com/joomla`), neither of
9
- * which contains those markers. The heuristic then silently falls back
10
- * to the WordPress default and the Joomla customer experiences a
11
- * 24/24 FAIL until they manually set `YTB_MCP_PLATFORM=joomla`.
12
- *
13
- * This module adds a *runtime probe*: lightweight unauthenticated GETs
14
- * against both platforms' `/health` endpoints. Whichever returns a
15
- * yt-builder-mcp-shaped response (a JSON body carrying `plugin_version`)
16
- * wins. Joomla is probed first because the negative case (probe fails)
17
- * is the long-tail and the positive case (probe succeeds) returns fast
18
- * — letting the more common WordPress install just fall through to the
19
- * second probe without paying for a wasted full timeout.
20
- *
21
- * The probe is fire-and-forget safe:
22
- * - 3 s `AbortSignal.timeout` per request (so a totally broken host
23
- * blocks ~6 s worst case, not the request's full 15 s default).
24
- * - Non-200 responses are ignored (Joomla on a WP-only install
25
- * answers 404; that's fine).
26
- * - Non-JSON / wrong-shape 200 responses are ignored (a WP frontend
27
- * without the plugin renders the homepage HTML, which `JSON.parse`
28
- * refuses — handled).
29
- * - Any thrown error (DNS, TLS, abort) is swallowed → try next.
30
- *
31
- * The function returns `null` when BOTH probes fail; the caller then
32
- * falls back to the URL-shape heuristic or the wordpress default. We do
33
- * NOT throw, because a missing-plugin or wrong-URL diagnosis belongs to
34
- * the first real authenticated request — not to silent boot-time probing.
35
- *
36
- * @license MIT
37
- */
38
- import { type PlatformKind } from './index.js';
39
- /**
40
- * Minimal fetch type so callers (and tests) can inject a stub without
41
- * pulling DOM types. Matches the global `fetch` contract we actually use.
42
- */
43
- export type ProbeFetch = (input: string, init?: {
44
- signal?: AbortSignal;
45
- }) => Promise<Response>;
46
- export interface DetectPlatformAtRuntimeOptions {
47
- /** Override the per-probe timeout (ms). Default 3000. */
48
- readonly timeoutMs?: number;
49
- /** Injectable fetch (tests). Defaults to the global `fetch`. */
50
- readonly fetchImpl?: ProbeFetch;
51
- }
52
- /**
53
- * Probe both platforms' health endpoints and return the first kind that
54
- * answers with a yt-builder-mcp-shaped JSON payload. Returns `null`
55
- * when neither responds usefully (so the caller can fall through to the
56
- * URL-shape heuristic / default).
57
- *
58
- * NB: `baseUrl` is taken verbatim except for trimming trailing slashes.
59
- * If `baseUrl` itself carries a path component (e.g. subfolder install
60
- * `https://dev.example.com/joomla`) we preserve it — that path is where
61
- * Joomla's `/api/index.php/...` is rooted.
62
- */
63
- export declare function detectPlatformAtRuntime(baseUrl: string, options?: DetectPlatformAtRuntimeOptions): Promise<PlatformKind | null>;
64
- //# sourceMappingURL=detect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/platform/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAGH,KAAK,YAAY,EACpB,MAAM,YAAY,CAAC;AAKpB;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,CACrB,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,KAC9B,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB,MAAM,WAAW,8BAA8B;IAC3C,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,gEAAgE;IAChE,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC;CACnC;AAaD;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,8BAAmC,GAC7C,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAgB9B"}
@@ -1,98 +0,0 @@
1
- /**
2
- * Runtime platform detection — F-Platform-Detect-Probe (P0 customer fix).
3
- *
4
- * The static URL-shape heuristic in `detectPlatformFromUrl()` only works
5
- * when the user-supplied base URL already carries `/wp-json/` or
6
- * `/api/index.php/` in its path. That is RARELY the case in practice —
7
- * the DXT/manifest tells the user to enter the **site origin** (or a
8
- * subfolder install like `https://dev.example.com/joomla`), neither of
9
- * which contains those markers. The heuristic then silently falls back
10
- * to the WordPress default and the Joomla customer experiences a
11
- * 24/24 FAIL until they manually set `YTB_MCP_PLATFORM=joomla`.
12
- *
13
- * This module adds a *runtime probe*: lightweight unauthenticated GETs
14
- * against both platforms' `/health` endpoints. Whichever returns a
15
- * yt-builder-mcp-shaped response (a JSON body carrying `plugin_version`)
16
- * wins. Joomla is probed first because the negative case (probe fails)
17
- * is the long-tail and the positive case (probe succeeds) returns fast
18
- * — letting the more common WordPress install just fall through to the
19
- * second probe without paying for a wasted full timeout.
20
- *
21
- * The probe is fire-and-forget safe:
22
- * - 3 s `AbortSignal.timeout` per request (so a totally broken host
23
- * blocks ~6 s worst case, not the request's full 15 s default).
24
- * - Non-200 responses are ignored (Joomla on a WP-only install
25
- * answers 404; that's fine).
26
- * - Non-JSON / wrong-shape 200 responses are ignored (a WP frontend
27
- * without the plugin renders the homepage HTML, which `JSON.parse`
28
- * refuses — handled).
29
- * - Any thrown error (DNS, TLS, abort) is swallowed → try next.
30
- *
31
- * The function returns `null` when BOTH probes fail; the caller then
32
- * falls back to the URL-shape heuristic or the wordpress default. We do
33
- * NOT throw, because a missing-plugin or wrong-URL diagnosis belongs to
34
- * the first real authenticated request — not to silent boot-time probing.
35
- *
36
- * @license MIT
37
- */
38
- import { JOOMLA_REST_NAMESPACE_PATH, WORDPRESS_REST_NAMESPACE_PATH, } from './index.js';
39
- /** Per-probe HTTP timeout. Keep tight — boot-time UX is on the line. */
40
- const PROBE_TIMEOUT_MS = 3_000;
41
- const PROBE_CANDIDATES = [
42
- // Joomla first — see module header rationale.
43
- { kind: 'joomla', path: `${JOOMLA_REST_NAMESPACE_PATH}/health` },
44
- { kind: 'wordpress', path: `${WORDPRESS_REST_NAMESPACE_PATH}/health` },
45
- ];
46
- /**
47
- * Probe both platforms' health endpoints and return the first kind that
48
- * answers with a yt-builder-mcp-shaped JSON payload. Returns `null`
49
- * when neither responds usefully (so the caller can fall through to the
50
- * URL-shape heuristic / default).
51
- *
52
- * NB: `baseUrl` is taken verbatim except for trimming trailing slashes.
53
- * If `baseUrl` itself carries a path component (e.g. subfolder install
54
- * `https://dev.example.com/joomla`) we preserve it — that path is where
55
- * Joomla's `/api/index.php/...` is rooted.
56
- */
57
- export async function detectPlatformAtRuntime(baseUrl, options = {}) {
58
- const timeoutMs = options.timeoutMs ?? PROBE_TIMEOUT_MS;
59
- const fetchImpl = options.fetchImpl ?? globalThis.fetch;
60
- if (typeof fetchImpl !== 'function')
61
- return null;
62
- const trimmed = baseUrl.replace(/\/+$/, '');
63
- for (const { kind, path } of PROBE_CANDIDATES) {
64
- const matched = await probeOne(trimmed + path, timeoutMs, fetchImpl);
65
- if (matched)
66
- return kind;
67
- }
68
- return null;
69
- }
70
- async function probeOne(url, timeoutMs, fetchImpl) {
71
- try {
72
- const signal = AbortSignal.timeout(timeoutMs);
73
- const r = await fetchImpl(url, { signal });
74
- if (!r.ok)
75
- return false;
76
- // Some hosts answer JSON with `text/html` Content-Type; don't
77
- // rely on the header. Parse defensively.
78
- const text = await r.text();
79
- let body;
80
- try {
81
- body = JSON.parse(text);
82
- }
83
- catch {
84
- return false;
85
- }
86
- return isYtbHealthShape(body);
87
- }
88
- catch {
89
- return false;
90
- }
91
- }
92
- /** Recognises a yt-builder-mcp `/health` response. */
93
- function isYtbHealthShape(body) {
94
- return (typeof body === 'object'
95
- && body !== null
96
- && 'plugin_version' in body);
97
- }
98
- //# sourceMappingURL=detect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detect.js","sourceRoot":"","sources":["../../src/platform/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACH,0BAA0B,EAC1B,6BAA6B,GAEhC,MAAM,YAAY,CAAC;AAEpB,wEAAwE;AACxE,MAAM,gBAAgB,GAAG,KAAK,CAA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