DSH HUB
首页插件商店插件包社区排行榜资源发布指南
插件源码
返回插件目录

borncode-app /

borncode-app/dsh-minimax-auth

仅 Topic 仓库

The MiniMax Code OAuth grant reader and refresher shared by dsh-minimax-credit and dsh-minimax-checkin.

★ 0 Stars0 Forks0 IssuesN/A 社区评分0 已确认安装
查看 GitHub
README来源: main@f30885f4

This repository has moved into one monorepo.

The whole MiniMax set — the credit proxy, the daily check-in, the model-list sync, the composer quota chip, the MiniMax Code bridge, and the shared grant reader — now lives in borncode-app/dsh-minimax-kit, one repository with one Plugins entry.

this repo new home
dsh-minimax-auth packages/dsh-minimax-auth
dsh-minimax-credit packages/dsh-minimax-credit
dsh-minimax-checkin packages/dsh-minimax-checkin
dsh-minimax-model-sync packages/dsh-minimax-model-sync
dsh-minimax-bridge packages/dsh-minimax-bridge
dsh-model-quota packages/dsh-model-quota

The code and its history are unchanged; only the repository is shared. Install dsh-minimax-kit instead of the individual bundles. This repository stays open so the old links keep working.

dsh-minimax-auth

The MiniMax Code OAuth grant reader and refresher, shared by dsh-minimax-credit and dsh-minimax-checkin.

Not a bundle: it declares no dsh.bundle.patch and inserts no Loader row. It is a plain library the two plugins import.

Why it exists

Both plugins borrow the same grant MiniMax Code wrote under ~/.minimax/auth/<buildEnv>/<region>/mcode-public/auth.json, and both refresh it in place. While each carried its own copy, two implementations wrote that one file: a refresh in one plugin could rotate the refresh token the other was about to use, and the second refresh then failed with invalid_grant even though the machine was still signed in.

One implementation, one code path, one place to fix.

API

export what it does
MinimaxCodeAuth reads the grant, refreshes it under MiniMax Code's own auth.lock, exposes token(), peekToken(), status(), paths()
AuthError the default error class, used when a caller passes no ErrorClass
AUTH_MESSAGES the user-facing wording, so both plugins say the same thing
numberOf, readConfig small config helpers both plugins also use
oauthAccountOrigin account.minimax.cn or account.minimax.io for a region
withAuthLock, writePrivateFile the lock and private-write primitives, exported for callers with their own store

A plugin keeps its own error class and code prefix:

import { MinimaxCodeAuth } from '@local/dsh-minimax-auth'

export class WidgetUnavailableError extends Error { /* … */ }

class WidgetAuth extends MinimaxCodeAuth {
  constructor(options) {
    super({ ...options, ErrorClass: WidgetUnavailableError, codePrefix: 'MINIMAX_WIDGET_' })
  }
}

token({ force: true }) refreshes even when the stored token still looks valid; that is what a caller does after the API answers 401 for it.

—/ 5

暂无评分

需要先验证清单

Commit f30885f4324a

社区评论

还没有评论,来写第一条。

DSH HUB

社区维护的 DSH 插件索引。不是 GitHub 或 DeepSeek AI 的官方产品。

社区资源API关于