dsh-fish-memory 1.4.9 → 1.5.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 (2) hide show
  1. package/lib/client.js +46 -41
  2. package/package.json +5 -1
package/lib/client.js CHANGED
@@ -443,6 +443,51 @@ const 洗键进度 = { 已: 0, 总: 0, 在跑: false, 干跑: false }
443
443
  const now = Date.now()
444
444
 
445
445
  // ---- 第二级:某个会话的详情 ----
446
+ // ⭐ 1.4.8(issue #26):合并预览抽成一个函数 —— 以前它只写在「会话详情」那个
447
+ // `if (open) return …` 分支里,可触发它的按钮在主面板,于是没展开会话时永远渲染不出来,
448
+ // 看着就是「点了没反应」(试算其实成功了)。现在主面板和详情都能用同一个状态。
449
+ const 合并预览 = () =>
450
+ 并入 && 并入.length
451
+ ? React.createElement(
452
+ 'div',
453
+ { style: S.askBox },
454
+ React.createElement(
455
+ 'div',
456
+ { style: { flex: 1 } },
457
+ '切成「按工作区」要把这些会话的记忆并成一份:',
458
+ React.createElement(
459
+ 'div',
460
+ { style: Object.assign({}, S.dim, { fontSize: 12, marginTop: 4, lineHeight: 1.7 }) },
461
+ 并入.map((r) =>
462
+ '· ' + r.叫什么 + ':' + r.会话数 + ' 间会话,共 ' + r.合计 + ' 条' +
463
+ (r.去重 ? '(' + r.去重 + ' 条重复,并完 ' + r.并完 + ' 条)' : ''),
464
+ ).join(String.fromCharCode(10)),
465
+ ),
466
+ React.createElement(
467
+ 'div',
468
+ { style: Object.assign({}, S.dim, { fontSize: 11, marginTop: 4 }) },
469
+ '归档的会话不会并进来。旧库都留着 —— 想退回「按会话」随时能退。',
470
+ ),
471
+ ),
472
+ React.createElement(
473
+ 'button',
474
+ {
475
+ style: S.btnDanger,
476
+ disabled: busy,
477
+ onClick: () => {
478
+ setBusy(true)
479
+ post('/merge-workspace', { 试算: false })
480
+ .then(() => post('/mode', { 模式: 'workspace' }))
481
+ .then(() => { setBusy(false); set并入(null); load() })
482
+ .catch(() => setBusy(false))
483
+ },
484
+ },
485
+ busy ? '并着呢…' : '并进来',
486
+ ),
487
+ React.createElement('button', { style: S.btn, onClick: () => set并入(null) }, '算了'),
488
+ )
489
+ : null
490
+
446
491
  if (open) {
447
492
  const s = (d.sessions || []).find((x) => x.id === open)
448
493
  if (!s) return React.createElement('div', { style: S.wrap }, '找不到这个会话')
@@ -2703,47 +2748,6 @@ const 洗键进度 = { 已: 0, 总: 0, 在跑: false, 干跑: false }
2703
2748
  '那种一个字都没改,也不会再问一遍 ✓)',
2704
2749
  )
2705
2750
  : null,
2706
- // ⭐ 1.4.5:切成「按工作区」之前的合并预览 —— 先看清楚要并什么,再决定
2707
- 并入 && 并入.length
2708
- ? React.createElement(
2709
- 'div',
2710
- { style: S.askBox },
2711
- React.createElement(
2712
- 'div',
2713
- { style: { flex: 1 } },
2714
- '切成「按工作区」要把这些会话的记忆并成一份:',
2715
- React.createElement(
2716
- 'div',
2717
- { style: Object.assign({}, S.dim, { fontSize: 12, marginTop: 4, lineHeight: 1.7 }) },
2718
- 并入.map((r) =>
2719
- '· ' + r.叫什么 + ':' + r.会话数 + ' 间会话,共 ' + r.合计 + ' 条' +
2720
- (r.去重 ? '(' + r.去重 + ' 条重复,并完 ' + r.并完 + ' 条)' : ''),
2721
- ).join('\n'),
2722
- ),
2723
- React.createElement(
2724
- 'div',
2725
- { style: Object.assign({}, S.dim, { fontSize: 11, marginTop: 4 }) },
2726
- '归档的会话不会并进来。旧库都留着 —— 想退回「按会话」随时能退。',
2727
- ),
2728
- ),
2729
- React.createElement(
2730
- 'button',
2731
- {
2732
- style: S.btnDanger,
2733
- disabled: busy,
2734
- onClick: () => {
2735
- setBusy(true)
2736
- post('/merge-workspace', { 试算: false })
2737
- .then(() => post('/mode', { 模式: 'workspace' }))
2738
- .then(() => { setBusy(false); set并入(null); load() })
2739
- .catch(() => setBusy(false))
2740
- },
2741
- },
2742
- busy ? '并着呢…' : '并进来',
2743
- ),
2744
- React.createElement('button', { style: S.btn, onClick: () => set并入(null) }, '算了'),
2745
- )
2746
- : null,
2747
2751
  confirm && confirm.kind === 'stable'
2748
2752
  ? React.createElement(
2749
2753
  'div',
@@ -4051,6 +4055,7 @@ const 洗键进度 = { 已: 0, 总: 0, 在跑: false, 干跑: false }
4051
4055
  : '每个会话各记各的。会话开久了变卡、要归档换新会话时,切成「按工作区」就接得上了。',
4052
4056
  ),
4053
4057
  ),
4058
+ 合并预览(),
4054
4059
  (d.sessions || []).map((s) =>
4055
4060
  React.createElement(
4056
4061
  'div',
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "dsh-fish-memory",
3
- "version": "1.4.9",
3
+ "version": "1.5.0",
4
4
  "description": "给 DSH 里的会话一份会淡忘的长期记忆,每条都带时间。",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
7
+ "engines": {
8
+ "node": ">=22",
9
+ "dsh": ">=0.2.1-rc.2"
10
+ },
7
11
  "keywords": [
8
12
  "deepseek-harness",
9
13
  "dsh-plugin",