socket 1.1.141 → 1.1.143

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 (39) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cli.js +202 -116
  3. package/dist/cli.js.map +1 -1
  4. package/dist/constants.js +4 -4
  5. package/dist/constants.js.map +1 -1
  6. package/dist/init.gradle +73 -0
  7. package/dist/manifest-scripts/maven-extension/coana-maven-extension.jar +0 -0
  8. package/dist/manifest-scripts/socket-facts.init.gradle +79 -2
  9. package/dist/manifest-scripts/socket-facts.plugin.scala +97 -20
  10. package/dist/tsconfig.dts.tsbuildinfo +1 -1
  11. package/dist/types/commands/manifest/cmd-manifest-auto.d.mts.map +1 -1
  12. package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts.map +1 -1
  13. package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts.map +1 -1
  14. package/dist/types/commands/manifest/cmd-manifest-maven.d.mts.map +1 -1
  15. package/dist/types/commands/manifest/cmd-manifest-scala.d.mts.map +1 -1
  16. package/dist/types/commands/manifest/convert-gradle-to-facts.d.mts +2 -1
  17. package/dist/types/commands/manifest/convert-gradle-to-facts.d.mts.map +1 -1
  18. package/dist/types/commands/manifest/convert-maven-to-facts.d.mts +2 -1
  19. package/dist/types/commands/manifest/convert-maven-to-facts.d.mts.map +1 -1
  20. package/dist/types/commands/manifest/convert-sbt-to-facts.d.mts +2 -1
  21. package/dist/types/commands/manifest/convert-sbt-to-facts.d.mts.map +1 -1
  22. package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +2 -1
  23. package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts.map +1 -1
  24. package/dist/types/commands/manifest/generate_auto_manifest.d.mts +4 -1
  25. package/dist/types/commands/manifest/generate_auto_manifest.d.mts.map +1 -1
  26. package/dist/types/commands/manifest/run-manifest-facts.d.mts +2 -1
  27. package/dist/types/commands/manifest/run-manifest-facts.d.mts.map +1 -1
  28. package/dist/types/commands/manifest/scripts/run.d.mts +4 -0
  29. package/dist/types/commands/manifest/scripts/run.d.mts.map +1 -1
  30. package/dist/types/commands/scan/exclude-paths.d.mts +2 -2
  31. package/dist/types/commands/scan/exclude-paths.d.mts.map +1 -1
  32. package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
  33. package/dist/types/utils/api.d.mts.map +1 -1
  34. package/dist/types/utils/dlx.d.mts.map +1 -1
  35. package/dist/types/utils/sdk.d.mts +1 -0
  36. package/dist/types/utils/sdk.d.mts.map +1 -1
  37. package/dist/utils.js +19 -6
  38. package/dist/utils.js.map +1 -1
  39. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -4,6 +4,20 @@ 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.143](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.143) - 2026-07-10
8
+
9
+ ### Changed
10
+ - Updated the Coana CLI to v `15.8.8`.
11
+
12
+ ## [1.1.142](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.142) - 2026-07-10
13
+
14
+ ### Added
15
+ - The `socket manifest` commands (`auto`, `gradle`, `kotlin`, `maven`, `scala`) now accept `--exclude-paths`, keeping excluded subprojects and their dependencies out of generated manifests.
16
+
17
+ ### Fixed
18
+ - `--exclude-paths` is now fully honored across JVM, .NET, and Rust reachability analysis: excluded directories no longer contribute dependencies, code, or framework resources to scan results. Includes an update of the Coana CLI to v `15.8.7`.
19
+ - Invalid `--exclude-paths` glob patterns are rejected with a clear error instead of failing mid-scan.
20
+
7
21
  ## [1.1.141](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.141) - 2026-07-10
8
22
 
9
23
  ### Changed
