@bastani/atomic-acp 0.0.1 → 0.0.3
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 +46 -8
- package/dist/index.js +683 -129
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -104,6 +104,7 @@ Sessions
|
|
|
104
104
|
- Threads get a title from your first message. Renaming in Atomic updates the title in the editor.
|
|
105
105
|
- Deleting a thread in the editor deletes the Atomic session file.
|
|
106
106
|
- Sessions survive an adapter restart. The next message restores the saved session.
|
|
107
|
+
- If a session's Atomic process exits during a message, the message fails with an error saying how Atomic exited, and its open tool calls and workflow runs are marked failed. A message that fails never ends as a normal reply. The next message starts Atomic again on the same session, with the same MCP servers.
|
|
107
108
|
|
|
108
109
|
Models and context
|
|
109
110
|
|
|
@@ -116,6 +117,15 @@ Commands and dialogs
|
|
|
116
117
|
- 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
118
|
- Extension notifications show up in the thread.
|
|
118
119
|
|
|
120
|
+
MCP servers
|
|
121
|
+
|
|
122
|
+
- MCP servers the editor passes in `session/new` and `session/load` are given to that session's Atomic process. Stdio and streamable HTTP servers work; SSE servers are skipped with a warning on stderr, because Atomic doesn't support SSE.
|
|
123
|
+
- Their tools are exposed directly as `mcp__<server>__<tool>`, so a prompt can name a tool and the model can call it without codemode or tool search.
|
|
124
|
+
- `atomic-acp` doesn't write to `~/.atomic/agent/mcp.json` or `.atomic/mcp.json`. It registers the servers through a temporary Atomic extension in a private directory, deleted when the session's Atomic process exits or the adapter quits. Env and header values are never written to that file: they reach Atomic through its environment and are used exactly as the editor sent them, with no `${VAR}` or `!command` expansion. Node's compile cache is turned off for that Atomic process so it keeps no copy of the extension. Server names are reduced to letters, digits, `_` and `-`.
|
|
125
|
+
- `session/new` and `session/load` fail with invalid params for a server Atomic can't use safely: an HTTP header name that isn't a valid token, a header value with a CR, LF or NUL, a URL containing `${` or `$env:` (Atomic would fill in its own environment variables), or a stdio env value with a NUL. The error names the server and header, never the value.
|
|
126
|
+
- If your own Atomic MCP configuration defines a server with the same name, your configuration wins, as it does for any extension-contributed server.
|
|
127
|
+
- Loading a running session with a different set of servers restarts its Atomic process. A session restored by a prompt after an adapter restart has no editor MCP servers until the editor loads it again.
|
|
128
|
+
|
|
119
129
|
Startup info
|
|
120
130
|
|
|
121
131
|
- 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.
|
|
@@ -130,7 +140,11 @@ Atomic workflows run from the editor the same way they do in the terminal.
|
|
|
130
140
|
/workflow status
|
|
131
141
|
```
|
|
132
142
|
|
|
133
|
-
|
|
143
|
+
A message that starts workflows, with `/workflow <name>` or through the agent's `workflow` tool, stays open until every run it started has completed, failed, been blocked or been cancelled. Each run shows up as a tool call with its stages and final result. When the runs end, the agent replies to Atomic's completion notice, and then the message finishes. Editors treat the end of a message as "the agent is done", so they don't report a workflow as finished while it is still running.
|
|
144
|
+
|
|
145
|
+
- Stopping the message (cancel in the editor) also quits the runs it started. They stay resumable with `/workflow resume <runId>`.
|
|
146
|
+
- If a run stops to wait for human input, the message stops waiting for that run and tells you. Reply in the thread and the agent can answer the prompt with its `workflow` tool.
|
|
147
|
+
- Set `ATOMIC_ACP_WAIT_FOR_WORKFLOWS=0` to end the message as soon as the run starts, as before. Runs then continue in the background, and their notices stream into the thread.
|
|
134
148
|
|
|
135
149
|
Two extra commands read the workflow history Atomic keeps for the current project:
|
|
136
150
|
|
|
@@ -161,10 +175,13 @@ Prompt templates load from `~/.atomic/agent/prompts/` and `<project>/.atomic/pro
|
|
|
161
175
|
|
|
162
176
|
Set these in the `env` object of your agent server entry:
|
|
163
177
|
|
|
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.
|
|
178
|
+
| Variable | Default | Purpose |
|
|
179
|
+
| ------------------------------------ | ---------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
180
|
+
| `ATOMIC_ACP_ATOMIC_COMMAND` | `atomic` (`atomic.cmd` on Windows) | Path or name of the Atomic executable. Arguments are not allowed here. |
|
|
181
|
+
| `ATOMIC_ACP_ENABLE_EMBEDDED_CONTEXT` | unset | Set to `true` to tell the editor it may attach file contents directly to prompts. |
|
|
182
|
+
| `ATOMIC_ACP_WAIT_FOR_WORKFLOWS` | `1` | Set to `0` to end a message without waiting for the workflow runs it started. |
|
|
183
|
+
| `ATOMIC_ACP_HEADLESS` | unset | Set to `1` when no person can answer questions. See [Headless clients](#headless-clients). |
|
|
184
|
+
| `ATOMIC_ACP_ATOMIC_ARGS` | unset | JSON array of extra arguments for every Atomic process, for example `["--model", "openai/gpt-5.5"]`. |
|
|
168
185
|
|
|
169
186
|
```json
|
|
170
187
|
{
|
|
@@ -182,13 +199,32 @@ Set these in the `env` object of your agent server entry:
|
|
|
182
199
|
}
|
|
183
200
|
```
|
|
184
201
|
|
|
202
|
+
### Headless clients
|
|
203
|
+
|
|
204
|
+
Set `ATOMIC_ACP_HEADLESS=1` for clients that run Atomic without a person watching, such as automation. Questions then end at once instead of waiting:
|
|
205
|
+
|
|
206
|
+
- `ask_user_question` returns a tool result saying no person is available, so the model states the question and its assumption in its reply and stops.
|
|
207
|
+
- Extension dialogs (pick, confirm, text input) are cancelled, and the thread shows `No person is available to answer "<question>"`.
|
|
208
|
+
- When a workflow stops for human input, `atomic-acp` quits that run (it stays resumable with `/workflow resume`) and says so in the thread.
|
|
209
|
+
|
|
210
|
+
Without the variable, a dialog that the client rejects, for example because it can't show permission prompts, is cancelled with the same notice.
|
|
211
|
+
|
|
212
|
+
### Extra Atomic arguments
|
|
213
|
+
|
|
214
|
+
Arguments after `--` are added to every `atomic --mode rpc` that `atomic-acp` starts, after the ones from `ATOMIC_ACP_ATOMIC_ARGS`:
|
|
215
|
+
|
|
216
|
+
```json
|
|
217
|
+
{ "command": "atomic-acp", "args": ["--", "--model", "openai/gpt-5.5", "-e", "/path/to/extension.ts"] }
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Each argument is passed to Atomic as is, without a shell. `atomic-acp` exits with an error at startup if `ATOMIC_ACP_ATOMIC_ARGS` isn't a JSON array of strings, or if an argument would take over what the adapter manages: `--mode`, `--print`, the session flags (`--session`, `--session-id`, `--session-dir`, `--no-session`, `--continue`, `--resume`, `--fork`), `--export`, `--list-models`, `--help`, `--version`, or a nested `--`.
|
|
221
|
+
|
|
185
222
|
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
223
|
|
|
187
224
|
## Limitations
|
|
188
225
|
|
|
189
|
-
- `ask_user_question`
|
|
226
|
+
- `ask_user_question` can't be answered over ACP because Atomic RPC mode can't carry its custom UI. Headless clients get a clear "no person is available" result instead.
|
|
190
227
|
- 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
228
|
- If you send several messages while Atomic is busy, they are queued and sent one at a time.
|
|
193
229
|
- Zed is the client this is tested against. Other ACP clients should work but may render some updates differently.
|
|
194
230
|
|
|
@@ -205,11 +241,13 @@ npm run format
|
|
|
205
241
|
|
|
206
242
|
The ACP side lives in `src/acp/`, and the wrapper around the Atomic subprocess lives in `src/atomic-rpc/`.
|
|
207
243
|
|
|
208
|
-
|
|
244
|
+
These 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
245
|
|
|
210
246
|
```bash
|
|
211
247
|
npm run build
|
|
212
248
|
npm run smoke:e2e:atomic # one prompt, checks streamed text and end_turn
|
|
249
|
+
npm run smoke:mcp # an editor MCP server's tool is called through ACP
|
|
250
|
+
npm run smoke:workflow-wait # /workflow sleepy keeps the message open until the run ends; killing Atomic mid-run fails the message and the next one restarts it
|
|
213
251
|
node scripts/smoke-workflow.mjs # runs /workflow list over ACP
|
|
214
252
|
```
|
|
215
253
|
|