@socketsecurity/cli-with-sentry 1.1.40 → 1.1.42

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/CHANGELOG.md CHANGED
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [1.1.42](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.42) - 2025-12-04
8
+
9
+ ### Added
10
+ - Added `--ecosystems` flag to `socket fix`.
11
+
12
+ ### Changed
13
+ - Updated the Coana CLI to v `14.12.113`.
14
+ - Rename `--limit` flag to `--pr-limit` for `socket fix`, but keep old flag as an alias. Note: `--pr-limit` has no effect in local mode, use `--id` options instead.
15
+ - Process all vulnerabilities with `socket fix` when no `--id` options are provided.
16
+
17
+ ## [1.1.41](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.41) - 2025-12-02
18
+
19
+ ### Added
20
+ - Added `--reach-version` flag to `socket scan create` and `socket scan reach` to override the @coana-tech/cli version used for reachability analysis.
21
+ - Added `--fix-version` flag to `socket fix` to override the @coana-tech/cli version used for fix analysis.
22
+
7
23
  ## [1.1.40](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.40) - 2025-12-02
8
24
 
9
25
  ### Fixed
package/dist/cli.js CHANGED
@@ -446,7 +446,7 @@ async function run$S(argv, importMeta, {
446
446
  fail: 'bad'
447
447
  }, {
448
448
  nook: true,
449
- test: hasApiToken,
449
+ test: dryRun || hasApiToken,
450
450
  message: 'This command requires a Socket API token for access',
451
451
  fail: 'try `socket login`'
452
452
  });
