@coana-tech/cli 14.12.22 → 14.12.24

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/cli.mjs CHANGED
@@ -227214,7 +227214,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
227214
227214
  }
227215
227215
 
227216
227216
  // dist/version.js
227217
- var version2 = "14.12.22";
227217
+ var version2 = "14.12.24";
227218
227218
 
227219
227219
  // dist/cli-core.js
227220
227220
  var { mapValues, omit, partition, pick } = import_lodash15.default;
@@ -227245,7 +227245,10 @@ var CliCore = class {
227245
227245
  }
227246
227246
  }
227247
227247
  this.rootWorkingDirectory = resolve29(rootWorkingDirectory);
227248
- this.spinner = Spinner.instance({ text: "Running Coana CLI", isSilent: this.options.silent });
227248
+ this.spinner = Spinner.instance({
227249
+ text: "Running Coana CLI",
227250
+ isSilent: this.options.silentSpinner ?? this.options.silent
227251
+ });
227249
227252
  this.shareWithDashboard = !this.options.socketMode && !!(this.options.apiKey && !this.options.disableReportSubmission && (this.options.repoUrl ?? this.options.projectName));
227250
227253
  this.dashboardAPI = new DashboardAPI(Boolean(this.options.socketMode), Boolean(this.options.disableAnalyticsSharing));
227251
227254
  }
@@ -227912,7 +227915,10 @@ async function upgradePurl(path2, upgrades, options, logFile, cliFixRunId) {
227912
227915
  cliRunId = await getSocketAPI().registerAutofixOrUpgradePurlRun(options.manifestsTarHash, options, "upgrade-purls");
227913
227916
  }
227914
227917
  const upgradePurlRunId = cliRunId && await getSocketAPI().registerUpgradePurlRun(cliRunId, upgrades);
