atom-agent 1.0.0 → 1.2.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 (46) hide show
  1. package/CHANGELOG.md +62 -2
  2. package/README.md +17 -16
  3. package/dist/App.js +1010 -77
  4. package/dist/adapters.js +108 -8
  5. package/dist/agent/gates.js +14 -1
  6. package/dist/agent/loop-guard.js +182 -0
  7. package/dist/agent/loop.js +781 -329
  8. package/dist/agent/normalize.js +151 -0
  9. package/dist/cli.js +16 -2
  10. package/dist/compact.js +128 -2
  11. package/dist/env-block.js +43 -5
  12. package/dist/scheduler.js +101 -21
  13. package/dist/sessions.js +524 -0
  14. package/dist/system.js +89 -12
  15. package/dist/telemetry-dashboard.js +19 -1
  16. package/dist/telemetry.js +55 -0
  17. package/dist/tools/dir-cache.js +214 -0
  18. package/dist/tools/filesystem.js +43 -3
  19. package/dist/tools/read-cache.js +160 -0
  20. package/dist/tools/registry.js +80 -0
  21. package/dist/tools/ripgrep.js +256 -0
  22. package/dist/tools/search.js +147 -80
  23. package/dist/tools/shared.js +39 -0
  24. package/dist/tools/shell.js +26 -5
  25. package/dist/tools/todo.js +1 -1
  26. package/dist/tools/web.js +6 -6
  27. package/dist/tools.js +3 -0
  28. package/dist/ui/diff-panel.js +55 -0
  29. package/dist/ui/diff-view.js +117 -0
  30. package/dist/ui/diff.js +422 -0
  31. package/dist/ui/highlight.js +120 -0
  32. package/dist/ui/live-host.js +18 -0
  33. package/dist/ui/live-tail.js +9 -3
  34. package/dist/ui/markdown.js +26 -2
  35. package/dist/ui/modals.js +22 -5
  36. package/dist/ui/palette.js +12 -2
  37. package/dist/ui/side-by-side.js +144 -0
  38. package/dist/ui/status-bar.js +20 -4
  39. package/dist/ui/status-host.js +22 -0
  40. package/dist/ui/stream-store.js +48 -0
  41. package/dist/ui/theme.js +6 -0
  42. package/dist/ui/todo-panel.js +10 -2
  43. package/dist/ui/tool-inspector.js +7 -1
  44. package/dist/ui/transcript.js +105 -39
  45. package/dist/zen.js +97 -20
  46. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,8 +1,68 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 1.2.0 — 2026-09-10
4
4
 
