@cdxgen/cdxgen 13.1.0 → 13.3.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 +32 -15
- package/bin/cdxgen.js +243 -122
- package/bin/evinse.js +7 -0
- package/bin/sign.js +88 -14
- package/bin/tracebom.js +64 -4
- package/bin/validate.js +29 -7
- package/bin/verify.js +79 -39
- package/data/crypto-oid.json +88 -12
- package/data/remediations.json +47 -0
- package/data/rules/ai-bom.yaml +78 -0
- package/data/rules/cargo-rust.yaml +132 -0
- package/data/rules/mcp-servers.yaml +122 -0
- package/lib/audit/targets.js +6 -1
- package/lib/cli/bomAssembly.js +117 -15
- package/lib/cli/cliOptions.js +93 -1
- package/lib/cli/index.js +235 -5
- package/lib/cli/jsBom.js +108 -26
- package/lib/cli/jvmBom.js +68 -12
- package/lib/cli/managedBom.js +264 -41
- package/lib/cli/nativeBom.js +923 -15
- package/lib/core/activity.js +120 -2
- package/lib/core/env.js +44 -7
- package/lib/core/fs.js +174 -6
- package/lib/core/metadataProperties.js +97 -0
- package/lib/core/projectConfig.js +31 -4
- package/lib/core/userAgent.js +151 -0
- package/lib/ecosystems/bunutils.js +269 -101
- package/lib/ecosystems/cargoCache.js +364 -0
- package/lib/ecosystems/caxa.js +447 -7
- package/lib/ecosystems/cmakeResolver.js +66 -0
- package/lib/ecosystems/cppEvidence.js +104 -33
- package/lib/ecosystems/ecosystems.js +260 -99
- package/lib/ecosystems/golem.js +11 -1
- package/lib/ecosystems/gradleutils.js +185 -9
- package/lib/ecosystems/jsEvidence.js +19 -20
- package/lib/ecosystems/kosi.js +1263 -0
- package/lib/ecosystems/npmutils.js +110 -9
- package/lib/ecosystems/parsers-crystal.js +179 -0
- package/lib/ecosystems/parsers-dotnet.js +120 -49
- package/lib/ecosystems/parsers-elm.js +816 -0
- package/lib/ecosystems/parsers-gleam.js +1 -1
- package/lib/ecosystems/parsers-go.js +47 -9
- package/lib/ecosystems/parsers-js.js +171 -50
- package/lib/ecosystems/parsers-julia.js +268 -0
- package/lib/ecosystems/parsers-lua.js +218 -0
- package/lib/ecosystems/parsers-misc.js +919 -161
- package/lib/ecosystems/parsers-nim.js +221 -0
- package/lib/ecosystems/parsers-opam.js +180 -0
- package/lib/ecosystems/parsers-perl.js +277 -0
- package/lib/ecosystems/parsers-python.js +27 -15
- package/lib/ecosystems/parsers-r.js +148 -0
- package/lib/ecosystems/parsers-rebar.js +411 -0
- package/lib/ecosystems/parsers-rust.js +954 -33
- package/lib/ecosystems/parsers-spack.js +204 -0
- package/lib/ecosystems/parsers-stack.js +264 -0
- package/lib/ecosystems/parsers-terraform.js +194 -0
- package/lib/ecosystems/rubyutils.js +1426 -166
- package/lib/ecosystems/rusi.js +158 -7
- package/lib/evinser/evinser.js +547 -129
- package/lib/evinser/swiftsem.js +1914 -302
- package/lib/helpers/agenticToolutils.js +925 -0
- package/lib/helpers/bomSigner.js +652 -221
- package/lib/inventory/agentFormulationParser.js +57 -4
- package/lib/inventory/aiCollector.js +504 -10
- package/lib/inventory/aiInventory.js +12 -0
- package/lib/inventory/analyzer.js +488 -30
- package/lib/inventory/astWorker.js +6 -0
- package/lib/inventory/atomUtils.js +568 -31
- package/lib/inventory/auditCategories.js +8 -0
- package/lib/inventory/cbomutils.js +30 -0
- package/lib/inventory/cdxrs.js +110 -14
- package/lib/inventory/communityAiConfigParser.js +215 -2
- package/lib/inventory/depsUtils.js +183 -11
- package/lib/inventory/display.js +4 -5
- package/lib/inventory/dosai.js +627 -13
- package/lib/inventory/dynamic.js +39 -1
- package/lib/inventory/envcontext.js +9 -6
- package/lib/inventory/evidenceUtils.js +26 -5
- package/lib/inventory/fetchBatch.js +190 -19
- package/lib/inventory/fetchRate.js +74 -11
- package/lib/inventory/forgeEnricher.js +3 -2
- package/lib/inventory/jvmToolEnv.js +6 -5
- package/lib/inventory/mcpConfigParser.js +166 -2
- package/lib/inventory/mcpDiscovery.js +11 -0
- package/lib/inventory/mcpServerManifest.js +389 -0
- package/lib/inventory/mcpbBundle.js +419 -0
- package/lib/inventory/plugins.js +3 -0
- package/lib/inventory/protobom.js +62 -89
- package/lib/inventory/protobomLoader.js +4 -0
- package/lib/inventory/purl.js +152 -3
- package/lib/inventory/rustFormulationParser.js +1 -1
- package/lib/inventory/sbomDocument.js +2 -70
- package/lib/inventory/source.js +47 -23
- package/lib/inventory/stylePackageRefs.js +41 -0
- package/lib/inventory/svelteUtils.js +524 -0
- package/lib/inventory/traceRunner.js +210 -21
- package/lib/managers/binary.js +115 -24
- package/lib/managers/docker.js +440 -20
- package/lib/managers/oci.js +39 -1
- package/lib/parsers/cmakeLists.js +452 -0
- package/lib/parsers/huggingfaceUtils.js +15 -7
- package/lib/parsers/largeJson.js +454 -0
- package/lib/parsers/npmrc.js +19 -1
- package/lib/parsers/onnx.js +294 -0
- package/lib/parsers/safetensors.js +114 -0
- package/lib/stages/postgen/introspection/markers.js +29 -6
- package/lib/stages/postgen/postgen.js +237 -16
- package/lib/third-party/arborist/snapshots/calc-dep-flags.test.cjs +462 -0
- package/lib/validator/bomValidator.js +6 -16
- package/lib/validator/index.js +48 -10
- package/lib/validator/reporters/console.js +3 -0
- package/lib/validator/reporters/json.js +1 -0
- package/lib/validator/reporters/sarif.js +7 -0
- package/package.json +27 -27
- package/types/lib/audit/targets.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts +2 -1
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +33 -1
- package/types/lib/cli/cliOptions.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts +2 -2
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/cli/jsBom.d.ts +23 -0
- package/types/lib/cli/jsBom.d.ts.map +1 -1
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts +33 -0
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts +88 -8
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/activity.d.ts.map +1 -1
- package/types/lib/core/env.d.ts +21 -0
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts +55 -0
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/metadataProperties.d.ts +39 -0
- package/types/lib/core/metadataProperties.d.ts.map +1 -0
- package/types/lib/core/projectConfig.d.ts +6 -2
- package/types/lib/core/projectConfig.d.ts.map +1 -1
- package/types/lib/core/userAgent.d.ts +56 -0
- package/types/lib/core/userAgent.d.ts.map +1 -0
- package/types/lib/ecosystems/bunutils.d.ts +12 -5
- package/types/lib/ecosystems/bunutils.d.ts.map +1 -1
- package/types/lib/ecosystems/cargoCache.d.ts +75 -0
- package/types/lib/ecosystems/cargoCache.d.ts.map +1 -0
- package/types/lib/ecosystems/caxa.d.ts +14 -0
- package/types/lib/ecosystems/caxa.d.ts.map +1 -1
- package/types/lib/ecosystems/cmakeResolver.d.ts +23 -0
- package/types/lib/ecosystems/cmakeResolver.d.ts.map +1 -1
- package/types/lib/ecosystems/cppEvidence.d.ts +2 -2
- package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/ecosystems.d.ts +15 -1
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/golem.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +40 -4
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/jsEvidence.d.ts +5 -2
- package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/kosi.d.ts +86 -0
- package/types/lib/ecosystems/kosi.d.ts.map +1 -0
- package/types/lib/ecosystems/npmutils.d.ts +42 -0
- package/types/lib/ecosystems/npmutils.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-crystal.d.ts +27 -0
- package/types/lib/ecosystems/parsers-crystal.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-dotnet.d.ts +19 -0
- package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-elm.d.ts +79 -0
- package/types/lib/ecosystems/parsers-elm.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-go.d.ts +10 -0
- package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts +10 -4
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-julia.d.ts +57 -0
- package/types/lib/ecosystems/parsers-julia.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-lua.d.ts +50 -0
- package/types/lib/ecosystems/parsers-lua.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-misc.d.ts +90 -3
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-nim.d.ts +43 -0
- package/types/lib/ecosystems/parsers-nim.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-opam.d.ts +31 -0
- package/types/lib/ecosystems/parsers-opam.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-perl.d.ts +36 -0
- package/types/lib/ecosystems/parsers-perl.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-r.d.ts +35 -0
- package/types/lib/ecosystems/parsers-r.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-rebar.d.ts +42 -0
- package/types/lib/ecosystems/parsers-rebar.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-rust.d.ts +199 -0
- package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-spack.d.ts +33 -0
- package/types/lib/ecosystems/parsers-spack.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-stack.d.ts +35 -0
- package/types/lib/ecosystems/parsers-stack.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-terraform.d.ts +34 -0
- package/types/lib/ecosystems/parsers-terraform.d.ts.map +1 -0
- package/types/lib/ecosystems/pythonutils.d.ts +1 -1
- package/types/lib/ecosystems/rubyutils.d.ts +143 -2
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rusi.d.ts +13 -0
- package/types/lib/ecosystems/rusi.d.ts.map +1 -1
- package/types/lib/evinser/evinser.d.ts +81 -2
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/swiftsem.d.ts +280 -15
- package/types/lib/evinser/swiftsem.d.ts.map +1 -1
- package/types/lib/helpers/agenticToolutils.d.ts +87 -0
- package/types/lib/helpers/agenticToolutils.d.ts.map +1 -0
- package/types/lib/helpers/bomSigner.d.ts +106 -13
- package/types/lib/helpers/bomSigner.d.ts.map +1 -1
- package/types/lib/inventory/agentFormulationParser.d.ts.map +1 -1
- package/types/lib/inventory/aiCollector.d.ts.map +1 -1
- package/types/lib/inventory/aiInventory.d.ts.map +1 -1
- package/types/lib/inventory/analyzer.d.ts.map +1 -1
- package/types/lib/inventory/atomUtils.d.ts +145 -3
- package/types/lib/inventory/atomUtils.d.ts.map +1 -1
- package/types/lib/inventory/auditCategories.d.ts +4 -0
- package/types/lib/inventory/auditCategories.d.ts.map +1 -1
- package/types/lib/inventory/cbomutils.d.ts.map +1 -1
- package/types/lib/inventory/cdxrs.d.ts +8 -3
- package/types/lib/inventory/cdxrs.d.ts.map +1 -1
- package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/depsUtils.d.ts +15 -0
- package/types/lib/inventory/depsUtils.d.ts.map +1 -1
- package/types/lib/inventory/display.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +87 -1
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/dynamic.d.ts.map +1 -1
- package/types/lib/inventory/envcontext.d.ts.map +1 -1
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
- package/types/lib/inventory/fetchBatch.d.ts +34 -0
- package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
- package/types/lib/inventory/fetchRate.d.ts +9 -6
- package/types/lib/inventory/fetchRate.d.ts.map +1 -1
- package/types/lib/inventory/forgeEnricher.d.ts.map +1 -1
- package/types/lib/inventory/jvmToolEnv.d.ts +5 -4
- package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -1
- package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/mcpDiscovery.d.ts.map +1 -1
- package/types/lib/inventory/mcpServerManifest.d.ts +19 -0
- package/types/lib/inventory/mcpServerManifest.d.ts.map +1 -0
- package/types/lib/inventory/mcpbBundle.d.ts +19 -0
- package/types/lib/inventory/mcpbBundle.d.ts.map +1 -0
- package/types/lib/inventory/plugins.d.ts.map +1 -1
- package/types/lib/inventory/protobom.d.ts +18 -13
- package/types/lib/inventory/protobom.d.ts.map +1 -1
- package/types/lib/inventory/protobomLoader.d.ts.map +1 -1
- package/types/lib/inventory/purl.d.ts +71 -2
- package/types/lib/inventory/purl.d.ts.map +1 -1
- package/types/lib/inventory/sbomDocument.d.ts.map +1 -1
- package/types/lib/inventory/source.d.ts.map +1 -1
- package/types/lib/inventory/stylePackageRefs.d.ts +17 -0
- package/types/lib/inventory/stylePackageRefs.d.ts.map +1 -0
- package/types/lib/inventory/svelteUtils.d.ts +124 -0
- package/types/lib/inventory/svelteUtils.d.ts.map +1 -0
- package/types/lib/inventory/traceRunner.d.ts +47 -1
- package/types/lib/inventory/traceRunner.d.ts.map +1 -1
- package/types/lib/managers/binary.d.ts +30 -1
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts +29 -0
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/managers/oci.d.ts +14 -0
- package/types/lib/managers/oci.d.ts.map +1 -1
- package/types/lib/parsers/cmakeLists.d.ts +76 -0
- package/types/lib/parsers/cmakeLists.d.ts.map +1 -0
- package/types/lib/parsers/huggingfaceUtils.d.ts +8 -1
- package/types/lib/parsers/huggingfaceUtils.d.ts.map +1 -1
- package/types/lib/parsers/largeJson.d.ts +52 -0
- package/types/lib/parsers/largeJson.d.ts.map +1 -0
- package/types/lib/parsers/npmrc.d.ts +5 -0
- package/types/lib/parsers/npmrc.d.ts.map +1 -1
- package/types/lib/parsers/onnx.d.ts +28 -0
- package/types/lib/parsers/onnx.d.ts.map +1 -0
- package/types/lib/parsers/safetensors.d.ts +22 -0
- package/types/lib/parsers/safetensors.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/markers.d.ts +3 -2
- package/types/lib/stages/postgen/introspection/markers.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts +33 -0
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
- package/types/lib/validator/index.d.ts +10 -1
- package/types/lib/validator/index.d.ts.map +1 -1
- package/types/lib/validator/reporters/console.d.ts.map +1 -1
- package/types/lib/validator/reporters/json.d.ts.map +1 -1
- package/types/lib/validator/reporters/sarif.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rubyutils.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/rubyutils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rubyutils.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/rubyutils.js"],"names":[],"mappings":"AAsEA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAHzB,MAGyB,GAFvB,OAAO,CAOnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAHlC,MAAM,GAAG,SAGyB,GAFhC,MAAM,GAAG,SAAS,CAO9B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAHrC,MAAM,GAAG,SAG4B,GAFnC;IAAC,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAAC,QAAQ,EAAE,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IAAI,GAAC,SAAS,CAoHjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,OAAA,EACP,eAAe,EARN,MAQM,EACf,YAAY,OAAA,GAND;IAAC,OAAO,QAAQ;IAAC,YAAY,QAAO;CAAC,CAmEjD"}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the backend rusi actually used. `options.backend` is only the
|
|
3
|
+
* requested backend: when the compiler backend cannot run (missing
|
|
4
|
+
* components, wrapper build failure), rusi still echoes "compiler" but falls
|
|
5
|
+
* back to the stable source analysis. Compiler evidence was collected only
|
|
6
|
+
* when rusi emits its compiler-source-evidence diagnostic; a backend-error
|
|
7
|
+
* alone is not conclusive because native interop scanning reports failures
|
|
8
|
+
* under that kind too.
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} rusiReport Parsed rusi report
|
|
11
|
+
* @returns {string|undefined} Effective backend name
|
|
12
|
+
*/
|
|
13
|
+
export declare function effectiveRusiBackend(rusiReport?: Object): string | undefined;
|
|
1
14
|
/**
|
|
2
15
|
* Checks if the provided language is a Rust language alias.
|
|
3
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rusi.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/rusi.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rusi.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/rusi.js"],"names":[],"mappings":"AAgWA;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,GAHpC,MAGyC,GAFvC,MAAM,GAAC,SAAS,CAW5B;AAsZD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAHhC,MAGgC,GAF9B,OAAO,CAInB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAH9B,MAG8B,GAF5B,MAAM,GAAC,SAAS,CAW5B;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EALxB,MAKwB,EAAE,UAAU,EAJpC,MAIoC,EAAE,OAAO,GAH7C,MAGkD,GAFhD,OAAO,CAuDnB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAJ3B,MAI2B,EAAE,OAAO,GAHpC,MAGyC,GAFvC,MAAM,GAAC,SAAS,CA2B5B;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,GAJnC,MAIwC,EAAE,UAAU,QAAK,GAFvD,MAAM,CA8DlB"}
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merges one analyzer run's metadata properties into the BOM's metadata
|
|
3
|
+
* component. Analyzer metadata describes a single run, so when the input BOM
|
|
4
|
+
* already carries facts from an earlier run (cdxgen --profile research, then
|
|
5
|
+
* evinse), everything under the analyzer's own `cdx:<analyzer>:` prefix is
|
|
6
|
+
* replaced. Replacing by exact name would keep facts the new run no longer
|
|
7
|
+
* emits, such as a cdx:rusi:requestedBackend left from a fallback run.
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} component Metadata component to update in place
|
|
10
|
+
* @param {Object[]} metadataProperties Properties from the analyzer run
|
|
11
|
+
*/
|
|
12
|
+
export declare function mergeAnalyzerMetadataProperties(component: Object, metadataProperties?: Object[]): void;
|
|
13
|
+
/**
|
|
14
|
+
* Build the options for the evinse phase (prepareDB, analyzeProject, and
|
|
15
|
+
* createEvinseFile) from the cdxgen CLI options.
|
|
16
|
+
*
|
|
17
|
+
* This object used to be assembled inline in bin/cdxgen.js, which dropped
|
|
18
|
+
* fields the analyzers read - most notably `exclude`, so every dosai and atom
|
|
19
|
+
* run triggered by `--evidence` ignored the user's `--exclude` patterns. Keep
|
|
20
|
+
* the wiring in one place so the forwarded fields stay testable.
|
|
21
|
+
*
|
|
22
|
+
* @param {Object} options CLI options
|
|
23
|
+
* @param {Object} args Parsed CLI arguments; `args._[0]` is the source directory
|
|
24
|
+
* @param {string} input Path of the BOM file the evinse phase enriches
|
|
25
|
+
* @returns {Object} Options for prepareDB, analyzeProject, and createEvinseFile
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildEvinseOptions(options: Object, args: Object, input: string): Object;
|
|
1
28
|
/**
|
|
2
29
|
* Function to create the db for the libraries referred in the sbom.
|
|
3
30
|
*
|
|
@@ -91,8 +118,9 @@ export declare function purlToLanguage(purl: string, filePath?: string): string
|
|
|
91
118
|
* Seed purl-location and import maps from SBOM component evidence.
|
|
92
119
|
*
|
|
93
120
|
* Walks the supplied components reading `internal:ImportedModules` (or
|
|
94
|
-
* `internal:Namespaces` for php/ruby
|
|
95
|
-
*
|
|
121
|
+
* `internal:Namespaces` for php/ruby, plus the `internal:ImportedSymbols` the
|
|
122
|
+
* C/C++ collector records) and `evidence.occurrences` properties to construct
|
|
123
|
+
* lookup maps used during slice analysis.
|
|
96
124
|
*
|
|
97
125
|
* @param {Object[]} components CycloneDX components from the input SBOM
|
|
98
126
|
* @param {string} language Application language used to select the import property name
|
|
@@ -102,6 +130,26 @@ export declare function initFromSbom(components: Object[], language: string): {
|
|
|
102
130
|
purlLocationMap: Record<string, Set<any>>;
|
|
103
131
|
purlImportsMap: Record<string, string[]>;
|
|
104
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* Load a semantics slices file for reuse when it belongs to this project.
|
|
135
|
+
*
|
|
136
|
+
* `--semantics-slices-file` defaults to `semantics.slices.json` in the working
|
|
137
|
+
* directory, which is shared by every project scanned from there and also
|
|
138
|
+
* receives the reports of other analyzers (dosai, rusi, golem). A file is
|
|
139
|
+
* only reused when its shape matches the language. Swift slices must also
|
|
140
|
+
* describe the same project directory and must not predate the input SBOM:
|
|
141
|
+
* `cdxgen --evidence` writes a fresh SBOM before evinse runs, so an older
|
|
142
|
+
* slice was made from an earlier state of the sources and is regenerated.
|
|
143
|
+
* Scala slices cannot be regenerated by evinse and are reused whenever their
|
|
144
|
+
* shape matches.
|
|
145
|
+
*
|
|
146
|
+
* @param {string} language Project language
|
|
147
|
+
* @param {string} slicesFile Candidate semantics slices file
|
|
148
|
+
* @param {string} bomFile Input SBOM
|
|
149
|
+
* @param {string} dirPath Project directory
|
|
150
|
+
* @returns {undefined|Object} Parsed slice when it can be reused
|
|
151
|
+
*/
|
|
152
|
+
export declare function loadReusableSemanticsSlice(language: string, slicesFile: string, bomFile: string, dirPath: string): undefined | Object;
|
|
105
153
|
/**
|
|
106
154
|
* Function to analyze the project
|
|
107
155
|
*
|
|
@@ -115,6 +163,7 @@ export declare function analyzeProject(dbObjMap: Object, options: Object): Promi
|
|
|
115
163
|
userDefinedTypesMap: {};
|
|
116
164
|
componentPropertiesMap?: undefined;
|
|
117
165
|
metadataProperties?: undefined;
|
|
166
|
+
workspaceComponent?: undefined;
|
|
118
167
|
atomFile?: undefined;
|
|
119
168
|
usagesSlicesFile?: undefined;
|
|
120
169
|
dataFlowSlicesFile?: undefined;
|
|
@@ -135,6 +184,26 @@ export declare function analyzeProject(dbObjMap: Object, options: Object): Promi
|
|
|
135
184
|
cryptoGeneratePurls: any;
|
|
136
185
|
servicesMap: {};
|
|
137
186
|
userDefinedTypesMap: {};
|
|
187
|
+
workspaceComponent?: undefined;
|
|
188
|
+
atomFile?: undefined;
|
|
189
|
+
usagesSlicesFile?: undefined;
|
|
190
|
+
dataFlowSlicesFile?: undefined;
|
|
191
|
+
reachablesSlicesFile?: undefined;
|
|
192
|
+
semanticsSlicesFile?: undefined;
|
|
193
|
+
tempDir?: undefined;
|
|
194
|
+
tempDirOwned?: undefined;
|
|
195
|
+
aiComponents?: undefined;
|
|
196
|
+
openapiSpecFile?: undefined;
|
|
197
|
+
} | {
|
|
198
|
+
purlLocationMap: {};
|
|
199
|
+
dataFlowFrames: {};
|
|
200
|
+
componentPropertiesMap: {};
|
|
201
|
+
metadataProperties: any[];
|
|
202
|
+
cryptoComponents: any[];
|
|
203
|
+
cryptoGeneratePurls: {};
|
|
204
|
+
servicesMap: {};
|
|
205
|
+
userDefinedTypesMap: {};
|
|
206
|
+
workspaceComponent: Object | undefined;
|
|
138
207
|
atomFile?: undefined;
|
|
139
208
|
usagesSlicesFile?: undefined;
|
|
140
209
|
dataFlowSlicesFile?: undefined;
|
|
@@ -147,6 +216,7 @@ export declare function analyzeProject(dbObjMap: Object, options: Object): Promi
|
|
|
147
216
|
} | {
|
|
148
217
|
componentPropertiesMap?: undefined;
|
|
149
218
|
metadataProperties?: undefined;
|
|
219
|
+
workspaceComponent?: undefined;
|
|
150
220
|
usagesSlicesFile: any;
|
|
151
221
|
dataFlowSlicesFile: any;
|
|
152
222
|
semanticsSlicesFile: any;
|
|
@@ -165,6 +235,7 @@ export declare function analyzeProject(dbObjMap: Object, options: Object): Promi
|
|
|
165
235
|
} | {
|
|
166
236
|
componentPropertiesMap?: undefined;
|
|
167
237
|
metadataProperties?: undefined;
|
|
238
|
+
workspaceComponent?: undefined;
|
|
168
239
|
atomFile: any;
|
|
169
240
|
usagesSlicesFile: any;
|
|
170
241
|
dataFlowSlicesFile: any;
|
|
@@ -215,6 +286,14 @@ export declare function parseSliceUsages(language: string, userDefinedTypesMap:
|
|
|
215
286
|
/**
|
|
216
287
|
* Method to parse semantic slice data. Currently supported for swift and scala languages.
|
|
217
288
|
*
|
|
289
|
+
* Swift slices created by cdxgen record, for every indexed source file, the
|
|
290
|
+
* lines that reference each dependency module (`moduleReferences`); the module
|
|
291
|
+
* of a reference is the declaring module recovered from the compiler-resolved
|
|
292
|
+
* USR. Components are mapped to their package's modules through the
|
|
293
|
+
* `packages` slice, so every occurrence is backed by a resolved reference.
|
|
294
|
+
* Slices without `moduleReferences` (created by older cdxgen versions) fall
|
|
295
|
+
* back to matching symbol names.
|
|
296
|
+
*
|
|
218
297
|
* @param {String} language Project language.
|
|
219
298
|
* @param {Array} components Components from the input SBOM
|
|
220
299
|
* @param {Object} semanticsSlice Semantic slice data
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evinser.d.ts","sourceRoot":"","sources":["../../../lib/evinser/evinser.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evinser.d.ts","sourceRoot":"","sources":["../../../lib/evinser/evinser.js"],"names":[],"mappings":"AA0GA;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAJA,MAIA,EACT,kBAAkB,GAJT,MAAM,EAIQ,QAkBxB;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAL/B,MAK+B,EAAE,IAAI,EAJrC,MAIqC,EAAE,KAAK,EAH5C,MAG4C,GAF1C,MAAM,CA+BlB;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAF5B,MAE4B;;;;;;;eAuDtC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAPE,MAOF,EACP,SAAS,wBAAA,EACT,UAAU,EAPD,MAOC,EACV,OAAO,GAPE,MAOG,GAND,OAAO,CAAC,IAAI,CAAC,CAmDzB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EALpC,MAKoC,EAAE,SAAS,wBAAA,EAAE,UAAU,EAH3D,MAG2D,GAFzD,OAAO,CAAC,IAAI,CAAC,CAoCzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAPK,MAOL,EACJ,SAAS,wBAAA,EACT,MAAM,EAPG,MAOH,EACN,OAAO,GAPE,MAOG,GAND,OAAO,CAAC,MAAM,GAAC,SAAS,CAAC,CAuBrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAH9B,MAG8B,GAF5B,MAAM,CAOlB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,WAAW,CAC/B,eAAe,EAPN,MAAM,GAAC,MAAM,EAOP,EACf,QAAQ,EAPC,MAOD,EACR,SAAS,AAPR,CACA,EADQ,MAOW,EACpB,OAAO,AAPN,CACA,EADQ,MA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,EAAE,eAAe,EAFtD,MAEsD;;;;;;;;YAgFzD,SAAS;YACT,GAAG;;;;EASV;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,OAAA,qBA4DnC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAH9B,MAG8B,UAExC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAJvC,MAIuC,EAAE,YAAY,EAHrD,MAGqD,GAFnD,MAAM,GAAC,SAAS,CAmD5B"}
|
|
@@ -1,11 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a SwiftPM target or package name into its module name.
|
|
3
|
+
*
|
|
4
|
+
* @param {String} name Target or package name
|
|
5
|
+
* @returns {String} Module name
|
|
6
|
+
*/
|
|
7
|
+
export declare function toModuleName(name: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Decide whether a module belongs to tests or to an aggregate product and so
|
|
10
|
+
* must not contribute build symbols or semantic context.
|
|
11
|
+
*
|
|
12
|
+
* @param {String} moduleName Module name
|
|
13
|
+
* @returns {boolean} `true` when the module should be skipped
|
|
14
|
+
*/
|
|
15
|
+
export declare function isTestOrAggregateModule(moduleName: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Parse the JSON printed by `swift -print-target-info`.
|
|
18
|
+
*
|
|
19
|
+
* `paths.runtimeResourcePath` is `<toolchain>/usr/lib/swift` for every
|
|
20
|
+
* toolchain layout (Xcode, `.xctoolchain` bundles, swiftly, Linux tarballs),
|
|
21
|
+
* so it names the toolchain that actually compiles the project.
|
|
22
|
+
*
|
|
23
|
+
* @param {Object} targetInfo Parsed `-print-target-info` output
|
|
24
|
+
* @returns {undefined|Object} `{ compilerVersion, triple, runtimeResourcePath, toolchainDir }`
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseSwiftTargetInfo(targetInfo: Object): undefined | Object;
|
|
27
|
+
/**
|
|
28
|
+
* Identify the toolchain that `swift` resolves to inside a project directory.
|
|
29
|
+
*
|
|
30
|
+
* The query runs in the project directory because toolchain managers such as
|
|
31
|
+
* swiftly select the toolchain per directory (`.swift-version`), so the
|
|
32
|
+
* compiler that builds a project can differ from the one on the PATH of the
|
|
33
|
+
* calling process.
|
|
34
|
+
*
|
|
35
|
+
* @param {String} basePath Project directory
|
|
36
|
+
* @returns {undefined|Object} Toolchain details, see parseSwiftTargetInfo
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveSwiftToolchain(basePath: string): undefined | Object;
|
|
39
|
+
/**
|
|
40
|
+
* Environment overrides that make sourcekitten load the SourceKit of the
|
|
41
|
+
* toolchain that builds the project.
|
|
42
|
+
*
|
|
43
|
+
* Without guidance sourcekitten uses the toolchain of the selected Xcode (or
|
|
44
|
+
* the `swift` found on the PATH on Linux). SourceKit cannot load modules
|
|
45
|
+
* produced by a different compiler version, so every reference to a
|
|
46
|
+
* dependency then goes unresolved. On macOS sourcekitten honours
|
|
47
|
+
* `XCODE_DEFAULT_TOOLCHAIN_OVERRIDE` ahead of `xcrun`; on Linux it honours
|
|
48
|
+
* `LINUX_SOURCEKIT_LIB_PATH`. Explicitly configured values always win.
|
|
49
|
+
*
|
|
50
|
+
* @param {Object} toolchain Toolchain details from resolveSwiftToolchain
|
|
51
|
+
* @param {String} [platform] Platform name, defaults to process.platform
|
|
52
|
+
* @returns {undefined|Object} Environment overrides for sourcekitten
|
|
53
|
+
*/
|
|
54
|
+
export declare function sourcekittenEnvForToolchain(toolchain: Object, platform?: string): undefined | Object;
|
|
1
55
|
/**
|
|
2
56
|
* Retrieve the structure information of a .swift file in json format
|
|
3
57
|
*
|
|
4
58
|
* @param {String} filePath Path to .swift file
|
|
59
|
+
* @param {Object} [env] Environment overrides for sourcekitten
|
|
5
60
|
*
|
|
6
61
|
* @returns {undefined|Object} JSON representation of the swift file or undefined.
|
|
7
62
|
*/
|
|
8
|
-
export declare function getStructure(filePath: string): undefined | Object;
|
|
63
|
+
export declare function getStructure(filePath: string, env?: Object): undefined | Object;
|
|
9
64
|
/**
|
|
10
65
|
* Parse the data from the structure command
|
|
11
66
|
*
|
|
@@ -13,35 +68,150 @@ export declare function getStructure(filePath: string): undefined | Object;
|
|
|
13
68
|
* @returns {Object|undefined} Parsed value
|
|
14
69
|
*/
|
|
15
70
|
export declare function parseStructure(structureJson: Object): Object | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Split a Swift command line, as printed by a verbose build or given in an
|
|
73
|
+
* environment variable, into arguments.
|
|
74
|
+
*
|
|
75
|
+
* Paths on Windows use backslash separators, so a backslash there is literal
|
|
76
|
+
* unless it precedes a double quote (the `CommandLineToArgvW` rules). Single
|
|
77
|
+
* quotes, which SwiftPM uses to quote arguments on every platform, keep their
|
|
78
|
+
* content literal. Elsewhere shell quoting applies.
|
|
79
|
+
*
|
|
80
|
+
* @param {String} commandString Command line
|
|
81
|
+
* @param {String} [platform] Platform name, defaults to process.platform
|
|
82
|
+
* @returns {Array<String>} Arguments
|
|
83
|
+
*/
|
|
84
|
+
export declare function splitSwiftCommandArgs(commandString: string, platform?: string): Array<string>;
|
|
16
85
|
/**
|
|
17
86
|
* Method to perform swift build in verbose mode.
|
|
18
87
|
*
|
|
88
|
+
* `SWIFT_BUILD_ARGS` adds arguments to the build, for example
|
|
89
|
+
* `--build-system native` to use the llbuild engine with Swift 6.4.
|
|
90
|
+
*
|
|
19
91
|
* @param {String} basePath Path
|
|
20
92
|
* @returns {undefined|String} Verbose build output
|
|
21
93
|
*/
|
|
22
94
|
export declare function verboseBuild(basePath: string): undefined | string;
|
|
23
95
|
/**
|
|
24
|
-
*
|
|
96
|
+
* Reduce one module's compiler invocation to the arguments that affect how
|
|
97
|
+
* its sources are type-checked.
|
|
98
|
+
*
|
|
99
|
+
* Only known argument classes are kept, so outputs, incremental build
|
|
100
|
+
* bookkeeping, response files, and flags a SourceKit build may not know are
|
|
101
|
+
* dropped. The order of the kept arguments is preserved, which keeps paired
|
|
102
|
+
* clang arguments such as `-Xcc -I -Xcc <path>` intact. The module cache is
|
|
103
|
+
* dropped as well: the build's cache may hold modules of other toolchains.
|
|
104
|
+
*
|
|
105
|
+
* @param {Array<String>} tokens Tokenized compiler invocation
|
|
106
|
+
* @returns {Array<String>} Sanitized compiler arguments
|
|
107
|
+
*/
|
|
108
|
+
export declare function sanitizeSwiftModuleArgs(tokens: Array<string>): Array<string>;
|
|
109
|
+
/**
|
|
110
|
+
* Extract the per-module compiler invocations printed by a verbose swift
|
|
111
|
+
* build.
|
|
112
|
+
*
|
|
113
|
+
* Both engines print one driver invocation per module that carries
|
|
114
|
+
* `-module-name`: llbuild prints `swiftc ... -module-name X ... @sources`,
|
|
115
|
+
* while the Swift Build engine prints `builtin-SwiftDriver -- swiftc ...
|
|
116
|
+
* -module-name X ... @<target>.SwiftFileList`. llbuild also prints the
|
|
117
|
+
* frontend jobs of each module, which are only used when no driver line is
|
|
118
|
+
* found. Package manifest and plugin compilations are skipped.
|
|
119
|
+
*
|
|
120
|
+
* @param {String} buildOutput Verbose build output
|
|
121
|
+
* @param {String} [platform] Platform that printed the output, which decides
|
|
122
|
+
* its quoting rules; defaults to process.platform
|
|
123
|
+
* @returns {Object} Map of module name to `{ args, sources, isDriver }`
|
|
124
|
+
*/
|
|
125
|
+
export declare function parseSwiftModuleInvocations(buildOutput: string, platform?: string): Object;
|
|
126
|
+
/**
|
|
127
|
+
* Parse the llbuild engine's build description
|
|
128
|
+
* (`.build/<triple>/debug/description.json`).
|
|
129
|
+
*
|
|
130
|
+
* Its `swiftCommands` record every Swift module the build compiled, with the
|
|
131
|
+
* exact source list and compiler arguments. Host-tool variants
|
|
132
|
+
* (`...-tool.module`, built for macros and plugins) are used only when a
|
|
133
|
+
* module has no regular variant.
|
|
134
|
+
*
|
|
135
|
+
* @param {Object} descriptionJson Parsed description.json
|
|
136
|
+
* @returns {Object} Map of module name to `{ args, sources, isDriver }`
|
|
137
|
+
*/
|
|
138
|
+
export declare function parseSwiftBuildDescription(descriptionJson: Object): Object;
|
|
139
|
+
/**
|
|
140
|
+
* Merge the sanitized arguments of several modules into one argument list,
|
|
141
|
+
* used when a source file cannot be attributed to a single module. The first
|
|
142
|
+
* module's single-value flags win, include paths accumulate, and `-Xcc`
|
|
143
|
+
* values are merged per clang argument group.
|
|
144
|
+
*
|
|
145
|
+
* @param {Array<Array<String>>} argLists Sanitized argument lists, most relevant first
|
|
146
|
+
* @returns {Array<String>} Merged arguments
|
|
147
|
+
*/
|
|
148
|
+
export declare function mergeSwiftModuleArgs(argLists: Array<Array<string>>): Array<string>;
|
|
149
|
+
/**
|
|
150
|
+
* Method to parse the verbose swift build output to identify key compiler
|
|
151
|
+
* parameters. The arguments of the root package's modules are merged, or of
|
|
152
|
+
* every module when the root modules are unknown.
|
|
25
153
|
*
|
|
26
154
|
* @param {String} buildOutput Verbose build output
|
|
27
|
-
* @
|
|
155
|
+
* @param {Array<String>|Set<String>} [rootModules] Module names of the root package
|
|
156
|
+
* @returns {Object} `{ params, compilerArgs }` where params maps module names to their arguments
|
|
28
157
|
*/
|
|
29
|
-
export declare function extractCompilerParamsFromBuild(buildOutput: string): Object;
|
|
158
|
+
export declare function extractCompilerParamsFromBuild(buildOutput: string, rootModules?: Array<string> | Set<string>): Object;
|
|
30
159
|
/**
|
|
31
160
|
* Method to index a swift file and extract metadata
|
|
32
161
|
*
|
|
33
162
|
* @param {String} filePath Path to .swift file
|
|
34
|
-
* @param {String|Array<string>} compilerArgs Compiler arguments
|
|
163
|
+
* @param {String|Array<string>} compilerArgs Compiler arguments. They should
|
|
164
|
+
* list every source of the file's module so that references across files
|
|
165
|
+
* resolve; the file itself is appended when missing.
|
|
166
|
+
* @param {Object} [env] Environment overrides for sourcekitten
|
|
35
167
|
* @returns {undefined|Object} metadata
|
|
36
168
|
*/
|
|
37
|
-
export declare function index(filePath: string, compilerArgs: string | Array<string
|
|
169
|
+
export declare function index(filePath: string, compilerArgs: string | Array<string>, env?: Object): undefined | Object;
|
|
38
170
|
/**
|
|
39
171
|
* Parse the data from the index command
|
|
40
172
|
*
|
|
173
|
+
* Besides the symbol names and lines, the unified symbol resolution (USR) of
|
|
174
|
+
* every indexed entity is recorded with its lines. A USR identifies the
|
|
175
|
+
* declaration the compiler resolved a reference to, including the module
|
|
176
|
+
* that declares it, which is what attributes a usage to a dependency.
|
|
177
|
+
*
|
|
41
178
|
* @param {Object} indexJson Json from the index command
|
|
42
179
|
* @returns {Object|undefined} Parsed value
|
|
43
180
|
*/
|
|
44
181
|
export declare function parseIndex(indexJson: Object): Object | undefined;
|
|
182
|
+
/**
|
|
183
|
+
* Identify the module that declares an entity from its demangled name.
|
|
184
|
+
*
|
|
185
|
+
* Qualified names start with the module (`Yams.dump(object:...)`), and
|
|
186
|
+
* members declared in extensions carry the extending module
|
|
187
|
+
* (`(extension in Yams):Swift.String.yaml`), which is what a usage of the
|
|
188
|
+
* member depends on.
|
|
189
|
+
*
|
|
190
|
+
* @param {String} demangled Output of `swift demangle --compact`
|
|
191
|
+
* @returns {undefined|String} Module name
|
|
192
|
+
*/
|
|
193
|
+
export declare function moduleFromDemangledName(demangled: string): undefined | string;
|
|
194
|
+
/**
|
|
195
|
+
* Identify the module of a mangled Swift name without the demangler. Only the
|
|
196
|
+
* leading module context is decoded, so extension members are attributed to
|
|
197
|
+
* the extended type's module.
|
|
198
|
+
*
|
|
199
|
+
* @param {String} mangled Mangled name starting with `$s`
|
|
200
|
+
* @returns {undefined|String} Module name
|
|
201
|
+
*/
|
|
202
|
+
export declare function moduleFromMangledPrefix(mangled: string): undefined | string;
|
|
203
|
+
/**
|
|
204
|
+
* Identify the declaring module of each USR.
|
|
205
|
+
*
|
|
206
|
+
* Swift USRs are demangled in one batch with `swift demangle`; clang module
|
|
207
|
+
* references (`c:@M@<module>`, emitted for import declarations) carry the
|
|
208
|
+
* module name directly. Other clang USRs name no module and are skipped.
|
|
209
|
+
*
|
|
210
|
+
* @param {Array<String>} usrs USRs to resolve
|
|
211
|
+
* @param {String} basePath Directory to run the demangler in
|
|
212
|
+
* @returns {Map<String, String>} USR to module name
|
|
213
|
+
*/
|
|
214
|
+
export declare function resolveUsrModules(usrs: Array<string>, basePath: string): Map<string, string>;
|
|
45
215
|
/**
|
|
46
216
|
* Method to execute dump-package package command.
|
|
47
217
|
*
|
|
@@ -61,9 +231,10 @@ export declare function parseDumpPackage(dumpJson: Object): Object | undefined;
|
|
|
61
231
|
*
|
|
62
232
|
* @param {String} moduleName Module name
|
|
63
233
|
* @param {String|Array<string>} compilerArgs Compiler arguments extracted from verbose build log
|
|
234
|
+
* @param {Object} [env] Environment overrides for sourcekitten
|
|
64
235
|
* @returns {undefined|Object} JSON representation of the swift module or undefined.
|
|
65
236
|
*/
|
|
66
|
-
export declare function moduleInfo(moduleName: string, compilerArgs: string | Array<string
|
|
237
|
+
export declare function moduleInfo(moduleName: string, compilerArgs: string | Array<string>, env?: Object): undefined | Object;
|
|
67
238
|
/**
|
|
68
239
|
* Parse the data from module-info command to replicate the swift interface
|
|
69
240
|
*
|
|
@@ -72,32 +243,126 @@ export declare function moduleInfo(moduleName: string, compilerArgs: string | Ar
|
|
|
72
243
|
*/
|
|
73
244
|
export declare function parseModuleInfo(moduleInfoJson: Object): Object | undefined;
|
|
74
245
|
/**
|
|
75
|
-
* Method to collect the build symbols from the output file maps generated by
|
|
246
|
+
* Method to collect the build symbols from the output file maps generated by
|
|
247
|
+
* swift build.
|
|
248
|
+
*
|
|
249
|
+
* Both build engines are supported: the llbuild engine writes per-module
|
|
250
|
+
* `output-file-map.json` files, while the Swift Build engine (default from
|
|
251
|
+
* Swift 6.4) writes per-target `<target>-OutputFileMap.json` files under
|
|
252
|
+
* `.build/out/Intermediates.noindex`.
|
|
76
253
|
*
|
|
77
254
|
* @param {String} basePath Path
|
|
78
255
|
* @param {Object} options CLI options
|
|
79
|
-
* @
|
|
256
|
+
* @param {Array<String>} [fileMaps] Output file maps, found under basePath when omitted
|
|
257
|
+
* @returns {Object} symbols map keyed by module name
|
|
80
258
|
*/
|
|
81
|
-
export declare function collectBuildSymbols(basePath: string, options: Object): Object;
|
|
259
|
+
export declare function collectBuildSymbols(basePath: string, options: Object, fileMaps?: Array<string>): Object;
|
|
82
260
|
/**
|
|
83
|
-
* Method to parse output file map to identify the module
|
|
84
|
-
*
|
|
261
|
+
* Method to parse output file map to identify the module, its sources, and
|
|
262
|
+
* their symbols. The symbol list is imprecise; the sources are exact.
|
|
263
|
+
*
|
|
264
|
+
* The module name is derived from the containing directory for llbuild maps
|
|
265
|
+
* (`<Module>.build` and, since Swift 6.4, `<Module>-tool.build`) and from the
|
|
266
|
+
* file name for Swift Build maps (`<target>-OutputFileMap.json`, where the
|
|
267
|
+
* target name still needs to be sanitised into a module name).
|
|
85
268
|
*
|
|
86
269
|
* @param filemap {String} File name
|
|
87
|
-
* @returns {Object} parsed module metadata
|
|
270
|
+
* @returns {Object} parsed module metadata `{ moduleName, moduleSymbols, sourceFiles }`
|
|
88
271
|
*/
|
|
89
272
|
export declare function parseOutputFileMap(filemap: string): Object;
|
|
273
|
+
/**
|
|
274
|
+
* Parse `.build/workspace-state.json` into the dependency packages of the
|
|
275
|
+
* workspace and the directory each one was materialised in.
|
|
276
|
+
*
|
|
277
|
+
* @param {Object} stateJson Parsed workspace-state.json
|
|
278
|
+
* @param {String} basePath Root package directory
|
|
279
|
+
* @returns {Array<Object>} `{ identity, name, location, kind, dir }` per package
|
|
280
|
+
*/
|
|
281
|
+
export declare function parseSwiftWorkspaceState(stateJson: Object, basePath: string): Array<Object>;
|
|
282
|
+
/**
|
|
283
|
+
* Parse the Swift Build engine's project model (`.build/manifest.pif`) into
|
|
284
|
+
* the module names each package declares.
|
|
285
|
+
*
|
|
286
|
+
* The manifest is a list of workspace, project, and target objects linked
|
|
287
|
+
* through their `signature` hashes. A project's guid is `PACKAGE:<identity>`
|
|
288
|
+
* and each target records its `PRODUCT_MODULE_NAME`. Unlike the verbose
|
|
289
|
+
* build output, the manifest lists modules whose compilation never started,
|
|
290
|
+
* which keeps the module-to-package mapping complete when a build fails.
|
|
291
|
+
*
|
|
292
|
+
* @param {Array} manifestJson Parsed manifest.pif contents
|
|
293
|
+
* @returns {Object} Map of package identity to module names
|
|
294
|
+
*/
|
|
295
|
+
export declare function parseSwiftBuildManifest(manifestJson: any[]): Object;
|
|
296
|
+
/**
|
|
297
|
+
* Collect the modules imported by a Swift source file, with their lines.
|
|
298
|
+
*
|
|
299
|
+
* Declarations such as `@testable import Foo`, `public import Foo`,
|
|
300
|
+
* `@_implementationOnly import cmark_gfm`, and `import struct Foo.Bar` are
|
|
301
|
+
* recognised; comments, string literals, and `canImport` conditions are not
|
|
302
|
+
* imports.
|
|
303
|
+
*
|
|
304
|
+
* @param {String} sourceText Swift source
|
|
305
|
+
* @returns {Array<Object>} `{ module, line }` per import declaration
|
|
306
|
+
*/
|
|
307
|
+
export declare function parseSwiftImports(sourceText: string): Array<Object>;
|
|
308
|
+
/**
|
|
309
|
+
* Collect the clang module names declared at the top level of a module map.
|
|
310
|
+
*
|
|
311
|
+
* @param {String} moduleMapText module.modulemap contents
|
|
312
|
+
* @returns {Object} `{ modules, headerPaths }`
|
|
313
|
+
*/
|
|
314
|
+
export declare function parseClangModuleMap(moduleMapText: string): Object;
|
|
315
|
+
/**
|
|
316
|
+
* Build a description of every module in a completed swift build: its
|
|
317
|
+
* compiler arguments, sources, and owning package.
|
|
318
|
+
*
|
|
319
|
+
* Arguments come from the llbuild build description when present and from
|
|
320
|
+
* the verbose build output otherwise (the only source for the Swift Build
|
|
321
|
+
* engine); sources come from the same places or from the output file maps.
|
|
322
|
+
* Packages come from `workspace-state.json`, and every module is attributed
|
|
323
|
+
* to the package whose directory holds its sources. Clang modules are
|
|
324
|
+
* discovered through their module maps.
|
|
325
|
+
*
|
|
326
|
+
* @param {String} basePath Root package directory
|
|
327
|
+
* @param {String} buildOutput Verbose build output
|
|
328
|
+
* @param {Object} options CLI options
|
|
329
|
+
* @param {Object} [rootMetadata] Parsed dump-package of the root package
|
|
330
|
+
* @returns {Object} `{ modules, packages, root, clangModules, fileMaps }`
|
|
331
|
+
*/
|
|
332
|
+
export declare function collectSwiftBuildPlan(basePath: string, buildOutput: string, options: Object, rootMetadata?: Object): Object;
|
|
333
|
+
/**
|
|
334
|
+
* Check that sourcekitten can load SourceKit, with a trivial syntax request.
|
|
335
|
+
*
|
|
336
|
+
* A missing binary, a binary without its Swift runtime (`error while loading
|
|
337
|
+
* shared libraries: libswiftCore.so`), or one linked against a different
|
|
338
|
+
* Swift runtime than the toolchain provides (Linux has no stable Swift ABI, so
|
|
339
|
+
* such a binary crashes inside libswiftCore) fails every request; the probe
|
|
340
|
+
* turns that into one clear message instead of silent empty results.
|
|
341
|
+
*
|
|
342
|
+
* @param {Object} [env] Environment overrides for sourcekitten
|
|
343
|
+
* @returns {boolean} `true` when sourcekitten answered the probe
|
|
344
|
+
*/
|
|
345
|
+
export declare function isSourcekittenUsable(env?: Object): boolean;
|
|
90
346
|
/**
|
|
91
347
|
* Create a precise semantics slices file for a swift project.
|
|
92
348
|
*
|
|
349
|
+
* The project is built once in verbose mode. Every source file of the root
|
|
350
|
+
* package's (non-test) modules is then indexed with sourcekitten using that
|
|
351
|
+
* module's own compiler arguments and source list, with sourcekitten aligned
|
|
352
|
+
* to the toolchain that compiled the project. The declaring module of every
|
|
353
|
+
* resolved reference is recovered from its USR, which attributes each usage
|
|
354
|
+
* to the package that provides the module (`moduleReferences`).
|
|
355
|
+
*
|
|
93
356
|
* @param basePath basePath Path
|
|
94
357
|
* @param options options CLI options
|
|
95
358
|
*/
|
|
96
359
|
export declare function createSemanticsSlices(basePath: any, options: any): {
|
|
360
|
+
projectPath: any;
|
|
361
|
+
toolchain: any;
|
|
97
362
|
packageMetadata: Object | undefined;
|
|
363
|
+
packages: any;
|
|
364
|
+
packageModules: {};
|
|
98
365
|
buildSymbols: Object;
|
|
99
|
-
moduleInfos: {};
|
|
100
|
-
fileStructures: {};
|
|
101
366
|
fileIndexes: {};
|
|
102
367
|
} | undefined;
|
|
103
368
|
//# sourceMappingURL=swiftsem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swiftsem.d.ts","sourceRoot":"","sources":["../../../lib/evinser/swiftsem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"swiftsem.d.ts","sourceRoot":"","sources":["../../../lib/evinser/swiftsem.js"],"names":[],"mappings":"AAoGA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,QAAA,UAEhC;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,QAAA,GAFrC,OAAO,CAYnB;AAmBD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAHpC,MAGoC,GAFlC,SAAS,GAAC,MAAM,CAqB5B;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,QAAA,GAFjC,SAAS,GAAC,MAAM,CAkB5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EALA,MAKA,EACT,QAAQ,AALP,CACA,QAI0B,GAJhB,SAAS,GAAC,MAAM,CA4C5B;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,QAAQ,QAAA,EAAE,GAAG,AAJvC,CAEA,EAFQ,MAI+B,GAF7B,SAAS,GAAC,MAAM,CAI5B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAHjC,MAGiC,GAF/B,MAAM,GAAC,SAAS,CAiB5B;AAqCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,QAAA,EACb,QAAQ,AALP,CACA,QAI0B,GAJhB,KAAK,QAAQ,CAgEzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,QAAA,GAFxB,SAAS,SAAO,CAW5B;AAmED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAHnC,KAAK,QAG8B,GAFjC,KAAK,QAAQ,CA2EzB;AAwBD;;;;;;;;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KAAA,EAAE,OAAO,KAAA;;;;;;;;cA2LtD"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The purl type used for installed agentic CLI tools. These tools ship as
|
|
3
|
+
* self-contained executables rather than as a resolvable source package, so a
|
|
4
|
+
* `pkg:generic/...` identifier is the honest representation.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AGENTIC_TOOL_PURL_TYPE = "generic";
|
|
7
|
+
/**
|
|
8
|
+
* Rewrite an absolute path under the user's home directory to a `~`-relative
|
|
9
|
+
* form so the emitted BOM does not carry the local username.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} filePath Absolute path
|
|
12
|
+
* @returns {string} Home-relative path when applicable, else the input
|
|
13
|
+
*/
|
|
14
|
+
export declare function redactHomePath(filePath: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Describe where each supported agentic CLI tool stores its per-user state.
|
|
17
|
+
*
|
|
18
|
+
* Each entry lists the tool key, a display name, and the candidate home
|
|
19
|
+
* directories per platform (mirroring how `getIdeExtensionDirs` models IDE
|
|
20
|
+
* extension locations). Only the current platform's directories plus
|
|
21
|
+
* always-present dot-directories are included.
|
|
22
|
+
*
|
|
23
|
+
* @returns {Array<{tool: string, name: string, dirs: string[], supportDirs?: string[]}>}
|
|
24
|
+
* One entry per known agentic CLI tool.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getAgenticToolDirs(): Array<{
|
|
27
|
+
tool: string;
|
|
28
|
+
name: string;
|
|
29
|
+
dirs: string[];
|
|
30
|
+
supportDirs?: string[];
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Discover which agentic CLI tools are installed for the current user by
|
|
34
|
+
* checking their known home directories.
|
|
35
|
+
*
|
|
36
|
+
* @returns {Array<{tool: string, name: string, dir: string, supportDir?: string}>}
|
|
37
|
+
* One entry per discovered tool, using the first existing directory.
|
|
38
|
+
*/
|
|
39
|
+
export declare function discoverAgenticTools(): Array<{
|
|
40
|
+
tool: string;
|
|
41
|
+
name: string;
|
|
42
|
+
dir: string;
|
|
43
|
+
supportDir?: string;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Compute safe, redacted signal counts for a discovered tool. Only structural
|
|
47
|
+
* counts and small enumerated values are returned; no credential, transcript,
|
|
48
|
+
* or telemetry content is read.
|
|
49
|
+
*
|
|
50
|
+
* @param {string} tool Tool key
|
|
51
|
+
* @param {string} dir Discovered tool home directory
|
|
52
|
+
* @param {string} [supportDir] Optional platform support directory
|
|
53
|
+
* @returns {Object} Map of signal name to count/boolean/small-string value
|
|
54
|
+
*/
|
|
55
|
+
export declare function collectToolSignals(tool: string, dir: string, supportDir?: string): Object;
|
|
56
|
+
/**
|
|
57
|
+
* Build a CycloneDX application component for one discovered agentic tool.
|
|
58
|
+
*
|
|
59
|
+
* @param {{tool: string, name: string, dir: string, supportDir?: string}} entry
|
|
60
|
+
* Discovered tool entry
|
|
61
|
+
* @returns {Object} CycloneDX component
|
|
62
|
+
*/
|
|
63
|
+
export declare function componentForAgenticTool(entry: {
|
|
64
|
+
tool: string;
|
|
65
|
+
name: string;
|
|
66
|
+
dir: string;
|
|
67
|
+
supportDir?: string;
|
|
68
|
+
}): Object;
|
|
69
|
+
/**
|
|
70
|
+
* Discover installed agentic CLI tools on the current host and return CycloneDX
|
|
71
|
+
* components describing each one, plus the child agents, plugins, and providers
|
|
72
|
+
* they define and the dependency edges linking children to their tool.
|
|
73
|
+
*
|
|
74
|
+
* This host scan is unconditional: it does not consult scan filters such as
|
|
75
|
+
* `--exclude` or profile/technique options, because it inventories fixed tool
|
|
76
|
+
* home directories rather than a project tree. The `options` argument is
|
|
77
|
+
* accepted for signature parity and is intentionally not used to alter results.
|
|
78
|
+
*
|
|
79
|
+
* @param {Object} [options={}] Collection options (accepted but not applied)
|
|
80
|
+
* @returns {{components: Object[], services: Object[], dependencies: Object[]}} Discovered inventory
|
|
81
|
+
*/
|
|
82
|
+
export declare function collectAgenticTools(_options?: {}): {
|
|
83
|
+
components: Object[];
|
|
84
|
+
services: Object[];
|
|
85
|
+
dependencies: Object[];
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=agenticToolutils.d.ts.map
|