claude-team-mcp 0.4.0__py3-none-any.whl → 0.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -240,6 +240,10 @@ def create_local_worktree(
240
240
  The branch name matches the worktree directory name for consistency.
241
241
  Automatically adds .worktrees to .gitignore if not present.
242
242
 
243
+ If a worktree path or branch already exists, appends an incrementing
244
+ suffix (-1, -2, etc.) until an available name is found. This allows
245
+ multiple workers to work on the same bead in parallel.
246
+
243
247
  Args:
244
248
  repo_path: Path to the main repository
245
249
  worker_name: Name of the worker (used in fallback naming)
@@ -262,6 +266,9 @@ def create_local_worktree(
262
266
  )
263
267
  # Returns: Path("/path/to/repo/.worktrees/cic-abc-add-local-worktrees")
264
268
 
269
+ # If called again with same bead/annotation:
270
+ # Returns: Path("/path/to/repo/.worktrees/cic-abc-add-local-worktrees-1")
271
+
265
272
  # Without bead ID
266
273
  path = create_local_worktree(
267
274
  repo_path=Path("/path/to/repo"),
@@ -290,7 +297,6 @@ def create_local_worktree(
290
297
 
291
298
  # Worktree path inside the repo
292
299
  worktrees_dir = repo_path / LOCAL_WORKTREE_DIR
293
- worktree_path = worktrees_dir / dir_name
294
300
 
295
301
  # Ensure .worktrees is in .gitignore
296
302
  ensure_gitignore_entry(repo_path, LOCAL_WORKTREE_DIR)
@@ -298,29 +304,32 @@ def create_local_worktree(
298
304
  # Ensure .worktrees directory exists
299
305
  worktrees_dir.mkdir(parents=True, exist_ok=True)
300
306
 
301
- # Check if worktree already exists
302
- if worktree_path.exists():
303
- raise WorktreeError(f"Worktree already exists at {worktree_path}")
307
+ # Find an available name, handling collisions with incrementing suffix.
308
+ # Check both path existence and branch existence (git won't allow the same
309
+ # branch checked out in multiple worktrees).
310
+ def branch_exists(name: str) -> bool:
311
+ result = subprocess.run(
312
+ ["git", "-C", str(repo_path), "rev-parse", "--verify", f"refs/heads/{name}"],
313
+ capture_output=True,
314
+ text=True,
315
+ )
316
+ return result.returncode == 0
304
317
 
305
- # Branch name matches directory name for clarity
306
- branch_name = dir_name
318
+ base_dir_name = dir_name
319
+ worktree_path = worktrees_dir / dir_name
320
+ suffix = 0
307
321
 
308
- # Build the git worktree add command
309
- cmd = ["git", "-C", str(repo_path), "worktree", "add"]
322
+ while worktree_path.exists() or branch_exists(dir_name):
323
+ suffix += 1
324
+ dir_name = f"{base_dir_name}-{suffix}"
325
+ worktree_path = worktrees_dir / dir_name
310
326
 
311
- # Check if branch exists
312
- branch_check = subprocess.run(
313
- ["git", "-C", str(repo_path), "rev-parse", "--verify", f"refs/heads/{branch_name}"],
314
- capture_output=True,
315
- text=True,
316
- )
327
+ # Branch name matches directory name for clarity
328
+ branch_name = dir_name
317
329
 
318
- if branch_check.returncode == 0:
319
- # Branch exists, check it out
320
- cmd.extend([str(worktree_path), branch_name])
321
- else:
322
- # Branch doesn't exist, create it with -b
323
- cmd.extend(["-b", branch_name, str(worktree_path)])
330
+ # Build the git worktree add command.
331
+ # Branch is guaranteed not to exist (collision loop checked for it).
332
+ cmd = ["git", "-C", str(repo_path), "worktree", "add", "-b", branch_name, str(worktree_path)]
324
333
 
325
334
  result = subprocess.run(cmd, capture_output=True, text=True)
326
335
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: claude-team-mcp
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: MCP server for managing multiple Claude Code sessions via iTerm2
5
5
  Project-URL: Homepage, https://github.com/Martian-Engineering/claude-team
6
6
  Project-URL: Repository, https://github.com/Martian-Engineering/claude-team
@@ -93,7 +93,7 @@ This automatically configures the MCP server - no manual setup needed.
93
93
  Once published, install via:
94
94
 
95
95
  ```bash
96
- uvx --from claude-team-mcp claude-team
96
+ uvx --from claude-team-mcp@latest claude-team
97
97
  ```
98
98
 
99
99
  ### From Source
@@ -120,7 +120,7 @@ Add to your Claude Code MCP settings. You can configure this at:
120
120
  "mcpServers": {
121
121
  "claude-team": {
122
122
  "command": "uvx",
123
- "args": ["--from", "claude-team-mcp", "claude-team"]
123
+ "args": ["--from", "claude-team-mcp@latest", "claude-team"]
124
124
  }
125
125
  }
126
126
  }
@@ -11,7 +11,7 @@ claude_team_mcp/server.py,sha256=oOYWVJo0-P0izs1wyxeouK1MJP16-P5djRZH8trSrqM,127
11
11
  claude_team_mcp/session_state.py,sha256=OcViByS05afdiCrBNRLR9qKrAn77H-2ALTe7yHfUUDs,34837
12
12
  claude_team_mcp/subprocess_cache.py,sha256=6Q1NIMn2X5_75S4s_a9iPBka-UCz6RW0EMxPSPEaLxo,3612
13
13
  claude_team_mcp/worker_prompt.py,sha256=Cz6yByWKVLg74_Y4DiwfO1oUel0-gkHvC8RK7h1JwzM,12594
14
- claude_team_mcp/worktree.py,sha256=jFKLfNbuWnYyff08dSq_A3is5Hernew7yl5s-yx01Ko,16472
14
+ claude_team_mcp/worktree.py,sha256=s5X4mePVb4AlPzYsTklLGKgLD-4GJX1iokpsF6WwrdU,17015
15
15
  claude_team_mcp/cli_backends/__init__.py,sha256=9lpklc5lGWn-AdHoVqFMHau3UgzsN276grC1istHI2k,1038
16
16
  claude_team_mcp/cli_backends/base.py,sha256=dArm2Yqjzs3smN0JpSGR79e9I_kQYJFgQ8gYpNrmS-o,3923
17
17
  claude_team_mcp/cli_backends/claude.py,sha256=5axMph_IX-wX-DMulq0B_xQ3mVbhlwZjIi_WqjQwyL4,3268
@@ -36,7 +36,7 @@ claude_team_mcp/utils/__init__.py,sha256=_O-de711DxfMdjCAHHoifyOtzdllciE9FFV-tZ5
36
36
  claude_team_mcp/utils/constants.py,sha256=R5BRg50hAkbsZFNRZye7O8bCqsCkzMGz-re_PK14USE,2465
37
37
  claude_team_mcp/utils/errors.py,sha256=9uPFHp7UJYB5t3p7P_5Sh3PVpYh4_vj_RLzX5GcJPEU,2738
38
38
  claude_team_mcp/utils/worktree_detection.py,sha256=NfEK8c_toFiz8dqF2ht1FJzW9a9VstVm7Y5SNXvwAD8,2564
39
- claude_team_mcp-0.4.0.dist-info/METADATA,sha256=00AjFNo5EpM1L4DCeEcXrZ1YkG44tHPxHd7lBsGEIe0,15683
40
- claude_team_mcp-0.4.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
41
- claude_team_mcp-0.4.0.dist-info/entry_points.txt,sha256=cmk5dmK50RVquExT-k_J72akl3qKIerPpVqfit7kQtQ,53
42
- claude_team_mcp-0.4.0.dist-info/RECORD,,
39
+ claude_team_mcp-0.5.0.dist-info/METADATA,sha256=_hmIf5fWm2Zm-LVyuYqkoiIayPbQlb0bMPT_kCl7aJo,15697
40
+ claude_team_mcp-0.5.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
41
+ claude_team_mcp-0.5.0.dist-info/entry_points.txt,sha256=cmk5dmK50RVquExT-k_J72akl3qKIerPpVqfit7kQtQ,53
42
+ claude_team_mcp-0.5.0.dist-info/RECORD,,