ada-agent 0.2.0 → 0.3.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.
- package/README.md +262 -263
- package/bench/README.md +88 -88
- package/bench/swebench.mjs +242 -242
- package/docs/architecture.md +163 -163
- package/docs/architecture.svg +73 -73
- package/docs/cloudflare.md +81 -81
- package/docs/connectors.md +49 -49
- package/docs/integrations.md +62 -62
- package/package.json +67 -65
- package/skills/aesthetic-direction/SKILL.md +24 -24
- package/skills/color-palette/SKILL.md +24 -24
- package/skills/component-library/SKILL.md +23 -23
- package/skills/dark-mode/SKILL.md +24 -24
- package/skills/dashboard-ui/SKILL.md +23 -23
- package/skills/design-system/SKILL.md +24 -24
- package/skills/design-tokens/SKILL.md +24 -24
- package/skills/empty-states/SKILL.md +23 -23
- package/skills/hero-section/SKILL.md +23 -23
- package/skills/micro-interactions/SKILL.md +23 -23
- package/skills/motion-design/SKILL.md +23 -23
- package/skills/page-transitions/SKILL.md +23 -23
- package/skills/pricing-page/SKILL.md +23 -23
- package/skills/scroll-animation/SKILL.md +23 -23
- package/skills/skeleton-loader/SKILL.md +23 -23
- package/skills/tailwind-theme/SKILL.md +24 -24
- package/skills/typography/SKILL.md +24 -24
- package/skills/ui-polish/SKILL.md +24 -24
- package/skills/ui-review/SKILL.md +24 -24
- package/skills/web-fonts/SKILL.md +24 -24
- package/src/client/autostart.ts +93 -0
- package/src/client/catalog.json +1 -1
- package/src/client/cli.ts +1275 -1262
- package/src/client/models-dev.ts +106 -106
- package/src/selfcheck.ts +404 -390
- package/src/server/config.ts +65 -65
- package/src/server/providers/openai-compat.ts +78 -78
- package/src/server/providers/registry.ts +32 -32
- package/src/server/router.ts +33 -33
- package/src/shared/types.ts +21 -21
package/docs/cloudflare.md
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
# Using Cloudflare models with ada
|
|
2
|
-
|
|
3
|
-
Cloudflare gives you two OpenAI-compatible endpoints, and ada speaks OpenAI — so both are just the
|
|
4
|
-
`cloudflare` provider with the right env vars. Pick the one you have:
|
|
5
|
-
|
|
6
|
-
- **Workers AI** — Cloudflare *hosts* the model (Llama, Qwen, Gemma, Kimi, …). Simplest.
|
|
7
|
-
- **AI Gateway** — Cloudflare *proxies* other providers (OpenAI/Anthropic/Workers AI/…) through one
|
|
8
|
-
endpoint, with caching + analytics + optional unified billing.
|
|
9
|
-
|
|
10
|
-
Browse what's available and its pricing any time, offline:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
ada catalog cloudflare # Workers AI + AI Gateway models, context + $/1M
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Workers AI (recommended start)
|
|
19
|
-
|
|
20
|
-
1. **Cloudflare dashboard → AI → Workers AI → "Use REST API".** Copy your **Account ID** and
|
|
21
|
-
**create an API token** (Workers AI scope).
|
|
22
|
-
2. Set the env vars for the backend:
|
|
23
|
-
```bash
|
|
24
|
-
export CLOUDFLARE_ACCOUNT_ID=your-32-char-account-id
|
|
25
|
-
export CLOUDFLARE_API_TOKEN=your-workers-ai-token
|
|
26
|
-
```
|
|
27
|
-
3. Start the backend and run ada with a `@cf/…` model id:
|
|
28
|
-
```bash
|
|
29
|
-
ada-server
|
|
30
|
-
ada --model "@cf/moonshotai/kimi-k2.7-code" # or any id from `ada catalog cloudflare`
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
That's it. ada routes `@cf/*` to Cloudflare automatically, sends the full id through, and `/cost`
|
|
34
|
-
already knows the price from the catalog.
|
|
35
|
-
|
|
36
|
-
> The default endpoint ada builds is
|
|
37
|
-
> `https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1` — Workers AI's
|
|
38
|
-
> OpenAI-compatible base. No code change needed.
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## AI Gateway
|
|
43
|
-
|
|
44
|
-
1. **Cloudflare dashboard → AI → AI Gateway → create a gateway.** Note your **Account ID** and
|
|
45
|
-
**Gateway ID**, and grab the gateway's **OpenAI-compatible endpoint URL** (the "compat" base).
|
|
46
|
-
2. Point ada at that URL and supply the token it expects (your gateway token, or the upstream
|
|
47
|
-
provider's key, depending on how the gateway is configured):
|
|
48
|
-
```bash
|
|
49
|
-
export CLOUDFLARE_BASE_URL="https://gateway.ai.cloudflare.com/v1/<account>/<gateway>/compat"
|
|
50
|
-
export CLOUDFLARE_API_TOKEN=your-gateway-or-provider-key
|
|
51
|
-
```
|
|
52
|
-
(`CLOUDFLARE_BASE_URL` overrides the Workers AI default, so `CLOUDFLARE_ACCOUNT_ID` isn't needed.)
|
|
53
|
-
3. Use the model id format your gateway expects (often `provider/model`, e.g. `openai/gpt-4o`), and
|
|
54
|
-
route it explicitly to the `cloudflare` provider — easiest is the `--provider` field or an
|
|
55
|
-
`@cf/`-style id; otherwise send `provider: "cloudflare"` on the request.
|
|
56
|
-
|
|
57
|
-
> Copy the exact base URL from your AI Gateway page — Cloudflare shows the OpenAI-compatible endpoint
|
|
58
|
-
> there. ada just proxies to whatever you set.
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## How it works (why it's only ~2 lines in ada)
|
|
63
|
-
|
|
64
|
-
ada keys providers by **wire format**, not by vendor. Cloudflare's Workers AI and AI Gateway both
|
|
65
|
-
emit the OpenAI Chat Completions format, so they reuse the shared `openai-compat.ts` adapter — no
|
|
66
|
-
Cloudflare-specific SDK or adapter. The whole integration is:
|
|
67
|
-
|
|
68
|
-
- one `PROVIDERS` entry in [`src/server/config.ts`](../src/server/config.ts) (base URL + key env),
|
|
69
|
-
- one router line in [`src/server/router.ts`](../src/server/router.ts) (`@cf/*` → cloudflare).
|
|
70
|
-
|
|
71
|
-
(Contrast: opencode pulls in dedicated `workers-ai-provider` / `ai-gateway-provider` packages + a
|
|
72
|
-
custom loader, because it's built on the Vercel AI SDK's per-provider abstraction. ada doesn't need
|
|
73
|
-
that for an OpenAI-shaped endpoint.)
|
|
74
|
-
|
|
75
|
-
## Troubleshooting
|
|
76
|
-
|
|
77
|
-
- **401 / 403** — wrong token or scope. Workers AI needs a Workers-AI-scoped token; the Account ID
|
|
78
|
-
must match the token's account.
|
|
79
|
-
- **404 on the model** — the `@cf/…` id isn't hosted; check `ada catalog cloudflare` or the Workers
|
|
80
|
-
AI catalog in the dashboard.
|
|
81
|
-
- **`/cost` says "no price table"** — the model isn't in the baked catalog; run `npm run catalog:refresh`.
|
|
1
|
+
# Using Cloudflare models with ada
|
|
2
|
+
|
|
3
|
+
Cloudflare gives you two OpenAI-compatible endpoints, and ada speaks OpenAI — so both are just the
|
|
4
|
+
`cloudflare` provider with the right env vars. Pick the one you have:
|
|
5
|
+
|
|
6
|
+
- **Workers AI** — Cloudflare *hosts* the model (Llama, Qwen, Gemma, Kimi, …). Simplest.
|
|
7
|
+
- **AI Gateway** — Cloudflare *proxies* other providers (OpenAI/Anthropic/Workers AI/…) through one
|
|
8
|
+
endpoint, with caching + analytics + optional unified billing.
|
|
9
|
+
|
|
10
|
+
Browse what's available and its pricing any time, offline:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
ada catalog cloudflare # Workers AI + AI Gateway models, context + $/1M
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Workers AI (recommended start)
|
|
19
|
+
|
|
20
|
+
1. **Cloudflare dashboard → AI → Workers AI → "Use REST API".** Copy your **Account ID** and
|
|
21
|
+
**create an API token** (Workers AI scope).
|
|
22
|
+
2. Set the env vars for the backend:
|
|
23
|
+
```bash
|
|
24
|
+
export CLOUDFLARE_ACCOUNT_ID=your-32-char-account-id
|
|
25
|
+
export CLOUDFLARE_API_TOKEN=your-workers-ai-token
|
|
26
|
+
```
|
|
27
|
+
3. Start the backend and run ada with a `@cf/…` model id:
|
|
28
|
+
```bash
|
|
29
|
+
ada-server
|
|
30
|
+
ada --model "@cf/moonshotai/kimi-k2.7-code" # or any id from `ada catalog cloudflare`
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
That's it. ada routes `@cf/*` to Cloudflare automatically, sends the full id through, and `/cost`
|
|
34
|
+
already knows the price from the catalog.
|
|
35
|
+
|
|
36
|
+
> The default endpoint ada builds is
|
|
37
|
+
> `https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1` — Workers AI's
|
|
38
|
+
> OpenAI-compatible base. No code change needed.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## AI Gateway
|
|
43
|
+
|
|
44
|
+
1. **Cloudflare dashboard → AI → AI Gateway → create a gateway.** Note your **Account ID** and
|
|
45
|
+
**Gateway ID**, and grab the gateway's **OpenAI-compatible endpoint URL** (the "compat" base).
|
|
46
|
+
2. Point ada at that URL and supply the token it expects (your gateway token, or the upstream
|
|
47
|
+
provider's key, depending on how the gateway is configured):
|
|
48
|
+
```bash
|
|
49
|
+
export CLOUDFLARE_BASE_URL="https://gateway.ai.cloudflare.com/v1/<account>/<gateway>/compat"
|
|
50
|
+
export CLOUDFLARE_API_TOKEN=your-gateway-or-provider-key
|
|
51
|
+
```
|
|
52
|
+
(`CLOUDFLARE_BASE_URL` overrides the Workers AI default, so `CLOUDFLARE_ACCOUNT_ID` isn't needed.)
|
|
53
|
+
3. Use the model id format your gateway expects (often `provider/model`, e.g. `openai/gpt-4o`), and
|
|
54
|
+
route it explicitly to the `cloudflare` provider — easiest is the `--provider` field or an
|
|
55
|
+
`@cf/`-style id; otherwise send `provider: "cloudflare"` on the request.
|
|
56
|
+
|
|
57
|
+
> Copy the exact base URL from your AI Gateway page — Cloudflare shows the OpenAI-compatible endpoint
|
|
58
|
+
> there. ada just proxies to whatever you set.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## How it works (why it's only ~2 lines in ada)
|
|
63
|
+
|
|
64
|
+
ada keys providers by **wire format**, not by vendor. Cloudflare's Workers AI and AI Gateway both
|
|
65
|
+
emit the OpenAI Chat Completions format, so they reuse the shared `openai-compat.ts` adapter — no
|
|
66
|
+
Cloudflare-specific SDK or adapter. The whole integration is:
|
|
67
|
+
|
|
68
|
+
- one `PROVIDERS` entry in [`src/server/config.ts`](../src/server/config.ts) (base URL + key env),
|
|
69
|
+
- one router line in [`src/server/router.ts`](../src/server/router.ts) (`@cf/*` → cloudflare).
|
|
70
|
+
|
|
71
|
+
(Contrast: opencode pulls in dedicated `workers-ai-provider` / `ai-gateway-provider` packages + a
|
|
72
|
+
custom loader, because it's built on the Vercel AI SDK's per-provider abstraction. ada doesn't need
|
|
73
|
+
that for an OpenAI-shaped endpoint.)
|
|
74
|
+
|
|
75
|
+
## Troubleshooting
|
|
76
|
+
|
|
77
|
+
- **401 / 403** — wrong token or scope. Workers AI needs a Workers-AI-scoped token; the Account ID
|
|
78
|
+
must match the token's account.
|
|
79
|
+
- **404 on the model** — the `@cf/…` id isn't hosted; check `ada catalog cloudflare` or the Workers
|
|
80
|
+
AI catalog in the dashboard.
|
|
81
|
+
- **`/cost` says "no price table"** — the model isn't in the baked catalog; run `npm run catalog:refresh`.
|
package/docs/connectors.md
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
# Connectors (MCP)
|
|
2
|
-
|
|
3
|
-
ada connects to external tools and data through the **Model Context Protocol (MCP)**. Each connector
|
|
4
|
-
is an MCP server; ada spawns or calls it, lists its tools, and registers them as ada tools named
|
|
5
|
-
`<server>__<tool>` — approval-gated, and only loaded for **trusted projects**.
|
|
6
|
-
|
|
7
|
-
## Quick start
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
ada mcp # list the connector catalog (● configured · ○ available)
|
|
11
|
-
ada mcp add github # write the github entry into .ada/mcp.json
|
|
12
|
-
ada mcp remove github # remove it
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
After `add`, set any env vars it prints (e.g. `GITHUB_PERSONAL_ACCESS_TOKEN`), then start `ada` in
|
|
16
|
-
that project — the connector's tools appear automatically.
|
|
17
|
-
|
|
18
|
-
## Catalog
|
|
19
|
-
|
|
20
|
-
`filesystem` · `github` · `git` · `postgres` · `sqlite` · `fetch` · `brave-search` · `puppeteer` ·
|
|
21
|
-
`slack` · `memory` · `sentry`. Run `ada mcp` for the live list and which env vars each needs.
|
|
22
|
-
|
|
23
|
-
## Config: `.ada/mcp.json`
|
|
24
|
-
|
|
25
|
-
`ada mcp add` edits this file, but you can also write entries by hand. Two transports:
|
|
26
|
-
|
|
27
|
-
```jsonc
|
|
28
|
-
{
|
|
29
|
-
"servers": {
|
|
30
|
-
// local stdio server (a subprocess)
|
|
31
|
-
"fs": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."] },
|
|
32
|
-
// remote server over Streamable HTTP
|
|
33
|
-
"remote": { "url": "https://mcp.example.com/v1", "headers": { "Authorization": "Bearer <token>" } }
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
- **stdio** — `{ command, args, env }`: ada launches the process and speaks JSON-RPC over stdin/stdout.
|
|
39
|
-
- **http** — `{ url, headers }`: ada POSTs JSON-RPC and reads a JSON or SSE response (Streamable HTTP).
|
|
40
|
-
|
|
41
|
-
## Notes
|
|
42
|
-
|
|
43
|
-
- MCP servers run code / reach the network, so they load **only in trusted projects** (the same trust
|
|
44
|
-
gate as `.ada` prompts and settings). Untrusted projects skip them.
|
|
45
|
-
- Every MCP tool is **approval-gated** — ada prompts before each call (in `ask` mode).
|
|
46
|
-
- A server's **resources** are reachable through a generated `<server>__read_resource` tool.
|
|
47
|
-
- Secrets come from **env vars** (referenced in the server's `env`), never committed to `.ada/mcp.json`.
|
|
48
|
-
- See the `connectors` skill category (`list_skills {category: "connectors"}`) for per-connector setup
|
|
49
|
-
walk-throughs, and the `mcp-server` skill to build your own.
|
|
1
|
+
# Connectors (MCP)
|
|
2
|
+
|
|
3
|
+
ada connects to external tools and data through the **Model Context Protocol (MCP)**. Each connector
|
|
4
|
+
is an MCP server; ada spawns or calls it, lists its tools, and registers them as ada tools named
|
|
5
|
+
`<server>__<tool>` — approval-gated, and only loaded for **trusted projects**.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ada mcp # list the connector catalog (● configured · ○ available)
|
|
11
|
+
ada mcp add github # write the github entry into .ada/mcp.json
|
|
12
|
+
ada mcp remove github # remove it
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
After `add`, set any env vars it prints (e.g. `GITHUB_PERSONAL_ACCESS_TOKEN`), then start `ada` in
|
|
16
|
+
that project — the connector's tools appear automatically.
|
|
17
|
+
|
|
18
|
+
## Catalog
|
|
19
|
+
|
|
20
|
+
`filesystem` · `github` · `git` · `postgres` · `sqlite` · `fetch` · `brave-search` · `puppeteer` ·
|
|
21
|
+
`slack` · `memory` · `sentry`. Run `ada mcp` for the live list and which env vars each needs.
|
|
22
|
+
|
|
23
|
+
## Config: `.ada/mcp.json`
|
|
24
|
+
|
|
25
|
+
`ada mcp add` edits this file, but you can also write entries by hand. Two transports:
|
|
26
|
+
|
|
27
|
+
```jsonc
|
|
28
|
+
{
|
|
29
|
+
"servers": {
|
|
30
|
+
// local stdio server (a subprocess)
|
|
31
|
+
"fs": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."] },
|
|
32
|
+
// remote server over Streamable HTTP
|
|
33
|
+
"remote": { "url": "https://mcp.example.com/v1", "headers": { "Authorization": "Bearer <token>" } }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- **stdio** — `{ command, args, env }`: ada launches the process and speaks JSON-RPC over stdin/stdout.
|
|
39
|
+
- **http** — `{ url, headers }`: ada POSTs JSON-RPC and reads a JSON or SSE response (Streamable HTTP).
|
|
40
|
+
|
|
41
|
+
## Notes
|
|
42
|
+
|
|
43
|
+
- MCP servers run code / reach the network, so they load **only in trusted projects** (the same trust
|
|
44
|
+
gate as `.ada` prompts and settings). Untrusted projects skip them.
|
|
45
|
+
- Every MCP tool is **approval-gated** — ada prompts before each call (in `ask` mode).
|
|
46
|
+
- A server's **resources** are reachable through a generated `<server>__read_resource` tool.
|
|
47
|
+
- Secrets come from **env vars** (referenced in the server's `env`), never committed to `.ada/mcp.json`.
|
|
48
|
+
- See the `connectors` skill category (`list_skills {category: "connectors"}`) for per-connector setup
|
|
49
|
+
walk-throughs, and the `mcp-server` skill to build your own.
|
package/docs/integrations.md
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
# Integrating with ada
|
|
2
|
-
|
|
3
|
-
ada exposes a few programmatic surfaces so other tools can drive it. The buildable foundations are
|
|
4
|
-
shipped; the product surfaces that need *external* infrastructure (a Slack app, hosting, an Electron
|
|
5
|
-
build, an IdP) are described with what they'd take — they can't be "live" without your accounts.
|
|
6
|
-
|
|
7
|
-
## HTTP API — `ada serve`
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
ada serve # → http://localhost:8788 (ADA_HTTP_PORT to change)
|
|
11
|
-
```
|
|
12
|
-
- `GET /health` → `{ ok, model }`
|
|
13
|
-
- `POST /v1/prompt` `{ "text": "...", "model"?: "..." }` → `{ text, usage }` (runs a fresh agent turn)
|
|
14
|
-
|
|
15
|
-
## Typed SDK — `src/sdk`
|
|
16
|
-
|
|
17
|
-
```ts
|
|
18
|
-
import { createClient } from "ada-agent/sdk"; // in-repo: "./src/sdk/index.ts"
|
|
19
|
-
const ada = createClient("http://localhost:8788");
|
|
20
|
-
console.log(await ada.health());
|
|
21
|
-
const { text } = await ada.prompt("list the files in this project");
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
It's a ~30-line `fetch` wrapper over the HTTP API above — if you'd rather not pull in the source,
|
|
25
|
-
just POST to `/v1/prompt` directly.
|
|
26
|
-
|
|
27
|
-
## ACP bridge — `ada acp`
|
|
28
|
-
|
|
29
|
-
A minimal Agent Client Protocol bridge over stdio (JSON-RPC 2.0, newline-delimited): handles
|
|
30
|
-
`initialize` and `session/prompt`, so an ACP-aware editor can drive ada. It's a **scaffold** — method
|
|
31
|
-
names and framing may need adjusting to your client's ACP version.
|
|
32
|
-
|
|
33
|
-
## Session share — `ada share`
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
ada share # serve the latest session as a read-only web page (localhost)
|
|
37
|
-
ada share <name|file> # a specific session
|
|
38
|
-
```
|
|
39
|
-
Local and read-only. A *public* share link would need a hosted backend to receive and serve the
|
|
40
|
-
transcript (see below).
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Needs your infrastructure (foundations are here; the rest is your accounts/hosting)
|
|
45
|
-
|
|
46
|
-
These are all buildable **on top of the HTTP API / SDK above** — what's missing is the external
|
|
47
|
-
service, which only you can provision.
|
|
48
|
-
|
|
49
|
-
- **Slack bot** — a [Slack Bolt](https://slack.dev/bolt-js) app that, per thread, calls
|
|
50
|
-
`createClient().prompt(message)` and posts the reply. Needs a **Slack app + bot token** (`SLACK_BOT_TOKEN`)
|
|
51
|
-
and a running process. ~30 lines on top of the SDK.
|
|
52
|
-
- **Web console** — a single page that POSTs to `/v1/prompt` and renders the reply (the `ada share`
|
|
53
|
-
server is a minimal read-only version). Needs **hosting** + CORS if cross-origin.
|
|
54
|
-
- **Desktop app** — an Electron shell that spawns `ada serve` and points a webview at it. Needs the
|
|
55
|
-
**Electron build/packaging** pipeline (you already have the separate `ada-ide` VS Code fork).
|
|
56
|
-
- **Public session sharing** — `ada share` is local; a public link needs a **hosted endpoint** to
|
|
57
|
-
receive the transcript and a viewer (like opencode's `console.opncd.ai`).
|
|
58
|
-
- **Enterprise / identity / teams** — multi-tenant accounts + SSO need an **IdP and a control plane**;
|
|
59
|
-
out of scope for a single-binary CLI.
|
|
60
|
-
- **SQLite session store** — ada uses append-only JSONL (`.ada/sessions/*.jsonl`) by design (no native
|
|
61
|
-
dep, greppable, trivially portable). Node 24 ships an experimental `node:sqlite`; a SQLite backend is
|
|
62
|
-
a drop-in for `session.ts` if you want indexed queries — say the word and it's a small module.
|
|
1
|
+
# Integrating with ada
|
|
2
|
+
|
|
3
|
+
ada exposes a few programmatic surfaces so other tools can drive it. The buildable foundations are
|
|
4
|
+
shipped; the product surfaces that need *external* infrastructure (a Slack app, hosting, an Electron
|
|
5
|
+
build, an IdP) are described with what they'd take — they can't be "live" without your accounts.
|
|
6
|
+
|
|
7
|
+
## HTTP API — `ada serve`
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ada serve # → http://localhost:8788 (ADA_HTTP_PORT to change)
|
|
11
|
+
```
|
|
12
|
+
- `GET /health` → `{ ok, model }`
|
|
13
|
+
- `POST /v1/prompt` `{ "text": "...", "model"?: "..." }` → `{ text, usage }` (runs a fresh agent turn)
|
|
14
|
+
|
|
15
|
+
## Typed SDK — `src/sdk`
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { createClient } from "ada-agent/sdk"; // in-repo: "./src/sdk/index.ts"
|
|
19
|
+
const ada = createClient("http://localhost:8788");
|
|
20
|
+
console.log(await ada.health());
|
|
21
|
+
const { text } = await ada.prompt("list the files in this project");
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
It's a ~30-line `fetch` wrapper over the HTTP API above — if you'd rather not pull in the source,
|
|
25
|
+
just POST to `/v1/prompt` directly.
|
|
26
|
+
|
|
27
|
+
## ACP bridge — `ada acp`
|
|
28
|
+
|
|
29
|
+
A minimal Agent Client Protocol bridge over stdio (JSON-RPC 2.0, newline-delimited): handles
|
|
30
|
+
`initialize` and `session/prompt`, so an ACP-aware editor can drive ada. It's a **scaffold** — method
|
|
31
|
+
names and framing may need adjusting to your client's ACP version.
|
|
32
|
+
|
|
33
|
+
## Session share — `ada share`
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
ada share # serve the latest session as a read-only web page (localhost)
|
|
37
|
+
ada share <name|file> # a specific session
|
|
38
|
+
```
|
|
39
|
+
Local and read-only. A *public* share link would need a hosted backend to receive and serve the
|
|
40
|
+
transcript (see below).
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Needs your infrastructure (foundations are here; the rest is your accounts/hosting)
|
|
45
|
+
|
|
46
|
+
These are all buildable **on top of the HTTP API / SDK above** — what's missing is the external
|
|
47
|
+
service, which only you can provision.
|
|
48
|
+
|
|
49
|
+
- **Slack bot** — a [Slack Bolt](https://slack.dev/bolt-js) app that, per thread, calls
|
|
50
|
+
`createClient().prompt(message)` and posts the reply. Needs a **Slack app + bot token** (`SLACK_BOT_TOKEN`)
|
|
51
|
+
and a running process. ~30 lines on top of the SDK.
|
|
52
|
+
- **Web console** — a single page that POSTs to `/v1/prompt` and renders the reply (the `ada share`
|
|
53
|
+
server is a minimal read-only version). Needs **hosting** + CORS if cross-origin.
|
|
54
|
+
- **Desktop app** — an Electron shell that spawns `ada serve` and points a webview at it. Needs the
|
|
55
|
+
**Electron build/packaging** pipeline (you already have the separate `ada-ide` VS Code fork).
|
|
56
|
+
- **Public session sharing** — `ada share` is local; a public link needs a **hosted endpoint** to
|
|
57
|
+
receive the transcript and a viewer (like opencode's `console.opncd.ai`).
|
|
58
|
+
- **Enterprise / identity / teams** — multi-tenant accounts + SSO need an **IdP and a control plane**;
|
|
59
|
+
out of scope for a single-binary CLI.
|
|
60
|
+
- **SQLite session store** — ada uses append-only JSONL (`.ada/sessions/*.jsonl`) by design (no native
|
|
61
|
+
dep, greppable, trivially portable). Node 24 ships an experimental `node:sqlite`; a SQLite backend is
|
|
62
|
+
a drop-in for `session.ts` if you want indexed queries — say the word and it's a small module.
|
package/package.json
CHANGED
|
@@ -1,65 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ada-agent",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A from-zero terminal coding agent with a Cursor-style routing backend, ~285 skills, MCP connectors, and ask/plan/auto modes",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"author": "Aditya",
|
|
8
|
-
"homepage": "https://github.com/black141312/ada#readme",
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/black141312/ada.git"
|
|
12
|
-
},
|
|
13
|
-
"bugs": {
|
|
14
|
-
"url": "https://github.com/black141312/ada/issues"
|
|
15
|
-
},
|
|
16
|
-
"keywords": [
|
|
17
|
-
"coding-agent",
|
|
18
|
-
"ai-agent",
|
|
19
|
-
"llm",
|
|
20
|
-
"cli",
|
|
21
|
-
"terminal",
|
|
22
|
-
"tui",
|
|
23
|
-
"mcp",
|
|
24
|
-
"openai",
|
|
25
|
-
"anthropic",
|
|
26
|
-
"ollama",
|
|
27
|
-
"agentic",
|
|
28
|
-
"developer-tools"
|
|
29
|
-
],
|
|
30
|
-
"bin": {
|
|
31
|
-
"ada": "bin/ada.mjs",
|
|
32
|
-
"ada-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "ada-agent",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "A from-zero terminal coding agent with a Cursor-style routing backend, ~285 skills, MCP connectors, and ask/plan/auto modes",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Aditya",
|
|
8
|
+
"homepage": "https://github.com/black141312/ada#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/black141312/ada.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/black141312/ada/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"coding-agent",
|
|
18
|
+
"ai-agent",
|
|
19
|
+
"llm",
|
|
20
|
+
"cli",
|
|
21
|
+
"terminal",
|
|
22
|
+
"tui",
|
|
23
|
+
"mcp",
|
|
24
|
+
"openai",
|
|
25
|
+
"anthropic",
|
|
26
|
+
"ollama",
|
|
27
|
+
"agentic",
|
|
28
|
+
"developer-tools"
|
|
29
|
+
],
|
|
30
|
+
"bin": {
|
|
31
|
+
"ada": "bin/ada.mjs",
|
|
32
|
+
"ada-agent": "bin/ada.mjs",
|
|
33
|
+
"ada-server": "bin/ada-server.mjs"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"bin/",
|
|
37
|
+
"src/",
|
|
38
|
+
"skills/",
|
|
39
|
+
"docs/",
|
|
40
|
+
"bench/",
|
|
41
|
+
"tsconfig.json",
|
|
42
|
+
"README.md",
|
|
43
|
+
"LICENSE"
|
|
44
|
+
],
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"start": "tsx src/client/cli.ts",
|
|
50
|
+
"server": "tsx src/server/index.ts",
|
|
51
|
+
"typecheck": "tsc --noEmit",
|
|
52
|
+
"selfcheck": "tsx src/selfcheck.ts",
|
|
53
|
+
"bench:swebench": "node bench/swebench.mjs",
|
|
54
|
+
"catalog:refresh": "node scripts/refresh-catalog.mjs",
|
|
55
|
+
"release": "node scripts/release.mjs"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@anthropic-ai/sdk": "^0.106.0",
|
|
59
|
+
"node-pty": "^1.1.0",
|
|
60
|
+
"openai": "^6.45.0",
|
|
61
|
+
"tsx": "^4.22.4"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@types/node": "^26.0.1",
|
|
65
|
+
"typescript": "^6.0.3"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: aesthetic-direction
|
|
3
|
-
description: Choose an intentional, non-templated visual direction and reference before building any UI
|
|
4
|
-
category: ui-design
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Aesthetic Direction
|
|
8
|
-
|
|
9
|
-
Do this before writing component code. The difference between a forgettable, templated UI and a memorable one is a deliberate point of view chosen up front — not defaults stacked by accident.
|
|
10
|
-
|
|
11
|
-
1. Name the feeling in 2–3 adjectives and a reference: "editorial and confident, like Linear meets a print magazine" or "warm utilitarian, like a well-made tool." Vague intent yields vague output.
|
|
12
|
-
2. Pick a stance on each axis deliberately: density (airy vs. compact), shape language (sharp vs. rounded), contrast (muted vs. punchy), and ornament (flat vs. layered/textured). Write the choices down.
|
|
13
|
-
3. Choose ONE signature move the design hangs on — a distinctive typeface, a bold accent, a grain/noise texture, an unusual grid, a motion personality. Without a signature, it reads generic.
|
|
14
|
-
4. Anchor with real references: pull 3–5 screenshots you admire and articulate *what specifically* works (the oversized headers, the restrained palette, the tight grid) — then translate, don't copy.
|
|
15
|
-
5. Pressure-test against templates: if it could be any Bootstrap/default-shadcn site, push harder — change the type, break the symmetry, commit to one strong color, vary the rhythm.
|
|
16
|
-
6. Encode the direction into tokens immediately so the rest of the build inherits the decision instead of re-litigating it per component.
|
|
17
|
-
7. Sanity-check feasibility and accessibility — a daring direction still has to pass contrast and perform.
|
|
18
|
-
|
|
19
|
-
## Rules
|
|
20
|
-
- Decide the direction before components; retrofitting taste onto built UI rarely works.
|
|
21
|
-
- Commit to one signature element rather than three half-measures.
|
|
22
|
-
- "Modern/clean/minimal" is not a direction — name a feeling, a reference, and a specific move.
|
|
23
|
-
- Default shadcn/Bootstrap/Tailwind-gray is a starting point to subvert, not a destination.
|
|
24
|
-
- Distinctive still means accessible and fast — daring is not an excuse for 2:1 contrast.
|
|
1
|
+
---
|
|
2
|
+
name: aesthetic-direction
|
|
3
|
+
description: Choose an intentional, non-templated visual direction and reference before building any UI
|
|
4
|
+
category: ui-design
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Aesthetic Direction
|
|
8
|
+
|
|
9
|
+
Do this before writing component code. The difference between a forgettable, templated UI and a memorable one is a deliberate point of view chosen up front — not defaults stacked by accident.
|
|
10
|
+
|
|
11
|
+
1. Name the feeling in 2–3 adjectives and a reference: "editorial and confident, like Linear meets a print magazine" or "warm utilitarian, like a well-made tool." Vague intent yields vague output.
|
|
12
|
+
2. Pick a stance on each axis deliberately: density (airy vs. compact), shape language (sharp vs. rounded), contrast (muted vs. punchy), and ornament (flat vs. layered/textured). Write the choices down.
|
|
13
|
+
3. Choose ONE signature move the design hangs on — a distinctive typeface, a bold accent, a grain/noise texture, an unusual grid, a motion personality. Without a signature, it reads generic.
|
|
14
|
+
4. Anchor with real references: pull 3–5 screenshots you admire and articulate *what specifically* works (the oversized headers, the restrained palette, the tight grid) — then translate, don't copy.
|
|
15
|
+
5. Pressure-test against templates: if it could be any Bootstrap/default-shadcn site, push harder — change the type, break the symmetry, commit to one strong color, vary the rhythm.
|
|
16
|
+
6. Encode the direction into tokens immediately so the rest of the build inherits the decision instead of re-litigating it per component.
|
|
17
|
+
7. Sanity-check feasibility and accessibility — a daring direction still has to pass contrast and perform.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
- Decide the direction before components; retrofitting taste onto built UI rarely works.
|
|
21
|
+
- Commit to one signature element rather than three half-measures.
|
|
22
|
+
- "Modern/clean/minimal" is not a direction — name a feeling, a reference, and a specific move.
|
|
23
|
+
- Default shadcn/Bootstrap/Tailwind-gray is a starting point to subvert, not a destination.
|
|
24
|
+
- Distinctive still means accessible and fast — daring is not an excuse for 2:1 contrast.
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: color-palette
|
|
3
|
-
description: Craft an accessible on-brand palette with checked contrast, perceptual ramps, and semantic color roles
|
|
4
|
-
category: ui-design
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Color Palette
|
|
8
|
-
|
|
9
|
-
Use this when choosing or fixing a product's colors — to get past "pick a brand hue and tint it" into a palette that's coherent, accessible, and works in both light and dark.
|
|
10
|
-
|
|
11
|
-
1. Start from one or two brand hues and build perceptually even ramps in `oklch()` (11 steps, 50–950). Even lightness steps mean predictable contrast — RGB tinting gives muddy, uneven ramps.
|
|
12
|
-
2. Reserve saturation for intent: keep most surfaces near-neutral (low-chroma grays carrying a hint of the brand hue) and spend vivid color only on the accent and on calls to action.
|
|
13
|
-
3. Define semantic roles, not raw swatches: `--bg`, `--surface`, `--surface-raised`, `--text`, `--text-muted`, `--border`, `--accent`, `--accent-fg`, plus state colors success/warning/danger/info.
|
|
14
|
-
4. Check contrast for real: body text ≥ 4.5:1, large text and UI components ≥ 3:1 (WCAG AA). Pair every background token with a foreground that passes against it.
|
|
15
|
-
5. Design the dark variant as a sibling, not an inversion — raise surface lightness for elevation instead of adding shadows, and slightly lower accent chroma so it doesn't vibrate on dark.
|
|
16
|
-
6. Don't rely on hue alone to convey meaning; back status colors with an icon or label for color-blind users, and test with a deuteranopia simulation.
|
|
17
|
-
7. Constrain the whole palette: ~2 brand hues + neutrals + 4 state colors. A palette with 9 unrelated hues never feels designed.
|
|
18
|
-
|
|
19
|
-
## Rules
|
|
20
|
-
- Every text/background pairing passes WCAG AA (4.5:1 body, 3:1 large/UI) — verify, don't eyeball.
|
|
21
|
-
- Build ramps in oklch/HSL for even steps; avoid hand-picked hex stops.
|
|
22
|
-
- Most of the screen is neutral; saturated color is an accent, not a background.
|
|
23
|
-
- Name by role (`--accent`, `--danger`) so themes remap meaning, not pixels.
|
|
24
|
-
- Never encode state in color alone — add an icon, label, or shape.
|
|
1
|
+
---
|
|
2
|
+
name: color-palette
|
|
3
|
+
description: Craft an accessible on-brand palette with checked contrast, perceptual ramps, and semantic color roles
|
|
4
|
+
category: ui-design
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Color Palette
|
|
8
|
+
|
|
9
|
+
Use this when choosing or fixing a product's colors — to get past "pick a brand hue and tint it" into a palette that's coherent, accessible, and works in both light and dark.
|
|
10
|
+
|
|
11
|
+
1. Start from one or two brand hues and build perceptually even ramps in `oklch()` (11 steps, 50–950). Even lightness steps mean predictable contrast — RGB tinting gives muddy, uneven ramps.
|
|
12
|
+
2. Reserve saturation for intent: keep most surfaces near-neutral (low-chroma grays carrying a hint of the brand hue) and spend vivid color only on the accent and on calls to action.
|
|
13
|
+
3. Define semantic roles, not raw swatches: `--bg`, `--surface`, `--surface-raised`, `--text`, `--text-muted`, `--border`, `--accent`, `--accent-fg`, plus state colors success/warning/danger/info.
|
|
14
|
+
4. Check contrast for real: body text ≥ 4.5:1, large text and UI components ≥ 3:1 (WCAG AA). Pair every background token with a foreground that passes against it.
|
|
15
|
+
5. Design the dark variant as a sibling, not an inversion — raise surface lightness for elevation instead of adding shadows, and slightly lower accent chroma so it doesn't vibrate on dark.
|
|
16
|
+
6. Don't rely on hue alone to convey meaning; back status colors with an icon or label for color-blind users, and test with a deuteranopia simulation.
|
|
17
|
+
7. Constrain the whole palette: ~2 brand hues + neutrals + 4 state colors. A palette with 9 unrelated hues never feels designed.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
- Every text/background pairing passes WCAG AA (4.5:1 body, 3:1 large/UI) — verify, don't eyeball.
|
|
21
|
+
- Build ramps in oklch/HSL for even steps; avoid hand-picked hex stops.
|
|
22
|
+
- Most of the screen is neutral; saturated color is an accent, not a background.
|
|
23
|
+
- Name by role (`--accent`, `--danger`) so themes remap meaning, not pixels.
|
|
24
|
+
- Never encode state in color alone — add an icon, label, or shape.
|