@kesike/dsh-exit 0.2.1 → 0.2.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 CHANGED
@@ -7,7 +7,7 @@
7
7
  [![dsh web plugin](https://img.shields.io/badge/dsh-web%20plugin-4f46e5?style=for-the-badge)](https://npmjs.com/package/@deepseek-ai/dsh)
8
8
  [![npm](https://img.shields.io/npm/v/%40kesike%2Fdsh-exit?style=for-the-badge&label=npm)](https://www.npmjs.com/package/@kesike/dsh-exit)
9
9
  [![Platform](https://img.shields.io/badge/platform-web-0ea5e9?style=for-the-badge)](https://github.com/KeS1Ke/dsh-exit)
10
- [![Version](https://img.shields.io/badge/version-0.2.1-64748b?style=for-the-badge)](package.json)
10
+ [![Version](https://img.shields.io/badge/version-0.2.2-64748b?style=for-the-badge)](package.json)
11
11
  [![Dependencies](https://img.shields.io/badge/runtime%20dependencies-none-16a34a?style=for-the-badge)](package.json)
12
12
 
13
13
  [简体中文](https://github.com/KeS1Ke/dsh-exit/blob/main/README.zh-CN.md)
@@ -25,7 +25,7 @@
25
25
  - Keeps the **Exit** section at the bottom of the settings navigation.
26
26
  - Calls the typed `dshExit/exit` Remote method only after confirmation.
27
27
  - Gives the gateway a short acknowledgement window, then ends the host process.
28
- - Releases every port held by that process, including the usual `127.0.0.1:3080`.
28
+ - Releases every port held by that process; the settings page displays the current dsh Web host and port.
29
29
  - Keeps the terminal window and browser tab available for the next action.
30
30
  - Uses the existing dsh design tokens and the Lucide `power` icon.
31
31
 
@@ -124,7 +124,7 @@ node --check lib/client.js
124
124
  - **Install mode:** npm package
125
125
  - **Surface:** lower-right floating control
126
126
  - **Action:** terminate the dsh host process
127
- - **Default port mentioned by dsh:** `127.0.0.1:3080`
127
+ - **Runtime port:** read from the current dsh Web address in the settings page
128
128
  - **Repository topics:** `dsh` · `deepseek-harness` · `plugin` · `javascript` · `web`
129
129
 
130
130
  The power icon comes from [Lucide](https://lucide.dev/icons/power) and is used under its ISC license.
package/README.zh-CN.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![dsh Web 插件](https://img.shields.io/badge/dsh-Web%20%E6%8F%92%E4%BB%B6-4f46e5?style=for-the-badge)](https://npmjs.com/package/@deepseek-ai/dsh)
8
8
  [![npm](https://img.shields.io/npm/v/%40kesike%2Fdsh-exit?style=for-the-badge&label=npm)](https://www.npmjs.com/package/@kesike/dsh-exit)
9
9
  [![平台](https://img.shields.io/badge/%E5%B9%B3%E5%8F%B0-Web-0ea5e9?style=for-the-badge)](https://github.com/KeS1Ke/dsh-exit)
10
- [![版本](https://img.shields.io/badge/%E7%89%88%E6%9C%AC-0.2.1-64748b?style=for-the-badge)](package.json)
10
+ [![版本](https://img.shields.io/badge/%E7%89%88%E6%9C%AC-0.2.2-64748b?style=for-the-badge)](package.json)
11
11
  [![依赖](https://img.shields.io/badge/%E8%BF%90%E8%A1%8C%E6%97%B6%E4%BE%9D%E8%B5%96-%E6%97%A0-16a34a?style=for-the-badge)](package.json)
12
12
 
13
13
  **简体中文** | [English](https://github.com/KeS1Ke/dsh-exit/blob/main/README.md)
@@ -25,7 +25,7 @@
25
25
  - **退出**栏目始终位于设置左侧导航的最底部。
26
26
  - 确认后调用类型化的 `dshExit/exit` Remote 方法。
27
27
  - 先返回调用应答,再等待短暂窗口结束宿主进程。
28
- - 释放该进程占用的全部端口,包括常见的 `127.0.0.1:3080`。
28
+ - 释放该进程占用的全部端口;设置页会显示当前 dsh Web 的真实主机和端口。
29
29
  - 保留宿主终端窗口和浏览器标签页,方便后续操作。
30
30
  - 使用 dsh 现有设计令牌与 Lucide `power` 电源图标。
31
31
 
@@ -124,7 +124,7 @@ node --check lib/client.js
124
124
  - **安装方式:** npm 包
125
125
  - **界面位置:** 右下角悬浮控件
126
126
  - **执行动作:** 结束 dsh 宿主进程
127
- - **dsh 常见端口:** `127.0.0.1:3080`
127
+ - **运行端口:** 从设置页当前 dsh Web 地址动态读取
128
128
  - **仓库主题:** `dsh` · `deepseek-harness` · `plugin` · `javascript` · `web`
129
129
 
130
130
  电源图标来自 [Lucide](https://lucide.dev/icons/power),遵循其 ISC 许可使用。
package/lib/client.js CHANGED
@@ -91,10 +91,10 @@ window.__ModuleLoader__.load({
91
91
  nav: "退出",
92
92
  title: "退出 dsh",
93
93
  description: "从这里安全结束 dsh 宿主进程,并释放它占用的端口。",
94
- warning: "确认后将结束所有运行中的会话并停止后台服务,3080 端口会随之释放。",
94
+ warning: "确认后将结束所有运行中的会话并停止后台服务,当前 dsh Web 端口 {endpoint} 会随之释放。",
95
95
  button: "确认退出",
96
96
  dialogTitle: "退出 DeepSeek Harness?",
97
- dialogBody: "退出后将结束所有运行中的会话并停止后台服务,3080 端口会随之释放。",
97
+ dialogBody: "退出后将结束所有运行中的会话并停止后台服务,当前 dsh Web 端口 {endpoint} 会随之释放。",
98
98
  cancel: "取消",
99
99
  confirm: "确认退出",
100
100
  exiting: "正在退出…",
@@ -104,10 +104,10 @@ window.__ModuleLoader__.load({
104
104
  nav: "Exit",
105
105
  title: "Exit dsh",
106
106
  description: "Safely terminate the dsh host process and release the ports it owns.",
107
- warning: "Confirming ends all running sessions and stops the background service, releasing port 3080.",
107
+ warning: "Confirming ends all running sessions and stops the background service, releasing the current dsh Web port {endpoint}.",
108
108
  button: "Confirm exit",
109
109
  dialogTitle: "Exit DeepSeek Harness?",
110
- dialogBody: "This ends all running sessions and stops the background service, releasing port 3080.",
110
+ dialogBody: "This ends all running sessions and stops the background service, releasing the current dsh Web port {endpoint}.",
111
111
  cancel: "Cancel",
112
112
  confirm: "Confirm exit",
113
113
  exiting: "Exiting…",
@@ -127,8 +127,14 @@ window.__ModuleLoader__.load({
127
127
  document.head.appendChild(tag);
128
128
  }
129
129
 
130
- function textOf(t, key) {
131
- return typeof t === "function" ? t(key) : DICT.zh[key] ?? key;
130
+ function textOf(t, key, values = {}) {
131
+ const raw = typeof t === "function" ? t(key, values) : DICT.zh[key] ?? key;
132
+ return String(raw).replace(/\{([A-Za-z0-9_]+)\}/g, (match, name) => values[name] === undefined ? match : String(values[name]));
133
+ }
134
+
135
+ function currentDshEndpoint() {
136
+ const location = globalThis.location;
137
+ return location?.host || "当前 Web 端口";
132
138
  }
133
139
 
134
140
  /** dsh 的设置壳层为未知 section 使用齿轮图标;给本插件的导航项换成 power 图标。 */
@@ -166,6 +172,7 @@ window.__ModuleLoader__.load({
166
172
  }
167
173
 
168
174
  function ExitSettingsSection({ ctx, t }) {
175
+ const endpoint = currentDshEndpoint();
169
176
  return h("section", {
170
177
  className: "dshExitSettings",
171
178
  "aria-labelledby": "dsh-exit-settings-title"
@@ -182,7 +189,7 @@ window.__ModuleLoader__.load({
182
189
  ])
183
190
  ]),
184
191
  h("div", { className: "dshExitSettingsCard", key: "card" }, [
185
- h("p", { className: "dshExitSettingsWarning", key: "warning" }, textOf(t, "warning")),
192
+ h("p", { className: "dshExitSettingsWarning", key: "warning" }, textOf(t, "warning", { endpoint })),
186
193
  h("button", {
187
194
  type: "button",
188
195
  className: "dshExitSettingsButton",
@@ -209,7 +216,8 @@ window.__ModuleLoader__.load({
209
216
  }
210
217
 
211
218
  function openModal(ctx, exitBtn, t) {
212
- const text = (key) => textOf(t, key);
219
+ const endpoint = currentDshEndpoint();
220
+ const text = (key) => textOf(t, key, { endpoint });
213
221
  closeModal();
214
222
  overlayEl = document.createElement("div");
215
223
  overlayEl.className = "dshExitOverlay";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kesike/dsh-exit",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "在 dsh web 界面提供退出按钮:确认后结束宿主进程并释放端口",
6
6
  "keywords": [