feat: oversea oauth

This commit is contained in:
xiaose 2026-01-28 16:02:08 +08:00
parent 730d229067
commit cdd03f465d
4 changed files with 29 additions and 21 deletions

View File

@ -1,38 +1,33 @@
# MiniMax OAuth (Clawdbot plugin)
# MiniMax OAuth (Moltbot plugin)
OAuth provider plugin for **MiniMax** (free-tier OAuth).
OAuth provider plugin for **MiniMax** (OAuth).
## Enable
Bundled plugins are disabled by default. Enable this one:
```bash
clawdbot plugins enable minimax-portal-auth
moltbot plugins enable minimax-portal-auth
```
Restart the Gateway after enabling.
```bash
moltbot gateway restart
```
## Authenticate
### Global Endpoint (global user)
Uses `api.minimax.io`:
```bash
clawdbot models auth login --provider minimax-portal --set-default
moltbot models auth login --provider minimax-portal --set-default
```
### China Endpoint
You will be prompted to select an endpoint:
Uses `api.minimaxi.com`:
```bash
clawdbot models auth login --provider minimax-portal --auth-id oauth-cn --set-default
```
- **Global** - International users, optimized for overseas access (`api.minimax.io`)
- **China** - Optimized for users in China (`api.minimaxi.com`)
## Notes
- MiniMax OAuth uses a device-code login flow.
- Tokens auto-refresh; re-run login if refresh fails or access is revoked.
- Global endpoint: `api.minimax.io` (default)
- China endpoint: `api.minimax.chat` (use `--auth-id oauth-cn`)

View File

@ -110,7 +110,7 @@ function createOAuthHandler(region: MiniMaxRegion) {
const minimaxPortalPlugin = {
id: "minimax-portal-auth",
name: "MiniMax OAuth",
description: "OAuth flow for MiniMax (free-tier) models",
description: "OAuth flow for MiniMax models",
configSchema: emptyPluginConfigSchema(),
register(api) {
api.registerProvider({
@ -129,7 +129,7 @@ const minimaxPortalPlugin = {
{
id: "oauth-cn",
label: "MiniMax OAuth (CN)",
hint: "CN endpoint - api.minimax.chat",
hint: "CN endpoint - api.minimaxi.com",
kind: "user_code",
run: createOAuthHandler("cn"),
},

View File

@ -0,0 +1,11 @@
{
"name": "@moltbot/minimax-portal-auth",
"version": "2026.1.27",
"type": "module",
"description": "Moltbot MiniMax Portal OAuth provider plugin",
"moltbot": {
"extensions": [
"./index.ts"
]
}
}

8
pnpm-lock.yaml generated
View File

@ -372,6 +372,8 @@ importers:
specifier: ^6.16.0
version: 6.16.0(ws@8.19.0)(zod@4.3.6)
extensions/minimax-portal-auth: {}
extensions/msteams:
dependencies:
'@microsoft/agents-hosting':
@ -383,12 +385,12 @@ importers:
'@microsoft/agents-hosting-extensions-teams':
specifier: ^1.2.2
version: 1.2.2
moltbot:
specifier: workspace:*
version: link:../..
express:
specifier: ^5.2.1
version: 5.2.1
moltbot:
specifier: workspace:*
version: link:../..
proper-lockfile:
specifier: ^4.1.2
version: 4.1.2