From a5a3eed6d8d4ac8dc74dad8603b4d63555c184b1 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Tue, 25 Aug 2026 10:58:37 -0600 Subject: [PATCH] fix(repl): offer prompts in .list tab completion and rename its listing helpers MCP prompts are live, server-owned catalog entries, not managed assets; list_prompt_assets/prompt_asset_rows implied otherwise and are now list_mcp_prompts/mcp_prompt_rows. The .list completer was also missing the prompts kind that the usage string and unknown-kind error advertise. --- src/config/request_context.rs | 11 ++++++----- src/repl/mod.rs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/config/request_context.rs b/src/config/request_context.rs index 9159318..4a76952 100644 --- a/src/config/request_context.rs +++ b/src/config/request_context.rs @@ -164,7 +164,7 @@ pub(crate) fn asset_table(header: &[&str]) -> Table { table } -fn prompt_asset_rows(items: &[CatalogItem]) -> Vec<[String; 4]> { +fn mcp_prompt_rows(items: &[CatalogItem]) -> Vec<[String; 4]> { items .iter() .map(|item| { @@ -3386,6 +3386,7 @@ impl RequestContext { "rags", "macros", "skills", + "prompts", "tools", "mcp-servers", "bundles", @@ -3727,7 +3728,7 @@ impl RequestContext { .prompt_completion(&enabled_ids, args) } - pub async fn list_prompt_assets(&self) -> Result<()> { + pub async fn list_mcp_prompts(&self) -> Result<()> { let items = self.tool_scope.mcp_runtime.prompt_catalog().await; if items.is_empty() { println!("No prompts found."); @@ -3735,7 +3736,7 @@ impl RequestContext { } let mut table = asset_table(&["server", "name", "description", "args"]); - for row in prompt_asset_rows(&items) { + for row in mcp_prompt_rows(&items) { table.add_row(row.to_vec()); } @@ -4867,7 +4868,7 @@ mod tests { } #[test] - fn prompt_asset_rows_assembles_columns() { + fn mcp_prompt_rows_assembles_columns() { let items = vec![ CatalogItem { name: "summarize".to_string(), @@ -4886,7 +4887,7 @@ mod tests { }, ]; - let rows = prompt_asset_rows(&items); + let rows = mcp_prompt_rows(&items); assert_eq!(rows.len(), 2); assert_eq!( diff --git a/src/repl/mod.rs b/src/repl/mod.rs index 95a04e3..a31b87b 100644 --- a/src/repl/mod.rs +++ b/src/repl/mod.rs @@ -1251,7 +1251,7 @@ pub async fn run_repl_command( }, ".list" => match args.map(str::trim) { Some("prompts") => { - ctx.list_prompt_assets().await?; + ctx.list_mcp_prompts().await?; } Some(args) => { ctx.list_assets(args)?;