@fish-under-sea/opencode-meoo-auth 1.1.1 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -6
- package/index.mjs +48 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,30 @@ OpenCode & Magpie provider plugin for **Meoo 秒悟**(`meoo.com`)。npm 包
|
|
|
40
40
|
- **`qwen3-vl-plus` 不在网关 `/models` 里**,但 Meoo 文档给了、网关也接(实测可调)。插件拉目录时会用一次 1-token 的探针试它,接了就补进目录,否则不提——不写死一个调不通的模型。
|
|
41
41
|
- **目录里出现表外的新模型**按保守值给(200K 上下文 / 64K 输出、纯文本),不会把 1M 随手许出去;要正式支持就把它加进 `MODEL_SPECS`。
|
|
42
42
|
|
|
43
|
+
### 为什么 Kimi K3 / GLM-5.3 / MiniMax 没出现
|
|
44
|
+
|
|
45
|
+
Meoo 文档的「支持模型介绍」把 Kimi K3、Kimi K3.1 Pro、GLM-5.3、GLM-5.3-Flash、MiniMax M3.1 Flash、Qwen3.8-Max-0902 都算作平台模型,但**项目的 OpenAI 兼容网关只收这 9 个文本 id**(2026-11 实测,其余一律 400):
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
当前仅支持配置模型: qwen3.8-flash、qwen3.8-max、qwen3.7-max、qwen3.7-plus、
|
|
49
|
+
deepseek-v4.1-flash-1017、deepseek-v4-pro-0813、deepseek-v4-flash-0731、
|
|
50
|
+
glm-5.2-fast-preview、glm-5.2
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Kimi / GLM-5.3 / MiniMax 在 Meoo 的 **Agent 产品**里(`/open/v1/projects/<id>/agent/runs`,SSE 协议,不是 OpenAI 兼容),想用它们装 [`magpie-plugin-meoo-agent`](https://github.com/RexVane/magpie-plugin-meoo-agent)。两个插件可以并存:`meoo` 与 `meoo-agent` 是两个 provider id,不抢同名 key。
|
|
54
|
+
|
|
55
|
+
插件仍然会把上面这些候选逐个探一遍(并发 4 条、1 token、结果随目录缓存 10 分钟):**Meoo 哪天在网关放开哪个,下次拉目录就自动出现**,不用等发版。
|
|
56
|
+
|
|
57
|
+
### 自己加模型
|
|
58
|
+
|
|
59
|
+
网关接了但目录没列、插件也不认识的 id,用环境变量塞进去(仍然要过那一探,不接的不进目录):
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
MEOO_EXTRA_MODELS=my-model-a,my-model-b
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
未知 id 一律按 200K / 64K、纯文本处理;想给它正确的上下文,就往 `MODEL_SPECS` 里加一条。
|
|
66
|
+
|
|
43
67
|
## 余额
|
|
44
68
|
|
|
45
69
|
浏览器授权登录后,供应商卡片会带一张积分卡(控制面 `/open/v1/cli-compat/account/points`):
|
|
@@ -153,7 +177,7 @@ opencode auth login # 选 Meoo
|
|
|
153
177
|
|
|
154
178
|
```bash
|
|
155
179
|
node --check index.mjs && node --check opencode.mjs
|
|
156
|
-
node --test test/offline.test.mjs #
|
|
180
|
+
node --test test/offline.test.mjs # 23 项:假 fetch + 假 client,含浏览器 PKCE loopback 全流程
|
|
157
181
|
```
|
|
158
182
|
|
|
159
183
|
Windows 沙箱里跑测试要关掉测试隔离(沙箱禁命名管道,`spawn EPERM`):
|
|
@@ -162,14 +186,29 @@ Windows 沙箱里跑测试要关掉测试隔离(沙箱禁命名管道,`spawn
|
|
|
162
186
|
node --test --test-isolation=none test/offline.test.mjs
|
|
163
187
|
```
|
|
164
188
|
|
|
165
|
-
##
|
|
189
|
+
## 作者与致谢
|
|
190
|
+
|
|
191
|
+
### 维护
|
|
192
|
+
|
|
193
|
+
- [Fish-under-sea](https://github.com/Fish-under-sea):独立 npm 包化、仓库与发版,外层显示名(Meoo)与包名呈现,模型规格表与积分余额卡。
|
|
194
|
+
|
|
195
|
+
### 上游作者
|
|
196
|
+
|
|
197
|
+
- [Chensy(elysia395)](https://github.com/elysia395):本插件的 Magpie 供应商插件形态与实现,见 [FISH-DOCK-Plugins PR #35](https://github.com/Fish-under-sea/FISH-DOCK-Plugins/pull/35)。这个 npm 包就是该 PR 里的插件本体,作者同为上游作者之一。
|
|
198
|
+
- [2239058652/dsh-meoo-connect](https://github.com/2239058652/dsh-meoo-connect):Meoo OAuth(PKCE)、控制面(身份 / 项目 / 云服务 AK)、网关模型目录的原始实现。`index.mjs` 的登录与取 AK 链路由这里移植而来。
|
|
199
|
+
- [sangonomiya249/dsh-meoo](https://github.com/sangonomiya249/dsh-meoo)(基线 `cf77e92`):dsh-meoo-connect 的上游,版权归其作者所有。
|
|
200
|
+
- [magpie-community/plugins](https://github.com/magpie-community/plugins):`opencode2.mjs`(OpenCode 2.x 适配层)整份取自该仓库,按「每个包携带同一份字节」的约定未做修改。
|
|
201
|
+
- [yetone/magpie](https://github.com/yetone/magpie):供应商插件契约(`config` / `provider.models` / `auth`)、`magpie.name` 与预付费钱包窗口的宿主实现;「外层短名 + 详情包名」的呈现由它决定。
|
|
202
|
+
|
|
203
|
+
### 资料出处
|
|
204
|
+
|
|
205
|
+
- Meoo 秒悟官方([meoo.com](https://meoo.com) / [docs.meoo.com](https://docs.meoo.com)):AI 服务协议、模型清单,以及本包规格表里的上下文与输出上限。本项目是第三方集成,与官方无隶属关系。
|
|
166
206
|
|
|
167
|
-
|
|
168
|
-
- [Chensy(elysia395)](https://github.com/elysia395):Magpie 供应商插件形态的设计与实现,见 [FISH-DOCK-Plugins PR #35](https://github.com/Fish-under-sea/FISH-DOCK-Plugins/pull/35)。
|
|
207
|
+
### 相关但不同的项目
|
|
169
208
|
|
|
170
|
-
|
|
209
|
+
- [RexVane/magpie-plugin-meoo-agent](https://github.com/RexVane/magpie-plugin-meoo-agent):走 Meoo 的 Agent 接口(`/open/v1/projects/<id>/agent/runs`),覆盖 Kimi K3、GLM-5.3 等本插件网关调不到的模型。两者 provider id 不同(`meoo` 与 `meoo-agent`),可同时安装。
|
|
171
210
|
|
|
172
|
-
|
|
211
|
+
各上游的许可证与使用范围见 [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md)。
|
|
173
212
|
|
|
174
213
|
## License
|
|
175
214
|
|
package/index.mjs
CHANGED
|
@@ -71,12 +71,37 @@ const MODEL_SPECS = [
|
|
|
71
71
|
]
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
74
|
+
* 候选模型:文档里写了、网关 /models 却不一定列出来的 id。
|
|
75
|
+
*
|
|
76
|
+
* 2026-11 实测:Meoo 文档「支持模型介绍」把 Kimi K3 / K3.1 Pro、GLM-5.3 / 5.3-Flash、
|
|
77
|
+
* MiniMax M3.1 Flash、Qwen3.8-Max-0902 都算作平台模型,但项目的 OpenAI 兼容网关
|
|
78
|
+
* (/meoo-ai/compatible-mode/v1)只收 9 个文本 id:
|
|
79
|
+
* qwen3.8-flash、qwen3.8-max、qwen3.7-max、qwen3.7-plus、deepseek-v4.1-flash-1017、
|
|
80
|
+
* deepseek-v4-pro-0813、deepseek-v4-flash-0731、glm-5.2-fast-preview、glm-5.2
|
|
81
|
+
* 其余一律 400「当前仅支持配置模型: …」。Kimi / GLM-5.3 / MiniMax 走的是 Meoo 的
|
|
82
|
+
* Agent 产品(/open/v1/projects/<id>/agent/runs),不是这个网关——那是
|
|
83
|
+
* magpie-plugin-meoo-agent 的活。
|
|
84
|
+
*
|
|
85
|
+
* 所以这里逐个探:网关接了才进目录,不接就当它不存在。Meoo 哪天放开,插件下次
|
|
86
|
+
* 拉目录就自动带上,不需要发版。qwen3-vl-plus 就是这样被探出来的(文档写了、
|
|
87
|
+
* /models 不列、网关可调)。
|
|
78
88
|
*/
|
|
79
|
-
const SUPPLEMENT_MODELS = [
|
|
89
|
+
const SUPPLEMENT_MODELS = [
|
|
90
|
+
"qwen3-vl-plus", // 视觉理解:实测可用
|
|
91
|
+
"qwen3.8-max-0902",
|
|
92
|
+
"glm-5.3",
|
|
93
|
+
"glm-5.3-flash",
|
|
94
|
+
"kimi-k3",
|
|
95
|
+
"kimi-k3.1-pro",
|
|
96
|
+
"minimax-m3.1-flash",
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
/** 用户自己往目录里塞 id:逗号分隔。仍然要过网关那一探,不接的不进目录。 */
|
|
100
|
+
const extraModels = () =>
|
|
101
|
+
String(process.env.MEOO_EXTRA_MODELS || "")
|
|
102
|
+
.split(",")
|
|
103
|
+
.map((s) => s.trim())
|
|
104
|
+
.filter(Boolean)
|
|
80
105
|
|
|
81
106
|
const MODEL_BY_ID = new Map(MODEL_SPECS.map((m) => [m.id, m]))
|
|
82
107
|
|
|
@@ -411,6 +436,21 @@ async function acceptsModel(ak, id) {
|
|
|
411
436
|
}
|
|
412
437
|
}
|
|
413
438
|
|
|
439
|
+
/** 并发探多个 id,限速 4 条同时,别把网关打满。 */
|
|
440
|
+
async function probeModels(ak, ids) {
|
|
441
|
+
const out = []
|
|
442
|
+
const queue = [...ids]
|
|
443
|
+
const worker = async () => {
|
|
444
|
+
for (;;) {
|
|
445
|
+
const id = queue.shift()
|
|
446
|
+
if (!id) return
|
|
447
|
+
if (await acceptsModel(ak, id)) out.push(id)
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
await Promise.all(Array.from({ length: Math.min(4, ids.length) }, worker))
|
|
451
|
+
return out
|
|
452
|
+
}
|
|
453
|
+
|
|
414
454
|
async function fetchGatewayModels(ak) {
|
|
415
455
|
const base = gatewayBase()
|
|
416
456
|
if (catalogCache.models && catalogCache.origin === base && Date.now() - catalogCache.at < CATALOG_TTL_MS) {
|
|
@@ -424,9 +464,9 @@ async function fetchGatewayModels(ak) {
|
|
|
424
464
|
const models = parseGatewayModels(await res.json())
|
|
425
465
|
if (!models.length) throw new Error("empty catalog")
|
|
426
466
|
const seen = new Set(models.map((m) => m.id))
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
467
|
+
// 文档里有、目录里没有的 id 逐个探;接了就补进目录,不接的不进。
|
|
468
|
+
const missing = [...new Set([...SUPPLEMENT_MODELS, ...extraModels()])].filter((id) => !seen.has(id))
|
|
469
|
+
for (const id of await probeModels(ak, missing)) {
|
|
430
470
|
const spec = specOf(id)
|
|
431
471
|
models.push({ id, name: spec.name, context: spec.context, output: spec.output, image: !!spec.image })
|
|
432
472
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fish-under-sea/opencode-meoo-auth",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Meoo 秒悟 (meoo.com) in OpenCode and Magpie: PKCE sign-in, reuse of a local dsh-meoo-connect state or a project service AK, a live catalog with each model's real context window, and the account's points balance",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./opencode.mjs",
|