ada-agent 0.1.0 → 0.3.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 (36) hide show
  1. package/README.md +262 -256
  2. package/docs/architecture.md +38 -14
  3. package/docs/cloudflare.md +81 -0
  4. package/docs/connectors.md +2 -1
  5. package/docs/integrations.md +4 -1
  6. package/package.json +4 -2
  7. package/skills/aesthetic-direction/SKILL.md +24 -24
  8. package/skills/color-palette/SKILL.md +24 -24
  9. package/skills/component-library/SKILL.md +23 -23
  10. package/skills/dark-mode/SKILL.md +24 -24
  11. package/skills/dashboard-ui/SKILL.md +23 -23
  12. package/skills/design-system/SKILL.md +24 -24
  13. package/skills/design-tokens/SKILL.md +24 -24
  14. package/skills/empty-states/SKILL.md +23 -23
  15. package/skills/hero-section/SKILL.md +23 -23
  16. package/skills/micro-interactions/SKILL.md +23 -23
  17. package/skills/motion-design/SKILL.md +23 -23
  18. package/skills/page-transitions/SKILL.md +23 -23
  19. package/skills/pricing-page/SKILL.md +23 -23
  20. package/skills/scroll-animation/SKILL.md +23 -23
  21. package/skills/skeleton-loader/SKILL.md +23 -23
  22. package/skills/tailwind-theme/SKILL.md +24 -24
  23. package/skills/typography/SKILL.md +24 -24
  24. package/skills/ui-polish/SKILL.md +24 -24
  25. package/skills/ui-review/SKILL.md +24 -24
  26. package/skills/web-fonts/SKILL.md +24 -24
  27. package/src/client/autostart.ts +93 -0
  28. package/src/client/catalog.json +1 -0
  29. package/src/client/cli.ts +23 -1
  30. package/src/client/models-dev.ts +57 -3
  31. package/src/selfcheck.ts +404 -364
  32. package/src/server/config.ts +7 -0
  33. package/src/server/providers/openai-compat.ts +4 -2
  34. package/src/server/providers/registry.ts +1 -0
  35. package/src/server/router.ts +5 -1
  36. package/src/shared/types.ts +1 -0
package/README.md CHANGED
@@ -1,256 +1,262 @@
1
- # ada
2
-
3
- [![npm](https://img.shields.io/npm/v/ada-agent)](https://www.npmjs.com/package/ada-agent)
4
- [![CI](https://github.com/black141312/ada/actions/workflows/ci.yml/badge.svg)](https://github.com/black141312/ada/actions/workflows/ci.yml)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![Node ≥ 18](https://img.shields.io/badge/node-%E2%89%A518-green.svg)](package.json)
7
-
8
- A coding agent built from zero — a terminal client in the spirit of pi / Codex / Cursor,
9
- that holds every provider key and speaks one wire
10
- format to the client.
11
-
12
- ![ada architecture](docs/architecture.svg)
13
-
14
- The client talks **only** OpenAI Chat Completions to the backend. The backend routes each request
15
- to the right provider by model id and normalizes every provider back to that one format — so a new
16
- model is **zero code**, and a new OpenAI-compatible provider is **two lines**.
17
-
18
- ---
19
-
20
- ## Features
21
-
22
- - **Agentic loop** — streams, calls tools, feeds results back, repeats until done.
23
- - **Tools** — `read_file`, `write_file`, `edit_file` (exact-match), `apply_patch` (multi-file),
24
- `bash`, `ls`, `grep` (uses `rg` if present), `glob`, `web_fetch`, `web_search`, `lsp_diagnostics`,
25
- `ask_user` (clarifying questions).
26
- - **Auto-format on edit** — written files are formatted with the project's formatter
27
- (prettier/gofmt/rustfmt/ruff/shfmt) in trusted projects; off via `ADA_NO_FORMAT`.
28
- - **LSP diagnostics** — `lsp_diagnostics` runs a language server (typescript-language-server,
29
- pyright, gopls, rust-analyzer) and returns errors/warnings; servers are reused, trusted-project only.
30
- - **Real PTY shell** — `bash` runs in a pseudo-terminal (node-pty), so TTY-only programs, colour, and
31
- progress output behave; ANSI is stripped from what the model sees.
32
- - **Two front-ends** — a classic readline REPL and an inline **TUI** (`--tui`) with a live "thinking"
33
- spinner and Claude-style turn markers.
34
- - **Permission modes — ask / plan / auto** — `/ask` confirms each tool, `/plan` is read-only (ada
35
- plans, `/run` to execute), `/auto` runs freely (destructive `bash` still confirms). Each approval
36
- states in plain words what it wants ("ada wants to run a shell command…") instead of raw args.
37
- - **Skills that actually fire** — ~285 built-in skills; ada routes every request and **auto-applies**
38
- a clearly-matching one (injecting its procedure), or suggests skills to load. See [Skills](#skills).
39
- - **todos**, **checkpoint/undo** (revert the agent's edits), **protected paths**, **git worktrees**,
40
- **workspace snapshots** (`/snapshot` `/restore`), **named agents**, and **subagents** (`spawn_agent`).
41
- - **Sessions** — every turn is persisted; `--continue` / `--resume` to pick up where you left off.
42
- - **Context compaction** — summarizes old turns automatically as context grows.
43
- - **Sign in with GitHub or Google** (RFC 8628 device flow) — zero client config.
44
- - **Extensible** — extensions (tools + hooks + commands), prompt templates, skills, and MCP servers.
45
- - **No build step** — TypeScript run through `tsx`.
46
-
47
- ## Providers
48
-
49
- The backend proxies any OpenAI-compatible upstream and translates the one that isn't (Anthropic):
50
-
51
- | Provider | Models | Key env var |
52
- |---|---|---|
53
- | OpenAI | `gpt-*`, `o*` | `OPENAI_API_KEY` |
54
- | Anthropic | `claude-*` | `ANTHROPIC_API_KEY` |
55
- | Google Gemini | `gemini-*` | `GEMINI_API_KEY` |
56
- | Mistral | `mistral-*` | `MISTRAL_API_KEY` |
57
- | Groq | | `GROQ_API_KEY` |
58
- | DeepSeek | `deepseek-*` | `DEEPSEEK_API_KEY` |
59
- | Together | | `TOGETHER_API_KEY` |
60
- | xAI (Grok) | `grok-*` | `XAI_API_KEY` |
61
- | DashScope (Qwen) | | `DASHSCOPE_API_KEY` |
62
- | OpenRouter | everything else | `OPENROUTER_API_KEY` |
63
- | **Ollama (local)** | `name:tag` (e.g. `qwen2.5-coder:latest`) | *keyless* |
64
-
65
- Routing: a model id containing `:` → local Ollama; otherwise by prefix; an explicit `provider`
66
- field always wins. Set only the keys you have the rest stay dormant (vendor SDKs load lazily).
67
-
68
- ---
69
-
70
- ## Install
71
-
72
- Requires **Node ≥ 18** (and a C toolchain, since `node-pty` builds natively).
73
-
74
- **Run it without installing — `npx`:**
75
-
76
- ```bash
77
- npx ada-agent # the client (published to npm)
78
- npx -p ada-agent ada-server # the backend (second bin in the same package)
79
- # straight from source, no publish needed:
80
- npx github:black141312/ada
81
- ```
82
-
83
- **Install globally** (puts `ada` and `ada-server` on your PATH):
84
-
85
- ```bash
86
- npm install -g ada-agent
87
- ada
88
- ```
89
-
90
- **From a clone** (for hacking on it):
91
-
92
- ```bash
93
- git clone https://github.com/black141312/ada.git
94
- cd ada && npm install
95
- npm link # global `ada` / `ada-server` · or `npm start`
96
- ```
97
-
98
- > The published-npm commands work once a maintainer has run `npm publish`; the `github:` form works
99
- > against the repo today.
100
-
101
- ## Quickstart
102
-
103
- ada is two processes: a **backend** (holds keys, routes) and the **`ada`** client.
104
-
105
- **Option A local, no keys (Ollama):**
106
-
107
- ```bash
108
- # terminal 1: backend
109
- ada-server # http://localhost:8787
110
-
111
- # terminal 2: the agent
112
- ada # pick a local model and chat
113
- ```
114
-
115
- **Option Ba cloud provider:**
116
-
117
- ```bash
118
- # terminal 1
119
- export ANTHROPIC_API_KEY=sk-ant-... # and/or OPENAI_API_KEY, GEMINI_API_KEY, …
120
- ada-server
121
-
122
- # terminal 2
123
- ada --model claude-opus-4-8
124
- ```
125
-
126
- Windows PowerShell: `$env:ANTHROPIC_API_KEY="sk-ant-..."`.
127
-
128
- ---
129
-
130
- ## Using `ada`
131
-
132
- ```bash
133
- ada # interactive; pick a model on first run
134
- ada --tui # inline TUI front-end
135
- ada --model <id> # start on a specific model
136
- ada --list-models # everything your keys can reach (via the backend)
137
- ada --continue # resume the most recent session
138
- ada --resume # pick a session to resume
139
- ada --yolo # auto-approve tool calls (skip prompts)
140
- ada -p "fix the build" # one-shot: print the answer and exit
141
- ```
142
-
143
- **Slash commands** (in a session): `/ask` · `/plan` · `/auto` · `/mode` (cycle the permission mode) ·
144
- `/run` · `/model [id]` · `/models` · `/reasoning low|medium|high|off` ·
145
- `/strategy react|single|plan|multi|toolsmith` · `/agent [name]` · `/todos` · `/undo` · `/snapshot` ·
146
- `/restore` · `/jobs` · `/fork` · `/tree` · `/rewind` · `/compact` · `/context` · `/cost` ·
147
- `/image <path>` · `/paste` · `/login` · `/logout` · `/exit`.
148
-
149
- **Permission modes** — switch with `/ask` · `/plan` · `/auto` (or `/mode` to cycle); the current mode
150
- shows in the prompt line. In **ask** mode each gated tool prompts with what it wants in plain words
151
- (`ada wants to run a shell command…`) and one key: `[y]es` · `[a]uto` (run the rest without asking) ·
152
- `[p]lan` · `[n]o`. **plan** is read-only — ada plans but won't edit; `/run` approves and executes.
153
- **auto** runs tools without asking (destructive `bash` still confirms). `--yolo` starts in **auto**.
154
-
155
- **Subcommands:** `ada mcp …` (connectors) · `ada skill add <url>` · `ada worktree add <name>` ·
156
- `ada serve` (HTTP API) · `ada share` (view a session) · `ada acp` (editor bridge). See
157
- [docs/integrations.md](docs/integrations.md) for the HTTP API, the typed SDK, and ACP.
158
-
159
- **Orchestration strategies** — the harness runs pluggable agent architectures (`--strategy <name>`
160
- or `/strategy`): `react` (default loop), `single` (one shot), `plan` (plan→execute), `multi`
161
- (sub-agent fan-out), and `toolsmith` (read a connected integration's docs and have sub-agents author
162
- skills for it). See [docs/orchestration.md](docs/orchestration.md).
163
-
164
- **Sign in** (optional — identifies you to the backend): run `/login`, choose GitHub or Google, and
165
- enter the device code in your browser. The token is stored locally and sent as your client key.
166
-
167
- ## Skills
168
-
169
- ada ships with **~285 built-in skills** across ~30 categories — specialized instructions the model
170
- pulls in only when a task needs them (progressive disclosure). ada **routes** every request with a
171
- relevance ranker over names + descriptions: when one skill clearly fits, ada **auto-applies** it
172
- injecting its procedure so even a weak model follows it (announced as `↳ skill: <name>`); when the
173
- match is ambiguous it just suggests them. The model can also browse with **`list_skills`** (by
174
- `category`/`filter`), search with **`find_skill`** (ranked), and load one with **`use_skill`** — so
175
- nothing bloats the prompt until it's used. A sample of the categories:
176
-
177
- `git` · `review` · `testing` · `debugging` · `refactoring` · `docs` · `security` · `ci-cd` ·
178
- `performance` · `database` · `api` · `frontend` · `ui-design` · `html` · `pptx` · `image` ·
179
- `graphics` · `languages` · `frameworks` · `mobile` · `cloud` · `observability` · `data-ml` ·
180
- `agent-llm` · `web3` · `networking` · `shell` · `connectors` · `compliance` · …
181
-
182
- Examples: `commit`, `code-review`, `dockerize`, `migration`, `react-hooks`, `terraform-module`,
183
- `rag-pipeline`, `security-audit`, `project-overview`, `architecture-diagram`, `graphify`, `ponytail`.
184
-
185
- Add your own as `SKILL.md` files under `.ada/skills/<name>/` (project) or `~/.ada/skills/<name>/`
186
- (global) `---\ndescription: …\ncategory: …\n---` front-matter is all that's required. Project
187
- skills override global, which override the built-ins. Install remote ones with
188
- `ada skill add <url>` (a `SKILL.md` or a JSON index); `ada skill list` shows them.
189
-
190
- ## Connectors (MCP)
191
-
192
- ada reaches external tools and data through MCP servers. Browse the catalog and add one:
193
-
194
- ```bash
195
- ada mcp # list the catalog (filesystem, github, postgres, slack, sentry, …)
196
- ada mcp add github # write it into .ada/mcp.json, then set the token it prints
197
- ```
198
-
199
- Both **local stdio** servers (`{ command, args }`) and **remote HTTP** servers (`{ url, headers }`)
200
- are supported; their tools appear as `<server>__<tool>`, approval-gated, in trusted projects. See
201
- [docs/connectors.md](docs/connectors.md), or the `connectors` skill category for per-connector setup.
202
-
203
- ## Configuration
204
-
205
- **Client** (`ada`):
206
-
207
- | Env var | Default | Purpose |
208
- |---|---|---|
209
- | `ADA_BACKEND_URL` | `http://localhost:8787/v1` | Where the backend lives |
210
- | `ADA_CLIENT_KEY` | stored login token, else `dev` | Bearer sent to the backend |
211
- | `ADA_MODEL` | — | Default model id |
212
- | `ADA_COMPACT_AT` | `100000` | Token estimate that triggers compaction |
213
- | `ADA_AUTO_APPROVE` | | `1` ⇒ behave like `--yolo` |
214
- | `NO_COLOR` / `ADA_THEME` | — | Disable color / theme overrides |
215
-
216
- **Backend** (`ada-server`):
217
-
218
- | Env var | Default | Purpose |
219
- |---|---|---|
220
- | `ADA_PORT` | `8787` | Listen port |
221
- | `ADA_CLIENT_KEYS` | *(unset = dev/no-auth)* | Comma-separated allowed client keys |
222
- | `ADA_REQUIRE_LOGIN` / `ADA_ALLOWED_USERS` | — | Gate access to verified GitHub/Google users |
223
- | `OLLAMA_BASE_URL` | `http://localhost:11434/v1` | Local Ollama endpoint |
224
- | *(provider keys)* | | See the [Providers](#providers) table |
225
-
226
- ---
227
-
228
- ## Develop
229
-
230
- ```bash
231
- npm run typecheck # tsc --noEmit
232
- npm run selfcheck # offline checks (tools, sessions, routing, parsers, TUI)
233
- npm start # run the client from source
234
- npm run server # run the backend from source
235
- ```
236
-
237
- See **[docs/architecture.md](docs/architecture.md)** for the design (adapters, routing, request
238
- flow, file layout), **[docs/orchestration.md](docs/orchestration.md)** for the agent strategies, and
239
- **[docs/integrations.md](docs/integrations.md)** for the HTTP API / SDK / ACP.
240
-
241
- ## Benchmarks
242
-
243
- ada can run **SWE-bench Verified** — it generates patches for real GitHub issues (one isolated repo
244
- clone per task), emitting an official-format `predictions.jsonl` that the official `swebench` Docker
245
- harness scores. `node bench/swebench.mjs --dataset --model --out runs/x`. See
246
- **[bench/README.md](bench/README.md)** for the full flow (dataset, prereqs, scoring command).
247
-
248
- ## Contributing
249
-
250
- Issues and PRs welcome it's a small, no-build codebase. Run `npm run typecheck && npm run selfcheck`
251
- before a PR and keep changes lean. See **[CONTRIBUTING.md](CONTRIBUTING.md)**; report vulnerabilities
252
- via **[SECURITY.md](SECURITY.md)**.
253
-
254
- ## License
255
-
256
- [MIT](LICENSE) © 2026 Aditya
1
+ # ada
2
+
3
+ [![npm](https://img.shields.io/npm/v/ada-agent)](https://www.npmjs.com/package/ada-agent)
4
+ [![CI](https://github.com/black141312/ada/actions/workflows/ci.yml/badge.svg)](https://github.com/black141312/ada/actions/workflows/ci.yml)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
+ [![Node ≥ 18](https://img.shields.io/badge/node-%E2%89%A518-green.svg)](package.json)
7
+
8
+ A coding agent built from zero — a terminal client in the spirit of pi / Codex / Cursor,
9
+ that holds every provider key and speaks one wire
10
+ format to the client.
11
+
12
+ ![ada architecture](docs/architecture.svg)
13
+
14
+ The client talks **only** OpenAI Chat Completions to the backend. The backend routes each request
15
+ to the right provider by model id and normalizes every provider back to that one format — so a new
16
+ model is **zero code**, and a new OpenAI-compatible provider is **two lines**.
17
+
18
+ ---
19
+
20
+ ## Features
21
+
22
+ - **Agentic loop** — streams, calls tools, feeds results back, repeats until done.
23
+ - **Tools** — `read_file`, `write_file`, `edit_file` (exact-match), `apply_patch` (multi-file),
24
+ `bash`, `ls`, `grep` (uses `rg` if present), `glob`, `web_fetch`, `web_search`, `lsp_diagnostics`,
25
+ `ask_user` (clarifying questions).
26
+ - **Auto-format on edit** — written files are formatted with the project's formatter
27
+ (prettier/gofmt/rustfmt/ruff/shfmt) in trusted projects; off via `ADA_NO_FORMAT`.
28
+ - **LSP diagnostics** — `lsp_diagnostics` runs a language server (typescript-language-server,
29
+ pyright, gopls, rust-analyzer) and returns errors/warnings; servers are reused, trusted-project only.
30
+ - **Real PTY shell** — `bash` runs in a pseudo-terminal (node-pty), so TTY-only programs, colour, and
31
+ progress output behave; ANSI is stripped from what the model sees.
32
+ - **Two front-ends** — a classic readline REPL and an inline **TUI** (`--tui`) with a live "thinking"
33
+ spinner and Claude-style turn markers.
34
+ - **Permission modes — ask / plan / auto** — `/ask` confirms each tool, `/plan` is read-only (ada
35
+ plans, `/run` to execute), `/auto` runs freely (destructive `bash` still confirms). Each approval
36
+ states in plain words what it wants ("ada wants to run a shell command…") instead of raw args.
37
+ - **Skills that actually fire** — ~285 built-in skills; ada routes every request and **auto-applies**
38
+ a clearly-matching one (injecting its procedure), or suggests skills to load. See [Skills](#skills).
39
+ - **todos**, **checkpoint/undo** (revert the agent's edits), **protected paths**, **git worktrees**,
40
+ **workspace snapshots** (`/snapshot` `/restore`), **named agents**, and **subagents** (`spawn_agent`).
41
+ - **Sessions** — every turn is persisted; `--continue` / `--resume` to pick up where you left off.
42
+ - **Context compaction** — summarizes old turns automatically as context grows.
43
+ - **Sign in with GitHub or Google** (RFC 8628 device flow) — zero client config.
44
+ - **Extensible** — extensions (tools + hooks + commands), prompt templates, skills, and MCP servers.
45
+ - **No build step** — TypeScript run through `tsx`.
46
+
47
+ ## Providers
48
+
49
+ The backend proxies any OpenAI-compatible upstream and translates the one that isn't (Anthropic):
50
+
51
+ | Provider | Models | Key env var |
52
+ |---|---|---|
53
+ | OpenAI | `gpt-*`, `o*` | `OPENAI_API_KEY` |
54
+ | Anthropic | `claude-*` | `ANTHROPIC_API_KEY` |
55
+ | Google Gemini | `gemini-*`, `gemma-*` | `GEMINI_API_KEY` |
56
+ | Mistral | `mistral-*`, `codestral-*`, … | `MISTRAL_API_KEY` |
57
+ | DeepSeek | `deepseek-*` | `DEEPSEEK_API_KEY` |
58
+ | xAI (Grok) | `grok-*` | `XAI_API_KEY` |
59
+ | DashScope (Qwen) | `qwen-*`, `qwq-*` | `DASHSCOPE_API_KEY` |
60
+ | **Cloudflare** (Workers AI / AI Gateway) | `@cf/*` (e.g. `@cf/moonshotai/kimi-k2.7-code`) | `CLOUDFLARE_API_TOKEN` (+ `CLOUDFLARE_ACCOUNT_ID`) |
61
+ | Groq | `groq/<model>` | `GROQ_API_KEY` |
62
+ | Together | `together/<model>` | `TOGETHER_API_KEY` |
63
+ | OpenRouter | everything else | `OPENROUTER_API_KEY` |
64
+ | **Ollama (local)** | `name:tag` (e.g. `qwen2.5-coder:latest`) | *keyless* |
65
+
66
+ Routing: a model id containing `:` local Ollama; `@cf/*` Cloudflare; `groq/…`/`together/…` pick
67
+ those providers (their model names — `llama-3.3`, `gemma2` — are ambiguous, so they're explicit);
68
+ otherwise by prefix; an explicit `provider`
69
+ field always wins. Set only the keys you have — the rest stay dormant (vendor SDKs load lazily).
70
+
71
+ **Cloudflare** (Workers AI or AI Gateway) is a step-by-step of its own — see
72
+ **[docs/cloudflare.md](docs/cloudflare.md)**.
73
+
74
+ ---
75
+
76
+ ## Install
77
+
78
+ Requires **Node 18** (and a C toolchain, since `node-pty` builds natively).
79
+
80
+ **Run it without installing — `npx`:**
81
+
82
+ ```bash
83
+ npx ada-agent # the client (published to npm)
84
+ npx -p ada-agent ada-server # the backend (second bin in the same package)
85
+ # straight from source, no publish needed:
86
+ npx github:black141312/ada
87
+ ```
88
+
89
+ **Install globally** (puts `ada` and `ada-server` on your PATH):
90
+
91
+ ```bash
92
+ npm install -g ada-agent
93
+ ada
94
+ ```
95
+
96
+ **From a clone** (for hacking on it):
97
+
98
+ ```bash
99
+ git clone https://github.com/black141312/ada.git
100
+ cd ada && npm install
101
+ npm link # global `ada` / `ada-server` · or `npm start`
102
+ ```
103
+
104
+ > The published-npm commands work once a maintainer has run `npm publish`; the `github:` form works
105
+ > against the repo today.
106
+
107
+ ## Quickstart
108
+
109
+ ada is two processes: a **backend** (holds keys, routes) and the **`ada`** client.
110
+
111
+ `ada` **auto-starts `ada-server`** in the background if it isn't already running — one terminal is
112
+ enough for solo use. (Set `ADA_BACKEND_URL` to a remote URL to skip auto-start, or
113
+ `ADA_NO_AUTOSTART=1` to opt out entirely.)
114
+
115
+ **Option Alocal, no keys (Ollama):**
116
+
117
+ ```bash
118
+ ada # pick a local model and chat (backend auto-spawns)
119
+ ```
120
+
121
+ **Option B — a cloud provider:**
122
+
123
+ ```bash
124
+ export ANTHROPIC_API_KEY=sk-ant-... # and/or OPENAI_API_KEY, GEMINI_API_KEY, …
125
+ ada --model claude-opus-4-8
126
+ ```
127
+
128
+ Windows PowerShell: `$env:ANTHROPIC_API_KEY="sk-ant-..."`.
129
+
130
+ To run `ada-server` as a long-lived shared backend (multi-client setups, or just to keep it warm),
131
+ start it manually first — `ada` will detect and reuse it.
132
+
133
+ ---
134
+
135
+ ## Using `ada`
136
+
137
+ ```bash
138
+ ada # interactive; pick a model on first run
139
+ ada --tui # inline TUI front-end
140
+ ada --model <id> # start on a specific model
141
+ ada --list-models # everything your keys can reach (via the backend)
142
+ ada --continue # resume the most recent session
143
+ ada --resume # pick a session to resume
144
+ ada --yolo # auto-approve tool calls (skip prompts)
145
+ ada -p "fix the build" # one-shot: print the answer and exit
146
+ ```
147
+
148
+ **Slash commands** (in a session): `/ask` · `/plan` · `/auto` · `/mode` (cycle the permission mode) ·
149
+ `/run` · `/model [id]` · `/models` · `/reasoning low|medium|high|off` ·
150
+ `/strategy react|single|plan|multi|toolsmith` · `/agent [name]` · `/todos` · `/undo` · `/snapshot` ·
151
+ `/restore` · `/jobs` · `/fork` · `/tree` · `/rewind` · `/compact` · `/context` · `/cost` ·
152
+ `/image <path>` · `/paste` · `/login` · `/logout` · `/exit`.
153
+
154
+ **Permission modes** — switch with `/ask` · `/plan` · `/auto` (or `/mode` to cycle); the current mode
155
+ shows in the prompt line. In **ask** mode each gated tool prompts with what it wants in plain words
156
+ (`ada wants to run a shell command…`) and one key: `[y]es` · `[a]uto` (run the rest without asking) ·
157
+ `[p]lan` · `[n]o`. **plan** is read-only ada plans but won't edit; `/run` approves and executes.
158
+ **auto** runs tools without asking (destructive `bash` still confirms). `--yolo` starts in **auto**.
159
+
160
+ **Subcommands:** `ada mcp …` (connectors) · `ada skill add <url>` · `ada worktree add <name>` ·
161
+ `ada catalog [provider]` (offline model/price catalog) · `ada serve` (HTTP API) · `ada share`
162
+ (view a session) · `ada acp` (editor bridge). See
163
+ [docs/integrations.md](docs/integrations.md) for the HTTP API, the typed SDK, and ACP.
164
+
165
+ **Orchestration strategies** the harness runs pluggable agent architectures (`--strategy <name>`
166
+ or `/strategy`): `react` (default loop), `single` (one shot), `plan` (plan→execute), `multi`
167
+ (sub-agent fan-out), and `toolsmith` (read a connected integration's docs and have sub-agents author
168
+ skills for it). See [docs/orchestration.md](docs/orchestration.md).
169
+
170
+ **Sign in** (optional identifies you to the backend): run `/login`, choose GitHub or Google, and
171
+ enter the device code in your browser. The token is stored locally and sent as your client key.
172
+
173
+ ## Skills
174
+
175
+ ada ships with **~285 built-in skills** across ~30 categories specialized instructions the model
176
+ pulls in only when a task needs them (progressive disclosure). ada **routes** every request with a
177
+ relevance ranker over names + descriptions: when one skill clearly fits, ada **auto-applies** it
178
+ injecting its procedure so even a weak model follows it (announced as `↳ skill: <name>`); when the
179
+ match is ambiguous it just suggests them. The model can also browse with **`list_skills`** (by
180
+ `category`/`filter`), search with **`find_skill`** (ranked), and load one with **`use_skill`** so
181
+ nothing bloats the prompt until it's used. A sample of the categories:
182
+
183
+ `git` · `review` · `testing` · `debugging` · `refactoring` · `docs` · `security` · `ci-cd` ·
184
+ `performance` · `database` · `api` · `frontend` · `ui-design` · `html` · `pptx` · `image` ·
185
+ `graphics` · `languages` · `frameworks` · `mobile` · `cloud` · `observability` · `data-ml` ·
186
+ `agent-llm` · `web3` · `networking` · `shell` · `connectors` · `compliance` · …
187
+
188
+ Examples: `commit`, `code-review`, `dockerize`, `migration`, `react-hooks`, `terraform-module`,
189
+ `rag-pipeline`, `security-audit`, `project-overview`, `architecture-diagram`, `graphify`, `ponytail`.
190
+
191
+ Add your own as `SKILL.md` files under `.ada/skills/<name>/` (project) or `~/.ada/skills/<name>/`
192
+ (global) `---\ndescription: …\ncategory: …\n---` front-matter is all that's required. Project
193
+ skills override global, which override the built-ins. Install remote ones with
194
+ `ada skill add <url>` (a `SKILL.md` or a JSON index); `ada skill list` shows them.
195
+
196
+ ## Connectors (MCP)
197
+
198
+ ada reaches external tools and data through MCP servers. Browse the catalog and add one:
199
+
200
+ ```bash
201
+ ada mcp # list the catalog (filesystem, github, postgres, slack, sentry, …)
202
+ ada mcp add github # write it into .ada/mcp.json, then set the token it prints
203
+ ```
204
+
205
+ Both **local stdio** servers (`{ command, args }`) and **remote HTTP** servers (`{ url, headers }`)
206
+ are supported; their tools appear as `<server>__<tool>`, approval-gated, in trusted projects. See
207
+ [docs/connectors.md](docs/connectors.md), or the `connectors` skill category for per-connector setup.
208
+
209
+ ## Configuration
210
+
211
+ **Client** (`ada`):
212
+
213
+ | Env var | Default | Purpose |
214
+ |---|---|---|
215
+ | `ADA_BACKEND_URL` | `http://localhost:8787/v1` | Where the backend lives |
216
+ | `ADA_CLIENT_KEY` | stored login token, else `dev` | Bearer sent to the backend |
217
+ | `ADA_MODEL` | — | Default model id |
218
+ | `ADA_COMPACT_AT` | `100000` | Token estimate that triggers compaction |
219
+ | `ADA_AUTO_APPROVE` | — | `1` ⇒ behave like `--yolo` |
220
+ | `NO_COLOR` / `ADA_THEME` | | Disable color / theme overrides |
221
+
222
+ **Backend** (`ada-server`):
223
+
224
+ | Env var | Default | Purpose |
225
+ |---|---|---|
226
+ | `ADA_PORT` | `8787` | Listen port |
227
+ | `ADA_CLIENT_KEYS` | *(unset = dev/no-auth)* | Comma-separated allowed client keys |
228
+ | `ADA_REQUIRE_LOGIN` / `ADA_ALLOWED_USERS` | — | Gate access to verified GitHub/Google users |
229
+ | `OLLAMA_BASE_URL` | `http://localhost:11434/v1` | Local Ollama endpoint |
230
+ | *(provider keys)* | — | See the [Providers](#providers) table |
231
+
232
+ ---
233
+
234
+ ## Develop
235
+
236
+ ```bash
237
+ npm run typecheck # tsc --noEmit
238
+ npm run selfcheck # offline checks (tools, sessions, routing, parsers, TUI)
239
+ npm start # run the client from source
240
+ npm run server # run the backend from source
241
+ ```
242
+
243
+ See **[docs/architecture.md](docs/architecture.md)** for the design (adapters, routing, request
244
+ flow, file layout), **[docs/orchestration.md](docs/orchestration.md)** for the agent strategies, and
245
+ **[docs/integrations.md](docs/integrations.md)** for the HTTP API / SDK / ACP.
246
+
247
+ ## Benchmarks
248
+
249
+ ada can run **SWE-bench Verified** — it generates patches for real GitHub issues (one isolated repo
250
+ clone per task), emitting an official-format `predictions.jsonl` that the official `swebench` Docker
251
+ harness scores. `node bench/swebench.mjs --dataset --model --out runs/x`. See
252
+ **[bench/README.md](bench/README.md)** for the full flow (dataset, prereqs, scoring command).
253
+
254
+ ## Contributing
255
+
256
+ Issues and PRs welcome — it's a small, no-build codebase. Run `npm run typecheck && npm run selfcheck`
257
+ before a PR and keep changes lean. See **[CONTRIBUTING.md](CONTRIBUTING.md)**; report vulnerabilities
258
+ via **[SECURITY.md](SECURITY.md)**.
259
+
260
+ ## License
261
+
262
+ [MIT](LICENSE) © 2026 Aditya
@@ -32,9 +32,26 @@ billing all belong in one place; the client carries only an ada client key. Same
32
32
 
33
33
  ![ada agent loop](agent-loop.svg)
34
34
 
35
- Each turn streams the model's reply; if it contains tool calls, gated ones prompt for approval,
36
- the tools run, and one `{role:"tool", tool_call_id, content}` per call is appended before control
37
- returns to the model — looping until the model stops calling tools.
35
+ Each turn streams the model's reply; if it contains tool calls, gated ones go through the
36
+ **permission mode**, the tools run, and one `{role:"tool", tool_call_id, content}` per call is
37
+ appended before control returns to the model — looping until the model stops calling tools.
38
+
39
+ **Permission modes** (`/ask` · `/plan` · `/auto`, or `/mode` to cycle; shown in the prompt):
40
+
41
+ - **ask** (default) — each gated tool shows a plain-words prompt ("ada wants to run a shell command…")
42
+ and one key: `[y]es` · `[a]uto` · `[p]lan` · `[n]o`. Destructive `bash` always confirms.
43
+ - **plan** — read-only: ada plans but won't edit; `/run` approves and executes.
44
+ - **auto** — runs tools without asking (still confirms destructive `bash`). `--yolo` starts here.
45
+
46
+ **Skills.** ~285 bundled `SKILL.md` instructions load only on demand. A lexical router
47
+ (`client/skill-router.ts`) ranks every request; on a confident, name-exact match ada **auto-applies**
48
+ the skill (injects its procedure, announced `↳ skill: <name>`), otherwise it suggests them. The model
49
+ can also `list_skills` / `find_skill` / `use_skill`. See [orchestration.md](orchestration.md) for the
50
+ strategies (`react`/`plan`/`multi`/`toolsmith`) layered on the same loop.
51
+
52
+ **Programmatic surfaces.** Beyond the REPL/TUI, the same agent drives an HTTP API (`ada serve`), a
53
+ typed SDK, an ACP editor bridge (`ada acp`), and read-only session sharing (`ada share`) — see
54
+ [integrations.md](integrations.md). And it can run **SWE-bench Verified** via [bench/](../bench/).
38
55
 
39
56
  ## Sign in (device flow)
40
57
 
@@ -115,25 +132,32 @@ src/
115
132
  anthropic.ts native Anthropic adapter (lazy @anthropic-ai/sdk)
116
133
 
117
134
  client/ the terminal agent (ada | npm start)
118
- cli.ts REPL: flags, model picker, slash commands, approval prompt
119
- agent.ts the agentic loop (stream → tool calls → feed back → repeat)
120
- tools.ts read/write/edit/bash/ls/grep/glob; protected paths; destructive detection
135
+ cli.ts REPL: flags, model picker, slash commands, ask/plan/auto modes + approval
136
+ agent.ts the agentic loop (stream → tool calls → feed back → repeat) + orchestrators
137
+ tools.ts read_file/write_file/edit_file · apply_patch · bash (PTY) · ls/glob/grep (rg)
138
+ · web_fetch/web_search · lsp_diagnostics · ask_user; protected paths;
139
+ destructive detection; trust-gated auto-format
121
140
  tui.ts inline TUI engine (composer, spinner, user bar)
122
141
  tui-mode.ts the TUI loop
123
- session.ts append-only JSONL session store (.cos0/sessions/)
142
+ session.ts append-only JSONL session store (.ada/sessions/)
124
143
  compaction.ts context summarization
125
- checkpoint.ts undo: snapshot files before edits, restore on /undo
126
- todos.ts task tracking + render
127
- hooks.ts extension hooks (before/after tool, input transform)
128
- extensions.ts load extensions (tools + hooks + commands)
129
- skills.ts · mcp.ts · prompts.ts skills, MCP servers, prompt templates
144
+ checkpoint.ts · snapshot.ts undo (revert edits) · whole-tree git snapshot/restore
145
+ skills.ts · skill-router.ts skills + the relevance router (auto-apply)
146
+ mcp.ts · prompts.ts · background.ts · models-dev.ts · lsp.ts connectors, templates,
147
+ background jobs, models.dev catalog, LSP client
148
+ todos.ts · hooks.ts · extensions.ts tasks; extension hooks + tools + commands
130
149
  settings.ts · platform.ts · render.ts · image.ts · telemetry.ts · pkg.ts
131
150
 
132
- selfcheck.ts offline checks (tools, sessions, routing, parsers, TUI)
151
+ sdk/index.ts typed client for the HTTP API (`ada serve`)
152
+ selfcheck.ts offline checks (tools, sessions, routing, parsers, TUI, classifiers)
153
+
154
+ bench/
155
+ swebench.mjs SWE-bench Verified prediction generator (scored by the official harness)
133
156
  ```
134
157
 
135
158
  ## No build step
136
159
 
137
160
  Everything runs through `tsx` — TypeScript with no compile. The `bin/*.mjs` launchers register the
138
161
  tsx ESM loader in-process, then import the relevant `.ts` entrypoint (which self-runs). `tsx` is a
139
- runtime dependency so the global `ada` command works after `npm link` / `npm install -g`.
162
+ runtime dependency so the global `ada` command works after `npx ada-agent`, `npm install -g ada-agent`,
163
+ or `npm link` from a clone. (`node-pty` is the one native dep, so a C toolchain is needed at install.)