@restregular/dsh-powerup 0.9.8 → 0.9.9
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 +61 -3
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
const promptCreateDraft = { workspaceId: null, title: '', text: '', scope: 'current' };
|
|
84
84
|
/** Fallback bucket when the hero cannot resolve an owning workspace yet. */
|
|
85
85
|
const UNSCOPED_WORKSPACE = '__unscoped__';
|
|
86
|
-
const VERSION = '0.9.
|
|
86
|
+
const VERSION = '0.9.9';
|
|
87
87
|
const MENU_GAP = 8;
|
|
88
88
|
const MENU_WIDTH = 248;
|
|
89
89
|
/** Reference scheme understood by the Host's `powerup_step_read` tool. */
|
|
@@ -3939,6 +3939,9 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
3939
3939
|
.dsh-powerup-send[data-kind="interrupt"]{color:var(--dsw-alias-state-warn-label,var(--dsw-alias-label-secondary))}
|
|
3940
3940
|
.dsh-powerup-send svg{width:16px;height:16px}
|
|
3941
3941
|
.dsh-powerup-dual-send{display:inline-flex;align-items:center;gap:4px}
|
|
3942
|
+
/* Our buttons replace the host's primary button while the draft has text. The
|
|
3943
|
+
component marks the host button with data-powerup-send-hidden. */
|
|
3944
|
+
[data-powerup-send-hidden]{display:none!important}
|
|
3942
3945
|
.dsh-powerup-mask-editor{display:flex;flex-direction:column;gap:10px}
|
|
3943
3946
|
.dsh-powerup-mask-row{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) auto auto;gap:8px;align-items:center;padding:8px;border:.5px solid var(--dsw-alias-border-l1);border-radius:var(--dsw-radius-md,8px);background:var(--dsw-alias-bg-layer-1)}
|
|
3944
3947
|
.dsh-powerup-mask-default.on{background:var(--dsw-alias-brand-primary);color:var(--dsw-alias-bg-layer-1);border-color:var(--dsw-alias-brand-primary)}
|
|
@@ -8473,8 +8476,63 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
8473
8476
|
return () => document.removeEventListener('keydown', onKeyDown, true);
|
|
8474
8477
|
}, [settings.dualSend, sessionId, draft, ctx, inputActions]);
|
|
8475
8478
|
void currentDraft;
|
|
8476
|
-
|
|
8477
|
-
|
|
8479
|
+
// Replace the host's single primary button with our two only while the
|
|
8480
|
+
// composer actually holds text. An empty draft keeps the native button
|
|
8481
|
+
// (that state is the host's Stop / retry affordance).
|
|
8482
|
+
const active = settings.dualSend && trimmed !== '';
|
|
8483
|
+
const wrapRef = useRef(null);
|
|
8484
|
+
useEffect(() => {
|
|
8485
|
+
if (!settings.dualSend || typeof document === 'undefined' || document === null) return undefined;
|
|
8486
|
+
const clearAll = () => {
|
|
8487
|
+
for (const node of document.querySelectorAll('[data-powerup-send-hidden]')) {
|
|
8488
|
+
node.removeAttribute('data-powerup-send-hidden');
|
|
8489
|
+
}
|
|
8490
|
+
};
|
|
8491
|
+
if (!active) {
|
|
8492
|
+
clearAll();
|
|
8493
|
+
return undefined;
|
|
8494
|
+
}
|
|
8495
|
+
// Walk up from our own slot to the row that directly holds the host's
|
|
8496
|
+
// send buttons, then take its LAST direct button child — that is the
|
|
8497
|
+
// primary send/stop control (the optional interrupt-stop precedes it).
|
|
8498
|
+
const findScope = () => {
|
|
8499
|
+
let node = wrapRef.current;
|
|
8500
|
+
for (let depth = 0; node !== null && depth < 8; depth += 1) {
|
|
8501
|
+
const direct = typeof node.querySelectorAll === 'function'
|
|
8502
|
+
? node.querySelectorAll(':scope > button')
|
|
8503
|
+
: [];
|
|
8504
|
+
if (direct.length > 0) return node;
|
|
8505
|
+
node = node.parentElement;
|
|
8506
|
+
}
|
|
8507
|
+
return null;
|
|
8508
|
+
};
|
|
8509
|
+
const mark = () => {
|
|
8510
|
+
const scope = findScope();
|
|
8511
|
+
if (scope === null) return;
|
|
8512
|
+
const direct = [...scope.querySelectorAll(':scope > button')];
|
|
8513
|
+
const primary = direct[direct.length - 1];
|
|
8514
|
+
if (primary === undefined) return;
|
|
8515
|
+
primary.setAttribute('data-powerup-send-hidden', '');
|
|
8516
|
+
};
|
|
8517
|
+
mark();
|
|
8518
|
+
let scheduled = false;
|
|
8519
|
+
const schedule = () => {
|
|
8520
|
+
if (scheduled) return;
|
|
8521
|
+
scheduled = true;
|
|
8522
|
+
queueMicrotask(() => {
|
|
8523
|
+
scheduled = false;
|
|
8524
|
+
mark();
|
|
8525
|
+
});
|
|
8526
|
+
};
|
|
8527
|
+
const observer = typeof MutationObserver === 'function' ? new MutationObserver(schedule) : null;
|
|
8528
|
+
observer?.observe(document.body, { childList: true, subtree: true });
|
|
8529
|
+
return () => {
|
|
8530
|
+
observer?.disconnect();
|
|
8531
|
+
clearAll();
|
|
8532
|
+
};
|
|
8533
|
+
}, [settings.dualSend, active]);
|
|
8534
|
+
if (!active) return null;
|
|
8535
|
+
return h('div', { className: 'dsh-powerup-dual-send', ref: wrapRef },
|
|
8478
8536
|
h('button', {
|
|
8479
8537
|
type: 'button',
|
|
8480
8538
|
className: 'dsh-powerup-send',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restregular/dsh-powerup",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
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, and workspace prompts — each toggled independently on the Power-Up page.",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"type": "module",
|