@wootsup/yt-builder-mcp 1.0.1 → 1.1.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 (401) hide show
  1. package/README.md +18 -6
  2. package/bin/yt-builder-mcp.js +6 -0
  3. package/dist/auth.d.ts +119 -0
  4. package/dist/auth.d.ts.map +1 -0
  5. package/dist/auth.js +226 -0
  6. package/dist/auth.js.map +1 -0
  7. package/dist/client.d.ts +84 -0
  8. package/dist/client.d.ts.map +1 -0
  9. package/dist/client.js +151 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/clients/claude-code.d.ts +18 -0
  12. package/dist/clients/claude-code.d.ts.map +1 -0
  13. package/dist/clients/claude-code.js +53 -0
  14. package/dist/clients/claude-code.js.map +1 -0
  15. package/dist/clients/claude-desktop.d.ts +19 -0
  16. package/dist/clients/claude-desktop.d.ts.map +1 -0
  17. package/dist/clients/claude-desktop.js +56 -0
  18. package/dist/clients/claude-desktop.js.map +1 -0
  19. package/dist/clients/cline.d.ts +26 -0
  20. package/dist/clients/cline.d.ts.map +1 -0
  21. package/dist/clients/cline.js +80 -0
  22. package/dist/clients/cline.js.map +1 -0
  23. package/dist/clients/codex-cli.d.ts +42 -0
  24. package/dist/clients/codex-cli.d.ts.map +1 -0
  25. package/dist/clients/codex-cli.js +194 -0
  26. package/dist/clients/codex-cli.js.map +1 -0
  27. package/dist/clients/continue.d.ts +13 -0
  28. package/dist/clients/continue.d.ts.map +1 -0
  29. package/dist/clients/continue.js +52 -0
  30. package/dist/clients/continue.js.map +1 -0
  31. package/dist/clients/cursor.d.ts +12 -0
  32. package/dist/clients/cursor.d.ts.map +1 -0
  33. package/dist/clients/cursor.js +38 -0
  34. package/dist/clients/cursor.js.map +1 -0
  35. package/dist/clients/gemini-cli.d.ts +18 -0
  36. package/dist/clients/gemini-cli.d.ts.map +1 -0
  37. package/dist/clients/gemini-cli.js +44 -0
  38. package/dist/clients/gemini-cli.js.map +1 -0
  39. package/dist/clients/home.d.ts +14 -0
  40. package/dist/clients/home.d.ts.map +1 -0
  41. package/dist/clients/home.js +20 -0
  42. package/dist/clients/home.js.map +1 -0
  43. package/dist/clients/index.d.ts +52 -0
  44. package/dist/clients/index.d.ts.map +1 -0
  45. package/dist/clients/index.js +72 -0
  46. package/dist/clients/index.js.map +1 -0
  47. package/dist/clients/roo-code.d.ts +23 -0
  48. package/dist/clients/roo-code.d.ts.map +1 -0
  49. package/dist/clients/roo-code.js +69 -0
  50. package/dist/clients/roo-code.js.map +1 -0
  51. package/dist/clients/zed.d.ts +12 -0
  52. package/dist/clients/zed.d.ts.map +1 -0
  53. package/dist/clients/zed.js +41 -0
  54. package/dist/clients/zed.js.map +1 -0
  55. package/dist/errors/hints.d.ts +51 -0
  56. package/dist/errors/hints.d.ts.map +1 -0
  57. package/dist/errors/hints.js +95 -0
  58. package/dist/errors/hints.js.map +1 -0
  59. package/dist/errors/mask.d.ts +35 -0
  60. package/dist/errors/mask.d.ts.map +1 -0
  61. package/dist/errors/mask.js +49 -0
  62. package/dist/errors/mask.js.map +1 -0
  63. package/dist/errors/sanitize.d.ts +31 -0
  64. package/dist/errors/sanitize.d.ts.map +1 -0
  65. package/dist/errors/sanitize.js +100 -0
  66. package/dist/errors/sanitize.js.map +1 -0
  67. package/dist/errors.d.ts +42 -0
  68. package/dist/errors.d.ts.map +1 -0
  69. package/dist/errors.js +61 -0
  70. package/dist/errors.js.map +1 -0
  71. package/dist/gateway/advanced-tool/discovery.d.ts +19 -0
  72. package/dist/gateway/advanced-tool/discovery.d.ts.map +1 -0
  73. package/dist/gateway/advanced-tool/discovery.js +53 -0
  74. package/dist/gateway/advanced-tool/discovery.js.map +1 -0
  75. package/dist/gateway/advanced-tool/domains.d.ts +47 -0
  76. package/dist/gateway/advanced-tool/domains.d.ts.map +1 -0
  77. package/dist/gateway/advanced-tool/domains.js +94 -0
  78. package/dist/gateway/advanced-tool/domains.js.map +1 -0
  79. package/dist/gateway/advanced-tool/execute.d.ts +29 -0
  80. package/dist/gateway/advanced-tool/execute.d.ts.map +1 -0
  81. package/dist/gateway/advanced-tool/execute.js +54 -0
  82. package/dist/gateway/advanced-tool/execute.js.map +1 -0
  83. package/dist/gateway/advanced-tool/index.d.ts +36 -0
  84. package/dist/gateway/advanced-tool/index.d.ts.map +1 -0
  85. package/dist/gateway/advanced-tool/index.js +39 -0
  86. package/dist/gateway/advanced-tool/index.js.map +1 -0
  87. package/dist/gateway/advanced-tool/register.d.ts +18 -0
  88. package/dist/gateway/advanced-tool/register.d.ts.map +1 -0
  89. package/dist/gateway/advanced-tool/register.js +69 -0
  90. package/dist/gateway/advanced-tool/register.js.map +1 -0
  91. package/dist/gateway/advanced-tool.d.ts +13 -0
  92. package/dist/gateway/advanced-tool.d.ts.map +1 -0
  93. package/dist/gateway/advanced-tool.js +13 -0
  94. package/dist/gateway/advanced-tool.js.map +1 -0
  95. package/dist/gateway/capturing-server.d.ts +117 -0
  96. package/dist/gateway/capturing-server.d.ts.map +1 -0
  97. package/dist/gateway/capturing-server.js +103 -0
  98. package/dist/gateway/capturing-server.js.map +1 -0
  99. package/dist/gateway/essentials.d.ts +49 -0
  100. package/dist/gateway/essentials.d.ts.map +1 -0
  101. package/dist/gateway/essentials.js +92 -0
  102. package/dist/gateway/essentials.js.map +1 -0
  103. package/dist/gateway/test-support.d.ts +41 -0
  104. package/dist/gateway/test-support.d.ts.map +1 -0
  105. package/dist/gateway/test-support.js +60 -0
  106. package/dist/gateway/test-support.js.map +1 -0
  107. package/dist/index.d.ts +29 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +113 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/install-skill.d.ts +43 -0
  112. package/dist/install-skill.d.ts.map +1 -0
  113. package/dist/install-skill.js +118 -0
  114. package/dist/install-skill.js.map +1 -0
  115. package/dist/platform/detect.d.ts +64 -0
  116. package/dist/platform/detect.d.ts.map +1 -0
  117. package/dist/platform/detect.js +98 -0
  118. package/dist/platform/detect.js.map +1 -0
  119. package/dist/platform/index.d.ts +121 -0
  120. package/dist/platform/index.d.ts.map +1 -0
  121. package/dist/platform/index.js +176 -0
  122. package/dist/platform/index.js.map +1 -0
  123. package/dist/platform/joomla.d.ts +44 -0
  124. package/dist/platform/joomla.d.ts.map +1 -0
  125. package/dist/platform/joomla.js +46 -0
  126. package/dist/platform/joomla.js.map +1 -0
  127. package/dist/server.d.ts +109 -0
  128. package/dist/server.d.ts.map +1 -0
  129. package/dist/server.js +237 -0
  130. package/dist/server.js.map +1 -0
  131. package/dist/setup-cli-confirm.d.ts +36 -0
  132. package/dist/setup-cli-confirm.d.ts.map +1 -0
  133. package/dist/setup-cli-confirm.js +59 -0
  134. package/dist/setup-cli-confirm.js.map +1 -0
  135. package/dist/setup-cli.d.ts +152 -0
  136. package/dist/setup-cli.d.ts.map +1 -0
  137. package/dist/setup-cli.js +870 -0
  138. package/dist/setup-cli.js.map +1 -0
  139. package/dist/setup-prompts.d.ts +41 -0
  140. package/dist/setup-prompts.d.ts.map +1 -0
  141. package/dist/setup-prompts.js +146 -0
  142. package/dist/setup-prompts.js.map +1 -0
  143. package/dist/setup-token.d.ts +38 -0
  144. package/dist/setup-token.d.ts.map +1 -0
  145. package/dist/setup-token.js +106 -0
  146. package/dist/setup-token.js.map +1 -0
  147. package/dist/setup-wizard-defaults.d.ts +43 -0
  148. package/dist/setup-wizard-defaults.d.ts.map +1 -0
  149. package/dist/setup-wizard-defaults.js +160 -0
  150. package/dist/setup-wizard-defaults.js.map +1 -0
  151. package/dist/setup-wizard-handshake.d.ts +25 -0
  152. package/dist/setup-wizard-handshake.d.ts.map +1 -0
  153. package/dist/setup-wizard-handshake.js +103 -0
  154. package/dist/setup-wizard-handshake.js.map +1 -0
  155. package/dist/setup-wizard-types.d.ts +164 -0
  156. package/dist/setup-wizard-types.d.ts.map +1 -0
  157. package/dist/setup-wizard-types.js +11 -0
  158. package/dist/setup-wizard-types.js.map +1 -0
  159. package/dist/setup-wizard.d.ts +33 -0
  160. package/dist/setup-wizard.d.ts.map +1 -0
  161. package/dist/setup-wizard.js +199 -0
  162. package/dist/setup-wizard.js.map +1 -0
  163. package/dist/setup.d.ts +17 -0
  164. package/dist/setup.d.ts.map +1 -0
  165. package/dist/setup.js +33 -0
  166. package/dist/setup.js.map +1 -0
  167. package/dist/sites/cli/add-site.d.ts +106 -0
  168. package/dist/sites/cli/add-site.d.ts.map +1 -0
  169. package/dist/sites/cli/add-site.js +185 -0
  170. package/dist/sites/cli/add-site.js.map +1 -0
  171. package/dist/sites/cli/list-sites.d.ts +40 -0
  172. package/dist/sites/cli/list-sites.d.ts.map +1 -0
  173. package/dist/sites/cli/list-sites.js +117 -0
  174. package/dist/sites/cli/list-sites.js.map +1 -0
  175. package/dist/sites/cli/remove-site.d.ts +60 -0
  176. package/dist/sites/cli/remove-site.d.ts.map +1 -0
  177. package/dist/sites/cli/remove-site.js +120 -0
  178. package/dist/sites/cli/remove-site.js.map +1 -0
  179. package/dist/sites/cli/set-default.d.ts +47 -0
  180. package/dist/sites/cli/set-default.d.ts.map +1 -0
  181. package/dist/sites/cli/set-default.js +69 -0
  182. package/dist/sites/cli/set-default.js.map +1 -0
  183. package/dist/sites/cli/test-site.d.ts +77 -0
  184. package/dist/sites/cli/test-site.d.ts.map +1 -0
  185. package/dist/sites/cli/test-site.js +146 -0
  186. package/dist/sites/cli/test-site.js.map +1 -0
  187. package/dist/sites/client-pool.d.ts +124 -0
  188. package/dist/sites/client-pool.d.ts.map +1 -0
  189. package/dist/sites/client-pool.js +172 -0
  190. package/dist/sites/client-pool.js.map +1 -0
  191. package/dist/sites/env-bridge.d.ts +55 -0
  192. package/dist/sites/env-bridge.d.ts.map +1 -0
  193. package/dist/sites/env-bridge.js +94 -0
  194. package/dist/sites/env-bridge.js.map +1 -0
  195. package/dist/sites/paths.d.ts +21 -0
  196. package/dist/sites/paths.d.ts.map +1 -0
  197. package/dist/sites/paths.js +37 -0
  198. package/dist/sites/paths.js.map +1 -0
  199. package/dist/sites/probe.d.ts +60 -0
  200. package/dist/sites/probe.d.ts.map +1 -0
  201. package/dist/sites/probe.js +112 -0
  202. package/dist/sites/probe.js.map +1 -0
  203. package/dist/sites/registry.d.ts +142 -0
  204. package/dist/sites/registry.d.ts.map +1 -0
  205. package/dist/sites/registry.js +163 -0
  206. package/dist/sites/registry.js.map +1 -0
  207. package/dist/sites/schema.d.ts +90 -0
  208. package/dist/sites/schema.d.ts.map +1 -0
  209. package/dist/sites/schema.js +71 -0
  210. package/dist/sites/schema.js.map +1 -0
  211. package/dist/sites/secret-resolver.d.ts +109 -0
  212. package/dist/sites/secret-resolver.d.ts.map +1 -0
  213. package/dist/sites/secret-resolver.js +189 -0
  214. package/dist/sites/secret-resolver.js.map +1 -0
  215. package/dist/sites/store.d.ts +82 -0
  216. package/dist/sites/store.d.ts.map +1 -0
  217. package/dist/sites/store.js +198 -0
  218. package/dist/sites/store.js.map +1 -0
  219. package/dist/sites/tools/index.d.ts +28 -0
  220. package/dist/sites/tools/index.d.ts.map +1 -0
  221. package/dist/sites/tools/index.js +30 -0
  222. package/dist/sites/tools/index.js.map +1 -0
  223. package/dist/sites/tools/sites-list.d.ts +48 -0
  224. package/dist/sites/tools/sites-list.d.ts.map +1 -0
  225. package/dist/sites/tools/sites-list.js +135 -0
  226. package/dist/sites/tools/sites-list.js.map +1 -0
  227. package/dist/sites/tools/sites-test.d.ts +47 -0
  228. package/dist/sites/tools/sites-test.d.ts.map +1 -0
  229. package/dist/sites/tools/sites-test.js +148 -0
  230. package/dist/sites/tools/sites-test.js.map +1 -0
  231. package/dist/skill-loader.d.ts +111 -0
  232. package/dist/skill-loader.d.ts.map +1 -0
  233. package/dist/skill-loader.js +191 -0
  234. package/dist/skill-loader.js.map +1 -0
  235. package/dist/tools/elements/builders.d.ts +24 -0
  236. package/dist/tools/elements/builders.d.ts.map +1 -0
  237. package/dist/tools/elements/builders.js +199 -0
  238. package/dist/tools/elements/builders.js.map +1 -0
  239. package/dist/tools/elements/handlers-write.d.ts +49 -0
  240. package/dist/tools/elements/handlers-write.d.ts.map +1 -0
  241. package/dist/tools/elements/handlers-write.js +148 -0
  242. package/dist/tools/elements/handlers-write.js.map +1 -0
  243. package/dist/tools/elements/handlers.d.ts +68 -0
  244. package/dist/tools/elements/handlers.d.ts.map +1 -0
  245. package/dist/tools/elements/handlers.js +206 -0
  246. package/dist/tools/elements/handlers.js.map +1 -0
  247. package/dist/tools/elements/index.d.ts +28 -0
  248. package/dist/tools/elements/index.d.ts.map +1 -0
  249. package/dist/tools/elements/index.js +27 -0
  250. package/dist/tools/elements/index.js.map +1 -0
  251. package/dist/tools/elements.d.ts +13 -0
  252. package/dist/tools/elements.d.ts.map +1 -0
  253. package/dist/tools/elements.js +13 -0
  254. package/dist/tools/elements.js.map +1 -0
  255. package/dist/tools/elicitation.d.ts +87 -0
  256. package/dist/tools/elicitation.d.ts.map +1 -0
  257. package/dist/tools/elicitation.js +100 -0
  258. package/dist/tools/elicitation.js.map +1 -0
  259. package/dist/tools/format/elements-format.d.ts +40 -0
  260. package/dist/tools/format/elements-format.d.ts.map +1 -0
  261. package/dist/tools/format/elements-format.js +194 -0
  262. package/dist/tools/format/elements-format.js.map +1 -0
  263. package/dist/tools/format/health-format.d.ts +79 -0
  264. package/dist/tools/format/health-format.d.ts.map +1 -0
  265. package/dist/tools/format/health-format.js +181 -0
  266. package/dist/tools/format/health-format.js.map +1 -0
  267. package/dist/tools/format/inspection-format.d.ts +58 -0
  268. package/dist/tools/format/inspection-format.d.ts.map +1 -0
  269. package/dist/tools/format/inspection-format.js +164 -0
  270. package/dist/tools/format/inspection-format.js.map +1 -0
  271. package/dist/tools/format/pages-format.d.ts +48 -0
  272. package/dist/tools/format/pages-format.d.ts.map +1 -0
  273. package/dist/tools/format/pages-format.js +137 -0
  274. package/dist/tools/format/pages-format.js.map +1 -0
  275. package/dist/tools/format/sources-format.d.ts +25 -0
  276. package/dist/tools/format/sources-format.d.ts.map +1 -0
  277. package/dist/tools/format/sources-format.js +208 -0
  278. package/dist/tools/format/sources-format.js.map +1 -0
  279. package/dist/tools/health.d.ts +22 -0
  280. package/dist/tools/health.d.ts.map +1 -0
  281. package/dist/tools/health.js +220 -0
  282. package/dist/tools/health.js.map +1 -0
  283. package/dist/tools/index.d.ts +30 -0
  284. package/dist/tools/index.d.ts.map +1 -0
  285. package/dist/tools/index.js +39 -0
  286. package/dist/tools/index.js.map +1 -0
  287. package/dist/tools/inspection.d.ts +14 -0
  288. package/dist/tools/inspection.d.ts.map +1 -0
  289. package/dist/tools/inspection.js +170 -0
  290. package/dist/tools/inspection.js.map +1 -0
  291. package/dist/tools/layout-flatten.d.ts +75 -0
  292. package/dist/tools/layout-flatten.d.ts.map +1 -0
  293. package/dist/tools/layout-flatten.js +107 -0
  294. package/dist/tools/layout-flatten.js.map +1 -0
  295. package/dist/tools/multi-items/builders.d.ts +23 -0
  296. package/dist/tools/multi-items/builders.d.ts.map +1 -0
  297. package/dist/tools/multi-items/builders.js +69 -0
  298. package/dist/tools/multi-items/builders.js.map +1 -0
  299. package/dist/tools/multi-items/clean-implode-handler.d.ts +28 -0
  300. package/dist/tools/multi-items/clean-implode-handler.d.ts.map +1 -0
  301. package/dist/tools/multi-items/clean-implode-handler.js +40 -0
  302. package/dist/tools/multi-items/clean-implode-handler.js.map +1 -0
  303. package/dist/tools/multi-items/index.d.ts +18 -0
  304. package/dist/tools/multi-items/index.d.ts.map +1 -0
  305. package/dist/tools/multi-items/index.js +18 -0
  306. package/dist/tools/multi-items/index.js.map +1 -0
  307. package/dist/tools/multi-items/inspect-handler.d.ts +41 -0
  308. package/dist/tools/multi-items/inspect-handler.d.ts.map +1 -0
  309. package/dist/tools/multi-items/inspect-handler.js +50 -0
  310. package/dist/tools/multi-items/inspect-handler.js.map +1 -0
  311. package/dist/tools/multi-items/item-container-map.d.ts +41 -0
  312. package/dist/tools/multi-items/item-container-map.d.ts.map +1 -0
  313. package/dist/tools/multi-items/item-container-map.js +73 -0
  314. package/dist/tools/multi-items/item-container-map.js.map +1 -0
  315. package/dist/tools/pages/builders.d.ts +14 -0
  316. package/dist/tools/pages/builders.d.ts.map +1 -0
  317. package/dist/tools/pages/builders.js +127 -0
  318. package/dist/tools/pages/builders.js.map +1 -0
  319. package/dist/tools/pages/handlers-read.d.ts +33 -0
  320. package/dist/tools/pages/handlers-read.d.ts.map +1 -0
  321. package/dist/tools/pages/handlers-read.js +171 -0
  322. package/dist/tools/pages/handlers-read.js.map +1 -0
  323. package/dist/tools/pages/handlers-write.d.ts +21 -0
  324. package/dist/tools/pages/handlers-write.d.ts.map +1 -0
  325. package/dist/tools/pages/handlers-write.js +52 -0
  326. package/dist/tools/pages/handlers-write.js.map +1 -0
  327. package/dist/tools/pages/index.d.ts +17 -0
  328. package/dist/tools/pages/index.d.ts.map +1 -0
  329. package/dist/tools/pages/index.js +17 -0
  330. package/dist/tools/pages/index.js.map +1 -0
  331. package/dist/tools/pages/schemas.d.ts +30 -0
  332. package/dist/tools/pages/schemas.d.ts.map +1 -0
  333. package/dist/tools/pages/schemas.js +48 -0
  334. package/dist/tools/pages/schemas.js.map +1 -0
  335. package/dist/tools/pages.d.ts +13 -0
  336. package/dist/tools/pages.d.ts.map +1 -0
  337. package/dist/tools/pages.js +13 -0
  338. package/dist/tools/pages.js.map +1 -0
  339. package/dist/tools/pool-resolve-helper.d.ts +83 -0
  340. package/dist/tools/pool-resolve-helper.d.ts.map +1 -0
  341. package/dist/tools/pool-resolve-helper.js +148 -0
  342. package/dist/tools/pool-resolve-helper.js.map +1 -0
  343. package/dist/tools/progress-phases.d.ts +46 -0
  344. package/dist/tools/progress-phases.d.ts.map +1 -0
  345. package/dist/tools/progress-phases.js +48 -0
  346. package/dist/tools/progress-phases.js.map +1 -0
  347. package/dist/tools/shared-schemas.d.ts +25 -0
  348. package/dist/tools/shared-schemas.d.ts.map +1 -0
  349. package/dist/tools/shared-schemas.js +48 -0
  350. package/dist/tools/shared-schemas.js.map +1 -0
  351. package/dist/tools/sources/builders.d.ts +13 -0
  352. package/dist/tools/sources/builders.d.ts.map +1 -0
  353. package/dist/tools/sources/builders.js +115 -0
  354. package/dist/tools/sources/builders.js.map +1 -0
  355. package/dist/tools/sources/handlers-bind.d.ts +28 -0
  356. package/dist/tools/sources/handlers-bind.d.ts.map +1 -0
  357. package/dist/tools/sources/handlers-bind.js +129 -0
  358. package/dist/tools/sources/handlers-bind.js.map +1 -0
  359. package/dist/tools/sources/handlers.d.ts +45 -0
  360. package/dist/tools/sources/handlers.d.ts.map +1 -0
  361. package/dist/tools/sources/handlers.js +91 -0
  362. package/dist/tools/sources/handlers.js.map +1 -0
  363. package/dist/tools/sources/index.d.ts +19 -0
  364. package/dist/tools/sources/index.d.ts.map +1 -0
  365. package/dist/tools/sources/index.js +18 -0
  366. package/dist/tools/sources/index.js.map +1 -0
  367. package/dist/tools/sources.d.ts +14 -0
  368. package/dist/tools/sources.d.ts.map +1 -0
  369. package/dist/tools/sources.js +14 -0
  370. package/dist/tools/sources.js.map +1 -0
  371. package/dist/tools/sparse-fields.d.ts +80 -0
  372. package/dist/tools/sparse-fields.d.ts.map +1 -0
  373. package/dist/tools/sparse-fields.js +144 -0
  374. package/dist/tools/sparse-fields.js.map +1 -0
  375. package/dist/tools/tool-builder/annotations.d.ts +55 -0
  376. package/dist/tools/tool-builder/annotations.d.ts.map +1 -0
  377. package/dist/tools/tool-builder/annotations.js +86 -0
  378. package/dist/tools/tool-builder/annotations.js.map +1 -0
  379. package/dist/tools/tool-builder/define.d.ts +31 -0
  380. package/dist/tools/tool-builder/define.d.ts.map +1 -0
  381. package/dist/tools/tool-builder/define.js +31 -0
  382. package/dist/tools/tool-builder/define.js.map +1 -0
  383. package/dist/tools/tool-builder/index.d.ts +28 -0
  384. package/dist/tools/tool-builder/index.d.ts.map +1 -0
  385. package/dist/tools/tool-builder/index.js +27 -0
  386. package/dist/tools/tool-builder/index.js.map +1 -0
  387. package/dist/tools/tool-builder/results.d.ts +93 -0
  388. package/dist/tools/tool-builder/results.d.ts.map +1 -0
  389. package/dist/tools/tool-builder/results.js +211 -0
  390. package/dist/tools/tool-builder/results.js.map +1 -0
  391. package/dist/tools/tool-builder/types.d.ts +82 -0
  392. package/dist/tools/tool-builder/types.d.ts.map +1 -0
  393. package/dist/tools/tool-builder/types.js +9 -0
  394. package/dist/tools/tool-builder/types.js.map +1 -0
  395. package/dist/tools/tool-builder.d.ts +16 -0
  396. package/dist/tools/tool-builder.d.ts.map +1 -0
  397. package/dist/tools/tool-builder.js +16 -0
  398. package/dist/tools/tool-builder.js.map +1 -0
  399. package/manifest.json +27 -10
  400. package/package.json +3 -1
  401. package/skills/yt-builder-mcp/SKILL.md +397 -138
