sentinello 3.3.1 → 3.3.2

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.cjs +49 -9
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -13153,8 +13153,8 @@ function isSourceUnavailableReason(code) {
13153
13153
  }
13154
13154
 
13155
13155
  // ../../packages/core/src/advisory-rows.ts
13156
- var OSV_NORMALIZER_VERSION = 4;
13157
- var GEMNASIUM_NORMALIZER_VERSION = 5;
13156
+ var OSV_NORMALIZER_VERSION = 5;
13157
+ var GEMNASIUM_NORMALIZER_VERSION = 6;
13158
13158
 
13159
13159
  // ../../packages/core/src/advisory-export.ts
13160
13160
  var DEFAULT_EXPORT_PROMPT = `You are helping a development team triage and fix the vulnerabilities listed at the bottom of this document. Treat this as a remediation work list, not a checklist to rubber-stamp. Work in a planning posture from the start: if your tooling has a read-only planning mode (Claude Code's plan mode, for example), enter it now and stay in it until the human has approved the triage below. Nothing in this document authorises you to edit a file before then.
@@ -13468,7 +13468,7 @@ function aboveLowerBound(installed, range, comparator) {
13468
13468
  }
13469
13469
 
13470
13470
  // ../../packages/versions/src/compare.ts
13471
- __toESM(require_semver2());
13471
+ var import_semver2 = __toESM(require_semver2());
13472
13472
 
13473
13473
  // ../../packages/versions/src/comparators/semver.ts
13474
13474
  var import_semver = __toESM(require_semver2());
@@ -13498,6 +13498,26 @@ var semverComparator = {
13498
13498
  }
13499
13499
  };
13500
13500
 
13501
+ // ../../packages/versions/src/compare.ts
13502
+ function compareVersions(a, b) {
13503
+ const left = normalizeSemver(a);
13504
+ const right = normalizeSemver(b);
13505
+ if (left === null || right === null) {
13506
+ if (left === null && right === null) return a < b ? -1 : a > b ? 1 : 0;
13507
+ return left === null ? -1 : 1;
13508
+ }
13509
+ if ((0, import_semver2.lt)(left, right)) return -1;
13510
+ if ((0, import_semver2.gt)(left, right)) return 1;
13511
+ return 0;
13512
+ }
13513
+ function highestVersion(versions) {
13514
+ let best = null;
13515
+ for (const candidate of versions) {
13516
+ if (best === null || compareVersions(candidate, best) > 0) best = candidate;
13517
+ }
13518
+ return best;
13519
+ }
13520
+
13501
13521
  // ../../packages/versions/src/comparators/pep440.ts
13502
13522
  var PRE_RANK = { a: 0, b: 1, rc: 2 };
13503
13523
  var PEP440_RE = new RegExp(
@@ -33535,7 +33555,7 @@ function normalizeOsvRecord(record2, ecosystem) {
33535
33555
  if (!pkg2 || pkg2.ecosystem !== ecosystem) continue;
33536
33556
  const packageName = typeof pkg2.name === "string" ? pkg2.name : null;
33537
33557
  if (!packageName) continue;
33538
- const ranges = extractRanges(affected.ranges);
33558
+ const ranges = extractRanges(affected.ranges, affected.database_specific?.last_known_affected_version_range);
33539
33559
  const versions = extractVersions(affected.versions);
33540
33560
  const existing = byPackage.get(packageName);
33541
33561
  if (existing) {
@@ -33571,7 +33591,7 @@ function extractVersions(versions) {
33571
33591
  }
33572
33592
  return out;
33573
33593
  }
33574
- function extractRanges(ranges) {
33594
+ function extractRanges(ranges, lastKnownAffected) {
33575
33595
  if (!Array.isArray(ranges)) return [];
33576
33596
  const out = [];
33577
33597
  for (const range of ranges) {
@@ -33603,6 +33623,20 @@ function extractRanges(ranges) {
33603
33623
  out.push({ type: type2, introduced, fixed: null, lastAffected });
33604
33624
  }
33605
33625
  }
33626
+ return boundOpenEndedRange(out, lastKnownAffected);
33627
+ }
33628
+ function boundOpenEndedRange(ranges, lastKnownAffected) {
33629
+ if (ranges.length !== 1 || typeof lastKnownAffected !== "string") return ranges;
33630
+ const text = lastKnownAffected.trim();
33631
+ const inclusive = text.startsWith("<=");
33632
+ if (!inclusive && !text.startsWith("<")) return ranges;
33633
+ const version2 = text.slice(inclusive ? 2 : 1).trim();
33634
+ if (version2.length === 0 || /[\s,|]/.test(version2)) return ranges;
33635
+ const out = [];
33636
+ for (const range of ranges) {
33637
+ const open = range.fixed === null && range.lastAffected === null;
33638
+ out.push(open ? { ...range, fixed: inclusive ? null : version2, lastAffected: inclusive ? version2 : null } : range);
33639
+ }
33606
33640
  return out;
33607
33641
  }
33608
33642
  function pickSeverity2(r) {
@@ -33911,7 +33945,13 @@ function parseAffectedRange(affectedRange, fixedVersions) {
33911
33945
  if (ranges.length === 1 && versions.length === 0 && only && fixedVersions.length === 1 && authoritativeFixed !== void 0) {
33912
33946
  ranges[0] = toRange(only.introduced, only.introducedExclusive === true, authoritativeFixed, null);
33913
33947
  }
33914
- return { ranges, versions };
33948
+ const highestFixed = highestVersion(fixedVersions);
33949
+ const bounded = [];
33950
+ for (const range of ranges) {
33951
+ const openEnded = range.fixed === null && range.lastAffected === null;
33952
+ bounded.push(highestFixed !== null && openEnded && compareVersions(highestFixed, range.introduced) > 0 ? toRange(range.introduced, range.introducedExclusive === true, highestFixed, null) : range);
33953
+ }
33954
+ return { ranges: bounded, versions };
33915
33955
  }
33916
33956
  function toRange(introduced, introducedExclusive, fixed, lastAffected) {
33917
33957
  const range = { introduced, fixed, lastAffected };
@@ -33955,7 +33995,7 @@ function parseIntervalNotation(disjunct) {
33955
33995
  };
33956
33996
  }
33957
33997
  function parseComparatorForm(disjunct) {
33958
- const tokens = disjunct.split(/\s+/).filter(nonEmpty);
33998
+ const tokens = disjunct.split(/[\s,]+/).filter(nonEmpty);
33959
33999
  if (tokens.length === 0) return null;
33960
34000
  let introduced = "0";
33961
34001
  let introducedExclusive = false;
@@ -35535,8 +35575,8 @@ function createUi(options) {
35535
35575
 
35536
35576
  // src/help.ts
35537
35577
  var CLI_VERSION = (function resolveVersion() {
35538
- if ("3.3.1".length > 0) {
35539
- return "3.3.1";
35578
+ if ("3.3.2".length > 0) {
35579
+ return "3.3.2";
35540
35580
  }
35541
35581
  const fromEnv = process.env.SENTINELLO_VERSION;
35542
35582
  if (fromEnv && fromEnv.trim().length > 0) return fromEnv.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sentinello",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "license": "MIT",
5
5
  "description": "Scan the projects in a folder for vulnerable dependencies and write an advisory an agent can act on.",
6
6
  "keywords": [