| refactor(agent_teams): collapse run_agent_team to spec-only facade
Collapse the 4-way Union[str, BaseTeam, BaseAgent, TeamAgentSpec]
input on Runner.run_agent_team* into a single facade with a
keyword-only base: bool = False flag:
- base=False (default): TeamAgent path, accepts str | TeamAgentSpec.
str is a team_name shorthand resolved through the pool; first call
must seed the pool with a spec.
- base=True: BaseTeam path, accepts str | BaseTeam, str resolves
through Runner.resource_mgr.
Already-built TeamAgent / BaseAgent instances are no longer accepted
on the public surface. Spawn-side code goes through an internal
_run_team_member helper that skips manager.activate and stays out
of the pool, preserving the leader-only pool invariant.
Drop the dual register_instance write semantics — TeamAgentSpec →
manager.activate is the only path in. Mark instance-side
run_base_team* as internal (_run_base_team*) since the facade is
the sole caller.
Interactive e2e scripts now drive Runner entries with the spec
directly instead of build()-then-re-extract; add an
on_runtime_ready hook on consume_stream / run_interactive so
callers can wire facade-bound listeners after the pool entry lands.
Tests, examples and CLAUDE.md docs updated to match.
Refs: #751
| 29 天前 |