Expand description
Agent inventory + target validation for the supervisor /agents and
/tell routing commands.
The inventory is composed from two sources (design D1):
- broker
GET /status—branch_id,status,last_seen,cli; tmux list-paneswithpane_current_path— the livebranch_id → pane_indexmapping (v0.5.0 doctrine: never assume pane index ordering; resolve via the worktree path).
The join, mode detection, target validation, and the freshness cache are
all factored as library functions (design D6) so the v0.6.0 consumer (the
/tell skill) and future consumers — notably the v1.0.0 MCP write tools’
publish_agent_feedback — share one inventory + validation shape rather
than re-implementing it.
Structs§
- Agent
Entry - One agent’s inventory record.
- Agent
Inventory - A point-in-time inventory snapshot.
- Inventory
Cache - In-memory inventory cache with a freshness window (design D2).
- Status
Agent - One agent row parsed from the broker
/statusJSON.
Enums§
- Mode
- Best-effort detected interaction mode of an agent’s CLI pane.
- Validation
Error - Rejection returned by
validate_targetfor an unknown target.
Functions§
- build_
inventory - Builds an inventory snapshot from the live broker and tmux session.
- detect_
mode - Best-effort mode detection from an agent pane’s title and recent capture.
- fetch_
status_ agents_ over_ http - Fetches and parses the broker
GET /statusagent list over HTTP. - join_
inventory - Joins broker status rows with the tmux pane mapping and per-pane detected modes into inventory entries.
- match_
pane - Resolves the pane index for
agent_idfrom thepane_current_pathmapping, per the v0.5.0 doctrine (match on the worktree path, never on index ordering). - parse_
pane_ paths - Parses
tmux list-panes -F '#{pane_index} #{pane_current_path}'output into(pane_index, current_path)pairs. - parse_
status_ agents - Parses the broker
GET /statusJSON body into agent rows. - validate_
target - Validates a
/telltarget against the inventory.