@restregular/dsh-powerup 0.19.2 → 0.19.3

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.
Files changed (2) hide show
  1. package/client.js +24 -14
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -85,7 +85,7 @@
85
85
  const requirementCreateDraft = { workspaceId: null, title: '', text: '', scope: 'current' };
86
86
  /** Fallback bucket when the hero cannot resolve an owning workspace yet. */
87
87
  const UNSCOPED_WORKSPACE = '__unscoped__';
88
- const VERSION = '0.19.2';
88
+ const VERSION = '0.19.3';
89
89
  const MENU_GAP = 8;
90
90
  const MENU_WIDTH = 248;
91
91
  /** Reference scheme understood by the Host's `powerup_step_read` tool. */
@@ -11316,7 +11316,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
11316
11316
  );
11317
11317
  }
11318
11318
 
11319
- function ProgressControl({ sessionId }) {
11319
+ function ProgressControl({ sessionId, useWorkspaces }) {
11320
11320
  const settings = useSettings();
11321
11321
  const [open, setOpen] = useState(false);
11322
11322
  const [view, setView] = useState(null);
@@ -11332,19 +11332,23 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
11332
11332
  const [creatingReq, setCreatingReq] = useState(false);
11333
11333
  const reqs = useRequirements();
11334
11334
  // Resolve the owning workspace for requirement filtering + create modal.
11335
- const workspaceId = useMemo(() => {
11336
- try {
11337
- const snapshot = ctxRef.current?.get?.('workspaces')?.list?.getSnapshot?.();
11338
- return resolveWorkspaceIdFromSnapshot(snapshot, sessionRef.current) ?? '';
11339
- } catch { return ''; }
11340
- }, [sessionId, open]);
11341
- const workspaceTitle = useMemo(() => {
11342
- try {
11343
- const items = ctxRef.current?.get?.('workspaces')?.list?.getSnapshot?.()?.items ?? [];
11335
+ // Prefer the slot-provided scoped `useWorkspaces` hook (the client-side
11336
+ // `workspaces` service has no `.list`; that is Host-only). Fall back to
11337
+ // the live DOM session id if the hook is absent on an older host.
11338
+ const workspaceSelector = useMemo(
11339
+ () => (snapshot) => resolveWorkspaceIdFromSnapshot(snapshot, sessionRef.current),
11340
+ [sessionId],
11341
+ );
11342
+ const workspaceId = typeof useWorkspaces === 'function'
11343
+ ? useWorkspaces(workspaceSelector) ?? ''
11344
+ : '';
11345
+ const workspaceTitle = typeof useWorkspaces === 'function'
11346
+ ? (useWorkspaces((snapshot) => {
11347
+ const items = snapshot !== null && typeof snapshot === 'object' && Array.isArray(snapshot.items) ? snapshot.items : [];
11344
11348
  const found = items.find((ws) => ws?.workspaceId === workspaceId);
11345
11349
  return found?.title ?? '';
11346
- } catch { return ''; }
11347
- }, [workspaceId, open]);
11350
+ }) ?? '')
11351
+ : '';
11348
11352
  const visibleReqs = requirementsForWorkspace(reqs, workspaceId);
11349
11353
  /** Concatenate the enabled+selected requirements into editable text. */
11350
11354
  const composeReqText = useCallback((ids) => {
@@ -11805,7 +11809,13 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
11805
11809
  register('conversation.session.header.utilities', {
11806
11810
  id: 'powerup-progress',
11807
11811
  order: 52,
11808
- }, (props) => h(ProgressControl, { sessionId: props?.sessionId }), 'dsh-powerup: task progress');
11812
+ }, (props) => h(ProgressControl, {
11813
+ sessionId: props?.sessionId,
11814
+ // The header utilities slot provides useWorkspaces as a standard
11815
+ // scoped hook; forward it so the requirement modal can resolve the
11816
+ // owning workspace (ctx.get('workspaces').list is Host-only).
11817
+ useWorkspaces: props?.useWorkspaces,
11818
+ }), 'dsh-powerup: task progress');
11809
11819
 
11810
11820
  register('conversation.hero.options', {
11811
11821
  id: 'powerup-prompts',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restregular/dsh-powerup",
3
- "version": "0.19.2",
3
+ "version": "0.19.3",
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",