use std::path::PathBuf;
#[cfg(test)]
use toml_edit::DocumentMut;
#[cfg(test)]
use self::model::{
ConfigScope, build_config, plugins_edit_command_for_scope, plugins_resume_command,
preview_paths, save_config,
};
use super::model;
use crate::agents::CodingAgent;
use crate::error::CliError;
#[cfg(test)]
use self::model::{
Defaults, SetupAnswers, global_config_dir, read_agents_from_doc, read_existing_defaults, reset,
write_or_merge,
};
#[cfg(test)]
use self::model::detect_installed_agents_in;
mod prompt;
pub(crate) async fn run(
agent_hint: Option<CodingAgent>,
explicit_plugin_path: Option<PathBuf>,
) -> Result<(), CliError> {
prompt::run(agent_hint, explicit_plugin_path).await
}
fn plugin_prompt_was_interrupted(error: &dialoguer::Error) -> bool {
matches!(
error,
dialoguer::Error::IO(io_error)
if matches!(
io_error.kind(),
std::io::ErrorKind::Interrupted | std::io::ErrorKind::UnexpectedEof
)
)
}
#[cfg(test)]
#[path = "../../../tests/coverage/shared/setup_tests.rs"]
mod tests;