@skillsmith/mcp-server 0.3.0 → 0.3.1

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 (314) hide show
  1. package/package.json +1 -1
  2. package/dist/.tsbuildinfo +0 -1
  3. package/dist/src/__tests__/get-skill.test.d.ts +0 -6
  4. package/dist/src/__tests__/get-skill.test.d.ts.map +0 -1
  5. package/dist/src/__tests__/get-skill.test.js +0 -88
  6. package/dist/src/__tests__/get-skill.test.js.map +0 -1
  7. package/dist/src/__tests__/middleware/errorFormatter.test.d.ts +0 -7
  8. package/dist/src/__tests__/middleware/errorFormatter.test.d.ts.map +0 -1
  9. package/dist/src/__tests__/middleware/errorFormatter.test.js +0 -304
  10. package/dist/src/__tests__/middleware/errorFormatter.test.js.map +0 -1
  11. package/dist/src/__tests__/middleware/license.test.d.ts +0 -7
  12. package/dist/src/__tests__/middleware/license.test.d.ts.map +0 -1
  13. package/dist/src/__tests__/middleware/license.test.js +0 -500
  14. package/dist/src/__tests__/middleware/license.test.js.map +0 -1
  15. package/dist/src/__tests__/search.test.d.ts +0 -6
  16. package/dist/src/__tests__/search.test.d.ts.map +0 -1
  17. package/dist/src/__tests__/search.test.js +0 -86
  18. package/dist/src/__tests__/search.test.js.map +0 -1
  19. package/dist/src/__tests__/test-utils.d.ts +0 -20
  20. package/dist/src/__tests__/test-utils.d.ts.map +0 -1
  21. package/dist/src/__tests__/test-utils.js +0 -91
  22. package/dist/src/__tests__/test-utils.js.map +0 -1
  23. package/dist/src/context/index.d.ts +0 -19
  24. package/dist/src/context/index.d.ts.map +0 -1
  25. package/dist/src/context/index.js +0 -25
  26. package/dist/src/context/index.js.map +0 -1
  27. package/dist/src/context/project-detector.d.ts +0 -145
  28. package/dist/src/context/project-detector.d.ts.map +0 -1
  29. package/dist/src/context/project-detector.js +0 -321
  30. package/dist/src/context/project-detector.js.map +0 -1
  31. package/dist/src/context.d.ts +0 -157
  32. package/dist/src/context.d.ts.map +0 -1
  33. package/dist/src/context.js +0 -231
  34. package/dist/src/context.js.map +0 -1
  35. package/dist/src/core-shim.d.ts +0 -7
  36. package/dist/src/core-shim.d.ts.map +0 -1
  37. package/dist/src/core-shim.js +0 -9
  38. package/dist/src/core-shim.js.map +0 -1
  39. package/dist/src/health/healthCheck.d.ts +0 -88
  40. package/dist/src/health/healthCheck.d.ts.map +0 -1
  41. package/dist/src/health/healthCheck.js +0 -117
  42. package/dist/src/health/healthCheck.js.map +0 -1
  43. package/dist/src/health/index.d.ts +0 -21
  44. package/dist/src/health/index.d.ts.map +0 -1
  45. package/dist/src/health/index.js +0 -21
  46. package/dist/src/health/index.js.map +0 -1
  47. package/dist/src/health/readinessCheck.d.ts +0 -139
  48. package/dist/src/health/readinessCheck.d.ts.map +0 -1
  49. package/dist/src/health/readinessCheck.js +0 -266
  50. package/dist/src/health/readinessCheck.js.map +0 -1
  51. package/dist/src/index.d.ts +0 -9
  52. package/dist/src/index.d.ts.map +0 -1
  53. package/dist/src/index.js +0 -236
  54. package/dist/src/index.js.map +0 -1
  55. package/dist/src/index.test.d.ts +0 -2
  56. package/dist/src/index.test.d.ts.map +0 -1
  57. package/dist/src/index.test.js +0 -43
  58. package/dist/src/index.test.js.map +0 -1
  59. package/dist/src/logger.d.ts +0 -26
  60. package/dist/src/logger.d.ts.map +0 -1
  61. package/dist/src/logger.js +0 -179
  62. package/dist/src/logger.js.map +0 -1
  63. package/dist/src/middleware/__tests__/csp.test.d.ts +0 -2
  64. package/dist/src/middleware/__tests__/csp.test.d.ts.map +0 -1
  65. package/dist/src/middleware/__tests__/csp.test.js +0 -390
  66. package/dist/src/middleware/__tests__/csp.test.js.map +0 -1
  67. package/dist/src/middleware/csp.d.ts +0 -103
  68. package/dist/src/middleware/csp.d.ts.map +0 -1
  69. package/dist/src/middleware/csp.js +0 -273
  70. package/dist/src/middleware/csp.js.map +0 -1
  71. package/dist/src/middleware/degradation.d.ts +0 -105
  72. package/dist/src/middleware/degradation.d.ts.map +0 -1
  73. package/dist/src/middleware/degradation.js +0 -319
  74. package/dist/src/middleware/degradation.js.map +0 -1
  75. package/dist/src/middleware/errorFormatter.d.ts +0 -119
  76. package/dist/src/middleware/errorFormatter.d.ts.map +0 -1
  77. package/dist/src/middleware/errorFormatter.js +0 -294
  78. package/dist/src/middleware/errorFormatter.js.map +0 -1
  79. package/dist/src/middleware/index.d.ts +0 -11
  80. package/dist/src/middleware/index.d.ts.map +0 -1
  81. package/dist/src/middleware/index.js +0 -16
  82. package/dist/src/middleware/index.js.map +0 -1
  83. package/dist/src/middleware/license.d.ts +0 -169
  84. package/dist/src/middleware/license.d.ts.map +0 -1
  85. package/dist/src/middleware/license.js +0 -292
  86. package/dist/src/middleware/license.js.map +0 -1
  87. package/dist/src/middleware/quota.d.ts +0 -182
  88. package/dist/src/middleware/quota.d.ts.map +0 -1
  89. package/dist/src/middleware/quota.js +0 -309
  90. package/dist/src/middleware/quota.js.map +0 -1
  91. package/dist/src/middleware/toolFeatureMapping.d.ts +0 -36
  92. package/dist/src/middleware/toolFeatureMapping.d.ts.map +0 -1
  93. package/dist/src/middleware/toolFeatureMapping.js +0 -96
  94. package/dist/src/middleware/toolFeatureMapping.js.map +0 -1
  95. package/dist/src/onboarding/first-run.d.ts +0 -65
  96. package/dist/src/onboarding/first-run.d.ts.map +0 -1
  97. package/dist/src/onboarding/first-run.js +0 -79
  98. package/dist/src/onboarding/first-run.js.map +0 -1
  99. package/dist/src/onboarding/index.d.ts +0 -7
  100. package/dist/src/onboarding/index.d.ts.map +0 -1
  101. package/dist/src/onboarding/index.js +0 -7
  102. package/dist/src/onboarding/index.js.map +0 -1
  103. package/dist/src/onboarding/install-assets.d.ts +0 -27
  104. package/dist/src/onboarding/install-assets.d.ts.map +0 -1
  105. package/dist/src/onboarding/install-assets.js +0 -128
  106. package/dist/src/onboarding/install-assets.js.map +0 -1
  107. package/dist/src/suggestions/index.d.ts +0 -21
  108. package/dist/src/suggestions/index.d.ts.map +0 -1
  109. package/dist/src/suggestions/index.js +0 -20
  110. package/dist/src/suggestions/index.js.map +0 -1
  111. package/dist/src/suggestions/suggestion-engine.d.ts +0 -185
  112. package/dist/src/suggestions/suggestion-engine.d.ts.map +0 -1
  113. package/dist/src/suggestions/suggestion-engine.js +0 -352
  114. package/dist/src/suggestions/suggestion-engine.js.map +0 -1
  115. package/dist/src/suggestions/types.d.ts +0 -88
  116. package/dist/src/suggestions/types.d.ts.map +0 -1
  117. package/dist/src/suggestions/types.js +0 -21
  118. package/dist/src/suggestions/types.js.map +0 -1
  119. package/dist/src/tools/analyze.d.ts +0 -151
  120. package/dist/src/tools/analyze.d.ts.map +0 -1
  121. package/dist/src/tools/analyze.js +0 -205
  122. package/dist/src/tools/analyze.js.map +0 -1
  123. package/dist/src/tools/compare.d.ts +0 -149
  124. package/dist/src/tools/compare.d.ts.map +0 -1
  125. package/dist/src/tools/compare.js +0 -464
  126. package/dist/src/tools/compare.js.map +0 -1
  127. package/dist/src/tools/get-skill.d.ts +0 -107
  128. package/dist/src/tools/get-skill.d.ts.map +0 -1
  129. package/dist/src/tools/get-skill.js +0 -260
  130. package/dist/src/tools/get-skill.js.map +0 -1
  131. package/dist/src/tools/index.d.ts +0 -20
  132. package/dist/src/tools/index.d.ts.map +0 -1
  133. package/dist/src/tools/index.js +0 -20
  134. package/dist/src/tools/index.js.map +0 -1
  135. package/dist/src/tools/install.d.ts +0 -122
  136. package/dist/src/tools/install.d.ts.map +0 -1
  137. package/dist/src/tools/install.js +0 -326
  138. package/dist/src/tools/install.js.map +0 -1
  139. package/dist/src/tools/recommend.d.ts +0 -169
  140. package/dist/src/tools/recommend.d.ts.map +0 -1
  141. package/dist/src/tools/recommend.js +0 -357
  142. package/dist/src/tools/recommend.js.map +0 -1
  143. package/dist/src/tools/search.d.ts +0 -114
  144. package/dist/src/tools/search.d.ts.map +0 -1
  145. package/dist/src/tools/search.js +0 -247
  146. package/dist/src/tools/search.js.map +0 -1
  147. package/dist/src/tools/suggest.d.ts +0 -181
  148. package/dist/src/tools/suggest.d.ts.map +0 -1
  149. package/dist/src/tools/suggest.js +0 -310
  150. package/dist/src/tools/suggest.js.map +0 -1
  151. package/dist/src/tools/uninstall.d.ts +0 -123
  152. package/dist/src/tools/uninstall.d.ts.map +0 -1
  153. package/dist/src/tools/uninstall.js +0 -250
  154. package/dist/src/tools/uninstall.js.map +0 -1
  155. package/dist/src/tools/validate.d.ts +0 -122
  156. package/dist/src/tools/validate.d.ts.map +0 -1
  157. package/dist/src/tools/validate.js +0 -497
  158. package/dist/src/tools/validate.js.map +0 -1
  159. package/dist/src/utils/installed-skills.d.ts +0 -101
  160. package/dist/src/utils/installed-skills.d.ts.map +0 -1
  161. package/dist/src/utils/installed-skills.js +0 -220
  162. package/dist/src/utils/installed-skills.js.map +0 -1
  163. package/dist/src/utils/validation.d.ts +0 -95
  164. package/dist/src/utils/validation.d.ts.map +0 -1
  165. package/dist/src/utils/validation.js +0 -186
  166. package/dist/src/utils/validation.js.map +0 -1
  167. package/dist/src/webhooks/index.d.ts +0 -8
  168. package/dist/src/webhooks/index.d.ts.map +0 -1
  169. package/dist/src/webhooks/index.js +0 -9
  170. package/dist/src/webhooks/index.js.map +0 -1
  171. package/dist/src/webhooks/webhook-endpoint.d.ts +0 -149
  172. package/dist/src/webhooks/webhook-endpoint.d.ts.map +0 -1
  173. package/dist/src/webhooks/webhook-endpoint.js +0 -339
  174. package/dist/src/webhooks/webhook-endpoint.js.map +0 -1
  175. package/dist/tests/compare.test.d.ts +0 -6
  176. package/dist/tests/compare.test.d.ts.map +0 -1
  177. package/dist/tests/compare.test.js +0 -225
  178. package/dist/tests/compare.test.js.map +0 -1
  179. package/dist/tests/context/project-detector.test.d.ts +0 -6
  180. package/dist/tests/context/project-detector.test.d.ts.map +0 -1
  181. package/dist/tests/context/project-detector.test.js +0 -719
  182. package/dist/tests/context/project-detector.test.js.map +0 -1
  183. package/dist/tests/e2e/compare.e2e.test.d.ts +0 -10
  184. package/dist/tests/e2e/compare.e2e.test.d.ts.map +0 -1
  185. package/dist/tests/e2e/compare.e2e.test.js +0 -296
  186. package/dist/tests/e2e/compare.e2e.test.js.map +0 -1
  187. package/dist/tests/e2e/install-flow.e2e.test.d.ts +0 -10
  188. package/dist/tests/e2e/install-flow.e2e.test.d.ts.map +0 -1
  189. package/dist/tests/e2e/install-flow.e2e.test.js +0 -229
  190. package/dist/tests/e2e/install-flow.e2e.test.js.map +0 -1
  191. package/dist/tests/e2e/recommend.e2e.test.d.ts +0 -12
  192. package/dist/tests/e2e/recommend.e2e.test.d.ts.map +0 -1
  193. package/dist/tests/e2e/recommend.e2e.test.js +0 -357
  194. package/dist/tests/e2e/recommend.e2e.test.js.map +0 -1
  195. package/dist/tests/e2e/skill-flow.e2e.test.d.ts +0 -10
  196. package/dist/tests/e2e/skill-flow.e2e.test.d.ts.map +0 -1
  197. package/dist/tests/e2e/skill-flow.e2e.test.js +0 -311
  198. package/dist/tests/e2e/skill-flow.e2e.test.js.map +0 -1
  199. package/dist/tests/e2e/suggest.e2e.test.d.ts +0 -13
  200. package/dist/tests/e2e/suggest.e2e.test.d.ts.map +0 -1
  201. package/dist/tests/e2e/suggest.e2e.test.js +0 -367
  202. package/dist/tests/e2e/suggest.e2e.test.js.map +0 -1
  203. package/dist/tests/e2e/utils/baseline-collector.d.ts +0 -107
  204. package/dist/tests/e2e/utils/baseline-collector.d.ts.map +0 -1
  205. package/dist/tests/e2e/utils/baseline-collector.js +0 -211
  206. package/dist/tests/e2e/utils/baseline-collector.js.map +0 -1
  207. package/dist/tests/e2e/utils/hardcoded-detector.d.ts +0 -46
  208. package/dist/tests/e2e/utils/hardcoded-detector.d.ts.map +0 -1
  209. package/dist/tests/e2e/utils/hardcoded-detector.js +0 -255
  210. package/dist/tests/e2e/utils/hardcoded-detector.js.map +0 -1
  211. package/dist/tests/e2e/utils/index.d.ts +0 -7
  212. package/dist/tests/e2e/utils/index.d.ts.map +0 -1
  213. package/dist/tests/e2e/utils/index.js +0 -7
  214. package/dist/tests/e2e/utils/index.js.map +0 -1
  215. package/dist/tests/e2e/utils/linear-reporter.d.ts +0 -60
  216. package/dist/tests/e2e/utils/linear-reporter.d.ts.map +0 -1
  217. package/dist/tests/e2e/utils/linear-reporter.js +0 -232
  218. package/dist/tests/e2e/utils/linear-reporter.js.map +0 -1
  219. package/dist/tests/health.test.d.ts +0 -9
  220. package/dist/tests/health.test.d.ts.map +0 -1
  221. package/dist/tests/health.test.js +0 -308
  222. package/dist/tests/health.test.js.map +0 -1
  223. package/dist/tests/integration/analyze.integration.test.d.ts +0 -2
  224. package/dist/tests/integration/analyze.integration.test.d.ts.map +0 -1
  225. package/dist/tests/integration/analyze.integration.test.js +0 -244
  226. package/dist/tests/integration/analyze.integration.test.js.map +0 -1
  227. package/dist/tests/integration/compare.integration.test.d.ts +0 -2
  228. package/dist/tests/integration/compare.integration.test.d.ts.map +0 -1
  229. package/dist/tests/integration/compare.integration.test.js +0 -120
  230. package/dist/tests/integration/compare.integration.test.js.map +0 -1
  231. package/dist/tests/integration/fixtures/test-skills.d.ts +0 -62
  232. package/dist/tests/integration/fixtures/test-skills.d.ts.map +0 -1
  233. package/dist/tests/integration/fixtures/test-skills.js +0 -644
  234. package/dist/tests/integration/fixtures/test-skills.js.map +0 -1
  235. package/dist/tests/integration/get-skill.integration.test.d.ts +0 -6
  236. package/dist/tests/integration/get-skill.integration.test.d.ts.map +0 -1
  237. package/dist/tests/integration/get-skill.integration.test.js +0 -203
  238. package/dist/tests/integration/get-skill.integration.test.js.map +0 -1
  239. package/dist/tests/integration/github-api.integration.test.d.ts +0 -14
  240. package/dist/tests/integration/github-api.integration.test.d.ts.map +0 -1
  241. package/dist/tests/integration/github-api.integration.test.js +0 -190
  242. package/dist/tests/integration/github-api.integration.test.js.map +0 -1
  243. package/dist/tests/integration/install.integration.test.d.ts +0 -6
  244. package/dist/tests/integration/install.integration.test.d.ts.map +0 -1
  245. package/dist/tests/integration/install.integration.test.js +0 -282
  246. package/dist/tests/integration/install.integration.test.js.map +0 -1
  247. package/dist/tests/integration/recommend.integration.test.d.ts +0 -2
  248. package/dist/tests/integration/recommend.integration.test.d.ts.map +0 -1
  249. package/dist/tests/integration/recommend.integration.test.js +0 -217
  250. package/dist/tests/integration/recommend.integration.test.js.map +0 -1
  251. package/dist/tests/integration/search.integration.test.d.ts +0 -6
  252. package/dist/tests/integration/search.integration.test.d.ts.map +0 -1
  253. package/dist/tests/integration/search.integration.test.js +0 -229
  254. package/dist/tests/integration/search.integration.test.js.map +0 -1
  255. package/dist/tests/integration/setup.d.ts +0 -74
  256. package/dist/tests/integration/setup.d.ts.map +0 -1
  257. package/dist/tests/integration/setup.js +0 -131
  258. package/dist/tests/integration/setup.js.map +0 -1
  259. package/dist/tests/integration/uninstall.integration.test.d.ts +0 -6
  260. package/dist/tests/integration/uninstall.integration.test.d.ts.map +0 -1
  261. package/dist/tests/integration/uninstall.integration.test.js +0 -296
  262. package/dist/tests/integration/uninstall.integration.test.js.map +0 -1
  263. package/dist/tests/integration/validate.integration.test.d.ts +0 -2
  264. package/dist/tests/integration/validate.integration.test.d.ts.map +0 -1
  265. package/dist/tests/integration/validate.integration.test.js +0 -181
  266. package/dist/tests/integration/validate.integration.test.js.map +0 -1
  267. package/dist/tests/onboarding/first-run.test.d.ts +0 -7
  268. package/dist/tests/onboarding/first-run.test.d.ts.map +0 -1
  269. package/dist/tests/onboarding/first-run.test.js +0 -264
  270. package/dist/tests/onboarding/first-run.test.js.map +0 -1
  271. package/dist/tests/performance/search-performance.test.d.ts +0 -10
  272. package/dist/tests/performance/search-performance.test.d.ts.map +0 -1
  273. package/dist/tests/performance/search-performance.test.js +0 -222
  274. package/dist/tests/performance/search-performance.test.js.map +0 -1
  275. package/dist/tests/recommend.test.d.ts +0 -6
  276. package/dist/tests/recommend.test.d.ts.map +0 -1
  277. package/dist/tests/recommend.test.js +0 -210
  278. package/dist/tests/recommend.test.js.map +0 -1
  279. package/dist/tests/suggestions/suggestion-engine.test.d.ts +0 -6
  280. package/dist/tests/suggestions/suggestion-engine.test.d.ts.map +0 -1
  281. package/dist/tests/suggestions/suggestion-engine.test.js +0 -448
  282. package/dist/tests/suggestions/suggestion-engine.test.js.map +0 -1
  283. package/dist/tests/test-utils.d.ts +0 -74
  284. package/dist/tests/test-utils.d.ts.map +0 -1
  285. package/dist/tests/test-utils.js +0 -98
  286. package/dist/tests/test-utils.js.map +0 -1
  287. package/dist/tests/tools.test.d.ts +0 -5
  288. package/dist/tests/tools.test.d.ts.map +0 -1
  289. package/dist/tests/tools.test.js +0 -138
  290. package/dist/tests/tools.test.js.map +0 -1
  291. package/dist/tests/unit/installed-skills.test.d.ts +0 -6
  292. package/dist/tests/unit/installed-skills.test.d.ts.map +0 -1
  293. package/dist/tests/unit/installed-skills.test.js +0 -285
  294. package/dist/tests/unit/installed-skills.test.js.map +0 -1
  295. package/dist/tests/unit/logger.test.d.ts +0 -6
  296. package/dist/tests/unit/logger.test.d.ts.map +0 -1
  297. package/dist/tests/unit/logger.test.js +0 -281
  298. package/dist/tests/unit/logger.test.js.map +0 -1
  299. package/dist/tests/validate.test.d.ts +0 -5
  300. package/dist/tests/validate.test.d.ts.map +0 -1
  301. package/dist/tests/validate.test.js +0 -303
  302. package/dist/tests/validate.test.js.map +0 -1
  303. package/dist/tests/webhooks/proxy-trust.security.test.d.ts +0 -8
  304. package/dist/tests/webhooks/proxy-trust.security.test.d.ts.map +0 -1
  305. package/dist/tests/webhooks/proxy-trust.security.test.js +0 -145
  306. package/dist/tests/webhooks/proxy-trust.security.test.js.map +0 -1
  307. package/dist/tests/webhooks/rate-limiter.security.test.d.ts +0 -8
  308. package/dist/tests/webhooks/rate-limiter.security.test.d.ts.map +0 -1
  309. package/dist/tests/webhooks/rate-limiter.security.test.js +0 -122
  310. package/dist/tests/webhooks/rate-limiter.security.test.js.map +0 -1
  311. package/dist/vitest.config.d.ts +0 -6
  312. package/dist/vitest.config.d.ts.map +0 -1
  313. package/dist/vitest.config.js +0 -13
  314. package/dist/vitest.config.js.map +0 -1
