huskies: merge 855

This commit is contained in:
dave
2026-04-29 21:35:55 +00:00
parent a7b1572693
commit 4d24b5b661
17 changed files with 204 additions and 973 deletions
+5 -5
View File
@@ -36,11 +36,11 @@ pub fn worktree_path(project_root: &Path, story_id: &str) -> PathBuf {
.join(story_id)
}
/// Write a `.mcp.json` file in the given directory pointing to the MCP server
/// at the given port.
/// Write a `.mcp.json` file in the given directory pointing to the huskies
/// rendezvous WebSocket endpoint at the given port.
pub fn write_mcp_json(dir: &Path, port: u16) -> Result<(), String> {
let content = format!(
"{{\n \"mcpServers\": {{\n \"huskies\": {{\n \"type\": \"http\",\n \"url\": \"http://localhost:{port}/mcp\"\n }}\n }}\n}}\n"
"{{\n \"mcpServers\": {{\n \"huskies\": {{\n \"url\": \"ws://localhost:{port}/crdt-sync\"\n }}\n }}\n}}\n"
);
std::fs::write(dir.join(".mcp.json"), content).map_err(|e| format!("Write .mcp.json: {e}"))
}
@@ -91,7 +91,7 @@ mod tests {
let tmp = TempDir::new().unwrap();
write_mcp_json(tmp.path(), 4242).unwrap();
let content = std::fs::read_to_string(tmp.path().join(".mcp.json")).unwrap();
assert!(content.contains("http://localhost:4242/mcp"));
assert!(content.contains("ws://localhost:4242/crdt-sync"));
}
#[test]
@@ -99,7 +99,7 @@ mod tests {
let tmp = TempDir::new().unwrap();
write_mcp_json(tmp.path(), 3001).unwrap();
let content = std::fs::read_to_string(tmp.path().join(".mcp.json")).unwrap();
assert!(content.contains("http://localhost:3001/mcp"));
assert!(content.contains("ws://localhost:3001/crdt-sync"));
}
#[test]