@@ -0,0 +1,55 @@
1
+ /**
2
+ * `tool-builder/annotations` — annotation builders that produce the
3
+ * MCP `ToolAnnotations` shape. Each helper encodes a verified
4
+ * read/write/destructive policy so call-sites in domain tools (pages,
5
+ * elements, sources, …) get a single one-liner instead of repeating
6
+ * the four-flag pattern verbatim.
7
+ *
8
+ * Split from `tool-builder.ts` in Round-1.5 — see `index.ts` for
9
+ * the cohesion rationale.
10
+ *
11
+ * Audit-v3 / Stream D3 T3 (2026-05-22) — per Anthropic MCP spec
12
+ * 2026-03-16 "Tool Annotations", every registered tool MUST advertise
13
+ * the full 4-tuple `{readOnlyHint, destructiveHint, idempotentHint,
14
+ * openWorldHint}`. Hosts treat `undefined` hints as "potentially
15
+ * destructive" — defaulting `destructiveHint:false` and
16
+ * `idempotentHint:true/false` explicitly removes that ambiguity for
17
+ * read-only and additive tools.
18
+ *
19
+ * `openWorldHint:false` reflects the closed Builder domain: the REST
20
+ * surface writes to a single local `wp_option('yootheme')` blob —
21
+ * there is no external network side-effect or world-modifying action.
22
+ * The gateway (`yootheme_builder_advanced`) is the exception (its
23
+ * effective behaviour is dynamic, decided at call-time).
24
+ *
25
+ * @license MIT
26
+ */
27
+ import type { ToolAnnotations } from './types.js';
28
+ /**
29
+ * Build a `readOnly` annotation.
30
+ *
31
+ * Reads are idempotent by definition — repeating a read returns the
32
+ * same data (modulo concurrent writes). Setting `idempotentHint:true`
33
+ * is informative for hosts that surface a "safe-to-retry" badge.
34
+ */
35
+ export declare function readOnly(title?: string): ToolAnnotations;
36
+ /**
37
+ * Build a `mutating` annotation for idempotent updates (PUT-style
38
+ * writes — full replacement semantics where repeating the call with
39
+ * the same inputs yields the same end-state).
40
+ */
41
+ export declare function mutating(title?: string): ToolAnnotations;
42
+ /**
43
+ * Build a `creating` annotation for non-idempotent creates (POST-style
44
+ * writes — repeating the call produces additional elements / new IDs).
45
+ */
46
+ export declare function creating(title?: string): ToolAnnotations;
47
+ /**
48
+ * Build a `destructive` annotation. Callers MUST also expose a
49
+ * `confirm` param + preview guard (see annotations-pin.test.ts).
50
+ *
51
+ * Destructive ops are inherently non-idempotent (the first call
52
+ * removes data; the second call hits a 404 / already-gone state).
53
+ */
54
+ export declare function destructive(title?: string): ToolAnnotations;
55
+ //# sourceMappingURL=annotations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-builder/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe,CAQxD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe,CAQxD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe,CAQxD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe,CAQ3D"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * `tool-builder/annotations` — annotation builders that produce the
3
+ * MCP `ToolAnnotations` shape. Each helper encodes a verified
4
+ * read/write/destructive policy so call-sites in domain tools (pages,
5
+ * elements, sources, …) get a single one-liner instead of repeating
6
+ * the four-flag pattern verbatim.
7
+ *
8
+ * Split from `tool-builder.ts` in Round-1.5 — see `index.ts` for
9
+ * the cohesion rationale.
10
+ *
11
+ * Audit-v3 / Stream D3 T3 (2026-05-22) — per Anthropic MCP spec
12
+ * 2026-03-16 "Tool Annotations", every registered tool MUST advertise
13
+ * the full 4-tuple `{readOnlyHint, destructiveHint, idempotentHint,
14
+ * openWorldHint}`. Hosts treat `undefined` hints as "potentially
15
+ * destructive" — defaulting `destructiveHint:false` and
16
+ * `idempotentHint:true/false` explicitly removes that ambiguity for
17
+ * read-only and additive tools.
18
+ *
19
+ * `openWorldHint:false` reflects the closed Builder domain: the REST
20
+ * surface writes to a single local `wp_option('yootheme')` blob —
21
+ * there is no external network side-effect or world-modifying action.
22
+ * The gateway (`yootheme_builder_advanced`) is the exception (its
23
+ * effective behaviour is dynamic, decided at call-time).
24
+ *
25
+ * @license MIT
26
+ */
27
+ /**
28
+ * Build a `readOnly` annotation.
29
+ *
30
+ * Reads are idempotent by definition — repeating a read returns the
31
+ * same data (modulo concurrent writes). Setting `idempotentHint:true`
32
+ * is informative for hosts that surface a "safe-to-retry" badge.
33
+ */
34
+ export function readOnly(title) {
35
+ return {
36
+ title,
37
+ readOnlyHint: true,
38
+ destructiveHint: false,
39
+ idempotentHint: true,
40
+ openWorldHint: false,
41
+ };
42
+ }
43
+ /**
44
+ * Build a `mutating` annotation for idempotent updates (PUT-style
45
+ * writes — full replacement semantics where repeating the call with
46
+ * the same inputs yields the same end-state).
47
+ */
48
+ export function mutating(title) {
49
+ return {
50
+ title,
51
+ readOnlyHint: false,
52
+ destructiveHint: false,
53
+ idempotentHint: true,
54
+ openWorldHint: false,
55
+ };
56
+ }
57
+ /**
58
+ * Build a `creating` annotation for non-idempotent creates (POST-style
59
+ * writes — repeating the call produces additional elements / new IDs).
60
+ */
61
+ export function creating(title) {
62
+ return {
63
+ title,
64
+ readOnlyHint: false,
65
+ destructiveHint: false,
66
+ idempotentHint: false,
67
+ openWorldHint: false,
68
+ };
69
+ }
70
+ /**
71
+ * Build a `destructive` annotation. Callers MUST also expose a
72
+ * `confirm` param + preview guard (see annotations-pin.test.ts).
73
+ *
74
+ * Destructive ops are inherently non-idempotent (the first call
75
+ * removes data; the second call hits a 404 / already-gone state).
76
+ */
77
+ export function destructive(title) {
78
+ return {
79
+ title,
80
+ readOnlyHint: false,
81
+ destructiveHint: true,
82
+ idempotentHint: false,
83
+ openWorldHint: false,
84
+ };
85
+ }
86
+ //# sourceMappingURL=annotations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../../src/tools/tool-builder/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACnC,OAAO;QACH,KAAK;QACL,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,KAAK;KACvB,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACnC,OAAO;QACH,KAAK;QACL,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,KAAK;KACvB,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACnC,OAAO;QACH,KAAK;QACL,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,KAAK;KACvB,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACtC,OAAO;QACH,KAAK;QACL,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,KAAK;KACvB,CAAC;AACN,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * `tool-builder/define` — the `defineTool` identity helper plus the
3
+ * progress-reporter re-export.
4
+ *
5
+ * `defineTool` is intentionally trivial at runtime (returns its
6
+ * argument verbatim) — its only job is to preserve the inferred Zod
7
+ * schema shape so each tool's handler is fully type-checked against
8
+ * its inputSchema. The wrapping/sanitising work happens in
9
+ * `results.ts`.
10
+ *
11
+ * Split from `tool-builder.ts` in Round-1.5 — see `index.ts` for
12
+ * the cohesion rationale.
13
+ *
14
+ * @license MIT
15
+ */
16
+ import { createProgressReporter as toolkitCreateProgressReporter } from '@getimo/mcp-toolkit';
17
+ import type { ZodRawShape } from 'zod';
18
+ import type { ToolDefinition } from './types.js';
19
+ /**
20
+ * Re-export the toolkit's `createProgressReporter` under a stable
21
+ * local symbol so every write-handler in this package depends on a
22
+ * single import path. Returns `null` when the caller sent no
23
+ * `progressToken` — handlers then no-op via `progress?.report(...)`.
24
+ */
25
+ export declare const createProgressReporter: typeof toolkitCreateProgressReporter;
26
+ /**
27
+ * `defineTool` — preserves the inferred Zod-schema shape so each
28
+ * tool's handler is fully type-checked against its inputSchema.
29
+ */
30
+ export declare function defineTool<TSchema extends ZodRawShape>(def: ToolDefinition<TSchema>): ToolDefinition<TSchema>;
31
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-builder/define.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,sBAAsB,IAAI,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,sCAAgC,CAAC;AAEpE;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,SAAS,WAAW,EAClD,GAAG,EAAE,cAAc,CAAC,OAAO,CAAC,GAC7B,cAAc,CAAC,OAAO,CAAC,CAEzB"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * `tool-builder/define` — the `defineTool` identity helper plus the
3
+ * progress-reporter re-export.
4
+ *
5
+ * `defineTool` is intentionally trivial at runtime (returns its
6
+ * argument verbatim) — its only job is to preserve the inferred Zod
7
+ * schema shape so each tool's handler is fully type-checked against
8
+ * its inputSchema. The wrapping/sanitising work happens in
9
+ * `results.ts`.
10
+ *
11
+ * Split from `tool-builder.ts` in Round-1.5 — see `index.ts` for
12
+ * the cohesion rationale.
13
+ *
14
+ * @license MIT
15
+ */
16
+ import { createProgressReporter as toolkitCreateProgressReporter } from '@getimo/mcp-toolkit';
17
+ /**
18
+ * Re-export the toolkit's `createProgressReporter` under a stable
19
+ * local symbol so every write-handler in this package depends on a
20
+ * single import path. Returns `null` when the caller sent no
21
+ * `progressToken` — handlers then no-op via `progress?.report(...)`.
22
+ */
23
+ export const createProgressReporter = toolkitCreateProgressReporter;
24
+ /**
25
+ * `defineTool` — preserves the inferred Zod-schema shape so each
26
+ * tool's handler is fully type-checked against its inputSchema.
27
+ */
28
+ export function defineTool(def) {
29
+ return def;
30
+ }
31
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.js","sourceRoot":"","sources":["../../../src/tools/tool-builder/define.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,sBAAsB,IAAI,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAI9F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,6BAA6B,CAAC;AAEpE;;;GAGG;AACH,MAAM,UAAU,UAAU,CACtB,GAA4B;IAE5B,OAAO,GAAG,CAAC;AACf,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `tool-builder/index` — barrel re-export for the split
3
+ * tool-definition system.
4
+ *
5
+ * Round-1.5: structural split of the former monolithic
6
+ * `tool-builder.ts` (320 LoC). Cohesion is preserved by topic:
7
+ *
8
+ * - `types.ts` — pure type declarations (no runtime imports
9
+ * beyond type-only `zod` + SDK notifications)
10
+ * - `annotations.ts` — `readOnly` / `mutating` / `creating` /
11
+ * `destructive` annotation builders
12
+ * - `results.ts` — `jsonResult` / `errorResult` /
13
+ * `structuredResult` / `confirmGuard` envelope
14
+ * builders + the shared `sanitizeContentItem`
15
+ * helper (single LLM-boundary mask)
16
+ * - `define.ts` — `defineTool` identity helper + progress-
17
+ * reporter re-export
18
+ *
19
+ * The parent file `../tool-builder.ts` re-exports this barrel so
20
+ * existing `./tool-builder.js` imports keep working without churn.
21
+ *
22
+ * @license MIT
23
+ */
24
+ export type { AnyToolDefinition, HandlerExtra, ToolAnnotations, ToolContent, ToolDefinition, ToolHandler, ToolResult, } from './types.js';
25
+ export { creating, destructive, mutating, readOnly, } from './annotations.js';
26
+ export { confirmGuard, errorResult, jsonResult, structuredResult, withSiteMeta, } from './results.js';
27
+ export { createProgressReporter, defineTool } from './define.js';
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-builder/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,YAAY,EACR,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACH,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACH,YAAY,EACZ,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,YAAY,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `tool-builder/index` — barrel re-export for the split
3
+ * tool-definition system.
4
+ *
5
+ * Round-1.5: structural split of the former monolithic
6
+ * `tool-builder.ts` (320 LoC). Cohesion is preserved by topic:
7
+ *
8
+ * - `types.ts` — pure type declarations (no runtime imports
9
+ * beyond type-only `zod` + SDK notifications)
10
+ * - `annotations.ts` — `readOnly` / `mutating` / `creating` /
11
+ * `destructive` annotation builders
12
+ * - `results.ts` — `jsonResult` / `errorResult` /
13
+ * `structuredResult` / `confirmGuard` envelope
14
+ * builders + the shared `sanitizeContentItem`
15
+ * helper (single LLM-boundary mask)
16
+ * - `define.ts` — `defineTool` identity helper + progress-
17
+ * reporter re-export
18
+ *
19
+ * The parent file `../tool-builder.ts` re-exports this barrel so
20
+ * existing `./tool-builder.js` imports keep working without churn.
21
+ *
22
+ * @license MIT
23
+ */
24
+ export { creating, destructive, mutating, readOnly, } from './annotations.js';
25
+ export { confirmGuard, errorResult, jsonResult, structuredResult, withSiteMeta, } from './results.js';
26
+ export { createProgressReporter, defineTool } from './define.js';
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/tool-builder/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAWH,OAAO,EACH,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACH,YAAY,EACZ,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,YAAY,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * `tool-builder/results` — envelope builders (`jsonResult`,
3
+ * `errorResult`, `structuredResult`, `confirmGuard`) + the shared
4
+ * `sanitizeContentItem` helper. Every payload accepted here runs
5
+ * through the `sanitizeSecrets` / `sanitizeForLogs` boundary so an
6
+ * upstream regression can never land in the LLM context. The mask
7
+ * is concentrated here — `define.ts` and call-sites do not re-mask.
8
+ *
9
+ * Split from `tool-builder.ts` in Round-1.5.
10
+ *
11
+ * @license MIT
12
+ */
13
+ import type { ResolvedSite } from '../../sites/registry.js';
14
+ import type { ToolContent, ToolResult } from './types.js';
15
+ /**
16
+ * Convert any JSON-serializable value into the MCP content envelope
17
+ * (2-space JSON). Wave G.6.4b: every payload is deep-walked through
18
+ * `sanitizeSecrets` before stringification so an upstream regression
19
+ * (REST handler surfacing `oauth_refresh_token`, `auth_data`, etc.)
20
+ * can never land in the LLM context.
21
+ */
22
+ export declare function jsonResult(payload: unknown, options?: {
23
+ isError?: boolean;
24
+ }): ToolResult;
25
+ /**
26
+ * Render a structured error result with `context` (echoed input) and a
27
+ * recovery `hint`. Wave G.6.3 defense-in-depth: message is
28
+ * mask-and-truncate'd; context is deep-walked so an input param that
29
+ * accidentally echoed a secret-bearing value cannot leak.
30
+ */
31
+ export declare function errorResult(opts: {
32
+ error: unknown;
33
+ context: Record<string, unknown>;
34
+ hint: string;
35
+ }): ToolResult;
36
+ /**
37
+ * Confirm-guard preview helper for destructive tools. Returns the
38
+ * preview `ToolResult` when `confirm` is false; callers `return` it
39
+ * before executing the destructive REST call.
40
+ */
41
+ export declare function confirmGuard(opts: {
42
+ operation: string;
43
+ details: Record<string, unknown>;
44
+ }): ToolResult;
45
+ /**
46
+ * Merge a toolkit `StructuredCallToolResult` (carries `content[0].text`
47
+ * + `_meta.ui`) with a domain-typed `structuredContent` payload. The
48
+ * result satisfies both Rich-Card hosts (read `_meta.ui`) AND
49
+ * structured-output hosts (read `structuredContent`, may validate
50
+ * against `outputSchema`). Single envelope-merger from every migrated
51
+ * tool's handler — toolkit builders are wrapped, not modified.
52
+ */
53
+ /**
54
+ * W6.2 — site-awareness envelope wrapper.
55
+ *
56
+ * Stamps a resolved-site descriptor onto a tool result so the human +
57
+ * agent both know which connected site the call ran against. Two
58
+ * channels:
59
+ *
60
+ * 1. **text-prefix PRIMARY surface** — `[<label or site_id> @
61
+ * <hostname>] ` is injected at the start of `content[0].text`
62
+ * when that block is a text item. Per the W6 web-research
63
+ * addendum (HCFV §B, Claude-Desktop UI gap doc'd in plan
64
+ * Z.1329-1332), `_meta` is read by the agent but NOT rendered as
65
+ * a UI widget today — so the prefix is the only thing Maria the
66
+ * Claude-Desktop-user reliably SEES. LOAD-BEARING.
67
+ *
68
+ * 2. **`structuredContent._meta` SECONDARY surface** — `_meta:
69
+ * {site_id, site_url, platform}` is merged into the structured
70
+ * payload. MCP-spec-conform metadata channel; future host
71
+ * versions are expected to surface this natively.
72
+ *
73
+ * Pure function: never mutates the input result. Non-text blocks
74
+ * (resource / image / etc.) pass through verbatim. Existing
75
+ * `structuredContent` fields are preserved — only `_meta` is added or
76
+ * augmented. Empty `content[]` is tolerated and produces a
77
+ * prefix-free result (the meta still lands in structuredContent).
78
+ *
79
+ * Label-fallback: `site.label` wins; falls back to `site.id`.
80
+ *
81
+ * Hostname extraction defaults to `new URL(site.url).host`. A
82
+ * malformed URL falls back to the raw site.url string so the prefix
83
+ * remains user-readable even when the registry was hand-edited.
84
+ */
85
+ export declare function withSiteMeta<R extends ToolResult>(result: R, site: ResolvedSite): R;
86
+ export declare function structuredResult(toolkitResult: {
87
+ content: ToolContent[];
88
+ _meta?: {
89
+ ui?: unknown;
90
+ } & Record<string, unknown>;
91
+ isError?: boolean;
92
+ }, structuredContent: Record<string, unknown>): ToolResult;
93
+ //# sourceMappingURL=results.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../../src/tools/tool-builder/results.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAU1D;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,UAAU,CAM5F;AAaD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CAChB,GAAG,UAAU,CAYb;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,GAAG,UAAU,CAQb;AAuBD;;;;;;;GAOG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,UAAU,EAC7C,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,YAAY,GACnB,CAAC,CAyDH;AAED,wBAAgB,gBAAgB,CAC5B,aAAa,EAAE;IACX,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,EACD,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3C,UAAU,CAgBZ"}
@@ -0,0 +1,211 @@
1
+ /**
2
+ * `tool-builder/results` — envelope builders (`jsonResult`,
3
+ * `errorResult`, `structuredResult`, `confirmGuard`) + the shared
4
+ * `sanitizeContentItem` helper. Every payload accepted here runs
5
+ * through the `sanitizeSecrets` / `sanitizeForLogs` boundary so an
6
+ * upstream regression can never land in the LLM context. The mask
7
+ * is concentrated here — `define.ts` and call-sites do not re-mask.
8
+ *
9
+ * Split from `tool-builder.ts` in Round-1.5.
10
+ *
11
+ * @license MIT
12
+ */
13
+ import { NetworkError, RestError } from '../../errors.js';
14
+ import { sanitizeForLogs } from '../../errors/mask.js';
15
+ import { sanitizeSecrets } from '../../errors/sanitize.js';
16
+ function stringify(value) {
17
+ try {
18
+ return JSON.stringify(value, null, 2);
19
+ }
20
+ catch {
21
+ return String(value);
22
+ }
23
+ }
24
+ /**
25
+ * Convert any JSON-serializable value into the MCP content envelope
26
+ * (2-space JSON). Wave G.6.4b: every payload is deep-walked through
27
+ * `sanitizeSecrets` before stringification so an upstream regression
28
+ * (REST handler surfacing `oauth_refresh_token`, `auth_data`, etc.)
29
+ * can never land in the LLM context.
30
+ */
31
+ export function jsonResult(payload, options = {}) {
32
+ const safe = sanitizeSecrets(payload);
33
+ return {
34
+ content: [{ type: 'text', text: stringify(safe) }],
35
+ ...(options.isError === true ? { isError: true } : {}),
36
+ };
37
+ }
38
+ /** Extract `(message, status?, code?)` from any thrown value, honouring
39
+ * `RestError` / `NetworkError` shape distinctions. */
40
+ function describeError(e) {
41
+ if (e instanceof RestError)
42
+ return { message: e.message, status: e.status, code: e.code };
43
+ if (e instanceof NetworkError)
44
+ return { message: e.message };
45
+ if (e instanceof Error)
46
+ return { message: e.message };
47
+ return { message: stringify(e) };
48
+ }
49
+ /**
50
+ * Render a structured error result with `context` (echoed input) and a
51
+ * recovery `hint`. Wave G.6.3 defense-in-depth: message is
52
+ * mask-and-truncate'd; context is deep-walked so an input param that
53
+ * accidentally echoed a secret-bearing value cannot leak.
54
+ */
55
+ export function errorResult(opts) {
56
+ const { message, status, code } = describeError(opts.error);
57
+ return jsonResult({
58
+ error: sanitizeForLogs(message),
59
+ ...(status !== undefined ? { status } : {}),
60
+ ...(code !== undefined ? { code } : {}),
61
+ context: sanitizeSecrets(opts.context),
62
+ hint: opts.hint,
63
+ }, { isError: true });
64
+ }
65
+ /**
66
+ * Confirm-guard preview helper for destructive tools. Returns the
67
+ * preview `ToolResult` when `confirm` is false; callers `return` it
68
+ * before executing the destructive REST call.
69
+ */
70
+ export function confirmGuard(opts) {
71
+ return jsonResult({
72
+ preview: true,
73
+ warning: 'DESTRUCTIVE — Confirmation required',
74
+ operation: opts.operation,
75
+ details: opts.details,
76
+ instruction: 'Ask the user to confirm, then call again with `confirm: true`.',
77
+ });
78
+ }
79
+ /**
80
+ * Sanitise a single content item from a toolkit builder. Text items
81
+ * frequently embed a JSON-stringified payload — if it parses, deep-walk
82
+ * and re-stringify; otherwise leave as-is (toolkit-rendered tables /
83
+ * details are already domain-mapped at the call site).
84
+ */
85
+ function sanitizeContentItem(item) {
86
+ if (item.type !== 'text' || typeof item.text !== 'string')
87
+ return item;
88
+ const text = item.text;
89
+ try {
90
+ const parsed = JSON.parse(text);
91
+ const safe = sanitizeSecrets(parsed);
92
+ return { ...item, text: stringify(safe) };
93
+ }
94
+ catch {
95
+ // Not JSON — toolkit-rendered text. No structural redaction
96
+ // possible without false-positives; the caller has already
97
+ // mapped raw secrets out via field-projection helpers.
98
+ return item;
99
+ }
100
+ }
101
+ /**
102
+ * Merge a toolkit `StructuredCallToolResult` (carries `content[0].text`
103
+ * + `_meta.ui`) with a domain-typed `structuredContent` payload. The
104
+ * result satisfies both Rich-Card hosts (read `_meta.ui`) AND
105
+ * structured-output hosts (read `structuredContent`, may validate
106
+ * against `outputSchema`). Single envelope-merger from every migrated
107
+ * tool's handler — toolkit builders are wrapped, not modified.
108
+ */
109
+ /**
110
+ * W6.2 — site-awareness envelope wrapper.
111
+ *
112
+ * Stamps a resolved-site descriptor onto a tool result so the human +
113
+ * agent both know which connected site the call ran against. Two
114
+ * channels:
115
+ *
116
+ * 1. **text-prefix PRIMARY surface** — `[<label or site_id> @
117
+ * <hostname>] ` is injected at the start of `content[0].text`
118
+ * when that block is a text item. Per the W6 web-research
119
+ * addendum (HCFV §B, Claude-Desktop UI gap doc'd in plan
120
+ * Z.1329-1332), `_meta` is read by the agent but NOT rendered as
121
+ * a UI widget today — so the prefix is the only thing Maria the
122
+ * Claude-Desktop-user reliably SEES. LOAD-BEARING.
123
+ *
124
+ * 2. **`structuredContent._meta` SECONDARY surface** — `_meta:
125
+ * {site_id, site_url, platform}` is merged into the structured
126
+ * payload. MCP-spec-conform metadata channel; future host
127
+ * versions are expected to surface this natively.
128
+ *
129
+ * Pure function: never mutates the input result. Non-text blocks
130
+ * (resource / image / etc.) pass through verbatim. Existing
131
+ * `structuredContent` fields are preserved — only `_meta` is added or
132
+ * augmented. Empty `content[]` is tolerated and produces a
133
+ * prefix-free result (the meta still lands in structuredContent).
134
+ *
135
+ * Label-fallback: `site.label` wins; falls back to `site.id`.
136
+ *
137
+ * Hostname extraction defaults to `new URL(site.url).host`. A
138
+ * malformed URL falls back to the raw site.url string so the prefix
139
+ * remains user-readable even when the registry was hand-edited.
140
+ */
141
+ export function withSiteMeta(result, site) {
142
+ const displayLabel = site.label ?? site.id;
143
+ let host;
144
+ try {
145
+ host = new URL(site.url).host;
146
+ }
147
+ catch {
148
+ host = site.url;
149
+ }
150
+ const prefix = `[${displayLabel} @ ${host}] `;
151
+ const meta = {
152
+ site_id: site.id,
153
+ site_url: site.url,
154
+ platform: site.platform.kind,
155
+ };
156
+ // W12-R1.2 (A4-F2): site-awareness is the LOAD-BEARING surface for
157
+ // Claude-Desktop users. When the wrapped result has no text content
158
+ // (e.g. an image-only / resource-only / empty-list response), the
159
+ // prefix would otherwise be lost and the agent would have no visible
160
+ // signal of which site the call ran against. Prepend a synthetic
161
+ // text block so the prefix is ALWAYS the first visible glyph.
162
+ // Trim the trailing space — a standalone prefix block reads better
163
+ // without it.
164
+ const firstItem = result.content[0];
165
+ const needsSynthetic = result.content.length === 0
166
+ || firstItem === undefined
167
+ || firstItem.type !== 'text';
168
+ const newContent = needsSynthetic
169
+ ? [
170
+ { type: 'text', text: prefix.trimEnd() },
171
+ ...result.content,
172
+ ]
173
+ : result.content.map((item, idx) => {
174
+ if (idx !== 0)
175
+ return item;
176
+ if (item.type !== 'text')
177
+ return item;
178
+ const existingText = typeof item.text === 'string' ? item.text : '';
179
+ return { ...item, text: prefix + existingText };
180
+ });
181
+ const baseStructured = result.structuredContent ?? {};
182
+ const existingMeta = baseStructured._meta;
183
+ const mergedMeta = existingMeta !== undefined && existingMeta !== null && typeof existingMeta === 'object'
184
+ ? { ...existingMeta, ...meta }
185
+ : meta;
186
+ return {
187
+ ...result,
188
+ content: newContent,
189
+ structuredContent: {
190
+ ...baseStructured,
191
+ _meta: mergedMeta,
192
+ },
193
+ };
194
+ }
195
+ export function structuredResult(toolkitResult, structuredContent) {
196
+ // Wave G.6.4b — deep-walk-sanitise all three legs (text content,
197
+ // _meta.ui, structuredContent) so regressing sources never bypass
198
+ // the LLM-boundary mask.
199
+ const safeContent = toolkitResult.content.map(sanitizeContentItem);
200
+ const safeStructured = sanitizeSecrets(structuredContent);
201
+ const safeMeta = toolkitResult._meta !== undefined
202
+ ? sanitizeSecrets(toolkitResult._meta)
203
+ : undefined;
204
+ return {
205
+ content: safeContent,
206
+ ...(safeMeta !== undefined ? { _meta: safeMeta } : {}),
207
+ ...(toolkitResult.isError === true ? { isError: true } : {}),
208
+ structuredContent: safeStructured,
209
+ };
210
+ }
211
+ //# sourceMappingURL=results.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"results.js","sourceRoot":"","sources":["../../../src/tools/tool-builder/results.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAI3D,SAAS,SAAS,CAAC,KAAc;IAC7B,IAAI,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACL,OAAO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