@cdxgen/cdxgen 13.5.0 → 13.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. package/README.md +17 -10
  2. package/bin/audit.js +7 -4
  3. package/bin/cdxgen.js +260 -37
  4. package/bin/convert.js +146 -22
  5. package/bin/evinse.js +28 -3
  6. package/bin/repl.js +47 -3
  7. package/bin/sign.js +211 -34
  8. package/bin/tracebom.js +18 -6
  9. package/bin/validate.js +24 -3
  10. package/bin/verify.js +113 -5
  11. package/data/behavior-taxonomy.schema.json +1491 -0
  12. package/data/cyclonedx-2.0-bundled.schema.json +18606 -5528
  13. package/data/cyclonedx-2.0-cryptography-defs.schema.json +857 -0
  14. package/data/license-aliases.json +24 -2
  15. package/data/pqc-migration.json +239 -0
  16. package/data/remediations.json +176 -0
  17. package/data/rules/ai-bom.yaml +1 -1
  18. package/data/rules/brotli-decoder.yaml +107 -0
  19. package/data/rules/cbom-security.yaml +4 -3
  20. package/data/rules/package-integrity.yaml +28 -0
  21. package/data/rules/vscode-extensions.yaml +75 -0
  22. package/data/spdx-license-list.json +121 -7
  23. package/data/spdx-licenses.json +69 -0
  24. package/data/spdx.schema.json +845 -2
  25. package/lib/audit/index.js +25 -3
  26. package/lib/cli/bomAssembly.js +172 -4
  27. package/lib/cli/cliOptions.js +121 -17
  28. package/lib/cli/index.js +720 -902
  29. package/lib/cli/jsBom.js +156 -64
  30. package/lib/cli/jvmBom.js +602 -86
  31. package/lib/cli/managedBom.js +161 -19
  32. package/lib/cli/nativeBom.js +52 -5
  33. package/lib/core/boundedFile.js +344 -0
  34. package/lib/core/brotliProbe.js +182 -0
  35. package/lib/core/env.js +34 -0
  36. package/lib/core/fs.js +138 -3
  37. package/lib/core/globPatterns.js +218 -0
  38. package/lib/core/httpClient.js +98 -1
  39. package/lib/core/lockPaths.js +38 -0
  40. package/lib/core/paths.js +24 -1
  41. package/lib/core/processTree.js +100 -8
  42. package/lib/core/projectConfig.js +332 -25
  43. package/lib/core/toolRegistry.js +184 -0
  44. package/lib/ecosystems/cppEvidence.js +263 -106
  45. package/lib/ecosystems/cppIncludeResolver.js +16 -5
  46. package/lib/ecosystems/denoutils.js +2 -2
  47. package/lib/ecosystems/ecosystems.js +25 -10
  48. package/lib/ecosystems/gemHostProbe.js +301 -0
  49. package/lib/ecosystems/golem.js +3 -8
  50. package/lib/ecosystems/gradleutils.js +1909 -229
  51. package/lib/ecosystems/jsEvidence.js +90 -38
  52. package/lib/ecosystems/kosi.js +3 -5
  53. package/lib/ecosystems/npmVersionResolution.js +376 -0
  54. package/lib/ecosystems/parsers-bazel.js +107 -6
  55. package/lib/ecosystems/parsers-js.js +505 -22
  56. package/lib/ecosystems/parsers-misc.js +209 -20
  57. package/lib/ecosystems/parsers-python.js +178 -30
  58. package/lib/ecosystems/parsers-rust.js +117 -15
  59. package/lib/ecosystems/pythonutils.js +128 -2
  60. package/lib/ecosystems/remote/huggingface.js +22 -0
  61. package/lib/ecosystems/rubyutils.js +538 -31
  62. package/lib/ecosystems/rusi.js +2 -4
  63. package/lib/ecosystems/scalacliutils.js +2 -0
  64. package/lib/ecosystems/scalasem.js +798 -152
  65. package/lib/ecosystems/vendoredCode.js +237 -3
  66. package/lib/ecosystems/venvProbe.js +360 -0
  67. package/lib/evinser/evinser.js +536 -71
  68. package/lib/evinser/scalasem.js +5 -1
  69. package/lib/helpers/agenticToolutils.js +525 -94
  70. package/lib/helpers/bomSigner.js +43 -9
  71. package/lib/helpers/jssSigner.js +1276 -0
  72. package/lib/helpers/vsixutils.js +1574 -315
  73. package/lib/inventory/agentBlueprint.js +193 -0
  74. package/lib/inventory/agentToolNames.js +145 -0
  75. package/lib/inventory/aiCollector.js +153 -7
  76. package/lib/inventory/aiInventory.js +44 -8
  77. package/lib/inventory/aiProviders.js +324 -0
  78. package/lib/inventory/atomUtils.js +77 -0
  79. package/lib/inventory/bomUtils.js +8 -1
  80. package/lib/inventory/brotliDecoder.js +142 -0
  81. package/lib/inventory/buildToolRateLimit.js +1 -1
  82. package/lib/inventory/cbomutils.js +56 -7
  83. package/lib/inventory/ciParsers/githubActionsLock.js +821 -0
  84. package/lib/inventory/citations.js +31 -2
  85. package/lib/inventory/communityAiConfigParser.js +978 -80
  86. package/lib/inventory/cyclonedx20.js +152 -0
  87. package/lib/inventory/cyclonedx20Common.js +286 -0
  88. package/lib/inventory/cyclonedx20Derived.js +159 -0
  89. package/lib/inventory/cyclonedx20Parties.js +552 -0
  90. package/lib/inventory/cyclonedx20Read.js +768 -0
  91. package/lib/inventory/cyclonedx20ReadCommon.js +374 -0
  92. package/lib/inventory/cyclonedx20ReadComponents.js +692 -0
  93. package/lib/inventory/cyclonedx20ReadContext.js +380 -0
  94. package/lib/inventory/cyclonedx20ReadEvidence.js +466 -0
  95. package/lib/inventory/cyclonedx20ReadSections.js +599 -0
  96. package/lib/inventory/cyclonedx20Render.js +766 -0
  97. package/lib/inventory/cyclonedx20RenderComponents.js +716 -0
  98. package/lib/inventory/cyclonedx20RenderDefinitions.js +405 -0
  99. package/lib/inventory/cyclonedx20RenderEvidence.js +726 -0
  100. package/lib/inventory/cyclonedx20RenderHardware.js +203 -0
  101. package/lib/inventory/cyclonedx20RenderPatents.js +174 -0
  102. package/lib/inventory/cyclonedx20RenderRefIds.js +314 -0
  103. package/lib/inventory/cyclonedx20RenderSections.js +499 -0
  104. package/lib/inventory/cyclonedx20Tables.js +594 -0
  105. package/lib/inventory/deps.js +141 -13
  106. package/lib/inventory/dosai.js +375 -6
  107. package/lib/inventory/dosaiParsers.js +3 -6
  108. package/lib/inventory/dotnetRuntime.js +367 -0
  109. package/lib/inventory/ecosystemFormulationParsers.js +979 -0
  110. package/lib/inventory/envcontext.js +436 -48
  111. package/lib/inventory/evidenceUtils.js +13 -1
  112. package/lib/inventory/fetchBatch.js +1 -1
  113. package/lib/inventory/formulationParsers.js +124 -14
  114. package/lib/inventory/gtfobins.js +13 -0
  115. package/lib/inventory/hbom.js +45 -6
  116. package/lib/inventory/hbomLoader.js +166 -0
  117. package/lib/inventory/hostRuntimeProbe.js +686 -0
  118. package/lib/inventory/jvmLocalRepos.js +9 -2
  119. package/lib/inventory/jvmToolEnv.js +29 -0
  120. package/lib/inventory/licenseEnhancer.js +12 -0
  121. package/lib/inventory/mavenCentralMirror.js +534 -0
  122. package/lib/inventory/mcpConfigParser.js +5 -0
  123. package/lib/inventory/nodeBuildInfo.js +218 -0
  124. package/lib/inventory/nodeHostProbe.js +202 -0
  125. package/lib/inventory/occurrenceKey.js +90 -0
  126. package/lib/inventory/osPackageResolver.js +182 -0
  127. package/lib/inventory/phpBuildInfo.js +10 -59
  128. package/lib/inventory/phpHostProbe.js +32 -488
  129. package/lib/inventory/pqcMigration.js +426 -0
  130. package/lib/inventory/rubyBuildInfo.js +972 -0
  131. package/lib/inventory/rubyHostProbe.js +218 -0
  132. package/lib/inventory/rustFormulationParser.js +21 -10
  133. package/lib/inventory/scalaCoords.js +4 -3
  134. package/lib/inventory/scalaDedupe.js +440 -0
  135. package/lib/inventory/source.js +114 -8
  136. package/lib/managers/binary.js +337 -3
  137. package/lib/managers/docker.js +79 -0
  138. package/lib/parsers/huggingfaceManifest.js +9 -1
  139. package/lib/parsers/huggingfaceUtils.js +18 -0
  140. package/lib/parsers/kiroPermissions.js +166 -0
  141. package/lib/parsers/largeJson.js +28 -11
  142. package/lib/parsers/vscodeExtensionId.js +183 -0
  143. package/lib/server/server.js +48 -35
  144. package/lib/stages/postgen/postgen.js +41 -1
  145. package/lib/stages/postgen/ruleEngine.js +13 -5
  146. package/lib/stages/postgen/specVersionCompat.js +76 -0
  147. package/lib/stages/pregen/envAudit.js +1 -0
  148. package/lib/stages/pregen/pregen.js +114 -57
  149. package/lib/validator/bomValidator.js +14 -2
  150. package/lib/validator/complianceEngine.js +30 -3
  151. package/lib/validator/complianceRules.js +1416 -4
  152. package/lib/validator/generated/validate-1.6.mjs +1 -1
  153. package/lib/validator/generated/validate-1.7.mjs +1 -1
  154. package/lib/validator/generated/validate-2.0.mjs +57554 -13851
  155. package/lib/validator/index.js +49 -8
  156. package/lib/validator/reporters/json.js +6 -0
  157. package/package.json +11 -10
  158. package/types/bin/repl.d.ts.map +1 -1
  159. package/types/lib/audit/index.d.ts +6 -2
  160. package/types/lib/audit/index.d.ts.map +1 -1
  161. package/types/lib/cli/bomAssembly.d.ts +29 -1
  162. package/types/lib/cli/bomAssembly.d.ts.map +1 -1
  163. package/types/lib/cli/cliOptions.d.ts +6 -0
  164. package/types/lib/cli/cliOptions.d.ts.map +1 -1
  165. package/types/lib/cli/index.d.ts.map +1 -1
  166. package/types/lib/cli/jsBom.d.ts +3 -18
  167. package/types/lib/cli/jsBom.d.ts.map +1 -1
  168. package/types/lib/cli/jvmBom.d.ts +15 -0
  169. package/types/lib/cli/jvmBom.d.ts.map +1 -1
  170. package/types/lib/cli/managedBom.d.ts.map +1 -1
  171. package/types/lib/cli/nativeBom.d.ts.map +1 -1
  172. package/types/lib/core/boundedFile.d.ts +100 -0
  173. package/types/lib/core/boundedFile.d.ts.map +1 -0
  174. package/types/lib/core/brotliProbe.d.ts +37 -0
  175. package/types/lib/core/brotliProbe.d.ts.map +1 -0
  176. package/types/lib/core/env.d.ts +14 -0
  177. package/types/lib/core/env.d.ts.map +1 -1
  178. package/types/lib/core/fs.d.ts +4 -0
  179. package/types/lib/core/fs.d.ts.map +1 -1
  180. package/types/lib/core/globPatterns.d.ts +70 -0
  181. package/types/lib/core/globPatterns.d.ts.map +1 -0
  182. package/types/lib/core/httpClient.d.ts +24 -0
  183. package/types/lib/core/httpClient.d.ts.map +1 -1
  184. package/types/lib/core/lockPaths.d.ts +19 -0
  185. package/types/lib/core/lockPaths.d.ts.map +1 -0
  186. package/types/lib/core/paths.d.ts +9 -0
  187. package/types/lib/core/paths.d.ts.map +1 -1
  188. package/types/lib/core/processTree.d.ts +17 -4
  189. package/types/lib/core/processTree.d.ts.map +1 -1
  190. package/types/lib/core/projectConfig.d.ts +47 -8
  191. package/types/lib/core/projectConfig.d.ts.map +1 -1
  192. package/types/lib/core/toolRegistry.d.ts +36 -0
  193. package/types/lib/core/toolRegistry.d.ts.map +1 -0
  194. package/types/lib/ecosystems/cppEvidence.d.ts +40 -13
  195. package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
  196. package/types/lib/ecosystems/cppIncludeResolver.d.ts +2 -1
  197. package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -1
  198. package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
  199. package/types/lib/ecosystems/gemHostProbe.d.ts +28 -0
  200. package/types/lib/ecosystems/gemHostProbe.d.ts.map +1 -0
  201. package/types/lib/ecosystems/golem.d.ts.map +1 -1
  202. package/types/lib/ecosystems/gradleutils.d.ts +294 -20
  203. package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
  204. package/types/lib/ecosystems/jsEvidence.d.ts +14 -1
  205. package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
  206. package/types/lib/ecosystems/kosi.d.ts.map +1 -1
  207. package/types/lib/ecosystems/npmVersionResolution.d.ts +119 -0
  208. package/types/lib/ecosystems/npmVersionResolution.d.ts.map +1 -0
  209. package/types/lib/ecosystems/parsers-bazel.d.ts.map +1 -1
  210. package/types/lib/ecosystems/parsers-js.d.ts +17 -20
  211. package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
  212. package/types/lib/ecosystems/parsers-misc.d.ts +19 -0
  213. package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
  214. package/types/lib/ecosystems/parsers-python.d.ts +10 -0
  215. package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
  216. package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
  217. package/types/lib/ecosystems/pythonutils.d.ts +19 -1
  218. package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
  219. package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
  220. package/types/lib/ecosystems/rubyutils.d.ts +144 -12
  221. package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
  222. package/types/lib/ecosystems/rusi.d.ts.map +1 -1
  223. package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -1
  224. package/types/lib/ecosystems/scalasem.d.ts +58 -16
  225. package/types/lib/ecosystems/scalasem.d.ts.map +1 -1
  226. package/types/lib/ecosystems/vendoredCode.d.ts +26 -0
  227. package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -1
  228. package/types/lib/ecosystems/venvProbe.d.ts +40 -0
  229. package/types/lib/ecosystems/venvProbe.d.ts.map +1 -0
  230. package/types/lib/evinser/evinser.d.ts +120 -13
  231. package/types/lib/evinser/evinser.d.ts.map +1 -1
  232. package/types/lib/evinser/scalasem.d.ts.map +1 -1
  233. package/types/lib/helpers/agenticToolutils.d.ts +53 -19
  234. package/types/lib/helpers/agenticToolutils.d.ts.map +1 -1
  235. package/types/lib/helpers/bomSigner.d.ts +20 -3
  236. package/types/lib/helpers/bomSigner.d.ts.map +1 -1
  237. package/types/lib/helpers/jssSigner.d.ts +288 -0
  238. package/types/lib/helpers/jssSigner.d.ts.map +1 -0
  239. package/types/lib/helpers/vsixutils.d.ts +303 -19
  240. package/types/lib/helpers/vsixutils.d.ts.map +1 -1
  241. package/types/lib/inventory/agentBlueprint.d.ts +70 -0
  242. package/types/lib/inventory/agentBlueprint.d.ts.map +1 -0
  243. package/types/lib/inventory/agentToolNames.d.ts +51 -0
  244. package/types/lib/inventory/agentToolNames.d.ts.map +1 -0
  245. package/types/lib/inventory/aiCollector.d.ts.map +1 -1
  246. package/types/lib/inventory/aiInventory.d.ts.map +1 -1
  247. package/types/lib/inventory/aiProviders.d.ts +85 -0
  248. package/types/lib/inventory/aiProviders.d.ts.map +1 -0
  249. package/types/lib/inventory/atomUtils.d.ts +19 -0
  250. package/types/lib/inventory/atomUtils.d.ts.map +1 -1
  251. package/types/lib/inventory/bomUtils.d.ts.map +1 -1
  252. package/types/lib/inventory/brotliDecoder.d.ts +58 -0
  253. package/types/lib/inventory/brotliDecoder.d.ts.map +1 -0
  254. package/types/lib/inventory/cbomutils.d.ts +17 -0
  255. package/types/lib/inventory/cbomutils.d.ts.map +1 -1
  256. package/types/lib/inventory/ciParsers/githubActionsLock.d.ts +101 -0
  257. package/types/lib/inventory/ciParsers/githubActionsLock.d.ts.map +1 -0
  258. package/types/lib/inventory/citations.d.ts +5 -0
  259. package/types/lib/inventory/citations.d.ts.map +1 -1
  260. package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
  261. package/types/lib/inventory/cyclonedx20.d.ts +99 -0
  262. package/types/lib/inventory/cyclonedx20.d.ts.map +1 -0
  263. package/types/lib/inventory/cyclonedx20Common.d.ts +102 -0
  264. package/types/lib/inventory/cyclonedx20Common.d.ts.map +1 -0
  265. package/types/lib/inventory/cyclonedx20Derived.d.ts +74 -0
  266. package/types/lib/inventory/cyclonedx20Derived.d.ts.map +1 -0
  267. package/types/lib/inventory/cyclonedx20Parties.d.ts +91 -0
  268. package/types/lib/inventory/cyclonedx20Parties.d.ts.map +1 -0
  269. package/types/lib/inventory/cyclonedx20Read.d.ts +51 -0
  270. package/types/lib/inventory/cyclonedx20Read.d.ts.map +1 -0
  271. package/types/lib/inventory/cyclonedx20ReadCommon.d.ts +69 -0
  272. package/types/lib/inventory/cyclonedx20ReadCommon.d.ts.map +1 -0
  273. package/types/lib/inventory/cyclonedx20ReadComponents.d.ts +77 -0
  274. package/types/lib/inventory/cyclonedx20ReadComponents.d.ts.map +1 -0
  275. package/types/lib/inventory/cyclonedx20ReadContext.d.ts +118 -0
  276. package/types/lib/inventory/cyclonedx20ReadContext.d.ts.map +1 -0
  277. package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts +40 -0
  278. package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts.map +1 -0
  279. package/types/lib/inventory/cyclonedx20ReadSections.d.ts +45 -0
  280. package/types/lib/inventory/cyclonedx20ReadSections.d.ts.map +1 -0
  281. package/types/lib/inventory/cyclonedx20Render.d.ts +53 -0
  282. package/types/lib/inventory/cyclonedx20Render.d.ts.map +1 -0
  283. package/types/lib/inventory/cyclonedx20RenderComponents.d.ts +73 -0
  284. package/types/lib/inventory/cyclonedx20RenderComponents.d.ts.map +1 -0
  285. package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts +29 -0
  286. package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts.map +1 -0
  287. package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts +110 -0
  288. package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts.map +1 -0
  289. package/types/lib/inventory/cyclonedx20RenderHardware.d.ts +42 -0
  290. package/types/lib/inventory/cyclonedx20RenderHardware.d.ts.map +1 -0
  291. package/types/lib/inventory/cyclonedx20RenderPatents.d.ts +26 -0
  292. package/types/lib/inventory/cyclonedx20RenderPatents.d.ts.map +1 -0
  293. package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts +55 -0
  294. package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts.map +1 -0
  295. package/types/lib/inventory/cyclonedx20RenderSections.d.ts +45 -0
  296. package/types/lib/inventory/cyclonedx20RenderSections.d.ts.map +1 -0
  297. package/types/lib/inventory/cyclonedx20Tables.d.ts +134 -0
  298. package/types/lib/inventory/cyclonedx20Tables.d.ts.map +1 -0
  299. package/types/lib/inventory/deps.d.ts +35 -2
  300. package/types/lib/inventory/deps.d.ts.map +1 -1
  301. package/types/lib/inventory/dosai.d.ts +36 -1
  302. package/types/lib/inventory/dosai.d.ts.map +1 -1
  303. package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
  304. package/types/lib/inventory/dotnetRuntime.d.ts +91 -0
  305. package/types/lib/inventory/dotnetRuntime.d.ts.map +1 -0
  306. package/types/lib/inventory/ecosystemFormulationParsers.d.ts +73 -0
  307. package/types/lib/inventory/ecosystemFormulationParsers.d.ts.map +1 -0
  308. package/types/lib/inventory/envcontext.d.ts +74 -12
  309. package/types/lib/inventory/envcontext.d.ts.map +1 -1
  310. package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
  311. package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
  312. package/types/lib/inventory/gtfobins.d.ts.map +1 -1
  313. package/types/lib/inventory/hbom.d.ts +11 -0
  314. package/types/lib/inventory/hbom.d.ts.map +1 -1
  315. package/types/lib/inventory/hbomLoader.d.ts +54 -0
  316. package/types/lib/inventory/hbomLoader.d.ts.map +1 -1
  317. package/types/lib/inventory/hostRuntimeProbe.d.ts +44 -0
  318. package/types/lib/inventory/hostRuntimeProbe.d.ts.map +1 -0
  319. package/types/lib/inventory/jvmLocalRepos.d.ts +5 -1
  320. package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -1
  321. package/types/lib/inventory/jvmToolEnv.d.ts +12 -0
  322. package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -1
  323. package/types/lib/inventory/licenseEnhancer.d.ts.map +1 -1
  324. package/types/lib/inventory/mavenCentralMirror.d.ts +170 -0
  325. package/types/lib/inventory/mavenCentralMirror.d.ts.map +1 -0
  326. package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
  327. package/types/lib/inventory/nodeBuildInfo.d.ts +95 -0
  328. package/types/lib/inventory/nodeBuildInfo.d.ts.map +1 -0
  329. package/types/lib/inventory/nodeHostProbe.d.ts +15 -0
  330. package/types/lib/inventory/nodeHostProbe.d.ts.map +1 -0
  331. package/types/lib/inventory/occurrenceKey.d.ts +52 -0
  332. package/types/lib/inventory/occurrenceKey.d.ts.map +1 -0
  333. package/types/lib/inventory/osPackageResolver.d.ts +38 -0
  334. package/types/lib/inventory/osPackageResolver.d.ts.map +1 -1
  335. package/types/lib/inventory/phpBuildInfo.d.ts.map +1 -1
  336. package/types/lib/inventory/phpHostProbe.d.ts.map +1 -1
  337. package/types/lib/inventory/pqcMigration.d.ts +84 -0
  338. package/types/lib/inventory/pqcMigration.d.ts.map +1 -0
  339. package/types/lib/inventory/rubyBuildInfo.d.ts +271 -0
  340. package/types/lib/inventory/rubyBuildInfo.d.ts.map +1 -0
  341. package/types/lib/inventory/rubyHostProbe.d.ts +47 -0
  342. package/types/lib/inventory/rubyHostProbe.d.ts.map +1 -0
  343. package/types/lib/inventory/rustFormulationParser.d.ts +7 -2
  344. package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
  345. package/types/lib/inventory/scalaCoords.d.ts.map +1 -1
  346. package/types/lib/inventory/scalaDedupe.d.ts +43 -0
  347. package/types/lib/inventory/scalaDedupe.d.ts.map +1 -0
  348. package/types/lib/inventory/source.d.ts +25 -0
  349. package/types/lib/inventory/source.d.ts.map +1 -1
  350. package/types/lib/managers/binary.d.ts.map +1 -1
  351. package/types/lib/managers/docker.d.ts +12 -0
  352. package/types/lib/managers/docker.d.ts.map +1 -1
  353. package/types/lib/parsers/huggingfaceManifest.d.ts +10 -1
  354. package/types/lib/parsers/huggingfaceManifest.d.ts.map +1 -1
  355. package/types/lib/parsers/huggingfaceUtils.d.ts +12 -0
  356. package/types/lib/parsers/huggingfaceUtils.d.ts.map +1 -1
  357. package/types/lib/parsers/kiroPermissions.d.ts +62 -0
  358. package/types/lib/parsers/kiroPermissions.d.ts.map +1 -0
  359. package/types/lib/parsers/largeJson.d.ts +4 -3
  360. package/types/lib/parsers/largeJson.d.ts.map +1 -1
  361. package/types/lib/parsers/vscodeExtensionId.d.ts +48 -0
  362. package/types/lib/parsers/vscodeExtensionId.d.ts.map +1 -0
  363. package/types/lib/server/server.d.ts.map +1 -1
  364. package/types/lib/stages/postgen/postgen.d.ts +7 -0
  365. package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
  366. package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
  367. package/types/lib/stages/postgen/specVersionCompat.d.ts +25 -0
  368. package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
  369. package/types/lib/stages/pregen/envAudit.d.ts.map +1 -1
  370. package/types/lib/stages/pregen/pregen.d.ts +12 -8
  371. package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
  372. package/types/lib/validator/bomValidator.d.ts +5 -1
  373. package/types/lib/validator/bomValidator.d.ts.map +1 -1
  374. package/types/lib/validator/complianceEngine.d.ts +4 -4
  375. package/types/lib/validator/complianceEngine.d.ts.map +1 -1
  376. package/types/lib/validator/complianceRules.d.ts +14 -2
  377. package/types/lib/validator/complianceRules.d.ts.map +1 -1
  378. package/types/lib/validator/index.d.ts +10 -0
  379. package/types/lib/validator/index.d.ts.map +1 -1
  380. package/types/lib/validator/reporters/json.d.ts.map +1 -1
