Skip to content

Commit 399f8e9

Browse files
authored
Merge pull request #39 from OpenCoven/val/perf-command-integration-audit
Large docs + formatting PR. Conflicts resolved: took main's trusted_command_path helpers over HEAD's hardcoded command names in TUI clipboard/image paste (security-correct). Fixed EffortLevel::from_str → ::parse API rename. cargo check clean.
2 parents b98e662 + aa639ff commit 399f8e9

208 files changed

Lines changed: 68598 additions & 61721 deletions

File tree

Some content is hidden

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

docs/commands.md

Lines changed: 48 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Coven Code Slash Commands Reference
22

3-
This document is the complete reference for every slash command available in Coven Code, the Rust reimplementation of Claude Code CLI. Commands are invoked by typing `/command-name` at the REPL prompt.
3+
This document is the reference for the visible slash commands available in Coven Code. Commands are invoked by typing `/command-name` at the REPL prompt.
44

55
---
66

@@ -27,30 +27,21 @@ This document is the complete reference for every slash command available in Cov
2727

2828
## Command System Overview
2929

30-
Commands are registered in a priority-ordered registry. When you type a command name, Coven Code resolves it through this chain:
31-
32-
```
33-
bundledSkills -> builtinPluginSkills -> skillDirCommands ->
34-
workflowCommands -> pluginCommands -> pluginSkills -> COMMANDS()
35-
```
36-
37-
### Command Types
38-
39-
| Type | Behavior |
40-
|------|----------|
41-
| `local` | Runs synchronously; returns text output directly |
42-
| `local-jsx` | Renders an interactive TUI component (model picker, theme selector, etc.) |
43-
| `prompt` | Expands to a prompt sent to the model via the main inference loop |
44-
45-
Commands support aliases — for example `/h`, `/?`, and `/help` all invoke the same handler.
30+
Commands are resolved in a priority-ordered registry. When you type a command name, Coven Code checks:
31+
32+
```
33+
built-in commands -> user command templates -> discovered skills -> plugin commands
34+
```
35+
36+
Commands support aliases — for example `/h`, `/?`, and `/help` all invoke the same handler.
4637

4738
### Usage Syntax
4839

4940
```
5041
/command-name [arguments]
5142
```
5243

53-
Arguments are passed as a single string after the command name. Most commands that accept arguments are documented with an `argumentHint` shown in the command palette.
44+
Arguments are passed as a single string after the command name.
5445

5546
---
5647

@@ -59,7 +50,7 @@ Arguments are passed as a single string after the command name. Most commands th
5950
### /help
6051
**Aliases:** `h`, `?`
6152

62-
Display all available commands with their descriptions. Respects `isHidden` flags — internal or rarely-needed commands are suppressed unless you are an Anthropic employee.
53+
Display all available commands with their descriptions. Hidden and setup-only commands are suppressed from the default listing.
6354

6455
```
6556
/help
@@ -342,15 +333,21 @@ Open Coven Code privacy settings. Launches a browser to the Anthropic privacy po
342333

343334
### /mcp
344335

345-
Configure and manage Model Context Protocol (MCP) servers. MCP servers expose additional tools and resources to the agent.
336+
Inspect Model Context Protocol (MCP) servers and reconnect configured servers. MCP servers expose additional tools and resources to the agent.
346337

347338
```
348-
/mcp
349-
/mcp list
350-
/mcp add <name> <command>
351-
/mcp remove <name>
352-
/mcp restart <name>
353-
```
339+
/mcp
340+
/mcp list
341+
/mcp status
342+
/mcp auth <name>
343+
/mcp connect <name>
344+
/mcp logs <name>
345+
/mcp resources [name]
346+
/mcp prompts [name]
347+
/mcp get-prompt <name> <prompt> [key=value ...]
348+
```
349+
350+
Add or remove MCP servers by editing `~/.coven-code/settings.json`.
354351

355352
---
356353

@@ -782,19 +779,22 @@ List and manage skills. Skills are bundled prompt-commands that extend Coven Cod
782779

783780
---
784781

