@wootsup/yt-builder-mcp 1.1.0 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (400) hide show
  1. package/README.md +56 -55
  2. package/manifest.json +15 -15
  3. package/package.json +2 -2
  4. package/skills/yt-builder-mcp/SKILL.md +130 -121
  5. package/dist/auth.d.ts +0 -119
  6. package/dist/auth.d.ts.map +0 -1
  7. package/dist/auth.js +0 -226
  8. package/dist/auth.js.map +0 -1
  9. package/dist/client.d.ts +0 -84
  10. package/dist/client.d.ts.map +0 -1
  11. package/dist/client.js +0 -151
  12. package/dist/client.js.map +0 -1
  13. package/dist/clients/claude-code.d.ts +0 -18
  14. package/dist/clients/claude-code.d.ts.map +0 -1
  15. package/dist/clients/claude-code.js +0 -53
  16. package/dist/clients/claude-code.js.map +0 -1
  17. package/dist/clients/claude-desktop.d.ts +0 -19
  18. package/dist/clients/claude-desktop.d.ts.map +0 -1
  19. package/dist/clients/claude-desktop.js +0 -56
  20. package/dist/clients/claude-desktop.js.map +0 -1
  21. package/dist/clients/cline.d.ts +0 -26
  22. package/dist/clients/cline.d.ts.map +0 -1
  23. package/dist/clients/cline.js +0 -80
  24. package/dist/clients/cline.js.map +0 -1
  25. package/dist/clients/codex-cli.d.ts +0 -42
  26. package/dist/clients/codex-cli.d.ts.map +0 -1
  27. package/dist/clients/codex-cli.js +0 -194
  28. package/dist/clients/codex-cli.js.map +0 -1
  29. package/dist/clients/continue.d.ts +0 -13
  30. package/dist/clients/continue.d.ts.map +0 -1
  31. package/dist/clients/continue.js +0 -52
  32. package/dist/clients/continue.js.map +0 -1
  33. package/dist/clients/cursor.d.ts +0 -12
  34. package/dist/clients/cursor.d.ts.map +0 -1
  35. package/dist/clients/cursor.js +0 -38
  36. package/dist/clients/cursor.js.map +0 -1
  37. package/dist/clients/gemini-cli.d.ts +0 -18
  38. package/dist/clients/gemini-cli.d.ts.map +0 -1
  39. package/dist/clients/gemini-cli.js +0 -44
  40. package/dist/clients/gemini-cli.js.map +0 -1
  41. package/dist/clients/home.d.ts +0 -14
  42. package/dist/clients/home.d.ts.map +0 -1
  43. package/dist/clients/home.js +0 -20
  44. package/dist/clients/home.js.map +0 -1
  45. package/dist/clients/index.d.ts +0 -52
  46. package/dist/clients/index.d.ts.map +0 -1
  47. package/dist/clients/index.js +0 -72
  48. package/dist/clients/index.js.map +0 -1
  49. package/dist/clients/roo-code.d.ts +0 -23
  50. package/dist/clients/roo-code.d.ts.map +0 -1
  51. package/dist/clients/roo-code.js +0 -69
  52. package/dist/clients/roo-code.js.map +0 -1
  53. package/dist/clients/zed.d.ts +0 -12
  54. package/dist/clients/zed.d.ts.map +0 -1
  55. package/dist/clients/zed.js +0 -41
  56. package/dist/clients/zed.js.map +0 -1
  57. package/dist/errors/hints.d.ts +0 -51
  58. package/dist/errors/hints.d.ts.map +0 -1
  59. package/dist/errors/hints.js +0 -95
  60. package/dist/errors/hints.js.map +0 -1
  61. package/dist/errors/mask.d.ts +0 -35
  62. package/dist/errors/mask.d.ts.map +0 -1
  63. package/dist/errors/mask.js +0 -49
  64. package/dist/errors/mask.js.map +0 -1
  65. package/dist/errors/sanitize.d.ts +0 -31
  66. package/dist/errors/sanitize.d.ts.map +0 -1
  67. package/dist/errors/sanitize.js +0 -100
  68. package/dist/errors/sanitize.js.map +0 -1
  69. package/dist/errors.d.ts +0 -42
  70. package/dist/errors.d.ts.map +0 -1
  71. package/dist/errors.js +0 -61
  72. package/dist/errors.js.map +0 -1
  73. package/dist/gateway/advanced-tool/discovery.d.ts +0 -19
  74. package/dist/gateway/advanced-tool/discovery.d.ts.map +0 -1
  75. package/dist/gateway/advanced-tool/discovery.js +0 -53
  76. package/dist/gateway/advanced-tool/discovery.js.map +0 -1
  77. package/dist/gateway/advanced-tool/domains.d.ts +0 -47
  78. package/dist/gateway/advanced-tool/domains.d.ts.map +0 -1
  79. package/dist/gateway/advanced-tool/domains.js +0 -94
  80. package/dist/gateway/advanced-tool/domains.js.map +0 -1
  81. package/dist/gateway/advanced-tool/execute.d.ts +0 -29
  82. package/dist/gateway/advanced-tool/execute.d.ts.map +0 -1
  83. package/dist/gateway/advanced-tool/execute.js +0 -54
  84. package/dist/gateway/advanced-tool/execute.js.map +0 -1
  85. package/dist/gateway/advanced-tool/index.d.ts +0 -36
  86. package/dist/gateway/advanced-tool/index.d.ts.map +0 -1
  87. package/dist/gateway/advanced-tool/index.js +0 -39
  88. package/dist/gateway/advanced-tool/index.js.map +0 -1
  89. package/dist/gateway/advanced-tool/register.d.ts +0 -18
  90. package/dist/gateway/advanced-tool/register.d.ts.map +0 -1
  91. package/dist/gateway/advanced-tool/register.js +0 -69
  92. package/dist/gateway/advanced-tool/register.js.map +0 -1
  93. package/dist/gateway/advanced-tool.d.ts +0 -13
  94. package/dist/gateway/advanced-tool.d.ts.map +0 -1
  95. package/dist/gateway/advanced-tool.js +0 -13
  96. package/dist/gateway/advanced-tool.js.map +0 -1
  97. package/dist/gateway/capturing-server.d.ts +0 -117
  98. package/dist/gateway/capturing-server.d.ts.map +0 -1
  99. package/dist/gateway/capturing-server.js +0 -103
  100. package/dist/gateway/capturing-server.js.map +0 -1
  101. package/dist/gateway/essentials.d.ts +0 -49
  102. package/dist/gateway/essentials.d.ts.map +0 -1
  103. package/dist/gateway/essentials.js +0 -92
  104. package/dist/gateway/essentials.js.map +0 -1
  105. package/dist/gateway/test-support.d.ts +0 -41
  106. package/dist/gateway/test-support.d.ts.map +0 -1
  107. package/dist/gateway/test-support.js +0 -60
  108. package/dist/gateway/test-support.js.map +0 -1
  109. package/dist/index.d.ts +0 -29
  110. package/dist/index.d.ts.map +0 -1
  111. package/dist/index.js +0 -113
  112. package/dist/index.js.map +0 -1
  113. package/dist/install-skill.d.ts +0 -43
  114. package/dist/install-skill.d.ts.map +0 -1
  115. package/dist/install-skill.js +0 -118
  116. package/dist/install-skill.js.map +0 -1
  117. package/dist/platform/detect.d.ts +0 -64
  118. package/dist/platform/detect.d.ts.map +0 -1
  119. package/dist/platform/detect.js +0 -98
  120. package/dist/platform/detect.js.map +0 -1
  121. package/dist/platform/index.d.ts +0 -121
  122. package/dist/platform/index.d.ts.map +0 -1
  123. package/dist/platform/index.js +0 -176
  124. package/dist/platform/index.js.map +0 -1
  125. package/dist/platform/joomla.d.ts +0 -44
  126. package/dist/platform/joomla.d.ts.map +0 -1
  127. package/dist/platform/joomla.js +0 -46
  128. package/dist/platform/joomla.js.map +0 -1
  129. package/dist/server.d.ts +0 -109
  130. package/dist/server.d.ts.map +0 -1
  131. package/dist/server.js +0 -237
  132. package/dist/server.js.map +0 -1
  133. package/dist/setup-cli-confirm.d.ts +0 -36
  134. package/dist/setup-cli-confirm.d.ts.map +0 -1
  135. package/dist/setup-cli-confirm.js +0 -59
  136. package/dist/setup-cli-confirm.js.map +0 -1
  137. package/dist/setup-cli.d.ts +0 -152
  138. package/dist/setup-cli.d.ts.map +0 -1
  139. package/dist/setup-cli.js +0 -870
  140. package/dist/setup-cli.js.map +0 -1
  141. package/dist/setup-prompts.d.ts +0 -41
  142. package/dist/setup-prompts.d.ts.map +0 -1
  143. package/dist/setup-prompts.js +0 -146
  144. package/dist/setup-prompts.js.map +0 -1
  145. package/dist/setup-token.d.ts +0 -38
  146. package/dist/setup-token.d.ts.map +0 -1
  147. package/dist/setup-token.js +0 -106
  148. package/dist/setup-token.js.map +0 -1
  149. package/dist/setup-wizard-defaults.d.ts +0 -43
  150. package/dist/setup-wizard-defaults.d.ts.map +0 -1
  151. package/dist/setup-wizard-defaults.js +0 -160
  152. package/dist/setup-wizard-defaults.js.map +0 -1
  153. package/dist/setup-wizard-handshake.d.ts +0 -25
  154. package/dist/setup-wizard-handshake.d.ts.map +0 -1
  155. package/dist/setup-wizard-handshake.js +0 -103
  156. package/dist/setup-wizard-handshake.js.map +0 -1
  157. package/dist/setup-wizard-types.d.ts +0 -164
  158. package/dist/setup-wizard-types.d.ts.map +0 -1
  159. package/dist/setup-wizard-types.js +0 -11
  160. package/dist/setup-wizard-types.js.map +0 -1
  161. package/dist/setup-wizard.d.ts +0 -33
  162. package/dist/setup-wizard.d.ts.map +0 -1
  163. package/dist/setup-wizard.js +0 -199
  164. package/dist/setup-wizard.js.map +0 -1
  165. package/dist/setup.d.ts +0 -17
  166. package/dist/setup.d.ts.map +0 -1
  167. package/dist/setup.js +0 -33
  168. package/dist/setup.js.map +0 -1
  169. package/dist/sites/cli/add-site.d.ts +0 -106
  170. package/dist/sites/cli/add-site.d.ts.map +0 -1
  171. package/dist/sites/cli/add-site.js +0 -185
  172. package/dist/sites/cli/add-site.js.map +0 -1
  173. package/dist/sites/cli/list-sites.d.ts +0 -40
  174. package/dist/sites/cli/list-sites.d.ts.map +0 -1
  175. package/dist/sites/cli/list-sites.js +0 -117
  176. package/dist/sites/cli/list-sites.js.map +0 -1
  177. package/dist/sites/cli/remove-site.d.ts +0 -60
  178. package/dist/sites/cli/remove-site.d.ts.map +0 -1
  179. package/dist/sites/cli/remove-site.js +0 -120
  180. package/dist/sites/cli/remove-site.js.map +0 -1
  181. package/dist/sites/cli/set-default.d.ts +0 -47
  182. package/dist/sites/cli/set-default.d.ts.map +0 -1
  183. package/dist/sites/cli/set-default.js +0 -69
  184. package/dist/sites/cli/set-default.js.map +0 -1
  185. package/dist/sites/cli/test-site.d.ts +0 -77
  186. package/dist/sites/cli/test-site.d.ts.map +0 -1
  187. package/dist/sites/cli/test-site.js +0 -146
  188. package/dist/sites/cli/test-site.js.map +0 -1
  189. package/dist/sites/client-pool.d.ts +0 -124
  190. package/dist/sites/client-pool.d.ts.map +0 -1
  191. package/dist/sites/client-pool.js +0 -172
  192. package/dist/sites/client-pool.js.map +0 -1
  193. package/dist/sites/env-bridge.d.ts +0 -55
  194. package/dist/sites/env-bridge.d.ts.map +0 -1
  195. package/dist/sites/env-bridge.js +0 -94
  196. package/dist/sites/env-bridge.js.map +0 -1
  197. package/dist/sites/paths.d.ts +0 -21
  198. package/dist/sites/paths.d.ts.map +0 -1
  199. package/dist/sites/paths.js +0 -37
  200. package/dist/sites/paths.js.map +0 -1
  201. package/dist/sites/probe.d.ts +0 -60
  202. package/dist/sites/probe.d.ts.map +0 -1
  203. package/dist/sites/probe.js +0 -112
  204. package/dist/sites/probe.js.map +0 -1
  205. package/dist/sites/registry.d.ts +0 -142
  206. package/dist/sites/registry.d.ts.map +0 -1
  207. package/dist/sites/registry.js +0 -163
  208. package/dist/sites/registry.js.map +0 -1
  209. package/dist/sites/schema.d.ts +0 -90
  210. package/dist/sites/schema.d.ts.map +0 -1
  211. package/dist/sites/schema.js +0 -71
  212. package/dist/sites/schema.js.map +0 -1
  213. package/dist/sites/secret-resolver.d.ts +0 -109
  214. package/dist/sites/secret-resolver.d.ts.map +0 -1
  215. package/dist/sites/secret-resolver.js +0 -189
  216. package/dist/sites/secret-resolver.js.map +0 -1
  217. package/dist/sites/store.d.ts +0 -82
  218. package/dist/sites/store.d.ts.map +0 -1
  219. package/dist/sites/store.js +0 -198
  220. package/dist/sites/store.js.map +0 -1
  221. package/dist/sites/tools/index.d.ts +0 -28
  222. package/dist/sites/tools/index.d.ts.map +0 -1
  223. package/dist/sites/tools/index.js +0 -30
  224. package/dist/sites/tools/index.js.map +0 -1
  225. package/dist/sites/tools/sites-list.d.ts +0 -48
  226. package/dist/sites/tools/sites-list.d.ts.map +0 -1
  227. package/dist/sites/tools/sites-list.js +0 -135
  228. package/dist/sites/tools/sites-list.js.map +0 -1
  229. package/dist/sites/tools/sites-test.d.ts +0 -47
  230. package/dist/sites/tools/sites-test.d.ts.map +0 -1
  231. package/dist/sites/tools/sites-test.js +0 -148
  232. package/dist/sites/tools/sites-test.js.map +0 -1
  233. package/dist/skill-loader.d.ts +0 -111
  234. package/dist/skill-loader.d.ts.map +0 -1
  235. package/dist/skill-loader.js +0 -191
  236. package/dist/skill-loader.js.map +0 -1
  237. package/dist/tools/elements/builders.d.ts +0 -24
  238. package/dist/tools/elements/builders.d.ts.map +0 -1
  239. package/dist/tools/elements/builders.js +0 -199
  240. package/dist/tools/elements/builders.js.map +0 -1
  241. package/dist/tools/elements/handlers-write.d.ts +0 -49
  242. package/dist/tools/elements/handlers-write.d.ts.map +0 -1
  243. package/dist/tools/elements/handlers-write.js +0 -148
  244. package/dist/tools/elements/handlers-write.js.map +0 -1
  245. package/dist/tools/elements/handlers.d.ts +0 -68
  246. package/dist/tools/elements/handlers.d.ts.map +0 -1
  247. package/dist/tools/elements/handlers.js +0 -206
  248. package/dist/tools/elements/handlers.js.map +0 -1
  249. package/dist/tools/elements/index.d.ts +0 -28
  250. package/dist/tools/elements/index.d.ts.map +0 -1
  251. package/dist/tools/elements/index.js +0 -27
  252. package/dist/tools/elements/index.js.map +0 -1
  253. package/dist/tools/elements.d.ts +0 -13
  254. package/dist/tools/elements.d.ts.map +0 -1
  255. package/dist/tools/elements.js +0 -13
  256. package/dist/tools/elements.js.map +0 -1
  257. package/dist/tools/elicitation.d.ts +0 -87
  258. package/dist/tools/elicitation.d.ts.map +0 -1
  259. package/dist/tools/elicitation.js +0 -100
  260. package/dist/tools/elicitation.js.map +0 -1
  261. package/dist/tools/format/elements-format.d.ts +0 -40
  262. package/dist/tools/format/elements-format.d.ts.map +0 -1
  263. package/dist/tools/format/elements-format.js +0 -194
  264. package/dist/tools/format/elements-format.js.map +0 -1
  265. package/dist/tools/format/health-format.d.ts +0 -79
  266. package/dist/tools/format/health-format.d.ts.map +0 -1
  267. package/dist/tools/format/health-format.js +0 -181
  268. package/dist/tools/format/health-format.js.map +0 -1
  269. package/dist/tools/format/inspection-format.d.ts +0 -58
  270. package/dist/tools/format/inspection-format.d.ts.map +0 -1
  271. package/dist/tools/format/inspection-format.js +0 -164
  272. package/dist/tools/format/inspection-format.js.map +0 -1
  273. package/dist/tools/format/pages-format.d.ts +0 -48
  274. package/dist/tools/format/pages-format.d.ts.map +0 -1
  275. package/dist/tools/format/pages-format.js +0 -137
  276. package/dist/tools/format/pages-format.js.map +0 -1
  277. package/dist/tools/format/sources-format.d.ts +0 -25
  278. package/dist/tools/format/sources-format.d.ts.map +0 -1
  279. package/dist/tools/format/sources-format.js +0 -208
  280. package/dist/tools/format/sources-format.js.map +0 -1
  281. package/dist/tools/health.d.ts +0 -22
  282. package/dist/tools/health.d.ts.map +0 -1
  283. package/dist/tools/health.js +0 -220
  284. package/dist/tools/health.js.map +0 -1
  285. package/dist/tools/index.d.ts +0 -30
  286. package/dist/tools/index.d.ts.map +0 -1
  287. package/dist/tools/index.js +0 -39
  288. package/dist/tools/index.js.map +0 -1
  289. package/dist/tools/inspection.d.ts +0 -14
  290. package/dist/tools/inspection.d.ts.map +0 -1
  291. package/dist/tools/inspection.js +0 -170
  292. package/dist/tools/inspection.js.map +0 -1
  293. package/dist/tools/layout-flatten.d.ts +0 -75
  294. package/dist/tools/layout-flatten.d.ts.map +0 -1
  295. package/dist/tools/layout-flatten.js +0 -107
  296. package/dist/tools/layout-flatten.js.map +0 -1
  297. package/dist/tools/multi-items/builders.d.ts +0 -23
  298. package/dist/tools/multi-items/builders.d.ts.map +0 -1
  299. package/dist/tools/multi-items/builders.js +0 -69
  300. package/dist/tools/multi-items/builders.js.map +0 -1
  301. package/dist/tools/multi-items/clean-implode-handler.d.ts +0 -28
  302. package/dist/tools/multi-items/clean-implode-handler.d.ts.map +0 -1
  303. package/dist/tools/multi-items/clean-implode-handler.js +0 -40
  304. package/dist/tools/multi-items/clean-implode-handler.js.map +0 -1
  305. package/dist/tools/multi-items/index.d.ts +0 -18
  306. package/dist/tools/multi-items/index.d.ts.map +0 -1
  307. package/dist/tools/multi-items/index.js +0 -18
  308. package/dist/tools/multi-items/index.js.map +0 -1
  309. package/dist/tools/multi-items/inspect-handler.d.ts +0 -41
  310. package/dist/tools/multi-items/inspect-handler.d.ts.map +0 -1
  311. package/dist/tools/multi-items/inspect-handler.js +0 -50
  312. package/dist/tools/multi-items/inspect-handler.js.map +0 -1
  313. package/dist/tools/multi-items/item-container-map.d.ts +0 -41
  314. package/dist/tools/multi-items/item-container-map.d.ts.map +0 -1
  315. package/dist/tools/multi-items/item-container-map.js +0 -73
  316. package/dist/tools/multi-items/item-container-map.js.map +0 -1
  317. package/dist/tools/pages/builders.d.ts +0 -14
  318. package/dist/tools/pages/builders.d.ts.map +0 -1
  319. package/dist/tools/pages/builders.js +0 -127
  320. package/dist/tools/pages/builders.js.map +0 -1
  321. package/dist/tools/pages/handlers-read.d.ts +0 -33
  322. package/dist/tools/pages/handlers-read.d.ts.map +0 -1
  323. package/dist/tools/pages/handlers-read.js +0 -171
  324. package/dist/tools/pages/handlers-read.js.map +0 -1
  325. package/dist/tools/pages/handlers-write.d.ts +0 -21
  326. package/dist/tools/pages/handlers-write.d.ts.map +0 -1
  327. package/dist/tools/pages/handlers-write.js +0 -52
  328. package/dist/tools/pages/handlers-write.js.map +0 -1
  329. package/dist/tools/pages/index.d.ts +0 -17
  330. package/dist/tools/pages/index.d.ts.map +0 -1
  331. package/dist/tools/pages/index.js +0 -17
  332. package/dist/tools/pages/index.js.map +0 -1
  333. package/dist/tools/pages/schemas.d.ts +0 -30
  334. package/dist/tools/pages/schemas.d.ts.map +0 -1
  335. package/dist/tools/pages/schemas.js +0 -48
  336. package/dist/tools/pages/schemas.js.map +0 -1
  337. package/dist/tools/pages.d.ts +0 -13
  338. package/dist/tools/pages.d.ts.map +0 -1
  339. package/dist/tools/pages.js +0 -13
  340. package/dist/tools/pages.js.map +0 -1
  341. package/dist/tools/pool-resolve-helper.d.ts +0 -83
  342. package/dist/tools/pool-resolve-helper.d.ts.map +0 -1
  343. package/dist/tools/pool-resolve-helper.js +0 -148
  344. package/dist/tools/pool-resolve-helper.js.map +0 -1
  345. package/dist/tools/progress-phases.d.ts +0 -46
  346. package/dist/tools/progress-phases.d.ts.map +0 -1
  347. package/dist/tools/progress-phases.js +0 -48
  348. package/dist/tools/progress-phases.js.map +0 -1
  349. package/dist/tools/shared-schemas.d.ts +0 -25
  350. package/dist/tools/shared-schemas.d.ts.map +0 -1
  351. package/dist/tools/shared-schemas.js +0 -48
  352. package/dist/tools/shared-schemas.js.map +0 -1
  353. package/dist/tools/sources/builders.d.ts +0 -13
  354. package/dist/tools/sources/builders.d.ts.map +0 -1
  355. package/dist/tools/sources/builders.js +0 -115
  356. package/dist/tools/sources/builders.js.map +0 -1
  357. package/dist/tools/sources/handlers-bind.d.ts +0 -28
  358. package/dist/tools/sources/handlers-bind.d.ts.map +0 -1
  359. package/dist/tools/sources/handlers-bind.js +0 -129
  360. package/dist/tools/sources/handlers-bind.js.map +0 -1
  361. package/dist/tools/sources/handlers.d.ts +0 -45
  362. package/dist/tools/sources/handlers.d.ts.map +0 -1
  363. package/dist/tools/sources/handlers.js +0 -91
  364. package/dist/tools/sources/handlers.js.map +0 -1
  365. package/dist/tools/sources/index.d.ts +0 -19
  366. package/dist/tools/sources/index.d.ts.map +0 -1
  367. package/dist/tools/sources/index.js +0 -18
  368. package/dist/tools/sources/index.js.map +0 -1
  369. package/dist/tools/sources.d.ts +0 -14
  370. package/dist/tools/sources.d.ts.map +0 -1
  371. package/dist/tools/sources.js +0 -14
  372. package/dist/tools/sources.js.map +0 -1
  373. package/dist/tools/sparse-fields.d.ts +0 -80
  374. package/dist/tools/sparse-fields.d.ts.map +0 -1
  375. package/dist/tools/sparse-fields.js +0 -144
  376. package/dist/tools/sparse-fields.js.map +0 -1
  377. package/dist/tools/tool-builder/annotations.d.ts +0 -55
  378. package/dist/tools/tool-builder/annotations.d.ts.map +0 -1
  379. package/dist/tools/tool-builder/annotations.js +0 -86
  380. package/dist/tools/tool-builder/annotations.js.map +0 -1
  381. package/dist/tools/tool-builder/define.d.ts +0 -31
  382. package/dist/tools/tool-builder/define.d.ts.map +0 -1
  383. package/dist/tools/tool-builder/define.js +0 -31
  384. package/dist/tools/tool-builder/define.js.map +0 -1
  385. package/dist/tools/tool-builder/index.d.ts +0 -28
  386. package/dist/tools/tool-builder/index.d.ts.map +0 -1
  387. package/dist/tools/tool-builder/index.js +0 -27
  388. package/dist/tools/tool-builder/index.js.map +0 -1
  389. package/dist/tools/tool-builder/results.d.ts +0 -93
  390. package/dist/tools/tool-builder/results.d.ts.map +0 -1
  391. package/dist/tools/tool-builder/results.js +0 -211
  392. package/dist/tools/tool-builder/results.js.map +0 -1
  393. package/dist/tools/tool-builder/types.d.ts +0 -82
  394. package/dist/tools/tool-builder/types.d.ts.map +0 -1
  395. package/dist/tools/tool-builder/types.js +0 -9
  396. package/dist/tools/tool-builder/types.js.map +0 -1
  397. package/dist/tools/tool-builder.d.ts +0 -16
  398. package/dist/tools/tool-builder.d.ts.map +0 -1
  399. package/dist/tools/tool-builder.js +0 -16
  400. package/dist/tools/tool-builder.js.map +0 -1
