evrex-mcp 0.5.0 → 0.6.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/hook.js +4 -1
- package/dist/index.js +5 -2
- package/package.json +1 -1
package/dist/hook.js
CHANGED
|
@@ -77,6 +77,9 @@ function repoForCwd(repos, cwd) {
|
|
|
77
77
|
}
|
|
78
78
|
return best?.id ?? null;
|
|
79
79
|
}
|
|
80
|
+
function evidenceLabel(e) {
|
|
81
|
+
return e.kind === "session" ? e.sourceKind ?? "session" : e.kind;
|
|
82
|
+
}
|
|
80
83
|
function confidenceLabel(p) {
|
|
81
84
|
if (!p) return "";
|
|
82
85
|
if (p.status === "inferred") return ` ${Math.round((p.confidence ?? 0) * 100)}%`;
|
|
@@ -87,7 +90,7 @@ function formatContext(evidence) {
|
|
|
87
90
|
if (strong.length === 0) return "";
|
|
88
91
|
const lines = strong.map((e) => {
|
|
89
92
|
const excerpt = e.excerpt.replace(/\s+/g, " ").trim().slice(0, MAX_EXCERPT);
|
|
90
|
-
return `- [${e
|
|
93
|
+
return `- [${evidenceLabel(e)} ${e.refId.slice(0, 8)}${confidenceLabel(e.provenance)}] ${excerpt}`;
|
|
91
94
|
});
|
|
92
95
|
return [
|
|
93
96
|
"<evrex-recovered-context>",
|
package/dist/index.js
CHANGED
|
@@ -955,6 +955,9 @@ function confidenceLabel(p) {
|
|
|
955
955
|
return p.status;
|
|
956
956
|
}
|
|
957
957
|
var MAX_ITEMS = 5;
|
|
958
|
+
function evidenceLabel(e) {
|
|
959
|
+
return e.kind === "session" ? e.sourceKind ?? "session" : e.kind;
|
|
960
|
+
}
|
|
958
961
|
function truncate(text, max) {
|
|
959
962
|
return text.length > max ? `${text.slice(0, max - 1)}\u2026` : text;
|
|
960
963
|
}
|
|
@@ -1099,7 +1102,7 @@ async function evrexWhy(filePath, question) {
|
|
|
1099
1102
|
);
|
|
1100
1103
|
}
|
|
1101
1104
|
const evidenceLines = evidence.slice(0, MAX_ITEMS).map((e) => {
|
|
1102
|
-
return `- [${e
|
|
1105
|
+
return `- [${evidenceLabel(e)} ${confidenceLabel(e.provenance)}] ${truncate(e.excerpt, MAX_EXCERPT)}`;
|
|
1103
1106
|
});
|
|
1104
1107
|
parts.push(`EVIDENCE:
|
|
1105
1108
|
${evidenceLines.join("\n")}`);
|
|
@@ -1127,7 +1130,7 @@ async function evrexSearch(query) {
|
|
|
1127
1130
|
const lines = results.slice(0, MAX_ITEMS * 2).map(({ repo, e }) => {
|
|
1128
1131
|
const conf = confidenceLabel(e.provenance);
|
|
1129
1132
|
const repoTag = multiRepo ? ` \xB7 ${repo.name}` : "";
|
|
1130
|
-
return `- [${e
|
|
1133
|
+
return `- [${evidenceLabel(e)} ${e.refId.slice(0, 8)} ${conf}${repoTag}] ${truncate(e.excerpt.replace(/\s+/g, " ").trim(), MAX_EXCERPT)}`;
|
|
1131
1134
|
});
|
|
1132
1135
|
return lines.join("\n");
|
|
1133
1136
|
}
|
package/package.json
CHANGED