s-app-scoder-agent 0.8.20 → 0.9.2

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 CHANGED
@@ -1,4 +1,6 @@
1
- # scoder — Autonomous Coding Agent CLI
1
+ # scoder — Autonomous Coding Agent CLI
2
+
3
+ **Current version: 0.9.2**
2
4
 
3
5
  [![CI](https://github.com/nbhson/app-scoder-agent/actions/workflows/ci.yml/badge.svg)](https://github.com/nbhson/app-scoder-agent/actions/workflows/ci.yml)
4
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
@@ -50,8 +52,11 @@ export OPENAI_BASE_URL=https://api.openai.com/v1 # optional, for custom endpoin
50
52
  # Run a task
51
53
  scoder "add a ping function to src/network.ts"
52
54
 
53
- # Interactive REPL (supports /help, /clear, /cost, /model, /skills, /skill, /mcp, /review, /permission)
54
- scoder
55
+ # Interactive REPL (supports /help, /clear, /compact, /cost, /model, /skills, /skill, /mcp, /review, /permission)
56
+ scoder
57
+
58
+ # Full-screen TUI with rich agent display
59
+ scoder tui
55
60
  ```
56
61
 
57
62
  ## How It Works
@@ -105,7 +110,6 @@ Safety defaults:
105
110
  | `SCODER_MAX_STEPS` | `40` | Max loop iterations before giving up |
106
111
  | `SCODER_PERMISSION` | `auto` | Permission mode: `auto` \| `ask` \| `readonly` |
107
112
  | `SCODER_STREAM` | `1` | `0` to disable streaming LLM output |
108
- | `SCODER_STREAM` | `1` | `0` to disable streaming LLM output |
109
113
  | `SCODER_SERVER_TOKEN` | — | `scoder serve` only: require `Authorization: Bearer <token>` |
110
114
  | `SCODER_WEB_ALLOW_PRIVATE` | — | Set to `1` to let `web_fetch` reach localhost/private addresses (local dev) |
111
115
  | `SCODER_NO_APIKEY_WARNING` | — | Set to `1` to suppress the apiKey-in-rc warning |
@@ -233,18 +237,46 @@ Read the current diff. Check for: null derefs, injection risks, ...
233
237
  | Command | Description |
234
238
  |---|---|
235
239
  | `/help` | command list |
240
+ | `/plan` | show the current plan; `/plan done\|start <id\|n>` to mark steps |
241
+ | `/agent` | list/select primary agents (build/plan/review/custom) |
242
+ | `/init` | create an AGENTS.md template in this project |
243
+ | `/sessions` | list saved sessions; `/sessions resume <id\|last>` |
244
+ | `/diff` | show diffs: `/diff turn\|session\|branch` (TUI) |
245
+ | `/theme` | switch palette (TUI) |
236
246
  | `/clear` | reset conversation + agent context |
247
+ | `/compact` | summarize older history now (manual compaction) |
237
248
  | `/cost` | session token usage |
238
249
  | `/model` | active model/provider/build |
239
250
  | `/skills` | list discovered skills |
240
251
  | `/skill <name>` | stage a skill for the next task |
241
252
  | `/mcp` | MCP servers + tools; exec one directly: `/mcp <server> <tool> [json\|text]` or `/mcp mcp__server__tool [json\|text]` — non-JSON text binds to the tool's first string parameter |
242
253
  | `/review <prompt>` | Prompt gate (prompt-gate MCP): LLM rewrites your prompt, you pick original/rewritten/update/cancel — only the approved prompt is used |
243
- | `/permission <auto\|readonly>` | switch permission mode at runtime |
254
+ | `/permission <auto\|ask\|readonly>` | switch permission mode at runtime |
255
+ | `/undo` | revert files (and optionally trim the turn) (TUI) |
256
+ | `/commands` | list all commands (builtin + custom) |
257
+ | `/export [md\|json]` | export session transcript |
258
+ | `/search <query>` | search the transcript |
244
259
  | `/exit` | quit |
245
260
 
246
261
  In the TUI, **Tab** completes commands (and `/skill` names, `/mcp <server> <tool>` arguments), **↑/↓** recall sent-message history.
247
262
 
263
+ ### Context compaction
264
+
265
+ Long runs are summarized automatically when history reaches `contextWindow × trigger` (default **80%**). Mechanical trimming only starts later, at **95%** of the window, so compaction gets the first chance to preserve task state. `/compact` runs the same summarization immediately (useful mid-session or when auto-compaction is disabled).
266
+
267
+ ```jsonc
268
+ // .scoderrc.json — all fields optional
269
+ "compaction": {
270
+ "trigger": 0.8, // fraction of the model window that triggers compaction
271
+ "keep": 0.15, // recent-history fraction kept verbatim
272
+ "buffer": 0.15, // extra recent-history fraction never summarized
273
+ "contextWindow": 128000 // override the model-catalog window
274
+ }
275
+ // "compaction": false disables automatic compaction (mechanical trim only)
276
+ ```
277
+
278
+ `/compact` remains available even when automatic compaction is disabled.
279
+
248
280
  ### @file mentions
249
281
 
250
282
  Prefix any path with `@` in your task to inline its content into the agent's context:
@@ -322,6 +354,13 @@ scoder can use tools from [MCP](https://modelcontextprotocol.io) servers configu
322
354
  - Built-in tools always take priority over MCP tools with colliding names
323
355
  - ⚠️ **MCP tools bypass the built-in permission system** (no command classification, no diff preview). In `readonly` mode they are therefore disabled entirely; in `auto`/`ask` mode they run unsandboxed — only add MCP servers you trust.
324
356
 
357
+ ### MCP governance
358
+
359
+ Each server supports `enabled`, `trust` (`auto`/`ask`/`readonly`/`deny`), `tools.include`/`exclude`
360
+ (globs), and `timeoutMs`. `readonly` servers are never spawned. Import existing configs with
361
+ `scoder mcp import`. MCP tool output is flagged `untrusted` and wrapped with an `[UNTRUSTED]`
362
+ marker; audit entries are written to the JSONL log.
363
+
325
364
  ### Prompt gate (`/review`)
326
365
 
327
366
  If the [`prompt-gate`](https://github.com/nbhson/s-universal-prompt-gate-mcp) MCP server is configured (`~/.scoder/config.json`), `/review <prompt>` runs the gated rewrite flow — like OpenCode's `review-and-select-prompt`:
@@ -377,7 +416,7 @@ Features:
377
416
  - **Header row 2** — (no longer present; phase breadcrumb + metrics moved into the sidebar / status bar to avoid duplication)
378
417
  - **Diff cards** (`✎`) — every file write/edit renders as a unified diff (`+` green / `-` red / `@@` cyan hunk headers); the same diff also flows out of the HTTP SSE stream
379
418
  - **Status bar** — model, token usage (input/output/cached), scroll position, keybind hints
380
- - **Slash commands** — `/help`, `/clear`, `/cost`, `/model`, `/skills`, `/skill`, `/mcp`, `/review`, `/permission`, `/exit` (identical to the REPL)
419
+ - **Slash commands** — `/help`, `/clear`, `/compact`, `/cost`, `/model`, `/skills`, `/skill`, `/mcp`, `/review`, `/permission`, `/exit` (identical to the REPL)
381
420
  - **Multi-turn** — keep typing follow-ups after a task finishes; the conversation context carries over (same as the REPL)
382
421
  - **Scrollback** — `PgUp`/`PgDn` page in 0.8-viewport steps, `Home`/`End` jump to top/bottom, `Esc` returns to the live tail (press again to abort); rendering is capped at the last 200 items for smooth scrolling on long runs
383
422
  - **Keybinds** — `Enter` send · `PgUp`/`PgDn` scroll · `Esc` reset scroll / abort · `Ctrl+C` quit
@@ -469,7 +508,12 @@ scoder --help | --version Help and version
469
508
  | `--permission <mode>` | `auto` \| `ask` \| `readonly` shell-command policy (default `auto`) |
470
509
  | `-y` | Non-interactive mode (denies commands needing confirmation) |
471
510
  | `--provider <name>` | `openai` \| `anthropic` (env SCODER_PROVIDER; auto-detected) |
511
+ | `--agent <name>` | Primary agent to run (build/plan/review/custom) |
472
512
  | `--no-save` | Disable session auto-save to `.scoder/sessions/` |
513
+ | `--no-color` | Disable colored output |
514
+ | `--no-motion` | Disable animations |
515
+ | `--plain` | Plain (monochrome) output |
516
+ | `--high-contrast` | High-contrast theme |
473
517
  | `--log-file` | Write a structured JSONL event log to `.scoder/logs/` |
474
518
  | `--port <n>` | (`serve`) TCP port, `0` = random free port |
475
519
  | `--host <addr>` | (`serve`) Bind address (default `127.0.0.1`) |