dsh-magpie-connector 0.3.0 → 0.3.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/CHANGELOG.md +4 -0
- package/README.md +16 -13
- package/README.zh.md +16 -13
- package/docs/SCREENSHOTS.md +2 -3
- package/docs/model-picker.png +0 -0
- package/docs/settings.png +0 -0
- package/lib/host/transport.js +2 -1
- package/package.json +1 -1
- package/screenshots.json +2 -1
- package/docs/model-picker.gif +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
- Replace both README demo GIFs with representative PNG screenshots (the model picker grouped by provider; per-provider visibility, default effort and usage cards in Settings), because the DSH plugin store does not show GIFs by default. No runtime behavior changes.
|
|
6
|
+
|
|
3
7
|
## 0.3.0
|
|
4
8
|
|
|
5
9
|
**BREAKING:** the single provider route `dsh-magpie-connector` is retired and not aliased. Sessions, the default model and any external configuration saved with that route id no longer resolve; reselect the model after upgrading, and update anything that lists the exact route id (subagent routing, egress allowlists).
|
package/README.md
CHANGED
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
English · [简体中文](README.zh.md)
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<img src="docs/model-picker.
|
|
6
|
+
<img src="docs/model-picker.png" alt="Model picker grouped by upstream provider: Magpie (Claude), Magpie (GPT), Magpie (deepseek)" width="49%">
|
|
7
|
+
<img src="docs/settings.png" alt="Settings: the connection line on top, then models grouped by provider with visibility, default effort and usage cards" width="49%">
|
|
7
8
|
</p>
|
|
8
9
|
|
|
9
|
-
*
|
|
10
|
+
*Left: model picker grouped by upstream provider. Right: Settings → Magpie — the connection line, then per-provider model visibility, default effort and usage cards. Captured from an isolated DSH host with a local mock Magpie gateway; models and accounts are synthetic.*
|
|
10
11
|
|
|
11
|
-
[
|
|
12
|
+

|
|
12
13
|
|
|
13
14
|
<!-- problem -->
|
|
14
|
-
**Connect a self-hosted Magpie gateway to DeepSeek Harness
|
|
15
|
+
**Connect a self-hosted Magpie gateway to DeepSeek Harness with one provider route per upstream owner: models grouped by upstream provider on stock DSH, read-only usage cards, and a per-session fast mode.** Magpie keeps managing logins, accounts, routing and provider egress; this plugin adds the DSH side.
|
|
15
16
|
|
|
16
17
|
### What you get
|
|
17
18
|
|
|
@@ -68,22 +69,22 @@ Need another method — custom headers, mTLS, another zero-trust gateway? **Issu
|
|
|
68
69
|
- **Not supported:** `stop` sequences fail before any network access (`MAGPIE_STOP_UNSUPPORTED`) because Magpie cannot preserve them across every upstream translation. Usage cards and Codex reset credits are display-only; the plugin never calls account-management or reset endpoints.
|
|
69
70
|
- **Secrets stay out of responses and logs.** Gateway-reflected text is redacted with the current key before it can reach the settings API or logs. Files are written `0600`; the settings API reports only `configured` / `writable`.
|
|
70
71
|
|
|
71
|
-
###
|
|
72
|
-
|
|
73
|
-

|
|
72
|
+
### Code map
|
|
74
73
|
|
|
75
74
|
Entry: [index.ts](src/index.ts). Adapter and request/stream mapping: [adapter.ts](src/host/adapter.ts). Routes: [routes.ts](src/host/routes.ts). Transport allowlist: [transport.ts](src/host/transport.ts). Settings page: [SettingsPage.ts](src/client/SettingsPage.ts). The diagram source, with credential-free repository evidence: [architecture.en.json](docs/architecture.en.json).
|
|
76
75
|
|
|
77
76
|
### Development
|
|
78
77
|
|
|
78
|
+
In a standalone checkout of this repository:
|
|
79
|
+
|
|
79
80
|
```sh
|
|
80
81
|
npm install
|
|
81
|
-
npm
|
|
82
|
-
npm
|
|
83
|
-
npm run build
|
|
82
|
+
npm run typecheck
|
|
83
|
+
npm test
|
|
84
|
+
npm run build
|
|
84
85
|
```
|
|
85
86
|
|
|
86
|
-
Tests use local mock gateways and the real wire library; no real key is required. Build output is not committed. Both `prepare` and `prepack` build the package.
|
|
87
|
+
Inside the ohmydsh monorepo, install once at the root and add `--workspace=dsh-magpie-connector` to the last three commands. Tests use local mock gateways and the real wire library; no real key is required. Build output is not committed. Both `prepare` and `prepack` build the package.
|
|
87
88
|
|
|
88
89
|
## Removal
|
|
89
90
|
<!-- section: removal -->
|
|
@@ -96,6 +97,8 @@ Restart DSH and refresh the page. Disposal releases registrations, timers and co
|
|
|
96
97
|
|
|
97
98
|
Inside [ohmydsh](https://github.com/prgrmrwy/ohmydsh), set the manifest entry to `enabled: false` and rebuild instead.
|
|
98
99
|
|
|
99
|
-
##
|
|
100
|
+
## Source, license and contributing
|
|
101
|
+
|
|
102
|
+
This plugin is developed in [ohmydsh](https://github.com/prgrmrwy/ohmydsh) (`packages/dsh-magpie-connector`); [this repository](https://github.com/prgrmrwy/dsh-magpie-connector) is its release mirror, published automatically to [npm](https://www.npmjs.com/package/dsh-magpie-connector) and [GitHub Releases](https://github.com/prgrmrwy/dsh-magpie-connector/releases). Current behavior is specified in [`openspec/specs/dsh-magpie-connector`](https://github.com/prgrmrwy/ohmydsh/blob/main/openspec/specs/dsh-magpie-connector/spec.md).
|
|
100
103
|
|
|
101
|
-
MIT. `@earendil-works/pi-ai` and `undici` are separate MIT-licensed dependencies; the bird artwork follows the notice in [THIRD-PARTY-NOTICES](THIRD-PARTY-NOTICES).
|
|
104
|
+
[MIT](LICENSE). `@earendil-works/pi-ai` and `undici` are separate MIT-licensed dependencies; the bird artwork follows the notice in [THIRD-PARTY-NOTICES](THIRD-PARTY-NOTICES). Issues and pull requests are welcome at [prgrmrwy/dsh-magpie-connector](https://github.com/prgrmrwy/dsh-magpie-connector/issues).
|
package/README.zh.md
CHANGED
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
[English](README.md) · 简体中文
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<img src="docs/model-picker.
|
|
6
|
+
<img src="docs/model-picker.png" alt="模型选择器:按上游 provider 分组为 Magpie (Claude)、Magpie (GPT)、Magpie (deepseek)" width="49%">
|
|
7
|
+
<img src="docs/settings.png" alt="设置页:顶部连接线路,下方按 provider 分组的模型可见性、默认 effort 与用量卡片" width="49%">
|
|
7
8
|
</p>
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
*左:按上游 provider 分组的模型选择器;右:设置 → Magpie,顶部连接线路,下方按 provider 分组的模型可见性、默认 effort 与用量卡片。截图来自隔离 DSH 宿主与本地 mock Magpie 网关,模型和账号均为演示数据。*
|
|
10
11
|
|
|
11
|
-
[
|
|
12
|
+

|
|
12
13
|
|
|
13
14
|
<!-- problem -->
|
|
14
|
-
**把自托管的 Magpie
|
|
15
|
+
**把自托管的 Magpie 网关接入 DeepSeek Harness,每个上游归属对应一个 provider route:原版 DSH 即按上游 provider 分组展示模型,附带只读用量卡片和会话级快速档。** Magpie 继续负责登录、账号、路由和厂商出站代理,本插件补齐 DSH 侧。
|
|
15
16
|
|
|
16
17
|
### 你会得到什么
|
|
17
18
|
|
|
@@ -70,22 +71,22 @@ dsh plugin --profile web add dsh-magpie-connector
|
|
|
70
71
|
- **不支持:** 非空 `stop` 序列会在发请求前失败(`MAGPIE_STOP_UNSUPPORTED`),因为 Magpie 无法在所有上游协议转换中保留 stop。用量卡片与 Codex 重置次数只读展示,插件不会调用账号管理或重置端点。
|
|
71
72
|
- **密钥不会进入响应或日志。** 网关反射的文本在进入设置接口或日志之前会用当前 key 脱敏。写盘文件权限 `0600`;设置接口只报告 `configured` / `writable`。
|
|
72
73
|
|
|
73
|
-
###
|
|
74
|
-
|
|
75
|
-

|
|
74
|
+
### 代码导览
|
|
76
75
|
|
|
77
76
|
入口:[index.ts](src/index.ts)。适配器与请求/流映射:[adapter.ts](src/host/adapter.ts)。路由:[routes.ts](src/host/routes.ts)。传输白名单:[transport.ts](src/host/transport.ts)。设置页:[SettingsPage.ts](src/client/SettingsPage.ts)。不含凭据的图源与仓库证据:[architecture.zh.json](docs/architecture.zh.json)。
|
|
78
77
|
|
|
79
78
|
### 开发
|
|
80
79
|
|
|
80
|
+
在本仓库的独立检出中:
|
|
81
|
+
|
|
81
82
|
```sh
|
|
82
83
|
npm install
|
|
83
|
-
npm
|
|
84
|
-
npm
|
|
85
|
-
npm run build
|
|
84
|
+
npm run typecheck
|
|
85
|
+
npm test
|
|
86
|
+
npm run build
|
|
86
87
|
```
|
|
87
88
|
|
|
88
|
-
|
|
89
|
+
在 ohmydsh monorepo 里,在仓库根目录安装一次,后三条命令加上 `--workspace=dsh-magpie-connector`。测试使用本机 mock 网关和真实线协议库,不需要真实 key。构建产物不入库;`prepare` 与 `prepack` 都会执行 build。
|
|
89
90
|
|
|
90
91
|
## 移除
|
|
91
92
|
<!-- section: removal -->
|
|
@@ -98,6 +99,8 @@ dsh plugin --profile web remove dsh-magpie-connector
|
|
|
98
99
|
|
|
99
100
|
在 [ohmydsh](https://github.com/prgrmrwy/ohmydsh) 中则把 manifest 条目设为 `enabled: false` 后重新构建。
|
|
100
101
|
|
|
101
|
-
##
|
|
102
|
+
## 来源、许可与参与
|
|
103
|
+
|
|
104
|
+
本插件在 [ohmydsh](https://github.com/prgrmrwy/ohmydsh)(`packages/dsh-magpie-connector`)中持续开发,[本仓库](https://github.com/prgrmrwy/dsh-magpie-connector)是发布镜像,自动发布到 [npm](https://www.npmjs.com/package/dsh-magpie-connector) 与 [GitHub Releases](https://github.com/prgrmrwy/dsh-magpie-connector/releases)。当前行为见规范 [`openspec/specs/dsh-magpie-connector`](https://github.com/prgrmrwy/ohmydsh/blob/main/openspec/specs/dsh-magpie-connector/spec.md)。
|
|
102
105
|
|
|
103
|
-
MIT
|
|
106
|
+
采用 [MIT](LICENSE) 许可。`@earendil-works/pi-ai` 与 `undici` 是分别以 MIT 许可分发的依赖;鸟形图标来源与许可见 [THIRD-PARTY-NOTICES](THIRD-PARTY-NOTICES)。欢迎到 [prgrmrwy/dsh-magpie-connector](https://github.com/prgrmrwy/dsh-magpie-connector/issues) 提 issue 和 PR。
|
package/docs/SCREENSHOTS.md
CHANGED
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
| file | kind | source | date | reviewer | verdict | note |
|
|
4
4
|
|---|---|---|---|---|---|---|
|
|
5
|
-
| model-picker.
|
|
6
|
-
|
|
7
|
-
> Settings screenshot removed pending re-recording after the 0.2.0 line-list settings rewrite; the old recording showed the pre-multi-line connection form.
|
|
5
|
+
| model-picker.png | screenshot | frame 11 of the 2026-10-28 recording (isolated DSH_HOME instance, temp HOME/XDG/DSH_HOME under /tmp, port 3199; local mock Magpie gateway on loopback with demo models; lossless deviceScaleFactor-2 screenshots of the real Web UI, 1500x880 at 1:1), exported losslessly from the global-palette GIF | 2026-10-29 | lead | pass (reviewed frame: demo workspace and mock models only; no hostname, user, path, token or real session) | 106789 bytes; picker open with Magpie (Claude), Magpie (GPT) and Magpie (deepseek) groups; replaces model-picker.gif because the plugin store does not show GIFs by default |
|
|
6
|
+
| settings.png | screenshot | isolated DSH_HOME under /tmp (temp HOME/XDG, port 3199) running the deployed 0.3.0 plugin (code identical to 0.3.1) against a local loopback mock Magpie gateway serving demo models and usage cards; Playwright/CDP deviceScaleFactor-2 screenshot of the settings dialog, 1600x1600 | 2026-10-29 | lead | pass (reviewed: loopback mock address, key from a fake startup env value, demo@example.com account, demo models; no real hostname, user, path, token or session) | 202707 bytes; connection section with line 1 collapsed, then the claude group with per-model default effort and its usage card, codex group below; replaces settings.gif |
|
|
Binary file
|
|
Binary file
|
package/lib/host/transport.js
CHANGED
|
@@ -18,7 +18,8 @@ export class GatewayTransport {
|
|
|
18
18
|
signal = new AbortController();
|
|
19
19
|
/** Called when a request fails before the connection was established. */
|
|
20
20
|
onConnectionFailure;
|
|
21
|
-
|
|
21
|
+
// undici's default 10s connect timeout fails cold TLS handshakes to the Cloudflare ingress.
|
|
22
|
+
agent = new Agent({ connect: { timeout: 25_000 } });
|
|
22
23
|
async request(identity, method, path, init = {}) {
|
|
23
24
|
validateIdentity(identity);
|
|
24
25
|
const base = new URL(identity.baseUrl);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-magpie-connector",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "DeepSeek Harness plugin: connect a self-hosted Magpie gateway with one real provider route per upstream owner (grouped model picker on stock DSH), automatic multi-line failover, read-only usage cards, model visibility, default effort and per-session fast mode",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "prgrmrwy",
|
package/screenshots.json
CHANGED
package/docs/model-picker.gif
DELETED
|
Binary file
|