@plumpslabs/kuma 2.3.33 â 2.3.34
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/README.md +38 -79
- package/dist/index.js +3871 -6281
- package/package.json +1 -1
- package/packages/ide/studio/dist/index.js +24 -10
- package/packages/ide/studio/public/index.html +23 -18
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div align="center">
|
|
3
3
|
|
|
4
4
|
<img src="https://raw.githubusercontent.com/plumpslabs/kuma/main/public/kuma.png" alt="Kuma Logo" width="180" />
|
|
5
|
-
|
|
5
|
+
</div>
|
|
6
6
|
# Kuma
|
|
7
7
|
|
|
8
8
|
**Safety-first context & orchestration engine for AI coding agents.**
|
|
@@ -21,14 +21,11 @@ Kuma is an MCP (Model Context Protocol) server that acts as a **pre-modification
|
|
|
21
21
|
|
|
22
22
|
**The Problem:** AI agents often modify code without understanding the full context â missing dependencies, breaking related features, or repeating past mistakes.
|
|
23
23
|
|
|
24
|
-
**The Solution:** Kuma
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- đĄī¸ **Safety policies** â Configurable rules that block risky operations
|
|
24
|
+
**The Solution:** Kuma is a **shadow memory** that injects *"where is this file fragile and why is it written this way"* right before the agent touches it:
|
|
25
|
+
- đĒ **Auto-inject hooks** â gotchas/decisions/history injected before every edit, zero extra steps
|
|
26
|
+
- đ§ **Knowledge graph** â SQLite-based derived cache (hash-verified, never stale)
|
|
28
27
|
- đ **Decision memory** â ADR-style decision tracking across sessions
|
|
29
|
-
-
|
|
30
|
-
- âŠī¸ **Selective undo** â Symbol-level change tracking for precise reverts
|
|
31
|
-
- đ **Kuma Studio** â Visual dashboard for knowledge graph, efficiency metrics, and activity tracking
|
|
28
|
+
- đ **Kuma Studio** â Visual dashboard for gotchas, decisions, and shadow-memory metrics
|
|
32
29
|
|
|
33
30
|
---
|
|
34
31
|
|
|
@@ -46,69 +43,58 @@ kuma
|
|
|
46
43
|
Kuma auto-generates:
|
|
47
44
|
- `.kuma/init.md` â Project-specific behavioral rules
|
|
48
45
|
- `.kuma/kuma.db` â SQLite knowledge graph (WASM, zero native build)
|
|
49
|
-
- `.kuma/policy.yml` â Customizable safety policies
|
|
50
46
|
- `.skills/` â Skill files for common patterns
|
|
51
47
|
|
|
52
48
|
---
|
|
53
49
|
|
|
54
50
|
## Core Architecture: 3 Pipeline-Driven Tools
|
|
55
51
|
|
|
56
|
-
Kuma
|
|
52
|
+
Kuma provides **3 coarse-grained tools** with impactful actions. Removed gimmick actions (add_node, feature, heal, harvest, session_mine, todo, context, benchmark, domain_rules, layers, noise_policy, lock, override, policy, contract, portability, doctor, gitignore, clean, progressive, sync, visualize, researches) are no longer documented.
|
|
57
53
|
|
|
58
54
|
### đ§ `kuma_context` â Context & Research
|
|
59
55
|
|
|
60
56
|
| Action | Purpose | Impact |
|
|
61
57
|
|--------|---------|--------|
|
|
62
|
-
| `init` |
|
|
63
|
-
| `research` | 5-step pipeline: cache â graph â
|
|
64
|
-
| `
|
|
58
|
+
| `init` | Lean project brief + restore session | đ´ Required first |
|
|
59
|
+
| `research` | 5-step pipeline: cache â graph â scan â impact â decision | đ´ Required before edits |
|
|
60
|
+
| `history` | Why is this file written this way (cross-session trace) | đ´ High |
|
|
61
|
+
| `flow` | Hash-verified derived flow cache (F13) | đ´ High |
|
|
62
|
+
| `impact` | Analyze change effects on related code | đĄ Linear |
|
|
65
63
|
| `navigate` | Trace code flow across files | đĄ Linear |
|
|
66
64
|
| `changes` | View change log for current session | đĄ Linear |
|
|
67
|
-
| `health` | Project health score (0-100) | đĄ Linear |
|
|
68
65
|
| `rollback` | Undo a specific change by ID | đĄ Linear |
|
|
69
|
-
| `sync` | Unified batch state query | đĸ Skip (agent native) |
|
|
70
66
|
| `digest` | Ultra-compact <500 token project briefing | đĄ Linear |
|
|
71
67
|
| `drift` | Detect memory staleness & code drift | đĄ Linear |
|
|
72
|
-
| `
|
|
68
|
+
| `resume` | Load previous session context | đĄ Linear |
|
|
73
69
|
|
|
74
70
|
### đž `kuma_memory` â Decision & Knowledge
|
|
75
71
|
|
|
76
72
|
| Action | Purpose | Impact |
|
|
77
73
|
|--------|---------|--------|
|
|
78
|
-
| `research_save` | Save research findings to cache | đ´ Exponential |
|
|
79
74
|
| `gotcha` | Record bugs/quirks IMMEDIATELY | đ´ Exponential |
|
|
80
75
|
| `arch_flow` | Record architecture flow (max 5 core files) | đ´ Exponential |
|
|
81
76
|
| `decision` | Record ADR-style decision with rationale | đ´ Exponential |
|
|
82
|
-
| `
|
|
77
|
+
| `research_save` | Save research findings to cache | đĄ Linear |
|
|
83
78
|
| `mine` | Mine git history for hidden decisions | đĄ Linear |
|
|
84
79
|
| `session` | View session summary | đĸ Skip |
|
|
85
|
-
| `heal` | Repair stale graph entries | đĄ Linear |
|
|
86
80
|
| `search` | Search knowledge graph | đĄ Linear |
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `benchmark` | Capture/diff performance metrics | đĄ Linear |
|
|
90
|
-
| `domain_rules` | Layer 1: Business rules | đĄ Linear |
|
|
91
|
-
| `layers` | View all 3 memory layers | đĸ Skip |
|
|
81
|
+
| `delete_node` | Remove node/gotcha from graph + table | đĄ Linear |
|
|
82
|
+
| `goal_progress` | Track goal completion | đĸ Skip |
|
|
92
83
|
|
|
93
|
-
### đĄī¸ `kuma_safety` â Safety &
|
|
84
|
+
### đĄī¸ `kuma_safety` â Safety & Verification
|
|
94
85
|
|
|
95
86
|
| Action | Purpose | Impact |
|
|
96
87
|
|--------|---------|--------|
|
|
97
88
|
| `guard` | Detect anti-patterns, drift, runaway loops | đ´ Required |
|
|
98
|
-
| `verify` | Auto-run scoped tests
|
|
89
|
+
| `verify` | Auto-run scoped tests after edits | đ´ High |
|
|
99
90
|
| `check` | Pre-execution safety check | đĄ Linear |
|
|
100
91
|
| `audit` | Query safety audit trail | đĄ Linear |
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `override` | Bypass safety (recorded in audit) | đĄ Linear |
|
|
104
|
-
| `security` | Scan for leaked secrets | đĄ Linear |
|
|
92
|
+
| `health` | Project health score (optional/cosmetic) | đĸ Skip |
|
|
93
|
+
| `security` | Scan for leaked secrets/tokens | đĄ Linear |
|
|
105
94
|
| `gc` | Garbage collect stale data | đĸ Skip |
|
|
106
|
-
| `doctor` | Full health check | đĄ Linear |
|
|
107
|
-
| `policy` | Policy-as-Code engine | đĄ Linear |
|
|
108
95
|
| `ast` / `validate` | AST-based code validation | đĄ Linear |
|
|
109
96
|
| `checkpoint` | Atomic snapshot before refactors | đĄ Linear |
|
|
110
97
|
| `rollback_label` | Restore from checkpoint | đĄ Linear |
|
|
111
|
-
| `contract` | Pre/post-condition checks | đĄ Linear |
|
|
112
98
|
|
|
113
99
|
---
|
|
114
100
|
|
|
@@ -133,13 +119,10 @@ Kuma V3 is a major evolution focusing on **simplicity, safety, and agent-native
|
|
|
133
119
|
|---------|-------------|
|
|
134
120
|
| **3 Coarse-Grained Tools** | Simplified API: `kuma_context`, `kuma_memory`, `kuma_safety` |
|
|
135
121
|
| **Pipeline-Driven Actions** | Each action triggers internal multi-step workflows |
|
|
136
|
-
| **Knowledge Graph** | SQLite + FTS5 full-text search with WASM engine |
|
|
137
|
-
| **Feature Recording** | Auto-detect and record high-level features with `owns` edges |
|
|
122
|
+
| **Knowledge Graph** | SQLite + FTS5 full-text search with WASM engine (derived cache) |
|
|
138
123
|
| **Session Memory** | Track tool calls, recordings, and efficiency per session |
|
|
139
124
|
| **Guard System** | Real-time monitoring with blocking warnings for anti-patterns |
|
|
140
|
-
| **
|
|
141
|
-
| **Kuma Studio** | Visual dashboard with graph, efficiency, and activity tracking |
|
|
142
|
-
| **Policy-as-Code** | Configurable safety rules in `.kuma/policy.yml` |
|
|
125
|
+
| **Kuma Studio** | Visual dashboard with graph, gotchas, and injection metrics |
|
|
143
126
|
| **Checkpoint/Rollback** | Atomic snapshots before major refactors |
|
|
144
127
|
|
|
145
128
|
---
|
|
@@ -151,12 +134,10 @@ Kuma Studio is a **web-based dashboard** for visualizing and managing your knowl
|
|
|
151
134
|
### Features
|
|
152
135
|
|
|
153
136
|
- **đ Knowledge Graph** â Interactive node-edge visualization with physics simulation
|
|
154
|
-
- **â Features** â High-level module tracking with owns edges to files
|
|
155
137
|
- **â ī¸ Gotchas** â Known bugs and quirks with severity levels
|
|
156
|
-
- **đ Health** â Project health scores over time
|
|
157
138
|
- **⥠Efficiency** â Session metrics, time saved, verification pass rates
|
|
139
|
+
- **đĒ Injections** â Shadow-memory metrics: injection count + time saved (24h)
|
|
158
140
|
- **đ Staleness** â Detection of stale nodes with missing file references
|
|
159
|
-
- **đ¤ Activity** â Agent usage intensity, success rates, and session history
|
|
160
141
|
|
|
161
142
|
### Usage
|
|
162
143
|
|
|
@@ -195,47 +176,20 @@ Kuma builds a comprehensive knowledge graph with these node types:
|
|
|
195
176
|
| `test` | Test file |
|
|
196
177
|
| `research` | Research cache entry |
|
|
197
178
|
|
|
198
|
-
Edge types include: `
|
|
179
|
+
Edge types include: `contains`, `flows_through`, `owns`, `explains`.
|
|
199
180
|
|
|
200
181
|
---
|
|
201
182
|
|
|
202
183
|
## Safety Layer
|
|
203
184
|
|
|
204
|
-
### Policy Engine
|
|
205
|
-
|
|
206
|
-
Configure safety rules in `.kuma/policy.yml`:
|
|
207
|
-
|
|
208
|
-
```yaml
|
|
209
|
-
rules:
|
|
210
|
-
- name: "No production databases"
|
|
211
|
-
pattern: "DROP TABLE|DELETE FROM.*WHERE 1"
|
|
212
|
-
action: block
|
|
213
|
-
message: "Production database modifications blocked"
|
|
214
|
-
|
|
215
|
-
- name: "Require tests before deploy"
|
|
216
|
-
pattern: "git push"
|
|
217
|
-
require: "kuma_safety({ action: 'verify' })"
|
|
218
|
-
message: "Run tests before pushing"
|
|
219
|
-
```
|
|
220
|
-
|
|
221
185
|
### Audit Trail
|
|
222
186
|
|
|
223
187
|
Every safety check is logged to the audit trail:
|
|
224
188
|
- Tool name and parameters
|
|
225
189
|
- Risk level (low/medium/high/critical)
|
|
226
|
-
- Policy violations
|
|
227
190
|
- Allowed/blocked decision
|
|
228
191
|
- Duration and metadata
|
|
229
192
|
|
|
230
|
-
### Multi-Agent Lock
|
|
231
|
-
|
|
232
|
-
Prevent conflicts when multiple agents work on the same project:
|
|
233
|
-
```bash
|
|
234
|
-
kuma_safety({ action: 'lock', acquire: true })
|
|
235
|
-
# ... work ...
|
|
236
|
-
kuma_safety({ action: 'lock', release: true })
|
|
237
|
-
```
|
|
238
|
-
|
|
239
193
|
---
|
|
240
194
|
|
|
241
195
|
## Workflow
|
|
@@ -272,15 +226,20 @@ Kuma stores all context locally in `.kuma/`:
|
|
|
272
226
|
|
|
273
227
|
```
|
|
274
228
|
.kuma/
|
|
275
|
-
âââ kuma.db # SQLite knowledge graph (WASM)
|
|
276
|
-
âââ init.md # Project
|
|
277
|
-
âââ
|
|
278
|
-
âââ
|
|
279
|
-
âââ
|
|
280
|
-
âââ memories/ # Memory layer
|
|
281
|
-
|
|
229
|
+
âââ kuma.db # SQLite knowledge graph (WASM) â nodes, edges, research cache, changes
|
|
230
|
+
âââ init.md # Project behavioral rules (generated by `kuma init`)
|
|
231
|
+
âââ memory.json # Session state + metrics (auto)
|
|
232
|
+
âââ auto-gotcha.json # Self-learning loop state (auto)
|
|
233
|
+
âââ policy.yml # OPTIONAL safety policy â only read if you create it
|
|
234
|
+
âââ memories/ # Memory layer markdown (decisions.md, arch_flow.md, ...)
|
|
235
|
+
âââ checkpoints/ # Atomic snapshots (label/ with kuma.db + files/)
|
|
236
|
+
âââ scratch/ # Temp debug artifacts (auto, ephemeral)
|
|
282
237
|
```
|
|
283
238
|
|
|
239
|
+
> Hooks are registered in `.claude/settings.json` (PreToolUse) â not stored under `.kuma/`.
|
|
240
|
+
|
|
241
|
+
> Research cache is **not** a folder â it lives in the `research_cache` table inside `kuma.db`.
|
|
242
|
+
|
|
284
243
|
**Key principle:** Context is per-project, per-agent. No shared state between projects.
|
|
285
244
|
|
|
286
245
|
---
|
|
@@ -292,10 +251,10 @@ Kuma stores all context locally in `.kuma/`:
|
|
|
292
251
|
| **Context** | Agent forgets project-specific patterns | Knowledge graph persists across sessions |
|
|
293
252
|
| **Safety** | Agent may break critical code | Policy engine blocks risky operations |
|
|
294
253
|
| **Impact** | Agent doesn't know what's affected | Impact analysis traces dependencies |
|
|
295
|
-
| **Coordination** | Multiple agents conflict |
|
|
254
|
+
| **Coordination** | Multiple agents conflict | Per-agent session state + audit trail avoid collisions |
|
|
296
255
|
| **Memory** | Agent repeats past mistakes | Decision memory + gotchas prevent loops |
|
|
297
|
-
| **Reversibility** | Hard to undo changes |
|
|
298
|
-
| **Staleness** | Knowledge becomes outdated |
|
|
256
|
+
| **Reversibility** | Hard to undo changes | Checkpoint snapshots + selective undo |
|
|
257
|
+
| **Staleness** | Knowledge becomes outdated | Drift detection + gotcha staleness checks flag stale data |
|
|
299
258
|
|
|
300
259
|
---
|
|
301
260
|
|