@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.
- package/README.md +17 -10
- package/bin/audit.js +7 -4
- package/bin/cdxgen.js +260 -37
- package/bin/convert.js +146 -22
- package/bin/evinse.js +28 -3
- package/bin/repl.js +47 -3
- package/bin/sign.js +211 -34
- package/bin/tracebom.js +18 -6
- package/bin/validate.js +24 -3
- package/bin/verify.js +113 -5
- package/data/behavior-taxonomy.schema.json +1491 -0
- package/data/cyclonedx-2.0-bundled.schema.json +18606 -5528
- package/data/cyclonedx-2.0-cryptography-defs.schema.json +857 -0
- package/data/license-aliases.json +24 -2
- package/data/pqc-migration.json +239 -0
- package/data/remediations.json +176 -0
- package/data/rules/ai-bom.yaml +1 -1
- package/data/rules/brotli-decoder.yaml +107 -0
- package/data/rules/cbom-security.yaml +4 -3
- package/data/rules/package-integrity.yaml +28 -0
- package/data/rules/vscode-extensions.yaml +75 -0
- package/data/spdx-license-list.json +121 -7
- package/data/spdx-licenses.json +69 -0
- package/data/spdx.schema.json +845 -2
- package/lib/audit/index.js +25 -3
- package/lib/cli/bomAssembly.js +172 -4
- package/lib/cli/cliOptions.js +121 -17
- package/lib/cli/index.js +720 -902
- package/lib/cli/jsBom.js +156 -64
- package/lib/cli/jvmBom.js +602 -86
- package/lib/cli/managedBom.js +161 -19
- package/lib/cli/nativeBom.js +52 -5
- package/lib/core/boundedFile.js +344 -0
- package/lib/core/brotliProbe.js +182 -0
- package/lib/core/env.js +34 -0
- package/lib/core/fs.js +138 -3
- package/lib/core/globPatterns.js +218 -0
- package/lib/core/httpClient.js +98 -1
- package/lib/core/lockPaths.js +38 -0
- package/lib/core/paths.js +24 -1
- package/lib/core/processTree.js +100 -8
- package/lib/core/projectConfig.js +332 -25
- package/lib/core/toolRegistry.js +184 -0
- package/lib/ecosystems/cppEvidence.js +263 -106
- package/lib/ecosystems/cppIncludeResolver.js +16 -5
- package/lib/ecosystems/denoutils.js +2 -2
- package/lib/ecosystems/ecosystems.js +25 -10
- package/lib/ecosystems/gemHostProbe.js +301 -0
- package/lib/ecosystems/golem.js +3 -8
- package/lib/ecosystems/gradleutils.js +1909 -229
- package/lib/ecosystems/jsEvidence.js +90 -38
- package/lib/ecosystems/kosi.js +3 -5
- package/lib/ecosystems/npmVersionResolution.js +376 -0
- package/lib/ecosystems/parsers-bazel.js +107 -6
- package/lib/ecosystems/parsers-js.js +505 -22
- package/lib/ecosystems/parsers-misc.js +209 -20
- package/lib/ecosystems/parsers-python.js +178 -30
- package/lib/ecosystems/parsers-rust.js +117 -15
- package/lib/ecosystems/pythonutils.js +128 -2
- package/lib/ecosystems/remote/huggingface.js +22 -0
- package/lib/ecosystems/rubyutils.js +538 -31
- package/lib/ecosystems/rusi.js +2 -4
- package/lib/ecosystems/scalacliutils.js +2 -0
- package/lib/ecosystems/scalasem.js +798 -152
- package/lib/ecosystems/vendoredCode.js +237 -3
- package/lib/ecosystems/venvProbe.js +360 -0
- package/lib/evinser/evinser.js +536 -71
- package/lib/evinser/scalasem.js +5 -1
- package/lib/helpers/agenticToolutils.js +525 -94
- package/lib/helpers/bomSigner.js +43 -9
- package/lib/helpers/jssSigner.js +1276 -0
- package/lib/helpers/vsixutils.js +1574 -315
- package/lib/inventory/agentBlueprint.js +193 -0
- package/lib/inventory/agentToolNames.js +145 -0
- package/lib/inventory/aiCollector.js +153 -7
- package/lib/inventory/aiInventory.js +44 -8
- package/lib/inventory/aiProviders.js +324 -0
- package/lib/inventory/atomUtils.js +77 -0
- package/lib/inventory/bomUtils.js +8 -1
- package/lib/inventory/brotliDecoder.js +142 -0
- package/lib/inventory/buildToolRateLimit.js +1 -1
- package/lib/inventory/cbomutils.js +56 -7
- package/lib/inventory/ciParsers/githubActionsLock.js +821 -0
- package/lib/inventory/citations.js +31 -2
- package/lib/inventory/communityAiConfigParser.js +978 -80
- package/lib/inventory/cyclonedx20.js +152 -0
- package/lib/inventory/cyclonedx20Common.js +286 -0
- package/lib/inventory/cyclonedx20Derived.js +159 -0
- package/lib/inventory/cyclonedx20Parties.js +552 -0
- package/lib/inventory/cyclonedx20Read.js +768 -0
- package/lib/inventory/cyclonedx20ReadCommon.js +374 -0
- package/lib/inventory/cyclonedx20ReadComponents.js +692 -0
- package/lib/inventory/cyclonedx20ReadContext.js +380 -0
- package/lib/inventory/cyclonedx20ReadEvidence.js +466 -0
- package/lib/inventory/cyclonedx20ReadSections.js +599 -0
- package/lib/inventory/cyclonedx20Render.js +766 -0
- package/lib/inventory/cyclonedx20RenderComponents.js +716 -0
- package/lib/inventory/cyclonedx20RenderDefinitions.js +405 -0
- package/lib/inventory/cyclonedx20RenderEvidence.js +726 -0
- package/lib/inventory/cyclonedx20RenderHardware.js +203 -0
- package/lib/inventory/cyclonedx20RenderPatents.js +174 -0
- package/lib/inventory/cyclonedx20RenderRefIds.js +314 -0
- package/lib/inventory/cyclonedx20RenderSections.js +499 -0
- package/lib/inventory/cyclonedx20Tables.js +594 -0
- package/lib/inventory/deps.js +141 -13
- package/lib/inventory/dosai.js +375 -6
- package/lib/inventory/dosaiParsers.js +3 -6
- package/lib/inventory/dotnetRuntime.js +367 -0
- package/lib/inventory/ecosystemFormulationParsers.js +979 -0
- package/lib/inventory/envcontext.js +436 -48
- package/lib/inventory/evidenceUtils.js +13 -1
- package/lib/inventory/fetchBatch.js +1 -1
- package/lib/inventory/formulationParsers.js +124 -14
- package/lib/inventory/gtfobins.js +13 -0
- package/lib/inventory/hbom.js +45 -6
- package/lib/inventory/hbomLoader.js +166 -0
- package/lib/inventory/hostRuntimeProbe.js +686 -0
- package/lib/inventory/jvmLocalRepos.js +9 -2
- package/lib/inventory/jvmToolEnv.js +29 -0
- package/lib/inventory/licenseEnhancer.js +12 -0
- package/lib/inventory/mavenCentralMirror.js +534 -0
- package/lib/inventory/mcpConfigParser.js +5 -0
- package/lib/inventory/nodeBuildInfo.js +218 -0
- package/lib/inventory/nodeHostProbe.js +202 -0
- package/lib/inventory/occurrenceKey.js +90 -0
- package/lib/inventory/osPackageResolver.js +182 -0
- package/lib/inventory/phpBuildInfo.js +10 -59
- package/lib/inventory/phpHostProbe.js +32 -488
- package/lib/inventory/pqcMigration.js +426 -0
- package/lib/inventory/rubyBuildInfo.js +972 -0
- package/lib/inventory/rubyHostProbe.js +218 -0
- package/lib/inventory/rustFormulationParser.js +21 -10
- package/lib/inventory/scalaCoords.js +4 -3
- package/lib/inventory/scalaDedupe.js +440 -0
- package/lib/inventory/source.js +114 -8
- package/lib/managers/binary.js +337 -3
- package/lib/managers/docker.js +79 -0
- package/lib/parsers/huggingfaceManifest.js +9 -1
- package/lib/parsers/huggingfaceUtils.js +18 -0
- package/lib/parsers/kiroPermissions.js +166 -0
- package/lib/parsers/largeJson.js +28 -11
- package/lib/parsers/vscodeExtensionId.js +183 -0
- package/lib/server/server.js +48 -35
- package/lib/stages/postgen/postgen.js +41 -1
- package/lib/stages/postgen/ruleEngine.js +13 -5
- package/lib/stages/postgen/specVersionCompat.js +76 -0
- package/lib/stages/pregen/envAudit.js +1 -0
- package/lib/stages/pregen/pregen.js +114 -57
- package/lib/validator/bomValidator.js +14 -2
- package/lib/validator/complianceEngine.js +30 -3
- package/lib/validator/complianceRules.js +1416 -4
- package/lib/validator/generated/validate-1.6.mjs +1 -1
- package/lib/validator/generated/validate-1.7.mjs +1 -1
- package/lib/validator/generated/validate-2.0.mjs +57554 -13851
- package/lib/validator/index.js +49 -8
- package/lib/validator/reporters/json.js +6 -0
- package/package.json +11 -10
- package/types/bin/repl.d.ts.map +1 -1
- package/types/lib/audit/index.d.ts +6 -2
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts +29 -1
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +6 -0
- package/types/lib/cli/cliOptions.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/cli/jsBom.d.ts +3 -18
- package/types/lib/cli/jsBom.d.ts.map +1 -1
- package/types/lib/cli/jvmBom.d.ts +15 -0
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/boundedFile.d.ts +100 -0
- package/types/lib/core/boundedFile.d.ts.map +1 -0
- package/types/lib/core/brotliProbe.d.ts +37 -0
- package/types/lib/core/brotliProbe.d.ts.map +1 -0
- package/types/lib/core/env.d.ts +14 -0
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts +4 -0
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/globPatterns.d.ts +70 -0
- package/types/lib/core/globPatterns.d.ts.map +1 -0
- package/types/lib/core/httpClient.d.ts +24 -0
- package/types/lib/core/httpClient.d.ts.map +1 -1
- package/types/lib/core/lockPaths.d.ts +19 -0
- package/types/lib/core/lockPaths.d.ts.map +1 -0
- package/types/lib/core/paths.d.ts +9 -0
- package/types/lib/core/paths.d.ts.map +1 -1
- package/types/lib/core/processTree.d.ts +17 -4
- package/types/lib/core/processTree.d.ts.map +1 -1
- package/types/lib/core/projectConfig.d.ts +47 -8
- package/types/lib/core/projectConfig.d.ts.map +1 -1
- package/types/lib/core/toolRegistry.d.ts +36 -0
- package/types/lib/core/toolRegistry.d.ts.map +1 -0
- package/types/lib/ecosystems/cppEvidence.d.ts +40 -13
- package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/cppIncludeResolver.d.ts +2 -1
- package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -1
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/gemHostProbe.d.ts +28 -0
- package/types/lib/ecosystems/gemHostProbe.d.ts.map +1 -0
- package/types/lib/ecosystems/golem.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +294 -20
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/jsEvidence.d.ts +14 -1
- package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/kosi.d.ts.map +1 -1
- package/types/lib/ecosystems/npmVersionResolution.d.ts +119 -0
- package/types/lib/ecosystems/npmVersionResolution.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-bazel.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts +17 -20
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-misc.d.ts +19 -0
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-python.d.ts +10 -0
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
- package/types/lib/ecosystems/pythonutils.d.ts +19 -1
- package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
- package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
- package/types/lib/ecosystems/rubyutils.d.ts +144 -12
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rusi.d.ts.map +1 -1
- package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -1
- package/types/lib/ecosystems/scalasem.d.ts +58 -16
- package/types/lib/ecosystems/scalasem.d.ts.map +1 -1
- package/types/lib/ecosystems/vendoredCode.d.ts +26 -0
- package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -1
- package/types/lib/ecosystems/venvProbe.d.ts +40 -0
- package/types/lib/ecosystems/venvProbe.d.ts.map +1 -0
- package/types/lib/evinser/evinser.d.ts +120 -13
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/scalasem.d.ts.map +1 -1
- package/types/lib/helpers/agenticToolutils.d.ts +53 -19
- package/types/lib/helpers/agenticToolutils.d.ts.map +1 -1
- package/types/lib/helpers/bomSigner.d.ts +20 -3
- package/types/lib/helpers/bomSigner.d.ts.map +1 -1
- package/types/lib/helpers/jssSigner.d.ts +288 -0
- package/types/lib/helpers/jssSigner.d.ts.map +1 -0
- package/types/lib/helpers/vsixutils.d.ts +303 -19
- package/types/lib/helpers/vsixutils.d.ts.map +1 -1
- package/types/lib/inventory/agentBlueprint.d.ts +70 -0
- package/types/lib/inventory/agentBlueprint.d.ts.map +1 -0
- package/types/lib/inventory/agentToolNames.d.ts +51 -0
- package/types/lib/inventory/agentToolNames.d.ts.map +1 -0
- package/types/lib/inventory/aiCollector.d.ts.map +1 -1
- package/types/lib/inventory/aiInventory.d.ts.map +1 -1
- package/types/lib/inventory/aiProviders.d.ts +85 -0
- package/types/lib/inventory/aiProviders.d.ts.map +1 -0
- package/types/lib/inventory/atomUtils.d.ts +19 -0
- package/types/lib/inventory/atomUtils.d.ts.map +1 -1
- package/types/lib/inventory/bomUtils.d.ts.map +1 -1
- package/types/lib/inventory/brotliDecoder.d.ts +58 -0
- package/types/lib/inventory/brotliDecoder.d.ts.map +1 -0
- package/types/lib/inventory/cbomutils.d.ts +17 -0
- package/types/lib/inventory/cbomutils.d.ts.map +1 -1
- package/types/lib/inventory/ciParsers/githubActionsLock.d.ts +101 -0
- package/types/lib/inventory/ciParsers/githubActionsLock.d.ts.map +1 -0
- package/types/lib/inventory/citations.d.ts +5 -0
- package/types/lib/inventory/citations.d.ts.map +1 -1
- package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/cyclonedx20.d.ts +99 -0
- package/types/lib/inventory/cyclonedx20.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Common.d.ts +102 -0
- package/types/lib/inventory/cyclonedx20Common.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Derived.d.ts +74 -0
- package/types/lib/inventory/cyclonedx20Derived.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Parties.d.ts +91 -0
- package/types/lib/inventory/cyclonedx20Parties.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Read.d.ts +51 -0
- package/types/lib/inventory/cyclonedx20Read.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadCommon.d.ts +69 -0
- package/types/lib/inventory/cyclonedx20ReadCommon.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadComponents.d.ts +77 -0
- package/types/lib/inventory/cyclonedx20ReadComponents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadContext.d.ts +118 -0
- package/types/lib/inventory/cyclonedx20ReadContext.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts +40 -0
- package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadSections.d.ts +45 -0
- package/types/lib/inventory/cyclonedx20ReadSections.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Render.d.ts +53 -0
- package/types/lib/inventory/cyclonedx20Render.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderComponents.d.ts +73 -0
- package/types/lib/inventory/cyclonedx20RenderComponents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts +29 -0
- package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts +110 -0
- package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderHardware.d.ts +42 -0
- package/types/lib/inventory/cyclonedx20RenderHardware.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderPatents.d.ts +26 -0
- package/types/lib/inventory/cyclonedx20RenderPatents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts +55 -0
- package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderSections.d.ts +45 -0
- package/types/lib/inventory/cyclonedx20RenderSections.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Tables.d.ts +134 -0
- package/types/lib/inventory/cyclonedx20Tables.d.ts.map +1 -0
- package/types/lib/inventory/deps.d.ts +35 -2
- package/types/lib/inventory/deps.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +36 -1
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
- package/types/lib/inventory/dotnetRuntime.d.ts +91 -0
- package/types/lib/inventory/dotnetRuntime.d.ts.map +1 -0
- package/types/lib/inventory/ecosystemFormulationParsers.d.ts +73 -0
- package/types/lib/inventory/ecosystemFormulationParsers.d.ts.map +1 -0
- package/types/lib/inventory/envcontext.d.ts +74 -12
- package/types/lib/inventory/envcontext.d.ts.map +1 -1
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
- package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
- package/types/lib/inventory/gtfobins.d.ts.map +1 -1
- package/types/lib/inventory/hbom.d.ts +11 -0
- package/types/lib/inventory/hbom.d.ts.map +1 -1
- package/types/lib/inventory/hbomLoader.d.ts +54 -0
- package/types/lib/inventory/hbomLoader.d.ts.map +1 -1
- package/types/lib/inventory/hostRuntimeProbe.d.ts +44 -0
- package/types/lib/inventory/hostRuntimeProbe.d.ts.map +1 -0
- package/types/lib/inventory/jvmLocalRepos.d.ts +5 -1
- package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -1
- package/types/lib/inventory/jvmToolEnv.d.ts +12 -0
- package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -1
- package/types/lib/inventory/licenseEnhancer.d.ts.map +1 -1
- package/types/lib/inventory/mavenCentralMirror.d.ts +170 -0
- package/types/lib/inventory/mavenCentralMirror.d.ts.map +1 -0
- package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/nodeBuildInfo.d.ts +95 -0
- package/types/lib/inventory/nodeBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/nodeHostProbe.d.ts +15 -0
- package/types/lib/inventory/nodeHostProbe.d.ts.map +1 -0
- package/types/lib/inventory/occurrenceKey.d.ts +52 -0
- package/types/lib/inventory/occurrenceKey.d.ts.map +1 -0
- package/types/lib/inventory/osPackageResolver.d.ts +38 -0
- package/types/lib/inventory/osPackageResolver.d.ts.map +1 -1
- package/types/lib/inventory/phpBuildInfo.d.ts.map +1 -1
- package/types/lib/inventory/phpHostProbe.d.ts.map +1 -1
- package/types/lib/inventory/pqcMigration.d.ts +84 -0
- package/types/lib/inventory/pqcMigration.d.ts.map +1 -0
- package/types/lib/inventory/rubyBuildInfo.d.ts +271 -0
- package/types/lib/inventory/rubyBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/rubyHostProbe.d.ts +47 -0
- package/types/lib/inventory/rubyHostProbe.d.ts.map +1 -0
- package/types/lib/inventory/rustFormulationParser.d.ts +7 -2
- package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
- package/types/lib/inventory/scalaCoords.d.ts.map +1 -1
- package/types/lib/inventory/scalaDedupe.d.ts +43 -0
- package/types/lib/inventory/scalaDedupe.d.ts.map +1 -0
- package/types/lib/inventory/source.d.ts +25 -0
- package/types/lib/inventory/source.d.ts.map +1 -1
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts +12 -0
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/parsers/huggingfaceManifest.d.ts +10 -1
- package/types/lib/parsers/huggingfaceManifest.d.ts.map +1 -1
- package/types/lib/parsers/huggingfaceUtils.d.ts +12 -0
- package/types/lib/parsers/huggingfaceUtils.d.ts.map +1 -1
- package/types/lib/parsers/kiroPermissions.d.ts +62 -0
- package/types/lib/parsers/kiroPermissions.d.ts.map +1 -0
- package/types/lib/parsers/largeJson.d.ts +4 -3
- package/types/lib/parsers/largeJson.d.ts.map +1 -1
- package/types/lib/parsers/vscodeExtensionId.d.ts +48 -0
- package/types/lib/parsers/vscodeExtensionId.d.ts.map +1 -0
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts +7 -0
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
- package/types/lib/stages/postgen/specVersionCompat.d.ts +25 -0
- package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
- package/types/lib/stages/pregen/envAudit.d.ts.map +1 -1
- package/types/lib/stages/pregen/pregen.d.ts +12 -8
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts +5 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
- package/types/lib/validator/complianceEngine.d.ts +4 -4
- package/types/lib/validator/complianceEngine.d.ts.map +1 -1
- package/types/lib/validator/complianceRules.d.ts +14 -2
- package/types/lib/validator/complianceRules.d.ts.map +1 -1
- package/types/lib/validator/index.d.ts +10 -0
- package/types/lib/validator/index.d.ts.map +1 -1
- 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
|
-
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
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:
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
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
|
-
`
|
|
1865
|
+
`Found ${inventory.components.length} IDE and extension component(s) in ${ideDirs.length} folder(s)`,
|
|
1774
1866
|
);
|
|
1775
1867
|
}
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
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
|
-
|
|
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) {
|