Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/server/src/agents/types.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";

Expand Down
12 changes: 9 additions & 3 deletions apps/server/src/shared/mcp/crud-tools.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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);
Expand Down
14 changes: 6 additions & 8 deletions apps/server/src/shared/mcp/persona-interaction-tools.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
Expand Down
Loading