@plumpslabs/kuma 2.4.20 β†’ 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 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,30 +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
- " // NOTE: setup must return hooks synchronously \u2014 never an async",
11496
- " // effect/event-loop. An async effect never resolves and hangs load.",
11497
- " setup: () => kumaHooks,",
11498
- "};",
11499
11473
  ""
11500
11474
  ].join("\n");
11501
11475
  }
@@ -13836,6 +13810,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
13836
13810
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
13837
13811
 
13838
13812
  // src/manifest.ts
13813
+ import { ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
13839
13814
  import { z } from "zod";
13840
13815
 
13841
13816
  // src/tools/kumaContextTool.ts
@@ -15618,6 +15593,25 @@ function registerAllTools(server) {
15618
15593
  server.tool("kuma_kuma_safety", safetyDesc, safetySchema, safetyHandler);
15619
15594
  console.error("[Manifest] Registered 3 core tools with universal dual-prefix aliases (kuma_* and kuma_kuma_*).");
15620
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
+ }
15621
15615
  }
15622
15616
 
15623
15617
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumpslabs/kuma",
3
- "version": "2.4.20",
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.20",
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",
@@ -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)