227915
- Spinner.instance({ text: "Running Coana Upgrade Purl CLI", isSilent: options.silent }).start();
227918
+ Spinner.instance({
227919
+ text: "Running Coana Upgrade Purl CLI",
227920
+ isSilent: options.silentSpinner ?? options.silent
227921
+ }).start();
227916
227922
  try {
227917
227923
  logger.info(`Upgrading purls for ${path2}:
227918
227924
  ${upgrades.map((upgrade) => ` ${upgrade.purl} -> ${upgrade.upgradeVersion}`).join("\n")}`);
@@ -228204,19 +228210,19 @@ function computeSBOMTaskArtifacts(dependencyTrees) {
228204
228210
  // dist/index.js
228205
228211
  var program2 = new Command();
228206
228212
  var run2 = new Command();
228207
- run2.name("run").argument("<path>", "File system path to folder containing the project").option("-o, --output-dir <path>", "Write json report to <path>/coana-report.json").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("-p, --print-report", "Print the report to the console", false).option("--offline-database <path>", "Path to a coana-offline-db.json file for running the CLI without internet connectivity", void 0).option("-t, --timeout <timeout>", "Set API <timeout> in milliseconds to Coana backend.", "300000").option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-c, --concurrency <concurrency>", "Set the maximum number of concurrent reachability analysis runs. It's recommended to choose a concurrency level that ensures that each analysis run has at least the --memory-limit amount of memory available.", "1").option("--api-key <key>", "Set the Coana dashboard API key. By setting you also enable the dashboard integration.").addOption(new Option("--write-report-to-file", "Write the report dashboard-compatible report to dashboard-report.json. This report may help the Coana team debug issues with the report insertion mechanism.").default(false).hideHelp()).option("--project-name <repoName>", "Set the name of the repository. Used for dashboard integration.").option("--repo-url <repoUrl>", "Set the URL of the repository. Used for dashboard integration.").option("--include-dirs <relativeDirs...>", "globs for directories to include from the detection of subprojects (space-separated)(use relative paths from the project root). Notice, projects that are not included may still be scanned if they are referenced from included projects.").option("--exclude-dirs <relativeDirs...>", "globs for directories to exclude from the detection of subprojects (space-separated)(use relative paths from the project root). Notice, excluded projects may still be scanned if they are referenced from non-excluded projects.").option("--disable-analysis-splitting", "Limits Coana to at most 1 reachability analysis run per workspace").option("--print-analysis-log-file", "Store log output from the JavaScript/TypeScript reachability analysis in the file js-analysis.log file in the root of each workspace", false).option("--entry-points <entryPoints...>", "List of files to analyze for root workspace. The reachability analysis automatically analyzes all files used by the entry points. If not provided, all JavaScript and TypeScript files are considered entry points. For non-root workspaces, all JavaScript and TypeScript files are analyzed as well.").option("--include-projects-with-no-reachability-support", "Also runs Coana on projects where we support traditional SCA, but does not yet support reachability analysis.", false).option("--ecosystems <ecosystems...>", "List of ecosystems to analyze (space-separated). Currently NPM, PIP, MAVEN, NUGET and GO are supported. Default is all supported ecosystems.").addOption(new Option("--purl-types <purlTypes...>", "List of PURL types to analyze (space-separated). Currently npm, pypi, maven, nuget, golang and cargo are supported. Default is all supported purl types.").hideHelp()).option("--changed-files <files...>", "List of files that have changed. If provided, Coana only analyzes workspaces and modules that contain changed files.").option("--disable-report-submission", "Disable the submission of the report to the Coana dashboard. Used by the pipeline blocking feature.", false).option("--disable-analytics-sharing", "Disable analytics sharing.", false).option("--provider-project <path>", "File system path to folder containing the provider project (Only supported for Maven, Gradle, and SBT)").option("--provider-workspaces <dirs...>", "List of workspaces that build the provided runtime environment (Only supported for Maven, Gradle, and SBT)", (paths) => paths.split(" ")).option("--lightweight-reachability", "Runs Coana in lightweight mode. This increases analysis speed but also raises the risk of Coana misclassifying the reachability of certain complex vulnerabilities. Recommended only for use with Coana Guardrail mode.", false).addOption(new Option("--run-without-docker", "Run package managers and reachability analyzers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).addOption(new Option("--run-env <env>", "Specifies the environment in which the CLI is run. So far only MANAGED_SCAN and UNKNOWN are supported.").default("UNKNOWN").choices(["UNKNOWN", "MANAGED_SCAN"]).hideHelp()).addOption(new Option("--guardrail-mode", "Run Coana in guardrail mode. This mode is used to prevent new reachable vulnerabilities from being introduced into the codebase. Usually run as a CI check when pushing new commits to a pull request.")).option("--ignore-failing-workspaces", "Continue processing when a workspace fails instead of exiting. Failed workspaces will be logged at termination.", false).addOption(new Option("--socket-mode <output-file>", "Run Coana in socket mode and write report to <output-file>").hideHelp()).addOption(new Option("--manifests-tar-hash <hash>", "Hash of the tarball containing all manifest files already uploaded to Socket. If provided, Socket will be used for computing dependency trees.").hideHelp()).option("--skip-cache-usage", "Do not attempt to use cached analysis configuration from previous runs", false).version(version2).configureHelp({ sortOptions: true }).action(async (path2, options) => {
228213
+ run2.name("run").argument("<path>", "File system path to folder containing the project").option("-o, --output-dir <path>", "Write json report to <path>/coana-report.json").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).option("-p, --print-report", "Print the report to the console", false).option("--offline-database <path>", "Path to a coana-offline-db.json file for running the CLI without internet connectivity", void 0).option("-t, --timeout <timeout>", "Set API <timeout> in milliseconds to Coana backend.", "300000").option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-c, --concurrency <concurrency>", "Set the maximum number of concurrent reachability analysis runs. It's recommended to choose a concurrency level that ensures that each analysis run has at least the --memory-limit amount of memory available.", "1").option("--api-key <key>", "Set the Coana dashboard API key. By setting you also enable the dashboard integration.").addOption(new Option("--write-report-to-file", "Write the report dashboard-compatible report to dashboard-report.json. This report may help the Coana team debug issues with the report insertion mechanism.").default(false).hideHelp()).option("--project-name <repoName>", "Set the name of the repository. Used for dashboard integration.").option("--repo-url <repoUrl>", "Set the URL of the repository. Used for dashboard integration.").option("--include-dirs <relativeDirs...>", "globs for directories to include from the detection of subprojects (space-separated)(use relative paths from the project root). Notice, projects that are not included may still be scanned if they are referenced from included projects.").option("--exclude-dirs <relativeDirs...>", "globs for directories to exclude from the detection of subprojects (space-separated)(use relative paths from the project root). Notice, excluded projects may still be scanned if they are referenced from non-excluded projects.").option("--disable-analysis-splitting", "Limits Coana to at most 1 reachability analysis run per workspace").option("--print-analysis-log-file", "Store log output from the JavaScript/TypeScript reachability analysis in the file js-analysis.log file in the root of each workspace", false).option("--entry-points <entryPoints...>", "List of files to analyze for root workspace. The reachability analysis automatically analyzes all files used by the entry points. If not provided, all JavaScript and TypeScript files are considered entry points. For non-root workspaces, all JavaScript and TypeScript files are analyzed as well.").option("--include-projects-with-no-reachability-support", "Also runs Coana on projects where we support traditional SCA, but does not yet support reachability analysis.", false).option("--ecosystems <ecosystems...>", "List of ecosystems to analyze (space-separated). Currently NPM, PIP, MAVEN, NUGET and GO are supported. Default is all supported ecosystems.").addOption(new Option("--purl-types <purlTypes...>", "List of PURL types to analyze (space-separated). Currently npm, pypi, maven, nuget, golang and cargo are supported. Default is all supported purl types.").hideHelp()).option("--changed-files <files...>", "List of files that have changed. If provided, Coana only analyzes workspaces and modules that contain changed files.").option("--disable-report-submission", "Disable the submission of the report to the Coana dashboard. Used by the pipeline blocking feature.", false).option("--disable-analytics-sharing", "Disable analytics sharing.", false).option("--provider-project <path>", "File system path to folder containing the provider project (Only supported for Maven, Gradle, and SBT)").option("--provider-workspaces <dirs...>", "List of workspaces that build the provided runtime environment (Only supported for Maven, Gradle, and SBT)", (paths) => paths.split(" ")).option("--lightweight-reachability", "Runs Coana in lightweight mode. This increases analysis speed but also raises the risk of Coana misclassifying the reachability of certain complex vulnerabilities. Recommended only for use with Coana Guardrail mode.", false).addOption(new Option("--run-without-docker", "Run package managers and reachability analyzers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).addOption(new Option("--run-env <env>", "Specifies the environment in which the CLI is run. So far only MANAGED_SCAN and UNKNOWN are supported.").default("UNKNOWN").choices(["UNKNOWN", "MANAGED_SCAN"]).hideHelp()).addOption(new Option("--guardrail-mode", "Run Coana in guardrail mode. This mode is used to prevent new reachable vulnerabilities from being introduced into the codebase. Usually run as a CI check when pushing new commits to a pull request.")).option("--ignore-failing-workspaces", "Continue processing when a workspace fails instead of exiting. Failed workspaces will be logged at termination.", false).addOption(new Option("--socket-mode <output-file>", "Run Coana in socket mode and write report to <output-file>").hideHelp()).addOption(new Option("--manifests-tar-hash <hash>", "Hash of the tarball containing all manifest files already uploaded to Socket. If provided, Socket will be used for computing dependency trees.").hideHelp()).option("--skip-cache-usage", "Do not attempt to use cached analysis configuration from previous runs", false).version(version2).configureHelp({ sortOptions: true }).action(async (path2, options) => {
228208
228214
  process.env.DOCKER_IMAGE_TAG ??= version2;
228209
228215
  options.ecosystems = options.ecosystems?.map((e) => e.toUpperCase());
228210
228216
  options.purlTypes = options.purlTypes?.map((e) => e.toLowerCase());
228211
228217
  await new CliCore(path2, options).main();
228212
228218
  });
