@restregular/dsh-powerup 0.15.0 → 0.16.0

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 (3) hide show
  1. package/README.md +9 -7
  2. package/client.js +101 -50
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -456,13 +456,15 @@ requirements you want** — checked ones fill an editable text box that you may
456
456
  freely modify, and generation/refresh uses the full box text verbatim. The panel
457
457
  also has a **New requirement** entry with a modal pinned to the session's
458
458
  workspace (like the prompt picker).
459
- The panel is wider by default, resizable from its bottom-right corner (size
460
- persisted), and its header tint shifts from blue toward warning red as the
461
- report ages. Every refresh adds a new report to a per-session history stored on
462
- disk; older reports stay browsable and are never discarded. The panel can switch
463
- between them, show the exact raw AI text, copy it, and clear the history
464
- explicitly. "Refresh progress" generates a new report without dropping the old
465
- ones.
459
+ The panel uses **tabs** below the header: **Progress**, **Requirements** and
460
+ **Raw output** — requirements and the raw AI text are no longer embedded in the
461
+ progress body. Stage cards (checklist steps, phases, milestones and tree nodes)
462
+ are **collapsible**. The panel is wider by default, resizable from its
463
+ bottom-right corner (size persisted), and its header tint shifts from blue
464
+ toward warning red as the report ages. Every refresh adds a new report to a
465
+ per-session history stored on disk; older reports stay browsable and are never
466
+ discarded. The panel can clear the history explicitly. "Refresh progress"
467
+ generates a new report without dropping the old ones.
466
468
 
467
469
  ### Direct ask (no Agent)
468
470
 
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.15.0';
88
+ const VERSION = '0.16.0';
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. */
@@ -377,7 +377,11 @@
377
377
  'progress.updated': '更新于 {time}',
378
378
  'progress.history': '历史进度',
379
379
  'progress.historyEmpty': '暂无历史记录',
380
- 'progress.viewRaw': '查看原始内容',
380
+ 'progress.viewRaw': '原始内容',
381
+ 'progress.tabProgress': '进度',
382
+ 'progress.rawEmpty': '本次报告没有原始文本。',
383
+ 'progress.expand': '展开',
384
+ 'progress.collapse': '折叠',
381
385
  'progress.rawTitle': 'AI 原始生成内容',
382
386
  'progress.rawHint': '这是模型返回的原始文本,未经解析处理。',
383
387
  'progress.copyRaw': '复制原文',
@@ -767,7 +771,11 @@
767
771
  'progress.updated': 'Updated at {time}',
768
772
  'progress.history': 'History',
769
773
  'progress.historyEmpty': 'No history yet',
770
- 'progress.viewRaw': 'View raw output',
774
+ 'progress.viewRaw': 'Raw output',
775
+ 'progress.tabProgress': 'Progress',
776
+ 'progress.rawEmpty': 'No raw text for this report.',
777
+ 'progress.expand': 'Expand',
778
+ 'progress.collapse': 'Collapse',
771
779
  'progress.rawTitle': 'Raw AI output',
772
780
  'progress.rawHint': 'This is the exact text returned by the model, before parsing.',
773
781
  'progress.copyRaw': 'Copy raw',
@@ -4579,7 +4587,19 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
4579
4587
  .dsh-powerup-progress-fill{height:100%;border-radius:999px;background:var(--dsw-alias-brand-primary);transition:width .3s ease}
4580
4588
  .dsh-powerup-progress-section{margin:12px 0 6px;color:var(--dsw-alias-label-tertiary);font-size:10.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}
4581
4589
  .dsh-powerup-progress-items{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}