package/dist/cli.js CHANGED
@@ -955,12 +955,50 @@ function applyFullExcludePaths({
955
955
  // silently producing an empty scan or a no-op exclusion.
956
956
  const DEGENERATE_EXCLUDE_PATHS = new Set(['', '.', './', './**', '/', '**', '/**']);
957
957
 
958
+ /**
959
+ * NIO glob syntax (used by the JVM manifest producers) throws on unbalanced
960
+ * `[`/`{` and nested `{...}` groups, where micromatch silently falls back to a
961
+ * literal match. Detect those shapes so the CLI can reject them up front
962
+ * instead of crashing mid-build inside gradle/maven/sbt. Backslashes are
963
+ * normalized to `/` throughout the pipeline, so no escape handling is needed.
964
+ */
965
+ function hasNioIncompatibleGlobBrackets(pattern) {
966
+ let braceDepth = 0;
967
+ for (let i = 0; i < pattern.length; i += 1) {
968
+ const ch = pattern[i];
969
+ if (ch === '[') {
970
+ let j = i + 1;
971
+ if (pattern[j] === '!' || pattern[j] === '^') {
972
+ j += 1;
973
+ }
974
+ // NIO glob has no literal-`]`-first convention: `[]x` / `[!]x` throws
975
+ // as an empty/unclosed class.
976
+ if (j >= pattern.length || pattern[j] === ']') {
977
+ return true;
978
+ }
979
+ const close = pattern.indexOf(']', j + 1);
980
+ if (close === -1) {
981
+ return true;
982
+ }
983
+ i = close;
984
+ } else if (ch === '{') {
985
+ braceDepth += 1;
986
+ if (braceDepth > 1) {
987
+ return true;
988
+ }
989
+ } else if (ch === '}' && braceDepth > 0) {
990
+ braceDepth -= 1;
991
+ }
992
+ }
993
+ return braceDepth !== 0;
994
+ }
995
+
958
996
  /**
959
997
  * Validates --exclude-paths entries before they reach either exclusion sink.
960
998
  * Rejects gitignore-style negations (coana's --exclude-dirs has no negation
961
999
  * form), absolute paths (the flag is scan-root relative), patterns escaping
962
- * the scan root via `..`, and degenerate match-everything sentinels like `.`,
963
- * `**`, `/`.
1000
+ * the scan root via `..`, degenerate match-everything sentinels like `.`,
1001
+ * `**`, `/`, and bracket shapes the JVM producers' NIO glob parser rejects.
964
1002
  */
965
1003
  function assertValidExcludePaths(paths) {
966
1004
  for (const p of paths) {
@@ -977,6 +1015,9 @@ function assertValidExcludePaths(paths) {
977
1015
  if (posix === '..' || posix.startsWith('../') || posix.includes('/../')) {
978
1016
  throw new utils.InputError(`--exclude-paths cannot escape the scan root with '..'. Got: '${p}'.`);
979
1017
  }
1018
+ if (hasNioIncompatibleGlobBrackets(posix)) {
1019
+ throw new utils.InputError(`--exclude-paths contains a glob with unbalanced or nested '[' / '{' brackets: '${p}'. Note that '{a,b}' alternations are not supported (values are comma-split).`);
1020
+ }
980
1021
  }
981
1022
  }
982
1023
 
@@ -5336,6 +5377,11 @@ function commonProps(opts, prefix) {
5336
5377
  if (opts.excludeConfigs) {
5337
5378
  props.push(`${prefix}socket.excludeConfigs=${opts.excludeConfigs}`);
5338
5379
  }
5380
+ if (opts.excludePaths?.length) {
5381
+ // CSV: `--exclude-paths` is comma-split at the CLI, so an entry can never
5382
+ // contain a comma.
5383
+ props.push(`${prefix}socket.excludePaths=${opts.excludePaths.join(',')}`);
5384
+ }
5339
5385
  return props;
5340
5386
  }
5341
5387
  async function runGradle(opts) {
@@ -5466,6 +5512,7 @@ async function runManifestFacts({
5466
5512
  cwd,
5467
5513
  ecosystem,
5468
5514
  excludeConfigs,
5515
+ excludePaths,
5469
5516
  ignoreUnresolved,
5470
5517
  includeConfigs,
5471
5518
  sidecarAcc,
@@ -5477,6 +5524,7 @@ async function runManifestFacts({
5477
5524
  const scriptOpts = {
5478
5525
  bin: bin || undefined,
5479
5526
  excludeConfigs: excludeConfigs || undefined,
5527
+ excludePaths: excludePaths?.length ? excludePaths : undefined,
5480
5528
  includeConfigs: includeConfigs || undefined,
5481
5529
  projectDir: cwd,
5482
5530
  // Stream the build tool's output only when asked; otherwise capture it and
@@ -5587,6 +5635,7 @@ async function convertGradleToFacts({
5587
5635
  bin,
5588
5636
  cwd,
5589
5637
  excludeConfigs,
5638
+ excludePaths,
5590
5639
  gradleOpts,
5591
5640
  ignoreUnresolved,
5592
5641
  includeConfigs,
@@ -5600,6 +5649,7 @@ async function convertGradleToFacts({
5600
5649
  cwd,
5601
5650
  ecosystem: 'gradle',
5602
5651
  excludeConfigs,
5652
+ excludePaths,
5603
5653
  ignoreUnresolved,
5604
5654
  includeConfigs,
5605
5655
  sidecarAcc,
@@ -5613,6 +5663,7 @@ async function convertMavenToFacts({
5613
5663
  bin,
5614
5664
  cwd,
5615
5665
  excludeConfigs,
5666
+ excludePaths,
5616
5667
  ignoreUnresolved,
5617
5668
  includeConfigs,
5618
5669
  mavenOpts,
@@ -5626,6 +5677,7 @@ async function convertMavenToFacts({
5626
5677
  cwd,
5627
5678
  ecosystem: 'maven',
5628
5679
  excludeConfigs,
5680
+ excludePaths,
5629
5681
  ignoreUnresolved,
5630
5682
  includeConfigs,
5631
5683
  sidecarAcc,
@@ -5641,6 +5693,7 @@ async function convertSbtToFacts({
5641
5693
  bin,
5642
5694
  cwd,
5643
5695
  excludeConfigs,
5696
+ excludePaths,
5644
5697
  ignoreUnresolved,
5645
5698
  includeConfigs,
5646
5699
  sbtOpts,
@@ -5654,6 +5707,7 @@ async function convertSbtToFacts({
5654
5707
  cwd,
5655
5708
  ecosystem: 'sbt',
5656
5709
  excludeConfigs,
5710
+ excludePaths,
5657
5711
  ignoreUnresolved,
5658
5712
  includeConfigs,
5659
5713
  sidecarAcc,
@@ -5665,6 +5719,7 @@ async function convertSbtToFacts({
5665
5719
  async function convertGradleToMaven({
5666
5720
  bin,
5667
5721
  cwd,
5722
+ excludePaths,
5668
5723
  gradleOpts,
5669
5724
  verbose
5670
5725
  }) {
@@ -5693,7 +5748,11 @@ async function convertGradleToMaven({
5693
5748
  // I'd prefer something plain-text if it is to be committed.
5694
5749
  // Note: init.gradle will be exported by .config/rollup.dist.config.mjs
5695
5750
  const initLocation = path.join(constants.default.distPath, 'init.gradle');
5696
- const commandArgs = ['--init-script', initLocation, ...gradleOpts, 'pom'];
5751
+ // CSV: `--exclude-paths` is comma-split at the CLI, so an entry can never
5752
+ // contain a comma. The init script skips POM generation for excluded
5753
+ // subprojects.
5754
+ const excludeProps = excludePaths?.length ? [`-Psocket.excludePaths=${excludePaths.join(',')}`] : [];
5755
+ const commandArgs = ['--init-script', initLocation, ...excludeProps, ...gradleOpts, 'pom'];
5697
5756
  if (verbose) {
5698
5757
  logger.logger.log('[VERBOSE] Executing:', [bin], ', args:', commandArgs);
5699
5758
  }
@@ -6175,6 +6234,7 @@ async function generateAutoManifest({
6175
6234
  computeArtifactsSidecar,
6176
6235
  cwd,
6177
6236
  detected,
6237
+ excludePaths,
6178
6238
  outputKind,
6179
6239
  verbose
6180
6240
  }) {
@@ -6205,6 +6265,7 @@ async function generateAutoManifest({
6205
6265
  await convertSbtToFacts({
6206
6266
  ...sbtArgs,
6207
6267
  excludeConfigs: sockJson.defaults?.manifest?.sbt?.excludeConfigs ?? '',
6268
+ excludePaths,
6208
6269
  ignoreUnresolved: Boolean(sockJson.defaults?.manifest?.sbt?.ignoreUnresolved),
6209
6270
  includeConfigs: sockJson.defaults?.manifest?.sbt?.includeConfigs ?? '',
6210
6271
  sidecarAcc,
@@ -6237,6 +6298,7 @@ async function generateAutoManifest({
6237
6298
  await convertGradleToFacts({
6238
6299
  ...gradleArgs,
6239
6300
  excludeConfigs: sockJson.defaults?.manifest?.gradle?.excludeConfigs ?? '',
6301
+ excludePaths,
6240
6302
  ignoreUnresolved: Boolean(sockJson.defaults?.manifest?.gradle?.ignoreUnresolved),
6241
6303
  includeConfigs: sockJson.defaults?.manifest?.gradle?.includeConfigs ?? '',
6242
6304
  sidecarAcc,
@@ -6258,6 +6320,7 @@ async function generateAutoManifest({
6258
6320
  bin: sockJson.defaults?.manifest?.maven?.bin ?? resolveBuildToolBin('maven', cwd),
6259
6321
  cwd,
6260
6322
  excludeConfigs: sockJson.defaults?.manifest?.maven?.excludeConfigs ?? '',
6323
+ excludePaths,
6261
6324
  ignoreUnresolved: Boolean(sockJson.defaults?.manifest?.maven?.ignoreUnresolved),
6262
6325
  includeConfigs: sockJson.defaults?.manifest?.maven?.includeConfigs ?? '',
6263
6326
  mavenOpts: parseBuildToolOpts(sockJson.defaults?.manifest?.maven?.mavenOpts),
@@ -6399,6 +6462,7 @@ async function handleCreateNewScan({
6399
6462
  computeArtifactsSidecar: reach.runReachabilityAnalysis,
6400
6463
  cwd,
6401
6464
  detected,
6465
+ excludePaths: reach.excludePaths,
6402
6466
  outputKind,
6403
6467
  verbose: false
6404
6468
  });
@@ -11307,12 +11371,125 @@ async function run$G(argv, importMeta, {
11307
11371
  evaluateEcosystemOutcomes(outcomes, wasExplicitEcosystemSelection);
11308
11372
  }
11309
11373
 
11374
+ const reachabilityFlags = {
11375
+ reachVersion: {
11376
+ type: 'string',
11377
+ description: `Override the version of @coana-tech/cli used for reachability analysis. Default: ${constants.default.ENV.INLINED_SOCKET_CLI_COANA_TECH_CLI_VERSION}.`
11378
+ },
11379
+ reachAnalysisMemoryLimit: {
11380
+ type: 'string',
11381
+ default: '8192',
11382
+ description: 'The maximum memory for the reachability analysis as a whole number optionally followed by MB or GB (e.g. 512MB, 8GB). The default is 8GB.'
11383
+ },
11384
+ reachAnalysisTimeout: {
11385
+ type: 'string',
11386
+ default: '',
11387
+ description: 'Set the timeout for the reachability analysis as a whole number optionally followed by s, m or h (e.g. 90s, 10m, 1h). Defaults to 10m. Split analysis runs may cause the total scan time to exceed this timeout significantly.'
11388
+ },
11389
+ reachConcurrency: {
11390
+ type: 'number',
11391
+ default: 1,
11392
+ description: 'Set the maximum number of concurrent reachability analysis runs. It is recommended to choose a concurrency level that ensures each analysis run has at least the --reach-analysis-memory-limit amount of memory available.'
11393
+ },
11394
+ reachContinueOnAnalysisErrors: {
11395
+ type: 'boolean',
11396
+ default: false,
11397
+ description: 'Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed reachability results. By default, the CLI halts on analysis errors.'
11398
+ },
11399
+ reachContinueOnInstallErrors: {
11400
+ type: 'boolean',
11401
+ default: false,
11402
+ description: 'Continue reachability analysis when package installation fails, falling back to precomputed reachability results. By default, the CLI halts on installation errors.'
11403
+ },
11404
+ reachContinueOnMissingLockFiles: {
11405
+ type: 'boolean',
11406
+ default: false,
11407
+ description: 'Continue reachability analysis when a Gradle or SBT project is missing its lock file (or version catalog / pre-generated SBOM). By default, the CLI halts.'
11408
+ },
11409
+ reachContinueOnNoSourceFiles: {
11410
+ type: 'boolean',
11411
+ default: false,
11412
+ description: 'Continue reachability analysis when a workspace contains no source files for its ecosystem. By default, the CLI halts.'
11413
+ },
11414
+ reachDisableExternalToolChecks: {
11415
+ type: 'boolean',
11416
+ default: false,
11417
+ description: 'Disable external tool checks during reachability analysis.'
11418
+ },
11419
+ reachDebug: {
11420
+ type: 'boolean',
11421
+ default: false,
11422
+ description: 'Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI.'
11423
+ },
11424
+ reachDetailedAnalysisLogFile: {
11425
+ type: 'boolean',
11426
+ default: false,
11427
+ description: 'A log file with detailed analysis logs is written to root of each analyzed workspace.'
11428
+ },
11429
+ reachDisableAnalytics: {
11430
+ type: 'boolean',
11431
+ default: false,
11432
+ description: 'Disable reachability analytics sharing with Socket. Also disables caching-based optimizations.'
11433
+ },
11434
+ reachDisableAnalysisSplitting: {
11435
+ type: 'boolean',
11436
+ default: false,
11437
+ hidden: true,
11438
+ description: 'Deprecated: Analysis splitting is now disabled by default. This flag is a no-op.'
11439
+ },
11440
+ reachEnableAnalysisSplitting: {
11441
+ type: 'boolean',
11442
+ default: false,
11443
+ description: 'Allow the reachability analysis to partition CVEs into buckets that are processed in separate analysis runs. May improve accuracy, but not recommended by default.'
11444
+ },
11445
+ reachEcosystems: {
11446
+ type: 'string',
11447
+ isMultiple: true,
11448
+ description: 'List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Defaults to all ecosystems.'
11449
+ },
11450
+ reachExcludePaths: {
11451
+ type: 'string',
11452
+ isMultiple: true,
11453
+ hidden: true,
11454
+ description: 'Deprecated: use --exclude-paths instead. List of paths to exclude from reachability analysis, as either a comma separated value or as multiple flags.'
11455
+ },
11456
+ reachLazyMode: {
11457
+ type: 'boolean',
11458
+ default: false,
11459
+ description: 'Enable lazy mode for reachability analysis.',
11460
+ hidden: true
11461
+ },
11462
+ reachRetainFactsFile: {
11463
+ type: 'boolean',
11464
+ default: false,
11465
+ description: 'Keep the `.socket.facts.json` reachability report that the analysis writes to the scan directory instead of deleting it after a successful scan. IMPORTANT: you must delete this file before running a fresh full application reachability scan. A stale `.socket.facts.json` left in place is picked up as a pre-generated input and silently overrides fresh analysis, so the new scan results will not be reliable.'
11466
+ },
11467
+ reachSkipCache: {
11468
+ type: 'boolean',
11469
+ default: false,
11470
+ description: 'Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous runs to speed up the analysis.'
11471
+ },
11472
+ reachUseOnlyPregeneratedSboms: {
11473
+ type: 'boolean',
11474
+ default: false,
11475
+ description: 'When using this option, the scan is created based only on pre-generated CDX and SPDX files in your project.'
11476
+ }
11477
+ };
11478
+ const excludePathsFlag = {
11479
+ excludePaths: {
11480
+ type: 'string',
11481
+ isMultiple: true,
11482
+ description: 'List of glob patterns to exclude from the scan, including SCA/SBOM manifest discovery and (when --reach is enabled) full application reachability analysis. Patterns are anchored micromatch globs matched relative to the Socket scan root, which is the command working directory (`--cwd` if set), not the reachability target: `tests` matches only `<cwd>/tests`; use `**/tests` to match at any depth. Negation patterns (`!path`) are not supported. Accepts a comma-separated value or multiple flags.'
11483
+ }
11484
+ };
11485
+
11310
11486
  const config$e = {
11311
11487
  commandName: 'auto',
11312
11488
  description: 'Auto-detect build and attempt to generate manifest file',
11313
11489
  hidden: false,
11314
11490
  flags: {
11315
11491
  ...flags.commonFlags,
11492
+ ...excludePathsFlag,
11316
11493
  verbose: {
11317
11494
  type: 'boolean',
11318
11495
  default: false,
@@ -11392,9 +11569,12 @@ async function run$F(argv, importMeta, {
11392
11569
  process.exitCode = 1;
11393
11570
  return;
11394
11571
  }
11572
+ const excludePaths = utils.cmdFlagValueToArray(cli.flags['excludePaths']);
11573
+ assertValidExcludePaths(excludePaths);
11395
11574
  await generateAutoManifest({
11396
11575
  detected,
11397
11576
  cwd,
11577
+ excludePaths,
11398
11578
  outputKind,
11399
11579
  verbose
11400
11580
  });
@@ -11583,6 +11763,7 @@ const config$c = {
11583
11763
  type: 'string',
11584
11764
  description: 'When generating facts: comma-separated glob patterns; Gradle configurations matching any pattern are skipped (applied after --include-configs)'
11585
11765
  },
11766
+ ...excludePathsFlag,
11586
11767
  ignoreUnresolved: {
11587
11768
  type: 'boolean',
11588
11769
  description: 'When generating facts: warn on unresolved dependencies instead of failing the run (unresolved deps are not emitted to the facts file)'
@@ -11778,11 +11959,14 @@ async function run$D(argv, importMeta, {
11778
11959
  return;
11779
11960
  }
11780
11961
  const parsedGradleOpts = parseBuildToolOpts(String(gradleOpts || ''));
11962
+ const excludePaths = utils.cmdFlagValueToArray(cli.flags['excludePaths']);
11963
+ assertValidExcludePaths(excludePaths);
11781
11964
  if (facts) {
11782
11965
  await convertGradleToFacts({
11783
11966
  bin: String(bin),
11784
11967
  cwd,
11785
11968
  excludeConfigs: String(excludeConfigs || ''),
11969
+ excludePaths,
11786
11970
  gradleOpts: parsedGradleOpts,
11787
11971
  ignoreUnresolved: Boolean(ignoreUnresolved),
11788
11972
  includeConfigs: String(includeConfigs || ''),
@@ -11793,6 +11977,7 @@ async function run$D(argv, importMeta, {
11793
11977
  await convertGradleToMaven({
11794
11978
  bin: String(bin),
11795
11979
  cwd,
11980
+ excludePaths,
11796
11981
  gradleOpts: parsedGradleOpts,
11797
11982
  verbose: Boolean(verbose)
11798
11983
  });
@@ -11829,6 +12014,7 @@ const config$b = {
11829
12014
  type: 'string',
11830
12015
  description: 'When generating facts: comma-separated glob patterns; Gradle configurations matching any pattern are skipped (applied after --include-configs)'
11831
12016
  },
12017
+ ...excludePathsFlag,
11832
12018
  ignoreUnresolved: {
11833
12019
  type: 'boolean',
11834
12020
  description: 'When generating facts: warn on unresolved dependencies instead of failing the run (unresolved deps are not emitted to the facts file)'
@@ -12022,11 +12208,14 @@ async function run$C(argv, importMeta, {
12022
12208
  return;
12023
12209
  }
12024
12210
  const parsedGradleOpts = parseBuildToolOpts(String(gradleOpts || ''));
12211
+ const excludePaths = utils.cmdFlagValueToArray(cli.flags['excludePaths']);
12212
+ assertValidExcludePaths(excludePaths);
12025
12213
  if (facts) {
12026
12214
  await convertGradleToFacts({
12027
12215
  bin: String(bin),
12028
12216
  cwd,
12029
12217
  excludeConfigs: String(excludeConfigs || ''),
12218
+ excludePaths,
12030
12219
  gradleOpts: parsedGradleOpts,
12031
12220
  ignoreUnresolved: Boolean(ignoreUnresolved),
12032
12221
  includeConfigs: String(includeConfigs || ''),
@@ -12037,6 +12226,7 @@ async function run$C(argv, importMeta, {
12037
12226
  await convertGradleToMaven({
12038
12227
  bin: String(bin),
12039
12228
  cwd,
12229
+ excludePaths,
12040
12230
  gradleOpts: parsedGradleOpts,
12041
12231
  verbose: Boolean(verbose)
12042
12232
  });
@@ -12060,6 +12250,7 @@ const config$a = {
12060
12250
  type: 'string',
12061
12251
  description: 'Comma-separated glob patterns; Maven scopes matching any pattern are skipped (applied after --include-configs)'
12062
12252
  },
12253
+ ...excludePathsFlag,
12063
12254
  ignoreUnresolved: {
12064
12255
  type: 'boolean',
12065
12256
  description: 'Warn on unresolved dependencies instead of failing the run (unresolved deps are not emitted to the facts file)'
@@ -12215,10 +12406,13 @@ async function run$B(argv, importMeta, {
12215
12406
  return;
12216
12407
  }
12217
12408
  const parsedMavenOpts = parseBuildToolOpts(String(mavenOpts || ''));
12409
+ const excludePaths = utils.cmdFlagValueToArray(cli.flags['excludePaths']);
12410
+ assertValidExcludePaths(excludePaths);
12218
12411
  await convertMavenToFacts({
12219
12412
  bin: String(bin),
12220
12413
  cwd,
12221
12414
  excludeConfigs: String(excludeConfigs || ''),
12415
+ excludePaths,
12222
12416
  ignoreUnresolved: Boolean(ignoreUnresolved),
12223
12417
  includeConfigs: String(includeConfigs || ''),
12224
12418
  mavenOpts: parsedMavenOpts,
@@ -12252,6 +12446,7 @@ const config$9 = {
12252
12446
  type: 'string',
12253
12447
  description: 'When generating facts: comma-separated glob patterns; sbt configurations matching any pattern are skipped (applied after --include-configs)'
12254
12448
  },
12449
+ ...excludePathsFlag,
12255
12450
  ignoreUnresolved: {
12256
12451
  type: 'boolean',
12257
12452
  description: 'When generating facts: warn on unresolved dependencies instead of failing the run (unresolved deps are not emitted to the facts file)'
@@ -12491,11 +12686,14 @@ async function run$A(argv, importMeta, {
12491
12686
  return;
12492
12687
  }
12493
12688
  const parsedSbtOpts = parseBuildToolOpts(String(sbtOpts || ''));
12689
+ const excludePaths = utils.cmdFlagValueToArray(cli.flags['excludePaths']);
12690
+ assertValidExcludePaths(excludePaths);
12494
12691
  if (facts) {
12495
12692
  await convertSbtToFacts({
12496
12693
  bin: String(bin),
12497
12694
  cwd,
12498
12695
  excludeConfigs: String(excludeConfigs || ''),
12696
+ excludePaths,
12499
12697
  ignoreUnresolved: Boolean(ignoreUnresolved),
12500
12698
  includeConfigs: String(includeConfigs || ''),
12501
12699
  sbtOpts: parsedSbtOpts,
@@ -17238,118 +17436,6 @@ const cmdRepository = {
17238
17436
  }
17239
17437
  };
17240
17438
 
17241
- const reachabilityFlags = {
17242
- reachVersion: {
17243
- type: 'string',
17244
- description: `Override the version of @coana-tech/cli used for reachability analysis. Default: ${constants.default.ENV.INLINED_SOCKET_CLI_COANA_TECH_CLI_VERSION}.`
17245
- },
17246
- reachAnalysisMemoryLimit: {
17247
- type: 'string',
17248
- default: '8192',
17249
- description: 'The maximum memory for the reachability analysis as a whole number optionally followed by MB or GB (e.g. 512MB, 8GB). The default is 8GB.'
17250
- },
17251
- reachAnalysisTimeout: {
17252
- type: 'string',
17253
- default: '',
17254
- description: 'Set the timeout for the reachability analysis as a whole number optionally followed by s, m or h (e.g. 90s, 10m, 1h). Defaults to 10m. Split analysis runs may cause the total scan time to exceed this timeout significantly.'
17255
- },
17256
- reachConcurrency: {
17257
- type: 'number',
17258
- default: 1,
17259
- description: 'Set the maximum number of concurrent reachability analysis runs. It is recommended to choose a concurrency level that ensures each analysis run has at least the --reach-analysis-memory-limit amount of memory available.'
17260
- },
17261
- reachContinueOnAnalysisErrors: {
17262
- type: 'boolean',
17263
- default: false,
17264
- description: 'Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed reachability results. By default, the CLI halts on analysis errors.'
17265
- },
17266
- reachContinueOnInstallErrors: {
17267
- type: 'boolean',
17268
- default: false,
17269
- description: 'Continue reachability analysis when package installation fails, falling back to precomputed reachability results. By default, the CLI halts on installation errors.'
17270
- },
17271
- reachContinueOnMissingLockFiles: {
17272
- type: 'boolean',
17273
- default: false,
17274
- description: 'Continue reachability analysis when a Gradle or SBT project is missing its lock file (or version catalog / pre-generated SBOM). By default, the CLI halts.'
17275
- },
17276
- reachContinueOnNoSourceFiles: {
17277
- type: 'boolean',
17278
- default: false,
17279
- description: 'Continue reachability analysis when a workspace contains no source files for its ecosystem. By default, the CLI halts.'
17280
- },
17281
- reachDisableExternalToolChecks: {
17282
- type: 'boolean',
17283
- default: false,
17284
- description: 'Disable external tool checks during reachability analysis.'
17285
- },
17286
- reachDebug: {
17287
- type: 'boolean',
17288
- default: false,
17289
- description: 'Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI.'
17290
- },
17291
- reachDetailedAnalysisLogFile: {
17292
- type: 'boolean',
17293
- default: false,
17294
- description: 'A log file with detailed analysis logs is written to root of each analyzed workspace.'
17295
- },
17296
- reachDisableAnalytics: {
17297
- type: 'boolean',
17298
- default: false,
17299
- description: 'Disable reachability analytics sharing with Socket. Also disables caching-based optimizations.'
17300
- },
17301
- reachDisableAnalysisSplitting: {
17302
- type: 'boolean',
17303
- default: false,
17304
- hidden: true,
17305
- description: 'Deprecated: Analysis splitting is now disabled by default. This flag is a no-op.'
17306
- },
17307
- reachEnableAnalysisSplitting: {
17308
- type: 'boolean',
17309
- default: false,
17310
- description: 'Allow the reachability analysis to partition CVEs into buckets that are processed in separate analysis runs. May improve accuracy, but not recommended by default.'
17311
- },
17312
- reachEcosystems: {
17313
- type: 'string',
17314
- isMultiple: true,
17315
- description: 'List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Defaults to all ecosystems.'
17316
- },
17317
- reachExcludePaths: {
17318
- type: 'string',
17319
- isMultiple: true,
17320
- hidden: true,
17321
- description: 'Deprecated: use --exclude-paths instead. List of paths to exclude from reachability analysis, as either a comma separated value or as multiple flags.'
17322
- },
17323
- reachLazyMode: {
17324
- type: 'boolean',
17325
- default: false,
17326
- description: 'Enable lazy mode for reachability analysis.',
17327
- hidden: true
17328
- },
17329
- reachRetainFactsFile: {
17330
- type: 'boolean',
17331
- default: false,
17332
- description: 'Keep the `.socket.facts.json` reachability report that the analysis writes to the scan directory instead of deleting it after a successful scan. IMPORTANT: you must delete this file before running a fresh full application reachability scan. A stale `.socket.facts.json` left in place is picked up as a pre-generated input and silently overrides fresh analysis, so the new scan results will not be reliable.'
17333
- },
17334
- reachSkipCache: {
17335
- type: 'boolean',
17336
- default: false,
17337
- description: 'Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous runs to speed up the analysis.'
17338
- },
17339
- reachUseOnlyPregeneratedSboms: {
17340
- type: 'boolean',
17341
- default: false,
17342
- description: 'When using this option, the scan is created based only on pre-generated CDX and SPDX files in your project.'
17343
- }
17344
- };
17345
- const excludePathsFlag = {
17346
- excludePaths: {
17347
- type: 'string',
17348
- isMultiple: true,
17349
- description: 'List of glob patterns to exclude from the scan, including SCA/SBOM manifest discovery and (when --reach is enabled) full application reachability analysis. Patterns are anchored micromatch globs matched relative to the Socket scan root, which is the command working directory (`--cwd` if set), not the reachability target: `tests` matches only `<cwd>/tests`; use `**/tests` to match at any depth. Negation patterns (`!path`) are not supported. Accepts a comma-separated value or multiple flags.'
17350
- }
17351
- };
17352
-
17353
17439
  async function suggestTarget() {
17354
17440
  // We could prefill this with sub-dirs of the current
17355
17441
  // dir ... but is that going to be useful?
@@ -21902,5 +21988,5 @@ process.on('unhandledRejection', async (reason, promise) => {
21902
21988
  // eslint-disable-next-line n/no-process-exit
21903
21989
  process.exit(1);
21904
21990
  });
21905
- //# debugId=e3648eac-e83a-498a-89eb-cf4c309aaf2a
21991
+ //# debugId=90319482-1408-4a2f-a2ea-db0456ffd3c2
21906
21992
  //# sourceMappingURL=cli.js.map