@restregular/dsh-powerup 0.19.13 → 0.19.14
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/client.js +172 -71
- package/package.json +1 -2
package/client.js
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
const requirementCreateDraft = { workspaceId: null, title: '', text: '', scope: 'current' };
|
|
99
99
|
/** Fallback bucket when the hero cannot resolve an owning workspace yet. */
|
|
100
100
|
const UNSCOPED_WORKSPACE = '__unscoped__';
|
|
101
|
-
const VERSION = '0.19.
|
|
101
|
+
const VERSION = '0.19.14';
|
|
102
102
|
const MENU_GAP = 8;
|
|
103
103
|
const MENU_WIDTH = 248;
|
|
104
104
|
/** Reference scheme understood by the Host's `powerup_step_read` tool. */
|
|
@@ -116,11 +116,16 @@
|
|
|
116
116
|
'page.subtitle': '给 DeepSeek Harness 加一点助推。',
|
|
117
117
|
'page.featureTitle': '轨迹右键菜单',
|
|
118
118
|
'page.featureDesc': '在轨迹页面右键任意记录,快速复制、引用、查看详情、复制步骤引用,或从该记录 Fork 出一个新会话。',
|
|
119
|
+
'page.featureHow1': '打开任意会话,切到顶部的「轨迹」视图。',
|
|
120
|
+
'page.featureHow2': '在记录行上右键;在空白处右键可执行会话级操作。',
|
|
121
|
+
'page.featureHow3': '菜单支持 ↑ / ↓ 选择、Enter 执行、Esc 关闭。',
|
|
119
122
|
'page.enabled': '已启用',
|
|
120
123
|
'page.disabled': '已停用',
|
|
121
124
|
'page.details': '详情',
|
|
122
125
|
'page.more': '更多',
|
|
123
126
|
'page.collapse': '收起',
|
|
127
|
+
'page.sectionDesc': '具体描述',
|
|
128
|
+
'page.sectionHow': '使用教程',
|
|
124
129
|
'page.featureBrief': '右键轨迹记录,快速复制、引用、查看、Fork。',
|
|
125
130
|
'page.launcherBrief': '把侧边栏面板按钮变成可拖拽排序的图标网格。',
|
|
126
131
|
'page.sessionSwitchBrief': '点击会话标题,在运行中的会话间切换。',
|
|
@@ -134,6 +139,10 @@
|
|
|
134
139
|
'page.promptsBrief': '为每个工作区保存可复用的提示词。',
|
|
135
140
|
'page.jobStopBrief': '停止后台任务时顺手填写停止原因。',
|
|
136
141
|
'page.updateBrief': '为第三方插件提供安装入口。',
|
|
142
|
+
'page.themeTitle': '系统亮暗模式切换',
|
|
143
|
+
'page.themeBrief': '在侧边栏点一下图标,在亮色与暗色之间切换。',
|
|
144
|
+
'page.themeDesc': '在左侧边栏的品牌行加入一个主题切换按钮:点击即在亮色和暗色之间切换,图标随当前配色显示(暗色显示太阳,亮色显示月亮)。主题偏好交给 DSH 自身的主题服务保存,与系统设置里的「外观」保持一致。',
|
|
145
|
+
'page.themeHow': '启用本功能后,左侧边栏顶部品牌名旁会出现一个太阳/月亮图标,点击即可切换亮暗模式;关闭本功能后按钮消失,主题设置仍由 DSH 管理。',
|
|
137
146
|
'theme.toLight': '切换到亮色模式',
|
|
138
147
|
'theme.toDark': '切换到暗色模式',
|
|
139
148
|
'page.actions': '可用操作',
|
|
@@ -543,11 +552,16 @@
|
|
|
543
552
|
'page.subtitle': 'A little boost for DeepSeek Harness.',
|
|
544
553
|
'page.featureTitle': 'Trajectory context menu',
|
|
545
554
|
'page.featureDesc': 'Right-click any trajectory record to copy it, quote it, open its inspector, copy a step reference, or fork the session at that point.',
|
|
555
|
+
'page.featureHow1': 'Open a session and switch to the Trajectory view.',
|
|
556
|
+
'page.featureHow2': 'Right-click a record row; right-click empty space for session actions.',
|
|
557
|
+
'page.featureHow3': 'Use ↑ / ↓ to move, Enter to run, Esc to close.',
|
|
546
558
|
'page.enabled': 'Enabled',
|
|
547
559
|
'page.disabled': 'Disabled',
|
|
548
560
|
'page.details': 'Details',
|
|
549
561
|
'page.more': 'More',
|
|
550
562
|
'page.collapse': 'Hide',
|
|
563
|
+
'page.sectionDesc': 'Description',
|
|
564
|
+
'page.sectionHow': 'How to use',
|
|
551
565
|
'page.featureBrief': 'Right-click a trajectory record to copy, quote, inspect, or fork it.',
|
|
552
566
|
'page.launcherBrief': 'Turn sidebar panel buttons into a draggable, sortable icon grid.',
|
|
553
567
|
'page.sessionSwitchBrief': 'Click the session title to switch between running sessions.',
|
|
@@ -561,6 +575,10 @@
|
|
|
561
575
|
'page.promptsBrief': 'Save reusable prompts per workspace.',
|
|
562
576
|
'page.jobStopBrief': 'Leave a reason when stopping a background job.',
|
|
563
577
|
'page.updateBrief': 'Add an install entry to third-party plugins.',
|
|
578
|
+
'page.themeTitle': 'Light/dark mode switch',
|
|
579
|
+
'page.themeBrief': 'Toggle light and dark mode from a sidebar button.',
|
|
580
|
+
'page.themeDesc': 'Adds a theme toggle button to the sidebar brand row: one click flips between light and dark, with the icon following the active palette (sun in dark mode, moon in light mode). The preference is persisted by DSH\'s own theme service, in sync with the Appearance setting.',
|
|
581
|
+
'page.themeHow': 'Once enabled, a sun/moon icon appears next to the brand name at the top of the left sidebar; click it to switch palettes. Turning the feature off removes the button; theme preferences remain managed by DSH.',
|
|
564
582
|
'theme.toLight': 'Switch to light mode',
|
|
565
583
|
'theme.toDark': 'Switch to dark mode',
|
|
566
584
|
'page.actions': 'What you can do',
|
|
@@ -1001,6 +1019,7 @@
|
|
|
1001
1019
|
update: true,
|
|
1002
1020
|
locateSession: true,
|
|
1003
1021
|
scrollToTop: true,
|
|
1022
|
+
themeToggle: true,
|
|
1004
1023
|
contentRendering: true,
|
|
1005
1024
|
dualSend: false,
|
|
1006
1025
|
workspacePrompts: true,
|
|
@@ -1028,6 +1047,7 @@
|
|
|
1028
1047
|
update: parsed.update !== false,
|
|
1029
1048
|
locateSession: parsed.locateSession !== false,
|
|
1030
1049
|
scrollToTop: parsed.scrollToTop !== false,
|
|
1050
|
+
themeToggle: parsed.themeToggle !== false,
|
|
1031
1051
|
contentRendering: parsed.contentRendering !== false,
|
|
1032
1052
|
dualSend: parsed.dualSend === true,
|
|
1033
1053
|
workspacePrompts: parsed.workspacePrompts !== false,
|
|
@@ -4241,9 +4261,6 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
|
|
|
4241
4261
|
.dsh-powerup-card-detail{margin-top:12px;padding-top:4px}
|
|
4242
4262
|
.dsh-powerup-card-foot{display:flex;align-items:center;gap:8px;margin-top:12px}
|
|
4243
4263
|
.dsh-powerup-how-card .dsh-powerup-section-title{margin-bottom:10px}
|
|
4244
|
-
.dsh-powerup-detail-btn{flex:none;padding:3px 9px;border:.5px solid var(--dsw-alias-border-l2);border-radius:7px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;line-height:18px;cursor:pointer;white-space:nowrap}
|
|
4245
|
-
.dsh-powerup-detail-btn:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-primary)}
|
|
4246
|
-
.dsh-powerup-detail-btn:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}
|
|
4247
4264
|
.dsh-powerup-fold-btn{flex:none;display:inline-flex;align-items:center;gap:5px;padding:3px 9px 3px 7px;border:.5px solid var(--dsw-alias-border-l2);border-radius:7px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;line-height:18px;cursor:pointer;white-space:nowrap}
|
|
4248
4265
|
.dsh-powerup-fold-btn:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-primary)}
|
|
4249
4266
|
.dsh-powerup-fold-btn.on{color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}
|
|
@@ -4259,7 +4276,15 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
|
|
|
4259
4276
|
.dsh-powerup-card-copy{min-width:0;flex:1 1 auto}
|
|
4260
4277
|
.dsh-powerup-card-copy h2{margin:0;font-size:14px;line-height:1.35;font-weight:650}
|
|
4261
4278
|
.dsh-powerup-card-copy p{margin:4px 0 0;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.55}
|
|
4262
|
-
.dsh-powerup-
|
|
4279
|
+
.dsh-powerup-card-brief-row{display:flex;align-items:center;gap:10px;min-width:0;flex-wrap:wrap}
|
|
4280
|
+
.dsh-powerup-card-brief-row p{flex:1 1 auto;min-width:0}
|
|
4281
|
+
.dsh-powerup-detail-link{flex:none;padding:0;border:0;background:transparent;color:var(--dsw-alias-brand-primary);font:inherit;font-size:12px;line-height:18px;cursor:pointer;white-space:nowrap;text-decoration:underline;text-underline-offset:2px}
|
|
4282
|
+
.dsh-powerup-detail-link:hover{color:var(--dsw-alias-brand-primary-hover,var(--dsw-alias-brand-primary));text-decoration-thickness:2px}
|
|
4283
|
+
.dsh-powerup-detail-link:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}
|
|
4284
|
+
.dsh-powerup-detail-section{margin-bottom:14px}
|
|
4285
|
+
.dsh-powerup-detail-section:last-child{margin-bottom:0}
|
|
4286
|
+
.dsh-powerup-detail-section-title{margin:0 0 6px;color:var(--dsw-alias-label-tertiary);font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}
|
|
4287
|
+
.dsh-powerup-switch{flex:none;display:inline-flex;align-items:center;justify-content:center;padding:3px 4px 3px 6px;border:0;border-radius:7px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;line-height:18px;cursor:pointer;white-space:nowrap}
|
|
4263
4288
|
.dsh-powerup-switch:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2))}
|
|
4264
4289
|
.dsh-powerup-switch:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}
|
|
4265
4290
|
.dsh-powerup-switch-track{position:relative;display:inline-block;flex:none;width:32px;height:17px;border-radius:999px;background:var(--dsw-alias-border-l3);transition:background .14s ease}
|
|
@@ -4451,7 +4476,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
|
|
|
4451
4476
|
.dsh-powerup-update-quick-note-title{display:flex;align-items:center;gap:6px;color:var(--dsw-alias-state-warn-label);font-size:12px;line-height:17px;font-weight:500}
|
|
4452
4477
|
.dsh-powerup-update-quick-note .dsh-powerup-update-note{color:var(--dsw-alias-label-secondary)}
|
|
4453
4478
|
.dsh-powerup-update-close:focus-visible,.dsh-powerup-update-toggle:focus-visible,.dsh-powerup-update-version:focus-visible,.dsh-powerup-update-select-trigger:focus-visible,.dsh-powerup-update-option:focus-visible,.dsh-powerup-update-primary:focus-visible,.dsh-powerup-update-ghost:focus-visible,.dsh-powerup-update-quick:focus-visible,.dsh-powerup-update-button:focus-visible,.dsh-powerup-restart-action:focus-visible,.dsh-powerup-update-default:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}
|
|
4454
|
-
@media (max-width:680px){.dsh-powerup-page{padding:20px 16px 42px}.dsh-powerup-actions{grid-template-columns:minmax(0,1fr)}.dsh-powerup-hero-art{width:54px;height:54px}.dsh-powerup-hero h1{font-size:19px}.dsh-powerup-card-head{flex-wrap:wrap}.dsh-powerup-
|
|
4479
|
+
@media (max-width:680px){.dsh-powerup-page{padding:20px 16px 42px}.dsh-powerup-actions{grid-template-columns:minmax(0,1fr)}.dsh-powerup-hero-art{width:54px;height:54px}.dsh-powerup-hero h1{font-size:19px}.dsh-powerup-card-head{flex-wrap:wrap}.dsh-powerup-card-brief-row{gap:6px}.dsh-powerup-update-mask{padding:12px}.dsh-powerup-update-dialog{max-height:calc(100dvh - 24px)}.dsh-powerup-update-head{padding:18px 12px 10px 18px}.dsh-powerup-update-body{padding:0 18px 4px}.dsh-powerup-update-foot{padding:14px 18px 18px}}
|
|
4455
4480
|
`;
|
|
4456
4481
|
|
|
4457
4482
|
const SESSION_SWITCH_CSS = `
|
|
@@ -5960,17 +5985,19 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
5960
5985
|
* showing a sun glyph in dark mode (click to go light) and a moon glyph in
|
|
5961
5986
|
* light mode (click to go dark). Falls back to `prefers-color-scheme` via
|
|
5962
5987
|
* the active theme's colorScheme when the preference is `system`.
|
|
5963
|
-
* @param {{getTheme?: Function, setTheme?: Function, t?: Function}} deps
|
|
5988
|
+
* @param {{getTheme?: Function, setTheme?: Function, t?: Function, isEnabled?: Function}} deps
|
|
5964
5989
|
*/
|
|
5965
5990
|
function createThemeToggleCore(deps) {
|
|
5966
5991
|
const options = deps ?? {};
|
|
5967
5992
|
const getTheme = typeof options.getTheme === 'function' ? options.getTheme : () => undefined;
|
|
5968
5993
|
const setTheme = typeof options.setTheme === 'function' ? options.setTheme : () => {};
|
|
5969
5994
|
const t = typeof options.t === 'function' ? options.t : (key) => key;
|
|
5995
|
+
const isEnabled = typeof options.isEnabled === 'function' ? options.isEnabled : () => true;
|
|
5970
5996
|
|
|
5971
5997
|
let button = null;
|
|
5972
5998
|
let observer = null;
|
|
5973
5999
|
let started = false;
|
|
6000
|
+
let renderedMode = null;
|
|
5974
6001
|
|
|
5975
6002
|
const SUN_ICON = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="3" stroke="currentColor" stroke-width="1.3"/><path d="M8 1.2v1.6M8 13.2v1.6M1.2 8h1.6M13.2 8h1.6M3.2 3.2l1.1 1.1M11.7 11.7l1.1 1.1M12.8 3.2l-1.1 1.1M4.3 11.7l-1.1 1.1" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/></svg>';
|
|
5976
6003
|
const MOON_ICON = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><path d="M13.5 9.5A6 6 0 0 1 6.5 2.5a6 6 0 1 0 7 7Z" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round"/></svg>';
|
|
@@ -6003,18 +6030,26 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
6003
6030
|
function refresh() {
|
|
6004
6031
|
if (button === null) return;
|
|
6005
6032
|
const dark = isDark();
|
|
6033
|
+
const mode = dark ? 'dark' : 'light';
|
|
6034
|
+
const label = dark ? t('theme.toLight') : t('theme.toDark');
|
|
6035
|
+
// The button lives inside the subtree watched by our MutationObserver.
|
|
6036
|
+
// Rewriting innerHTML on every callback would trigger another mutation
|
|
6037
|
+
// and spin the renderer forever, so only write when state actually changed.
|
|
6038
|
+
if (renderedMode === mode && button.getAttribute('aria-label') === label) return;
|
|
6039
|
+
renderedMode = mode;
|
|
6006
6040
|
button.innerHTML = dark ? SUN_ICON : MOON_ICON;
|
|
6007
|
-
button.setAttribute('aria-label',
|
|
6008
|
-
button.setAttribute('title',
|
|
6041
|
+
button.setAttribute('aria-label', label);
|
|
6042
|
+
button.setAttribute('title', label);
|
|
6009
6043
|
}
|
|
6010
6044
|
|
|
6011
6045
|
function ensureButton() {
|
|
6012
6046
|
const host = brandRow();
|
|
6013
|
-
if (host === null) {
|
|
6014
|
-
if (button !== null) { button.remove(); button = null; }
|
|
6047
|
+
if (host === null || !isEnabled()) {
|
|
6048
|
+
if (button !== null) { button.remove(); button = null; renderedMode = null; }
|
|
6015
6049
|
return;
|
|
6016
6050
|
}
|
|
6017
6051
|
if (button !== null && button.isConnected === true) { refresh(); return; }
|
|
6052
|
+
renderedMode = null;
|
|
6018
6053
|
button = document.createElement('button');
|
|
6019
6054
|
button.type = 'button';
|
|
6020
6055
|
button.className = 'dsh-powerup-theme-toggle';
|
|
@@ -6031,6 +6066,10 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
6031
6066
|
|
|
6032
6067
|
function sync() {
|
|
6033
6068
|
if (!started) return;
|
|
6069
|
+
if (!isEnabled()) {
|
|
6070
|
+
if (button !== null) { button.remove(); button = null; renderedMode = null; }
|
|
6071
|
+
return;
|
|
6072
|
+
}
|
|
6034
6073
|
ensureButton();
|
|
6035
6074
|
}
|
|
6036
6075
|
|
|
@@ -6050,6 +6089,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
6050
6089
|
observer = null;
|
|
6051
6090
|
if (button !== null) button.remove();
|
|
6052
6091
|
button = null;
|
|
6092
|
+
renderedMode = null;
|
|
6053
6093
|
}
|
|
6054
6094
|
|
|
6055
6095
|
return { start, stop, sync, isDark };
|
|
@@ -6060,27 +6100,44 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
6060
6100
|
* @param {object} ctx client plugin context
|
|
6061
6101
|
*/
|
|
6062
6102
|
function installThemeToggle(ctx) {
|
|
6063
|
-
const
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
core.
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6103
|
+
const install = (scope) => {
|
|
6104
|
+
const theme = (() => {
|
|
6105
|
+
try { return scope.get('theme'); } catch { return undefined; }
|
|
6106
|
+
})();
|
|
6107
|
+
if (theme === undefined || typeof theme.getTheme !== 'function') return null;
|
|
6108
|
+
const core = createThemeToggleCore({
|
|
6109
|
+
t: (key, params) => translateCurrent(key, params),
|
|
6110
|
+
isEnabled: () => getSettings().themeToggle !== false,
|
|
6111
|
+
getTheme: () => {
|
|
6112
|
+
try { return theme.getTheme(); } catch { return undefined; }
|
|
6113
|
+
},
|
|
6114
|
+
setTheme: (id) => {
|
|
6115
|
+
try { if (typeof theme.setTheme === 'function') theme.setTheme(id); } catch { /* ignore */ }
|
|
6116
|
+
},
|
|
6117
|
+
});
|
|
6118
|
+
scope.effect(() => {
|
|
6119
|
+
core.start();
|
|
6120
|
+
const off = typeof scope.on === 'function' ? scope.on('theme/change', () => core.sync()) : null;
|
|
6121
|
+
const offSettings = subscribeSettings(() => core.sync());
|
|
6122
|
+
return () => {
|
|
6123
|
+
if (typeof off === 'function') off();
|
|
6124
|
+
offSettings();
|
|
6125
|
+
core.stop();
|
|
6126
|
+
};
|
|
6127
|
+
}, 'dsh-powerup: theme toggle');
|
|
6128
|
+
return core;
|
|
6129
|
+
};
|
|
6130
|
+
// The theme service is provided by another UI plugin and may arrive
|
|
6131
|
+
// after ours on a cold start, so wait for it instead of sampling once.
|
|
6132
|
+
if (typeof ctx?.inject === 'function') {
|
|
6133
|
+
try {
|
|
6134
|
+
ctx.inject(['theme'], (scope) => { install(scope); });
|
|
6135
|
+
} catch (error) {
|
|
6136
|
+
console.warn('[dsh-powerup] theme toggle registration failed:', error?.message ?? error);
|
|
6137
|
+
}
|
|
6138
|
+
return null;
|
|
6139
|
+
}
|
|
6140
|
+
return install(ctx);
|
|
6084
6141
|
}
|
|
6085
6142
|
|
|
6086
6143
|
/**
|
|
@@ -11002,7 +11059,8 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
11002
11059
|
// ------------------------------------------------------------------
|
|
11003
11060
|
/**
|
|
11004
11061
|
* A feature card's full detail modal: icon + title + full description,
|
|
11005
|
-
* the "how to use"
|
|
11062
|
+
* the "how to use" tutorial, and any sub-options (settings) the card carries.
|
|
11063
|
+
* Description and tutorial are shown as two titled sections.
|
|
11006
11064
|
*/
|
|
11007
11065
|
function FeatureDetailModal({ card, t, onClose }) {
|
|
11008
11066
|
const [closing, setClosing] = useState(false);
|
|
@@ -11024,6 +11082,11 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
11024
11082
|
return () => document.removeEventListener('keydown', onKey, true);
|
|
11025
11083
|
}, [closing]);
|
|
11026
11084
|
const Icon = card.iconComp;
|
|
11085
|
+
const howParts = Array.isArray(card.howParts)
|
|
11086
|
+
? card.howParts.filter((part) => typeof part === 'string' && part !== '')
|
|
11087
|
+
: [];
|
|
11088
|
+
const howText = card.howKey !== undefined ? t(card.howKey) : '';
|
|
11089
|
+
const steps = howParts.length > 0 ? howParts : (howText !== '' ? [howText] : []);
|
|
11027
11090
|
return renderInBody(h('div', {
|
|
11028
11091
|
className: 'dsh-powerup-prompt-modal-mask' + (closing ? ' is-closing' : ''),
|
|
11029
11092
|
role: 'presentation',
|
|
@@ -11050,8 +11113,25 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
11050
11113
|
}, '\u00d7'),
|
|
11051
11114
|
),
|
|
11052
11115
|
h('div', { className: 'dsh-powerup-prompt-modal-body' },
|
|
11053
|
-
card.descKey !== undefined
|
|
11054
|
-
|
|
11116
|
+
card.descKey !== undefined
|
|
11117
|
+
? h('section', { className: 'dsh-powerup-detail-section' },
|
|
11118
|
+
h('h3', { className: 'dsh-powerup-detail-section-title' }, t('page.sectionDesc')),
|
|
11119
|
+
h('p', { className: 'dsh-powerup-detail-modal-desc' }, t(card.descKey)),
|
|
11120
|
+
)
|
|
11121
|
+
: null,
|
|
11122
|
+
steps.length > 0
|
|
11123
|
+
? h('section', { className: 'dsh-powerup-detail-section' },
|
|
11124
|
+
h('h3', { className: 'dsh-powerup-detail-section-title' }, t('page.sectionHow')),
|
|
11125
|
+
steps.length === 1
|
|
11126
|
+
? h('p', { className: 'dsh-powerup-card-how' }, steps[0])
|
|
11127
|
+
: h('ol', { className: 'dsh-powerup-steps' },
|
|
11128
|
+
steps.map((step, index) => h('li', { key: index, className: 'dsh-powerup-step' },
|
|
11129
|
+
h('span', { className: 'dsh-powerup-step-num' }, String(index + 1)),
|
|
11130
|
+
h('span', null, step),
|
|
11131
|
+
)),
|
|
11132
|
+
),
|
|
11133
|
+
)
|
|
11134
|
+
: null,
|
|
11055
11135
|
card.detail ?? null,
|
|
11056
11136
|
),
|
|
11057
11137
|
),
|
|
@@ -11102,14 +11182,18 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
11102
11182
|
h('span', { className: 'dsh-powerup-switch-track' },
|
|
11103
11183
|
h('span', { className: 'dsh-powerup-switch-thumb' }),
|
|
11104
11184
|
),
|
|
11105
|
-
h('span', null, checked ? t('page.enabled') : t('page.disabled')),
|
|
11106
11185
|
);
|
|
11107
11186
|
};
|
|
11108
11187
|
|
|
11109
|
-
/**
|
|
11110
|
-
|
|
11188
|
+
/**
|
|
11189
|
+
* One uniform feature card: icon + title + a one-line brief with a
|
|
11190
|
+
* Details link and enable switch on its right (aligned with each other),
|
|
11191
|
+
* and a fold/unfold button on the card-foot row for sub-options.
|
|
11192
|
+
* opts: { descKey, howKey, howParts, detailAsDetails }
|
|
11193
|
+
*/
|
|
11194
|
+
const featureCard = (key, iconComp, titleKey, briefKey, opts = {}) => {
|
|
11195
|
+
const { howKey, howParts, detail, descKey, detailAsDetails } = opts;
|
|
11111
11196
|
const hasSub = detail !== undefined && detail !== null;
|
|
11112
|
-
const hasHow = howKey !== undefined;
|
|
11113
11197
|
const expanded = expandedCards.has(key);
|
|
11114
11198
|
const toggleExpanded = () => {
|
|
11115
11199
|
const next = new Set(expandedCards);
|
|
@@ -11117,7 +11201,8 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
11117
11201
|
else next.add(key);
|
|
11118
11202
|
setExpandedCards(next);
|
|
11119
11203
|
};
|
|
11120
|
-
const
|
|
11204
|
+
const hasDetail = descKey !== undefined || howKey !== undefined || Array.isArray(howParts);
|
|
11205
|
+
const openDetail = () => setDetailCard({ key, iconComp, titleKey, descKey, howKey, howParts, detail });
|
|
11121
11206
|
return h('section', {
|
|
11122
11207
|
key,
|
|
11123
11208
|
className: 'dsh-powerup-card' + (settings[key] === false ? ' is-off' : ''),
|
|
@@ -11126,17 +11211,21 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
11126
11211
|
h('div', { className: 'dsh-powerup-card-icon' }, h(iconComp, { size: 18 })),
|
|
11127
11212
|
h('div', { className: 'dsh-powerup-card-copy' },
|
|
11128
11213
|
h('h2', null, t(titleKey)),
|
|
11129
|
-
h('
|
|
11214
|
+
h('div', { className: 'dsh-powerup-card-brief-row' },
|
|
11215
|
+
h('p', null, t(briefKey)),
|
|
11216
|
+
hasDetail
|
|
11217
|
+
? h('button', {
|
|
11218
|
+
type: 'button',
|
|
11219
|
+
className: 'dsh-powerup-detail-link',
|
|
11220
|
+
onClick: openDetail,
|
|
11221
|
+
}, t('page.details'))
|
|
11222
|
+
: null,
|
|
11223
|
+
toggle(key, t(titleKey)),
|
|
11224
|
+
),
|
|
11130
11225
|
),
|
|
11131
|
-
toggle(key, t(titleKey)),
|
|
11132
11226
|
),
|
|
11133
|
-
hasSub
|
|
11227
|
+
hasSub && !detailAsDetails
|
|
11134
11228
|
? h('div', { className: 'dsh-powerup-card-foot' },
|
|
11135
|
-
hasHow ? h('button', {
|
|
11136
|
-
type: 'button',
|
|
11137
|
-
className: 'dsh-powerup-detail-btn',
|
|
11138
|
-
onClick: openDetail,
|
|
11139
|
-
}, t('page.details')) : null,
|
|
11140
11229
|
h('button', {
|
|
11141
11230
|
type: 'button',
|
|
11142
11231
|
className: 'dsh-powerup-fold-btn' + (expanded ? ' on' : ''),
|
|
@@ -11147,7 +11236,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
11147
11236
|
h('span', null, t(expanded ? 'page.collapse' : 'page.more'))),
|
|
11148
11237
|
)
|
|
11149
11238
|
: null,
|
|
11150
|
-
hasSub && expanded
|
|
11239
|
+
hasSub && !detailAsDetails && expanded
|
|
11151
11240
|
? h('div', { className: 'dsh-powerup-card-body' }, detail)
|
|
11152
11241
|
: null,
|
|
11153
11242
|
);
|
|
@@ -11238,34 +11327,46 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
11238
11327
|
);
|
|
11239
11328
|
|
|
11240
11329
|
const featuresContent = h('div', null,
|
|
11241
|
-
featureCard('contextMenu', PowerUpLineIcon, 'page.featureTitle', 'page.featureBrief',
|
|
11242
|
-
|
|
11243
|
-
|
|
11330
|
+
featureCard('contextMenu', PowerUpLineIcon, 'page.featureTitle', 'page.featureBrief', {
|
|
11331
|
+
descKey: 'page.featureDesc',
|
|
11332
|
+
howParts: [t('page.featureHow1'), t('page.featureHow2'), t('page.featureHow3')],
|
|
11333
|
+
detail: actionsDetail,
|
|
11334
|
+
detailAsDetails: true,
|
|
11335
|
+
}),
|
|
11336
|
+
featureCard('themeToggle', QuickIcon, 'page.themeTitle', 'page.themeBrief', {
|
|
11337
|
+
descKey: 'page.themeDesc',
|
|
11338
|
+
howKey: 'page.themeHow',
|
|
11339
|
+
}),
|
|
11340
|
+
featureCard('launcher', LauncherIcon, 'page.launcherTitle', 'page.launcherBrief', {
|
|
11341
|
+
descKey: 'page.launcherDesc',
|
|
11342
|
+
detail: h('div', { className: 'dsh-powerup-card-detail' },
|
|
11244
11343
|
settingRow('launcher', settings.launcher !== false, t('page.launcherToggle'), t('page.launcherToggleHint')),
|
|
11245
11344
|
),
|
|
11246
|
-
),
|
|
11247
|
-
featureCard('sessionSwitch', QuickIcon, 'page.sessionSwitchTitle', 'page.sessionSwitchBrief', 'page.sessionSwitchHow',
|
|
11248
|
-
featureCard('locateSession', LocateIcon, 'page.locateTitle', 'page.locateBrief', 'page.locateHow',
|
|
11249
|
-
featureCard('scrollToTop', ScrollTopIcon, 'page.scrollToTopTitle', 'page.scrollToTopBrief', 'page.scrollToTopHow',
|
|
11250
|
-
featureCard('contentRendering', PowerUpLineIcon, 'page.renderingTitle', 'page.renderingBrief', 'page.renderingHow',
|
|
11251
|
-
featureCard('dualSend', LauncherIcon, 'page.dualSendTitle', 'page.dualSendBrief', 'page.dualSendHow',
|
|
11252
|
-
featureCard('quickReplies', TagIcon, 'page.quickRepliesTitle', 'page.quickRepliesBrief', 'page.quickRepliesHow',
|
|
11253
|
-
featureCard('taskProgress', ProgressIcon, 'page.taskProgressTitle', 'page.taskProgressBrief',
|
|
11254
|
-
|
|
11345
|
+
}),
|
|
11346
|
+
featureCard('sessionSwitch', QuickIcon, 'page.sessionSwitchTitle', 'page.sessionSwitchBrief', { howKey: 'page.sessionSwitchHow', descKey: 'page.sessionSwitchDesc' }),
|
|
11347
|
+
featureCard('locateSession', LocateIcon, 'page.locateTitle', 'page.locateBrief', { howKey: 'page.locateHow', descKey: 'page.locateDesc' }),
|
|
11348
|
+
featureCard('scrollToTop', ScrollTopIcon, 'page.scrollToTopTitle', 'page.scrollToTopBrief', { howKey: 'page.scrollToTopHow', descKey: 'page.scrollToTopDesc' }),
|
|
11349
|
+
featureCard('contentRendering', PowerUpLineIcon, 'page.renderingTitle', 'page.renderingBrief', { howKey: 'page.renderingHow', descKey: 'page.renderingDesc' }),
|
|
11350
|
+
featureCard('dualSend', LauncherIcon, 'page.dualSendTitle', 'page.dualSendBrief', { howKey: 'page.dualSendHow', descKey: 'page.dualSendDesc' }),
|
|
11351
|
+
featureCard('quickReplies', TagIcon, 'page.quickRepliesTitle', 'page.quickRepliesBrief', { howKey: 'page.quickRepliesHow', descKey: 'page.quickRepliesDesc' }),
|
|
11352
|
+
featureCard('taskProgress', ProgressIcon, 'page.taskProgressTitle', 'page.taskProgressBrief', {
|
|
11353
|
+
howKey: 'page.taskProgressHow',
|
|
11354
|
+
descKey: 'page.taskProgressDesc',
|
|
11355
|
+
detail: h('div', { className: 'dsh-powerup-card-detail' },
|
|
11255
11356
|
numberRow('taskProgressCooldown', settings.taskProgressCooldown, t('page.taskProgressCooldown'), t('page.taskProgressCooldownHint')),
|
|
11256
11357
|
),
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11358
|
+
}),
|
|
11359
|
+
featureCard('directAsk', TagIcon, 'page.directAskTitle', 'page.directAskBrief', {
|
|
11360
|
+
howKey: 'page.directAskHow',
|
|
11361
|
+
descKey: 'page.directAskDesc',
|
|
11362
|
+
detail: h('div', { className: 'dsh-powerup-card-detail' },
|
|
11261
11363
|
settingRow('directAsk', settings.directAsk !== false, t('page.directAskToggle'), t('page.directAskToggleHint')),
|
|
11262
11364
|
settingRow('directAskAutoTitle', settings.directAskAutoTitle === true, t('page.directAskAutoTitle'), t('page.directAskAutoTitleHint')),
|
|
11263
11365
|
),
|
|
11264
|
-
|
|
11265
|
-
),
|
|
11266
|
-
featureCard('
|
|
11267
|
-
featureCard('
|
|
11268
|
-
featureCard('update', UpdateIcon, 'page.updateTitle', 'page.updateBrief', 'page.updateHow', oneClickDetail, 'page.updateDesc'),
|
|
11366
|
+
}),
|
|
11367
|
+
featureCard('workspacePrompts', TagIcon, 'page.promptsTitle', 'page.promptsBrief', { howKey: 'page.promptsHow', descKey: 'page.promptsDesc' }),
|
|
11368
|
+
featureCard('jobStop', StopIcon, 'page.jobStopTitle', 'page.jobStopBrief', { howKey: 'page.jobStopHow', descKey: 'page.jobStopDesc' }),
|
|
11369
|
+
featureCard('update', UpdateIcon, 'page.updateTitle', 'page.updateBrief', { howKey: 'page.updateHow', descKey: 'page.updateDesc', detail: oneClickDetail }),
|
|
11269
11370
|
);
|
|
11270
11371
|
|
|
11271
11372
|
return h('div', { className: 'dsh-powerup-page' },
|
|
@@ -12648,6 +12749,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
12648
12749
|
QuickIcon,
|
|
12649
12750
|
PowerUpBridge,
|
|
12650
12751
|
PowerUpPage,
|
|
12752
|
+
FeatureDetailModal,
|
|
12651
12753
|
PowerUpOverlay,
|
|
12652
12754
|
PluginUpdateOverlay,
|
|
12653
12755
|
JobStopOverlay,
|
|
@@ -12708,4 +12810,3 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
12708
12810
|
},
|
|
12709
12811
|
});
|
|
12710
12812
|
})();
|
|
12711
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restregular/dsh-powerup",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.14",
|
|
4
4
|
"description": "为 DeepSeek Harness 提供一组可选的小型增强:轨迹右键菜单与步骤引用、后台任务停止原因、插件一键安装、侧边栏图标网格、会话切换、定位当前会话、工作区提示词、旁路模型生成的结构化任务进度;所有功能均可在 Power-Up 页面独立开关。 · Opt-in upgrades for DeepSeek Harness: Trajectory context menu and step references, job stop reasons, one-click plugin install, an adaptive sidebar launcher, session switching, locating the current session, workspace prompts, and non-blocking model-generated structured task progress — each toggled independently on the Power-Up page.",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"type": "module",
|
|
@@ -104,4 +104,3 @@
|
|
|
104
104
|
"license": "MIT",
|
|
105
105
|
"author": "RestRegular"
|
|
106
106
|
}
|
|
107
|
-
|