feat: minimax oauth
This commit is contained in:
1 parent
6859e1e6a6
commit
ec2306371f
8 files changed
+368
-1
No files matched your search
@@ -269,6 +269,10 @@ export function resolveEnvApiKey(provider: string): EnvApiKeyResult | null {
|
||||
return pick("QWEN_OAUTH_TOKEN") ?? pick("QWEN_PORTAL_API_KEY");
|
||||
}
|
||||
|
||||
if (normalized === "minimax-portal") {
|
||||
return pick("MINIMAX_OAUTH_TOKEN") ?? pick("MINIMAX_API_KEY");
|
||||
}
|
||||
|
||||
const envMap: Record<string, string> = {
|
||||
openai: "OPENAI_API_KEY",
|
||||
google: "GEMINI_API_KEY",
|
||||
|
||||
@@ -53,7 +53,7 @@ const AUTH_CHOICE_GROUP_DEFS: {
|
||||
value: "minimax",
|
||||
label: "MiniMax",
|
||||
hint: "M2.1 (recommended)",
|
||||
choices: ["minimax-api", "minimax-api-lightning"],
|
||||
choices: ["minimax-api", "minimax-api-lightning","minimax-portal"],
|
||||
},
|
||||
{
|
||||
value: "qwen",
|
||||
@@ -219,6 +219,7 @@ export function buildAuthChoiceOptions(params: {
|
||||
hint: "Uses the bundled Gemini CLI auth plugin",
|
||||
});
|
||||
options.push({ value: "zai-api-key", label: "Z.AI (GLM 4.7) API key" });
|
||||
options.push({ value: "minimax-portal", label: "MiniMax OAuth" });
|
||||
options.push({ value: "qwen-portal", label: "Qwen OAuth" });
|
||||
options.push({
|
||||
value: "copilot-proxy",
|
||||
|
||||
@@ -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,
|
||||
@@ -27,6 +28,15 @@ export async function applyAuthChoiceMiniMax(
|
||||
"Model configured",
|
||||
);
|
||||
};
|
||||
if (params.authChoice === "minimax-portal") {
|
||||
return await applyAuthChoicePluginProvider(params, {
|
||||
authChoice: "minimax-portal",
|
||||
pluginId: "minimax-portal-auth",
|
||||
providerId: "minimax-portal",
|
||||
methodId: "device",
|
||||
label: "MiniMax",
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
params.authChoice === "minimax-cloud" ||
|
||||
|
||||
@@ -27,6 +27,7 @@ export type AuthChoice =
|
||||
| "minimax"
|
||||
| "minimax-api"
|
||||
| "minimax-api-lightning"
|
||||
| "minimax-portal"
|
||||
| "opencode-zen"
|
||||
| "github-copilot"
|
||||
| "copilot-proxy"
|
||||
|
||||
Reference in new issue
Block a user