@merittdev/horus 0.21.3 → 0.21.4

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.
Binary file
package/dist/index.cjs CHANGED
@@ -3057,7 +3057,7 @@ var init_version = __esm({
3057
3057
  "../../packages/core/src/version.ts"() {
3058
3058
  "use strict";
3059
3059
  init_cjs_shims();
3060
- HORUS_VERSION = true ? "0.21.3" : "dev";
3060
+ HORUS_VERSION = true ? "0.21.4" : "dev";
3061
3061
  PINNED_SOURCE_VERSION = HORUS_VERSION;
3062
3062
  SOURCE_PIN_ENFORCED = HORUS_VERSION !== "dev";
3063
3063
  }
@@ -72464,7 +72464,7 @@ var SourceCodeProvider = class {
72464
72464
  kind = "code";
72465
72465
  // --- helpers -------------------------------------------------------------
72466
72466
  nodeToSymbol(n4) {
72467
- return {
72467
+ const sym = {
72468
72468
  id: n4.id,
72469
72469
  name: n4.name,
72470
72470
  filePath: n4.filePath,
@@ -72474,6 +72474,8 @@ var SourceCodeProvider = class {
72474
72474
  language: n4.language,
72475
72475
  className: n4.className
72476
72476
  };
72477
+ if (n4.aliasOf) sym.aliasOf = n4.aliasOf;
72478
+ return sym;
72477
72479
  }
72478
72480
  /** Map a serialized graph node to a `Symbol`, coercing the host's `0` line sentinel to undefined. */
72479
72481
  serializedToSymbol(n4) {
@@ -72487,6 +72489,7 @@ var SourceCodeProvider = class {
72487
72489
  if (n4.className) sym.className = n4.className;
72488
72490
  if (n4.signature) sym.signature = n4.signature;
72489
72491
  if (n4.language) sym.language = n4.language;
72492
+ if (n4.aliasOf) sym.aliasOf = n4.aliasOf;
72490
72493
  return sym;
72491
72494
  }
72492
72495
  /**
@@ -97622,6 +97625,16 @@ function parseSymbolQuery(query) {
97622
97625
  if (container.length < 2 || m5[2].length < 2) return null;
97623
97626
  return { symbol: m5[2], container, isPath: false };
97624
97627
  }
97628
+ function redirectExportAlias(candidates) {
97629
+ const head = candidates[0];
97630
+ if (head === void 0 || head.aliasOf === void 0 || head.aliasOf === "") return candidates;
97631
+ const implName = head.aliasOf.toLowerCase();
97632
+ const impl = candidates.find(
97633
+ (s5) => s5.id !== head.id && s5.name.toLowerCase() === implName && s5.filePath === head.filePath
97634
+ ) ?? candidates.find((s5) => s5.id !== head.id && s5.name.toLowerCase() === implName);
97635
+ if (impl === void 0) return candidates;
97636
+ return [impl, ...candidates.filter((s5) => s5.id !== impl.id)];
97637
+ }
97625
97638
  function resolveSymbolQuery(query, symbols, opts) {
97626
97639
  const includeTests = opts?.includeTests === true;
97627
97640
  const qualifier = parseSymbolQuery(query);
@@ -97645,7 +97658,10 @@ function resolveSymbolQuery(query, symbols, opts) {
97645
97658
  const ambiguous = kind !== "fuzzy" && kind !== "none" && first !== void 0 && second !== void 0 && first.score === second.score && first.symbol.filePath !== second.symbol.filePath;
97646
97659
  return {
97647
97660
  kind,
97648
- candidates: [...scoredTier.map((s5) => s5.symbol), ...rest],
97661
+ // B2: redirect a public export-alias hit (`Component` → `BaseComponent`) to the
97662
+ // implementation so explain/blast-radius/search land on real product code, not the
97663
+ // empty alias stub. No-op unless the head candidate carries `aliasOf`.
97664
+ candidates: redirectExportAlias([...scoredTier.map((s5) => s5.symbol), ...rest]),
97649
97665
  ambiguous,
97650
97666
  qualifier
97651
97667
  };
@@ -97659,7 +97675,16 @@ async function resolveSeedSymbol(code, query, opts) {
97659
97675
  const seen = new Set(pool.map((s5) => s5.id));
97660
97676
  for (const s5 of extra) if (!seen.has(s5.id)) pool.push(s5);
97661
97677
  }
97662
- return resolveSymbolQuery(query, pool, { includeTests: opts?.includeTests ?? false });
97678
+ const includeTests = opts?.includeTests ?? false;
97679
+ let resolution = resolveSymbolQuery(query, pool, { includeTests });
97680
+ const head = resolution.candidates[0];
97681
+ if (head?.aliasOf !== void 0 && head.aliasOf !== "" && !pool.some((s5) => s5.id !== head.id && s5.name.toLowerCase() === head.aliasOf.toLowerCase())) {
97682
+ const implHits = await code.searchSymbols(head.aliasOf, Math.max(limit, 20));
97683
+ const seen = new Set(pool.map((s5) => s5.id));
97684
+ for (const s5 of implHits) if (!seen.has(s5.id)) pool.push(s5);
97685
+ resolution = resolveSymbolQuery(query, pool, { includeTests });
97686
+ }
97687
+ return resolution;
97663
97688
  }
97664
97689
  function rankSeeds(seeds, hintTokens, changedFiles, hintHasCode, qualifier, preferNamed) {
97665
97690
  const scored = seeds.map((symbol, i3) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merittdev/horus",
3
- "version": "0.21.3",
3
+ "version": "0.21.4",
4
4
  "description": "Local-first, source-aware production-incident investigation engine",
5
5
  "type": "module",
6
6
  "bin": {