@plumpslabs/kuma 2.4.6 → 2.4.8
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 +654 -184
- package/hooks/kuma-agy-hooks.js +28 -3
- package/package.json +2 -2
- package/plugin.json +1 -1
package/hooks/kuma-agy-hooks.js
CHANGED
|
@@ -5,11 +5,18 @@
|
|
|
5
5
|
import fs from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
|
|
8
|
+
const GENERIC_FILENAMES = new Set([
|
|
9
|
+
"index.ts", "index.js", "index.tsx", "index.jsx",
|
|
10
|
+
"types.ts", "types.d.ts", "constants.ts", "utils.ts",
|
|
11
|
+
"config.ts", "schema.ts", "styles.css", "main.ts", "main.js"
|
|
12
|
+
]);
|
|
13
|
+
|
|
8
14
|
function findGotchasForFile(targetPath) {
|
|
9
15
|
if (!targetPath) return [];
|
|
10
16
|
const results = [];
|
|
11
17
|
const normalized = targetPath.replace(/\\/g, "/");
|
|
12
18
|
const baseName = path.basename(normalized);
|
|
19
|
+
const isGeneric = GENERIC_FILENAMES.has(baseName.toLowerCase());
|
|
13
20
|
|
|
14
21
|
const gotchasMd = path.resolve(process.cwd(), ".kuma", "KNOWN_GOTCHAS.md");
|
|
15
22
|
if (fs.existsSync(gotchasMd)) {
|
|
@@ -17,11 +24,29 @@ function findGotchasForFile(targetPath) {
|
|
|
17
24
|
const content = fs.readFileSync(gotchasMd, "utf-8");
|
|
18
25
|
const sections = content.split(/(?=^###\s+)/m);
|
|
19
26
|
for (const sec of sections) {
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
// Skip resolved or deprecated gotchas
|
|
28
|
+
if (/[-*]\s*(?:🏷️\s*)?\*\*Status\*\*:\s*(?:resolved|deprecated)/i.test(sec)) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const headingLine = sec.split("\n")[0] || "";
|
|
33
|
+
const headingMatch = headingLine.match(/^###\s+\[?(.+?)\]?\s*(?:[—–-]+\s*(.+))?$/);
|
|
34
|
+
if (!headingMatch) continue;
|
|
35
|
+
|
|
36
|
+
const secFilePath = headingMatch[1].trim().replace(/\\/g, "/");
|
|
37
|
+
const secBase = path.basename(secFilePath);
|
|
38
|
+
|
|
39
|
+
// Path matching: exact match, suffix match, or non-generic basename match
|
|
40
|
+
const isMatch =
|
|
41
|
+
normalized.endsWith(secFilePath) ||
|
|
42
|
+
secFilePath.endsWith(normalized) ||
|
|
43
|
+
(!isGeneric && secBase.toLowerCase() === baseName.toLowerCase());
|
|
44
|
+
|
|
45
|
+
if (isMatch) {
|
|
46
|
+
const firstLine = headingLine.replace(/^###\s+/, "").trim();
|
|
22
47
|
const trapMatch = sec.match(/- \S*\s*\*\*Trap\*\*:\s*([^\n]+)/i) || sec.match(/- \*\*Issue\*\*:\s*([^\n]+)/i);
|
|
23
48
|
const ruleMatch = sec.match(/- \S*\s*\*\*Rule(?:\/Fix)?\*\*:\s*([^\n]+)/i) || sec.match(/- \*\*Workaround\*\*:\s*([^\n]+)/i);
|
|
24
|
-
const trap = trapMatch ? trapMatch[1].trim() : firstLine;
|
|
49
|
+
const trap = trapMatch ? trapMatch[1].trim() : (headingMatch[2]?.trim() || firstLine);
|
|
25
50
|
const rule = ruleMatch ? ruleMatch[1].trim() : "";
|
|
26
51
|
results.push({ file: baseName, trap, rule });
|
|
27
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumpslabs/kuma",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.8",
|
|
4
4
|
"description": "Safety-first context & orchestration engine for AI coding agents. MCP server with mandatory research pipeline, knowledge graph, impact analysis, decision memory, and safety guard — works with any MCP client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -82,6 +82,6 @@
|
|
|
82
82
|
"studio:dev": "bun run packages/ide/studio/src/index.ts",
|
|
83
83
|
"typecheck": "tsc --noEmit",
|
|
84
84
|
"lint": "echo 'No linting configured'",
|
|
85
|
-
"test": "NODE_OPTIONS=--experimental-vm-modules pnpm exec jest"
|
|
85
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules pnpm exec jest --runInBand"
|
|
86
86
|
}
|
|
87
87
|
}
|
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://antigravity.google/schemas/v1/plugin.json",
|
|
3
3
|
"name": "kuma",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.8",
|
|
5
5
|
"description": "Safety-first context & orchestration engine for AI coding agents. Shadow memory, gotcha lifecycle, blast radius impact analysis, and test verification.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "plumpslabs",
|