MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / execute_operation

Method execute_operation

crates/chat-cli/src/cli/chat/cli/knowledge.rs:110–132  ·  view source on GitHub ↗
(&self, os: &Os, session: &mut ChatSession)

Source from the content-addressed store, hash-verified

108 }
109
110 async fn execute_operation(&self, os: &Os, session: &mut ChatSession) -> OperationResult {
111 match self {
112 KnowledgeSubcommand::Show => {
113 match Self::handle_show(os, session).await {
114 Ok(_) => OperationResult::Info("".to_string()), // Empty Info, formatting already done
115 Err(e) => OperationResult::Error(format!("Failed to show knowledge base entries: {}", e)),
116 }
117 },
118 KnowledgeSubcommand::Add {
119 name,
120 path,
121 include,
122 exclude,
123 index_type,
124 } => Self::handle_add(os, session, name, path, include, exclude, index_type).await,
125 KnowledgeSubcommand::Remove { path } => Self::handle_remove(os, session, path).await,
126 KnowledgeSubcommand::Update { path } => Self::handle_update(os, session, path).await,
127 KnowledgeSubcommand::Clear => Self::handle_clear(os, session).await,
128 KnowledgeSubcommand::Cancel { operation_id } => {
129 Self::handle_cancel(os, session, operation_id.as_deref()).await
130 },
131 }
132 }
133
134 async fn handle_show(os: &Os, session: &mut ChatSession) -> Result<(), std::io::Error> {
135 let agent_name = Self::get_agent(session).map(|a| a.name.clone());

Callers 1

executeMethod · 0.80

Calls 2

to_stringMethod · 0.80
ErrorEnum · 0.50

Tested by

no test coverage detected