@cdxgen/cdxgen 13.2.0 → 13.4.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 (311) hide show
  1. package/README.md +33 -14
  2. package/bin/cdxgen.js +310 -138
  3. package/bin/evinse.js +22 -0
  4. package/bin/repl.js +86 -0
  5. package/bin/sign.js +119 -15
  6. package/bin/tracebom.js +69 -5
  7. package/bin/validate.js +107 -19
  8. package/bin/verify.js +172 -63
  9. package/data/helpers/init.gradle +46 -21
  10. package/data/remediations.json +85 -0
  11. package/data/rules/dependency-sources.yaml +67 -0
  12. package/data/rules/scala-evidence.yaml +115 -0
  13. package/lib/audit/index.js +38 -6
  14. package/lib/cli/bomAssembly.js +105 -15
  15. package/lib/cli/cliOptions.js +93 -1
  16. package/lib/cli/index.js +156 -58
  17. package/lib/cli/jsBom.js +99 -53
  18. package/lib/cli/jvmBom.js +708 -147
  19. package/lib/cli/managedBom.js +415 -224
  20. package/lib/cli/nativeBom.js +264 -44
  21. package/lib/core/activity.js +12 -0
  22. package/lib/core/env.js +22 -15
  23. package/lib/core/fs.js +176 -7
  24. package/lib/core/httpClient.js +159 -24
  25. package/lib/core/metadataProperties.js +97 -0
  26. package/lib/core/pluginRun.js +184 -0
  27. package/lib/core/processTree.js +100 -0
  28. package/lib/core/projectConfig.js +31 -4
  29. package/lib/core/runState.js +39 -0
  30. package/lib/core/toml.js +72 -0
  31. package/lib/ecosystems/asarutils.js +4 -2
  32. package/lib/ecosystems/bunutils.js +274 -108
  33. package/lib/ecosystems/cargoCache.js +231 -8
  34. package/lib/ecosystems/caxa.js +434 -2
  35. package/lib/ecosystems/cmakeResolver.js +76 -21
  36. package/lib/ecosystems/cppBuildContext.js +631 -0
  37. package/lib/ecosystems/cppEvidence.js +399 -51
  38. package/lib/ecosystems/cppIncludeResolver.js +294 -0
  39. package/lib/ecosystems/denoutils.js +93 -66
  40. package/lib/ecosystems/ecosystems.js +1983 -793
  41. package/lib/ecosystems/golem.js +28 -12
  42. package/lib/ecosystems/gradleutils.js +356 -37
  43. package/lib/ecosystems/jsEvidence.js +104 -44
  44. package/lib/ecosystems/kosi.js +31 -7
  45. package/lib/ecosystems/npmutils.js +174 -9
  46. package/lib/ecosystems/parsers-dotnet.js +616 -159
  47. package/lib/ecosystems/parsers-elm.js +46 -28
  48. package/lib/ecosystems/parsers-gleam.js +3 -4
  49. package/lib/ecosystems/parsers-go.js +371 -70
  50. package/lib/ecosystems/parsers-js.js +263 -76
  51. package/lib/ecosystems/parsers-julia.js +2 -3
  52. package/lib/ecosystems/parsers-jvm.js +204 -12
  53. package/lib/ecosystems/parsers-misc.js +929 -216
  54. package/lib/ecosystems/parsers-python.js +167 -24
  55. package/lib/ecosystems/parsers-rust.js +28 -22
  56. package/lib/ecosystems/parsers-terraform.js +1573 -19
  57. package/lib/ecosystems/pythonutils.js +102 -6
  58. package/lib/ecosystems/remote/huggingface.js +3 -0
  59. package/lib/ecosystems/rubyutils.js +1492 -182
  60. package/lib/ecosystems/rusi.js +54 -10
  61. package/lib/ecosystems/sbtutils.js +243 -187
  62. package/lib/ecosystems/scalacliutils.js +342 -0
  63. package/lib/ecosystems/scalasem.js +2618 -0
  64. package/lib/ecosystems/terraformRegistry.js +288 -0
  65. package/lib/ecosystems/utils.js +2 -0
  66. package/lib/ecosystems/vendoredCode.js +156 -0
  67. package/lib/evinser/evinser.js +1008 -191
  68. package/lib/evinser/swiftsem.js +1914 -302
  69. package/lib/helpers/agenticToolutils.js +2 -2
  70. package/lib/helpers/bomSigner.js +1101 -222
  71. package/lib/inventory/aiCollector.js +4 -1
  72. package/lib/inventory/analyzer.js +110 -127
  73. package/lib/inventory/atomUtils.js +703 -43
  74. package/lib/inventory/auditCategories.js +7 -0
  75. package/lib/inventory/buildToolRateLimit.js +144 -0
  76. package/lib/inventory/cacheCommands.js +2 -1
  77. package/lib/inventory/cdxrs.js +103 -12
  78. package/lib/inventory/cmakeBuildDirs.js +254 -0
  79. package/lib/inventory/deps.js +501 -124
  80. package/lib/inventory/depsUtils.js +183 -11
  81. package/lib/inventory/display.js +4 -5
  82. package/lib/inventory/dosai.js +798 -57
  83. package/lib/inventory/dosaiParsers.js +310 -15
  84. package/lib/inventory/dynamic.js +90 -6
  85. package/lib/inventory/evidenceUtils.js +166 -113
  86. package/lib/inventory/fetchBatch.js +690 -55
  87. package/lib/inventory/fetchDiskCache.js +597 -0
  88. package/lib/inventory/forgeEnricher.js +14 -5
  89. package/lib/inventory/jvmLocalRepos.js +917 -0
  90. package/lib/inventory/mcpConfigParser.js +2 -3
  91. package/lib/inventory/parentSelection.js +146 -0
  92. package/lib/inventory/protobom.js +8 -1
  93. package/lib/inventory/purl.js +152 -3
  94. package/lib/inventory/rustFormulationParser.js +3 -4
  95. package/lib/inventory/sbomDocument.js +2 -70
  96. package/lib/inventory/scalaCoords.js +153 -0
  97. package/lib/inventory/source.js +45 -27
  98. package/lib/inventory/spdx.js +101 -0
  99. package/lib/inventory/traceRunner.js +295 -25
  100. package/lib/inventory/tracedCrypto.js +294 -0
  101. package/lib/managers/binary.js +115 -24
  102. package/lib/managers/docker.js +467 -46
  103. package/lib/managers/oci.js +63 -3
  104. package/lib/parsers/cmakeCache.js +69 -0
  105. package/lib/parsers/cmakeLists.js +466 -0
  106. package/lib/parsers/cmakePresets.js +400 -0
  107. package/lib/parsers/compileCommands.js +557 -0
  108. package/lib/parsers/largeJson.js +454 -0
  109. package/lib/parsers/npmrc.js +19 -1
  110. package/lib/parsers/strictJson.js +322 -0
  111. package/lib/parsers/terraformConfig.js +1073 -0
  112. package/lib/parsers/terraformSource.js +652 -0
  113. package/lib/server/server.js +23 -0
  114. package/lib/stages/postgen/introspection/markers.js +1 -1
  115. package/lib/stages/postgen/postgen.js +83 -16
  116. package/lib/stages/postgen/specVersionCompat.js +32 -0
  117. package/lib/validator/bomValidator.js +6 -16
  118. package/lib/validator/index.js +64 -11
  119. package/lib/validator/reporters/console.js +3 -0
  120. package/lib/validator/reporters/json.js +2 -0
  121. package/lib/validator/reporters/sarif.js +7 -0
  122. package/package.json +23 -23
  123. package/types/lib/audit/index.d.ts.map +1 -1
  124. package/types/lib/cli/bomAssembly.d.ts +2 -1
  125. package/types/lib/cli/bomAssembly.d.ts.map +1 -1
  126. package/types/lib/cli/cliOptions.d.ts +33 -1
  127. package/types/lib/cli/cliOptions.d.ts.map +1 -1
  128. package/types/lib/cli/index.d.ts.map +1 -1
  129. package/types/lib/cli/jsBom.d.ts.map +1 -1
  130. package/types/lib/cli/jvmBom.d.ts +24 -1
  131. package/types/lib/cli/jvmBom.d.ts.map +1 -1
  132. package/types/lib/cli/managedBom.d.ts +7 -4
  133. package/types/lib/cli/managedBom.d.ts.map +1 -1
  134. package/types/lib/cli/nativeBom.d.ts +3 -1
  135. package/types/lib/cli/nativeBom.d.ts.map +1 -1
  136. package/types/lib/core/activity.d.ts.map +1 -1
  137. package/types/lib/core/env.d.ts +9 -0
  138. package/types/lib/core/env.d.ts.map +1 -1
  139. package/types/lib/core/fs.d.ts +55 -0
  140. package/types/lib/core/fs.d.ts.map +1 -1
  141. package/types/lib/core/httpClient.d.ts +13 -8
  142. package/types/lib/core/httpClient.d.ts.map +1 -1
  143. package/types/lib/core/metadataProperties.d.ts +39 -0
  144. package/types/lib/core/metadataProperties.d.ts.map +1 -0
  145. package/types/lib/core/pluginRun.d.ts +97 -0
  146. package/types/lib/core/pluginRun.d.ts.map +1 -0
  147. package/types/lib/core/processTree.d.ts +36 -0
  148. package/types/lib/core/processTree.d.ts.map +1 -0
  149. package/types/lib/core/projectConfig.d.ts +6 -2
  150. package/types/lib/core/projectConfig.d.ts.map +1 -1
  151. package/types/lib/core/runState.d.ts +29 -0
  152. package/types/lib/core/runState.d.ts.map +1 -0
  153. package/types/lib/core/toml.d.ts +20 -0
  154. package/types/lib/core/toml.d.ts.map +1 -0
  155. package/types/lib/ecosystems/asarutils.d.ts.map +1 -1
  156. package/types/lib/ecosystems/bunutils.d.ts +12 -5
  157. package/types/lib/ecosystems/bunutils.d.ts.map +1 -1
  158. package/types/lib/ecosystems/cargoCache.d.ts +12 -0
  159. package/types/lib/ecosystems/cargoCache.d.ts.map +1 -1
  160. package/types/lib/ecosystems/caxa.d.ts +14 -0
  161. package/types/lib/ecosystems/caxa.d.ts.map +1 -1
  162. package/types/lib/ecosystems/cmakeResolver.d.ts +28 -3
  163. package/types/lib/ecosystems/cmakeResolver.d.ts.map +1 -1
  164. package/types/lib/ecosystems/cppBuildContext.d.ts +55 -0
  165. package/types/lib/ecosystems/cppBuildContext.d.ts.map +1 -0
  166. package/types/lib/ecosystems/cppEvidence.d.ts +17 -1
  167. package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
  168. package/types/lib/ecosystems/cppIncludeResolver.d.ts +92 -0
  169. package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -0
  170. package/types/lib/ecosystems/denoutils.d.ts +9 -3
  171. package/types/lib/ecosystems/denoutils.d.ts.map +1 -1
  172. package/types/lib/ecosystems/ecosystems.d.ts +62 -13
  173. package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
  174. package/types/lib/ecosystems/golem.d.ts.map +1 -1
  175. package/types/lib/ecosystems/gradleutils.d.ts +70 -4
  176. package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
  177. package/types/lib/ecosystems/jsEvidence.d.ts +5 -2
  178. package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
  179. package/types/lib/ecosystems/kosi.d.ts +13 -0
  180. package/types/lib/ecosystems/kosi.d.ts.map +1 -1
  181. package/types/lib/ecosystems/npmutils.d.ts +57 -0
  182. package/types/lib/ecosystems/npmutils.d.ts.map +1 -1
  183. package/types/lib/ecosystems/parsers-dotnet.d.ts +118 -4
  184. package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
  185. package/types/lib/ecosystems/parsers-elm.d.ts.map +1 -1
  186. package/types/lib/ecosystems/parsers-gleam.d.ts.map +1 -1
  187. package/types/lib/ecosystems/parsers-go.d.ts +54 -2
  188. package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
  189. package/types/lib/ecosystems/parsers-js.d.ts +16 -5
  190. package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
  191. package/types/lib/ecosystems/parsers-julia.d.ts.map +1 -1
  192. package/types/lib/ecosystems/parsers-jvm.d.ts +46 -1
  193. package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
  194. package/types/lib/ecosystems/parsers-misc.d.ts +70 -4
  195. package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
  196. package/types/lib/ecosystems/parsers-python.d.ts +53 -3
  197. package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
  198. package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
  199. package/types/lib/ecosystems/parsers-terraform.d.ts +38 -21
  200. package/types/lib/ecosystems/parsers-terraform.d.ts.map +1 -1
  201. package/types/lib/ecosystems/pythonutils.d.ts +27 -2
  202. package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
  203. package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
  204. package/types/lib/ecosystems/rubyutils.d.ts +164 -3
  205. package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
  206. package/types/lib/ecosystems/rusi.d.ts +13 -0
  207. package/types/lib/ecosystems/rusi.d.ts.map +1 -1
  208. package/types/lib/ecosystems/sbtutils.d.ts +88 -2
  209. package/types/lib/ecosystems/sbtutils.d.ts.map +1 -1
  210. package/types/lib/ecosystems/scalacliutils.d.ts +56 -0
  211. package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -0
  212. package/types/lib/ecosystems/scalasem.d.ts +311 -0
  213. package/types/lib/ecosystems/scalasem.d.ts.map +1 -0
  214. package/types/lib/ecosystems/terraformRegistry.d.ts +9 -0
  215. package/types/lib/ecosystems/terraformRegistry.d.ts.map +1 -0
  216. package/types/lib/ecosystems/utils.d.ts +2 -2
  217. package/types/lib/ecosystems/utils.d.ts.map +1 -1
  218. package/types/lib/ecosystems/vendoredCode.d.ts +32 -0
  219. package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -0
  220. package/types/lib/evinser/evinser.d.ts +132 -15
  221. package/types/lib/evinser/evinser.d.ts.map +1 -1
  222. package/types/lib/evinser/swiftsem.d.ts +280 -15
  223. package/types/lib/evinser/swiftsem.d.ts.map +1 -1
  224. package/types/lib/helpers/bomSigner.d.ts +182 -13
  225. package/types/lib/helpers/bomSigner.d.ts.map +1 -1
  226. package/types/lib/inventory/aiCollector.d.ts.map +1 -1
  227. package/types/lib/inventory/analyzer.d.ts.map +1 -1
  228. package/types/lib/inventory/atomUtils.d.ts +219 -5
  229. package/types/lib/inventory/atomUtils.d.ts.map +1 -1
  230. package/types/lib/inventory/auditCategories.d.ts +3 -0
  231. package/types/lib/inventory/auditCategories.d.ts.map +1 -1
  232. package/types/lib/inventory/buildToolRateLimit.d.ts +38 -0
  233. package/types/lib/inventory/buildToolRateLimit.d.ts.map +1 -0
  234. package/types/lib/inventory/cacheCommands.d.ts +2 -1
  235. package/types/lib/inventory/cacheCommands.d.ts.map +1 -1
  236. package/types/lib/inventory/cdxrs.d.ts +8 -3
  237. package/types/lib/inventory/cdxrs.d.ts.map +1 -1
  238. package/types/lib/inventory/cmakeBuildDirs.d.ts +58 -0
  239. package/types/lib/inventory/cmakeBuildDirs.d.ts.map +1 -0
  240. package/types/lib/inventory/deps.d.ts +59 -1
  241. package/types/lib/inventory/deps.d.ts.map +1 -1
  242. package/types/lib/inventory/depsUtils.d.ts +15 -0
  243. package/types/lib/inventory/depsUtils.d.ts.map +1 -1
  244. package/types/lib/inventory/display.d.ts.map +1 -1
  245. package/types/lib/inventory/dosai.d.ts +121 -9
  246. package/types/lib/inventory/dosai.d.ts.map +1 -1
  247. package/types/lib/inventory/dosaiParsers.d.ts +53 -7
  248. package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
  249. package/types/lib/inventory/dynamic.d.ts +10 -0
  250. package/types/lib/inventory/dynamic.d.ts.map +1 -1
  251. package/types/lib/inventory/evidenceUtils.d.ts +19 -4
  252. package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
  253. package/types/lib/inventory/fetchBatch.d.ts +83 -14
  254. package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
  255. package/types/lib/inventory/fetchDiskCache.d.ts +169 -0
  256. package/types/lib/inventory/fetchDiskCache.d.ts.map +1 -0
  257. package/types/lib/inventory/forgeEnricher.d.ts.map +1 -1
  258. package/types/lib/inventory/jvmLocalRepos.d.ts +178 -0
  259. package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -0
  260. package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
  261. package/types/lib/inventory/parentSelection.d.ts +34 -0
  262. package/types/lib/inventory/parentSelection.d.ts.map +1 -0
  263. package/types/lib/inventory/plugins.d.ts.map +1 -1
  264. package/types/lib/inventory/protobom.d.ts.map +1 -1
  265. package/types/lib/inventory/purl.d.ts +71 -2
  266. package/types/lib/inventory/purl.d.ts.map +1 -1
  267. package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
  268. package/types/lib/inventory/sbomDocument.d.ts.map +1 -1
  269. package/types/lib/inventory/scalaCoords.d.ts +80 -0
  270. package/types/lib/inventory/scalaCoords.d.ts.map +1 -0
  271. package/types/lib/inventory/source.d.ts.map +1 -1
  272. package/types/lib/inventory/spdx.d.ts +9 -0
  273. package/types/lib/inventory/spdx.d.ts.map +1 -1
  274. package/types/lib/inventory/traceRunner.d.ts +59 -1
  275. package/types/lib/inventory/traceRunner.d.ts.map +1 -1
  276. package/types/lib/inventory/tracedCrypto.d.ts +42 -0
  277. package/types/lib/inventory/tracedCrypto.d.ts.map +1 -0
  278. package/types/lib/managers/binary.d.ts +30 -1
  279. package/types/lib/managers/binary.d.ts.map +1 -1
  280. package/types/lib/managers/docker.d.ts +29 -0
  281. package/types/lib/managers/docker.d.ts.map +1 -1
  282. package/types/lib/managers/oci.d.ts +17 -1
  283. package/types/lib/managers/oci.d.ts.map +1 -1
  284. package/types/lib/parsers/cmakeCache.d.ts +16 -0
  285. package/types/lib/parsers/cmakeCache.d.ts.map +1 -1
  286. package/types/lib/parsers/cmakeLists.d.ts +77 -0
  287. package/types/lib/parsers/cmakeLists.d.ts.map +1 -0
  288. package/types/lib/parsers/cmakePresets.d.ts +78 -0
  289. package/types/lib/parsers/cmakePresets.d.ts.map +1 -0
  290. package/types/lib/parsers/compileCommands.d.ts +115 -0
  291. package/types/lib/parsers/compileCommands.d.ts.map +1 -0
  292. package/types/lib/parsers/largeJson.d.ts +52 -0
  293. package/types/lib/parsers/largeJson.d.ts.map +1 -0
  294. package/types/lib/parsers/npmrc.d.ts +5 -0
  295. package/types/lib/parsers/npmrc.d.ts.map +1 -1
  296. package/types/lib/parsers/strictJson.d.ts +46 -0
  297. package/types/lib/parsers/strictJson.d.ts.map +1 -0
  298. package/types/lib/parsers/terraformConfig.d.ts +70 -0
  299. package/types/lib/parsers/terraformConfig.d.ts.map +1 -0
  300. package/types/lib/parsers/terraformSource.d.ts +66 -0
  301. package/types/lib/parsers/terraformSource.d.ts.map +1 -0
  302. package/types/lib/server/server.d.ts.map +1 -1
  303. package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
  304. package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
  305. package/types/lib/validator/bomValidator.d.ts.map +1 -1
  306. package/types/lib/validator/index.d.ts +18 -1
  307. package/types/lib/validator/index.d.ts.map +1 -1
  308. package/types/lib/validator/reporters/console.d.ts.map +1 -1
  309. package/types/lib/validator/reporters/json.d.ts.map +1 -1
  310. package/types/lib/validator/reporters/sarif.d.ts.map +1 -1
  311. package/lib/third-party/arborist/snapshots/calc-dep-flags.test.cjs +0 -462
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Where a C/C++ project's build trees are: the build directories its CMake
3
+ * presets configure, and the conventional ones (`build`, `build-<name>`,
4
+ * `out`, `builddir`, `cmake-build-<name>`). Shared by the lookups for
5
+ * `CMakeCache.txt` and for the compilation database, so both search the same
6
+ * places in the same order.
7
+ */
8
+ /**
9
+ * Whether `child` is `parent` or inside it.
10
+ *
11
+ * @param {string} child Path to test
12
+ * @param {string} parent Directory
13
+ * @returns {boolean}
14
+ */
15
+ export declare function isInsideDir(child: string, parent: string): boolean;
16
+ /**
17
+ * CMake's `${hostSystemName}` for this host.
18
+ *
19
+ * @returns {string}
20
+ */
21
+ export declare function hostSystemName(): string;
22
+ /**
23
+ * Read a project's presets documents: `CMakePresets.json` and
24
+ * `CMakeUserPresets.json`, each followed by the files it includes (schema
25
+ * version 4 and later). In secure mode an include outside the project is not
26
+ * read.
27
+ *
28
+ * @param {string} root Project source directory
29
+ * @returns {Array<{file: string, fileDir: string, document: Object}>}
30
+ */
31
+ export declare function readCmakePresetDocuments(root: string): Array<{
32
+ file: string;
33
+ fileDir: string;
34
+ document: Object;
35
+ }>;
36
+ /**
37
+ * The visible configure presets of a project, resolved and with their macros
38
+ * expanded for this host.
39
+ *
40
+ * @param {string} root Project source directory
41
+ * @returns {Object[]} See `resolveConfigurePresets`
42
+ */
43
+ export declare function readCmakeConfigurePresets(root: string): Object[];
44
+ /**
45
+ * The directories a project's build trees may be in, most specific first:
46
+ * the directory of an explicit `--cmake-cache`, the build directories of its
47
+ * configure presets, then the `build`, `build-<name>`, `out`, `builddir` and
48
+ * `cmake-build-<name>` directories at the project root, and the directories
49
+ * one level below `build`, `out` and `out/build` (where Visual Studio puts
50
+ * preset builds). Only existing directories are listed; in secure mode, only
51
+ * those inside the project.
52
+ *
53
+ * @param {string} root Project source directory
54
+ * @param {Object} [options] CLI options (`cmakeCache`)
55
+ * @returns {string[]} Absolute directories, without duplicates
56
+ */
57
+ export declare function cmakeBuildDirCandidates(root: string, options?: Object): string[];
58
+ //# sourceMappingURL=cmakeBuildDirs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cmakeBuildDirs.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cmakeBuildDirs.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA4CH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAJtB,MAIsB,EAAE,MAAM,EAH9B,MAG8B,GAF5B,OAAO,CAKnB;AAsBD;;;;GAIG;AACH,wBAAgB,cAAc,IAFjB,MAAM,CAIlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAHlC,MAGkC,GAFhC,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CAAC,CAsCpE;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAHnC,MAGmC,GAFjC,MAAM,EAAE,CAgBpB;AA+BD;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAJjC,MAIiC,EAAE,OAAO,AAHlD,CACA,EADQ,MAG+C,GAF7C,MAAM,EAAE,CAoDpB"}
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Whether a jar holds sources or javadoc rather than classes.
3
+ *
4
+ * @param {string} jarName Jar file name.
5
+ * @returns {boolean}
6
+ */
7
+ export declare function isDocumentationJar(jarName: string): boolean;
1
8
  /**
2
9
  * Collect maven dependencies
3
10
  *
@@ -67,11 +74,62 @@ export declare function parsePomProperties(pomProperties: string): Object;
67
74
  /**
68
75
  * Method to get pom properties from maven directory
69
76
  *
77
+ * A shaded or fat jar carries a `pom.properties` for every artifact folded
78
+ * into it. When the jar's file name is known, the descriptor whose
79
+ * `artifactId-version` (or `artifactId`) starts the file name is the jar's
80
+ * own; otherwise the first descriptor is used, as before.
81
+ *
70
82
  * @param {string} mavenDir Path to maven directory
83
+ * @param {string} [jarName] File name of the jar the directory came from
71
84
  *
72
85
  * @return array with pom properties
73
86
  */
