@team-agent/installer 0.1.0 → 0.1.1
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.
package/package.json
CHANGED
|
@@ -505,7 +505,7 @@ def handle_mcp(tools: TeamOrchestratorTools, request: dict[str, Any]) -> dict[st
|
|
|
505
505
|
"result": {
|
|
506
506
|
"protocolVersion": request.get("params", {}).get("protocolVersion", "2024-11-05"),
|
|
507
507
|
"capabilities": {"tools": {}},
|
|
508
|
-
"serverInfo": {"name": "team_orchestrator", "version": "0.1.
|
|
508
|
+
"serverInfo": {"name": "team_orchestrator", "version": "0.1.1"},
|
|
509
509
|
},
|
|
510
510
|
}
|
|
511
511
|
if method == "tools/list":
|
|
@@ -170,6 +170,8 @@ def _process_info(pid: int) -> dict[str, Any] | None:
|
|
|
170
170
|
|
|
171
171
|
def init_workspace(workspace: Path, force: bool = False) -> dict[str, Path]:
|
|
172
172
|
ensure_workspace_dirs(workspace)
|
|
173
|
+
team_dir = workspace / ".team" / "current"
|
|
174
|
+
team_dir.mkdir(parents=True, exist_ok=True)
|
|
173
175
|
spec_path = team_dir / "team.spec.yaml"
|
|
174
176
|
state_path = workspace / "team_state.md"
|
|
175
177
|
from team_agent.paths import example_path, template_path
|
|
@@ -939,10 +941,12 @@ def _attach_leader_to_state(
|
|
|
939
941
|
) -> tuple[dict[str, Any], dict[str, Any]]:
|
|
940
942
|
get_adapter(provider)
|
|
941
943
|
pane_info, discovery = _resolve_leader_pane(pane, provider, workspace=workspace, require_current=require_current)
|
|
944
|
+
inferred_provider = _leader_command_provider(pane_info.get("pane_current_command", ""))
|
|
945
|
+
receiver_provider = inferred_provider or provider
|
|
942
946
|
receiver = {
|
|
943
947
|
"mode": "direct_tmux",
|
|
944
948
|
"status": "attached",
|
|
945
|
-
"provider":
|
|
949
|
+
"provider": receiver_provider,
|
|
946
950
|
"pane_id": pane_info["pane_id"],
|
|
947
951
|
"session_name": pane_info["session_name"],
|
|
948
952
|
"window_index": pane_info["window_index"],
|
|
@@ -954,6 +958,8 @@ def _attach_leader_to_state(
|
|
|
954
958
|
"attached_at": datetime.now(timezone.utc).isoformat(),
|
|
955
959
|
"discovery": discovery,
|
|
956
960
|
}
|
|
961
|
+
if receiver_provider != provider:
|
|
962
|
+
receiver["requested_provider"] = provider
|
|
957
963
|
validation = _validate_leader_receiver(receiver)
|
|
958
964
|
if not validation["ok"]:
|
|
959
965
|
event_log.write(
|
|
@@ -978,7 +984,8 @@ def _attach_leader_to_state(
|
|
|
978
984
|
pane_index=receiver["pane_index"],
|
|
979
985
|
pane_tty=receiver["pane_tty"],
|
|
980
986
|
pane_current_command=receiver["pane_current_command"],
|
|
981
|
-
provider=
|
|
987
|
+
provider=receiver_provider,
|
|
988
|
+
requested_provider=provider if receiver_provider != provider else None,
|
|
982
989
|
discovery=discovery,
|
|
983
990
|
source=source,
|
|
984
991
|
)
|
|
@@ -3744,12 +3751,12 @@ def _resolve_leader_pane(
|
|
|
3744
3751
|
details = (
|
|
3745
3752
|
f" Current tmux client points at pane {pane_info.get('pane_id')} "
|
|
3746
3753
|
f"command={pane_info.get('pane_current_command')!r} "
|
|
3747
|
-
f"cwd={pane_info.get('pane_current_path')!r}, not
|
|
3754
|
+
f"cwd={pane_info.get('pane_current_path')!r}, not a usable pane for this workspace."
|
|
3748
3755
|
)
|
|
3749
3756
|
raise RuntimeError(
|
|
3750
3757
|
"Team Agent could not locate a tmux-managed leader pane for this workspace. "
|
|
3751
|
-
"
|
|
3752
|
-
|
|
3758
|
+
"Run quick-start from the visible tmux-managed leader pane, pass --pane explicitly, "
|
|
3759
|
+
"or use `team-agent codex`/`team-agent claude` as a convenience fallback."
|
|
3753
3760
|
+ details
|
|
3754
3761
|
)
|
|
3755
3762
|
if pane_info and workspace is None:
|
|
@@ -3822,6 +3829,7 @@ def _infer_workspace_tmux_pane(provider: str, workspace: Path) -> dict[str, Any]
|
|
|
3822
3829
|
pane
|
|
3823
3830
|
for pane in workspace_panes
|
|
3824
3831
|
if _leader_command_looks_usable(pane.get("pane_current_command", ""), provider)
|
|
3832
|
+
or _leader_command_provider(pane.get("pane_current_command", "")) is not None
|
|
3825
3833
|
]
|
|
3826
3834
|
if not candidates:
|
|
3827
3835
|
return {"status": "missing", "workspace_panes": workspace_panes}
|
|
@@ -3834,7 +3842,8 @@ def _infer_workspace_tmux_pane(provider: str, workspace: Path) -> dict[str, Any]
|
|
|
3834
3842
|
|
|
3835
3843
|
|
|
3836
3844
|
def _pane_is_usable_leader(pane: dict[str, str], provider: str, workspace: Path | None) -> bool:
|
|
3837
|
-
|
|
3845
|
+
command = pane.get("pane_current_command", "")
|
|
3846
|
+
if not _leader_command_looks_usable(command, provider) and _leader_command_provider(command) is None:
|
|
3838
3847
|
return False
|
|
3839
3848
|
if workspace is not None and not _pane_path_matches_workspace(pane, workspace):
|
|
3840
3849
|
return False
|
|
@@ -3872,6 +3881,15 @@ def _leader_command_is_exact(command: str, provider: str) -> bool:
|
|
|
3872
3881
|
return provider == "fake"
|
|
3873
3882
|
|
|
3874
3883
|
|
|
3884
|
+
def _leader_command_provider(command: str) -> str | None:
|
|
3885
|
+
command_name = Path(command).name
|
|
3886
|
+
if command_name in {"codex", "node", "nodejs"}:
|
|
3887
|
+
return "codex"
|
|
3888
|
+
if command_name in {"claude", "claude.exe"}:
|
|
3889
|
+
return "claude_code"
|
|
3890
|
+
return None
|
|
3891
|
+
|
|
3892
|
+
|
|
3875
3893
|
def _format_leader_pane_candidates(candidates: list[dict[str, str]]) -> str:
|
|
3876
3894
|
compact = []
|
|
3877
3895
|
for pane in candidates[:5]:
|