785-
### /plugin
786-
**Aliases:** `plugins`, `marketplace`
787-
788-
Manage plugins. Plugins are loadable modules that can register new commands, tools, and hooks. Browse the marketplace or install from a local path.
789-
790-
```
791-
/plugin
792-
/plugin list
793-
/plugin install <name>
794-
/plugin install <path>
795-
/plugin remove <name>
796-
/plugin reload
797-
```
782+
### /plugin
783+
**Aliases:** `plugins`
784+
785+
Manage plugins. Plugins are loadable modules that can register new commands, tools, hooks, agents, skills, and MCP server definitions.
786+
787+
```
788+
/plugin
789+
/plugin list
790+
/plugin info <name>
791+
/plugin enable <name>
792+
/plugin disable <name>
793+
/plugin install <path>
794+
/plugin reload
795+
```
796+
797+
`/plugin reload` refreshes the active session plugin registry, hook registry, plugin commands, agents, skills, and in-memory MCP server definitions. New plugin MCP servers are included in the initial MCP connection at startup; if a reload adds a new MCP server after startup, start a new session before expecting its tools in the model tool list.
798798

799799
---
800800

@@ -1182,22 +1182,15 @@ Over the Remote Control bridge (used by IDE integrations), only `local`-type com
11821182

11831183
`compact`, `clear`, `cost`, `files`
11841184

1185-
### Internal-Only Commands
1186-
1187-
The following commands are only available when the `USER_TYPE` environment variable is set to `ant` (Anthropic internal builds):
1188-
1189-
`commit-push-pr`, `ctx_viz`, `good-claude`, `issue`, `init-verifiers`, `mock-limits`, `bridge-kick`, `ultraplan`, `summary`, `teleport`, `ant-trace`, `perf-issue`, `env`, `oauth-refresh`, `debug-tool-call`, `autofix-pr`, `bughunter`, `backfill-sessions`, `break-cache`
1190-
1191-
### Availability-Restricted Commands
1192-
1193-
Some commands are available only under certain account or platform conditions:
1185+
### Availability-Restricted Commands
1186+
1187+
Some commands are available only under certain account or platform conditions:
11941188

11951189
| Command | Restriction |
11961190
|---------|-------------|
1197-
| `/fast` | Available when a fast-mode model is configured for the active provider |
1198-
| `/privacy-settings` | Opens Anthropic privacy portal (useful for claude.ai accounts) |
1199-
| `/sandbox-toggle` | Functional on macOS, Linux, WSL2 only; no-op on native Windows |
1200-
1201-
### Feature-Flagged Commands
1202-
1203-
Some commands check `isEnabled()` at runtime. For example, voice-related commands check for audio device availability; the desktop command checks for a display server.
1191+
| `/fast` | Available when a fast-mode model is configured for the active provider |
1192+
| `/install-slack-app` | Hidden; Slack setup is unavailable in this build |
1193+
| `/privacy-settings` | Opens the provider privacy portal where supported |
1194+
| `/sandbox-toggle` | Functional on macOS, Linux, WSL2 only; no-op on native Windows |
1195+
| `/voice` | Requires an audio backend plus `OPENAI_API_KEY` or `WHISPER_ENDPOINT_URL` for transcription |
1196+
| `/chrome` | Requires a running Chrome/Chromium instance launched with remote debugging enabled |

docs/mcp.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ MCP defines three primitives a server can offer:
1414

1515
Coven Code discovers tools, resources, and prompts from connected MCP servers during the handshake phase and wraps them as native `Tool` instances (via `McpToolWrapper`), making them transparent to the query loop.
1616

17+
Plugin-provided MCP server definitions are merged into the in-memory config before the initial MCP connection. That means plugin MCP tools are available on first startup instead of requiring a reconnect after plugins load.
18+
1719
---
1820

1921
## Transports
@@ -136,9 +138,12 @@ Use `/mcp` inside an interactive session to inspect and manage MCP servers at ru
136138
```
137139
/mcp — show status of all configured servers
138140
/mcp status — same as above
139-
/mcp connect <name> — connect to a server by name
140-
/mcp disconnect <name> — disconnect a server
141-
/mcp restart <name> — disconnect then reconnect a server
141+
/mcp auth <name> — show OAuth auth instructions for a server
142+
/mcp connect <name> — retry a disconnected configured server
143+
/mcp logs <name> — show recent error/log information
144+
/mcp resources [name] — list resources from connected servers
145+
/mcp prompts [name] — list prompt templates from connected servers
146+
/mcp get-prompt <name> <prompt> [key=value ...] — expand a prompt template
142147
```
143148

