import { allAgents, resolveAgentId } from "@poe-code/agent-defs";
import { getSpawnConfig } from "./index.js";
export function resolveConfig(agentId) {
    const resolvedAgentId = resolveAgentId(agentId);
    if (!resolvedAgentId) {
        throw new Error(`Unknown agent "${agentId}".`);
    }
    const agentDefinition = allAgents.find((agent) => agent.id === resolvedAgentId);
    if (!agentDefinition) {
        throw new Error(`Unknown agent "${agentId}".`);
    }
    const spawnConfig = getSpawnConfig(resolvedAgentId);
    const binaryName = agentDefinition.binaryName;
    return { agentId: resolvedAgentId, binaryName, spawnConfig };
}
