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 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.gif" alt="Model picker grouped by upstream provider, with the GPT-only standard/fast control" width="49%">
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
- *Model picker recorded from an isolated DSH host with a local mock Magpie gateway; models and accounts are synthetic. A fresh settings screenshot is pending re-recording.*
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
- [Repository](https://github.com/prgrmrwy/dsh-magpie-connector) · [Releases](https://github.com/prgrmrwy/dsh-magpie-connector/releases) · [npm](https://www.npmjs.com/package/dsh-magpie-connector)
12
+ ![Magpie connector architecture: Web GUI and Host plugin, credentials and settings, Magpie gateway and upstream providers, optionally through Cloudflare Access](docs/architecture.en.svg)
12
13
 
13
14
  <!-- problem -->
14
- **Connect a self-hosted Magpie gateway to DeepSeek Harness as one provider route: models grouped by their upstream provider, 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
+ **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
- ### Architecture
72
-
73
- ![Magpie connector architecture: Web GUI and Host plugin, credentials and settings, Magpie gateway and upstream providers, optionally through Cloudflare Access](docs/architecture.en.svg)
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 test --workspace=dsh-magpie-connector
82
- npm run typecheck --workspace=dsh-magpie-connector
83
- npm run build --workspace=dsh-magpie-connector
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
- ## License
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.gif" alt="模型选择器:按上游 provider 分组,仅 GPT 显示标准/快速" width="49%">
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
- *模型选择器录屏来自隔离 DSH 宿主与本地 mock Magpie 网关,模型和账号均为演示数据;设置页的线路列表截图待重录。*
10
+ *左:按上游 provider 分组的模型选择器;右:设置 → Magpie,顶部连接线路,下方按 provider 分组的模型可见性、默认 effort 与用量卡片。截图来自隔离 DSH 宿主与本地 mock Magpie 网关,模型和账号均为演示数据。*
10
11
 
11
- [插件仓库](https://github.com/prgrmrwy/dsh-magpie-connector) · [版本发布](https://github.com/prgrmrwy/dsh-magpie-connector/releases) · [npm](https://www.npmjs.com/package/dsh-magpie-connector)
12
+ ![Magpie connector 架构:Web GUI 与 Host 插件、凭据与设置、Magpie 网关与上游 provider,可选经 Cloudflare Access](docs/architecture.zh.svg)
12
13
 
13
14
  <!-- problem -->
14
- **把自托管的 Magpie 网关作为一个 provider route 接入 DeepSeek Harness:模型按上游 provider 分组展示,附带只读用量卡片和会话级快速档。** Magpie 继续负责登录、账号、路由和厂商出站代理,本插件补齐 DSH 侧。
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
- ![Magpie connector 架构:Web GUI 与 Host 插件、凭据与设置、Magpie 网关与上游 provider,可选经 Cloudflare Access](docs/architecture.zh.svg)
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 test --workspace=dsh-magpie-connector
84
- npm run typecheck --workspace=dsh-magpie-connector
85
- npm run build --workspace=dsh-magpie-connector
84
+ npm run typecheck
85
+ npm test
86
+ npm run build
86
87
  ```
87
88
 
88
- 测试使用本机 mock 网关和真实线协议库,不需要真实 key。构建产物不入库;`prepare` 与 `prepack` 都会执行 build。
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。`@earendil-works/pi-ai` 与 `undici` 是分别以 MIT 许可分发的依赖;鸟形图标来源与许可见 [THIRD-PARTY-NOTICES](THIRD-PARTY-NOTICES)。
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。
@@ -2,6 +2,5 @@
2
2
 
3
3
  | file | kind | source | date | reviewer | verdict | note |
4
4
  |---|---|---|---|---|---|---|
5
- | model-picker.gif | screenshot | isolated DSH_HOME instance (temp HOME/XDG/DSH_HOME under /tmp, port 3199), synthetic data: local mock Magpie gateway on loopback with demo models (only Codex models advertise the priority tier, as on Magpie); lossless deviceScaleFactor-2 screenshots of the real Web UI, 1500x880 at 1:1 | 2026-10-28 | lead | pass (viewed frames: demo workspace, mock models and mock account only; no hostname, user, path, token or real session) | Model picker grouped by upstream provider, search, switch to GPT shows the standard/fast control, switch back to Claude hides it immediately |
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
@@ -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
- agent = new Agent();
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.0",
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
@@ -1,3 +1,4 @@
1
1
  [
2
- "docs/model-picker.gif"
2
+ "docs/model-picker.png",
3
+ "docs/settings.png"
3
4
  ]
Binary file