74
- export declare function getPomPropertiesFromMavenDir(mavenDir: string): {};
87
+ export declare function getPomPropertiesFromMavenDir(mavenDir: string, jarName?: string): Object;
88
+ /**
89
+ * The licences a MANIFEST.MF `Bundle-License` value names. The value is a
90
+ * comma-separated list; each item is an SPDX id, a licence name or a URL,
91
+ * optionally followed by `;link=` and `;description=` attributes, and any
92
+ * part may be quoted. Each item is mapped through findLicenseId; an item it
93
+ * cannot map is replaced by its `link` URL when one is given, which the
94
+ * licence URL lookup resolves later. `<<EXTERNAL>>` names no licence.
95
+ *
96
+ * @param {string} value Raw Bundle-License value.
97
+ * @returns {string[]} Licence ids, names or URLs, without duplicates.
98
+ */
99
+ export declare function parseManifestLicenseList(value: string): string[];
100
+ /**
101
+ * The Maven descriptor a jar carries for itself, read from an extracted
102
+ * `META-INF/maven` directory: the pom.properties that names the jar's own
103
+ * coordinates and the pom.xml stored beside it.
104
+ *
105
+ * @param {string} mavenDir Path to the extracted META-INF/maven directory
106
+ * @param {string} [jarName] File name of the jar the directory came from
107
+ * @returns {{properties: Object, pomXml?: string}|undefined} The chosen
108
+ * descriptor, with its pom.xml text when one is stored beside it.
109
+ */
110
+ export declare function readEmbeddedMavenDescriptor(mavenDir: string, jarName?: string): {
111
+ properties: Object;
112
+ pomXml?: string;
113
+ } | undefined;
114
+ /**
115
+ * The Maven descriptor and manifest licence a jar carries for itself, read
116
+ * from its zip without extracting it. Entry names are only matched and
117
+ * paired, never used as paths, and each entry is read only under a size
118
+ * bound, because the archive is untrusted input.
119
+ *
120
+ * @param {string} jarFile Path to the jar.
121
+ * @param {{group: string, name: string, version: string}} coordinates The jar's own coordinates, which choose its descriptor.
122
+ * @returns {Promise<{properties?: Object, pomXml?: string, manifestLicenses?: string[]}|undefined>}
123
+ */
124
+ export declare function readEmbeddedJarMetadata(jarFile: string, coordinates: {
125
+ group: string;
126
+ name: string;
127
+ version: string;
128
+ }): Promise<{
129
+ properties?: Object;
130
+ pomXml?: string;
131
+ manifestLicenses?: string[];
132
+ } | undefined>;
75
133
  /**
76
134
  * Method to read a single file entry from a zip file
77
135
  *
@@ -1 +1 @@
1
- {"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../../../lib/invent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4CrC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EARE,MAQF,EACP,YAAY,EARH,MAQG,EACZ,EAAE,eAAyB,EAAE,aAA+B,EAAE,AAR7D,CAGA,EAFA;IAAsB,eAAe,AAArC,CACA,EADQ,MAAM,CACd;IAAsB,aAAa,AAAnC,CACA,EADQ,MAAM,CACd;CAKkE,GALxD,OAAO,CAAC,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC,CAkDxD;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAJhC,MAIgC,gBAqE1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,eAAe,EANhC,MAMgC,EAAE,OAAO,EALzC,MAAM,EAKmC,EAAE,cAAc,EAJzD,MAIyD,EAAE,CAAC,EAH5D,MAG4D,GAF1D,IAAI,CAqDhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAJtB,MAAM,GAAC,MAIe,EAAE,CAAC,EAHzB,MAAM,GAAC,MAGkB,GAFvB,MAAM,CAWlB"}
@@ -29,6 +29,21 @@ export declare function markNpmTypesPackagesAsExcluded(components?: Object[]): O
29
29
  * @returns {Object[]} The same component array with scopes updated in place
30
30
  */
