@restregular/dsh-powerup 0.19.10 → 0.19.11
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 +42 -5
- package/index.js +1 -0
- package/lib/quick-replies.js +1 -0
- package/package.json +2 -2
package/client.js
CHANGED
|
@@ -67,6 +67,19 @@
|
|
|
67
67
|
return createPortal !== null && body !== null ? createPortal(node, body) : node;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Safe stand-ins for the host's standard hooks on older hosts. DSH 0.2.3
|
|
72
|
+
* added `useMobile` / `useDocumentPortal` to every slot's standard props,
|
|
73
|
+
* and the host ModelSelect now calls both while rendering. We re-render
|
|
74
|
+
* that component inside the progress panel, so a missing hook used to
|
|
75
|
+
* throw a TypeError, crash the whole header-utilities slot entry and
|
|
76
|
+
* silently hide the progress entry button. Forward the real hooks from
|
|
77
|
+
* the slot props; fall back to these when they are absent.
|
|
78
|
+
*/
|
|
79
|
+
const BodyPortal = ({ children }) => renderInBody(children);
|
|
80
|
+
const fallbackUseMobile = () => false;
|
|
81
|
+
const fallbackUseDocumentPortal = () => BodyPortal;
|
|
82
|
+
|
|
70
83
|
const NS = 'dsh-powerup';
|
|
71
84
|
const SETTINGS_KEY = 'dsh-powerup:settings:v1';
|
|
72
85
|
/**
|
|
@@ -85,7 +98,7 @@
|
|
|
85
98
|
const requirementCreateDraft = { workspaceId: null, title: '', text: '', scope: 'current' };
|
|
86
99
|
/** Fallback bucket when the hero cannot resolve an owning workspace yet. */
|
|
87
100
|
const UNSCOPED_WORKSPACE = '__unscoped__';
|
|
88
|
-
const VERSION = '0.19.
|
|
101
|
+
const VERSION = '0.19.11';
|
|
89
102
|
const MENU_GAP = 8;
|
|
90
103
|
const MENU_WIDTH = 248;
|
|
91
104
|
/** Reference scheme understood by the Host's `powerup_step_read` tool. */
|
|
@@ -11551,10 +11564,20 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
11551
11564
|
}
|
|
11552
11565
|
|
|
11553
11566
|
/** Render the host's exact composer model dropdown inside the progress header. */
|
|
11554
|
-
function ProgressModelSelect({ sessionId, ctx, t: translate }) {
|
|
11567
|
+
function ProgressModelSelect({ sessionId, ctx, t: translate, useMobile, useDocumentPortal }) {
|
|
11555
11568
|
const slots = ctx?.get?.('slots');
|
|
11556
11569
|
const seatRef = useRef(null);
|
|
11557
11570
|
const [entry, setEntry] = useState(() => findModelSelectEntry(slots));
|
|
11571
|
+
// Keep hook identity stable across renders; the host component calls
|
|
11572
|
+
// these itself, so choose once from the forwarded props or fallback.
|
|
11573
|
+
const mobileHook = useMemo(
|
|
11574
|
+
() => (typeof useMobile === 'function' ? useMobile : fallbackUseMobile),
|
|
11575
|
+
[useMobile],
|
|
11576
|
+
);
|
|
11577
|
+
const portalHook = useMemo(
|
|
11578
|
+
() => (typeof useDocumentPortal === 'function' ? useDocumentPortal : fallbackUseDocumentPortal),
|
|
11579
|
+
[useDocumentPortal],
|
|
11580
|
+
);
|
|
11558
11581
|
useEffect(() => {
|
|
11559
11582
|
if (entry !== null || slots === undefined) return undefined;
|
|
11560
11583
|
const update = () => {
|
|
@@ -11628,11 +11651,20 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
11628
11651
|
}, '…');
|
|
11629
11652
|
}
|
|
11630
11653
|
return h('span', { className: 'dsh-powerup-progress-model-seat', ref: seatRef },
|
|
11631
|
-
h(entry.component, {
|
|
11654
|
+
h(entry.component, {
|
|
11655
|
+
...face,
|
|
11656
|
+
t: seatT,
|
|
11657
|
+
renderSlot: seatRenderSlot,
|
|
11658
|
+
locked: false,
|
|
11659
|
+
// DSH 0.2.3 ModelSelect requires these standard props. Omitting
|
|
11660
|
+
// them crashes the component and hides the progress entry button.
|
|
11661
|
+
useMobile: mobileHook,
|
|
11662
|
+
useDocumentPortal: portalHook,
|
|
11663
|
+
}),
|
|
11632
11664
|
);
|
|
11633
11665
|
}
|
|
11634
11666
|
|
|
11635
|
-
function ProgressControl({ sessionId, useWorkspaces }) {
|
|
11667
|
+
function ProgressControl({ sessionId, useWorkspaces, useMobile, useDocumentPortal }) {
|
|
11636
11668
|
const settings = useSettings();
|
|
11637
11669
|
const [open, setOpen] = useState(false);
|
|
11638
11670
|
const [view, setView] = useState(null);
|
|
@@ -12028,7 +12060,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
12028
12060
|
t('progress.subtitle'),
|
|
12029
12061
|
),
|
|
12030
12062
|
),
|
|
12031
|
-
h(ProgressModelSelect, { sessionId, ctx: ctxRef.current, t }),
|
|
12063
|
+
h(ProgressModelSelect, { sessionId, ctx: ctxRef.current, t, useMobile, useDocumentPortal }),
|
|
12032
12064
|
h('button', {
|
|
12033
12065
|
type: 'button', className: 'dsh-powerup-progress-close',
|
|
12034
12066
|
'aria-label': t('progress.close'), onClick: close,
|
|
@@ -12135,6 +12167,11 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
|
|
|
12135
12167
|
// scoped hook; forward it so the requirement modal can resolve the
|
|
12136
12168
|
// owning workspace (ctx.get('workspaces').list is Host-only).
|
|
12137
12169
|
useWorkspaces: props?.useWorkspaces,
|
|
12170
|
+
// DSH 0.2.3 standard hooks, forwarded to the host ModelSelect we
|
|
12171
|
+
// render inside the panel. Without them the slot entry crashes and
|
|
12172
|
+
// this very button disappears once the panel is opened.
|
|
12173
|
+
useMobile: props?.useMobile,
|
|
12174
|
+
useDocumentPortal: props?.useDocumentPortal,
|
|
12138
12175
|
}), 'dsh-powerup: task progress');
|
|
12139
12176
|
|
|
12140
12177
|
register('conversation.hero.options', {
|
package/index.js
CHANGED
|
@@ -255,6 +255,7 @@ function appendSelfUpdateLog(line) {
|
|
|
255
255
|
*/
|
|
256
256
|
const QUICK_REPLIES_PROMPT_SECTION = [
|
|
257
257
|
'## Quick reply options (dsh-powerup)',
|
|
258
|
+
'At the end of your turn, if you need to ask the user anything — a confirmation, a choice, a missing detail, or how to proceed — actively call the `powerup_quick_replies` tool to offer tappable buttons under your reply instead of leaving a plain open-ended question.',
|
|
258
259
|
'When your answer leaves a few obvious next steps, call the `powerup_quick_replies` tool to offer tappable buttons under your reply.',
|
|
259
260
|
'Pass `options` as a list of objects with `label` and `message`: `label` is the short button text, `message` is the full text sent when the user taps it.',
|
|
260
261
|
'Offer at most 8 concise, mutually exclusive choices; prefer 2-4. Use this after answering, not instead of answering.',
|
package/lib/quick-replies.js
CHANGED
|
@@ -25,6 +25,7 @@ export const QUICK_REPLIES_TOOL_NAME = 'powerup_quick_replies';
|
|
|
25
25
|
|
|
26
26
|
export const QUICK_REPLIES_DESCRIPTION = [
|
|
27
27
|
'Offer the user a short list of tappable reply options in the current conversation.',
|
|
28
|
+
'At the end of your turn, whenever you need to ask the user anything — a confirmation, a choice, a missing detail, or how to proceed — call this tool to offer tappable reply options instead of leaving a plain open-ended question.',
|
|
28
29
|
'Use this after answering when the next step has a few obvious choices (for example confirm, reject, or a follow-up question).',
|
|
29
30
|
'Each option has a short button label and the full message that is sent when it is tapped.',
|
|
30
31
|
'The options are shown under the last assistant message and are removed automatically once the user sends any message.',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restregular/dsh-powerup",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.11",
|
|
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,4 @@
|
|
|
104
104
|
"license": "MIT",
|
|
105
105
|
"author": "RestRegular"
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
|