@fish-under-sea/magpie-dragonapi 0.1.1 → 0.1.2
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 +21 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
把 [DragonAPI](https://newapi.dragon3api.com/) 接进 magpie:模型广场、余额、用量,外加一个能按分组建钥匙的本地界面。
|
|
4
4
|
|
|
5
|
-
> 当前版本 **0.1.
|
|
5
|
+
> 当前版本 **0.1.2**。只做供应商插件 + 只读看板 + 密钥管理,不做「页面里点充值」。
|
|
6
6
|
|
|
7
7
|
## 它是什么
|
|
8
8
|
|
|
@@ -13,6 +13,26 @@
|
|
|
13
13
|
| **供应商插件** | 把站点 `/api/pricing` 的目录折成 magpie 的模型表;`sk-` 钥匙直接读余额与逐条用量;视频模型走 magpie 的 `/v1/videos` 三件套 |
|
|
14
14
|
| **页面插件 + 本地服务** | magpie 的插件页是 `connect-src 'none'` 的沙箱,页面自己发不出请求。所以插件起一个只监听 `127.0.0.1` 的 HTTP 服务,页面导航过去,界面由服务提供 |
|
|
15
15
|
|
|
16
|
+
## 安装
|
|
17
|
+
|
|
18
|
+
包已发布到 npm:`@fish-under-sea/magpie-dragonapi`([npm](https://www.npmjs.com/package/@fish-under-sea/magpie-dragonapi) · [GitHub](https://github.com/Fish-under-sea/magpie-dragonapi))。
|
|
19
|
+
|
|
20
|
+
两种装法,任选其一:
|
|
21
|
+
|
|
22
|
+
| 方式 | 怎么做 |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| **Discover(推荐)** | magpie 窗口 → Discover → Unofficial。这个仓库打了 `magpie-plugin` topic,`package.json` 里也有已提交的 `magpie.page.file`,所以会按 `magpie.name` / `magpie.summary` 列出卡片,点它安装 |
|
|
25
|
+
| **命令行** | `magpie plugin add @fish-under-sea/magpie-dragonapi` |
|
|
26
|
+
|
|
27
|
+
npm 拉不到时(内网、镜像抽风):到 [Releases](https://github.com/Fish-under-sea/magpie-dragonapi/releases) 下
|
|
28
|
+
`fish-under-sea-magpie-dragonapi-0.1.2.tgz`,解包成目录,再 `magpie plugin add <那个目录>` ——
|
|
29
|
+
`plugin add` 认 `path`,和从文件夹加插件是同一条路。
|
|
30
|
+
|
|
31
|
+
装好后:Settings → Plugins 里出现 **DragonAPI** 行(带一张页面),供应商列表里出现 **DragonAPI**。
|
|
32
|
+
|
|
33
|
+
> 只装不配也能看到模型广场——目录走站点公开的 `/api/pricing`,不需要任何凭据。
|
|
34
|
+
> 要看余额、读用量、建钥匙,才需要下面的钥匙与 PAT。
|
|
35
|
+
|
|
16
36
|
## 为什么不照抄 NearToken
|
|
17
37
|
|
|
18
38
|
NearToken 那套「页面里点充值、点连接」依赖两个本站没有的东西:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fish-under-sea/magpie-dragonapi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "DragonAPI for magpie: a provider plugin whose models, groups and prices come from the site's public /api/pricing, with balance and per-call usage from an sk- key, plus a local page that lists the market (read-only), shows usage and can mint new keys for a group.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.mjs",
|