@team-agent/installer 0.5.119 → 0.5.120

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.
Files changed (59) hide show
  1. package/Cargo.lock +1 -1
  2. package/Cargo.toml +1 -1
  3. package/README.md +46 -1
  4. package/README.zh.md +46 -1
  5. package/crates/team-agent/src/cli/adapters.rs +11 -0
  6. package/crates/team-agent/src/cli/arguments.rs +401 -0
  7. package/crates/team-agent/src/cli/emit.rs +241 -142
  8. package/crates/team-agent/src/cli/intent/runtime.rs +1139 -0
  9. package/crates/team-agent/src/cli/intent/runtime_tests.rs +584 -0
  10. package/crates/team-agent/src/cli/intent/tests.rs +654 -0
  11. package/crates/team-agent/src/cli/intent.rs +642 -0
  12. package/crates/team-agent/src/cli/mod.rs +49 -5
  13. package/crates/team-agent/src/cli/named_address.rs +10 -1
  14. package/crates/team-agent/src/cli/spec.rs +22 -10
  15. package/crates/team-agent/src/cli/status_port/brief.rs +117 -16
  16. package/crates/team-agent/src/cli/tests/base.rs +6 -1
  17. package/crates/team-agent/src/cli/tests/parser_safety.rs +383 -0
  18. package/crates/team-agent/src/cli/tests/run_delegation.rs +63 -19
  19. package/crates/team-agent/src/cli/tests/verb_install_skill.rs +3 -2
  20. package/crates/team-agent/src/cli/tests/verb_profile.rs +3 -1
  21. package/crates/team-agent/src/contract_runtime/backend.rs +1 -1
  22. package/crates/team-agent/src/lifecycle/launch/quick_start.rs +166 -77
  23. package/crates/team-agent/src/lifecycle/launch.rs +28 -0
  24. package/crates/team-agent/src/lifecycle/restart.rs +17 -0
  25. package/crates/team-agent/src/lifecycle/tests/acceptance_b_batch_red.rs +1 -3
  26. package/crates/team-agent/src/lifecycle/tests/behavioral_diff_264_red.rs +5 -15
  27. package/crates/team-agent/src/lifecycle/tests/claude_compatible_config_red.rs +2 -3
  28. package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +2 -3
  29. package/crates/team-agent/src/lifecycle/tests/cli_argv_routing_red.rs +10 -2
  30. package/crates/team-agent/src/lifecycle/tests/clone_agent_preserves_source_tools.rs +8 -1
  31. package/crates/team-agent/src/lifecycle/tests/clone_fork_copilot_perms_red.rs +3 -2
  32. package/crates/team-agent/src/lifecycle/tests/communication_mode_runtime_contract_red.rs +6 -9
  33. package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +7 -5
  34. package/crates/team-agent/src/lifecycle/tests/cursor_mcp_overlay.rs +4 -2
  35. package/crates/team-agent/src/lifecycle/tests/cursor_require_explicit_model_red.rs +5 -2
  36. package/crates/team-agent/src/lifecycle/tests/cursor_restart_resume_red.rs +4 -3
  37. package/crates/team-agent/src/lifecycle/tests/grok_effort_argv_red.rs +2 -4
  38. package/crates/team-agent/src/lifecycle/tests/grok_mcp_overlay_red.rs +3 -4
  39. package/crates/team-agent/src/lifecycle/tests/grok_require_explicit_model_red.rs +5 -4
  40. package/crates/team-agent/src/lifecycle/tests/grok_restart_resume_red.rs +2 -4
  41. package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +78 -36
  42. package/crates/team-agent/src/lifecycle/tests/phase_b_contracts.rs +8 -4
  43. package/crates/team-agent/src/lifecycle/tests/phase_golden.rs +6 -12
  44. package/crates/team-agent/src/lifecycle/tests/pi_fork_session_inheritance_red.rs +4 -0
  45. package/crates/team-agent/src/lifecycle/tests/startup_latency_contract.rs +1 -3
  46. package/crates/team-agent/src/lifecycle/tests/status_credential_redaction_contract.rs +7 -0
  47. package/crates/team-agent/src/lifecycle/tests/team_in_team_identity_scope_red.rs +1 -3
  48. package/crates/team-agent/src/lifecycle/tests/verify_rs031_window_consistency_red.rs +2 -1
  49. package/crates/team-agent/src/lifecycle/types.rs +10 -0
  50. package/crates/team-agent/src/tmux_backend/tests.rs +37 -0
  51. package/crates/team-agent/src/tmux_backend.rs +8 -1
  52. package/package.json +4 -4
  53. package/skills/team-agent/SKILL.md +71 -54
  54. package/skills/team-agent/command-coverage.json +283 -13
  55. package/skills/team-agent/docs/reference/team-agent-operator.md +220 -0
  56. package/skills/team-agent/references/bug-as-artifact-flow.md +1 -1
  57. package/skills/team-agent/references/recovery-runbook.md +61 -212
  58. package/skills/team-agent/references/team-agent-operator.md +181 -48
  59. package/skills/team-agent/references/team-in-team.md +47 -80
