Story 42: Deterministic worktree management via REST/MCP API
Add REST and MCP endpoints for creating, listing, and removing worktrees. Includes worktree lifecycle management and cleanup operations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -466,6 +466,21 @@ impl AgentPool {
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a worktree for the given story using the server port (writes .mcp.json).
|
||||
pub async fn create_worktree(
|
||||
&self,
|
||||
project_root: &Path,
|
||||
story_id: &str,
|
||||
) -> Result<worktree::WorktreeInfo, String> {
|
||||
let config = ProjectConfig::load(project_root)?;
|
||||
worktree::create_worktree(project_root, story_id, &config, self.port).await
|
||||
}
|
||||
|
||||
/// Return the port this server is running on.
|
||||
pub fn port(&self) -> u16 {
|
||||
self.port
|
||||
}
|
||||
|
||||
/// Get project root helper.
|
||||
pub fn get_project_root(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user