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 sign_in: SignIn,
22 pub chat: Chat,
23 pub review: Review,
24}
25
26#[derive(Debug, Clone, Copy, PartialEq, Eq)]
28pub enum SignIn {
29 Commands {
31 status: &'static [&'static str],
32 login: &'static [&'static str],
33 logout: &'static [&'static str],
34 },
35 Acp { login: &'static [&'static str] },
37 Terminal { command: &'static str },
39}
40
41#[derive(Debug, Clone, Copy, PartialEq, Eq)]
43pub enum Chat {
44 Native { args: &'static [&'static str] },
46 Adapter {
49 program: &'static str,
50 registry: &'static str,
51 },
52}
53
54#[derive(Debug, Clone, Copy, PartialEq, Eq)]
56pub enum Review {
57 Harness(Harness),
59 ChatOnly { reason: &'static str },
61}
62
63#[derive(Debug, Clone, Copy, PartialEq, Eq)]
65pub enum Harness {
66 ClaudeCode,
68 Codex,
70}
71
72pub const AGENTS: &[Agent] = &[
74 Agent {
75 id: "claude",
76 name: "Claude",
77 program: "claude",
78 kept_by: "Claude Code",
79 install_url: "https://docs.anthropic.com/en/docs/claude-code/setup",
80 sign_in: SignIn::Commands {
81 status: &["auth", "status", "--json"],
82 login: &["auth", "login"],
83 logout: &["auth", "logout"],
84 },
85 chat: Chat::Adapter {
86 program: "claude-agent-acp",
87 registry: "claude-acp",
88 },
89 review: Review::Harness(Harness::ClaudeCode),
90 },
91 Agent {
92 id: "codex",
93 name: "Codex",
94 program: "codex",
95 kept_by: "Codex CLI",
96 install_url: "https://developers.openai.com/codex/cli",
97 sign_in: SignIn::Commands {
98 status: &["login", "status"],
99 login: &["login"],
100 logout: &["logout"],
101 },
102 chat: Chat::Adapter {
103 program: "codex-acp",
104 registry: "codex-acp",
105 },
106 review: Review::Harness(Harness::Codex),
107 },
108 Agent {
109 id: "antigravity",
110 name: "Antigravity",
111 program: "agy",
112 kept_by: "Antigravity CLI",
113 install_url: "https://antigravity.google/",
114 sign_in: SignIn::Acp {
115 login: &["acp", "--login"],
116 },
117 chat: Chat::Native { args: &["acp"] },
118 review: Review::ChatOnly {
119 reason: "Antigravity allows no third-party harness.",
120 },
121 },
122 Agent {
123 id: "opencode",
124 name: "OpenCode",
125 program: "opencode",
126 kept_by: "OpenCode",
127 install_url: "https://opencode.ai/docs/",
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 sign_in: SignIn::Terminal {
143 command: "copilot, then /login",
144 },
145 chat: Chat::Native { args: &["--acp"] },
146 review: Review::ChatOnly {
147 reason: "artifactize has no reviewer harness for Copilot yet.",
148 },
149 },
150 Agent {
151 id: "cursor",
152 name: "Cursor",
153 program: "cursor-agent",
154 kept_by: "Cursor Agent",
155 install_url: "https://cursor.com/docs/cli/installation",
156 sign_in: SignIn::Commands {
157 status: &["status"],
158 login: &["login"],
159 logout: &["logout"],
160 },
161 chat: Chat::Native { args: &["acp"] },
162 review: Review::ChatOnly {
163 reason: "artifactize has no reviewer harness for Cursor yet.",
164 },
165 },
166 Agent {
167 id: "goose",
168 name: "Goose",
169 program: "goose",
170 kept_by: "Goose",
171 install_url: "https://block.github.io/goose/docs/getting-started/installation",
172 sign_in: SignIn::Terminal {
173 command: "goose configure",
174 },
175 chat: Chat::Native { args: &["acp"] },
176 review: Review::ChatOnly {
177 reason: "artifactize has no reviewer harness for Goose yet.",
178 },
179 },
180 Agent {
181 id: "pi",
182 name: "pi",
183 program: "pi",
184 kept_by: "pi",
185 install_url: "https://www.npmjs.com/package/@earendil-works/pi-coding-agent",
186 sign_in: SignIn::Terminal {
187 command: "pi, then /login",
188 },
189 chat: Chat::Adapter {
190 program: "pi-acp",
191 registry: "pi-acp",
192 },
193 review: Review::ChatOnly {
194 reason: "artifactize has no reviewer harness for pi yet.",
195 },
196 },
197];
198
199const FORMER_IDS: &[(&str, &str)] = &[
202 ("claude-agent", "claude"),
203 ("claude-acp", "claude"),
204 ("codex-acp", "codex"),
205];
206
207pub fn agent(id: &str) -> Option<&'static Agent> {
209 let id = FORMER_IDS
210 .iter()
211 .find_map(|(former, current)| (*former == id).then_some(*current))
212 .unwrap_or(id);
213 AGENTS.iter().find(|agent| agent.id == id)
214}
215
216pub fn reviewer(harness: Harness) -> &'static Agent {
218 AGENTS
219 .iter()
220 .find(|agent| agent.review == Review::Harness(harness))
221 .expect("every harness belongs to one built-in agent")
222}
223
224#[derive(Debug, Clone, Copy, PartialEq, Eq)]
226pub struct ApiProvider {
227 pub provider: HttpProvider,
228 pub name: &'static str,
229}
230
231pub const API_PROVIDERS: &[ApiProvider] = &[
234 ApiProvider {
235 provider: HttpProvider::Openai,
236 name: "OpenAI",
237 },
238 ApiProvider {
239 provider: HttpProvider::Anthropic,
240 name: "Anthropic",
241 },
242 ApiProvider {
243 provider: HttpProvider::Gemini,
244 name: "Gemini API",
245 },
246];
247
248#[cfg(test)]
249mod tests;