diff --git a/apps/server/src/agents/types.ts b/apps/server/src/agents/types.ts index 0871f329..f2c74cd5 100644 --- a/apps/server/src/agents/types.ts +++ b/apps/server/src/agents/types.ts @@ -7,7 +7,10 @@ export type AgentStatus = | "error" | "unknown"; -export type AgentType = "codex" | "claude" | "opencode" | "cursor" | "terminal"; +// Re-exported so the ~15 modules that already import AgentType from here keep +// working, while the member list itself lives in one place. +export type { AgentType } from "../shared/agent-types.js"; +import type { AgentType } from "../shared/agent-types.js"; export type AgentRole = "standard" | "review" | "assisted_update"; diff --git a/apps/server/src/shared/mcp/crud-tools.ts b/apps/server/src/shared/mcp/crud-tools.ts index 68e23024..7a4bc9bd 100644 --- a/apps/server/src/shared/mcp/crud-tools.ts +++ b/apps/server/src/shared/mcp/crud-tools.ts @@ -2,7 +2,11 @@ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import * as z from "zod/v4"; import { describeAgentModelCatalog } from "../agent-models.js"; -import type { AgentType } from "../agent-types.js"; +import { + AGENT_TYPES, + CLI_AGENT_TYPES, + type AgentType, +} from "../agent-types.js"; import { parseTemplateArgs } from "../../templates/arg-parser.js"; import type { TemplateRecord } from "../../templates/store.js"; import { jsonText } from "./response.js"; @@ -78,8 +82,10 @@ function toWriteAck(record: unknown) { }; } -const JOB_AGENT_TYPES = ["claude", "codex", "opencode", "cursor"] as const; -const TEMPLATE_AGENT_TYPES = [...JOB_AGENT_TYPES, "terminal"] as const; +// Jobs run an AI CLI, so they take the CLI subset; templates also back terminal +// agents, so they take the full table. Both are aliases of the shared tables. +const JOB_AGENT_TYPES = CLI_AGENT_TYPES; +const TEMPLATE_AGENT_TYPES = AGENT_TYPES; const jobAgentTypeEnum = z.enum(JOB_AGENT_TYPES); const templateAgentTypeEnum = z.enum(TEMPLATE_AGENT_TYPES); diff --git a/apps/server/src/shared/mcp/persona-interaction-tools.ts b/apps/server/src/shared/mcp/persona-interaction-tools.ts index 387b8be0..d156d503 100644 --- a/apps/server/src/shared/mcp/persona-interaction-tools.ts +++ b/apps/server/src/shared/mcp/persona-interaction-tools.ts @@ -20,18 +20,16 @@ import { validatePersonas, } from "../../personas/authoring.js"; import { describeAgentModelCatalog } from "../agent-models.js"; +import { CLI_AGENT_TYPES, type CliAgentType } from "../agent-types.js"; import type { McpRequestContext } from "./server.js"; import { jsonText } from "./response.js"; import { toToolError } from "./tool-error.js"; -export const LAUNCH_PERSONA_AGENT_TYPES = [ - "claude", - "codex", - "cursor", - "opencode", -] as const; -export type LaunchPersonaAgentType = - (typeof LAUNCH_PERSONA_AGENT_TYPES)[number]; +// A persona launch runs an AI CLI, so it takes the shared CLI subset. Aliased +// rather than re-exported directly because both names are already part of this +// module's surface (server.ts imports the type). +export const LAUNCH_PERSONA_AGENT_TYPES = CLI_AGENT_TYPES; +export type LaunchPersonaAgentType = CliAgentType; export type PersonaInteractionCallbacks = { agentId: string;