@restregular/dsh-powerup 0.5.0 → 0.6.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 +51 -34
- package/client.js +175 -143
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Small, opt-in upgrades for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness).
|
|
4
4
|
The upgrades include a **right-click action menu in the Trajectory view**, an
|
|
5
|
-
optional **stop reason for background jobs**, and an in-place **plugin
|
|
5
|
+
optional **stop reason for background jobs**, and an in-place **plugin installer**.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -31,17 +31,20 @@ Right-click empty space in the ledger:
|
|
|
31
31
|
|
|
32
32
|
The sidebar **Power-Up** page turns the menu on or off and lists the available
|
|
33
33
|
actions. The setting is stored in the browser. It also holds the defaults for
|
|
34
|
-
**one-click
|
|
34
|
+
**one-click install** (auto-enable and auto-restart), which the plugin installer
|
|
35
35
|
uses.
|
|
36
36
|
|
|
37
37
|
### Stop a background job with a reason
|
|
38
38
|
|
|
39
39
|
The session header's background jobs panel keeps the host's list, live output,
|
|
40
|
-
and stop button. Clicking a running job's stop button opens a
|
|
41
|
-
dialog instead of the host's two-press stop
|
|
40
|
+
and stop button. Clicking a running job's stop button opens a themed Power-Up
|
|
41
|
+
dialog instead of the host's two-press stop. The dialog is portaled to the
|
|
42
|
+
document body, so it renders above the jobs menu (which is itself a body portal)
|
|
43
|
+
and is not clipped by any slot's stacking context; its colors come only from
|
|
44
|
+
`--dsw-alias-*` tokens, so light and dark themes both work.
|
|
42
45
|
|
|
43
46
|
- The reason field is optional; an empty field keeps the host's default
|
|
44
|
-
`cancelled by the user` reason.
|
|
47
|
+
`cancelled by the user` reason. `Enter` confirms while `Esc` cancels.
|
|
45
48
|
- Confirming stops the job through the Host route, which records
|
|
46
49
|
`cancelled by the user: <reason>`. The completion notice injected into the
|
|
47
50
|
session and the shell tool's result therefore carry the reason.
|
|
@@ -52,30 +55,32 @@ dialog instead of the host's two-press stop:
|
|
|
52
55
|
|
|
53
56
|
`↑` / `↓` move, `Home` / `End` jump, `Enter` runs, `Esc` closes.
|
|
54
57
|
|
|
55
|
-
##
|
|
58
|
+
## Install a plugin
|
|
56
59
|
|
|
57
60
|
Open the built-in **Plugins** page. Every third-party card under **Installed
|
|
58
|
-
plugins** gains a small
|
|
59
|
-
|
|
61
|
+
plugins** gains a small install icon in its action area. Clicking it opens the
|
|
62
|
+
install dialog:
|
|
60
63
|
|
|
61
64
|
1. The dialog reads the package's published versions from the Host's configured
|
|
62
65
|
registries — the same list the **Add plugin** dialog offers, including the
|
|
63
66
|
npmmirror fallback. Star any registry to make it Power-Up's default for
|
|
64
|
-
later
|
|
67
|
+
later installs; otherwise the list starts from the Add dialog's remembered
|
|
65
68
|
choice.
|
|
66
|
-
2. Type a version or pick one from the floating version list. The
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
2. Type a version or pick one from the floating version list. The version in the
|
|
70
|
+
input is authoritative: both install actions install exactly that version, so
|
|
71
|
+
reinstalling or downgrading works. The installed version is tagged
|
|
72
|
+
**Current**; the newest is tagged **latest**, and a version that is both uses
|
|
73
|
+
one **Current · latest** tag.
|
|
74
|
+
3. **One-click install** installs the version in the input and skips both
|
|
75
|
+
questions: by default the new copy is enabled and DSH restarts automatically.
|
|
76
|
+
The Power-Up page can turn either default off. With auto-enable off, the new
|
|
72
77
|
version is left disabled and nothing restarts. With auto-restart off (or when
|
|
73
78
|
the current runtime cannot restart itself), the completion panel closes
|
|
74
79
|
itself after a few seconds instead of staying on screen. Power-Up's own
|
|
75
|
-
|
|
76
|
-
4. Otherwise, confirming removes the installed copy, checks the
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
install keeps its background handoff and does not offer one-click.
|
|
81
|
+
4. Otherwise, confirming removes the installed copy, checks the spec the way
|
|
82
|
+
**Add plugin** does, and installs the selected version without enabling it.
|
|
83
|
+
Because the old copy is already gone at that point, a refused check or a
|
|
79
84
|
failed install automatically re-installs the removed version with its
|
|
80
85
|
previous enabled state; the dialog reports both the failure and the rollback
|
|
81
86
|
result.
|
|
@@ -89,11 +94,11 @@ update dialog:
|
|
|
89
94
|
plugins** heading. The heading bar is always present — with **No plugins need
|
|
90
95
|
a restart** and the restart button when nothing is pending — and a **Restart
|
|
91
96
|
DSH** button confirms and performs the same restart. The Host also audits
|
|
92
|
-
profile bundle directories written after it started, so
|
|
93
|
-
the built-in **Add plugin** / **
|
|
97
|
+
profile bundle directories written after it started, so installs made through
|
|
98
|
+
the built-in **Add plugin** / **Install** UI, or before this page loaded, are
|
|
94
99
|
marked too.
|
|
95
100
|
|
|
96
|
-
Power-Up
|
|
101
|
+
Power-Up installs itself through the same dialog (the one-click action is hidden
|
|
97
102
|
for itself). Because removing the plugin unloads this panel, the Host answers
|
|
98
103
|
first and then hands `removeBundle` → `inspect` → `installBundle(enabled: true)`
|
|
99
104
|
to the built-in manager service, which keeps running after the Power-Up Host
|
|
@@ -124,23 +129,25 @@ fiber is unloaded. The panel closes; refresh the page when the install finishes.
|
|
|
124
129
|
The typed reason goes to `POST /dsh-powerup/api/job-kill`, which calls the
|
|
125
130
|
registry's `kill(id, session, reason)` — the same admission the built-in
|
|
126
131
|
Remote uses, with the reason settlement merges into the job's `detail` line.
|
|
127
|
-
- **The
|
|
132
|
+
- **The install entry uses the built-in page's contracts.** The Plugins page has
|
|
128
133
|
no per-card slot, so the overlay injects one button into every
|
|
129
134
|
`[data-plugin-group="bundles"] [data-plugin-package]` card and re-asserts it
|
|
130
135
|
after React renders. Version listing is a plain registry `GET`; removal and
|
|
131
136
|
installation use the same `remote.pluginManager` calls as **Add plugin**. The
|
|
132
137
|
Host adds two loopback-only routes: `/dsh-powerup/api/restart` for the
|
|
133
|
-
process restart, and `/dsh-powerup/api/self-update` for the self-
|
|
138
|
+
process restart, and `/dsh-powerup/api/self-update` for the self-install
|
|
134
139
|
handoff.
|
|
135
|
-
- **
|
|
136
|
-
a timer starts `removeBundle` → `inspect` →
|
|
137
|
-
through the built-in manager service. Removing
|
|
138
|
-
own Host fiber, but the manager service and the
|
|
139
|
-
Host process, so the reinstall finishes; failures
|
|
140
|
-
`~/.dsh/powerup/self-update.log`. The Host captures the
|
|
141
|
-
from before removal and re-installs that version if the
|
|
142
|
-
fails, so a failed self-
|
|
143
|
-
|
|
140
|
+
- **Power-Up's own install outlives its unload.** The Host route sends its
|
|
141
|
+
answer, then a timer starts `removeBundle` → `inspect` →
|
|
142
|
+
`installBundle(enabled: true)` through the built-in manager service. Removing
|
|
143
|
+
the bundle unloads Power-Up's own Host fiber, but the manager service and the
|
|
144
|
+
pending promise stay in the Host process, so the reinstall finishes; failures
|
|
145
|
+
are appended to `~/.dsh/powerup/self-update.log`. The Host captures the
|
|
146
|
+
version it was loaded from before removal and re-installs that version if the
|
|
147
|
+
check or install fails, so a failed self-install does not leave Power-Up
|
|
148
|
+
missing.
|
|
149
|
+
- **One-click install is a client-side decision.** Both install actions use the
|
|
150
|
+
version in the dialog input (so reinstall and downgrade are allowed) and both
|
|
144
151
|
defaults live in the shared settings store (`dsh-powerup:settings:v1`), so the
|
|
145
152
|
Power-Up page and an open dialog agree without a reload. A one-click run
|
|
146
153
|
installs disabled — the same shape as **Add plugin** — then enables through
|
|
@@ -148,11 +155,21 @@ fiber is unloaded. The panel closes; refresh the page when the install finishes.
|
|
|
148
155
|
auto-enable off the new copy stays disabled and nothing restarts. When no
|
|
149
156
|
restart happens the completion panel closes on a timer; install, enable, and
|
|
150
157
|
restart failures stay on screen with their reason instead.
|
|
158
|
+
- **The stop dialog is a body portal with host-dialog chrome.** `shell.overlay`
|
|
159
|
+
is an absolute layer at `z-index: 20`, and the host jobs menu is a
|
|
160
|
+
`document.body` portal at `z-index: 100`; a high z-index inside the overlay
|
|
161
|
+
layer therefore still loses. The reason popover is rendered through
|
|
162
|
+
`react-dom`'s `createPortal` into `document.body` and uses `z-index: 1400`.
|
|
163
|
+
Its surface (`--dsw-alias-bg-layer-2`, `--dsw-radius-panel`,
|
|
164
|
+
`--dsw-elevation-prominent`), 34px input, and buttons mirror the host dialog
|
|
165
|
+
and menu primitives; the confirm button reuses the host's armed-stop
|
|
166
|
+
treatment (red border, 12% red fill, red text) instead of inventing a solid
|
|
167
|
+
danger style. Without `react-dom` it falls back to in-place rendering.
|
|
151
168
|
- **Restart status lives in this browser session.** A management result that
|
|
152
169
|
says `restart-required` is written to `sessionStorage`; the card gets a
|
|
153
170
|
**Restart needed** tag and the group heading gets a count plus a restart
|
|
154
171
|
button. The Client also wraps the shared `remote.pluginManager` methods so an
|
|
155
|
-
|
|
172
|
+
install started from the built-in Add plugin/Install dialogs is observed, and
|
|
156
173
|
asks the Host audit route for profile bundles whose files are newer than the
|
|
157
174
|
Host process. A real app restart clears the session, while a page refresh
|
|
158
175
|
keeps the markers.
|
package/client.js
CHANGED
|
@@ -41,10 +41,35 @@
|
|
|
41
41
|
const React = require('react');
|
|
42
42
|
const h = React.createElement;
|
|
43
43
|
const { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } = React;
|
|
44
|
+
// react-dom is a seed module in the host's ModuleLoader (the built-in
|
|
45
|
+
// Client packages require it too). Fall back to in-place rendering when
|
|
46
|
+
// it is missing, so an older host loses layering but keeps working.
|
|
47
|
+
const createPortal = (() => {
|
|
48
|
+
try {
|
|
49
|
+
const dom = require('react-dom');
|
|
50
|
+
return dom !== null && dom !== undefined && typeof dom.createPortal === 'function' ? dom.createPortal : null;
|
|
51
|
+
} catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
})();
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Render a floating panel at the document root. Slot containers own
|
|
58
|
+
* stacking contexts (`position:fixed; z-index:…`), so a high z-index
|
|
59
|
+
* inside a slot still loses to a body-level popover such as the jobs menu.
|
|
60
|
+
* Portaling escapes that context; without react-dom the node stays in
|
|
61
|
+
* place rather than failing.
|
|
62
|
+
* @param {object} node
|
|
63
|
+
* @returns {object}
|
|
64
|
+
*/
|
|
65
|
+
function renderInBody(node) {
|
|
66
|
+
const body = typeof document === 'undefined' || document === null ? null : document.body;
|
|
67
|
+
return createPortal !== null && body !== null ? createPortal(node, body) : node;
|
|
68
|
+
}
|
|
44
69
|
|
|
45
70
|
const NS = 'dsh-powerup';
|
|
46
71
|
const SETTINGS_KEY = 'dsh-powerup:settings:v1';
|
|
47
|
-
const VERSION = '0.
|
|
72
|
+
const VERSION = '0.6.0';
|
|
48
73
|
const MENU_GAP = 8;
|
|
49
74
|
const MENU_WIDTH = 248;
|
|
50
75
|
/** How long a one-click update's completion panel stays open when nothing restarts. */
|
|
@@ -67,15 +92,15 @@
|
|
|
67
92
|
'page.how1': '打开任意会话,切到顶部的「轨迹」视图。',
|
|
68
93
|
'page.how2': '在记录行上右键;在空白处右键可执行会话级操作。',
|
|
69
94
|
'page.how3': '菜单支持 ↑ / ↓ 选择、Enter 执行、Esc 关闭。',
|
|
70
|
-
'page.updateTitle': '
|
|
71
|
-
'page.updateDesc': '
|
|
72
|
-
'page.updateHow': '
|
|
73
|
-
'page.oneClickTitle': '
|
|
74
|
-
'page.oneClickDesc': '
|
|
95
|
+
'page.updateTitle': '插件安装',
|
|
96
|
+
'page.updateDesc': '在插件页为每个第三方已安装插件提供安装入口:从安装源读取版本,按输入框中的版本卸载旧版并按「添加插件」流程安装,完成后可立即启用并选择是否重启 DSH;也可以一键安装。',
|
|
97
|
+
'page.updateHow': '打开侧边栏的「插件」页,在「已安装插件」分组中点击卡片右侧的安装图标;在面板里输入或选择版本后点「一键安装」即可,并按下面的默认行为处理。',
|
|
98
|
+
'page.oneClickTitle': '一键安装',
|
|
99
|
+
'page.oneClickDesc': '在安装面板里点「一键安装」时,直接安装输入框中的版本,跳过「是否启用」和「是否重启」的询问。',
|
|
75
100
|
'page.oneClickEnable': '自动启用新版本',
|
|
76
|
-
'page.oneClickEnableHint': '
|
|
101
|
+
'page.oneClickEnableHint': '关闭后,一键安装只安装版本,保持停用,也不自动重启。',
|
|
77
102
|
'page.oneClickRestart': '自动重启 DSH',
|
|
78
|
-
'page.oneClickRestartHint': '
|
|
103
|
+
'page.oneClickRestartHint': '关闭后,安装完成的提示会自动关闭。',
|
|
79
104
|
'page.jobStopTitle': '后台任务停止原因',
|
|
80
105
|
'page.jobStopDesc': '在会话顶部的后台任务面板里点停止按钮时,可以顺手填写停止原因;原因会附加在任务结束后注入会话的提示里。',
|
|
81
106
|
'page.jobStopHow': '打开任意会话,点顶部的「后台任务」面板,在运行中的任务右侧点停止,填写原因(可留空)后确认。',
|
|
@@ -124,6 +149,8 @@
|
|
|
124
149
|
'toast.forkUnavailable': '当前宿主没有提供 Fork 接口',
|
|
125
150
|
'toast.noSession': '还没有打开会话',
|
|
126
151
|
'jobStop.title': '停止后台任务',
|
|
152
|
+
'jobStop.subtitle': '停止后无法恢复,正在运行的工作会中断。',
|
|
153
|
+
'jobStop.close': '关闭',
|
|
127
154
|
'jobStop.reasonLabel': '停止原因(可选)',
|
|
128
155
|
'jobStop.reasonPlaceholder': '例如:已经不需要这个结果了',
|
|
129
156
|
'jobStop.reasonNote': '原因会附加在任务结束后注入会话的提示里。',
|
|
@@ -131,9 +158,9 @@
|
|
|
131
158
|
'jobStop.confirm': '停止任务',
|
|
132
159
|
'jobStop.stopping': '正在停止…',
|
|
133
160
|
'jobStop.failed': '停止失败:{message}',
|
|
134
|
-
'update.button': '
|
|
135
|
-
'update.title': '
|
|
136
|
-
'update.subtitle': '
|
|
161
|
+
'update.button': '安装',
|
|
162
|
+
'update.title': '安装插件',
|
|
163
|
+
'update.subtitle': '按输入框中的版本安装;已安装的副本会先移除。',
|
|
137
164
|
'update.current': '当前版本',
|
|
138
165
|
'update.versionLabel': '版本号',
|
|
139
166
|
'update.versionPlaceholder': '输入版本号,或从列表选择',
|
|
@@ -153,7 +180,7 @@
|
|
|
153
180
|
'update.registryMirror': '中国大陆镜像源',
|
|
154
181
|
'update.registryCustom': '自定义地址',
|
|
155
182
|
'update.registryFrom': '版本列表来自 {registry}',
|
|
156
|
-
'update.start': '
|
|
183
|
+
'update.start': '开始安装',
|
|
157
184
|
'update.cancel': '取消',
|
|
158
185
|
'update.close': '关闭',
|
|
159
186
|
'update.step.checking': '正在校验版本…',
|
|
@@ -174,14 +201,14 @@
|
|
|
174
201
|
'update.restartUnsupported': '当前运行方式无法自动重启:{reason}',
|
|
175
202
|
'update.restarting': 'DSH 正在重启,窗口即将关闭…',
|
|
176
203
|
'update.restartFailed': '重启请求失败:{message}',
|
|
177
|
-
'update.selfUpdateWarning': '
|
|
178
|
-
'update.selfUpdating': 'Power-Up
|
|
204
|
+
'update.selfUpdateWarning': '安装 Power-Up 会在后台卸载并安装所选版本;本面板会关闭,完成后刷新页面。',
|
|
205
|
+
'update.selfUpdating': 'Power-Up 正在后台安装…',
|
|
179
206
|
'update.selfRefresh': '完成后请刷新页面。',
|
|
180
207
|
'update.setDefault': '设为默认',
|
|
181
208
|
'update.defaultTag': '默认',
|
|
182
|
-
'update.defaultHint': '
|
|
209
|
+
'update.defaultHint': '安装列表默认使用此安装源',
|
|
183
210
|
'restart.tag': '需重启',
|
|
184
|
-
'restart.tagHint': '
|
|
211
|
+
'restart.tagHint': '该插件已安装新版本,重启 DSH 后生效',
|
|
185
212
|
'restart.pending': '{count} 个插件待重启',
|
|
186
213
|
'restart.none': '暂无插件需要重启',
|
|
187
214
|
'restart.action': '重启 DSH',
|
|
@@ -189,41 +216,40 @@
|
|
|
189
216
|
'restart.desc': '重启会关闭并重新打开 DSH,正在运行的任务会中断。',
|
|
190
217
|
'restart.cancel': '取消',
|
|
191
218
|
'restart.confirm': '立即重启',
|
|
192
|
-
'update.doneTitle': '
|
|
193
|
-
'update.doneInstalled': '{name}
|
|
219
|
+
'update.doneTitle': '安装完成',
|
|
220
|
+
'update.doneInstalled': '{name} 已安装 {version}。',
|
|
194
221
|
'update.doneDisabled': '{name} 已安装 {version},尚未启用。',
|
|
195
222
|
'update.doneEnabled': '新版本已启用。',
|
|
196
223
|
'update.doneRestart': '部分更改需要重启 DSH 后生效。',
|
|
197
224
|
'update.doneAutoClose': '完成面板将在 {seconds} 秒后自动关闭。',
|
|
198
225
|
'update.doneButton': '完成',
|
|
199
|
-
'update.oneClick': '
|
|
200
|
-
'update.oneClickTitle': '
|
|
201
|
-
'update.oneClickHint': '
|
|
226
|
+
'update.oneClick': '一键安装',
|
|
227
|
+
'update.oneClickTitle': '一键安装',
|
|
228
|
+
'update.oneClickHint': '安装输入框中的版本 {version},跳过「是否启用」和「是否重启」的询问。',
|
|
202
229
|
'update.oneClickDefaults': '自动启用:{enable} · 自动重启:{restart}。可在侧边栏 Power-Up 页面修改。',
|
|
203
230
|
'update.on': '开',
|
|
204
231
|
'update.off': '关',
|
|
205
|
-
'update.
|
|
206
|
-
'update.oneClickUpToDate': '已经是最新版本,无需更新。',
|
|
232
|
+
'update.oneClickNoVersion': '请先输入或选择要安装的版本。',
|
|
207
233
|
'update.oneClickEnableFailed': '新版本已安装,但自动启用失败。请到「插件」页手动启用。',
|
|
208
234
|
'update.oneClickSkippedEnable': '已按设置保持停用;需要时到「插件」页启用。',
|
|
209
|
-
'update.errorTitle': '
|
|
235
|
+
'update.errorTitle': '安装失败',
|
|
210
236
|
'update.rollbackOkTitle': '已恢复旧版本',
|
|
211
|
-
'update.rollbackOkDesc': '
|
|
237
|
+
'update.rollbackOkDesc': '安装失败,{name} 已自动回滚到 {version},仍可继续使用。',
|
|
212
238
|
'update.rollbackFailedTitle': '旧版本恢复失败',
|
|
213
239
|
'update.rollbackFailedDesc': '自动回滚失败:{message}。请到「插件」页用「添加插件」重新安装。',
|
|
214
240
|
'update.rollbackUnavailable': '无法确定旧版本号,未能自动回滚。请到「插件」页重新安装。',
|
|
215
|
-
'update.selfTitle': '
|
|
216
|
-
'update.selfDesc': '
|
|
217
|
-
'update.notRemovable': '该插件受 DSH
|
|
241
|
+
'update.selfTitle': '请用「添加插件」安装 Power-Up 自身',
|
|
242
|
+
'update.selfDesc': '安装 Power-Up 会先卸载本插件,安装流程会随之中断。',
|
|
243
|
+
'update.notRemovable': '该插件受 DSH 管理,不能在这里安装。',
|
|
218
244
|
'update.notBundle': '该包不是 DSH 插件包。',
|
|
219
245
|
'update.alreadyInstalled': '该包已安装,请先卸载旧版本。',
|
|
220
246
|
'update.notFound': '安装源里找不到这个版本。',
|
|
221
|
-
'update.cancelled': '
|
|
247
|
+
'update.cancelled': '安装已取消。',
|
|
222
248
|
'update.installedChip': '未安装',
|
|
223
249
|
'update.unknown': '未知错误',
|
|
224
250
|
'update.invalidVersion': '请输入有效版本号(例如 1.2.3)',
|
|
225
251
|
'update.stopProfile': '当前 profile 不能热卸载该插件,请重启 DSH 后再试。',
|
|
226
|
-
'update.unsupportedTitle': '
|
|
252
|
+
'update.unsupportedTitle': '无法自动安装',
|
|
227
253
|
},
|
|
228
254
|
en: {
|
|
229
255
|
'panel.title': 'Power-Up',
|
|
@@ -238,15 +264,15 @@
|
|
|
238
264
|
'page.how1': 'Open a session and switch to the Trajectory view.',
|
|
239
265
|
'page.how2': 'Right-click a record row; right-click empty space for session actions.',
|
|
240
266
|
'page.how3': 'Use ↑ / ↓ to move, Enter to run, Esc to close.',
|
|
241
|
-
'page.updateTitle': '
|
|
242
|
-
'page.updateDesc': 'Every third-party plugin on the Plugins page gains an
|
|
243
|
-
'page.updateHow': 'Open Plugins in the sidebar and click the
|
|
244
|
-
'page.oneClickTitle': 'One-click
|
|
245
|
-
'page.oneClickDesc': 'One-click
|
|
267
|
+
'page.updateTitle': 'Install plugins',
|
|
268
|
+
'page.updateDesc': 'Every third-party plugin on the Plugins page gains an install entry: read versions from a registry, install the version in the input through the Add plugin path (removing the old copy first), then enable and optionally restart DSH — or use one-click install.',
|
|
269
|
+
'page.updateHow': 'Open Plugins in the sidebar and click the install icon at the right of a card under Installed plugins; in the panel, type or choose a version and press One-click install to use the defaults below.',
|
|
270
|
+
'page.oneClickTitle': 'One-click install',
|
|
271
|
+
'page.oneClickDesc': 'One-click install installs the version in the input and skips both the enable and the restart questions.',
|
|
246
272
|
'page.oneClickEnable': 'Enable the new version automatically',
|
|
247
|
-
'page.oneClickEnableHint': 'When off, one-click
|
|
273
|
+
'page.oneClickEnableHint': 'When off, one-click install only installs the version, leaves it disabled, and does not restart.',
|
|
248
274
|
'page.oneClickRestart': 'Restart DSH automatically',
|
|
249
|
-
'page.oneClickRestartHint': 'When off, the
|
|
275
|
+
'page.oneClickRestartHint': 'When off, the install-complete panel closes itself.',
|
|
250
276
|
'page.jobStopTitle': 'Background job stop reason',
|
|
251
277
|
'page.jobStopDesc': 'When you stop a running job from the background jobs panel in the session header, you can leave a reason; the reason is appended to the notice injected into the session when the job settles.',
|
|
252
278
|
'page.jobStopHow': 'Open a session, expand the background jobs panel, press stop on a running job, type a reason (optional), then confirm.',
|
|
@@ -295,6 +321,8 @@
|
|
|
295
321
|
'toast.forkUnavailable': 'This host does not expose the fork API',
|
|
296
322
|
'toast.noSession': 'No session is open',
|
|
297
323
|
'jobStop.title': 'Stop background job',
|
|
324
|
+
'jobStop.subtitle': 'This cannot be undone; running work will be interrupted.',
|
|
325
|
+
'jobStop.close': 'Close',
|
|
298
326
|
'jobStop.reasonLabel': 'Stop reason (optional)',
|
|
299
327
|
'jobStop.reasonPlaceholder': 'e.g. the result is no longer needed',
|
|
300
328
|
'jobStop.reasonNote': 'The reason is appended to the notice injected into the session when the job settles.',
|
|
@@ -302,9 +330,9 @@
|
|
|
302
330
|
'jobStop.confirm': 'Stop job',
|
|
303
331
|
'jobStop.stopping': 'Stopping…',
|
|
304
332
|
'jobStop.failed': 'Could not stop the job: {message}',
|
|
305
|
-
'update.button': '
|
|
306
|
-
'update.title': '
|
|
307
|
-
'update.subtitle': '
|
|
333
|
+
'update.button': 'Install',
|
|
334
|
+
'update.title': 'Install plugin',
|
|
335
|
+
'update.subtitle': 'Install the version in the input; the installed copy is removed first.',
|
|
308
336
|
'update.current': 'Current version',
|
|
309
337
|
'update.versionLabel': 'Version',
|
|
310
338
|
'update.versionPlaceholder': 'Type a version or pick one from the list',
|
|
@@ -324,7 +352,7 @@
|
|
|
324
352
|
'update.registryMirror': 'Mainland China mirror',
|
|
325
353
|
'update.registryCustom': 'Custom address',
|
|
326
354
|
'update.registryFrom': 'Versions came from {registry}',
|
|
327
|
-
'update.start': '
|
|
355
|
+
'update.start': 'Install',
|
|
328
356
|
'update.cancel': 'Cancel',
|
|
329
357
|
'update.close': 'Close',
|
|
330
358
|
'update.step.checking': 'Checking the version…',
|
|
@@ -345,14 +373,14 @@
|
|
|
345
373
|
'update.restartUnsupported': 'This runtime cannot restart itself: {reason}',
|
|
346
374
|
'update.restarting': 'DSH is restarting; this window will close…',
|
|
347
375
|
'update.restartFailed': 'Restart request failed: {message}',
|
|
348
|
-
'update.selfUpdateWarning': '
|
|
349
|
-
'update.selfUpdating': 'Power-Up is
|
|
376
|
+
'update.selfUpdateWarning': 'Installing Power-Up removes and reinstalls it in the background; this panel closes, then refresh the page.',
|
|
377
|
+
'update.selfUpdating': 'Power-Up is installing in the background…',
|
|
350
378
|
'update.selfRefresh': 'Refresh the page when it finishes.',
|
|
351
379
|
'update.setDefault': 'Set as default',
|
|
352
380
|
'update.defaultTag': 'Default',
|
|
353
|
-
'update.defaultHint': 'The
|
|
381
|
+
'update.defaultHint': 'The install list starts from this registry',
|
|
354
382
|
'restart.tag': 'Restart needed',
|
|
355
|
-
'restart.tagHint': '
|
|
383
|
+
'restart.tagHint': 'Installed; restart DSH to apply',
|
|
356
384
|
'restart.pending': '{count} plugins need a restart',
|
|
357
385
|
'restart.none': 'No plugins need a restart',
|
|
358
386
|
'restart.action': 'Restart DSH',
|
|
@@ -360,41 +388,40 @@
|
|
|
360
388
|
'restart.desc': 'Restarting closes and reopens DSH; running tasks are interrupted.',
|
|
361
389
|
'restart.cancel': 'Cancel',
|
|
362
390
|
'restart.confirm': 'Restart now',
|
|
363
|
-
'update.doneTitle': '
|
|
364
|
-
'update.doneInstalled': '{name}
|
|
391
|
+
'update.doneTitle': 'Install complete',
|
|
392
|
+
'update.doneInstalled': '{name} installed {version}.',
|
|
365
393
|
'update.doneDisabled': '{name} {version} is installed but not enabled.',
|
|
366
394
|
'update.doneEnabled': 'The new version is enabled.',
|
|
367
395
|
'update.doneRestart': 'Some changes apply only after DSH restarts.',
|
|
368
396
|
'update.doneAutoClose': 'This panel closes itself in {seconds} seconds.',
|
|
369
397
|
'update.doneButton': 'Done',
|
|
370
|
-
'update.oneClick': 'One-click
|
|
371
|
-
'update.oneClickTitle': 'One-click
|
|
372
|
-
'update.oneClickHint': 'Installs the
|
|
398
|
+
'update.oneClick': 'One-click install',
|
|
399
|
+
'update.oneClickTitle': 'One-click install',
|
|
400
|
+
'update.oneClickHint': 'Installs the version in the input ({version}) and skips the enable and restart questions.',
|
|
373
401
|
'update.oneClickDefaults': 'Auto-enable: {enable} · Auto-restart: {restart}. Change these on the Power-Up page.',
|
|
374
402
|
'update.on': 'on',
|
|
375
403
|
'update.off': 'off',
|
|
376
|
-
'update.
|
|
377
|
-
'update.
|
|
378
|
-
'update.oneClickEnableFailed': 'The new version is installed but could not be enabled. Enable it on the Plugins page.',
|
|
404
|
+
'update.oneClickNoVersion': 'Type or choose a version to install first.',
|
|
405
|
+
'update.oneClickEnableFailed': 'The version is installed but could not be enabled. Enable it on the Plugins page.',
|
|
379
406
|
'update.oneClickSkippedEnable': 'Left disabled as configured; enable it on the Plugins page when ready.',
|
|
380
|
-
'update.errorTitle': '
|
|
407
|
+
'update.errorTitle': 'Install failed',
|
|
381
408
|
'update.rollbackOkTitle': 'Previous version restored',
|
|
382
|
-
'update.rollbackOkDesc': 'The
|
|
409
|
+
'update.rollbackOkDesc': 'The install failed, so {name} was rolled back to {version} and is ready to use.',
|
|
383
410
|
'update.rollbackFailedTitle': 'Could not restore the previous version',
|
|
384
411
|
'update.rollbackFailedDesc': 'Automatic rollback failed: {message}. Reinstall it from the Plugins page with “Add plugin”.',
|
|
385
412
|
'update.rollbackUnavailable': 'The previous version is unknown, so no automatic rollback was possible. Reinstall it from the Plugins page.',
|
|
386
|
-
'update.selfTitle': '
|
|
387
|
-
'update.selfDesc': '
|
|
388
|
-
'update.notRemovable': 'DSH manages this plugin; it cannot be
|
|
413
|
+
'update.selfTitle': 'Install Power-Up with Add plugin',
|
|
414
|
+
'update.selfDesc': 'Installing Power-Up removes this plugin first, which interrupts this flow.',
|
|
415
|
+
'update.notRemovable': 'DSH manages this plugin; it cannot be installed here.',
|
|
389
416
|
'update.notBundle': 'This package is not a DSH plugin bundle.',
|
|
390
417
|
'update.alreadyInstalled': 'This package is already installed; remove the old version first.',
|
|
391
418
|
'update.notFound': 'That version is not available from the registry.',
|
|
392
|
-
'update.cancelled': 'The
|
|
419
|
+
'update.cancelled': 'The install was cancelled.',
|
|
393
420
|
'update.installedChip': 'Not installed',
|
|
394
421
|
'update.unknown': 'Unknown error',
|
|
395
422
|
'update.invalidVersion': 'Enter a valid version, for example 1.2.3.',
|
|
396
423
|
'update.stopProfile': 'This profile cannot hot-remove the plugin; restart DSH and try again.',
|
|
397
|
-
'update.unsupportedTitle': 'Cannot
|
|
424
|
+
'update.unsupportedTitle': 'Cannot install automatically',
|
|
398
425
|
},
|
|
399
426
|
};
|
|
400
427
|
|
|
@@ -807,26 +834,35 @@
|
|
|
807
834
|
.dsh-powerup-menu-foot-id{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--dsw-font-family-code,ui-monospace,SFMono-Regular,Consolas,monospace)}
|
|
808
835
|
.dsh-powerup-toast{position:fixed;left:50%;bottom:30px;transform:translateX(-50%);z-index:1001;max-width:min(440px,calc(100vw - 32px));padding:7px 12px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-overlay,var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-lv2,0 8px 24px rgba(15,23,42,.18));font-size:12px;line-height:1.45;pointer-events:none;animation:dsh-powerup-toast-in .14s ease-out}
|
|
809
836
|
@keyframes dsh-powerup-toast-in{from{opacity:0;transform:translate(-50%,5px)}to{opacity:1;transform:translate(-50%,0)}}
|
|
810
|
-
.dsh-powerup-jobstop{position:fixed;z-index:
|
|
811
|
-
@keyframes dsh-powerup-jobstop-in{from{opacity:0;transform:translateY(
|
|
812
|
-
.dsh-powerup-jobstop-head{display:flex;align-items:
|
|
813
|
-
.dsh-powerup-jobstop-
|
|
814
|
-
.dsh-powerup-jobstop-
|
|
815
|
-
.dsh-powerup-jobstop-
|
|
816
|
-
.dsh-powerup-jobstop-
|
|
837
|
+
.dsh-powerup-jobstop{position:fixed;z-index:1400;box-sizing:border-box;display:flex;flex-direction:column;padding:0 0 16px;border:0;border-radius:var(--dsw-radius-panel);background:var(--dsw-alias-bg-layer-2);box-shadow:var(--dsw-elevation-prominent);--dsw-elevation-stroke-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);font-size:12px;line-height:18px;pointer-events:auto;overflow-y:auto;--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);animation:dsh-powerup-jobstop-in .16s ease-out}
|
|
838
|
+
@keyframes dsh-powerup-jobstop-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
|
|
839
|
+
.dsh-powerup-jobstop-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:18px 12px 6px 20px}
|
|
840
|
+
.dsh-powerup-jobstop-heading{display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
841
|
+
.dsh-powerup-jobstop-title{color:var(--dsw-alias-label-primary);font-size:16px;line-height:24px;font-weight:500}
|
|
842
|
+
.dsh-powerup-jobstop-subtitle{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}
|
|
843
|
+
.dsh-powerup-jobstop-close{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;margin:-4px -2px 0 0;padding:0;border:0;border-radius:var(--dsw-radius-sm);background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:18px;line-height:1;cursor:pointer}
|
|
844
|
+
.dsh-powerup-jobstop-close:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
|
|
845
|
+
.dsh-powerup-jobstop-label{display:flex;align-items:center;gap:6px;min-width:0;margin:6px 20px 0;font-size:11.5px;line-height:18px}
|
|
846
|
+
.dsh-powerup-jobstop-dot{flex:none;width:6px;height:6px;border-radius:50%;background:var(--dsw-alias-state-success-primary)}
|
|
847
|
+
.dsh-powerup-jobstop-kind{flex:none;padding:0 5px;border-radius:var(--dsw-radius-xs);background:var(--dsw-specific-menu);color:var(--dsw-alias-label-tertiary);font-family:var(--dsw-font-family-code,ui-monospace,SFMono-Regular,Consolas,monospace);font-size:10.5px;line-height:16px}
|
|
848
|
+
.dsh-powerup-jobstop-label-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-family-code,ui-monospace,SFMono-Regular,Consolas,monospace);font-size:11.5px;line-height:18px}
|
|
849
|
+
.dsh-powerup-jobstop-body{display:flex;flex-direction:column;gap:12px;margin-top:12px;padding:0 20px}
|
|
850
|
+
.dsh-powerup-jobstop-field{display:flex;flex-direction:column;gap:6px;min-width:0}
|
|
817
851
|
.dsh-powerup-jobstop-field-label{color:var(--dsw-alias-label-secondary);font-size:11.5px;line-height:17px}
|
|
818
|
-
.dsh-powerup-jobstop-input{box-sizing:border-box;width:100%;height:
|
|
819
|
-
.dsh-powerup-jobstop-input::placeholder{color:var(--dsw-alias-label-
|
|
820
|
-
.dsh-powerup-jobstop-input:focus{border-color:var(--dsw-alias-state-business-primary)
|
|
821
|
-
.dsh-powerup-jobstop-
|
|
822
|
-
.dsh-powerup-jobstop-
|
|
823
|
-
.dsh-powerup-jobstop-
|
|
824
|
-
.dsh-powerup-jobstop-
|
|
825
|
-
.dsh-powerup-jobstop-cancel:
|
|
826
|
-
.dsh-powerup-jobstop-
|
|
827
|
-
.dsh-powerup-jobstop-
|
|
828
|
-
.dsh-powerup-jobstop-confirm:
|
|
829
|
-
.dsh-powerup-jobstop-
|
|
852
|
+
.dsh-powerup-jobstop-input{box-sizing:border-box;width:100%;height:34px;padding:0 12px;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:1.5;outline:none;transition:border-color .14s ease}
|
|
853
|
+
.dsh-powerup-jobstop-input::placeholder{color:var(--dsw-alias-label-dimmed)}
|
|
854
|
+
.dsh-powerup-jobstop-input:focus-visible{outline:none;border-color:var(--dsw-alias-state-business-primary)}
|
|
855
|
+
.dsh-powerup-jobstop-input:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}
|
|
856
|
+
.dsh-powerup-jobstop-note{margin:0;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}
|
|
857
|
+
.dsh-powerup-jobstop-error{margin:0;color:var(--dsw-alias-state-error-primary);font-size:11.5px;line-height:17px;overflow-wrap:anywhere}
|
|
858
|
+
.dsh-powerup-jobstop-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:14px 20px 0}
|
|
859
|
+
.dsh-powerup-jobstop-cancel{height:36px;padding:0 14px;border:0;border-radius:var(--dsw-radius-md);background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:14px;line-height:22px;cursor:pointer}
|
|
860
|
+
.dsh-powerup-jobstop-cancel:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
|
|
861
|
+
.dsh-powerup-jobstop-cancel:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}
|
|
862
|
+
.dsh-powerup-jobstop-confirm{height:36px;padding:0 14px;border:.5px solid color-mix(in srgb,var(--dsw-alias-state-error-primary) 45%,transparent);border-radius:var(--dsw-radius-md);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent);color:var(--dsw-alias-state-error-primary);font:inherit;font-size:14px;line-height:22px;cursor:pointer;transition:background .14s ease}
|
|
863
|
+
.dsh-powerup-jobstop-confirm:hover:not(:disabled){background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 18%,transparent)}
|
|
864
|
+
.dsh-powerup-jobstop-confirm:disabled,.dsh-powerup-jobstop-cancel:disabled,.dsh-powerup-jobstop-close:disabled{opacity:.4;cursor:not-allowed}
|
|
865
|
+
.dsh-powerup-jobstop-cancel:focus-visible,.dsh-powerup-jobstop-confirm:focus-visible,.dsh-powerup-jobstop-close:focus-visible,.dsh-powerup-jobstop-input:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}
|
|
830
866
|
@media (prefers-reduced-motion:reduce){.dsh-powerup-jobstop{animation:none}}
|
|
831
867
|
.dsh-powerup-update-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-caption);cursor:pointer}
|
|
832
868
|
.dsh-powerup-update-button:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary)}
|
|
@@ -1693,30 +1729,14 @@
|
|
|
1693
1729
|
}
|
|
1694
1730
|
|
|
1695
1731
|
/**
|
|
1696
|
-
* The version
|
|
1697
|
-
*
|
|
1698
|
-
*
|
|
1699
|
-
* @
|
|
1700
|
-
|
|
1701
|
-
function oneClickVersion(view) {
|
|
1702
|
-
const declared = normalizeVersionInput(view?.latest);
|
|
1703
|
-
if (declared !== '') return declared;
|
|
1704
|
-
const first = Array.isArray(view?.versions) ? view.versions[0] : null;
|
|
1705
|
-
return normalizeVersionInput(first);
|
|
1706
|
-
}
|
|
1707
|
-
|
|
1708
|
-
/**
|
|
1709
|
-
* Whether a target version is strictly newer than the installed one.
|
|
1710
|
-
* @param {unknown} target
|
|
1711
|
-
* @param {unknown} current
|
|
1712
|
-
* @returns {boolean}
|
|
1732
|
+
* The version both install paths target: whatever is in the dialog's
|
|
1733
|
+
* version input. One-click install reads the same input instead of the
|
|
1734
|
+
* registry's newest version, so it can also reinstall or downgrade.
|
|
1735
|
+
* @param {{ version?: unknown }} view
|
|
1736
|
+
* @returns {string} a concrete version, or '' when the input is invalid.
|
|
1713
1737
|
*/
|
|
1714
|
-
function
|
|
1715
|
-
|
|
1716
|
-
if (version === '') return false;
|
|
1717
|
-
const installed = normalizeVersionInput(current);
|
|
1718
|
-
if (installed === '') return true;
|
|
1719
|
-
return compareVersionsDesc(version, installed) < 0;
|
|
1738
|
+
function installVersion(view) {
|
|
1739
|
+
return normalizeVersionInput(view?.version);
|
|
1720
1740
|
}
|
|
1721
1741
|
|
|
1722
1742
|
/** A display title for a bundle, following the page's locale fallback. */
|
|
@@ -2267,8 +2287,10 @@
|
|
|
2267
2287
|
};
|
|
2268
2288
|
|
|
2269
2289
|
if (target === null) return null;
|
|
2270
|
-
const placement = popoverPlacement({ getBoundingClientRect: () => target.rect },
|
|
2271
|
-
|
|
2290
|
+
const placement = popoverPlacement({ getBoundingClientRect: () => target.rect }, 340, 300);
|
|
2291
|
+
// The body portal escapes every slot's stacking context, so the same
|
|
2292
|
+
// panel is above the host jobs menu (z-index 100) in both themes.
|
|
2293
|
+
return renderInBody(h('div', {
|
|
2272
2294
|
ref: panelRef,
|
|
2273
2295
|
className: 'dsh-powerup-jobstop',
|
|
2274
2296
|
role: 'dialog',
|
|
@@ -2295,23 +2317,44 @@
|
|
|
2295
2317
|
void submit();
|
|
2296
2318
|
},
|
|
2297
2319
|
},
|
|
2298
|
-
h('div', { className: 'dsh-powerup-jobstop-head' },
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
placeholder: t('jobStop.reasonPlaceholder'),
|
|
2320
|
+
h('div', { className: 'dsh-powerup-jobstop-head' },
|
|
2321
|
+
h('div', { className: 'dsh-powerup-jobstop-heading' },
|
|
2322
|
+
h('span', { className: 'dsh-powerup-jobstop-title' }, t('jobStop.title')),
|
|
2323
|
+
h('span', { className: 'dsh-powerup-jobstop-subtitle' }, t('jobStop.subtitle')),
|
|
2324
|
+
),
|
|
2325
|
+
h('button', {
|
|
2326
|
+
type: 'button',
|
|
2327
|
+
className: 'dsh-powerup-jobstop-close',
|
|
2328
|
+
'aria-label': t('jobStop.close'),
|
|
2329
|
+
title: t('jobStop.close'),
|
|
2309
2330
|
disabled: pending,
|
|
2310
|
-
|
|
2311
|
-
}),
|
|
2331
|
+
onClick: close,
|
|
2332
|
+
}, '×'),
|
|
2333
|
+
),
|
|
2334
|
+
h('div', { className: 'dsh-powerup-jobstop-label', title: target.job.label },
|
|
2335
|
+
h('span', { className: 'dsh-powerup-jobstop-dot', 'aria-hidden': 'true' }),
|
|
2336
|
+
typeof target.job.kind === 'string' && target.job.kind !== ''
|
|
2337
|
+
? h('span', { className: 'dsh-powerup-jobstop-kind' }, target.job.kind)
|
|
2338
|
+
: null,
|
|
2339
|
+
h('span', { className: 'dsh-powerup-jobstop-label-text' }, target.job.label),
|
|
2340
|
+
),
|
|
2341
|
+
h('div', { className: 'dsh-powerup-jobstop-body' },
|
|
2342
|
+
h('label', { className: 'dsh-powerup-jobstop-field' },
|
|
2343
|
+
h('span', { className: 'dsh-powerup-jobstop-field-label' }, t('jobStop.reasonLabel')),
|
|
2344
|
+
h('input', {
|
|
2345
|
+
ref: inputRef,
|
|
2346
|
+
className: 'dsh-powerup-jobstop-input',
|
|
2347
|
+
type: 'text',
|
|
2348
|
+
value: reason,
|
|
2349
|
+
maxLength: JOB_STOP_REASON_MAX,
|
|
2350
|
+
placeholder: t('jobStop.reasonPlaceholder'),
|
|
2351
|
+
disabled: pending,
|
|
2352
|
+
onChange: (event) => setReason(event.target.value),
|
|
2353
|
+
}),
|
|
2354
|
+
),
|
|
2355
|
+
h('p', { className: 'dsh-powerup-jobstop-note' }, t('jobStop.reasonNote')),
|
|
2356
|
+
error === null ? null : h('p', { className: 'dsh-powerup-jobstop-error', role: 'alert' }, error),
|
|
2312
2357
|
),
|
|
2313
|
-
h('p', { className: 'dsh-powerup-jobstop-note' }, t('jobStop.reasonNote')),
|
|
2314
|
-
error === null ? null : h('p', { className: 'dsh-powerup-jobstop-error', role: 'alert' }, error),
|
|
2315
2358
|
h('div', { className: 'dsh-powerup-jobstop-actions' },
|
|
2316
2359
|
h('button', {
|
|
2317
2360
|
type: 'button',
|
|
@@ -2325,7 +2368,7 @@
|
|
|
2325
2368
|
disabled: pending,
|
|
2326
2369
|
onClick: () => { void submit(); },
|
|
2327
2370
|
}, pending ? t('jobStop.stopping') : t('jobStop.confirm')),
|
|
2328
|
-
));
|
|
2371
|
+
)));
|
|
2329
2372
|
}
|
|
2330
2373
|
|
|
2331
2374
|
/**
|
|
@@ -2860,20 +2903,16 @@
|
|
|
2860
2903
|
if (token === null || current === null || current.phase !== 'choose') return;
|
|
2861
2904
|
const t = tRef.current;
|
|
2862
2905
|
const oneClick = options?.oneClick === true;
|
|
2863
|
-
//
|
|
2864
|
-
//
|
|
2865
|
-
const version =
|
|
2906
|
+
// Both paths install the version in the input. One-click only skips
|
|
2907
|
+
// the enable/restart questions, so reinstalling or downgrading works.
|
|
2908
|
+
const version = installVersion(current);
|
|
2866
2909
|
if (version === '') {
|
|
2867
2910
|
setView((state) => state === null ? state : {
|
|
2868
2911
|
...state,
|
|
2869
|
-
formError: t(oneClick ? 'update.
|
|
2912
|
+
formError: t(oneClick ? 'update.oneClickNoVersion' : 'update.invalidVersion'),
|
|
2870
2913
|
});
|
|
2871
2914
|
return;
|
|
2872
2915
|
}
|
|
2873
|
-
if (oneClick && isUpdateAvailable(version, current.currentVersion) !== true) {
|
|
2874
|
-
setView((state) => state === null ? state : { ...state, formError: t('update.oneClickUpToDate') });
|
|
2875
|
-
return;
|
|
2876
|
-
}
|
|
2877
2916
|
const choice = current.choices.find((item) => item.key === current.registryKey) ?? current.choices[0];
|
|
2878
2917
|
const registry = registryValue(choice);
|
|
2879
2918
|
const spec = `${current.name}@${version}`;
|
|
@@ -3169,12 +3208,9 @@
|
|
|
3169
3208
|
const canClose = !busy;
|
|
3170
3209
|
const title = view.title === undefined || view.title === '' ? view.name : view.title;
|
|
3171
3210
|
const showVersions = view.phase === 'choose' && view.listOpen === true;
|
|
3172
|
-
//
|
|
3173
|
-
const quickVersion =
|
|
3174
|
-
const quickAvailable = view.self !== true
|
|
3175
|
-
&& view.versionsState === 'ready'
|
|
3176
|
-
&& quickVersion !== ''
|
|
3177
|
-
&& isUpdateAvailable(quickVersion, view.currentVersion);
|
|
3211
|
+
// One-click install uses exactly what the version input holds.
|
|
3212
|
+
const quickVersion = installVersion(view);
|
|
3213
|
+
const quickAvailable = view.self !== true && quickVersion !== '';
|
|
3178
3214
|
|
|
3179
3215
|
const footer = (() => {
|
|
3180
3216
|
if (view.phase === 'choose') {
|
|
@@ -3189,16 +3225,14 @@
|
|
|
3189
3225
|
disabled: !quickAvailable,
|
|
3190
3226
|
title: quickAvailable
|
|
3191
3227
|
? t('update.oneClickHint', { version: quickVersion })
|
|
3192
|
-
:
|
|
3193
|
-
? t('update.oneClickNoLatest')
|
|
3194
|
-
: t('update.oneClickUpToDate'),
|
|
3228
|
+
: t('update.oneClickNoVersion'),
|
|
3195
3229
|
onClick: () => startUpdate({ oneClick: true }),
|
|
3196
3230
|
}, h(QuickIcon, { size: 13 }), t('update.oneClick')),
|
|
3197
3231
|
h('button', {
|
|
3198
3232
|
key: 'start',
|
|
3199
3233
|
type: 'button',
|
|
3200
3234
|
className: 'dsh-powerup-update-primary',
|
|
3201
|
-
disabled:
|
|
3235
|
+
disabled: quickVersion === '',
|
|
3202
3236
|
onClick: () => startUpdate(),
|
|
3203
3237
|
}, t('update.start')),
|
|
3204
3238
|
].filter(Boolean);
|
|
@@ -3372,9 +3406,7 @@
|
|
|
3372
3406
|
),
|
|
3373
3407
|
h('p', { className: 'dsh-powerup-update-note' }, quickAvailable
|
|
3374
3408
|
? t('update.oneClickHint', { version: quickVersion })
|
|
3375
|
-
:
|
|
3376
|
-
? t('update.oneClickNoLatest')
|
|
3377
|
-
: t('update.oneClickUpToDate')),
|
|
3409
|
+
: t('update.oneClickNoVersion')),
|
|
3378
3410
|
quickAvailable
|
|
3379
3411
|
? h('p', { className: 'dsh-powerup-update-note' }, t('update.oneClickDefaults', {
|
|
3380
3412
|
enable: getSettings().oneClickEnable === false ? t('update.off') : t('update.on'),
|
|
@@ -4011,6 +4043,7 @@
|
|
|
4011
4043
|
PowerUpOverlay,
|
|
4012
4044
|
PluginUpdateOverlay,
|
|
4013
4045
|
JobStopOverlay,
|
|
4046
|
+
renderInBody,
|
|
4014
4047
|
stopButtonLabel,
|
|
4015
4048
|
resolveStopTarget,
|
|
4016
4049
|
ensureUpdateButtons,
|
|
@@ -4039,8 +4072,7 @@
|
|
|
4039
4072
|
readRememberedRegistry,
|
|
4040
4073
|
packageDisplayTitle,
|
|
4041
4074
|
normalizeVersionInput,
|
|
4042
|
-
|
|
4043
|
-
isUpdateAvailable,
|
|
4075
|
+
installVersion,
|
|
4044
4076
|
readSettings,
|
|
4045
4077
|
getSettings,
|
|
4046
4078
|
setSettings,
|
package/locale/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Power-Up",
|
|
4
|
-
"description": "Adds a right-click action menu to the Trajectory ledger: copy a record, copy a Markdown quote, quote it into the composer, open the record inspector, fork the session at that record, export the trajectory snapshot, and copy the session ID. The session header's background jobs panel gains an optional stop reason when a job is stopped by hand; the reason is appended to the completion notice injected into the session. The Plugins page gains an
|
|
4
|
+
"description": "Adds a right-click action menu to the Trajectory ledger: copy a record, copy a Markdown quote, quote it into the composer, open the record inspector, fork the session at that record, export the trajectory snapshot, and copy the session ID. The session header's background jobs panel gains an optional stop reason when a job is stopped by hand; the reason is appended to the completion notice injected into the session. The Plugins page gains an install control on every third-party installed plugin: read versions from the registry, install the version in the input through the Add plugin path (removing the old copy first), then enable and optionally restart DSH. The install panel also offers a one-click install that installs the input version without the enable and restart questions, enabling and restarting automatically by default; both defaults are configurable on the Power-Up page."
|
|
5
5
|
}
|
|
6
6
|
}
|
package/locale/zh.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Power-Up",
|
|
4
|
-
"description": "在轨迹页面为记录增加右键操作菜单:复制内容、复制 Markdown 引用、引用到输入框、查看记录详情、从该记录 Fork 会话、导出轨迹快照、复制会话 ID
|
|
4
|
+
"description": "在轨迹页面为记录增加右键操作菜单:复制内容、复制 Markdown 引用、引用到输入框、查看记录详情、从该记录 Fork 会话、导出轨迹快照、复制会话 ID。在会话顶部的后台任务面板手动停止任务时可以填写停止原因,原因会附加在任务结束后注入会话的提示里。插件页为每个第三方已安装插件增加安装按钮:从安装源读取版本,按输入框中的版本先卸载旧版再按「添加插件」流程安装,完成后可立即启用并选择是否重启 DSH。安装面板还提供「一键安装」:按输入框版本安装并跳过启用与重启的询问,默认自动启用并重启,可在 Power-Up 页面调整默认行为。"
|
|
5
5
|
}
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restregular/dsh-powerup",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Power-Up — small, opt-in upgrades for DeepSeek Harness. Adds a right-click action menu to the Trajectory ledger, an optional stop reason in the session header's background jobs panel (appended to the injected completion notice), and an
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Power-Up — small, opt-in upgrades for DeepSeek Harness. Adds a right-click action menu to the Trajectory ledger, an optional stop reason in the session header's background jobs panel (appended to the injected completion notice), and an install control for third-party plugins from the Plugins page: read versions from the configured registries, install the version in the input through the Add plugin path (removing the old copy first), mark restart-needed installs, hand Power-Up's own install to the background, and optionally restart DSH. One-click install skips the enable and restart questions and can apply those actions automatically with configurable defaults. · 为 DeepSeek Harness 提供小型增强:在轨迹页面右键记录即可复制、引用、查看详情或从该记录 Fork;在会话顶部的后台任务面板手动停止任务时可填写停止原因,原因会附加到任务结束后的会话提示;并在插件页为第三方已安装插件提供安装按钮,从安装源读取版本,按输入框中的版本沿用「添加插件」流程安装(先卸载旧版),支持待重启标记、Power-Up 自身后台安装与可选重启;安装面板提供「一键安装」,按输入框版本安装并跳过启用/重启询问,默认自动启用并重启,可在 Power-Up 页面调整默认行为。",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "index.js",
|