@plumpslabs/kuma 2.4.19 β 2.4.21
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 +21 -26
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skills/kuma/SKILL.md +72 -0
package/dist/index.js
CHANGED
|
@@ -11438,7 +11438,7 @@ function opencodePluginTemplate() {
|
|
|
11438
11438
|
" }",
|
|
11439
11439
|
"}",
|
|
11440
11440
|
"",
|
|
11441
|
-
"export const KumaPlugin = async () => {",
|
|
11441
|
+
"export const KumaPlugin = async ({ project, client, $, directory, worktree }) => {",
|
|
11442
11442
|
" return {",
|
|
11443
11443
|
' "tool.execute.before": async (input, output) => {',
|
|
11444
11444
|
' const tool = String(input.tool || "").toLowerCase();',
|
|
@@ -11456,12 +11456,10 @@ function opencodePluginTemplate() {
|
|
|
11456
11456
|
" }",
|
|
11457
11457
|
" },",
|
|
11458
11458
|
' "file.edited": async (input) => {',
|
|
11459
|
-
" // Post-edit verify nudge (log channel only \u2014 never blocks).",
|
|
11460
11459
|
' const fp = input.filePath || input.path || (input.file && input.file.path) || "";',
|
|
11461
11460
|
' if (fp) console.warn(`\u{1F43B} [Kuma] ${fp} edited \u2014 consider kuma_safety({ action: "verify", scope: "${fp}" })`);',
|
|
11462
11461
|
" },",
|
|
11463
11462
|
' "experimental.session.compacting": async (input, output) => {',
|
|
11464
|
-
" // Compaction survival set via the native channel (docs: plugins#compaction).",
|
|
11465
11463
|
" try {",
|
|
11466
11464
|
' const { execSync } = await import("node:child_process");',
|
|
11467
11465
|
' const ctx = execSync("kuma hook pre-compact", { encoding: "utf-8", timeout: 8000 });',
|
|
@@ -11472,29 +11470,6 @@ function opencodePluginTemplate() {
|
|
|
11472
11470
|
" },",
|
|
11473
11471
|
" };",
|
|
11474
11472
|
"};",
|
|
11475
|
-
"",
|
|
11476
|
-
"// Server-runtime definition (required by newer OpenCode server).",
|
|
11477
|
-
"// Reuses the same hooks via the named export above.",
|
|
11478
|
-
"const kumaHooks = {",
|
|
11479
|
-
' "tool.execute.before": async (input, output) => {',
|
|
11480
|
-
" const hooks = await KumaPlugin();",
|
|
11481
|
-
' return hooks["tool.execute.before"](input, output);',
|
|
11482
|
-
" },",
|
|
11483
|
-
' "file.edited": async (input) => {',
|
|
11484
|
-
" const hooks = await KumaPlugin();",
|
|
11485
|
-
' return hooks["file.edited"](input);',
|
|
11486
|
-
" },",
|
|
11487
|
-
' "experimental.session.compacting": async (input, output) => {',
|
|
11488
|
-
" const hooks = await KumaPlugin();",
|
|
11489
|
-
' return hooks["experimental.session.compacting"](input, output);',
|
|
11490
|
-
" },",
|
|
11491
|
-
"};",
|
|
11492
|
-
"",
|
|
11493
|
-
"export default {",
|
|
11494
|
-
' id: "kuma",',
|
|
11495
|
-
" setup: async () => kumaHooks,",
|
|
11496
|
-
" effect: async () => kumaHooks,",
|
|
11497
|
-
"};",
|
|
11498
11473
|
""
|
|
11499
11474
|
].join("\n");
|
|
11500
11475
|
}
|
|
@@ -13835,6 +13810,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
13835
13810
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
13836
13811
|
|
|
13837
13812
|
// src/manifest.ts
|
|
13813
|
+
import { ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
13838
13814
|
import { z } from "zod";
|
|
13839
13815
|
|
|
13840
13816
|
// src/tools/kumaContextTool.ts
|
|
@@ -15617,6 +15593,25 @@ function registerAllTools(server) {
|
|
|
15617
15593
|
server.tool("kuma_kuma_safety", safetyDesc, safetySchema, safetyHandler);
|
|
15618
15594
|
console.error("[Manifest] Registered 3 core tools with universal dual-prefix aliases (kuma_* and kuma_kuma_*).");
|
|
15619
15595
|
console.error("[Manifest] Auto-init hooks installed on all tools.");
|
|
15596
|
+
const baseServer = server.server;
|
|
15597
|
+
const existingListHandler = baseServer._requestHandlers?.get("tools/list");
|
|
15598
|
+
if (existingListHandler) {
|
|
15599
|
+
const stripSchemaMeta = (schema) => {
|
|
15600
|
+
if (!schema || typeof schema !== "object") return;
|
|
15601
|
+
for (const key of ["$schema", "$id", "id", "title", "definitions", "$defs"]) {
|
|
15602
|
+
delete schema[key];
|
|
15603
|
+
}
|
|
15604
|
+
};
|
|
15605
|
+
baseServer.removeRequestHandler("tools/list");
|
|
15606
|
+
baseServer.setRequestHandler(ListToolsRequestSchema, async (request, extra) => {
|
|
15607
|
+
const result = await existingListHandler(request, extra);
|
|
15608
|
+
for (const tool of result?.tools ?? []) {
|
|
15609
|
+
stripSchemaMeta(tool.inputSchema);
|
|
15610
|
+
stripSchemaMeta(tool.outputSchema);
|
|
15611
|
+
}
|
|
15612
|
+
return result;
|
|
15613
|
+
});
|
|
15614
|
+
}
|
|
15620
15615
|
}
|
|
15621
15616
|
|
|
15622
15617
|
// src/index.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumpslabs/kuma",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.21",
|
|
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",
|
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.21",
|
|
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",
|
package/skills/kuma/SKILL.md
CHANGED
|
@@ -100,5 +100,77 @@ Record what matters, skip what doesn't.
|
|
|
100
100
|
|
|
101
101
|
π Full rules: `.kuma/init.md`
|
|
102
102
|
|
|
103
|
+
π Read `.kuma/init.md` for detailed rules.
|
|
104
|
+
π Readable state: `.kuma/KNOWN_GOTCHAS.md` (gotchas) Β· `.kuma/memories/decisions.md` (decisions)
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
_Generated by Kuma MCP - https://github.com/plumpslabs/kuma_
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
name: kuma-mcp
|
|
111
|
+
description: Kuma MCP β .kuma/ is the single source of truth
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
Kuma MCP tools: kuma_context, kuma_memory, kuma_safety.
|
|
115
|
+
Record what matters, skip what doesn't.
|
|
116
|
+
|
|
117
|
+
<kuma_obedience>
|
|
118
|
+
## π Obedience β honest model (issue #39)
|
|
119
|
+
- HARNESS-ENFORCED (no choice): MCP schema rejects unknown actions; hooks inject gotchas pre-edit (`kuma hook pre-edit`); SessionStart serves the brief; dirty-flags patch the map post-edit.
|
|
120
|
+
- AGENT-EXPECTED (best-effort ~70%): call `kuma_context({ action: "init" })` first; record gotchas IMMEDIATELY; `kuma_safety({ action: "verify" })` after edits.
|
|
121
|
+
- FALLBACKS: init skipped β lazy brief on first unfamiliar edit; gotcha skipped β auto-gotcha on repeated failures; verify skipped β CI is the backstop (never treat as verified).
|
|
122
|
+
</kuma_obedience>
|
|
123
|
+
|
|
124
|
+
<kuma_workflow>
|
|
125
|
+
π§ **Before coding:** `kuma_context({ action: "init" })`
|
|
126
|
+
πΊοΈ **Monorepo map:** `kuma_context({ action: "map" })`
|
|
127
|
+
π¬ **Unfamiliar code / blast radius:** `kuma_context({ action: "research", scope: "<area>" })` or `kuma_context({ action: "impact", target: "<file>" })`
|
|
128
|
+
π **Found a bug/quirk:** `kuma_memory({ action: "gotcha" })` (IMMEDIATELY)
|
|
129
|
+
π§ **Chose between options:** `kuma_memory({ action: "decision" })`
|
|
130
|
+
π **Traced a flow:** `kuma_memory({ action: "arch_flow" })` (max 5 files)
|
|
131
|
+
π‘οΈ **Before risky work / after edits:** `kuma_safety({ action: "guard" | "verify" })`
|
|
132
|
+
</kuma_workflow>
|
|
133
|
+
|
|
134
|
+
πͺ **Auto-inject (Claude Code):** gotcha/decision/history injected automatically before edits
|
|
135
|
+
via the PreToolUse hook β an empty hook output means the file has no gotchas.
|
|
136
|
+
|
|
137
|
+
π Full rules: `.kuma/init.md`
|
|
138
|
+
|
|
139
|
+
π Read `.kuma/init.md` for detailed rules.
|
|
140
|
+
π Readable state: `.kuma/KNOWN_GOTCHAS.md` (gotchas) Β· `.kuma/memories/decisions.md` (decisions)
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
_Generated by Kuma MCP - https://github.com/plumpslabs/kuma_
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
name: kuma-mcp
|
|
147
|
+
description: Kuma MCP β .kuma/ is the single source of truth
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
Kuma MCP tools: kuma_context, kuma_memory, kuma_safety.
|
|
151
|
+
Record what matters, skip what doesn't.
|
|
152
|
+
|
|
153
|
+
<kuma_obedience>
|
|
154
|
+
## π Obedience β honest model (issue #39)
|
|
155
|
+
- HARNESS-ENFORCED (no choice): MCP schema rejects unknown actions; hooks inject gotchas pre-edit (`kuma hook pre-edit`); SessionStart serves the brief; dirty-flags patch the map post-edit.
|
|
156
|
+
- AGENT-EXPECTED (best-effort ~70%): call `kuma_context({ action: "init" })` first; record gotchas IMMEDIATELY; `kuma_safety({ action: "verify" })` after edits.
|
|
157
|
+
- FALLBACKS: init skipped β lazy brief on first unfamiliar edit; gotcha skipped β auto-gotcha on repeated failures; verify skipped β CI is the backstop (never treat as verified).
|
|
158
|
+
</kuma_obedience>
|
|
159
|
+
|
|
160
|
+
<kuma_workflow>
|
|
161
|
+
π§ **Before coding:** `kuma_context({ action: "init" })`
|
|
162
|
+
πΊοΈ **Monorepo map:** `kuma_context({ action: "map" })`
|
|
163
|
+
π¬ **Unfamiliar code / blast radius:** `kuma_context({ action: "research", scope: "<area>" })` or `kuma_context({ action: "impact", target: "<file>" })`
|
|
164
|
+
π **Found a bug/quirk:** `kuma_memory({ action: "gotcha" })` (IMMEDIATELY)
|
|
165
|
+
π§ **Chose between options:** `kuma_memory({ action: "decision" })`
|
|
166
|
+
π **Traced a flow:** `kuma_memory({ action: "arch_flow" })` (max 5 files)
|
|
167
|
+
π‘οΈ **Before risky work / after edits:** `kuma_safety({ action: "guard" | "verify" })`
|
|
168
|
+
</kuma_workflow>
|
|
169
|
+
|
|
170
|
+
πͺ **Auto-inject (Claude Code):** gotcha/decision/history injected automatically before edits
|
|
171
|
+
via the PreToolUse hook β an empty hook output means the file has no gotchas.
|
|
172
|
+
|
|
173
|
+
π Full rules: `.kuma/init.md`
|
|
174
|
+
|
|
103
175
|
π Read `.kuma/init.md` for detailed rules.
|
|
104
176
|
π Readable state: `.kuma/KNOWN_GOTCHAS.md` (gotchas) Β· `.kuma/memories/decisions.md` (decisions)
|