5
- (nothing yet)
5
+ - Durable multi-session store (`src/sessions.ts`): one JSON record per
6
+ session under `~/.atom/sessions/<id>.json` plus a plaintext `active`
7
+ pointer. Records carry stable `ses_` ids (never derived from the display
8
+ name), mutable titles defaulting to the exact local creation date and
9
+ time, separate machine-readable `createdAt`, `updatedAt` on every
10
+ meaningful mutation, `cwd`, provider/model/effort/mode, usage, full
11
+ history/turns, and metadata. Atomic temp-plus-rename writes (`0600`
12
+ POSIX), loads that never throw, most-recent-first listings, no transient
13
+ UI state, no LLM provider coupling
14
+ - `/rename <name>` (current session only; quotes optional; bare prints
15
+ usage): id, `createdAt`, and history untouched, persisted immediately,
16
+ failures keep the previous name
17
+ - `/session [filter]` interactive switcher: most-recent-first picker with
18
+ in-memory fuzzy filter (title first, id fallback), turn counts, relative
19
+ ages, `(current)` marker, windowing for large lists. Selecting replaces
20
+ the live conversation wholesale (no merge, no duplication) with
21
+ provider/model/settings restored; the outgoing turns snapshot first,
22
+ checkpoints and the TODO checklist reset like `/new`, and a missing
23
+ target errors without touching the live session. `Esc` cancels cleanly
24
+ - Runtime integration (`src/App.tsx`): every conversation auto-belongs to
25
+ the active session; completed turns, exits, and compactions mirror into
26
+ the record; `/new` snapshots then swaps records; the legacy
27
+ `session.json` save follows switches so `/resume` stays coherent.
28
+ Session identity surfaces in the picker, confirmations, and the
29
+ empty-state line (the status bar keeps its fixed width budget)
30
+ - Suite: `session-store` (26), `sessions-runtime` (5), `rename` (8),
31
+ `session-picker` (11), `session-lifecycle` (4) — see
32
+ `documentation/sessions.md`
33
+
34
+ ## 1.1.0 — 2026-09-10
35
+
36
+ - Agentic loop hardening (`src/agent/loop.ts`, `types.ts`, `loop-guard.ts`,
37
+ `normalize.ts`; `src/zen.ts`, `adapters.ts`): tool-result and
38
+ model-response normalization, per-tool execution timeouts, total tool-call
39
+ budget per turn, error-streak recovery (holds final text for a fix-forward
40
+ attempt instead of ending on unaddressed failures), opt-in repetition guard
41
+ with background-poll exclusions, and a per-turn `LoopStats` rollup
42
+ (iterations, calls, failures, cache hits, guard hits, bottleneck, context
43
+ growth) reported via `AgenticOpts.onLoopStats`, even on failed turns.
44
+ SSE stall guard (`ATOM_STALL_TIMEOUT_MS`, default 60s) in every streaming
45
+ reader: a silent 200-OK stream fails fast on the permanent Truncated
46
+ contract instead of hanging the turn
47
+ - LoopStats into observability (`src/telemetry.ts`,
48
+ `telemetry-dashboard.ts`, `src/App.tsx`): `recordLoopStats` attaches the
49
+ harness rollup to the open turn trace, aggregates total cache/guard hits,
50
+ dashboard renders per-turn loop fragments plus overview cards
51
+ - Search speed (`src/tools/search.ts`, `dir-cache.ts`, `read-cache.ts`,
52
+ `filesystem.ts`, `shell.ts`): `git ls-files` enumeration (tracked plus
53
+ untracked-non-ignored, `node_modules`/`.git` still excluded), single-pass
54
+ grep (half the file reads), 32-wide bounded-parallel scan with identical
55
+ output order, mtime-checked listing cache with exact invalidation on
56
+ write/edit/bash (`ATOM_FAST_LIST=0` forces the legacy walker), and a
57
+ stat-validated read cache. Measured 3–7x on content search; batching nudge
58
+ added to the system prompt
59
+ - TUI flow (`src/App.tsx`, `ui/transcript.tsx`, `live-tail.tsx`,
60
+ `status-bar.tsx`, `todo-panel.tsx`, `modals.tsx`, `palette.tsx`):
61
+ `/autoscroll on|off` (freezes a following view mid-turn instead of yanking
62
+ it), `/thinking` toggle with per-round model reasoning persisted to the
63
+ transcript (rendering-only; never model history), memoized status bar,
64
+ todo panel, approval/question modals, and palette plus memoized
65
+ palette/checkpoint derivations (timer-tick and picker-nav flicker fix)
6
66
 
7
67
  ## 1.0.0 — 2026-09-09
8
68
 
package/README.md CHANGED
@@ -26,10 +26,10 @@ Full docs live in [`documentation/`](documentation/index.md), same layout as ope
26
26
  - [Getting Started](documentation/getting-started.md) — install, key setup, first run
27
27
  - [CLI and TUI](documentation/cli.md) — slash commands, keyboard, status line
28
28
  - [Tools](documentation/tools.md) — the 13 local executors, caps, background tasks
29
- - [Providers and Models](documentation/providers.md) — 8 providers, endpoints, key resolution (Kilo default, key-optional)
30
- - [Permissions and Modes](documentation/permissions.md) — normal/yolo, trust, allow/deny rules
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
31
  - [Skills](documentation/skills.md) — discovery, frontmatter contract, auto-invoke
