atom-agent 1.4.0 → 1.5.1

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 (68) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +221 -224
  3. package/dist/App.js +922 -341
  4. package/dist/adapters.js +502 -21
  5. package/dist/agent/goal-evaluator.js +3 -0
  6. package/dist/agent/loop.js +250 -434
  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/providers.js +11 -3
  21. package/dist/scheduler.js +38 -9
  22. package/dist/session-revert.js +125 -0
  23. package/dist/sessions.js +101 -0
  24. package/dist/snapshots.js +69 -0
  25. package/dist/system.js +2 -89
  26. package/dist/telemetry.js +79 -5
  27. package/dist/todos.js +241 -0
  28. package/dist/tools/filesystem.js +102 -22
  29. package/dist/tools/registry.js +184 -45
  30. package/dist/tools/ripgrep.js +7 -6
  31. package/dist/tools/search.js +172 -17
  32. package/dist/tools/shared.js +6 -0
  33. package/dist/tools.js +7 -39
  34. package/dist/ui/diff-panel.js +1 -1
  35. package/dist/ui/diff-view.js +13 -5
  36. package/dist/ui/diff.js +67 -0
  37. package/dist/ui/errors.js +20 -6
  38. package/dist/ui/input.js +24 -20
  39. package/dist/ui/live-tail.js +36 -1
  40. package/dist/ui/markdown.js +9 -4
  41. package/dist/ui/modals.js +7 -5
  42. package/dist/ui/paint-scheduler.js +120 -0
  43. package/dist/ui/palette.js +4 -2
  44. package/dist/ui/pickers.js +4 -1
  45. package/dist/ui/side-by-side.js +81 -22
  46. package/dist/ui/status-bar.js +63 -8
  47. package/dist/ui/stream-store.js +7 -0
  48. package/dist/ui/theme.js +23 -1
  49. package/dist/ui/todo-panel.js +5 -2
  50. package/dist/ui/tool-inspector.js +33 -4
  51. package/dist/ui/transcript.js +8 -5
  52. package/dist/web/events.js +93 -0
  53. package/dist/web/runtime.js +790 -0
  54. package/dist/web/server.js +570 -0
  55. package/dist/web/ui/app.js +1925 -0
  56. package/dist/web/ui/index.html +135 -0
  57. package/dist/web/ui/styles.css +515 -0
  58. package/dist/zen.js +532 -34
  59. package/documentation/cli.md +5 -5
  60. package/documentation/configuration.md +11 -6
  61. package/documentation/development.md +4 -3
  62. package/documentation/goals.md +1 -1
  63. package/documentation/index.md +4 -4
  64. package/documentation/providers.md +2 -3
  65. package/documentation/skills.md +3 -3
  66. package/documentation/tools.md +8 -3
  67. package/documentation/troubleshooting.md +1 -1
  68. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,75 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.1 — 2026-09-12
