atom-agent 1.4.0 → 1.5.0

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 (67) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +220 -224
  3. package/dist/App.js +922 -341
  4. package/dist/adapters.js +127 -14
  5. package/dist/agent/goal-evaluator.js +3 -0
  6. package/dist/agent/loop.js +211 -430
  7. package/dist/agent/tool-pipeline.js +398 -0
  8. package/dist/agent/turn-events.js +12 -0
  9. package/dist/cli.js +57 -8
  10. package/dist/compact.js +72 -8
  11. package/dist/config.js +19 -0
  12. package/dist/context-manager.js +6 -2
  13. package/dist/extensions.js +6 -0
  14. package/dist/file-diffs.js +108 -0
  15. package/dist/kilo.js +1 -1
  16. package/dist/local-discovery.js +2 -2
  17. package/dist/media.js +276 -0
  18. package/dist/overflow.js +140 -0
  19. package/dist/policy.js +8 -0
  20. package/dist/scheduler.js +38 -9
  21. package/dist/session-revert.js +125 -0
  22. package/dist/sessions.js +101 -0
  23. package/dist/snapshots.js +69 -0
  24. package/dist/system.js +2 -89
  25. package/dist/telemetry.js +26 -1
  26. package/dist/todos.js +241 -0
  27. package/dist/tools/filesystem.js +102 -22
  28. package/dist/tools/registry.js +184 -45
  29. package/dist/tools/ripgrep.js +7 -6
  30. package/dist/tools/search.js +172 -17
  31. package/dist/tools/shared.js +6 -0
  32. package/dist/tools.js +7 -39
  33. package/dist/ui/diff-panel.js +1 -1
  34. package/dist/ui/diff-view.js +13 -5
  35. package/dist/ui/diff.js +67 -0
  36. package/dist/ui/errors.js +20 -6
  37. package/dist/ui/input.js +24 -20
  38. package/dist/ui/live-tail.js +36 -1
  39. package/dist/ui/markdown.js +9 -4
  40. package/dist/ui/modals.js +7 -5
  41. package/dist/ui/paint-scheduler.js +120 -0
  42. package/dist/ui/palette.js +4 -2
  43. package/dist/ui/pickers.js +4 -1
  44. package/dist/ui/side-by-side.js +81 -22
  45. package/dist/ui/status-bar.js +63 -8
  46. package/dist/ui/stream-store.js +7 -0
  47. package/dist/ui/theme.js +23 -1
  48. package/dist/ui/todo-panel.js +5 -2
  49. package/dist/ui/tool-inspector.js +33 -4
  50. package/dist/ui/transcript.js +8 -5
  51. package/dist/web/events.js +93 -0
  52. package/dist/web/runtime.js +790 -0
  53. package/dist/web/server.js +570 -0
  54. package/dist/web/ui/app.js +1925 -0
  55. package/dist/web/ui/index.html +135 -0
  56. package/dist/web/ui/styles.css +515 -0
  57. package/dist/zen.js +115 -4
  58. package/documentation/cli.md +5 -5
  59. package/documentation/configuration.md +11 -6
  60. package/documentation/development.md +4 -3
  61. package/documentation/goals.md +1 -1
  62. package/documentation/index.md +4 -4
  63. package/documentation/providers.md +2 -3
  64. package/documentation/skills.md +3 -3
  65. package/documentation/tools.md +8 -3
  66. package/documentation/troubleshooting.md +1 -1
  67. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.0 — 2026-09-12
