feat(swarm): muxa swarm — a fleet command center that dispatches work#65
Open
jiunbae wants to merge 1 commit into
Open
feat(swarm): muxa swarm — a fleet command center that dispatches work#65jiunbae wants to merge 1 commit into
jiunbae wants to merge 1 commit into
Conversation
`muxa swarm` is a fullscreen TUI that steps up from per-session views to a
fleet-level command center: every tracked agent is a node in a swarm,
clustered by project (cwd) or tmux session, rendered as a state-colored map
with a live fleet-status readout. It carries muxa's signature violet brand
accent (unifying the CLI with the BarShelf widget).
Beyond observing, it dispatches work:
- Enter / p compose a prompt for the selected agent
- b broadcast one prompt to a marked squad (Space to mark), or to
every input-blocked agent when nothing is marked
- x / K abort the current turn / terminate, behind a confirm popup
- o jump to the selected tmux pane on exit
Dispatch reuses the existing trusted side effects rather than reinventing
them: tmux `send-keys` via `watch::dispatch_quick_action` for pane agents,
and IPC `write_session` / `terminate_session` for muxa-owned PTY sessions.
No new dependencies.
Pure board/target logic (`build_swarm_data`, `broadcast_targets`,
`DispatchTarget::for_agent`) is factored out and unit-tested (9 tests):
fleet tally, paneless filtering, project grouping, urgency sort, broadcast
target resolution, PTY-over-pane routing, width-aware truncation.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
muxa swarm, a fullscreen TUI that steps up from muxa's per-session views (watch,dashboard) to a fleet-level command center. This is the first concrete step in the "agent + tmux helper → agent swarm manager" repositioning: the dashboard/TUIs were observation-only;swarmadds command.Every tracked agent becomes a node in a swarm map, clustered by project (cwd) or tmux session, rendered as a state-colored grid with a live fleet-status readout (
● working ▶ input ◆ choice ■ error … N need you). It wears muxa's signature violet brand accent, unifying the CLI with the BarShelf menu-bar widget.Dispatch — you can give the swarm work
Enter/pbSpaceto mark), or to every input-blocked agent when nothing is markedx/KogTabjumps clusters ·?helpDispatch reuses the existing trusted side effects rather than reinventing them:
send-keysviawatch::dispatch_quick_actionfor pane agentswrite_session/terminate_sessionfor muxa-owned PTY sessionsPTY surfaces win over the legacy
panefield so apty:*agent is never driven as a tmux pane it doesn't own. No new dependencies.Design
Pure board/target logic is factored out of the TUI so it's testable without a daemon or terminal:
build_swarm_data— snapshot → clustered, urgency-sorted board + fleet tallybroadcast_targets— marked squad, else the input-blocked setDispatchTarget::for_agent— PTY-over-pane routingTesting
cargo test --workspace— green (unit + e2e once bins are built)cargo clippy --workspace --all-targets -- -D warnings— clean (incl. pedantic)cargo fmt --all -- --check— cleanNotes / follow-ups
muxa dashboard); a push-basedsubscribe()stream is a natural follow-up.SpawnSession), a task/goal queue, and a web-dashboard swarm map with the same violet identity.🤖 Generated with Claude Code