@jovan158/vantage
Version:
See and control what your coding agent does
24 lines (23 loc) • 985 B
JavaScript
// The agents Vantage runs, keyed by the name users type.
import { claudeCode } from "./claude.js";
import { codex } from "./codex.js";
import { copilot } from "./copilot.js";
import { opencode } from "./opencode.js";
import { pi } from "./pi.js";
export const AGENTS = [claudeCode, codex, copilot, opencode, pi];
// By the name users type, or the id session logs show (`claude-code` is
// accepted too, but not advertised: one name to learn).
export function resolveAdapter(name) {
return AGENTS.find((a) => a.key === name) ?? AGENTS.find((a) => a.id === name);
}
export function knownAgents() {
return AGENTS.map((a) => a.key);
}
// How the agent is called in messages and sentences, from the id in a
// session's log (older logs name no agent: they are Claude Code's).
export function agentName(id) {
return (id && resolveAdapter(id)?.name) || (id ?? "Claude Code");
}
export function agentShort(id) {
return (id && resolveAdapter(id)?.short) || (id ?? "Claude");
}