228213
228219
  var applyFixes = new Command();
228214
- applyFixes.name("apply-fixes").argument("<path>", "File system path to the folder containing the project").argument("<fixIds...>", "Apply the fixes associated with the fixIds of the form fix_UUID").option("-r, --recompute-outdated", "Look for a new fix solution when the old solution is outdated", false).option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).addOption(new Option("--run-without-docker", "Run package managers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).version(version2).action(async (path2, fixIds, options) => {
228220
+ applyFixes.name("apply-fixes").argument("<path>", "File system path to the folder containing the project").argument("<fixIds...>", "Apply the fixes associated with the fixIds of the form fix_UUID").option("-r, --recompute-outdated", "Look for a new fix solution when the old solution is outdated", false).option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).addOption(new Option("--run-without-docker", "Run package managers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).version(version2).action(async (path2, fixIds, options) => {
228215
228221
  process.env.DOCKER_IMAGE_TAG ??= version2;
228216
228222
  await applyFix(path2, fixIds, options);
228217
228223
  }).configureHelp({ sortOptions: true });
228218
228224
  var upgradePurls = new Command();
228219
- upgradePurls.name("upgrade-purls").argument("<path>", "File system path to the folder containing the project").argument("<specs...>", "Package upgrade specifications in the format 'purl -> newVersion' (e.g., 'pkg:maven/io.micrometer/micrometer-core@1.10.9 -> 1.15.0')").option("-g, --glob <pattern>", "Glob pattern to filter workspaces by absolute file path").option("-c, --concurrency <concurrency>", "Set the maximum number of concurrent reachability analysis runs. It's recommended to choose a concurrency level that ensures that each analysis run has at least the --memory-limit amount of memory available.", "1").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--range-style <style>", 'Range style to use for the output. Currently only "pin" is supported and it only works for npm.').addOption(new Option("--run-without-docker", "Run package managers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).addOption(new Option("--socket-mode", "Use Socket for computing dependency trees").default(process.env.SOCKET_MODE === "true").hideHelp()).version(version2).action(async (path2, specs2, options) => {
228225
+ upgradePurls.name("upgrade-purls").argument("<path>", "File system path to the folder containing the project").argument("<specs...>", "Package upgrade specifications in the format 'purl -> newVersion' (e.g., 'pkg:maven/io.micrometer/micrometer-core@1.10.9 -> 1.15.0')").option("-g, --glob <pattern>", "Glob pattern to filter workspaces by absolute file path").option("-c, --concurrency <concurrency>", "Set the maximum number of concurrent reachability analysis runs. It's recommended to choose a concurrency level that ensures that each analysis run has at least the --memory-limit amount of memory available.", "1").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).option("--range-style <style>", 'Range style to use for the output. Currently only "pin" is supported and it only works for npm.').addOption(new Option("--run-without-docker", "Run package managers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).addOption(new Option("--socket-mode", "Use Socket for computing dependency trees").default(process.env.SOCKET_MODE === "true").hideHelp()).version(version2).action(async (path2, specs2, options) => {
228220
228226
  process.env.DOCKER_IMAGE_TAG ??= version2;
228221
228227
  await withTmpDirectory("upgrade-purls", async (tmpDir) => {
228222
228228
  const logFile = join28(tmpDir, "upgrade-purls.log");
@@ -228234,7 +228240,7 @@ upgradePurls.name("upgrade-purls").argument("<path>", "File system path to the f
228234
228240
  });
228235
228241
  }).configureHelp({ sortOptions: true });
228236
228242
  var computeFixesAndUpgradePurlsCmd = new Command();
228237
- computeFixesAndUpgradePurlsCmd.name("compute-fixes-and-upgrade-purls").argument("<path>", "File system path to the folder containing the project").option("-a, --apply-fixes-to <ghsas...>", 'GHSA IDs to compute fixes for. Use "all" to compute fixes for all vulnerabilities.', []).option("--dry-run", "Show what changes would be made without actually making them", false).option("-g, --glob <pattern>", "Glob pattern to filter workspaces by absolute file path").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--range-style <style>", 'Range style to use for the output. Currently only "pin" is supported and it only works for npm.').option("--disable-major-updates", "Do not suggest major updates. If only major update are available, the fix will not be applied.", false).addOption(new Option("--run-without-docker", "Run package managers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).addOption(new Option("--manifests-tar-hash <hash>", "Hash of the tarball containing all manifest files already uploaded to Socket. If provided, Socket will be used for computing dependency trees.").hideHelp()).version(version2).action(async (path2, options) => {
228243
+ computeFixesAndUpgradePurlsCmd.name("compute-fixes-and-upgrade-purls").argument("<path>", "File system path to the folder containing the project").option("-a, --apply-fixes-to <ghsas...>", 'GHSA IDs to compute fixes for. Use "all" to compute fixes for all vulnerabilities.', []).option("--dry-run", "Show what changes would be made without actually making them", false).option("-g, --glob <pattern>", "Glob pattern to filter workspaces by absolute file path").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).option("--range-style <style>", 'Range style to use for the output. Currently only "pin" is supported and it only works for npm.').option("--disable-major-updates", "Do not suggest major updates. If only major update are available, the fix will not be applied.", false).addOption(new Option("--run-without-docker", "Run package managers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).addOption(new Option("--manifests-tar-hash <hash>", "Hash of the tarball containing all manifest files already uploaded to Socket. If provided, Socket will be used for computing dependency trees.").hideHelp()).version(version2).action(async (path2, options) => {
228238
228244
  process.env.DOCKER_IMAGE_TAG ??= version2;
228239
228245
  if (options.rangeStyle && options.rangeStyle === "preserve") {
228240
228246
  options.rangeStyle = void 0;
@@ -228267,6 +228273,7 @@ program2.parseAsync();
228267
228273
  var defaultCliOptions = {
228268
228274
  debug: false,
228269
228275
  silent: false,
228276
+ silentSpinner: false,
228270
228277
  printReport: false,
228271
228278
  memoryLimit: "8192",
228272
228279
  timeout: "300000",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coana-tech/cli",
3
- "version": "14.12.22",
3
+ "version": "14.12.24",
4
4
  "description": "Coana CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -97532,7 +97532,7 @@ async function getReachabilityAnalyzersStateFromInput(rootWorkingDir, subproject
97532
97532
  }
97533
97533
 
97534
97534
  // dist/reachability-analyzers-cli.js
97535
- var runReachabilityAnalysisCmd = new Command().name("runReachabilityAnalysis").argument("<rootWorkingDir>", "Directory where Coana is run").argument("<subprojectDir>", "Project root of directory being analyzed").argument("<workspacePath>", "Path to directory to analyze relative to subprojectDir").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--coana-log-path <logPath>", "Coana log path").option("--silent-spinner", "Silence spinner").requiredOption("-i, --input-file <inputFile>", "Input file for data and vulnerabilities").requiredOption("-o, --output-file <outputFile>", "Output directory for the results").configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (rootWorkingDir, subprojectDir, workspacePath, options) => withLoggerAndSpinner("Coana Reachability Analyzers", options, async () => {
97535
+ var runReachabilityAnalysisCmd = new Command().name("runReachabilityAnalysis").argument("<rootWorkingDir>", "Directory where Coana is run").argument("<subprojectDir>", "Project root of directory being analyzed").argument("<workspacePath>", "Path to directory to analyze relative to subprojectDir").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--coana-log-path <logPath>", "Coana log path").option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).requiredOption("-i, --input-file <inputFile>", "Input file for data and vulnerabilities").requiredOption("-o, --output-file <outputFile>", "Output directory for the results").configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (rootWorkingDir, subprojectDir, workspacePath, options) => withLoggerAndSpinner("Coana Reachability Analyzers", options, async () => {
97536
97536
  const state = await getReachabilityAnalyzersStateFromInput(rootWorkingDir, subprojectDir, workspacePath, options.inputFile);
97537
97537
  const result = await runReachabilityAnalysis(state);
97538
97538
  if (options.outputFile) {
@@ -97542,7 +97542,7 @@ var runReachabilityAnalysisCmd = new Command().name("runReachabilityAnalysis").a
97542
97542
  logger.info("Result:", JSON.stringify(result, null, 2));
97543
97543
  }
97544
97544
  }));
97545
- var runOnDependencyChainCmd = new Command().name("runOnDependencyChain").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--coana-log-path <logPath>", "Coana log path").option("--silent-spinner", "Silence spinner").requiredOption("-i, --input-file <inputFile>", "Input file for data and vulnerabilities").requiredOption("-o, --output-file <outputFile>", "Output directory for the results").configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (options) => withLoggerAndSpinner("Coana Reachability Analyzers", options, async () => {
97545
+ var runOnDependencyChainCmd = new Command().name("runOnDependencyChain").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--coana-log-path <logPath>", "Coana log path").option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).requiredOption("-i, --input-file <inputFile>", "Input file for data and vulnerabilities").requiredOption("-o, --output-file <outputFile>", "Output directory for the results").configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (options) => withLoggerAndSpinner("Coana Reachability Analyzers", options, async () => {
97546
97546
  const { ecosystem, dependencyChain, vulnerability } = JSON.parse(await readFile12(options.inputFile, "utf-8"));
97547
97547
  const result = await analyzePackages(ecosystem, deserializeDependencyChain(ecosystem, dependencyChain), vulnerability);
97548
97548
  if (options.outputFile) {
@@ -97552,7 +97552,7 @@ var runOnDependencyChainCmd = new Command().name("runOnDependencyChain").option(
97552
97552
  logger.info("Result:", JSON.stringify(result, null, 2));
97553
97553
  }
97554
97554
  }));
