@skill-map/cli 0.25.0 → 0.26.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
@@ -100,7 +100,7 @@ import cl100k_base from "js-tiktoken/ranks/cl100k_base";
100
100
  // package.json
101
101
  var package_default = {
102
102
  name: "@skill-map/cli",
103
- version: "0.25.0",
103
+ version: "0.26.0",
104
104
  description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
105
105
  license: "MIT",
106
106
  type: "module",
@@ -845,6 +845,26 @@ function validateLink(extractor, link, emitter) {
845
845
  const confidence = link.confidence ?? extractor.defaultConfidence;
846
846
  return { ...link, confidence };
847
847
  }
848
+ function dedupeLinks(links) {
849
+ const out = /* @__PURE__ */ new Map();
850
+ for (const link of links) {
851
+ const trigger = link.trigger?.normalizedTrigger ?? "";
852
+ const key = `${link.source}\0${link.target}\0${link.kind}\0${trigger}`;
853
+ const existing = out.get(key);
854
+ if (existing) {
855
+ const seen = new Set(existing.sources);
856
+ for (const src of link.sources) {
857
+ if (!seen.has(src)) {
858
+ seen.add(src);
859
+ existing.sources = [...existing.sources, src];
860
+ }
861
+ }
862
+ continue;
863
+ }
864
+ out.set(key, link);
865
+ }
866
+ return [...out.values()];
867
+ }
848
868
  function recomputeLinkCounts(nodes, links) {
849
869
  const byPath2 = /* @__PURE__ */ new Map();
850
870
  for (const node of nodes) {
@@ -2216,6 +2236,7 @@ async function runScanInternal(_kernel, options) {
2216
2236
  providerFrontmatter: setup.providerFrontmatter,
2217
2237
  pluginStores: options.pluginStores
2218
2238
  });
2239
+ walked.internalLinks = dedupeLinks(walked.internalLinks);
2219
2240
  recomputeLinkCounts(walked.nodes, walked.internalLinks);
2220
2241
  recomputeExternalRefsCount(walked.nodes, walked.externalLinks, walked.cachedPaths);
2221
2242
  await dispatchExtractorCompleted(exts.extractors, emitter, hookDispatcher);