@bastani/atomic-acp 0.0.0-stage → 0.0.2
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/LICENSE +24 -0
- package/README.md +233 -2
- package/dist/index.js +3400 -0
- package/dist/index.js.map +1 -0
- package/package.json +67 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Bastani, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
If your product or service exceeds 100 million monthly active users or $20 million in monthly revenue,
|
|
16
|
+
you must prominently display 'Atomic' on the user interface of such product or service.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,234 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">atomic-acp</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<b>Use the <a href="https://github.com/bastani-inc/atomic">Atomic</a> coding agent inside Zed and other editors that speak the Agent Client Protocol.</b>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
Chat with Atomic, watch its tool calls and diffs, switch models and thinking levels, and run Atomic workflows from your editor's agent panel.
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="#get-started"><b>Get started →</b></a>
|
|
13
|
+
·
|
|
14
|
+
<a href="#what-works">What works</a>
|
|
15
|
+
·
|
|
16
|
+
<a href="#workflows">Workflows</a>
|
|
17
|
+
·
|
|
18
|
+
<a href="#limitations">Limitations</a>
|
|
19
|
+
·
|
|
20
|
+
<a href="https://docs.bastani.ai/">Atomic docs</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<a href="https://github.com/bastani-inc/atomic-acp/actions/workflows/test.yml"><img src="https://github.com/bastani-inc/atomic-acp/actions/workflows/test.yml/badge.svg" alt="Tests"></a>
|
|
25
|
+
<a href="https://agentclientprotocol.com/"><img src="https://img.shields.io/badge/ACP-v1-0A7EA4" alt="ACP v1"></a>
|
|
26
|
+
<a href="https://docs.bastani.ai/"><img src="https://img.shields.io/badge/docs-atomic-blue" alt="Docs"></a>
|
|
27
|
+
<a href="https://discord.gg/9CvdXUGXR4"><img src="https://img.shields.io/badge/join%20community-discord-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
|
|
28
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
## How it works
|
|
32
|
+
|
|
33
|
+
Your editor starts `atomic-acp` and talks to it over stdio using [ACP](https://agentclientprotocol.com/) JSON-RPC. For each chat session, `atomic-acp` starts its own `atomic --mode rpc` process and translates between the two protocols.
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
Zed (ACP client) ⇄ atomic-acp ⇄ atomic --mode rpc
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Atomic reads files, edits code, and runs commands on your machine, exactly as it does in the terminal. Only open workspaces you trust.
|
|
40
|
+
|
|
41
|
+
## Get started
|
|
42
|
+
|
|
43
|
+
### Prerequisites
|
|
44
|
+
|
|
45
|
+
- Node.js 22 or newer (20 is the minimum).
|
|
46
|
+
- Atomic installed and logged in to at least one model provider:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm install -g @bastani/atomic
|
|
50
|
+
atomic # sign in, then quit
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`atomic-acp` uses whatever `atomic` it finds on your `PATH`. Point it at a different binary with `ATOMIC_ACP_ATOMIC_COMMAND`.
|
|
54
|
+
|
|
55
|
+
### Install
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install -g @bastani/atomic-acp
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
To run from source instead, clone this repository and run `npm install && npm run build`. The entry point is `dist/index.js`.
|
|
62
|
+
|
|
63
|
+
### Add it to Zed
|
|
64
|
+
|
|
65
|
+
Open Zed's `settings.json` and add an agent server:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"agent_servers": {
|
|
70
|
+
"Atomic": {
|
|
71
|
+
"type": "custom",
|
|
72
|
+
"command": "atomic-acp",
|
|
73
|
+
"args": [],
|
|
74
|
+
"env": {}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Other ways to launch it:
|
|
81
|
+
|
|
82
|
+
| Setup | `command` | `args` |
|
|
83
|
+
| ------------------------- | ------------ | --------------------------------------- |
|
|
84
|
+
| Global install | `atomic-acp` | `[]` |
|
|
85
|
+
| No install, always latest | `npx` | `["-y", "@bastani/atomic-acp"]` |
|
|
86
|
+
| Source checkout | `node` | `["/path/to/atomic-acp/dist/index.js"]` |
|
|
87
|
+
|
|
88
|
+
Then open the agent panel, pick **Atomic**, and start a thread.
|
|
89
|
+
|
|
90
|
+
If Atomic has no working provider login, Zed shows an **Authenticate** banner that opens Atomic in a terminal. You can run the same flow yourself with `atomic-acp --terminal-login`.
|
|
91
|
+
|
|
92
|
+
## What works
|
|
93
|
+
|
|
94
|
+
Chat and tools
|
|
95
|
+
|
|
96
|
+
- Assistant text and reasoning stream into the thread as they arrive.
|
|
97
|
+
- Tool calls appear with their status and file locations, so Zed can follow along as files are read and edited.
|
|
98
|
+
- Edits and writes show a real diff of the file before and after the change, including Atomic's multi-file edits.
|
|
99
|
+
- Bash commands render as terminal output.
|
|
100
|
+
|
|
101
|
+
Sessions
|
|
102
|
+
|
|
103
|
+
- Sessions are saved by Atomic in `~/.atomic/agent/sessions/`, so you can pick a thread back up in Zed's history or with `atomic --resume` in a terminal.
|
|
104
|
+
- Threads get a title from your first message. Renaming in Atomic updates the title in the editor.
|
|
105
|
+
- Deleting a thread in the editor deletes the Atomic session file.
|
|
106
|
+
- Sessions survive an adapter restart. The next message restores the saved session.
|
|
107
|
+
|
|
108
|
+
Models and context
|
|
109
|
+
|
|
110
|
+
- The model and thinking-level pickers list what your Atomic setup offers, including model-specific levels such as `max`.
|
|
111
|
+
- The context window indicator shows how full the current context is after each turn.
|
|
112
|
+
|
|
113
|
+
Commands and dialogs
|
|
114
|
+
|
|
115
|
+
- Atomic prompt templates, skills (`/skill:name`), and extension commands such as `/workflow` show up in the slash command menu.
|
|
116
|
+
- When an Atomic extension or workflow asks you to pick, confirm, or type something, the editor shows a form. Clients without form support get a permission prompt for pick and confirm questions.
|
|
117
|
+
- Extension notifications show up in the thread.
|
|
118
|
+
|
|
119
|
+
Startup info
|
|
120
|
+
|
|
121
|
+
- New threads open with a short summary of the Atomic version, skills, prompts, and extensions in use. Set `quietStartup: true` in your Atomic settings to hide it.
|
|
122
|
+
|
|
123
|
+
## Workflows
|
|
124
|
+
|
|
125
|
+
Atomic workflows run from the editor the same way they do in the terminal.
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
/workflow list
|
|
129
|
+
/workflow ralph prompt="Add rate limiting to the API"
|
|
130
|
+
/workflow status
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Workflows keep running in the background after the command returns, and you can keep chatting while they do. Progress notices, status lines, and the completion message stream into the thread as they happen. If a workflow stage needs your input, you'll get a form in the editor.
|
|
134
|
+
|
|
135
|
+
Two extra commands read the workflow history Atomic keeps for the current project:
|
|
136
|
+
|
|
137
|
+
| Command | Shows |
|
|
138
|
+
| ------------------------- | -------------------------------------------------- |
|
|
139
|
+
| `/workflow-runs [status]` | Recent runs, optionally filtered by status |
|
|
140
|
+
| `/workflow-run <runId>` | The saved summary for one run (may lag a live run) |
|
|
141
|
+
|
|
142
|
+
## Slash commands
|
|
143
|
+
|
|
144
|
+
On top of your Atomic prompts, skills, and extension commands, `atomic-acp` adds:
|
|
145
|
+
|
|
146
|
+
| Command | What it does |
|
|
147
|
+
| ------------------------------ | --------------------------------------------------------- |
|
|
148
|
+
| `/compact [instructions]` | Compact the context, with optional instructions |
|
|
149
|
+
| `/autocompact on\|off\|toggle` | Turn automatic compaction on or off |
|
|
150
|
+
| `/session` | Token, message, and cost stats plus the session file path |
|
|
151
|
+
| `/name <name>` | Rename the session |
|
|
152
|
+
| `/export` | Export the session as HTML into the working directory |
|
|
153
|
+
| `/steering`, `/follow-up` | Show or set how queued messages are delivered |
|
|
154
|
+
| `/changelog` | Show the installed Atomic changelog |
|
|
155
|
+
|
|
156
|
+
Use the editor's model picker instead of `/model`, its thinking or mode picker instead of `/thinking`, and a new thread instead of `/clear`.
|
|
157
|
+
|
|
158
|
+
Prompt templates load from `~/.atomic/agent/prompts/` and `<project>/.atomic/prompts/`.
|
|
159
|
+
|
|
160
|
+
## Configuration
|
|
161
|
+
|
|
162
|
+
Set these in the `env` object of your agent server entry:
|
|
163
|
+
|
|
164
|
+
| Variable | Default | Purpose |
|
|
165
|
+
| ------------------------------------ | ---------------------------------- | --------------------------------------------------------------------------------- |
|
|
166
|
+
| `ATOMIC_ACP_ATOMIC_COMMAND` | `atomic` (`atomic.cmd` on Windows) | Path or name of the Atomic executable. Arguments are not allowed here. |
|
|
167
|
+
| `ATOMIC_ACP_ENABLE_EMBEDDED_CONTEXT` | unset | Set to `true` to tell the editor it may attach file contents directly to prompts. |
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"agent_servers": {
|
|
172
|
+
"Atomic": {
|
|
173
|
+
"type": "custom",
|
|
174
|
+
"command": "atomic-acp",
|
|
175
|
+
"args": [],
|
|
176
|
+
"env": {
|
|
177
|
+
"ATOMIC_ACP_ATOMIC_COMMAND": "/path/to/atomic",
|
|
178
|
+
"ATOMIC_ACP_ENABLE_EMBEDDED_CONTEXT": "true"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Everything else comes from Atomic itself. Provider logins, models, skills, and extensions use your normal Atomic settings in `~/.atomic/agent/settings.json` and `<project>/.atomic/settings.json`. Atomic's own variables, such as `ATOMIC_CODING_AGENT_DIR` and `ATOMIC_CODING_AGENT_SESSION_DIR`, pass through to the Atomic process.
|
|
186
|
+
|
|
187
|
+
## Limitations
|
|
188
|
+
|
|
189
|
+
- `ask_user_question` isn't available over ACP because Atomic RPC mode can't carry its custom UI.
|
|
190
|
+
- The editor's file and terminal APIs aren't used. Atomic reads, writes, and runs commands locally, and the editor displays the results.
|
|
191
|
+
- MCP servers configured in the editor are ignored. Configure MCP servers in Atomic instead.
|
|
192
|
+
- If you send several messages while Atomic is busy, they are queued and sent one at a time.
|
|
193
|
+
- Zed is the client this is tested against. Other ACP clients should work but may render some updates differently.
|
|
194
|
+
|
|
195
|
+
## Development
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
npm install
|
|
199
|
+
npm run dev # run from source with tsx
|
|
200
|
+
npm run build
|
|
201
|
+
npm test
|
|
202
|
+
npm run lint
|
|
203
|
+
npm run format
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
The ACP side lives in `src/acp/`, and the wrapper around the Atomic subprocess lives in `src/atomic-rpc/`.
|
|
207
|
+
|
|
208
|
+
Two smoke scripts exercise a real Atomic install. They need a provider login and use real model tokens, so they aren't part of `npm test`:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
npm run build
|
|
212
|
+
npm run smoke:e2e:atomic # one prompt, checks streamed text and end_turn
|
|
213
|
+
node scripts/smoke-workflow.mjs # runs /workflow list over ACP
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
`npm run` puts `node_modules/.bin` first on `PATH`, which can pick up an older Atomic installed as a dependency. Set `ATOMIC_ACP_ATOMIC_COMMAND=$(which atomic)` to test the one you have installed globally.
|
|
217
|
+
|
|
218
|
+
## Releasing
|
|
219
|
+
|
|
220
|
+
Releases go to npm through [trusted publishing](https://docs.npmjs.com/trusted-publishers), so there is no npm token in this repository.
|
|
221
|
+
|
|
222
|
+
1. Merge a commit to `main` titled `Release X.Y.Z` (or `Release X.Y.Z-alpha.N`) that sets the same version in `package.json`.
|
|
223
|
+
2. Push a tag named `X.Y.Z` on that commit.
|
|
224
|
+
|
|
225
|
+
The [publish workflow](.github/workflows/publish.yml) checks the tag against the version and commit title, runs the test suite, stages a draft GitHub Release, publishes to npm from the `npm-publish` environment, and then publishes the release. Stable versions go to the `latest` tag on npm and alpha versions go to `next`.
|
|
226
|
+
|
|
227
|
+
## Credits
|
|
228
|
+
|
|
229
|
+
- [pi-acp](https://github.com/svkozak/pi-acp) by Sergii Kozak
|
|
230
|
+
- [Pi](https://pi.dev)
|
|
231
|
+
|
|
232
|
+
## License
|
|
233
|
+
|
|
234
|
+
[MIT](LICENSE)
|