31
31
  export declare function propagateRequiredScopeFromDependencies(components?: Object[], dependencies?: Object[]): Object[];
32
+ /**
33
+ * Scopes the dependencies of type-only npm packages as optional.
34
+ *
35
+ * A package imported only for its TypeScript types, like an `@types` package,
36
+ * is erased at compile time, and so is what it depends on unless a runtime
37
+ * package depends on it too. A component below a type-only package becomes
38
+ * optional when no dependency path from a root of the graph reaches it without
39
+ * passing through a type-only package. A component that already has a scope,
40
+ * from its manifest or from usage evidence, keeps it.
41
+ *
42
+ * @param {Object[]} components CycloneDX component objects
43
+ * @param {Object[]} dependencies CycloneDX dependency entries
44
+ * @returns {Object[]} The same component array with scopes updated in place
45
+ */
46
+ export declare function markTypeOnlyDependenciesOptional(components?: Object[], dependencies?: Object[]): Object[];
32
47
  /**
33
48
  * Merge CycloneDX services using bom-ref or group/name/version identity.
34
49
  *
@@ -1 +1 @@
1
- {"version":3,"file":"depsUtils.d.ts","sourceRoot":"","sources":["../../../lib/inventory/depsUtils.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EANH,MAAM,EAMH,EACZ,eAAe,EANN,MAAM,EAMA,EACf,eAAe,GANN,MAMW,GALT,MAAM,EAAE,CAuEpB;AA4CD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,GAH9C,MAAM,EAG6C,GAFjD,MAAM,EAAE,CAYpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sCAAsC,CACpD,UAAU,GALD,MAAM,EAKA,EACf,YAAY,GALH,MAAM,EAKE,GAJN,MAAM,EAAE,CA8DpB;AA0FD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAJ3B,MAAM,EAAE,GAAC,MAIkB,EAAE,WAAW,EAHxC,MAAM,EAAE,GAAC,MAG+B,GAFtC,MAAM,EAAE,CAqFpB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,OAAA,SAoIxC;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAH7C,MAAM,EAAE,GAAG,SAAS,GAAG,IAGsB,GAF3C,MAAM,EAAE,CA0CpB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,YAAY,OAAA,EAAE,eAAe,SAAI,WAsB9D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,OAAA,EAAE,YAAY,OAAA,SAgCnD"}
1
+ {"version":3,"file":"depsUtils.d.ts","sourceRoot":"","sources":["../../../lib/inventory/depsUtils.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wBAAgB,i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,wBAAgB,eAAe,CAAC,cAAc,EAHnC,MAGmC,GAFjC,IAAI,CAmChB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAHzC,MAAM,EAGmC,GAFvC,IAAI,CA4BhB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAH/B,MAG+B,GAF7B,IAAI,CAwBhB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAHzB,MAGyB,GAFvB,IAAI,CAsDhB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,AAH5C,CACA,EADQ,MAGgD,GAF9C,IAAI,CAwHhB;AAGE,YAAmG,eAAe,GAAxG;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC,CAAiB;AA6DrH;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,gBAAgB,GAHnD,eAAe,EAGyC,GAFtD,IAAI,CA+BhB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EANC,MAMD,EACR,MAAM,EANG,MAMH,EACN,OAAO,EANE,MAMF,EACP,gBAAgB,EANP,eAAe,EAMR,QAgUjB"}
@@ -1,3 +1,32 @@
1
+ /**
2
+ * Translate cdxgen --exclude globs into dosai --exclude globs.
3
+ *
4
+ * Dosai is an evidence analyzer, so the translation follows the exclude
5
+ * filter cdxgen already applies to atom evidence slices
6
+ * (`globPatternsToAtomIgnoreRegex`): a relative pattern matches at any depth,
7
+ * and an absolute pattern is anchored to the scanned directory. Dosai itself
8
+ * uses gitignore conventions, where a pattern with a slash is anchored, so
9
+ * relative patterns get a leading "**\/". Like the atom filter, and unlike
10
+ * cdxgen's file discovery, excluding a directory also excludes everything
11
+ * beneath it.
12
+ *
13
+ * Brace groups and numeric ranges are expanded, and comma separated lists are
14
+ * split, since dosai reads both as literal text. Character classes, extglobs,
15
+ * escapes, negation, and patterns that step outside the scanned directory
16
+ * have no dosai equivalent; they are reported as skipped rather than passed
17
+ * on as literals that match nothing. So is any pattern that still carries a
18
+ * character outside a small allowlist, such as a literal brace group or a
19
+ * shell metacharacter. Dosai matches case-sensitively on Linux.
20
+ *
21
+ * @param {string[]} excludes cdxgen exclude globs
22
+ * @param {string} srcPath Absolute directory dosai scans
23
+ * @returns {{patterns: string[], skipped: string[], truncated: number}} Translated patterns, dropped patterns, and how many were left out by the cap
24
+ */
25
+ export declare function toDosaiExcludePatterns(excludes: string[], srcPath: string): {
26
+ patterns: string[];
27
+ skipped: string[];
28
+ truncated: number;
29
+ };
1
30
  /**
2
31
  * Check whether a language is a .NET language supported by dosai analysis.
3
32
  *
@@ -12,6 +41,70 @@ export declare function isDosaiDotnetLanguage(language: string): boolean;
12
41
  * @returns {Object|undefined} Parsed JSON content, or undefined when missing or invalid
13
42
  */