@@ -1,189 +0,0 @@
1
- /**
2
- * W2 — Secret-Resolver: produce a bearer-token for a `SiteEntryT` at call
3
- * time, supporting either a plain in-file token (`bearer`) or a 1Password
4
- * Secret Reference (`bearer_ref`) resolved through the `op` CLI.
5
- *
6
- * Design choices (per plan §W2):
7
- * - **`execFile`, never `exec`/`spawn` with `shell:true`.** `op read <ref>`
8
- * must run as a direct `execve` with an argv array — no shell, no
9
- * metacharacter expansion. The W1 schema already enforces
10
- * {@link OP_REF_REGEX}; this module re-enforces it at the call site as
11
- * defence-in-depth (a hand-edited sites.json could otherwise sneak a
12
- * payload past validation).
13
- * - **5-second hard timeout.** `op` is interactive in some failure modes
14
- * (Touch-ID, biometric retry). We cap with a real timer + `kill()` to
15
- * avoid agent-loop wedging on a stalled subprocess.
16
- * - **Pluggable for testing.** The OpSecretResolver accepts an injected
17
- * `execFile` callback so tests can mock subprocess invocation without
18
- * monkey-patching the global `node:child_process` module.
19
- *
20
- * @license MIT
21
- */
22
- import { execFile as nodeExecFile } from 'node:child_process';
23
- import { OP_REF_REGEX } from './schema.js';
24
- /** Hard cap for any single `op read` invocation. */
25
- const OP_TIMEOUT_MS = 5_000;
26
- /** `op` CLI exit-code → friendly hint mapping. */
27
- const OP_EXIT_CODE_HINTS = {
28
- 6: 'Not signed in to 1Password CLI. Run `op signin` and retry.',
29
- 1: 'Generic op CLI error — verify the secret reference exists and the vault is accessible.',
30
- };
31
- /** Domain-tagged error so callers (auth, client) can branch on `code`. */
32
- export class SecretResolverError extends Error {
33
- code;
34
- constructor(code, message) {
35
- super(message);
36
- this.code = code;
37
- this.name = 'SecretResolverError';
38
- }
39
- }
40
- /** Default factory wrapping Node's real `execFile`. Adapter for type-shape. */
41
- const defaultExecFile = (file, args, options, callback) => {
42
- // Pass `encoding: 'utf8'` explicitly so stdout/stderr are guaranteed
43
- // strings, not Buffers. The execFile overload resolution returns `string`
44
- // for both when `encoding` is set.
45
- nodeExecFile(file, args, { ...options, encoding: 'utf8' }, (err, stdout, stderr) => {
46
- callback(err, stdout, stderr);
47
- });
48
- };
49
- /**
50
- * Plain in-file bearer — used when `site.bearer` is populated. Returns the
51
- * stored token verbatim, with `source:'plain'`.
52
- */
53
- export class PlainSecretResolver {
54
- async resolve(site) {
55
- const token = site.bearer;
56
- if (token === undefined || token.length === 0) {
57
- throw new SecretResolverError('PLAIN_BEARER_MISSING', `Site '${site.site_id}' has no inline 'bearer' — set one or configure 'bearer_ref'.`);
58
- }
59
- return {
60
- token,
61
- source: 'plain',
62
- };
63
- }
64
- }
65
- /**
66
- * Resolves `bearer_ref` (`op://vault/item/field`) through the 1Password CLI.
67
- *
68
- * Failure surface:
69
- * - Missing `bearer_ref` → `OP_REF_MISSING`
70
- * - Malformed ref at call site → `OP_REF_INVALID`
71
- * - `op` binary not on PATH (ENOENT) → `OP_CLI_MISSING`
72
- * - `op` exit-code 6 (not signed in) → `OP_NOT_SIGNED_IN`
73
- * - 5-second timeout exceeded → `OP_TIMEOUT`
74
- * - Empty/whitespace stdout → `OP_EMPTY_OUTPUT`
75
- * - Any other non-zero exit → `OP_EXEC_FAILED`
76
- */
77
- export class OpSecretResolver {
78
- opBinary;
79
- execFile;
80
- timeoutMs;
81
- constructor(opBinary = 'op', execFile = defaultExecFile, timeoutMs = OP_TIMEOUT_MS) {
82
- this.opBinary = opBinary;
83
- this.execFile = execFile;
84
- this.timeoutMs = timeoutMs;
85
- }
86
- async resolve(site) {
87
- const ref = site.bearer_ref;
88
- if (ref === undefined || ref.length === 0) {
89
- throw new SecretResolverError('OP_REF_MISSING', `Site '${site.site_id}' has no 'bearer_ref' — OpSecretResolver requires one.`);
90
- }
91
- // Defence-in-depth: re-validate the ref shape at the call site,
92
- // BEFORE we hand the string to a subprocess. The W1 schema also
93
- // enforces this on load/save, but a hand-edited or hot-loaded
94
- // sites.json could in theory bypass that.
95
- if (!OP_REF_REGEX.test(ref)) {
96
- throw new SecretResolverError('OP_REF_INVALID', `Site '${site.site_id}' has an invalid 'bearer_ref' shape — must match op://<vault>/<item>/<field>.`);
97
- }
98
- const stdout = await this.runOpRead(ref);
99
- const token = stdout.trim();
100
- if (token.length === 0) {
101
- throw new SecretResolverError('OP_EMPTY_OUTPUT', `op returned empty output for '${ref}' — verify the field exists and is non-empty.`);
102
- }
103
- return {
104
- token,
105
- source: 'op',
106
- };
107
- }
108
- /**
109
- * Invokes `op read <ref>` with a hard timeout. The promise is wrapped
110
- * so a stalled subprocess (e.g. waiting on biometric prompt) cannot
111
- * outlive {@link timeoutMs}.
112
- */
113
- runOpRead(ref) {
114
- return new Promise((resolve, reject) => {
115
- let settled = false;
116
- const timer = setTimeout(() => {
117
- if (settled)
118
- return;
119
- settled = true;
120
- reject(new SecretResolverError('OP_TIMEOUT', `op read '${ref}' exceeded ${this.timeoutMs}ms — is 1Password CLI hung on a biometric prompt?`));
121
- }, this.timeoutMs);
122
- // Allow the test process to exit even if `op` is still pending.
123
- if (typeof timer.unref === 'function')
124
- timer.unref();
125
- this.execFile(this.opBinary, ['read', ref], { timeout: this.timeoutMs, maxBuffer: 1024 * 64 }, (err, stdout, stderr) => {
126
- if (settled)
127
- return;
128
- settled = true;
129
- clearTimeout(timer);
130
- if (err) {
131
- reject(this.mapExecError(err, stderr, ref));
132
- return;
133
- }
134
- resolve(stdout);
135
- });
136
- });
137
- }
138
- mapExecError(err, stderr, ref) {
139
- const codeStr = typeof err.code === 'string' ? err.code : '';
140
- const codeNum = typeof err.code === 'number' ? err.code : NaN;
141
- if (codeStr === 'ENOENT') {
142
- return new SecretResolverError('OP_CLI_MISSING', `op CLI not found in PATH — install 1Password CLI or use plain bearer field instead of bearer_ref.`);
143
- }
144
- // W12-R1.2 (A5-S4): the `op` CLI returns "isn't an item" / "item
145
- // not found" on stderr when the ref points to a nonexistent item.
146
- // Surfaced as generic OP_EXEC_FAILED pre-W12, which left the
147
- // customer guessing whether their ref shape was wrong vs whether
148
- // the item was deleted. Brand it explicitly so the recovery hint
149
- // can name the right knob.
150
- const stderrLower = (stderr || '').toLowerCase();
151
- if (stderrLower.includes(`isn't an item`)
152
- || stderrLower.includes('item not found')) {
153
- return new SecretResolverError('OP_ITEM_NOT_FOUND', `1Password item not found at '${ref}'. `
154
- + 'Verify the ref points to an existing item, or update sites.json bearer_ref.');
155
- }
156
- if (Number.isFinite(codeNum)) {
157
- const hint = OP_EXIT_CODE_HINTS[codeNum];
158
- if (codeNum === 6) {
159
- return new SecretResolverError('OP_NOT_SIGNED_IN', hint ?? `op exited 6 — not signed in.`);
160
- }
161
- return new SecretResolverError('OP_EXEC_FAILED', `op read '${ref}' failed with exit ${codeNum}: ${(stderr || '').trim() || (hint ?? 'no stderr')}`);
162
- }
163
- return new SecretResolverError('OP_EXEC_FAILED', `op read '${ref}' failed: ${err.message}`);
164
- }
165
- }
166
- /**
167
- * Composite resolver — chooses Plain/Op per site at resolve-time. This is
168
- * the resolver wired into the registry in W4; W2 ships it standalone so
169
- * unit tests cover the routing logic in isolation from any caching.
170
- */
171
- export class CompositeSecretResolver {
172
- plain;
173
- op;
174
- constructor(plain = new PlainSecretResolver(), op = new OpSecretResolver()) {
175
- this.plain = plain;
176
- this.op = op;
177
- }
178
- async resolve(site) {
179
- if (site.bearer_ref !== undefined) {
180
- return this.op.resolve(site);
181
- }
182
- return this.plain.resolve(site);
183
- }
184
- }
185
- /** Default factory consumed by the W4 registry / W5 auth pipeline. */
186
- export function defaultSecretResolver() {
187
- return new CompositeSecretResolver();
188
- }
189
- //# sourceMappingURL=secret-resolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secret-resolver.js","sourceRoot":"","sources":["../../src/sites/secret-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAmB,MAAM,aAAa,CAAC;AAE5D,oDAAoD;AACpD,MAAM,aAAa,GAAG,KAAK,CAAC;AAE5B,kDAAkD;AAClD,MAAM,kBAAkB,GAA2B;IAC/C,CAAC,EAAE,4DAA4D;IAC/D,CAAC,EAAE,wFAAwF;CAC9F,CAAC;AAuBF,0EAA0E;AAC1E,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACd;IAA5B,YAA4B,IAAY,EAAE,OAAe;QACrD,KAAK,CAAC,OAAO,CAAC,CAAC;QADS,SAAI,GAAJ,IAAI,CAAQ;QAEpC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACtC,CAAC;CACJ;AAsBD,+EAA+E;AAC/E,MAAM,eAAe,GAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;IACpE,qEAAqE;IACrE,0EAA0E;IAC1E,mCAAmC;IACnC,YAAY,CACR,IAAI,EACJ,IAAgB,EAChB,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAChC,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QACpB,QAAQ,CACJ,GAAmE,EACnE,MAAM,EACN,MAAM,CACT,CAAC;IACN,CAAC,CACJ,CAAC;AACN,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAC5B,KAAK,CAAC,OAAO,CAAC,IAAgB;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B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gB,EAChB,YAAY,GAAG,aAAa,GAAG,CAAC,OAAO,EAAE,CAC5C,CAAC;IACN,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,OAAO,uBAAuB;IAEX;IACA;IAFrB,YACqB,QAAwB,IAAI,mBAAmB,EAAE,EACjD,KAAqB,IAAI,gBAAgB,EAAE;QAD3C,UAAK,GAAL,KAAK,CAA4C;QACjD,OAAE,GAAF,EAAE,CAAyC;IAC7D,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,IAAgB;QAC1B,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACJ;AAED,sEAAsE;AACtE,MAAM,UAAU,qBAAqB;IACjC,OAAO,IAAI,uBAAuB,EAAE,CAAC;AACzC,CAAC"}
@@ -1,82 +0,0 @@
1
- /**
2
- * W1 — Sites-Storage Foundation: load/save the sites file.
3
- *
4
- * Guarantees:
5
- * - **Atomic replace.** Writes go to a sibling `*.tmp.<rand>` file, are
6
- * fsynced, chmod'd to 0600, and then `rename(2)`d over the target.
7
- * A SIGINT/SIGKILL between any two of these steps leaves either the
8
- * old file intact or the new file fully written — never a torn write.
9
- * - **Lock for concurrent writers.** `proper-lockfile` acquires an
10
- * advisory lockfile (`<file>.lock`) before any read/modify/write
11
- * cycle. Default `stale: 10000` ms; second concurrent save retries
12
- * with exponential back-off (`retries: 10, minTimeout: 50`).
13
- * - **0600 mode on write.** The temp file is opened/chmod'd to 0600
14
- * BEFORE the rename so the new inode never exists with looser perms,
15
- * even for one fsync window.
16
- * - **Schema-version gate.** Refuses to load a file with a version we
17
- * don't understand — explicit error, never silent migration.
18
- *
19
- * @license MIT
20
- */
21
- import { type SitesFileT } from './schema.js';
22
- /** Base class for any sites-file IO/format failure. */
23
- export declare class SitesFileError extends Error {
24
- readonly cause?: unknown | undefined;
25
- constructor(message: string, cause?: unknown | undefined);
26
- }
27
- /** Thrown when the on-disk file declares a `schema_version` we don't know. */
28
- export declare class SchemaVersionError extends SitesFileError {
29
- readonly found: unknown;
30
- constructor(found: unknown);
31
- }
32
- /**
33
- * Discriminated lock-acquisition failure. W12-R1.2 (A4-F1): the
34
- * pre-W12 `SitesFileError` collapsed three distinct failure modes into
35
- * one opaque "lock not acquired" string. Operators triaging a stuck
36
- * setup wizard need to distinguish them to choose the right recovery:
37
- *
38
- * - LOCK_TIMEOUT → another setup process is currently writing.
39
- * Wait + retry; do NOT touch the lockfile.
40
- * - LOCK_ORPHAN → stale lock from a crashed prior process.
41
- * Manual `rm <lockfilePath>` is the only fix.
42
- * - LOCK_PERMISSION → the lock dir itself is not writable. Fix
43
- * file-system permissions.
44
- *
45
- * The `lockCode` discriminant + `lockfilePath` field let CLI surfaces
46
- * (and pre-flight automation) emit precise hints.
47
- */
48
- export type SitesFileLockCode = 'LOCK_TIMEOUT' | 'LOCK_ORPHAN' | 'LOCK_PERMISSION';
49
- export declare class SitesFileLockError extends SitesFileError {
50
- readonly lockCode: SitesFileLockCode;
51
- readonly lockfilePath: string;
52
- constructor(lockCode: SitesFileLockCode, lockfilePath: string, message: string, cause?: unknown);
53
- }
54
- /**
55
- * Returns the empty seed used when a sites file does not yet exist.
56
- * Callers (W3 registry) detect "no file → run env-bridge fallback".
57
- */
58
- export declare function emptySitesFile(): SitesFileT;
59
- /**
60
- * Load + validate a sites file.
61
- *
62
- * Returns {@link emptySitesFile} when the path does not exist (no error).
63
- * Throws {@link SchemaVersionError} for a known-unknown version and
64
- * {@link SitesFileError} for JSON-parse or Zod-validation failures.
65
- */
66
- export declare function loadSitesFile(path: string): Promise<SitesFileT>;
67
- /**
68
- * Persist + validate a sites file atomically with chmod 0600.
69
- *
70
- * Pipeline:
71
- * 1. Acquire `<path>.lock` via proper-lockfile (with retries).
72
- * 2. Validate `data` through {@link SitesFile} (rejects bad input
73
- * before touching the filesystem).
74
- * 3. Ensure parent directory exists.
75
- * 4. Write JSON to `<path>.tmp.<pid>.<rand>`, fsync, chmod 0600.
76
- * 5. `renameSync` over `<path>`.
77
- * 6. Release lock.
78
- *
79
- * Tmp-file cleanup on any failure path.
80
- */
81
- export declare function saveSitesFile(path: string, data: SitesFileT): Promise<void>;
82
- //# sourceMappingURL=store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/sites/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAkBH,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzD,uDAAuD;AACvD,qBAAa,cAAe,SAAQ,KAAK;aACQ,KAAK,CAAC,EAAE,OAAO;gBAAhD,OAAO,EAAE,MAAM,EAAkB,KAAK,CAAC,EAAE,OAAO,YAAA;CAI/D;AAED,8EAA8E;AAC9E,qBAAa,kBAAmB,SAAQ,cAAc;aACtB,KAAK,EAAE,OAAO;gBAAd,KAAK,EAAE,OAAO;CAQ7C;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAEnF,qBAAa,kBAAmB,SAAQ,cAAc;aAE9B,QAAQ,EAAE,iBAAiB;aAC3B,YAAY,EAAE,MAAM;gBADpB,QAAQ,EAAE,iBAAiB,EAC3B,YAAY,EAAE,MAAM,EACpC,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,OAAO;CAKtB;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,UAAU,CAE3C;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAiCrE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAoFjF"}
@@ -1,198 +0,0 @@
1
- /**
2
- * W1 — Sites-Storage Foundation: load/save the sites file.
3
- *
4
- * Guarantees:
5
- * - **Atomic replace.** Writes go to a sibling `*.tmp.<rand>` file, are
6
- * fsynced, chmod'd to 0600, and then `rename(2)`d over the target.
7
- * A SIGINT/SIGKILL between any two of these steps leaves either the
8
- * old file intact or the new file fully written — never a torn write.
9
- * - **Lock for concurrent writers.** `proper-lockfile` acquires an
10
- * advisory lockfile (`<file>.lock`) before any read/modify/write
11
- * cycle. Default `stale: 10000` ms; second concurrent save retries
12
- * with exponential back-off (`retries: 10, minTimeout: 50`).
13
- * - **0600 mode on write.** The temp file is opened/chmod'd to 0600
14
- * BEFORE the rename so the new inode never exists with looser perms,
15
- * even for one fsync window.
16
- * - **Schema-version gate.** Refuses to load a file with a version we
17
- * don't understand — explicit error, never silent migration.
18
- *
19
- * @license MIT
20
- */
21
- import { chmodSync, closeSync, existsSync, fsyncSync, mkdirSync, openSync, readFileSync, renameSync, unlinkSync, writeSync, } from 'node:fs';
22
- import { dirname } from 'node:path';
23
- import lockfile from 'proper-lockfile';
24
- import { SitesFile } from './schema.js';
25
- /** Base class for any sites-file IO/format failure. */
26
- export class SitesFileError extends Error {
27
- cause;
28
- constructor(message, cause) {
29
- super(message);
30
- this.cause = cause;
31
- this.name = 'SitesFileError';
32
- }
33
- }
34
- /** Thrown when the on-disk file declares a `schema_version` we don't know. */
35
- export class SchemaVersionError extends SitesFileError {
36
- found;
37
- constructor(found) {
38
- super(`Unsupported sites-file schema_version: ${String(found)}. ` +
39
- `This build supports schema_version: 1. ` +
40
- `Upgrade @wootsup/yt-builder-mcp or revert the file.`);
41
- this.found = found;
42
- this.name = 'SchemaVersionError';
43
- }
44
- }
45
- export class SitesFileLockError extends SitesFileError {
46
- lockCode;
47
- lockfilePath;
48
- constructor(lockCode, lockfilePath, message, cause) {
49
- super(message, cause);
50
- this.lockCode = lockCode;
51
- this.lockfilePath = lockfilePath;
52
- this.name = 'SitesFileLockError';
53
- }
54
- }
55
- /**
56
- * Returns the empty seed used when a sites file does not yet exist.
57
- * Callers (W3 registry) detect "no file → run env-bridge fallback".
58
- */
59
- export function emptySitesFile() {
60
- return { schema_version: 1, default_site_id: null, sites: [] };
61
- }
62
- /**
63
- * Load + validate a sites file.
64
- *
65
- * Returns {@link emptySitesFile} when the path does not exist (no error).
66
- * Throws {@link SchemaVersionError} for a known-unknown version and
67
- * {@link SitesFileError} for JSON-parse or Zod-validation failures.
68
- */
69
- export async function loadSitesFile(path) {
70
- if (!existsSync(path)) {
71
- return emptySitesFile();
72
- }
73
- let raw;
74
- try {
75
- raw = readFileSync(path, 'utf-8');
76
- }
77
- catch (e) {
78
- throw new SitesFileError(`Failed to read sites file at ${path}`, e);
79
- }
80
- let parsed;
81
- try {
82
- parsed = JSON.parse(raw);
83
- }
84
- catch (e) {
85
- throw new SitesFileError(`Sites file at ${path} is not valid JSON`, e);
86
- }
87
- if (typeof parsed === 'object' && parsed !== null
88
- && 'schema_version' in parsed
89
- && parsed.schema_version !== 1) {
90
- throw new SchemaVersionError(parsed.schema_version);
91
- }
92
- const result = SitesFile.safeParse(parsed);
93
- if (!result.success) {
94
- throw new SitesFileError(`Sites file at ${path} failed schema validation: ` +
95
- result.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`).join('; '));
96
- }
97
- return result.data;
98
- }
99
- /**
100
- * Persist + validate a sites file atomically with chmod 0600.
101
- *
102
- * Pipeline:
103
- * 1. Acquire `<path>.lock` via proper-lockfile (with retries).
104
- * 2. Validate `data` through {@link SitesFile} (rejects bad input
105
- * before touching the filesystem).
106
- * 3. Ensure parent directory exists.
107
- * 4. Write JSON to `<path>.tmp.<pid>.<rand>`, fsync, chmod 0600.
108
- * 5. `renameSync` over `<path>`.
109
- * 6. Release lock.
110
- *
111
- * Tmp-file cleanup on any failure path.
112
- */
113
- export async function saveSitesFile(path, data) {
114
- const validated = SitesFile.safeParse(data);
115
- if (!validated.success) {
116
- throw new SitesFileError(`Refusing to write invalid sites file: ` +
117
- validated.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`).join('; '));
118
- }
119
- const dir = dirname(path);
120
- // W12-R1.2 (A2-M3): the on-disk sites file ends up chmod 0600, but
121
- // the parent directory was previously created with the process
122
- // umask — typically 0o755 on Linux/macOS, which is world-readable.
123
- // A world-readable parent dir is harmless for the bearers (they
124
- // live in 0600 files) but DOES leak the existence of a sites.json
125
- // to any local user. Tighten to 0700 (owner-only rwx) on creation.
126
- // Existing directories are left as-is — mkdirSync is a no-op when
127
- // the dir exists, and chmod'ing an existing dir would surprise
128
- // operators who chose a shared location intentionally.
129
- mkdirSync(dir, { recursive: true, mode: 0o700 });
130
- // proper-lockfile defaults to realpath:true, which throws ENOENT for
131
- // a not-yet-existing target. Disable realpath + steer the lock at an
132
- // explicit sibling path. The lock dir always exists (mkdirSync above).
133
- const lockfilePath = `${path}.lock`;
134
- let release;
135
- try {
136
- release = await lockfile.lock(path, {
137
- lockfilePath,
138
- realpath: false,
139
- stale: 10_000,
140
- retries: { retries: 10, minTimeout: 50, maxTimeout: 500, factor: 2 },
141
- });
142
- }
143
- catch (e) {
144
- // W12-R1.2 (A4-F1): map the underlying error code into a
145
- // discriminated lock-failure so callers can render the right
146
- // recovery hint instead of telling the user three possible
147
- // causes at once.
148
- const errCode = e !== null && typeof e === 'object' && 'code' in e
149
- ? e.code
150
- : undefined;
151
- let lockCode;
152
- let hint;
153
- if (errCode === 'ELOCKED') {
154
- lockCode = 'LOCK_TIMEOUT';
155
- hint =
156
- 'Another setup process is currently writing — retry in 30s.';
157
- }
158
- else if (errCode === 'EACCES' || errCode === 'EPERM') {
159
- lockCode = 'LOCK_PERMISSION';
160
- hint = `Cannot write to lock dir. Check permissions on ${dir}.`;
161
- }
162
- else {
163
- lockCode = 'LOCK_ORPHAN';
164
- hint =
165
- `Stale lock from prior crashed process. Remove with: rm ${lockfilePath}`;
166
- }
167
- throw new SitesFileLockError(lockCode, lockfilePath, `Could not acquire lock on ${lockfilePath}. ${hint}`, e);
168
- }
169
- const tmpPath = `${path}.tmp.${process.pid}.${Math.random().toString(36).slice(2, 10)}`;
170
- try {
171
- const fd = openSync(tmpPath, 'w', 0o600);
172
- try {
173
- const payload = JSON.stringify(validated.data, null, 2) + '\n';
174
- writeSync(fd, payload);
175
- fsyncSync(fd);
176
- }
177
- finally {
178
- closeSync(fd);
179
- }
180
- // Belt-and-braces: openSync's mode arg may be umask-clamped on
181
- // some platforms; the explicit chmod guarantees 0600 regardless.
182
- chmodSync(tmpPath, 0o600);
183
- renameSync(tmpPath, path);
184
- }
185
- catch (e) {
186
- // Best-effort tmp cleanup; ignore failures.
187
- try {
188
- if (existsSync(tmpPath))
189
- unlinkSync(tmpPath);
190
- }
191
- catch { /* swallow */ }
192
- throw new SitesFileError(`Failed to write sites file at ${path}`, e);
193
- }
194
- finally {
195
- await release().catch(() => { });
196
- }
197
- }
198
- //# sourceMappingURL=store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/sites/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACH,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AAEzD,uDAAuD;AACvD,MAAM,OAAO,cAAe,SAAQ,KAAK;IACQ;IAA7C,YAAY,OAAe,EAAkB,KAAe;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QAD0B,UAAK,GAAL,KAAK,CAAU;QAExD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC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E,CAAC;YAAS,CAAC;QACP,MAAM,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAA4C,CAAC,CAAC,CAAC;IAC9E,CAAC;AACL,CAAC"}
@@ -1,28 +0,0 @@
1
- /**
2
- * W7 — sites/tools/ aggregator.
3
- *
4
- * Returns the two L1 platform-agnostic site-management tools:
5
- * - `yootheme_builder_sites_list` (registry inspection — no REST)
6
- * - `yootheme_builder_sites_test` (per-site connectivity probe)
7
- *
8
- * Wired into `buildAllTools(pool)` — the aggregator pulls the
9
- * read-only `SiteRegistry` off the pool internally so callers thread
10
- * only the pool through, never the registry separately.
11
- *
12
- * @license MIT
13
- */
14
- import type { ClientPool } from '../client-pool.js';
15
- import type { AnyToolDefinition } from '../../tools/tool-builder.js';
16
- /**
17
- * Build the W7 sites-management tool pair. The pool's read-only
18
- * `registry` accessor feeds `buildSitesListTool` (which never resolves
19
- * a bearer); the pool itself feeds `buildSitesTestTool` (which calls
20
- * `pool.resolve(site_id)` to obtain a `RestClient`).
21
- *
22
- * W12-R1.3 (A1-L-01): single-arg signature — reading the registry off
23
- * the pool inside this aggregator removes the only call-site that
24
- * needed the pool's `registry` getter, so the getter can stay
25
- * `@internal`.
26
- */
27
- export declare function buildSitesTools(pool: ClientPool): readonly AnyToolDefinition[];
28
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sites/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAKrE;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC3B,IAAI,EAAE,UAAU,GACjB,SAAS,iBAAiB,EAAE,CAE9B"}
@@ -1,30 +0,0 @@
1
- /**
2
- * W7 — sites/tools/ aggregator.
3
- *
4
- * Returns the two L1 platform-agnostic site-management tools:
5
- * - `yootheme_builder_sites_list` (registry inspection — no REST)
6
- * - `yootheme_builder_sites_test` (per-site connectivity probe)
7
- *
8
- * Wired into `buildAllTools(pool)` — the aggregator pulls the
9
- * read-only `SiteRegistry` off the pool internally so callers thread
10
- * only the pool through, never the registry separately.
11
- *
12
- * @license MIT
13
- */
14
- import { buildSitesListTool } from './sites-list.js';
15
- import { buildSitesTestTool } from './sites-test.js';
16
- /**
17
- * Build the W7 sites-management tool pair. The pool's read-only
18
- * `registry` accessor feeds `buildSitesListTool` (which never resolves
19
- * a bearer); the pool itself feeds `buildSitesTestTool` (which calls
20
- * `pool.resolve(site_id)` to obtain a `RestClient`).
21
- *
22
- * W12-R1.3 (A1-L-01): single-arg signature — reading the registry off
23
- * the pool inside this aggregator removes the only call-site that
24
- * needed the pool's `registry` getter, so the getter can stay
25
- * `@internal`.
26
- */
27
- export function buildSitesTools(pool) {
28
- return [buildSitesListTool(pool.registry), buildSitesTestTool(pool)];
29
- }
30
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sites/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAC3B,IAAgB;IAEhB,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;AACzE,CAAC"}
@@ -1,48 +0,0 @@
1
- /**
2
- * W7 — `yootheme_builder_sites_list` L1 tool.
3
- *
4
- * Platform-agnostic registry inspection: lists the in-process
5
- * {@link SiteRegistry} as a tabular result so an agent (or a Maria-class
6
- * Claude-Desktop user) can discover which site_ids are wired into this
7
- * MCP server WITHOUT a network round-trip.
8
- *
9
- * Why it does NOT call `pool.resolve()`:
10
- * - The tool reads the registry verbatim and never touches bearers, the
11
- * secret-resolver, or any HTTP endpoint. Resolving through the pool
12
- * would force a default-site requirement that is exactly the
13
- * bootstrap failure-mode the tool is meant to diagnose ("I added
14
- * sites but forgot to mark a default"). For the same reason the
15
- * handler intentionally skips `withSiteMeta` — there is no resolved
16
- * site to stamp; instead we emit a `structuredContent._meta.tool_kind
17
- * = 'registry'` marker so MCP hosts can route the result through a
18
- * registry-aware UI if/when they grow one.
19
- *
20
- * Why `site_id` is exposed but unused:
21
- * - The W5 SITE_ID_SCHEMA pin requires EVERY tool to expose the
22
- * optional `site_id` field so legacy/scripted callers never trip a
23
- * Zod parse on an extra-property. The W12-R1.3 DESCRIPTION_SUFFIX_EXEMPT
24
- * list opts this tool out of the canonical description suffix
25
- * because "operates on the default site" would imply per-row
26
- * filtering that the handler does not perform.
27
- *
28
- * W12-R1.3 (A2-L4): `bearer_source` was previously projected into the
29
- * output row + table column. Even though it carried only the literal
30
- * `'plain'` / `'op'`, the `sites://current` resource already omits
31
- * this field (see ADR rationale in server.ts) and the tool surface
32
- * should match for cross-surface consistency. The field is dropped
33
- * from both the structured row AND the table column.
34
- *
35
- * @license MIT
36
- */
37
- import type { SiteRegistry } from '../registry.js';
38
- import { type AnyToolDefinition } from '../../tools/tool-builder.js';
39
- /**
40
- * Build the W7 `yootheme_builder_sites_list` tool.
41
- *
42
- * Signature accepts the {@link SiteRegistry} directly — unlike other
43
- * tool-builders, it does NOT need the {@link ClientPool} because it
44
- * never resolves a site. Callers wire `buildSitesListTool(pool.registry)`
45
- * from the W7 aggregator (`src/sites/tools/index.ts`).
46
- */
47
- export declare function buildSitesListTool(registry: SiteRegistry): AnyToolDefinition;
48
- //# sourceMappingURL=sites-list.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sites-list.d.ts","sourceRoot":"","sources":["../../../src/sites/tools/sites-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAIH,KAAK,iBAAiB,EACzB,MAAM,6BAA6B,CAAC;AA+BrC;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,iBAAiB,CAmE5E"}