feat(tui) render request_permissions calls (#14004)

## Summary
Adds support for tui rendering of request_permission calls

<img width="724" height="245" alt="Screenshot 2026-03-08 at 9 04 07 PM"
src="https://github.com/user-attachments/assets/e1997825-a496-4bfb-bbda-43d0006460a5"
/>


## Testing
- [x] Added snapshot test
This commit is contained in:
Dylan Hurd authored and GitHub committed 2026-03-09 04:24:04 +00:00
1 parent 05332b0e96
commit 06f82c123c
8 files changed
+305 -3

No files matched your search

+33
View File
@@ -1171,6 +1171,15 @@ impl App {
))
}
}
EventMsg::RequestPermissions(ev) => Some(ThreadInteractiveRequest::Approval(
ApprovalRequest::Permissions {
thread_id,
thread_label,
call_id: ev.call_id.clone(),
reason: ev.reason.clone(),
permissions: ev.permissions.clone(),
},
)),
_ => None,
}
}
@@ -3237,6 +3246,30 @@ impl App {
"E X E C".to_string(),
));
}
ApprovalRequest::Permissions {
permissions,
reason,
..
} => {
let _ = tui.enter_alt_screen();
let mut lines = Vec::new();
if let Some(reason) = reason {
lines.push(Line::from(vec!["Reason: ".into(), reason.italic()]));
lines.push(Line::from(""));
}
if let Some(rule_line) =
crate::bottom_pane::format_additional_permissions_rule(&permissions)
{
lines.push(Line::from(vec![
"Permission rule: ".into(),
rule_line.cyan(),
]));
}
self.overlay = Some(Overlay::new_static_with_renderables(
vec![Box::new(Paragraph::new(lines).wrap(Wrap { trim: false }))],
"P E R M I S S I O N S".to_string(),
));
}
ApprovalRequest::McpElicitation {
server_name,
message,