dsh-conversation-navigator 0.2.7 → 0.2.8

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 +22 -0
  2. package/package.json +2 -2
package/lib/client.js CHANGED
@@ -636,6 +636,17 @@ window.__ModuleLoader__.load({
636
636
  count += 1;
637
637
  }
638
638
  for (const g of groups) {
639
+ /* 轮次组头必须是人类消息(user): 官方节点序里 system-prompt / turn-process
640
+ 的 anchorSeq 可能早于 user 而排在前面, 直接把 items[0] 当轮头会把
641
+ "系统提示"错当轮次主体。把首个 user 稳定提到最前, headKey/标题/
642
+ 步次(slice(1)) 才能都对准用户消息。 */
643
+ if (g.turn !== null) {
644
+ const ui = g.items.findIndex((it) => it.kind === "user");
645
+ if (ui > 0) {
646
+ const u = g.items.splice(ui, 1)[0];
647
+ g.items.unshift(u);
648
+ }
649
+ }
639
650
  const first = g.items[0];
640
651
  if (g.turn === null) {
641
652
  g.title = first.label;
@@ -792,6 +803,17 @@ window.__ModuleLoader__.load({
792
803
  count += 1;
793
804
  }
794
805
  for (const g of groups) {
806
+ /* 轮次组头必须是人类消息(user): 官方节点序里 system-prompt / turn-process
807
+ 的 anchorSeq 可能早于 user 而排在前面, 直接把 items[0] 当轮头会把
808
+ "系统提示"错当轮次主体。把首个 user 稳定提到最前, headKey/标题/
809
+ 步次(slice(1)) 才能都对准用户消息。 */
810
+ if (g.turn !== null) {
811
+ const ui = g.items.findIndex((it) => it.kind === "user");
812
+ if (ui > 0) {
813
+ const u = g.items.splice(ui, 1)[0];
814
+ g.items.unshift(u);
815
+ }
816
+ }
795
817
  const first = g.items[0];
796
818
  if (g.turn === null) {
797
819
  g.title = first.label;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-conversation-navigator",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "DSH(DeepSeek Harness)会话导航插件:按轮折叠的对话大纲面板,支持节点点击跳转、滚动位置高亮与轨迹视图同款配色。",
5
5
  "keywords": [
6
6
  "dsh",
@@ -33,7 +33,7 @@
33
33
  "node": ">=18"
34
34
  },
35
35
  "peerDependencies": {
36
- "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.1-rc.2 <0.2.0"
36
+ "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.2-rc.1 <0.2.0"
37
37
  },
38
38
  "dsh": {
39
39
  "bundle": {