package/lib/cli/jsBom.js CHANGED
@@ -70,9 +70,13 @@ import {
70
70
  } from "../helpers/agenticToolutils.js";
71
71
  import {
72
72
  cleanupTempDir,
73
- collectInstalledExtensions,
73
+ collectIdeInventory,
74
74
  discoverIdeExtensionDirs,
75
75
  extractVsixToTempDir,
76
+ identifyIdeFromExtensionsDir,
77
+ isInstalledExtensionDir,
78
+ isInstalledExtensionsDir,
79
+ mergeExtensionComponents,
76
80
  parseVsixFile,
77
81
  VSCODE_EXTENSION_PURL_TYPE,
78
82
  } from "../helpers/vsixutils.js";
@@ -96,6 +100,7 @@ import {
96
100
  } from "../inventory/depsUtils.js";
97
101
  import { GIT_COMMAND } from "../inventory/envcontext.js";
98
102
  import { tryBuildPurl } from "../inventory/purl.js";
103
+ import { isInsideInstalledGem } from "../inventory/rubyBuildInfo.js";
99
104
  import { DEFAULT_NPMRC_BLOCKLIST, parseNpmrc } from "../parsers/npmrc.js";
100
105
  import {
101
106
  buildBomNSData,
@@ -127,6 +132,13 @@ const isWin = _platform() === "win32";
127
132
  * @param {object} options CLI options
128
133
  * @returns {string|undefined} The detected AI inventory type (`"ai"`) or undefined
129
134
  */
135
+ // The manifests and lockfiles inside an installed gem, such as the VS Code
136
+ // extension typeprof ships, are part of the gem's sources and install nothing.
137
+ // An image scan reads each gem home as a directory of its own, so the check is
138
+ // on the absolute path rather than a glob relative to the scanned directory.
139
+ const outsideInstalledGems = (files, scanRoot) =>
140
+ files.filter((file) => !isInsideInstalledGem(file, safeExistsSync, scanRoot));
141
+
130
142
  export function getDirectAiInventoryType(path, options) {
131
143
  const exactAiInventoryType = getExactAiInventoryType(options);
132
144
  if (exactAiInventoryType) {
@@ -166,6 +178,9 @@ export async function createNodejsBom(path, options) {
166
178
  let dependencies = [];
167
179
  let parentComponent = {};
168
180
  const parentSubComponents = [];
181
+ // Formulation components reported by the pnpm lockfiles, such as the
182
+ // pnpm version resolved for the project.
183
+ const pnpmFormulationList = [];
169
184
  let ppurl = "";
170
185
  const exactAiInventoryType = getDirectAiInventoryType(path, options);
171
186
  const requestedAiInventoryTypes = getRequestedAiInventoryTypes(options);
@@ -225,7 +240,10 @@ export async function createNodejsBom(path, options) {
225
240
  }
226
241
  // Docker mode requires special handling
227
242
  if (hasAnyProjectType(["docker", "oci", "container", "os"], options, false)) {
228
- const pkgJsonFiles = getAllFiles(path, "**/package.json", options);
243
+ const pkgJsonFiles = outsideInstalledGems(
244
+ getAllFiles(path, "**/package.json", options),
245
+ path,
246
+ );
229
247
  // Are there any package.json files in the container?
230
248
  if (pkgJsonFiles.length) {
231
249
  // Every manifest is read locally first, and the registry is asked about
@@ -314,33 +332,48 @@ export async function createNodejsBom(path, options) {
314
332
  // otherwise the dependencies of those nested projects are silently dropped
315
333
  // from the BOM (see #4224). node_modules and .git stay ignored by getAllFiles.
316
334
  const lockSearchOptions = { ...options, includeDot: true };
317
- let yarnLockFiles = getAllFiles(
335
+ let yarnLockFiles = outsideInstalledGems(
336
+ getAllFiles(
337
+ path,
338
+ `${options.multiProject ? "**/" : ""}yarn.lock`,
339
+ lockSearchOptions,
340
+ ),
318
341
  path,
319
- `${options.multiProject ? "**/" : ""}yarn.lock`,
320
- lockSearchOptions,
321
342
  );
322
- const shrinkwrapFiles = getAllFiles(
343
+ const shrinkwrapFiles = outsideInstalledGems(
344
+ getAllFiles(
345
+ path,
346
+ `${options.multiProject ? "**/" : ""}npm-shrinkwrap.json`,
347
+ lockSearchOptions,
348
+ ),
323
349
  path,
324
- `${options.multiProject ? "**/" : ""}npm-shrinkwrap.json`,
325
- lockSearchOptions,
326
350
  );
327
- let pkgLockFiles = getAllFiles(
351
+ let pkgLockFiles = outsideInstalledGems(
352
+ getAllFiles(
353
+ path,
354
+ `${options.multiProject ? "**/" : ""}package-lock.json`,
355
+ lockSearchOptions,
356
+ ),
328
357
  path,
329
- `${options.multiProject ? "**/" : ""}package-lock.json`,
330
- lockSearchOptions,
331
358
  );
332
359
  if (shrinkwrapFiles.length) {
333
360
  pkgLockFiles = pkgLockFiles.concat(shrinkwrapFiles);
334
361
  }
335
- let pnpmLockFiles = getAllFiles(
362
+ let pnpmLockFiles = outsideInstalledGems(
363
+ getAllFiles(
364
+ path,
365
+ `${options.multiProject ? "**/" : ""}pnpm-lock.yaml`,
366
+ lockSearchOptions,
367
+ ),
336
368
  path,
337
- `${options.multiProject ? "**/" : ""}pnpm-lock.yaml`,
338
- lockSearchOptions,
339
369
  );
340
- const bunLockFiles = getAllFiles(
370
+ const bunLockFiles = outsideInstalledGems(
371
+ getAllFiles(
372
+ path,
373
+ `${options.multiProject ? "**/" : ""}bun.lock`,
374
+ lockSearchOptions,
375
+ ),
341
376
  path,
342
- `${options.multiProject ? "**/" : ""}bun.lock`,
343
- lockSearchOptions,
344
377
  );
345
378
  // Warn about the binary bun lockfile which cdxgen cannot parse. Users should
346
379
  // regenerate a text lockfile with `bun install --save-text-lockfile`.
@@ -476,15 +509,21 @@ export async function createNodejsBom(path, options) {
476
509
  }
477
510
  }
478
511
  }
479
- const pkgJsonLockFiles = getAllFiles(
512
+ const pkgJsonLockFiles = outsideInstalledGems(
513
+ getAllFiles(
514
+ path,
515
+ `${options.multiProject ? "**/" : ""}package-lock.json`,
516
+ lockSearchOptions,
517
+ ),
480
518
  path,
481
- `${options.multiProject ? "**/" : ""}package-lock.json`,
482
- lockSearchOptions,
483
519
  );
484
- const pkgJsonFiles = getAllFiles(
520
+ const pkgJsonFiles = outsideInstalledGems(
521
+ getAllFiles(
522
+ path,
523
+ `${options.multiProject ? "**/" : ""}package.json`,
524
+ lockSearchOptions,
525
+ ),
485
526
  path,
486
- `${options.multiProject ? "**/" : ""}package.json`,
487
- lockSearchOptions,
488
527
  );
489
528
  const npmInstallCount =
490
529
  Number.parseInt(readEnvironmentVariable("NPM_INSTALL_COUNT"), 10) || 2;
@@ -708,20 +747,29 @@ export async function createNodejsBom(path, options) {
708
747
  anyInstallSuccess = true;
709
748
  }
710
749
  }
711
- pkgLockFiles = getAllFiles(
750
+ pkgLockFiles = outsideInstalledGems(
751
+ getAllFiles(
752
+ path,
753
+ `${options.multiProject ? "**/" : ""}package-lock.json`,
754
+ options,
755
+ ),
712
756
  path,
713
- `${options.multiProject ? "**/" : ""}package-lock.json`,
714
- options,
715
757
  );
716
- pnpmLockFiles = getAllFiles(
758
+ pnpmLockFiles = outsideInstalledGems(
759
+ getAllFiles(
760
+ path,
761
+ `${options.multiProject ? "**/" : ""}pnpm-lock.yaml`,
762
+ options,
763
+ ),
717
764
  path,
718
- `${options.multiProject ? "**/" : ""}pnpm-lock.yaml`,
719
- options,
720
765
  );
721
- yarnLockFiles = getAllFiles(
766
+ yarnLockFiles = outsideInstalledGems(
767
+ getAllFiles(
768
+ path,
769
+ `${options.multiProject ? "**/" : ""}yarn.lock`,
770
+ options,
771
+ ),
722
772
  path,
723
- `${options.multiProject ? "**/" : ""}yarn.lock`,
724
- options,
725
773
  );
726
774
  if (
727
775
  anyInstallSuccess &&
@@ -743,7 +791,6 @@ export async function createNodejsBom(path, options) {
743
791
  const workspaceSrcFiles = {};
744
792
  const workspaceDirectDeps = {};
745
793
  const depsWorkspaceRefs = {};
746
- let workspaceCatalogs = {};
747
794
  const seenPkgJsonFiles = {};
748
795
  // Is this a pnpm workspace?
749
796
  for (const f of pnpmWorkspaceFiles) {
@@ -832,10 +879,6 @@ export async function createNodejsBom(path, options) {
832
879
  }
833
880
  }
834
881
  }
835
- workspaceCatalogs = {
836
- ...workspaceCatalogs,
837
- ...(workspaceObj.catalogs || {}),
838
- };
839
882
  }
840
883
  if (DEBUG_MODE && Object.keys(seenPkgJsonFiles).length) {
841
884
  console.log(
@@ -898,11 +941,13 @@ export async function createNodejsBom(path, options) {
898
941
  parentComponent,
899
942
  workspacePackages,
900
943
  workspaceSrcFiles,
901
- workspaceCatalogs,
902
944
  workspaceDirectDeps,
903
945
  depsWorkspaceRefs,
904
946
  path,
905
947
  );
948
+ if (parsedList?.formulationList?.length) {
949
+ pnpmFormulationList.push(...parsedList.formulationList);
950
+ }
906
951
  const dlist = parsedList.pkgList;
907
952
  if (dlist?.length) {
908
953
  pkgList = pkgList.concat(dlist);
@@ -1028,6 +1073,7 @@ export async function createNodejsBom(path, options) {
1028
1073
  allImports,
1029
1074
  allExports,
1030
1075
  options.deep,
1076
+ { srcDir: path },
1031
1077
  );
1032
1078
  return buildBomNSData(options, pkgList, "npm", {
1033
1079
  allImports,
@@ -1043,7 +1089,6 @@ export async function createNodejsBom(path, options) {
1043
1089
  {},
1044
1090
  {},
1045
1091
  {},
1046
- {},
1047
1092
  path,
1048
1093
  );
1049
1094
  let pkgList = addWasmComponentsFromImports(
@@ -1062,6 +1107,7 @@ export async function createNodejsBom(path, options) {
1062
1107
  allImports,
1063
1108
  allExports,
1064
1109
  options.deep,
1110
+ { srcDir: path, dependencies },
1065
1111
  );
1066
1112
  pkgList = propagateRequiredScopeFromDependencies(pkgList, dependencies);
1067
1113
  pkgList = markNpmTypesPackagesAsExcluded(pkgList);
@@ -1507,6 +1553,7 @@ export async function createNodejsBom(path, options) {
1507
1553
  allImports,
1508
1554
  allExports,
1509
1555
  options.deep,
1556
+ { srcDir: path, dependencies, parentComponent },
1510
1557
  );
1511
1558
  if (mcpInventory.components?.length) {
1512
1559
  pkgList = trimComponents(pkgList.concat(mcpInventory.components));
@@ -1554,6 +1601,7 @@ export async function createNodejsBom(path, options) {
1554
1601
  dependencies,
1555
1602
  parentComponent,
1556
1603
  services: inventoryServices,
1604
+ formulationList: pnpmFormulationList,
1557
1605
  });
1558
1606
  }
1559
1607
 
@@ -1724,12 +1772,13 @@ export async function createVscodeExtensionBom(path, options) {
1724
1772
  // Mode 1: Scan for .vsix files in the given directory, or treat the input
1725
1773
  // path as a single .vsix file.
1726
1774
  let vsixFiles = [];
1727
- if (path.endsWith(".vsix")) {
1775
+ const isVsixPath = path.toLowerCase().endsWith(".vsix");
1776
+ if (isVsixPath) {
1728
1777
  vsixFiles = [resolve(path)];
1729
1778
  } else {
1730
1779
  vsixFiles = getAllFiles(
1731
1780
  path,
1732
- `${options.multiProject ? "**/" : ""}*.vsix`,
1781
+ `${options.multiProject ? "**/" : ""}*.{vsix,VSIX,Vsix}`,
1733
1782
  options,
1734
1783
  );
1735
1784
  }
@@ -1764,32 +1813,68 @@ export async function createVscodeExtensionBom(path, options) {
1764
1813
  }
1765
1814
  }
1766
1815
 
1767
- // Mode 2: Auto-discover extensions from known IDE locations
1768
- if (shouldDiscoverInstalledIdeExtensions) {
1769
- const ideDirs = discoverIdeExtensionDirs();
1770
- if (ideDirs.length) {
1816
+ // Mode 2: The path is an editor's extensions folder, such as
1817
+ // ~/.cursor/extensions copied off a workstation, or one extension in such a
1818
+ // folder. A source repository that contains an extension is neither. The
1819
+ // editor's own version is looked up beside the folder, never among this
1820
+ // machine's installed applications.
1821
+ const resolvedPath = resolve(path);
1822
+ const pathIdeDirs = [];
1823
+ const pathFolder = (dir, only) => {
1824
+ const ide = identifyIdeFromExtensionsDir(dir);
1825
+ return {
1826
+ ...(ide || { name: undefined }),
1827
+ dir,
1828
+ only,
1829
+ probeApps: false,
1830
+ };
1831
+ };
1832
+ if (!isVsixPath && safeExistsSync(resolvedPath)) {
1833
+ if (isInstalledExtensionsDir(resolvedPath)) {
1834
+ pathIdeDirs.push(pathFolder(resolvedPath));
1835
+ } else if (
1836
+ isInstalledExtensionsDir(dirname(resolvedPath)) &&
1837
+ isInstalledExtensionDir(resolvedPath)
1838
+ ) {
1839
+ pathIdeDirs.push(
1840
+ pathFolder(dirname(resolvedPath), basename(resolvedPath)),
1841
+ );
1842
+ }
1843
+ }
1844
+
1845
+ // Mode 3: Auto-discover extensions from known IDE locations when the path
1846
+ // held nothing to scan, so `cdxgen -t ide` in any folder reads this host
1847
+ // while `cdxgen -t ide <folder of .vsix files>` reads only that folder.
1848
+ const hostIdeDirs =
1849
+ shouldDiscoverInstalledIdeExtensions &&
1850
+ !pathIdeDirs.length &&
1851
+ !vsixFiles.length
1852
+ ? discoverIdeExtensionDirs()
1853
+ : [];
1854
+ if (hostIdeDirs.length && DEBUG_MODE) {
1855
+ console.log(
1856
+ `Discovered IDE extension directories: ${hostIdeDirs.map((d) => `${d.name}: ${d.dir}`).join(", ")}`,
1857
+ );
1858
+ }
1859
+ const ideDirs = [...pathIdeDirs, ...hostIdeDirs];
1860
+ if (ideDirs.length) {
1861
+ const inventory = collectIdeInventory(ideDirs);
1862
+ if (inventory.components.length) {
1771
1863
  if (DEBUG_MODE) {
1772
1864
  console.log(
1773
- `Discovered IDE extension directories: ${ideDirs.map((d) => `${d.name}: ${d.dir}`).join(", ")}`,
1865
+ `Found ${inventory.components.length} IDE and extension component(s) in ${ideDirs.length} folder(s)`,
1774
1866
  );
1775
1867
  }
1776
- const ideExtensions = collectInstalledExtensions(ideDirs);
1777
- if (ideExtensions.length) {
1778
- if (DEBUG_MODE) {
1779
- console.log(
1780
- `Found ${ideExtensions.length} IDE extension(s) from ${ideDirs.length} IDE location(s)`,
1781
- );
1782
- }
1783
- pkgList = pkgList.concat(ideExtensions);
1784
- // Deep analysis for IDE extension directories
1785
- for (const ideDir of ideDirs) {
1786
- await analyzeInstalledExtensionDirs(
1787
- ideDir.dir,
1788
- options,
1789
- pkgList,
1790
- dependencies,
1791
- );
1792
- }
1868
+ pkgList = pkgList.concat(inventory.components);
1869
+ dependencies = mergeDependencies(dependencies, inventory.dependencies);
1870
+ for (const ideDir of ideDirs) {
1871
+ await analyzeInstalledExtensionDirs(
1872
+ ideDir.dir,
1873
+ options,
1874
+ pkgList,
1875
+ dependencies,
1876
+ ideDir.only,
1877
+ );
1793
1878
  }
1794
1879
  }
1795
1880
  }
@@ -1798,7 +1883,9 @@ export async function createVscodeExtensionBom(path, options) {
1798
1883
  for (const td of tempDirs) {
1799
1884
  cleanupTempDir(td);
1800
1885
  }
1801
- pkgList = trimComponents(pkgList);
1886
+ // A .vsix and the folder it was installed into describe one build; merge
1887
+ // them before trimComponents keeps only the first.
1888
+ pkgList = trimComponents(mergeExtensionComponents(pkgList));
1802
1889
  return buildBomNSData(options, pkgList, VSCODE_EXTENSION_PURL_TYPE, {
1803
1890
  src: path,
1804
1891
  filename: vsixFiles.join(", "),
@@ -2189,12 +2276,14 @@ export async function analyzeExtensionDir(extDir, options) {
2189
2276
  * @param {Object} options CLI options
2190
2277
  * @param {Object[]} pkgList Mutable array to push discovered components into
2191
2278
  * @param {Object[]} dependencies Mutable array to merge dependencies into
2279
+ * @param {string} [onlyEntry] Analyze only this extension folder
2192
2280
  */
2193
2281
  export async function analyzeInstalledExtensionDirs(
2194
2282
  extensionsDir,
2195
2283
  options,
2196
2284
  pkgList,
2197
2285
  dependencies,
2286
+ onlyEntry,
2198
2287
  ) {
2199
2288
  let entries;
2200
2289
  try {
@@ -2206,6 +2295,9 @@ export async function analyzeInstalledExtensionDirs(
2206
2295
  if (!entry.isDirectory() || entry.name.startsWith(".")) {
2207
2296
  continue;
2208
2297
  }
2298
+ if (onlyEntry && entry.name !== onlyEntry) {
2299
+ continue;
2300
+ }
2209
2301
  const extDir = join(extensionsDir, entry.name);
2210
2302
  const deepResult = await analyzeExtensionDir(extDir, options);
2211
2303
  if (deepResult.pkgList.length) {