@ctxo/cli 0.7.0-alpha.0 → 0.7.0

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
@@ -11,12 +11,11 @@ import {
11
11
  createLogger,
12
12
  detectWorkspace,
13
13
  loadCoChangeMap
14
- } from "./chunk-O3L56NY6.js";
14
+ } from "./chunk-HFTEFUIJ.js";
15
15
  import {
16
16
  DetailLevelSchema,
17
17
  JsonIndexReader
18
- } from "./chunk-I4TUA7CD.js";
19
- import "./chunk-7OCVIDC7.js";
18
+ } from "./chunk-WXA2JJLH.js";
20
19
 
21
20
  // src/index.ts
22
21
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -712,7 +711,6 @@ var BlastRadiusCalculator = class {
712
711
  }
713
712
  for (const [nodeId, info] of bestByNode) {
714
713
  visited.add(nodeId);
715
- if (!graph.hasNode(nodeId)) continue;
716
714
  const depth = current.depth + 1;
717
715
  const riskScore = 1 / Math.pow(depth, 0.7);
718
716
  let confidence = info.confidence;
@@ -955,7 +953,7 @@ var ContextAssembler = class {
955
953
  }
956
954
  }
957
955
  for (const entry of blastResult.impactedSymbols) {
958
- const node = graph.getNode(entry.symbolId);
956
+ const node = graph.getNode(entry.symbolId) ?? synthesizeNodeFromId(entry.symbolId);
959
957
  if (!node) continue;
960
958
  const existing = candidateMap.get(entry.symbolId);
961
959
  if (existing) {
@@ -1088,6 +1086,22 @@ var ContextAssembler = class {
1088
1086
  return (node.endLine - node.startLine + 1) * 10;
1089
1087
  }
1090
1088
  };
1089
+ var VALID_SYMBOL_KINDS = /* @__PURE__ */ new Set([
1090
+ "function",
1091
+ "class",
1092
+ "interface",
1093
+ "method",
1094
+ "variable",
1095
+ "type"
1096
+ ]);
1097
+ function synthesizeNodeFromId(symbolId) {
1098
+ const parts = symbolId.split("::");
1099
+ if (parts.length !== 3) return void 0;
1100
+ const [file, name, kindRaw] = parts;
1101
+ if (!file || !name || !kindRaw) return void 0;
1102
+ const kind = VALID_SYMBOL_KINDS.has(kindRaw) ? kindRaw : "variable";
1103
+ return { symbolId, name, kind, startLine: 0, endLine: 0 };
1104
+ }
1091
1105
 
1092
1106
  // src/adapters/mcp/get-context-for-task.ts
1093
1107
  var TaskTypeSchema = z7.enum(["fix", "extend", "refactor", "understand"]);
@@ -2484,7 +2498,7 @@ async function main() {
2484
2498
  const args = process.argv.slice(2);
2485
2499
  const httpPortStr = process.env.CTXO_HTTP_PORT || (args.includes("--http") ? args[args.indexOf("--port") + 1] || "3001" : null);
2486
2500
  if (!httpPortStr && args.length > 0) {
2487
- const { CliRouter } = await import("./cli-router-RA4EBMVV.js");
2501
+ const { CliRouter } = await import("./cli-router-UQPEWYFA.js");
2488
2502
  const router = new CliRouter(process.cwd());
2489
2503
  await router.route(args);
2490
2504
  return;
@@ -2498,7 +2512,7 @@ async function main() {
2498
2512
  const git = new SimpleGitAdapter(process.cwd());
2499
2513
  const recorder = readStatsEnabled(ctxoRoot) ? new SessionRecorderAdapter(storage.getDb(), () => storage.persist()) : null;
2500
2514
  const server = new McpServer({ name: "ctxo", version: PKG_VERSION });
2501
- const { StalenessDetector } = await import("./staleness-detector-HJH52U5W.js");
2515
+ const { StalenessDetector } = await import("./staleness-detector-4HJYBQ7Z.js");
2502
2516
  const staleness = new StalenessDetector(process.cwd(), ctxoRoot);
2503
2517
  registerTools(server, storage, masking, git, staleness, recorder, ctxoRoot);
2504
2518
  if (httpPortStr) {