@ctxo/cli 0.7.0 → 0.7.1

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
@@ -10,8 +10,10 @@ import {
10
10
  SymbolGraph,
11
11
  createLogger,
12
12
  detectWorkspace,
13
- loadCoChangeMap
14
- } from "./chunk-HFTEFUIJ.js";
13
+ loadCoChangeMap,
14
+ loadConfig,
15
+ statsEnabled
16
+ } from "./chunk-4M4V5V36.js";
15
17
  import {
16
18
  DetailLevelSchema,
17
19
  JsonIndexReader
@@ -641,6 +643,7 @@ function handleGetChangeIntelligence(storage, git, masking, staleness, ctxoRoot
641
643
  const indices = indexReader.readAll();
642
644
  const fileIndex = indices.find((i) => i.file === filePath);
643
645
  const complexityEntries = fileIndex?.complexity ?? [];
646
+ const indexMissingWarning = !fileIndex ? `JSON index for ${filePath} not found on disk \u2014 complexity falls back to 0. Run "ctxo index" to resync.` : void 0;
644
647
  let cyclomatic = complexityEntries.find((c) => c.symbolId === symbolId)?.cyclomatic;
645
648
  if (cyclomatic === void 0) {
646
649
  const symbolName = symbolId.split("::")[1] ?? "";
@@ -657,6 +660,9 @@ function handleGetChangeIntelligence(storage, git, masking, staleness, ctxoRoot
657
660
  const warning = staleness.check(storage.listIndexedFiles());
658
661
  if (warning) content.push({ type: "text", text: `\u26A0\uFE0F ${warning.message}` });
659
662
  }
663
+ if (indexMissingWarning) {
664
+ content.push({ type: "text", text: `\u26A0\uFE0F ${indexMissingWarning}` });
665
+ }
660
666
  content.push({ type: "text", text: payload });
661
667
  return { content };
662
668
  } catch (err) {
@@ -2473,16 +2479,7 @@ function loadMaskingConfig(ctxoRoot) {
2473
2479
  return new MaskingPipeline();
2474
2480
  }
2475
2481
  function readStatsEnabled(ctxoRoot) {
2476
- const configPath = join2(ctxoRoot, "config.yaml");
2477
- if (!existsSync2(configPath)) return true;
2478
- try {
2479
- const raw = readFileSync2(configPath, "utf-8");
2480
- const match = raw.match(/stats:\s*\n\s*enabled:\s*(true|false)/);
2481
- if (match) return match[1] !== "false";
2482
- return true;
2483
- } catch {
2484
- return true;
2485
- }
2482
+ return statsEnabled(loadConfig(ctxoRoot).config);
2486
2483
  }
2487
2484
  var PKG_VERSION = (() => {
2488
2485
  try {
@@ -2498,7 +2495,7 @@ async function main() {
2498
2495
  const args = process.argv.slice(2);
2499
2496
  const httpPortStr = process.env.CTXO_HTTP_PORT || (args.includes("--http") ? args[args.indexOf("--port") + 1] || "3001" : null);
2500
2497
  if (!httpPortStr && args.length > 0) {
2501
- const { CliRouter } = await import("./cli-router-UQPEWYFA.js");
2498
+ const { CliRouter } = await import("./cli-router-T3VZZJD6.js");
2502
2499
  const router = new CliRouter(process.cwd());
2503
2500
  await router.route(args);
2504
2501
  return;