@wootsup/yt-builder-mcp 1.1.6 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/README.md +7 -7
  2. package/bin/yt-builder-mcp.js +55 -40
  3. package/dist/auth.d.ts +137 -0
  4. package/dist/auth.d.ts.map +1 -0
  5. package/dist/auth.js +244 -0
  6. package/dist/auth.js.map +1 -0
  7. package/dist/cli/invocation-decision.d.ts +57 -0
  8. package/dist/cli/invocation-decision.d.ts.map +1 -0
  9. package/dist/cli/invocation-decision.js +86 -0
  10. package/dist/cli/invocation-decision.js.map +1 -0
  11. package/dist/client.d.ts +112 -0
  12. package/dist/client.d.ts.map +1 -0
  13. package/dist/client.js +190 -0
  14. package/dist/client.js.map +1 -0
  15. package/dist/clients/claude-code.d.ts +18 -0
  16. package/dist/clients/claude-code.d.ts.map +1 -0
  17. package/dist/clients/claude-code.js +55 -0
  18. package/dist/clients/claude-code.js.map +1 -0
  19. package/dist/clients/claude-desktop.d.ts +19 -0
  20. package/dist/clients/claude-desktop.d.ts.map +1 -0
  21. package/dist/clients/claude-desktop.js +58 -0
  22. package/dist/clients/claude-desktop.js.map +1 -0
  23. package/dist/clients/cline.d.ts +26 -0
  24. package/dist/clients/cline.d.ts.map +1 -0
  25. package/dist/clients/cline.js +82 -0
  26. package/dist/clients/cline.js.map +1 -0
  27. package/dist/clients/codex-cli.d.ts +42 -0
  28. package/dist/clients/codex-cli.d.ts.map +1 -0
  29. package/dist/clients/codex-cli.js +292 -0
  30. package/dist/clients/codex-cli.js.map +1 -0
  31. package/dist/clients/continue.d.ts +13 -0
  32. package/dist/clients/continue.d.ts.map +1 -0
  33. package/dist/clients/continue.js +121 -0
  34. package/dist/clients/continue.js.map +1 -0
  35. package/dist/clients/cursor.d.ts +12 -0
  36. package/dist/clients/cursor.d.ts.map +1 -0
  37. package/dist/clients/cursor.js +40 -0
  38. package/dist/clients/cursor.js.map +1 -0
  39. package/dist/clients/gemini-cli.d.ts +18 -0
  40. package/dist/clients/gemini-cli.d.ts.map +1 -0
  41. package/dist/clients/gemini-cli.js +46 -0
  42. package/dist/clients/gemini-cli.js.map +1 -0
  43. package/dist/clients/home.d.ts +14 -0
  44. package/dist/clients/home.d.ts.map +1 -0
  45. package/dist/clients/home.js +20 -0
  46. package/dist/clients/home.js.map +1 -0
  47. package/dist/clients/index.d.ts +156 -0
  48. package/dist/clients/index.d.ts.map +1 -0
  49. package/dist/clients/index.js +213 -0
  50. package/dist/clients/index.js.map +1 -0
  51. package/dist/clients/roo-code.d.ts +23 -0
  52. package/dist/clients/roo-code.d.ts.map +1 -0
  53. package/dist/clients/roo-code.js +71 -0
  54. package/dist/clients/roo-code.js.map +1 -0
  55. package/dist/clients/zed.d.ts +12 -0
  56. package/dist/clients/zed.d.ts.map +1 -0
  57. package/dist/clients/zed.js +43 -0
  58. package/dist/clients/zed.js.map +1 -0
  59. package/dist/errors/hints.d.ts +51 -0
  60. package/dist/errors/hints.d.ts.map +1 -0
  61. package/dist/errors/hints.js +95 -0
  62. package/dist/errors/hints.js.map +1 -0
  63. package/dist/errors/mask.d.ts +35 -0
  64. package/dist/errors/mask.d.ts.map +1 -0
  65. package/dist/errors/mask.js +49 -0
  66. package/dist/errors/mask.js.map +1 -0
  67. package/dist/errors/sanitize.d.ts +31 -0
  68. package/dist/errors/sanitize.d.ts.map +1 -0
  69. package/dist/errors/sanitize.js +100 -0
  70. package/dist/errors/sanitize.js.map +1 -0
  71. package/dist/errors.d.ts +42 -0
  72. package/dist/errors.d.ts.map +1 -0
  73. package/dist/errors.js +61 -0
  74. package/dist/errors.js.map +1 -0
  75. package/dist/gateway/advanced-tool/discovery.d.ts +19 -0
  76. package/dist/gateway/advanced-tool/discovery.d.ts.map +1 -0
  77. package/dist/gateway/advanced-tool/discovery.js +53 -0
  78. package/dist/gateway/advanced-tool/discovery.js.map +1 -0
  79. package/dist/gateway/advanced-tool/domains.d.ts +47 -0
  80. package/dist/gateway/advanced-tool/domains.d.ts.map +1 -0
  81. package/dist/gateway/advanced-tool/domains.js +94 -0
  82. package/dist/gateway/advanced-tool/domains.js.map +1 -0
  83. package/dist/gateway/advanced-tool/execute.d.ts +29 -0
  84. package/dist/gateway/advanced-tool/execute.d.ts.map +1 -0
  85. package/dist/gateway/advanced-tool/execute.js +54 -0
  86. package/dist/gateway/advanced-tool/execute.js.map +1 -0
  87. package/dist/gateway/advanced-tool/index.d.ts +36 -0
  88. package/dist/gateway/advanced-tool/index.d.ts.map +1 -0
  89. package/dist/gateway/advanced-tool/index.js +39 -0
  90. package/dist/gateway/advanced-tool/index.js.map +1 -0
  91. package/dist/gateway/advanced-tool/register.d.ts +18 -0
  92. package/dist/gateway/advanced-tool/register.d.ts.map +1 -0
  93. package/dist/gateway/advanced-tool/register.js +69 -0
  94. package/dist/gateway/advanced-tool/register.js.map +1 -0
  95. package/dist/gateway/advanced-tool.d.ts +13 -0
  96. package/dist/gateway/advanced-tool.d.ts.map +1 -0
  97. package/dist/gateway/advanced-tool.js +13 -0
  98. package/dist/gateway/advanced-tool.js.map +1 -0
  99. package/dist/gateway/capturing-server.d.ts +117 -0
  100. package/dist/gateway/capturing-server.d.ts.map +1 -0
  101. package/dist/gateway/capturing-server.js +103 -0
  102. package/dist/gateway/capturing-server.js.map +1 -0
  103. package/dist/gateway/essentials.d.ts +50 -0
  104. package/dist/gateway/essentials.d.ts.map +1 -0
  105. package/dist/gateway/essentials.js +108 -0
  106. package/dist/gateway/essentials.js.map +1 -0
  107. package/dist/gateway/test-support.d.ts +41 -0
  108. package/dist/gateway/test-support.d.ts.map +1 -0
  109. package/dist/gateway/test-support.js +60 -0
  110. package/dist/gateway/test-support.js.map +1 -0
  111. package/dist/index.d.ts +30 -0
  112. package/dist/index.d.ts.map +1 -0
  113. package/dist/index.js +119 -0
  114. package/dist/index.js.map +1 -0
  115. package/dist/install-skill.d.ts +43 -0
  116. package/dist/install-skill.d.ts.map +1 -0
  117. package/dist/install-skill.js +118 -0
  118. package/dist/install-skill.js.map +1 -0
  119. package/dist/platform/detect.d.ts +64 -0
  120. package/dist/platform/detect.d.ts.map +1 -0
  121. package/dist/platform/detect.js +98 -0
  122. package/dist/platform/detect.js.map +1 -0
  123. package/dist/platform/index.d.ts +121 -0
  124. package/dist/platform/index.d.ts.map +1 -0
  125. package/dist/platform/index.js +176 -0
  126. package/dist/platform/index.js.map +1 -0
  127. package/dist/platform/joomla.d.ts +44 -0
  128. package/dist/platform/joomla.d.ts.map +1 -0
  129. package/dist/platform/joomla.js +46 -0
  130. package/dist/platform/joomla.js.map +1 -0
  131. package/dist/server.d.ts +110 -0
  132. package/dist/server.d.ts.map +1 -0
  133. package/dist/server.js +274 -0
  134. package/dist/server.js.map +1 -0
  135. package/dist/setup-cli-confirm.d.ts +36 -0
  136. package/dist/setup-cli-confirm.d.ts.map +1 -0
  137. package/dist/setup-cli-confirm.js +59 -0
  138. package/dist/setup-cli-confirm.js.map +1 -0
  139. package/dist/setup-cli.d.ts +193 -0
  140. package/dist/setup-cli.d.ts.map +1 -0
  141. package/dist/setup-cli.js +1032 -0
  142. package/dist/setup-cli.js.map +1 -0
  143. package/dist/setup-prompts.d.ts +64 -0
  144. package/dist/setup-prompts.d.ts.map +1 -0
  145. package/dist/setup-prompts.js +221 -0
  146. package/dist/setup-prompts.js.map +1 -0
  147. package/dist/setup-token.d.ts +38 -0
  148. package/dist/setup-token.d.ts.map +1 -0
  149. package/dist/setup-token.js +106 -0
  150. package/dist/setup-token.js.map +1 -0
  151. package/dist/setup-wizard-defaults.d.ts +43 -0
  152. package/dist/setup-wizard-defaults.d.ts.map +1 -0
  153. package/dist/setup-wizard-defaults.js +160 -0
  154. package/dist/setup-wizard-defaults.js.map +1 -0
  155. package/dist/setup-wizard-handshake.d.ts +25 -0
  156. package/dist/setup-wizard-handshake.d.ts.map +1 -0
  157. package/dist/setup-wizard-handshake.js +103 -0
  158. package/dist/setup-wizard-handshake.js.map +1 -0
  159. package/dist/setup-wizard-types.d.ts +164 -0
  160. package/dist/setup-wizard-types.d.ts.map +1 -0
  161. package/dist/setup-wizard-types.js +11 -0
  162. package/dist/setup-wizard-types.js.map +1 -0
  163. package/dist/setup-wizard.d.ts +33 -0
  164. package/dist/setup-wizard.d.ts.map +1 -0
  165. package/dist/setup-wizard.js +199 -0
  166. package/dist/setup-wizard.js.map +1 -0
  167. package/dist/setup.d.ts +17 -0
  168. package/dist/setup.d.ts.map +1 -0
  169. package/dist/setup.js +33 -0
  170. package/dist/setup.js.map +1 -0
  171. package/dist/sites/bootstrap.d.ts +41 -0
  172. package/dist/sites/bootstrap.d.ts.map +1 -0
  173. package/dist/sites/bootstrap.js +58 -0
  174. package/dist/sites/bootstrap.js.map +1 -0
  175. package/dist/sites/cli/add-site.d.ts +106 -0
  176. package/dist/sites/cli/add-site.d.ts.map +1 -0
  177. package/dist/sites/cli/add-site.js +185 -0
  178. package/dist/sites/cli/add-site.js.map +1 -0
  179. package/dist/sites/cli/list-sites.d.ts +40 -0
  180. package/dist/sites/cli/list-sites.d.ts.map +1 -0
  181. package/dist/sites/cli/list-sites.js +116 -0
  182. package/dist/sites/cli/list-sites.js.map +1 -0
  183. package/dist/sites/cli/remove-site.d.ts +60 -0
  184. package/dist/sites/cli/remove-site.d.ts.map +1 -0
  185. package/dist/sites/cli/remove-site.js +120 -0
  186. package/dist/sites/cli/remove-site.js.map +1 -0
  187. package/dist/sites/cli/set-default.d.ts +47 -0
  188. package/dist/sites/cli/set-default.d.ts.map +1 -0
  189. package/dist/sites/cli/set-default.js +69 -0
  190. package/dist/sites/cli/set-default.js.map +1 -0
  191. package/dist/sites/cli/test-site.d.ts +77 -0
  192. package/dist/sites/cli/test-site.d.ts.map +1 -0
  193. package/dist/sites/cli/test-site.js +146 -0
  194. package/dist/sites/cli/test-site.js.map +1 -0
  195. package/dist/sites/client-pool.d.ts +157 -0
  196. package/dist/sites/client-pool.d.ts.map +1 -0
  197. package/dist/sites/client-pool.js +222 -0
  198. package/dist/sites/client-pool.js.map +1 -0
  199. package/dist/sites/env-bridge.d.ts +55 -0
  200. package/dist/sites/env-bridge.d.ts.map +1 -0
  201. package/dist/sites/env-bridge.js +94 -0
  202. package/dist/sites/env-bridge.js.map +1 -0
  203. package/dist/sites/paths.d.ts +21 -0
  204. package/dist/sites/paths.d.ts.map +1 -0
  205. package/dist/sites/paths.js +37 -0
  206. package/dist/sites/paths.js.map +1 -0
  207. package/dist/sites/probe.d.ts +60 -0
  208. package/dist/sites/probe.d.ts.map +1 -0
  209. package/dist/sites/probe.js +112 -0
  210. package/dist/sites/probe.js.map +1 -0
  211. package/dist/sites/registry.d.ts +142 -0
  212. package/dist/sites/registry.d.ts.map +1 -0
  213. package/dist/sites/registry.js +163 -0
  214. package/dist/sites/registry.js.map +1 -0
  215. package/dist/sites/schema.d.ts +90 -0
  216. package/dist/sites/schema.d.ts.map +1 -0
  217. package/dist/sites/schema.js +71 -0
  218. package/dist/sites/schema.js.map +1 -0
  219. package/dist/sites/secret-resolver.d.ts +115 -0
  220. package/dist/sites/secret-resolver.d.ts.map +1 -0
  221. package/dist/sites/secret-resolver.js +225 -0
  222. package/dist/sites/secret-resolver.js.map +1 -0
  223. package/dist/sites/store.d.ts +82 -0
  224. package/dist/sites/store.d.ts.map +1 -0
  225. package/dist/sites/store.js +198 -0
  226. package/dist/sites/store.js.map +1 -0
  227. package/dist/sites/tools/index.d.ts +28 -0
  228. package/dist/sites/tools/index.d.ts.map +1 -0
  229. package/dist/sites/tools/index.js +38 -0
  230. package/dist/sites/tools/index.js.map +1 -0
  231. package/dist/sites/tools/sites-list.d.ts +48 -0
  232. package/dist/sites/tools/sites-list.d.ts.map +1 -0
  233. package/dist/sites/tools/sites-list.js +137 -0
  234. package/dist/sites/tools/sites-list.js.map +1 -0
  235. package/dist/sites/tools/sites-test.d.ts +47 -0
  236. package/dist/sites/tools/sites-test.d.ts.map +1 -0
  237. package/dist/sites/tools/sites-test.js +148 -0
  238. package/dist/sites/tools/sites-test.js.map +1 -0
  239. package/dist/sites/tools/use-site.d.ts +47 -0
  240. package/dist/sites/tools/use-site.d.ts.map +1 -0
  241. package/dist/sites/tools/use-site.js +183 -0
  242. package/dist/sites/tools/use-site.js.map +1 -0
  243. package/dist/skill-loader.d.ts +111 -0
  244. package/dist/skill-loader.d.ts.map +1 -0
  245. package/dist/skill-loader.js +191 -0
  246. package/dist/skill-loader.js.map +1 -0
  247. package/dist/tools/elements/builders.d.ts +24 -0
  248. package/dist/tools/elements/builders.d.ts.map +1 -0
  249. package/dist/tools/elements/builders.js +208 -0
  250. package/dist/tools/elements/builders.js.map +1 -0
  251. package/dist/tools/elements/handlers-write.d.ts +49 -0
  252. package/dist/tools/elements/handlers-write.d.ts.map +1 -0
  253. package/dist/tools/elements/handlers-write.js +341 -0
  254. package/dist/tools/elements/handlers-write.js.map +1 -0
  255. package/dist/tools/elements/handlers.d.ts +70 -0
  256. package/dist/tools/elements/handlers.d.ts.map +1 -0
  257. package/dist/tools/elements/handlers.js +292 -0
  258. package/dist/tools/elements/handlers.js.map +1 -0
  259. package/dist/tools/elements/index.d.ts +28 -0
  260. package/dist/tools/elements/index.d.ts.map +1 -0
  261. package/dist/tools/elements/index.js +27 -0
  262. package/dist/tools/elements/index.js.map +1 -0
  263. package/dist/tools/elements.d.ts +13 -0
  264. package/dist/tools/elements.d.ts.map +1 -0
  265. package/dist/tools/elements.js +13 -0
  266. package/dist/tools/elements.js.map +1 -0
  267. package/dist/tools/elicitation.d.ts +87 -0
  268. package/dist/tools/elicitation.d.ts.map +1 -0
  269. package/dist/tools/elicitation.js +100 -0
  270. package/dist/tools/elicitation.js.map +1 -0
  271. package/dist/tools/format/elements-format.d.ts +40 -0
  272. package/dist/tools/format/elements-format.d.ts.map +1 -0
  273. package/dist/tools/format/elements-format.js +193 -0
  274. package/dist/tools/format/elements-format.js.map +1 -0
  275. package/dist/tools/format/health-format.d.ts +79 -0
  276. package/dist/tools/format/health-format.d.ts.map +1 -0
  277. package/dist/tools/format/health-format.js +181 -0
  278. package/dist/tools/format/health-format.js.map +1 -0
  279. package/dist/tools/format/inspection-format.d.ts +70 -0
  280. package/dist/tools/format/inspection-format.d.ts.map +1 -0
  281. package/dist/tools/format/inspection-format.js +359 -0
  282. package/dist/tools/format/inspection-format.js.map +1 -0
  283. package/dist/tools/format/pages-format.d.ts +57 -0
  284. package/dist/tools/format/pages-format.d.ts.map +1 -0
  285. package/dist/tools/format/pages-format.js +157 -0
  286. package/dist/tools/format/pages-format.js.map +1 -0
  287. package/dist/tools/format/sources-format.d.ts +44 -0
  288. package/dist/tools/format/sources-format.d.ts.map +1 -0
  289. package/dist/tools/format/sources-format.js +242 -0
  290. package/dist/tools/format/sources-format.js.map +1 -0
  291. package/dist/tools/health.d.ts +22 -0
  292. package/dist/tools/health.d.ts.map +1 -0
  293. package/dist/tools/health.js +220 -0
  294. package/dist/tools/health.js.map +1 -0
  295. package/dist/tools/index.d.ts +30 -0
  296. package/dist/tools/index.d.ts.map +1 -0
  297. package/dist/tools/index.js +39 -0
  298. package/dist/tools/index.js.map +1 -0
  299. package/dist/tools/inspection.d.ts +14 -0
  300. package/dist/tools/inspection.d.ts.map +1 -0
  301. package/dist/tools/inspection.js +401 -0
  302. package/dist/tools/inspection.js.map +1 -0
  303. package/dist/tools/layout-flatten.d.ts +75 -0
  304. package/dist/tools/layout-flatten.d.ts.map +1 -0
  305. package/dist/tools/layout-flatten.js +107 -0
  306. package/dist/tools/layout-flatten.js.map +1 -0
  307. package/dist/tools/multi-items/builders.d.ts +23 -0
  308. package/dist/tools/multi-items/builders.d.ts.map +1 -0
  309. package/dist/tools/multi-items/builders.js +84 -0
  310. package/dist/tools/multi-items/builders.js.map +1 -0
  311. package/dist/tools/multi-items/clean-implode-handler.d.ts +36 -0
  312. package/dist/tools/multi-items/clean-implode-handler.d.ts.map +1 -0
  313. package/dist/tools/multi-items/clean-implode-handler.js +57 -0
  314. package/dist/tools/multi-items/clean-implode-handler.js.map +1 -0
  315. package/dist/tools/multi-items/format/inspection-format.d.ts +41 -0
  316. package/dist/tools/multi-items/format/inspection-format.d.ts.map +1 -0
  317. package/dist/tools/multi-items/format/inspection-format.js +64 -0
  318. package/dist/tools/multi-items/format/inspection-format.js.map +1 -0
  319. package/dist/tools/multi-items/index.d.ts +18 -0
  320. package/dist/tools/multi-items/index.d.ts.map +1 -0
  321. package/dist/tools/multi-items/index.js +18 -0
  322. package/dist/tools/multi-items/index.js.map +1 -0
  323. package/dist/tools/multi-items/inspect-handler.d.ts +76 -0
  324. package/dist/tools/multi-items/inspect-handler.d.ts.map +1 -0
  325. package/dist/tools/multi-items/inspect-handler.js +133 -0
  326. package/dist/tools/multi-items/inspect-handler.js.map +1 -0
  327. package/dist/tools/multi-items/inspection-cache.d.ts +85 -0
  328. package/dist/tools/multi-items/inspection-cache.d.ts.map +1 -0
  329. package/dist/tools/multi-items/inspection-cache.js +126 -0
  330. package/dist/tools/multi-items/inspection-cache.js.map +1 -0
  331. package/dist/tools/multi-items/item-container-map.d.ts +41 -0
  332. package/dist/tools/multi-items/item-container-map.d.ts.map +1 -0
  333. package/dist/tools/multi-items/item-container-map.js +73 -0
  334. package/dist/tools/multi-items/item-container-map.js.map +1 -0
  335. package/dist/tools/pages/builders.d.ts +43 -0
  336. package/dist/tools/pages/builders.d.ts.map +1 -0
  337. package/dist/tools/pages/builders.js +229 -0
  338. package/dist/tools/pages/builders.js.map +1 -0
  339. package/dist/tools/pages/handlers-read.d.ts +33 -0
  340. package/dist/tools/pages/handlers-read.d.ts.map +1 -0
  341. package/dist/tools/pages/handlers-read.js +260 -0
  342. package/dist/tools/pages/handlers-read.js.map +1 -0
  343. package/dist/tools/pages/handlers-write.d.ts +63 -0
  344. package/dist/tools/pages/handlers-write.d.ts.map +1 -0
  345. package/dist/tools/pages/handlers-write.js +127 -0
  346. package/dist/tools/pages/handlers-write.js.map +1 -0
  347. package/dist/tools/pages/index.d.ts +17 -0
  348. package/dist/tools/pages/index.d.ts.map +1 -0
  349. package/dist/tools/pages/index.js +17 -0
  350. package/dist/tools/pages/index.js.map +1 -0
  351. package/dist/tools/pages/schemas.d.ts +157 -0
  352. package/dist/tools/pages/schemas.d.ts.map +1 -0
  353. package/dist/tools/pages/schemas.js +232 -0
  354. package/dist/tools/pages/schemas.js.map +1 -0
  355. package/dist/tools/pages.d.ts +13 -0
  356. package/dist/tools/pages.d.ts.map +1 -0
  357. package/dist/tools/pages.js +13 -0
  358. package/dist/tools/pages.js.map +1 -0
  359. package/dist/tools/pool-resolve-helper.d.ts +83 -0
  360. package/dist/tools/pool-resolve-helper.d.ts.map +1 -0
  361. package/dist/tools/pool-resolve-helper.js +148 -0
  362. package/dist/tools/pool-resolve-helper.js.map +1 -0
  363. package/dist/tools/progress-phases.d.ts +46 -0
  364. package/dist/tools/progress-phases.d.ts.map +1 -0
  365. package/dist/tools/progress-phases.js +48 -0
  366. package/dist/tools/progress-phases.js.map +1 -0
  367. package/dist/tools/shared-schemas.d.ts +25 -0
  368. package/dist/tools/shared-schemas.d.ts.map +1 -0
  369. package/dist/tools/shared-schemas.js +72 -0
  370. package/dist/tools/shared-schemas.js.map +1 -0
  371. package/dist/tools/sources/builders.d.ts +13 -0
  372. package/dist/tools/sources/builders.d.ts.map +1 -0
  373. package/dist/tools/sources/builders.js +118 -0
  374. package/dist/tools/sources/builders.js.map +1 -0
  375. package/dist/tools/sources/handlers-bind.d.ts +28 -0
  376. package/dist/tools/sources/handlers-bind.d.ts.map +1 -0
  377. package/dist/tools/sources/handlers-bind.js +181 -0
  378. package/dist/tools/sources/handlers-bind.js.map +1 -0
  379. package/dist/tools/sources/handlers.d.ts +47 -0
  380. package/dist/tools/sources/handlers.d.ts.map +1 -0
  381. package/dist/tools/sources/handlers.js +108 -0
  382. package/dist/tools/sources/handlers.js.map +1 -0
  383. package/dist/tools/sources/index.d.ts +19 -0
  384. package/dist/tools/sources/index.d.ts.map +1 -0
  385. package/dist/tools/sources/index.js +18 -0
  386. package/dist/tools/sources/index.js.map +1 -0
  387. package/dist/tools/sources.d.ts +14 -0
  388. package/dist/tools/sources.d.ts.map +1 -0
  389. package/dist/tools/sources.js +14 -0
  390. package/dist/tools/sources.js.map +1 -0
  391. package/dist/tools/sparse-fields.d.ts +106 -0
  392. package/dist/tools/sparse-fields.d.ts.map +1 -0
  393. package/dist/tools/sparse-fields.js +165 -0
  394. package/dist/tools/sparse-fields.js.map +1 -0
  395. package/dist/tools/tool-builder/annotations.d.ts +55 -0
  396. package/dist/tools/tool-builder/annotations.d.ts.map +1 -0
  397. package/dist/tools/tool-builder/annotations.js +86 -0
  398. package/dist/tools/tool-builder/annotations.js.map +1 -0
  399. package/dist/tools/tool-builder/define.d.ts +31 -0
  400. package/dist/tools/tool-builder/define.d.ts.map +1 -0
  401. package/dist/tools/tool-builder/define.js +31 -0
  402. package/dist/tools/tool-builder/define.js.map +1 -0
  403. package/dist/tools/tool-builder/index.d.ts +28 -0
  404. package/dist/tools/tool-builder/index.d.ts.map +1 -0
  405. package/dist/tools/tool-builder/index.js +27 -0
  406. package/dist/tools/tool-builder/index.js.map +1 -0
  407. package/dist/tools/tool-builder/results.d.ts +104 -0
  408. package/dist/tools/tool-builder/results.d.ts.map +1 -0
  409. package/dist/tools/tool-builder/results.js +224 -0
  410. package/dist/tools/tool-builder/results.js.map +1 -0
  411. package/dist/tools/tool-builder/types.d.ts +97 -0
  412. package/dist/tools/tool-builder/types.d.ts.map +1 -0
  413. package/dist/tools/tool-builder/types.js +9 -0
  414. package/dist/tools/tool-builder/types.js.map +1 -0
  415. package/dist/tools/tool-builder.d.ts +16 -0
  416. package/dist/tools/tool-builder.d.ts.map +1 -0
  417. package/dist/tools/tool-builder.js +16 -0
  418. package/dist/tools/tool-builder.js.map +1 -0
  419. package/dist/uninstall-skill.d.ts +52 -0
  420. package/dist/uninstall-skill.d.ts.map +1 -0
  421. package/dist/uninstall-skill.js +146 -0
  422. package/dist/uninstall-skill.js.map +1 -0
  423. package/dist/uninstall.d.ts +73 -0
  424. package/dist/uninstall.d.ts.map +1 -0
  425. package/dist/uninstall.js +82 -0
  426. package/dist/uninstall.js.map +1 -0
  427. package/icon.png +0 -0
  428. package/manifest.json +10 -10
  429. package/package.json +4 -1
  430. package/skills/yt-builder-mcp/SKILL.md +30 -26
