atom-lite 0.5.1 → 0.6.3

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 (105) hide show
  1. package/CHANGELOG.md +33 -1
  2. package/README.md +60 -116
  3. package/dist/agent/loop.d.ts +16 -0
  4. package/dist/agent/loop.js +158 -11
  5. package/dist/agent/loop.js.map +1 -1
  6. package/dist/agent/system-prompt.d.ts +1 -0
  7. package/dist/agent/system-prompt.js +23 -0
  8. package/dist/agent/system-prompt.js.map +1 -0
  9. package/dist/agent/turn-recorder.d.ts +4 -0
  10. package/dist/agent/turn-recorder.js +1 -0
  11. package/dist/agent/turn-recorder.js.map +1 -1
  12. package/dist/agent/types.d.ts +33 -0
  13. package/dist/cli/app.js +337 -55
  14. package/dist/cli/app.js.map +1 -1
  15. package/dist/cli/commands.js +180 -0
  16. package/dist/cli/commands.js.map +1 -1
  17. package/dist/cli/diff-view.d.ts +18 -0
  18. package/dist/cli/diff-view.js +66 -0
  19. package/dist/cli/diff-view.js.map +1 -0
  20. package/dist/cli/main.js +2 -1
  21. package/dist/cli/main.js.map +1 -1
  22. package/dist/cli/panel.js +8 -8
  23. package/dist/cli/panel.js.map +1 -1
  24. package/dist/cli/status-line.d.ts +2 -0
  25. package/dist/cli/status-line.js +9 -1
  26. package/dist/cli/status-line.js.map +1 -1
  27. package/dist/cli/tool-box.d.ts +1 -1
  28. package/dist/cli/tool-box.js +47 -41
  29. package/dist/cli/tool-box.js.map +1 -1
  30. package/dist/config/defaults.d.ts +4 -5
  31. package/dist/config/defaults.js +6 -3
  32. package/dist/config/defaults.js.map +1 -1
  33. package/dist/config/load.js +29 -3
  34. package/dist/config/load.js.map +1 -1
  35. package/dist/config/schema.d.ts +14 -14
  36. package/dist/config/schema.js +8 -5
  37. package/dist/config/schema.js.map +1 -1
  38. package/dist/context/budget.js +19 -1
  39. package/dist/context/budget.js.map +1 -1
  40. package/dist/context/manager.js +1 -1
  41. package/dist/context/manager.js.map +1 -1
  42. package/dist/eval/runner.d.ts +51 -0
  43. package/dist/eval/runner.js +230 -0
  44. package/dist/eval/runner.js.map +1 -0
  45. package/dist/mcp/client.js +2 -1
  46. package/dist/mcp/client.js.map +1 -1
  47. package/dist/providers/context-window.d.ts +4 -0
  48. package/dist/providers/context-window.js +54 -0
  49. package/dist/providers/context-window.js.map +1 -1
  50. package/dist/providers/factory.js +3 -0
  51. package/dist/providers/factory.js.map +1 -1
  52. package/dist/providers/gemini.d.ts +2 -0
  53. package/dist/providers/gemini.js +18 -11
  54. package/dist/providers/gemini.js.map +1 -1
  55. package/dist/providers/ollama.d.ts +3 -0
  56. package/dist/providers/ollama.js +9 -0
  57. package/dist/providers/ollama.js.map +1 -1
  58. package/dist/providers/openai-compatible.d.ts +2 -0
  59. package/dist/providers/openai-compatible.js +24 -3
  60. package/dist/providers/openai-compatible.js.map +1 -1
  61. package/dist/runtime/background-tasks.d.ts +23 -0
  62. package/dist/runtime/background-tasks.js +141 -0
  63. package/dist/runtime/background-tasks.js.map +1 -0
  64. package/dist/runtime/checkpoint-store.d.ts +64 -0
  65. package/dist/runtime/checkpoint-store.js +419 -0
  66. package/dist/runtime/checkpoint-store.js.map +1 -0
  67. package/dist/runtime/modes.d.ts +3 -0
  68. package/dist/runtime/modes.js +8 -0
  69. package/dist/runtime/modes.js.map +1 -0
  70. package/dist/runtime/tool-executor.js +10 -0
  71. package/dist/runtime/tool-executor.js.map +1 -1
  72. package/dist/skills/registry.js +8 -1
  73. package/dist/skills/registry.js.map +1 -1
  74. package/dist/tools/bash.js +46 -10
  75. package/dist/tools/bash.js.map +1 -1
  76. package/dist/tools/edit.js +28 -8
  77. package/dist/tools/edit.js.map +1 -1
  78. package/dist/tools/glob.d.ts +2 -0
  79. package/dist/tools/glob.js +97 -0
  80. package/dist/tools/glob.js.map +1 -0
  81. package/dist/tools/grep.d.ts +2 -0
  82. package/dist/tools/grep.js +290 -0
  83. package/dist/tools/grep.js.map +1 -0
  84. package/dist/tools/index.d.ts +3 -0
  85. package/dist/tools/index.js +3 -0
  86. package/dist/tools/index.js.map +1 -1
  87. package/dist/tools/read.js +70 -9
  88. package/dist/tools/read.js.map +1 -1
  89. package/dist/tools/task.d.ts +2 -0
  90. package/dist/tools/task.js +55 -0
  91. package/dist/tools/task.js.map +1 -0
  92. package/dist/tools/types.d.ts +10 -1
  93. package/dist/tools/write.js +29 -8
  94. package/dist/tools/write.js.map +1 -1
  95. package/dist/types.d.ts +9 -3
  96. package/dist/types.js +1 -4
  97. package/dist/types.js.map +1 -1
  98. package/dist/version.d.ts +1 -0
  99. package/dist/version.js +14 -0
  100. package/dist/version.js.map +1 -0
  101. package/package.json +5 -3
  102. package/skills/atom-lite-extensions/SKILL.md +240 -0
  103. package/skills/caveman/SKILL.md +89 -0
  104. package/skills/code-review/SKILL.md +46 -0
  105. package/skills/optimization/SKILL.md +51 -0
