1use crate::names::HttpProvider;
6
7#[derive(Debug, Clone, Copy, PartialEq, Eq)]
10pub struct Agent {
11 pub id: &'static str,
14 pub name: &'static str,
15 pub program: &'static str,
17 pub kept_by: &'static str,
19 pub install_url: &'static str,
21 pub update: Option<&'static [&'static str]>,
23 pub sign_in: SignIn,
24 pub chat: Chat,
25 pub review: Review,
26}
27
28#[derive(Debug, Clone, Copy, PartialEq, Eq)]
30pub enum SignIn {
31 Commands {
33 status: &'static [&'static str],
34 login: &'static [&'static str],
35 logout: &'static [&'static str],
36 },
37 Acp { login: &'static [&'static str] },
39 Terminal { command: &'static str },
41}
42
43#[derive(Debug, Clone, Copy, PartialEq, Eq)]
45pub enum Chat {
46 Native { args: &'static [&'static str] },
48 Bundled,
50}
51
52#[derive(Debug, Clone, Copy, PartialEq, Eq)]
54pub enum Review {
55 Harness(Harness),
57 ChatOnly { reason: &'static str },
59}
60
61#[derive(Debug, Clone, Copy, PartialEq, Eq)]
63pub enum Harness {
64 ClaudeCode,
66 Codex,
68}
69
70pub const AGENTS: &[Agent] = &[
72 Agent {
73 id: "claude",
74 name: "Claude",
75 program: "claude",
76 kept_by: "Claude Code",
77 install_url: "https://docs.anthropic.com/en/docs/claude-code/setup",
78 update: Some(&["update"]),
80 sign_in: SignIn::Commands {
81 status: &["auth", "status", "--json"],
82 login: &["auth", "login"],
83 logout: &["auth", "logout"],
84 },
85 chat: Chat::Bundled,
86 review: Review::Harness(Harness::ClaudeCode),
87 },
88 Agent {
89 id: "codex",
90 name: "Codex",
91 program: "codex",
92 kept_by: "Codex CLI",
93 install_url: "https://developers.openai.com/codex/cli",
94 update: Some(&["update"]),
96 sign_in: SignIn::Commands {
97 status: &["login", "status"],
98 login: &["login"],
99 logout: &["logout"],
100 },
101 chat: Chat::Bundled,
102 review: Review::Harness(Harness::Codex),
103 },
104 Agent {
105 id: "antigravity",
106 name: "Antigravity",
107 program: "agy",
108 kept_by: "Antigravity CLI",
109 install_url: "https://antigravity.google/",
110 update: Some(&["update"]),
112 sign_in: SignIn::Acp {
113 login: &["acp", "--login"],
114 },
115 chat: Chat::Native { args: &["acp"] },
116 review: Review::ChatOnly {
117 reason: "Antigravity allows no third-party harness.",
118 },
119 },
120 Agent {
121 id: "opencode",
122 name: "OpenCode",
123 program: "opencode",
124 kept_by: "OpenCode",
125 install_url: "https://opencode.ai/docs/",
126 update: Some(&["upgrade"]),
128 sign_in: SignIn::Terminal {
129 command: "opencode auth login",
130 },
131 chat: Chat::Native { args: &["acp"] },
132 review: Review::ChatOnly {
133 reason: "artifactize has no reviewer harness for OpenCode yet.",
134 },
135 },
136 Agent {
137 id: "copilot",
138 name: "Copilot",
139 program: "copilot",
140 kept_by: "GitHub Copilot CLI",
141 install_url: "https://docs.github.com/copilot/how-tos/set-up/install-copilot-cli",
142 update: Some(&["update"]),
144 sign_in: SignIn::Terminal {
145 command: "copilot, then /login",
146 },
147 chat: Chat::Native { args: &["--acp"] },
148 review: Review::ChatOnly {
149 reason: "artifactize has no reviewer harness for Copilot yet.",
150 },
151 },
152 Agent {
153 id: "cursor",
154 name: "Cursor",
155 program: "cursor-agent",
156 kept_by: "Cursor Agent",
157 install_url: "https://cursor.com/docs/cli/installation",
158 update: Some(&["update"]),
160 sign_in: SignIn::Commands {
161 status: &["status"],
162 login: &["login"],
163 logout: &["logout"],
164 },
165 chat: Chat::Native { args: &["acp"] },
166 review: Review::ChatOnly {
167 reason: "artifactize has no reviewer harness for Cursor yet.",
168 },
169 },
170 Agent {
171 id: "goose",
172 name: "Goose",
173 program: "goose",
174 kept_by: "Goose",
175 install_url: "https://block.github.io/goose/docs/getting-started/installation",
176 update: Some(&["update"]),
178 sign_in: SignIn::Terminal {
179 command: "goose configure",
180 },
181 chat: Chat::Native { args: &["acp"] },
182 review: Review::ChatOnly {
183 reason: "artifactize has no reviewer harness for Goose yet.",
184 },
185 },
186 Agent {
187 id: "pi",
188 name: "pi",
189 program: "pi",
190 kept_by: "pi",
191 install_url: "https://www.npmjs.com/package/@earendil-works/pi-coding-agent",
192 update: Some(&["update", "--self"]),
194 sign_in: SignIn::Terminal {
195 command: "pi, then /login",
196 },
197 chat: Chat::Bundled,
198 review: Review::ChatOnly {
199 reason: "artifactize has no reviewer harness for pi yet.",
200 },
201 },
202];
203
204const FORMER_IDS: &[(&str, &str)] = &[
207 ("claude-agent", "claude"),
208 ("claude-acp", "claude"),
209 ("codex-acp", "codex"),
210];
211
212pub fn agent(id: &str) -> Option<&'static Agent> {
214 let id = FORMER_IDS
215 .iter()
216 .find_map(|(former, current)| (*former == id).then_some(*current))
217 .unwrap_or(id);
218 AGENTS.iter().find(|agent| agent.id == id)
219}
220
221pub fn reviewer(harness: Harness) -> &'static Agent {
223 AGENTS
224 .iter()
225 .find(|agent| agent.review == Review::Harness(harness))
226 .expect("every harness belongs to one built-in agent")
227}
228
229#[derive(Debug, Clone, Copy, PartialEq, Eq)]
231pub struct ApiProvider {
232 pub provider: HttpProvider,
233 pub name: &'static str,
234}
235
236pub const API_PROVIDERS: &[ApiProvider] = &[
239 ApiProvider {
240 provider: HttpProvider::Openai,
241 name: "OpenAI",
242 },
243 ApiProvider {
244 provider: HttpProvider::Anthropic,
245 name: "Anthropic",
246 },
247 ApiProvider {
248 provider: HttpProvider::Gemini,
249 name: "Gemini API",
250 },
251];
252
253#[cfg(test)]
254mod tests;