@@ -0,0 +1,118 @@
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 30 MCP tools (29 domain + 1 gateway, 23 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-skill.js","sourceRoot":"","sources":["../src/install-skill.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,64 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,98 @@
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
@@ -0,0 +1 @@
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,CAAC;AAuB/B,MAAM,gBAAgB,GAA8B;IAChD,8CAA8C;IAC9C,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,0BAA0B,SAAS,EAAE;IAChE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,6BAA6B,SAAS,EAAE;CACzE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CACzC,OAAe,EACf,UAA0C,EAAE;IAE5C,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,gBAAgB,CAAC;IACxD,MAAM,SAAS,GACX,OAAO,CAAC,SAAS,IAAK,UAAU,CAAC,KAAoB,CAAC;IAC1D,IAAI,OAAO,SAAS,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IAEjD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC5C,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,gBAAgB,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAC1B,OAAO,GAAG,IAAI,EACd,SAAS,EACT,SAAS,CACZ,CAAC;QACF,IAAI,OAAO;YAAE,OAAO,IAAI,CAAC;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,QAAQ,CACnB,GAAW,EACX,SAAiB,EACjB,SAAqB;IAErB,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC9C,MAAM,CAAC,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3C,IAAI,CAAC,CAAC,CAAC,EAAE;YAAE,OAAO,KAAK,CAAC;QACxB,8DAA8D;QAC9D,yCAAyC;QACzC,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,IAAa,CAAC;QAClB,IAAI,CAAC;YACD,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC;AAED,sDAAsD;AACtD,SAAS,gBAAgB,CAAC,IAAa;IACnC,OAAO,CACH,OAAO,IAAI,KAAK,QAAQ;WACrB,IAAI,KAAK,IAAI;WACb,gBAAgB,IAAI,IAAI,CAC9B,CAAC;AACN,CAAC"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Platform abstraction — Wave G.0.
3
+ *
4
+ * A `Platform` is the seam between the MCP server and a host CMS. Today
5
+ * the only concrete impl is `WordPressPlatform`; `joomla` is reserved
6
+ * as a typed seam-marker so Wave G.4+ can land Joomla without rippling
7
+ * through every call site.
8
+ *
9
+ * Why an interface instead of a tagged union?
10
+ * - Each platform owns its REST-namespace path verbatim (WP uses
11
+ * `/wp-json/<ns>`, Joomla will use `/index.php?option=com_ajax&…`).
12
+ * - Adding a platform = implement the interface + add a `PlatformKind`
13
+ * member. No switch statements to update.
14
+ *
15
+ * The `RestClient` accepts EITHER a `Platform` OR the legacy
16
+ * `{baseUrl}` form (which internally builds a `WordPressPlatform`),
17
+ * so existing callers keep working unchanged.
18
+ *
19
+ * @license MIT
20
+ */
21
+ /** Tagged union of supported host platforms. */
22
+ export type PlatformKind = 'wordpress' | 'joomla';
23
+ /**
24
+ * A `Platform` describes WHERE and HOW the MCP server reaches the
25
+ * REST surface of the host CMS.
26
+ */
27
+ export interface Platform {
28
+ /** Discriminator for runtime checks. */
29
+ readonly kind: PlatformKind;
30
+ /** Origin (scheme + host + optional port). No trailing-slash normalisation here. */
31
+ readonly baseUrl: string;
32
+ /** Path prefix appended to baseUrl to form the REST root (must start with `/`). */
33
+ readonly restNamespacePath: string;
34
+ }
35
+ /** Canonical WordPress REST-namespace path for this plugin. */
36
+ export declare const WORDPRESS_REST_NAMESPACE_PATH = "/wp-json/yt-builder-mcp/v1";
37
+ /**
38
+ * WordPress platform implementation.
39
+ *
40
+ * `restNamespacePath` is fixed to the plugin's namespace; the caller
41
+ * supplies only the site origin.
42
+ */
43
+ export declare class WordPressPlatform implements Platform {
44
+ readonly kind: "wordpress";
45
+ readonly baseUrl: string;
46
+ readonly restNamespacePath: string;
47
+ constructor(baseUrl: string);
48
+ }
49
+ export { JoomlaPlatform, JOOMLA_REST_NAMESPACE_PATH } from './joomla.js';
50
+ /**
51
+ * Detect which {@link Platform} a base URL targets based on the URL
52
+ * shape alone (no network call).
53
+ *
54
+ * - pathname starts with `/wp-json/` → `'wordpress'`
55
+ * - pathname starts with `/api/index.php/` → `'joomla'`
56
+ * - otherwise → `null` (ambiguous — caller may probe `/identity`)
57
+ *
58
+ * Round-6 A1 polish: detection switched from `String.includes` to a
59
+ * proper `URL`-parse + `pathname.startsWith` so query-string payloads
60
+ * cannot cause mis-detection (e.g. a Joomla site URL like
61
+ * `https://example.com/?redirect=/wp-json/foo` no longer pretends to
62
+ * be WordPress). Malformed URLs that the `URL` constructor rejects
63
+ * gracefully fall back to the legacy substring scan so callers that
64
+ * accidentally pass a host-only string (e.g. `example.com`) keep
65
+ * working — they would have already failed the actual network call
66
+ * with a clearer error before this function was reached in practice.
67
+ *
68
+ * Cookbook §3.7.1 — the runtime tie-breaker (when this returns `null`)
69
+ * is the `/identity` endpoint, which returns
70
+ * `{ product: 'yt-builder-mcp', platform: 'wordpress'|'joomla', ... }`
71
+ * on both platforms.
72
+ */
73
+ export declare function detectPlatformFromUrl(url: string): PlatformKind | null;
74
+ /**
75
+ * Construct the right {@link Platform} for a base URL.
76
+ *
77
+ * When the URL shape gives an unambiguous hint via
78
+ * {@link detectPlatformFromUrl}, that wins. Otherwise the caller can
79
+ * pass an explicit `hint` (e.g. from a config flag) or fall back to
80
+ * the default (`'wordpress'` for back-compat — Joomla support landed
81
+ * in Wave 7, so existing WordPress installs never need to flag).
82
+ *
83
+ * Synchronous variant — kept for back-compat with callers that cannot
84
+ * (or do not need to) probe over the network. Prefer
85
+ * {@link platformForUrlAsync} when running in the server boot path:
86
+ * it adds a runtime probe that disambiguates origin-only / subfolder
87
+ * URLs (e.g. `https://example.com/joomla`) where the URL shape alone
88
+ * is silent.
89
+ */
90
+ export declare function platformForUrl(baseUrl: string, hint?: PlatformKind): Platform;
91
+ /**
92
+ * Async variant of {@link platformForUrl} that adds a runtime probe
93
+ * step for URLs the URL-shape heuristic cannot disambiguate.
94
+ *
95
+ * Resolution order (first match wins):
96
+ * 1. Explicit `hint` from `YTB_MCP_PLATFORM` env var → no probe.
97
+ * 2. URL-shape via {@link detectPlatformFromUrl} (clear `/wp-json/`
98
+ * or `/api/index.php/` marker) → no probe.
99
+ * 3. Runtime probe via `detectPlatformAtRuntime` (the F-Platform-
100
+ * Detect-Probe fix — handles subfolder installs like
101
+ * `https://dev.example.com/joomla` where steps 1+2 return null).
102
+ * 4. Final fallback: `'wordpress'` (back-compat).
103
+ *
104
+ * The probe step is what unblocks origin-only Joomla customers without
105
+ * forcing them to manually set `YTB_MCP_PLATFORM=joomla` — the DXT
106
+ * default of `auto` finally lives up to its name.
107
+ *
108
+ * If both probes fail (server unreachable, plugin not installed, etc.)
109
+ * we fall back to the wordpress default and emit a single stderr note
110
+ * so the customer at least sees *why* the next authenticated call may
111
+ * 404; the real diagnosis still belongs to the first authenticated
112
+ * tool invocation.
113
+ *
114
+ * @param opts.probe Optional probe override (tests / DI).
115
+ * @param opts.logger Optional stderr writer (defaults to `process.stderr.write`).
116
+ */
117
+ export declare function platformForUrlAsync(baseUrl: string, hint?: PlatformKind, opts?: {
118
+ readonly probe?: (url: string) => Promise<PlatformKind | null>;
119
+ readonly logger?: (msg: string) => void;
120
+ }): Promise<Platform>;
121
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,gDAAgD;AAChD,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACrB,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mFAAmF;IACnF,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACtC;AAED,+DAA+D;AAC/D,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AAE1E;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,QAAQ;IAC9C,SAAgB,IAAI,EAAG,WAAW,CAAU;IAC5C,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,iBAAiB,EAAE,MAAM,CAAC;gBAE9B,OAAO,EAAE,MAAM;CAI9B;AAOD,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAetE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,YAAY,GACpB,QAAQ,CAMV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,mBAAmB,CACrC,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,YAAY,EACnB,IAAI,GAAE;IACF,QAAQ,CAAC,KAAK,CAAC,EAAE,CACb,GAAG,EAAE,MAAM,KACV,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,GACP,OAAO,CAAC,QAAQ,CAAC,CA0CnB"}
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Platform abstraction — Wave G.0.
3
+ *
4
+ * A `Platform` is the seam between the MCP server and a host CMS. Today
5
+ * the only concrete impl is `WordPressPlatform`; `joomla` is reserved
6
+ * as a typed seam-marker so Wave G.4+ can land Joomla without rippling
7
+ * through every call site.
8
+ *
9
+ * Why an interface instead of a tagged union?
10
+ * - Each platform owns its REST-namespace path verbatim (WP uses
11
+ * `/wp-json/<ns>`, Joomla will use `/index.php?option=com_ajax&…`).
12
+ * - Adding a platform = implement the interface + add a `PlatformKind`
13
+ * member. No switch statements to update.
14
+ *
15
+ * The `RestClient` accepts EITHER a `Platform` OR the legacy
16
+ * `{baseUrl}` form (which internally builds a `WordPressPlatform`),
17
+ * so existing callers keep working unchanged.
18
+ *
19
+ * @license MIT
20
+ */
21
+ /** Canonical WordPress REST-namespace path for this plugin. */
22
+ export const WORDPRESS_REST_NAMESPACE_PATH = '/wp-json/yt-builder-mcp/v1';
23
+ /**
24
+ * WordPress platform implementation.
25
+ *
26
+ * `restNamespacePath` is fixed to the plugin's namespace; the caller
27
+ * supplies only the site origin.
28
+ */
29
+ export class WordPressPlatform {
30
+ kind = 'wordpress';
31
+ baseUrl;
32
+ restNamespacePath;
33
+ constructor(baseUrl) {
34
+ this.baseUrl = baseUrl;
35
+ this.restNamespacePath = WORDPRESS_REST_NAMESPACE_PATH;
36
+ }
37
+ }
38
+ // Local import keeps the symbol in scope for `platformForUrl` below;
39
+ // the re-export immediately after surfaces it to outside callers so
40
+ // the platform barrel remains the single import point (cookbook
41
+ // Ch1 Finding 2).
42
+ import { JoomlaPlatform } from './joomla.js';
43
+ export { JoomlaPlatform, JOOMLA_REST_NAMESPACE_PATH } from './joomla.js';
44
+ /**
45
+ * Detect which {@link Platform} a base URL targets based on the URL
46
+ * shape alone (no network call).
47
+ *
48
+ * - pathname starts with `/wp-json/` → `'wordpress'`
49
+ * - pathname starts with `/api/index.php/` → `'joomla'`
50
+ * - otherwise → `null` (ambiguous — caller may probe `/identity`)
51
+ *
52
+ * Round-6 A1 polish: detection switched from `String.includes` to a
53
+ * proper `URL`-parse + `pathname.startsWith` so query-string payloads
54
+ * cannot cause mis-detection (e.g. a Joomla site URL like
55
+ * `https://example.com/?redirect=/wp-json/foo` no longer pretends to
56
+ * be WordPress). Malformed URLs that the `URL` constructor rejects
57
+ * gracefully fall back to the legacy substring scan so callers that
58
+ * accidentally pass a host-only string (e.g. `example.com`) keep
59
+ * working — they would have already failed the actual network call
60
+ * with a clearer error before this function was reached in practice.
61
+ *
62
+ * Cookbook §3.7.1 — the runtime tie-breaker (when this returns `null`)
63
+ * is the `/identity` endpoint, which returns
64
+ * `{ product: 'yt-builder-mcp', platform: 'wordpress'|'joomla', ... }`
65
+ * on both platforms.
66
+ */
67
+ export function detectPlatformFromUrl(url) {
68
+ let pathname;
69
+ try {
70
+ pathname = new URL(url).pathname;
71
+ }
72
+ catch {
73
+ // Fallback for inputs the URL constructor rejects (host-only
74
+ // strings, relative paths). Preserves the legacy substring
75
+ // behaviour as a defensive net.
76
+ if (url.includes('/wp-json/'))
77
+ return 'wordpress';
78
+ if (url.includes('/api/index.php/'))
79
+ return 'joomla';
80
+ return null;
81
+ }
82
+ if (pathname.startsWith('/wp-json/'))
83
+ return 'wordpress';
84
+ if (pathname.startsWith('/api/index.php/'))
85
+ return 'joomla';
86
+ return null;
87
+ }
88
+ /**
89
+ * Construct the right {@link Platform} for a base URL.
90
+ *
91
+ * When the URL shape gives an unambiguous hint via
92
+ * {@link detectPlatformFromUrl}, that wins. Otherwise the caller can
93
+ * pass an explicit `hint` (e.g. from a config flag) or fall back to
94
+ * the default (`'wordpress'` for back-compat — Joomla support landed
95
+ * in Wave 7, so existing WordPress installs never need to flag).
96
+ *
97
+ * Synchronous variant — kept for back-compat with callers that cannot
98
+ * (or do not need to) probe over the network. Prefer
99
+ * {@link platformForUrlAsync} when running in the server boot path:
100
+ * it adds a runtime probe that disambiguates origin-only / subfolder
101
+ * URLs (e.g. `https://example.com/joomla`) where the URL shape alone
102
+ * is silent.
103
+ */
104
+ export function platformForUrl(baseUrl, hint) {
105
+ const detected = detectPlatformFromUrl(baseUrl);
106
+ const kind = detected ?? hint ?? 'wordpress';
107
+ return kind === 'joomla'
108
+ ? new JoomlaPlatform(baseUrl)
109
+ : new WordPressPlatform(baseUrl);
110
+ }
111
+ /**
112
+ * Async variant of {@link platformForUrl} that adds a runtime probe
113
+ * step for URLs the URL-shape heuristic cannot disambiguate.
114
+ *
115
+ * Resolution order (first match wins):
116
+ * 1. Explicit `hint` from `YTB_MCP_PLATFORM` env var → no probe.
117
+ * 2. URL-shape via {@link detectPlatformFromUrl} (clear `/wp-json/`
118
+ * or `/api/index.php/` marker) → no probe.
119
+ * 3. Runtime probe via `detectPlatformAtRuntime` (the F-Platform-
120
+ * Detect-Probe fix — handles subfolder installs like
121
+ * `https://dev.example.com/joomla` where steps 1+2 return null).
122
+ * 4. Final fallback: `'wordpress'` (back-compat).
123
+ *
124
+ * The probe step is what unblocks origin-only Joomla customers without
125
+ * forcing them to manually set `YTB_MCP_PLATFORM=joomla` — the DXT
126
+ * default of `auto` finally lives up to its name.
127
+ *
128
+ * If both probes fail (server unreachable, plugin not installed, etc.)
129
+ * we fall back to the wordpress default and emit a single stderr note
130
+ * so the customer at least sees *why* the next authenticated call may
131
+ * 404; the real diagnosis still belongs to the first authenticated
132
+ * tool invocation.
133
+ *
134
+ * @param opts.probe Optional probe override (tests / DI).
135
+ * @param opts.logger Optional stderr writer (defaults to `process.stderr.write`).
136
+ */
137
+ export async function platformForUrlAsync(baseUrl, hint, opts = {}) {
138
+ // 1. Explicit hint wins — probe-less, by design (user override).
139
+ if (hint !== undefined) {
140
+ return hint === 'joomla'
141
+ ? new JoomlaPlatform(baseUrl)
142
+ : new WordPressPlatform(baseUrl);
143
+ }
144
+ // 2. Static URL-shape heuristic.
145
+ const detected = detectPlatformFromUrl(baseUrl);
146
+ if (detected !== null) {
147
+ return detected === 'joomla'
148
+ ? new JoomlaPlatform(baseUrl)
149
+ : new WordPressPlatform(baseUrl);
150
+ }
151
+ // 3. Runtime probe. Lazy-imported so the sync `platformForUrl`
152
+ // barrel above stays free of any fetch dependency for callers
153
+ // that do not opt-in.
154
+ const probe = opts.probe
155
+ ?? (async (url) => {
156
+ const mod = await import('./detect.js');
157
+ return mod.detectPlatformAtRuntime(url);
158
+ });
159
+ const probed = await probe(baseUrl);
160
+ if (probed !== null) {
161
+ return probed === 'joomla'
162
+ ? new JoomlaPlatform(baseUrl)
163
+ : new WordPressPlatform(baseUrl);
164
+ }
165
+ // 4. Final fallback — emit a single soft note so the user knows
166
+ // we tried and that explicit YTB_MCP_PLATFORM may rescue.
167
+ const logger = opts.logger
168
+ ?? ((msg) => {
169
+ process.stderr.write(msg);
170
+ });
171
+ logger('[yt-builder-mcp] notice: platform auto-detection probe failed for '
172
+ + `${baseUrl} — falling back to wordpress. Set YTB_MCP_PLATFORM=joomla `
173
+ + 'if this is a Joomla install.\n');
174
+ return new WordPressPlatform(baseUrl);
175
+ }
176
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAkBH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,6BAA6B,GAAG,4BAA4B,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,OAAO,iBAAiB;IACV,IAAI,GAAG,WAAoB,CAAC;IAC5B,OAAO,CAAS;IAChB,iBAAiB,CAAS;IAE1C,YAAY,OAAe;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,iBAAiB,GAAG,6BAA6B,CAAC;IAC3D,CAAC;CACJ;AAED,qEAAqE;AACrE,oEAAoE;AACpE,gEAAgE;AAChE,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC7C,IAAI,QAAgB,CAAC;IACrB,IAAI,CAAC;QACD,QAAQ,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACL,6DAA6D;QAC7D,2DAA2D;QAC3D,gCAAgC;QAChC,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC;YAAE,OAAO,WAAW,CAAC;QAClD,IAAI,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAAE,OAAO,QAAQ,CAAC;QACrD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;QAAE,OAAO,WAAW,CAAC;IACzD,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC5D,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,cAAc,CAC1B,OAAe,EACf,IAAmB;IAEnB,MAAM,QAAQ,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,IAAI,GAAiB,QAAQ,IAAI,IAAI,IAAI,WAAW,CAAC;IAC3D,OAAO,IAAI,KAAK,QAAQ;QACpB,CAAC,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC;QAC7B,CAAC,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACrC,OAAe,EACf,IAAmB,EACnB,OAKI,EAAE;IAEN,iEAAiE;IACjE,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACrB,OAAO,IAAI,KAAK,QAAQ;YACpB,CAAC,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC;YAC7B,CAAC,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IACD,iCAAiC;IACjC,MAAM,QAAQ,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAChD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,QAAQ,KAAK,QAAQ;YACxB,CAAC,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC;YAC7B,CAAC,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IACD,+DAA+D;IAC/D,iEAAiE;IACjE,yBAAyB;IACzB,MAAM,KAAK,GACP,IAAI,CAAC,KAAK;WACP,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YACd,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;YACxC,OAAO,GAAG,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACP,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,MAAM,KAAK,QAAQ;YACtB,CAAC,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC;YAC7B,CAAC,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IACD,gEAAgE;IAChE,6DAA6D;IAC7D,MAAM,MAAM,GACR,IAAI,CAAC,MAAM;WACR,CAAC,CAAC,GAAW,EAAE,EAAE;YAChB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACP,MAAM,CACF,oEAAoE;UAC9D,GAAG,OAAO,4DAA4D;UACtE,gCAAgC,CACzC,CAAC;IACF,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Joomla 5/6 platform implementation — Wave 7 prep.
3
+ *
4
+ * Mirrors {@link WordPressPlatform} but targets the Joomla Web Services
5
+ * API surface registered by `plg_system_ytbmcp` (see
6
+ * `src/packaging/joomla/extensions/plg_system_ytbmcp/src/Extension/Ytbmcp.php`
7
+ * — `onBeforeApiRoute()` mounts the routes under
8
+ * `v1/yt-builder-mcp/...` against `com_ytbmcp`).
9
+ *
10
+ * The full request URL composed by {@link RestClient} is:
11
+ *
12
+ * {baseUrl}/api/index.php/v1/yt-builder-mcp/{path}
13
+ *
14
+ * — where `{baseUrl}` is the Joomla site origin (e.g. `https://example.com`
15
+ * or `https://example.com/joomla` for a subfolder install) and `{path}`
16
+ * is the per-tool REST path (e.g. `/health`, `/pages`, `/etag`).
17
+ *
18
+ * Cookbook Ch1 Finding 2: the `PlatformKind` union already declared
19
+ * `'joomla'` in Wave G.0; this class fills the seam so no tool handler
20
+ * has to change.
21
+ *
22
+ * Cookbook §3.7 (cross-platform parity): the REST byte-shape returned
23
+ * by every endpoint is identical across platforms — only the route
24
+ * prefix differs.
25
+ *
26
+ * @license MIT
27
+ */
28
+ import type { Platform } from './index.js';
29
+ /** Canonical Joomla REST namespace prefix for this plugin. */
30
+ export declare const JOOMLA_REST_NAMESPACE_PATH = "/api/index.php/v1/yt-builder-mcp";
31
+ /**
32
+ * Joomla platform implementation.
33
+ *
34
+ * `restNamespacePath` is fixed to the Web Services API mount point that
35
+ * `plg_system_ytbmcp::onBeforeApiRoute()` registers; the caller supplies
36
+ * only the site origin.
37
+ */
38
+ export declare class JoomlaPlatform implements Platform {
39
+ readonly kind: "joomla";
40
+ readonly baseUrl: string;
41
+ readonly restNamespacePath: string;
42
+ constructor(baseUrl: string);
43
+ }
44
+ //# sourceMappingURL=joomla.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joomla.d.ts","sourceRoot":"","sources":["../../src/platform/joomla.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,8DAA8D;AAC9D,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAE7E;;;;;;GAMG;AACH,qBAAa,cAAe,YAAW,QAAQ;IAC3C,SAAgB,IAAI,EAAG,QAAQ,CAAU;IACzC,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,iBAAiB,EAAE,MAAM,CAAC;gBAE9B,OAAO,EAAE,MAAM;CAI9B"}