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