feat: add MiniMax OAuth plugin (#4521) (thanks @Maosghoul)

This commit is contained in:
Peter Steinberger
2026-01-31 12:42:45 +01:00
parent b9b94715fa
commit 1287328b6f
21 changed files with 795 additions and 38 deletions

View File

@@ -6,6 +6,7 @@ import {
} from "./auth-choice.api-key.js";
import type { ApplyAuthChoiceParams, ApplyAuthChoiceResult } from "./auth-choice.apply.js";
import { applyDefaultModelChoice } from "./auth-choice.default-model.js";
import { applyAuthChoicePluginProvider } from "./auth-choice.apply.plugin-provider.js";
import {
applyAuthProfileConfig,
applyMinimaxApiConfig,
@@ -29,6 +30,24 @@ export async function applyAuthChoiceMiniMax(
"Model configured",
);
};
if (params.authChoice === "minimax-portal") {
// Let user choose between Global/CN endpoints
const endpoint = await params.prompter.select({
message: "Select MiniMax endpoint",
options: [
{ value: "oauth", label: "Global", hint: "OAuth for international users" },
{ value: "oauth-cn", label: "CN", hint: "OAuth for users in China" },
],
});
return await applyAuthChoicePluginProvider(params, {
authChoice: "minimax-portal",
pluginId: "minimax-portal-auth",
providerId: "minimax-portal",
methodId: endpoint,
label: "MiniMax",
});
}
if (
params.authChoice === "minimax-cloud" ||