4
+
5
+ - OpenCode Zen free tiers all usable (`src/adapters.ts`, `src/zen.ts`,
6
+ `src/providers.ts`): every request now carries the official-client
7
+ identity (`User-Agent: opencode/*` plus `x-opencode-session` /
8
+ `x-opencode-request`), clearing the upstream `429 FreeUsageLimitError`
9
+ and `400 MissingSessionID` gates for anonymous and keyed calls alike.
10
+ Suites in `tests/zen-headers.test.ts`
11
+ - New Responses-family transport (`src/adapters.ts`,
12
+ `src/zen.ts`): `muse-spark-1.2` / `muse-spark-1.3` (including the free
13
+ contributor tiers) ride Zen's `/responses` endpoint with full
14
+ retry/hook/compaction/media parity — tool calls, streaming tokens,
15
+ reasoning-effort mapping, and `incomplete` → `truncated` handling.
16
+ Routing is automatic by model family; every other provider is
17
+ byte-identical. Suites in `tests/zen-responses.test.ts`
18
+ - Picker lists all eight free Zen models (`FALLBACK_MODELS` in
19
+ `src/zen.ts`, `fallbackModels` in `src/providers.ts`): `big-pickle`,
20
+ `mimo-v2.5-free`, `ling-3.0-flash-fin-free`, `nemotron-3-ultra-free`,
21
+ `nemotron-3.5-lightning-free`, `deepseek-v4-flash-free`,
22
+ `muse-spark-1.3-contributor-free`, `muse-spark-1.2-contributor-free`
23
+ - Loop/telemetry phase timing (`src/agent/loop.ts`,
24
+ `src/agent/types.ts`, `src/telemetry.ts`): per-turn model vs tool
25
+ totals, slowest model call, and truncation notices surfaced through
26
+ `LoopStats`; telemetry schema v2 with v1 back-compat, failed-turn
27
+ partial replies preserved for post-mortem. Accuracy fixes: each failed
28
+ POST and each truncation counts exactly once; timeline events fire for
29
+ failed turns only
30
+ - Housekeeping: downloaded third-party skills (`.agents/skills/`,
31
+ `skills-lock.json`) are now gitignored
32
+
33
+ ## 1.5.0 — 2026-09-12
34
+
35
+ - Local agentic Web UI (`src/web/server.ts`, `src/web/runtime.ts`,
36
+ `src/web/events.ts`, `src/web/ui/`): `atom --web [--port <n>]` serves a
37
+ loopback-only agentic frontend over the same runtime as the TUI, with a
38
+ read-only JSON API (`/api/health`, `/api/providers`, `/api/sessions`).
39
+ The web runtime shares the pure diff engine (`src/ui/diff.ts`) with the
40
+ TUI so both surfaces compute identical hunks/rows; suites in
41
+ `tests/web-server.test.ts`, `tests/web-runtime.test.ts`,
42
+ `tests/web-events.test.ts`, `tests/web-slash.test.ts`. The build copies
43
+ the client assets into `dist/web/ui/` (`scripts/copy-web-ui.mjs`, wired
44
+ into `npm run build`), so the published tarball serves them with no
45
+ extra step
46
+ - Shared loop core (`src/agent/tool-pipeline.ts`,
47
+ `src/agent/turn-events.ts`): tool dispatch and turn-event fan-out
48
+ extracted from the loop with parity coverage
49
+ (`tests/tool-pipeline.test.ts`, `tests/parallel-pipeline-parity.test.ts`,
50
+ `tests/loop-turn-events.test.ts`, `tests/turn-events-consume.test.ts`)
51
+ - New focused modules with suites: media/vision accounting (`src/media.ts`),
52
+ overflow spills (`src/overflow.ts`), session revert (`src/session-revert.ts`),
53
+ file diffs (`src/file-diffs.ts`), session todos (`src/todos.ts`), and the
54
+ paint scheduler (`src/ui/paint-scheduler.ts`)
55
+ - Docs audit: fixed `documentation/` agent links, documented `--web` and the
56
+ extension flags in `cli.md`, corrected the `maxToolSteps` default
57
+ (uncapped; the shipped example sets `30`), added `compactAuto` /
58
+ `compactReserve` keys, corrected `update_goal` payload visibility, and
59
+ refreshed the project layout in `README.md` / `development.md`
60
+ - Current-behavior suites pinning post-1.4.0 contracts
61
+ (`tests/diff-panes-current.test.tsx`,
62
+ `tests/ui-boundary-current.test.ts`,
63
+ `tests/turn-diff-current.test.tsx`, `tests/turn-error-current.test.tsx`,
64
+ `tests/session-new-current.test.tsx`,
65
+ `tests/session-switch-todo-current.test.tsx`). Known stale: pre-web
66
+ assertions in `tests/architecture.test.ts` (blanket `ui/*` ban),
67
+ `tests/hostile-perf.test.tsx`, `tests/turn-events-consume.test.tsx`
68
+ (`BEFORE`/`AFTER` labels), `tests/session.test.tsx` (retired system
69
+ wording), `tests/session-lifecycle.test.tsx` (retired notice text), and
70
+ `tests/turn-failure.test.tsx` (retired marker) — slated for retirement
71
+ in a follow-up; the new suites are the current contracts
72
+
3
73
  ## 1.4.0 — 2026-09-11