14
43
  export declare function readDosaiJsonFile(jsonFile: string): Object | undefined;
44
+ /**
45
+ * Read a dosai methods report of any size.
46
+ *
47
+ * A report that fits in one JavaScript string is parsed whole. A larger one is
48
+ * read in bounded runs, keeping the requested sections, the CallGraph nodes and
49
+ * edges that PackageReachability references, and the MethodCalls accepted by
50
+ * `keepMethodCall` (none when it is omitted). Nothing cdxgen reads is lost.
51
+ *
52
+ * @param {string} reportFile Path to the dosai methods JSON
53
+ * @param {Object} [options] Options
54
+ * @param {string[]} [options.sections] Sections to keep from a large report (default: every section cdxgen reads)
55
+ * @param {Function} [options.keepMethodCall] Predicate choosing the MethodCalls to keep from a large report
56
+ * @param {number} [options.maxTextBytes] Largest report parsed whole, for tests
57
+ * @returns {Object|undefined} Parsed report, or undefined when missing or invalid
58
+ */
59
+ export declare function readDosaiMethodsReport(reportFile: string, options?: {
60
+ sections?: string[];
61
+ keepMethodCall?: Function;
62
+ maxTextBytes?: number;
63
+ }): Object | undefined;
64
+ /**
65
+ * Read a dosai data-flow report of any size.
66
+ *
67
+ * A report that fits in one JavaScript string is parsed whole. A larger one
68
+ * keeps Metadata, Slices, PackageReachability, and the Nodes those reference.
69
+ *
70
+ * @param {string} reportFile Path to the dosai data-flow JSON
71
+ * @param {Object} [options] Options
72
+ * @param {number} [options.maxTextBytes] Largest report parsed whole, for tests
73
+ * @returns {Object|undefined} Parsed report, or undefined when missing or invalid
74
+ */
75
+ export declare function readDosaiDataFlowReport(reportFile: string, options?: {
76
+ maxTextBytes?: number;
77
+ }): Object | undefined;
78
+ /**
79
+ * Whether a dosai run ended because it ran out of time.
80
+ *
81
+ * dosai has no limit of its own: cdxgen's spawn timeout
82
+ * (CDXGEN_TIMEOUT_MS) stops the process, which reaches the caller only as an
83
+ * ETIMEDOUT error looking like any other failure (issue 4438).
84
+ *
85
+ * @param {Object} result spawnSync result
86
+ * @returns {boolean} true when the run was stopped by the spawn timeout
87
+ */
88
+ export declare function dosaiRunTimedOut(result: Object): boolean;
89
+ /**
90
+ * How a dosai run was stopped before it could finish, if it was.
91
+ *
92
+ * Besides the spawn timeout, a run is stopped when its console output outgrows
93
+ * CDXGEN_MAX_BUFFER (ENOBUFS) or a signal ends it, such as the kernel's
94
+ * out-of-memory killer. A stopped run can leave its slice half written.
95
+ *
96
+ * @param {Object} result spawnSync result
97
+ * @returns {"timeout"|"buffer"|"signal"|undefined} Why the run was stopped, or undefined when it ended by itself
98
+ */
99
+ export declare function dosaiRunStopReason(result: Object): "timeout" | "buffer" | "signal" | undefined;
100
+ /**
101
+ * Whether the dosai run that should have written a file was stopped (by the
102
+ * time limit, the output buffer limit, or a signal) and already reported so.
103
+ *
104
+ * @param {string} outputFile Output file passed to the dosai run
105
+ * @returns {boolean} true when the run was stopped
106
+ */
107
+ export declare function dosaiRunWasStopped(outputFile: string): boolean;
15
108
  /**
16
109
  * Run a dosai subcommand ("methods", "dataflows", or "crypto") against a source
17
110
  * tree and write its JSON output to the given file.
@@ -19,7 +112,7 @@ export declare function readDosaiJsonFile(jsonFile: string): Object | undefined;
19
112
  * @param {string} command Dosai subcommand to execute
20
113
  * @param {string} src Source directory to analyze
21
114
  * @param {string} outputFile Path where the dosai JSON output is written
22
- * @param {Object} [options] Options carrying dosaiCommand, dataFlowPatterns, or patternPacks overrides
115
+ * @param {Object} [options] Options carrying dosaiCommand, dataFlowPatterns, patternPacks, or exclude globs
23
116
  * @returns {boolean} True when the command succeeded and produced the output file, false otherwise
24
117
  */
