feat(#1082): add description() to ToolGroup + Capability; expose in API + UI tooltips

- hive-sh4re: ToolGroup::description() and Capability::description() return
  short human-readable strings for each variant
- hive-c0re: ToolGroupsSnapshot and CapabilitiesSnapshot now include a
  `descriptions` map (name → description); get_capabilities now iterates
  Capability::ALL instead of hardcoding the list
- tabs.js: renderToolGroups + renderCapabilities use descriptions[name] as
  the column header title attribute (native browser tooltip on hover)
This commit is contained in:
iris 2026-06-02 12:50:19 +02:00
commit 2368bec634
3 changed files with 62 additions and 6 deletions

View file

@ -876,6 +876,30 @@ impl ToolGroup {
Self::WebTools => "web_tools",
}
}
/// Short human-readable description suitable for a tooltip or help text.
#[must_use]
pub fn description(self) -> &'static str {
match self {
Self::Messaging => "send, recv, ask, answer — core agent communication",
Self::Meta => "set_status, get_agent_meta — identity and status",
Self::Inbox => {
"get_loose_ends, cancel_loose_end, remind, request_next_turn — self-scheduling"
}
Self::Lifecycle => "kill, start, restart, update — container lifecycle (privileged)",
Self::Approvals => {
"request_init_config, request_apply_commit, request_update_meta_inputs — config change flow (privileged)"
}
Self::Scheduling => {
"request_schedule_prompt and related — operator-visible scheduled prompts (privileged)"
}
Self::Diagnostics => "get_logs — read host journal and build logs (privileged)",
Self::Execution => "bash_run, bash_status — run shell commands in the container",
Self::WebTools => {
"WebFetch, WebSearch — Claude built-in web egress; not MCP tools"
}
}
}
}
/// Per-agent capability grants. Stored in `meta/capabilities.json`
@ -962,6 +986,20 @@ impl Capability {
Self::QueryAgentState => "query_agent_state",
}
}
/// Short human-readable description suitable for a tooltip or help text.
#[must_use]
pub fn description(self) -> &'static str {
match self {
Self::ManageRootAgent => {
"lifecycle-manage the root/manager agent on hive crash recovery"
}
Self::ReadHostJournal => "read host journald via get_host_journal MCP tool",
Self::QueryAgentState => {
"query non-child agents' loose ends and reminder state via get_loose_ends"
}
}
}
}
/// Schedule row shape on the wire — mirror of