144149
The status display shows the connection state and discovered tool count for each server:
@@ -184,6 +189,8 @@ Use `ListMcpResources` to discover available URIs before calling `ReadMcpResourc
184189

185190
In addition to these, every tool that an MCP server exposes is automatically available to the model under its declared name (wrapped transparently by `McpToolWrapper`).
186191

192+
MCP tool wrappers are built from the servers connected during session startup. `/reload-plugins` refreshes plugin MCP definitions in memory, but newly added plugin MCP servers need a new session before their tools are exposed to the model tool list.
193+
187194
---
188195

189196
## Reconnection with Exponential Backoff
@@ -194,7 +201,7 @@ When an MCP server disconnects or fails to connect, Coven Code starts a backgrou
194201
- Backoff factor: **2x** after each failed attempt
195202
- Maximum delay: **60 seconds**
196203

197-
The loop exits as soon as the server connects successfully. A new loop can be started again if the server disconnects again later. The `/mcp restart <name>` command cancels any running loop and starts a fresh connection attempt immediately.
204+
The loop exits as soon as the server connects successfully. If a configured server is disconnected, `/mcp connect <name>` attempts a reconnect. Add or remove servers by editing `~/.coven-code/settings.json` and starting a new session.
198205

199206
Server statuses during reconnection:
200207

docs/plugins.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -349,31 +349,25 @@ The `/plugin` slash command manages plugins from within an interactive session:
349349
/plugin reload — reload all plugins from disk
350350
```
351351

352-
After enabling or disabling a plugin, run `/plugin reload` or use `/reload-plugins` to apply changes in the current session without restarting.
352+
After enabling or disabling a plugin, run `/plugin reload` or use `/reload-plugins` to refresh the session plugin registry without restarting.
353353

354354
### /reload-plugins
355355

356356
```
357357
/reload-plugins
358358
```
359359

360-
Rescans `~/.coven-code/plugins/`, re-reads all manifests, and refreshes the active hook registry, commands, agents, skills, and MCP server definitions. Use this after making changes to a plugin directory or after installing a new plugin.
360+
Rescans `~/.coven-code/plugins/`, re-reads all manifests, and refreshes the active plugin registry, hook registry, plugin commands, agents, skills, and in-memory MCP server definitions. Use this after making changes to a plugin directory or after installing a new plugin.
361361

362-
---
363-
364-
## Plugin Marketplace Integration
362+
Plugin-provided MCP servers are merged before the initial MCP connection during startup, so their tools are available in the first session tool list. If a reload adds a new MCP server after startup, restart the session to expose that server's tools to the model tool list.
365363

366-
Plugins published to the Coven Code marketplace have a `marketplace_id` field in their manifest (e.g. `"author/plugin-name"`). The marketplace integration allows:
364+
---
367365

368-
- Browsing available plugins
369-
- Installing plugins by ID
370-
- Updating installed plugins to newer versions
366+
## Marketplace Metadata
371367

372-
```
373-
/plugin install author/plugin-name — install from the marketplace
374-
```
368+
Plugin manifests may include a `marketplace_id` field (e.g. `"author/plugin-name"`) for catalog metadata and future marketplace workflows.
375369

376-
Locally installed plugins (via a file path) do not require a `marketplace_id`.
370+
The current `/plugin install` command installs from a local plugin path. It does not install marketplace IDs directly.
377371

378372
---
379373

docs/tools.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ This document is the complete reference for every tool available to the Coven Co
2828

2929
## Tool System Overview
3030

31-
Every tool in Coven Code implements a common `Tool` interface. This interface defines:
31+
Every tool in Coven Code implements the Rust `Tool` trait in `src-rust/crates/tools/src/lib.rs`. This trait defines:
3232

33-
- **Identity** — name, aliases, MCP info
34-
- **Input schema**a Zod schema validating the input the model must provide
35-
- **Capability flags**`isReadOnly`, `isDestructive`, `isConcurrencySafe`
36-
- **Permission check**`checkPermissions()` called before execution
37-
- **Execution**`call()` performs the actual operation
38-
- **UI rendering**React/Ink components for TUI display
33+
- **Identity**the tool name the model uses to call it
34+
- **Description**instructions shown to the model
35+
- **Input schema**a JSON Schema object validating the input the model must provide
36+
- **Permission level**`None`, `ReadOnly`, `Write`, `Execute`, `Dangerous`, or `Forbidden`
37+
- **Execution**`execute()` performs the operation after permission resolution
38+
- **Tool definition**`to_definition()` serializes the name, description, and schema for providers
3939