4
+
5
+ - Local agentic Web UI (`src/web/server.ts`, `src/web/runtime.ts`,
6
+ `src/web/events.ts`, `src/web/ui/`): `atom --web [--port <n>]` serves a
7
+ loopback-only agentic frontend over the same runtime as the TUI, with a
8
+ read-only JSON API (`/api/health`, `/api/providers`, `/api/sessions`).
9
+ The web runtime shares the pure diff engine (`src/ui/diff.ts`) with the
10
+ TUI so both surfaces compute identical hunks/rows; suites in
11
+ `tests/web-server.test.ts`, `tests/web-runtime.test.ts`,
12
+ `tests/web-events.test.ts`, `tests/web-slash.test.ts`. The build copies
13
+ the client assets into `dist/web/ui/` (`scripts/copy-web-ui.mjs`, wired
14
+ into `npm run build`), so the published tarball serves them with no
15
+ extra step
16
+ - Shared loop core (`src/agent/tool-pipeline.ts`,
17
+ `src/agent/turn-events.ts`): tool dispatch and turn-event fan-out
18
+ extracted from the loop with parity coverage
19
+ (`tests/tool-pipeline.test.ts`, `tests/parallel-pipeline-parity.test.ts`,
20
+ `tests/loop-turn-events.test.ts`, `tests/turn-events-consume.test.ts`)
21
+ - New focused modules with suites: media/vision accounting (`src/media.ts`),
22
+ overflow spills (`src/overflow.ts`), session revert (`src/session-revert.ts`),
23
+ file diffs (`src/file-diffs.ts`), session todos (`src/todos.ts`), and the
24
+ paint scheduler (`src/ui/paint-scheduler.ts`)
25
+ - Docs audit: fixed `documentation/` agent links, documented `--web` and the
26
+ extension flags in `cli.md`, corrected the `maxToolSteps` default
27
+ (uncapped; the shipped example sets `30`), added `compactAuto` /
28
+ `compactReserve` keys, corrected `update_goal` payload visibility, and
29
+ refreshed the project layout in `README.md` / `development.md`
30
+ - Current-behavior suites pinning post-1.4.0 contracts
31
+ (`tests/diff-panes-current.test.tsx`,
32
+ `tests/ui-boundary-current.test.ts`,
33
+ `tests/turn-diff-current.test.tsx`, `tests/turn-error-current.test.tsx`,
34
+ `tests/session-new-current.test.tsx`,
35
+ `tests/session-switch-todo-current.test.tsx`). Known stale: pre-web
36
+ assertions in `tests/architecture.test.ts` (blanket `ui/*` ban),
37
+ `tests/hostile-perf.test.tsx`, `tests/turn-events-consume.test.tsx`
38
+ (`BEFORE`/`AFTER` labels), `tests/session.test.tsx` (retired system
39
+ wording), `tests/session-lifecycle.test.tsx` (retired notice text), and
40
+ `tests/turn-failure.test.tsx` (retired marker) — slated for retirement
41
+ in a follow-up; the new suites are the current contracts
42
+
3
43
  ## 1.4.0 — 2026-09-11
4
44
 