97555
- var runOnPackageRegistryPackageCmd = new Command().name("runOnPackageRegistryPackage").argument("<mainPackage>", "Main package to analyze").requiredOption("--dependencies <dependencies...>", "Dependencies to analyze (installed as a dependency chain in the provided order)").requiredOption("--api-key <apiKey>", "Coana ApiKey").requiredOption("--ecosystem <ecosystem>", "Ecosystem for mainPackage and dependencies").requiredOption("-v, --vulnerability <vulnerability>", "GHSA id for vulnerability").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run", "60").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-o, --output-file <outputFile>", "Output file for the results").option("--coana-log-path <logPath>", "Coana log path").option("--silent-spinner", "Silence spinner").configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (mainPackage, options) => {
97555
+ var runOnPackageRegistryPackageCmd = new Command().name("runOnPackageRegistryPackage").argument("<mainPackage>", "Main package to analyze").requiredOption("--dependencies <dependencies...>", "Dependencies to analyze (installed as a dependency chain in the provided order)").requiredOption("--api-key <apiKey>", "Coana ApiKey").requiredOption("--ecosystem <ecosystem>", "Ecosystem for mainPackage and dependencies").requiredOption("-v, --vulnerability <vulnerability>", "GHSA id for vulnerability").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run", "60").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-o, --output-file <outputFile>", "Output file for the results").option("--coana-log-path <logPath>", "Coana log path").option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (mainPackage, options) => {
97556
97556
  withLoggerAndSpinner("Coana Reachability Analyzers runOnPackages", options, async () => {
97557
97557
  let vulnerability;
97558
97558
  try {
@@ -7749,8 +7749,10 @@ var AlucardResolutionManager = class {
7749
7749
  const inputFile = resolve(tmpDir, "input.json");
7750
7750
  await writeFile(inputFile, JSON.stringify(inputFileData));
7751
7751
  const execResult = await execNeverFail(cmdt`java -jar ${this.alucardPath} resolveNodes --batch-mode --input-file=${inputFile} --output-dir=${tmpDir} --timeout=${this.timeoutInSeconds}`);
7752
- if (execResult.error)
7753
- throw Error("alucard could not resolve nodes");
7752
+ if (execResult.error) {
7753
+ throw Error(`alucard could not resolve nodes: ${execResult.error.message}${execResult.stderr ? `
7754
+ stderr: ${execResult.stderr}` : ""}`);
7755
+ }
7754
7756
  const nodes = JSON.parse(await readFile5(resolve(tmpDir, "nodes.json"), "utf-8"));
7755
7757
  const fatJarExcludes = new Set(nodes.filter((node) => deps[node.packageId] && node.nodeType === "type").map((node) => node.fullyQualifiedName));
7756
7758
  graph.addNodes(nodes.filter((node) => !apps[node.nodeId] && node.nodeType === "type" && fatJarExcludes.has(node.fullyQualifiedName)));
@@ -7768,8 +7770,10 @@ var AlucardResolutionManager = class {
7768
7770
  const inputFile = resolve(tmpDir, "input.json");
7769
7771
  await writeFile(inputFile, JSON.stringify(inputFileData));
7770
7772
  const execResult = await execNeverFail(cmdt`java -jar ${this.alucardPath} resolveEdges --batch-mode ${mode === "DIRECT_DEPENDENCIES" && "--entry-edges-only"} --input-file=${inputFile} --output-dir=${tmpDir} --timeout=${this.timeoutInSeconds}`);
7771
- if (execResult.error)
7772
- throw new Error("alucard could not resolve edges");
7773
+ if (execResult.error) {
7774
+ throw Error(`alucard could not resolve edges: ${execResult.error.message}${execResult.stderr ? `
7775
+ stderr: ${execResult.stderr}` : ""}`);
7776
+ }
7773
7777
  for (const idx of JSON.parse(await readFile5(resolve(tmpDir, "visited.json"), "utf-8"))) {
7774
7778
  visited.add(idx);
7775
7779
  }
@@ -17518,8 +17522,10 @@ var CocoaResolutionManager = class {
17518
17522
  await writeFile4(inputFile, JSON.stringify(inputFileData));
17519
17523
  const cmd = cmdt`dotnet ${this.cocoaPath} resolveNodes --batch-mode --input-file=${inputFile} --output-dir=${tmpDir} --timeout=${this.timeoutInSeconds}`;
17520
17524
  const execResult = await execNeverFail(cmd, ".");
17521
- if (execResult.error)
17522
- throw new Error("cocoa could not resolve class graph nodes");
17525
+ if (execResult.error) {
17526
+ throw Error(`cocoa could not resolve nodes: ${execResult.error.message}${execResult.stderr ? `
17527
+ stderr: ${execResult.stderr}` : ""}`);
17528
+ }
17523
17529
  const nodes = JSON.parse(await readFile9(resolve3(tmpDir, "nodes.json"), "utf-8"));
17524
17530
  graph.addNodes(nodes);
17525
17531
  });
@@ -17537,8 +17543,10 @@ var CocoaResolutionManager = class {
17537
17543
  await writeFile4(inputFile, JSON.stringify(inputFileData));
17538
17544
  const cmd = cmdt`dotnet ${this.cocoaPath} resolveEdges --batch-mode ${mode === "DIRECT_DEPENDENCIES" && "--entry-edges-only"} --input-file=${inputFile} --output-dir=${tmpDir} --timeout=${this.timeoutInSeconds}`;
17539
17545
  const execResult = await execNeverFail(cmd, ".");
17540
- if (execResult.error)
17541
- throw new Error("cocoa could not resolve class graph edges");
17546
+ if (execResult.error) {
17547
+ throw Error(`cocoa could not resolve edges: ${execResult.error.message}${execResult.stderr ? `
17548
+ stderr: ${execResult.stderr}` : ""}`);
17549
+ }
17542
17550
  for (const idx of JSON.parse(await readFile9(resolve3(tmpDir, "visited.json"), "utf-8"))) {
17543
17551
  visited.add(idx);
17544
17552
  }