@@ -850,7 +850,7 @@ async function run$R(argv, importMeta, {
850
850
  fail: 'missing'
851
851
  }, {
852
852
  nook: true,
853
- test: hasApiToken,
853
+ test: dryRun || hasApiToken,
854
854
  message: 'This command requires a Socket API token for access',
855
855
  fail: 'try `socket login`'
856
856
  }, {
@@ -1658,6 +1658,7 @@ async function performReachabilityAnalysis(options) {
1658
1658
 
1659
1659
  // Run Coana with the manifests tar hash.
1660
1660
  const coanaResult = await utils.spawnCoanaDlx(coanaArgs, orgSlug, {
1661
+ coanaVersion: reachabilityOptions.reachVersion,
1661
1662
  cwd,
1662
1663
  env: coanaEnv,
1663
1664
  spinner,
@@ -2380,15 +2381,16 @@ async function handleCi(autoManifest) {
2380
2381
  pendingHead: true,
2381
2382
  pullRequest: 0,
2382
2383
  reach: {
2383
- reachAnalysisTimeout: 0,
2384
2384
  reachAnalysisMemoryLimit: 0,
2385
+ reachAnalysisTimeout: 0,
2385
2386
  reachConcurrency: 1,
2386
2387
  reachDebug: false,
2387
- reachDisableAnalytics: false,
2388
2388
  reachDisableAnalysisSplitting: false,
2389
+ reachDisableAnalytics: false,
2389
2390
  reachEcosystems: [],
2390
2391
  reachExcludePaths: [],
2391
2392
  reachSkipCache: false,
2393
+ reachVersion: undefined,
2392
2394
  runReachabilityAnalysis: false
2393
2395
  },
2394
2396
  repoName,
@@ -3692,28 +3694,27 @@ async function getFixEnv() {
3692
3694
  async function discoverGhsaIds(orgSlug, tarHash, options) {
3693
3695
  const {
3694
3696
  cwd = process.cwd(),
3695
- limit,
3697
+ ecosystems,
3696
3698
  spinner
3697
3699
  } = {
3698
3700
  __proto__: null,
3699
3701
  ...options
3700
3702
  };
3701
- const foundCResult = await utils.spawnCoanaDlx(['find-vulnerabilities', cwd, '--manifests-tar-hash', tarHash], orgSlug, {
3703
+ const foundCResult = await utils.spawnCoanaDlx(['find-vulnerabilities', cwd, '--manifests-tar-hash', tarHash, ...(ecosystems?.length ? ['--purl-types', ...ecosystems] : [])], orgSlug, {
3702
3704
  cwd,
3703
- spinner
3705
+ spinner,
3706
+ coanaVersion: options?.coanaVersion
3704
3707
  }, {
3705
3708
  stdio: 'pipe'
3706
3709
  });
3707
3710
  if (foundCResult.ok) {
3708
- // Coana prints ghsaIds as json-formatted string on the final line of the output
3709
- const foundIds = [];
3710
3711
  try {
3712
+ // Coana prints ghsaIds as json-formatted string on the final line of the output.
3711
3713
  const ghsaIdsRaw = foundCResult.data.trim().split('\n').pop();
3712
3714
  if (ghsaIdsRaw) {
3713
- foundIds.push(...JSON.parse(ghsaIdsRaw));
3715
+ return JSON.parse(ghsaIdsRaw);
3714
3716
  }
3715
3717
  } catch {}
3716
- return limit !== undefined ? foundIds.slice(0, limit) : foundIds;
3717
3718
  }
3718
3719
  return [];
3719
3720
  }
@@ -3721,15 +3722,17 @@ async function coanaFix(fixConfig) {
3721
3722
  const {
3722
3723
  applyFixes,
3723
3724
  autopilot,
3725
+ coanaVersion,
3724
3726
  cwd,
3725
3727
  disableMajorUpdates,
3728
+ ecosystems,
3726
3729
  exclude,
3727
3730
  ghsas,
3728
3731
  include,
3729
- limit,
3730
3732
  minimumReleaseAge,
3731
3733
  orgSlug,
3732
3734
  outputFile,
3735
+ prLimit,
3733
3736
  showAffectedDirectDependencies,
3734
3737
  spinner
3735
3738
  } = fixConfig;
@@ -3772,7 +3775,7 @@ async function coanaFix(fixConfig) {
3772
3775
  data: uploadCResult.data
3773
3776
  };
3774
3777
  }
3775
- const isAll = !ghsas.length || ghsas.length === 1 && (ghsas[0] === 'all' || ghsas[0] === 'auto');
3778
+ const shouldDiscoverGhsaIds = !ghsas.length;
3776
3779
  const shouldOpenPrs = fixEnv.isCi && fixEnv.repoInfo;
3777
3780
  if (!shouldOpenPrs) {
3778
3781
  // Inform user about local mode when fixes will be applied.
@@ -3788,19 +3791,15 @@ async function coanaFix(fixConfig) {
3788
3791
  logger.logger.info('Running in local mode - fixes will be applied directly to your working directory.\n' + getCiEnvInstructions());
3789
3792
  }
3790
3793
  }
3791
- let ids;
3792
- if (isAll && limit > 0) {
3793
- ids = await discoverGhsaIds(orgSlug, tarHash, {
3794
- cwd,
3795
- limit,
3796
- spinner
3797
- });
3798
- } else if (limit > 0) {
3799
- ids = ghsas.slice(0, limit);
3800
- } else {
3801
- ids = [];
3802
- }
3803
- if (limit < 1 || ids.length === 0) {
3794
+
3795
+ // In local mode, process all discovered/provided IDs (no limit).
3796
+ const ids = shouldDiscoverGhsaIds ? await discoverGhsaIds(orgSlug, tarHash, {
3797
+ coanaVersion,
3798
+ cwd,
3799
+ ecosystems,
3800
+ spinner
3801
+ }) : ghsas;
3802
+ if (ids.length === 0) {
3804
3803
  spinner?.stop();
3805
3804
  return {
3806
3805
  ok: true,
@@ -3814,7 +3813,8 @@ async function coanaFix(fixConfig) {
3814
3813
  const tmpDir = os.tmpdir();
3815
3814
  const tmpFile = path.join(tmpDir, `socket-fix-${Date.now()}.json`);
3816
3815
  try {
3817
- const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...ids, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(!applyFixes ? [constants.FLAG_DRY_RUN] : []), '--output-file', tmpFile, ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3816
+ const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...ids, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(ecosystems.length ? ['--purl-types', ...ecosystems] : []), ...(!applyFixes ? [constants.FLAG_DRY_RUN] : []), '--output-file', tmpFile, ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3817
+ coanaVersion,
3818
3818
  cwd,
3819
3819
  spinner,
3820
3820
  stdio: 'inherit'
@@ -3852,8 +3852,8 @@ async function coanaFix(fixConfig) {
3852
3852
  }
3853
3853
  }
3854
3854
 
3855
- // Adjust limit based on open Socket Fix PRs.
3856
- let adjustedLimit = limit;
3855
+ // Adjust PR limit based on open Socket Fix PRs.
3856
+ let adjustedPrLimit = prLimit;
3857
3857
  if (shouldOpenPrs && fixEnv.repoInfo) {
3858
3858
  try {
3859
3859
  const openPrs = await getSocketFixPrs(fixEnv.repoInfo.owner, fixEnv.repoInfo.repo, {
@@ -3861,25 +3861,24 @@ async function coanaFix(fixConfig) {
3861
3861
  });
3862
3862
  const openPrCount = openPrs.length;
3863
3863
  // Reduce limit by number of open PRs to avoid creating too many.
3864
- adjustedLimit = Math.max(0, limit - openPrCount);
3864
+ adjustedPrLimit = Math.max(0, prLimit - openPrCount);
3865
3865
  if (openPrCount > 0) {
3866
- require$$9.debugFn('notice', `limit: adjusted from ${limit} to ${adjustedLimit} (${openPrCount} open Socket Fix ${words.pluralize('PR', openPrCount)}`);
3866
+ require$$9.debugFn('notice', `prLimit: adjusted from ${prLimit} to ${adjustedPrLimit} (${openPrCount} open Socket Fix ${words.pluralize('PR', openPrCount)}`);
3867
3867
  }
3868
3868
  } catch (e) {
3869
3869
  require$$9.debugFn('warn', 'Failed to count open PRs, using original limit');
3870
3870
  require$$9.debugDir('error', e);
3871
3871
  }
3872
3872
  }
3873
- const shouldSpawnCoana = adjustedLimit > 0;
3873
+ const shouldSpawnCoana = adjustedPrLimit > 0;
3874
3874
  let ids;
3875
- if (shouldSpawnCoana && isAll) {
3876
- ids = await discoverGhsaIds(orgSlug, tarHash, {
3875
+ if (shouldSpawnCoana) {
3876
+ ids = (shouldDiscoverGhsaIds ? await discoverGhsaIds(orgSlug, tarHash, {
3877
+ coanaVersion,
3877
3878
  cwd,
3878
- limit: adjustedLimit,
3879
+ ecosystems,
3879
3880
  spinner
3880
- });
3881
- } else if (shouldSpawnCoana) {
3882
- ids = ghsas.slice(0, adjustedLimit);
3881
+ }) : ghsas).slice(0, adjustedPrLimit);
3883
3882
  }
3884
3883
  if (!ids?.length) {
3885
3884
  require$$9.debugFn('notice', 'miss: no GHSA IDs to process');
@@ -3912,7 +3911,8 @@ async function coanaFix(fixConfig) {
3912
3911
 
3913
3912
  // Apply fix for single GHSA ID.
3914
3913
  // eslint-disable-next-line no-await-in-loop
3915
- const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ghsaId, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3914
+ const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ghsaId, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(ecosystems.length ? ['--purl-types', ...ecosystems] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3915
+ coanaVersion,
3916
3916
  cwd,
3917
3917
  spinner,
3918
3918
  stdio: 'inherit'
@@ -4072,8 +4072,8 @@ async function coanaFix(fixConfig) {
4072
4072
  await utils.gitCheckoutBranch(fixEnv.baseBranch, cwd);
4073
4073
  }
4074
4074
  count += 1;
4075
- require$$9.debugFn('notice', `increment: count ${count}/${Math.min(adjustedLimit, ids.length)}`);
4076
- if (count >= adjustedLimit) {
4075
+ require$$9.debugFn('notice', `increment: count ${count}/${Math.min(adjustedPrLimit, ids.length)}`);
4076
+ if (count >= adjustedPrLimit) {
4077
4077
  break ghsaLoop;
4078
4078
  }
4079
4079
  }
@@ -4169,18 +4169,20 @@ async function convertIdsToGhsas(ids) {
4169
4169
  async function handleFix({
4170
4170
  applyFixes,
4171
4171
  autopilot,
4172
+ coanaVersion,
4172
4173
  cwd,
4173
4174
  disableMajorUpdates,
4175
+ ecosystems,
4174
4176
  exclude,
4175
4177
  ghsas,
4176
4178
  include,
4177
- limit,
4178
4179
  minSatisfying,
4179
4180
  minimumReleaseAge,
4180
4181
  orgSlug,
4181
4182
  outputFile,
4182
4183
  outputKind,
4183
4184
  prCheck,
4185
+ prLimit,
4184
4186
  rangeStyle,
4185
4187
  showAffectedDirectDependencies,
4186
4188
  spinner,
@@ -4190,17 +4192,19 @@ async function handleFix({
4190
4192
  require$$9.debugDir('inspect', {
4191
4193
  applyFixes,
4192
4194
  autopilot,
4195
+ coanaVersion,
4193
4196
  cwd,
4194
4197
  disableMajorUpdates,
4198
+ ecosystems,
4195
4199
  exclude,
4196
4200
  ghsas,
4197
4201
  include,
4198
- limit,
4199
4202
  minSatisfying,
4200
4203
  minimumReleaseAge,
4201
4204
  outputFile,
4202
4205
  outputKind,
4203
4206
  prCheck,
4207
+ prLimit,
4204
4208
  rangeStyle,
4205
4209
  showAffectedDirectDependencies,
4206
4210
  unknownFlags
@@ -4208,18 +4212,20 @@ async function handleFix({
4208
4212
  await outputFixResult(await coanaFix({
4209
4213
  applyFixes,
4210
4214
  autopilot,
4215
+ coanaVersion,
4211
4216
  cwd,
4212
4217
  disableMajorUpdates,
4218
+ ecosystems,
4213
4219
  exclude,
4214
4220
  // Convert mixed CVE/GHSA/PURL inputs to GHSA IDs only.
4215
4221
  ghsas: await convertIdsToGhsas(ghsas),
4216
4222
  include,
4217
- limit,
4218
4223
  minimumReleaseAge,
4219
4224
  minSatisfying,
4220
4225
  orgSlug,
4221
4226
  outputFile,
4222
4227
  prCheck,
4228
+ prLimit,
4223
4229
  rangeStyle,
4224
4230
  showAffectedDirectDependencies,
4225
4231
  spinner,
@@ -4242,6 +4248,10 @@ const generalFlags$2 = {
4242
4248
  default: false,
4243
4249
  description: `Enable auto-merge for pull requests that Socket opens.\nSee ${vendor.terminalLinkExports('GitHub documentation', 'https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository')} for managing auto-merge for pull requests in your repository.`
4244
4250
  },
4251
+ fixVersion: {
4252
+ type: 'string',
4253
+ description: `Override the version of @coana-tech/cli used for fix analysis. Default: ${constants.default.ENV.INLINED_SOCKET_CLI_COANA_TECH_CLI_VERSION}.`
4254
+ },
4245
4255
  applyFixes: {
4246
4256
  aliases: ['onlyCompute'],
4247
4257
  type: 'boolean',
@@ -4281,10 +4291,11 @@ const generalFlags$2 = {
4281
4291
  Can be provided as comma separated values or as multiple flags`,
4282
4292
  isMultiple: true
4283
4293
  },
4284
- limit: {
4294
+ prLimit: {
4295
+ aliases: ['limit'],
4285
4296
  type: 'number',
4286
4297
  default: DEFAULT_LIMIT,
4287
- description: `The number of fixes to attempt at a time (default ${DEFAULT_LIMIT})`
4298
+ description: `Maximum number of pull requests to create in CI mode (default ${DEFAULT_LIMIT}). Has no effect in local mode.`
4288
4299
  },
4289
4300
  rangeStyle: {
4290
4301
  type: 'string',
@@ -4306,6 +4317,12 @@ Available styles:
4306
4317
  default: '',
4307
4318
  description: 'Set a minimum age requirement for suggested upgrade versions (e.g., 1h, 2d, 3w). A higher age requirement reduces the risk of upgrading to malicious versions. For example, setting the value to 1 week (1w) gives ecosystem maintainers one week to remove potentially malicious versions.'
4308
4319
  },
4320
+ ecosystems: {
4321
+ type: 'string',
4322
+ default: [],
4323
+ description: 'Limit fix analysis to specific ecosystems. Can be provided as comma separated values or as multiple flags. Defaults to all ecosystems.',
4324
+ isMultiple: true
4325
+ },
4309
4326
  showAffectedDirectDependencies: {
4310
4327
  type: 'boolean',
4311
4328
  default: false,
@@ -4419,16 +4436,18 @@ async function run$K(argv, importMeta, {
4419
4436
  const {
4420
4437
  applyFixes,
4421
4438
  autopilot,
4439
+ ecosystems,
4422
4440
  exclude,
4441
+ fixVersion,
4423
4442
  include,
4424
4443
  json,
4425
- limit,
4426
4444
  majorUpdates,
4427
4445
  markdown,
4428
4446
  maxSatisfying,
4429
4447
  minimumReleaseAge,
4430
4448
  outputFile,
4431
4449
  prCheck,
4450
+ prLimit,
4432
4451
  rangeStyle,
4433
4452
  showAffectedDirectDependencies,
4434
4453
  // We patched in this feature with `npx custompatch meow` at
@@ -4439,6 +4458,21 @@ async function run$K(argv, importMeta, {
4439
4458
  const minSatisfying = cli.flags['minSatisfying'] || !maxSatisfying;
4440
4459
  const disableMajorUpdates = !majorUpdates;
4441
4460
  const outputKind = utils.getOutputKind(json, markdown);
4461
+
4462
+ // Process comma-separated values for ecosystems flag.
4463
+ const ecosystemsRaw = utils.cmdFlagValueToArray(ecosystems);
4464
+
4465
+ // Validate ecosystem values early, before dry-run check.
4466
+ const validatedEcosystems = [];
4467
+ const validEcosystemChoices = utils.getEcosystemChoicesForMeow();
4468
+ for (const ecosystem of ecosystemsRaw) {
4469
+ if (!validEcosystemChoices.includes(ecosystem)) {
4470
+ logger.logger.fail(`Invalid ecosystem: "${ecosystem}". Valid values are: ${arrays.joinAnd(validEcosystemChoices)}`);
4471
+ process.exitCode = 1;
4472
+ return;
4473
+ }
4474
+ validatedEcosystems.push(ecosystem);
4475
+ }
4442
4476
  const wasValidInput = utils.checkCommandInput(outputKind, {
4443
4477
  test: utils.RangeStyles.includes(rangeStyle),
4444
4478
  message: `Expecting range style of ${arrays.joinOr(utils.RangeStyles)}`,
@@ -4476,18 +4510,20 @@ async function run$K(argv, importMeta, {
4476
4510
  await handleFix({
4477
4511
  applyFixes,
4478
4512
  autopilot,
4513
+ coanaVersion: fixVersion,
4479
4514
  cwd,
4480
4515
  disableMajorUpdates,
4516
+ ecosystems: validatedEcosystems,
4481
4517
  exclude: excludePatterns,
4482
4518
  ghsas,
4483
4519
  include: includePatterns,
4484
- limit,
4485
4520
  minimumReleaseAge,
4486
4521
  minSatisfying,
4487
4522
  orgSlug,
4488
4523
  outputFile,
4489
4524
  outputKind,
4490
4525
  prCheck,
4526
+ prLimit,
4491
4527
  rangeStyle,
4492
4528
  showAffectedDirectDependencies,
4493
4529
  spinner,
@@ -8047,7 +8083,7 @@ async function run$t(argv, importMeta, {
8047
8083
  fail: 'bad'
8048
8084
  }, {
8049
8085
  nook: true,
8050
- test: hasApiToken,
8086
+ test: dryRun || hasApiToken,
8051
8087
  message: 'This command requires a Socket API token for access',
8052
8088
  fail: 'try `socket login`'
8053
8089
  });
@@ -8186,7 +8222,7 @@ async function run$s(argv, importMeta, {
8186
8222
  fail: 'omit one'
8187
8223
  }, {
8188
8224
  nook: true,
8189
- test: hasApiToken,
8225
+ test: dryRun || hasApiToken,
8190
8226
  message: 'This command requires a Socket API token for access',
8191
8227
  fail: 'try `socket login`'
8192
8228
  });
@@ -8322,7 +8358,7 @@ async function run$r(argv, importMeta, {
8322
8358
  fail: 'omit one'
8323
8359
  }, {
8324
8360
  nook: true,
8325
- test: hasApiToken,
8361
+ test: dryRun || hasApiToken,
8326
8362
  message: 'This command requires a Socket API token for access',
8327
8363
  fail: 'try `socket login`'
8328
8364
  });
@@ -8450,7 +8486,7 @@ async function run$q(argv, importMeta, {
8450
8486
  fail: 'bad'
8451
8487
  }, {
8452
8488
  nook: true,
8453
- test: hasApiToken,
8489
+ test: dryRun || hasApiToken,
8454
8490
  message: 'This command requires a Socket API token for access',
8455
8491
  fail: 'try `socket login`'
8456
8492
  });
@@ -8581,7 +8617,7 @@ async function run$p(argv, importMeta, {
8581
8617
  fail: 'omit one'
8582
8618
  }, {
8583
8619
  nook: true,
8584
- test: hasApiToken,
8620
+ test: dryRun || hasApiToken,
8585
8621
  message: 'This command requires a Socket API token for access',
8586
8622
  fail: 'try `socket login`'
8587
8623
  });
@@ -8950,7 +8986,7 @@ async function run$o(argv, importMeta, {
8950
8986
  fail: 'omit one'
8951
8987
  }, {
8952
8988
  nook: true,
8953
- test: hasApiToken,
8989
+ test: dryRun || hasApiToken,
8954
8990
  message: 'This command requires a Socket API token for access',
8955
8991
  fail: 'try `socket login`'
8956
8992
  });
@@ -10236,7 +10272,7 @@ async function run$i(argv, importMeta, {
10236
10272
  fail: 'missing'
10237
10273
  }, {
10238
10274
  nook: true,
10239
- test: hasApiToken,
10275
+ test: dryRun || hasApiToken,
10240
10276
  message: 'This command requires a Socket API token for access',
10241
10277
  fail: 'try `socket login`'
10242
10278
  });
@@ -10372,7 +10408,7 @@ async function run$h(argv, importMeta, {
10372
10408
  fail: 'missing'
10373
10409
  }, {
10374
10410
  nook: true,
10375
- test: hasApiToken,
10411
+ test: dryRun || hasApiToken,
10376
10412
  message: 'This command requires a Socket API token for access',
10377
10413
  fail: 'try `socket login`'
10378
10414
  });
@@ -10664,7 +10700,7 @@ async function run$g(argv, importMeta, {
10664
10700
  fail: 'bad'
10665
10701
  }, {
10666
10702
  nook: true,
10667
- test: hasApiToken,
10703
+ test: dryRun || hasApiToken,
10668
10704
  message: 'This command requires a Socket API token for access',
10669
10705
  fail: 'try `socket login`'
10670
10706
  }, {
@@ -10863,7 +10899,7 @@ async function run$f(argv, importMeta, {
10863
10899
  fail: 'missing'
10864
10900
  }, {
10865
10901
  nook: true,
10866
- test: hasApiToken,
10902
+ test: dryRun || hasApiToken,
10867
10903
  message: 'This command requires a Socket API token for access',
10868
10904
  fail: 'try `socket login`'
10869
10905
  });
@@ -11030,7 +11066,7 @@ async function run$e(argv, importMeta, {
11030
11066
  fail: 'bad'
11031
11067
  }, {
11032
11068
  nook: true,
11033
- test: hasApiToken,
11069
+ test: dryRun || hasApiToken,
11034
11070
  message: 'This command requires a Socket API token for access',
11035
11071
  fail: 'try `socket login`'
11036
11072
  });
@@ -11068,6 +11104,10 @@ const cmdRepository = {
11068
11104
  };
11069
11105
 
11070
11106
  const reachabilityFlags = {
11107
+ reachVersion: {
11108
+ type: 'string',
11109
+ description: `Override the version of @coana-tech/cli used for reachability analysis. Default: ${constants.default.ENV.INLINED_SOCKET_CLI_COANA_TECH_CLI_VERSION}.`
11110
+ },
11071
11111
  reachAnalysisMemoryLimit: {
11072
11112
  type: 'number',
11073
11113
  default: 8192,
@@ -11356,6 +11396,7 @@ async function run$d(argv, importMeta, {
11356
11396
  reachDisableAnalysisSplitting,
11357
11397
  reachDisableAnalytics,
11358
11398
  reachSkipCache,
11399
+ reachVersion,
11359
11400
  readOnly,
11360
11401
  reportLevel,
11361
11402
  setAsAlertsPage: pendingHeadFlag,
@@ -11483,7 +11524,8 @@ async function run$d(argv, importMeta, {
11483
11524
  const isUsingNonDefaultTimeout = reachAnalysisTimeout !== reachabilityFlags['reachAnalysisTimeout']?.default;
11484
11525
  const isUsingNonDefaultConcurrency = reachConcurrency !== reachabilityFlags['reachConcurrency']?.default;
11485
11526
  const isUsingNonDefaultAnalytics = reachDisableAnalytics !== reachabilityFlags['reachDisableAnalytics']?.default;
11486
- const isUsingAnyReachabilityFlags = isUsingNonDefaultMemoryLimit || isUsingNonDefaultTimeout || isUsingNonDefaultConcurrency || isUsingNonDefaultAnalytics || hasReachEcosystems || hasReachExcludePaths || reachSkipCache || reachDisableAnalysisSplitting;
11527
+ const isUsingNonDefaultVersion = reachVersion !== reachabilityFlags['reachVersion']?.default;
11528
+ const isUsingAnyReachabilityFlags = hasReachEcosystems || hasReachExcludePaths || isUsingNonDefaultAnalytics || isUsingNonDefaultConcurrency || isUsingNonDefaultMemoryLimit || isUsingNonDefaultTimeout || isUsingNonDefaultVersion || reachDisableAnalysisSplitting || reachSkipCache;
11487
11529
 
11488
11530
  // Validate target constraints when --reach is enabled.
11489
11531
  const reachTargetValidation = reach ? await validateReachabilityTarget(targets, cwd) : {
@@ -11508,7 +11550,7 @@ async function run$d(argv, importMeta, {
11508
11550
  fail: 'omit one'
11509
11551
  }, {
11510
11552
  nook: true,
11511
- test: hasApiToken,
11553
+ test: dryRun || hasApiToken,
11512
11554
  message: 'This command requires a Socket API token for access',
11513
11555
  fail: 'try `socket login`'
11514
11556
  }, {
@@ -11568,16 +11610,17 @@ async function run$d(argv, importMeta, {
11568
11610
  pendingHead: Boolean(pendingHead),
11569
11611
  pullRequest: Number(pullRequest),
11570
11612
  reach: {
11571
- runReachabilityAnalysis: Boolean(reach),
11572
- reachDisableAnalytics: Boolean(reachDisableAnalytics),
11573
- reachAnalysisTimeout: Number(reachAnalysisTimeout),
11574
11613
  reachAnalysisMemoryLimit: Number(reachAnalysisMemoryLimit),
11614
+ reachAnalysisTimeout: Number(reachAnalysisTimeout),
11575
11615
  reachConcurrency: Number(reachConcurrency),
11576
11616
  reachDebug: Boolean(reachDebug),
11577
11617
  reachDisableAnalysisSplitting: Boolean(reachDisableAnalysisSplitting),
11618
+ reachDisableAnalytics: Boolean(reachDisableAnalytics),
11578
11619
  reachEcosystems,
11579
11620
  reachExcludePaths,
11580
- reachSkipCache: Boolean(reachSkipCache)
11621
+ reachSkipCache: Boolean(reachSkipCache),
11622
+ reachVersion,
11623
+ runReachabilityAnalysis: Boolean(reach)
11581
11624
  },
11582
11625
  readOnly: Boolean(readOnly),
11583
11626
  repoName,
@@ -11696,7 +11739,7 @@ async function run$c(argv, importMeta, {
11696
11739
  fail: 'missing'
11697
11740
  }, {
11698
11741
  nook: true,
11699
- test: hasApiToken,
11742
+ test: dryRun || hasApiToken,
11700
11743
  message: 'This command requires a Socket API token for access',
11701
11744
  fail: 'try `socket login`'
11702
11745
  });
@@ -12010,7 +12053,7 @@ async function run$b(argv, importMeta, {
12010
12053
  fail: 'bad'
12011
12054
  }, {
12012
12055
  nook: true,
12013
- test: hasApiToken,
12056
+ test: dryRun || hasApiToken,
12014
12057
  message: 'This command requires a Socket API token for access',
12015
12058
  fail: 'try `socket login`'
12016
12059
  });
@@ -12216,16 +12259,17 @@ async function scanOneRepo(repoSlug, {
12216
12259
  pendingHead: true,
12217
12260
  pullRequest: 0,
12218
12261
  reach: {
12219
- runReachabilityAnalysis: false,
12220
- reachDisableAnalytics: false,
12221
- reachAnalysisTimeout: 0,
12222
12262
  reachAnalysisMemoryLimit: 0,
12263
+ reachAnalysisTimeout: 0,
12223
12264
  reachConcurrency: 1,
12224
12265
  reachDebug: false,
12225
12266
  reachDisableAnalysisSplitting: false,
12267
+ reachDisableAnalytics: false,
12226
12268
  reachEcosystems: [],
12227
12269
  reachExcludePaths: [],
12228
- reachSkipCache: false
12270
+ reachSkipCache: false,
12271
+ reachVersion: undefined,
12272
+ runReachabilityAnalysis: false
12229
12273
  },
12230
12274
  readOnly: false,
12231
12275
  repoName: repoSlug,
@@ -12902,11 +12946,11 @@ async function run$a(argv, importMeta, {
12902
12946
  fail: 'omit one'
12903
12947
  }, {
12904
12948
  nook: true,
12905
- test: hasSocketApiToken,
12949
+ test: dryRun || hasSocketApiToken,
12906
12950
  message: 'This command requires a Socket API token for access',
12907
12951
  fail: 'try `socket login`'
12908
12952
  }, {
12909
- test: hasGithubApiToken,
12953
+ test: dryRun || hasGithubApiToken,
12910
12954
  message: 'This command requires a GitHub API token for access',
12911
12955
  fail: 'missing'
12912
12956
  });
@@ -13170,7 +13214,7 @@ async function run$9(argv, importMeta, {
13170
13214
  fail: 'omit one'
13171
13215
  }, {
13172
13216
  nook: true,
13173
- test: hasApiToken,
13217
+ test: dryRun || hasApiToken,
13174
13218
  message: 'This command requires a Socket API token for access',
13175
13219
  fail: 'try `socket login`'
13176
13220
  }, {
@@ -13331,7 +13375,7 @@ async function run$8(argv, importMeta, {
13331
13375
  fail: 'omit one'
13332
13376
  }, {
13333
13377
  nook: true,
13334
- test: hasApiToken,
13378
+ test: dryRun || hasApiToken,
13335
13379
  message: 'This command requires a Socket API token for access',
13336
13380
  fail: 'try `socket login`'
13337
13381
  });
@@ -13511,7 +13555,8 @@ async function run$7(argv, importMeta, {
13511
13555
  reachDebug,
13512
13556
  reachDisableAnalysisSplitting,
13513
13557
  reachDisableAnalytics,
13514
- reachSkipCache
13558
+ reachSkipCache,
13559
+ reachVersion
13515
13560
  } = cli.flags;
13516
13561
  const dryRun = !!cli.flags['dryRun'];
13517
13562
 
@@ -13553,7 +13598,7 @@ async function run$7(argv, importMeta, {
13553
13598
  fail: 'missing'
13554
13599
  }, {
13555
13600
  nook: true,
13556
- test: hasApiToken,
13601
+ test: dryRun || hasApiToken,
13557
13602
  message: 'This command requires an API token for access',
13558
13603
  fail: 'try `socket login`'
13559
13604
  }, {
@@ -13601,15 +13646,16 @@ async function run$7(argv, importMeta, {
13601
13646
  outputKind,
13602
13647
  outputPath: outputPath || '',
13603
13648
  reachabilityOptions: {
13604
- reachAnalysisTimeout: Number(reachAnalysisTimeout),
13605
13649
  reachAnalysisMemoryLimit: Number(reachAnalysisMemoryLimit),
13650
+ reachAnalysisTimeout: Number(reachAnalysisTimeout),
13606
13651
  reachConcurrency: Number(reachConcurrency),
13607
13652
  reachDebug: Boolean(reachDebug),
13608
- reachDisableAnalytics: Boolean(reachDisableAnalytics),
13609
13653
  reachDisableAnalysisSplitting: Boolean(reachDisableAnalysisSplitting),
13654
+ reachDisableAnalytics: Boolean(reachDisableAnalytics),
13610
13655
  reachEcosystems,
13611
13656
  reachExcludePaths,
13612
- reachSkipCache: Boolean(reachSkipCache)
13657
+ reachSkipCache: Boolean(reachSkipCache),
13658
+ reachVersion
13613
13659
  },
13614
13660
  targets
13615
13661
  });
@@ -13742,7 +13788,7 @@ async function run$6(argv, importMeta, {
13742
13788
  fail: 'omit one'
13743
13789
  }, {
13744
13790
  nook: true,
13745
- test: hasApiToken,
13791
+ test: dryRun || hasApiToken,
13746
13792
  message: 'This command requires a Socket API token for access',
13747
13793
  fail: 'try `socket login`'
13748
13794
  });
@@ -14341,7 +14387,7 @@ async function run$4(argv, importMeta, {
14341
14387
  fail: 'bad'
14342
14388
  }, {
14343
14389
  nook: true,
14344
- test: hasApiToken,
14390
+ test: dryRun || hasApiToken,
14345
14391
  message: 'This command requires a Socket API token for access',
14346
14392
  fail: 'try `socket login`'
14347
14393
  }, {
@@ -14776,7 +14822,7 @@ async function run$3(argv, importMeta, {
14776
14822
  fail: 'omit one'
14777
14823
  }, {
14778
14824
  nook: true,
14779
- test: hasApiToken,
14825
+ test: dryRun || hasApiToken,
14780
14826
  message: 'This command requires a Socket API token for access',
14781
14827
  fail: 'try `socket login`'
14782
14828
  });
@@ -15448,5 +15494,5 @@ void (async () => {
15448
15494
  await utils.captureException(e);
15449
15495
  }
15450
15496
  })();
15451
- //# debugId=abe9e0d9-90ff-4e73-99b1-648bc5ca3347
15497
+ //# debugId=5f201233-b128-4a9f-b7eb-542d9cde563b
15452
15498
  //# sourceMappingURL=cli.js.map