5
45
  - Uncapped TUI diffs (`src/ui/diff.ts`, `src/ui/side-by-side.tsx`,
package/README.md CHANGED
@@ -1,9 +1,12 @@
1
- # ⚛ Atom — a minimal AI coding agent for your terminal
1
+ # ATOM
2
+
3
+ > A fast, transparent AI coding agent for your terminal.
2
4
 
3
5
  [![npm version](https://img.shields.io/npm/v/atom-agent.svg)](https://www.npmjs.com/package/atom-agent)
4
- [![license](https://img.shields.io/npm/l/atom-agent.svg)](LICENSE)
6
+ [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18-blue.svg)](https://nodejs.org/)
7
+ [![License](https://img.shields.io/npm/l/atom-agent.svg)](LICENSE)
5
8
 
6
- ```
9
+ ```text
7
10
  █████╗ ████████╗ ██████╗ ███╗ ███╗
8
11
  ██╔══██╗╚══██╔══╝██╔═══██╗████╗ ████║
9
12
  ███████║ ██║ ██║ ██║██╔████╔██║
@@ -12,264 +15,257 @@
12
15
  ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
13
16
  ```
14
17
 
15
- Atom is a small, fast, **agentic** terminal chatbot: it doesn't just answer
16
- it runs an **observe → act → inspect → adjust** loop with **13 real,
17
- locally-executed tools** (files, shell, web), streaming output, and an
18
- interactive Ink TUI. Powered by [Kilo Gateway](https://kilo.ai)
19
- as the default model provider. Zero ceremony: no key, one command, you're chatting
20
- with an agent that can read your code, edit it, run it, and search the web.
18
+ ATOM is a terminal-native coding agent built with [Ink](https://github.com/vadimdemedes/ink) and React. It combines a multi-step agent loop with local file, shell, and web tools, persistent sessions, permission controls, and local observability.
21
19
 
22
- ## Documentation
20
+ Instead of returning a static answer, ATOM can inspect your repository, plan a task, edit files, run commands, inspect the results, and adjust its approach. The terminal interface keeps tool activity, approvals, and progress visible while you stay in control.
21
+
22
+ Kilo Gateway is the default provider. Eligible free models can be used without an API key, and you can switch providers or configure a key at any time.
23
23
 
24
- Full docs live in [`documentation/`](documentation/index.md), same layout as opencode and claude code guides. Start here, then go deep:
25
-
26
- - [Getting Started](documentation/getting-started.md)install, key setup, first run
27
- - [CLI and TUI](documentation/cli.md) slash commands, keyboard, status line
28
- - [Tools](documentation/tools.md)the 13 local executors, caps, background tasks
29
- - [Providers and Models](documentation/providers.md)8 remote providers + 3 local runtimes, endpoints, key resolution (Kilo default, key-optional)
30
- - [Permissions and Modes](documentation/permissions.md) — normal/yolo/plan, trust, allow/deny rules
31
- - [Skills](documentation/skills.md)discovery, frontmatter contract, auto-invoke
32
- - [Sessions](documentation/sessions.md)durable multi-session store, rename, switcher, resume, clear, rewind
33
- - [Goals](documentation/goals.md)pin one session objective that runs turn-to-turn
34
- - [Extensions](documentation/extensions.md) — zero-to-running guide plus working samples
35
- - [Observability](documentation/observability.md) — local telemetry, `/telemetry`, dashboard drill-down
36
- - [Compaction and Token Display](documentation/compaction.md) — auto-compact, manual compact, footer format
37
- - [Configuration](documentation/configuration.md) env vars, auth file, AGENTS.md layering
38
- - [Development](documentation/development.md) scripts, structure, tests, build
39
- - [Troubleshooting](documentation/troubleshooting.md) — auth, models, approvals, TUI fixes
24
+ ## Highlights
25
+
26
+ - **Agentic execution**an observe, plan, act, inspect, and adjust loop with optional task checklists.
27
+ - **Terminal-first interface**streaming output, keyboard controls, slash commands, and a compact status line.
28
+ - **Local tools**file operations, search, shell commands, background processes, and web retrieval.
29
+ - **Flexible providers**Kilo Gateway, major hosted model providers, OpenAI-compatible servers, and local runtimes.
30
+ - **Permission modes** — normal, YOLO, and plan modes, plus session-scoped allow and deny rules.
31
+ - **Persistent work** named sessions, resume and rewind support, and goals that continue across turns.
32
+ - **Local observability** traces, summaries, and a self-contained dashboard stored on your machine.
33
+ - **Extensible**skills and extensions can add workflows, tools, and custom behavior.
34
+
35
+ ## Requirements
36
+
37
+ - Node.js 18 or newer
38
+ - A terminal with TTY support for the interactive interface
40
39
 
41
40
  ## Quickstart
42
41
 
43
- Install the published-style package (global install gives you the `atom`
44
- binary):
42
+ ### Install the package
45
43
 
46
44
  ```bash
47
- npm i -g atom-agent
45
+ npm install -g atom-agent
48
46
  atom
49
47
  ```
50
48
 
51
- Or run from source:
49
+ The global installation provides the `atom` command.
50
+
51
+ ### Run from source
52
52
 
53
53
  ```bash
54
54
  npm install
55
+ npm start
55
56
  ```
56
57
 
57
- No key needed — Kilo Gateway is the default provider and its free models
58
- work anonymously:
58
+ `npm start` launches the interactive TUI and requires a TTY.
59
59
 
60
- ```powershell
61
- npm start
62
- ```
60
+ ### First run
63
61
 
64
- That's it. ATOM discovers Kilo's live model catalog and starts on the free
65
- routing model (`kilo-auto/free`); open `/model` to pick another. A
66
- `KILO_API_KEY` (or any other provider key at
67
- [opencode.ai/auth](https://opencode.ai/auth) for Zen, etc.) is optional
68
- paste one via `/provider` to unlock more. Type `/` to see every command.
69
- Full command reference: [CLI and TUI](documentation/cli.md).
62
+ 1. Start ATOM with `atom` or `npm start`.
63
+ 2. Ask a question about your current repository.
64
+ 3. Type `/` at any time to view the available commands.
65
+ 4. Use `/model` to choose a model and `/provider` to configure a provider key.
70
66
 
71
- ## Updating
67
+ No key is required to try the default Kilo free-model route. Free-model availability and limits are controlled by Kilo and may change. Add `KILO_API_KEY` or use `/provider` when you need broader access.
72
68
 
73
- Check your installed version, then update to the latest release:
69
+ ### Update
74
70
 
75
71
  ```bash
76
- npm ls -g atom-agent # installed version
77
- npm i -g atom-agent@latest
72
+ npm ls -g atom-agent
73
+ npm install -g atom-agent@latest
78
74
  ```
79
75
 
80
- If the old version sticks around, clear the cache and reinstall:
76
+ If npm continues to use an older cached installation, clear the npm cache and install again:
81
77
 
82
78
  ```bash
83
79
  npm cache clean --force
84
- npm i -g atom-agent@latest
80
+ npm install -g atom-agent@latest
81
+ ```
82
+
83
+ Source installations can be updated with `git pull` followed by `npm install`.
84
+
85
+ ## How ATOM works
86
+
87
+ ATOM follows a long-running agent loop:
88
+
89
+ ```text
90
+ observe → plan → act → inspect → adjust
85
91
  ```
86
92
 
87
- Run-from-source users just `git pull` instead. Maintainers: bump `version`
88
- in `package.json`, add a `CHANGELOG.md` entry, commit, tag `vX.Y.Z`, push —
89
- `prepublishOnly` rebuilds `dist/` at `npm publish` time, so never commit it.
90
-
91
- ## What Atom can do
92
-
93
- - 🤖 **Agentic loop** — tool calls execute locally and results feed back in,
94
- with no step cap by default (optional cap via `ATOM_MAX_TOOL_STEPS`, clamped 5–100), with retries on transient failures
95
- - **Streaming** tokens, tool activity, and phase status render live;
96
- reasoning streams in its own dim block above the answer draft
97
- (transient); `Esc` stops a running response (footer shows `esc stops`
98
- while busy)
99
- - 🧰 **13 tools** `read`, `write`, `edit`, `grep`, `glob`, `bash`,
100
- `bash_output`, `websearch`, `webfetch`, `ask_question` (asks *you* things
101
- interactively), `todowrite` / `todo_get` / `todo_update` (session task
102
- checklist with a live TUI panel)
103
- - 🛡️ **Normal / YOLO modes** — `Tab` cycles normal → yolo → plan → normal. Normal auto-runs reads but
104
- asks before writes/shell (`y` once · `a` always · `t` trust all · `n` deny);
105
- `/trust` toggles a session trust tier (one approval covers the whole task,
106
- status shows `+trust`, never saved). YOLO never asks
107
- - 🗺️ **Plan mode** `Tab` from yolo enters a read-only mode for risky work:
108
- exploration (`read`/`grep`/`glob`/web/todos/`ask_question`) runs free while
109
- `write`/`edit`/`bash` are blocked pre-execution with a replan note (never a
110
- prompt). `/yolo`·`/trust` can't punch through
111
- it, `/deny` still wins. `Tab` out of plan approves the recorded todo checklist
112
- into implementation (lands in normal, never yolo)
113
- - ⌨️ **Slash commands** — `/model` (unified picker across keyed providers,
114
- type to filter), `/provider` (provider + key picker, keys in
115
- `~/.atom/auth.json`), `/effort` (reasoning-effort picker), `/tools`,
116
- `/skills`, `/skill:name` (invoke a skill; skills complete in `/`), `/context`
117
- (context usage by source), `/queue` + `/steer <text>` (follow-ups while
118
- busy: queue until the turn ends, or inject into the running turn),
119
- `/goal <objective>` (pin one session objective; bare shows it,
120
- `pause`/`resume`/`clear` manage it), `/compact`, `/telemetry`,
121
- `/dashboard`, `/rewind`, `/session`, `/resume`, `/rename`, `/new`, `/help`, `/mode`, `/trust`,
122
- `/clear`, `/exit` — plus `/`-autocomplete as you type (`/yolo` and `/plan` are retired as typed commands — `Tab` switches modes). Full list: [CLI and TUI](documentation/cli.md)
123
- - 📊 **Status line** — provider · model · session token usage (`token:
124
- (P%) NK`: NK is the cumulative spend in K, P% is the current context load
125
- over the model's verified window — last `prompt_tokens`, else the
126
- 4ch/token estimate; bare `token: NK` where no window is verified,
127
- `token: n/a` until reported — never estimated) · reasoning · mode, plus
128
- `goal: <objective> [active|paused]` while a goal is live (lowest priority,
129
- yields first under width pressure), plus
130
- live phase/elapsed/waiting while busy. It is the sole info bar: there is
131
- no persistent header, only the launch-time banner art.
132
- - 🗜️ **Context compaction** — auto-compacts at ~83% of the verified window
133
- (`ATOM_COMPACT_PCT` percent, 50–95) plus manual `/compact [focus text]`
134
- (structured summary, tools disabled, newest tail kept, thrash guard).
135
- - 📖 **AGENTS.md-aware** — Atom loads your project's `AGENTS.md` into its
136
- system prompt, so it knows your tools, rules, and permission model
137
- - 📊 **Local observability** — every turn is traced (iterations, model calls
138
- with reported-only tokens, per-tool durations and ok/fail, retries,
139
- outcomes) into `~/.atom/telemetry/`; `/telemetry` summarizes, `/dashboard`
140
- (or `atom --dashboard`) writes a self-contained drill-down page, and
141
- `atom --serve` offers the same view live in the browser plus a read-only
142
- JSON API. Local-only, secret-scrubbed, off via `ATOM_TELEMETRY=0`. See
143
- [Observability](documentation/observability.md)
144
- - 🔓 **No path sandbox** — file tools read/write anywhere on the computer
145
- (absolute paths and `..` escapes allowed, including sensitive locations
146
- like `~/.ssh/` — treat contents as untrusted, never exfiltrate or commit
147
- secrets); the permission mode is the control plane. Everything is capped
148
- and truncated
149
-
150
- ## Tools
151
-
152
- Full reference: [Tools](documentation/tools.md) plus [Permissions and Modes](documentation/permissions.md).
153
-
154
- | Tool | What it does | Permission (normal mode) |
93
+ For larger tasks, it can maintain a session checklist with at most one active item. After making code changes, it can run a verification command before reporting the task complete. Tool results are returned to the model, so the next step can respond to the actual state of the repository.
94
+
95
+ The interface streams tokens, tool activity, phase changes, approvals, and elapsed time. Reasoning output is kept separate from the answer draft so the final response remains easy to follow.
96
+
97
+ ## Permission modes
98
+
99
+ | Mode | Behavior |
100
+ |---|---|
101
+ | **Normal** | Read-only tools run automatically. `write`, `edit`, and `bash` requests require approval. |
102
+ | **YOLO** | Tools run without approval prompts. Use only when you are comfortable with automatic local changes and commands. |
103
+ | **Plan** | Read-only exploration is allowed; writes, edits, and shell commands are blocked so you can review a proposed approach. |
104
+
105
+ Press `Tab` to cycle through Normal, YOLO, and Plan. `/trust` provides a session-scoped trust level without switching to YOLO. `/allow` and `/deny` create more precise session rules, and deny rules always take precedence.
106
+
107
+ ## Core capabilities
108
+
109
+ ### Built-in tools
110
+
111
+ ATOM includes 13 built-in tools:
112
+
113
+ | Tool | Purpose | Normal mode |
155
114
  |---|---|---|
156
- | `read` | Read files / list directories | auto |
157
- | `grep` / `glob` | Search contents / find files | auto |
158
- | `websearch` | Keyless web search (discovery) | auto |
159
- | `webfetch` | Fetch pages as markdown/text/html (retrieval) | auto |
160
- | `write` / `edit` | Create / exact-match-patch files | asks |
161
- | `bash` | Shell commands (cwd, timeout, truncated) | asks |
162
- | `bash_output` | Poll a background shell task | auto |
163
- | `todowrite` / `todo_get` / `todo_update` | Session task checklist (live panel) | auto |
164
- | `ask_question` | Interactive picker for clarifications | n/a (is interaction) |
165
-
166
- ### Scoped permission rules
167
-
168
- Beyond all-or-nothing trust: `/allow <tool[:glob]>` pre-approves matching
169
- `write`/`edit`/`bash` calls for the session (no prompt e.g. `/allow
170
- bash:npm test*`, `/allow write:src/**`; bare `/allow bash` matches any args),
171
- and `/deny <tool[:glob]>` refuses matching calls before execution (the model
172
- sees the standard denial result and replans). **Deny wins over `/trust`,
173
- yolo, `[a]lways`, and skill grants.** `/rules` lists the session rules,
174
- `/rules clear` wipes them. Rules are in-memory only (like `/trust`, never
175
- saved); globs use `*` (any sequence) and `?` (one char), matched against the
176
- tool's primary string (command for `bash`, path for `write`/`edit` — the same
177
- primary shown in the `⚙` audit line, which still renders for every
178
- auto-approved call).
179
-
180
- ## Models & provider
181
-
182
- Full reference: [Providers and Models](documentation/providers.md) plus [Configuration](documentation/configuration.md).
183
-
184
- Atom talks to 8 remote providers plus 3 local runtimes (Ollama, LM Studio, llama.cpp) behind one UI (opencode `/connect` mirror,
185
- manual-key only — no OAuth). Kilo Gateway is the default: its free models
186
- (`:free` ids, incl. the `kilo-auto/free` routing model) chat with no key;
187
- paste a key once with `/provider` (validated, stored in
188
- `~/.atom/auth.json`, `0600` on POSIX) to unlock the full catalog or another
189
- provider, chat. Switching provider keeps session history text; system prompt
190
- stays. `/model` is a unified picker: the active provider's live models first
191
- (fallback on any failure), then every other keyed provider's models plus the
192
- always-visible keyless Kilo list (free models carry a `(free)` badge) —
193
- picking one switches provider too. `/effort` (`Auto`/`Low`/`Medium`/`High`/`Max`)
194
- applies on every provider — `reasoning_effort` for OpenAI-chat kinds,
195
- thinking budgets for Anthropic, thinking levels for Gemini (`Auto` omits
196
- it). Your
197
- `/model` + `/provider` + `/effort` picks persist across restarts (fresh
198
- conversation each launch; `/resume` restores it). Project defaults live in
199
- `atom.json` — see [Configuration](documentation/configuration.md).
200
-
201
- ### Model-choice policy
202
-
203
- The Kilo default is `kilo-auto/free` — the gateway's dynamic free routing
204
- model, preferred while no Kilo key is configured (no paid credentials for
205
- first run). The catalog is discovered live, so free-model availability can
206
- change; override any time with `/model`. The zen default is
207
- `deepseek-v4-pro` picked from the live `/models` list for reliable
208
- multi-step tool use (tool calls + reasoning effort supported). Free models
209
- (`big-pickle`, `mimo-v2.5-free`, …) stay selectable via `/model` for quick
210
- single-turn questions. Override any time with `/model` or
211
- `OPENCODE_ZEN_MODEL`.
212
-
213
- | Provider | Key env (wins over stored) | Endpoint | Notes |
214
- |---|---|---|---|
215
- | kilo | `KILO_API_KEY` (optional — free models work anonymously) | `https://api.kilo.ai/api/gateway/chat/completions` | Kilo Gateway default, OpenAI-compatible; live `/models` catalog is authoritative |
216
- | opencode-zen | `OPENCODE_ZEN_API_KEY` | `https://opencode.ai/zen/v1/chat/completions` | OpenAI-compatible chat/completions; key at https://opencode.ai/auth |
217
- | openai | `OPENAI_API_KEY` | `https://api.openai.com/v1/chat/completions` | OpenAI-compatible; key at https://platform.openai.com/api-keys |
218
- | anthropic | `ANTHROPIC_API_KEY` | `https://api.anthropic.com/v1/messages` | Messages API (`x-api-key` + `anthropic-version: 2023-06-01`, `max_tokens` 4096); key at https://console.anthropic.com/settings/keys |
219
- | deepseek | `DEEPSEEK_API_KEY` | `https://api.deepseek.com/chat/completions` | OpenAI-compatible (no `/v1` prefix); key at https://platform.deepseek.com/api_keys |
220
- | mistral | `MISTRAL_API_KEY` | `https://api.mistral.ai/v1/chat/completions` | OpenAI-compatible; key at https://console.mistral.ai/api-keys |
221
- | google-gemini | `GEMINI_API_KEY` (alias `GOOGLE_API_KEY`) | `https://generativelanguage.googleapis.com/v1beta/models/{model}:streamGenerateContent?alt=sse` (`:generateContent` fallback) | `x-goog-api-key`; key at https://aistudio.google.com/apikey |
222
- | openai-compatible | stored key only | stored baseURL (`/chat/completions` appended iff missing) | additionally prompts baseURL (must be http(s)); live `/models` authoritative |
223
-
224
- Keys: never printed full (masked `…last4`), never logged, never in fixtures (tests use `"test-key"`).
225
-
226
- ## Develop
227
-
228
- Full guide: [Development](documentation/development.md). Fixes start at [Troubleshooting](documentation/troubleshooting.md).
115
+ | `read` | Read text or supported images, and list directories | Automatic |
116
+ | `write` / `edit` | Create, overwrite, or patch files | Approval |
117
+ | `grep` / `glob` | Search file contents or locate files | Automatic |
118
+ | `bash` | Run a shell command, including background tasks | Approval |
119
+ | `bash_output` | Poll a background shell task | Automatic |
120
+ | `websearch` / `webfetch` | Discover and retrieve web content | Automatic, subject to network policy |
121
+ | `ask_question` | Ask the user an interactive clarification question | User interaction |
122
+ | `todowrite` / `todo_get` / `todo_update` | Manage the session task checklist and TUI panel | Automatic |
123
+
124
+ Extensions can register additional tools. Custom tools are validated before execution and require approval by default unless explicitly configured otherwise.
125
+
126
+ ### Sessions and goals
127
+
128
+ Sessions preserve conversation history, usage information, preferences, and the active goal. Use `/session` to switch sessions, `/resume` to restore the most recent saved session, and `/rewind` to restore files from a session checkpoint.
129
+
130
+ A pinned goal can keep the agent working across turns until it is completed, blocked, paused, or cleared:
131
+
132
+ ```text
133
+ /goal <objective>
134
+ /goal pause
135
+ /goal resume
136
+ /goal clear
137
+ ```
138
+
139
+ ### Context and project instructions
140
+
141
+ ATOM automatically compacts long conversations to stay within the model's context window. Manual compaction is available through `/compact`. When present, the project's `AGENTS.md` is loaded into the system prompt so the agent can follow repository-specific instructions and conventions.
142
+
143
+ ### Providers and models
144
+
145
+ ATOM supports a unified model picker across:
146
+
147
+ - Kilo Gateway (default; free models available anonymously where eligible)
148
+ - OpenCode Zen
149
+ - OpenAI
150
+ - Anthropic
151
+ - DeepSeek
152
+ - Mistral
153
+ - Google Gemini
154
+ - OpenAI-compatible servers
155
+ - Local Ollama, LM Studio, and llama.cpp runtimes
156
+
157
+ Provider keys can be supplied through environment variables or the `/provider` command. Stored keys live in `~/.atom/auth.json`; environment variables take precedence. Keys are masked in the interface and are not printed in logs.
158
+
159
+ Use `/model` to select a model, `/provider` to switch or configure a provider, and `/effort` to adjust reasoning effort. See [Providers and Models](documentation/providers.md) for endpoints, key resolution, local runtimes, and model-selection behavior.
160
+
161
+ ## Useful commands
162
+
163
+ | Command | Description |
164
+ |---|---|
165
+ | `/model` | Select a model from the unified picker |
166
+ | `/provider` | Select a provider and configure its key |
167
+ | `/effort` | Set reasoning effort |
168
+ | `/mode` | Show the current permission mode |
169
+ | `/trust` | Toggle session trust |
170
+ | `/allow` / `/deny` | Add a scoped session rule |
171
+ | `/tools` | List available tools |
172
+ | `/skills` / `/skill:name` | List or invoke a skill |
173
+ | `/goal` | Create or manage a long-running goal |
174
+ | `/session` / `/resume` | Switch or restore a session |
175
+ | `/compact` | Compact older conversation context |
176
+ | `/telemetry` / `/dashboard` | View local usage traces and generate a report |
177
+ | `/rewind` | Restore files from a session checkpoint |
178
+ | `/help` | Show the command reference |
179
+
180
+ Type `/` to use command autocomplete. The complete command and keyboard reference is in [CLI and TUI](documentation/cli.md).
181
+
182
+ ## Observability
183
+
184
+ ATOM records local traces for completed, failed, and cancelled turns. The data is stored under `~/.atom/telemetry/`; it is not sent to a remote service.
229
185
 
230
186
  ```bash
231
- npm start # run the TUI from source (needs a TTY)
232
- npm test # vitest suite (fully mocked never hits live APIs)
233
- npm run typecheck
234
- npm run build # emit dist/ (the `atom` binary entry is dist/cli.js)
187
+ atom --dashboard # write a static dashboard and exit
188
+ atom --serve # serve the live observability dashboard on loopback
189
+ atom --web # start the local agentic Web UI
235
190
  ```
236
191
 
237
- Env knobs: `KILO_API_KEY` (optional; or stored Kilo key via `/provider`), `OPENCODE_ZEN_API_KEY` (or stored zen key via `/provider`), `OPENCODE_ZEN_MODEL`,
238
- `OPENCODE_ZEN_ENDPOINT`, `OPENCODE_AGENTS_PATH`, `ATOM_COMPACT_PCT` (auto-compact percent, 50–95),
239
- `ATOM_MAX_TOOL_STEPS` (optional cap on tool rounds per turn, clamped 5–100),
240
- plus per-provider key env vars above.
241
- `~/.atom/auth.json` holds pasted keys (`{version:1, providers:{"<id>":{apiKey, baseURL?}}}`, `0600` POSIX).
192
+ The dashboard includes session and turn summaries, model and tool-call metrics, outcomes, durations, filters, and timelines. Telemetry can be disabled with `ATOM_TELEMETRY=0` or through the `telemetry` setting in `atom.json`.
193
+
194
+ See [Observability](documentation/observability.md) for details about the stored data, dashboard, privacy rules, and local server.
195
+
196
+ ## Documentation
197
+
198
+ The README is an overview. Detailed guides live in [`documentation/`](documentation/index.md):
199
+
200
+ - [Getting Started](documentation/getting-started.md) — installation, first run, and key setup
201
+ - [CLI and TUI](documentation/cli.md) — commands, keyboard controls, and status line
202
+ - [Tools](documentation/tools.md) — tool reference, limits, scheduling, and safety behavior
203
+ - [Permissions and Modes](documentation/permissions.md) — approval modes and scoped rules
204
+ - [Providers and Models](documentation/providers.md) — provider endpoints and model selection
205
+ - [Sessions](documentation/sessions.md) — persistence, resume, rewind, and session management
206
+ - [Goals](documentation/goals.md) — long-running objectives and goal controls
207
+ - [Skills](documentation/skills.md) and [Extensions](documentation/extensions.md)
208
+ - [Configuration](documentation/configuration.md) — environment variables and `atom.json`
209
+ - [Observability](documentation/observability.md) — local traces and dashboards
210
+ - [Development](documentation/development.md) — contributor setup and verification
211
+ - [Troubleshooting](documentation/troubleshooting.md) — common setup and runtime issues
212
+
213
+ ## Development
242
214
 
215
+ Clone the repository and install dependencies:
216
+
217
+ ```bash
218
+ git clone https://github.com/beast-ofcourse/Atom.git
219
+ cd Atom
220
+ npm install
221
+ ```
222
+
223
+ Common development commands:
224
+
225
+ ```bash
226
+ npm start # launch the TUI from source
227
+ npm test # run the Vitest suite
228
+ npm run typecheck # run TypeScript checks
229
+ npm run build # emit the distributable files in dist/
243
230
  ```
244
- .
245
- ├── src/
246
- │ ├── cli.tsx # entry: --help/--dashboard/--serve, always starts TUI (missing key guides to /provider)
247
- │ ├── App.tsx # Ink TUI: transcript, pickers, Tab modes, /trust, approvals, status line
248
- │ ├── telemetry.ts # local observability recorder + store (never throws, off via ATOM_TELEMETRY=0)
249
- │ ├── telemetry-dashboard.ts # self-contained local dashboard page (session → turn → iteration → call)
250
- │ ├── zen.ts # provider dispatch + agentic-loop wrappers (shared core in src/agent/loop.ts) + SSE
251
- │ ├── tools.ts # 13 local tool executors + function schemas (read/write/edit/grep/glob/bash/…)
252
- │ ├── permissions.ts # allow/deny rule matcher backing /allow /deny /rules
253
- ├── snapshots.ts # pre-mutation file snapshots backing /rewind
254
- ├── skills.ts # skill discovery backing /skills
255
- ├── env-block.ts # per-turn cwd/git/node environment block
256
- ├── providers.ts # 8 remote providers + 3 local runtimes (kind/endpoint/env/default + fallback models; Kilo default)
257
- ├── kilo.ts # Kilo Gateway: catalog parsing, free detection, TTL cache, error normalization
258
- ├── auth.ts # ~/.atom/auth.json store (env wins, 0600 POSIX)
259
- ├── adapters.ts # anthropic/gemini translation + SSE + models-list parsing + key validation
260
- ├── compact.ts # context compaction: load/trigger math, split, summary POST (tools off)
261
- ├── session.ts # legacy single-file save/resume (session.json)
262
- │ ├── sessions.ts # durable multi-session store (sessions/, /rename, /session picker)
263
- │ ├── context-windows.ts # curated per-model context windows + `token: (P%) NK` format
264
- │ └── system.ts # base system prompt (long-horizon operating contract)
265
- ├── dist/ # `npm run build` output (`atom` runs dist/cli.js; gitignored, shipped in the tarball)
266
- ├── tests/ # fully mocked (never live APIs; keys use "test-key")
267
- ├── documentation/ # user manual (getting started → troubleshooting)
268
- ├── AGENTS.md # agent instructions overlay (loaded at startup, minimal)
269
- ├── tsconfig.build.json # build-only config (src -> dist)
270
- └── .env.example # env template (never commit a real key)
231
+
232
+ `dist/` is generated output and is not committed. The package build is run automatically before publishing. Tests are mocked and do not call live provider APIs; use placeholder keys only in fixtures and examples.
233
+
234
+ See [Development](documentation/development.md) and [Architecture](documentation/architecture.md) before making substantial changes.
235
+
236
+ ## Project layout
237
+
238
+ ```text
239
+ src/
240
+ ├── cli.tsx # entry: --help/--dashboard/--serve/--web, extension flags
241
+ ├── App.tsx # Ink TUI root (transcript, pickers, modes, status line)
242
+ ├── agent/ # shared loop core, gates, types, goal evaluator
243
+ ├── tools/ # per-tool executors plus registry (names, validation, dispatch)
244
+ ├── tools.ts # pure barrel re-exporting tools/* (stable import path)
245
+ ├── ui/ # transcript, diff stack, panels, pickers, status line
246
+ ├── web/ # local agentic Web UI runtime (served by atom --web)
247
+ ├── providers.ts # 8 remote providers + 3 local runtimes (kilo default)
248
+ ├── telemetry.ts # local trace recording (+ dashboard/server siblings)
249
+ └── sessions.ts # durable multi-session store (+ session.json compat)
250
+ tests/ # unit and interface tests (mocked, never live APIs)
251
+ documentation/ # user and contributor guides
252
+ scripts/ # build and maintenance utilities
271
253
  ```
272
254
 
255
+ See [Development](documentation/development.md) and [Architecture](documentation/architecture.md) for the full module map and boundary rules.
256
+
257
+ ## Security and privacy
258
+
259
+ ATOM is designed to execute real local actions. File tools have no path sandbox, and shell commands run with the permissions of the current user. Treat repository contents, tool output, and untrusted extensions as untrusted input. Never commit or expose API keys, credentials, or sensitive files.
260
+
261
+ Normal mode prompts before writes, edits, and shell commands. YOLO mode intentionally bypasses those prompts. Scoped `/deny` rules provide an additional safeguard and take precedence over trust and YOLO. Network retrieval is governed by the configured network policy; private and link-local destinations are blocked by default.
262
+
263
+ API keys are stored outside the repository in `~/.atom/auth.json`. Telemetry is local by default and can be disabled entirely.
264
+
273
265
  ## License
274
266
 
275
267
  MIT — see [LICENSE](LICENSE).
268
+
269
+ ## Contributing
270
+
271
+ Contributions are welcome. Please open an [issue](https://github.com/beast-ofcourse/Atom/issues) for bugs or proposals, and include the relevant test or typecheck results with pull requests.