32
- - [Sessions](documentation/sessions.md) — persistence, resume, clear, rewind
32
+ - [Sessions](documentation/sessions.md) — durable multi-session store, rename, switcher, resume, clear, rewind
33
33
  - [Observability](documentation/observability.md) — local telemetry, `/telemetry`, dashboard drill-down
34
34
  - [Compaction and Token Display](documentation/compaction.md) — auto-compact, manual compact, footer format
35
35
  - [Configuration](documentation/configuration.md) — env vars, auth file, AGENTS.md layering
@@ -89,7 +89,7 @@ in `package.json`, add a `CHANGELOG.md` entry, commit, tag `vX.Y.Z`, push —
89
89
  ## What Atom can do
90
90
 
91
91
  - 🤖 **Agentic loop** — tool calls execute locally and results feed back in,
92
- up to 30 steps per turn (`ATOM_MAX_TOOL_STEPS`, clamped 5–100), with retries on transient failures
92
+ with no step cap by default (optional cap via `ATOM_MAX_TOOL_STEPS`, clamped 5–100), with retries on transient failures
93
93
  - ⚡ **Streaming** — tokens, tool activity, and phase status render live;
94
94
  reasoning streams in its own dim block above the answer draft
95
95
  (transient); `Esc` stops a running response (footer shows `esc stops`
@@ -98,23 +98,23 @@ in `package.json`, add a `CHANGELOG.md` entry, commit, tag `vX.Y.Z`, push —
98
98
  `bash_output`, `websearch`, `webfetch`, `ask_question` (asks *you* things
99
99
  interactively), `todowrite` / `todo_get` / `todo_update` (session task
100
100
  checklist with a live TUI panel)
101
- - 🛡️ **Normal / YOLO modes** — `Tab` toggles. Normal auto-runs reads but
101
+ - 🛡️ **Normal / YOLO modes** — `Tab` cycles normal → yolo → plan → normal. Normal auto-runs reads but
102
102
  asks before writes/shell (`y` once · `a` always · `t` trust all · `n` deny);
103
103
  `/trust` toggles a session trust tier (one approval covers the whole task,
104
104
  status shows `+trust`, never saved). YOLO never asks
105
- - 🗺️ **Plan mode** — `/plan` enters a read-only mode for risky work:
105
+ - 🗺️ **Plan mode** — `Tab` from yolo enters a read-only mode for risky work:
106
106
  exploration (`read`/`grep`/`glob`/web/todos/`ask_question`) runs free while
107
107
  `write`/`edit`/`bash` are blocked pre-execution with a replan note (never a
108
- prompt). `Tab` never enters/exits plan, `/yolo`·`/trust` can't punch through
109
- it, `/deny` still wins. Exiting `/plan` approves the recorded todo checklist
108
+ prompt). `/yolo`·`/trust` can't punch through
109
+ it, `/deny` still wins. `Tab` out of plan approves the recorded todo checklist
110
110
  into implementation (lands in normal, never yolo)
111
111
  - ⌨️ **Slash commands** — `/model` (unified picker across keyed providers,
112
112
  type to filter), `/provider` (provider + key picker, keys in
113
113
  `~/.atom/auth.json`), `/effort` (reasoning-effort picker), `/tools`,
114
114
  `/skills`, `/skill:name` (invoke a skill; skills complete in `/`), `/context`
115
115
  (context usage by source), `/queue` + `/steer <text>` (follow-ups while
116
- busy: queue until the turn ends, or inject into the running turn), `/help`, `/mode`, `/yolo`, `/trust`, `/plan`,
117
- `/clear`, `/exit` — plus `/`-autocomplete as you type
116
+ busy: queue until the turn ends, or inject into the running turn), `/help`, `/mode`, `/trust`,
117
+ `/clear`, `/exit` — plus `/`-autocomplete as you type (`/yolo` and `/plan` are retired as typed commands — `Tab` switches modes)
118
118
  - 📊 **Status line** — provider · model · session token usage (`token:
119
119
  (P%) NK`: NK is the cumulative spend in K, P% is the current context load
120
120
  over the model's verified window — last `prompt_tokens`, else the
@@ -174,7 +174,7 @@ auto-approved call).
174
174
 
