@plumpslabs/kuma 2.4.1 → 2.4.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 +12 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1081,7 +1081,7 @@ async function runGarbageCollection() {
|
|
|
1081
1081
|
};
|
|
1082
1082
|
const orphanResult = db.exec(`DELETE FROM nodes WHERE id NOT IN (SELECT source_id FROM edges UNION SELECT target_id FROM edges) AND file_path IS NULL AND updated_at < strftime('%s','now','-30 days')`);
|
|
1083
1083
|
removed += orphanResult[0]?.values?.length || 0;
|
|
1084
|
-
const staleEdges = db.exec(`DELETE FROM edges WHERE weight < 0.1 AND
|
|
1084
|
+
const staleEdges = db.exec(`DELETE FROM edges WHERE weight < 0.1 AND created_at < strftime('%s','now','-30 days')`);
|
|
1085
1085
|
removed += staleEdges[0]?.values?.length || 0;
|
|
1086
1086
|
db.exec(`DELETE FROM tool_calls WHERE created_at < strftime('%s','now','-90 days')`);
|
|
1087
1087
|
db.exec(`DELETE FROM experiences WHERE created_at < strftime('%s','now','-90 days')`);
|
|
@@ -1095,7 +1095,7 @@ async function runGarbageCollection() {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
const auditCount = getCount("SELECT COUNT(*) FROM safety_audit");
|
|
1097
1097
|
if (auditCount > 200) {
|
|
1098
|
-
db.exec(`DELETE FROM safety_audit WHERE id IN (SELECT id FROM safety_audit ORDER BY
|
|
1098
|
+
db.exec(`DELETE FROM safety_audit WHERE id IN (SELECT id FROM safety_audit ORDER BY timestamp ASC LIMIT ${auditCount - 200})`);
|
|
1099
1099
|
}
|
|
1100
1100
|
db.exec(`DELETE FROM research_cache WHERE updated_at < strftime('%s','now','-60 days')`);
|
|
1101
1101
|
const secCount = getCount("SELECT COUNT(*) FROM security_findings");
|
|
@@ -9924,21 +9924,25 @@ async function handleArchFlow(params) {
|
|
|
9924
9924
|
return readLayer2("arch_flow");
|
|
9925
9925
|
}
|
|
9926
9926
|
async function handleGotchaAction(params) {
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
const normalizedScope = normalizeScope(
|
|
9927
|
+
const content = (params.content ?? params.description ?? "").trim();
|
|
9928
|
+
const scope = (params.scope ?? "").trim();
|
|
9929
|
+
if (content && scope) {
|
|
9930
|
+
const normalizedScope = normalizeScope(scope) || scope;
|
|
9931
9931
|
const { addGotcha: addGotcha2 } = await Promise.resolve().then(() => (init_kumaGotchas(), kumaGotchas_exports));
|
|
9932
9932
|
const result = await addGotcha2({
|
|
9933
9933
|
filePath: normalizedScope,
|
|
9934
|
-
description:
|
|
9934
|
+
description: content,
|
|
9935
9935
|
severity: params.status || "medium",
|
|
9936
|
-
workaround
|
|
9936
|
+
// `description` doubles as workaround only when the canonical `content` field was used.
|
|
9937
|
+
workaround: params.content ? params.description : void 0,
|
|
9937
9938
|
triggerCommand: params.trigger_command
|
|
9938
9939
|
});
|
|
9939
9940
|
sessionMemory.recordMemoryAction("gotcha");
|
|
9940
9941
|
return result;
|
|
9941
9942
|
}
|
|
9943
|
+
if (scope || params.title || params.status || params.trigger_command || params.description) {
|
|
9944
|
+
return '\u274C **Gotcha NOT saved** \u2014 missing `content` (bug description).\n\u2705 Use: kuma_memory({ action: "gotcha", scope: "<file_path>", content: "<what went wrong>", status: "high" })\n- `scope` \u2014 file path where the bug was found\n- `content` \u2014 bug description (required to save)\n- `status` \u2014 low | medium | high | critical';
|
|
9945
|
+
}
|
|
9942
9946
|
const { listGotchas: listGotchas2, syncGotchasToDb: syncGotchasToDb2 } = await Promise.resolve().then(() => (init_kumaGotchas(), kumaGotchas_exports));
|
|
9943
9947
|
await syncGotchasToDb2();
|
|
9944
9948
|
return await listGotchas2({ filePath: params.scope, severity: params.status });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumpslabs/kuma",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
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",
|