4
74
 
5
75
  - Uncapped TUI diffs (`src/ui/diff.ts`, `src/ui/side-by-side.tsx`,
package/README.md CHANGED
@@ -1,9 +1,13 @@
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
+ [![npm downloads](https://img.shields.io/npm/dm/atom-agent.svg)](https://www.npmjs.com/package/atom-agent)
7
+ [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18-blue.svg)](https://nodejs.org/)
8
+ [![License](https://img.shields.io/npm/l/atom-agent.svg)](LICENSE)
5
9
 
6
- ```
10
+ ```text
7
11
  █████╗ ████████╗ ██████╗ ███╗ ███╗
8
12
  ██╔══██╗╚══██╔══╝██╔═══██╗████╗ ████║
9
13
  ███████║ ██║ ██║ ██║██╔████╔██║
@@ -12,264 +16,257 @@
12
16
  ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
13
17
  ```
14
18
 
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.
19
+ 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
20
 
22
- ## Documentation
21
+ 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.
22
+
23
+ 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
24
 
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
25
+ ## Highlights
26
+
27
+ - **Agentic execution**an observe, plan, act, inspect, and adjust loop with optional task checklists.
28
+ - **Terminal-first interface**streaming output, keyboard controls, slash commands, and a compact status line.
29
+ - **Local tools**file operations, search, shell commands, background processes, and web retrieval.
30
+ - **Flexible providers**Kilo Gateway, major hosted model providers, OpenAI-compatible servers, and local runtimes.
31
+ - **Permission modes** — normal, YOLO, and plan modes, plus session-scoped allow and deny rules.
32
+ - **Persistent work** named sessions, resume and rewind support, and goals that continue across turns.
33
+ - **Local observability** traces, summaries, and a self-contained dashboard stored on your machine.
34
+ - **Extensible**skills and extensions can add workflows, tools, and custom behavior.
35
+
36
+ ## Requirements
37
+
38
+ - Node.js 18 or newer
39
+ - A terminal with TTY support for the interactive interface
40
40
 
41
41
  ## Quickstart
42
42
 
43
- Install the published-style package (global install gives you the `atom`
44
- binary):
43
+ ### Install the package
45
44
 
46
45
  ```bash
47
- npm i -g atom-agent
46
+ npm install -g atom-agent
48
47
  atom
49
48
  ```
50
49
 
51
- Or run from source:
50
+ The global installation provides the `atom` command.
51
+
52
+ ### Run from source
52
53
 
53
54
  ```bash
54
55
  npm install
56
+ npm start
55
57
  ```
56
58
 
57
- No key needed — Kilo Gateway is the default provider and its free models
58
- work anonymously:
59
+ `npm start` launches the interactive TUI and requires a TTY.
59
60
 
60
- ```powershell
61
- npm start
62
- ```
61
+ ### First run
63
62
 
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).
63
+ 1. Start ATOM with `atom` or `npm start`.
64
+ 2. Ask a question about your current repository.
65
+ 3. Type `/` at any time to view the available commands.
66
+ 4. Use `/model` to choose a model and `/provider` to configure a provider key.
70
67
 
71
- ## Updating
68
+ 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
69
 
73
- Check your installed version, then update to the latest release:
70
+ ### Update
74
71
 
75
72
  ```bash
76
- npm ls -g atom-agent # installed version
77
- npm i -g atom-agent@latest
73
+ npm ls -g atom-agent
74
+ npm install -g atom-agent@latest
78
75
  ```
79
76
 
80
- If the old version sticks around, clear the cache and reinstall:
77
+ If npm continues to use an older cached installation, clear the npm cache and install again:
81
78
 
82
79
  ```bash
83
80
  npm cache clean --force
84
- npm i -g atom-agent@latest
81
+ npm install -g atom-agent@latest
82
+ ```
83
+
84
+ Source installations can be updated with `git pull` followed by `npm install`.
85
+
86
+ ## How ATOM works
87
+
88
+ ATOM follows a long-running agent loop:
89
+
90
+ ```text
91
+ observe → plan → act → inspect → adjust
85
92
  ```
86
93
 
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) |
94
+ 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.
95
+
96
+ 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.
97
+
98
+ ## Permission modes
99
+
100
+ | Mode | Behavior |
101
+ |---|---|
102
+ | **Normal** | Read-only tools run automatically. `write`, `edit`, and `bash` requests require approval. |
103
+ | **YOLO** | Tools run without approval prompts. Use only when you are comfortable with automatic local changes and commands. |
104
+ | **Plan** | Read-only exploration is allowed; writes, edits, and shell commands are blocked so you can review a proposed approach. |
105
+
106
+ 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.
107
+
108
+ ## Core capabilities
109
+
110
+ ### Built-in tools
111
+
112
+ ATOM includes 13 built-in tools:
113
+
114
+ | Tool | Purpose | Normal mode |
155
115
  |---|---|---|
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).
116
+ | `read` | Read text or supported images, and list directories | Automatic |
117
+ | `write` / `edit` | Create, overwrite, or patch files | Approval |
118
+ | `grep` / `glob` | Search file contents or locate files | Automatic |
119
+ | `bash` | Run a shell command, including background tasks | Approval |
120
+ | `bash_output` | Poll a background shell task | Automatic |
121
+ | `websearch` / `webfetch` | Discover and retrieve web content | Automatic, subject to network policy |
122
+ | `ask_question` | Ask the user an interactive clarification question | User interaction |
123
+ | `todowrite` / `todo_get` / `todo_update` | Manage the session task checklist and TUI panel | Automatic |
124
+
125
+ Extensions can register additional tools. Custom tools are validated before execution and require approval by default unless explicitly configured otherwise.
126
+
127
+ ### Sessions and goals
128
+
129
+ 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.
130
+
131
+ A pinned goal can keep the agent working across turns until it is completed, blocked, paused, or cleared:
132
+
133
+ ```text
134
+ /goal <objective>
135
+ /goal pause
136
+ /goal resume
137
+ /goal clear
138
+ ```
139
+
140
+ ### Context and project instructions
141
+
142
+ 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.
143
+
144
+ ### Providers and models
145
+
146
+ ATOM supports a unified model picker across:
147
+
148
+ - Kilo Gateway (default; free models available anonymously where eligible)
149
+ - OpenCode Zen
150
+ - OpenAI
151
+ - Anthropic
152
+ - DeepSeek
153
+ - Mistral
154
+ - Google Gemini
155
+ - OpenAI-compatible servers
156
+ - Local Ollama, LM Studio, and llama.cpp runtimes
157
+
158
+ 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.
159
+
160
+ 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.
161
+
162
+ ## Useful commands
163
+
164
+ | Command | Description |
165
+ |---|---|
166
+ | `/model` | Select a model from the unified picker |
167
+ | `/provider` | Select a provider and configure its key |
168
+ | `/effort` | Set reasoning effort |
169
+ | `/mode` | Show the current permission mode |
170
+ | `/trust` | Toggle session trust |
171
+ | `/allow` / `/deny` | Add a scoped session rule |
172
+ | `/tools` | List available tools |
173
+ | `/skills` / `/skill:name` | List or invoke a skill |
174
+ | `/goal` | Create or manage a long-running goal |
175
+ | `/session` / `/resume` | Switch or restore a session |
176
+ | `/compact` | Compact older conversation context |
177
+ | `/telemetry` / `/dashboard` | View local usage traces and generate a report |
178
+ | `/rewind` | Restore files from a session checkpoint |
179
+ | `/help` | Show the command reference |
180
+
181
+ Type `/` to use command autocomplete. The complete command and keyboard reference is in [CLI and TUI](documentation/cli.md).
182
+
183
+ ## Observability
184
+
185
+ 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
186
 
230
187
  ```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)
188
+ atom --dashboard # write a static dashboard and exit
189
+ atom --serve # serve the live observability dashboard on loopback
190
+ atom --web # start the local agentic Web UI
235
191
  ```
236
192
 
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).
193
+ 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`.
194
+
195
+ See [Observability](documentation/observability.md) for details about the stored data, dashboard, privacy rules, and local server.
196
+
197
+ ## Documentation
198
+
199
+ The README is an overview. Detailed guides live in [`documentation/`](documentation/index.md):
200
+
201
+ - [Getting Started](documentation/getting-started.md) — installation, first run, and key setup
202
+ - [CLI and TUI](documentation/cli.md) — commands, keyboard controls, and status line
203
+ - [Tools](documentation/tools.md) — tool reference, limits, scheduling, and safety behavior
204
+ - [Permissions and Modes](documentation/permissions.md) — approval modes and scoped rules
205
+ - [Providers and Models](documentation/providers.md) — provider endpoints and model selection
206
+ - [Sessions](documentation/sessions.md) — persistence, resume, rewind, and session management
207
+ - [Goals](documentation/goals.md) — long-running objectives and goal controls
208
+ - [Skills](documentation/skills.md) and [Extensions](documentation/extensions.md)
209
+ - [Configuration](documentation/configuration.md) — environment variables and `atom.json`
210
+ - [Observability](documentation/observability.md) — local traces and dashboards
211
+ - [Development](documentation/development.md) — contributor setup and verification
212
+ - [Troubleshooting](documentation/troubleshooting.md) — common setup and runtime issues
213
+
214
+ ## Development
242
215
 
216
+ Clone the repository and install dependencies:
217
+
218
+ ```bash
219
+ git clone https://github.com/beast-ofcourse/Atom.git
220
+ cd Atom
221
+ npm install
222
+ ```
223
+
224
+ Common development commands:
225
+
226
+ ```bash
227
+ npm start # launch the TUI from source
228
+ npm test # run the Vitest suite
229
+ npm run typecheck # run TypeScript checks
230
+ npm run build # emit the distributable files in dist/
243
231
  ```
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)
232
+
233
+ `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.
234
+
235
+ See [Development](documentation/development.md) and [Architecture](documentation/architecture.md) before making substantial changes.
236
+
237
+ ## Project layout
238
+
239
+ ```text
240
+ src/
241
+ ├── cli.tsx # entry: --help/--dashboard/--serve/--web, extension flags
242
+ ├── App.tsx # Ink TUI root (transcript, pickers, modes, status line)
243
+ ├── agent/ # shared loop core, gates, types, goal evaluator
244
+ ├── tools/ # per-tool executors plus registry (names, validation, dispatch)
245
+ ├── tools.ts # pure barrel re-exporting tools/* (stable import path)
246
+ ├── ui/ # transcript, diff stack, panels, pickers, status line
247
+ ├── web/ # local agentic Web UI runtime (served by atom --web)
248
+ ├── providers.ts # 8 remote providers + 3 local runtimes (kilo default)
249
+ ├── telemetry.ts # local trace recording (+ dashboard/server siblings)
250
+ └── sessions.ts # durable multi-session store (+ session.json compat)
251
+ tests/ # unit and interface tests (mocked, never live APIs)
252
+ documentation/ # user and contributor guides
253
+ scripts/ # build and maintenance utilities
271
254
  ```
272
255
 
256
+ See [Development](documentation/development.md) and [Architecture](documentation/architecture.md) for the full module map and boundary rules.
257
+
258
+ ## Security and privacy
259
+
260
+ 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.
261
+
262
+ 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.
263
+
264
+ API keys are stored outside the repository in `~/.atom/auth.json`. Telemetry is local by default and can be disabled entirely.
265
+
273
266
  ## License
274
267
 
275
268
  MIT — see [LICENSE](LICENSE).
269
+
270
+ ## Contributing
271
+
272
+ 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.