package/CHANGELOG.md CHANGED
@@ -5,9 +5,41 @@ All notable changes to this project are documented here.
5
5
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased]
8
+ ## [0.6.3] - 2026-11-06
9
9
 
10
10
  ### Added
11
+ - Interactive approval prompts (y/n/t) for read/write/edit/bash operations outside the workspace, in both plan and yolo modes.
12
+
13
+ ### Changed
14
+ - Default mode is now yolo; legacy `ask`/`trusted` approvalMode values migrate to yolo.
15
+ - Outside-workspace operations prompt regardless of mode; hard-blocked in non-interactive sessions.
16
+
17
+ ## [0.6.2] - 2026-11-05
18
+
19
+ ### Fixed
20
+ - Direct publish (bypass staged registry conflict).
21
+
22
+ ## [0.6.1] - 2026-11-05
23
+
24
+ ### Fixed
25
+ - Shell mode result rendering and @ mention fuzzy search (fd path).
26
+ - npm publish (staged 0.6.0 could not be approved locally).
27
+
28
+ ## [0.6.0] - 2026-11-05
29
+
30
+ ### Added
31
+ - Autonomy primitives: removed hard caps, added optional token budgets, plan/yolo modes with Tab toggle, higher scheduler parallelism, improved compaction fidelity.
32
+ - Interactive `@` file/folder mentions (including hidden files via `fd`) and `!` shell mode.
33
+ - Built-in skills: `atom-lite-extensions`, `code-review`, `caveman`, `optimization`.
34
+ - Richer default system prompt.
35
+
36
+ ### Changed
37
+ - Replaced ask/trusted/deny approval modes with plan/yolo modes.
38
+ - Configuration: `approvalMode` -> `mode`; added `maxTokensPerSession`/`maxTokensPerTurn`.
39
+
40
+ ### Fixed
41
+ - Shell command results now render (resolve on process exit).
42
+ - Hidden files included in `glob`/`grep` tools.
11
43
 
12
44
  ## [0.5.0] - 2026-11-05
13
45
 
package/README.md CHANGED
@@ -1,59 +1,43 @@
1
1
  # Atom-lite
2
2
 