@@ -1,106 +1,73 @@
1
- # Team-In-Team Reference
2
-
3
- This reference is for explicitly requested nested Team Agent teams. Use it only when the user or leader asks a worker to create or operate a child team. For normal work, a worker should stay inside its parent team and report through `team_orchestrator`.
4
-
5
- ## Safety Rules
6
-
7
- - Use the Team Agent framework skill and `team-agent` CLI. Do not use a provider's built-in agent-team feature when the user asked for Team Agent.
8
- - Never create a child team in the parent team's `.team/current` directory.
9
- - Never edit, delete, or reuse files under the parent team's `.team/current`.
10
- - Never shut down a team just because `.team/current` is already occupied. In a nested setup, that is probably the parent team; shutting it down can kill the main node.
11
- - A child team needs its own workspace directory. The role-doc directory is not the child workspace.
12
- - The MCP surface is exactly `send_message`, `report_result`, and optional `get_team_status`; it is team-scoped. A worker must not try to widen `send_message` to another team. Lifecycle management uses the authorized native CLI.
13
-
14
- ## Child Workspace
15
-
16
- Pick an independent directory before writing `TEAM.md` or agent role docs. A safe default is a child workspace under the parent workspace, but outside the parent `.team/current`:
17
-
18
- ```bash
19
- PARENT_WORKSPACE="$PWD"
20
- case "$PARENT_WORKSPACE" in
21
- */.team/current|*/.team/current/*)
22
- echo "Refusing to create a child team from parent .team/current; cd to the parent workspace root first." >&2
23
- exit 1
24
- ;;
25
- esac
26
- CHILD_TEAM="child-review-team"
27
- CHILD_WORKSPACE="$PARENT_WORKSPACE/.team/children/review-$(date +%Y%m%d%H%M%S)"
28
- mkdir -p "$CHILD_WORKSPACE"
29
- cd "$CHILD_WORKSPACE"
30
- mkdir -p .team/current/agents
31
- ```
32
-
33
- Then create the child team's files inside the child workspace:
1
+ # Team-in-team reference
34
2
 
35
- ```bash
36
- cat > .team/current/TEAM.md <<'EOF'
37
- A bounded child team for reviewing the requested files and reporting findings.
38
- EOF
3
+ Use only when the user/Leader explicitly authorizes a child Team Agent team. Ordinary workers stay in their parent team and report through their three team-scoped MCP tools. A provider's built-in team feature is not a substitute for Team Agent.
39
4
 
40
- cat > .team/current/agents/reviewer.md <<'EOF'
41
- # Independent Reviewer
5
+ ## Protect the parent
42
6
 
43
- Review only the files and instructions provided by the child-team leader.
44
- Use `send_message` for progress and report findings with `report_result` exactly once.
45
- EOF
7
+ - Never create, reuse, edit or delete the parent team's `.team/current` as a child workspace.
8
+ - Choose an independent child workspace before writing TEAM/role files. The role directory is not the workspace.
9
+ - Never stop the parent because a name, session or directory already exists. Treat collisions as scope/refusal evidence.
10
+ - Loading a skill or receiving a task does not change caller authority. If original native caller admission refuses creation, preserve the receipt and ask the authorized Leader to bootstrap; do not spoof or clear CALLER/Leader identity, claim another pane, or copy authentication.
11
+ - MCP remains team-scoped: `send_message`, `report_result`, optional `get_team_status`. Lifecycle stays on the separately authorized public CLI.
46
12
 
47
- team-agent quick-start .team/current
48
- ```
13
+ ## Create the child through start
49
14
 
50
- If `quick-start` reports that `current` or a tmux session already exists, do not run `shutdown`. Move to a new child workspace or change the child team name.
15
+ The following paths are placeholders for a new, explicitly authorized workspace, not a command to reuse a live team:
51
16
 
52
- ## Parent Protection
53
-
54
- The parent worker is also the child team's leader. Keep the two scopes separate:
17
+ ```sh
18
+ CHILD_WORKSPACE=/absolute/new/child-workspace
19
+ CHILD_TEAM=child-review-team
20
+ mkdir -p "$CHILD_WORKSPACE/.team/current/agents"
21
+ ```
55
22
 
56
- - Parent team: the worker talks upward with its parent `team_orchestrator` MCP tools.
57
- - Child team: the same worker talks downward with `team-agent send --workspace "$CHILD_WORKSPACE" --team "$CHILD_TEAM" ...`.
23
+ Write a bounded goal in `$CHILD_WORKSPACE/.team/current/TEAM.md` and complete roles in its `agents/`. Record the user's provider and boolean bypass decisions; use the main skill's role format. Do not infer Pi/bypass or create roles from a parent's private configuration.
58
24
 
59
- Do not run child lifecycle commands against the parent workspace. Always pass the child workspace and team when operating the child team from the parent worker.
25
+ From an admitted native Leader context:
60
26
 
