savant-code 0.0.13 → 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.
Files changed (4) hide show
  1. package/README.md +216 -153
  2. package/http.js +1 -1
  3. package/launcher.js +6 -5
  4. 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), and designed for local-first use with Ollama or any OpenAI-compatible provider.
6
-
7
- [![GitHub Stars](https://img.shields.io/github/stars/savant0x/savant-code?style=social)](https://github.com/savant0x/savant-code)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](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
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
+ and designed for local-first use with Ollama or any OpenAI-compatible provider.
7
+
8
+ [![GitHub Stars](https://img.shields.io/github/stars/savant0x/savant-code?style=social)](https://github.com/savant0x/savant-code)
9
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](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
@@ -1,6 +1,6 @@
1
+ const fs = require('fs')
1
2
  const http = require('http')
2
3
  const https = require('https')
3
- const fs = require('fs')
4
4
  const { pipeline } = require('stream/promises')
5
5
  const tls = require('tls')
6
6
 
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(tempEnvJsonPath, targetEnvJsonPath, replacements)
851
+ replaceFileWithRollback(
852
+ tempEnvJsonPath,
853
+ targetEnvJsonPath,
854
+ replacements,
855
+ )
855
856
  }
856
857
 
857
858
  replaceFileWithRollback(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "savant-code",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "Multi-Agent AI Coding Assistant with ECHO Protocol",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Savant Code <founders@savant-code.com>",