swarm repositories / source
aboutsummaryrefslogtreecommitdiff
path: root/crates/phone-opus/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/phone-opus/src/main.rs')
-rw-r--r--crates/phone-opus/src/main.rs51
1 files changed, 51 insertions, 0 deletions
diff --git a/crates/phone-opus/src/main.rs b/crates/phone-opus/src/main.rs
new file mode 100644
index 0000000..79ace26
--- /dev/null
+++ b/crates/phone-opus/src/main.rs
@@ -0,0 +1,51 @@
+mod mcp;
+
+use clap::{Args, Parser, Subcommand};
+#[cfg(test)]
+use libmcp_testkit as _;
+
+#[derive(Parser)]
+#[command(
+ author,
+ version,
+ about = "Consultative Claude Code MCP with a hardened host/worker spine"
+)]
+struct Cli {
+ #[command(subcommand)]
+ command: Command,
+}
+
+#[derive(Subcommand)]
+enum Command {
+ /// Serve the stdio MCP host.
+ Mcp {
+ #[command(subcommand)]
+ command: McpCommand,
+ },
+}
+
+#[derive(Subcommand)]
+enum McpCommand {
+ /// Run the durable stdio host.
+ Serve,
+ /// Run the disposable worker process.
+ Worker(McpWorkerArgs),
+}
+
+#[derive(Args)]
+struct McpWorkerArgs {
+ /// Logical worker generation assigned by the host.
+ #[arg(long)]
+ generation: u64,
+}
+
+fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let cli = Cli::parse();
+ match cli.command {
+ Command::Mcp { command } => match command {
+ McpCommand::Serve => mcp::run_host()?,
+ McpCommand::Worker(args) => mcp::run_worker(args.generation)?,
+ },
+ }
+ Ok(())
+}