61
- ## Parent-Child Messaging
27
+ ```sh
28
+ team-agent start --from "$CHILD_WORKSPACE/.team/current" \
29
+ --workspace "$CHILD_WORKSPACE" --team "$CHILD_TEAM"
30
+ team-agent team status --workspace "$CHILD_WORKSPACE" --team "$CHILD_TEAM" --json
31
+ ```
62
32
 
63
- Use explicit two-hop routing.
33
+ Start creates a genuinely uninitialized complete team once. Later start can wake stopped non-paused members or prove a live no-op; it is not repair/reset and does not prove business readiness. Resolve unknown scope, drift, conflicting state or caller refusal instead of switching to an old creation command or deleting runtime files.
64
34
 
65
- Parent leader to child worker:
35
+ ## Parent-child messages are two-hop
66
36
 
67
- 1. Parent leader sends the child-task instruction to the parent worker that owns the child team.
68
- 2. Parent worker sends into the child team:
37
+ The parent worker may act as child Leader only within explicitly delegated authority. Keep the bindings separate:
38
+ 1. Parent Leader instructs the parent worker through the parent team's MCP.
39
+ 2. The admitted child Leader sends into the child using explicit workspace/team:
69
40
 
70
- ```bash
71
- team-agent send reviewer "Review this patch and report findings" \
72
- --workspace "$CHILD_WORKSPACE" \
73
- --team "$CHILD_TEAM" \
74
- --watch-result
41
+ ```sh
42
+ team-agent send reviewer "Review the requested files and report findings" \
43
+ --workspace "$CHILD_WORKSPACE" --team "$CHILD_TEAM"
44
+ team-agent inbox leader --workspace "$CHILD_WORKSPACE" --team "$CHILD_TEAM" -n 3
75
45
  ```
76
46
 
77
- Child worker to parent leader:
78
-
79
- 1. Child worker reports to its child leader:
47
+ Accepted/queued is not the child's answer. A child worker reports using its own logical MCP tools:
80
48
 
81
49
  ```text
82
- team_orchestrator.send_message(to="leader", content="short progress")
83
- team_orchestrator.report_result(summary="short completion", status="success")
50
+ send_message(to="leader", content="short progress")
51
+ report_result(summary="short completion")
84
52
  ```
85
53
 
86
- 2. The parent worker, acting as child leader, relays the relevant summary upward to the parent leader with its parent-team MCP tools.
54
+ 3. The parent worker relays the actual result upward with its **parent** MCP tools. Do not tell a child worker to address parent IDs directly or widen its MCP scope. Cross-team CLI scope selection is not a worker privilege escalation shortcut.
87
55
 
88
- Do not ask a child worker to send directly to a parent-team agent id. Current MCP scope is team-local and should refuse out-of-scope peers. Use CLI `--workspace` and `--team` only from the appropriate leader/operator side when crossing team boundaries.
56
+ ## Manage and finish only the child
89
57
 
90
- ## Clean-Context Roles
58
+ ```sh
59
+ team-agent stop reviewer --workspace "$CHILD_WORKSPACE" --team "$CHILD_TEAM"
60
+ team-agent start reviewer --workspace "$CHILD_WORKSPACE" --team "$CHILD_TEAM"
61
+ team-agent team restart --session preserve --workspace "$CHILD_WORKSPACE" --team "$CHILD_TEAM"
62
+ team-agent stop --workspace "$CHILD_WORKSPACE" --team "$CHILD_TEAM" --json
63
+ ```
91
64
 
92
- Asking for a clean-context role is a normal feature request when the user wants a blind reviewer, a fresh second opinion, or a role that forgets earlier conversation. It is not the same as failure recovery.
65
+ Use preserve when recovery must retain context; new restart otherwise defaults to auto, which can permit a legal fresh session and is not a memory guarantee. Team restart preserves explicitly stopped/paused seats; intentionally waking the roster uses team start. Unknown/partial/native unsupported outcomes are not permission to reset or fall back. Check child-owned residuals after stop; do not kill shared servers or parent resources.
93
66
 
94
- For an existing worker that should restart with a blank provider context, the leader can use:
67
+ For an intentionally clean-context worker, only after explicit approval:
95
68
 
96
- ```bash
97
- team-agent reset-agent "$AGENT_ID" --workspace "$WORKSPACE" --team "$TEAM" --discard-session --json
69
+ ```sh
70
+ team-agent agent reset "$AGENT_ID" --workspace "$CHILD_WORKSPACE" --team "$CHILD_TEAM" --discard-session --json
98
71
  ```
99
72
 
100
- Use this only when the user intentionally wants a clean context. For incident recovery, follow `recovery-runbook.md`, where context-preserving repair comes first.
101
-
102
- ## Framework Gaps To Track
103
-
104
- - Nested mode needs a way to pin the framework Team Agent skill by absolute path, so providers do not choose their built-in agent-team feature.
105
- - A child-team worker should be prevented from shutting down the parent team by mistake.
106
- - Child team creation should avoid defaulting to the fragile parent `current` directory.
73
+ This is not incident recovery; use [the recovery reference](recovery-runbook.md) for that. Legacy initial-creation, shutdown and suffixed agent commands remain compatibility bridges only; new child-team instructions use the forms above.