@plumpslabs/kuma 2.3.33 â 2.4.1
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 +50 -98
- package/dist/index.js +3708 -6492
- 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,101 +43,80 @@ 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
|
-
| `health` | Safety health score | đĄ Linear |
|
|
103
|
-
| `override` | Bypass safety (recorded in audit) | đĄ Linear |
|
|
104
|
-
| `security` | Scan for leaked secrets | đĄ Linear |
|
|
92
|
+
| `security` | Scan for leaked secrets/tokens | đĄ Linear |
|
|
105
93
|
| `gc` | Garbage collect stale data | đĸ Skip |
|
|
106
|
-
| `doctor` | Full health check | đĄ Linear |
|
|
107
|
-
| `policy` | Policy-as-Code engine | đĄ Linear |
|
|
108
94
|
| `ast` / `validate` | AST-based code validation | đĄ Linear |
|
|
109
95
|
| `checkpoint` | Atomic snapshot before refactors | đĄ Linear |
|
|
110
96
|
| `rollback_label` | Restore from checkpoint | đĄ Linear |
|
|
111
|
-
| `contract` | Pre/post-condition checks | đĄ Linear |
|
|
112
97
|
|
|
113
98
|
---
|
|
114
99
|
|
|
115
|
-
##
|
|
100
|
+
## Architecture
|
|
116
101
|
|
|
117
|
-
Kuma
|
|
102
|
+
Kuma exposes exactly **3 coarse-grained tools** â the agent picks an *action*, Kuma runs the internal workflow:
|
|
118
103
|
|
|
119
|
-
|
|
104
|
+
| Tool | Core Actions | Purpose |
|
|
105
|
+
|------|--------------|---------|
|
|
106
|
+
| `kuma_context` | `init`, `research`, `history` | Load project context, understand unfamiliar code |
|
|
107
|
+
| `kuma_memory` | `gotcha`, `decision`, `arch_flow`, `research_save` | Persistent knowledge that saves future sessions |
|
|
108
|
+
| `kuma_safety` | `guard`, `verify` | Pre-risk check, post-edit verification |
|
|
120
109
|
|
|
121
|
-
|
|
122
|
-
|--------------|-------------|
|
|
123
|
-
| `precise_diff_editor` | Agent has native edit tools |
|
|
124
|
-
| `safe_terminal_exec` | Agent executes commands natively |
|
|
125
|
-
| `smart_grep` | Agent searches natively (ripgrep, semantic) |
|
|
126
|
-
| `batch_file_writer` | Agent creates files natively |
|
|
127
|
-
| `ast_validator` (standalone) | Merged into `kuma_safety` as `ast`/`validate` action |
|
|
128
|
-
| `git_diff_analyzer` | Merged into `kuma_context` as `impact` action |
|
|
110
|
+
Everything else is an internal action for power users. The agent uses its **own native tools** for editing, searching, and execution â Kuma is memory & safety, not a code manager.
|
|
129
111
|
|
|
130
|
-
###
|
|
112
|
+
### What Kuma Provides
|
|
131
113
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
| **Session Memory** | Track tool calls, recordings, and efficiency per session |
|
|
139
|
-
| **Guard System** | Real-time monitoring with blocking warnings for anti-patterns |
|
|
140
|
-
| **Self-Healing** | Automatic detection and repair of stale nodes |
|
|
141
|
-
| **Kuma Studio** | Visual dashboard with graph, efficiency, and activity tracking |
|
|
142
|
-
| **Policy-as-Code** | Configurable safety rules in `.kuma/policy.yml` |
|
|
143
|
-
| **Checkpoint/Rollback** | Atomic snapshots before major refactors |
|
|
114
|
+
- **Knowledge Graph** â SQLite + FTS5 full-text search (derived cache)
|
|
115
|
+
- **Session Memory** â track tool calls, recordings, and efficiency per session
|
|
116
|
+
- **Guard System** â real-time monitoring with blocking warnings for anti-patterns
|
|
117
|
+
- **Shadow Injection** â gotchas injected before edits via hooks (zero token waste when clean)
|
|
118
|
+
- **Kuma Studio** â visual dashboard with graph, gotchas, and injection metrics
|
|
119
|
+
- **Checkpoint/Rollback** â atomic snapshots before major refactors
|
|
144
120
|
|
|
145
121
|
---
|
|
146
122
|
|
|
@@ -151,12 +127,10 @@ Kuma Studio is a **web-based dashboard** for visualizing and managing your knowl
|
|
|
151
127
|
### Features
|
|
152
128
|
|
|
153
129
|
- **đ Knowledge Graph** â Interactive node-edge visualization with physics simulation
|
|
154
|
-
- **â Features** â High-level module tracking with owns edges to files
|
|
155
130
|
- **â ī¸ Gotchas** â Known bugs and quirks with severity levels
|
|
156
|
-
- **đ Health** â Project health scores over time
|
|
157
131
|
- **⥠Efficiency** â Session metrics, time saved, verification pass rates
|
|
132
|
+
- **đĒ Injections** â Shadow-memory metrics: injection count + time saved (24h)
|
|
158
133
|
- **đ Staleness** â Detection of stale nodes with missing file references
|
|
159
|
-
- **đ¤ Activity** â Agent usage intensity, success rates, and session history
|
|
160
134
|
|
|
161
135
|
### Usage
|
|
162
136
|
|
|
@@ -195,47 +169,20 @@ Kuma builds a comprehensive knowledge graph with these node types:
|
|
|
195
169
|
| `test` | Test file |
|
|
196
170
|
| `research` | Research cache entry |
|
|
197
171
|
|
|
198
|
-
Edge types include: `
|
|
172
|
+
Edge types include: `contains`, `flows_through`, `owns`, `explains`.
|
|
199
173
|
|
|
200
174
|
---
|
|
201
175
|
|
|
202
176
|
## Safety Layer
|
|
203
177
|
|
|
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
178
|
### Audit Trail
|
|
222
179
|
|
|
223
180
|
Every safety check is logged to the audit trail:
|
|
224
181
|
- Tool name and parameters
|
|
225
182
|
- Risk level (low/medium/high/critical)
|
|
226
|
-
- Policy violations
|
|
227
183
|
- Allowed/blocked decision
|
|
228
184
|
- Duration and metadata
|
|
229
185
|
|
|
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
186
|
---
|
|
240
187
|
|
|
241
188
|
## Workflow
|
|
@@ -272,15 +219,20 @@ Kuma stores all context locally in `.kuma/`:
|
|
|
272
219
|
|
|
273
220
|
```
|
|
274
221
|
.kuma/
|
|
275
|
-
âââ kuma.db # SQLite knowledge graph (WASM)
|
|
276
|
-
âââ init.md # Project
|
|
277
|
-
âââ
|
|
278
|
-
âââ
|
|
279
|
-
âââ
|
|
280
|
-
âââ memories/ # Memory layer
|
|
281
|
-
|
|
222
|
+
âââ kuma.db # SQLite knowledge graph (WASM) â nodes, edges, research cache, changes
|
|
223
|
+
âââ init.md # Project behavioral rules (generated by `kuma init`)
|
|
224
|
+
âââ memory.json # Session state + metrics (auto)
|
|
225
|
+
âââ auto-gotcha.json # Self-learning loop state (auto)
|
|
226
|
+
âââ policy.yml # OPTIONAL safety policy â only read if you create it
|
|
227
|
+
âââ memories/ # Memory layer markdown (decisions.md, arch_flow.md, ...)
|
|
228
|
+
âââ checkpoints/ # Atomic snapshots (label/ with kuma.db + files/)
|
|
229
|
+
âââ scratch/ # Temp debug artifacts (auto, ephemeral)
|
|
282
230
|
```
|
|
283
231
|
|
|
232
|
+
> Hooks are registered in `.claude/settings.json` (PreToolUse) â not stored under `.kuma/`.
|
|
233
|
+
|
|
234
|
+
> Research cache is **not** a folder â it lives in the `research_cache` table inside `kuma.db`.
|
|
235
|
+
|
|
284
236
|
**Key principle:** Context is per-project, per-agent. No shared state between projects.
|
|
285
237
|
|
|
286
238
|
---
|
|
@@ -292,10 +244,10 @@ Kuma stores all context locally in `.kuma/`:
|
|
|
292
244
|
| **Context** | Agent forgets project-specific patterns | Knowledge graph persists across sessions |
|
|
293
245
|
| **Safety** | Agent may break critical code | Policy engine blocks risky operations |
|
|
294
246
|
| **Impact** | Agent doesn't know what's affected | Impact analysis traces dependencies |
|
|
295
|
-
| **Coordination** | Multiple agents conflict |
|
|
247
|
+
| **Coordination** | Multiple agents conflict | Per-agent session state + audit trail avoid collisions |
|
|
296
248
|
| **Memory** | Agent repeats past mistakes | Decision memory + gotchas prevent loops |
|
|
297
|
-
| **Reversibility** | Hard to undo changes |
|
|
298
|
-
| **Staleness** | Knowledge becomes outdated |
|
|
249
|
+
| **Reversibility** | Hard to undo changes | Checkpoint snapshots + selective undo |
|
|
250
|
+
| **Staleness** | Knowledge becomes outdated | Drift detection + gotcha staleness checks flag stale data |
|
|
299
251
|
|
|
300
252
|
---
|
|
301
253
|
|