@huanlin/dsh-plugin-merge-tool-calls 0.1.0 → 0.2.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.
- package/README.md +27 -10
- package/lib/client.js +122 -54
- package/lib/client.js.map +1 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/locales.d.ts +10 -0
- package/lib/types/client/rows.d.ts +29 -2
- package/lib/types/client/styles.d.ts +1 -1
- package/lib/types/invariant.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://dshfind.com/zh/plugins/huanlinoto/dsh-plugin-merge-tool-calls"><img src="https://dshfind.com/api/card/huanlinoto/dsh-plugin-merge-tool-calls?lang=zh" alt="dsh-plugin-merge-tool-calls card"></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
1
5
|
# dsh-plugin-merge-tool-calls
|
|
2
6
|
|
|
3
7
|
把 WebUI 会话流中**连续相邻**的同工具调用合并为一个「主卡片 + 紧凑子行」的树状展示,减少连续读文件/搜索/编辑/执行命令时多条卡片对流的占据。默认覆盖所有内置通用行工具(`read`/`grep`/`glob`/`edit`/`write`/`bash`/`pwsh`/`web_search`/`web_fetch`/`run_code`/`cordis_package_inspect`/`cordis_runtime_inspect`),也可配置白名单。
|
|
4
8
|
|
|
5
9
|
```
|
|
6
10
|
合并前: 合并后:
|
|
7
|
-
[Read] foo ▸ 内容 [Read]
|
|
8
|
-
[Read] bar ▸ 内容 └
|
|
9
|
-
[Read] baz ▸ 内容 └
|
|
11
|
+
[Read] foo ▸ 内容 [Read] · 3 Files ▸(点击展开子行)
|
|
12
|
+
[Read] bar ▸ 内容 └ foo(子行,点击展开 foo 的内容)
|
|
13
|
+
[Read] baz ▸ 内容 └ bar(子行,点击展开 bar 的内容)
|
|
14
|
+
└ baz(子行,点击展开 baz 的内容)
|
|
10
15
|
```
|
|
11
16
|
|
|
17
|
+
主行只显示数量摘要(`Read · 3 Files`),具体文件路径全部下沉到子行;子行默认折叠,点击主行以动画展开/收起。单次调用(无合并)保持原行为(主行直接显示路径并展开内容)。
|
|
18
|
+
|
|
12
19
|
纯展示层合并:会话日志、模型可见数据、详情面板均不受影响;回放确定(合并结果是聊天快照的纯函数)。
|
|
13
20
|
|
|
14
21
|
## 工作原理
|
|
@@ -19,8 +26,9 @@
|
|
|
19
26
|
`[data-chat-flow-kind="tool-call"]:has([data-slot="tool.call.toolview"]:empty) { display: none; }`
|
|
20
27
|
将其从流中收起(与内置 `.flowItem:empty` 语义一致;渲染器为每个 toolview 包一层
|
|
21
28
|
`data-slot` 容器,故以该容器判空)。
|
|
22
|
-
- 主卡片镜像内置 ToolRow 的行面:按 variant 渲染标题/图标(Read/Search/Bash/Write/Edit/Code/`Tool call`,工具自定义标题如 `Pwsh`/`Inspect`
|
|
23
|
-
- 子行紧凑(20px 高),结构为主行的尾部(`sep 点 +
|
|
29
|
+
- 主卡片镜像内置 ToolRow 的行面:按 variant 渲染标题/图标(Read/Search/Bash/Write/Edit/Code/`Tool call`,工具自定义标题如 `Pwsh`/`Inspect` 优先)。**合并组的主行摘要改为数量**(`Read · 5 Files` / `Search · 3 Queries` / `Bash · 4 Commands` 等,按 variant 选名词),不再显示首个调用的路径;单次调用(无合并)仍显示 args 摘要(读→路径、搜索→query、bash→description/command、未知工具带 `工具名 ·` 前缀),`read`/`write`/`edit` 单行的摘要是可点击文件链接。行状态、错误首行、bash 失败退出码转红点均与内置一致。
|
|
30
|
+
- 子行紧凑(20px 高),结构为主行的尾部(`sep 点 + 路径`)。合并组内**所有调用(含首个)**均渲染为子行,所以每个文件路径都在子行上。对齐**运行时自动测量**:组件挂载后量取主行 sep 点相对卡片的偏移(并用 ResizeObserver 跟随字体/布局变化),以 `--mtc-sep-left` 自定义属性设置子行缩进——sep 点与主行 sep 点同列、路径与主行摘要同列,不依赖任何手工字体宽度常量,任意工具名均自动对齐。展开的子行卡片以负向 `calc` 抵消该缩进,左边缘与主卡片内容区对齐(占满卡片宽度,左侧不留白)。无可展开内容(如运行中的 read)的子行渲染为静态行。
|
|
31
|
+
- 子行**默认折叠**:主行点击展开时,子行块以 `grid-template-rows: 0fr → 1fr` + 透明度过渡动画滑出(200ms),收起时反向滑回;折叠期间子行仍在 DOM 中(grid 0fr + `overflow: hidden` 收起,不卸载),所以动画平滑无闪烁。每个子行仍可独立点击展开其内容卡片。
|
|
24
32
|
|
|
25
33
|
## 配置
|
|
26
34
|
|
|
@@ -52,8 +60,17 @@ profile 无需额外解析。
|
|
|
52
60
|
|
|
53
61
|
## 运行(挂载到 profile)
|
|
54
62
|
|
|
63
|
+
开发热更新(本地 clone,改源码重建 `lib/` 即生效):
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
dsh plugin --profile web add link:D:\Projects\deepseek-harness\dsh-plugin-merge-tool-calls
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
分发安装(二选一):
|
|
70
|
+
|
|
55
71
|
```sh
|
|
56
|
-
dsh plugin --profile web add
|
|
72
|
+
dsh plugin --profile web add "github:huanlinoto/dsh-plugin-merge-tool-calls" # 源码分发
|
|
73
|
+
dsh plugin --profile web add "@huanlin/dsh-plugin-merge-tool-calls" # npm registry 分发
|
|
57
74
|
```
|
|
58
75
|
|
|
59
76
|
然后由人类重启 `dsh web` 进程并硬刷新浏览器(`Ctrl+Shift+R`)。
|
|
@@ -62,15 +79,15 @@ dsh plugin --profile web add link:D:\Projects\deepseek-harness\dsh-merge-tool-ca
|
|
|
62
79
|
|
|
63
80
|
- `pnpm run typecheck && pnpm test && pnpm run build` 全绿;
|
|
64
81
|
- `git -C <dsh checkout> status` 干净(零源码 patch);
|
|
65
|
-
- 浏览器验证:连续 3 个 `read`
|
|
82
|
+
- 浏览器验证:连续 3 个 `read` 主行显示 `Read · 3 Files`,点击主行以动画展开 3 个 `└` 子行(foo/bar/baz 各一行),再点击子行展开内容;
|
|
66
83
|
`grep`/`glob` 同理;`write`/`edit` 子行展开显示 diff 卡片、`bash`/`pwsh` 显示终端卡片、
|
|
67
84
|
路径子行可点击在侧边栏预览;中间隔了其他节点的调用保持单卡片。
|
|
68
85
|
|
|
69
86
|
## 边界行为
|
|
70
87
|
|
|
71
|
-
- 组内运行中(running
|
|
72
|
-
- error / interrupted 调用按内置语义着色(错误首行 / 警告状态点);bash
|
|
73
|
-
- `read`/`write`/`edit`
|
|
88
|
+
- 组内运行中(running)调用:主行显示数量摘要(如 `Read · 3 Files`),子行折叠时不可见,展开后各子行显示对应调用的 args 摘要路径;结果到达后原地更新。
|
|
89
|
+
- error / interrupted 调用按内置语义着色(错误首行 / 警告状态点);bash 非零退出码按内置语义转为红色错误点。主行错误时摘要回退为错误首行(不显示数量)。
|
|
90
|
+
- `read`/`write`/`edit` 家族的子行摘要是可点击文件链接(与内置行为一致,打开侧边栏预览);grep/glob 的 `path` 参数是搜索目录而非文件,摘要保持纯文本,不会误开目录。单次调用(无合并)的主行摘要是文件链接。
|
|
74
91
|
- 组被任何其他节点打断即断开;超过 `maxGroupSize` 的部分另起新组(不丢调用)。
|
|
75
92
|
- 非聊天节点场景(如被 dispatch 为子调用)回退为普通单行,绝不空白。
|
|
76
93
|
- 带自定义行卡片的工具(`skill`、`cordis_define`、`cordis_run`/`cordis_stop`/`cordis_undefine`,以及摘要格式特殊的 `todo_write`/`ask_user_question`)**不**默认接管,保持内置行;如需合并,用 `tools` 白名单显式加入(合并行按通用行面渲染)。
|
package/lib/client.js
CHANGED
|
@@ -52,6 +52,11 @@ const zh = {
|
|
|
52
52
|
more: "+{n}",
|
|
53
53
|
showLess: "收起其余",
|
|
54
54
|
mergedCount: "已合并 {n} 次调用",
|
|
55
|
+
countFiles: "{n} 个文件",
|
|
56
|
+
countQueries: "{n} 次搜索",
|
|
57
|
+
countCommands: "{n} 条命令",
|
|
58
|
+
countPrograms: "{n} 段代码",
|
|
59
|
+
countCalls: "{n} 次调用",
|
|
55
60
|
"terminal.signal": "信号 {signal}",
|
|
56
61
|
"terminal.exitCode": "退出码 {code}",
|
|
57
62
|
"terminal.running": "运行中",
|
|
@@ -74,6 +79,11 @@ const en = {
|
|
|
74
79
|
more: "+{n}",
|
|
75
80
|
showLess: "Show fewer",
|
|
76
81
|
mergedCount: "{n} calls merged",
|
|
82
|
+
countFiles: "{n} Files",
|
|
83
|
+
countQueries: "{n} Queries",
|
|
84
|
+
countCommands: "{n} Commands",
|
|
85
|
+
countPrograms: "{n} Programs",
|
|
86
|
+
countCalls: "{n} Calls",
|
|
77
87
|
"terminal.signal": "signal {signal}",
|
|
78
88
|
"terminal.exitCode": "exit code {code}",
|
|
79
89
|
"terminal.running": "Running",
|
|
@@ -559,6 +569,21 @@ const VARIANT_ICONS = {
|
|
|
559
569
|
code: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconCodeOutline16, { size: 14 }),
|
|
560
570
|
others: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconSparkle16, { size: 14 })
|
|
561
571
|
};
|
|
572
|
+
/**
|
|
573
|
+
* Per-variant locale key for the merged-count summary (`{n} Files`, `{n}
|
|
574
|
+
* Commands`, …). Replaces the first call's file path on the main row when the
|
|
575
|
+
* run merges more than one call, so the main row reads `Read · 5 Files` and
|
|
576
|
+
* the file paths move to the collapsed child rows.
|
|
577
|
+
*/
|
|
578
|
+
const VARIANT_COUNT_KEY = {
|
|
579
|
+
read: "countFiles",
|
|
580
|
+
write: "countFiles",
|
|
581
|
+
edit: "countFiles",
|
|
582
|
+
search: "countQueries",
|
|
583
|
+
bash: "countCommands",
|
|
584
|
+
code: "countPrograms",
|
|
585
|
+
others: "countCalls"
|
|
586
|
+
};
|
|
562
587
|
/** Leading-slot state substitution, mirroring the shipped row. */
|
|
563
588
|
function leadingFor(state, icon) {
|
|
564
589
|
switch (state) {
|
|
@@ -650,16 +675,24 @@ function CardBody({ model, t }) {
|
|
|
650
675
|
]
|
|
651
676
|
});
|
|
652
677
|
}
|
|
653
|
-
/**
|
|
654
|
-
|
|
678
|
+
/**
|
|
679
|
+
* The run's main card: the first call's chrome (variant title/icon + state)
|
|
680
|
+
* plus, for a single call, its expandable content card. For a merged run the
|
|
681
|
+
* main row's collapsed summary is the count (`Read · 5 Files`) and the
|
|
682
|
+
* expanded body is the child-rows block (passed in as `children`); the first
|
|
683
|
+
* call is rendered as the first child row so every file path lands on a child
|
|
684
|
+
* row, never on the main row.
|
|
685
|
+
*/
|
|
686
|
+
const RowCard = (0, react.memo)(function RowCard$1({ toolName, block, cwd, openFile, inspect, t, mergedCount, children }) {
|
|
655
687
|
const model = callRowModel(toolName, block, cwd);
|
|
656
688
|
const [expanded, setExpanded] = (0, react.useState)(false);
|
|
657
|
-
const
|
|
689
|
+
const hasChildren = mergedCount > 0;
|
|
690
|
+
const expandable = model.expandable || hasChildren;
|
|
691
|
+
const open = expanded && expandable;
|
|
658
692
|
const status = stateStatus(model.state, t);
|
|
659
693
|
const failureLine = model.state === "error" ? model.errorSummary ?? null : null;
|
|
660
|
-
const summaryText = failureLine ?? model.summary;
|
|
661
|
-
const
|
|
662
|
-
const fileLink = model.filePath !== void 0 && openFile !== void 0 && failureLine === null;
|
|
694
|
+
const summaryText = hasChildren && failureLine === null ? t(VARIANT_COUNT_KEY[model.variant], { n: String(mergedCount + 1) }) : failureLine ?? model.summary;
|
|
695
|
+
const fileLink = !hasChildren && model.filePath !== void 0 && openFile !== void 0 && failureLine === null;
|
|
663
696
|
const openFileClick = (event) => {
|
|
664
697
|
event.stopPropagation();
|
|
665
698
|
if (model.filePath !== void 0) openFile(model.filePath);
|
|
@@ -668,29 +701,30 @@ const RowCard = (0, react.memo)(function RowCard$1({ toolName, block, cwd, openF
|
|
|
668
701
|
className: "mtc-row",
|
|
669
702
|
"data-state": model.state,
|
|
670
703
|
"data-variant": model.variant,
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
704
|
+
"data-merged": hasChildren || void 0,
|
|
705
|
+
children: [
|
|
706
|
+
status !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
707
|
+
className: "mtc-visually-hidden",
|
|
708
|
+
children: status
|
|
709
|
+
}),
|
|
710
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
|
|
711
|
+
rowClassName: "mtc-title-row",
|
|
712
|
+
titleClassName: "mtc-title",
|
|
713
|
+
leadingClassName: "mtc-leading",
|
|
714
|
+
chevronClassName: "mtc-chevron",
|
|
715
|
+
icon: leadingFor(model.state, VARIANT_ICONS[model.variant]),
|
|
716
|
+
title: model.title,
|
|
717
|
+
open,
|
|
718
|
+
expandable,
|
|
719
|
+
expandOnRowClick: true,
|
|
720
|
+
keepContentWhenOpen: true,
|
|
721
|
+
onToggle: () => {
|
|
722
|
+
setExpanded((value) => !value);
|
|
723
|
+
},
|
|
724
|
+
collapsedContent: summaryText !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
690
725
|
className: "mtc-sep",
|
|
691
726
|
"aria-hidden": true
|
|
692
|
-
}),
|
|
693
|
-
fileLink ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
727
|
+
}), fileLink ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
694
728
|
type: "button",
|
|
695
729
|
className: "mtc-summary-link",
|
|
696
730
|
onClick: openFileClick,
|
|
@@ -698,25 +732,35 @@ const RowCard = (0, react.memo)(function RowCard$1({ toolName, block, cwd, openF
|
|
|
698
732
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
699
733
|
className: "mtc-summary",
|
|
700
734
|
children: summaryText
|
|
701
|
-
}),
|
|
702
|
-
|
|
703
|
-
className: "mtc-
|
|
704
|
-
children:
|
|
735
|
+
})] }),
|
|
736
|
+
children: !hasChildren && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
737
|
+
className: "mtc-card-body",
|
|
738
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardBody, {
|
|
739
|
+
model,
|
|
740
|
+
t
|
|
741
|
+
}), inspect !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
742
|
+
type: "button",
|
|
743
|
+
className: "mtc-inspect",
|
|
744
|
+
onClick: inspect,
|
|
745
|
+
children: "Inspect"
|
|
746
|
+
})]
|
|
705
747
|
})
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
className: "mtc-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
748
|
+
}),
|
|
749
|
+
hasChildren && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
750
|
+
className: "mtc-children-collapse",
|
|
751
|
+
"data-open": open || void 0,
|
|
752
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
753
|
+
className: "mtc-children",
|
|
754
|
+
children
|
|
755
|
+
})
|
|
756
|
+
}),
|
|
757
|
+
hasChildren && open && inspect !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
758
|
+
type: "button",
|
|
759
|
+
className: "mtc-inspect",
|
|
760
|
+
onClick: inspect,
|
|
761
|
+
children: "Inspect"
|
|
718
762
|
})
|
|
719
|
-
|
|
763
|
+
]
|
|
720
764
|
});
|
|
721
765
|
});
|
|
722
766
|
/**
|
|
@@ -827,29 +871,27 @@ function MergedToolRow({ callId, toolName, block, cwd, openFile, inspect, t, cfg
|
|
|
827
871
|
});
|
|
828
872
|
if (!run.isFirst) return null;
|
|
829
873
|
const hasChildren = run.blocks.length > 1;
|
|
830
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
874
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
831
875
|
className: "mtc-root",
|
|
832
876
|
"data-tool": toolName,
|
|
833
877
|
ref: rootRef,
|
|
834
|
-
|
|
878
|
+
style: sepLeft === null ? void 0 : { ["--mtc-sep-left"]: `${sepLeft}px` },
|
|
879
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowCard, {
|
|
835
880
|
toolName,
|
|
836
881
|
block: run.blocks[0] ?? block,
|
|
837
882
|
cwd,
|
|
838
883
|
openFile,
|
|
839
884
|
inspect,
|
|
840
885
|
t,
|
|
841
|
-
mergedCount: run.blocks.length - 1
|
|
842
|
-
|
|
843
|
-
className: "mtc-children",
|
|
844
|
-
style: sepLeft === null ? void 0 : { ["--mtc-sep-left"]: `${sepLeft}px` },
|
|
845
|
-
children: run.blocks.slice(1).map((child) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChildRow, {
|
|
886
|
+
mergedCount: run.blocks.length - 1,
|
|
887
|
+
children: hasChildren && run.blocks.map((child) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChildRow, {
|
|
846
888
|
toolName,
|
|
847
889
|
block: child,
|
|
848
890
|
cwd,
|
|
849
891
|
openFile,
|
|
850
892
|
t
|
|
851
893
|
}, child.callId))
|
|
852
|
-
})
|
|
894
|
+
})
|
|
853
895
|
});
|
|
854
896
|
}
|
|
855
897
|
|
|
@@ -944,8 +986,34 @@ const CSS = `
|
|
|
944
986
|
/* Compact child rows: each is the main row's tail structure — [sep dot][path].
|
|
945
987
|
The dot/path columns are set at runtime by the component (it measures the
|
|
946
988
|
main row's sep offset and sets the --mtc-sep-left custom property on the
|
|
947
|
-
|
|
948
|
-
|
|
989
|
+
root), so this is only the pre-measure fallback.
|
|
990
|
+
|
|
991
|
+
The .mtc-children-collapse wrapper animates the block's height with a
|
|
992
|
+
grid-template-rows 0fr↔1fr transition (children stay in the DOM while
|
|
993
|
+
collapsing, so the slide is smooth instead of popping out). The vertical
|
|
994
|
+
margin lives on the wrapper (not .mtc-children) so it doesn't leak past the
|
|
995
|
+
0fr row when collapsed. */
|
|
996
|
+
.mtc-children-collapse {
|
|
997
|
+
display: grid;
|
|
998
|
+
grid-template-rows: 0fr;
|
|
999
|
+
margin: 0;
|
|
1000
|
+
transition: grid-template-rows 200ms ease-out, margin 200ms ease-out;
|
|
1001
|
+
}
|
|
1002
|
+
.mtc-children-collapse[data-open] {
|
|
1003
|
+
grid-template-rows: 1fr;
|
|
1004
|
+
margin: 2px 0;
|
|
1005
|
+
}
|
|
1006
|
+
.mtc-children {
|
|
1007
|
+
display: flex; flex-direction: column; gap: 1px;
|
|
1008
|
+
margin: 0 0 0 var(--mtc-sep-left, 61px);
|
|
1009
|
+
min-width: 0; min-height: 0; overflow: hidden;
|
|
1010
|
+
opacity: 0;
|
|
1011
|
+
transition: opacity 150ms ease-out;
|
|
1012
|
+
}
|
|
1013
|
+
.mtc-children-collapse[data-open] .mtc-children {
|
|
1014
|
+
opacity: 1;
|
|
1015
|
+
transition: opacity 150ms ease-out 50ms;
|
|
1016
|
+
}
|
|
949
1017
|
.mtc-child { display: flex; flex-direction: column; min-width: 0; }
|
|
950
1018
|
.mtc-child-row {
|
|
951
1019
|
display: flex; align-items: center; gap: 0; min-width: 0; height: 20px;
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["DEFAULT_MERGE_CONFIG: MergeToolCallsConfig","ALL_TOOL_NAMES: readonly string[]","VARIANT_TITLES: Record<ToolVariant, string>","TOOL_VARIANTS: Record<string, ToolVariant>","TOOL_TITLES: Record<string, string>","parts: string[]","parsed: unknown","SUMMARY_KEYS: Record<ToolVariant, readonly string[]>","FILE_PATH_VARIANTS: ReadonlySet<ToolVariant>","state: RowState","out: DiffHunk[]","diffs","blocks: ToolCallBlock[]","VARIANT_ICONS: Record<ToolVariant, ReactNode>","IconSearchOutline16","IconBrowseOutline16","IconApiOutline14","IconEditOutline16","IconCodeOutline16","IconSparkle16","StateDot","TerminalBlock","DiffBlock","ReadBlock","SearchBlock","WebBlock","RowCard","DisclosureRow","ChildRow","cfg: MergeToolCallsConfig"],"sources":["../src/types.ts","../src/client/locales.ts","../src/client/tool-names.ts","../src/client/card-model.ts","../src/client/merge-run.ts","../src/client/rows.tsx","../src/client/styles.ts","../src/client/index.ts"],"sourcesContent":["/** Shared config surface of the merge-tool-calls plugin (host + client halves). */\n\n/** How consecutive same-tool calls are grouped into one merged card. */\nexport type MergeGroupMode = 'adjacent' | 'step'\n\n/** Plugin configuration; defaults live in the Schemastery schema and cordis.patch.yml. */\nexport interface MergeToolCallsConfig {\n /**\n * Wire tool names whose consecutive calls merge. Empty = every built-in\n * generic-family tool (read/grep/glob/edit/write/bash/pwsh/web_search/\n * web_fetch/run_code/cordis_package_inspect/cordis_runtime_inspect); a\n * non-empty list is an explicit whitelist (any wire name works).\n */\n readonly tools: readonly string[]\n /** `adjacent`: any consecutive run in the chat flow; `step`: only within one agent step. */\n readonly groupBy: MergeGroupMode\n /** Max calls per merged group; the run is truncated and the excess starts a new group. */\n readonly maxGroupSize: number\n}\n\n/** Runtime defaults applied when a half receives no config (defensive only). */\nexport const DEFAULT_MERGE_CONFIG: MergeToolCallsConfig = {\n tools: [],\n groupBy: 'adjacent',\n maxGroupSize: 8,\n}\n","/** Product copy for the merged tool-call rows. */\nexport const zh = {\n running: '进行中',\n failed: '失败',\n stopped: '已中断',\n expand: '展开',\n collapse: '折叠',\n more: '+{n}',\n showLess: '收起其余',\n mergedCount: '已合并 {n} 次调用',\n 'terminal.signal': '信号 {signal}',\n 'terminal.exitCode': '退出码 {code}',\n 'terminal.running': '运行中',\n 'terminal.failed': '失败',\n 'terminal.done': '已完成',\n 'terminal.copy': '复制',\n 'terminal.copied': '已复制',\n 'terminal.noOutput': '无输出',\n 'terminal.collapseAria': '收起输出',\n 'terminal.collapse': '折叠',\n 'terminal.expandAria': '展开其余 {n} 行输出',\n 'terminal.expandRest': '… 其余 {n} 行',\n} satisfies Record<string, string>\n\nexport type MergeToolCallsKey = keyof typeof zh\n\nexport const en = {\n running: 'Running',\n failed: 'Failed',\n stopped: 'Interrupted',\n expand: 'Expand',\n collapse: 'Collapse',\n more: '+{n}',\n showLess: 'Show fewer',\n mergedCount: '{n} calls merged',\n 'terminal.signal': 'signal {signal}',\n 'terminal.exitCode': 'exit code {code}',\n 'terminal.running': 'Running',\n 'terminal.failed': 'Failed',\n 'terminal.done': 'Done',\n 'terminal.copy': 'Copy',\n 'terminal.copied': 'Copied',\n 'terminal.noOutput': 'No output',\n 'terminal.collapseAria': 'Collapse output',\n 'terminal.collapse': 'Collapse',\n 'terminal.expandAria': 'Expand the remaining {n} output lines',\n 'terminal.expandRest': '… {n} more lines',\n} satisfies Record<MergeToolCallsKey, string>\n\nexport const NS = 'merge-tool-calls'\n","/**\n * The built-in tool universe this plugin shadows by default, plus the\n * variant-classification vocabulary mirroring ui-tool's tool-call model.\n *\n * The keyed `tool.call.toolview` slot dispatches on the exact wire tool name,\n * so a shadowed registration is needed per name (there is no wildcard). This\n * list names every shipped tool whose row belongs to the generic ToolRow\n * family — a variant title/icon plus read/search/diff/terminal/web card or\n * IN/OUT text — which the merged row reproduces faithfully.\n *\n * Deliberately excluded: tools with custom row cards this plugin does not\n * replicate (`skill`, `cordis_define`, and the live `cordis_run` /\n * `cordis_stop` / `cordis_undefine` rows), and `todo_write` /\n * `ask_user_question` whose summary formatting is tool-specific. They keep\n * their built-in rows unless the user names them in the `tools` config\n * explicitly.\n * @module\n */\n\n/** Wire tool names merged by default (empty `tools` config = this list). */\nexport const ALL_TOOL_NAMES: readonly string[] = [\n // File tools (read/search/diff cards).\n 'read', 'grep', 'glob', 'edit', 'write',\n // Shell tools (terminal card).\n 'bash', 'pwsh',\n // Web tools (web card).\n 'web_search', 'web_fetch',\n // Code tool (generic IN/OUT with the program body).\n 'run_code',\n // Cordis inspection verbs (generic read-variant rows).\n 'cordis_package_inspect', 'cordis_runtime_inspect',\n]\n\n/** Tool-row visual variant, mirroring ui-tool's ToolRowVariant. */\nexport type ToolVariant = 'search' | 'read' | 'bash' | 'write' | 'edit' | 'code' | 'others'\n\n/** Figma row titles per variant (design literals, not translatable copy). */\nexport const VARIANT_TITLES: Record<ToolVariant, string> = {\n search: 'Search', read: 'Read', bash: 'Bash',\n write: 'Write', edit: 'Edit', code: 'Code', others: 'Tool call',\n}\n\n/**\n * Known tool name -> row variant (mirrors ui-tool's classification table,\n * minus the run-control verbs: their rows are custom and not shadowed).\n */\nconst TOOL_VARIANTS: Record<string, ToolVariant> = {\n bash: 'bash',\n pwsh: 'bash',\n read: 'read',\n web_fetch: 'read',\n web_search: 'search',\n grep: 'search',\n glob: 'search',\n write: 'write',\n edit: 'edit',\n run_code: 'code',\n cordis_package_inspect: 'read',\n cordis_runtime_inspect: 'read',\n}\n\n/** Tool-owned titles refining a generic row variant (mirrors ui-tool). */\nexport const TOOL_TITLES: Record<string, string> = {\n cordis_package_inspect: 'Inspect',\n cordis_runtime_inspect: 'Inspect',\n pwsh: 'Pwsh',\n}\n\n/** Classify a tool name into its row variant (mirrors ui-tool). */\nexport function classifyTool(toolName: string): ToolVariant {\n return TOOL_VARIANTS[toolName] ?? 'others'\n}\n\n/** The variant title a row shows, honoring tool-owned refinements. */\nexport function variantTitle(toolName: string): string {\n return TOOL_TITLES[toolName] ?? VARIANT_TITLES[classifyTool(toolName)]\n}\n","/**\n * Pure card/row derivation from a frozen call slice, mirroring ui-tool's\n * tool-call/read-card/search-card/diff-card/terminal-card/web-card models at\n * the plugin boundary (those models are ui-tool internals and cannot be\n * imported cross-package). Same wire contract, same defensive treatment of\n * untrusted result views. A merged row renders the same surface the built-in\n * row would: a variant title/icon plus a card primitive or IN/OUT text.\n * @module\n */\nimport {\n resolveWorkspacePath,\n type ToolCallBlock, type ToolResultNode,\n} from '@deepseek-ai/dsh-client-runtime/client'\nimport type {\n DiffBlockProps, DiffHunk, ReadBlockProps, SearchBlockProps, SearchFileGroup,\n TerminalBlockProps, WebBlockProps,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport { classifyTool, VARIANT_TITLES, TOOL_TITLES, type ToolVariant } from './tool-names.ts'\n\n/** Row state semantic, mirroring ui-tool's ToolRowState. */\nexport type RowState = 'running' | 'ok' | 'error' | 'stopped'\n\nexport type { ToolVariant } from './tool-names.ts'\n\n/** Read-card props the ReadBlock primitive draws (per-render maxLines owned by the caller). */\nexport type ReadCardModel = Pick<ReadBlockProps, 'label' | 'lines' | 'totalLines' | 'lang'>\n\n/**\n * Distributive `Omit`: a plain `Omit<A | B, K>` keeps only the keys common to\n * both members, dropping the discriminated `files`/`paths` fields. Distributing\n * over the naked type parameter preserves each shape.\n */\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never\n\n/** Search-card props plus the capped-result recovery locator (mirrors ui-tool). */\nexport interface SearchCardModel {\n readonly card: DistributiveOmit<SearchBlockProps, 'maxLines' | 'className'>\n /** The result view's replacement title, which outranks the args summary. */\n readonly title: string | undefined\n readonly recovery: string | undefined\n}\n\n/** Diff-card props (mirrors ui-tool; maxLines/className belong to the render site). */\nexport interface DiffCardModel {\n readonly card: Pick<DiffBlockProps, 'diffs'>\n}\n\n/** Terminal-card props (mirrors ui-tool; maxLines/className/labels belong to the render site). */\nexport interface TerminalCardModel {\n readonly card: Pick<TerminalBlockProps, 'command' | 'cwd' | 'output' | 'exitCode' | 'signal' | 'running'>\n /** The call view's model-authored description shown above the card. */\n readonly description: string | undefined\n}\n\n/** True when a settled terminal card reports a failing exit (mirrors ui-tool). */\nexport function terminalFailed(model: TerminalCardModel): boolean {\n const { exitCode, signal, running } = model.card\n return running !== true && ((exitCode !== undefined && exitCode !== 0) || signal !== undefined)\n}\n\n/** Everything a merged row needs, derived once from the frozen slice. */\nexport interface CallRowModel {\n readonly state: RowState\n readonly variant: ToolVariant\n /** Row title: variant title, or the tool-owned title when it refines one. */\n readonly title: string\n /** Args/result-derived one-line summary (path for file tools, query for searches, …). */\n readonly summary: string\n /** Expanded-body input text (pretty args); null = no input section. */\n readonly body: string | null\n /** Flattened result text; null while running or when the result carries no text. */\n readonly output: string | null\n /** First result line on an error row (the collapsed summary's error text). */\n readonly errorSummary: string | null\n /** Openable workspace path from args; absent for non-file tools and errors. */\n readonly filePath: string | undefined\n /** Whether the row has anything to expand (a card, args body, or output). */\n readonly expandable: boolean\n /** Expanded-body content cards, mutually exclusive, or null when absent. */\n readonly terminal: TerminalCardModel | null\n readonly diff: DiffCardModel | null\n readonly read: ReadCardModel | null\n readonly search: SearchCardModel | null\n readonly web: WebBlockProps | null\n}\n\n/**\n * Flatten a settled result's content blocks to display text.\n * @param node - settled result node.\n * @returns joined text (may be empty).\n */\nexport function resultText(node: ToolResultNode): string {\n const parts: string[] = []\n for (const block of node.content) {\n if (block.type === 'text') parts.push(block.text)\n else parts.push(JSON.stringify(block))\n }\n if (parts.length === 0 && node.error !== undefined) parts.push(`${node.error.name}: ${node.error.code}`)\n return parts.join('\\n')\n}\n\nfunction firstLine(text: string): string {\n const nl = text.indexOf('\\n')\n return nl === -1 ? text : text.slice(0, nl)\n}\n\n/** Strip the workspace root from a workspace-rooted absolute path (display only). */\nexport function relativizeToCwd(text: string, cwd: string | undefined): string {\n if (cwd === undefined || cwd === '') return text\n const root = cwd.replace(/[/\\\\]+$/, '')\n if (text.startsWith(`${root}/`) || text.startsWith(`${root}\\\\`)) return text.slice(root.length + 1)\n return text\n}\n\nfunction parseArgs(argsRaw: string): Record<string, unknown> | undefined {\n try {\n const parsed: unknown = JSON.parse(argsRaw)\n return typeof parsed === 'object' && parsed !== null ? parsed as Record<string, unknown> : undefined\n } catch {\n return undefined\n }\n}\n\nfunction pickString(args: Record<string, unknown>, keys: readonly string[]): string | undefined {\n for (const key of keys) {\n const value = args[key]\n if (typeof value === 'string' && value !== '') return value\n }\n return undefined\n}\n\n/** Summary key preference per row variant (args-derived, mirrors ui-tool). */\nconst SUMMARY_KEYS: Record<ToolVariant, readonly string[]> = {\n bash: ['description', 'command'],\n read: ['path', 'file_path', 'url'],\n search: ['query', 'pattern', 'url'],\n write: ['path', 'file_path'],\n edit: ['path', 'file_path'],\n code: ['description'],\n others: [],\n}\n\nfunction deriveSummary(variant: ToolVariant, argsRaw: string): string {\n const parsed = parseArgs(argsRaw)\n if (parsed === undefined) return firstLine(argsRaw)\n const picked = pickString(parsed, SUMMARY_KEYS[variant])\n if (picked !== undefined) return firstLine(picked)\n for (const value of Object.values(parsed)) {\n if (typeof value === 'string' && value !== '') return firstLine(value)\n }\n return firstLine(argsRaw)\n}\n\n/** Path keys only — never `url` (web_fetch lands on the read variant). */\nconst FILE_PATH_KEYS = ['path', 'file_path'] as const\n\n/** File-tool variants whose summary may be an openable workspace path. */\nconst FILE_PATH_VARIANTS: ReadonlySet<ToolVariant> = new Set(['read', 'write', 'edit'])\n\nfunction deriveFilePath(variant: ToolVariant, argsRaw: string): string | undefined {\n if (!FILE_PATH_VARIANTS.has(variant)) return undefined\n const parsed = parseArgs(argsRaw)\n if (parsed === undefined) return undefined\n return pickString(parsed, FILE_PATH_KEYS)?.split('\\n')[0]\n}\n\nfunction deriveBody(variant: ToolVariant, argsRaw: string): string | null {\n if (argsRaw === '') return null\n const parsed = parseArgs(argsRaw)\n if (parsed === undefined) return argsRaw\n // The code row's expanded body IS the program, not the args JSON envelope.\n if (variant === 'code') {\n const code = parsed.code\n if (typeof code === 'string' && code !== '') return code\n }\n return JSON.stringify(parsed, null, 2)\n}\n\n/** Derive the row model for one call of a grouped tool. */\nexport function callRowModel(\n toolName: string,\n block: ToolCallBlock,\n cwd: string | undefined,\n): CallRowModel {\n const done = 'kind' in block\n const argsRaw = (done ? block.call?.argsRaw : block.argsRaw) ?? ''\n const state: RowState = !done ? 'running'\n : block.error?.code === 'interrupted' ? 'stopped'\n : block.isError ? 'error' : 'ok'\n const variant = classifyTool(toolName)\n const terminal = terminalCardOf(block, cwd)\n const read = readCardOf(block, cwd)\n const diff = diffCardOf(block)\n const search = searchCardOf(block)\n const web = webCardOf(block)\n const base = argsRaw === '' ? block.callId : relativizeToCwd(deriveSummary(variant, argsRaw), cwd)\n const toolTitle = TOOL_TITLES[toolName]\n // Others keeps the static \"Tool call\" title; the real tool name rides the\n // summary slot unless the tool owns a specific title (mirrors ui-tool).\n const argsSummary = variant === 'others' && toolName !== '' && toolTitle === undefined\n ? `${toolName} · ${base}`\n : base\n const filePath = deriveFilePath(variant, argsRaw)\n const output = done ? (resultText(block) || null) : null\n const errorSummary = state === 'error' && output !== null ? firstLine(output) : null\n // A card's own summary outranks the args summary: the terminal presenter's\n // description is the contract's above-card text, and a search result view's\n // replacement title names the query the tool itself chose (mirrors ui-tool).\n const summary = terminal?.description ?? search?.title ?? argsSummary\n // Single-file tools never expose an args body — the path link is the only\n // args interaction (mirrors ui-tool's singleFile rule).\n const body = filePath !== undefined ? null : deriveBody(variant, argsRaw)\n // A failing exit status is the terminal card's own error signal: the call\n // settles isError:false, and the red state dot is its only collapsed signal.\n const finalState = state === 'ok' && terminal !== null && terminalFailed(terminal)\n ? 'error'\n : state\n const expandable = terminal !== null || diff !== null || read !== null\n || search !== null || web !== null || body !== null || output !== null\n return {\n state: finalState,\n variant,\n title: toolTitle ?? VARIANT_TITLES[variant],\n summary,\n body,\n output,\n errorSummary,\n filePath,\n expandable,\n terminal,\n diff,\n read,\n search,\n web,\n }\n}\n\n/** Read-card derivation, or null when this call is not a read card (mirrors ui-tool). */\nfunction readCardOf(block: ToolCallBlock, cwd: string | undefined): ReadCardModel | null {\n if (!('kind' in block)) return null\n const result = block.resultView?.card === 'read' ? block.resultView : null\n if (result === null) return null\n if (!Array.isArray(result.lines)) return null\n const lines = result.lines\n .filter(line => typeof line === 'object' && line !== null\n && typeof (line as { number?: unknown }).number === 'number'\n && typeof (line as { text?: unknown }).text === 'string')\n .map(line => ({ number: (line as { number: number }).number, text: (line as { text: string }).text }))\n return {\n label: result.title ?? relativizeToCwd(result.path, cwd),\n lines,\n totalLines: typeof result.totalLines === 'number' ? result.totalLines : lines.length,\n lang: typeof result.lang === 'string' ? result.lang : undefined,\n }\n}\n\nfunction isValidFiles(files: unknown): files is SearchFileGroup[] {\n return Array.isArray(files) && files.every(file =>\n typeof file === 'object' && file !== null\n && typeof (file as { path?: unknown }).path === 'string'\n && Array.isArray((file as { matches?: unknown }).matches)\n && (file as { matches: unknown[] }).matches.every(match =>\n typeof match === 'object' && match !== null\n && typeof (match as { lineNumber?: unknown }).lineNumber === 'number'\n && typeof (match as { line?: unknown }).line === 'string'))\n}\n\nfunction flattenContent(content: readonly { type: string; text?: string }[]): string | undefined {\n const text = content\n .filter((block): block is { type: 'text'; text: string } => block.type === 'text' && typeof block.text === 'string')\n .map(block => block.text)\n .join('\\n')\n return text === '' ? undefined : text\n}\n\n/** Search-card derivation, or null when this call is not a search card (mirrors ui-tool). */\nfunction searchCardOf(block: ToolCallBlock): SearchCardModel | null {\n if (!('kind' in block)) return null\n const result = block.resultView?.card === 'search' ? block.resultView : null\n if (result === null) return null\n const common = { truncated: result.truncated, total: result.total }\n const recovery = result.truncated ? flattenContent(block.content) : undefined\n if (result.shape === 'matches') {\n if (!isValidFiles(result.files)) return null\n return { title: result.title, recovery, card: { kind: 'matches', files: result.files, ...common } }\n }\n if (result.shape !== 'paths') return null\n if (!Array.isArray(result.paths) || !result.paths.every(path => typeof path === 'string')) return null\n return { title: result.title, recovery, card: { kind: 'paths', paths: result.paths, ...common } }\n}\n\n/** Narrow a wire `card:'diff'` view's `diffs` to well-formed hunks (mirrors ui-tool). */\nfunction narrowDiffs(diffs: unknown): DiffHunk[] | null {\n if (!Array.isArray(diffs) || diffs.length === 0) return null\n const out: DiffHunk[] = []\n for (const hunk of diffs) {\n if (typeof hunk !== 'object' || hunk === null) return null\n const { path, oldText, newText } = hunk as Record<string, unknown>\n if (typeof path !== 'string') return null\n if (oldText !== null && typeof oldText !== 'string') return null\n if (typeof newText !== 'string') return null\n out.push({ path, oldText, newText })\n }\n return out\n}\n\n/** Diff-card derivation, or null when this call is not a diff card (mirrors ui-tool). */\nfunction diffCardOf(block: ToolCallBlock): DiffCardModel | null {\n if (!('kind' in block)) {\n const call = block.callView?.card === 'diff' ? block.callView : null\n const diffs = call === null ? null : narrowDiffs(call.diffs)\n return diffs === null ? null : { card: { diffs } }\n }\n const result = block.resultView?.card === 'diff' ? block.resultView : null\n const diffs = result === null ? null : narrowDiffs(result.diffs)\n return diffs === null ? null : { card: { diffs } }\n}\n\n/**\n * Resolve a terminal view's working directory the way the render-intent\n * contract assigns it: an absolute path is used as-is, a relative one joins\n * under the session workspace, and an omitted one IS the session workspace.\n * @param viewCwd - the cwd the terminal call view carries, if any.\n * @param sessionCwd - the session workspace root, if the caller knows it.\n * @returns the working directory for the prompt label, or undefined.\n */\nfunction resolveTerminalCwd(viewCwd: string | undefined, sessionCwd: string | undefined): string | undefined {\n if (viewCwd === undefined || viewCwd === '') return sessionCwd\n if (sessionCwd === undefined || sessionCwd === '') return viewCwd\n return resolveWorkspacePath(sessionCwd, viewCwd)\n}\n\n/** Terminal-card derivation, or null when this call is not a terminal card (mirrors ui-tool). */\nfunction terminalCardOf(block: ToolCallBlock, sessionCwd: string | undefined): TerminalCardModel | null {\n const call = block.callView?.card === 'terminal' ? block.callView : null\n if (!('kind' in block)) {\n return call === null ? null : {\n description: call.description,\n card: {\n command: call.title,\n cwd: resolveTerminalCwd(call.cwd, sessionCwd),\n output: undefined,\n exitCode: undefined,\n signal: undefined,\n running: true,\n },\n }\n }\n const result = block.resultView?.card === 'terminal' ? block.resultView : null\n if (result === null) return null\n return {\n description: call?.description,\n card: {\n command: result.title ?? call?.title ?? '',\n cwd: call === null ? undefined : resolveTerminalCwd(call.cwd, sessionCwd),\n output: result.output,\n exitCode: result.exitCode,\n signal: result.signal,\n running: false,\n },\n }\n}\n\n/** Web-card derivation, or null when this call is not a web card (mirrors ui-tool). */\nfunction webCardOf(block: ToolCallBlock): WebBlockProps | null {\n if (!('kind' in block)) return null\n const result = block.resultView\n if (result?.card !== 'web') return null\n if (result.kind === 'search') {\n return {\n kind: 'search',\n answer: result.answer,\n sources: result.sources.map(source => ({\n url: source.url,\n title: source.title,\n snippet: source.snippet,\n publishedAt: source.publishedAt,\n })),\n truncated: result.truncated,\n }\n }\n if (result.kind === 'fetch') {\n return {\n kind: 'fetch',\n url: result.url,\n statusCode: result.statusCode,\n truncated: result.truncated,\n }\n }\n return null\n}\n","/**\n * Pure detection of a consecutive run of grouped tool calls in the chat flow,\n * and the per-seat merged-group partition over it.\n *\n * A pure function of the chat snapshot (order + node store), so the merged\n * display is deterministic under replay: the web layer recomputes it per frame.\n * @module\n */\nimport type { ChatConversationViewNode, ChatNodeStore, ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client'\nimport { conversationContextKey } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { MergeGroupMode } from '../types.ts'\nimport { classifyTool } from './tool-names.ts'\n\n/** Tool-call node kind registered by ui-conversation's built-in tool definition. */\nconst TOOL_CALL_KIND = 'tool-call'\n\n/** Extract a root call block from any chat node, when it is a tool-call node. */\nfunction toolRootOf(node: ChatConversationViewNode): ToolCallBlock | null {\n if (node.kind !== TOOL_CALL_KIND) return null\n const root = (node.data as { root?: unknown }).root\n return typeof root === 'object' && root !== null ? root as ToolCallBlock : null\n}\n\n/** The wire tool name of a call in either lifecycle form (mirrors ui-tool). */\nexport function callNameOf(block: ToolCallBlock): string {\n return 'kind' in block ? (block.call?.name ?? '') : block.name\n}\n\n/** Whether the call's wire name is one of the grouped tools (empty = all). */\nexport function isGroupedTool(name: string, tools: readonly string[]): boolean {\n return tools.length === 0 || tools.includes(name)\n}\n\n/** Step identity of a node's location; undefined when the node is not step-bound. */\nfunction stepIdOf(node: ChatConversationViewNode): string | undefined {\n const location = node.location\n return location.kind === 'step' ? `${location.turn.turn}:${location.step.step}` : undefined\n}\n\n/** One merged group: the group's first call plus its consecutive continuations. */\nexport interface ReadRun {\n /** Whether this seat is the group's rendering head (the only seat that shows the card). */\n readonly isFirst: boolean\n /** The group's root blocks in flow order (first + continuations). */\n readonly blocks: readonly ToolCallBlock[]\n}\n\n/**\n * Compute the merged group this call belongs to.\n *\n * 1. Locates this call's node in the chat order; null when it is not a chat\n * tool-call node (e.g. a read dispatched as a subcall).\n * 2. Walks backward/forward to the maximal consecutive run containing it. A\n * call continues the run when it is a grouped tool AND same-tool-same-run:\n * the identical wire name, or a sibling of the same known variant family\n * (grep+glob, bash+pwsh, read+web_fetch…). Unknown names (variant\n * `others`) only merge with themselves, so unrelated tools never share a\n * card (`adjacent`: any consecutive run; `step`: same agent step as this\n * call).\n * 3. Partitions the run into `maxGroupSize`-sized groups; this call is the\n * group's first only when it heads one of those partitions. Truncation\n * therefore never orphans a call: the excess starts its own group.\n *\n * @param order - chat node key order.\n * @param nodes - chat node store.\n * @param myCallId - the call id of the seat asking about itself.\n * @param tools - grouped wire tool names; empty means every tool.\n * @param groupBy - grouping mode.\n * @param maxGroupSize - per-group cap.\n * @returns the group partition, or null when the call is not a chat tool-call node.\n */\nexport function readRun(\n order: readonly string[],\n nodes: ChatNodeStore,\n myCallId: string,\n tools: readonly string[],\n groupBy: MergeGroupMode,\n maxGroupSize: number,\n): ReadRun | null {\n const myKey = conversationContextKey(TOOL_CALL_KIND, myCallId)\n const myIndex = order.indexOf(myKey)\n if (myIndex < 0) return null\n const myRoot = rootAtNode(order, nodes, myIndex)\n if (myRoot === null) return null\n const myName = callNameOf(myRoot)\n const myVariant = classifyTool(myName)\n const size = Math.max(1, maxGroupSize)\n\n const rootAt = (index: number): ToolCallBlock | null => rootAtNode(order, nodes, index)\n const myStep = groupBy === 'step' ? stepIdOfNodeAt(order, nodes, myIndex) : undefined\n const inGroup = (index: number): boolean => {\n const root = rootAt(index)\n if (root === null || !isGroupedTool(callNameOf(root), tools)) return false\n const name = callNameOf(root)\n // Same-name calls always continue the run; known families merge siblings\n // (grep+glob, bash+pwsh); unknown names merge only with themselves.\n if (name !== myName) {\n if (myVariant === 'others' || classifyTool(name) !== myVariant) return false\n }\n if (groupBy !== 'step') return true\n return myStep !== undefined && stepIdOfNodeAt(order, nodes, index) === myStep\n }\n\n let start = myIndex\n while (start > 0 && inGroup(start - 1)) start--\n let end = myIndex\n while (end < order.length - 1 && inGroup(end + 1)) end++\n\n const groupStart = start + Math.floor((myIndex - start) / size) * size\n const groupEnd = Math.min(groupStart + size, end + 1)\n\n const blocks: ToolCallBlock[] = []\n for (let index = groupStart; index < groupEnd; index++) {\n const root = rootAt(index)\n if (root !== null) blocks.push(root)\n }\n return { isFirst: myIndex === groupStart, blocks }\n}\n\nfunction rootAtNode(order: readonly string[], nodes: ChatNodeStore, index: number): ToolCallBlock | null {\n const key = order[index]\n const node = key === undefined ? undefined : nodes.get(key)\n return node === undefined ? null : toolRootOf(node)\n}\n\nfunction stepIdOfNodeAt(order: readonly string[], nodes: ChatNodeStore, index: number): string | undefined {\n const key = order[index]\n const node = key === undefined ? undefined : nodes.get(key)\n return node === undefined ? undefined : stepIdOf(node)\n}\n","/**\n * Merged tool-call row — the shadowed `tool.call.toolview` registrant.\n *\n * For the first call of a consecutive run of grouped tools, renders the run as\n * one card (the first call's full row) plus one compact child row per\n * continuation call. For a continuation call, renders nothing: the seat stays\n * empty and the injected stylesheet collapses it out of the flow. When the\n * call is not a chat tool-call node at all (e.g. dispatched as a subcall),\n * falls back to a plain single row so the call never disappears.\n *\n * The row surface mirrors the built-in generic ToolRow: a variant title/icon\n * plus the settled card (read/search/diff/terminal/web) or IN/OUT text.\n *\n * Everything here is a pure function of the chat snapshot + the frozen call\n * slices (replay-deterministic); expand state is component-local view state.\n * @module\n */\nimport { memo, useLayoutEffect, useRef, useState, type CSSProperties, type KeyboardEvent, type MouseEvent, type ReactNode } from 'react'\nimport {\n DiffBlock, DisclosureRow, IconApiOutline14, IconBrowseOutline16, IconCodeOutline16,\n IconEditOutline16, IconSearchOutline16, IconSparkle16, ReadBlock, SearchBlock, StateDot,\n TerminalBlock, WebBlock, type TerminalBlockLabels,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ToolCallViewProps } from '@deepseek-ai/dsh-client-ui-tool/client'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { MergeToolCallsConfig } from '../types.ts'\nimport { callRowModel, type CallRowModel, type RowState, type ToolVariant } from './card-model.ts'\nimport { readRun } from './merge-run.ts'\n\n/** Chat rows show a capped card; the details panel stays the full-height surface. */\nconst CHAT_READ_MAX_LINES = 8\nconst CHAT_SEARCH_MAX_LINES = 8\nconst CHAT_DIFF_MAX_LINES = 8\n\n/** Locale seat and inject face of the merged row registration. */\nexport type MergedToolRowProps = ToolCallViewProps\n & PropsLocale<'merge-tool-calls'>\n & { readonly cfg: MergeToolCallsConfig }\n\n/** Variant leading icons (figma table); all glyphs render at 14 inside the 16px leading box. */\nconst VARIANT_ICONS: Record<ToolVariant, ReactNode> = {\n search: <IconSearchOutline16 size={14} />,\n read: <IconBrowseOutline16 size={14} />,\n bash: <IconApiOutline14 size={14} />,\n write: <IconEditOutline16 size={14} />,\n edit: <IconEditOutline16 size={14} />,\n code: <IconCodeOutline16 size={14} />,\n others: <IconSparkle16 size={14} />,\n}\n\n/** Leading-slot state substitution, mirroring the shipped row. */\nfunction leadingFor(state: RowState, icon: ReactNode): ReactNode {\n switch (state) {\n case 'error': return <StateDot state=\"error\" />\n case 'stopped': return <StateDot state=\"warning\" />\n default: return icon\n }\n}\n\n/** Visually hidden run-state label (the StateDot and sweep are colour-only). */\nfunction stateStatus(state: RowState, t: MergedToolRowProps['t']): string | null {\n switch (state) {\n case 'running': return t('running')\n case 'error': return t('failed')\n case 'stopped': return t('stopped')\n default: return null\n }\n}\n\n/** TerminalBlock display copy from the plugin's own dictionary. */\nfunction terminalLabels(t: MergedToolRowProps['t']): TerminalBlockLabels {\n return {\n signal: signal => t('terminal.signal', { signal }),\n exitCode: code => t('terminal.exitCode', { code }),\n running: t('terminal.running'),\n failed: t('terminal.failed'),\n done: t('terminal.done'),\n copy: t('terminal.copy'),\n copied: t('terminal.copied'),\n noOutput: t('terminal.noOutput'),\n collapseAria: t('terminal.collapseAria'),\n collapse: t('terminal.collapse'),\n expandAria: hidden => t('terminal.expandAria', { n: hidden }),\n expand: hidden => t('terminal.expandRest', { n: hidden }),\n }\n}\n\n/** One call's expanded-body card, mirroring the built-in ToolRow body. */\nfunction CardBody({ model, t }: { model: CallRowModel; t: MergedToolRowProps['t'] }) {\n if (model.terminal !== null) {\n return <TerminalBlock {...model.terminal.card} maxLines={Infinity} labels={terminalLabels(t)} />\n }\n if (model.diff !== null) {\n return <DiffBlock {...model.diff.card} maxLines={CHAT_DIFF_MAX_LINES} />\n }\n if (model.read !== null) {\n return <ReadBlock {...model.read} maxLines={CHAT_READ_MAX_LINES} />\n }\n if (model.search !== null) {\n return (\n <>\n <SearchBlock {...model.search.card} maxLines={CHAT_SEARCH_MAX_LINES} />\n {model.search.recovery !== undefined && (\n <div className=\"mtc-recovery\">{model.search.recovery}</div>\n )}\n </>\n )\n }\n if (model.web !== null) {\n return <WebBlock {...model.web} />\n }\n const hasBody = model.body !== null\n const hasOutput = model.output !== null\n if (!hasBody && !hasOutput) return null\n return (\n <div className=\"mtc-io-card\">\n {hasBody && (\n <div className=\"mtc-io-section\">\n <span className=\"mtc-io-label\">IN</span>\n <span className=\"mtc-io-text\">{model.body}</span>\n </div>\n )}\n {hasBody && hasOutput && <span className=\"mtc-io-divider\" aria-hidden />}\n {hasOutput && (\n <div className=\"mtc-io-section\">\n <span className=\"mtc-io-label\">OUT</span>\n <span className=\"mtc-io-text\" data-error={model.state === 'error' || undefined}>{model.output}</span>\n </div>\n )}\n </div>\n )\n}\n\n/** The run's main card: the first call's full row (chrome + expandable card). */\nexport const RowCard = memo(function RowCard({\n toolName, block, cwd, openFile, inspect, t, mergedCount,\n}: {\n toolName: string\n block: ToolCallBlock\n cwd: string | undefined\n openFile: (path: string) => void\n inspect: (() => void) | undefined\n t: MergedToolRowProps['t']\n /** Continuation-call count rendered as a muted `+n` suffix; 0 hides it. */\n mergedCount: number\n}) {\n const model = callRowModel(toolName, block, cwd)\n const [expanded, setExpanded] = useState(false)\n const open = expanded && model.expandable\n const status = stateStatus(model.state, t)\n const failureLine = model.state === 'error' ? model.errorSummary ?? null : null\n const summaryText = failureLine ?? model.summary\n const suffix = failureLine === null && mergedCount > 0\n ? t('more', { n: String(mergedCount) })\n : null\n const fileLink = model.filePath !== undefined && openFile !== undefined && failureLine === null\n const openFileClick = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (model.filePath !== undefined) openFile(model.filePath)\n }\n return (\n <div className=\"mtc-row\" data-state={model.state} data-variant={model.variant}>\n {status !== null && <span className=\"mtc-visually-hidden\">{status}</span>}\n <DisclosureRow\n rowClassName=\"mtc-title-row\"\n titleClassName=\"mtc-title\"\n leadingClassName=\"mtc-leading\"\n chevronClassName=\"mtc-chevron\"\n icon={leadingFor(model.state, VARIANT_ICONS[model.variant])}\n title={model.title}\n open={open}\n expandable={model.expandable}\n expandOnRowClick\n keepContentWhenOpen\n onToggle={() => { setExpanded(value => !value) }}\n collapsedContent={summaryText !== '' && (\n <>\n <span className=\"mtc-sep\" aria-hidden />\n {fileLink ? (\n <button type=\"button\" className=\"mtc-summary-link\" onClick={openFileClick}>{summaryText}</button>\n ) : (\n <span className=\"mtc-summary\">{summaryText}</span>\n )}\n {suffix !== null && <span className=\"mtc-summary-suffix\">{suffix}</span>}\n </>\n )}\n >\n <div className=\"mtc-card-body\">\n <CardBody model={model} t={t} />\n {inspect !== undefined && (\n <button type=\"button\" className=\"mtc-inspect\" onClick={inspect}>Inspect</button>\n )}\n </div>\n </DisclosureRow>\n </div>\n )\n})\n\n/**\n * One compact continuation row: the main row's tail structure ([sep dot][path]).\n * An expandable call toggles the inline content card on click (mirroring the\n * main row's whole-row disclosure); a read/write/edit-family path additionally\n * renders as an open-file link (the sidebar preview) that stops propagation,\n * exactly like the main row's summary link.\n */\nexport const ChildRow = memo(function ChildRow({\n toolName, block, cwd, openFile, t,\n}: {\n toolName: string\n block: ToolCallBlock\n cwd: string | undefined\n openFile: (path: string) => void\n t: MergedToolRowProps['t']\n}) {\n const model = callRowModel(toolName, block, cwd)\n const [open, setOpen] = useState(false)\n const stateLabel = stateStatus(model.state, t)\n const expandable = model.expandable\n const toggle = (): void => { setOpen(value => !value) }\n const openFileClick = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (model.filePath !== undefined) openFile(model.filePath)\n }\n const onRowKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n toggle()\n }\n }\n return (\n <div className=\"mtc-child\">\n <div\n className=\"mtc-child-row\"\n data-open={expandable && open || undefined}\n data-static={expandable ? undefined : true}\n role={expandable ? 'button' : undefined}\n tabIndex={expandable ? 0 : undefined}\n aria-expanded={expandable ? open : undefined}\n onClick={expandable ? toggle : undefined}\n onKeyDown={expandable ? onRowKeyDown : undefined}\n >\n <span className=\"mtc-sep\" aria-hidden />\n {model.filePath !== undefined ? (\n <button type=\"button\" className=\"mtc-child-path-link\" onClick={openFileClick}>{model.summary}</button>\n ) : (\n <span className=\"mtc-child-path\">{model.summary}</span>\n )}\n {stateLabel !== null && (\n <span className=\"mtc-child-state\" data-error={model.state === 'error' || undefined}>{stateLabel}</span>\n )}\n </div>\n {expandable && open && (\n <div className=\"mtc-child-body\">\n <CardBody model={model} t={t} />\n </div>\n )}\n </div>\n )\n})\n\n/**\n * The shadowed toolview: renders the merged run card for the run's first call,\n * nothing for continuation calls, and a plain single row when this call is not\n * a chat tool-call node.\n *\n * Child-row alignment is measured at runtime, not hardcoded: the main row's\n * separator dot sits after a variable-width title (\"Read\"/\"Search\"/\"Bash\"/…),\n * so its column depends on the rendered font. A layout effect measures the\n * dot's offset from the card root (once, plus on reflow via ResizeObserver)\n * and indents the children so their dots and paths land on the main row's\n * columns — no font/title constants to keep in sync.\n */\nexport function MergedToolRow({ callId, toolName, block, cwd, openFile, inspect, t, cfg, useSession }: MergedToolRowProps) {\n const run = useSession(snapshot => readRun(\n snapshot.chat.order,\n snapshot.chat.nodes,\n callId,\n cfg.tools,\n cfg.groupBy,\n cfg.maxGroupSize,\n ))\n const rootRef = useRef<HTMLDivElement>(null)\n /** Main separator dot's left offset from the card root; null before first measure. */\n const [sepLeft, setSepLeft] = useState<number | null>(null)\n\n useLayoutEffect(() => {\n const root = rootRef.current\n if (root === null) return\n const sep = root.querySelector<HTMLElement>('.mtc-row .mtc-sep')\n if (sep === null) return\n const measure = (): void => {\n setSepLeft(Math.round(sep.getBoundingClientRect().left - root.getBoundingClientRect().left))\n }\n measure()\n // Font swaps, locale switches, and column resizes move the dot; keep the\n // alignment current without re-running the effect.\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(measure)\n observer?.observe(root)\n return () => { observer?.disconnect() }\n }, [run === null ? null : run.blocks[0]?.callId ?? null])\n\n if (run === null) {\n // Not a chat tool-call node (subcall dispatch): never blank the call.\n return (\n <RowCard\n toolName={toolName}\n block={block}\n cwd={cwd}\n openFile={openFile}\n inspect={inspect}\n t={t}\n mergedCount={0}\n />\n )\n }\n if (!run.isFirst) return null\n const hasChildren = run.blocks.length > 1\n return (\n <div className=\"mtc-root\" data-tool={toolName} ref={rootRef}>\n <RowCard\n toolName={toolName}\n block={run.blocks[0] ?? block}\n cwd={cwd}\n openFile={openFile}\n inspect={inspect}\n t={t}\n mergedCount={run.blocks.length - 1}\n />\n {hasChildren && (\n // The custom property overrides the CSS fallback with the measured dot\n // column: the 2px dot + 8px sep right margin land the path exactly on\n // the main summary column. It is a property rather than an inline\n // margin so the expanded child card can cancel the indent and span the\n // card width (see `.mtc-child-body` in styles.ts).\n <div\n className=\"mtc-children\"\n style={sepLeft === null ? undefined : { ['--mtc-sep-left']: `${sepLeft}px` } as CSSProperties}\n >\n {run.blocks.slice(1).map(child => (\n <ChildRow key={child.callId} toolName={toolName} block={child} cwd={cwd} openFile={openFile} t={t} />\n ))}\n </div>\n )}\n </div>\n )\n}\n","/**\n * One scoped stylesheet injected for the lifetime of the client activation.\n *\n * Two jobs:\n * 1. The empty-seat collapse rule: the shadowed toolview renders `null` for\n * every non-first call of a merged run. The built-in `ToolCallTree` still\n * wraps that null in its `.callRow` div, and the renderer wraps every\n * toolview in an empty `<div data-slot=\"tool.call.toolview\">` (display:\n * contents), so the seat's `.flowItem` is never `:empty` itself and the\n * built-in `.flowItem:empty { display:none }` rule does not fire. This\n * rule extends the same intent (\"a renderer may decline its row\") to a\n * tool seat whose toolview rendered nothing.\n * 2. The plugin's own `.mtc-*` chrome for the merged card and its child rows.\n *\n * All colors come from the shared `--dsw-*` tokens (never literals).\n */\nexport const CSS = `\n/* A tool-call seat whose toolview declined to render (merged-run continuation\n calls) must not consume the flow column's gap. The empty toolview slot\n wrapper is the decline signal; the callRow around it always exists. */\n[data-chat-flow-kind=\"tool-call\"]:has([data-slot=\"tool.call.toolview\"]:empty) { display: none; }\n\n.mtc-root { display: flex; flex-direction: column; min-width: 0; }\n.mtc-row { display: flex; flex-direction: column; min-width: 0; }\n.mtc-row[data-state='running'] .mtc-title-row { position: relative; overflow: hidden; }\n.mtc-row[data-state='running'] .mtc-title-row::after {\n content: '';\n position: absolute;\n top: 0; bottom: 0; left: 0;\n width: 300px;\n background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--dsw-alias-bg-base) 60%, transparent) 55%, transparent 100%);\n animation: dsh-mtc-sweep 2.6s ease-out infinite;\n pointer-events: none;\n}\n@keyframes dsh-mtc-sweep {\n 0% { left: -300px; }\n 90%, 100% { left: 100%; }\n}\n\n.mtc-title { font-weight: 400; }\n.mtc-sep { flex: none; width: 2px; height: 2px; border-radius: 1px; margin: 0 8px; background: var(--dsw-alias-label-caption); }\n.mtc-summary {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-tertiary);\n}\n.mtc-summary-link {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n margin: 0; padding: 0; border: none; background: none; font: inherit; text-align: left;\n font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-secondary);\n text-decoration: underline; text-decoration-color: var(--dsw-alias-label-quaternary);\n text-underline-offset: 3px; cursor: pointer;\n}\n.mtc-summary-link:hover { color: var(--dsw-alias-label-primary); text-decoration-color: currentColor; }\n.mtc-summary-error { color: var(--dsw-alias-state-error-primary); }\n.mtc-summary-suffix { flex: none; margin-left: 4px; white-space: nowrap; font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-tertiary); }\n\n.mtc-card-body { margin: 4px 0 4px 4px; min-width: 0; }\n.mtc-recovery { margin: 4px 0 4px 4px; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--dsw-font-xs-13); color: var(--dsw-alias-label-tertiary); }\n/* IN/OUT text card for calls without a card primitive (mirrors ToolRow). */\n.mtc-io-card {\n display: flex; flex-direction: column; min-width: 0;\n border: 1px solid var(--dsw-alias-border-l2); border-radius: 12px;\n background: var(--dsw-alias-bg-base);\n}\n.mtc-io-section { display: flex; gap: 10px; padding: 8px 12px; min-width: 0; }\n.mtc-io-label {\n flex: none; font-size: 11px; line-height: 16px; font-weight: 600;\n color: var(--dsw-alias-label-tertiary);\n}\n.mtc-io-text {\n flex: 1 1 auto; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere;\n font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary);\n}\n.mtc-io-text[data-error] { color: var(--dsw-alias-state-error-primary); }\n.mtc-io-divider { height: 1px; background: var(--dsw-alias-border-l2); }\n.mtc-inspect {\n display: inline-flex; align-self: flex-start; align-items: center; gap: 4px;\n margin: 4px 0 2px 4px; padding: 2px 8px;\n border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px;\n background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-secondary);\n font-size: 11px; line-height: 16px; cursor: pointer;\n opacity: 0; transition: opacity 100ms ease;\n}\n.mtc-root:hover .mtc-inspect, .mtc-inspect:focus-visible { opacity: 1; }\n.mtc-inspect:hover { background: var(--dsw-alias-interactive-bg-hover-solid); color: var(--dsw-alias-label-primary); }\n\n/* Compact child rows: each is the main row's tail structure — [sep dot][path].\n The dot/path columns are set at runtime by the component (it measures the\n main row's sep offset and sets the --mtc-sep-left custom property on the\n children block), so this is only the pre-measure fallback. */\n.mtc-children { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 2px var(--mtc-sep-left, 61px); }\n.mtc-child { display: flex; flex-direction: column; min-width: 0; }\n.mtc-child-row {\n display: flex; align-items: center; gap: 0; min-width: 0; height: 20px;\n margin: 0; padding: 0; border: 0; border-radius: 4px; background: none;\n font: inherit; text-align: left; color: var(--dsw-alias-label-secondary); cursor: pointer;\n}\n.mtc-child-row:hover { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }\n.mtc-child-row[data-static] { cursor: default; }\n.mtc-child-row[data-static]:hover { background: none; color: var(--dsw-alias-label-secondary); }\n.mtc-child-row .mtc-sep { margin: 0 8px 0 0; }\n.mtc-child-path {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n font-size: 14px; line-height: 20px;\n}\n/* Read-family child paths are open-file links (sidebar preview), same affordance\n as the main row's summary link. */\n.mtc-child-path-link {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n margin: 0; padding: 0; border: none; background: none; font: inherit; text-align: left;\n font-size: 14px; line-height: 20px; color: var(--dsw-alias-label-secondary);\n text-decoration: underline; text-decoration-color: var(--dsw-alias-label-quaternary);\n text-underline-offset: 3px; cursor: pointer;\n}\n.mtc-child-path-link:hover { color: var(--dsw-alias-label-primary); text-decoration-color: currentColor; }\n.mtc-child-state { flex: none; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }\n.mtc-child-state[data-error] { color: var(--dsw-alias-state-error-primary); }\n/* The expanded child card must not inherit the children block's sep indent:\n pull its left edge back to the main card body's column (root + 4px) so the\n card spans the card width instead of leaving a blank gutter on its left. */\n.mtc-child-body { margin: 2px 0 2px calc(4px - var(--mtc-sep-left, 61px)); min-width: 0; }\n\n.mtc-visually-hidden {\n position: absolute; width: 1px; height: 1px; overflow: hidden;\n clip: rect(0 0 0 0); white-space: nowrap;\n}\n`\n\n/** Install the stylesheet and return its disposer. */\nexport function installStyles(): () => void {\n const style = document.createElement('style')\n style.setAttribute('data-merge-tool-calls-style', '')\n style.textContent = CSS\n document.head.appendChild(style)\n return () => { style.remove() }\n}\n","/**\n * merge-tool-calls — browser half.\n *\n * Shadows the shipped `tool.call.toolview` entries for every grouped tool at\n * priority -1 (the keyed slot's shadowing rule: lowest priority renders). An\n * empty `tools` config means every built-in generic-family tool\n * (see {@link ALL_TOOL_NAMES}); a non-empty list is an explicit whitelist.\n * The shadowed component merges consecutive calls of one tool in the chat flow\n * into a single card with compact child rows.\n *\n * @module @dsh-external/dsh-merge-tool-calls/client\n */\n\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-tool/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\nimport { DEFAULT_MERGE_CONFIG, type MergeToolCallsConfig } from '../types.ts'\nimport { en, NS, zh, type MergeToolCallsKey } from './locales.ts'\nimport { MergedToolRow } from './rows.tsx'\nimport { installStyles } from './styles.ts'\nimport { ALL_TOOL_NAMES } from './tool-names.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Copy for the merged tool-call rows. */\n 'merge-tool-calls': MergeToolCallsKey\n }\n}\n\n/** Required services: the slot registry (toolview shadowing) and locale. */\nexport const inject = ['slots', 'locale']\n\n/**\n * Register one shadowed toolview per grouped tool.\n * @param ctx - client root context.\n * @param config - row config; defaults apply when the loader passes none.\n */\nexport function apply(ctx: ClientContext, config: Partial<MergeToolCallsConfig> = {}): void {\n const cfg: MergeToolCallsConfig = { ...DEFAULT_MERGE_CONFIG, ...config }\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'merge-tool-calls: dictionaries')\n ctx.effect(installStyles, 'merge-tool-calls: styles')\n\n const toolNames = cfg.tools.length === 0 ? ALL_TOOL_NAMES : [...new Set(cfg.tools)]\n for (const tool of toolNames) {\n ctx.slots.inject('tool.call.toolview', () => ctx.slots.register({\n name: 'tool.call.toolview',\n key: tool,\n priority: -1,\n locale: NS,\n inject: () => ({ cfg }),\n }, MergedToolRow))\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAaA,uBAA6C;CACxD,OAAO,EAAE;CACT,SAAS;CACT,cAAc;CACf;;;;;ACxBD,MAAa,KAAK;CAChB,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,UAAU;CACV,aAAa;CACb,mBAAmB;CACnB,qBAAqB;CACrB,oBAAoB;CACpB,mBAAmB;CACnB,iBAAiB;CACjB,iBAAiB;CACjB,mBAAmB;CACnB,qBAAqB;CACrB,yBAAyB;CACzB,qBAAqB;CACrB,uBAAuB;CACvB,uBAAuB;CACxB;AAID,MAAa,KAAK;CAChB,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,UAAU;CACV,aAAa;CACb,mBAAmB;CACnB,qBAAqB;CACrB,oBAAoB;CACpB,mBAAmB;CACnB,iBAAiB;CACjB,iBAAiB;CACjB,mBAAmB;CACnB,qBAAqB;CACrB,yBAAyB;CACzB,qBAAqB;CAC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pB,UAAS,KAAK,YAAY,MAAM;AAChC,cAAa;AAAE,QAAM,QAAQ;;;;;;;ACvG/B,MAAa,SAAS,CAAC,SAAS,SAAS;;;;;;AAOzC,SAAgB,MAAM,KAAoB,SAAwC,EAAE,EAAQ;CAC1F,MAAMC,MAA4B;EAAE,GAAG;EAAsB,GAAG;EAAQ;AACxE,KAAI,aAAa,IAAI,OAAO,SAAS,IAAI;EAAE;EAAI;EAAI,CAAC,EAAE,iCAAiC;AACvF,KAAI,OAAO,eAAe,2BAA2B;CAErD,MAAM,YAAY,IAAI,MAAM,WAAW,IAAI,iBAAiB,CAAC,GAAG,IAAI,IAAI,IAAI,MAAM,CAAC;AACnF,MAAK,MAAM,QAAQ,UACjB,KAAI,MAAM,OAAO,4BAA4B,IAAI,MAAM,SAAS;EAC9D,MAAM;EACN,KAAK;EACL,UAAU;EACV,QAAQ;EACR,eAAe,EAAE,KAAK;EACvB,EAAE,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["DEFAULT_MERGE_CONFIG: MergeToolCallsConfig","ALL_TOOL_NAMES: readonly string[]","VARIANT_TITLES: Record<ToolVariant, string>","TOOL_VARIANTS: Record<string, ToolVariant>","TOOL_TITLES: Record<string, string>","parts: string[]","parsed: unknown","SUMMARY_KEYS: Record<ToolVariant, readonly string[]>","FILE_PATH_VARIANTS: ReadonlySet<ToolVariant>","state: RowState","out: DiffHunk[]","diffs","blocks: ToolCallBlock[]","VARIANT_ICONS: Record<ToolVariant, ReactNode>","IconSearchOutline16","IconBrowseOutline16","IconApiOutline14","IconEditOutline16","IconCodeOutline16","IconSparkle16","VARIANT_COUNT_KEY: Record<ToolVariant, 'countFiles' | 'countQueries' | 'countCommands' | 'countPrograms' | 'countCalls'>","StateDot","TerminalBlock","DiffBlock","ReadBlock","SearchBlock","WebBlock","RowCard","DisclosureRow","ChildRow","cfg: MergeToolCallsConfig"],"sources":["../src/types.ts","../src/client/locales.ts","../src/client/tool-names.ts","../src/client/card-model.ts","../src/client/merge-run.ts","../src/client/rows.tsx","../src/client/styles.ts","../src/client/index.ts"],"sourcesContent":["/** Shared config surface of the merge-tool-calls plugin (host + client halves). */\n\n/** How consecutive same-tool calls are grouped into one merged card. */\nexport type MergeGroupMode = 'adjacent' | 'step'\n\n/** Plugin configuration; defaults live in the Schemastery schema and cordis.patch.yml. */\nexport interface MergeToolCallsConfig {\n /**\n * Wire tool names whose consecutive calls merge. Empty = every built-in\n * generic-family tool (read/grep/glob/edit/write/bash/pwsh/web_search/\n * web_fetch/run_code/cordis_package_inspect/cordis_runtime_inspect); a\n * non-empty list is an explicit whitelist (any wire name works).\n */\n readonly tools: readonly string[]\n /** `adjacent`: any consecutive run in the chat flow; `step`: only within one agent step. */\n readonly groupBy: MergeGroupMode\n /** Max calls per merged group; the run is truncated and the excess starts a new group. */\n readonly maxGroupSize: number\n}\n\n/** Runtime defaults applied when a half receives no config (defensive only). */\nexport const DEFAULT_MERGE_CONFIG: MergeToolCallsConfig = {\n tools: [],\n groupBy: 'adjacent',\n maxGroupSize: 8,\n}\n","/** Product copy for the merged tool-call rows. */\nexport const zh = {\n running: '进行中',\n failed: '失败',\n stopped: '已中断',\n expand: '展开',\n collapse: '折叠',\n more: '+{n}',\n showLess: '收起其余',\n mergedCount: '已合并 {n} 次调用',\n countFiles: '{n} 个文件',\n countQueries: '{n} 次搜索',\n countCommands: '{n} 条命令',\n countPrograms: '{n} 段代码',\n countCalls: '{n} 次调用',\n 'terminal.signal': '信号 {signal}',\n 'terminal.exitCode': '退出码 {code}',\n 'terminal.running': '运行中',\n 'terminal.failed': '失败',\n 'terminal.done': '已完成',\n 'terminal.copy': '复制',\n 'terminal.copied': '已复制',\n 'terminal.noOutput': '无输出',\n 'terminal.collapseAria': '收起输出',\n 'terminal.collapse': '折叠',\n 'terminal.expandAria': '展开其余 {n} 行输出',\n 'terminal.expandRest': '… 其余 {n} 行',\n} satisfies Record<string, string>\n\nexport type MergeToolCallsKey = keyof typeof zh\n\nexport const en = {\n running: 'Running',\n failed: 'Failed',\n stopped: 'Interrupted',\n expand: 'Expand',\n collapse: 'Collapse',\n more: '+{n}',\n showLess: 'Show fewer',\n mergedCount: '{n} calls merged',\n countFiles: '{n} Files',\n countQueries: '{n} Queries',\n countCommands: '{n} Commands',\n countPrograms: '{n} Programs',\n countCalls: '{n} Calls',\n 'terminal.signal': 'signal {signal}',\n 'terminal.exitCode': 'exit code {code}',\n 'terminal.running': 'Running',\n 'terminal.failed': 'Failed',\n 'terminal.done': 'Done',\n 'terminal.copy': 'Copy',\n 'terminal.copied': 'Copied',\n 'terminal.noOutput': 'No output',\n 'terminal.collapseAria': 'Collapse output',\n 'terminal.collapse': 'Collapse',\n 'terminal.expandAria': 'Expand the remaining {n} output lines',\n 'terminal.expandRest': '… {n} more lines',\n} satisfies Record<MergeToolCallsKey, string>\n\nexport const NS = 'merge-tool-calls'\n","/**\n * The built-in tool universe this plugin shadows by default, plus the\n * variant-classification vocabulary mirroring ui-tool's tool-call model.\n *\n * The keyed `tool.call.toolview` slot dispatches on the exact wire tool name,\n * so a shadowed registration is needed per name (there is no wildcard). This\n * list names every shipped tool whose row belongs to the generic ToolRow\n * family — a variant title/icon plus read/search/diff/terminal/web card or\n * IN/OUT text — which the merged row reproduces faithfully.\n *\n * Deliberately excluded: tools with custom row cards this plugin does not\n * replicate (`skill`, `cordis_define`, and the live `cordis_run` /\n * `cordis_stop` / `cordis_undefine` rows), and `todo_write` /\n * `ask_user_question` whose summary formatting is tool-specific. They keep\n * their built-in rows unless the user names them in the `tools` config\n * explicitly.\n * @module\n */\n\n/** Wire tool names merged by default (empty `tools` config = this list). */\nexport const ALL_TOOL_NAMES: readonly string[] = [\n // File tools (read/search/diff cards).\n 'read', 'grep', 'glob', 'edit', 'write',\n // Shell tools (terminal card).\n 'bash', 'pwsh',\n // Web tools (web card).\n 'web_search', 'web_fetch',\n // Code tool (generic IN/OUT with the program body).\n 'run_code',\n // Cordis inspection verbs (generic read-variant rows).\n 'cordis_package_inspect', 'cordis_runtime_inspect',\n]\n\n/** Tool-row visual variant, mirroring ui-tool's ToolRowVariant. */\nexport type ToolVariant = 'search' | 'read' | 'bash' | 'write' | 'edit' | 'code' | 'others'\n\n/** Figma row titles per variant (design literals, not translatable copy). */\nexport const VARIANT_TITLES: Record<ToolVariant, string> = {\n search: 'Search', read: 'Read', bash: 'Bash',\n write: 'Write', edit: 'Edit', code: 'Code', others: 'Tool call',\n}\n\n/**\n * Known tool name -> row variant (mirrors ui-tool's classification table,\n * minus the run-control verbs: their rows are custom and not shadowed).\n */\nconst TOOL_VARIANTS: Record<string, ToolVariant> = {\n bash: 'bash',\n pwsh: 'bash',\n read: 'read',\n web_fetch: 'read',\n web_search: 'search',\n grep: 'search',\n glob: 'search',\n write: 'write',\n edit: 'edit',\n run_code: 'code',\n cordis_package_inspect: 'read',\n cordis_runtime_inspect: 'read',\n}\n\n/** Tool-owned titles refining a generic row variant (mirrors ui-tool). */\nexport const TOOL_TITLES: Record<string, string> = {\n cordis_package_inspect: 'Inspect',\n cordis_runtime_inspect: 'Inspect',\n pwsh: 'Pwsh',\n}\n\n/** Classify a tool name into its row variant (mirrors ui-tool). */\nexport function classifyTool(toolName: string): ToolVariant {\n return TOOL_VARIANTS[toolName] ?? 'others'\n}\n\n/** The variant title a row shows, honoring tool-owned refinements. */\nexport function variantTitle(toolName: string): string {\n return TOOL_TITLES[toolName] ?? VARIANT_TITLES[classifyTool(toolName)]\n}\n","/**\n * Pure card/row derivation from a frozen call slice, mirroring ui-tool's\n * tool-call/read-card/search-card/diff-card/terminal-card/web-card models at\n * the plugin boundary (those models are ui-tool internals and cannot be\n * imported cross-package). Same wire contract, same defensive treatment of\n * untrusted result views. A merged row renders the same surface the built-in\n * row would: a variant title/icon plus a card primitive or IN/OUT text.\n * @module\n */\nimport {\n resolveWorkspacePath,\n type ToolCallBlock, type ToolResultNode,\n} from '@deepseek-ai/dsh-client-runtime/client'\nimport type {\n DiffBlockProps, DiffHunk, ReadBlockProps, SearchBlockProps, SearchFileGroup,\n TerminalBlockProps, WebBlockProps,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport { classifyTool, VARIANT_TITLES, TOOL_TITLES, type ToolVariant } from './tool-names.ts'\n\n/** Row state semantic, mirroring ui-tool's ToolRowState. */\nexport type RowState = 'running' | 'ok' | 'error' | 'stopped'\n\nexport type { ToolVariant } from './tool-names.ts'\n\n/** Read-card props the ReadBlock primitive draws (per-render maxLines owned by the caller). */\nexport type ReadCardModel = Pick<ReadBlockProps, 'label' | 'lines' | 'totalLines' | 'lang'>\n\n/**\n * Distributive `Omit`: a plain `Omit<A | B, K>` keeps only the keys common to\n * both members, dropping the discriminated `files`/`paths` fields. Distributing\n * over the naked type parameter preserves each shape.\n */\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never\n\n/** Search-card props plus the capped-result recovery locator (mirrors ui-tool). */\nexport interface SearchCardModel {\n readonly card: DistributiveOmit<SearchBlockProps, 'maxLines' | 'className'>\n /** The result view's replacement title, which outranks the args summary. */\n readonly title: string | undefined\n readonly recovery: string | undefined\n}\n\n/** Diff-card props (mirrors ui-tool; maxLines/className belong to the render site). */\nexport interface DiffCardModel {\n readonly card: Pick<DiffBlockProps, 'diffs'>\n}\n\n/** Terminal-card props (mirrors ui-tool; maxLines/className/labels belong to the render site). */\nexport interface TerminalCardModel {\n readonly card: Pick<TerminalBlockProps, 'command' | 'cwd' | 'output' | 'exitCode' | 'signal' | 'running'>\n /** The call view's model-authored description shown above the card. */\n readonly description: string | undefined\n}\n\n/** True when a settled terminal card reports a failing exit (mirrors ui-tool). */\nexport function terminalFailed(model: TerminalCardModel): boolean {\n const { exitCode, signal, running } = model.card\n return running !== true && ((exitCode !== undefined && exitCode !== 0) || signal !== undefined)\n}\n\n/** Everything a merged row needs, derived once from the frozen slice. */\nexport interface CallRowModel {\n readonly state: RowState\n readonly variant: ToolVariant\n /** Row title: variant title, or the tool-owned title when it refines one. */\n readonly title: string\n /** Args/result-derived one-line summary (path for file tools, query for searches, …). */\n readonly summary: string\n /** Expanded-body input text (pretty args); null = no input section. */\n readonly body: string | null\n /** Flattened result text; null while running or when the result carries no text. */\n readonly output: string | null\n /** First result line on an error row (the collapsed summary's error text). */\n readonly errorSummary: string | null\n /** Openable workspace path from args; absent for non-file tools and errors. */\n readonly filePath: string | undefined\n /** Whether the row has anything to expand (a card, args body, or output). */\n readonly expandable: boolean\n /** Expanded-body content cards, mutually exclusive, or null when absent. */\n readonly terminal: TerminalCardModel | null\n readonly diff: DiffCardModel | null\n readonly read: ReadCardModel | null\n readonly search: SearchCardModel | null\n readonly web: WebBlockProps | null\n}\n\n/**\n * Flatten a settled result's content blocks to display text.\n * @param node - settled result node.\n * @returns joined text (may be empty).\n */\nexport function resultText(node: ToolResultNode): string {\n const parts: string[] = []\n for (const block of node.content) {\n if (block.type === 'text') parts.push(block.text)\n else parts.push(JSON.stringify(block))\n }\n if (parts.length === 0 && node.error !== undefined) parts.push(`${node.error.name}: ${node.error.code}`)\n return parts.join('\\n')\n}\n\nfunction firstLine(text: string): string {\n const nl = text.indexOf('\\n')\n return nl === -1 ? text : text.slice(0, nl)\n}\n\n/** Strip the workspace root from a workspace-rooted absolute path (display only). */\nexport function relativizeToCwd(text: string, cwd: string | undefined): string {\n if (cwd === undefined || cwd === '') return text\n const root = cwd.replace(/[/\\\\]+$/, '')\n if (text.startsWith(`${root}/`) || text.startsWith(`${root}\\\\`)) return text.slice(root.length + 1)\n return text\n}\n\nfunction parseArgs(argsRaw: string): Record<string, unknown> | undefined {\n try {\n const parsed: unknown = JSON.parse(argsRaw)\n return typeof parsed === 'object' && parsed !== null ? parsed as Record<string, unknown> : undefined\n } catch {\n return undefined\n }\n}\n\nfunction pickString(args: Record<string, unknown>, keys: readonly string[]): string | undefined {\n for (const key of keys) {\n const value = args[key]\n if (typeof value === 'string' && value !== '') return value\n }\n return undefined\n}\n\n/** Summary key preference per row variant (args-derived, mirrors ui-tool). */\nconst SUMMARY_KEYS: Record<ToolVariant, readonly string[]> = {\n bash: ['description', 'command'],\n read: ['path', 'file_path', 'url'],\n search: ['query', 'pattern', 'url'],\n write: ['path', 'file_path'],\n edit: ['path', 'file_path'],\n code: ['description'],\n others: [],\n}\n\nfunction deriveSummary(variant: ToolVariant, argsRaw: string): string {\n const parsed = parseArgs(argsRaw)\n if (parsed === undefined) return firstLine(argsRaw)\n const picked = pickString(parsed, SUMMARY_KEYS[variant])\n if (picked !== undefined) return firstLine(picked)\n for (const value of Object.values(parsed)) {\n if (typeof value === 'string' && value !== '') return firstLine(value)\n }\n return firstLine(argsRaw)\n}\n\n/** Path keys only — never `url` (web_fetch lands on the read variant). */\nconst FILE_PATH_KEYS = ['path', 'file_path'] as const\n\n/** File-tool variants whose summary may be an openable workspace path. */\nconst FILE_PATH_VARIANTS: ReadonlySet<ToolVariant> = new Set(['read', 'write', 'edit'])\n\nfunction deriveFilePath(variant: ToolVariant, argsRaw: string): string | undefined {\n if (!FILE_PATH_VARIANTS.has(variant)) return undefined\n const parsed = parseArgs(argsRaw)\n if (parsed === undefined) return undefined\n return pickString(parsed, FILE_PATH_KEYS)?.split('\\n')[0]\n}\n\nfunction deriveBody(variant: ToolVariant, argsRaw: string): string | null {\n if (argsRaw === '') return null\n const parsed = parseArgs(argsRaw)\n if (parsed === undefined) return argsRaw\n // The code row's expanded body IS the program, not the args JSON envelope.\n if (variant === 'code') {\n const code = parsed.code\n if (typeof code === 'string' && code !== '') return code\n }\n return JSON.stringify(parsed, null, 2)\n}\n\n/** Derive the row model for one call of a grouped tool. */\nexport function callRowModel(\n toolName: string,\n block: ToolCallBlock,\n cwd: string | undefined,\n): CallRowModel {\n const done = 'kind' in block\n const argsRaw = (done ? block.call?.argsRaw : block.argsRaw) ?? ''\n const state: RowState = !done ? 'running'\n : block.error?.code === 'interrupted' ? 'stopped'\n : block.isError ? 'error' : 'ok'\n const variant = classifyTool(toolName)\n const terminal = terminalCardOf(block, cwd)\n const read = readCardOf(block, cwd)\n const diff = diffCardOf(block)\n const search = searchCardOf(block)\n const web = webCardOf(block)\n const base = argsRaw === '' ? block.callId : relativizeToCwd(deriveSummary(variant, argsRaw), cwd)\n const toolTitle = TOOL_TITLES[toolName]\n // Others keeps the static \"Tool call\" title; the real tool name rides the\n // summary slot unless the tool owns a specific title (mirrors ui-tool).\n const argsSummary = variant === 'others' && toolName !== '' && toolTitle === undefined\n ? `${toolName} · ${base}`\n : base\n const filePath = deriveFilePath(variant, argsRaw)\n const output = done ? (resultText(block) || null) : null\n const errorSummary = state === 'error' && output !== null ? firstLine(output) : null\n // A card's own summary outranks the args summary: the terminal presenter's\n // description is the contract's above-card text, and a search result view's\n // replacement title names the query the tool itself chose (mirrors ui-tool).\n const summary = terminal?.description ?? search?.title ?? argsSummary\n // Single-file tools never expose an args body — the path link is the only\n // args interaction (mirrors ui-tool's singleFile rule).\n const body = filePath !== undefined ? null : deriveBody(variant, argsRaw)\n // A failing exit status is the terminal card's own error signal: the call\n // settles isError:false, and the red state dot is its only collapsed signal.\n const finalState = state === 'ok' && terminal !== null && terminalFailed(terminal)\n ? 'error'\n : state\n const expandable = terminal !== null || diff !== null || read !== null\n || search !== null || web !== null || body !== null || output !== null\n return {\n state: finalState,\n variant,\n title: toolTitle ?? VARIANT_TITLES[variant],\n summary,\n body,\n output,\n errorSummary,\n filePath,\n expandable,\n terminal,\n diff,\n read,\n search,\n web,\n }\n}\n\n/** Read-card derivation, or null when this call is not a read card (mirrors ui-tool). */\nfunction readCardOf(block: ToolCallBlock, cwd: string | undefined): ReadCardModel | null {\n if (!('kind' in block)) return null\n const result = block.resultView?.card === 'read' ? block.resultView : null\n if (result === null) return null\n if (!Array.isArray(result.lines)) return null\n const lines = result.lines\n .filter(line => typeof line === 'object' && line !== null\n && typeof (line as { number?: unknown }).number === 'number'\n && typeof (line as { text?: unknown }).text === 'string')\n .map(line => ({ number: (line as { number: number }).number, text: (line as { text: string }).text }))\n return {\n label: result.title ?? relativizeToCwd(result.path, cwd),\n lines,\n totalLines: typeof result.totalLines === 'number' ? result.totalLines : lines.length,\n lang: typeof result.lang === 'string' ? result.lang : undefined,\n }\n}\n\nfunction isValidFiles(files: unknown): files is SearchFileGroup[] {\n return Array.isArray(files) && files.every(file =>\n typeof file === 'object' && file !== null\n && typeof (file as { path?: unknown }).path === 'string'\n && Array.isArray((file as { matches?: unknown }).matches)\n && (file as { matches: unknown[] }).matches.every(match =>\n typeof match === 'object' && match !== null\n && typeof (match as { lineNumber?: unknown }).lineNumber === 'number'\n && typeof (match as { line?: unknown }).line === 'string'))\n}\n\nfunction flattenContent(content: readonly { type: string; text?: string }[]): string | undefined {\n const text = content\n .filter((block): block is { type: 'text'; text: string } => block.type === 'text' && typeof block.text === 'string')\n .map(block => block.text)\n .join('\\n')\n return text === '' ? undefined : text\n}\n\n/** Search-card derivation, or null when this call is not a search card (mirrors ui-tool). */\nfunction searchCardOf(block: ToolCallBlock): SearchCardModel | null {\n if (!('kind' in block)) return null\n const result = block.resultView?.card === 'search' ? block.resultView : null\n if (result === null) return null\n const common = { truncated: result.truncated, total: result.total }\n const recovery = result.truncated ? flattenContent(block.content) : undefined\n if (result.shape === 'matches') {\n if (!isValidFiles(result.files)) return null\n return { title: result.title, recovery, card: { kind: 'matches', files: result.files, ...common } }\n }\n if (result.shape !== 'paths') return null\n if (!Array.isArray(result.paths) || !result.paths.every(path => typeof path === 'string')) return null\n return { title: result.title, recovery, card: { kind: 'paths', paths: result.paths, ...common } }\n}\n\n/** Narrow a wire `card:'diff'` view's `diffs` to well-formed hunks (mirrors ui-tool). */\nfunction narrowDiffs(diffs: unknown): DiffHunk[] | null {\n if (!Array.isArray(diffs) || diffs.length === 0) return null\n const out: DiffHunk[] = []\n for (const hunk of diffs) {\n if (typeof hunk !== 'object' || hunk === null) return null\n const { path, oldText, newText } = hunk as Record<string, unknown>\n if (typeof path !== 'string') return null\n if (oldText !== null && typeof oldText !== 'string') return null\n if (typeof newText !== 'string') return null\n out.push({ path, oldText, newText })\n }\n return out\n}\n\n/** Diff-card derivation, or null when this call is not a diff card (mirrors ui-tool). */\nfunction diffCardOf(block: ToolCallBlock): DiffCardModel | null {\n if (!('kind' in block)) {\n const call = block.callView?.card === 'diff' ? block.callView : null\n const diffs = call === null ? null : narrowDiffs(call.diffs)\n return diffs === null ? null : { card: { diffs } }\n }\n const result = block.resultView?.card === 'diff' ? block.resultView : null\n const diffs = result === null ? null : narrowDiffs(result.diffs)\n return diffs === null ? null : { card: { diffs } }\n}\n\n/**\n * Resolve a terminal view's working directory the way the render-intent\n * contract assigns it: an absolute path is used as-is, a relative one joins\n * under the session workspace, and an omitted one IS the session workspace.\n * @param viewCwd - the cwd the terminal call view carries, if any.\n * @param sessionCwd - the session workspace root, if the caller knows it.\n * @returns the working directory for the prompt label, or undefined.\n */\nfunction resolveTerminalCwd(viewCwd: string | undefined, sessionCwd: string | undefined): string | undefined {\n if (viewCwd === undefined || viewCwd === '') return sessionCwd\n if (sessionCwd === undefined || sessionCwd === '') return viewCwd\n return resolveWorkspacePath(sessionCwd, viewCwd)\n}\n\n/** Terminal-card derivation, or null when this call is not a terminal card (mirrors ui-tool). */\nfunction terminalCardOf(block: ToolCallBlock, sessionCwd: string | undefined): TerminalCardModel | null {\n const call = block.callView?.card === 'terminal' ? block.callView : null\n if (!('kind' in block)) {\n return call === null ? null : {\n description: call.description,\n card: {\n command: call.title,\n cwd: resolveTerminalCwd(call.cwd, sessionCwd),\n output: undefined,\n exitCode: undefined,\n signal: undefined,\n running: true,\n },\n }\n }\n const result = block.resultView?.card === 'terminal' ? block.resultView : null\n if (result === null) return null\n return {\n description: call?.description,\n card: {\n command: result.title ?? call?.title ?? '',\n cwd: call === null ? undefined : resolveTerminalCwd(call.cwd, sessionCwd),\n output: result.output,\n exitCode: result.exitCode,\n signal: result.signal,\n running: false,\n },\n }\n}\n\n/** Web-card derivation, or null when this call is not a web card (mirrors ui-tool). */\nfunction webCardOf(block: ToolCallBlock): WebBlockProps | null {\n if (!('kind' in block)) return null\n const result = block.resultView\n if (result?.card !== 'web') return null\n if (result.kind === 'search') {\n return {\n kind: 'search',\n answer: result.answer,\n sources: result.sources.map(source => ({\n url: source.url,\n title: source.title,\n snippet: source.snippet,\n publishedAt: source.publishedAt,\n })),\n truncated: result.truncated,\n }\n }\n if (result.kind === 'fetch') {\n return {\n kind: 'fetch',\n url: result.url,\n statusCode: result.statusCode,\n truncated: result.truncated,\n }\n }\n return null\n}\n","/**\n * Pure detection of a consecutive run of grouped tool calls in the chat flow,\n * and the per-seat merged-group partition over it.\n *\n * A pure function of the chat snapshot (order + node store), so the merged\n * display is deterministic under replay: the web layer recomputes it per frame.\n * @module\n */\nimport type { ChatConversationViewNode, ChatNodeStore, ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client'\nimport { conversationContextKey } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { MergeGroupMode } from '../types.ts'\nimport { classifyTool } from './tool-names.ts'\n\n/** Tool-call node kind registered by ui-conversation's built-in tool definition. */\nconst TOOL_CALL_KIND = 'tool-call'\n\n/** Extract a root call block from any chat node, when it is a tool-call node. */\nfunction toolRootOf(node: ChatConversationViewNode): ToolCallBlock | null {\n if (node.kind !== TOOL_CALL_KIND) return null\n const root = (node.data as { root?: unknown }).root\n return typeof root === 'object' && root !== null ? root as ToolCallBlock : null\n}\n\n/** The wire tool name of a call in either lifecycle form (mirrors ui-tool). */\nexport function callNameOf(block: ToolCallBlock): string {\n return 'kind' in block ? (block.call?.name ?? '') : block.name\n}\n\n/** Whether the call's wire name is one of the grouped tools (empty = all). */\nexport function isGroupedTool(name: string, tools: readonly string[]): boolean {\n return tools.length === 0 || tools.includes(name)\n}\n\n/** Step identity of a node's location; undefined when the node is not step-bound. */\nfunction stepIdOf(node: ChatConversationViewNode): string | undefined {\n const location = node.location\n return location.kind === 'step' ? `${location.turn.turn}:${location.step.step}` : undefined\n}\n\n/** One merged group: the group's first call plus its consecutive continuations. */\nexport interface ReadRun {\n /** Whether this seat is the group's rendering head (the only seat that shows the card). */\n readonly isFirst: boolean\n /** The group's root blocks in flow order (first + continuations). */\n readonly blocks: readonly ToolCallBlock[]\n}\n\n/**\n * Compute the merged group this call belongs to.\n *\n * 1. Locates this call's node in the chat order; null when it is not a chat\n * tool-call node (e.g. a read dispatched as a subcall).\n * 2. Walks backward/forward to the maximal consecutive run containing it. A\n * call continues the run when it is a grouped tool AND same-tool-same-run:\n * the identical wire name, or a sibling of the same known variant family\n * (grep+glob, bash+pwsh, read+web_fetch…). Unknown names (variant\n * `others`) only merge with themselves, so unrelated tools never share a\n * card (`adjacent`: any consecutive run; `step`: same agent step as this\n * call).\n * 3. Partitions the run into `maxGroupSize`-sized groups; this call is the\n * group's first only when it heads one of those partitions. Truncation\n * therefore never orphans a call: the excess starts its own group.\n *\n * @param order - chat node key order.\n * @param nodes - chat node store.\n * @param myCallId - the call id of the seat asking about itself.\n * @param tools - grouped wire tool names; empty means every tool.\n * @param groupBy - grouping mode.\n * @param maxGroupSize - per-group cap.\n * @returns the group partition, or null when the call is not a chat tool-call node.\n */\nexport function readRun(\n order: readonly string[],\n nodes: ChatNodeStore,\n myCallId: string,\n tools: readonly string[],\n groupBy: MergeGroupMode,\n maxGroupSize: number,\n): ReadRun | null {\n const myKey = conversationContextKey(TOOL_CALL_KIND, myCallId)\n const myIndex = order.indexOf(myKey)\n if (myIndex < 0) return null\n const myRoot = rootAtNode(order, nodes, myIndex)\n if (myRoot === null) return null\n const myName = callNameOf(myRoot)\n const myVariant = classifyTool(myName)\n const size = Math.max(1, maxGroupSize)\n\n const rootAt = (index: number): ToolCallBlock | null => rootAtNode(order, nodes, index)\n const myStep = groupBy === 'step' ? stepIdOfNodeAt(order, nodes, myIndex) : undefined\n const inGroup = (index: number): boolean => {\n const root = rootAt(index)\n if (root === null || !isGroupedTool(callNameOf(root), tools)) return false\n const name = callNameOf(root)\n // Same-name calls always continue the run; known families merge siblings\n // (grep+glob, bash+pwsh); unknown names merge only with themselves.\n if (name !== myName) {\n if (myVariant === 'others' || classifyTool(name) !== myVariant) return false\n }\n if (groupBy !== 'step') return true\n return myStep !== undefined && stepIdOfNodeAt(order, nodes, index) === myStep\n }\n\n let start = myIndex\n while (start > 0 && inGroup(start - 1)) start--\n let end = myIndex\n while (end < order.length - 1 && inGroup(end + 1)) end++\n\n const groupStart = start + Math.floor((myIndex - start) / size) * size\n const groupEnd = Math.min(groupStart + size, end + 1)\n\n const blocks: ToolCallBlock[] = []\n for (let index = groupStart; index < groupEnd; index++) {\n const root = rootAt(index)\n if (root !== null) blocks.push(root)\n }\n return { isFirst: myIndex === groupStart, blocks }\n}\n\nfunction rootAtNode(order: readonly string[], nodes: ChatNodeStore, index: number): ToolCallBlock | null {\n const key = order[index]\n const node = key === undefined ? undefined : nodes.get(key)\n return node === undefined ? null : toolRootOf(node)\n}\n\nfunction stepIdOfNodeAt(order: readonly string[], nodes: ChatNodeStore, index: number): string | undefined {\n const key = order[index]\n const node = key === undefined ? undefined : nodes.get(key)\n return node === undefined ? undefined : stepIdOf(node)\n}\n","/**\n * Merged tool-call row — the shadowed `tool.call.toolview` registrant.\n *\n * For the first call of a consecutive run of grouped tools, renders the run as\n * one card (the first call's full row) plus one compact child row per\n * continuation call. For a continuation call, renders nothing: the seat stays\n * empty and the injected stylesheet collapses it out of the flow. When the\n * call is not a chat tool-call node at all (e.g. dispatched as a subcall),\n * falls back to a plain single row so the call never disappears.\n *\n * The row surface mirrors the built-in generic ToolRow: a variant title/icon\n * plus the settled card (read/search/diff/terminal/web) or IN/OUT text.\n *\n * Everything here is a pure function of the chat snapshot + the frozen call\n * slices (replay-deterministic); expand state is component-local view state.\n * @module\n */\nimport { memo, useLayoutEffect, useRef, useState, type CSSProperties, type KeyboardEvent, type MouseEvent, type ReactNode } from 'react'\nimport {\n DiffBlock, DisclosureRow, IconApiOutline14, IconBrowseOutline16, IconCodeOutline16,\n IconEditOutline16, IconSearchOutline16, IconSparkle16, ReadBlock, SearchBlock, StateDot,\n TerminalBlock, WebBlock, type TerminalBlockLabels,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ToolCallViewProps } from '@deepseek-ai/dsh-client-ui-tool/client'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { MergeToolCallsConfig } from '../types.ts'\nimport { callRowModel, type CallRowModel, type RowState, type ToolVariant } from './card-model.ts'\nimport { readRun } from './merge-run.ts'\n\n/** Chat rows show a capped card; the details panel stays the full-height surface. */\nconst CHAT_READ_MAX_LINES = 8\nconst CHAT_SEARCH_MAX_LINES = 8\nconst CHAT_DIFF_MAX_LINES = 8\n\n/** Locale seat and inject face of the merged row registration. */\nexport type MergedToolRowProps = ToolCallViewProps\n & PropsLocale<'merge-tool-calls'>\n & { readonly cfg: MergeToolCallsConfig }\n\n/** Variant leading icons (figma table); all glyphs render at 14 inside the 16px leading box. */\nconst VARIANT_ICONS: Record<ToolVariant, ReactNode> = {\n search: <IconSearchOutline16 size={14} />,\n read: <IconBrowseOutline16 size={14} />,\n bash: <IconApiOutline14 size={14} />,\n write: <IconEditOutline16 size={14} />,\n edit: <IconEditOutline16 size={14} />,\n code: <IconCodeOutline16 size={14} />,\n others: <IconSparkle16 size={14} />,\n}\n\n/**\n * Per-variant locale key for the merged-count summary (`{n} Files`, `{n}\n * Commands`, …). Replaces the first call's file path on the main row when the\n * run merges more than one call, so the main row reads `Read · 5 Files` and\n * the file paths move to the collapsed child rows.\n */\nconst VARIANT_COUNT_KEY: Record<ToolVariant, 'countFiles' | 'countQueries' | 'countCommands' | 'countPrograms' | 'countCalls'> = {\n read: 'countFiles',\n write: 'countFiles',\n edit: 'countFiles',\n search: 'countQueries',\n bash: 'countCommands',\n code: 'countPrograms',\n others: 'countCalls',\n}\n\n/** Leading-slot state substitution, mirroring the shipped row. */\nfunction leadingFor(state: RowState, icon: ReactNode): ReactNode {\n switch (state) {\n case 'error': return <StateDot state=\"error\" />\n case 'stopped': return <StateDot state=\"warning\" />\n default: return icon\n }\n}\n\n/** Visually hidden run-state label (the StateDot and sweep are colour-only). */\nfunction stateStatus(state: RowState, t: MergedToolRowProps['t']): string | null {\n switch (state) {\n case 'running': return t('running')\n case 'error': return t('failed')\n case 'stopped': return t('stopped')\n default: return null\n }\n}\n\n/** TerminalBlock display copy from the plugin's own dictionary. */\nfunction terminalLabels(t: MergedToolRowProps['t']): TerminalBlockLabels {\n return {\n signal: signal => t('terminal.signal', { signal }),\n exitCode: code => t('terminal.exitCode', { code }),\n running: t('terminal.running'),\n failed: t('terminal.failed'),\n done: t('terminal.done'),\n copy: t('terminal.copy'),\n copied: t('terminal.copied'),\n noOutput: t('terminal.noOutput'),\n collapseAria: t('terminal.collapseAria'),\n collapse: t('terminal.collapse'),\n expandAria: hidden => t('terminal.expandAria', { n: hidden }),\n expand: hidden => t('terminal.expandRest', { n: hidden }),\n }\n}\n\n/** One call's expanded-body card, mirroring the built-in ToolRow body. */\nfunction CardBody({ model, t }: { model: CallRowModel; t: MergedToolRowProps['t'] }) {\n if (model.terminal !== null) {\n return <TerminalBlock {...model.terminal.card} maxLines={Infinity} labels={terminalLabels(t)} />\n }\n if (model.diff !== null) {\n return <DiffBlock {...model.diff.card} maxLines={CHAT_DIFF_MAX_LINES} />\n }\n if (model.read !== null) {\n return <ReadBlock {...model.read} maxLines={CHAT_READ_MAX_LINES} />\n }\n if (model.search !== null) {\n return (\n <>\n <SearchBlock {...model.search.card} maxLines={CHAT_SEARCH_MAX_LINES} />\n {model.search.recovery !== undefined && (\n <div className=\"mtc-recovery\">{model.search.recovery}</div>\n )}\n </>\n )\n }\n if (model.web !== null) {\n return <WebBlock {...model.web} />\n }\n const hasBody = model.body !== null\n const hasOutput = model.output !== null\n if (!hasBody && !hasOutput) return null\n return (\n <div className=\"mtc-io-card\">\n {hasBody && (\n <div className=\"mtc-io-section\">\n <span className=\"mtc-io-label\">IN</span>\n <span className=\"mtc-io-text\">{model.body}</span>\n </div>\n )}\n {hasBody && hasOutput && <span className=\"mtc-io-divider\" aria-hidden />}\n {hasOutput && (\n <div className=\"mtc-io-section\">\n <span className=\"mtc-io-label\">OUT</span>\n <span className=\"mtc-io-text\" data-error={model.state === 'error' || undefined}>{model.output}</span>\n </div>\n )}\n </div>\n )\n}\n\n/**\n * The run's main card: the first call's chrome (variant title/icon + state)\n * plus, for a single call, its expandable content card. For a merged run the\n * main row's collapsed summary is the count (`Read · 5 Files`) and the\n * expanded body is the child-rows block (passed in as `children`); the first\n * call is rendered as the first child row so every file path lands on a child\n * row, never on the main row.\n */\nexport const RowCard = memo(function RowCard({\n toolName, block, cwd, openFile, inspect, t, mergedCount, children,\n}: {\n toolName: string\n block: ToolCallBlock\n cwd: string | undefined\n openFile: (path: string) => void\n inspect: (() => void) | undefined\n t: MergedToolRowProps['t']\n /** Continuation-call count; 0 means a single-call row (no child rows). */\n mergedCount: number\n /** Child rows for the merged run (all calls, including the first). */\n children?: ReactNode\n}) {\n const model = callRowModel(toolName, block, cwd)\n const [expanded, setExpanded] = useState(false)\n const hasChildren = mergedCount > 0\n const expandable = model.expandable || hasChildren\n const open = expanded && expandable\n const status = stateStatus(model.state, t)\n const failureLine = model.state === 'error' ? model.errorSummary ?? null : null\n // Merged runs trade the first file path + `+n` suffix for a count summary,\n // so the main row reads `Read · 5 Files`; the file paths live on the child\n // rows. An error on the first call still surfaces its error text instead.\n const summaryText = hasChildren && failureLine === null\n ? t(VARIANT_COUNT_KEY[model.variant], { n: String(mergedCount + 1) })\n : failureLine ?? model.summary\n // The open-file link only applies to single-call rows (the merged summary is\n // a count, not a path).\n const fileLink = !hasChildren && model.filePath !== undefined && openFile !== undefined && failureLine === null\n const openFileClick = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (model.filePath !== undefined) openFile(model.filePath)\n }\n return (\n <div className=\"mtc-row\" data-state={model.state} data-variant={model.variant} data-merged={hasChildren || undefined}>\n {status !== null && <span className=\"mtc-visually-hidden\">{status}</span>}\n <DisclosureRow\n rowClassName=\"mtc-title-row\"\n titleClassName=\"mtc-title\"\n leadingClassName=\"mtc-leading\"\n chevronClassName=\"mtc-chevron\"\n icon={leadingFor(model.state, VARIANT_ICONS[model.variant])}\n title={model.title}\n open={open}\n expandable={expandable}\n expandOnRowClick\n keepContentWhenOpen\n onToggle={() => { setExpanded(value => !value) }}\n collapsedContent={summaryText !== '' && (\n <>\n <span className=\"mtc-sep\" aria-hidden />\n {fileLink ? (\n <button type=\"button\" className=\"mtc-summary-link\" onClick={openFileClick}>{summaryText}</button>\n ) : (\n <span className=\"mtc-summary\">{summaryText}</span>\n )}\n </>\n )}\n >\n {/* Single-call mode: the first call's expandable content card lives in\n the disclosure body. Merged mode renders nothing here — the child\n rows block is a sibling below, animated via its own collapse grid. */}\n {!hasChildren && (\n <div className=\"mtc-card-body\">\n <CardBody model={model} t={t} />\n {inspect !== undefined && (\n <button type=\"button\" className=\"mtc-inspect\" onClick={inspect}>Inspect</button>\n )}\n </div>\n )}\n </DisclosureRow>\n {hasChildren && (\n // The animated children block. Lives outside DisclosureRow so the\n // grid-template-rows transition can keep the rows in the DOM while\n // collapsing (DisclosureRow would unmount them instantly). The\n // --mtc-sep-left custom property is set by the parent on .mtc-root.\n <div className=\"mtc-children-collapse\" data-open={open || undefined}>\n <div className=\"mtc-children\">\n {children}\n </div>\n </div>\n )}\n {hasChildren && open && inspect !== undefined && (\n <button type=\"button\" className=\"mtc-inspect\" onClick={inspect}>Inspect</button>\n )}\n </div>\n )\n})\n\n/**\n * One compact continuation row: the main row's tail structure ([sep dot][path]).\n * An expandable call toggles the inline content card on click (mirroring the\n * main row's whole-row disclosure); a read/write/edit-family path additionally\n * renders as an open-file link (the sidebar preview) that stops propagation,\n * exactly like the main row's summary link.\n */\nexport const ChildRow = memo(function ChildRow({\n toolName, block, cwd, openFile, t,\n}: {\n toolName: string\n block: ToolCallBlock\n cwd: string | undefined\n openFile: (path: string) => void\n t: MergedToolRowProps['t']\n}) {\n const model = callRowModel(toolName, block, cwd)\n const [open, setOpen] = useState(false)\n const stateLabel = stateStatus(model.state, t)\n const expandable = model.expandable\n const toggle = (): void => { setOpen(value => !value) }\n const openFileClick = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (model.filePath !== undefined) openFile(model.filePath)\n }\n const onRowKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n toggle()\n }\n }\n return (\n <div className=\"mtc-child\">\n <div\n className=\"mtc-child-row\"\n data-open={expandable && open || undefined}\n data-static={expandable ? undefined : true}\n role={expandable ? 'button' : undefined}\n tabIndex={expandable ? 0 : undefined}\n aria-expanded={expandable ? open : undefined}\n onClick={expandable ? toggle : undefined}\n onKeyDown={expandable ? onRowKeyDown : undefined}\n >\n <span className=\"mtc-sep\" aria-hidden />\n {model.filePath !== undefined ? (\n <button type=\"button\" className=\"mtc-child-path-link\" onClick={openFileClick}>{model.summary}</button>\n ) : (\n <span className=\"mtc-child-path\">{model.summary}</span>\n )}\n {stateLabel !== null && (\n <span className=\"mtc-child-state\" data-error={model.state === 'error' || undefined}>{stateLabel}</span>\n )}\n </div>\n {expandable && open && (\n <div className=\"mtc-child-body\">\n <CardBody model={model} t={t} />\n </div>\n )}\n </div>\n )\n})\n\n/**\n * The shadowed toolview: renders the merged run card for the run's first call,\n * nothing for continuation calls, and a plain single row when this call is not\n * a chat tool-call node.\n *\n * Child-row alignment is measured at runtime, not hardcoded: the main row's\n * separator dot sits after a variable-width title (\"Read\"/\"Search\"/\"Bash\"/…),\n * so its column depends on the rendered font. A layout effect measures the\n * dot's offset from the card root (once, plus on reflow via ResizeObserver)\n * and indents the children so their dots and paths land on the main row's\n * columns — no font/title constants to keep in sync.\n */\nexport function MergedToolRow({ callId, toolName, block, cwd, openFile, inspect, t, cfg, useSession }: MergedToolRowProps) {\n const run = useSession(snapshot => readRun(\n snapshot.chat.order,\n snapshot.chat.nodes,\n callId,\n cfg.tools,\n cfg.groupBy,\n cfg.maxGroupSize,\n ))\n const rootRef = useRef<HTMLDivElement>(null)\n /** Main separator dot's left offset from the card root; null before first measure. */\n const [sepLeft, setSepLeft] = useState<number | null>(null)\n\n useLayoutEffect(() => {\n const root = rootRef.current\n if (root === null) return\n const sep = root.querySelector<HTMLElement>('.mtc-row .mtc-sep')\n if (sep === null) return\n const measure = (): void => {\n setSepLeft(Math.round(sep.getBoundingClientRect().left - root.getBoundingClientRect().left))\n }\n measure()\n // Font swaps, locale switches, and column resizes move the dot; keep the\n // alignment current without re-running the effect.\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(measure)\n observer?.observe(root)\n return () => { observer?.disconnect() }\n }, [run === null ? null : run.blocks[0]?.callId ?? null])\n\n if (run === null) {\n // Not a chat tool-call node (subcall dispatch): never blank the call.\n return (\n <RowCard\n toolName={toolName}\n block={block}\n cwd={cwd}\n openFile={openFile}\n inspect={inspect}\n t={t}\n mergedCount={0}\n />\n )\n }\n if (!run.isFirst) return null\n const hasChildren = run.blocks.length > 1\n return (\n <div\n className=\"mtc-root\"\n data-tool={toolName}\n ref={rootRef}\n // The measured dot column lands the children's sep dot on the main row's\n // summary column. Set on the root so it cascades into RowCard's\n // .mtc-children block.\n style={sepLeft === null ? undefined : { ['--mtc-sep-left']: `${sepLeft}px` } as CSSProperties}\n >\n <RowCard\n toolName={toolName}\n block={run.blocks[0] ?? block}\n cwd={cwd}\n openFile={openFile}\n inspect={inspect}\n t={t}\n mergedCount={run.blocks.length - 1}\n >\n {/* Every call (including the first) renders as a child row, so the\n main row's summary stays a count (`Read · 5 Files`) and every file\n path lands on its own child row. */}\n {hasChildren && run.blocks.map(child => (\n <ChildRow key={child.callId} toolName={toolName} block={child} cwd={cwd} openFile={openFile} t={t} />\n ))}\n </RowCard>\n </div>\n )\n}\n","/**\n * One scoped stylesheet injected for the lifetime of the client activation.\n *\n * Two jobs:\n * 1. The empty-seat collapse rule: the shadowed toolview renders `null` for\n * every non-first call of a merged run. The built-in `ToolCallTree` still\n * wraps that null in its `.callRow` div, and the renderer wraps every\n * toolview in an empty `<div data-slot=\"tool.call.toolview\">` (display:\n * contents), so the seat's `.flowItem` is never `:empty` itself and the\n * built-in `.flowItem:empty { display:none }` rule does not fire. This\n * rule extends the same intent (\"a renderer may decline its row\") to a\n * tool seat whose toolview rendered nothing.\n * 2. The plugin's own `.mtc-*` chrome for the merged card and its child rows.\n *\n * All colors come from the shared `--dsw-*` tokens (never literals).\n */\nexport const CSS = `\n/* A tool-call seat whose toolview declined to render (merged-run continuation\n calls) must not consume the flow column's gap. The empty toolview slot\n wrapper is the decline signal; the callRow around it always exists. */\n[data-chat-flow-kind=\"tool-call\"]:has([data-slot=\"tool.call.toolview\"]:empty) { display: none; }\n\n.mtc-root { display: flex; flex-direction: column; min-width: 0; }\n.mtc-row { display: flex; flex-direction: column; min-width: 0; }\n.mtc-row[data-state='running'] .mtc-title-row { position: relative; overflow: hidden; }\n.mtc-row[data-state='running'] .mtc-title-row::after {\n content: '';\n position: absolute;\n top: 0; bottom: 0; left: 0;\n width: 300px;\n background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--dsw-alias-bg-base) 60%, transparent) 55%, transparent 100%);\n animation: dsh-mtc-sweep 2.6s ease-out infinite;\n pointer-events: none;\n}\n@keyframes dsh-mtc-sweep {\n 0% { left: -300px; }\n 90%, 100% { left: 100%; }\n}\n\n.mtc-title { font-weight: 400; }\n.mtc-sep { flex: none; width: 2px; height: 2px; border-radius: 1px; margin: 0 8px; background: var(--dsw-alias-label-caption); }\n.mtc-summary {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-tertiary);\n}\n.mtc-summary-link {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n margin: 0; padding: 0; border: none; background: none; font: inherit; text-align: left;\n font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-secondary);\n text-decoration: underline; text-decoration-color: var(--dsw-alias-label-quaternary);\n text-underline-offset: 3px; cursor: pointer;\n}\n.mtc-summary-link:hover { color: var(--dsw-alias-label-primary); text-decoration-color: currentColor; }\n.mtc-summary-error { color: var(--dsw-alias-state-error-primary); }\n.mtc-summary-suffix { flex: none; margin-left: 4px; white-space: nowrap; font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-tertiary); }\n\n.mtc-card-body { margin: 4px 0 4px 4px; min-width: 0; }\n.mtc-recovery { margin: 4px 0 4px 4px; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--dsw-font-xs-13); color: var(--dsw-alias-label-tertiary); }\n/* IN/OUT text card for calls without a card primitive (mirrors ToolRow). */\n.mtc-io-card {\n display: flex; flex-direction: column; min-width: 0;\n border: 1px solid var(--dsw-alias-border-l2); border-radius: 12px;\n background: var(--dsw-alias-bg-base);\n}\n.mtc-io-section { display: flex; gap: 10px; padding: 8px 12px; min-width: 0; }\n.mtc-io-label {\n flex: none; font-size: 11px; line-height: 16px; font-weight: 600;\n color: var(--dsw-alias-label-tertiary);\n}\n.mtc-io-text {\n flex: 1 1 auto; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere;\n font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary);\n}\n.mtc-io-text[data-error] { color: var(--dsw-alias-state-error-primary); }\n.mtc-io-divider { height: 1px; background: var(--dsw-alias-border-l2); }\n.mtc-inspect {\n display: inline-flex; align-self: flex-start; align-items: center; gap: 4px;\n margin: 4px 0 2px 4px; padding: 2px 8px;\n border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px;\n background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-secondary);\n font-size: 11px; line-height: 16px; cursor: pointer;\n opacity: 0; transition: opacity 100ms ease;\n}\n.mtc-root:hover .mtc-inspect, .mtc-inspect:focus-visible { opacity: 1; }\n.mtc-inspect:hover { background: var(--dsw-alias-interactive-bg-hover-solid); color: var(--dsw-alias-label-primary); }\n\n/* Compact child rows: each is the main row's tail structure — [sep dot][path].\n The dot/path columns are set at runtime by the component (it measures the\n main row's sep offset and sets the --mtc-sep-left custom property on the\n root), so this is only the pre-measure fallback.\n\n The .mtc-children-collapse wrapper animates the block's height with a\n grid-template-rows 0fr↔1fr transition (children stay in the DOM while\n collapsing, so the slide is smooth instead of popping out). The vertical\n margin lives on the wrapper (not .mtc-children) so it doesn't leak past the\n 0fr row when collapsed. */\n.mtc-children-collapse {\n display: grid;\n grid-template-rows: 0fr;\n margin: 0;\n transition: grid-template-rows 200ms ease-out, margin 200ms ease-out;\n}\n.mtc-children-collapse[data-open] {\n grid-template-rows: 1fr;\n margin: 2px 0;\n}\n.mtc-children {\n display: flex; flex-direction: column; gap: 1px;\n margin: 0 0 0 var(--mtc-sep-left, 61px);\n min-width: 0; min-height: 0; overflow: hidden;\n opacity: 0;\n transition: opacity 150ms ease-out;\n}\n.mtc-children-collapse[data-open] .mtc-children {\n opacity: 1;\n transition: opacity 150ms ease-out 50ms;\n}\n.mtc-child { display: flex; flex-direction: column; min-width: 0; }\n.mtc-child-row {\n display: flex; align-items: center; gap: 0; min-width: 0; height: 20px;\n margin: 0; padding: 0; border: 0; border-radius: 4px; background: none;\n font: inherit; text-align: left; color: var(--dsw-alias-label-secondary); cursor: pointer;\n}\n.mtc-child-row:hover { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }\n.mtc-child-row[data-static] { cursor: default; }\n.mtc-child-row[data-static]:hover { background: none; color: var(--dsw-alias-label-secondary); }\n.mtc-child-row .mtc-sep { margin: 0 8px 0 0; }\n.mtc-child-path {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n font-size: 14px; line-height: 20px;\n}\n/* Read-family child paths are open-file links (sidebar preview), same affordance\n as the main row's summary link. */\n.mtc-child-path-link {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n margin: 0; padding: 0; border: none; background: none; font: inherit; text-align: left;\n font-size: 14px; line-height: 20px; color: var(--dsw-alias-label-secondary);\n text-decoration: underline; text-decoration-color: var(--dsw-alias-label-quaternary);\n text-underline-offset: 3px; cursor: pointer;\n}\n.mtc-child-path-link:hover { color: var(--dsw-alias-label-primary); text-decoration-color: currentColor; }\n.mtc-child-state { flex: none; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }\n.mtc-child-state[data-error] { color: var(--dsw-alias-state-error-primary); }\n/* The expanded child card must not inherit the children block's sep indent:\n pull its left edge back to the main card body's column (root + 4px) so the\n card spans the card width instead of leaving a blank gutter on its left. */\n.mtc-child-body { margin: 2px 0 2px calc(4px - var(--mtc-sep-left, 61px)); min-width: 0; }\n\n.mtc-visually-hidden {\n position: absolute; width: 1px; height: 1px; overflow: hidden;\n clip: rect(0 0 0 0); white-space: nowrap;\n}\n`\n\n/** Install the stylesheet and return its disposer. */\nexport function installStyles(): () => void {\n const style = document.createElement('style')\n style.setAttribute('data-merge-tool-calls-style', '')\n style.textContent = CSS\n document.head.appendChild(style)\n return () => { style.remove() }\n}\n","/**\n * merge-tool-calls — browser half.\n *\n * Shadows the shipped `tool.call.toolview` entries for every grouped tool at\n * priority -1 (the keyed slot's shadowing rule: lowest priority renders). An\n * empty `tools` config means every built-in generic-family tool\n * (see {@link ALL_TOOL_NAMES}); a non-empty list is an explicit whitelist.\n * The shadowed component merges consecutive calls of one tool in the chat flow\n * into a single card with compact child rows.\n *\n * @module @dsh-external/dsh-plugin-merge-tool-calls/client\n */\n\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-tool/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\nimport { DEFAULT_MERGE_CONFIG, type MergeToolCallsConfig } from '../types.ts'\nimport { en, NS, zh, type MergeToolCallsKey } from './locales.ts'\nimport { MergedToolRow } from './rows.tsx'\nimport { installStyles } from './styles.ts'\nimport { ALL_TOOL_NAMES } from './tool-names.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Copy for the merged tool-call rows. */\n 'merge-tool-calls': MergeToolCallsKey\n }\n}\n\n/** Required services: the slot registry (toolview shadowing) and locale. */\nexport const inject = ['slots', 'locale']\n\n/**\n * Register one shadowed toolview per grouped tool.\n * @param ctx - client root context.\n * @param config - row config; defaults apply when the loader passes none.\n */\nexport function apply(ctx: ClientContext, config: Partial<MergeToolCallsConfig> = {}): void {\n const cfg: MergeToolCallsConfig = { ...DEFAULT_MERGE_CONFIG, ...config }\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'merge-tool-calls: dictionaries')\n ctx.effect(installStyles, 'merge-tool-calls: styles')\n\n const toolNames = cfg.tools.length === 0 ? ALL_TOOL_NAMES : [...new Set(cfg.tools)]\n for (const tool of toolNames) {\n ctx.slots.inject('tool.call.toolview', () => ctx.slots.register({\n name: 'tool.call.toolview',\n key: tool,\n priority: -1,\n locale: NS,\n inject: () => ({ cfg }),\n }, MergedToolRow))\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAaA,uBAA6C;CACxD,OAAO,EAAE;CACT,SAAS;CACT,cAAc;CACf;;;;;ACxBD,MAAa,KAAK;CAChB,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,UAAU;CACV,aAAa;CACb,YAAY;CACZ,cAAc;CACd,eAAe;CACf,eAAe;CACf,YAAY;CACZ,mBAAmB;CACnB,qBAAqB;CACrB,oBAAoB;CACpB,mBAAmB;CACnB,iBAAiB;CACjB,iBAAiB;CACjB,mBAAmB;CACnB,qBAAqB;CACrB,yBAAyB;CACzB,qBAAqB;CACrB,uBAAuB;CACvB,uBAAuB;CACxB;AAID,MAAa,KAAK;CAChB,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,UAAU;CACV,aAAa;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,OAAO,IAAI,OAAO,MAAM;GACnB;GACK;GACD;GACN;GACH,aAAa,IAAI,OAAO,SAAS;aAKhC,eAAe,IAAI,OAAO,KAAI,UAC7B,2CAAC;IAAsC;IAAU,OAAO;IAAY;IAAe;IAAa;MAAjF,MAAM,OAAgF,CACrG;IACM;GACN;;;;;;;;;;;;;;;;;;;;;ACzXV,MAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2InB,SAAgB,gBAA4B;CAC1C,MAAM,QAAQ,SAAS,cAAc,QAAQ;AAC7C,OAAM,aAAa,+BAA+B,GAAG;AACrD,OAAM,cAAc;AACpB,UAAS,KAAK,YAAY,MAAM;AAChC,cAAa;AAAE,QAAM,QAAQ;;;;;;;ACjI/B,MAAa,SAAS,CAAC,SAAS,SAAS;;;;;;AAOzC,SAAgB,MAAM,KAAoB,SAAwC,EAAE,EAAQ;CAC1F,MAAMC,MAA4B;EAAE,GAAG;EAAsB,GAAG;EAAQ;AACxE,KAAI,aAAa,IAAI,OAAO,SAAS,IAAI;EAAE;EAAI;EAAI,CAAC,EAAE,iCAAiC;AACvF,KAAI,OAAO,eAAe,2BAA2B;CAErD,MAAM,YAAY,IAAI,MAAM,WAAW,IAAI,iBAAiB,CAAC,GAAG,IAAI,IAAI,IAAI,MAAM,CAAC;AACnF,MAAK,MAAM,QAAQ,UACjB,KAAI,MAAM,OAAO,4BAA4B,IAAI,MAAM,SAAS;EAC9D,MAAM;EACN,KAAK;EACL,UAAU;EACV,QAAQ;EACR,eAAe,EAAE,KAAK;EACvB,EAAE,cAAc,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* The shadowed component merges consecutive calls of one tool in the chat flow
|
|
9
9
|
* into a single card with compact child rows.
|
|
10
10
|
*
|
|
11
|
-
* @module @dsh-external/dsh-merge-tool-calls/client
|
|
11
|
+
* @module @dsh-external/dsh-plugin-merge-tool-calls/client
|
|
12
12
|
*/
|
|
13
13
|
import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
|
|
14
14
|
import { type MergeToolCallsConfig } from '../types.ts';
|
|
@@ -8,6 +8,11 @@ export declare const zh: {
|
|
|
8
8
|
more: string;
|
|
9
9
|
showLess: string;
|
|
10
10
|
mergedCount: string;
|
|
11
|
+
countFiles: string;
|
|
12
|
+
countQueries: string;
|
|
13
|
+
countCommands: string;
|
|
14
|
+
countPrograms: string;
|
|
15
|
+
countCalls: string;
|
|
11
16
|
'terminal.signal': string;
|
|
12
17
|
'terminal.exitCode': string;
|
|
13
18
|
'terminal.running': string;
|
|
@@ -31,6 +36,11 @@ export declare const en: {
|
|
|
31
36
|
more: string;
|
|
32
37
|
showLess: string;
|
|
33
38
|
mergedCount: string;
|
|
39
|
+
countFiles: string;
|
|
40
|
+
countQueries: string;
|
|
41
|
+
countCommands: string;
|
|
42
|
+
countPrograms: string;
|
|
43
|
+
countCalls: string;
|
|
34
44
|
'terminal.signal': string;
|
|
35
45
|
'terminal.exitCode': string;
|
|
36
46
|
'terminal.running': string;
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merged tool-call row — the shadowed `tool.call.toolview` registrant.
|
|
3
|
+
*
|
|
4
|
+
* For the first call of a consecutive run of grouped tools, renders the run as
|
|
5
|
+
* one card (the first call's full row) plus one compact child row per
|
|
6
|
+
* continuation call. For a continuation call, renders nothing: the seat stays
|
|
7
|
+
* empty and the injected stylesheet collapses it out of the flow. When the
|
|
8
|
+
* call is not a chat tool-call node at all (e.g. dispatched as a subcall),
|
|
9
|
+
* falls back to a plain single row so the call never disappears.
|
|
10
|
+
*
|
|
11
|
+
* The row surface mirrors the built-in generic ToolRow: a variant title/icon
|
|
12
|
+
* plus the settled card (read/search/diff/terminal/web) or IN/OUT text.
|
|
13
|
+
*
|
|
14
|
+
* Everything here is a pure function of the chat snapshot + the frozen call
|
|
15
|
+
* slices (replay-deterministic); expand state is component-local view state.
|
|
16
|
+
* @module
|
|
17
|
+
*/
|
|
18
|
+
import { type ReactNode } from 'react';
|
|
1
19
|
import type { ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
20
|
import type { ToolCallViewProps } from '@deepseek-ai/dsh-client-ui-tool/client';
|
|
3
21
|
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
@@ -6,7 +24,14 @@ import type { MergeToolCallsConfig } from '../types.ts';
|
|
|
6
24
|
export type MergedToolRowProps = ToolCallViewProps & PropsLocale<'merge-tool-calls'> & {
|
|
7
25
|
readonly cfg: MergeToolCallsConfig;
|
|
8
26
|
};
|
|
9
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* The run's main card: the first call's chrome (variant title/icon + state)
|
|
29
|
+
* plus, for a single call, its expandable content card. For a merged run the
|
|
30
|
+
* main row's collapsed summary is the count (`Read · 5 Files`) and the
|
|
31
|
+
* expanded body is the child-rows block (passed in as `children`); the first
|
|
32
|
+
* call is rendered as the first child row so every file path lands on a child
|
|
33
|
+
* row, never on the main row.
|
|
34
|
+
*/
|
|
10
35
|
export declare const RowCard: import("react").NamedExoticComponent<{
|
|
11
36
|
toolName: string;
|
|
12
37
|
block: ToolCallBlock;
|
|
@@ -14,8 +39,10 @@ export declare const RowCard: import("react").NamedExoticComponent<{
|
|
|
14
39
|
openFile: (path: string) => void;
|
|
15
40
|
inspect: (() => void) | undefined;
|
|
16
41
|
t: MergedToolRowProps["t"];
|
|
17
|
-
/** Continuation-call count
|
|
42
|
+
/** Continuation-call count; 0 means a single-call row (no child rows). */
|
|
18
43
|
mergedCount: number;
|
|
44
|
+
/** Child rows for the merged run (all calls, including the first). */
|
|
45
|
+
children?: ReactNode;
|
|
19
46
|
}>;
|
|
20
47
|
/**
|
|
21
48
|
* One compact continuation row: the main row's tail structure ([sep dot][path]).
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
*
|
|
15
15
|
* All colors come from the shared `--dsw-*` tokens (never literals).
|
|
16
16
|
*/
|
|
17
|
-
export declare const CSS = "\n/* A tool-call seat whose toolview declined to render (merged-run continuation\n calls) must not consume the flow column's gap. The empty toolview slot\n wrapper is the decline signal; the callRow around it always exists. */\n[data-chat-flow-kind=\"tool-call\"]:has([data-slot=\"tool.call.toolview\"]:empty) { display: none; }\n\n.mtc-root { display: flex; flex-direction: column; min-width: 0; }\n.mtc-row { display: flex; flex-direction: column; min-width: 0; }\n.mtc-row[data-state='running'] .mtc-title-row { position: relative; overflow: hidden; }\n.mtc-row[data-state='running'] .mtc-title-row::after {\n content: '';\n position: absolute;\n top: 0; bottom: 0; left: 0;\n width: 300px;\n background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--dsw-alias-bg-base) 60%, transparent) 55%, transparent 100%);\n animation: dsh-mtc-sweep 2.6s ease-out infinite;\n pointer-events: none;\n}\n@keyframes dsh-mtc-sweep {\n 0% { left: -300px; }\n 90%, 100% { left: 100%; }\n}\n\n.mtc-title { font-weight: 400; }\n.mtc-sep { flex: none; width: 2px; height: 2px; border-radius: 1px; margin: 0 8px; background: var(--dsw-alias-label-caption); }\n.mtc-summary {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-tertiary);\n}\n.mtc-summary-link {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n margin: 0; padding: 0; border: none; background: none; font: inherit; text-align: left;\n font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-secondary);\n text-decoration: underline; text-decoration-color: var(--dsw-alias-label-quaternary);\n text-underline-offset: 3px; cursor: pointer;\n}\n.mtc-summary-link:hover { color: var(--dsw-alias-label-primary); text-decoration-color: currentColor; }\n.mtc-summary-error { color: var(--dsw-alias-state-error-primary); }\n.mtc-summary-suffix { flex: none; margin-left: 4px; white-space: nowrap; font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-tertiary); }\n\n.mtc-card-body { margin: 4px 0 4px 4px; min-width: 0; }\n.mtc-recovery { margin: 4px 0 4px 4px; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--dsw-font-xs-13); color: var(--dsw-alias-label-tertiary); }\n/* IN/OUT text card for calls without a card primitive (mirrors ToolRow). */\n.mtc-io-card {\n display: flex; flex-direction: column; min-width: 0;\n border: 1px solid var(--dsw-alias-border-l2); border-radius: 12px;\n background: var(--dsw-alias-bg-base);\n}\n.mtc-io-section { display: flex; gap: 10px; padding: 8px 12px; min-width: 0; }\n.mtc-io-label {\n flex: none; font-size: 11px; line-height: 16px; font-weight: 600;\n color: var(--dsw-alias-label-tertiary);\n}\n.mtc-io-text {\n flex: 1 1 auto; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere;\n font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary);\n}\n.mtc-io-text[data-error] { color: var(--dsw-alias-state-error-primary); }\n.mtc-io-divider { height: 1px; background: var(--dsw-alias-border-l2); }\n.mtc-inspect {\n display: inline-flex; align-self: flex-start; align-items: center; gap: 4px;\n margin: 4px 0 2px 4px; padding: 2px 8px;\n border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px;\n background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-secondary);\n font-size: 11px; line-height: 16px; cursor: pointer;\n opacity: 0; transition: opacity 100ms ease;\n}\n.mtc-root:hover .mtc-inspect, .mtc-inspect:focus-visible { opacity: 1; }\n.mtc-inspect:hover { background: var(--dsw-alias-interactive-bg-hover-solid); color: var(--dsw-alias-label-primary); }\n\n/* Compact child rows: each is the main row's tail structure \u2014 [sep dot][path].\n The dot/path columns are set at runtime by the component (it measures the\n main row's sep offset and sets the --mtc-sep-left custom property on the\n
|
|
17
|
+
export declare const CSS = "\n/* A tool-call seat whose toolview declined to render (merged-run continuation\n calls) must not consume the flow column's gap. The empty toolview slot\n wrapper is the decline signal; the callRow around it always exists. */\n[data-chat-flow-kind=\"tool-call\"]:has([data-slot=\"tool.call.toolview\"]:empty) { display: none; }\n\n.mtc-root { display: flex; flex-direction: column; min-width: 0; }\n.mtc-row { display: flex; flex-direction: column; min-width: 0; }\n.mtc-row[data-state='running'] .mtc-title-row { position: relative; overflow: hidden; }\n.mtc-row[data-state='running'] .mtc-title-row::after {\n content: '';\n position: absolute;\n top: 0; bottom: 0; left: 0;\n width: 300px;\n background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--dsw-alias-bg-base) 60%, transparent) 55%, transparent 100%);\n animation: dsh-mtc-sweep 2.6s ease-out infinite;\n pointer-events: none;\n}\n@keyframes dsh-mtc-sweep {\n 0% { left: -300px; }\n 90%, 100% { left: 100%; }\n}\n\n.mtc-title { font-weight: 400; }\n.mtc-sep { flex: none; width: 2px; height: 2px; border-radius: 1px; margin: 0 8px; background: var(--dsw-alias-label-caption); }\n.mtc-summary {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-tertiary);\n}\n.mtc-summary-link {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n margin: 0; padding: 0; border: none; background: none; font: inherit; text-align: left;\n font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-secondary);\n text-decoration: underline; text-decoration-color: var(--dsw-alias-label-quaternary);\n text-underline-offset: 3px; cursor: pointer;\n}\n.mtc-summary-link:hover { color: var(--dsw-alias-label-primary); text-decoration-color: currentColor; }\n.mtc-summary-error { color: var(--dsw-alias-state-error-primary); }\n.mtc-summary-suffix { flex: none; margin-left: 4px; white-space: nowrap; font-size: 14px; line-height: 24px; color: var(--dsw-alias-label-tertiary); }\n\n.mtc-card-body { margin: 4px 0 4px 4px; min-width: 0; }\n.mtc-recovery { margin: 4px 0 4px 4px; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--dsw-font-xs-13); color: var(--dsw-alias-label-tertiary); }\n/* IN/OUT text card for calls without a card primitive (mirrors ToolRow). */\n.mtc-io-card {\n display: flex; flex-direction: column; min-width: 0;\n border: 1px solid var(--dsw-alias-border-l2); border-radius: 12px;\n background: var(--dsw-alias-bg-base);\n}\n.mtc-io-section { display: flex; gap: 10px; padding: 8px 12px; min-width: 0; }\n.mtc-io-label {\n flex: none; font-size: 11px; line-height: 16px; font-weight: 600;\n color: var(--dsw-alias-label-tertiary);\n}\n.mtc-io-text {\n flex: 1 1 auto; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere;\n font-size: 13px; line-height: 20px; color: var(--dsw-alias-label-secondary);\n}\n.mtc-io-text[data-error] { color: var(--dsw-alias-state-error-primary); }\n.mtc-io-divider { height: 1px; background: var(--dsw-alias-border-l2); }\n.mtc-inspect {\n display: inline-flex; align-self: flex-start; align-items: center; gap: 4px;\n margin: 4px 0 2px 4px; padding: 2px 8px;\n border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px;\n background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-secondary);\n font-size: 11px; line-height: 16px; cursor: pointer;\n opacity: 0; transition: opacity 100ms ease;\n}\n.mtc-root:hover .mtc-inspect, .mtc-inspect:focus-visible { opacity: 1; }\n.mtc-inspect:hover { background: var(--dsw-alias-interactive-bg-hover-solid); color: var(--dsw-alias-label-primary); }\n\n/* Compact child rows: each is the main row's tail structure \u2014 [sep dot][path].\n The dot/path columns are set at runtime by the component (it measures the\n main row's sep offset and sets the --mtc-sep-left custom property on the\n root), so this is only the pre-measure fallback.\n\n The .mtc-children-collapse wrapper animates the block's height with a\n grid-template-rows 0fr\u21941fr transition (children stay in the DOM while\n collapsing, so the slide is smooth instead of popping out). The vertical\n margin lives on the wrapper (not .mtc-children) so it doesn't leak past the\n 0fr row when collapsed. */\n.mtc-children-collapse {\n display: grid;\n grid-template-rows: 0fr;\n margin: 0;\n transition: grid-template-rows 200ms ease-out, margin 200ms ease-out;\n}\n.mtc-children-collapse[data-open] {\n grid-template-rows: 1fr;\n margin: 2px 0;\n}\n.mtc-children {\n display: flex; flex-direction: column; gap: 1px;\n margin: 0 0 0 var(--mtc-sep-left, 61px);\n min-width: 0; min-height: 0; overflow: hidden;\n opacity: 0;\n transition: opacity 150ms ease-out;\n}\n.mtc-children-collapse[data-open] .mtc-children {\n opacity: 1;\n transition: opacity 150ms ease-out 50ms;\n}\n.mtc-child { display: flex; flex-direction: column; min-width: 0; }\n.mtc-child-row {\n display: flex; align-items: center; gap: 0; min-width: 0; height: 20px;\n margin: 0; padding: 0; border: 0; border-radius: 4px; background: none;\n font: inherit; text-align: left; color: var(--dsw-alias-label-secondary); cursor: pointer;\n}\n.mtc-child-row:hover { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }\n.mtc-child-row[data-static] { cursor: default; }\n.mtc-child-row[data-static]:hover { background: none; color: var(--dsw-alias-label-secondary); }\n.mtc-child-row .mtc-sep { margin: 0 8px 0 0; }\n.mtc-child-path {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n font-size: 14px; line-height: 20px;\n}\n/* Read-family child paths are open-file links (sidebar preview), same affordance\n as the main row's summary link. */\n.mtc-child-path-link {\n flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n margin: 0; padding: 0; border: none; background: none; font: inherit; text-align: left;\n font-size: 14px; line-height: 20px; color: var(--dsw-alias-label-secondary);\n text-decoration: underline; text-decoration-color: var(--dsw-alias-label-quaternary);\n text-underline-offset: 3px; cursor: pointer;\n}\n.mtc-child-path-link:hover { color: var(--dsw-alias-label-primary); text-decoration-color: currentColor; }\n.mtc-child-state { flex: none; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }\n.mtc-child-state[data-error] { color: var(--dsw-alias-state-error-primary); }\n/* The expanded child card must not inherit the children block's sep indent:\n pull its left edge back to the main card body's column (root + 4px) so the\n card spans the card width instead of leaving a blank gutter on its left. */\n.mtc-child-body { margin: 2px 0 2px calc(4px - var(--mtc-sep-left, 61px)); min-width: 0; }\n\n.mtc-visually-hidden {\n position: absolute; width: 1px; height: 1px; overflow: hidden;\n clip: rect(0 0 0 0); white-space: nowrap;\n}\n";
|
|
18
18
|
/** Install the stylesheet and return its disposer. */
|
|
19
19
|
export declare function installStyles(): () => void;
|
package/lib/types/invariant.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Package invariant companion for dsh-merge-tool-calls. */
|
|
1
|
+
/** Package invariant companion for dsh-plugin-merge-tool-calls. */
|
|
2
2
|
import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants';
|
|
3
3
|
export declare const name = "merge-tool-calls-invariant";
|
|
4
4
|
export declare const inject: string[];
|