@kaddo/mcp 3.129.1 → 3.129.2
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 +46 -31
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25923,55 +25923,69 @@ function sha256(content) {
|
|
|
25923
25923
|
}
|
|
25924
25924
|
var SHINGLE_SIZE = 6;
|
|
25925
25925
|
var MIN_SHARED_RUN = 6;
|
|
25926
|
-
function
|
|
25927
|
-
|
|
25926
|
+
function stripNoise(text3) {
|
|
25927
|
+
return text3.replace(/```[\s\S]*?```/g, " ").replace(/`[^`]*`/g, " ").replace(/https?:\/\/\S+|www\.\S+/gi, " ");
|
|
25928
|
+
}
|
|
25929
|
+
function contentBlocks(body) {
|
|
25930
|
+
const blocks = [];
|
|
25931
|
+
let cur = [];
|
|
25928
25932
|
let inFence = false;
|
|
25933
|
+
const flush = () => {
|
|
25934
|
+
if (cur.length) blocks.push(cur);
|
|
25935
|
+
cur = [];
|
|
25936
|
+
};
|
|
25929
25937
|
for (const raw of body.split(/\r?\n/)) {
|
|
25930
25938
|
const t = raw.trim();
|
|
25931
25939
|
if (/^```/.test(t)) {
|
|
25932
25940
|
inFence = !inFence;
|
|
25941
|
+
flush();
|
|
25933
25942
|
continue;
|
|
25934
25943
|
}
|
|
25935
25944
|
if (inFence) continue;
|
|
25936
|
-
if (/^#{1,6}\s/.test(t))
|
|
25937
|
-
|
|
25938
|
-
|
|
25945
|
+
if (t === "" || /^#{1,6}\s/.test(t) || /^>/.test(t)) {
|
|
25946
|
+
flush();
|
|
25947
|
+
continue;
|
|
25948
|
+
}
|
|
25949
|
+
const isListItem = /^([-*+]\s+|\d+\.\s+)/.test(t);
|
|
25950
|
+
if (isListItem) flush();
|
|
25951
|
+
const text3 = stripNoise(t.replace(/^([-*+]\s+|\d+\.\s+)/, ""));
|
|
25939
25952
|
const matched = text3.toLowerCase().match(/[a-záéíóúñü0-9]+/gi);
|
|
25940
|
-
if (matched)
|
|
25953
|
+
if (matched) cur.push(...matched);
|
|
25941
25954
|
}
|
|
25942
|
-
|
|
25955
|
+
flush();
|
|
25956
|
+
return blocks;
|
|
25943
25957
|
}
|
|
25944
25958
|
function buildShingles(body) {
|
|
25945
|
-
const
|
|
25946
|
-
const keys = [];
|
|
25959
|
+
const blocks = contentBlocks(body);
|
|
25947
25960
|
const set = /* @__PURE__ */ new Set();
|
|
25948
|
-
for (
|
|
25949
|
-
|
|
25950
|
-
|
|
25951
|
-
|
|
25961
|
+
for (const block of blocks) {
|
|
25962
|
+
for (let i = 0; i + SHINGLE_SIZE <= block.length; i++) {
|
|
25963
|
+
set.add(block.slice(i, i + SHINGLE_SIZE).join(" "));
|
|
25964
|
+
}
|
|
25952
25965
|
}
|
|
25953
|
-
return {
|
|
25966
|
+
return { blocks, set };
|
|
25954
25967
|
}
|
|
25955
25968
|
function longestSharedRun(a2, b2) {
|
|
25956
25969
|
let best = 0;
|
|
25957
|
-
let
|
|
25958
|
-
|
|
25959
|
-
|
|
25960
|
-
|
|
25961
|
-
|
|
25962
|
-
|
|
25963
|
-
|
|
25964
|
-
|
|
25965
|
-
|
|
25966
|
-
|
|
25970
|
+
let bestSnippet = "";
|
|
25971
|
+
for (const block of a2.blocks) {
|
|
25972
|
+
let run = 0;
|
|
25973
|
+
let runStart = 0;
|
|
25974
|
+
for (let i = 0; i + SHINGLE_SIZE <= block.length; i++) {
|
|
25975
|
+
const key = block.slice(i, i + SHINGLE_SIZE).join(" ");
|
|
25976
|
+
if (b2.set.has(key)) {
|
|
25977
|
+
if (run === 0) runStart = i;
|
|
25978
|
+
run += 1;
|
|
25979
|
+
if (run > best) {
|
|
25980
|
+
best = run;
|
|
25981
|
+
bestSnippet = block.slice(runStart, runStart + SHINGLE_SIZE + run - 1).join(" ");
|
|
25982
|
+
}
|
|
25983
|
+
} else {
|
|
25984
|
+
run = 0;
|
|
25967
25985
|
}
|
|
25968
|
-
} else {
|
|
25969
|
-
run = 0;
|
|
25970
25986
|
}
|
|
25971
25987
|
}
|
|
25972
|
-
|
|
25973
|
-
const snippet = a2.words.slice(bestStart, bestStart + SHINGLE_SIZE + best - 1).join(" ");
|
|
25974
|
-
return { length: best, snippet };
|
|
25988
|
+
return { length: best, snippet: bestSnippet };
|
|
25975
25989
|
}
|
|
25976
25990
|
var NORMATIVE_RE = /(^|[^a-záéíóúñü])(must|should|shall|debe[ns]?|deber[ií]a[ns]?|se\s+debe|hay\s+que|requiere[ns]?|require[sd]?|no\s+debe|invariant[e]?|invariants|restricci[oó]n|constraint|regla|obligatori[oa])([^a-záéíóúñü]|$)/i;
|
|
25977
25991
|
var PAST_RESULT_RE = /(compil[aoeéó]\w*|compiled|benchmark\w*|passed|succeed\w*|succeeded|ran\s+successfully|ejecut\w*|resultad\w*|crates?\b|ns\/op|µs\b|throughput|latenc\w*|baseline|measured|medid\w*|\d+\s*%|\bx\d|faster|slower)/i;
|
|
@@ -26127,8 +26141,9 @@ function buildConsolidationPlan(dir, opts = {}) {
|
|
|
26127
26141
|
}
|
|
26128
26142
|
for (const la of scoped) {
|
|
26129
26143
|
if (!isCompletedWorkItem(la)) continue;
|
|
26130
|
-
const
|
|
26131
|
-
if (!
|
|
26144
|
+
const learningRaw = sectionBody(la.body, ["Learning", "Aprendizaje", "Aprendizajes", "Learnings"]);
|
|
26145
|
+
if (!learningRaw) continue;
|
|
26146
|
+
const learning = stripNoise(learningRaw);
|
|
26132
26147
|
const ruleFragment = firstRuleFragment(learning);
|
|
26133
26148
|
if (!ruleFragment) continue;
|
|
26134
26149
|
opportunities.push({
|
package/package.json
CHANGED