react-doctor 0.9.3-dev.f958625 → 0.9.4-dev.212b8b4

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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5505a3fc-455b-573f-b5e5-5fdf70905b36")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8d6e3c06-44f8-589f-8e07-aaa4704b6112")}catch(e){}}();
3
3
  import { i as __toESM$1, r as __require, t as __commonJSMin$1 } from "./chunk-ChKA3wi6.js";
4
4
  import { createRequire } from "node:module";
5
5
  import { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_RULES, REACT_DOCTOR_RULES, REACT_DOCTOR_RULE_REGISTRY, REACT_DOCTOR_SCAN_RULES, classifySecurityScanFile, collectCrossFileDependencyProbes, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor/core";
@@ -62285,7 +62285,7 @@ const SOCKET_FREE_USER_AGENT = "react-doctor-supply-chain";
62285
62285
  const FILE_LINT_CACHE_FILENAME = "file-lint-cache.json";
62286
62286
  const FILE_LINT_CACHE_MAX_FILE_COUNT = 5e4;
62287
62287
  const SIDECAR_LINT_CACHE_FILENAME = "sidecar-lint-cache.json";
62288
- const CORE_PACKAGE_VERSION = "0.9.3";
62288
+ const CORE_PACKAGE_VERSION = "0.9.4";
62289
62289
  const DEAD_CODE_CACHE_FILENAME = "dead-code-cache.json";
62290
62290
  const DEAD_CODE_SUMMARY_CACHE_FILENAME = "dead-code-summaries.json";
62291
62291
  const SUPPLY_CHAIN_PLUGIN = "socket";
@@ -62298,17 +62298,20 @@ const SUPPLY_CHAIN_IGNORED_PACKAGES = new Set(["next"]);
62298
62298
  const isErrnoException = (error) => error instanceof Error && "code" in error;
62299
62299
  const IGNORABLE_READDIR_ERROR_CODES = new Set([
62300
62300
  "EACCES",
62301
+ "EBUSY",
62301
62302
  "EPERM",
62302
62303
  "ENOENT",
62303
62304
  "ENOTDIR",
62304
62305
  "EINVAL",
62305
62306
  "ELOOP",
62306
- "ENAMETOOLONG"
62307
+ "ENAMETOOLONG",
62308
+ "ETIMEDOUT",
62309
+ "UNKNOWN"
62307
62310
  ]);
62308
62311
  const isIgnorableReaddirError = (error) => isErrnoException(error) && typeof error.code === "string" && IGNORABLE_READDIR_ERROR_CODES.has(error.code);
62309
62312
  const readDirectoryEntries = (directoryPath) => {
62310
62313
  try {
62311
- return NFS.readdirSync(directoryPath, { withFileTypes: true });
62314
+ return fs.readdirSync(directoryPath, { withFileTypes: true });
62312
62315
  } catch (error) {
62313
62316
  if (isIgnorableReaddirError(error)) return [];
62314
62317
  throw error;
@@ -62316,14 +62319,14 @@ const readDirectoryEntries = (directoryPath) => {
62316
62319
  };
62317
62320
  const isFile = (filePath) => {
62318
62321
  try {
62319
- return NFS.statSync(filePath).isFile();
62322
+ return fs.statSync(filePath).isFile();
62320
62323
  } catch {
62321
62324
  return false;
62322
62325
  }
62323
62326
  };
62324
62327
  const isDirectory = (directoryPath) => {
62325
62328
  try {
62326
- return NFS.statSync(directoryPath).isDirectory();
62329
+ return fs.statSync(directoryPath).isDirectory();
62327
62330
  } catch {
62328
62331
  return false;
62329
62332
  }
@@ -62753,7 +62756,12 @@ const mergeCompilerOptions = (inherited, current) => {
62753
62756
  };
62754
62757
  };
62755
62758
  const readResolvedCompilerOptions = (tsConfigPath, extendsDepth, visitedPaths) => {
62756
- const realPath = NFS.realpathSync.native(tsConfigPath);
62759
+ let realPath;
62760
+ try {
62761
+ realPath = NFS.realpathSync.native(tsConfigPath);
62762
+ } catch {
62763
+ return null;
62764
+ }
62757
62765
  if (visitedPaths.has(realPath)) return null;
62758
62766
  const tsConfig = readTsConfig(realPath);
62759
62767
  if (!tsConfig) return null;
@@ -63281,27 +63289,30 @@ const getSelectedObjectProperty = (expression, propertyName, analysis, visitedEx
63281
63289
  }
63282
63290
  return null;
63283
63291
  };
63284
- const configExpressionMayDefineProperty = (expression, propertyName, analysis) => {
63292
+ const configExpressionMayDefineProperty = (expression, propertyName, analysis, visitedExpressions = /* @__PURE__ */ new Set()) => {
63285
63293
  let resolvedExpression = expression;
63286
63294
  while (ts.isParenthesizedExpression(resolvedExpression) || ts.isAsExpression(resolvedExpression) || ts.isTypeAssertionExpression(resolvedExpression) || ts.isSatisfiesExpression(resolvedExpression) || ts.isNonNullExpression(resolvedExpression)) resolvedExpression = resolvedExpression.expression;
63295
+ if (visitedExpressions.has(resolvedExpression)) return true;
63296
+ const nextVisitedExpressions = new Set(visitedExpressions);
63297
+ nextVisitedExpressions.add(resolvedExpression);
63287
63298
  if (ts.isIdentifier(resolvedExpression)) {
63288
63299
  if (analysis.localBindings.has(resolvedExpression.text)) {
63289
63300
  const localReference = analysis.localBindings.get(resolvedExpression.text);
63290
- return localReference?.expression ? configExpressionMayDefineProperty(localReference.expression, propertyName, localReference.analysis) : true;
63301
+ return localReference?.expression ? configExpressionMayDefineProperty(localReference.expression, propertyName, localReference.analysis, nextVisitedExpressions) : true;
63291
63302
  }
63292
63303
  const scopedBinding = getScopedConfigBinding(resolvedExpression);
63293
- if (scopedBinding.wasFound) return scopedBinding.initializer ? configExpressionMayDefineProperty(scopedBinding.initializer, propertyName, analysis) : true;
63304
+ if (scopedBinding.wasFound) return scopedBinding.initializer ? configExpressionMayDefineProperty(scopedBinding.initializer, propertyName, analysis, nextVisitedExpressions) : true;
63294
63305
  const topLevelBinding = getTopLevelBinding(analysis.sourceFile, resolvedExpression.text);
63295
- return topLevelBinding && ts.isExpression(topLevelBinding) ? configExpressionMayDefineProperty(topLevelBinding, propertyName, analysis) : true;
63306
+ return topLevelBinding && ts.isExpression(topLevelBinding) ? configExpressionMayDefineProperty(topLevelBinding, propertyName, analysis, nextVisitedExpressions) : true;
63296
63307
  }
63297
63308
  if (ts.isConditionalExpression(resolvedExpression)) {
63298
- if (isStaticallyTruthyConfigExpression(resolvedExpression.condition, analysis)) return configExpressionMayDefineProperty(resolvedExpression.whenTrue, propertyName, analysis);
63299
- if (isStaticallyDisabledConfigExpression(resolvedExpression.condition, analysis)) return configExpressionMayDefineProperty(resolvedExpression.whenFalse, propertyName, analysis);
63300
- return configExpressionMayDefineProperty(resolvedExpression.whenTrue, propertyName, analysis) || configExpressionMayDefineProperty(resolvedExpression.whenFalse, propertyName, analysis);
63309
+ if (isStaticallyTruthyConfigExpression(resolvedExpression.condition, analysis)) return configExpressionMayDefineProperty(resolvedExpression.whenTrue, propertyName, analysis, nextVisitedExpressions);
63310
+ if (isStaticallyDisabledConfigExpression(resolvedExpression.condition, analysis)) return configExpressionMayDefineProperty(resolvedExpression.whenFalse, propertyName, analysis, nextVisitedExpressions);
63311
+ return configExpressionMayDefineProperty(resolvedExpression.whenTrue, propertyName, analysis, nextVisitedExpressions) || configExpressionMayDefineProperty(resolvedExpression.whenFalse, propertyName, analysis, nextVisitedExpressions);
63301
63312
  }
63302
63313
  if (!ts.isObjectLiteralExpression(resolvedExpression)) return true;
63303
63314
  return resolvedExpression.properties.some((property) => {
63304
- if (ts.isSpreadAssignment(property)) return configExpressionMayDefineProperty(property.expression, propertyName, analysis);
63315
+ if (ts.isSpreadAssignment(property)) return configExpressionMayDefineProperty(property.expression, propertyName, analysis, nextVisitedExpressions);
63305
63316
  if (ts.isPropertyAssignment(property) || ts.isShorthandPropertyAssignment(property) || ts.isMethodDeclaration(property) || ts.isGetAccessorDeclaration(property) || ts.isSetAccessorDeclaration(property)) {
63306
63317
  const staticPropertyName = getStaticPropertyName$2(property.name);
63307
63318
  return staticPropertyName === null || staticPropertyName === propertyName;
@@ -63377,7 +63388,13 @@ const analyzeConfigModuleExport = (filePath, exportName, allowCompilerTransform,
63377
63388
  if (visitedModules.has(moduleVisitKey)) return false;
63378
63389
  const nextVisitedModules = new Set(visitedModules);
63379
63390
  nextVisitedModules.add(moduleVisitKey);
63380
- return analyzeConfigSourceFileExport(parseConfigSourceFile(filePath, NFS.readFileSync(filePath, "utf-8")), filePath, exportName, allowCompilerTransform, importDepth, nextVisitedModules, argumentsList, argumentAnalysis);
63391
+ let sourceText;
63392
+ try {
63393
+ sourceText = NFS.readFileSync(filePath, "utf-8");
63394
+ } catch {
63395
+ return false;
63396
+ }
63397
+ return analyzeConfigSourceFileExport(parseConfigSourceFile(filePath, sourceText), filePath, exportName, allowCompilerTransform, importDepth, nextVisitedModules, argumentsList, argumentAnalysis);
63381
63398
  };
63382
63399
  const analyzeConfigSourceFileExport = (sourceFile, filePath, exportName, allowCompilerTransform, importDepth, visitedModules, argumentsList = [], argumentAnalysis) => {
63383
63400
  const analysis = {
@@ -66880,6 +66897,43 @@ const validateStringArrayField = (fieldName, value) => {
66880
66897
  return false;
66881
66898
  });
66882
66899
  };
66900
+ const validateIgnoreOverride = (rawOverride, index) => {
66901
+ const fieldName = `ignore.overrides[${index}]`;
66902
+ if (!isRecord(rawOverride)) {
66903
+ warnConfigIssue(`config field "${fieldName}" must be an object (got ${typeof rawOverride}); ignoring this override.`);
66904
+ return;
66905
+ }
66906
+ const files = validateStringArrayField(`${fieldName}.files`, rawOverride.files);
66907
+ if (files === void 0) return void 0;
66908
+ const validatedOverride = { files };
66909
+ if (rawOverride.rules !== void 0) {
66910
+ const rules = validateStringArrayField(`${fieldName}.rules`, rawOverride.rules);
66911
+ if (rules !== void 0) validatedOverride.rules = rules;
66912
+ }
66913
+ return validatedOverride;
66914
+ };
66915
+ const validateIgnoreField = (rawIgnore) => {
66916
+ if (!isRecord(rawIgnore)) {
66917
+ warnConfigIssue(`config field "ignore" must be an object (got ${typeof rawIgnore}); ignoring this field.`);
66918
+ return;
66919
+ }
66920
+ const validatedIgnore = {};
66921
+ for (const fieldName of [
66922
+ "rules",
66923
+ "files",
66924
+ "tags"
66925
+ ]) {
66926
+ if (rawIgnore[fieldName] === void 0) continue;
66927
+ const validatedValues = validateStringArrayField(`ignore.${fieldName}`, rawIgnore[fieldName]);
66928
+ if (validatedValues !== void 0) validatedIgnore[fieldName] = validatedValues;
66929
+ }
66930
+ if (rawIgnore.overrides !== void 0) if (!Array.isArray(rawIgnore.overrides)) warnConfigIssue(`config field "ignore.overrides" must be an array (got ${typeof rawIgnore.overrides}); ignoring this field.`);
66931
+ else validatedIgnore.overrides = rawIgnore.overrides.flatMap((rawOverride, index) => {
66932
+ const validatedOverride = validateIgnoreOverride(rawOverride, index);
66933
+ return validatedOverride ? [validatedOverride] : [];
66934
+ });
66935
+ return validatedIgnore;
66936
+ };
66883
66937
  const validateSurfaceControls = (surface, rawControls) => {
66884
66938
  if (!isRecord(rawControls)) {
66885
66939
  warnConfigIssue(`config field "surfaces.${surface}" must be an object (got ${typeof rawControls}); ignoring this surface.`);
@@ -66955,6 +67009,7 @@ const validateConfigTypes = (config) => {
66955
67009
  for (const fieldName of BOOLEAN_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => coerceMaybeBooleanString(fieldName, value));
66956
67010
  for (const fieldName of STRING_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateString(fieldName, value));
66957
67011
  for (const fieldName of STRING_ARRAY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateStringArrayField(fieldName, value));
67012
+ applyFieldValidator(config, validated, "ignore", validateIgnoreField);
66958
67013
  applyFieldValidator(config, validated, "surfaces", validateSurfacesField);
66959
67014
  for (const fieldName of SEVERITY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateSeverityMap(fieldName, value, fieldName === "categories"));
66960
67015
  applyFieldValidator(config, validated, "plugins", (value) => validateStringArrayField("plugins", value));
@@ -68619,7 +68674,7 @@ const collectScriptMotionEvidence = (sourceFile, typeChecker, program) => {
68619
68674
  if (calleeEvidence.isReducedMotionHook && isExpressionValueConsumed(node)) evidence.hasReducedMotionHandling = true;
68620
68675
  }
68621
68676
  if (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) {
68622
- const tagEvidence = ts.isJsxNamespacedName(node.tagName) ? EMPTY_MOTION_EXPRESSION_EVIDENCE : resolveMotionExpressionEvidence(node.tagName, typeChecker, program);
68677
+ const tagEvidence = ts.isIdentifier(node.tagName) || ts.isPropertyAccessExpression(node.tagName) ? resolveMotionExpressionEvidence(node.tagName, typeChecker, program) : EMPTY_MOTION_EXPRESSION_EVIDENCE;
68623
68678
  if (tagEvidence.isMotionComponent || tagEvidence.isMotionComponentFactory) evidence.hasMotionUse = true;
68624
68679
  if (tagEvidence.isMotionConfig && jsxElementHasReducedMotionConfiguration(node.attributes, typeChecker)) evidence.hasReducedMotionHandling = true;
68625
68680
  }
@@ -70603,7 +70658,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
70603
70658
  changedFiles: yield* mergeUntracked(directory, splitNullSeparated(diff.stdout), includeUntracked),
70604
70659
  isCurrentChanges: false
70605
70660
  };
70606
- }).pipe(withSpan("Git.diffSelection")),
70661
+ }).pipe(catchReasons("ReactDoctorError", { GitInvocationFailed: () => succeed$2(null) }, (_reason, error) => fail$4(error)), withSpan("Git.diffSelection")),
70607
70662
  stagedFilePaths: (directory) => runGit(directory, [
70608
70663
  "diff",
70609
70664
  "--no-ext-diff",
@@ -75223,7 +75278,7 @@ const materializeSourceTree = (input) => gen(function* () {
75223
75278
  const sourcePath = path.join(input.directory, subdirectory, configFilename);
75224
75279
  const targetPath = path.resolve(resolvedTempDirectory, subdirectory, configFilename);
75225
75280
  if (!isPathInsideDirectory(targetPath, resolvedTempDirectory)) continue;
75226
- if (fs.existsSync(sourcePath) && !fs.existsSync(targetPath)) {
75281
+ if (isFile(sourcePath) && !fs.existsSync(targetPath)) {
75227
75282
  fs.mkdirSync(path.dirname(targetPath), { recursive: true });
75228
75283
  fs.cpSync(sourcePath, targetPath);
75229
75284
  }
@@ -75534,71 +75589,47 @@ const createOxlintSpawnSlots = (concurrency) => createWorkerSlots({
75534
75589
  * untouched so the loader sees the same plain object either way.
75535
75590
  */
75536
75591
  const defineConfig = (config) => config;
75537
- const AI_TRAINING_ENV_VARS = [
75538
- ["HF_DATASETS_CACHE", "huggingface"],
75539
- ["HF_HOME", "huggingface"],
75540
- ["HUGGINGFACE_HUB_CACHE", "huggingface"],
75541
- ["SPACE_ID", "huggingface-spaces"],
75542
- ["CUDA_VISIBLE_DEVICES", "cuda"],
75543
- ["NVIDIA_VISIBLE_DEVICES", "nvidia"],
75544
- ["ROCR_VISIBLE_DEVICES", "rocm"],
75545
- ["TPU_NAME", "google-tpu"],
75592
+ const AI_TRAINING_BY_ENVIRONMENT_VARIABLE = [
75546
75593
  ["WANDB_RUN_ID", "wandb"],
75547
75594
  ["WANDB_SWEEP_ID", "wandb"],
75548
75595
  ["MLFLOW_RUN_ID", "mlflow"],
75549
- ["MLFLOW_TRACKING_URI", "mlflow"],
75550
75596
  ["COMET_EXPERIMENT_KEY", "comet"],
75551
75597
  ["NEPTUNE_RUN_ID", "neptune"],
75552
75598
  ["CLEARML_TASK_ID", "clearml"],
75553
75599
  ["DVC_STAGE", "dvc"],
75554
75600
  ["RAY_WORKER_PROCESS", "ray"],
75555
- ["RAY_ADDRESS", "ray"],
75556
- ["MUJOCO_GL", "mujoco"],
75557
- ["MUJOCO_PATH", "mujoco"],
75558
- ["GYM_DISABLE_ENV_CHECKER", "gymnasium"],
75559
75601
  ["SM_TRAINING_ENV", "sagemaker"],
75560
75602
  ["TRAINING_JOB_ARN", "sagemaker"],
75561
- ["SAGEMAKER_BASE_DIR", "sagemaker"],
75562
75603
  ["AZUREML_RUN_ID", "azure-ml"],
75563
- ["AZURE_ML_MODEL_DIR", "azure-ml"],
75564
- ["CLOUD_ML_PROJECT_ID", "vertex-ai"],
75565
- ["VERTEX_AI_LOG_LEVEL", "vertex-ai"],
75566
- ["DET_MASTER", "determined-ai"],
75567
- ["LIGHTNING_USER_ID", "lightning-ai"],
75568
75604
  ["FLYTE_INTERNAL_EXECUTION_ID", "flyte"],
75569
- ["ARGO_WORKFLOW_NAME", "argo-workflows"],
75570
75605
  ["KFP_POD_NAME", "kubeflow-pipelines"],
75571
75606
  ["KAGGLE_KERNEL_RUN_TYPE", "kaggle"],
75572
75607
  ["COLAB_BACKEND_VERSION", "google-colab"],
75573
- ["DATABRICKS_RUNTIME_VERSION", "databricks"],
75574
75608
  ["DAYTONA_WS_ID", "daytona"],
75575
- ["DAYTONA_WS_NAME", "daytona"],
75576
75609
  ["E2B_SANDBOX_ID", "e2b"],
75577
75610
  ["MODAL_FUNCTION_ID", "modal"],
75578
75611
  ["MODAL_TASK_ID", "modal"],
75579
75612
  ["RUNPOD_POD_ID", "runpod"],
75580
- ["REPLICATE_USERNAME", "replicate"],
75581
75613
  ["VAST_CONTAINERLABEL", "vast-ai"],
75582
- ["HARBOR_URL", "harbor"],
75583
- ["HARBOR_HOSTNAME", "harbor"],
75584
75614
  ["SWE_BENCH_TASK", "swe-bench"],
75585
75615
  ["SWEBENCH_TASK", "swe-bench"],
75586
75616
  ["SWE_AGENT_MODEL", "swe-agent"]
75587
75617
  ];
75588
- const detectAiTrainingEnvironment = () => {
75589
- for (const [envVar, label] of AI_TRAINING_ENV_VARS) if (process.env[envVar]) return label;
75618
+ const detectAiTrainingEnvironment = (environment = process.env) => {
75619
+ for (const [environmentVariable, label] of AI_TRAINING_BY_ENVIRONMENT_VARIABLE) if (environment[environmentVariable]?.trim()) return label;
75590
75620
  return null;
75591
75621
  };
75592
- const unionValues = (baseValues, overrideValues) => [...new Set([...baseValues, ...overrideValues])];
75622
+ const stringValues = (values) => Array.isArray(values) ? values.filter((value) => typeof value === "string") : [];
75623
+ const unionValues = (baseValues, overrideValues) => [...new Set([...stringValues(baseValues), ...stringValues(overrideValues)])];
75593
75624
  const mergeIgnores = (baseIgnore, overrideIgnore) => {
75594
75625
  const mergedIgnore = {
75595
75626
  ...baseIgnore,
75596
75627
  ...overrideIgnore
75597
75628
  };
75598
- if (baseIgnore.rules && overrideIgnore.rules) mergedIgnore.rules = unionValues(baseIgnore.rules, overrideIgnore.rules);
75599
- if (baseIgnore.files && overrideIgnore.files) mergedIgnore.files = unionValues(baseIgnore.files, overrideIgnore.files);
75600
- if (baseIgnore.tags && overrideIgnore.tags) mergedIgnore.tags = unionValues(baseIgnore.tags, overrideIgnore.tags);
75601
- if (baseIgnore.overrides && overrideIgnore.overrides) mergedIgnore.overrides = [...baseIgnore.overrides, ...overrideIgnore.overrides];
75629
+ if (baseIgnore.rules !== void 0 || overrideIgnore.rules !== void 0) mergedIgnore.rules = unionValues(baseIgnore.rules, overrideIgnore.rules);
75630
+ if (baseIgnore.files !== void 0 || overrideIgnore.files !== void 0) mergedIgnore.files = unionValues(baseIgnore.files, overrideIgnore.files);
75631
+ if (baseIgnore.tags !== void 0 || overrideIgnore.tags !== void 0) mergedIgnore.tags = unionValues(baseIgnore.tags, overrideIgnore.tags);
75632
+ if (baseIgnore.overrides !== void 0 || overrideIgnore.overrides !== void 0) mergedIgnore.overrides = [...Array.isArray(baseIgnore.overrides) ? baseIgnore.overrides : [], ...Array.isArray(overrideIgnore.overrides) ? overrideIgnore.overrides : []];
75602
75633
  return mergedIgnore;
75603
75634
  };
75604
75635
  /**
@@ -75806,4 +75837,4 @@ const toJsonReport = (result, options) => buildJsonReport({
75806
75837
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
75807
75838
 
75808
75839
  //# sourceMappingURL=index.js.map
75809
- //# debugId=5505a3fc-455b-573f-b5e5-5fdf70905b36
75840
+ //# debugId=8d6e3c06-44f8-589f-8e07-aaa4704b6112
package/dist/lsp.js CHANGED
@@ -7275,6 +7275,16 @@ const catchTag$2 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, k,
7275
7275
  return catchIf$2(self, Array.isArray(k) ? (e) => hasProperty(e, "_tag") && k.includes(e._tag) : isTagged(k), f, orElse);
7276
7276
  });
7277
7277
  /** @internal */
7278
+ const catchReasons$1 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, errorTag, cases, orElse) => {
7279
+ let keys;
7280
+ return catchIf$2(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason") && hasProperty(e.reason, "_tag") && isString(e.reason._tag), (e) => {
7281
+ const reason = e.reason;
7282
+ keys ??= Object.keys(cases);
7283
+ if (keys.includes(reason._tag)) return internalCall(() => cases[reason._tag](reason, e));
7284
+ return orElse ? internalCall(() => orElse(reason, e)) : fail$7(e);
7285
+ });
7286
+ });
7287
+ /** @internal */
7278
7288
  const mapError = /* @__PURE__ */ dual(2, (self, f) => catch_$2(self, (error) => failSync(() => f(error))));
7279
7289
  const mapBoth = /* @__PURE__ */ dual(2, (self, options) => matchEffect$2(self, {
7280
7290
  onFailure: (e) => failSync(() => options.onFailure(e)),
@@ -12184,6 +12194,42 @@ const catch_$1 = catch_$2;
12184
12194
  */
12185
12195
  const catchTag$1 = catchTag$2;
12186
12196
  /**
12197
+ * Catches multiple reasons within a tagged error using an object of handlers.
12198
+ *
12199
+ * **Example** (Handling multiple error reasons)
12200
+ *
12201
+ * ```ts
12202
+ * import { Data, Effect } from "effect"
12203
+ *
12204
+ * class RateLimitError extends Data.TaggedError("RateLimitError")<{
12205
+ * retryAfter: number
12206
+ * }> {}
12207
+ *
12208
+ * class QuotaExceededError extends Data.TaggedError("QuotaExceededError")<{
12209
+ * limit: number
12210
+ * }> {}
12211
+ *
12212
+ * class AiError extends Data.TaggedError("AiError")<{
12213
+ * reason: RateLimitError | QuotaExceededError
12214
+ * }> {}
12215
+ *
12216
+ * declare const program: Effect.Effect<string, AiError>
12217
+ *
12218
+ * const handled = program.pipe(
12219
+ * Effect.catchReasons("AiError", {
12220
+ * RateLimitError: (reason) =>
12221
+ * Effect.succeed(`Retry after ${reason.retryAfter}s`),
12222
+ * QuotaExceededError: (reason) =>
12223
+ * Effect.succeed(`Quota exceeded: ${reason.limit}`)
12224
+ * })
12225
+ * )
12226
+ * ```
12227
+ *
12228
+ * @category error handling
12229
+ * @since 4.0.0
12230
+ */
12231
+ const catchReasons = catchReasons$1;
12232
+ /**
12187
12233
  * Handles both recoverable and unrecoverable errors by providing a recovery
12188
12234
  * effect.
12189
12235
  *
@@ -62338,7 +62384,7 @@ const SOCKET_FREE_USER_AGENT = "react-doctor-supply-chain";
62338
62384
  const FILE_LINT_CACHE_FILENAME = "file-lint-cache.json";
62339
62385
  const FILE_LINT_CACHE_MAX_FILE_COUNT = 5e4;
62340
62386
  const SIDECAR_LINT_CACHE_FILENAME = "sidecar-lint-cache.json";
62341
- const CORE_PACKAGE_VERSION = "0.9.3";
62387
+ const CORE_PACKAGE_VERSION = "0.9.4";
62342
62388
  const DEAD_CODE_CACHE_FILENAME = "dead-code-cache.json";
62343
62389
  const DEAD_CODE_SUMMARY_CACHE_FILENAME = "dead-code-summaries.json";
62344
62390
  const SUPPLY_CHAIN_PLUGIN = "socket";
@@ -62351,17 +62397,20 @@ const SUPPLY_CHAIN_IGNORED_PACKAGES = new Set(["next"]);
62351
62397
  const isErrnoException = (error) => error instanceof Error && "code" in error;
62352
62398
  const IGNORABLE_READDIR_ERROR_CODES = new Set([
62353
62399
  "EACCES",
62400
+ "EBUSY",
62354
62401
  "EPERM",
62355
62402
  "ENOENT",
62356
62403
  "ENOTDIR",
62357
62404
  "EINVAL",
62358
62405
  "ELOOP",
62359
- "ENAMETOOLONG"
62406
+ "ENAMETOOLONG",
62407
+ "ETIMEDOUT",
62408
+ "UNKNOWN"
62360
62409
  ]);
62361
62410
  const isIgnorableReaddirError = (error) => isErrnoException(error) && typeof error.code === "string" && IGNORABLE_READDIR_ERROR_CODES.has(error.code);
62362
62411
  const readDirectoryEntries = (directoryPath) => {
62363
62412
  try {
62364
- return NFS.readdirSync(directoryPath, { withFileTypes: true });
62413
+ return fs.readdirSync(directoryPath, { withFileTypes: true });
62365
62414
  } catch (error) {
62366
62415
  if (isIgnorableReaddirError(error)) return [];
62367
62416
  throw error;
@@ -62369,14 +62418,14 @@ const readDirectoryEntries = (directoryPath) => {
62369
62418
  };
62370
62419
  const isFile = (filePath) => {
62371
62420
  try {
62372
- return NFS.statSync(filePath).isFile();
62421
+ return fs.statSync(filePath).isFile();
62373
62422
  } catch {
62374
62423
  return false;
62375
62424
  }
62376
62425
  };
62377
62426
  const isDirectory = (directoryPath) => {
62378
62427
  try {
62379
- return NFS.statSync(directoryPath).isDirectory();
62428
+ return fs.statSync(directoryPath).isDirectory();
62380
62429
  } catch {
62381
62430
  return false;
62382
62431
  }
@@ -62806,7 +62855,12 @@ const mergeCompilerOptions = (inherited, current) => {
62806
62855
  };
62807
62856
  };
62808
62857
  const readResolvedCompilerOptions = (tsConfigPath, extendsDepth, visitedPaths) => {
62809
- const realPath = NFS.realpathSync.native(tsConfigPath);
62858
+ let realPath;
62859
+ try {
62860
+ realPath = NFS.realpathSync.native(tsConfigPath);
62861
+ } catch {
62862
+ return null;
62863
+ }
62810
62864
  if (visitedPaths.has(realPath)) return null;
62811
62865
  const tsConfig = readTsConfig(realPath);
62812
62866
  if (!tsConfig) return null;
@@ -63334,27 +63388,30 @@ const getSelectedObjectProperty = (expression, propertyName, analysis, visitedEx
63334
63388
  }
63335
63389
  return null;
63336
63390
  };
63337
- const configExpressionMayDefineProperty = (expression, propertyName, analysis) => {
63391
+ const configExpressionMayDefineProperty = (expression, propertyName, analysis, visitedExpressions = /* @__PURE__ */ new Set()) => {
63338
63392
  let resolvedExpression = expression;
63339
63393
  while (ts.isParenthesizedExpression(resolvedExpression) || ts.isAsExpression(resolvedExpression) || ts.isTypeAssertionExpression(resolvedExpression) || ts.isSatisfiesExpression(resolvedExpression) || ts.isNonNullExpression(resolvedExpression)) resolvedExpression = resolvedExpression.expression;
63394
+ if (visitedExpressions.has(resolvedExpression)) return true;
63395
+ const nextVisitedExpressions = new Set(visitedExpressions);
63396
+ nextVisitedExpressions.add(resolvedExpression);
63340
63397
  if (ts.isIdentifier(resolvedExpression)) {
63341
63398
  if (analysis.localBindings.has(resolvedExpression.text)) {
63342
63399
  const localReference = analysis.localBindings.get(resolvedExpression.text);
63343
- return localReference?.expression ? configExpressionMayDefineProperty(localReference.expression, propertyName, localReference.analysis) : true;
63400
+ return localReference?.expression ? configExpressionMayDefineProperty(localReference.expression, propertyName, localReference.analysis, nextVisitedExpressions) : true;
63344
63401
  }
63345
63402
  const scopedBinding = getScopedConfigBinding(resolvedExpression);
63346
- if (scopedBinding.wasFound) return scopedBinding.initializer ? configExpressionMayDefineProperty(scopedBinding.initializer, propertyName, analysis) : true;
63403
+ if (scopedBinding.wasFound) return scopedBinding.initializer ? configExpressionMayDefineProperty(scopedBinding.initializer, propertyName, analysis, nextVisitedExpressions) : true;
63347
63404
  const topLevelBinding = getTopLevelBinding(analysis.sourceFile, resolvedExpression.text);
63348
- return topLevelBinding && ts.isExpression(topLevelBinding) ? configExpressionMayDefineProperty(topLevelBinding, propertyName, analysis) : true;
63405
+ return topLevelBinding && ts.isExpression(topLevelBinding) ? configExpressionMayDefineProperty(topLevelBinding, propertyName, analysis, nextVisitedExpressions) : true;
63349
63406
  }
63350
63407
  if (ts.isConditionalExpression(resolvedExpression)) {
63351
- if (isStaticallyTruthyConfigExpression(resolvedExpression.condition, analysis)) return configExpressionMayDefineProperty(resolvedExpression.whenTrue, propertyName, analysis);
63352
- if (isStaticallyDisabledConfigExpression(resolvedExpression.condition, analysis)) return configExpressionMayDefineProperty(resolvedExpression.whenFalse, propertyName, analysis);
63353
- return configExpressionMayDefineProperty(resolvedExpression.whenTrue, propertyName, analysis) || configExpressionMayDefineProperty(resolvedExpression.whenFalse, propertyName, analysis);
63408
+ if (isStaticallyTruthyConfigExpression(resolvedExpression.condition, analysis)) return configExpressionMayDefineProperty(resolvedExpression.whenTrue, propertyName, analysis, nextVisitedExpressions);
63409
+ if (isStaticallyDisabledConfigExpression(resolvedExpression.condition, analysis)) return configExpressionMayDefineProperty(resolvedExpression.whenFalse, propertyName, analysis, nextVisitedExpressions);
63410
+ return configExpressionMayDefineProperty(resolvedExpression.whenTrue, propertyName, analysis, nextVisitedExpressions) || configExpressionMayDefineProperty(resolvedExpression.whenFalse, propertyName, analysis, nextVisitedExpressions);
63354
63411
  }
63355
63412
  if (!ts.isObjectLiteralExpression(resolvedExpression)) return true;
63356
63413
  return resolvedExpression.properties.some((property) => {
63357
- if (ts.isSpreadAssignment(property)) return configExpressionMayDefineProperty(property.expression, propertyName, analysis);
63414
+ if (ts.isSpreadAssignment(property)) return configExpressionMayDefineProperty(property.expression, propertyName, analysis, nextVisitedExpressions);
63358
63415
  if (ts.isPropertyAssignment(property) || ts.isShorthandPropertyAssignment(property) || ts.isMethodDeclaration(property) || ts.isGetAccessorDeclaration(property) || ts.isSetAccessorDeclaration(property)) {
63359
63416
  const staticPropertyName = getStaticPropertyName$2(property.name);
63360
63417
  return staticPropertyName === null || staticPropertyName === propertyName;
@@ -63430,7 +63487,13 @@ const analyzeConfigModuleExport = (filePath, exportName, allowCompilerTransform,
63430
63487
  if (visitedModules.has(moduleVisitKey)) return false;
63431
63488
  const nextVisitedModules = new Set(visitedModules);
63432
63489
  nextVisitedModules.add(moduleVisitKey);
63433
- return analyzeConfigSourceFileExport(parseConfigSourceFile(filePath, NFS.readFileSync(filePath, "utf-8")), filePath, exportName, allowCompilerTransform, importDepth, nextVisitedModules, argumentsList, argumentAnalysis);
63490
+ let sourceText;
63491
+ try {
63492
+ sourceText = NFS.readFileSync(filePath, "utf-8");
63493
+ } catch {
63494
+ return false;
63495
+ }
63496
+ return analyzeConfigSourceFileExport(parseConfigSourceFile(filePath, sourceText), filePath, exportName, allowCompilerTransform, importDepth, nextVisitedModules, argumentsList, argumentAnalysis);
63434
63497
  };
63435
63498
  const analyzeConfigSourceFileExport = (sourceFile, filePath, exportName, allowCompilerTransform, importDepth, visitedModules, argumentsList = [], argumentAnalysis) => {
63436
63499
  const analysis = {
@@ -66911,6 +66974,43 @@ const validateStringArrayField = (fieldName, value) => {
66911
66974
  return false;
66912
66975
  });
66913
66976
  };
66977
+ const validateIgnoreOverride = (rawOverride, index) => {
66978
+ const fieldName = `ignore.overrides[${index}]`;
66979
+ if (!isRecord(rawOverride)) {
66980
+ warnConfigIssue(`config field "${fieldName}" must be an object (got ${typeof rawOverride}); ignoring this override.`);
66981
+ return;
66982
+ }
66983
+ const files = validateStringArrayField(`${fieldName}.files`, rawOverride.files);
66984
+ if (files === void 0) return void 0;
66985
+ const validatedOverride = { files };
66986
+ if (rawOverride.rules !== void 0) {
66987
+ const rules = validateStringArrayField(`${fieldName}.rules`, rawOverride.rules);
66988
+ if (rules !== void 0) validatedOverride.rules = rules;
66989
+ }
66990
+ return validatedOverride;
66991
+ };
66992
+ const validateIgnoreField = (rawIgnore) => {
66993
+ if (!isRecord(rawIgnore)) {
66994
+ warnConfigIssue(`config field "ignore" must be an object (got ${typeof rawIgnore}); ignoring this field.`);
66995
+ return;
66996
+ }
66997
+ const validatedIgnore = {};
66998
+ for (const fieldName of [
66999
+ "rules",
67000
+ "files",
67001
+ "tags"
67002
+ ]) {
67003
+ if (rawIgnore[fieldName] === void 0) continue;
67004
+ const validatedValues = validateStringArrayField(`ignore.${fieldName}`, rawIgnore[fieldName]);
67005
+ if (validatedValues !== void 0) validatedIgnore[fieldName] = validatedValues;
67006
+ }
67007
+ if (rawIgnore.overrides !== void 0) if (!Array.isArray(rawIgnore.overrides)) warnConfigIssue(`config field "ignore.overrides" must be an array (got ${typeof rawIgnore.overrides}); ignoring this field.`);
67008
+ else validatedIgnore.overrides = rawIgnore.overrides.flatMap((rawOverride, index) => {
67009
+ const validatedOverride = validateIgnoreOverride(rawOverride, index);
67010
+ return validatedOverride ? [validatedOverride] : [];
67011
+ });
67012
+ return validatedIgnore;
67013
+ };
66914
67014
  const validateSurfaceControls = (surface, rawControls) => {
66915
67015
  if (!isRecord(rawControls)) {
66916
67016
  warnConfigIssue(`config field "surfaces.${surface}" must be an object (got ${typeof rawControls}); ignoring this surface.`);
@@ -66986,6 +67086,7 @@ const validateConfigTypes = (config) => {
66986
67086
  for (const fieldName of BOOLEAN_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => coerceMaybeBooleanString(fieldName, value));
66987
67087
  for (const fieldName of STRING_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateString(fieldName, value));
66988
67088
  for (const fieldName of STRING_ARRAY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateStringArrayField(fieldName, value));
67089
+ applyFieldValidator(config, validated, "ignore", validateIgnoreField);
66989
67090
  applyFieldValidator(config, validated, "surfaces", validateSurfacesField);
66990
67091
  for (const fieldName of SEVERITY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateSeverityMap(fieldName, value, fieldName === "categories"));
66991
67092
  applyFieldValidator(config, validated, "plugins", (value) => validateStringArrayField("plugins", value));
@@ -68602,7 +68703,7 @@ const collectScriptMotionEvidence = (sourceFile, typeChecker, program) => {
68602
68703
  if (calleeEvidence.isReducedMotionHook && isExpressionValueConsumed(node)) evidence.hasReducedMotionHandling = true;
68603
68704
  }
68604
68705
  if (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) {
68605
- const tagEvidence = ts.isJsxNamespacedName(node.tagName) ? EMPTY_MOTION_EXPRESSION_EVIDENCE : resolveMotionExpressionEvidence(node.tagName, typeChecker, program);
68706
+ const tagEvidence = ts.isIdentifier(node.tagName) || ts.isPropertyAccessExpression(node.tagName) ? resolveMotionExpressionEvidence(node.tagName, typeChecker, program) : EMPTY_MOTION_EXPRESSION_EVIDENCE;
68606
68707
  if (tagEvidence.isMotionComponent || tagEvidence.isMotionComponentFactory) evidence.hasMotionUse = true;
68607
68708
  if (tagEvidence.isMotionConfig && jsxElementHasReducedMotionConfiguration(node.attributes, typeChecker)) evidence.hasReducedMotionHandling = true;
68608
68709
  }
@@ -70586,7 +70687,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
70586
70687
  changedFiles: yield* mergeUntracked(directory, splitNullSeparated(diff.stdout), includeUntracked),
70587
70688
  isCurrentChanges: false
70588
70689
  };
70589
- }).pipe(withSpan("Git.diffSelection")),
70690
+ }).pipe(catchReasons("ReactDoctorError", { GitInvocationFailed: () => succeed$2(null) }, (_reason, error) => fail$4(error)), withSpan("Git.diffSelection")),
70590
70691
  stagedFilePaths: (directory) => runGit(directory, [
70591
70692
  "diff",
70592
70693
  "--no-ext-diff",
@@ -75206,7 +75307,7 @@ const materializeSourceTree = (input) => gen(function* () {
75206
75307
  const sourcePath = path.join(input.directory, subdirectory, configFilename);
75207
75308
  const targetPath = path.resolve(resolvedTempDirectory, subdirectory, configFilename);
75208
75309
  if (!isPathInsideDirectory(targetPath, resolvedTempDirectory)) continue;
75209
- if (fs.existsSync(sourcePath) && !fs.existsSync(targetPath)) {
75310
+ if (isFile(sourcePath) && !fs.existsSync(targetPath)) {
75210
75311
  fs.mkdirSync(path.dirname(targetPath), { recursive: true });
75211
75312
  fs.cpSync(sourcePath, targetPath);
75212
75313
  }
@@ -75386,7 +75487,7 @@ const computeConfigFingerprint = (projectDirectory, version) => {
75386
75487
  /** Display name used in client-facing messages and progress titles. */
75387
75488
  const SERVER_DISPLAY_NAME = "React Doctor";
75388
75489
  /** Server version reported in `serverInfo`; injected at build, `dev` from source. */
75389
- const SERVER_VERSION = "0.9.3";
75490
+ const SERVER_VERSION = "0.9.4";
75390
75491
  /** `Diagnostic.source` shown next to every published diagnostic. */
75391
75492
  const DIAGNOSTIC_SOURCE = "react-doctor";
75392
75493
  /**
@@ -77428,5 +77529,5 @@ const startLanguageServer = () => {
77428
77529
  };
77429
77530
  //#endregion
77430
77531
  export { startLanguageServer };
77431
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="02495a55-39cb-51a9-9d93-04929a1ac660")}catch(e){}}();
77432
- //# debugId=02495a55-39cb-51a9-9d93-04929a1ac660
77532
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2d26cd21-f7f6-5e65-9c29-fabf32208583")}catch(e){}}();
77533
+ //# debugId=2d26cd21-f7f6-5e65-9c29-fabf32208583
@@ -1,14 +1,14 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="536bbbaf-ba97-5df5-b678-926826008e2e")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ce3dfab8-7fd1-5dae-a660-054bea703cbf")}catch(e){}}();
3
3
  import { $ as TUI_REPORT_DETAIL_WIDTH_FRACTION, A as shouldRecordOnboarding, B as buildSortedRuleGroups, C as createInvocationInspect, D as markOnboardingComplete, E as doctorFace, F as buildEmptyReportMessage, G as recordCount, H as formatLearnMoreLine, I as hasIncompleteScoreAnalysis, J as findNearestPackageDirectory, K as recordDistribution, L as buildNoScoreMessage, M as computeProjectedScore, N as formatElapsedTime, O as canAnimateOnboarding, P as buildCodeFrame, Q as TUI_REPORT_COMPACT_MAX_ROWS, R as hasLintHardFailure, S as deduplicateProjectScans, T as easeOutCubic, U as resolveBlockingLevel, V as formatFixRecipeLine, W as isReactDoctorWorkflowInstalled, X as CI_TRUST_COMPANIES, Y as isUnicodeSupported, Z as METRIC, _ as launchCliAgent, _t as succeed, a as selectProjects, at as buildRuleDocsUrl, b as formatSkippedProjectsMessage, c as resolveWorkspaceDeadCodeOwner, ct as highlighter, d as countUniqueScannedFiles, dt as remainingDeadlineBudgetMs, et as isCiEnvironment, f as setUpGitHubActions, ft as resolveScanTarget, g as copyToClipboard, gt as void_, h as CLI_AGENT_BINARIES, ht as sync, i as discoverWorkspacePackages, it as Reporter, j as filterDiagnosticsByCategories, k as isOnboardingForced, l as resolveCliInspectOptions, lt as isPathInsideDirectory, m as detectLaunchableAgents, mt as runPromise, n as registerActiveTuiRenderer, nt as GITHUB_ACTIONS_SETUP_URL, o as resolveProjectScan, ot as getCategoryImpact, p as openUrl, pt as yieldToEventLoop, q as toForwardSlashes, r as shouldFailScanGate, rt as Progress, s as retryMissingProjectScores, st as hasPublishedFixRecipe, t as exitGracefully, tt as DIAGNOSTIC_CATEGORY_BUCKETS, u as filterScansForSurface, ut as mapWithConcurrency, v as buildHandoffPayload, w as printFooter, x as collectProjectSourceFileCounts, y as isShareOptedOut, z as buildRulePriorityMap } from "./cli.js";
4
+ import { createRequire } from "node:module";
4
5
  import path from "node:path";
5
6
  import { performance } from "node:perf_hooks";
6
7
  import { getSkillAgentConfig } from "agent-install";
7
- import { Box, Text, render, useApp, useInput, useStdout } from "ink";
8
+ import { Box, Text, Transform, render, useApp, useInput, useStdout } from "ink";
8
9
  import figures from "figures";
9
- import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- import Link from "ink-link";
11
+ import terminalLink from "terminal-link";
12
12
  import Spinner from "ink-spinner";
13
13
  //#region src/cli/utils/pluralize.ts
14
14
  const pluralize = (count, singularNoun) => `${count} ${singularNoun}${count === 1 ? "" : "s"}`;
@@ -49,6 +49,7 @@ const useExitOnCtrlC = () => {
49
49
  }
50
50
  });
51
51
  };
52
+ const { useEffect, useMemo, useRef, useState, useSyncExternalStore } = createRequire(createRequire(import.meta.url).resolve("ink"))("react");
52
53
  //#endregion
53
54
  //#region src/cli/ink/hooks/use-stdout-dimensions.ts
54
55
  const readDimensions = (stdout) => ({
@@ -527,10 +528,9 @@ const AgentHandoff = ({ agents, onSelect, onBack, onQuit }) => {
527
528
  };
528
529
  //#endregion
529
530
  //#region src/cli/ink/components/tui-link.tsx
530
- const TuiLink = ({ children, url }) => /* @__PURE__ */ jsx(Link, {
531
- url,
532
- fallback: false,
533
- children
531
+ const TuiLink = ({ children, url }) => /* @__PURE__ */ jsx(Transform, {
532
+ transform: (text) => terminalLink(text, url, { fallback: false }),
533
+ children: /* @__PURE__ */ jsx(Text, { children })
534
534
  });
535
535
  //#endregion
536
536
  //#region src/cli/ink/components/ci-justification.tsx
@@ -2322,5 +2322,5 @@ const runScanApp = async (input) => {
2322
2322
  //#endregion
2323
2323
  export { runScanApp };
2324
2324
 
2325
- //# sourceMappingURL=run-scan-app-QbtG43NL.js.map
2326
- //# debugId=536bbbaf-ba97-5df5-b678-926826008e2e
2325
+ //# sourceMappingURL=run-scan-app-C8iWVgvR.js.map
2326
+ //# debugId=ce3dfab8-7fd1-5dae-a660-054bea703cbf