@plumpslabs/kuma 2.0.5
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/LICENSE +21 -0
- package/README.md +159 -0
- package/dist/index.js +4678 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kuma
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="https://raw.githubusercontent.com/plumpslabs/kuma/main/public/kuma.png" alt="Kuma Logo" width="200" />
|
|
4
|
+
|
|
5
|
+
# Kuma
|
|
6
|
+
|
|
7
|
+
**Zero-setup safety toolkit for AI coding agents.**
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@plumpslabs/kuma)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
[](https://nodejs.org/)
|
|
12
|
+
|
|
13
|
+
Works with **Claude Code**, **Cursor**, **Gemini CLI**, **GitHub Copilot**, and any MCP-compatible client.
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
Add to your MCP client config:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"kuma": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["-y", "@plumpslabs/kuma"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
<details>
|
|
36
|
+
<summary><b>Where does this config go?</b></summary>
|
|
37
|
+
|
|
38
|
+
| Client | Config Location |
|
|
39
|
+
|--------|----------------|
|
|
40
|
+
| **Claude Code** | `~/.claude/settings.json` |
|
|
41
|
+
| **Cursor** | Settings → Features → MCP → Add Server |
|
|
42
|
+
| **Gemini CLI** | `~/.gemini/settings.json` |
|
|
43
|
+
| **Copilot / Codex** | VS Code MCP extension settings |
|
|
44
|
+
|
|
45
|
+
</details>
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Kuma's Promise
|
|
50
|
+
|
|
51
|
+
**Kuma is built for one thing: making sure AI agents don't break your project.**
|
|
52
|
+
|
|
53
|
+
Every tool in Kuma has a safety net built-in — not as an afterthought, but as a core design principle. Here's what Kuma guarantees:
|
|
54
|
+
|
|
55
|
+
| # | When this happens... | Kuma does this... |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| 1 | LSP server is not installed | **Falls back to regex** — never hard fails |
|
|
58
|
+
| 2 | An edit breaks something | **Rollback to any version** — versioned backups |
|
|
59
|
+
| 3 | AI loops on a test failure | **Circuit breaker stops it** — prevents infinite retries |
|
|
60
|
+
| 4 | A file path doesn't resolve | **Shows where it looked** — CWD vs project root |
|
|
61
|
+
| 5 | A command is dangerous | **Blocks it** — `rm -rf`, `git push --force`, `curl \| bash` |
|
|
62
|
+
|
|
63
|
+
Most tools make AI smarter. **Kuma makes AI not break things.**
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Tools (16)
|
|
68
|
+
|
|
69
|
+
### 🔍 Context — Understand the codebase
|
|
70
|
+
|
|
71
|
+
| Tool | Description |
|
|
72
|
+
|------|-------------|
|
|
73
|
+
| `smart_grep` | Search code with regex. Returns filename, line, and context. Caches results. |
|
|
74
|
+
| `smart_file_picker` | Read files with smart chunking: `full` (entire file), `smart` (signatures + tail), `outline` (exports only). |
|
|
75
|
+
| `project_structure` | Tree view of project layout. Depth control, folder-only mode, include/exclude patterns. |
|
|
76
|
+
| `git_log` | Structured commit history with optional file filter. |
|
|
77
|
+
| `git_diff` | Structured diff output. Supports staged/unstaged, file filter, ref ranges. |
|
|
78
|
+
| `lsp_query` | Go-to-definition, find references, get type info, or rename symbols via TypeScript Language Server. **Falls back to regex when LSP unavailable.** |
|
|
79
|
+
| `project_conventions` | Auto-detect framework, test runner, package manager, import aliases, **monorepo workspaces**. |
|
|
80
|
+
|
|
81
|
+
### ✏️ Execution — Make changes safely
|
|
82
|
+
|
|
83
|
+
| Tool | Description |
|
|
84
|
+
|------|-------------|
|
|
85
|
+
| `precise_diff_editor` | Search-and-replace with exact → whitespace → fuzzy fallback. **Auto-backup before every edit.** Use `action: "rollback"` to undo. |
|
|
86
|
+
| `batch_file_writer` | Create up to 15 files in one call. Validates paths before writing. |
|
|
87
|
+
| `static_analysis` | Run ESLint / TypeScript / Prettier / Ruff and **parse output into structured results.** Auto-detects tools from project config. |
|
|
88
|
+
|
|
89
|
+
### 🧪 Validation — Verify before breaking
|
|
90
|
+
|
|
91
|
+
| Tool | Description |
|
|
92
|
+
|------|-------------|
|
|
93
|
+
| `execute_safe_test` | Run `test`/`build`/`lint`/`typecheck` with **timeout, circuit breaker, and process tree kill.** |
|
|
94
|
+
| `code_reviewer` | Senior-level static analysis. Focus modes: correctness, conventions, security, performance, and **over-engineering detection.** |
|
|
95
|
+
|
|
96
|
+
### 🧠 Memory — Know what happened
|
|
97
|
+
|
|
98
|
+
| Tool | Description |
|
|
99
|
+
|------|-------------|
|
|
100
|
+
| `get_session_memory` | Session state tracker. Shows modified files, unresolved failures, tool history. Load specific memory topics with `{ topic }`. |
|
|
101
|
+
| `search_session_memory` | **Keyword search** across tool calls, memory files, errors, modified files, and dependency graph. |
|
|
102
|
+
| `write_memory` | Persist project knowledge (decisions, glossary) to `.kuma/memories/`. Append, prepend, or overwrite. |
|
|
103
|
+
| `kuma_reflect` | **Reflection tool** — checks if you're on track, detects drift (edits without tests, loops, unresolved failures), and suggests the next action. |
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Safety
|
|
108
|
+
|
|
109
|
+
| Feature | What it does |
|
|
110
|
+
|---------|-------------|
|
|
111
|
+
| **Sandboxed** | All file operations locked to project directory. Path traversal blocked. System dirs protected. |
|
|
112
|
+
| **Auto-backup** | `.agent-backups/<timestamp>/` snapshot before every edit. Rollback to any version. |
|
|
113
|
+
| **Circuit breaker** | Stops after 3 identical failures. Prevents AI loops. |
|
|
114
|
+
| **Timeout** | All commands have configurable timeout (max 180s). Process tree kill on timeout. |
|
|
115
|
+
| **Command whitelist** | Only `test`, `build`, `lint`, `typecheck`, and explicit custom commands. |
|
|
116
|
+
| **Dangerous pattern blocking** | `rm -rf`, `git push --force`, `npm publish`, `curl \| bash` blocked by default. |
|
|
117
|
+
| **LSP graceful degradation** | When TypeScript Language Server is not installed, LSP tools **fall back to regex** instead of hard failing. |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## What Makes Kuma Unique
|
|
122
|
+
|
|
123
|
+
- **Workflow combo** — `project_conventions + smart_grep + smart_file_picker + precise_diff_editor + execute_safe_test + code_reviewer` as a seamless pipeline.
|
|
124
|
+
- **Safety is default, not optional** — Rollback, circuit breaker, sandbox, timeout, dangerous pattern blocking are built into every tool.
|
|
125
|
+
- **Graceful degradation** — When dependencies are missing (LSP, linters), Kuma falls back instead of crashing.
|
|
126
|
+
- **Over-engineering detection** — `code_reviewer` with `focus: "over-engineering"` catches unnecessary abstractions.
|
|
127
|
+
- **Drift detection** — `kuma_reflect` catches edits without tests, tool-call loops, unresolved failures.
|
|
128
|
+
- **Persistent memory** — Knowledge survives across sessions via `.kuma/memories/`. Auto-generates architecture & conventions docs.
|
|
129
|
+
- **Monorepo awareness** — Detects workspaces, scans `apps/*`, `packages/*`, `services/*`, and pnpm/yarn/npm workspaces.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Kuma's DNA
|
|
134
|
+
|
|
135
|
+
1. **Zero setup, zero friction** — Built-in tools that work without config. No DB, no API key.
|
|
136
|
+
2. **Safety first** — Every tool has a safety net: timeout, circuit breaker, rollback, sandbox.
|
|
137
|
+
3. **Graceful degradation, not crash** — Every tool has a fallback before it fails. LSP unavailable? Regex. File not found? Show resolved paths. Diff mismatch? Whitespace→fuzzy retry. Test fails? Circuit breaker stops the loop.
|
|
138
|
+
4. **Opinionated workflow** — Tools designed to be used together: `conventions → grep → pick → diff → test → review`.
|
|
139
|
+
5. **Minimal surface** — 16 focused tools. Each tool has one job and does it well. No overlap, no confusion.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Contributing
|
|
144
|
+
|
|
145
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
[MIT](LICENSE)
|
|
152
|
+
|
|
153
|
+
<div align="center">
|
|
154
|
+
|
|
155
|
+
**Made with 🐻 for AI agents everywhere**
|
|
156
|
+
|
|
157
|
+
[Report Bug](https://github.com/farhank15/kuma/issues) · [Request Feature](https://github.com/farhank15/kuma/issues)
|
|
158
|
+
|
|
159
|
+
</div>
|