dsh-magpie-connect 0.5.0 → 0.7.0
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 +22 -0
- package/dsh.plugin.json +1 -1
- package/lib/client.js +1437 -24
- package/lib/index.js +759 -41
- package/lib/index.js.map +4 -4
- package/lib/types/adapter/catalog.d.ts +8 -5
- package/lib/types/adapter/magpie-adapter.d.ts +1 -0
- package/lib/types/adapter/messages.d.ts +2 -0
- package/lib/types/client/model-visibility.d.ts +2 -0
- package/lib/types/client/trace-button.d.ts +13 -0
- package/lib/types/client/trace-format.d.ts +84 -0
- package/lib/types/client/trace-icons.d.ts +27 -0
- package/lib/types/client/trace-placement.d.ts +87 -0
- package/lib/types/client/trace-styles.d.ts +14 -0
- package/lib/types/index.d.ts +11 -0
- package/lib/types/settings.d.ts +25 -1
- package/lib/types/trace-contract.d.ts +265 -0
- package/lib/types/trace.d.ts +57 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
- **模型自动同步** — 网关列出的模型全部进入 DSH 模型选择器,想显示哪些由你决定。
|
|
14
14
|
- **图片识别** — 网关声明支持图片的模型可以直接发图。
|
|
15
15
|
- **思考档位** — 网关支持的思考档位(含 `none`、`ultra`)原样出现在选择器里。
|
|
16
|
+
- **路由浮窗** — 输入框右侧的 Magpie 图标,桌面悬停(手机端点按)即显示网关路由的压缩视图:当前会话最近一次请求走了哪条路由、命中/避开了哪些账号/模型及耗时;无会话时回退显示整份 trace 里最新的一条路由。数据由插件在 Host 侧用已保存的 Key 读取(`/api/magpie-trace`,聚合网关的 `/v1/magpie/usage/requests`、`/v1/magpie/quotas`、`/v1/magpie/concurrency` 与 Web 的 `/api/gateway/trace`),浏览器不接触 Key;账号持有人只以首字符形式出现在页面上。
|
|
17
|
+
- **完整路由组详情(可选)** — 在设置页填入 Magpie Web Key 后,浮窗会从 Magpie Web 的完整 trace 读取当前会话的路由组、嵌套子路由组(如 `Hy4 auto/hy4free`、`GPT-6 Luna auto/gpt-6-luna`)、候选账号、逐次尝试、限流/失效原因与恢复时间,并通过 Host 同源代理显示供应商图标;Web Key 仅保存在 Host 的 `settings.json`(文件权限 `0600`),设置页不回显。未配置或 Web Key 失效时自动回退到简化视图。
|
|
16
18
|
|
|
17
19
|
## 安装
|
|
18
20
|
|
|
@@ -35,6 +37,12 @@ dsh plugin --profile web add dsh-magpie-connect
|
|
|
35
37
|
- **API 地址** — 网关地址,**要带版本号**。默认已填好 `http://127.0.0.1:3425/v1`,网关不在本机时改成实际地址。
|
|
36
38
|
- **API Key** — 网关凭据,必填。
|
|
37
39
|
|
|
40
|
+
> Key 保存后**不会再回显**到页面;输入框留空表示沿用已保存的 Key,只有填入新值才会替换。
|
|
41
|
+
> 「测试连接」和「获取可用模型」同样复用已保存的 Key。设置文件里仍然是原来的 JSON 结构
|
|
42
|
+
> (`baseUrl` / `apiKey` / `enabledModels`),所以降级回旧版本也能直接读取。
|
|
43
|
+
> 插件自有状态目录在 POSIX 系统上为 `0700`、`settings.json` 为 `0600`;旧版本留下的宽权限
|
|
44
|
+
> 会在下次读取时自动收紧(只读文件系统或非 POSIX 平台会跳过,不影响设置读取)。
|
|
45
|
+
|
|
38
46
|
点「保存」后,可以点「测试连接」确认通不通(会告诉你网关上有多少模型)。两项都齐了才会生效——
|
|
39
47
|
地址有默认值,Key 没有,所以没填 Key 之前模型选择器是空的。
|
|
40
48
|
|
|
@@ -46,6 +54,17 @@ dsh plugin --profile web add dsh-magpie-connect
|
|
|
46
54
|
点 **获取可用模型**,会弹出网关当前的模型列表:勾选你想要的,再点「应用选择」。
|
|
47
55
|
弹窗里可以搜索、全选、取消全选。
|
|
48
56
|
|
|
57
|
+
模型选择器、已选模型列表和弹窗统一显示 **`<组名>/<模型名>`**:模型名直接取 API 的
|
|
58
|
+
`display_name`;组名优先取 `magpie_label` 最后一个 ` · ` 右边的部分。若 `magpie_label`
|
|
59
|
+
缺失或没有可解析的组名,则取 id 第一个 `/` 前的部分,并仅将首字母大写(例如
|
|
60
|
+
`workbuddy-ai/hy4free` → `Workbuddy-ai/Hy4`)。`auto/` 和 `group/` 是特例:组名始终从 id 前缀
|
|
61
|
+
生成(`Auto`、`Group`),不使用 `magpie_label` 中的通用组名。
|
|
62
|
+
原始路由 id 只在鼠标悬停时显示,请求、会话历史和白名单里始终是 id,所以改显示名
|
|
63
|
+
不会影响已保存的选择或历史会话。搜索可以同时按显示名和 id 匹配,列表按显示名排序。
|
|
64
|
+
|
|
65
|
+
> 如果 API 没有返回 `display_name`,显示名回落到原始 id。旧版本留下的本地模型缓存
|
|
66
|
+
> 暂时以 id 显示,等下一次成功读取网关目录后自动换成新标签。
|
|
67
|
+
|
|
49
68
|
模型列表是**白名单**,和 DSH 自带的「模型」设置语义一致:列表里有什么,选择器就提供
|
|
50
69
|
什么。不想要的点该行末尾的「删除」,它就从列表和选择器里一起消失;想加回来,点
|
|
51
70
|
「获取可用模型」,在弹窗里勾上它再「应用选择」。
|
|
@@ -178,6 +197,9 @@ http://127.0.0.1:3425/v1 ← 按 native_endpoints 选择 chat/completions 或 r
|
|
|
178
197
|
(显式档位直通网关);`none` 关闭思考,`ultra` 直通网关,不在本地截断。
|
|
179
198
|
- **图片** — 带图的请求经 harness 附件服务取字节后上行;文本模型收到图片会直接
|
|
180
199
|
失败(harness 已按模型声明的输入类型做过门控)。
|
|
200
|
+
- **输出预算** — 模型目录保留网关声明的最大输出能力;每次请求的默认输出预算沿用
|
|
201
|
+
Magpie 的 DSH 策略,为上下文和压缩保留空间。例如 500,000 上下文、393,216 最大
|
|
202
|
+
输出的模型默认预留 184,464 输出。显式设置的请求输出预算保持原值,读图能力不变。
|
|
181
203
|
- **容错** — 启动即注册,目录在后台预热;静默挂起会被看门狗快速判为超时;
|
|
182
204
|
上游截断如实上报,不做自动续写。
|
|
183
205
|
|