diff options
Diffstat (limited to 'crates/phone-opus/src/mcp/protocol.rs')
| -rw-r--r-- | crates/phone-opus/src/mcp/protocol.rs | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/crates/phone-opus/src/mcp/protocol.rs b/crates/phone-opus/src/mcp/protocol.rs index 9d3ec1a..79c2169 100644 --- a/crates/phone-opus/src/mcp/protocol.rs +++ b/crates/phone-opus/src/mcp/protocol.rs @@ -28,9 +28,48 @@ Prefer specific recommendations over vague commentary. If there are no meaningfu The real prompt follows."; pub(crate) const CLAUDE_EFFORT: &str = "max"; pub(crate) const CLAUDE_MODEL: &str = "claude-opus-4-6"; -pub(crate) const CLAUDE_TOOLSET: &str = "Bash,Read,Grep,Glob,LS,WebFetch"; pub(crate) const EMPTY_MCP_CONFIG: &str = "{\"mcpServers\":{}}"; +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub(crate) enum ClaudeTool { + Bash, + Read, + Grep, + Glob, + Ls, + WebFetch, +} + +impl ClaudeTool { + const fn cli_name(self) -> &'static str { + match self { + Self::Bash => "Bash", + Self::Read => "Read", + Self::Grep => "Grep", + Self::Glob => "Glob", + Self::Ls => "LS", + Self::WebFetch => "WebFetch", + } + } +} + +pub(crate) const CLAUDE_TOOLSET: &[ClaudeTool] = &[ + ClaudeTool::Bash, + ClaudeTool::Read, + ClaudeTool::Grep, + ClaudeTool::Glob, + ClaudeTool::Ls, + ClaudeTool::WebFetch, +]; + +pub(crate) fn render_claude_toolset(toolset: &[ClaudeTool]) -> String { + toolset + .iter() + .map(|tool| tool.cli_name()) + .collect::<Vec<_>>() + .join(",") +} + #[derive(Clone, Debug, Deserialize, Serialize)] pub(crate) struct HostStateSeed { pub(crate) session_kernel: HostSessionKernelSnapshot, |