* claim: #5015 Co-Authored-By: Claude Code <noreply@anthropic.com> * Assistant: add Anthropic-compatible API agents (#5015) The Add agent wizard now offers Anthropic-compatible endpoints beside OpenAI-compatible ones. The API backend speaks the Anthropic Messages protocol with the same MCP bridge, tool gate, limits, undo and keychain rules: x-api-key and anthropic-version, a top-level system note, input_schema tools, content-block answers and one user tool_result message per round. Test sends a short message because compatible endpoints (Qwen's) need not list models. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com>
This commit is contained in:
+15
-10
@@ -1,11 +1,12 @@
|
||||
# Agent chat
|
||||
|
||||
Agent chat is a side panel where you talk to a coding agent you already use (Claude Code,
|
||||
Codex, Google Antigravity, OpenCode, Grok Build and others), or to a model behind an OpenAI-compatible endpoint you
|
||||
choose (Ollama or LM Studio on your computer, OpenAI, any other URL), and have it work on the
|
||||
design that's open. A coding agent runs on your computer under **your own account** with that
|
||||
agent: SolidCraft doesn't sell or proxy a model and needs no key for it. An endpoint's key, if
|
||||
it needs one, goes into your system keychain, never into SolidCraft's settings.
|
||||
Codex, Google Antigravity, OpenCode, Grok Build and others), or to a model behind an
|
||||
OpenAI-compatible or Anthropic-compatible endpoint you choose (Ollama or LM Studio on your
|
||||
computer, OpenAI, Anthropic, any other URL), and have it work on the design that's open. A
|
||||
coding agent runs on your computer under **your own account** with that agent: SolidCraft
|
||||
doesn't sell or proxy a model and needs no key for it. An endpoint's key, if it needs one, goes
|
||||
into your system keychain, never into SolidCraft's settings.
|
||||
|
||||
Desktop app only.
|
||||
|
||||
@@ -199,11 +200,15 @@ Grok Build also supports `XAI_API_KEY` for users who choose API authentication.
|
||||
`my-agent --acp`. SolidCraft starts it directly, not through a shell.
|
||||
- **OpenAI-compatible API:** a preset (Ollama `http://localhost:11434/v1`, LM Studio
|
||||
`http://localhost:1234/v1`, OpenAI) or a custom URL, the model name, and an optional key.
|
||||
The key goes into the system keychain (Keychain on macOS, Credential Manager on Windows, the
|
||||
Secret Service on Linux) and is only ever sent over HTTPS or to this computer. **Test** asks the
|
||||
endpoint for its models. For these agents SolidCraft runs the conversation itself, with the
|
||||
same tools, limits and questions as for a coding agent, and at most 24 model requests per
|
||||
message.
|
||||
- **Anthropic-compatible API:** a preset (Anthropic) or a custom URL, for an endpoint that
|
||||
speaks the Anthropic Messages API (`{base}/v1/messages`). This covers Anthropic itself and
|
||||
providers that offer an Anthropic-compatible endpoint, such as DeepSeek and Qwen.
|
||||
- The key goes into the system keychain (Keychain on macOS, Credential Manager on Windows, the
|
||||
Secret Service on Linux) and is only ever sent over HTTPS or to this computer. **Test** asks an
|
||||
OpenAI-compatible endpoint for its models; an Anthropic-compatible one gets a short message,
|
||||
because not every such endpoint lists models (Qwen's has no model list). For these agents
|
||||
SolidCraft runs the conversation itself, with the same tools, limits and questions as for a
|
||||
coding agent, and at most 24 model requests per message.
|
||||
|
||||
## Signing in
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ labels; `prefs:measure_axis_distances` identifies the checkbox.
|
||||
| `ui.agent_cursor` | `show` (bool), `speed`: a number from 1 to 5 (times the normal speed) or `"instant"` (no animation: the command runs at once and the pointer jumps to where it acted), `follow_camera` (bool); all optional | the settings. While the cursor is shown, `engine.execute` first glides to the command's toolbar button and to each pick, then runs and replies; later requests wait their turn. It also follows the pointer input sent with `ui.move`, `ui.click`, `ui.drag` and `ui.scroll`, as each event reaches the app, and a press leaves a ripple. `"animate": false` on a call skips it |
|
||||
| `engine.execute` → `view.layout` | `mode`: `floating` or `compact` | Apply and save the workspace layout without opening a dialog, changing the design, resetting the camera or cancelling its active tool. General preferences expose the same choice; `ui.prefs {"layout":"compact"}` also saves it. |
|
||||
| `engine.execute` → `view.history_layout` | `width?`, `dock?`: `bottom`, `left`, `under_browser`, `collapsed?` | Resize/dock the history without opening a dialog or changing the design. Contents respond to measured width; browser-stacked history shares its width and splits height equally. One folded header gives the expanded card the rest; two folded headers stay at the top. |
|
||||
| `ui.agent_chat` | `features?`, `toolbar_button?`, `permissions?` (`ask`, `edits`, `all`), `add_agent?` ({`name`, `kind`: `acp` or `api`, `command` or `base_url` + `model`}; no keys), `default_agent?`, `agent?` (the conversation's agent, by id), `mode?` (the agent's own mode), `model?` (one of its models), `open?`, `side?` (`left`, `right`), `minimized?`, `popped?` (in its own window), `width?`, `picker?`, `refresh?`, `connect?`, `stop?`, `attach?`: a file's path (a picture, a text file or a CAD file, for the next message; CAD files are imported at once), `remove_file?` (index of a file on the next message), `send?`: text (files alone make a message too), `attach_view?`, `permission?`: an option id or `"cancel"` (the newest question of the agent's own), `approve?`: true, false or `"always"` (the oldest request held for Allow/Deny), `cancel?` (Stop: the queue stays), `send_now?` (stop the running step, then send the queued messages), `remove_pending?` (index), `new_chat?` (clear the chat, new session), `undo?` (the last message's changes) | the chat's state: `features`, `agents` (found and added), `currentAgent`, `state` (off, starting, ready, busy, auth, exited), `popped`, `window` (its place and size), `agent`, `modes`, `mode`, `models`, `model`, `authMethods`, `toolsPort`, `pid`, `waiting`, `turn`, `pending` (queued messages, with their `files`), `attachments` (the files on the next message, by name), `loading` (pictures still being read for it, by name), `stopped`, `detection` and the conversation (`items`). With `features` off only the settings apply. Desktop only; see [Agent chat](agent-chat.md) |
|
||||
| `ui.agent_chat` | `features?`, `toolbar_button?`, `permissions?` (`ask`, `edits`, `all`), `add_agent?` ({`name`, `kind`: `acp`, `api` or `anthropic` (`api` is OpenAI-compatible, `anthropic` Anthropic-compatible), `command` or `base_url` + `model`}; no keys), `add_dialog?` (`installed`, `custom`, `api`, `anthropic`, or `false` to close), `default_agent?`, `agent?` (the conversation's agent, by id), `mode?` (the agent's own mode), `model?` (one of its models), `open?`, `side?` (`left`, `right`), `minimized?`, `popped?` (in its own window), `width?`, `picker?`, `refresh?`, `connect?`, `stop?`, `attach?`: a file's path (a picture, a text file or a CAD file, for the next message; CAD files are imported at once), `remove_file?` (index of a file on the next message), `send?`: text (files alone make a message too), `attach_view?`, `permission?`: an option id or `"cancel"` (the newest question of the agent's own), `approve?`: true, false or `"always"` (the oldest request held for Allow/Deny), `cancel?` (Stop: the queue stays), `send_now?` (stop the running step, then send the queued messages), `remove_pending?` (index), `new_chat?` (clear the chat, new session), `undo?` (the last message's changes) | the chat's state: `features`, `agents` (found and added), `currentAgent`, `state` (off, starting, ready, busy, auth, exited), `popped`, `window` (its place and size), `agent`, `modes`, `mode`, `models`, `model`, `authMethods`, `toolsPort`, `pid`, `waiting`, `turn`, `pending` (queued messages, with their `files`), `attachments` (the files on the next message, by name), `loading` (pictures still being read for it, by name), `stopped`, `detection` and the conversation (`items`). With `features` off only the settings apply. Desktop only; see [Agent chat](agent-chat.md) |
|
||||
| `ui.resize` | `width`, `height` | |
|
||||
| `app.quit` | `force?` (quit without asking about unsaved designs) | `quitting` (the window closes), `asking` (a "save changes?" prompt is open) |
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ Code: `crates/ui-egui/src/agent_chat/`.
|
||||
|---|---|
|
||||
| `backend.rs` | The `ChatBackend` trait and its `Event`s: the only thing the panel talks to. |
|
||||
| `acp.rs`, `acp_client.rs` | The protocol messages, and `AcpBackend`, the first backend. |
|
||||
| `api_client.rs` | `ApiBackend`: an OpenAI-compatible endpoint, with SolidCraft running the tool loop. |
|
||||
| `api_client.rs` | `ApiBackend`: an OpenAI-compatible or Anthropic-compatible endpoint, with SolidCraft running the tool loop. |
|
||||
| `agents.rs` | The agents (found and added), permission modes, "always allow" answers. |
|
||||
| `settings.rs` | Preferences → AI and the Add agent dialog. |
|
||||
| `process.rs` | The agent as a child process in a process group of its own; stopping it ends the group. |
|
||||
@@ -112,13 +112,17 @@ requests, for a backend that runs tools in process). Two backends exist:
|
||||
- `AcpBackend` drives a coding agent the user already has (the default, and the point of the
|
||||
feature: the user's own account, no keys).
|
||||
- `ApiBackend` talks to an OpenAI-compatible chat completions endpoint (Ollama, LM Studio,
|
||||
OpenAI, a custom URL) and runs the tool loop itself: it starts the same `solidcraft-cli mcp
|
||||
--connect` server an ACP agent would get and is its MCP client (`tools/list` becomes the
|
||||
function tools, `crash_reports` left out), so its calls pass the same gate, limits, questions
|
||||
and undo as an ACP agent's. At most 24 model requests per message. The HTTP request is the
|
||||
desktop host's (`Services::agent_http`, ureq with no redirects); the key comes from the system
|
||||
keychain (`Services::secrets`, the keyring crate) for the connection only and is refused over
|
||||
plain HTTP to another computer.
|
||||
OpenAI, a custom URL) or an Anthropic-compatible Messages endpoint (Anthropic, or a provider
|
||||
that speaks the Messages API), and runs the tool loop itself: it starts the same
|
||||
`solidcraft-cli mcp --connect` server an ACP agent would get and is its MCP client
|
||||
(`tools/list` becomes the endpoint's tools, `crash_reports` left out), so its calls pass the
|
||||
same gate, limits, questions and undo as an ACP agent's. At most 24 model requests per
|
||||
message. The HTTP request is the desktop host's (`Services::agent_http`, ureq with no
|
||||
redirects); the key comes from the system keychain (`Services::secrets`, the keyring crate)
|
||||
for the connection only and is refused over plain HTTP to another computer. The two protocols
|
||||
differ only in their wire shape: OpenAI sends the system note as a message, function tools
|
||||
and one `tool` message per result; Anthropic sends it as `system`, `input_schema` tools and
|
||||
all of a round's `tool_result` blocks in one user message.
|
||||
|
||||
Another kind of backend slots in the same way without reshaping the panel.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user