Files
openclaw/src/commands/onboard-types.ts
liyuan97 55f47e5ce6 onboard(minimax): flatten auth to 4 direct choices, unify CN/Global under single provider (#44284)
Replace the multi-step MiniMax onboarding wizard with 4 flat options:
- MiniMax Global — OAuth (minimax.io)
- MiniMax Global — API Key (minimax.io)
- MiniMax CN — OAuth (minimaxi.com)
- MiniMax CN — API Key (minimaxi.com)

Storage changes:
- Unify CN and Global under provider "minimax" (baseUrl distinguishes region)
- Profiles: minimax:global / minimax:cn (both regions can coexist)
- Model ref: minimax/MiniMax-M2.5 (no more minimax-cn/ prefix)
- Remove LM Studio local mode and Lightning/Highspeed choice

Backward compatibility:
- Keep minimax-cn in provider-env-vars for existing configs
- Accept minimax-cn as legacy tokenProvider in CI pipelines
- Error with migration hint for removed auth choices in non-interactive mode
- Warn when dual-profile overwrites shared provider baseUrl

Made-with: Cursor
2026-03-12 11:23:42 -07:00

172 lines
4.5 KiB
TypeScript

import type { ChannelId } from "../channels/plugins/types.js";
import type { GatewayDaemonRuntime } from "./daemon-runtime.js";
export type OnboardMode = "local" | "remote";
export type AuthChoice =
// Legacy alias for `setup-token` (kept for backwards CLI compatibility).
| "oauth"
| "setup-token"
| "claude-cli"
| "token"
| "chutes"
| "vllm"
| "ollama"
| "openai-codex"
| "openai-api-key"
| "openrouter-api-key"
| "kilocode-api-key"
| "litellm-api-key"
| "ai-gateway-api-key"
| "cloudflare-ai-gateway-api-key"
| "moonshot-api-key"
| "moonshot-api-key-cn"
| "kimi-code-api-key"
| "synthetic-api-key"
| "venice-api-key"
| "together-api-key"
| "huggingface-api-key"
| "codex-cli"
| "apiKey"
| "gemini-api-key"
| "google-gemini-cli"
| "zai-api-key"
| "zai-coding-global"
| "zai-coding-cn"
| "zai-global"
| "zai-cn"
| "xiaomi-api-key"
| "minimax-global-oauth"
| "minimax-global-api"
| "minimax-cn-oauth"
| "minimax-cn-api"
| "opencode-zen"
| "opencode-go"
| "github-copilot"
| "copilot-proxy"
| "qwen-portal"
| "xai-api-key"
| "mistral-api-key"
| "volcengine-api-key"
| "byteplus-api-key"
| "qianfan-api-key"
| "modelstudio-api-key-cn"
| "modelstudio-api-key"
| "custom-api-key"
| "skip";
export type AuthChoiceGroupId =
| "openai"
| "anthropic"
| "chutes"
| "vllm"
| "ollama"
| "google"
| "copilot"
| "openrouter"
| "kilocode"
| "litellm"
| "ai-gateway"
| "cloudflare-ai-gateway"
| "moonshot"
| "zai"
| "xiaomi"
| "opencode"
| "minimax"
| "synthetic"
| "venice"
| "mistral"
| "qwen"
| "together"
| "huggingface"
| "qianfan"
| "modelstudio"
| "xai"
| "volcengine"
| "byteplus"
| "custom";
export type GatewayAuthChoice = "token" | "password";
export type ResetScope = "config" | "config+creds+sessions" | "full";
export type GatewayBind = "loopback" | "lan" | "auto" | "custom" | "tailnet";
export type TailscaleMode = "off" | "serve" | "funnel";
export type NodeManagerChoice = "npm" | "pnpm" | "bun";
export type ChannelChoice = ChannelId;
// Legacy alias (pre-rename).
export type ProviderChoice = ChannelChoice;
export type SecretInputMode = "plaintext" | "ref"; // pragma: allowlist secret
export type OnboardOptions = {
mode?: OnboardMode;
/** "manual" is an alias for "advanced". */
flow?: "quickstart" | "advanced" | "manual";
workspace?: string;
nonInteractive?: boolean;
/** Required for non-interactive onboarding; skips the interactive risk prompt when true. */
acceptRisk?: boolean;
reset?: boolean;
resetScope?: ResetScope;
authChoice?: AuthChoice;
/** Used when `authChoice=token` in non-interactive mode. */
tokenProvider?: string;
/** Used when `authChoice=token` in non-interactive mode. */
token?: string;
/** Used when `authChoice=token` in non-interactive mode. */
tokenProfileId?: string;
/** Used when `authChoice=token` in non-interactive mode. */
tokenExpiresIn?: string;
/** API key persistence mode for onboarding flows (default: plaintext). */
secretInputMode?: SecretInputMode;
anthropicApiKey?: string;
openaiApiKey?: string;
mistralApiKey?: string;
openrouterApiKey?: string;
kilocodeApiKey?: string;
litellmApiKey?: string;
aiGatewayApiKey?: string;
cloudflareAiGatewayAccountId?: string;
cloudflareAiGatewayGatewayId?: string;
cloudflareAiGatewayApiKey?: string;
moonshotApiKey?: string;
kimiCodeApiKey?: string;
geminiApiKey?: string;
zaiApiKey?: string;
xiaomiApiKey?: string;
minimaxApiKey?: string;
syntheticApiKey?: string;
veniceApiKey?: string;
togetherApiKey?: string;
huggingfaceApiKey?: string;
opencodeZenApiKey?: string;
opencodeGoApiKey?: string;
xaiApiKey?: string;
volcengineApiKey?: string;
byteplusApiKey?: string;
qianfanApiKey?: string;
modelstudioApiKeyCn?: string;
modelstudioApiKey?: string;
customBaseUrl?: string;
customApiKey?: string;
customModelId?: string;
customProviderId?: string;
customCompatibility?: "openai" | "anthropic";
gatewayPort?: number;
gatewayBind?: GatewayBind;
gatewayAuth?: GatewayAuthChoice;
gatewayToken?: string;
gatewayTokenRefEnv?: string;
gatewayPassword?: string;
tailscale?: TailscaleMode;
tailscaleResetOnExit?: boolean;
installDaemon?: boolean;
daemonRuntime?: GatewayDaemonRuntime;
skipChannels?: boolean;
/** @deprecated Legacy alias for `skipChannels`. */
skipProviders?: boolean;
skipSkills?: boolean;
skipSearch?: boolean;
skipHealth?: boolean;
skipUi?: boolean;
nodeManager?: NodeManagerChoice;
remoteUrl?: string;
remoteToken?: string;
json?: boolean;
};