magpie-plugin-loomy-auth 0.1.11 → 0.1.13
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/NOTICE.md +35 -35
- package/README.md +43 -0
- package/package.json +1 -1
package/NOTICE.md
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
# NOTICE
|
|
2
|
-
|
|
3
|
-
本插件的实现参考了以下来源。按各自的许可要求在此声明。
|
|
4
|
-
|
|
5
|
-
## magpie 插件契约
|
|
6
|
-
|
|
7
|
-
- **yetone/magpie** — Copyright (c) 2026 yetone, MIT License
|
|
8
|
-
- `src/pure.mjs` 里 `auth.usage` 的 windows 字段形状、`used` 的归一化行为、
|
|
9
|
-
`aside` 的语义、签到 `outcome` 的合法值清单、`client.auth.set` 的整体替换
|
|
10
|
-
(而非合并)语义,均取自 magpie 二进制内嵌的插件契约源码。
|
|
11
|
-
- `free` 字段的判据取自其路由模式说明("Free first"):模型供应商是否
|
|
12
|
-
**不消耗本订阅的额度或积分**。
|
|
13
|
-
|
|
14
|
-
## Loomy(讯飞)协议实现
|
|
15
|
-
|
|
16
|
-
- **sucooer / anyaer 的 `magpie-plugin-loomy`**(`github.com/sucooer/magpie-plugins`, MIT)
|
|
17
|
-
- `src/crypto.mjs` + `src/pure.mjs` 的 `signedHeaders`:账号接口的 HMAC-SHA1
|
|
18
|
-
待签串构造(9 段 `\n` 连接)、路径分段转义规则。
|
|
19
|
-
- `src/desktop.mjs`:Loomy 桌面端登录态的 leveldb 读取方式(键名
|
|
20
|
-
`loomy-auth-session`、追加写所以从后往前找)。
|
|
21
|
-
|
|
22
|
-
- **agent2api**(`loomy/sign.rs`, `loomy/images.rs`)
|
|
23
|
-
- deepseek 系模型只认 `<image_base64>` 标记、不认 `image_url` data URI 的结论,
|
|
24
|
-
以及把标记并入相邻 text 块的做法。
|
|
25
|
-
|
|
26
|
-
## 与上述实现的差异
|
|
27
|
-
|
|
28
|
-
本插件的额度上报口径与它们**不同**:市场现有实现不上报 `used`(或在拿不到上限时
|
|
29
|
-
上报 0),导致 magpie 把被蹬空的账号排在路由队首。本插件上报真实占比、把永久池
|
|
30
|
-
标为 `aside`、并在两池皆空时合成一条 `used: 100` 的参与路由窗口。
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## 本项目自身
|
|
34
|
-
|
|
35
|
-
Copyright (c) 2026 MYCF711, MIT License(见 `LICENSE`)。
|
|
1
|
+
# NOTICE
|
|
2
|
+
|
|
3
|
+
本插件的实现参考了以下来源。按各自的许可要求在此声明。
|
|
4
|
+
|
|
5
|
+
## magpie 插件契约
|
|
6
|
+
|
|
7
|
+
- **yetone/magpie** — Copyright (c) 2026 yetone, MIT License
|
|
8
|
+
- `src/pure.mjs` 里 `auth.usage` 的 windows 字段形状、`used` 的归一化行为、
|
|
9
|
+
`aside` 的语义、签到 `outcome` 的合法值清单、`client.auth.set` 的整体替换
|
|
10
|
+
(而非合并)语义,均取自 magpie 二进制内嵌的插件契约源码。
|
|
11
|
+
- `free` 字段的判据取自其路由模式说明("Free first"):模型供应商是否
|
|
12
|
+
**不消耗本订阅的额度或积分**。
|
|
13
|
+
|
|
14
|
+
## Loomy(讯飞)协议实现
|
|
15
|
+
|
|
16
|
+
- **sucooer / anyaer 的 `magpie-plugin-loomy`**(`github.com/sucooer/magpie-plugins`, MIT)
|
|
17
|
+
- `src/crypto.mjs` + `src/pure.mjs` 的 `signedHeaders`:账号接口的 HMAC-SHA1
|
|
18
|
+
待签串构造(9 段 `\n` 连接)、路径分段转义规则。
|
|
19
|
+
- `src/desktop.mjs`:Loomy 桌面端登录态的 leveldb 读取方式(键名
|
|
20
|
+
`loomy-auth-session`、追加写所以从后往前找)。
|
|
21
|
+
|
|
22
|
+
- **agent2api**(`github.com/aimod-cc/agent2api`, 许可未核实;`loomy/sign.rs`, `loomy/images.rs`)
|
|
23
|
+
- deepseek 系模型只认 `<image_base64>` 标记、不认 `image_url` data URI 的结论,
|
|
24
|
+
以及把标记并入相邻 text 块的做法。
|
|
25
|
+
|
|
26
|
+
## 与上述实现的差异
|
|
27
|
+
|
|
28
|
+
本插件的额度上报口径与它们**不同**:市场现有实现不上报 `used`(或在拿不到上限时
|
|
29
|
+
上报 0),导致 magpie 把被蹬空的账号排在路由队首。本插件上报真实占比、把永久池
|
|
30
|
+
标为 `aside`、并在两池皆空时合成一条 `used: 100` 的参与路由窗口。
|
|
31
|
+
判据与实测见 [`docs/internals.md`](docs/internals.md) 的「这个插件修的是什么」。
|
|
32
|
+
|
|
33
|
+
## 本项目自身
|
|
34
|
+
|
|
35
|
+
Copyright (c) 2026 MYCF711, MIT License(见 `LICENSE`)。
|
package/README.md
CHANGED
|
@@ -55,6 +55,37 @@ magpie 每天调一次,一次做完三件事:刷新今日额度、领新手
|
|
|
55
55
|
|
|
56
56
|
先卸掉别的 Loomy 插件 —— 会抢同一个供应商。
|
|
57
57
|
|
|
58
|
+
### 命令行
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# 从 npm(推荐)
|
|
62
|
+
magpie plugin add magpie-plugin-loomy-auth
|
|
63
|
+
|
|
64
|
+
# 从仓库源码(拿最新代码,不走 npm)
|
|
65
|
+
magpie plugin add github:MYCF711/magpie-loomy-auth
|
|
66
|
+
|
|
67
|
+
# 本地 tgz(自己改了代码)
|
|
68
|
+
npm pack --pack-destination ./dist
|
|
69
|
+
cp dist/magpie-plugin-loomy-auth-*.tgz ~/.config/magpie/plugins/dist/
|
|
70
|
+
# plugins.json 追加 { "spec": "magpie-plugin-loomy-auth" }
|
|
71
|
+
# plugins/package.json 追加 "magpie-plugin-loomy-auth": "./dist/magpie-plugin-loomy-auth-*.tgz"
|
|
72
|
+
cd ~/.config/magpie/plugins && ~/.cache/magpie/bun/1.4.4/magpie-bun.exe install
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
⚠ **`magpie plugin add <tgz路径>` 用不了** —— 它把 tgz 当 JS 模块 `import()`,报
|
|
76
|
+
`exports no OpenCode plugin function`(实测 0.1.1254)。本地包必须走上头那套
|
|
77
|
+
`plugins.json` 登记 + `bun install`。
|
|
78
|
+
|
|
79
|
+
装完确认:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
magpie plugin list
|
|
83
|
+
# magpie-plugin-loomy-auth on
|
|
84
|
+
# loomy (Loomy, 10 models) signed in as 189****8051
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
⚠ 改了代码要 **bump `version` 再打包** —— 同一版本号重打,bun 会命中缓存(输出 `no changes`)。
|
|
88
|
+
|
|
58
89
|
---
|
|
59
90
|
|
|
60
91
|
## 常见问题
|
|
@@ -71,6 +102,18 @@ magpie 每天调一次,一次做完三件事:刷新今日额度、领新手
|
|
|
71
102
|
|
|
72
103
|
---
|
|
73
104
|
|
|
105
|
+
## 参考源
|
|
106
|
+
|
|
107
|
+
本插件的协议实现参考了这几处,按各自许可在此声明(完整版权声明见 [`NOTICE.md`](NOTICE.md)):
|
|
108
|
+
|
|
109
|
+
| 来源 | 用在哪 |
|
|
110
|
+
|---|---|
|
|
111
|
+
| [yetone/magpie](https://github.com/yetone/magpie)(MIT) | 插件契约:`usage` 窗口字段、`used` 归一化、`aside` 语义、签到 outcome 清单、`free` 判据 |
|
|
112
|
+
| [sucooer/magpie-plugins](https://github.com/sucooer/magpie-plugins)(MIT) | 账号接口的 HMAC-SHA1 签名构造、桌面端登录态(leveldb)读取方式 |
|
|
113
|
+
| [agent2api](https://github.com/aimod-cc/agent2api) | deepseek 系模型只认 `<image_base64>` 标记、不认 `image_url` 的结论 |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
74
117
|
## 许可
|
|
75
118
|
|
|
76
119
|
MIT。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magpie-plugin-loomy-auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Loomy (iFlytek) for magpie: desktop-session import / SMS / session sign-in, live model catalog with reasoning efforts, chat with tools and images, and the two credit pools reported as the host routes them — the daily pool counts, the permanent one is shown aside.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|