@skillsmith/cli 0.7.2 → 0.7.3

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 +5 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/cli.js +44039 -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,285 +0,0 @@
1
- /**
2
- * SMI-2713: Extracted from manage.ts — helpers for reading installed skills
3
- * from the global and local ~/.claude/skills directories.
4
- */
5
- import { readdir, readFile, realpath, stat } from 'fs/promises';
6
- import { createHash } from 'crypto';
7
- import { join } from 'path';
8
- import { SkillParser, SkillVersionRepository, } from '@skillsmith/core';
9
- import { openCliDatabase } from './open-database.js';
10
- import { CANONICAL_CLIENT, CLIENT_IDS, CLIENT_NATIVE_PATHS, } from '@skillsmith/core/install';
11
- import { DEFAULT_DB_PATH } from '../config.js';
12
- /**
13
- * SMI-1630 + SMI-4578: discovery scans every client directory
14
- * (`CLIENT_NATIVE_PATHS`) plus repo-local `./.claude/skills`. Local
15
- * skills take precedence over global; canonical (`claude-code`) takes
16
- * precedence over secondary clients. See `getInstalledSkills` below.
17
- */
18
- /**
19
- * Returns the local skills directory path.
20
- * Computed at call time to handle working directory changes.
21
- */
22
- function getLocalSkillsDir() {
23
- return join(process.cwd(), '.claude', 'skills');
24
- }
25
- /**
26
- * Get skills from a specific directory.
27
- *
28
- * When dbPath is provided, opens the skill_versions table to determine
29
- * whether a newer content hash has been recorded since the skill was installed.
30
- * Falls back to hasUpdates: false when the database is unavailable.
31
- *
32
- * @param skillsDir Directory to scan for installed skills
33
- * @param dbPath Optional path to the Skillsmith SQLite database
34
- * @param installedVia SMI-4578: which client (or `'local'`) this directory
35
- * represents — propagated onto each returned skill so
36
- * callers can render "installed via Cursor" badges.
37
- */
38
- export async function getSkillsFromDirectory(skillsDir, dbPath, installedVia = CANONICAL_CLIENT) {
39
- const skills = [];
40
- // Open the version repository if a db path was provided
41
- let versionRepo = null;
42
- let dbConn = null;
43
- if (dbPath) {
44
- try {
45
- // SMI-5139: this is a pure-read version lookup — open read-only so the
46
- // WASM driver does not persist (write) on close() and throw EROFS when
47
- // dbPath is unwritable/absent. A read-only open of an absent db throws
48
- // (native driver), which the catch below degrades to hasUpdates: false.
49
- dbConn = await openCliDatabase(dbPath, { readonly: true });
50
- versionRepo = new SkillVersionRepository(dbConn);
51
- }
52
- catch {
53
- // DB not available yet — fall back to hasUpdates: false
54
- versionRepo = null;
55
- dbConn = null;
56
- }
57
- }
58
- try {
59
- const entries = await readdir(skillsDir, { withFileTypes: true });
60
- for (const entry of entries) {
61
- if (entry.isDirectory()) {
62
- const skillPath = join(skillsDir, entry.name);
63
- const skillMdPath = join(skillPath, 'SKILL.md');
64
- try {
65
- const skillMdStat = await stat(skillMdPath);
66
- const content = await readFile(skillMdPath, 'utf-8');
67
- const parser = new SkillParser();
68
- const parsed = parser.parse(content);
69
- // Determine hasUpdates by comparing the current SKILL.md hash to the
70
- // most-recently recorded hash in skill_versions for this skill id.
71
- let hasUpdates = false;
72
- if (versionRepo && parsed) {
73
- try {
74
- const parsedAny = parsed;
75
- const skillId = parsedAny['id'] ?? entry.name;
76
- const latestVersion = await versionRepo.getLatestVersion(skillId);
77
- if (latestVersion) {
78
- const currentHash = createHash('sha256').update(content, 'utf8').digest('hex');
79
- const storedHash = parsedAny['contentHash'] ??
80
- parsedAny['originalContentHash'] ??
81
- '';
82
- // hasUpdates = latest recorded hash differs from what we have locally
83
- hasUpdates = storedHash !== '' && latestVersion.content_hash !== storedHash;
84
- // If we have no stored hash, compare against current content hash
85
- if (!storedHash) {
86
- hasUpdates = latestVersion.content_hash !== currentHash;
87
- }
88
- }
89
- }
90
- catch {
91
- // Version check failed — safe to ignore, fall back to false
92
- hasUpdates = false;
93
- }
94
- }
95
- skills.push({
96
- name: parsed?.name || entry.name,
97
- path: skillPath,
98
- version: parsed?.version || null,
99
- trustTier: parsed ? parser.inferTrustTier(parsed) : 'unknown',
100
- installDate: skillMdStat.mtime.toISOString().split('T')[0] || 'Unknown',
101
- hasUpdates,
102
- installedVia,
103
- });
104
- }
105
- catch (error) {
106
- // ENOENT: SKILL.md absent — treat as unknown skill.
107
- // EISDIR: SKILL.md is itself a directory (e.g. .backups/SKILL.md created
108
- // by apply_recommended_edit — SMI-5440). Treat the same as absent.
109
- // Re-throw permission errors and other unexpected errors.
110
- const errno = error.code;
111
- if (errno !== 'ENOENT' && errno !== 'EISDIR') {
112
- throw error;
113
- }
114
- // No SKILL.md, treat as unknown skill
115
- const dirStat = await stat(skillPath);
116
- skills.push({
117
- name: entry.name,
118
- path: skillPath,
119
- version: null,
120
- trustTier: 'unknown',
121
- installDate: dirStat.mtime.toISOString().split('T')[0] || 'Unknown',
122
- hasUpdates: false,
123
- installedVia,
124
- });
125
- }
126
- }
127
- }
128
- }
129
- catch (error) {
130
- if (error.code !== 'ENOENT') {
131
- throw error;
132
- }
133
- }
134
- finally {
135
- dbConn?.close();
136
- }
137
- return skills;
138
- }
139
- /**
140
- * Resolve a path through `realpath` defensively. Returns the resolved
141
- * path on success, or the input path unchanged if the path is missing
142
- * or unreadable — dedup keying still works either way (we just won't
143
- * collapse symlinked aliases when the link is broken).
144
- */
145
- async function safeRealpath(p) {
146
- try {
147
- return await realpath(p);
148
- }
149
- catch {
150
- return p;
151
- }
152
- }
153
- /**
154
- * Reads `<skillPath>/SKILL.md`, returns its sha256 hex content hash and the
155
- * `id` front-matter field. Both are `null` on any read/parse error.
156
- * @internal
157
- */
158
- async function readSkillMd(skillPath) {
159
- try {
160
- const content = await readFile(join(skillPath, 'SKILL.md'), 'utf-8');
161
- const contentHash = createHash('sha256').update(content, 'utf8').digest('hex');
162
- const parser = new SkillParser();
163
- const parsed = parser.parse(content);
164
- const parsedAny = parsed;
165
- const skillId = parsedAny['id'] ?? null;
166
- return { contentHash, skillId };
167
- }
168
- catch {
169
- return { contentHash: null, skillId: null };
170
- }
171
- }
172
- /**
173
- * Returns one {@link HarnessSkillEntry} per (harness × skill) observed on
174
- * disk, deduplicated by realpath only.
175
- *
176
- * Unlike {@link getInstalledSkills}, this function:
177
- * - Does **not** deduplicate by skill name — the same skill present under two
178
- * distinct harness directories appears as two rows (different `path`).
179
- * - Does deduplicate by realpath — a symlinked alias such as
180
- * `~/.agents/skills/foo` → `~/.claude/skills/foo` collapses to one row.
181
- * - Enriches each surviving entry with a sha256 `contentHash` computed from
182
- * the SKILL.md content, for registry drift detection.
183
- *
184
- * Precedence order (first realpath wins when a symlink is detected): local
185
- * (repo) > claude-code > cursor > copilot > windsurf > agents. Inherits the
186
- * SMI-4578 ordering so local overrides are still respected.
187
- *
188
- * @see SMI-5390
189
- */
190
- export async function getInstalledSkillsPerHarness() {
191
- const localScan = getSkillsFromDirectory(getLocalSkillsDir(), undefined, 'local');
192
- const clientScans = CLIENT_IDS.map((client) => getSkillsFromDirectory(CLIENT_NATIVE_PATHS[client], undefined, client));
193
- const [localSkills, ...clientSkillsLists] = await Promise.all([localScan, ...clientScans]);
194
- // Same precedence order as getInstalledSkills — local first, then
195
- // canonical, then remaining clients.
196
- const ordered = [...localSkills];
197
- const canonicalIdx = CLIENT_IDS.indexOf(CANONICAL_CLIENT);
198
- if (canonicalIdx >= 0 && clientSkillsLists[canonicalIdx]) {
199
- ordered.push(...clientSkillsLists[canonicalIdx]);
200
- }
201
- for (let i = 0; i < CLIENT_IDS.length; i++) {
202
- if (i === canonicalIdx)
203
- continue;
204
- const list = clientSkillsLists[i];
205
- if (list)
206
- ordered.push(...list);
207
- }
208
- // Realpath-only dedup: collapses symlinked aliases (same inode) but keeps
209
- // the same skill independently installed under two different harnesses as
210
- // two distinct rows.
211
- const seenPaths = new Set();
212
- const out = [];
213
- for (const skill of ordered) {
214
- const rp = await safeRealpath(skill.path);
215
- if (seenPaths.has(rp))
216
- continue;
217
- seenPaths.add(rp);
218
- const { contentHash, skillId: parsedId } = await readSkillMd(skill.path);
219
- out.push({
220
- harness: skill.installedVia,
221
- skillId: parsedId ?? skill.name,
222
- version: skill.version,
223
- contentHash,
224
- path: skill.path,
225
- });
226
- }
227
- return out;
228
- }
229
- /**
230
- * Get list of installed skills across every client directory.
231
- *
232
- * SMI-4578: scans the union of `CLIENT_NATIVE_PATHS` (claude-code,
233
- * cursor, copilot, windsurf, agents) plus repo-local
234
- * `./.claude/skills`. Results are deduplicated by `realpath` so a
235
- * symlinked `~/.agents/skills/foo` pointing at `~/.claude/skills/foo`
236
- * is reported once. Each entry carries `installedVia` so the caller
237
- * can render "installed via Cursor" badges.
238
- *
239
- * Precedence (first wins after dedup): local (repo) > claude-code >
240
- * cursor > copilot > windsurf > agents. This keeps the SMI-1630
241
- * promise that repo-local overrides global.
242
- *
243
- * @param dbPath Optional path to the Skillsmith SQLite database for
244
- * update detection.
245
- */
246
- export async function getInstalledSkills(dbPath) {
247
- const resolvedDbPath = dbPath ?? DEFAULT_DB_PATH;
248
- const localScan = getSkillsFromDirectory(getLocalSkillsDir(), resolvedDbPath, 'local');
249
- const clientScans = CLIENT_IDS.map((client) => getSkillsFromDirectory(CLIENT_NATIVE_PATHS[client], resolvedDbPath, client));
250
- const [localSkills, ...clientSkillsLists] = await Promise.all([localScan, ...clientScans]);
251
- // Precedence order: local first, then canonical, then the rest.
252
- const ordered = [...localSkills];
253
- const canonicalIdx = CLIENT_IDS.indexOf(CANONICAL_CLIENT);
254
- if (canonicalIdx >= 0 && clientSkillsLists[canonicalIdx]) {
255
- ordered.push(...clientSkillsLists[canonicalIdx]);
256
- }
257
- for (let i = 0; i < CLIENT_IDS.length; i++) {
258
- if (i === canonicalIdx)
259
- continue;
260
- const list = clientSkillsLists[i];
261
- if (list)
262
- ordered.push(...list);
263
- }
264
- // Dedup by both skill name AND resolved path. Name-keying enforces the
265
- // precedence rule (local > canonical > others) when two clients carry
266
- // independently-installed copies of the same skill. Realpath-keying
267
- // collapses symlinked aliases (e.g. `~/.agents/skills` → `~/.claude/skills`)
268
- // so the symlinked entry doesn't appear twice when the second hop has a
269
- // different `installedVia` label.
270
- const seenNames = new Set();
271
- const seenPaths = new Set();
272
- const out = [];
273
- for (const skill of ordered) {
274
- if (seenNames.has(skill.name))
275
- continue;
276
- const realPath = await safeRealpath(skill.path);
277
- if (seenPaths.has(realPath))
278
- continue;
279
- seenNames.add(skill.name);
280
- seenPaths.add(realPath);
281
- out.push(skill);
282
- }
283
- return out;
284
- }
285
- //# sourceMappingURL=skills-directory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skills-directory.js","sourceRoot":"","sources":["../../../src/utils/skills-directory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,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AC,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAA;IAClD,CAAC;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,IAAI,CAAC,KAAK,YAAY;YAAE,SAAQ;QAChC,MAAM,IAAI,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAA;QACjC,IAAI,IAAI;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;IACjC,CAAC;IAED,uEAAuE;IACvE,sEAAsE;IACtE,oEAAoE;IACpE,6EAA6E;IAC7E,wEAAwE;IACxE,kCAAkC;IAClC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAA;IACnC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAA;IACnC,MAAM,GAAG,GAAqB,EAAE,CAAA;IAChC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,SAAQ;QACvC,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC/C,IAAI,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,SAAQ;QACrC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACzB,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACvB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACjB,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -1,29 +0,0 @@
1
- /**
2
- * SMI-5427: gate for the CLI startup header (version + license banner).
3
- *
4
- * The header is human context, not program output, so it is suppressed for
5
- * non-TTY / piped / scripted use, for the auth commands, and for machine-readable
6
- * subcommands. Subcommands are matched by FULL path (`parent leaf`) — a bare leaf
7
- * like `status` is ambiguous across groups (`inventory status` vs `sync status`
8
- * vs `telemetry status`), so matching the leaf alone would over-exempt.
9
- *
10
- * @module @skillsmith/cli/utils/startup-header-gate
11
- */
12
- /**
13
- * Resolve a command's full path. A top-level command (whose parent is the program
14
- * root) resolves to its bare leaf name; a subcommand resolves to `parent leaf`.
15
- *
16
- * @param leaf - The action command's own name (e.g. `push`).
17
- * @param parentName - The parent command's name, or `undefined` for top-level.
18
- * @param rootName - The program root name (`skillsmith` or the `sklx` alias).
19
- */
20
- export declare function resolveCommandPath(leaf: string, parentName: string | undefined, rootName: string): string;
21
- /**
22
- * Whether the startup header should be displayed.
23
- *
24
- * @param commandPath - Full command path from {@link resolveCommandPath}.
25
- * @param isTTY - `process.stdout.isTTY`; a non-TTY (piped/scripted) stream never
26
- * shows the header so it cannot pollute machine-readable output.
27
- */
28
- export declare function shouldShowStartupHeader(commandPath: string, isTTY: boolean): boolean;
29
- //# sourceMappingURL=startup-header-gate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"startup-header-gate.d.ts","sourceRoot":"","sources":["../../../src/utils/startup-header-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAGpF"}
@@ -1,44 +0,0 @@
1
- /**
2
- * SMI-5427: gate for the CLI startup header (version + license banner).
3
- *
4
- * The header is human context, not program output, so it is suppressed for
5
- * non-TTY / piped / scripted use, for the auth commands, and for machine-readable
6
- * subcommands. Subcommands are matched by FULL path (`parent leaf`) — a bare leaf
7
- * like `status` is ambiguous across groups (`inventory status` vs `sync status`
8
- * vs `telemetry status`), so matching the leaf alone would over-exempt.
9
- *
10
- * @module @skillsmith/cli/utils/startup-header-gate
11
- */
12
- /** Commands (full `parent leaf` path, or bare leaf for top-level) that never show the header. */
13
- const NO_HEADER_COMMANDS = new Set([
14
- 'login',
15
- 'logout',
16
- 'whoami',
17
- 'inventory push',
18
- 'inventory status',
19
- 'inventory forget-device',
20
- ]);
21
- /**
22
- * Resolve a command's full path. A top-level command (whose parent is the program
23
- * root) resolves to its bare leaf name; a subcommand resolves to `parent leaf`.
24
- *
25
- * @param leaf - The action command's own name (e.g. `push`).
26
- * @param parentName - The parent command's name, or `undefined` for top-level.
27
- * @param rootName - The program root name (`skillsmith` or the `sklx` alias).
28
- */
29
- export function resolveCommandPath(leaf, parentName, rootName) {
30
- return parentName && parentName !== rootName ? `${parentName} ${leaf}` : leaf;
31
- }
32
- /**
33
- * Whether the startup header should be displayed.
34
- *
35
- * @param commandPath - Full command path from {@link resolveCommandPath}.
36
- * @param isTTY - `process.stdout.isTTY`; a non-TTY (piped/scripted) stream never
37
- * shows the header so it cannot pollute machine-readable output.
38
- */
39
- export function shouldShowStartupHeader(commandPath, isTTY) {
40
- if (!isTTY)
41
- return false;
42
- return !NO_HEADER_COMMANDS.has(commandPath);
43
- }
44
- //# sourceMappingURL=startup-header-gate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"startup-header-gate.js","sourceRoot":"","sources":["../../../src/utils/startup-header-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,iGAAiG;AACjG,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAS;IACzC,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,gBAAgB;IAChB,kBAAkB;IAClB,yBAAyB;CAC1B,CAAC,CAAA;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAY,EACZ,UAA8B,EAC9B,QAAgB;IAEhB,OAAO,UAAU,IAAI,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AAC/E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,WAAmB,EAAE,KAAc;IACzE,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAA;IACxB,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;AAC7C,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=startup-header-gate.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"startup-header-gate.test.d.ts","sourceRoot":"","sources":["../../../src/utils/startup-header-gate.test.ts"],"names":[],"mappings":""}
@@ -1,46 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { resolveCommandPath, shouldShowStartupHeader } from './startup-header-gate.js';
3
- describe('SMI-5427 startup-header-gate', () => {
4
- describe('resolveCommandPath', () => {
5
- it('returns the bare leaf for a top-level command (parent is the root)', () => {
6
- expect(resolveCommandPath('search', 'skillsmith', 'skillsmith')).toBe('search');
7
- });
8
- it('returns parent+leaf for a subcommand', () => {
9
- expect(resolveCommandPath('push', 'inventory', 'skillsmith')).toBe('inventory push');
10
- });
11
- it('returns the bare leaf when there is no parent', () => {
12
- expect(resolveCommandPath('login', undefined, 'skillsmith')).toBe('login');
13
- });
14
- it('resolves correctly under the sklx alias root', () => {
15
- expect(resolveCommandPath('search', 'sklx', 'sklx')).toBe('search');
16
- });
17
- });
18
- describe('shouldShowStartupHeader', () => {
19
- it('never shows on a non-TTY stream (piped/scripted)', () => {
20
- expect(shouldShowStartupHeader('search', false)).toBe(false);
21
- expect(shouldShowStartupHeader('inventory push', false)).toBe(false);
22
- });
23
- it('shows for a normal command on a TTY', () => {
24
- expect(shouldShowStartupHeader('search', true)).toBe(true);
25
- expect(shouldShowStartupHeader('install', true)).toBe(true);
26
- });
27
- it('suppresses the auth commands', () => {
28
- expect(shouldShowStartupHeader('login', true)).toBe(false);
29
- expect(shouldShowStartupHeader('logout', true)).toBe(false);
30
- expect(shouldShowStartupHeader('whoami', true)).toBe(false);
31
- });
32
- it('suppresses inventory machine-readable subcommands by full path', () => {
33
- expect(shouldShowStartupHeader('inventory push', true)).toBe(false);
34
- expect(shouldShowStartupHeader('inventory status', true)).toBe(false);
35
- expect(shouldShowStartupHeader('inventory forget-device', true)).toBe(false);
36
- });
37
- it('does NOT over-exempt same-leaf subcommands of other groups (collision guard)', () => {
38
- // `sync status` / `telemetry status` share the `status` leaf with
39
- // `inventory status` but must still show the header — the gate matches the
40
- // full parent+leaf path, not the bare leaf (review finding C8).
41
- expect(shouldShowStartupHeader('sync status', true)).toBe(true);
42
- expect(shouldShowStartupHeader('telemetry status', true)).toBe(true);
43
- });
44
- });
45
- });
46
- //# sourceMappingURL=startup-header-gate.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"startup-header-gate.test.js","sourceRoot":"","sources":["../../../src/utils/startup-header-gate.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAEtF,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;YAC5E,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACjF,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC9C,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QACtF,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;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,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC7D,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;YACxE,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACnE,MAAM,CAAC,uBAAuB,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACrE,MAAM,CAAC,uBAAuB,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC9E,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,8EAA8E,EAAE,GAAG,EAAE;YACtF,kEAAkE;YAClE,2EAA2E;YAC3E,gEAAgE;YAChE,MAAM,CAAC,uBAAuB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC/D,MAAM,CAAC,uBAAuB,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACtE,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,54 +0,0 @@
1
- /**
2
- * SMI-1389: Tool Detection for Subagent Generation
3
- *
4
- * Analyzes SKILL.md content to determine minimal required tools
5
- * for subagent execution, enabling context isolation and token savings.
6
- */
7
- export interface ToolAnalysis {
8
- requiredTools: string[];
9
- recommendedTools: string[];
10
- detectedPatterns: string[];
11
- confidence: 'high' | 'medium' | 'low';
12
- }
13
- interface ToolPattern {
14
- always?: boolean;
15
- patterns: string[];
16
- }
17
- /**
18
- * Tool detection patterns
19
- * Each tool has patterns that indicate its requirement
20
- */
21
- export declare const TOOL_PATTERNS: Record<string, ToolPattern>;
22
- /**
23
- * Analyze skill content to determine required tools
24
- *
25
- * @param skillContent - The full SKILL.md content
26
- * @returns Analysis of required and recommended tools
27
- */
28
- export declare function analyzeToolRequirements(skillContent: string): ToolAnalysis;
29
- /**
30
- * Format tool list for YAML output
31
- *
32
- * @param tools - Array of tool names
33
- * @returns Formatted string for YAML tools field
34
- */
35
- export declare function formatToolList(tools: string[]): string;
36
- /**
37
- * Parse comma-separated tools string into array
38
- *
39
- * @param toolsString - Comma-separated tools (e.g., "Read, Write, Bash")
40
- * @returns Array of tool names
41
- */
42
- export declare function parseToolsString(toolsString: string): string[];
43
- /**
44
- * Validate that all tools in the list are recognized
45
- *
46
- * @param tools - Array of tool names to validate
47
- * @returns Object with valid boolean and any unrecognized tools
48
- */
49
- export declare function validateTools(tools: string[]): {
50
- valid: boolean;
51
- unrecognized: string[];
52
- };
53
- export {};
54
- //# sourceMappingURL=tool-analyzer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-analyzer.d.ts","sourceRoot":"","sources":["../../../src/utils/tool-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;CACtC;AAED,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAsErD,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,YAAY,CAmC1E;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAKtD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAK9D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CAQzF"}
@@ -1,156 +0,0 @@
1
- /**
2
- * SMI-1389: Tool Detection for Subagent Generation
3
- *
4
- * Analyzes SKILL.md content to determine minimal required tools
5
- * for subagent execution, enabling context isolation and token savings.
6
- */
7
- /**
8
- * Tool detection patterns
9
- * Each tool has patterns that indicate its requirement
10
- */
11
- export const TOOL_PATTERNS = {
12
- Read: { always: true, patterns: [] },
13
- Write: {
14
- patterns: [
15
- 'write',
16
- 'create file',
17
- 'save',
18
- 'output to file',
19
- 'generate file',
20
- 'write to',
21
- 'create new file',
22
- ],
23
- },
24
- Edit: {
25
- patterns: [
26
- 'edit',
27
- 'modify',
28
- 'update file',
29
- 'patch',
30
- 'change file',
31
- 'replace in file',
32
- 'refactor',
33
- ],
34
- },
35
- Bash: {
36
- patterns: [
37
- 'bash',
38
- 'npm',
39
- 'npx',
40
- 'run command',
41
- 'execute',
42
- 'terminal',
43
- 'shell',
44
- 'command line',
45
- 'cli',
46
- 'git ',
47
- 'docker',
48
- 'yarn',
49
- 'pnpm',
50
- ],
51
- },
52
- Grep: {
53
- patterns: [
54
- 'search',
55
- 'find text',
56
- 'grep',
57
- 'pattern match',
58
- 'search for',
59
- 'look for',
60
- 'find in files',
61
- ],
62
- },
63
- Glob: {
64
- patterns: ['find file', 'glob', 'file pattern', 'locate file', 'list files', 'find files'],
65
- },
66
- WebFetch: {
67
- patterns: [
68
- 'fetch',
69
- 'http',
70
- 'api call',
71
- 'url',
72
- 'web request',
73
- 'download',
74
- 'get from url',
75
- 'request',
76
- ],
77
- },
78
- WebSearch: {
79
- patterns: ['web search', 'search online', 'google', 'lookup online', 'search the web'],
80
- },
81
- };
82
- /**
83
- * Analyze skill content to determine required tools
84
- *
85
- * @param skillContent - The full SKILL.md content
86
- * @returns Analysis of required and recommended tools
87
- */
88
- export function analyzeToolRequirements(skillContent) {
89
- const content = skillContent.toLowerCase();
90
- const tools = new Set();
91
- const patterns = [];
92
- for (const [tool, config] of Object.entries(TOOL_PATTERNS)) {
93
- // Always include tools marked as 'always'
94
- if (config.always) {
95
- tools.add(tool);
96
- continue;
97
- }
98
- // Check each pattern for the tool
99
- for (const pattern of config.patterns) {
100
- if (content.includes(pattern)) {
101
- tools.add(tool);
102
- patterns.push(`${tool}: matched "${pattern}"`);
103
- break; // Only need one match per tool
104
- }
105
- }
106
- }
107
- // Determine confidence based on pattern matches
108
- const matchCount = patterns.length;
109
- const confidence = matchCount >= 3 ? 'high' : matchCount >= 1 ? 'medium' : 'low';
110
- const toolList = Array.from(tools);
111
- return {
112
- requiredTools: toolList,
113
- recommendedTools: toolList,
114
- detectedPatterns: patterns,
115
- confidence,
116
- };
117
- }
118
- /**
119
- * Format tool list for YAML output
120
- *
121
- * @param tools - Array of tool names
122
- * @returns Formatted string for YAML tools field
123
- */
124
- export function formatToolList(tools) {
125
- if (tools.length === 0) {
126
- return 'Read';
127
- }
128
- return tools.join(', ');
129
- }
130
- /**
131
- * Parse comma-separated tools string into array
132
- *
133
- * @param toolsString - Comma-separated tools (e.g., "Read, Write, Bash")
134
- * @returns Array of tool names
135
- */
136
- export function parseToolsString(toolsString) {
137
- return toolsString
138
- .split(',')
139
- .map((t) => t.trim())
140
- .filter((t) => t.length > 0);
141
- }
142
- /**
143
- * Validate that all tools in the list are recognized
144
- *
145
- * @param tools - Array of tool names to validate
146
- * @returns Object with valid boolean and any unrecognized tools
147
- */
148
- export function validateTools(tools) {
149
- const validTools = new Set(Object.keys(TOOL_PATTERNS));
150
- const unrecognized = tools.filter((t) => !validTools.has(t));
151
- return {
152
- valid: unrecognized.length === 0,
153
- unrecognized,
154
- };
155
- }
156
- //# sourceMappingURL=tool-analyzer.js.map