@@ -1,20 +0,0 @@
1
- /**
2
- * Test utilities for MCP server tests
3
- * @see SMI-792: Database initialization
4
- */
5
- import { type ToolContext } from '../context.js';
6
- export type { ToolContext };
7
- /**
8
- * Create a test context with in-memory database
9
- * SMI-1183: Uses offline mode to avoid API calls during tests
10
- */
11
- export declare function createTestContext(): ToolContext;
12
- /**
13
- * Seed test data into the context
14
- */
15
- export declare function seedTestData(context: ToolContext): void;
16
- /**
17
- * Create a seeded test context
18
- */
19
- export declare function createSeededTestContext(): ToolContext;
20
- //# sourceMappingURL=test-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAA;AAEnE,YAAY,EAAE,WAAW,EAAE,CAAA;AAE3B;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAK/C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAqEvD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,WAAW,CAIrD"}
@@ -1,91 +0,0 @@
1
- /**
2
- * Test utilities for MCP server tests
3
- * @see SMI-792: Database initialization
4
- */
5
- import { createToolContext } from '../context.js';
6
- /**
7
- * Create a test context with in-memory database
8
- * SMI-1183: Uses offline mode to avoid API calls during tests
9
- */
10
- export function createTestContext() {
11
- return createToolContext({
12
- dbPath: ':memory:',
13
- apiClientConfig: { offlineMode: true },
14
- });
15
- }
16
- /**
17
- * Seed test data into the context
18
- */
19
- export function seedTestData(context) {
20
- const { skillRepository } = context;
21
- // Add test skills
22
- skillRepository.create({
23
- id: 'anthropic/commit',
24
- name: 'commit',
25
- description: 'Generate semantic commit messages following conventional commits',
26
- author: 'anthropic',
27
- repoUrl: 'https://github.com/anthropics/claude-code-skills',
28
- qualityScore: 0.95,
29
- trustTier: 'verified',
30
- tags: ['git', 'commit', 'conventional-commits', 'automation'],
31
- });
32
- skillRepository.create({
33
- id: 'anthropic/review-pr',
34
- name: 'review-pr',
35
- description: 'Review pull requests with detailed code analysis',
36
- author: 'anthropic',
37
- repoUrl: 'https://github.com/anthropics/claude-code-skills-pr',
38
- qualityScore: 0.93,
39
- trustTier: 'verified',
40
- tags: ['git', 'pull-request', 'code-review', 'quality'],
41
- });
42
- skillRepository.create({
43
- id: 'community/jest-helper',
44
- name: 'jest-helper',
45
- description: 'Generate Jest test cases for React components',
46
- author: 'community',
47
- repoUrl: 'https://github.com/skillsmith-community/jest-helper',
48
- qualityScore: 0.87,
49
- trustTier: 'community',
50
- tags: ['jest', 'testing', 'react', 'unit-tests'],
51
- });
52
- skillRepository.create({
53
- id: 'community/vitest-helper',
54
- name: 'vitest-helper',
55
- description: 'Generate Vitest test cases with modern testing patterns',
56
- author: 'community',
57
- repoUrl: 'https://github.com/skillsmith-community/vitest-helper',
58
- qualityScore: 0.85,
59
- trustTier: 'community',
60
- tags: ['vitest', 'testing', 'typescript', 'unit-tests'],
61
- });
62
- skillRepository.create({
63
- id: 'community/docker-compose',
64
- name: 'docker-compose',
65
- description: 'Generate and manage Docker Compose configurations',
66
- author: 'community',
67
- repoUrl: 'https://github.com/skillsmith-community/docker-compose',
68
- qualityScore: 0.84,
69
- trustTier: 'community',
70
- tags: ['docker', 'devops', 'containers', 'infrastructure'],
71
- });
72
- skillRepository.create({
73
- id: 'community/api-docs',
74
- name: 'api-docs',
75
- description: 'Generate OpenAPI documentation from code',
76
- author: 'community',
77
- repoUrl: 'https://github.com/skillsmith-community/api-docs',
78
- qualityScore: 0.78,
79
- trustTier: 'experimental',
80
- tags: ['documentation', 'openapi', 'api'],
81
- });
82
- }
83
- /**
84
- * Create a seeded test context
85
- */
86
- export function createSeededTestContext() {
87
- const context = createTestContext();
88
- seedTestData(context);
89
- return context;
90
- }
91
- //# sourceMappingURL=test-utils.js.map
@@ -1 +0,0 @@
1
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@see SMI-912: Project context detection for skill suggestions
5
- *
6
- * Re-exports all project context detection utilities for easy importing.
7
- *
8
- * @example
9
- * import {
10
- * detectProjectContext,
11
- * getSuggestedSkills,
12
- * ProjectContext
13
- * } from './context';
14
- *
15
- * const context = detectProjectContext();
16
- * const skills = getSuggestedSkills(context);
17
- */
18
- export { detectProjectContext, detectDocker, detectLinear, detectGitHub, detectTestFramework, detectApiFramework, detectNativeModules, detectLanguage, getSuggestedSkills, type ProjectContext, } from './project-detector.js';
19
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEL,oBAAoB,EAEpB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EAEd,kBAAkB,EAElB,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAA"}
@@ -1,25 +0,0 @@
1
- /**
2
- * @fileoverview Context Detection Module Exports
3
- * @module @skillsmith/mcp-server/context
4
- * @see SMI-912: Project context detection for skill suggestions
5
- *
6
- * Re-exports all project context detection utilities for easy importing.
7
- *
8
- * @example
9
- * import {
10
- * detectProjectContext,
11
- * getSuggestedSkills,
12
- * ProjectContext
13
- * } from './context';
14
- *
15
- * const context = detectProjectContext();
16
- * const skills = getSuggestedSkills(context);
17
- */
18
- export {
19
- // Main detection function
20
- detectProjectContext,
21
- // Individual detection functions
22
- detectDocker, detectLinear, detectGitHub, detectTestFramework, detectApiFramework, detectNativeModules, detectLanguage,
23
- // Skill suggestion helper
24
- getSuggestedSkills, } from './project-detector.js';
25
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/context/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO;AACL,0BAA0B;AAC1B,oBAAoB;AACpB,iCAAiC;AACjC,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc;AACd,0BAA0B;AAC1B,kBAAkB,GAGnB,MAAM,uBAAuB,CAAA"}
@@ -1,145 +0,0 @@
1
- /**
2
- * @fileoverview Project Context Detection for Skill Suggestions
3
- * @module @skillsmith/mcp-server/context/project-detector
4
- * @see SMI-912: Project context detection for skill suggestions
5
- *
6
- * Analyzes the user's project to detect technologies, frameworks, and tools
7
- * in use to provide contextual skill recommendations.
8
- *
9
- * @example
10
- * // Detect project context for the current working directory
11
- * const context = detectProjectContext();
12
- *
13
- * // Detect project context for a specific path
14
- * const context = detectProjectContext('/path/to/project');
15
- *
16
- * // Use context for skill suggestions
17
- * if (context.hasDocker) {
18
- * suggestSkill('docker');
19
- * }
20
- */
21
- /**
22
- * Validates that a path does not escape the allowed base directory.
23
- * Prevents path traversal attacks using sequences like '../'.
24
- *
25
- * @param inputPath - The path to validate (can be relative or absolute)
26
- * @param baseDir - The allowed base directory
27
- * @returns The resolved, sanitized absolute path
28
- * @throws Error if the path attempts to escape the base directory
29
- */
30
- export declare function validatePath(inputPath: string, baseDir: string): string;
31
- /**
32
- * Detected project context for skill recommendations
33
- */
34
- export interface ProjectContext {
35
- /** Whether project uses Docker (Dockerfile or docker-compose) */
36
- hasDocker: boolean;
37
- /** Whether project is connected to Linear (detected from git config) */
38
- hasLinear: boolean;
39
- /** Whether project is hosted on GitHub */
40
- hasGitHub: boolean;
41
- /** Detected test framework (jest, vitest, mocha) */
42
- testFramework: 'jest' | 'vitest' | 'mocha' | null;
43
- /** Detected API framework (express, fastapi, nextjs) */
44
- apiFramework: 'express' | 'fastapi' | 'nextjs' | null;
45
- /** Whether project uses native modules (better-sqlite3, sharp, etc.) */
46
- hasNativeModules: boolean;
47
- /** Detected primary language */
48
- language: 'typescript' | 'javascript' | 'python' | null;
49
- }
50
- /**
51
- * Detect complete project context from filesystem analysis
52
- *
53
- * @param projectPath - Path to the project directory (defaults to cwd)
54
- * @param allowedBaseDir - Optional base directory to restrict path access (defaults to projectPath itself)
55
- * @returns Detected project context
56
- * @throws Error if projectPath attempts to escape the allowedBaseDir
57
- *
58
- * @example
59
- * const context = detectProjectContext('/path/to/project');
60
- * console.log(context.hasDocker); // true/false
61
- */
62
- export declare function detectProjectContext(projectPath?: string, allowedBaseDir?: string): ProjectContext;
63
- /**
64
- * Detect Docker usage in project
65
- *
66
- * Checks for:
67
- * - Dockerfile
68
- * - docker-compose.yml
69
- * - docker-compose.yaml
70
- *
71
- * @param path - Project path to check
72
- * @returns True if Docker is detected
73
- */
74
- export declare function detectDocker(path: string): boolean;
75
- /**
76
- * Detect Linear integration from git remote config
77
- *
78
- * Checks if any git remote references linear.app
79
- *
80
- * @param path - Project path to check
81
- * @returns True if Linear integration is detected
82
- */
83
- export declare function detectLinear(path: string): boolean;
84
- /**
85
- * Detect GitHub hosting from git remote config
86
- *
87
- * Checks if any git remote references github.com
88
- *
89
- * @param path - Project path to check
90
- * @returns True if GitHub hosting is detected
91
- */
92
- export declare function detectGitHub(path: string): boolean;
93
- /**
94
- * Detect test framework from package.json dependencies
95
- *
96
- * Checks for: vitest, jest, mocha (in priority order)
97
- *
98
- * @param path - Project path to check
99
- * @returns Detected test framework or null
100
- */
101
- export declare function detectTestFramework(path: string): 'jest' | 'vitest' | 'mocha' | null;
102
- /**
103
- * Detect API framework from package.json or requirements.txt
104
- *
105
- * Checks for: next (Next.js), express (Express), fastapi (FastAPI)
106
- *
107
- * @param path - Project path to check
108
- * @returns Detected API framework or null
109
- */
110
- export declare function detectApiFramework(path: string): 'express' | 'fastapi' | 'nextjs' | null;
111
- /**
112
- * Detect native module usage in package.json
113
- *
114
- * Checks for modules known to require native compilation:
115
- * better-sqlite3, sharp, canvas, bcrypt, onnxruntime-node, etc.
116
- *
117
- * @param path - Project path to check
118
- * @returns True if native modules are detected
119
- */
120
- export declare function detectNativeModules(path: string): boolean;
121
- /**
122
- * Detect primary programming language from project structure
123
- *
124
- * Detection order:
125
- * 1. TypeScript (tsconfig.json)
126
- * 2. JavaScript (package.json without tsconfig)
127
- * 3. Python (requirements.txt or pyproject.toml)
128
- *
129
- * @param path - Project path to check
130
- * @returns Detected language or null
131
- */
132
- export declare function detectLanguage(path: string): 'typescript' | 'javascript' | 'python' | null;
133
- /**
134
- * Get suggested skills based on project context
135
- *
136
- * @param context - Detected project context
137
- * @returns Array of suggested skill IDs
138
- *
139
- * @example
140
- * const context = detectProjectContext();
141
- * const suggestions = getSuggestedSkills(context);
142
- * // ['docker', 'github-actions', 'jest-helper']
143
- */
144
- export declare function getSuggestedSkills(context: ProjectContext): string[];
145
- //# sourceMappingURL=project-detector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project-detector.d.ts","sourceRoot":"","sources":["../../../src/context/project-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAWvE;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,SAAS,EAAE,OAAO,CAAA;IAClB,wEAAwE;IACxE,SAAS,EAAE,OAAO,CAAA;IAClB,0CAA0C;IAC1C,SAAS,EAAE,OAAO,CAAA;IAClB,oDAAoD;IACpD,aAAa,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAA;IACjD,wDAAwD;IACxD,YAAY,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAA;IACrD,wEAAwE;IACxE,gBAAgB,EAAE,OAAO,CAAA;IACzB,gCAAgC;IAChC,QAAQ,EAAE,YAAY,GAAG,YAAY,GAAG,QAAQ,GAAG,IAAI,CAAA;CACxD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,GAAE,MAAsB,EACnC,cAAc,CAAC,EAAE,MAAM,GACtB,cAAc,CAchB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMlD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAelD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAelD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAsBpF;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,CAmDxF;AAmBD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAiBzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,QAAQ,GAAG,IAAI,CAa1F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,EAAE,CA2CpE"}
@@ -1,321 +0,0 @@
1
- /**
2
- * @fileoverview Project Context Detection for Skill Suggestions
3
- * @module @skillsmith/mcp-server/context/project-detector
4
- * @see SMI-912: Project context detection for skill suggestions
5
- *
6
- * Analyzes the user's project to detect technologies, frameworks, and tools
7
- * in use to provide contextual skill recommendations.
8
- *
9
- * @example
10
- * // Detect project context for the current working directory
11
- * const context = detectProjectContext();
12
- *
13
- * // Detect project context for a specific path
14
- * const context = detectProjectContext('/path/to/project');
15
- *
16
- * // Use context for skill suggestions
17
- * if (context.hasDocker) {
18
- * suggestSkill('docker');
19
- * }
20
- */
21
- import { existsSync, readFileSync } from 'fs';
22
- import { join, resolve, isAbsolute } from 'path';
23
- /**
24
- * Validates that a path does not escape the allowed base directory.
25
- * Prevents path traversal attacks using sequences like '../'.
26
- *
27
- * @param inputPath - The path to validate (can be relative or absolute)
28
- * @param baseDir - The allowed base directory
29
- * @returns The resolved, sanitized absolute path
30
- * @throws Error if the path attempts to escape the base directory
31
- */
32
- export function validatePath(inputPath, baseDir) {
33
- const resolvedBase = resolve(baseDir);
34
- const resolvedPath = isAbsolute(inputPath) ? resolve(inputPath) : resolve(baseDir, inputPath);
35
- // Ensure the resolved path starts with the base directory
36
- // Add path separator to prevent partial matches (e.g., /base vs /base-other)
37
- if (!resolvedPath.startsWith(resolvedBase + '/') && resolvedPath !== resolvedBase) {
38
- throw new Error(`Path traversal attempt detected: ${inputPath}`);
39
- }
40
- return resolvedPath;
41
- }
42
- /**
43
- * Detect complete project context from filesystem analysis
44
- *
45
- * @param projectPath - Path to the project directory (defaults to cwd)
46
- * @param allowedBaseDir - Optional base directory to restrict path access (defaults to projectPath itself)
47
- * @returns Detected project context
48
- * @throws Error if projectPath attempts to escape the allowedBaseDir
49
- *
50
- * @example
51
- * const context = detectProjectContext('/path/to/project');
52
- * console.log(context.hasDocker); // true/false
53
- */
54
- export function detectProjectContext(projectPath = process.cwd(), allowedBaseDir) {
55
- // Validate path to prevent traversal attacks
56
- const baseDir = allowedBaseDir ?? projectPath;
57
- const validatedPath = validatePath(projectPath, baseDir);
58
- return {
59
- hasDocker: detectDocker(validatedPath),
60
- hasLinear: detectLinear(validatedPath),
61
- hasGitHub: detectGitHub(validatedPath),
62
- testFramework: detectTestFramework(validatedPath),
63
- apiFramework: detectApiFramework(validatedPath),
64
- hasNativeModules: detectNativeModules(validatedPath),
65
- language: detectLanguage(validatedPath),
66
- };
67
- }
68
- /**
69
- * Detect Docker usage in project
70
- *
71
- * Checks for:
72
- * - Dockerfile
73
- * - docker-compose.yml
74
- * - docker-compose.yaml
75
- *
76
- * @param path - Project path to check
77
- * @returns True if Docker is detected
78
- */
79
- export function detectDocker(path) {
80
- return (existsSync(join(path, 'Dockerfile')) ||
81
- existsSync(join(path, 'docker-compose.yml')) ||
82
- existsSync(join(path, 'docker-compose.yaml')));
83
- }
84
- /**
85
- * Detect Linear integration from git remote config
86
- *
87
- * Checks if any git remote references linear.app
88
- *
89
- * @param path - Project path to check
90
- * @returns True if Linear integration is detected
91
- */
92
- export function detectLinear(path) {
93
- const gitConfig = join(path, '.git', 'config');
94
- if (!existsSync(gitConfig))
95
- return false;
96
- try {
97
- const content = readFileSync(gitConfig, 'utf-8');
98
- return content.includes('linear.app');
99
- }
100
- catch (error) {
101
- console.warn('[project-detector] Failed to read git config for Linear detection:', gitConfig, error instanceof Error ? error.message : String(error));
102
- return false;
103
- }
104
- }
105
- /**
106
- * Detect GitHub hosting from git remote config
107
- *
108
- * Checks if any git remote references github.com
109
- *
110
- * @param path - Project path to check
111
- * @returns True if GitHub hosting is detected
112
- */
113
- export function detectGitHub(path) {
114
- const gitConfig = join(path, '.git', 'config');
115
- if (!existsSync(gitConfig))
116
- return false;
117
- try {
118
- const content = readFileSync(gitConfig, 'utf-8');
119
- return content.includes('github.com');
120
- }
121
- catch (error) {
122
- console.warn('[project-detector] Failed to read git config for GitHub detection:', gitConfig, error instanceof Error ? error.message : String(error));
123
- return false;
124
- }
125
- }
126
- /**
127
- * Detect test framework from package.json dependencies
128
- *
129
- * Checks for: vitest, jest, mocha (in priority order)
130
- *
131
- * @param path - Project path to check
132
- * @returns Detected test framework or null
133
- */
134
- export function detectTestFramework(path) {
135
- const pkgPath = join(path, 'package.json');
136
- if (!existsSync(pkgPath))
137
- return null;
138
- try {
139
- const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
140
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
141
- // Check in priority order (vitest is preferred over jest)
142
- if (deps['vitest'])
143
- return 'vitest';
144
- if (deps['jest'])
145
- return 'jest';
146
- if (deps['mocha'])
147
- return 'mocha';
148
- }
149
- catch (error) {
150
- console.warn('[project-detector] Failed to parse package.json for test framework detection:', pkgPath, error instanceof Error ? error.message : String(error));
151
- return null;
152
- }
153
- return null;
154
- }
155
- /**
156
- * Detect API framework from package.json or requirements.txt
157
- *
158
- * Checks for: next (Next.js), express (Express), fastapi (FastAPI)
159
- *
160
- * @param path - Project path to check
161
- * @returns Detected API framework or null
162
- */
163
- export function detectApiFramework(path) {
164
- // Check Node.js frameworks first
165
- const pkgPath = join(path, 'package.json');
166
- if (existsSync(pkgPath)) {
167
- try {
168
- const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
169
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
170
- // Check in priority order (Next.js is a more specific framework)
171
- if (deps['next'])
172
- return 'nextjs';
173
- if (deps['express'])
174
- return 'express';
175
- }
176
- catch (error) {
177
- console.warn('[project-detector] Failed to parse package.json for API framework detection:', pkgPath, error instanceof Error ? error.message : String(error));
178
- }
179
- }
180
- // Check for FastAPI (Python)
181
- const requirementsPath = join(path, 'requirements.txt');
182
- if (existsSync(requirementsPath)) {
183
- try {
184
- const content = readFileSync(requirementsPath, 'utf-8');
185
- if (content.toLowerCase().includes('fastapi'))
186
- return 'fastapi';
187
- }
188
- catch (error) {
189
- console.warn('[project-detector] Failed to read requirements.txt:', requirementsPath, error instanceof Error ? error.message : String(error));
190
- }
191
- }
192
- // Also check pyproject.toml for modern Python projects
193
- const pyprojectPath = join(path, 'pyproject.toml');
194
- if (existsSync(pyprojectPath)) {
195
- try {
196
- const content = readFileSync(pyprojectPath, 'utf-8');
197
- if (content.toLowerCase().includes('fastapi'))
198
- return 'fastapi';
199
- }
200
- catch (error) {
201
- console.warn('[project-detector] Failed to read pyproject.toml:', pyprojectPath, error instanceof Error ? error.message : String(error));
202
- }
203
- }
204
- return null;
205
- }
206
- /**
207
- * Known native Node.js modules that require compilation
208
- */
209
- const NATIVE_MODULES = [
210
- 'better-sqlite3',
211
- 'sharp',
212
- 'canvas',
213
- 'bcrypt',
214
- 'onnxruntime-node',
215
- 'node-gyp',
216
- 'node-sass',
217
- 'sqlite3',
218
- 'fsevents',
219
- 'bufferutil',
220
- 'utf-8-validate',
221
- ];
222
- /**
223
- * Detect native module usage in package.json
224
- *
225
- * Checks for modules known to require native compilation:
226
- * better-sqlite3, sharp, canvas, bcrypt, onnxruntime-node, etc.
227
- *
228
- * @param path - Project path to check
229
- * @returns True if native modules are detected
230
- */
231
- export function detectNativeModules(path) {
232
- const pkgPath = join(path, 'package.json');
233
- if (!existsSync(pkgPath))
234
- return false;
235
- try {
236
- const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
237
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
238
- return NATIVE_MODULES.some((mod) => mod in deps);
239
- }
240
- catch (error) {
241
- console.warn('[project-detector] Failed to parse package.json for native module detection:', pkgPath, error instanceof Error ? error.message : String(error));
242
- return false;
243
- }
244
- }
245
- /**
246
- * Detect primary programming language from project structure
247
- *
248
- * Detection order:
249
- * 1. TypeScript (tsconfig.json)
250
- * 2. JavaScript (package.json without tsconfig)
251
- * 3. Python (requirements.txt or pyproject.toml)
252
- *
253
- * @param path - Project path to check
254
- * @returns Detected language or null
255
- */
256
- export function detectLanguage(path) {
257
- // TypeScript takes priority
258
- if (existsSync(join(path, 'tsconfig.json')))
259
- return 'typescript';
260
- // JavaScript (has package.json but no tsconfig)
261
- if (existsSync(join(path, 'package.json')))
262
- return 'javascript';
263
- // Python
264
- if (existsSync(join(path, 'requirements.txt')) || existsSync(join(path, 'pyproject.toml'))) {
265
- return 'python';
266
- }
267
- return null;
268
- }
269
- /**
270
- * Get suggested skills based on project context
271
- *
272
- * @param context - Detected project context
273
- * @returns Array of suggested skill IDs
274
- *
275
- * @example
276
- * const context = detectProjectContext();
277
- * const suggestions = getSuggestedSkills(context);
278
- * // ['docker', 'github-actions', 'jest-helper']
279
- */
280
- export function getSuggestedSkills(context) {
281
- const suggestions = [];
282
- if (context.hasDocker) {
283
- suggestions.push('docker');
284
- }
285
- if (context.hasGitHub) {
286
- suggestions.push('github-actions');
287
- suggestions.push('github-pr');
288
- }
289
- if (context.hasLinear) {
290
- suggestions.push('linear');
291
- }
292
- if (context.testFramework === 'jest') {
293
- suggestions.push('jest-helper');
294
- }
295
- else if (context.testFramework === 'vitest') {
296
- suggestions.push('vitest-helper');
297
- }
298
- else if (context.testFramework === 'mocha') {
299
- suggestions.push('mocha-helper');
300
- }
301
- if (context.apiFramework === 'nextjs') {
302
- suggestions.push('nextjs');
303
- }
304
- else if (context.apiFramework === 'express') {
305
- suggestions.push('express');
306
- }
307
- else if (context.apiFramework === 'fastapi') {
308
- suggestions.push('fastapi');
309
- }
310
- if (context.hasNativeModules) {
311
- suggestions.push('native-modules');
312
- }
313
- if (context.language === 'typescript') {
314
- suggestions.push('typescript');
315
- }
316
- else if (context.language === 'python') {
317
- suggestions.push('python');
318
- }
319
- return suggestions;
320
- }
321
- //# sourceMappingURL=project-detector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project-detector.js","sourceRoot":"","sources":["../../../src/context/project-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAEhD;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,SAAiB,EAAE,OAAe;IAC7D,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACrC,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IAE7F,0DAA0D;IAC1D,6EAA6E;IAC7E,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,YAAY,GAAG,GAAG,CAAC,IAAI,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