9ef133a8c7
Old sessions and configs reference agent names in parenthesized format like 'Sisyphus (Ultraworker)' and 'Atlas (Plan Executor)' which failed to map during migration. Added entries for all six core agents. 🤖 Generated with OhMyOpenCode assistance https://github.com/code-yeongyu/oh-my-opencode
79 lines
2.0 KiB
TypeScript
79 lines
2.0 KiB
TypeScript
export const AGENT_NAME_MAP: Record<string, string> = {
|
|
// Sisyphus variants → "sisyphus"
|
|
omo: "sisyphus",
|
|
OmO: "sisyphus",
|
|
Sisyphus: "sisyphus",
|
|
"Sisyphus (Ultraworker)": "sisyphus",
|
|
sisyphus: "sisyphus",
|
|
|
|
// Hephaestus variants → "hephaestus"
|
|
"Hephaestus (Deep Agent)": "hephaestus",
|
|
|
|
// Prometheus variants → "prometheus"
|
|
"OmO-Plan": "prometheus",
|
|
"omo-plan": "prometheus",
|
|
"Planner-Sisyphus": "prometheus",
|
|
"planner-sisyphus": "prometheus",
|
|
"Prometheus - Plan Builder": "prometheus",
|
|
"Prometheus (Plan Builder)": "prometheus",
|
|
prometheus: "prometheus",
|
|
|
|
// Atlas variants → "atlas"
|
|
"orchestrator-sisyphus": "atlas",
|
|
Atlas: "atlas",
|
|
"Atlas (Plan Executor)": "atlas",
|
|
atlas: "atlas",
|
|
|
|
// Metis variants → "metis"
|
|
"plan-consultant": "metis",
|
|
"Metis - Plan Consultant": "metis",
|
|
"Metis (Plan Consultant)": "metis",
|
|
metis: "metis",
|
|
|
|
// Momus variants → "momus"
|
|
"Momus - Plan Critic": "momus",
|
|
"Momus (Plan Critic)": "momus",
|
|
momus: "momus",
|
|
|
|
// Sisyphus-Junior → "sisyphus-junior"
|
|
"Sisyphus-Junior": "sisyphus-junior",
|
|
"sisyphus-junior": "sisyphus-junior",
|
|
|
|
// Already lowercase - passthrough
|
|
build: "build",
|
|
oracle: "oracle",
|
|
librarian: "librarian",
|
|
explore: "explore",
|
|
"multimodal-looker": "multimodal-looker",
|
|
}
|
|
|
|
export const BUILTIN_AGENT_NAMES = new Set([
|
|
"sisyphus", // was "Sisyphus"
|
|
"oracle",
|
|
"librarian",
|
|
"explore",
|
|
"multimodal-looker",
|
|
"metis", // was "Metis - Plan Consultant"
|
|
"momus", // was "Momus - Plan Critic"
|
|
"prometheus", // was "Prometheus - Plan Builder"
|
|
"atlas", // was "Atlas"
|
|
"build",
|
|
])
|
|
|
|
export function migrateAgentNames(
|
|
agents: Record<string, unknown>
|
|
): { migrated: Record<string, unknown>; changed: boolean } {
|
|
const migrated: Record<string, unknown> = {}
|
|
let changed = false
|
|
|
|
for (const [key, value] of Object.entries(agents)) {
|
|
const newKey = AGENT_NAME_MAP[key.toLowerCase()] ?? AGENT_NAME_MAP[key] ?? key
|
|
if (newKey !== key) {
|
|
changed = true
|
|
}
|
|
migrated[newKey] = value
|
|
}
|
|
|
|
return { migrated, changed }
|
|
}
|