4582
- .dsh-powerup-progress-item{display:flex;align-items:flex-start;gap:8px;padding:6px 8px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1)}
4590
+ .dsh-powerup-progress-item{display:flex;flex-direction:column;gap:4px;padding:6px 8px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1)}
4591
+ .dsh-powerup-progress-item-head{display:flex;align-items:center;gap:7px;min-width:0}
4592
+ .dsh-powerup-progress-item-toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--dsw-alias-label-tertiary);cursor:pointer;transition:transform .12s ease}
4593
+ .dsh-powerup-progress-item-toggle svg{transform:rotate(-90deg);transition:transform .12s ease}
4594
+ .dsh-powerup-progress-item:not(.is-collapsed) .dsh-powerup-progress-item-toggle svg{transform:none}
4595
+ .dsh-powerup-progress-item-toggle-spacer{flex:none;width:16px;height:16px}
4596
+ .dsh-powerup-progress-item-detail{margin-left:23px;color:var(--dsw-alias-label-tertiary);font-size:10.5px;line-height:1.5;overflow-wrap:anywhere}
4597
+ .dsh-powerup-progress-tabs{display:flex;flex:none;gap:2px;padding:0 12px;border-bottom:.5px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1)}
4598
+ .dsh-powerup-progress-tab{position:relative;padding:8px 12px;border:0;background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:11.5px;line-height:1.5;cursor:pointer}
4599
+ .dsh-powerup-progress-tab:hover{color:var(--dsw-alias-label-primary)}
4600
+ .dsh-powerup-progress-tab.on{color:var(--dsw-alias-brand-primary);font-weight:600}
4601
+ .dsh-powerup-progress-tab.on:after{content:"";position:absolute;left:8px;right:8px;bottom:-1px;height:2px;border-radius:2px;background:var(--dsw-alias-brand-primary)}
4602
+ .dsh-powerup-progress-req-tab{display:flex;flex-direction:column;gap:6px}
4583
4603
  .dsh-powerup-progress-badge{flex:none;display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 5px;border-radius:8px;font-size:9.5px;font-weight:700;letter-spacing:.02em}
4584
4604
  .dsh-powerup-progress-badge[data-status=pending]{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-tertiary)}
4585
4605
  .dsh-powerup-progress-badge[data-status=in-progress]{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 14%,transparent);color:var(--dsw-alias-state-business-primary)}
@@ -10627,32 +10647,50 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10627
10647
  }, STATUS_LABEL[status] ?? status);
10628
10648
  }
10629
10649
 
