Skip to content

Commit a8048d2

Browse files
authored
Merge pull request #99 from nikomatsakis/main
Simplify the setup
2 parents 8cea50a + 185e515 commit a8048d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3026
-1052
lines changed

Cargo.lock

Lines changed: 492 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ members = [
33
"setup",
44
"md-rfd-preprocessor",
55
"ci",
6-
"src/symposium-acp-proxy",
76
"src/symposium-acp-agent",
87
"src/symposium-ferris",
98
"src/symposium-math",

md/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424
- [Ferris](./using/ferris.md)
2525
- [Cargo](./using/cargo.md)
2626

27-
# Contributing
27+
# Development guide
2828

2929
- [How to contribute](./contribute.md)
3030
- [Overview](./design/implementation-overview.md)
3131
- [Common Issues](./design/common-issues.md)
3232
- [Distribution](./design/distribution.md)
3333
- [Components](./design/components.md)
34+
- [Act-as-Configured Mode](./design/act-as-configured.md)
3435
- [Rust Crate Sources](./design/rust-crate-sources.md)
3536
- [VSCode Extension](./design/vscode-extension/architecture.md)
3637
- [Message Protocol](./design/vscode-extension/message-protocol.md)

md/artwork/logos/acp.png

81 KB
Loading

md/artwork/logos/emacs.png

189 KB
Loading

md/artwork/logos/neovim.svg

Lines changed: 147 additions & 0 deletions
Loading

md/design/act-as-configured.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Act-as-Configured Mode
2+
3+
The `act-as-configured` subcommand simplifies editor integration by reading agent configuration from a file rather than requiring command-line arguments.
4+
5+
## Motivation
6+
7+
Without this mode, editor extensions must either:
8+
- Hardcode specific agent commands, requiring extension updates to add new agents
9+
- Expose complex configuration UI for specifying agent commands and proxy options
10+
11+
With `act-as-configured`, the extension simply runs:
12+
13+
```bash
14+
symposium-acp-agent act-as-configured
15+
```
16+
17+
The agent reads its configuration from `~/.symposium/config.jsonc`, and if no configuration exists, runs an interactive setup wizard.
18+
19+
## Configuration File
20+
21+
**Location:** `~/.symposium/config.jsonc`
22+
23+
The file uses JSONC (JSON with comments) format:
24+
25+
```jsonc
26+
{
27+
// Downstream agent command (parsed as shell words)
28+
"agent": "npx -y @zed-industries/claude-code-acp",
29+
30+
// Proxy extensions to enable
31+
"proxies": [
32+
{ "name": "sparkle", "enabled": true },
33+
{ "name": "ferris", "enabled": true },
34+
{ "name": "cargo", "enabled": true }
35+
]
36+
}
37+
```
38+
39+
### Fields
40+
41+
| Field | Type | Description |
42+
|-------|------|-------------|
43+
| `agent` | string | Shell command to spawn the downstream agent. Parsed using shell word splitting. |
44+
| `proxies` | array | List of proxy extensions with `name` and `enabled` fields. |
45+
46+
The `agent` string is parsed as shell words, so commands like `npx -y @zed-industries/claude-code-acp` work correctly.
47+
48+
## Runtime Behavior
49+
50+
```
51+
┌─────────────────────────────────────────┐
52+
│ act-as-configured │
53+
└─────────────────┬───────────────────────┘
54+
55+
56+
┌─────────────────┐
57+
│ Config exists? │
58+
└────────┬────────┘
59+
60+
┌───────┴───────┐
61+
│ │
62+
▼ ▼
63+
┌──────────┐ ┌──────────────┐
64+
│ Yes │ │ No │
65+
└────┬─────┘ └──────┬───────┘
66+
│ │
67+
▼ ▼
68+
Load config Run configuration
69+
Run agent agent (setup wizard)
70+
```
71+
72+
When a configuration file exists, `act-as-configured` behaves equivalently to:
73+
74+
```bash
75+
symposium-acp-agent act-as-agent \
76+
--proxy sparkle --proxy ferris --proxy cargo \
77+
-- npx -y @zed-industries/claude-code-acp
78+
```
79+
80+
## Configuration Agent
81+
82+
When no configuration file exists, Symposium runs a built-in configuration agent instead of a downstream AI agent. This agent:
83+
84+
1. Presents a numbered list of known agents (Claude Code, Gemini, Codex, Kiro CLI)
85+
2. Waits for the user to type a number (1-N)
86+
3. Saves the configuration file with all proxies enabled
87+
4. Instructs the user to restart their editor
88+
89+
The configuration agent is a simple state machine that expects numeric input. Invalid input causes the prompt to repeat.
90+
91+
### Known Agents
92+
93+
The configuration wizard offers these pre-configured agents:
94+
95+
| Name | Command |
96+
|------|---------|
97+
| Claude Code | `npx -y @zed-industries/claude-code-acp` |
98+
| Gemini CLI | `npx -y -- @google/gemini-cli@latest --experimental-acp` |
99+
| Codex | `npx -y @zed-industries/codex-acp` |
100+
| Kiro CLI | `kiro-cli-chat acp` |
101+
102+
Users can manually edit `~/.symposium/config.jsonc` to use other agents or modify proxy settings.
103+
104+
## Implementation
105+
106+
The implementation consists of:
107+
108+
- **Config types:** `SymposiumUserConfig` and `ProxyEntry` structs in `src/symposium-acp-agent/src/config.rs`
109+
- **Config loading:** `load()` reads from `~/.symposium/config.jsonc`, `save()` writes it
110+
- **Configuration agent:** `ConfigurationAgent` implements the ACP `Component` trait
111+
- **CLI integration:** `ActAsConfigured` variant in the `Command` enum
112+
113+
### Dependencies
114+
115+
| Crate | Purpose |
116+
|-------|---------|
117+
| `serde_jsonc` | Parse JSON with comments |
118+
| `shell-words` | Parse agent command string into arguments |
119+
| `dirs` | Cross-platform home directory resolution |

md/design/implementation-overview.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,54 @@ Symposium uses a **conductor** to orchestrate a dynamic chain of component proxi
44

55
## Two Deployment Modes
66

7-
Symposium provides two binaries for different deployment scenarios:
7+
The `symposium-acp-agent` binary supports two deployment modes via subcommands:
88

9-
### Proxy Mode (`symposium-acp-proxy`)
9+
### Agent Mode (`act-as-agent`)
1010

11-
Sits between an editor and an existing agent, enriching the connection:
11+
Acts as a complete agent that wraps a downstream agent:
1212

1313
```mermaid
1414
flowchart LR
15-
Editor --> Proxy[symposium-acp-proxy] --> Agent
15+
Editor --> Agent[symposium-acp-agent] --> DownstreamAgent[claude-code, etc.]
1616
```
1717

18-
Use this when the editor spawns agents separately and you want to insert Symposium's capabilities in between.
18+
Use this when you want a single binary that editors can spawn directly. This is ideal for Zed extensions and similar scenarios where the editor expects to spawn a single agent binary.
1919

20-
### Agent Mode (`symposium-acp-agent`)
20+
Example:
21+
```bash
22+
symposium-acp-agent act-as-agent --proxy defaults -- npx -y @anthropic-ai/claude-code-acp
23+
```
2124

22-
Acts as a complete agent that wraps a downstream agent:
25+
### Proxy Mode (`act-as-proxy`)
26+
27+
Sits between an editor and an existing agent, enriching the connection:
2328

2429
```mermaid
2530
flowchart LR
26-
Editor --> Agent[symposium-acp-agent] --> DownstreamAgent[claude-code, etc.]
31+
Editor --> Proxy[symposium-acp-agent] --> Agent
2732
```
2833

29-
Use this when you want a single binary that editors can spawn directly. This is ideal for Zed extensions and similar scenarios where the editor expects to spawn a single agent binary.
34+
Use this when the editor spawns agents separately and you want to insert Symposium's capabilities in between.
3035

3136
Example:
3237
```bash
33-
symposium-acp-agent -- npx -y @zed-industries/claude-code-acp
38+
symposium-acp-agent act-as-proxy --proxy sparkle --proxy ferris
39+
```
40+
41+
## Proxy Configuration
42+
43+
Use `--proxy <name>` to specify which extensions to include. Order matters - proxies are chained in the order specified.
44+
45+
Known proxies: `sparkle`, `ferris`, `cargo`
46+
47+
The special value `defaults` expands to all known proxies:
48+
```bash
49+
--proxy defaults # equivalent to: --proxy sparkle --proxy ferris --proxy cargo
50+
--proxy foo --proxy defaults --proxy bar # foo, then all defaults, then bar
3451
```
3552

53+
If no `--proxy` flags are given, no proxies are included (pure passthrough).
54+
3655
## Internal Structure
3756

3857
Both modes use a [conductor](https://symposium-dev.github.io/symposium-acp/) to orchestrate multiple component proxies:

md/design/rust-crate-sources.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,10 @@ Each `rust_crate_query` call creates exactly one research session and expects ex
250250

251251
## Integration with Symposium
252252

253-
The component is registered with the conductor in `symposium-acp-proxy/src/lib.rs`:
253+
The component is registered with the conductor in `symposium-acp-agent/src/symposium.rs`:
254254

255255
```rust
256-
components.push(sacp::DynComponent::new(
257-
symposium_crate_sources_proxy::CrateSourcesProxy {},
258-
));
256+
proxies.push(DynComponent::new(symposium_ferris::FerrisComponent::new(ferris_config)));
259257
```
260258

261259
The component implements `Component::serve()` to:

0 commit comments

Comments
 (0)