3
+ <p align="center">
4
+ <img src="./assets/atom-lite.png" alt="Atom-lite" width="900" />
5
+ </p>
6
+
3
7
  [![npm](https://img.shields.io/npm/v/atom-lite?logo=npm)](https://www.npmjs.com/package/atom-lite)
4
8
  [![CI](https://github.com/beast-ofcourse/atom-lite/actions/workflows/ci.yml/badge.svg)](https://github.com/beast-ofcourse/atom-lite/actions/workflows/ci.yml)
5
9
  [![Node.js](https://img.shields.io/badge/node-%3E%3D22.19-339933?logo=node.js&logoColor=white)](https://nodejs.org)
6
10
  [![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org)
7
11
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
8
12
 
9
- **Atom-lite** is a local-first, model-agnostic coding agent with an intentionally small harness: one agent loop, four core built-in tools (`read`, `write`, `edit`, `bash`) plus network tools (`webfetch`, `websearch`), a deterministic conflict-aware scheduler, durable JSONL sessions, and explicit safety boundaries. It runs against local or hosted model providers through interchangeable adapters — no cloud account, telemetry service, or hosted control plane required.
10
-
11
- > See [`docs/README.md`](./docs/README.md) for the documentation index and [`docs/adr/`](./docs/adr/) for architectural decisions.
12
-
13
- ---
14
-
15
- ## Table of contents
13
+ Atom-lite is a local-first, model-agnostic coding agent built on a deliberately small harness: one agent loop, nine built-in tools, a conflict-aware scheduler, durable JSONL sessions, and explicit safety boundaries. It runs against local or hosted providers through interchangeable adapters — no cloud account, telemetry, or control plane required.
16
14
 
17
- - [Why Atom-lite](#why-atom-lite)
18
- - [Features](#features)
19
- - [Install](#install)
20
- - [Quick start](#quick-start)
21
- - [Default provider](#default-provider)
22
- - [Configuration](#configuration)
23
- - [Usage](#usage)
24
- - [Tools](#tools)
25
- - [Providers](#providers)
26
- - [Safety & security](#safety--security)
27
- - [Sessions](#sessions)
28
- - [Context management](#context-management)
29
- - [Development](#development)
30
- - [Architecture](#architecture)
31
- - [Contributing](#contributing)
32
- - [License](#license)
15
+ > Documentation index: [`docs/README.md`](./docs/README.md). Architectural decisions: [`docs/adr/`](./docs/adr/).
33
16
 
34
17
  ## Why Atom-lite
35
18
 
36
- Most coding agents accumulate tools, sub-agents, planning frameworks, retrieval pipelines, and orchestration layers until the harness itself becomes the product. Atom-lite takes the opposite stance:
19
+ Most coding agents accumulate tools, sub-agents, and orchestration until the harness becomes the product. Atom-lite takes the opposite stance:
37
20
 
38
- - **Small core, strong primitives.** The core contains only a provider interface, a session model, a single agent loop, four core tools plus two network tools, a scheduler/executor, context-window management, configuration, and a CLI.
39
- - **The model decides; the runtime enforces.** The model chooses which tool to call and what to do next. The runtime validates arguments, enforces workspace boundaries, applies approval rules, schedules calls safely, and returns accurate results. There is no hard-coded "plan → inspect → edit → test" workflow.
40
- - **Thin harness, not weak engineering.** Provider-specific formats, streaming failures, concurrent file access, shell timeouts, large outputs, context exhaustion, and session recovery are all handled — they are the reliability layer that makes a small harness useful.
21
+ - **Small core, strong primitives.** Provider interface, session model, one agent loop, nine tools, scheduler/executor, context management, config, and CLI.
22
+ - **The model decides; the runtime enforces.** The model chooses tools and next steps; the runtime validates arguments, enforces workspace boundaries, applies approval rules, schedules calls safely, and returns accurate results. No hard-coded workflow.
23
+ - **Thin harness, not weak engineering.** Streaming failures, concurrent file access, shell timeouts, large outputs, context exhaustion, and session recovery are handled as the reliability layer.
41
24
 
42
25
  ## Features
43
26
 
44
- - **Six built-in tools** — four core tools (`read`, `write`, `edit`, `bash`) plus `webfetch` and `websearch`. Everything else (search, tests, git, builds) goes through `bash`.
45
- - **Single agent loop** — one agent, one conversation, one tool registry, one control loop. Parallelism lives inside a tool-call batch.
46
- - **Conflict-aware scheduler** — per-file read/write locks and a global bash barrier. Parallelism is governed by resource conflicts, not applied blindly.
47
- - **Durable sessions** — append-only JSONL event logs, resumable across CLI restarts, grouped by workspace.
48
- - **Context management** — token estimation, compaction (summarization of older history) before the context budget is exceeded, while retaining the full transcript.
49
- - **Live context meter** — the status line shows context tokens used against the selected model's real window (e.g. `tokens: 4.5k/256k`), resolved from provider metadata with known-model fallbacks.
50
- - **Approval modes** — `ask` / `trusted` / `deny` for shell commands, with session-level trust.
51
- - **Hash guards** — `expected_hash` rejects stale `write`/`edit` operations when the file changed since it was read.
52
- - **Provider-agnostic** — Ollama, Gemini, and any OpenAI-compatible endpoint (LM Studio, llama.cpp, Kilo AI Gateway, OpenAI, Anthropic, OpenRouter, Groq, Mistral, xAI, …).
53
- - **Interactive provider/model pickers** — `/provider` adds a provider and stores its key securely; `/model` fuzzy-searches every configured provider's models.
54
- - **Command palette and themes** — `ctrl+p` fuzzy-searches commands, skills, providers, models, themes, and recent sessions. `/theme` switches between auto, dark, light, and no-colour modes.
55
- - **Local-first** — runs fully against local providers with no cloud account, telemetry, or hosted database.
56
- - **Safe path handling** — file tools resolve against the workspace and reject escapes; shell is an explicit, sandbox-aware boundary.
27
+ - **Nine built-in tools** — `read`, `write`, `edit`, `bash`, `grep`, `glob`, `webfetch`, `websearch`, `task`. Background tasks run via `bash` with `background:true` and are managed through `task`. Everything else (tests, git, builds) runs through `bash`.
28
+ - **Single agent loop** — one agent, one conversation, one registry, one control loop. Parallelism lives inside a tool-call batch.
29
+ - **Conflict-aware scheduler** — per-file read/write locks and a global bash barrier.
30
+ - **Durable sessions** — append-only JSONL event logs, resumable across restarts, grouped by workspace.
31
+ - **Context management** — token estimation and compaction before the budget is exceeded, full transcript retained.
32
+ - **Live context meter** — `tokens: 4.5k/256k` against the model's real window, resolved from provider metadata with fallbacks.
33
+ - **Autonomy modes** — `plan` (read/web only) and `yolo` (all tools), toggled with Tab; default `yolo`.
34
+ - **Hash guards** — `expected_hash` rejects stale `write`/`edit` when a file changed since read.
35
+ - **Provider-agnostic** — Ollama, Gemini, and any OpenAI-compatible endpoint (LM Studio, llama.cpp, Kilo, OpenAI, Anthropic, OpenRouter, Groq, Mistral, xAI, …).
36
+ - **Interactive pickers** — `/provider` adds a provider and stores its key securely; `/model` fuzzy-searches every configured provider's models.
37
+ - **Command palette & themes** — `ctrl+p` fuzzy-searches commands, skills, providers, models, themes, sessions. `/theme` switches auto/dark/light/no-colour.
38
+ - **Local-first** — runs fully against local providers; no telemetry or hosted database.
39
+ - **Safe path handling** — file tools resolve against the workspace and reject escapes; shell is an explicit boundary.
40
+ - **Recovery** — automatic Git-gated checkpoints before mutating turns, with `/undo` and `/diff` for review. See [ADR 0014](./docs/adr/0014-checkpoints-and-undo.md).
57
41
 
58
42
  ## Install
59
43
 
@@ -67,7 +51,7 @@ Or run without installing:
67
51
  npx atom-lite "fix the failing test"
68
52
  ```
69
53
 
70
- Requires **Node.js >= 22.19** (see `engines` in `package.json`).
54
+ Requires **Node.js >= 22.19**.
71
55
 
72
56
  ## Quick start
73
57
 
@@ -87,60 +71,21 @@ echo "summarize this repo" | atom-lite
87
71
 
88
72
  ## Default provider
89
73
 
90
- Out of the box, Atom-lite uses the **Kilo AI Gateway** (`https://api.kilo.ai/api/gateway`) with the free `kilo-auto/free` model. No API key is required (rate-limited to 200 requests/hour per IP for anonymous use). Override via `--provider`/`--model` or config.
74
+ Out of the box, Atom-lite uses the **Kilo AI Gateway** (`https://api.kilo.ai/api/gateway`) with the free `kilo-auto/free` model. No API key required (rate-limited to 200 requests/hour per IP for anonymous use). Override via `--provider`/`--model` or config.
91
75
 
92
76
  ## Configuration
93
77
 
94
- User config: `~/.config/atom-lite/config.json`
95
- Project config: `.atom-lite/config.json` (non-secrets only)
78
+ - User config: `~/.config/atom-lite/config.json`
79
+ - Project config: `.atom-lite/config.json` (non-secrets only)
96
80
 
97
- Precedence (low → high): defaults → user config → project config (non-secret) → environment → CLI overrides. Security-critical user settings (e.g. `approvalMode`) are **not** overridable by project config.
81
+ Precedence (low → high): defaults → user config → project config (non-secret) → environment → CLI overrides. Security-critical user settings (e.g. `approvalMode`) are not overridable by project config.
98
82
 
99
- Secrets are stored in `~/.config/atom-lite/credentials.json` with owner-only permissions (`0600`). Environment variables named by a provider's `apiKeyEnv` take precedence over the stored key. Secrets are never written to project config or session files.
100
-
101
- Environment overrides:
83
+ Secrets live in `~/.config/atom-lite/credentials.json` (`0600`). Environment variables named by a provider's `apiKeyEnv` take precedence over the stored key. Secrets are never written to project config or session files.
102
84
 
103
85
  | Variable | Effect |
104
86
  | --- | --- |
105
87
  | `ATOM_LITE_PROVIDER` | Default provider profile name |
106
- | `ATOM_LITE_APPROVAL_MODE` | `ask` / `trusted` / `deny` |
107
-
108
- Example `config.json`:
109
-
110
- ```json
111
- {
112
- "defaultProvider": "kilo",
113
- "providers": {
114
- "kilo": {
115
- "type": "openai-compatible",
116
- "baseUrl": "https://api.kilo.ai/api/gateway",
117
- "model": "kilo-auto/free",
118
- "apiKeyEnv": null
119
- },
120
- "ollama": {
121
- "type": "ollama",
122
- "baseUrl": "http://127.0.0.1:11434",
123
- "model": "qwen2.5-coder:7b"
124
- },
125
- "gemini": {
126
- "type": "gemini",
127
- "model": "gemini-2.0-flash",
128
- "apiKeyEnv": "GEMINI_API_KEY"
129
- }
130
- },
131
- "runtime": {
132
- "approvalMode": "ask",
133
- "bashConcurrency": "serial",
134
- "maxIterations": 40,
135
- "maxToolCalls": 100
136
- },
137
- "context": {
138
- "maxInputTokens": null,
139
- "reserveOutputTokens": 4096,
140
- "compactAtPercent": 85
141
- }
142
- }
143
- ```
88
+ | `ATOM_LITE_MODE` | `plan` / `yolo` |
144
89
 
145
90
  See [`docs/configuration.md`](./docs/configuration.md) for every field, default, and precedence rule.
146
91
 
@@ -169,17 +114,11 @@ atom-lite [task] [--provider NAME] [--model MODEL] [--continue] [--session ID]
169
114
  | `--version` | Print version |
170
115
  | `--help` | Show help |
171
116
 
172
- In the TUI, type `/help` to see every command grouped by category, or press
173
- `ctrl+p` for the fuzzy command palette. `/theme` opens a live-preview picker and
174
- persists your choice to user config; `NO_COLOR` and `--no-color` always win.
175
- `/sessions` opens a searchable session picker scoped to the current workspace,
176
- with a toggle for all workspaces, and `/search <query>` prints matching sessions
177
- with content snippets. Mouse wheel scrolling and click-to-focus are enabled for
178
- interactive terminals and can be disabled with `ui.mouse: false`.
117
+ In the TUI, type `/help` for every command grouped by category, or press `ctrl+p` for the fuzzy command palette. `/theme` opens a live-preview picker and persists your choice; `NO_COLOR` and `--no-color` always win. `/sessions` opens a searchable picker scoped to the current workspace; `/search <query>` prints matching sessions with snippets. Mouse wheel scrolling and click-to-focus are enabled for interactive terminals and can be disabled with `ui.mouse: false`.
179
118
 
180
119
  ## Tools
181
120
 
182
- Four core tools (see [ADR 0001](./docs/adr/0001-four-built-in-tools-only.md)) plus the additive network tools from [ADR 0006](./docs/adr/0006-expanded-toolset.md):
121
+ Nine built-in tools — the four core tools from [ADR 0001](./docs/adr/0001-four-built-in-tools-only.md), file search, network tools from [ADR 0006](./docs/adr/0006-expanded-toolset.md), plus `task` for background work from [ADR 0013](./docs/adr/0013-advanced-tool-features.md):
183
122
 
184
123
  | Tool | Purpose |
185
124
  | --- | --- |
@@ -187,16 +126,19 @@ Four core tools (see [ADR 0001](./docs/adr/0001-four-built-in-tools-only.md)) pl
187
126
  | `write` | Create or replace files safely (hash-guarded) |
188
127
  | `edit` | Precise find-and-replace edits (hash-guarded) |
189
128
  | `bash` | Execute shell commands (global exclusive barrier by default) |
129
+ | `grep` | Search file contents by regex (ripgrep-backed, falls back to JS) |
130
+ | `glob` | Find files matching a glob pattern |
190
131
  | `webfetch` | Fetch a URL and convert HTML to markdown |
191
132
  | `websearch` | Search the web and return ranked results |
133
+ | `task` | Query or control a background bash task |
192
134
 
193
- File discovery, search, tests, Git, builds, formatters, and package managers are available through `bash`, not through additional built-in tools.
135
+ Tests, Git, builds, formatters, and package managers are available through `bash`.
194
136
 
195
137
  ## Providers
196
138
 
197
139
  | Type | Adapter | Notes |
198
140
  | --- | --- | --- |
199
- | `openai-compatible` | `OpenAICompatibleAdapter` | LM Studio, llama.cpp/llama-server, Kilo AI Gateway, and other compatible endpoints |
141
+ | `openai-compatible` | `OpenAICompatibleAdapter` | LM Studio, llama.cpp/llama-server, Kilo, and other compatible endpoints |
200
142
  | `ollama` | `OllamaAdapter` | Native Ollama chat API |
201
143
  | `gemini` | `GeminiAdapter` | Official Gemini API |
202
144
 
@@ -204,25 +146,24 @@ Provider profiles are named combinations of endpoint, model, auth source, and op
204
146
 
205
147
  ### Interactive setup
206
148
 
207
- - `/provider` opens a searchable list of built-in providers (Kilo, OpenAI, Anthropic, Google Gemini, OpenRouter, Groq, Mistral, xAI, Ollama, LM Studio, llama.cpp). Selecting a hosted provider prompts for an API key with hidden input, validates it against the provider, and saves it to `~/.config/atom-lite/credentials.json` (`0600`).
208
- - `/model` opens a fuzzy-searchable picker containing models from **every configured provider** (plus providers whose key is present in the environment). Live model lists are fetched in the background while the picker stays responsive.
149
+ - `/provider` opens a searchable list of built-in providers (Kilo, OpenAI, Anthropic, Google Gemini, OpenRouter, Groq, Mistral, xAI, Ollama, LM Studio, llama.cpp). Selecting a hosted provider prompts for an API key with hidden input, validates it, and saves it to `~/.config/atom-lite/credentials.json` (`0600`).
150
+ - `/model` opens a fuzzy-searchable picker containing models from every configured provider (plus providers whose key is present in the environment). Live model lists are fetched in the background.
209
151
  - `/model <provider>/<model>` and `/provider <name>` are the non-interactive forms.
210
152
 
211
- The selected provider/model is persisted to the user config, so the next session starts where you left off.
153
+ The selected provider/model is persisted to user config, so the next session starts where you left off.
212
154
 
213
155
  ## Safety & security
214
156
 
215
- - **Workspace boundary** — `read`/`write`/`edit` resolve paths against the workspace and reject escapes. Shell commands are not constrained by this boundary (their effects are unknown), so `bash` runs as a global exclusive barrier.
216
- - **Approval modes** — `ask` prompts before each shell command; `trusted` auto-approves; `deny` blocks. Session trust can be granted interactively (`t`).
157
+ - **Workspace boundary** — `read`/`write`/`edit` resolve paths against the workspace and reject escapes. Shell commands are not constrained by this boundary, so `bash` runs as a global exclusive barrier.
158
+ - **Autonomy modes** — `plan` allows read/web tools only; `yolo` allows all tools. Default `yolo`. Toggle with Tab or set `runtime.mode`.
217
159
  - **Hash guards** — prevent stale overwrites when a file changed since it was read.
218
160
  - **Sandboxing flags** — reported per command; see `src/security/`.
219
- - **No secrets in config** — interactive provider setup stores API keys in `~/.config/atom-lite/credentials.json` with `0600` permissions; environment variables still take precedence.
161
+ - **No secrets in config** — interactive setup stores API keys in `~/.config/atom-lite/credentials.json` (`0600`); environment variables take precedence.
220
162
  - **Local-first** — no cloud account, telemetry, or remote control plane required (see [ADR 0004](./docs/adr/0004-local-first-no-cloud-dependency.md)).
221
163
 
222
164
  ## Commands
223
165
 
224
- Type `/help` for the grouped list, or press `ctrl+p` for the fuzzy command
225
- palette. Common commands:
166
+ Type `/help` for the grouped list, or press `ctrl+p` for the fuzzy command palette. Common commands:
226
167
 
227
168
  | Command | Description |
228
169
  | --- | --- |
@@ -237,7 +178,9 @@ palette. Common commands:
237
178
  | `/extensions` | List discovered extensions and load status |
238
179
  | `/compact` | Compact older context |
239
180
  | `/clear` | Clear the transcript view |
240
- | `/approval` | Change approval mode |
181
+ | `/undo` | Restore workspace to a checkpoint |
182
+ | `/diff` | Show changes since the last checkpoint |
183
+ | `/approval` | Show approval mode (legacy) |
241
184
  | `/doctor` | Run diagnostics |
242
185
  | `/thinking` | Toggle thinking display |
243
186
  | `/theme [auto\|dark\|light\|ansi]` | Switch theme |
@@ -246,9 +189,7 @@ palette. Common commands:
246
189
 
247
190
  ## Sessions
248
191
 
249
- Sessions are append-only JSONL event logs recording everything that happened in one conversation. They are resumable across CLI restarts and grouped by workspace. Stored under the session store (see `src/sessions/`). Compaction summarizes older history to stay within the context budget while retaining the full transcript.
250
-
251
- The session index derives a title from the first user message unless `/session rename <title>` overrides it, and records the provider, update time, and message count. `/sessions` resumes a session in place: retained messages are replayed into the transcript and a `session_resumed` event is appended. `/search <query>` matches titles, message content, and workspace paths, ranking title hits first. `--list-sessions` and `--search-sessions` print the same index as stable tab-separated rows for scripts.
192
+ Sessions are append-only JSONL event logs recording everything in one conversation. They are resumable across CLI restarts and grouped by workspace. The session index derives a title from the first user message unless `/session rename <title>` overrides it, and records the provider, update time, and message count. `/sessions` resumes a session in place: retained messages are replayed into the transcript and a `session_resumed` event is appended. `/search <query>` matches titles, message content, and workspace paths, ranking title hits first. `--list-sessions` and `--search-sessions` print the same index as stable tab-separated rows for scripts. Compaction summarizes older history to stay within the context budget while retaining the full transcript.
252
193
 
253
194
  ## Context management
254
195
 
@@ -270,13 +211,14 @@ Tests live in `tests/` (agent, config, runtime, tools). The project is TypeScrip
270
211
 
271
212
  ### Releasing
272
213
 
273
- 1. Update `version` in `package.json` and add a `CHANGELOG.md` entry.
274
- 2. Run `npm run typecheck && npm test && npm run bench`.
275
- 3. Commit, then tag and push: `git tag vX.Y.Z && git push origin master --tags`.
276
- 4. The `Release` workflow stages the package on npm with provenance and opens a draft GitHub release. It requires an `NPM_TOKEN` repository secret with publish access.
277
- 5. Approve the staged version on npm (Staged Packages tab, or `npm stage approve <stage-id>` with 2FA), then publish the draft release on GitHub.
214
+ Follow the release workflow in [`AGENTS.md`](./AGENTS.md):
278
215
 
279
- npm requires a maintainer with 2FA to approve staged releases; CI cannot complete that step.
216
+ 1. Bump `version` in `package.json` and add a `CHANGELOG.md` entry.
217
+ 2. Run `npm run typecheck && npm test && npm run bench` (bench is non-gating).
218
+ 3. Commit, tag, push: `git commit ... && git tag vX.Y.Z && git push origin master --tags`.
219
+ 4. Publish to npm directly: `npm publish --access public` (do not use `npm stage approve`).
220
+ 5. Create GitHub release: `gh release create vX.Y.Z --title "vX.Y.Z" --notes "..."`.
221
+ 6. Verify: `npm view atom-lite version` and the GitHub release page.
280
222
 
281
223
  ## Architecture
282
224
 
@@ -290,7 +232,7 @@ src/
290
232
  runtime/ # scheduler, approvals
291
233
  security/ # paths, process, redaction
292
234
  sessions/ # store, events, recovery
293
- tools/ # read, write, edit, bash, webfetch, websearch, registry
235
+ tools/ # read, write, edit, bash, grep, glob, webfetch, websearch, registry
294
236
  ```
295
237
 
296
238
  Key design decisions are recorded as ADRs in [`docs/adr/`](./docs/adr/):
@@ -305,10 +247,12 @@ Key design decisions are recorded as ADRs in [`docs/adr/`](./docs/adr/):
305
247
 
306
248
  ## Contributing
307
249
 
308
- Read [`CONTRIBUTING.md`](./CONTRIBUTING.md) before opening a pull request. Issues and specs live as markdown under `.scratch/` (see [`docs/agents/issue-tracker.md`](./docs/agents/issue-tracker.md)). Please keep changes consistent with the "small core" principle: new tools require strong justification against ADR 0001.
250
+ Read [`CONTRIBUTING.md`](./CONTRIBUTING.md) before opening a pull request. Issues and specs live as markdown under `.scratch/` (see [`docs/agents/issue-tracker.md`](./docs/agents/issue-tracker.md)). Keep changes consistent with the "small core" principle: new tools require strong justification against ADR 0001.
309
251
 
310
252
  Report vulnerabilities privately as described in [`SECURITY.md`](./SECURITY.md).
311
253
 
312
254
  ## License
313
255
 
314
256
  MIT
257
+
258
+ <!-- appended -->
@@ -5,6 +5,10 @@ export declare class AgentRuntime {
5
5
  private model;
6
6
  private workspace;
7
7
  private approvals;
8
+ private mode;
9
+ private maxTokensPerSession;
10
+ private maxTokensPerTurn;
11
+ private totalTokensUsed;
8
12
  private contextManager;
9
13
  private onEvent;
10
14
  private tools;
@@ -17,13 +21,25 @@ export declare class AgentRuntime {
17
21
  private systemPrompt;
18
22
  private contextWindow;
19
23
  private contextUsed;
24
+ private supportsVision;
25
+ private backgroundTasks;
26
+ private checkpointingEnabled;
27
+ private checkpointStoreOverride;
28
+ private turnCheckpointed;
29
+ private turnCheckpointId;
30
+ private turnCheckpointStore;
31
+ private turnIndex;
20
32
  constructor(options: AgentRuntimeOptions);
21
33
  switchModel(provider: AgentRuntimeOptions["provider"], model?: string): void;
22
34
  /** Update the context window for the selected model (metadata may arrive late). */
23
35
  setContextWindow(window: number | undefined): void;
36
+ setSupportsVision(value: boolean | undefined): void;
37
+ private injectCompletedBackgroundTasks;
24
38
  getContextUsage(): ContextUsage;
25
39
  private emitContextUsage;
26
40
  setEffort(effort: string): void;
41
+ setMode(mode: "plan" | "yolo"): void;
42
+ getMode(): "plan" | "yolo";
27
43
  setSteeringQueue(queue: string[]): void;
28
44
  compactSession(session: {
29
45
  messages: Message[];