MCPcopy Create free account
hub / github.com/GCWing/BitFun / inline_pending_text

Function inline_pending_text

src/apps/cli/src/ui/tool_cards.rs:403–445  ·  view source on GitHub ↗

Generate pending text for inline tools

(canonical: &str, tool_state: &ToolDisplayState)

Source from the content-addressed store, hash-verified

401
402/// Generate pending text for inline tools
403fn inline_pending_text(canonical: &str, tool_state: &ToolDisplayState) -> String {
404 match canonical {
405 "Read" => "Reading file...".to_string(),
406 "Write" => "Preparing write...".to_string(),
407 "Edit" => "Preparing edit...".to_string(),
408 "Delete" => "Preparing delete...".to_string(),
409 "Bash" => "Writing command...".to_string(),
410 "Grep" => "Searching content...".to_string(),
411 "Glob" => "Finding files...".to_string(),
412 "LS" => "Listing directory...".to_string(),
413 "WebSearch" => "Searching web...".to_string(),
414 "WebFetch" => "Fetching from the web...".to_string(),
415 "Task" => "Delegating...".to_string(),
416 "TodoWrite" => "Updating todos...".to_string(),
417 "HmosCompilation" => "Compiling HarmonyOS project...".to_string(),
418 "Skill" => "Loading skill...".to_string(),
419 "Git" => "Running git...".to_string(),
420 "ReadLints" => "Checking lints...".to_string(),
421 "AskUserQuestion" => "Asking questions...".to_string(),
422 "CreatePlan" => "Creating plan...".to_string(),
423 "GetFileDiff" => "Computing diff...".to_string(),
424 _ => {
425 if tool_state.tool_name.starts_with("mcp_") {
426 // Parse mcp_{server}_{tool} to show a cleaner name
427 let parts: Vec<&str> = tool_state.tool_name.splitn(3, '_').collect();
428 let tool = if parts.len() >= 3 {
429 parts[2]
430 } else {
431 &tool_state.tool_name
432 };
433 if let Some(ref msg) = tool_state.progress_message {
434 msg.clone()
435 } else {
436 format!("Running MCP tool {}...", tool)
437 }
438 } else if let Some(ref msg) = tool_state.progress_message {
439 msg.clone()
440 } else {
441 format!("Running {}...", tool_state.tool_name)
442 }
443 }
444 }
445}
446
447/// Generate complete text for inline tools
448fn inline_complete_text(canonical: &str, tool_state: &ToolDisplayState) -> String {

Callers 1

render_inline_dispatchFunction · 0.85

Calls 3

collectMethod · 0.80
lenMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected