sapper-iq 1.1.38 โ†’ 1.1.39

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 +401 -88
  2. package/package.json +2 -1
  3. package/sapper-ui.mjs +66 -19
  4. package/sapper.mjs +1456 -211
package/README.md CHANGED
@@ -1,71 +1,379 @@
1
1
  # Sapper
2
2
 
3
- ๐Ÿš€ **AI-powered development assistant that executes commands and builds projects**
3
+ [![npm version](https://img.shields.io/npm/v/sapper-iq.svg?style=flat-square)](https://www.npmjs.com/package/sapper-iq)
4
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen?style=flat-square)](https://nodejs.org)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](LICENSE)
6
+ [![npm downloads](https://img.shields.io/npm/dm/sapper-iq?style=flat-square)](https://www.npmjs.com/package/sapper-iq)
4
7
 
5
- Sapper is a command-line interface that connects to Ollama models to help you build, manage, and execute development tasks through natural language conversations.
8
+ **Terminal-first AI coding assistant for real developer workflows.**
9
+
10
+ Sapper is a Node.js CLI that connects to locally running Ollama models and acts as an autonomous development agent โ€” reading, writing, searching, running shell commands, managing git, and browsing the web, all from a single conversational interface in your terminal.
11
+
12
+ ---
13
+
14
+ ## Table of Contents
15
+
16
+ - [Terminal Interface](#terminal-interface)
17
+ - [Architecture](#architecture)
18
+ - [Features](#features)
19
+ - [Prerequisites](#prerequisites)
20
+ - [Installation](#installation)
21
+ - [Quick Start](#quick-start)
22
+ - [How It Works](#how-it-works)
23
+ - [Commands](#commands)
24
+ - [Tool Catalog](#tool-catalog)
25
+ - [Agents and Skills](#agents-and-skills)
26
+ - [Configuration](#configuration)
27
+ - [Session Memory](#session-memory)
28
+ - [Development](#development)
29
+ - [License](#license)
30
+
31
+ ---
32
+
33
+ ## Terminal Interface
34
+
35
+ Sapper presents three distinct screens during a session, each with a focused purpose.
36
+
37
+ ### Startup โ€” Session Dashboard
38
+
39
+ When Sapper launches it immediately displays the full state of the current working directory before asking for any input.
40
+
41
+ ```
42
+ Sapper terminal workspace
43
+ Local models, live tools, and focused coding in one loop
44
+ /your/project ยท v1.1.38
45
+
46
+ Quick start @file attach ยท /help commands ยท /agents modes
47
+
48
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
49
+ โ”‚ [workspace] 5 files ยท 0 symbols ยท indexed 36103m ago โ”‚
50
+ โ”‚ [memory] .sapper/ ยท auto-attach on โ”‚
51
+ โ”‚ [prompt] default prompt โ”‚
52
+ โ”‚ [thinking] mode auto โ”‚
53
+ โ”‚ [tools] limit 40 rounds โ”‚
54
+ โ”‚ [shell] stream on ยท bg auto ยท 0 active โ”‚
55
+ โ”‚ [stream] heartbeat on ยท phases on โ”‚
56
+ โ”‚ [summary] phases on ยท trigger 65% โ”‚
57
+ โ”‚ [agents] 3 ยท [skills] 2 โ”‚
58
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
59
+
60
+ Previous session found in .sapper/context.json
61
+ Resume session? [y/N]
62
+ ```
63
+
64
+ The dashboard shows workspace indexing state, memory configuration, active agents and skills count, shell mode, and context summarization trigger. If a previous session exists, Sapper offers to resume it.
65
+
66
+ ---
67
+
68
+ ### Model Selection โ€” Interactive Picker
69
+
70
+ Before each session, Sapper reads the locally available Ollama models and presents an interactive picker. Models are listed with their disk footprint and last-used time.
71
+
72
+ ```
73
+ Model selection use โ†‘โ†“ or j/k, enter to confirm
74
+
75
+ > 01 gemma4:e4b-mlx-bf16 14.9 GB ยท 54m ago
76
+ 02 qwen3.6:35b-a3b-coding-nvfp4 20.4 GB ยท 9d ago
77
+ 03 gemma-4-E4B-it-heretic-GGUF 7.48 GB ยท 13d ago ยท 7.5B
78
+ 04 qwen3-14b-abliterated:q8_0 14.6 GB ยท 13d ago ยท 14.8B
79
+ 05 qwen3.5:4b-mlx-bf16 8.47 GB ยท 18d ago
80
+
81
+ Preview
82
+ Selected gemma4:e4b-mlx-bf16
83
+ Footprint 14.9 GB
84
+ Updated 54m ago
85
+ Profile safetensors
86
+ Quant default
87
+ ```
88
+
89
+ Keyboard controls: `โ†‘` `โ†“` or `j` / `k` to navigate, `Enter` to confirm. A live preview panel shows model metadata before committing.
90
+
91
+ ---
92
+
93
+ ### Active Session โ€” Context Bar
94
+
95
+ Once a model is selected the prompt loop begins. A persistent context bar at the bottom of each turn shows token consumption against the configured limit.
96
+
97
+ ```
98
+ Session
99
+
100
+ [model] gemma4:e4b-mlx-bf16
101
+ [tools] native tool calling
102
+ [context] 35,000 tokens (custom limit, model: 131,072)
103
+
104
+ [gemma4] [default] [2% ctx]
105
+ โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 765 / 35,000 tokens
106
+ >
107
+ ```
108
+
109
+ The bar updates after every turn. When usage approaches the configured `summarizeTriggerPercent` threshold, Sapper automatically compresses older turns into a summary and continues without interruption.
110
+
111
+ ---
112
+
113
+ ### .sapper/ Data Folder
114
+
115
+ All persistent state is isolated inside `.sapper/` at the root of each project, keeping your workspace clean.
116
+
117
+ ```
118
+ .sapper/
119
+ โ”œโ”€โ”€ config.json runtime configuration (hot-reload)
120
+ โ”œโ”€โ”€ context.json conversation history for session resume
121
+ โ”œโ”€โ”€ embeddings.json semantic vector memory, cosine similarity recall
122
+ โ”œโ”€โ”€ workspace.json file index and dependency graph
123
+ โ”œโ”€โ”€ agents/ custom agent definitions (.md + YAML frontmatter)
124
+ โ”œโ”€โ”€ skills/ reusable instruction blocks (.md + YAML frontmatter)
125
+ โ””โ”€โ”€ logs/ per-session activity audit logs (.md)
126
+ ```
127
+
128
+ ---
129
+
130
+ ## Architecture
131
+
132
+ ```
133
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
134
+ โ”‚ SAPPER CLI โ”‚
135
+ โ”‚ โ”‚
136
+ โ”‚ User Input โ”€โ”€โ–บ Prompt Builder โ”€โ”€โ–บ Ollama API โ”‚
137
+ โ”‚ โ”‚ โ”‚ โ”‚
138
+ โ”‚ Context / Memory Streaming โ”‚
139
+ โ”‚ Embeddings Response โ”‚
140
+ โ”‚ Agent / Skills โ”‚ โ”‚
141
+ โ”‚ โ”‚ โ–ผ โ”‚
142
+ โ”‚ Tool Parser โ—„โ”€โ”€โ”€โ”€ AI Response โ”‚
143
+ โ”‚ โ”‚ โ”‚
144
+ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
145
+ โ”‚ โ–ผ โ–ผ โ–ผ โ”‚
146
+ โ”‚ File System Shell Git / Web โ”‚
147
+ โ”‚ READ WRITE PATCH SHELL SHELL(bg) COMMIT PUSH FETCH โ”‚
148
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
149
+ ```
150
+
151
+ ```
152
+ .sapper/
153
+ โ”œโ”€โ”€ config.json โ† Runtime configuration
154
+ โ”œโ”€โ”€ context.json โ† Conversation history
155
+ โ”œโ”€โ”€ embeddings.json โ† Vector memory store
156
+ โ”œโ”€โ”€ workspace.json โ† Project dependency graph
157
+ โ”œโ”€โ”€ agents/ โ† Custom agent definitions (.md)
158
+ โ”œโ”€โ”€ skills/ โ† Reusable skill definitions (.md)
159
+ โ””โ”€โ”€ logs/ โ† Per-session activity logs (.md)
160
+ ```
161
+
162
+ ---
6
163
 
7
164
  ## Features
8
165
 
9
- - ๐Ÿค– **AI-powered assistance** - Chat with local Ollama models
10
- - ๐Ÿ› ๏ธ **Multi-tool execution** - File operations, shell commands, directory management
11
- - ๐Ÿ’ฌ **Conversational interface** - Natural language project management
12
- - ๐Ÿ”„ **Session persistence** - Resume previous conversations
13
- - ๐ŸŽฏ **Context-aware** - Automatically detects directory contents
14
- - โšก **Live streaming** - See AI responses in real-time
15
- - ๐Ÿ”’ **Security prompts** - Review commands before execution
16
- - โœ๏ธ **Inline approval feedback** - Type feedback, or use `f` and `e` shortcuts at shell or file approval prompts, to make Sapper revise the command or change
17
- - ๐Ÿงต **Background shell sessions** - Long-running commands can hand off to tracked background sessions with chunked output inspection
166
+ | Area | Capability |
167
+ |---|---|
168
+ | AI Integration | Connects to any local Ollama model; model picker on startup |
169
+ | Tool Execution | 28 built-in tools covering files, shell, git, and web |
170
+ | Context Management | Auto-summarization when context window approaches limit |
171
+ | Session Memory | Embedding-based semantic memory with cosine similarity recall |
172
+ | Agents & Skills | Custom `.md` agent files with YAML frontmatter and tool restrictions |
173
+ | Background Shell | Long-running commands hand off to tracked background sessions |
174
+ | Approval Gate | Prompted approval with inline feedback for shell and write operations |
175
+ | Activity Logging | Every tool call and AI turn is logged to `.sapper/logs/` |
176
+ | AST Parsing | Symbol extraction (functions, classes) with `/symbol` search |
177
+ | Streaming | Live token-by-token output with heartbeat and phase status |
178
+
179
+ ---
18
180
 
19
- ## Installation
181
+ ## Prerequisites
182
+
183
+ - [Node.js](https://nodejs.org) >= 16.0.0
184
+ - [Ollama](https://ollama.ai) installed and running locally
185
+ - At least one model pulled, for example:
20
186
 
21
187
  ```bash
22
- npm install -g sapper
188
+ ollama pull llama3
23
189
  ```
24
190
 
25
- ## Prerequisites
191
+ ---
26
192
 
27
- - Node.js 16+
28
- - [Ollama](https://ollama.ai/) installed and running
29
- - At least one Ollama model downloaded
193
+ ## Installation
30
194
 
31
- ## Usage
195
+ ```bash
196
+ npm install -g sapper-iq
197
+ ```
198
+
199
+ ---
200
+
201
+ ## Quick Start
32
202
 
33
203
  ```bash
34
204
  sapper
35
205
  ```
36
206
 
37
- ### Commands
207
+ Sapper will prompt you to select a model, then you can start conversing immediately.
38
208
 
39
- - `/reset` or `/clear-session` - Start a new session
40
- - `/session-info` - Show current session details
41
- - `/summary` - View or change auto-summary settings
42
- - `/shell` - Inspect shell config and tracked background sessions
43
- - `/shell read <id>` - Read output from a tracked shell session
44
- - `/shell stop <id>` - Stop a tracked shell session
45
- - `/step` - Toggle step-by-step mode
46
- - `/help` - Show command help
47
- - `exit` - Exit Sapper
48
-
49
- ### Example Interactions
209
+ ```
210
+ Model: llama3
211
+ Working directory: /your/project
50
212
 
51
- ```text
52
- > set up a React project in ./my-app
53
- > run the development server
54
- > create a login component with TypeScript
55
- > add Tailwind CSS styling
213
+ > analyze this project and list what it does
214
+ > add a REST endpoint for user authentication
215
+ > run the tests and fix any failures
216
+ > commit the changes with a descriptive message
56
217
  ```
57
218
 
219
+ ---
220
+
58
221
  ## How It Works
59
222
 
60
- 1. **Connect to Ollama** - Choose from your available local models
61
- 2. **Natural conversation** - Describe what you want to build or do
62
- 3. **AI executes tools** - Creates files, runs commands, manages projects
63
- 4. **Review & approve** - Security prompts for shell commands
64
- 5. **Context awareness** - Sapper understands your project structure
223
+ ```
224
+ User prompt
225
+ โ”‚
226
+ โ–ผ
227
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
228
+ โ”‚ 1. Build system prompt โ”‚
229
+ โ”‚ - Core instructions โ”‚
230
+ โ”‚ - Active agent / skills โ”‚
231
+ โ”‚ - Workspace context โ”‚
232
+ โ”‚ - Conversation history โ”‚
233
+ โ”‚ - Semantic memory recall โ”‚
234
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
235
+ โ”‚
236
+ โ–ผ
237
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
238
+ โ”‚ 2. Stream response from Ollama โ”‚
239
+ โ”‚ - Parse tool calls in real time โ”‚
240
+ โ”‚ - Execute tools as they arrive โ”‚
241
+ โ”‚ - Feed results back to model โ”‚
242
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
243
+ โ”‚
244
+ โ–ผ
245
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
246
+ โ”‚ 3. Tool execution loop โ”‚
247
+ โ”‚ - Approval prompts for โ”‚
248
+ โ”‚ shell / write operations โ”‚
249
+ โ”‚ - Inline feedback to revise โ”‚
250
+ โ”‚ - Loop until no more tool calls โ”‚
251
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
252
+ โ”‚
253
+ โ–ผ
254
+ Final answer rendered
255
+ to terminal with syntax
256
+ highlighting and markdown
257
+ ```
258
+
259
+ ---
260
+
261
+ ## Commands
262
+
263
+ Run these inside Sapper at the prompt:
264
+
265
+ | Command | Description |
266
+ |---|---|
267
+ | `/help` | Show all available commands |
268
+ | `/reset` | Start a new conversation session |
269
+ | `/clear-session` | Alias for `/reset` |
270
+ | `/session-info` | Display current session metadata |
271
+ | `/summary` | View or change auto-summarization settings |
272
+ | `/summary phases off` | Hide summarization step list |
273
+ | `/summary trigger 60` | Set summarization trigger to 60 % of context |
274
+ | `/shell` | Inspect shell config and list tracked background sessions |
275
+ | `/shell read <id>` | Read buffered output from a background session |
276
+ | `/shell stop <id>` | Stop a tracked background shell session |
277
+ | `/step` | Toggle step-by-step tool approval mode |
278
+ | `/tools` | Browse the built-in tool catalog |
279
+ | `/git` | Inspect repository state and git shortcuts |
280
+ | `/symbol <name>` | Search for a code symbol via AST index |
281
+ | `/recall <query>` | Search semantic memory for past context |
282
+ | `/log` | View the current session activity log |
283
+ | `/attach <file>` | Attach a file to the next prompt |
284
+ | `exit` | Exit Sapper |
285
+
286
+ ---
287
+
288
+ ## Tool Catalog
289
+
290
+ ### File System
291
+
292
+ | Tool | Description |
293
+ |---|---|
294
+ | `READ` | Read a file's full contents |
295
+ | `CAT` | Alias for READ |
296
+ | `HEAD` | Read the first N lines of a file |
297
+ | `TAIL` | Read the last N lines of a file |
298
+ | `WRITE` | Create or overwrite a file |
299
+ | `PATCH` | Replace a specific block of text inside an existing file |
300
+ | `MKDIR` | Create a directory tree |
301
+ | `RMDIR` | Remove a directory (requires user approval) |
302
+ | `LIST` / `LS` | List directory contents |
303
+ | `FIND` | Find files and directories by name pattern |
304
+ | `SEARCH` / `GREP` | Search file contents with regex |
305
+ | `PWD` | Show the current tool working directory |
306
+ | `CD` | Change the tool working directory |
307
+
308
+ ### Shell
309
+
310
+ | Tool | Description |
311
+ |---|---|
312
+ | `SHELL` | Execute a terminal command, with optional background handoff |
313
+
314
+ ### Git
315
+
316
+ | Tool | Description |
317
+ |---|---|
318
+ | `STATUS` | Show concise git status |
319
+ | `CHANGES` | Show git status and diffs |
320
+ | `BRANCH` | List, create, or switch branches (changes require approval) |
321
+ | `COMMIT` | Create a git commit (requires approval) |
322
+ | `STASH` | List or apply/drop stashes (state changes require approval) |
323
+ | `TAG` | List, inspect, create, or delete tags (changes require approval) |
324
+ | `PUSH` | Push a branch to a remote (requires approval) |
325
+
326
+ ### Web
327
+
328
+ | Tool | Description |
329
+ |---|---|
330
+ | `FETCH` | Fetch a web page as plain readable text |
331
+ | `FETCH_MAIN` | Extract main article body from a web page |
332
+ | `FETCH_MULTI` | Fetch multiple URLs in one call |
333
+ | `OPEN` | Open a URL in the default browser (requires approval) |
334
+
335
+ ### Interaction
336
+
337
+ | Tool | Description |
338
+ |---|---|
339
+ | `ASK` | Pause and ask the user a clarifying question mid-task |
340
+ | `MEMORY` | Search saved semantic memory from past sessions |
341
+
342
+ ---
343
+
344
+ ## Agents and Skills
345
+
346
+ Sapper supports custom agents and reusable skills defined as Markdown files with YAML frontmatter, stored in `.sapper/agents/` and `.sapper/skills/`.
347
+
348
+ **Example agent** โ€” `.sapper/agents/backend.md`:
349
+
350
+ ```markdown
351
+ ---
352
+ name: Backend Engineer
353
+ description: Focused on API design, database queries, and server-side code
354
+ tools: [read, write, patch, shell, search, find, git]
355
+ ---
356
+
357
+ You are a senior backend engineer. Prefer typed interfaces, validate inputs at boundaries,
358
+ and write efficient SQL. Always check existing patterns before introducing new abstractions.
359
+ ```
360
+
361
+ Frontmatter fields:
362
+
363
+ | Field | Description |
364
+ |---|---|
365
+ | `name` | Display name for the agent |
366
+ | `description` | Short description shown in the agent picker |
367
+ | `tools` | Comma-separated list of allowed tools (restricts the default set) |
368
+ | `model` | Override the active Ollama model for this agent |
369
+
370
+ Skills follow the same format and are injected into the system prompt as reusable instruction blocks.
371
+
372
+ ---
65
373
 
66
- ## Config
374
+ ## Configuration
67
375
 
68
- Sapper creates `.sapper/config.json` on first run. You can tune context behavior there.
376
+ Sapper writes `.sapper/config.json` on first run. All fields are optional; missing values use the defaults shown below.
69
377
 
70
378
  ```json
71
379
  {
@@ -90,71 +398,76 @@ Sapper creates `.sapper/config.json` on first run. You can tune context behavior
90
398
  },
91
399
  "prompt": {
92
400
  "prepend": "",
93
- "append": "Prefer concise answers.",
401
+ "append": "",
94
402
  "coreOverride": ""
95
403
  }
96
404
  }
97
405
  ```
98
406
 
99
- - `toolRoundLimit`: maximum tool-call rounds Sapper will allow in one prompt loop before it forces a final answer. Default: `40`.
100
- - `summaryPhases`: show or hide the step-by-step auto-summary progress list.
101
- - `summarizeTriggerPercent`: start summarizing older context near this percentage of the active context window. Lower values summarize earlier and reduce large-context pauses.
102
- - `shell.streamToModel`: include shell output chunks in tool results when a command is handed off to a background session.
103
- - `shell.backgroundMode`: three modes: `off`, `auto`, or `on`. `off` keeps commands fully attached so you keep seeing live shell output in the terminal. `auto` backgrounds likely long-running commands like dev servers; `on` applies the timeout to every shell command.
104
- - `shell.backgroundAfterSeconds`: how long Sapper waits before handing an eligible running command off to a background shell session.
105
- - `shell.outputChunkChars`: maximum shell output chunk size returned to the model for background handoffs and session reads.
106
- - `thinking.mode`: three modes: `auto`, `on`, or `off`. `auto` skips long reasoning blocks for simple prompts, `on` always enables reasoning for every prompt, and `off` disables it for every prompt. This controls model reasoning visibility, not shell backgrounding.
107
- - `streaming.showPhaseStatus`: show short status lines when Sapper is finalizing output, executing tools, or looping for the next model turn.
108
- - `streaming.showHeartbeat`: keep updating the live progress line during quiet streamed phases instead of looking frozen.
109
- - `streaming.idleNoticeSeconds`: print an idle notice after this many seconds without visible streamed output.
110
- - `prompt.prepend`: insert custom instructions before the default Sapper prompt.
111
- - `prompt.append`: add custom instructions near the end of the system prompt.
112
- - `prompt.coreOverride`: replace the default Sapper core prompt block while keeping the tool, context, agent, and skill sections.
407
+ | Key | Default | Description |
408
+ |---|---|---|
409
+ | `autoAttach` | `true` | Automatically include directory contents in context |
410
+ | `contextLimit` | `null` | Override the model's context window size in tokens |
411
+ | `toolRoundLimit` | `40` | Maximum tool-call rounds before forcing a final answer |
412
+ | `summaryPhases` | `true` | Show step list during auto-summarization |
413
+ | `summarizeTriggerPercent` | `65` | Summarize when context reaches this % of the window |
414
+ | `shell.streamToModel` | `true` | Stream shell output chunks back to the model in background mode |
415
+ | `shell.backgroundMode` | `"auto"` | `off` โ€” always attached; `auto` โ€” background long commands; `on` โ€” background everything |
416
+ | `shell.backgroundAfterSeconds` | `8` | Seconds before a running command is handed off to a background session |
417
+ | `shell.outputChunkChars` | `4000` | Max chars per background shell output chunk returned to the model |
418
+ | `thinking.mode` | `"auto"` | `auto` / `on` / `off` โ€” controls model reasoning block visibility |
419
+ | `streaming.showPhaseStatus` | `true` | Show status lines during tool execution and model turns |
420
+ | `streaming.showHeartbeat` | `true` | Update progress line during quiet streaming phases |
421
+ | `streaming.idleNoticeSeconds` | `4` | Print an idle notice after N seconds of no visible output |
422
+ | `prompt.prepend` | `""` | Inject custom instructions before the default system prompt |
423
+ | `prompt.append` | `""` | Inject custom instructions after the default system prompt |
424
+ | `prompt.coreOverride` | `""` | Replace the core prompt block entirely (tool and context sections are preserved) |
425
+
426
+ Configuration is hot-reloaded โ€” edit the file while Sapper is running and changes take effect on the next prompt turn.
427
+
428
+ ---
429
+
430
+ ## Session Memory
431
+
432
+ Sapper maintains two layers of memory per project:
113
433
 
114
- You can also change these inside Sapper with `/summary`, for example `/summary phases off` or `/summary trigger 60`.
115
- Prompt config is read from `.sapper/config.json` and Sapper refreshes it on the next turn if you edit the file while it is running.
116
- Background shell sessions are controlled through `run_shell` with `__shell_list__`, `__shell_read__ <session_id>`, and `__shell_stop__ <session_id>`.
117
- You can also inspect them directly in Sapper with `/shell`, `/shell read <session_id>`, and `/shell stop <session_id>`.
118
-
119
- ## Supported Tools
120
-
121
- - `SHELL` - Execute terminal commands
122
- - `READ` - Read file contents
123
- - `WRITE` - Create/edit files
124
- - `MKDIR` - Create directories
125
- - `LIST` - List directory contents
126
- - `SEARCH` - Search for text in files
127
-
128
- ## Examples
129
-
130
- **Create a Next.js project:**
131
-
132
- ```text
133
- > create a Next.js app with TypeScript and Tailwind in ./my-nextjs-app
434
+ ```
435
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
436
+ โ”‚ Short-term โ†’ .sapper/context.json โ”‚
437
+ โ”‚ Full conversation history for the current session โ”‚
438
+ โ”‚ Auto-summarized as the context window fills up โ”‚
439
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
440
+ โ”‚ Long-term โ†’ .sapper/embeddings.json โ”‚
441
+ โ”‚ Chunked text embedded with cosine similarity โ”‚
442
+ โ”‚ Recalled automatically on relevant prompts โ”‚
443
+ โ”‚ Searchable manually with /recall <query> โ”‚
444
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
134
445
  ```
135
446
 
136
- **Add features to existing project:**
447
+ All activity is also written to `.sapper/logs/session-<timestamp>.md` for auditing.
137
448
 
138
- ```text
139
- > analyze the codebase in ./my-project
140
- > add a user authentication system
141
- > create API endpoints for user management
142
- ```
449
+ ---
143
450
 
144
451
  ## Development
145
452
 
146
453
  ```bash
147
- git clone https://github.com/yourusername/sapper
454
+ git clone https://github.com/aledanee/sapper.git
148
455
  cd sapper
149
456
  npm install
150
457
  chmod +x sapper.mjs
151
- ./sapper.mjs
458
+ node sapper.mjs
152
459
  ```
153
460
 
461
+ CI runs automatically on push to `main` across Node.js 16, 18, and 20.
462
+
463
+ ---
464
+
154
465
  ## License
155
466
 
156
- MIT
467
+ MIT โ€” see [LICENSE](LICENSE)
157
468
 
158
- ## Author
469
+ ---
159
470
 
160
- Ibrahim Ihsan
471
+ **Author:** Ibrahim Ihsan
472
+ **Package:** [sapper-iq on npm](https://www.npmjs.com/package/sapper-iq)
473
+ **Repository:** [github.com/aledanee/sapper](https://github.com/aledanee/sapper)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sapper-iq",
3
- "version": "1.1.38",
3
+ "version": "1.1.39",
4
4
  "description": "AI-powered development assistant that executes commands and builds projects",
5
5
  "main": "sapper.mjs",
6
6
  "bin": {
@@ -19,6 +19,7 @@
19
19
  "dependencies": {
20
20
  "acorn": "^8.15.0",
21
21
  "chalk": "^5.3.0",
22
+ "cli-highlight": "^2.1.11",
22
23
  "marked": "^15.0.12",
23
24
  "marked-terminal": "^7.3.0",
24
25
  "ollama": "^0.5.0",