agents.ts 716 B

123456789101112131415161718192021
  1. /**
  2. * Agent catalog — client-safe metadata shared by the UI selector and the
  3. * server route. Kept free of server-only imports (harness/sandbox SDKs) so it
  4. * can be imported from client components without leaking those into the bundle.
  5. * The actual harness construction lives in `lib/agent.ts`.
  6. */
  7. export const AGENTS = {
  8. "claude-code": { label: "Claude Code" },
  9. codex: { label: "Codex" },
  10. pi: { label: "Pi" },
  11. } as const;
  12. export type AgentId = keyof typeof AGENTS;
  13. export const AGENT_IDS = Object.keys(AGENTS) as AgentId[];
  14. export const DEFAULT_AGENT_ID: AgentId = "claude-code";
  15. export function isAgentId(value: unknown): value is AgentId {
  16. return typeof value === "string" && value in AGENTS;
  17. }