feat: oversea oauth
This commit is contained in:
parent
730d229067
commit
cdd03f465d
@ -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
|
## Enable
|
||||||
|
|
||||||
Bundled plugins are disabled by default. Enable this one:
|
Bundled plugins are disabled by default. Enable this one:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
clawdbot plugins enable minimax-portal-auth
|
moltbot plugins enable minimax-portal-auth
|
||||||
```
|
```
|
||||||
|
|
||||||
Restart the Gateway after enabling.
|
Restart the Gateway after enabling.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
moltbot gateway restart
|
||||||
|
```
|
||||||
|
|
||||||
## Authenticate
|
## Authenticate
|
||||||
|
|
||||||
### Global Endpoint (global user)
|
|
||||||
|
|
||||||
Uses `api.minimax.io`:
|
|
||||||
|
|
||||||
```bash
|
```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`:
|
- **Global** - International users, optimized for overseas access (`api.minimax.io`)
|
||||||
|
- **China** - Optimized for users in China (`api.minimaxi.com`)
|
||||||
```bash
|
|
||||||
clawdbot models auth login --provider minimax-portal --auth-id oauth-cn --set-default
|
|
||||||
```
|
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- MiniMax OAuth uses a device-code login flow.
|
- MiniMax OAuth uses a device-code login flow.
|
||||||
- Tokens auto-refresh; re-run login if refresh fails or access is revoked.
|
- 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`)
|
|
||||||
|
|||||||
@ -110,7 +110,7 @@ function createOAuthHandler(region: MiniMaxRegion) {
|
|||||||
const minimaxPortalPlugin = {
|
const minimaxPortalPlugin = {
|
||||||
id: "minimax-portal-auth",
|
id: "minimax-portal-auth",
|
||||||
name: "MiniMax OAuth",
|
name: "MiniMax OAuth",
|
||||||
description: "OAuth flow for MiniMax (free-tier) models",
|
description: "OAuth flow for MiniMax models",
|
||||||
configSchema: emptyPluginConfigSchema(),
|
configSchema: emptyPluginConfigSchema(),
|
||||||
register(api) {
|
register(api) {
|
||||||
api.registerProvider({
|
api.registerProvider({
|
||||||
@ -129,7 +129,7 @@ const minimaxPortalPlugin = {
|
|||||||
{
|
{
|
||||||
id: "oauth-cn",
|
id: "oauth-cn",
|
||||||
label: "MiniMax OAuth (CN)",
|
label: "MiniMax OAuth (CN)",
|
||||||
hint: "CN endpoint - api.minimax.chat",
|
hint: "CN endpoint - api.minimaxi.com",
|
||||||
kind: "user_code",
|
kind: "user_code",
|
||||||
run: createOAuthHandler("cn"),
|
run: createOAuthHandler("cn"),
|
||||||
},
|
},
|
||||||
|
|||||||
11
extensions/minimax-portal-auth/package.json
Normal file
11
extensions/minimax-portal-auth/package.json
Normal 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
8
pnpm-lock.yaml
generated
@ -372,6 +372,8 @@ importers:
|
|||||||
specifier: ^6.16.0
|
specifier: ^6.16.0
|
||||||
version: 6.16.0(ws@8.19.0)(zod@4.3.6)
|
version: 6.16.0(ws@8.19.0)(zod@4.3.6)
|
||||||
|
|
||||||
|
extensions/minimax-portal-auth: {}
|
||||||
|
|
||||||
extensions/msteams:
|
extensions/msteams:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@microsoft/agents-hosting':
|
'@microsoft/agents-hosting':
|
||||||
@ -383,12 +385,12 @@ importers:
|
|||||||
'@microsoft/agents-hosting-extensions-teams':
|
'@microsoft/agents-hosting-extensions-teams':
|
||||||
specifier: ^1.2.2
|
specifier: ^1.2.2
|
||||||
version: 1.2.2
|
version: 1.2.2
|
||||||
moltbot:
|
|
||||||
specifier: workspace:*
|
|
||||||
version: link:../..
|
|
||||||
express:
|
express:
|
||||||
specifier: ^5.2.1
|
specifier: ^5.2.1
|
||||||
version: 5.2.1
|
version: 5.2.1
|
||||||
|
moltbot:
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../..
|
||||||
proper-lockfile:
|
proper-lockfile:
|
||||||
specifier: ^4.1.2
|
specifier: ^4.1.2
|
||||||
version: 4.1.2
|
version: 4.1.2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user