cognium-dev 3.202.0 → 3.203.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 (2) hide show
  1. package/dist/cli.js +112 -11
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -45953,6 +45953,19 @@ function parseNpmDependencies(packageJson) {
45953
45953
  }
45954
45954
  return out2;
45955
45955
  }
45956
+ function parsePep508(spec) {
45957
+ let s = spec.trim();
45958
+ s = s.split(";")[0].trim();
45959
+ if (!s)
45960
+ return null;
45961
+ const m = s.match(/^([A-Za-z0-9._-]+)\s*(?:\[[^\]]*\])?\s*(.*)$/);
45962
+ if (!m)
45963
+ return null;
45964
+ const rest = m[2].trim();
45965
+ const verMatch = rest.replace(/^\(/, "").match(/^(?:==|>=|<=|~=|!=|>|<|===)?\s*([^,\s)]+)/);
45966
+ const version = verMatch && verMatch[1] ? verMatch[1] : "unknown";
45967
+ return { name: m[1], version };
45968
+ }
45956
45969
  function parsePypiDependencies(requirementsTxt) {
45957
45970
  if (!requirementsTxt)
45958
45971
  return [];
@@ -45964,17 +45977,101 @@ function parsePypiDependencies(requirementsTxt) {
45964
45977
  if (line.startsWith("-") || /^[a-z]+:\/\//i.test(line))
45965
45978
  continue;
45966
45979
  line = line.split("#")[0].trim();
45967
- line = line.split(";")[0].trim();
45968
45980
  if (!line)
45969
45981
  continue;
45970
- const m = line.match(/^([A-Za-z0-9._-]+)\s*(?:\[[^\]]*\])?\s*(.*)$/);
45971
- if (!m)
45982
+ const parsed = parsePep508(line);
45983
+ if (parsed)
45984
+ out2.push(dep("pypi", parsed.name, parsed.version, "required"));
45985
+ }
45986
+ return out2;
45987
+ }
45988
+ function parsePyprojectDependencies(pyprojectToml) {
45989
+ if (!pyprojectToml)
45990
+ return [];
45991
+ const out2 = [];
45992
+ const lines = pyprojectToml.split(/\r?\n/);
45993
+ let table = "";
45994
+ let poetryScope = null;
45995
+ let inArray = false;
45996
+ let arrayScope = "required";
45997
+ const pushReq = (raw, scope) => {
45998
+ const cleaned = raw.trim().replace(/^["']|["'],?$/g, "").replace(/,$/, "").trim();
45999
+ if (!cleaned)
46000
+ return;
46001
+ const parsed = parsePep508(cleaned);
46002
+ if (parsed && parsed.name.toLowerCase() !== "python")
46003
+ out2.push(dep("pypi", parsed.name, parsed.version, scope));
46004
+ };
46005
+ for (const raw of lines) {
46006
+ const line = raw.trim();
46007
+ if (!line || line.startsWith("#"))
45972
46008
  continue;
45973
- const name2 = m[1];
45974
- const rest = m[2].trim();
45975
- const verMatch = rest.match(/^(?:==|>=|<=|~=|!=|>|<|===)?\s*([^,\s]+)/);
45976
- const version = verMatch && verMatch[1] ? verMatch[1] : "unknown";
45977
- out2.push(dep("pypi", name2, version, "required"));
46009
+ if (inArray) {
46010
+ if (line.startsWith("]")) {
46011
+ inArray = false;
46012
+ continue;
46013
+ }
46014
+ pushReq(line, arrayScope);
46015
+ continue;
46016
+ }
46017
+ const header = line.match(/^\[([^\]]+)\]$/);
46018
+ if (header) {
46019
+ table = header[1];
46020
+ if (table === "tool.poetry.dependencies")
46021
+ poetryScope = "required";
46022
+ else if (/^tool\.poetry\.(dev-dependencies|group\..+\.dependencies)$/.test(table))
46023
+ poetryScope = "dev";
46024
+ else
46025
+ poetryScope = null;
46026
+ continue;
46027
+ }
46028
+ const arrayOpen = line.match(/^(dependencies|[A-Za-z0-9._-]+)\s*=\s*\[(.*)$/);
46029
+ if (arrayOpen && (arrayOpen[1] === "dependencies" || table === "project.optional-dependencies")) {
46030
+ arrayScope = arrayOpen[1] === "dependencies" ? "required" : "optional";
46031
+ const inline = arrayOpen[2];
46032
+ if (inline.includes("]")) {
46033
+ for (const item of inline.slice(0, inline.indexOf("]")).split(","))
46034
+ pushReq(item, arrayScope);
46035
+ } else {
46036
+ inArray = true;
46037
+ if (inline.trim())
46038
+ pushReq(inline, arrayScope);
46039
+ }
46040
+ continue;
46041
+ }
46042
+ if (poetryScope) {
46043
+ const kv = line.match(/^([A-Za-z0-9._-]+)\s*=\s*(.+)$/);
46044
+ if (!kv || kv[1].toLowerCase() === "python")
46045
+ continue;
46046
+ let version = "unknown";
46047
+ const strv = kv[2].match(/^["']([^"']+)["']/);
46048
+ if (strv)
46049
+ version = strv[1];
46050
+ else {
46051
+ const inlinev = kv[2].match(/version\s*=\s*["']([^"']+)["']/);
46052
+ if (inlinev)
46053
+ version = inlinev[1];
46054
+ }
46055
+ out2.push(dep("pypi", kv[1], version, poetryScope));
46056
+ }
46057
+ }
46058
+ return out2;
46059
+ }
46060
+ function parseGradleDependencies(buildGradle) {
46061
+ if (!buildGradle)
46062
+ return [];
46063
+ const out2 = [];
46064
+ const re = /\b(implementation|api|compileOnly|compileOnlyApi|runtimeOnly|testImplementation|testCompileOnly|testRuntimeOnly|annotationProcessor|kapt|classpath)\s*[(\s]\s*['"]([\w.-]+:[\w.-]+(?::[\w.\-+]+)?)['"]/g;
46065
+ let m;
46066
+ while ((m = re.exec(buildGradle)) !== null) {
46067
+ const config = m[1];
46068
+ const coord = m[2].split(":");
46069
+ if (coord.length < 2)
46070
+ continue;
46071
+ const name2 = `${coord[0]}:${coord[1]}`;
46072
+ const version = coord[2] ?? "unknown";
46073
+ const scope = config.startsWith("test") ? "dev" : "required";
46074
+ out2.push(dep("maven", name2, version, scope));
45978
46075
  }
45979
46076
  return out2;
45980
46077
  }
@@ -46753,7 +46850,7 @@ var colors = {
46753
46850
  };
46754
46851
 
46755
46852
  // src/version.ts
46756
- var version = "3.202.0";
46853
+ var version = "3.203.0";
46757
46854
 
46758
46855
  // src/formatters.ts
46759
46856
  var LIBRARY_API_SURFACE_TAG2 = "library-api-surface:caller-responsibility";
@@ -47411,7 +47508,8 @@ SBOM OPTIONS:
47411
47508
  --prod-only Exclude dev/test dependencies
47412
47509
  --deterministic Omit timestamp / serialNumber / namespace for reproducible output
47413
47510
  -o, --output <file> Write the document to a file (default: stdout)
47414
- Discovers package.json / requirements.txt / pom.xml / Cargo.toml / go.mod.
47511
+ Discovers package.json / requirements.txt / pyproject.toml /
47512
+ pom.xml / build.gradle(.kts) / Cargo.toml / go.mod.
47415
47513
  CVE matching is out of scope (deterministic SAST — no network).
47416
47514
 
47417
47515
  EXAMPLES:
@@ -48452,7 +48550,10 @@ function parseCrossFileBudgetMs(raw) {
48452
48550
  var SBOM_MANIFESTS = {
48453
48551
  "package.json": parseNpmDependencies,
48454
48552
  "requirements.txt": parsePypiDependencies,
48553
+ "pyproject.toml": parsePyprojectDependencies,
48455
48554
  "pom.xml": parseMavenDependencies,
48555
+ "build.gradle": parseGradleDependencies,
48556
+ "build.gradle.kts": parseGradleDependencies,
48456
48557
  "Cargo.toml": parseCargoDependencies,
48457
48558
  "go.mod": parseGoDependencies
48458
48559
  };
@@ -48489,7 +48590,7 @@ async function runSbom(targetPath, options) {
48489
48590
  }
48490
48591
  const manifests = await collectManifestFiles(absPath);
48491
48592
  if (manifests.length === 0) {
48492
- console.error(colors.red("Error: no supported manifests found (package.json, requirements.txt, pom.xml, Cargo.toml, go.mod)"));
48593
+ console.error(colors.red("Error: no supported manifests found (package.json, requirements.txt, pyproject.toml, pom.xml, build.gradle, Cargo.toml, go.mod)"));
48493
48594
  process.exit(1);
48494
48595
  }
48495
48596
  let deps = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cognium-dev",
3
- "version": "3.202.0",
3
+ "version": "3.203.0",
4
4
  "description": "Static Application Security Testing CLI for detecting security vulnerabilities via taint tracking",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@cognium/project-profile-detect": "^1.1.0",
69
- "circle-ir": "^3.202.0"
69
+ "circle-ir": "^3.203.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/node": "^25.5.0",