Execute install or uninstall for all chosen agents and integrations, printing results.
(mode: Mode, agents: list[AgentTarget], integrations: list[_Integration])
| 162 | |
| 163 | |
| 164 | def _apply(mode: Mode, agents: list[AgentTarget], integrations: list[_Integration]) -> None: |
| 165 | """Execute install or uninstall for all chosen agents and integrations, printing results.""" |
| 166 | print() |
| 167 | for agent in agents: |
| 168 | print(f" {_BOLD}{agent.display_name}{_RESET}") |
| 169 | for integ in integrations: |
| 170 | result = integ.apply(agent, mode) |
| 171 | if result is None: |
| 172 | print(f" {_DIM}– {integ.id}: not supported{_RESET}") |
| 173 | continue |
| 174 | ok = result.action in ("created", "updated", "removed", "unchanged") |
| 175 | detail = _ACTION_DETAIL.get(result.action, "") |
| 176 | suffix = f" — {detail}" if detail else "" |
| 177 | print(f" {_tick(ok)} {integ.id} ({result.action}){suffix} → {result.path}") |
| 178 | print() |
| 179 | |
| 180 | |
| 181 | def run(mode: Mode) -> None: |