savant-code 0.0.10 → 0.0.13
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 +153 -107
- package/launcher.js +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,107 +1,153 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
###
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
**
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
# Savant-Code
|
|
2
|
+
|
|
3
|
+
**A terminal-native multi-agent AI coding assistant that audits every change before it touches your repo.**
|
|
4
|
+
|
|
5
|
+
Built with TypeScript/Bun, governed by the [ECHO Protocol](https://github.com/savant0x/savant-code/blob/main/ECHO.md), and designed for local-first use with Ollama or any OpenAI-compatible provider.
|
|
6
|
+
|
|
7
|
+
[](https://github.com/savant0x/savant-code)
|
|
8
|
+
[](https://github.com/savant0x/savant-code/blob/main/LICENSE)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g savant-code
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
cd your-project
|
|
20
|
+
savant-code
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then just start chatting — describe what you want and Savant-Code will read your codebase, plan changes, implement them, and verify the result.
|
|
24
|
+
|
|
25
|
+
## What Makes Savant-Code Different
|
|
26
|
+
|
|
27
|
+
Savant-Code isn't a single AI model guessing at your code. It's a **multi-agent system** where 9 specialized agents coordinate through a strict protocol to audit every change before it touches your files.
|
|
28
|
+
|
|
29
|
+
### The Agent Roster
|
|
30
|
+
|
|
31
|
+
| Agent | Role |
|
|
32
|
+
|-------|------|
|
|
33
|
+
| **Savant** | Orchestrator — routes work, enforces protocol, spawns agents |
|
|
34
|
+
| **Detective** | Discovers bugs and issues with evidence before any code is written |
|
|
35
|
+
| **Forge** | Implements code changes from a converged plan |
|
|
36
|
+
| **Verifier** | Independent double-audit after implementation |
|
|
37
|
+
| **Thinker** | Deep sequential reasoning for complex problems |
|
|
38
|
+
| **Scout** | Explores codebases to gather context |
|
|
39
|
+
| **Researcher** | Web search and documentation lookup |
|
|
40
|
+
| **Recorder** | FID lifecycle management and tracking |
|
|
41
|
+
| **Scribe** | Session summaries and knowledge capture |
|
|
42
|
+
|
|
43
|
+
### ECHO Protocol
|
|
44
|
+
|
|
45
|
+
Every change follows the **ECHO Perfection Loop**:
|
|
46
|
+
|
|
47
|
+
1. **RED** — Identify ALL failures and issues with evidence
|
|
48
|
+
2. **GREEN** — Fix with minimal, surgical changes
|
|
49
|
+
3. **AUDIT** — Independent verification by a separate agent
|
|
50
|
+
4. **COMPLETE** — Document results, archive tracking
|
|
51
|
+
|
|
52
|
+
No code is written without a plan. No plan is accepted without audit. No audit passes without evidence.
|
|
53
|
+
|
|
54
|
+
## Features
|
|
55
|
+
|
|
56
|
+
### Multi-Agent Orchestration
|
|
57
|
+
9 specialized agents coordinate via the ECHO Protocol. Detective finds issues, Forge implements, Verifier audits, Thinker reasons through complex problems, and Recorder tracks everything.
|
|
58
|
+
|
|
59
|
+
### Thinker with Sequential Thinking
|
|
60
|
+
The Thinker agent accumulates stacked reasoning steps, converges to a typed non-null result, and never returns an empty or null output. Each thought builds on the previous one.
|
|
61
|
+
|
|
62
|
+
### Native Tool-Call Hardening
|
|
63
|
+
Fail-closed streaming boundary for incomplete or malformed tool calls. Stale-fragment replacement for placeholder arguments. Permissive coercion of stringified values before strict validation.
|
|
64
|
+
|
|
65
|
+
### Tool Permission Boundary
|
|
66
|
+
Strict allowlist-based tool provisioning. Restricted agents never receive parent-only tools. Each agent has exactly the tools it needs — no more.
|
|
67
|
+
|
|
68
|
+
### Gateway Providers
|
|
69
|
+
Works with Ollama (local-first) and any OpenAI-compatible API:
|
|
70
|
+
- **OpenCode Go** (default) — MiMo 2.5
|
|
71
|
+
- **OpenRouter** — access to hundreds of models
|
|
72
|
+
- **NVIDIA NIM** — enterprise inference
|
|
73
|
+
- **Cloudflare Workers AI** — edge inference
|
|
74
|
+
- **TokenRouter** — multi-provider routing
|
|
75
|
+
- **Any OpenAI-compatible endpoint** — custom providers via `/provider`
|
|
76
|
+
|
|
77
|
+
### Context Compaction
|
|
78
|
+
4-layer progressive auto-compaction keeps your session running through large codebases without hitting context limits.
|
|
79
|
+
|
|
80
|
+
### Rich Terminal UI
|
|
81
|
+
- Streaming token-by-token output
|
|
82
|
+
- Copy buttons on code blocks, tool outputs, and diffs
|
|
83
|
+
- Mode switching (EDIT / ANALYZE / SCAFFOLD)
|
|
84
|
+
- Light/dark theming with Neon Slate aesthetic
|
|
85
|
+
- Provider picker with masked API key input
|
|
86
|
+
- Collapsible sidebar sections
|
|
87
|
+
|
|
88
|
+
### Goal Loop
|
|
89
|
+
Set a goal and a cadence — Savant-Code will check and work toward it on a schedule.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
/goal fix all failing tests
|
|
93
|
+
/loop 5m
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Slash Commands
|
|
97
|
+
|
|
98
|
+
| Command | Description |
|
|
99
|
+
|---------|-------------|
|
|
100
|
+
| `/model` | Switch LLM provider and model |
|
|
101
|
+
| `/provider` | Configure API keys (interactive picker) |
|
|
102
|
+
| `/help` | Show all commands |
|
|
103
|
+
| `/new` | Start a fresh conversation |
|
|
104
|
+
| `/history` | Browse past sessions |
|
|
105
|
+
| `/goal` | Set a persistent goal |
|
|
106
|
+
| `/loop` | Schedule recurring checks |
|
|
107
|
+
| `/telemetry` | Toggle analytics (on/off/status) |
|
|
108
|
+
| `/theme:toggle` | Switch light/dark mode |
|
|
109
|
+
| `/init` | Scaffold agent config files |
|
|
110
|
+
|
|
111
|
+
### Knowledge Files
|
|
112
|
+
Add a `knowledge.md` anywhere in your project to give Savant-Code persistent context about your codebase, conventions, and preferences.
|
|
113
|
+
|
|
114
|
+
## Usage Examples
|
|
115
|
+
|
|
116
|
+
**Implement a feature:**
|
|
117
|
+
> Add a rate limiter to the API endpoints that allows 100 requests per minute per IP address, with Redis-backed counting.
|
|
118
|
+
|
|
119
|
+
**Fix a bug:**
|
|
120
|
+
> The login form crashes on submit when the email field is empty. Find the bug and fix it.
|
|
121
|
+
|
|
122
|
+
**Write tests:**
|
|
123
|
+
> Add unit tests for the UserService class covering all edge cases in the register flow.
|
|
124
|
+
|
|
125
|
+
**Refactor:**
|
|
126
|
+
> Refactor the database connection layer to use connection pooling instead of creating a new connection per request.
|
|
127
|
+
|
|
128
|
+
**Code review:**
|
|
129
|
+
> Review my recent changes and flag any security issues, performance problems, or style violations.
|
|
130
|
+
|
|
131
|
+
## Troubleshooting
|
|
132
|
+
|
|
133
|
+
### Permission Errors
|
|
134
|
+
```bash
|
|
135
|
+
sudo npm install -g savant-code
|
|
136
|
+
```
|
|
137
|
+
Or [reinstall Node](https://nodejs.org/en/download) to fix global permissions.
|
|
138
|
+
|
|
139
|
+
### Corporate Proxy / Firewall
|
|
140
|
+
```bash
|
|
141
|
+
export HTTPS_PROXY=http://your-proxy-server:port
|
|
142
|
+
savant-code
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### No Model Available
|
|
146
|
+
Savant-Code requires at least one LLM provider. Run `/provider` to configure one, or install [Ollama](https://ollama.com) for local inference.
|
|
147
|
+
|
|
148
|
+
## Links
|
|
149
|
+
|
|
150
|
+
- **GitHub:** [github.com/savant0x/savant-code](https://github.com/savant0x/savant-code)
|
|
151
|
+
- **Docs:** [savant-code.com/docs](https://savant-code.com/docs)
|
|
152
|
+
- **Issues:** [GitHub Issues](https://github.com/savant0x/savant-code/issues)
|
|
153
|
+
- **License:** MIT
|
package/launcher.js
CHANGED
|
@@ -840,6 +840,20 @@ function createLauncher(productConfig) {
|
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
842
|
|
|
843
|
+
// Move env.json next to the binary. The binary loads this at startup to
|
|
844
|
+
// determine its runtime environment, so it must live beside the exe.
|
|
845
|
+
const tempEnvJsonPath = path.join(
|
|
846
|
+
CONFIG.tempDownloadDir,
|
|
847
|
+
'env.json',
|
|
848
|
+
)
|
|
849
|
+
if (fs.existsSync(tempEnvJsonPath)) {
|
|
850
|
+
const targetEnvJsonPath = path.join(
|
|
851
|
+
path.dirname(CONFIG.binaryPath),
|
|
852
|
+
'env.json',
|
|
853
|
+
)
|
|
854
|
+
replaceFileWithRollback(tempEnvJsonPath, targetEnvJsonPath, replacements)
|
|
855
|
+
}
|
|
856
|
+
|
|
843
857
|
replaceFileWithRollback(
|
|
844
858
|
metadataTempPath,
|
|
845
859
|
CONFIG.metadataPath,
|