@restregular/dsh-powerup 0.10.4 → 0.10.6
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 +3 -1
- package/client.js +68 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -190,7 +190,9 @@ Save reusable prompts and drop one into a new session without retyping it.
|
|
|
190
190
|
level as the group headers, under **Ungrouped**. In the **Prompts** settings
|
|
191
191
|
tab you can create, rename and delete groups for each scope, and **drag a
|
|
192
192
|
prompt onto a group header to move it** (or onto Ungrouped to take it out of
|
|
193
|
-
a group)
|
|
193
|
+
a group), and **drop a prompt onto another prompt to reorder them within the
|
|
194
|
+
same group**. Deleting a group never deletes its prompts — they become
|
|
195
|
+
ungrouped.
|
|
194
196
|
- In the New Session row, to the right of the Agent preset, a dropdown lists the
|
|
195
197
|
prompts available in the current workspace, grouped the same way. In an
|
|
196
198
|
**ongoing session** the same picker also appears in the composer's bottom
|
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.10.
|
|
86
|
+
const VERSION = '0.10.6';
|
|
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. */
|
|
@@ -399,7 +399,7 @@
|
|
|
399
399
|
'prompts.groupConfirmDelete': '删除这个分组?其中的提示词会变为未分组,不会被删除。',
|
|
400
400
|
'prompts.moveToGroup': '移动到分组',
|
|
401
401
|
'prompts.moveUngrouped': '移出分组',
|
|
402
|
-
'prompts.dropHint': '
|
|
402
|
+
'prompts.dropHint': '拖拽提示词到分组标题即可移动,拖到「未分组」可移出分组;拖到另一条提示词上可调整组内排序。',
|
|
403
403
|
},
|
|
404
404
|
en: {
|
|
405
405
|
'panel.title': 'Power-Up',
|
|
@@ -705,7 +705,7 @@
|
|
|
705
705
|
'prompts.groupConfirmDelete': 'Delete this group? Its prompts stay as ungrouped and are not deleted.',
|
|
706
706
|
'prompts.moveToGroup': 'Move to group',
|
|
707
707
|
'prompts.moveUngrouped': 'Move out of group',
|
|
708
|
-
'prompts.dropHint': 'Drag a prompt onto a group header to move it
|
|
708
|
+
'prompts.dropHint': 'Drag a prompt onto a group header to move it, or onto Ungrouped to take it out; drop on another prompt to reorder within the group.',
|
|
709
709
|
},
|
|
710
710
|
};
|
|
711
711
|
|
|
@@ -3070,16 +3070,24 @@
|
|
|
3070
3070
|
for (const section of sectionsList) {
|
|
3071
3071
|
const scopeHead = document.createElement('div');
|
|
3072
3072
|
scopeHead.className = 'dsh-powerup-prompt-pop-scope';
|
|
3073
|
-
|
|
3073
|
+
const scopeLabel = document.createElement('span');
|
|
3074
|
+
scopeLabel.textContent = section.label;
|
|
3075
|
+
scopeHead.appendChild(scopeLabel);
|
|
3074
3076
|
list.appendChild(scopeHead);
|
|
3075
3077
|
for (const group of section.groups) {
|
|
3076
3078
|
if (group.items.length === 0 && !group.group) continue;
|
|
3077
3079
|
const isUngrouped = group.isUngrouped === true;
|
|
3078
3080
|
const key = section.key + ':' + group.id;
|
|
3079
3081
|
const isCollapsed = localCollapsed.has(key);
|
|
3082
|
+
const block = document.createElement('div');
|
|
3083
|
+
block.className = 'dsh-powerup-prompt-pop-block';
|
|
3084
|
+
if (isCollapsed) block.classList.add('is-collapsed');
|
|
3085
|
+
if (isUngrouped) block.classList.add('is-ungrouped');
|
|
3080
3086
|
if (isUngrouped) {
|
|
3081
|
-
// Ungrouped prompts sit at the same level as group headers
|
|
3082
|
-
|
|
3087
|
+
// Ungrouped prompts sit at the same level as group headers,
|
|
3088
|
+
// without a label, to keep the list compact.
|
|
3089
|
+
for (const prompt of group.items) block.appendChild(renderRow(prompt));
|
|
3090
|
+
list.appendChild(block);
|
|
3083
3091
|
continue;
|
|
3084
3092
|
}
|
|
3085
3093
|
const head = document.createElement('button');
|
|
@@ -3089,6 +3097,7 @@
|
|
|
3089
3097
|
head.setAttribute('aria-expanded', isCollapsed ? 'false' : 'true');
|
|
3090
3098
|
head.innerHTML = '<svg width="10" height="10" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><path d="m4 6 4 4 4-4" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
3091
3099
|
const label = document.createElement('span');
|
|
3100
|
+
label.className = 'dsh-powerup-prompt-pop-group-name';
|
|
3092
3101
|
label.textContent = group.name || t('prompts.untitled');
|
|
3093
3102
|
const count = document.createElement('span');
|
|
3094
3103
|
count.className = 'dsh-powerup-prompt-pop-group-count';
|
|
@@ -3102,10 +3111,14 @@
|
|
|
3102
3111
|
if (typeof onToggleGroup === 'function') onToggleGroup(key, !localCollapsed.has(key));
|
|
3103
3112
|
renderList();
|
|
3104
3113
|
});
|
|
3105
|
-
|
|
3114
|
+
block.appendChild(head);
|
|
3106
3115
|
if (!isCollapsed) {
|
|
3107
|
-
|
|
3116
|
+
const body = document.createElement('div');
|
|
3117
|
+
body.className = 'dsh-powerup-prompt-pop-group-body';
|
|
3118
|
+
for (const prompt of group.items) body.appendChild(renderRow(prompt));
|
|
3119
|
+
block.appendChild(body);
|
|
3108
3120
|
}
|
|
3121
|
+
list.appendChild(block);
|
|
3109
3122
|
}
|
|
3110
3123
|
}
|
|
3111
3124
|
};
|
|
@@ -3486,7 +3499,7 @@
|
|
|
3486
3499
|
sections,
|
|
3487
3500
|
collapsed,
|
|
3488
3501
|
onToggleGroup: toggleGroup,
|
|
3489
|
-
placement: (node) => popoverPlacement(node, 360,
|
|
3502
|
+
placement: (node) => popoverPlacement(node, 360, 480, { preferUp: compact }),
|
|
3490
3503
|
onPick: (prompt) => apply(prompt, false),
|
|
3491
3504
|
onSend: (prompt) => apply(prompt, true),
|
|
3492
3505
|
onEdit: (prompt) => setEditing(prompt),
|
|
@@ -4206,13 +4219,20 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
4206
4219
|
.dsh-powerup-prompt-pop{position:fixed;z-index:1600;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;overflow-x:hidden;border:0;border-radius:10px;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:12.5px;line-height:1.5;opacity:0;transform:translateY(-4px);transition:opacity .12s ease,transform .12s ease;pointer-events:auto;--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2)}
|
|
4207
4220
|
.dsh-powerup-prompt-pop.is-open{opacity:1;transform:none}
|
|
4208
4221
|
.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}
|
|
4209
|
-
|
|
4210
|
-
.dsh-powerup-prompt-pop-
|
|
4211
|
-
.dsh-powerup-prompt-pop-
|
|
4222
|
+
/* Scope dividers: a full-width label with hairline rules on both sides. */
|
|
4223
|
+
.dsh-powerup-prompt-pop-scope{flex:none;display:flex;align-items:center;gap:8px;padding:4px 10px 2px;color:var(--dsw-alias-brand-primary);font-size:10.5px;font-weight:700;letter-spacing:.04em}
|
|
4224
|
+
.dsh-powerup-prompt-pop-scope::before,.dsh-powerup-prompt-pop-scope::after{content:'';flex:1 1 auto;height:1px;background:var(--dsw-alias-border-l1)}
|
|
4225
|
+
.dsh-powerup-prompt-pop-block+.dsh-powerup-prompt-pop-scope{margin-top:0}
|
|
4226
|
+
/* One group: a tinted header chip with a compact, rail-joined body. */
|
|
4227
|
+
.dsh-powerup-prompt-pop-block{flex:none;display:flex;flex-direction:column;gap:2px;margin:0 0 2px}
|
|
4228
|
+
.dsh-powerup-prompt-pop-group{flex:none;display:flex;align-items:center;gap:6px;width:100%;min-height:28px;padding:3px 9px;border:.5px solid var(--dsw-alias-border-l2);border-radius:7px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);font:inherit;font-size:11.5px;font-weight:600;line-height:1.5;text-align:left;cursor:pointer;transition:background .12s ease,border-color .12s ease}
|
|
4229
|
+
.dsh-powerup-prompt-pop-group svg{flex:none;color:var(--dsw-alias-label-secondary);transition:transform .12s ease}
|
|
4212
4230
|
.dsh-powerup-prompt-pop-group[aria-expanded=false] svg{transform:rotate(-90deg)}
|
|
4213
|
-
.dsh-powerup-prompt-pop-group:hover{
|
|
4214
|
-
.dsh-powerup-prompt-pop-group-
|
|
4215
|
-
.dsh-powerup-prompt-pop-
|
|
4231
|
+
.dsh-powerup-prompt-pop-group:hover{border-color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-interactive-bg-hover)}
|
|
4232
|
+
.dsh-powerup-prompt-pop-group-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
4233
|
+
.dsh-powerup-prompt-pop-group-count{margin-left:auto;flex:none;min-width:18px;padding:0 5px;border-radius:9px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font-size:10px;font-weight:500;line-height:16px;text-align:center;font-variant-numeric:tabular-nums}
|
|
4234
|
+
.dsh-powerup-prompt-pop-group-body{flex:none;display:flex;flex-direction:column;gap:3px;margin-left:10px;padding-left:7px;border-left:1px solid var(--dsw-alias-border-l2)}
|
|
4235
|
+
.dsh-powerup-prompt-pop-list{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:2px;padding:4px 6px;overflow-y:auto;overflow-x:hidden}
|
|
4216
4236
|
.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}
|
|
4217
4237
|
.dsh-powerup-prompt-pop-item:hover{border-color:var(--dsw-alias-border-l2);background:var(--dsw-alias-interactive-bg-hover)}
|
|
4218
4238
|
.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}
|
|
@@ -9018,6 +9038,29 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
9018
9038
|
movePrompt(groupId, scopeId);
|
|
9019
9039
|
},
|
|
9020
9040
|
});
|
|
9041
|
+
/**
|
|
9042
|
+
* Drop one prompt onto another to reorder inside that group. The array
|
|
9043
|
+
* order is the display order within a group, so removing and reinserting
|
|
9044
|
+
* before the target card also adopts the target's group/workspace.
|
|
9045
|
+
*/
|
|
9046
|
+
const reorderBefore = (targetId) => {
|
|
9047
|
+
const id = dragRef.current;
|
|
9048
|
+
dragRef.current = null;
|
|
9049
|
+
setDragOver(null);
|
|
9050
|
+
if (typeof id !== 'string' || id === '' || id === targetId) return;
|
|
9051
|
+
const moving = prompts.find((p) => p.id === id);
|
|
9052
|
+
const target = prompts.find((p) => p.id === targetId);
|
|
9053
|
+
if (moving === undefined || target === undefined) return;
|
|
9054
|
+
const next = prompts.filter((p) => p.id !== id);
|
|
9055
|
+
const moved = {
|
|
9056
|
+
...moving,
|
|
9057
|
+
groupId: typeof target.groupId === 'string' ? target.groupId : '',
|
|
9058
|
+
workspaceId: typeof target.workspaceId === 'string' ? target.workspaceId : '',
|
|
9059
|
+
};
|
|
9060
|
+
const idx = next.findIndex((p) => p.id === targetId);
|
|
9061
|
+
next.splice(idx < 0 ? next.length : idx, 0, moved);
|
|
9062
|
+
writeAll([...groups, ...next]);
|
|
9063
|
+
};
|
|
9021
9064
|
const field = (label, key, placeholder, className) => h('label', { className: 'dsh-powerup-prompt-field' },
|
|
9022
9065
|
h('span', { className: 'dsh-powerup-prompt-field-label' }, label),
|
|
9023
9066
|
key === 'text'
|
|
@@ -9090,6 +9133,16 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
9090
9133
|
try { event.dataTransfer?.setData?.('text/plain', prompt.id); } catch { /* best effort */ }
|
|
9091
9134
|
},
|
|
9092
9135
|
onDragEnd: () => { dragRef.current = null; setDragOver(null); },
|
|
9136
|
+
onDragOver: (event) => {
|
|
9137
|
+
event.preventDefault();
|
|
9138
|
+
if (dragOver !== 'card:' + prompt.id) setDragOver('card:' + prompt.id);
|
|
9139
|
+
},
|
|
9140
|
+
onDragLeave: () => setDragOver((current) => (current === 'card:' + prompt.id ? null : current)),
|
|
9141
|
+
onDrop: (event) => {
|
|
9142
|
+
event.preventDefault();
|
|
9143
|
+
event.stopPropagation();
|
|
9144
|
+
reorderBefore(prompt.id);
|
|
9145
|
+
},
|
|
9093
9146
|
},
|
|
9094
9147
|
h('div', { className: 'dsh-powerup-prompt-card-head' },
|
|
9095
9148
|
h('span', { className: 'dsh-powerup-prompt-drag-handle', 'aria-hidden': 'true' }, '\u2807'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restregular/dsh-powerup",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.6",
|
|
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",
|