(
request: &crate::mcp::JsonRpcRequest,
client_identity: &DaemonClientIdentity,
)
| 2124 | |
| 2125 | #[cfg(unix)] |
| 2126 | async fn projectless_response( |
| 2127 | request: &crate::mcp::JsonRpcRequest, |
| 2128 | client_identity: &DaemonClientIdentity, |
| 2129 | ) -> Option<crate::mcp::JsonRpcResponse> { |
| 2130 | let id = request.id.clone()?; |
| 2131 | match request.method.as_str() { |
| 2132 | "initialize" => Some(JsonRpcResponse::success( |
| 2133 | id, |
| 2134 | json!({ |
| 2135 | "protocolVersion": "2024-11-05", |
| 2136 | "capabilities": { |
| 2137 | "tools": {} |
| 2138 | }, |
| 2139 | "serverInfo": { |
| 2140 | "name": "tracedecay", |
| 2141 | "version": env!("CARGO_PKG_VERSION") |
| 2142 | } |
| 2143 | }), |
| 2144 | )), |
| 2145 | "tools/call" => Some( |
| 2146 | projectless_tools_call_response(id, request.params.as_ref(), client_identity).await, |
| 2147 | ), |
| 2148 | "ping" | "logging/setLevel" => Some(JsonRpcResponse::success(id, json!({}))), |
| 2149 | _ => Some(JsonRpcResponse::error( |
| 2150 | id, |
| 2151 | ErrorCode::MethodNotFound, |
| 2152 | format!("Method not found: {}", request.method), |
| 2153 | )), |
| 2154 | } |
| 2155 | } |
| 2156 | |
| 2157 | #[cfg(unix)] |
| 2158 | async fn projectless_tools_call_response( |
no test coverage detected