mirror of
https://github.com/openai/codex.git
synced 2026-11-25 15:24:26 +00:00
Plugins TUI install/uninstall (#15342)
- Add install/uninstall actions to the TUI plugins menu - Wire plugin install/uninstall through both TUI and `tui_app_server` - Refresh config/plugin state after changes so the UI updates immediately - Add a post-install app setup flow for plugins that require additional app auth <img width="1567" height="300" alt="Screenshot 2026-03-20 at 4 08 44 PM" src="https://github.com/user-attachments/assets/366bd31b-2ffd-4e80-b4a3-3a9a9c674a5f" /> <img width="445" height="240" alt="Screenshot 2026-03-20 at 4 08 54 PM" src="https://github.com/user-attachments/assets/613999ab-269a-4758-ab59-7c057a1742dc" /> <img width="797" height="219" alt="Screenshot 2026-03-20 at 4 09 07 PM" src="https://github.com/user-attachments/assets/b9679e60-40f5-49bb-ade0-2e40449c3fbf" /> <img width="499" height="235" alt="Screenshot 2026-03-20 at 4 09 24 PM" src="https://github.com/user-attachments/assets/261ce2fe-f356-4e99-8ac9-f29ed850bc75" /> Note/known issue: The /plugin install flow fails in `tui_app_server` because after a successful install it tries to trigger a ReloadUserConfig operation, but `tui_app_server` has not yet implemented transport for that operation, so it falls through to the generic “Not available in app-server TUI yet” stub.
This commit is contained in:
1 parent
f55f5c258f
commit
b5d0a5518d
20 files changed
+2611
-56
No files matched your search
@@ -3584,6 +3584,24 @@ impl ChatComposer {
|
||||
|
||||
fn mention_items(&self) -> Vec<MentionItem> {
|
||||
let mut mentions = Vec::new();
|
||||
let plugin_namespaces: HashSet<String> =
|
||||
self.plugins.as_ref().map_or_else(HashSet::new, |plugins| {
|
||||
plugins
|
||||
.iter()
|
||||
.filter_map(|plugin| {
|
||||
let (plugin_name, _) = plugin
|
||||
.config_name
|
||||
.split_once('@')
|
||||
.unwrap_or((plugin.config_name.as_str(), ""));
|
||||
let plugin_name = plugin_name.trim();
|
||||
if plugin_name.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(plugin_name.to_ascii_lowercase())
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
});
|
||||
let plugin_display_names: HashSet<String> =
|
||||
self.plugins.as_ref().map_or_else(HashSet::new, |plugins| {
|
||||
plugins
|
||||
@@ -3594,6 +3612,13 @@ impl ChatComposer {
|
||||
|
||||
if let Some(skills) = self.skills.as_ref() {
|
||||
for skill in skills {
|
||||
let is_plugin_namespaced_skill =
|
||||
skill.name.split_once(':').is_some_and(|(namespace, _)| {
|
||||
plugin_namespaces.contains(&namespace.to_ascii_lowercase())
|
||||
});
|
||||
if is_plugin_namespaced_skill {
|
||||
continue;
|
||||
}
|
||||
let display_name = skill_display_name(skill).to_string();
|
||||
let description = skill_description(skill);
|
||||
let skill_name = skill.name.clone();
|
||||
@@ -5403,7 +5428,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mention_items_keep_plugin_owned_skills_but_hide_duplicate_apps() {
|
||||
fn mention_items_hide_plugin_owned_skill_and_app_duplicates() {
|
||||
let (tx, _rx) = unbounded_channel::<AppEvent>();
|
||||
let sender = AppEventSender::new(tx);
|
||||
let mut composer = ChatComposer::new(
|
||||
@@ -5465,27 +5490,13 @@ mod tests {
|
||||
}],
|
||||
}));
|
||||
|
||||
let mut mention_summaries: Vec<_> = composer
|
||||
.mention_items()
|
||||
.into_iter()
|
||||
.map(|mention| (mention.display_name, mention.category_tag, mention.path))
|
||||
.collect();
|
||||
mention_summaries.sort();
|
||||
|
||||
let mentions = composer.mention_items();
|
||||
assert_eq!(mentions.len(), 1);
|
||||
assert_eq!(mentions[0].display_name, "Google Calendar".to_string());
|
||||
assert_eq!(mentions[0].category_tag, Some("[Plugin]".to_string()));
|
||||
assert_eq!(
|
||||
mention_summaries,
|
||||
vec![
|
||||
(
|
||||
"Google Calendar".to_string(),
|
||||
Some("[Plugin]".to_string()),
|
||||
Some("plugin://google-calendar@debug".to_string()),
|
||||
),
|
||||
(
|
||||
"Google Calendar".to_string(),
|
||||
Some("[Skill]".to_string()),
|
||||
Some("/tmp/repo/google-calendar/SKILL.md".to_string()),
|
||||
),
|
||||
]
|
||||
mentions[0].path,
|
||||
Some("plugin://google-calendar@debug".to_string())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user