dsh-gateway-provider 1.1.2 → 1.1.3

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 CHANGED
@@ -66,6 +66,48 @@ it should answer `✓ Connected — N models`. Not using the public newapi
66
66
  cloud? Set **Base URL** on the card (or `baseURL` in config) to your own
67
67
  gateway address first.
68
68
 
69
+ ## Terminal / headless
70
+
71
+ The host half of this plugin (the `llm-newapi` provider route) works in any
72
+ profile — including terminal / TUI setups such as
73
+ [dsh-tui](https://github.com/ccch1mneyyy/dsh-TUI). **Settings → Gateway
74
+ Models is web-only**; without the web UI you configure the gateway by
75
+ overriding the bundle's `llm-newapi` entry in the profile patch. A patch
76
+ layer replaces `config` wholesale, so write the whole block out:
77
+
78
+ ```yaml
79
+ # ~/.dsh/profiles/<name>/cordis.patch.yml
80
+ # Override by id — do not insert a second llm-newapi row (duplicate = loader error).
81
+ - id: llm-newapi
82
+ config:
83
+ label: My Gateway
84
+ baseURL: https://gw.example.com
85
+ apiKeyEnv: GW_API_KEY
86
+ models:
87
+ - id: some-model
88
+ protocol: gemini
89
+ ```
90
+
91
+ Store the key under the name in `apiKeyEnv` (same rules as Install):
92
+
93
+ ```sh
94
+ echo "GW_API_KEY: sk-REPLACE_WITH_YOUR_KEY" >> ~/.dsh/.credentials.yaml
95
+ # or: export GW_API_KEY=sk-REPLACE_WITH_YOUR_KEY
96
+ ```
97
+
98
+ Install into a non-web profile the same way — swap the profile name:
99
+
100
+ ```sh
101
+ dsh plugin --profile dsh-tui add dsh-gateway-provider
102
+ ```
103
+
104
+ After a restart the gateway models should appear in the TUI model picker.
105
+ Connection Test / Sync / per-model editing still need the web settings page
106
+ (or hand-edits of the YAML above). A future in-terminal settings surface
107
+ (`tuiSettingsSections`, see [#5](https://github.com/Luck9Star/dsh-gateway-provider/issues/5))
108
+ may cover the scalar fields; until then the YAML override is the supported
109
+ path.
110
+
69
111
  ## Daily use
70
112
 
71
113
  Everything lives in **Settings → Gateway Models**:
package/docs/README.zh.md CHANGED
@@ -42,6 +42,46 @@ dsh --profile web
42
42
 
43
43
  **预期结果:** 模型选择器多出一条 "NewAPI" 路由,列出网关的对话模型,最新在前。在网关卡片上点 **Test** —— 应显示 `✓ Connected — N models`。用的不是 newapi 公有云?先在卡片上改 **Base URL**(或配置里的 `baseURL`)指向你自己的网关地址。
44
44
 
45
+ ## 终端 / 无界面(headless)
46
+
47
+ 本插件的 host 半边(`llm-newapi` provider 路由)在任意 profile 都能用 ——
48
+ 包括终端 / TUI(例如 [dsh-tui](https://github.com/ccch1mneyyy/dsh-TUI))。
49
+ **Settings → Gateway Models 仅限 web**;没有 web UI 时,通过在 profile
50
+ patch 里覆盖 bundle 插入的 `llm-newapi` 条目来配置网关。patch 层会整段
51
+ 替换 `config`,所以要把整个块写全:
52
+
53
+ ```yaml
54
+ # ~/.dsh/profiles/<name>/cordis.patch.yml
55
+ # 按 id 覆盖 —— 不要再 insert 第二条 llm-newapi(重复行 = 加载器报错)。
56
+ - id: llm-newapi
57
+ config:
58
+ label: My Gateway
59
+ baseURL: https://gw.example.com
60
+ apiKeyEnv: GW_API_KEY
61
+ models:
62
+ - id: some-model
63
+ protocol: gemini
64
+ ```
65
+
66
+ 密钥按 `apiKeyEnv` 里的名字存放(规则与「安装」一节相同):
67
+
68
+ ```sh
69
+ echo "GW_API_KEY: sk-REPLACE_WITH_YOUR_KEY" >> ~/.dsh/.credentials.yaml
70
+ # 或: export GW_API_KEY=sk-REPLACE_WITH_YOUR_KEY
71
+ ```
72
+
73
+ 装到非 web profile 时同样操作,换成对应 profile 名即可:
74
+
75
+ ```sh
76
+ dsh plugin --profile dsh-tui add dsh-gateway-provider
77
+ ```
78
+
79
+ 重启后,网关模型会出现在 TUI 的模型选择器里。连接测试 / 同步 /
80
+ 按模型编辑仍需要 web 设置页(或手工改上面的 YAML)。之后可能会加终端内
81
+ 设置面(`tuiSettingsSections`,见
82
+ [#5](https://github.com/Luck9Star/dsh-gateway-provider/issues/5))覆盖标量
83
+ 字段;在那之前,YAML 覆盖就是受支持的用法。
84
+
45
85
  ## 日常使用
46
86
 
47
87
  一切都在 **Settings → Gateway Models**:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gateway-provider",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Generic LLM gateway model provider plugin for DeepSeek Harness: mounts newapi / LiteLLM / Higress / any OpenAI-compatible gateway as provider routes, auto-discovers the model list, enriches every model with models.dev parameters, and dispatches each model over its native wire protocol (OpenAI / Anthropic / Gemini) via the pi-ai SDK",
5
5
  "repository": {
6
6
  "type": "git",
@@ -70,10 +70,10 @@
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@deepseek-ai/cordis": "^4.0.2",
73
- "@deepseek-ai/dsh-credentials": "0.2.1-rc.2",
74
- "@deepseek-ai/dsh-launch-environment": "0.2.1-rc.2",
75
- "@deepseek-ai/dsh-llm": "0.2.1-rc.2",
76
- "@deepseek-ai/dsh-timeout": "0.2.1-rc.2",
73
+ "@deepseek-ai/dsh-credentials": ">=0.2.1-rc.2 <0.2.2-0",
74
+ "@deepseek-ai/dsh-launch-environment": ">=0.2.1-rc.2 <0.2.2-0",
75
+ "@deepseek-ai/dsh-llm": ">=0.2.1-rc.2 <0.2.2-0",
76
+ "@deepseek-ai/dsh-timeout": ">=0.2.1-rc.2 <0.2.2-0",
77
77
  "@deepseek-ai/schemastery": "^3.18.1"
78
78
  }
79
79
  }