40-
Tools are loaded eagerly at session start. The model receives tool descriptions and schemas and selects tools to call. Each tool call goes through permission resolution before `call()` is invoked.
40+
Built-in tools are constructed once per session by `all_tools()`. Cheap lookup paths use a static built-in tool-name catalog so status/help flows do not instantiate every tool just to list names. MCP tools are added after MCP servers connect and are wrapped as native `Tool` instances.
4141

4242
### Tool Concurrency
4343

44-
Tools marked `isConcurrencySafe` may run in parallel with other tool calls. Most write tools are not concurrency-safe. Read-only tools are generally safe to parallelize.
44+
The query loop may run compatible tool calls in parallel. Write and execute tools still pass through permission checks, while read-only tools are generally safe to parallelize.
4545

4646
---
4747

src-rust/crates/acp/src/connection.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ where
224224

225225
if has_id && (has_result || has_error) && !has_method {
226226
// Response — route to pending.
227-
let id: acp::RequestId = serde_json::from_value(v["id"].clone()).unwrap_or(acp::RequestId::Null);
227+
let id: acp::RequestId =
228+
serde_json::from_value(v["id"].clone()).unwrap_or(acp::RequestId::Null);
228229
if has_result {
229230
let value = v["result"].clone();
230231
connection.complete_pending(&id, Ok(value));
@@ -237,17 +238,15 @@ where
237238
}
238239
} else if has_id && has_method {
239240
// Request.
240-
let id: acp::RequestId = serde_json::from_value(v["id"].clone()).unwrap_or(acp::RequestId::Null);
241+
let id: acp::RequestId =
242+
serde_json::from_value(v["id"].clone()).unwrap_or(acp::RequestId::Null);
241243
let method = v
242244
.get("method")
243245
.and_then(Value::as_str)
244246
.unwrap_or("")
245247
.to_string();
246248
let params = v.get("params").cloned();
247-
if tx
248-
.send(Inbound::Request { id, method, params })
249-
.is_err()
250-
{
249+
if tx.send(Inbound::Request { id, method, params }).is_err() {
251250
break;
252251
}
253252
} else if has_method {
@@ -349,9 +348,7 @@ mod tests {
349348
.await
350349
.unwrap();
351350
writer_handle
352-
.write_all(
353-
b"{\"jsonrpc\":\"2.0\",\"id\":99,\"result\":{\"orphan\":true}}\n",
354-
)
351+
.write_all(b"{\"jsonrpc\":\"2.0\",\"id\":99,\"result\":{\"orphan\":true}}\n")
355352
.await
356353
.unwrap();
357354
drop(writer_handle); // EOF the reader
@@ -383,8 +380,7 @@ mod tests {
383380
let (server_to_client_reader, server_to_client) = duplex(8192);
384381
let connection = Connection::new(server_to_client);
385382
let (tx, _rx) = mpsc::unbounded_channel();
386-
let reader_handle =
387-
tokio::spawn(run_reader(connection.clone(), server_reader, tx));
383+
let reader_handle = tokio::spawn(run_reader(connection.clone(), server_reader, tx));
388384

389385
// Background: as a fake client, read the outbound request and write a
390386
// matching response.
@@ -403,8 +399,7 @@ mod tests {
403399
break;
404400
}
405401
}
406-
let outbound: serde_json::Value =
407-
serde_json::from_slice(buf.trim_ascii_end()).unwrap();
402+
let outbound: serde_json::Value = serde_json::from_slice(buf.trim_ascii_end()).unwrap();
408403
let id = outbound["id"].clone();
409404
// Send the response back through the client_to_server pipe.
410405
let response = serde_json::json!({
@@ -429,4 +424,3 @@ mod tests {
429424
let _ = reader_handle.await;
430425
}
431426
}
432-

src-rust/crates/acp/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ fn install_stderr_tracing() {
9797
use tracing_subscriber::{fmt, EnvFilter};
9898
let _ = fmt()
9999
.with_env_filter(
100-
EnvFilter::try_from_env("COVEN_CODE_ACP_LOG").unwrap_or_else(|_| EnvFilter::new("warn")),
100+
EnvFilter::try_from_env("COVEN_CODE_ACP_LOG")
101+
.unwrap_or_else(|_| EnvFilter::new("warn")),
101102
)
102103
.with_writer(std::io::stderr)
103104
.try_init();

0 commit comments

Comments
 (0)