@restregular/dsh-powerup 0.9.7 → 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 +66 -10
- 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. */
|
|
@@ -2904,9 +2904,7 @@
|
|
|
2904
2904
|
name.textContent = promptLabel(prompt, t);
|
|
2905
2905
|
const preview = document.createElement('span');
|
|
2906
2906
|
preview.className = 'dsh-powerup-prompt-pop-preview';
|
|
2907
|
-
|
|
2908
|
-
// the available width decides how much text is shown.
|
|
2909
|
-
preview.textContent = (prompt.text || '').trim().replace(/\s+/gu, ' ');
|
|
2907
|
+
preview.textContent = [...(prompt.text || '').trim()].slice(0, 40).join('');
|
|
2910
2908
|
main.append(name, preview);
|
|
2911
2909
|
main.addEventListener('click', (event) => {
|
|
2912
2910
|
event.preventDefault();
|
|
@@ -3262,7 +3260,7 @@
|
|
|
3262
3260
|
anchor,
|
|
3263
3261
|
t,
|
|
3264
3262
|
items: visible,
|
|
3265
|
-
placement: (node) => popoverPlacement(node,
|
|
3263
|
+
placement: (node) => popoverPlacement(node, 360, 340, { preferUp: compact }),
|
|
3266
3264
|
onPick: (prompt) => apply(prompt, false),
|
|
3267
3265
|
onSend: (prompt) => apply(prompt, true),
|
|
3268
3266
|
onCreate: () => setCreating(true),
|
|
@@ -3941,6 +3939,9 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
3941
3939
|
.dsh-powerup-send[data-kind="interrupt"]{color:var(--dsw-alias-state-warn-label,var(--dsw-alias-label-secondary))}
|
|
3942
3940
|
.dsh-powerup-send svg{width:16px;height:16px}
|
|
3943
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}
|
|
3944
3945
|
.dsh-powerup-mask-editor{display:flex;flex-direction:column;gap:10px}
|
|
3945
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)}
|
|
3946
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)}
|
|
@@ -3973,11 +3974,11 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
3973
3974
|
.dsh-powerup-prompt-pop.is-open{opacity:1;transform:none}
|
|
3974
3975
|
.dsh-powerup-prompt-pop-head{flex:none;display:flex;align-items:center;gap:6px;padding:8px 11px 7px;color:var(--dsw-alias-label-tertiary);font-size:10.5px;font-weight:600;letter-spacing:.03em}
|
|
3975
3976
|
.dsh-powerup-prompt-pop-list{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:4px;padding:6px;overflow-y:auto;overflow-x:hidden}
|
|
3976
|
-
.dsh-powerup-prompt-pop-item{display:flex;align-items:center;gap:6px;width:100%;min-width:0;min-height:38px;padding:4px 5px 4px 9px;border:.5px solid transparent;border-radius:var(--dsw-radius-md,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;text-align:left;transition:border-color .12s ease,background .12s ease}
|
|
3977
|
+
.dsh-powerup-prompt-pop-item{box-sizing:border-box;display:flex;align-items:center;gap:6px;width:100%;min-width:0;min-height:38px;padding:4px 5px 4px 9px;border:.5px solid transparent;border-radius:var(--dsw-radius-md,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;text-align:left;transition:border-color .12s ease,background .12s ease}
|
|
3977
3978
|
.dsh-powerup-prompt-pop-item:hover{border-color:var(--dsw-alias-border-l2);background:var(--dsw-alias-interactive-bg-hover)}
|
|
3978
3979
|
.dsh-powerup-prompt-pop-main{flex:1 1 auto;display:flex;flex-direction:column;gap:1px;min-width:0;padding:3px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}
|
|
3979
|
-
.dsh-powerup-prompt-pop-name{display
|
|
3980
|
-
.dsh-powerup-prompt-pop-preview{display
|
|
3980
|
+
.dsh-powerup-prompt-pop-name{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;line-height:18px}
|
|
3981
|
+
.dsh-powerup-prompt-pop-preview{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary);font-size:10.5px;line-height:15px}
|
|
3981
3982
|
.dsh-powerup-prompt-pop-send{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:.5px solid var(--dsw-alias-border-l2);border-radius:7px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary);font:inherit;line-height:1;cursor:pointer;transition:background .12s ease,color .12s ease,border-color .12s ease}
|
|
3982
3983
|
.dsh-powerup-prompt-pop-send svg{width:14px;height:14px}
|
|
3983
3984
|
.dsh-powerup-prompt-pop-send:hover{border-color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-brand-primary)}
|
|
@@ -8475,8 +8476,63 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
8475
8476
|
return () => document.removeEventListener('keydown', onKeyDown, true);
|
|
8476
8477
|
}, [settings.dualSend, sessionId, draft, ctx, inputActions]);
|
|
8477
8478
|
void currentDraft;
|
|
8478
|
-
|
|
8479
|
-
|
|
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 },
|
|
8480
8536
|
h('button', {
|
|
8481
8537
|
type: 'button',
|
|
8482
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",
|