(
client: ExternalAcpClient,
permission: CliAcpPermissionMode,
)
| 295 | } |
| 296 | |
| 297 | pub async fn enable_external_client( |
| 298 | client: ExternalAcpClient, |
| 299 | permission: CliAcpPermissionMode, |
| 300 | ) -> Result<()> { |
| 301 | let service = create_client_service().await?; |
| 302 | let config_json = update_client_config_json( |
| 303 | load_client_config_json(&service).await?, |
| 304 | client.id(), |
| 305 | Some(client.config()), |
| 306 | true, |
| 307 | Some(permission.to_config_mode()), |
| 308 | )?; |
| 309 | save_client_config_json(&service, &config_json).await?; |
| 310 | println!( |
| 311 | "Enabled external ACP agent '{}' with permission mode {:?}.", |
| 312 | client.id(), |
| 313 | permission |
| 314 | ); |
| 315 | Ok(()) |
| 316 | } |
| 317 | |
| 318 | pub async fn disable_external_client(client_id: &str) -> Result<()> { |
| 319 | let service = create_client_service().await?; |
no test coverage detected