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

Function resolve_exec_message

src/apps/cli/src/root_handlers.rs:75–98  ·  view source on GitHub ↗
(message: Option<String>)

Source from the content-addressed store, hash-verified

73}
74
75fn resolve_exec_message(message: Option<String>) -> Result<String> {
76 let mut combined = message.unwrap_or_default();
77 if !std::io::stdin().is_terminal() {
78 use std::io::Read;
79 let mut stdin_content = String::new();
80 std::io::stdin().read_to_string(&mut stdin_content)?;
81 let stdin_content = stdin_content.trim_end().to_string();
82 if !stdin_content.is_empty() {
83 if combined.is_empty() {
84 combined = stdin_content;
85 } else {
86 combined.push('\n');
87 combined.push_str(&stdin_content);
88 }
89 }
90 }
91
92 let message = combined.trim().to_string();
93 if message.is_empty() {
94 anyhow::bail!("Prompt cannot be empty");
95 }
96
97 Ok(message)
98}
99
100pub async fn handle_session_action(action: SessionAction) -> Result<Option<String>> {
101 let agentic_system = crate::agent::agentic_system::init_agentic_system_for_cli().await?;

Callers 1

handle_exec_commandFunction · 0.85

Calls 6

is_terminalMethod · 0.80
read_to_stringMethod · 0.80
trimMethod · 0.80
is_emptyMethod · 0.45
pushMethod · 0.45
push_strMethod · 0.45

Tested by

no test coverage detected