ada-agent 0.8.0 → 0.9.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.
package/README.md CHANGED
@@ -258,6 +258,10 @@ JIT-provisions a seat for the verified identity and offboarding is immediate. St
258
258
  verification, no new dependency; fail-closed by construction. See
259
259
  **[docs/enterprise-stage2-oidc.md](docs/enterprise-stage2-oidc.md)**.
260
260
 
261
+ **Deploy** — a `Dockerfile` + `docker-compose.yml` run the backend anywhere (`docker compose up`);
262
+ point clients at it with `ADA_BACKEND_URL` / `ada.backendUrl`. Use Cloudflare Workers AI models
263
+ (`@cf/*`) or an AI Gateway with zero code change. See **[docs/deploy.md](docs/deploy.md)**.
264
+
261
265
  ## Benchmarks
262
266
 
263
267
  ada can run **SWE-bench Verified** — it generates patches for real GitHub issues (one isolated repo
package/docs/deploy.md ADDED
@@ -0,0 +1,84 @@
1
+ # Deploying ada-server
2
+
3
+ `ada-server` is the routing backend — it holds provider keys and speaks the OpenAI-compatible API
4
+ that every ada client (the `ada` CLI **and** the ada IDE) points at. It's a small Node HTTP server;
5
+ this guide runs it in a container. Clients then set `ADA_BACKEND_URL` (CLI) or `ada.backendUrl` (IDE)
6
+ to its URL.
7
+
8
+ ## Quick start (container)
9
+
10
+ ```bash
11
+ cp .env.example .env # add at least one provider key (see below)
12
+ docker compose up --build # → http://localhost:8787
13
+
14
+ # point a client at it
15
+ ADA_BACKEND_URL=http://localhost:8787/v1 ada
16
+ ```
17
+
18
+ Or without compose:
19
+
20
+ ```bash
21
+ docker build -t ada-server .
22
+ docker run -p 8787:8787 -v ada-data:/data --env-file .env ada-server
23
+ ```
24
+
25
+ The image is **server-only** (~small, `node:22-slim`, no native build) — it drops the `node-pty`
26
+ client tool and the `skills/` bundle it doesn't need.
27
+
28
+ ## Configuration (env)
29
+
30
+ | Var | Purpose |
31
+ |---|---|
32
+ | provider keys | e.g. `CLOUDFLARE_ACCOUNT_ID`+`CLOUDFLARE_API_TOKEN`, `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, … — set what you use. Every provider + its key env is in [`src/server/config.ts`](../src/server/config.ts). |
33
+ | `ADA_PORT` | listen port (default `8787`). |
34
+ | `ADA_DATA_DIR` | where seats/policy/usage/audit live (default `/data` in the image). **Mount a volume here** — see persistence. |
35
+ | `ADA_ADMIN_KEY` | bootstrap admin key → enables the enterprise control plane ([enterprise.md](enterprise.md)). |
36
+ | `ADA_OIDC_*` | OIDC SSO ([enterprise-stage2-oidc.md](enterprise-stage2-oidc.md)). |
37
+
38
+ ## Persistence — mount `/data`
39
+
40
+ The stores are flat JSON/JSONL under `ADA_DATA_DIR`. In a container that directory is **ephemeral**
41
+ unless you mount a volume — without one, seats, usage, and the audit log are lost on restart. The
42
+ compose file and the `docker run -v ada-data:/data` above handle this. On a PaaS, attach a persistent
43
+ disk/volume mounted at `/data`.
44
+
45
+ > If your platform has no persistent volume (e.g. plain Cloudflare Workers), that's the signal to move
46
+ > to the Workers + D1/KV port below rather than the container.
47
+
48
+ ## Cloudflare
49
+
50
+ Two independent things, don't conflate them:
51
+
52
+ **1. Using Cloudflare's models (no code, works today).** Set `CLOUDFLARE_ACCOUNT_ID` +
53
+ `CLOUDFLARE_API_TOKEN` and request `@cf/*` model ids (e.g. `@cf/meta/llama-3.3-70b-instruct`) — the
54
+ router sends them to Workers AI. To route *all* providers through a **Cloudflare AI Gateway** (for
55
+ unified logging, caching, rate-limiting), point `CLOUDFLARE_BASE_URL` at your gateway URL.
56
+
57
+ **2. Hosting the container.**
58
+ - **Easiest durable path (recommended now):** any container host with a persistent volume — **Fly.io**,
59
+ **Render**, **Railway**. Deploy the Dockerfile, attach a volume at `/data`, set env, done. Put TLS
60
+ in front (the platform usually does this for you).
61
+ - **Cloudflare Containers** (beta): runnable via a Worker + container binding, but Cloudflare's model
62
+ is stateless-leaning — durable seat/usage/audit state wants **R2/D1**, not a container disk. For a
63
+ Cloudflare-native, stateful deploy, prefer the port below.
64
+
65
+ ### Phase 2 — Workers-native port (planned)
66
+
67
+ The container is deliberately step one. The edge-native version swaps:
68
+
69
+ - the Node HTTP server → a Workers `fetch` handler,
70
+ - the file-backed stores (already isolated behind `dataDir()` in `enterprise.ts`) → **D1** (seats /
71
+ policy / usage / audit) or **KV**,
72
+ - streaming metering (currently a `res.write` tee) → **AI Gateway** request logs,
73
+ - and uses **Workers AI** directly for `@cf/*`.
74
+
75
+ Tracked as a follow-up; the container unblocks distribution first.
76
+
77
+ ## Hardening
78
+
79
+ - Terminate **TLS** in front (Caddy/nginx, or the PaaS) — seat keys travel as bearer tokens.
80
+ - Back up the `/data` volume (four small files).
81
+ - Lock it down: set `ADA_ADMIN_KEY` or `ADA_OIDC_*` so the backend isn't dev-open (see
82
+ [enterprise.md](enterprise.md)).
83
+ - To run non-root, add `USER node` to the Dockerfile and ensure the mounted volume is writable by
84
+ uid 1000.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ada-agent",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "A from-zero terminal coding agent with a Cursor-style routing backend, ~285 skills, MCP connectors, and ask/plan/auto modes",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -56,10 +56,12 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@anthropic-ai/sdk": "^0.106.0",
59
- "node-pty": "^1.1.0",
60
59
  "openai": "^6.45.0",
61
60
  "tsx": "^4.22.4"
62
61
  },
62
+ "optionalDependencies": {
63
+ "node-pty": "^1.1.0"
64
+ },
63
65
  "devDependencies": {
64
66
  "@types/node": "^26.0.1",
65
67
  "typescript": "^6.0.3"