@skillsmith/cli 0.7.2 → 0.7.4

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 (560) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/cli.js +44014 -0
  4. package/package.json +21 -11
  5. package/dist/src/commands/__meta__/telemetry-coverage.test.d.ts +0 -20
  6. package/dist/src/commands/__meta__/telemetry-coverage.test.d.ts.map +0 -1
  7. package/dist/src/commands/__meta__/telemetry-coverage.test.js +0 -118
  8. package/dist/src/commands/__meta__/telemetry-coverage.test.js.map +0 -1
  9. package/dist/src/commands/ab-test.d.ts +0 -29
  10. package/dist/src/commands/ab-test.d.ts.map +0 -1
  11. package/dist/src/commands/ab-test.js +0 -226
  12. package/dist/src/commands/ab-test.js.map +0 -1
  13. package/dist/src/commands/ab-test.test.d.ts +0 -7
  14. package/dist/src/commands/ab-test.test.d.ts.map +0 -1
  15. package/dist/src/commands/ab-test.test.js +0 -255
  16. package/dist/src/commands/ab-test.test.js.map +0 -1
  17. package/dist/src/commands/analyze.d.ts +0 -14
  18. package/dist/src/commands/analyze.d.ts.map +0 -1
  19. package/dist/src/commands/analyze.js +0 -191
  20. package/dist/src/commands/analyze.js.map +0 -1
  21. package/dist/src/commands/audit-collisions.d.ts +0 -68
  22. package/dist/src/commands/audit-collisions.d.ts.map +0 -1
  23. package/dist/src/commands/audit-collisions.js +0 -309
  24. package/dist/src/commands/audit-collisions.js.map +0 -1
  25. package/dist/src/commands/audit-sources.action.d.ts +0 -37
  26. package/dist/src/commands/audit-sources.action.d.ts.map +0 -1
  27. package/dist/src/commands/audit-sources.action.js +0 -321
  28. package/dist/src/commands/audit-sources.action.js.map +0 -1
  29. package/dist/src/commands/audit-sources.d.ts +0 -37
  30. package/dist/src/commands/audit-sources.d.ts.map +0 -1
  31. package/dist/src/commands/audit-sources.js +0 -55
  32. package/dist/src/commands/audit-sources.js.map +0 -1
  33. package/dist/src/commands/audit-sources.test.d.ts +0 -9
  34. package/dist/src/commands/audit-sources.test.d.ts.map +0 -1
  35. package/dist/src/commands/audit-sources.test.js +0 -228
  36. package/dist/src/commands/audit-sources.test.js.map +0 -1
  37. package/dist/src/commands/audit.d.ts +0 -40
  38. package/dist/src/commands/audit.d.ts.map +0 -1
  39. package/dist/src/commands/audit.js +0 -223
  40. package/dist/src/commands/audit.js.map +0 -1
  41. package/dist/src/commands/audit.test.d.ts +0 -8
  42. package/dist/src/commands/audit.test.d.ts.map +0 -1
  43. package/dist/src/commands/audit.test.js +0 -97
  44. package/dist/src/commands/audit.test.js.map +0 -1
  45. package/dist/src/commands/author/index.d.ts +0 -17
  46. package/dist/src/commands/author/index.d.ts.map +0 -1
  47. package/dist/src/commands/author/index.js +0 -21
  48. package/dist/src/commands/author/index.js.map +0 -1
  49. package/dist/src/commands/author/init.action.d.ts +0 -29
  50. package/dist/src/commands/author/init.action.d.ts.map +0 -1
  51. package/dist/src/commands/author/init.action.js +0 -131
  52. package/dist/src/commands/author/init.action.js.map +0 -1
  53. package/dist/src/commands/author/init.d.ts +0 -36
  54. package/dist/src/commands/author/init.d.ts.map +0 -1
  55. package/dist/src/commands/author/init.helpers.d.ts +0 -80
  56. package/dist/src/commands/author/init.helpers.d.ts.map +0 -1
  57. package/dist/src/commands/author/init.helpers.js +0 -107
  58. package/dist/src/commands/author/init.helpers.js.map +0 -1
  59. package/dist/src/commands/author/init.js +0 -320
  60. package/dist/src/commands/author/init.js.map +0 -1
  61. package/dist/src/commands/author/mcp-init.d.ts +0 -21
  62. package/dist/src/commands/author/mcp-init.d.ts.map +0 -1
  63. package/dist/src/commands/author/mcp-init.js +0 -202
  64. package/dist/src/commands/author/mcp-init.js.map +0 -1
  65. package/dist/src/commands/author/subagent.d.ts +0 -23
  66. package/dist/src/commands/author/subagent.d.ts.map +0 -1
  67. package/dist/src/commands/author/subagent.js +0 -174
  68. package/dist/src/commands/author/subagent.js.map +0 -1
  69. package/dist/src/commands/author/transform.d.ts +0 -23
  70. package/dist/src/commands/author/transform.d.ts.map +0 -1
  71. package/dist/src/commands/author/transform.js +0 -149
  72. package/dist/src/commands/author/transform.js.map +0 -1
  73. package/dist/src/commands/author/utils.d.ts +0 -27
  74. package/dist/src/commands/author/utils.d.ts.map +0 -1
  75. package/dist/src/commands/author/utils.js +0 -118
  76. package/dist/src/commands/author/utils.js.map +0 -1
  77. package/dist/src/commands/config.d.ts +0 -57
  78. package/dist/src/commands/config.d.ts.map +0 -1
  79. package/dist/src/commands/config.js +0 -226
  80. package/dist/src/commands/config.js.map +0 -1
  81. package/dist/src/commands/create.d.ts +0 -43
  82. package/dist/src/commands/create.d.ts.map +0 -1
  83. package/dist/src/commands/create.js +0 -336
  84. package/dist/src/commands/create.js.map +0 -1
  85. package/dist/src/commands/diff.d.ts +0 -21
  86. package/dist/src/commands/diff.d.ts.map +0 -1
  87. package/dist/src/commands/diff.js +0 -227
  88. package/dist/src/commands/diff.js.map +0 -1
  89. package/dist/src/commands/diff.test.d.ts +0 -6
  90. package/dist/src/commands/diff.test.d.ts.map +0 -1
  91. package/dist/src/commands/diff.test.js +0 -327
  92. package/dist/src/commands/diff.test.js.map +0 -1
  93. package/dist/src/commands/import-local.d.ts +0 -28
  94. package/dist/src/commands/import-local.d.ts.map +0 -1
  95. package/dist/src/commands/import-local.helpers.d.ts +0 -28
  96. package/dist/src/commands/import-local.helpers.d.ts.map +0 -1
  97. package/dist/src/commands/import-local.helpers.js +0 -166
  98. package/dist/src/commands/import-local.helpers.js.map +0 -1
  99. package/dist/src/commands/import-local.js +0 -273
  100. package/dist/src/commands/import-local.js.map +0 -1
  101. package/dist/src/commands/import-local.types.d.ts +0 -59
  102. package/dist/src/commands/import-local.types.d.ts.map +0 -1
  103. package/dist/src/commands/import-local.types.js +0 -2
  104. package/dist/src/commands/import-local.types.js.map +0 -1
  105. package/dist/src/commands/import.d.ts +0 -47
  106. package/dist/src/commands/import.d.ts.map +0 -1
  107. package/dist/src/commands/import.js +0 -314
  108. package/dist/src/commands/import.js.map +0 -1
  109. package/dist/src/commands/index.d.ts +0 -28
  110. package/dist/src/commands/index.d.ts.map +0 -1
  111. package/dist/src/commands/index.js +0 -50
  112. package/dist/src/commands/index.js.map +0 -1
  113. package/dist/src/commands/info.d.ts +0 -19
  114. package/dist/src/commands/info.d.ts.map +0 -1
  115. package/dist/src/commands/info.js +0 -110
  116. package/dist/src/commands/info.js.map +0 -1
  117. package/dist/src/commands/install-skill.d.ts +0 -16
  118. package/dist/src/commands/install-skill.d.ts.map +0 -1
  119. package/dist/src/commands/install-skill.js +0 -155
  120. package/dist/src/commands/install-skill.js.map +0 -1
  121. package/dist/src/commands/install.d.ts +0 -34
  122. package/dist/src/commands/install.d.ts.map +0 -1
  123. package/dist/src/commands/install.js +0 -311
  124. package/dist/src/commands/install.js.map +0 -1
  125. package/dist/src/commands/inventory.action.d.ts +0 -55
  126. package/dist/src/commands/inventory.action.d.ts.map +0 -1
  127. package/dist/src/commands/inventory.action.js +0 -179
  128. package/dist/src/commands/inventory.action.js.map +0 -1
  129. package/dist/src/commands/inventory.action.test.d.ts +0 -19
  130. package/dist/src/commands/inventory.action.test.d.ts.map +0 -1
  131. package/dist/src/commands/inventory.action.test.js +0 -371
  132. package/dist/src/commands/inventory.action.test.js.map +0 -1
  133. package/dist/src/commands/inventory.d.ts +0 -21
  134. package/dist/src/commands/inventory.d.ts.map +0 -1
  135. package/dist/src/commands/inventory.js +0 -42
  136. package/dist/src/commands/inventory.js.map +0 -1
  137. package/dist/src/commands/login.d.ts +0 -7
  138. package/dist/src/commands/login.d.ts.map +0 -1
  139. package/dist/src/commands/login.js +0 -323
  140. package/dist/src/commands/login.js.map +0 -1
  141. package/dist/src/commands/login.test-helpers.d.ts +0 -7
  142. package/dist/src/commands/login.test-helpers.d.ts.map +0 -1
  143. package/dist/src/commands/login.test-helpers.js +0 -44
  144. package/dist/src/commands/login.test-helpers.js.map +0 -1
  145. package/dist/src/commands/login.test.d.ts +0 -2
  146. package/dist/src/commands/login.test.d.ts.map +0 -1
  147. package/dist/src/commands/login.test.js +0 -387
  148. package/dist/src/commands/login.test.js.map +0 -1
  149. package/dist/src/commands/logout.d.ts +0 -15
  150. package/dist/src/commands/logout.d.ts.map +0 -1
  151. package/dist/src/commands/logout.js +0 -54
  152. package/dist/src/commands/logout.js.map +0 -1
  153. package/dist/src/commands/logout.test.d.ts +0 -8
  154. package/dist/src/commands/logout.test.d.ts.map +0 -1
  155. package/dist/src/commands/logout.test.js +0 -137
  156. package/dist/src/commands/logout.test.js.map +0 -1
  157. package/dist/src/commands/manage.d.ts +0 -19
  158. package/dist/src/commands/manage.d.ts.map +0 -1
  159. package/dist/src/commands/manage.js +0 -346
  160. package/dist/src/commands/manage.js.map +0 -1
  161. package/dist/src/commands/merge.d.ts +0 -24
  162. package/dist/src/commands/merge.d.ts.map +0 -1
  163. package/dist/src/commands/merge.js +0 -168
  164. package/dist/src/commands/merge.js.map +0 -1
  165. package/dist/src/commands/pin.d.ts +0 -26
  166. package/dist/src/commands/pin.d.ts.map +0 -1
  167. package/dist/src/commands/pin.js +0 -138
  168. package/dist/src/commands/pin.js.map +0 -1
  169. package/dist/src/commands/pin.test.d.ts +0 -6
  170. package/dist/src/commands/pin.test.d.ts.map +0 -1
  171. package/dist/src/commands/pin.test.js +0 -206
  172. package/dist/src/commands/pin.test.js.map +0 -1
  173. package/dist/src/commands/recommend-scoring.d.ts +0 -29
  174. package/dist/src/commands/recommend-scoring.d.ts.map +0 -1
  175. package/dist/src/commands/recommend-scoring.js +0 -141
  176. package/dist/src/commands/recommend-scoring.js.map +0 -1
  177. package/dist/src/commands/recommend.d.ts +0 -15
  178. package/dist/src/commands/recommend.d.ts.map +0 -1
  179. package/dist/src/commands/recommend.helpers.d.ts +0 -44
  180. package/dist/src/commands/recommend.helpers.d.ts.map +0 -1
  181. package/dist/src/commands/recommend.helpers.js +0 -303
  182. package/dist/src/commands/recommend.helpers.js.map +0 -1
  183. package/dist/src/commands/recommend.js +0 -198
  184. package/dist/src/commands/recommend.js.map +0 -1
  185. package/dist/src/commands/recommend.types.d.ts +0 -66
  186. package/dist/src/commands/recommend.types.d.ts.map +0 -1
  187. package/dist/src/commands/recommend.types.js +0 -14
  188. package/dist/src/commands/recommend.types.js.map +0 -1
  189. package/dist/src/commands/run-registry-sync.d.ts +0 -31
  190. package/dist/src/commands/run-registry-sync.d.ts.map +0 -1
  191. package/dist/src/commands/run-registry-sync.js +0 -45
  192. package/dist/src/commands/run-registry-sync.js.map +0 -1
  193. package/dist/src/commands/search-formatters.d.ts +0 -36
  194. package/dist/src/commands/search-formatters.d.ts.map +0 -1
  195. package/dist/src/commands/search-formatters.js +0 -132
  196. package/dist/src/commands/search-formatters.js.map +0 -1
  197. package/dist/src/commands/search-types.d.ts +0 -46
  198. package/dist/src/commands/search-types.d.ts.map +0 -1
  199. package/dist/src/commands/search-types.js +0 -12
  200. package/dist/src/commands/search-types.js.map +0 -1
  201. package/dist/src/commands/search.action.d.ts +0 -16
  202. package/dist/src/commands/search.action.d.ts.map +0 -1
  203. package/dist/src/commands/search.action.js +0 -384
  204. package/dist/src/commands/search.action.js.map +0 -1
  205. package/dist/src/commands/search.d.ts +0 -18
  206. package/dist/src/commands/search.d.ts.map +0 -1
  207. package/dist/src/commands/search.helpers.d.ts +0 -52
  208. package/dist/src/commands/search.helpers.d.ts.map +0 -1
  209. package/dist/src/commands/search.helpers.js +0 -95
  210. package/dist/src/commands/search.helpers.js.map +0 -1
  211. package/dist/src/commands/search.js +0 -48
  212. package/dist/src/commands/search.js.map +0 -1
  213. package/dist/src/commands/search.test.d.ts +0 -10
  214. package/dist/src/commands/search.test.d.ts.map +0 -1
  215. package/dist/src/commands/search.test.js +0 -179
  216. package/dist/src/commands/search.test.js.map +0 -1
  217. package/dist/src/commands/sync.action.d.ts +0 -39
  218. package/dist/src/commands/sync.action.d.ts.map +0 -1
  219. package/dist/src/commands/sync.action.js +0 -353
  220. package/dist/src/commands/sync.action.js.map +0 -1
  221. package/dist/src/commands/sync.d.ts +0 -24
  222. package/dist/src/commands/sync.d.ts.map +0 -1
  223. package/dist/src/commands/sync.helpers.d.ts +0 -55
  224. package/dist/src/commands/sync.helpers.d.ts.map +0 -1
  225. package/dist/src/commands/sync.helpers.js +0 -90
  226. package/dist/src/commands/sync.helpers.js.map +0 -1
  227. package/dist/src/commands/sync.js +0 -101
  228. package/dist/src/commands/sync.js.map +0 -1
  229. package/dist/src/commands/telemetry.action.d.ts +0 -38
  230. package/dist/src/commands/telemetry.action.d.ts.map +0 -1
  231. package/dist/src/commands/telemetry.action.js +0 -350
  232. package/dist/src/commands/telemetry.action.js.map +0 -1
  233. package/dist/src/commands/telemetry.d.ts +0 -30
  234. package/dist/src/commands/telemetry.d.ts.map +0 -1
  235. package/dist/src/commands/telemetry.helpers.d.ts +0 -58
  236. package/dist/src/commands/telemetry.helpers.d.ts.map +0 -1
  237. package/dist/src/commands/telemetry.helpers.js +0 -173
  238. package/dist/src/commands/telemetry.helpers.js.map +0 -1
  239. package/dist/src/commands/telemetry.helpers.test.d.ts +0 -15
  240. package/dist/src/commands/telemetry.helpers.test.d.ts.map +0 -1
  241. package/dist/src/commands/telemetry.helpers.test.js +0 -240
  242. package/dist/src/commands/telemetry.helpers.test.js.map +0 -1
  243. package/dist/src/commands/telemetry.js +0 -65
  244. package/dist/src/commands/telemetry.js.map +0 -1
  245. package/dist/src/commands/telemetry.test.d.ts +0 -18
  246. package/dist/src/commands/telemetry.test.d.ts.map +0 -1
  247. package/dist/src/commands/telemetry.test.js +0 -401
  248. package/dist/src/commands/telemetry.test.js.map +0 -1
  249. package/dist/src/commands/whoami.d.ts +0 -15
  250. package/dist/src/commands/whoami.d.ts.map +0 -1
  251. package/dist/src/commands/whoami.js +0 -55
  252. package/dist/src/commands/whoami.js.map +0 -1
  253. package/dist/src/commands/whoami.test.d.ts +0 -8
  254. package/dist/src/commands/whoami.test.d.ts.map +0 -1
  255. package/dist/src/commands/whoami.test.js +0 -133
  256. package/dist/src/commands/whoami.test.js.map +0 -1
  257. package/dist/src/config.d.ts +0 -29
  258. package/dist/src/config.d.ts.map +0 -1
  259. package/dist/src/config.js +0 -34
  260. package/dist/src/config.js.map +0 -1
  261. package/dist/src/index.d.ts +0 -22
  262. package/dist/src/index.d.ts.map +0 -1
  263. package/dist/src/index.js +0 -117
  264. package/dist/src/index.js.map +0 -1
  265. package/dist/src/templates/changelog.md.template.d.ts +0 -8
  266. package/dist/src/templates/changelog.md.template.d.ts.map +0 -1
  267. package/dist/src/templates/changelog.md.template.js +0 -19
  268. package/dist/src/templates/changelog.md.template.js.map +0 -1
  269. package/dist/src/templates/index.d.ts +0 -11
  270. package/dist/src/templates/index.d.ts.map +0 -1
  271. package/dist/src/templates/index.js +0 -11
  272. package/dist/src/templates/index.js.map +0 -1
  273. package/dist/src/templates/mcp-server.template.d.ts +0 -82
  274. package/dist/src/templates/mcp-server.template.d.ts.map +0 -1
  275. package/dist/src/templates/mcp-server.template.js +0 -430
  276. package/dist/src/templates/mcp-server.template.js.map +0 -1
  277. package/dist/src/templates/mcp-server.template.snippets.d.ts +0 -51
  278. package/dist/src/templates/mcp-server.template.snippets.d.ts.map +0 -1
  279. package/dist/src/templates/mcp-server.template.snippets.js +0 -162
  280. package/dist/src/templates/mcp-server.template.snippets.js.map +0 -1
  281. package/dist/src/templates/mcp-template-handlers.d.ts +0 -33
  282. package/dist/src/templates/mcp-template-handlers.d.ts.map +0 -1
  283. package/dist/src/templates/mcp-template-handlers.js +0 -106
  284. package/dist/src/templates/mcp-template-handlers.js.map +0 -1
  285. package/dist/src/templates/mcp-template-types.d.ts +0 -48
  286. package/dist/src/templates/mcp-template-types.d.ts.map +0 -1
  287. package/dist/src/templates/mcp-template-types.js +0 -18
  288. package/dist/src/templates/mcp-template-types.js.map +0 -1
  289. package/dist/src/templates/readme.md.template.d.ts +0 -8
  290. package/dist/src/templates/readme.md.template.d.ts.map +0 -1
  291. package/dist/src/templates/readme.md.template.js +0 -86
  292. package/dist/src/templates/readme.md.template.js.map +0 -1
  293. package/dist/src/templates/skill.md.template.d.ts +0 -8
  294. package/dist/src/templates/skill.md.template.d.ts.map +0 -1
  295. package/dist/src/templates/skill.md.template.js +0 -97
  296. package/dist/src/templates/skill.md.template.js.map +0 -1
  297. package/dist/src/templates/subagent.md.template.d.ts +0 -38
  298. package/dist/src/templates/subagent.md.template.d.ts.map +0 -1
  299. package/dist/src/templates/subagent.md.template.js +0 -128
  300. package/dist/src/templates/subagent.md.template.js.map +0 -1
  301. package/dist/src/utils/errors.d.ts +0 -52
  302. package/dist/src/utils/errors.d.ts.map +0 -1
  303. package/dist/src/utils/errors.js +0 -58
  304. package/dist/src/utils/errors.js.map +0 -1
  305. package/dist/src/utils/formatters.d.ts +0 -39
  306. package/dist/src/utils/formatters.d.ts.map +0 -1
  307. package/dist/src/utils/formatters.js +0 -69
  308. package/dist/src/utils/formatters.js.map +0 -1
  309. package/dist/src/utils/license-types.d.ts +0 -88
  310. package/dist/src/utils/license-types.d.ts.map +0 -1
  311. package/dist/src/utils/license-types.js +0 -60
  312. package/dist/src/utils/license-types.js.map +0 -1
  313. package/dist/src/utils/license-validation.d.ts +0 -61
  314. package/dist/src/utils/license-validation.d.ts.map +0 -1
  315. package/dist/src/utils/license-validation.js +0 -198
  316. package/dist/src/utils/license-validation.js.map +0 -1
  317. package/dist/src/utils/license.d.ts +0 -56
  318. package/dist/src/utils/license.d.ts.map +0 -1
  319. package/dist/src/utils/license.js +0 -163
  320. package/dist/src/utils/license.js.map +0 -1
  321. package/dist/src/utils/license.test.d.ts +0 -7
  322. package/dist/src/utils/license.test.d.ts.map +0 -1
  323. package/dist/src/utils/license.test.js +0 -308
  324. package/dist/src/utils/license.test.js.map +0 -1
  325. package/dist/src/utils/manifest.d.ts +0 -121
  326. package/dist/src/utils/manifest.d.ts.map +0 -1
  327. package/dist/src/utils/manifest.js +0 -133
  328. package/dist/src/utils/manifest.js.map +0 -1
  329. package/dist/src/utils/manifest.test.d.ts +0 -20
  330. package/dist/src/utils/manifest.test.d.ts.map +0 -1
  331. package/dist/src/utils/manifest.test.js +0 -344
  332. package/dist/src/utils/manifest.test.js.map +0 -1
  333. package/dist/src/utils/node-version.d.ts +0 -41
  334. package/dist/src/utils/node-version.d.ts.map +0 -1
  335. package/dist/src/utils/node-version.js +0 -123
  336. package/dist/src/utils/node-version.js.map +0 -1
  337. package/dist/src/utils/open-database.d.ts +0 -35
  338. package/dist/src/utils/open-database.d.ts.map +0 -1
  339. package/dist/src/utils/open-database.js +0 -73
  340. package/dist/src/utils/open-database.js.map +0 -1
  341. package/dist/src/utils/require-tier.d.ts +0 -38
  342. package/dist/src/utils/require-tier.d.ts.map +0 -1
  343. package/dist/src/utils/require-tier.js +0 -74
  344. package/dist/src/utils/require-tier.js.map +0 -1
  345. package/dist/src/utils/sanitize.d.ts +0 -30
  346. package/dist/src/utils/sanitize.d.ts.map +0 -1
  347. package/dist/src/utils/sanitize.js +0 -45
  348. package/dist/src/utils/sanitize.js.map +0 -1
  349. package/dist/src/utils/skill-name.d.ts +0 -19
  350. package/dist/src/utils/skill-name.d.ts.map +0 -1
  351. package/dist/src/utils/skill-name.js +0 -26
  352. package/dist/src/utils/skill-name.js.map +0 -1
  353. package/dist/src/utils/skills-directory.d.ts +0 -95
  354. package/dist/src/utils/skills-directory.d.ts.map +0 -1
  355. package/dist/src/utils/skills-directory.js +0 -285
  356. package/dist/src/utils/skills-directory.js.map +0 -1
  357. package/dist/src/utils/startup-header-gate.d.ts +0 -29
  358. package/dist/src/utils/startup-header-gate.d.ts.map +0 -1
  359. package/dist/src/utils/startup-header-gate.js +0 -44
  360. package/dist/src/utils/startup-header-gate.js.map +0 -1
  361. package/dist/src/utils/startup-header-gate.test.d.ts +0 -2
  362. package/dist/src/utils/startup-header-gate.test.d.ts.map +0 -1
  363. package/dist/src/utils/startup-header-gate.test.js +0 -46
  364. package/dist/src/utils/startup-header-gate.test.js.map +0 -1
  365. package/dist/src/utils/tool-analyzer.d.ts +0 -54
  366. package/dist/src/utils/tool-analyzer.d.ts.map +0 -1
  367. package/dist/src/utils/tool-analyzer.js +0 -156
  368. package/dist/src/utils/tool-analyzer.js.map +0 -1
  369. package/dist/src/version.d.ts +0 -2
  370. package/dist/src/version.d.ts.map +0 -1
  371. package/dist/src/version.js +0 -24
  372. package/dist/src/version.js.map +0 -1
  373. package/dist/tests/audit-collisions.test.d.ts +0 -42
  374. package/dist/tests/audit-collisions.test.d.ts.map +0 -1
  375. package/dist/tests/audit-collisions.test.js +0 -370
  376. package/dist/tests/audit-collisions.test.js.map +0 -1
  377. package/dist/tests/audit-restructure.test.d.ts +0 -15
  378. package/dist/tests/audit-restructure.test.d.ts.map +0 -1
  379. package/dist/tests/audit-restructure.test.js +0 -151
  380. package/dist/tests/audit-restructure.test.js.map +0 -1
  381. package/dist/tests/author.test.d.ts +0 -5
  382. package/dist/tests/author.test.d.ts.map +0 -1
  383. package/dist/tests/author.test.js +0 -653
  384. package/dist/tests/author.test.js.map +0 -1
  385. package/dist/tests/config.test.d.ts +0 -33
  386. package/dist/tests/config.test.d.ts.map +0 -1
  387. package/dist/tests/config.test.js +0 -240
  388. package/dist/tests/config.test.js.map +0 -1
  389. package/dist/tests/create.test.d.ts +0 -5
  390. package/dist/tests/create.test.d.ts.map +0 -1
  391. package/dist/tests/create.test.js +0 -449
  392. package/dist/tests/create.test.js.map +0 -1
  393. package/dist/tests/e2e/audit-sources-affix.test.d.ts +0 -11
  394. package/dist/tests/e2e/audit-sources-affix.test.d.ts.map +0 -1
  395. package/dist/tests/e2e/audit-sources-affix.test.js +0 -121
  396. package/dist/tests/e2e/audit-sources-affix.test.js.map +0 -1
  397. package/dist/tests/e2e/audit-sources-apply.test.d.ts +0 -13
  398. package/dist/tests/e2e/audit-sources-apply.test.d.ts.map +0 -1
  399. package/dist/tests/e2e/audit-sources-apply.test.js +0 -166
  400. package/dist/tests/e2e/audit-sources-apply.test.js.map +0 -1
  401. package/dist/tests/e2e/audit-sources-recovery.test.d.ts +0 -15
  402. package/dist/tests/e2e/audit-sources-recovery.test.d.ts.map +0 -1
  403. package/dist/tests/e2e/audit-sources-recovery.test.js +0 -179
  404. package/dist/tests/e2e/audit-sources-recovery.test.js.map +0 -1
  405. package/dist/tests/e2e/audit-sources-roundtrip.test.d.ts +0 -23
  406. package/dist/tests/e2e/audit-sources-roundtrip.test.d.ts.map +0 -1
  407. package/dist/tests/e2e/audit-sources-roundtrip.test.js +0 -139
  408. package/dist/tests/e2e/audit-sources-roundtrip.test.js.map +0 -1
  409. package/dist/tests/e2e/author.e2e.test.d.ts +0 -9
  410. package/dist/tests/e2e/author.e2e.test.d.ts.map +0 -1
  411. package/dist/tests/e2e/author.e2e.test.js +0 -666
  412. package/dist/tests/e2e/author.e2e.test.js.map +0 -1
  413. package/dist/tests/e2e/import.e2e.test.d.ts +0 -10
  414. package/dist/tests/e2e/import.e2e.test.d.ts.map +0 -1
  415. package/dist/tests/e2e/import.e2e.test.js +0 -213
  416. package/dist/tests/e2e/import.e2e.test.js.map +0 -1
  417. package/dist/tests/e2e/manage.e2e.test.d.ts +0 -9
  418. package/dist/tests/e2e/manage.e2e.test.d.ts.map +0 -1
  419. package/dist/tests/e2e/manage.e2e.test.js +0 -277
  420. package/dist/tests/e2e/manage.e2e.test.js.map +0 -1
  421. package/dist/tests/e2e/search.e2e.test.d.ts +0 -10
  422. package/dist/tests/e2e/search.e2e.test.d.ts.map +0 -1
  423. package/dist/tests/e2e/search.e2e.test.js +0 -324
  424. package/dist/tests/e2e/search.e2e.test.js.map +0 -1
  425. package/dist/tests/e2e/test-config.d.ts +0 -39
  426. package/dist/tests/e2e/test-config.d.ts.map +0 -1
  427. package/dist/tests/e2e/test-config.js +0 -44
  428. package/dist/tests/e2e/test-config.js.map +0 -1
  429. package/dist/tests/e2e/utils/baseline-collector.d.ts +0 -107
  430. package/dist/tests/e2e/utils/baseline-collector.d.ts.map +0 -1
  431. package/dist/tests/e2e/utils/baseline-collector.js +0 -211
  432. package/dist/tests/e2e/utils/baseline-collector.js.map +0 -1
  433. package/dist/tests/e2e/utils/hardcoded-detector.d.ts +0 -46
  434. package/dist/tests/e2e/utils/hardcoded-detector.d.ts.map +0 -1
  435. package/dist/tests/e2e/utils/hardcoded-detector.js +0 -238
  436. package/dist/tests/e2e/utils/hardcoded-detector.js.map +0 -1
  437. package/dist/tests/e2e/utils/index.d.ts +0 -12
  438. package/dist/tests/e2e/utils/index.d.ts.map +0 -1
  439. package/dist/tests/e2e/utils/index.js +0 -12
  440. package/dist/tests/e2e/utils/index.js.map +0 -1
  441. package/dist/tests/e2e/utils/linear-reporter.d.ts +0 -60
  442. package/dist/tests/e2e/utils/linear-reporter.d.ts.map +0 -1
  443. package/dist/tests/e2e/utils/linear-reporter.js +0 -223
  444. package/dist/tests/e2e/utils/linear-reporter.js.map +0 -1
  445. package/dist/tests/e2e/utils/mock-github.d.ts +0 -23
  446. package/dist/tests/e2e/utils/mock-github.d.ts.map +0 -1
  447. package/dist/tests/e2e/utils/mock-github.js +0 -60
  448. package/dist/tests/e2e/utils/mock-github.js.map +0 -1
  449. package/dist/tests/e2e/utils/mock-prompts.d.ts +0 -19
  450. package/dist/tests/e2e/utils/mock-prompts.d.ts.map +0 -1
  451. package/dist/tests/e2e/utils/mock-prompts.js +0 -48
  452. package/dist/tests/e2e/utils/mock-prompts.js.map +0 -1
  453. package/dist/tests/e2e/utils/source-recovery-fixture.d.ts +0 -49
  454. package/dist/tests/e2e/utils/source-recovery-fixture.d.ts.map +0 -1
  455. package/dist/tests/e2e/utils/source-recovery-fixture.js +0 -106
  456. package/dist/tests/e2e/utils/source-recovery-fixture.js.map +0 -1
  457. package/dist/tests/embedding-probe-stdio.test.d.ts +0 -11
  458. package/dist/tests/embedding-probe-stdio.test.d.ts.map +0 -1
  459. package/dist/tests/embedding-probe-stdio.test.js +0 -58
  460. package/dist/tests/embedding-probe-stdio.test.js.map +0 -1
  461. package/dist/tests/import.test.d.ts +0 -5
  462. package/dist/tests/import.test.d.ts.map +0 -1
  463. package/dist/tests/import.test.js +0 -11
  464. package/dist/tests/import.test.js.map +0 -1
  465. package/dist/tests/init.test.d.ts +0 -30
  466. package/dist/tests/init.test.d.ts.map +0 -1
  467. package/dist/tests/init.test.js +0 -357
  468. package/dist/tests/init.test.js.map +0 -1
  469. package/dist/tests/install-multi-client.test.d.ts +0 -2
  470. package/dist/tests/install-multi-client.test.d.ts.map +0 -1
  471. package/dist/tests/install-multi-client.test.js +0 -202
  472. package/dist/tests/install-multi-client.test.js.map +0 -1
  473. package/dist/tests/install-quarantine.test.d.ts +0 -10
  474. package/dist/tests/install-quarantine.test.d.ts.map +0 -1
  475. package/dist/tests/install-quarantine.test.js +0 -86
  476. package/dist/tests/install-quarantine.test.js.map +0 -1
  477. package/dist/tests/install-skill.test.d.ts +0 -8
  478. package/dist/tests/install-skill.test.d.ts.map +0 -1
  479. package/dist/tests/install-skill.test.js +0 -414
  480. package/dist/tests/install-skill.test.js.map +0 -1
  481. package/dist/tests/integration/import-local.test.d.ts +0 -2
  482. package/dist/tests/integration/import-local.test.d.ts.map +0 -1
  483. package/dist/tests/integration/import-local.test.js +0 -158
  484. package/dist/tests/integration/import-local.test.js.map +0 -1
  485. package/dist/tests/license-validation.test.d.ts +0 -8
  486. package/dist/tests/license-validation.test.d.ts.map +0 -1
  487. package/dist/tests/license-validation.test.js +0 -186
  488. package/dist/tests/license-validation.test.js.map +0 -1
  489. package/dist/tests/manage.test.d.ts +0 -5
  490. package/dist/tests/manage.test.d.ts.map +0 -1
  491. package/dist/tests/manage.test.js +0 -495
  492. package/dist/tests/manage.test.js.map +0 -1
  493. package/dist/tests/mcp-server-template.test.d.ts +0 -7
  494. package/dist/tests/mcp-server-template.test.d.ts.map +0 -1
  495. package/dist/tests/mcp-server-template.test.js +0 -372
  496. package/dist/tests/mcp-server-template.test.js.map +0 -1
  497. package/dist/tests/node-version.test.d.ts +0 -8
  498. package/dist/tests/node-version.test.d.ts.map +0 -1
  499. package/dist/tests/node-version.test.js +0 -200
  500. package/dist/tests/node-version.test.js.map +0 -1
  501. package/dist/tests/open-database.test.d.ts +0 -2
  502. package/dist/tests/open-database.test.d.ts.map +0 -1
  503. package/dist/tests/open-database.test.js +0 -77
  504. package/dist/tests/open-database.test.js.map +0 -1
  505. package/dist/tests/recommend-helpers.test.d.ts +0 -9
  506. package/dist/tests/recommend-helpers.test.d.ts.map +0 -1
  507. package/dist/tests/recommend-helpers.test.js +0 -308
  508. package/dist/tests/recommend-helpers.test.js.map +0 -1
  509. package/dist/tests/recommend-scoring.test.d.ts +0 -8
  510. package/dist/tests/recommend-scoring.test.d.ts.map +0 -1
  511. package/dist/tests/recommend-scoring.test.js +0 -184
  512. package/dist/tests/recommend-scoring.test.js.map +0 -1
  513. package/dist/tests/recommend.errors.test.d.ts +0 -8
  514. package/dist/tests/recommend.errors.test.d.ts.map +0 -1
  515. package/dist/tests/recommend.errors.test.js +0 -232
  516. package/dist/tests/recommend.errors.test.js.map +0 -1
  517. package/dist/tests/recommend.filters.test.d.ts +0 -9
  518. package/dist/tests/recommend.filters.test.d.ts.map +0 -1
  519. package/dist/tests/recommend.filters.test.js +0 -235
  520. package/dist/tests/recommend.filters.test.js.map +0 -1
  521. package/dist/tests/recommend.test-helpers.d.ts +0 -66
  522. package/dist/tests/recommend.test-helpers.d.ts.map +0 -1
  523. package/dist/tests/recommend.test-helpers.js +0 -79
  524. package/dist/tests/recommend.test-helpers.js.map +0 -1
  525. package/dist/tests/recommend.test.d.ts +0 -11
  526. package/dist/tests/recommend.test.d.ts.map +0 -1
  527. package/dist/tests/recommend.test.js +0 -320
  528. package/dist/tests/recommend.test.js.map +0 -1
  529. package/dist/tests/search-helpers.test.d.ts +0 -2
  530. package/dist/tests/search-helpers.test.d.ts.map +0 -1
  531. package/dist/tests/search-helpers.test.js +0 -110
  532. package/dist/tests/search-helpers.test.js.map +0 -1
  533. package/dist/tests/search.test.d.ts +0 -5
  534. package/dist/tests/search.test.d.ts.map +0 -1
  535. package/dist/tests/search.test.js +0 -91
  536. package/dist/tests/search.test.js.map +0 -1
  537. package/dist/tests/skills-directory-per-harness.test.d.ts +0 -2
  538. package/dist/tests/skills-directory-per-harness.test.d.ts.map +0 -1
  539. package/dist/tests/skills-directory-per-harness.test.js +0 -116
  540. package/dist/tests/skills-directory-per-harness.test.js.map +0 -1
  541. package/dist/tests/skills-directory.test.d.ts +0 -2
  542. package/dist/tests/skills-directory.test.d.ts.map +0 -1
  543. package/dist/tests/skills-directory.test.js +0 -108
  544. package/dist/tests/skills-directory.test.js.map +0 -1
  545. package/dist/tests/sync.auth-ux.test.d.ts +0 -14
  546. package/dist/tests/sync.auth-ux.test.d.ts.map +0 -1
  547. package/dist/tests/sync.auth-ux.test.js +0 -148
  548. package/dist/tests/sync.auth-ux.test.js.map +0 -1
  549. package/dist/tests/tool-analyzer.test.d.ts +0 -8
  550. package/dist/tests/tool-analyzer.test.d.ts.map +0 -1
  551. package/dist/tests/tool-analyzer.test.js +0 -149
  552. package/dist/tests/tool-analyzer.test.js.map +0 -1
  553. package/dist/tests/unit/commands/install.test.d.ts +0 -7
  554. package/dist/tests/unit/commands/install.test.d.ts.map +0 -1
  555. package/dist/tests/unit/commands/install.test.js +0 -482
  556. package/dist/tests/unit/commands/install.test.js.map +0 -1
  557. package/dist/tests/unit/import-local.helpers.test.d.ts +0 -2
  558. package/dist/tests/unit/import-local.helpers.test.d.ts.map +0 -1
  559. package/dist/tests/unit/import-local.helpers.test.js +0 -96
  560. package/dist/tests/unit/import-local.helpers.test.js.map +0 -1
