use crate::names::HttpProvider;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Agent {
pub id: &'static str,
pub name: &'static str,
pub program: &'static str,
pub kept_by: &'static str,
pub install_url: &'static str,
pub update: Option<&'static [&'static str]>,
pub sign_in: SignIn,
pub chat: Chat,
pub review: Review,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SignIn {
Commands {
status: &'static [&'static str],
login: &'static [&'static str],
logout: &'static [&'static str],
},
Acp { login: &'static [&'static str] },
Terminal { command: &'static str },
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Chat {
Native { args: &'static [&'static str] },
Bundled,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Review {
Harness(Harness),
ChatOnly { reason: &'static str },
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Harness {
ClaudeCode,
Codex,
}
pub const AGENTS: &[Agent] = &[
Agent {
id: "claude",
name: "Claude",
program: "claude",
kept_by: "Claude Code",
install_url: "https://docs.anthropic.com/en/docs/claude-code/setup",
update: Some(&["update"]),
sign_in: SignIn::Commands {
status: &["auth", "status", "--json"],
login: &["auth", "login"],
logout: &["auth", "logout"],
},
chat: Chat::Bundled,
review: Review::Harness(Harness::ClaudeCode),
},
Agent {
id: "codex",
name: "Codex",
program: "codex",
kept_by: "Codex CLI",
install_url: "https://developers.openai.com/codex/cli",
update: Some(&["update"]),
sign_in: SignIn::Commands {
status: &["login", "status"],
login: &["login"],
logout: &["logout"],
},
chat: Chat::Bundled,
review: Review::Harness(Harness::Codex),
},
Agent {
id: "antigravity",
name: "Antigravity",
program: "agy",
kept_by: "Antigravity CLI",
install_url: "https://antigravity.google/",
update: Some(&["update"]),
sign_in: SignIn::Acp {
login: &["acp", "--login"],
},
chat: Chat::Native { args: &["acp"] },
review: Review::ChatOnly {
reason: "Antigravity allows no third-party harness.",
},
},
Agent {
id: "opencode",
name: "OpenCode",
program: "opencode",
kept_by: "OpenCode",
install_url: "https://opencode.ai/docs/",
update: Some(&["upgrade"]),
sign_in: SignIn::Terminal {
command: "opencode auth login",
},
chat: Chat::Native { args: &["acp"] },
review: Review::ChatOnly {
reason: "artifactize has no reviewer harness for OpenCode yet.",
},
},
Agent {
id: "copilot",
name: "Copilot",
program: "copilot",
kept_by: "GitHub Copilot CLI",
install_url: "https://docs.github.com/copilot/how-tos/set-up/install-copilot-cli",
update: Some(&["update"]),
sign_in: SignIn::Terminal {
command: "copilot, then /login",
},
chat: Chat::Native { args: &["--acp"] },
review: Review::ChatOnly {
reason: "artifactize has no reviewer harness for Copilot yet.",
},
},
Agent {
id: "cursor",
name: "Cursor",
program: "cursor-agent",
kept_by: "Cursor Agent",
install_url: "https://cursor.com/docs/cli/installation",
update: Some(&["update"]),
sign_in: SignIn::Commands {
status: &["status"],
login: &["login"],
logout: &["logout"],
},
chat: Chat::Native { args: &["acp"] },
review: Review::ChatOnly {
reason: "artifactize has no reviewer harness for Cursor yet.",
},
},
Agent {
id: "goose",
name: "Goose",
program: "goose",
kept_by: "Goose",
install_url: "https://block.github.io/goose/docs/getting-started/installation",
update: Some(&["update"]),
sign_in: SignIn::Terminal {
command: "goose configure",
},
chat: Chat::Native { args: &["acp"] },
review: Review::ChatOnly {
reason: "artifactize has no reviewer harness for Goose yet.",
},
},
Agent {
id: "pi",
name: "pi",
program: "pi",
kept_by: "pi",
install_url: "https://www.npmjs.com/package/@earendil-works/pi-coding-agent",
update: Some(&["update", "--self"]),
sign_in: SignIn::Terminal {
command: "pi, then /login",
},
chat: Chat::Bundled,
review: Review::ChatOnly {
reason: "artifactize has no reviewer harness for pi yet.",
},
},
];
const FORMER_IDS: &[(&str, &str)] = &[
("claude-agent", "claude"),
("claude-acp", "claude"),
("codex-acp", "codex"),
];
pub fn agent(id: &str) -> Option<&'static Agent> {
let id = FORMER_IDS
.iter()
.find_map(|(former, current)| (*former == id).then_some(*current))
.unwrap_or(id);
AGENTS.iter().find(|agent| agent.id == id)
}
pub fn reviewer(harness: Harness) -> &'static Agent {
AGENTS
.iter()
.find(|agent| agent.review == Review::Harness(harness))
.expect("every harness belongs to one built-in agent")
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ApiProvider {
pub provider: HttpProvider,
pub name: &'static str,
}
pub const API_PROVIDERS: &[ApiProvider] = &[
ApiProvider {
provider: HttpProvider::Openai,
name: "OpenAI",
},
ApiProvider {
provider: HttpProvider::Anthropic,
name: "Anthropic",
},
ApiProvider {
provider: HttpProvider::Gemini,
name: "Gemini API",
},
];
#[cfg(test)]
mod tests;