export function parseCliUserModelId(modelId) {
    const parts = modelId
        .trim()
        .split("/")
        .map((part) => part.trim());
    const provider = parts[1]?.toLowerCase();
    if (provider !== "claude" &&
        provider !== "codex" &&
        provider !== "gemini" &&
        provider !== "agent" &&
        provider !== "openclaw" &&
        provider !== "opencode" &&
        provider !== "copilot" &&
        provider !== "agy" &&
        provider !== "pi") {
        throw new Error(`Invalid CLI model id "${modelId}". Expected cli/<provider>/<model>.`);
    }
    const model = parts.slice(2).join("/").trim();
    return { provider, model: model.length > 0 ? model : null };
}
//# sourceMappingURL=cli-model-id.js.map