@@ -1,55 +0,0 @@
1
- /**
2
- * sync command helpers (SMI-4287)
3
- *
4
- * Extracted from `sync.ts` to keep the main command file under the 500-line
5
- * governance ceiling. Covers local-skill adapter scanning and warning
6
- * formatting for the `sync status` subcommand.
7
- */
8
- import { type AdapterError, type SyncResult } from '@skillsmith/core';
9
- /**
10
- * SMI-4482: Detect whether a failed sync was caused by exhausted/absent
11
- * credentials rather than a transient network or server error.
12
- *
13
- * Root cause: on a fresh install (`skillsmith sync` before `skillsmith login`,
14
- * no `SKILLSMITH_API_KEY`) the API client correctly falls back to the public
15
- * Supabase anon key and reaches the anonymous IP-trial path. Once the per-IP
16
- * free-trial limit is exhausted the `skills-search` edge function returns
17
- * HTTP 401 with body `{"error":"Authentication required", ...}`. `SyncEngine`
18
- * surfaces that raw string in `SyncResult.errors`, so the CLI used to print a
19
- * bare `Authentication required` with `Σ Total: 0` and no next step.
20
- *
21
- * This matches the 401 auth signal so `sync.ts` can replace the bare error
22
- * with actionable guidance.
23
- *
24
- * @param result - The `SyncResult` returned by the sync engine.
25
- * @returns `true` when the sync failed solely because no usable credentials
26
- * were available (anonymous trial exhausted or auth rejected).
27
- */
28
- export declare function isAuthFailure(result: SyncResult): boolean;
29
- /**
30
- * SMI-4482: Actionable, multi-line guidance shown when `sync` fails because
31
- * no credentials are available. Replaces the previous bare
32
- * `Error: Authentication required` so the user always has a clear next step.
33
- *
34
- * @returns Lines to print to stderr, in order.
35
- */
36
- export declare function formatAuthGuidance(): string[];
37
- /**
38
- * Scan `~/.claude/skills` for non-fatal adapter warnings.
39
- *
40
- * Pulls `SourceSearchResult.warnings[]` from a fresh LocalFilesystemAdapter
41
- * so `sync status` surfaces symlink-escape / permission / loop issues.
42
- * Returns an empty array if the skills dir does not exist (e.g. fresh
43
- * install) or the adapter fails to initialise — `sync status` must not
44
- * crash just because local skills couldn't be scanned.
45
- */
46
- export declare function scanLocalSkillsForWarnings(): Promise<AdapterError[]>;
47
- /**
48
- * Format adapter warnings for stderr display.
49
- *
50
- * One `chalk.yellow` line per warning with a machine-readable prefix the
51
- * user can grep for: `[symlink-guard]`, `[permission]`, `[loop]`,
52
- * `[not-found]`, `[io]`.
53
- */
54
- export declare function formatAdapterWarnings(warnings: AdapterError[]): string[];
55
- //# sourceMappingURL=sync.helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync.helpers.d.ts","sourceRoot":"","sources":["../../../src/commands/sync.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAgC,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGnG;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAKzD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAK7C;AAED;;;;;;;;GAQG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAiB1E;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAKxE"}
@@ -1,90 +0,0 @@
1
- /**
2
- * sync command helpers (SMI-4287)
3
- *
4
- * Extracted from `sync.ts` to keep the main command file under the 500-line
5
- * governance ceiling. Covers local-skill adapter scanning and warning
6
- * formatting for the `sync status` subcommand.
7
- */
8
- import chalk from 'chalk';
9
- import { createLocalFilesystemAdapter } from '@skillsmith/core';
10
- import { DEFAULT_SKILLS_DIR } from '../config.js';
11
- /**
12
- * SMI-4482: Detect whether a failed sync was caused by exhausted/absent
13
- * credentials rather than a transient network or server error.
14
- *
15
- * Root cause: on a fresh install (`skillsmith sync` before `skillsmith login`,
16
- * no `SKILLSMITH_API_KEY`) the API client correctly falls back to the public
17
- * Supabase anon key and reaches the anonymous IP-trial path. Once the per-IP
18
- * free-trial limit is exhausted the `skills-search` edge function returns
19
- * HTTP 401 with body `{"error":"Authentication required", ...}`. `SyncEngine`
20
- * surfaces that raw string in `SyncResult.errors`, so the CLI used to print a
21
- * bare `Authentication required` with `Σ Total: 0` and no next step.
22
- *
23
- * This matches the 401 auth signal so `sync.ts` can replace the bare error
24
- * with actionable guidance.
25
- *
26
- * @param result - The `SyncResult` returned by the sync engine.
27
- * @returns `true` when the sync failed solely because no usable credentials
28
- * were available (anonymous trial exhausted or auth rejected).
29
- */
30
- export function isAuthFailure(result) {
31
- if (result.success || result.totalProcessed > 0) {
32
- return false;
33
- }
34
- return result.errors.some((error) => /authentication required|unauthorized/i.test(error));
35
- }
36
- /**
37
- * SMI-4482: Actionable, multi-line guidance shown when `sync` fails because
38
- * no credentials are available. Replaces the previous bare
39
- * `Error: Authentication required` so the user always has a clear next step.
40
- *
41
- * @returns Lines to print to stderr, in order.
42
- */
43
- export function formatAuthGuidance() {
44
- return [
45
- chalk.yellow('Sync requires authentication. Run: ') + chalk.cyan('skillsmith login'),
46
- chalk.dim('Or set SKILLSMITH_API_KEY for headless/CI use.'),
47
- ];
48
- }
49
- /**
50
- * Scan `~/.claude/skills` for non-fatal adapter warnings.
51
- *
52
- * Pulls `SourceSearchResult.warnings[]` from a fresh LocalFilesystemAdapter
53
- * so `sync status` surfaces symlink-escape / permission / loop issues.
54
- * Returns an empty array if the skills dir does not exist (e.g. fresh
55
- * install) or the adapter fails to initialise — `sync status` must not
56
- * crash just because local skills couldn't be scanned.
57
- */
58
- export async function scanLocalSkillsForWarnings() {
59
- try {
60
- const adapter = createLocalFilesystemAdapter({
61
- id: 'sync-status-local',
62
- name: 'Local Skills',
63
- type: 'local',
64
- baseUrl: 'file://',
65
- enabled: true,
66
- rootDir: DEFAULT_SKILLS_DIR,
67
- followSymlinks: true,
68
- });
69
- await adapter.initialize();
70
- const result = await adapter.search({});
71
- return result.warnings ?? [];
72
- }
73
- catch {
74
- return [];
75
- }
76
- }
77
- /**
78
- * Format adapter warnings for stderr display.
79
- *
80
- * One `chalk.yellow` line per warning with a machine-readable prefix the
81
- * user can grep for: `[symlink-guard]`, `[permission]`, `[loop]`,
82
- * `[not-found]`, `[io]`.
83
- */
84
- export function formatAdapterWarnings(warnings) {
85
- return warnings.map((warning) => {
86
- const prefix = warning.code === 'symlink-escape' ? 'symlink-guard' : warning.code;
87
- return chalk.yellow(` [${prefix}] ${warning.message}`);
88
- });
89
- }
90
- //# sourceMappingURL=sync.helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync.helpers.js","sourceRoot":"","sources":["../../../src/commands/sync.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,4BAA4B,EAAsC,MAAM,kBAAkB,CAAA;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEjD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,aAAa,CAAC,MAAkB;IAC9C,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,cAAc,GAAG,CAAC,EAAE,CAAC;QAChD,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,uCAAuC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;AAC3F,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL,KAAK,CAAC,MAAM,CAAC,qCAAqC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC;QACpF,KAAK,CAAC,GAAG,CAAC,gDAAgD,CAAC;KAC5D,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B;IAC9C,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,4BAA4B,CAAC;YAC3C,EAAE,EAAE,mBAAmB;YACvB,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,kBAAkB;YAC3B,cAAc,EAAE,IAAI;SACrB,CAAC,CAAA;QACF,MAAM,OAAO,CAAC,UAAU,EAAE,CAAA;QAC1B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACvC,OAAO,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAA;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAwB;IAC5D,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC9B,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAA;QACjF,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,MAAM,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,101 +0,0 @@
1
- /**
2
- * Sync Command - Registry synchronization CLI
3
- *
4
- * Provides commands for syncing the local skill database with the
5
- * live Skillsmith registry.
6
- *
7
- * Usage:
8
- * skillsmith sync # Run sync (differential)
9
- * skillsmith sync --force # Run full sync
10
- * skillsmith sync --dry-run # Preview what would sync
11
- * skillsmith sync status # Show sync status
12
- * skillsmith sync history # Show sync history
13
- * skillsmith sync config # Configure auto-sync
14
- *
15
- * SMI-5127: Action implementations moved to sync.action.ts.
16
- * This file retains only the commander factory functions.
17
- */
18
- import { Command } from 'commander';
19
- import { DEFAULT_DB_PATH } from '../config.js';
20
- import { syncAction, syncStatusAction, syncHistoryAction, syncConfigAction } from './sync.action.js';
21
- /**
22
- * Create sync status subcommand
23
- */
24
- function createStatusCommand() {
25
- return new Command('status')
26
- .description('Show sync status and statistics')
27
- .option('-d, --db <path>', 'Database file path', DEFAULT_DB_PATH)
28
- .option('--json', 'Output as JSON')
29
- .action(async (opts) => {
30
- await syncStatusAction({
31
- dbPath: opts['db'],
32
- json: opts['json'] ?? false,
33
- });
34
- });
35
- }
36
- /**
37
- * Create sync history subcommand
38
- */
39
- function createHistoryCommand() {
40
- return new Command('history')
41
- .description('Show sync history')
42
- .option('-d, --db <path>', 'Database file path', DEFAULT_DB_PATH)
43
- .option('-l, --limit <number>', 'Number of entries to show', '10')
44
- .option('--json', 'Output as JSON')
45
- .action(async (opts) => {
46
- await syncHistoryAction({
47
- dbPath: opts['db'],
48
- limit: parseInt(opts['limit'], 10),
49
- json: opts['json'] ?? false,
50
- });
51
- });
52
- }
53
- /**
54
- * Create sync config subcommand
55
- */
56
- function createConfigCommand() {
57
- return new Command('config')
58
- .description('Configure automatic sync settings')
59
- .option('-d, --db <path>', 'Database file path', DEFAULT_DB_PATH)
60
- .option('--enable', 'Enable automatic background sync')
61
- .option('--disable', 'Disable automatic background sync')
62
- .option('--frequency <freq>', 'Set sync frequency (daily|weekly)')
63
- .option('--show', 'Show current configuration')
64
- .option('--json', 'Output as JSON')
65
- .action(async (opts) => {
66
- await syncConfigAction({
67
- dbPath: opts['db'],
68
- enable: opts['enable'],
69
- disable: opts['disable'],
70
- frequency: opts['frequency'],
71
- show: opts['show'],
72
- json: opts['json'] ?? false,
73
- });
74
- });
75
- }
76
- /**
77
- * Create sync command with subcommands
78
- */
79
- export function createSyncCommand() {
80
- const cmd = new Command('sync')
81
- .description('Synchronize skills from the Skillsmith registry')
82
- .option('-d, --db <path>', 'Database file path', DEFAULT_DB_PATH)
83
- .option('-f, --force', 'Force full sync (ignore last sync time)')
84
- .option('--dry-run', 'Show what would be synced without making changes')
85
- .option('--json', 'Output results as JSON')
86
- .action(async (opts) => {
87
- await syncAction({
88
- dbPath: opts['db'],
89
- force: opts['force'] ?? false,
90
- dryRun: opts['dry-run'] ?? false,
91
- json: opts['json'] ?? false,
92
- });
93
- });
94
- // Add subcommands
95
- cmd.addCommand(createStatusCommand());
96
- cmd.addCommand(createHistoryCommand());
97
- cmd.addCommand(createConfigCommand());
98
- return cmd;
99
- }
100
- export default createSyncCommand;
101
- //# sourceMappingURL=sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../src/commands/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEpG;;GAEG;AACH,SAAS,mBAAmB;IAC1B,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC;SACzB,WAAW,CAAC,iCAAiC,CAAC;SAC9C,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,eAAe,CAAC;SAChE,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,KAAK,EAAE,IAAkD,EAAE,EAAE;QACnE,MAAM,gBAAgB,CAAC;YACrB,MAAM,EAAE,IAAI,CAAC,IAAI,CAAW;YAC5B,IAAI,EAAG,IAAI,CAAC,MAAM,CAAa,IAAI,KAAK;SACzC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACN,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB;IAC3B,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC;SAC1B,WAAW,CAAC,mBAAmB,CAAC;SAChC,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,eAAe,CAAC;SAChE,MAAM,CAAC,sBAAsB,EAAE,2BAA2B,EAAE,IAAI,CAAC;SACjE,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,KAAK,EAAE,IAAkD,EAAE,EAAE;QACnE,MAAM,iBAAiB,CAAC;YACtB,MAAM,EAAE,IAAI,CAAC,IAAI,CAAW;YAC5B,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAW,EAAE,EAAE,CAAC;YAC5C,IAAI,EAAG,IAAI,CAAC,MAAM,CAAa,IAAI,KAAK;SACzC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACN,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB;IAC1B,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC;SACzB,WAAW,CAAC,mCAAmC,CAAC;SAChD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,eAAe,CAAC;SAChE,MAAM,CAAC,UAAU,EAAE,kCAAkC,CAAC;SACtD,MAAM,CAAC,WAAW,EAAE,mCAAmC,CAAC;SACxD,MAAM,CAAC,oBAAoB,EAAE,mCAAmC,CAAC;SACjE,MAAM,CAAC,QAAQ,EAAE,4BAA4B,CAAC;SAC9C,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,KAAK,EAAE,IAAkD,EAAE,EAAE;QACnE,MAAM,gBAAgB,CAAC;YACrB,MAAM,EAAE,IAAI,CAAC,IAAI,CAAW;YAC5B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAwB;YAC7C,OAAO,EAAE,IAAI,CAAC,SAAS,CAAwB;YAC/C,SAAS,EAAE,IAAI,CAAC,WAAW,CAAuB;YAClD,IAAI,EAAE,IAAI,CAAC,MAAM,CAAwB;YACzC,IAAI,EAAG,IAAI,CAAC,MAAM,CAAa,IAAI,KAAK;SACzC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACN,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;SAC5B,WAAW,CAAC,iDAAiD,CAAC;SAC9D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,eAAe,CAAC;SAChE,MAAM,CAAC,aAAa,EAAE,yCAAyC,CAAC;SAChE,MAAM,CAAC,WAAW,EAAE,kDAAkD,CAAC;SACvE,MAAM,CAAC,QAAQ,EAAE,wBAAwB,CAAC;SAC1C,MAAM,CAAC,KAAK,EAAE,IAAkD,EAAE,EAAE;QACnE,MAAM,UAAU,CAAC;YACf,MAAM,EAAE,IAAI,CAAC,IAAI,CAAW;YAC5B,KAAK,EAAG,IAAI,CAAC,OAAO,CAAa,IAAI,KAAK;YAC1C,MAAM,EAAG,IAAI,CAAC,SAAS,CAAa,IAAI,KAAK;YAC7C,IAAI,EAAG,IAAI,CAAC,MAAM,CAAa,IAAI,KAAK;SACzC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEJ,kBAAkB;IAClB,GAAG,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAA;IACrC,GAAG,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAA;IACtC,GAAG,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAA;IAErC,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,eAAe,iBAAiB,CAAA"}
@@ -1,38 +0,0 @@
1
- /**
2
- * @fileoverview `skillsmith telemetry` action implementations + telemetry wrappers.
3
- * @module @skillsmith/cli/commands/telemetry.action
4
- * @see SMI-5128 batch D — sibling-split of telemetry.ts so the 6 subcommand
5
- * handlers can be wrapped with withTelemetry without exceeding the 500-LOC
6
- * gate. Mirrors the sync.action.ts / search.action.ts convention (SMI-5127):
7
- * the run* business logic + the wrapped *Action exports live here; the
8
- * commander factory stays in telemetry.ts and imports the wrapped actions.
9
- *
10
- * Privacy invariants (plan line 719):
11
- * - anonymousId is NEVER printed in full. Only the last 8 hex chars appear in stdout.
12
- * - The full SHA-256 hex travels only to the events endpoint in hook payloads.
13
- */
14
- declare function idTail(id: string | undefined): string;
15
- declare function runEnable(): Promise<void>;
16
- declare function runDisable(): Promise<void>;
17
- declare function runStatus(): Promise<void>;
18
- declare function runInstallHook(options: {
19
- scope: 'user' | 'project';
20
- endpoint?: string;
21
- }): Promise<void>;
22
- declare function runUninstallHook(options: {
23
- scope: 'user' | 'project';
24
- }): Promise<void>;
25
- declare function runResetId(): Promise<void>;
26
- export declare const telemetryEnableAction: () => Promise<void>;
27
- export declare const telemetryDisableAction: () => Promise<void>;
28
- export declare const telemetryStatusAction: () => Promise<void>;
29
- export declare const telemetryInstallHookAction: (options: {
30
- scope: string;
31
- endpoint?: string;
32
- }) => Promise<void>;
33
- export declare const telemetryUninstallHookAction: (options: {
34
- scope: string;
35
- }) => Promise<void>;
36
- export declare const telemetryResetIdAction: () => Promise<void>;
37
- export { runEnable, runDisable, runStatus, runInstallHook, runUninstallHook, runResetId, idTail };
38
- //# sourceMappingURL=telemetry.action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"telemetry.action.d.ts","sourceRoot":"","sources":["../../../src/commands/telemetry.action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAmDH,iBAAS,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAG9C;AA8BD,iBAAe,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAgCxC;AAMD,iBAAe,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAkBzC;AAMD,iBAAe,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAyDxC;AAMD,iBAAe,cAAc,CAAC,OAAO,EAAE;IACrC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwDhB;AAMD,iBAAe,gBAAgB,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBrF;AAMD,iBAAe,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAezC;AAeD,eAAO,MAAM,qBAAqB,qBAIhC,CAAA;AAWF,eAAO,MAAM,sBAAsB,qBAIjC,CAAA;AAWF,eAAO,MAAM,qBAAqB,qBAIhC,CAAA;AAsBF,eAAO,MAAM,0BAA0B;WAnB9B,MAAM;eACF,MAAM;mBAsBjB,CAAA;AAYF,eAAO,MAAM,4BAA4B;WAVyB,MAAM;mBActE,CAAA;AAWF,eAAO,MAAM,sBAAsB,qBAIjC,CAAA;AAGF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA"}
@@ -1,350 +0,0 @@
1
- /**
2
- * @fileoverview `skillsmith telemetry` action implementations + telemetry wrappers.
3
- * @module @skillsmith/cli/commands/telemetry.action
4
- * @see SMI-5128 batch D — sibling-split of telemetry.ts so the 6 subcommand
5
- * handlers can be wrapped with withTelemetry without exceeding the 500-LOC
6
- * gate. Mirrors the sync.action.ts / search.action.ts convention (SMI-5127):
7
- * the run* business logic + the wrapped *Action exports live here; the
8
- * commander factory stays in telemetry.ts and imports the wrapped actions.
9
- *
10
- * Privacy invariants (plan line 719):
11
- * - anonymousId is NEVER printed in full. Only the last 8 hex chars appear in stdout.
12
- * - The full SHA-256 hex travels only to the events endpoint in hook payloads.
13
- */
14
- import { existsSync, copyFileSync, chmodSync, mkdirSync } from 'node:fs';
15
- import { homedir } from 'node:os';
16
- import { join, dirname } from 'node:path';
17
- import { fileURLToPath } from 'node:url';
18
- import { readdirSync, unlinkSync, statSync } from 'node:fs';
19
- const __dirname = dirname(fileURLToPath(import.meta.url));
20
- import chalk from 'chalk';
21
- import { loadManifest, saveManifest, generateAnonymousId, shouldRotateAnonymousId, rotateAnonymousId, sweepExpiredPreviousId, } from '../utils/manifest.js';
22
- import { loadClaudeSettings, addSkillHookEntries, removeSkillHookEntries, writeClaudeSettings, TelemetryHookError, } from './telemetry.helpers.js';
23
- import { sanitizeError } from '../utils/sanitize.js';
24
- import { withTelemetry } from '@skillsmith/core/telemetry';
25
- // ---------------------------------------------------------------------------
26
- // Constants
27
- // ---------------------------------------------------------------------------
28
- const PRIVACY_URL = 'https://skillsmith.app/privacy#telemetry';
29
- const DEFAULT_ENDPOINT = 'https://vrcnzpmndtroqxxoqkzy.supabase.co/functions/v1/events';
30
- const ORPHAN_TTL_MS = 60 * 60 * 1000; // 1 hour
31
- // All path helpers resolved at call time so test harnesses that swap HOME work.
32
- function hookScriptPath() {
33
- return join(homedir(), '.skillsmith', 'hooks', 'skill-telemetry.sh');
34
- }
35
- function runDir() {
36
- return join(homedir(), '.skillsmith', 'run');
37
- }
38
- // ---------------------------------------------------------------------------
39
- // Privacy helper — NEVER print full anonymousId
40
- // ---------------------------------------------------------------------------
41
- function idTail(id) {
42
- if (!id)
43
- return '(none)';
44
- return `...${id.slice(-8)}`;
45
- }
46
- // ---------------------------------------------------------------------------
47
- // Orphan GC (plan line 714)
48
- // ---------------------------------------------------------------------------
49
- function gcOrphanRunFiles() {
50
- try {
51
- const dir = runDir();
52
- if (!existsSync(dir))
53
- return;
54
- const now = Date.now();
55
- for (const f of readdirSync(dir)) {
56
- if (!f.startsWith('skill-'))
57
- continue;
58
- const fp = join(dir, f);
59
- try {
60
- const st = statSync(fp);
61
- if (now - st.mtimeMs > ORPHAN_TTL_MS)
62
- unlinkSync(fp);
63
- }
64
- catch {
65
- // best-effort
66
- }
67
- }
68
- }
69
- catch {
70
- // never throw from GC
71
- }
72
- }
73
- // ---------------------------------------------------------------------------
74
- // enable
75
- // ---------------------------------------------------------------------------
76
- async function runEnable() {
77
- const manifest = await loadManifest();
78
- const t = manifest.telemetry ?? { enabled: false };
79
- if (t.enabled) {
80
- console.log(chalk.green('Telemetry is already enabled.'));
81
- console.log(chalk.dim(` Anonymous ID tail: ${idTail(t.anonymousId)}`));
82
- return;
83
- }
84
- const now = new Date().toISOString();
85
- const updated = {
86
- ...t,
87
- enabled: true,
88
- anonymousId: t.anonymousId ?? generateAnonymousId(),
89
- anonymousIdCreatedAt: t.anonymousIdCreatedAt ?? now,
90
- scope: t.scope ?? 'personal',
91
- endpoint: t.endpoint ?? DEFAULT_ENDPOINT,
92
- };
93
- await saveManifest({ ...manifest, telemetry: updated });
94
- console.log(chalk.green('Telemetry enabled.'));
95
- console.log();
96
- console.log('Skillsmith telemetry collects anonymous skill-invocation counts to help improve\n' +
97
- 'the registry and surface stale skills. No personal data, file contents, or\n' +
98
- `paths are captured. Full privacy policy: ${chalk.cyan(PRIVACY_URL)}`);
99
- console.log();
100
- console.log(chalk.dim(` Anonymous ID tail: ${idTail(updated.anonymousId)}`));
101
- console.log(chalk.dim(' Disable at any time: ') + chalk.cyan('skillsmith telemetry disable'));
102
- }
103
- // ---------------------------------------------------------------------------
104
- // disable
105
- // ---------------------------------------------------------------------------
106
- async function runDisable() {
107
- const manifest = await loadManifest();
108
- const t = manifest.telemetry ?? { enabled: false };
109
- if (!t.enabled) {
110
- console.log(chalk.dim('Telemetry is already disabled.'));
111
- return;
112
- }
113
- await saveManifest({ ...manifest, telemetry: { ...t, enabled: false } });
114
- console.log(chalk.yellow('Telemetry disabled.'));
115
- console.log(chalk.dim(' The anonymous ID is retained in the local manifest for continuity if you re-enable.\n' +
116
- ' To fully clear it: skillsmith telemetry reset-id'));
117
- }
118
- // ---------------------------------------------------------------------------
119
- // status
120
- // ---------------------------------------------------------------------------
121
- async function runStatus() {
122
- let manifest = await loadManifest();
123
- let rotationTriggered = false;
124
- // Annual auto-rotation (plan line 706, 713)
125
- if (shouldRotateAnonymousId(manifest)) {
126
- const rotated = rotateAnonymousId(manifest);
127
- manifest = { ...manifest, telemetry: rotated };
128
- await saveManifest(manifest);
129
- rotationTriggered = true;
130
- }
131
- // Sweep expired previous id
132
- const swept = sweepExpiredPreviousId(manifest);
133
- if (swept !== manifest.telemetry) {
134
- manifest = { ...manifest, telemetry: swept };
135
- await saveManifest(manifest);
136
- }
137
- // GC orphan run files (plan line 714)
138
- gcOrphanRunFiles();
139
- const t = manifest.telemetry ?? { enabled: false };
140
- const endpoint = t.endpoint ?? DEFAULT_ENDPOINT;
141
- let ageDays = null;
142
- if (t.anonymousIdCreatedAt) {
143
- ageDays = Math.floor((Date.now() - new Date(t.anonymousIdCreatedAt).getTime()) / 86_400_000);
144
- }
145
- console.log(chalk.bold('Skillsmith Telemetry Status'));
146
- console.log();
147
- console.log(` Enabled: ${t.enabled ? chalk.green('yes') : chalk.dim('no')}`);
148
- console.log(` Endpoint: ${chalk.dim(endpoint)}`);
149
- console.log(` Anonymous ID: ${chalk.dim(idTail(t.anonymousId))}`);
150
- console.log(` ID age (days): ${ageDays !== null ? String(ageDays) : chalk.dim('n/a')}`);
151
- console.log(` Scope: ${t.scope ?? chalk.dim('personal')}`);
152
- if (t.installedAt) {
153
- console.log(` Hook installed: ${chalk.dim(t.installedAt)}`);
154
- }
155
- if (rotationTriggered) {
156
- console.log();
157
- console.log(chalk.yellow(' Annual rotation triggered.') +
158
- chalk.dim(' New ID tail: ') +
159
- chalk.cyan(idTail(t.anonymousId)));
160
- if (t.previousAnonymousId) {
161
- console.log(chalk.dim(` Previous ID retained for 7-day overlap window (retired: ${t.previousAnonymousIdRetiredAt ?? 'unknown'})`));
162
- }
163
- }
164
- }
165
- // ---------------------------------------------------------------------------
166
- // install-hook
167
- // ---------------------------------------------------------------------------
168
- async function runInstallHook(options) {
169
- // Resolve the template source — relative to this file's compiled output.
170
- // src/commands/telemetry.action.ts → ../../templates/skill-telemetry.sh (via dist/commands)
171
- // and one level up for the src layout during tests.
172
- const templateCandidates = [
173
- join(__dirname, '..', '..', 'templates', 'skill-telemetry.sh'),
174
- join(__dirname, '..', 'templates', 'skill-telemetry.sh'),
175
- ];
176
- const templateSrc = templateCandidates.find((p) => existsSync(p));
177
- if (!templateSrc) {
178
- throw new Error('skill-telemetry.sh template not found. ' +
179
- 'Ensure the CLI package is fully built: npm run build');
180
- }
181
- // Load + validate settings.json — throws TelemetryHookError on foreign Skill matcher
182
- const scope = options.scope;
183
- const settings = loadClaudeSettings(scope);
184
- const hookPath = hookScriptPath();
185
- const updated = addSkillHookEntries(settings, hookPath);
186
- // Copy hook script to ~/.skillsmith/hooks/
187
- const destPath = hookScriptPath();
188
- const hooksDir = dirname(destPath);
189
- mkdirSync(hooksDir, { recursive: true, mode: 0o700 });
190
- copyFileSync(templateSrc, destPath);
191
- try {
192
- chmodSync(destPath, 0o755);
193
- }
194
- catch {
195
- // best-effort on Windows
196
- }
197
- // Persist settings.json atomically
198
- writeClaudeSettings(scope, updated);
199
- // Record installation timestamp in manifest
200
- const manifest = await loadManifest();
201
- const t = manifest.telemetry ?? { enabled: false };
202
- await saveManifest({ ...manifest, telemetry: { ...t, installedAt: new Date().toISOString() } });
203
- // Update endpoint in manifest if provided
204
- if (options.endpoint) {
205
- const m2 = await loadManifest();
206
- const t2 = m2.telemetry ?? { enabled: false };
207
- await saveManifest({ ...m2, telemetry: { ...t2, endpoint: options.endpoint } });
208
- }
209
- const scopeLabel = scope === 'user' ? '~/.claude/settings.json' : './.claude/settings.json';
210
- console.log(chalk.green('Skillsmith telemetry hook installed.'));
211
- console.log(chalk.dim(` Hook script: ${destPath}`));
212
- console.log(chalk.dim(` Settings file: ${scopeLabel}`));
213
- console.log();
214
- console.log(chalk.dim('Enable telemetry to start collecting: ') + chalk.cyan('skillsmith telemetry enable'));
215
- }
216
- // ---------------------------------------------------------------------------
217
- // uninstall-hook
218
- // ---------------------------------------------------------------------------
219
- async function runUninstallHook(options) {
220
- const scope = options.scope;
221
- const hookPath = hookScriptPath();
222
- const settings = loadClaudeSettings(scope);
223
- const updated = removeSkillHookEntries(settings, hookPath);
224
- writeClaudeSettings(scope, updated);
225
- // Optionally remove the script file
226
- try {
227
- const scriptPath = hookScriptPath();
228
- if (existsSync(scriptPath))
229
- unlinkSync(scriptPath);
230
- }
231
- catch {
232
- // best-effort
233
- }
234
- const scopeLabel = scope === 'user' ? '~/.claude/settings.json' : './.claude/settings.json';
235
- console.log(chalk.yellow('Skillsmith telemetry hook removed.'));
236
- console.log(chalk.dim(` Removed from: ${scopeLabel}`));
237
- console.log(chalk.dim(' Foreign hooks (if any) were not touched.'));
238
- }
239
- // ---------------------------------------------------------------------------
240
- // reset-id
241
- // ---------------------------------------------------------------------------
242
- async function runResetId() {
243
- const manifest = await loadManifest();
244
- const rotated = rotateAnonymousId(manifest); // unconditional rotation
245
- await saveManifest({ ...manifest, telemetry: rotated });
246
- console.log(chalk.green('Anonymous ID rotated.'));
247
- console.log(chalk.dim(` New ID tail: ${idTail(rotated.anonymousId)}`));
248
- if (rotated.previousAnonymousId) {
249
- console.log(chalk.dim(` Previous ID tail: ${idTail(rotated.previousAnonymousId)}`));
250
- console.log(chalk.dim(` Previous ID retirement: ${rotated.previousAnonymousIdRetiredAt ?? 'unknown'} (7-day overlap window)`));
251
- }
252
- }
253
- // ---------------------------------------------------------------------------
254
- // withTelemetry-wrapped action handlers (SMI-5128)
255
- // ---------------------------------------------------------------------------
256
- async function telemetryEnableActionImpl() {
257
- try {
258
- await runEnable();
259
- }
260
- catch (err) {
261
- console.error(chalk.red('Error:'), sanitizeError(err));
262
- process.exit(1);
263
- }
264
- }
265
- export const telemetryEnableAction = withTelemetry(telemetryEnableActionImpl, {
266
- source: 'cli',
267
- extractSkillId: () => 'telemetry enable',
268
- extractFramework: () => 'cli',
269
- });
270
- async function telemetryDisableActionImpl() {
271
- try {
272
- await runDisable();
273
- }
274
- catch (err) {
275
- console.error(chalk.red('Error:'), sanitizeError(err));
276
- process.exit(1);
277
- }
278
- }
279
- export const telemetryDisableAction = withTelemetry(telemetryDisableActionImpl, {
280
- source: 'cli',
281
- extractSkillId: () => 'telemetry disable',
282
- extractFramework: () => 'cli',
283
- });
284
- async function telemetryStatusActionImpl() {
285
- try {
286
- await runStatus();
287
- }
288
- catch (err) {
289
- console.error(chalk.red('Error:'), sanitizeError(err));
290
- process.exit(1);
291
- }
292
- }
293
- export const telemetryStatusAction = withTelemetry(telemetryStatusActionImpl, {
294
- source: 'cli',
295
- extractSkillId: () => 'telemetry status',
296
- extractFramework: () => 'cli',
297
- });
298
- async function telemetryInstallHookActionImpl(options) {
299
- const scope = options.scope === 'project' ? 'project' : 'user';
300
- try {
301
- await runInstallHook(options.endpoint !== undefined ? { scope, endpoint: options.endpoint } : { scope });
302
- }
303
- catch (err) {
304
- if (err instanceof TelemetryHookError) {
305
- console.error(chalk.red(`Error [${err.code}]:`));
306
- console.error(err.message);
307
- }
308
- else {
309
- console.error(chalk.red('Error:'), sanitizeError(err));
310
- }
311
- process.exit(1);
312
- }
313
- }
314
- export const telemetryInstallHookAction = withTelemetry(telemetryInstallHookActionImpl, {
315
- source: 'cli',
316
- extractSkillId: () => 'telemetry install-hook',
317
- extractFramework: () => 'cli',
318
- });
319
- async function telemetryUninstallHookActionImpl(options) {
320
- const scope = options.scope === 'project' ? 'project' : 'user';
321
- try {
322
- await runUninstallHook({ scope });
323
- }
324
- catch (err) {
325
- console.error(chalk.red('Error:'), sanitizeError(err));
326
- process.exit(1);
327
- }
328
- }
329
- export const telemetryUninstallHookAction = withTelemetry(telemetryUninstallHookActionImpl, {
330
- source: 'cli',
331
- extractSkillId: () => 'telemetry uninstall-hook',
332
- extractFramework: () => 'cli',
333
- });
334
- async function telemetryResetIdActionImpl() {
335
- try {
336
- await runResetId();
337
- }
338
- catch (err) {
339
- console.error(chalk.red('Error:'), sanitizeError(err));
340
- process.exit(1);
341
- }
342
- }
343
- export const telemetryResetIdAction = withTelemetry(telemetryResetIdActionImpl, {
344
- source: 'cli',
345
- extractSkillId: () => 'telemetry reset-id',
346
- extractFramework: () => 'cli',
347
- });
348
- // Internal exports for tests (re-exported from telemetry.ts for back-compat).
349
- export { runEnable, runDisable, runStatus, runInstallHook, runUninstallHook, runResetId, idTail };
350
- //# sourceMappingURL=telemetry.action.js.map