10630
- /** Render one node (checklist step / phase / milestone / tree node). */
10631
- function ProgressItem(title, status, detail, children, key) {
10632
- return h('li', { key, className: 'dsh-powerup-progress-item' },
10633
- ProgressBadge(status),
10634
- h('div', { className: 'dsh-powerup-progress-item-copy' },
10650
+ /**
10651
+ * One collapsible node (checklist step / phase / milestone / tree node).
10652
+ * Rendered via h(ProgressItem, …) so each card owns its own collapse state.
10653
+ */
10654
+ function ProgressItem({ title, status, detail, children, nodeKey, t: translate }) {
10655
+ const [collapsed, setCollapsed] = useState(false);
10656
+ const hasBody = Boolean(detail) || (Array.isArray(children) && children.length > 0);
10657
+ return h('li', { key: nodeKey, className: 'dsh-powerup-progress-item' + (collapsed ? ' is-collapsed' : '') },
10658
+ h('div', { className: 'dsh-powerup-progress-item-head' },
10659
+ hasBody
10660
+ ? h('button', {
10661
+ type: 'button',
10662
+ className: 'dsh-powerup-progress-item-toggle',
10663
+ 'aria-expanded': collapsed ? 'false' : 'true',
10664
+ 'aria-label': collapsed ? (translate?.('progress.expand') ?? 'Expand') : (translate?.('progress.collapse') ?? 'Collapse'),
10665
+ onClick: () => setCollapsed((v) => !v),
10666
+ }, h('svg', { width: 10, height: 10, viewBox: '0 0 16 16', fill: 'none', 'aria-hidden': 'true' },
10667
+ h('path', { d: 'm4 6 4 4 4-4', stroke: 'currentColor', strokeWidth: 1.4, strokeLinecap: 'round', strokeLinejoin: 'round' })))
10668
+ : h('span', { className: 'dsh-powerup-progress-item-toggle-spacer' }),
10669
+ ProgressBadge(status),
10635
10670
  h('span', { className: 'dsh-powerup-progress-item-title' }, title),
10636
- detail ? h('span', { className: 'dsh-powerup-progress-item-detail' }, detail) : null,
10637
- Array.isArray(children) && children.length > 0
10638
- ? h('ul', { className: 'dsh-powerup-progress-children' }, children)
10639
- : null,
10640
10671
  ),
10672
+ !collapsed && detail ? h('span', { className: 'dsh-powerup-progress-item-detail' }, detail) : null,
10673
+ !collapsed && Array.isArray(children) && children.length > 0
10674
+ ? h('ul', { className: 'dsh-powerup-progress-children' }, children)
10675
+ : null,
10641
10676
  );
10642
10677
  }
10643
10678
 
10644
10679
  /** Render the model-chosen structured body. */
10645
- function ProgressStructure(report) {
10680
+ function ProgressStructure(report, t) {
10646
10681
  if (report === null || typeof report !== 'object') return null;
10647
10682
  const sections = [];
10683
+ const item = (title, status, detail, children, nodeKey) => h(ProgressItem, {
10684
+ key: nodeKey, title, status, detail, children, nodeKey, t,
10685
+ });
10648
10686
  const mode = report.mode ?? 'checklist';
10649
10687
  if (mode === 'phases' && Array.isArray(report.phases) && report.phases.length > 0) {
10650
10688
  sections.push(h('div', { key: 'phases' },
10651
10689
  h('div', { className: 'dsh-powerup-progress-section' }, MODE_LABEL.phases),
10652
- h('ul', { className: 'dsh-powerup-progress-items' }, report.phases.map((phase, i) => ProgressItem(
10690
+ h('ul', { className: 'dsh-powerup-progress-items' }, report.phases.map((phase, i) => item(
10653
10691
  phase.name, phase.status, phase.detail,
10654
10692
  Array.isArray(phase.steps) && phase.steps.length > 0
10655
- ? phase.steps.map((s, j) => ProgressItem(s.title, s.status, '', null, `p${i}-s${j}`))
10693
+ ? phase.steps.map((s, j) => item(s.title, s.status, '', null, `p${i}-s${j}`))
10656
10694
  : null,
10657
10695
  `phase-${i}`,
10658
10696
  ))),
@@ -10660,13 +10698,13 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10660
10698
  } else if (mode === 'milestones' && Array.isArray(report.milestones) && report.milestones.length > 0) {
10661
10699
  sections.push(h('div', { key: 'milestones' },
10662
10700
  h('div', { className: 'dsh-powerup-progress-section' }, MODE_LABEL.milestones),
10663
- h('ul', { className: 'dsh-powerup-progress-items' }, report.milestones.map((m, i) => ProgressItem(
10701
+ h('ul', { className: 'dsh-powerup-progress-items' }, report.milestones.map((m, i) => item(
10664
10702
  m.name, m.status, m.criteria ? `${m.detail ?? ''} · ${m.criteria}`.trim() : m.detail,
10665
10703
  null, `m-${i}`,
10666
10704
  ))),
10667
10705
  ));
10668
10706
  } else if (mode === 'tree' && report.tree !== null && report.tree !== undefined) {
10669
- const node = (n, key) => ProgressItem(
10707
+ const node = (n, key) => item(
10670
10708
  n.title, n.status, n.detail,
10671
10709
  Array.isArray(n.children) && n.children.length > 0 ? n.children.map((c, i) => node(c, `${key}-${i}`)) : null,
10672
10710
  key,
@@ -10678,7 +10716,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10678
10716
  } else if (Array.isArray(report.steps) && report.steps.length > 0) {
10679
10717
  sections.push(h('div', { key: 'steps' },
10680
10718
  h('div', { className: 'dsh-powerup-progress-section' }, MODE_LABEL.checklist),
10681
- h('ul', { className: 'dsh-powerup-progress-items' }, report.steps.map((s, i) => ProgressItem(
10719
+ h('ul', { className: 'dsh-powerup-progress-items' }, report.steps.map((s, i) => item(
10682
10720
  s.title, s.status, s.detail, null, `step-${i}`,
10683
10721
  ))),
10684
10722
  ));
@@ -10753,8 +10791,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10753
10791
  const [view, setView] = useState(null);
10754
10792
  const [busy, setBusy] = useState(false);
10755
10793
  const [historyIndex, setHistoryIndex] = useState(0);
10756
- const [showRaw, setShowRaw] = useState(false);
10757
- const [showReq, setShowReq] = useState(false);
10794
+ const [activeTab, setActiveTab] = useState('progress');
10758
10795
  // Selected requirement ids + the free-editable combined text.
10759
10796
  const [selectedReqIds, setSelectedReqIds] = useState([]);
10760
10797
  const [reqText, setReqText] = useState('');
@@ -10964,12 +11001,29 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10964
11001
  h('div', { className: 'dsh-powerup-progress-fill', style: { width: `${report.percent}%` } }),
10965
11002
  ),
10966
11003
  ),
10967
- ProgressStructure(report),
11004
+ ProgressStructure(report, t),
10968
11005
  ProgressDisplay(report),
10969
11006
  );
10970
11007
  })();
10971
11008
 
10972
- const body = (() => {
11009
+ // Three tabs below the header: progress / requirements / raw output.
11010
+ const tabs = [
11011
+ { id: 'progress', label: t('progress.tabProgress') },
11012
+ { id: 'requirements', label: t('progress.requirements') },
11013
+ { id: 'raw', label: t('progress.viewRaw') },
11014
+ ];
11015
+ const tabBar = h('div', { className: 'dsh-powerup-progress-tabs', role: 'tablist' },
11016
+ tabs.map((tab) => h('button', {
11017
+ key: tab.id,
11018
+ type: 'button',
11019
+ role: 'tab',
11020
+ 'aria-selected': activeTab === tab.id ? 'true' : 'false',
11021
+ className: 'dsh-powerup-progress-tab' + (activeTab === tab.id ? ' on' : ''),
11022
+ onClick: () => setActiveTab(tab.id),
11023
+ }, tab.label)),
11024
+ );
11025
+
11026
+ const progressBody = (() => {
10973
11027
  if (view === null) return h('div', { className: 'dsh-powerup-progress-empty' }, t('progress.hint'));
10974
11028
  if (view.status === 'error') return h('p', { className: 'dsh-powerup-progress-error' }, view.error ?? t('progress.failed'));
10975
11029
  if (running) {
@@ -10978,18 +11032,6 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10978
11032
  reportBody,
10979
11033
  );
10980
11034
  }
10981
- if (showRaw) {
10982
- const raw = typeof report?.raw === 'string' ? report.raw : '';
10983
- return h('div', null,
10984
- h('h4', { className: 'dsh-powerup-progress-section' }, t('progress.rawTitle')),
10985
- h('p', { className: 'dsh-powerup-progress-empty' }, t('progress.rawHint')),
10986
- h('pre', { className: 'dsh-powerup-progress-code' }, raw || '(empty)'),
10987
- h('button', {
10988
- type: 'button', className: 'dsh-powerup-progress-refresh',
10989
- onClick: () => void copyText(raw),
10990
- }, t('progress.copyRaw')),
10991
- );
10992
- }
10993
11035
  if (report === null || report === undefined) {
10994
11036
  return h('div', null,
10995
11037
  h('p', { className: 'dsh-powerup-progress-empty' }, t('progress.empty')),
@@ -11019,8 +11061,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
11019
11061
  );
11020
11062
  })();
11021
11063
 
11022
- const requirementsEditor = showReq ? h('div', { className: 'dsh-powerup-progress-req-pop' },
11023
- h('span', { className: 'dsh-powerup-prompt-field-label' }, t('progress.reqSelect')),
11064
+ const requirementsBody = h('div', { className: 'dsh-powerup-progress-req-tab' },
11024
11065
  h('p', { className: 'dsh-powerup-setting-hint' }, t('progress.reqSelectHint')),
11025
11066
  h(RequirementPicker, {
11026
11067
  reqs: visibleReqs,
@@ -11034,7 +11075,24 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
11034
11075
  type: 'button', className: 'dsh-powerup-prompt-new dsh-powerup-req-create',
11035
11076
  onClick: () => setCreatingReq(true),
11036
11077
  }, t('progress.reqNew')),
11037
- ) : null;
11078
+ );
11079
+
11080
+ const rawBody = h('div', null,
11081
+ h('p', { className: 'dsh-powerup-progress-empty' }, t('progress.rawHint')),
11082
+ h('pre', { className: 'dsh-powerup-progress-code' },
11083
+ (typeof report?.raw === 'string' ? report.raw : '') || t('progress.rawEmpty')),
11084
+ h('button', {
11085
+ type: 'button', className: 'dsh-powerup-progress-refresh',
11086
+ disabled: typeof report?.raw !== 'string' || report.raw === '',
11087
+ onClick: () => void copyText(typeof report?.raw === 'string' ? report.raw : ''),
11088
+ }, t('progress.copyRaw')),
11089
+ );
11090
+
11091
+ const activeBody = activeTab === 'requirements'
11092
+ ? requirementsBody
11093
+ : activeTab === 'raw'
11094
+ ? rawBody
11095
+ : progressBody;
11038
11096
 
11039
11097
  const panel = !open ? null : h('div', {
11040
11098
  ref: panelRef,
@@ -11065,20 +11123,12 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
11065
11123
  'aria-label': t('progress.close'), onClick: close,
11066
11124
  }, '×'),
11067
11125
  ),
11068
- requirementsEditor,
11069
- h('div', { className: 'dsh-powerup-progress-body' }, body),
11126
+ tabBar,
11127
+ h('div', { className: 'dsh-powerup-progress-body' }, activeBody),
11070
11128
  h('div', { className: 'dsh-powerup-progress-foot' },
11071
11129
  h('span', { className: 'dsh-powerup-progress-time' },
11072
11130
  view?.updatedAt ? format(t('progress.updated'), { time: new Date(view.updatedAt).toLocaleTimeString() }) : '',
11073
11131
  ),
11074
- h('button', {
11075
- type: 'button', className: 'dsh-powerup-progress-mini',
11076
- onClick: () => setShowReq((v) => !v),
11077
- }, t('progress.requirements')),
11078
- report?.raw ? h('button', {
11079
- type: 'button', className: 'dsh-powerup-progress-mini',
11080
- onClick: () => setShowRaw((v) => !v),
11081
- }, t('progress.viewRaw')) : null,
11082
11132
  history.length > 0 ? h('button', {
11083
11133
  type: 'button', className: 'dsh-powerup-progress-mini',
11084
11134
  onClick: () => void clearHistory(),
@@ -11276,14 +11326,15 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
11276
11326
  PROMPTS_CSS,
11277
11327
  PROGRESS_CSS,
11278
11328
  ProgressControl,
11329
+ ProgressItem,
11330
+ ProgressStructure,
11331
+ ProgressDisplay,
11279
11332
  RequirementManager,
11280
11333
  RequirementCreateModal,
11281
11334
  RequirementForm,
11282
11335
  RequirementPicker,
11283
11336
  requirementForWorkspace: requirementsForWorkspace,
11284
11337
  DirectAskButton,
11285
- ProgressStructure,
11286
- ProgressDisplay,
11287
11338
  progressRequest,
11288
11339
  PROMPTS_LAST_KEY,
11289
11340
  promptCreateDraft,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restregular/dsh-powerup",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
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",