175
175
  Full reference: [Providers and Models](documentation/providers.md) plus [Configuration](documentation/configuration.md).
176
176
 
177
- Atom talks to 8 providers behind one UI (opencode `/connect` mirror,
177
+ Atom talks to 8 remote providers plus 3 local runtimes (Ollama, LM Studio, llama.cpp) behind one UI (opencode `/connect` mirror,
178
178
  manual-key only — no OAuth). Kilo Gateway is the default: its free models
179
179
  (`:free` ids, incl. the `kilo-auto/free` routing model) chat with no key;
180
180
  paste a key once with `/provider` (validated, stored in
@@ -227,7 +227,7 @@ npm run build # emit dist/ (the `atom` binary entry is dist/cli.js)
227
227
 
228
228
  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`,
229
229
  `OPENCODE_ZEN_ENDPOINT`, `OPENCODE_AGENTS_PATH`, `ATOM_COMPACT_PCT` (auto-compact percent, 50–95),
230
- `ATOM_MAX_TOOL_STEPS` (tool rounds per turn, default 30, clamped 5–100),
230
+ `ATOM_MAX_TOOL_STEPS` (optional cap on tool rounds per turn, clamped 5–100),
231
231
  plus per-provider key env vars above.
232
232
  `~/.atom/auth.json` holds pasted keys (`{version:1, providers:{"<id>":{apiKey, baseURL?}}}`, `0600` POSIX).
233
233
 
@@ -235,21 +235,22 @@ plus per-provider key env vars above.
235
235
  .
236
236
  ├── src/
237
237
  │ ├── cli.tsx # entry: --help/--dashboard/--serve, always starts TUI (missing key guides to /provider)
238
- │ ├── App.tsx # Ink TUI: transcript, pickers, modes (/plan /trust), approvals, status line
238
+ │ ├── App.tsx # Ink TUI: transcript, pickers, Tab modes, /trust, approvals, status line
239
239
  │ ├── telemetry.ts # local observability recorder + store (never throws, off via ATOM_TELEMETRY=0)
240
240
  │ ├── telemetry-dashboard.ts # self-contained local dashboard page (session → turn → iteration → call)
241
- │ ├── zen.ts # agentic loop (budgets, todo/verification guards) + provider dispatch + SSE
241
+ │ ├── zen.ts # provider dispatch + agentic-loop wrappers (shared core in src/agent/loop.ts) + SSE
242
242
  │ ├── tools.ts # 13 local tool executors + function schemas (read/write/edit/grep/glob/bash/…)
243
243
  │ ├── permissions.ts # allow/deny rule matcher backing /allow /deny /rules
244
244
  │ ├── snapshots.ts # pre-mutation file snapshots backing /rewind
245
245
  │ ├── skills.ts # skill discovery backing /skills
246
246
  │ ├── env-block.ts # per-turn cwd/git/node environment block
247
- │ ├── providers.ts # 8-provider registry (kind/endpoint/env/default + fallback models; Kilo default)
247
+ │ ├── providers.ts # 8 remote providers + 3 local runtimes (kind/endpoint/env/default + fallback models; Kilo default)
248
248
  │ ├── kilo.ts # Kilo Gateway: catalog parsing, free detection, TTL cache, error normalization
249
249
  │ ├── auth.ts # ~/.atom/auth.json store (env wins, 0600 POSIX)
250
250
  │ ├── adapters.ts # anthropic/gemini translation + SSE + models-list parsing + key validation
251
251
  │ ├── compact.ts # context compaction: load/trigger math, split, summary POST (tools off)
252
- │ ├── session.ts # session save/resume
252
+ │ ├── session.ts # legacy single-file save/resume (session.json)
253
+ │ ├── sessions.ts # durable multi-session store (sessions/, /rename, /session picker)
253
254
  │ ├── context-windows.ts # curated per-model context windows + `token: (P%) NK` format
254
255
  │ └── system.ts # base system prompt (long-horizon operating contract)
255
256
  ├── dist/ # `npm run build` output (`atom` runs dist/cli.js; gitignored, shipped in the tarball)