25
118
  export declare function runDosaiCommand(command: string, src: string, outputFile: string, options?: Object): boolean;
@@ -75,17 +168,21 @@ export declare function persistDosaiSemanticsReport(options: any, methodsSlice:
75
168
  * Build a purl alias map for a list of components.
76
169
  *
77
170
  * @param {Object[]} [components] Component objects with purl fields
78
- * @returns {Map<string, string>} Map of exact purls and normalized type/namespace/name keys to canonical purls
171
+ * @param {Object} [options] Options passed to {@link buildDosaiPurlAliasMap} (`srcPath`)
172
+ * @returns {Map<string, string>} Map of component purls, carrying the version-free identity index
79
173
  */
80
- export declare function buildPurlAliasMap(components?: Object[]): Map<string, string>;
174
+ export declare function buildPurlAliasMap(components?: Object[], options?: Object): Map<string, string>;
81
175
  /**
82
- * Resolve a possibly-aliased purl to the canonical component purl.
176
+ * Resolve a dosai purl to the canonical component purl, by version, and for a
177
+ * package the BOM holds in several versions by the record's location.
83
178
  *
84
179
  * @param {string} purl Purl from a dosai report
85
180
  * @param {Map<string, string>} purlAliasMap Alias map built by buildPurlAliasMap
86
- * @returns {string|undefined} Canonical component purl, the input purl when unaliased, or undefined when empty
181
+ * @param {string} [location] Source location of the dosai record
182
+ * @returns {string|undefined} Canonical component purl, the input purl when the BOM has no such package,
183
+ * or undefined when empty or ambiguous
87
184
  */
88
- export declare function resolveComponentPurl(purl: string, purlAliasMap: Map<string, string>): string | undefined;
185
+ export declare function resolveComponentPurl(purl: string, purlAliasMap: Map<string, string>, location?: string): string | undefined;
89
186
  /**
90
187
  * Copy one dosai PackageReachability fact onto a component as properties.
91
188
  *
@@ -106,9 +203,14 @@ export declare function addDosaiReachabilityProperties(component: Object, reacha
106
203
  *
107
204
  * @param {Object} methodsSlice Parsed dosai methods slice JSON
108
205
  * @param {Object[]} [components] BOM components used to resolve purl aliases and mutate
206
+ * @param {Object} [options] Options
207
+ * @param {string} [options.srcPath] Directory dosai analyzed; a package the BOM holds in several
208
+ * versions is matched by the project of the record's file
109
209
  * @returns {number} Number of distinct components enriched
110
210
  */
111
- export declare function applyDosaiReachabilityEvidence(methodsSlice: Object, components?: Object[]): number;
211
+ export declare function applyDosaiReachabilityEvidence(methodsSlice: Object, components?: Object[], options?: {
212
+ srcPath?: string;
213
+ }): number;
112
214
  /**
113
215
  * Map a dosai methods slice to per-purl occurrence evidence.
114
216
  *
@@ -117,9 +219,14 @@ export declare function applyDosaiReachabilityEvidence(methodsSlice: Object, com
117
219
  *
118
220
  * @param {Object} methodsSlice Parsed dosai methods slice JSON
119
221
  * @param {Object[]} [components] BOM components used to resolve purl aliases
222
+ * @param {Object} [options] Options
223
+ * @param {string} [options.srcPath] Directory dosai analyzed; a package the BOM holds in several
224
+ * versions is matched by the project of the record's file
120
225
  * @returns {Object} Object with purlLocationMap, purlModulesMap, and purlMethodsMap keyed by purl
121
226
  */
122
- export declare function collectDosaiPurlEvidence(methodsSlice: Object, components?: Object[]): Object;
227
+ export declare function collectDosaiPurlEvidence(methodsSlice: Object, components?: Object[], options?: {
228
+ srcPath?: string;
229
+ }): Object;
123
230
  /**
124
231
  * Extract data-flow call frames per component purl from a dosai data-flow result.
125
232
  *
@@ -128,9 +235,14 @@ export declare function collectDosaiPurlEvidence(methodsSlice: Object, component
128
235
  *
129
236
  * @param {Object} dataFlowResult Parsed dosai data-flow slice JSON
130
237
  * @param {Object[]} [components] BOM components used to resolve purl aliases
238
+ * @param {Object} [options] Options
239
+ * @param {string} [options.srcPath] Directory dosai analyzed; a package the BOM holds in several
240
+ * versions is matched by the project of the record's file
131
241
  * @returns {Object} Map of canonical purl to arrays of call-stack frame objects
132
242
  */
133
- export declare function collectDosaiDataFlowFrames(dataFlowResult: Object, components?: Object[]): Object;
243
+ export declare function collectDosaiDataFlowFrames(dataFlowResult: Object, components?: Object[], options?: {
244
+ srcPath?: string;
245
+ }): Object;
134
246
  /**
135
247
  * Consume dosai's AiComponents[] inventory (schema 4.0.0): model identifiers,
136
248
  * on-disk model artifacts with hashes, MCP tools, prompts (redacted), and agents
@@ -1 +1 @@
1
- {"version":3,"file":"dosai.d.ts","sourceRoot":"","sources":["../../../lib/inventory/dosai.js"],"names":[],"mappings":"AA8LA;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAHnC,MAGmC,GAFjC,OAAO,CAInB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAH/B,MAG+B,GAF7B,MAAM,GAAC,SAAS,CAW5B;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAN5B,MAM4B,EAAE,GAAG,EALjC,MAKiC,EAAE,UAAU,EAJ7C,MAI6C,EAAE,OAAO,AAH9D,CACA,EADQ,MAG2D,GAFzD,OAAO,CAiEnB;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EALhC,MAKgC,EAAE,UAAU,EAJ5C,MAI4C,EAAE,OAAO,AAH7D,CACA,EADQ,MAG0D,GAFxD,OAAO,CAInB;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EALjC,MAKiC,EAAE,UAAU,EAJ7C,MAI6C,EAAE,OAAO,AAH9D,CACA,EADQ,MAG2D,GAFzD,OAAO,CAInB;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EALlC,MAKkC,EAAE,UAAU,EAJ9C,MAI8C,EAAE,OAAO,AAH/D,CACA,EADQ,MAG4D,GAF1D,OAAO,CAInB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAJ3B,MAI2B,EAAE,OAAO,AAH5C,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EACZ,WAAW,AALV,CACA,EADQ,MAKO,GAJL,MAAM,CA+GlB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,AAHjD,CACA,EADQ,MAG8C,GAF5C,MAAM,EAAE,CA6CpB"}
@@ -24,6 +24,25 @@ export declare function addDosaiSetValue(map: Object, key: string, value: string
24
24
  * @returns {string|undefined} Location string with a `#line` suffix when available, or undefined when no file is known
25
25
  */
26
26
  export declare function dosaiLocation(item: Object): string | undefined;
27
+ /**
28
+ * Format the `file#line` location of a dosai MethodCalls row, relative to the
29
+ * scanned directory like dosai's source rows.
30
+ *
31
+ * A call site found in assembly IL names its file through the PDB. dosai 5
32
+ * writes it relative to the scan root and leaves Path out when the file has
33
+ * no place in the tree; dosai 4 writes the PDB path as it is: absolute for a
34
+ * local build, `/_/` for a deterministic one (owasp-dep-scan/dosai#79). An
35
+ * absolute path under the scanned directory is made relative to it, and any
36
+ * other build path, or a missing one, gives way to the file name, as for call
37
+ * graph edges, so both versions list a call site found in source and in IL
38
+ * once. Where no sequence point covers a call, the row names the assembly and
39
+ * its line is an IL offset, which is no source location.
40
+ *
41
+ * @param {Object} methodCall Dosai MethodCalls row
42
+ * @param {string} [srcPath] Directory dosai analyzed
43
+ * @returns {string|undefined} Location string, or undefined when the row names no source file
44
+ */
45
+ export declare function dosaiCallSiteLocation(methodCall: Object, srcPath?: string): string | undefined;
27
46
  /**
28
47
  * Return a validated source location for .NET source extensions, from a call graph node.
29
48
  *
@@ -41,19 +60,46 @@ export declare function dosaiSourceLocation(location: Object): string | undefine
41
60
  /**
42
61
  * Build a purl alias map from BOM components.
43
62
  *
44
- * Maps both exact component purls and normalized type/namespace/name keys to
45
- * the canonical component purl so dosai-reported purls can be reconciled.
63
+ * Maps each component purl to itself, and indexes the components by their
64
+ * version-free identity, so a dosai-reported purl can be reconciled by version
65
+ * (see {@link resolveDosaiComponentPurl}). Two versions of one package are two
66
+ * components, and nothing here picks one of them on a name alone.
46
67
  *
47
68
  * @param {Object[]} [components] Component objects with purl fields
48
- * @returns {Map<string, string>} Map of purl or normalized key to canonical component purl
69
+ * @param {Object} [options] Options
70
+ * @param {string} [options.srcPath] Directory dosai analyzed, which its relative locations
71
+ * and the BOM's relative manifest paths are relative to
72
+ * @returns {Map<string, string>} Map of purl to canonical component purl, carrying the identity index
49
73
  */
50
- export declare function buildDosaiPurlAliasMap(components?: Object[]): Map<string, string>;
74
+ export declare function buildDosaiPurlAliasMap(components?: Object[], options?: {
75
+ srcPath?: string;
76
+ }): Map<string, string>;
51
77
  /**
52
- * Resolve a purl to the canonical component purl via the alias map.
78
+ * Choose among the components that share a file name (two versions of a
79
+ * package ship the same DLLs): the only one, else the one whose project
80
+ * directory is nearest the record's location.
81
+ *
82
+ * @param {Iterable<string>} purls Candidate component purls
83
+ * @param {Map<string, string>} purlAliasMap Alias map built by buildDosaiPurlAliasMap
84
+ * @param {string} [location] Source location of the dosai record (`path` or `path#line`)
85
+ * @returns {string|undefined} The component purl, or undefined when it cannot be told
86
+ */
87
+ export declare function pickDosaiComponentByLocation(purls: Iterable<string>, purlAliasMap: Map<string, string>, location?: string): string | undefined;
88
+ /**
89
+ * Resolve a dosai-reported purl to a BOM component purl.
90
+ *
91
+ * The exact purl wins, then the same package at the same version (ids compare
92
+ * case-insensitively). A versionless purl, or a version the BOM does not hold,
93
+ * maps to the package's only component when it has one. When the BOM holds
94
+ * several versions, the record's location picks the version of the project
95
+ * that file belongs to; without a location that settles it the purl maps to
96
+ * nothing rather than to an arbitrary version (issue dosai#72).
53
97
  *
54
98
  * @param {string} purl Purl reported by dosai
55
99
  * @param {Map<string, string>} purlAliasMap Alias map built by buildDosaiPurlAliasMap
56
- * @returns {string|undefined} Canonical component purl, the input purl when unaliased, or undefined when empty
100
+ * @param {string} [location] Source location of the dosai record (`path` or `path#line`)
101
+ * @returns {string|undefined} Canonical component purl, the input purl when the BOM has no
102
+ * component of that package, or undefined when empty or ambiguous
57
103
  */
58
- export declare function resolveDosaiComponentPurl(purl: string, purlAliasMap: Map<string, string>): string | undefined;
104
+ export declare function resolveDosaiComponentPurl(purl: string, purlAliasMap: Map<string, string>, location?: string): string | undefined;
59
105
  //# sourceMappingURL=dosaiParsers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dosaiParsers.d.ts","sourceRoot":"","sources":["../../../lib/inventory/dosaiParsers.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAH/B,MAG+B,GAF7B,MAAM,GAAC,SAAS,CAgB5B;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EALzB,MAKyB,EAAE,GAAG,EAJ9B,MAI8B,EAAE,KAAK,EAHrC,MAGqC,GAFnC,IAAI,CAQhB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAHvB,MAGuB,GAFrB,MAAM,GAAC,SAAS,CAc5B;AAcD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAHrC,MAGqC,GAFnC,MAAM,GAAC,SAAS,CAa5B;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAHjC,MAGiC,GAF/B,MAAM,GAAC,SAAS,CAa5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,AAH9C,CACA,EADQ,MAAM,EAGqC,GAFzC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAe/B;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAJnC,MAImC,EAAE,YAAY,EAHjD,GAAG,CAAC,MAAM,EAAE,MAAM,CAG+B,GAF/C,MAAM,GAAC,SAAS,CAW5B"}
1
+ {"version":3,"file":"dosaiParsers.d.ts","sourceRoot":"","sources":["../../../lib/inventory/dosaiParsers.js"],"names":[],"mappings":"AAeA;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAH/B,MAG+B,GAF7B,MAAM,GAAC,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CA6B5B"}
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Converts a traced library path into a purl subpath. Windows paths
3
+ * ("C:\Windows\System32\bcrypt.dll", "\\server\share\x.dll") use forward
4
+ * slashes and drop the drive or UNC prefix, which a purl subpath cannot carry;
5
+ * the full path stays in the cdx:dynamic:filePath property.
6
+ *
7
+ * @param {string} libPath - Absolute path of the loaded library
8
+ * @returns {string|null} Subpath without leading separators, or null
9
+ */
10
+ export declare function librarySubpath(libPath: string): string | null;
1
11
  /**
2
12
  * Builds a flat list of CycloneDX component objects and services by executing
3
13
  * the given command and inspecting which shared libraries it loads at runtime
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic.d.ts","sourceRoot":"","sources":["../../../lib/inventory/dynamic.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAND,MAMC,EACV,UAAU,EAND,MAMC,EACV,YAAY,AANX,CACA,EADQ,MAMQ,GALN,OAAO,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAC,CAAC,CAsHzE"}
1
+ {"version":3,"file":"dynamic.d.ts","sourceRoot":"","sources":["../../../lib/inventory/dynamic.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAH3B,MAG2B,GAFzB,MAAM,GAAC,IAAI,CAevB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAND,MAMC,EACV,UAAU,EAND,MAMC,EACV,YAAY,AANX,CACA,EADQ,MAMQ,GALN,OAAO,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAC,CAAC,CA8KzE"}
@@ -44,15 +44,30 @@ export declare function attachIdentityTools(subjects: Object | Object[], toolRef
44
44
  * Enrich .NET package components with occurrence evidence and imported module/method
45
45
  * information from a dosai dependency slices file.
46
46
  *
47
- * Builds a mapping of DLL filenames to purls using the `internal:PackageFiles` property of each
48
- * package, then reads the slices file to add occurrence locations, imported modules,
49
- * called methods, and assembly version information where available.
47
+ * Each dosai record names its package by purl, resolved in the project of the
48
+ * record's file, and is attached to the component of that version (see
49
+ * {@link resolveDosaiComponentPurl}). The DLL files of each package
50
+ * (`internal:PackageFiles`) only fill in for a record whose purl names no
51
+ * component, and only when the DLL belongs to one component or the record's
52
+ * location says which: two versions of a package ship the same DLL names.
53
+ *
54
+ * The fallback is needed because dosai names a `System.*` assembly it cannot
55
+ * map to a package with a framework purl (`pkg:nuget/System.Runtime`), as it
56
+ * does whenever the tree has lock files but no restore output: the DLL of
57
+ * System.Data.SQLite.Core is still the package's. A DLL that only a package's
58
+ * build-time folders carry is not listed in `internal:PackageFiles`, so it
59
+ * credits no package with the project's framework calls (issue 4441).
50
60
  *
51
61
  * @param {Object[]} pkgList Array of .NET package component objects to enrich
52
62
  * @param {string} slicesFile Path to the dosai dependency slices JSON file
63
+ * @param {Object} [options] Options
64
+ * @param {string} [options.srcPath] Directory dosai analyzed, which its relative locations
65
+ * and the components' relative manifest paths are relative to
53
66
  * @returns {Object[]} The enriched package list (same array, mutated in place)
54
67
  */
55
- export declare function addEvidenceForDotnet(pkgList: Object[], slicesFile: string): Object[];
68
+ export declare function addEvidenceForDotnet(pkgList: Object[], slicesFile: string, options?: {
69
+ srcPath?: string;
70
+ }): Object[];
56
71
  /**
57
72
  * Convert OS query results
58
73
  *
@@ -1 +1 @@
1
- {"version":3,"file":"evidenceUtils.d.ts","sourceRoot":"","sources":["../../../lib/inventory/evidenceUtils.js"],"names":[],"mappings":"AA6BA;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAJtC,MAIsC,EAAE,OAAO,AAHvD,CACA,EADQ,MAGoD,GAFlD,MAAM,GAAC,SAA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