@huanlin/dsh-plugin-merge-tool-calls 0.2.2 → 0.4.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.
@@ -1,73 +1,77 @@
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';
19
- import type { ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client';
20
- import type { ToolCallViewProps } from '@deepseek-ai/dsh-client-ui-tool/client';
21
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
22
- import type { MergeToolCallsConfig } from '../types.ts';
23
- /** Locale seat and inject face of the merged row registration. */
24
- export type MergedToolRowProps = ToolCallViewProps & PropsLocale<'merge-tool-calls'> & {
25
- readonly cfg: MergeToolCallsConfig;
26
- };
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
- */
35
- export declare const RowCard: import("react").NamedExoticComponent<{
36
- toolName: string;
37
- block: ToolCallBlock;
38
- cwd: string | undefined;
39
- openFile: (path: string) => void;
40
- inspect: (() => void) | undefined;
41
- t: MergedToolRowProps["t"];
42
- /** Continuation-call count; 0 means a single-call row (no child rows). */
43
- mergedCount: number;
44
- /** Child rows for the merged run (all calls, including the first). */
45
- children?: ReactNode;
46
- }>;
47
- /**
48
- * One compact continuation row: the main row's tail structure ([sep dot][path]).
49
- * An expandable call toggles the inline content card on click (mirroring the
50
- * main row's whole-row disclosure); a read/write/edit-family path additionally
51
- * renders as an open-file link (the sidebar preview) that stops propagation,
52
- * exactly like the main row's summary link.
53
- */
54
- export declare const ChildRow: import("react").NamedExoticComponent<{
55
- toolName: string;
56
- block: ToolCallBlock;
57
- cwd: string | undefined;
58
- openFile: (path: string) => void;
59
- t: MergedToolRowProps["t"];
60
- }>;
61
- /**
62
- * The shadowed toolview: renders the merged run card for the run's first call,
63
- * nothing for continuation calls, and a plain single row when this call is not
64
- * a chat tool-call node.
65
- *
66
- * Child-row alignment is measured at runtime, not hardcoded: the main row's
67
- * separator dot sits after a variable-width title ("Read"/"Search"/"Bash"/…),
68
- * so its column depends on the rendered font. A layout effect measures the
69
- * dot's offset from the card root (once, plus on reflow via ResizeObserver)
70
- * and indents the children so their dots and paths land on the main row's
71
- * columns — no font/title constants to keep in sync.
72
- */
73
- export declare function MergedToolRow({ callId, toolName, block, cwd, openFile, inspect, t, cfg, useSession }: MergedToolRowProps): import("react").JSX.Element | null;
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. The
13
+ * card primitives' localized label props are built here from the plugin's own
14
+ * dictionary (the primitives are cordis-free and require complete labels).
15
+ *
16
+ * Everything here is a pure function of the chat snapshot + the frozen call
17
+ * slices (replay-deterministic); expand state is component-local view state.
18
+ * @module
19
+ */
20
+ import { type ReactNode } from 'react';
21
+ import type { ToolCallBlock } from '@deepseek-ai/dsh-client-ui-chat/client';
22
+ import type { ToolCallViewProps } from '@deepseek-ai/dsh-client-ui-tool/client';
23
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
24
+ import type { MergeToolCallsConfig } from '../types.ts';
25
+ /** Locale seat and inject face of the merged row registration. */
26
+ export type MergedToolRowProps = ToolCallViewProps & PropsLocale<'merge-tool-calls'> & {
27
+ readonly cfg: MergeToolCallsConfig;
28
+ };
29
+ /**
30
+ * The run's main card: the first call's chrome (variant title/icon + state)
31
+ * plus, for a single call, its expandable content card. For a merged run the
32
+ * main row's collapsed summary is the count (`Read · 5 Files`) and the
33
+ * expanded body is the child-rows block (passed in as `children`); the first
34
+ * call is rendered as the first child row so every file path lands on a child
35
+ * row, never on the main row.
36
+ */
37
+ export declare const RowCard: import("react").NamedExoticComponent<{
38
+ toolName: string;
39
+ block: ToolCallBlock;
40
+ cwd: string | undefined;
41
+ home: string | undefined;
42
+ openFile: (path: string) => void;
43
+ inspect: (() => void) | undefined;
44
+ t: MergedToolRowProps["t"];
45
+ /** Continuation-call count; 0 means a single-call row (no child rows). */
46
+ mergedCount: number;
47
+ /** Child rows for the merged run (all calls, including the first). */
48
+ children?: ReactNode;
49
+ }>;
50
+ /**
51
+ * One compact continuation row: the main row's tail structure ([sep dot][path]).
52
+ * An expandable call toggles the inline content card on click (mirroring the
53
+ * main row's whole-row disclosure); a read/write/edit-family path additionally
54
+ * renders as an open-file link (the sidebar preview) that stops propagation,
55
+ * exactly like the main row's summary link.
56
+ */
57
+ export declare const ChildRow: import("react").NamedExoticComponent<{
58
+ toolName: string;
59
+ block: ToolCallBlock;
60
+ cwd: string | undefined;
61
+ home: string | undefined;
62
+ openFile: (path: string) => void;
63
+ t: MergedToolRowProps["t"];
64
+ }>;
65
+ /**
66
+ * The shadowed toolview: renders the merged run card for the run's first call,
67
+ * nothing for continuation calls, and a plain single row when this call is not
68
+ * a chat tool-call node.
69
+ *
70
+ * Child-row alignment is measured at runtime, not hardcoded: the main row's
71
+ * separator dot sits after a variable-width title ("Read"/"Search"/"Bash"/…),
72
+ * so its column depends on the rendered font. A layout effect measures the
73
+ * dot's offset from the card root (once, plus on reflow via ResizeObserver)
74
+ * and indents the children so their dots and paths land on the main row's
75
+ * columns — no font/title constants to keep in sync.
76
+ */
77
+ export declare function MergedToolRow({ callId, toolName, block, cwd, home, openFile, inspect, t, cfg, useChat }: MergedToolRowProps): import("react").JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huanlin/dsh-plugin-merge-tool-calls",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -17,10 +17,6 @@
17
17
  "types": "./lib/types/index.d.ts",
18
18
  "import": "./lib/index.js"
19
19
  },
20
- "./invariant": {
21
- "types": "./lib/types/invariant.d.ts",
22
- "import": "./lib/invariant.js"
23
- },
24
20
  "./client": {
25
21
  "types": "./lib/types/client/index.d.ts",
26
22
  "default": "./lib/client.js"
@@ -38,9 +34,10 @@
38
34
  },
39
35
  "client": {
40
36
  "inject": [
41
- "@deepseek-ai/dsh-client-runtime",
42
37
  "@deepseek-ai/dsh-client-locale",
38
+ "@deepseek-ai/dsh-client-ui-renderer",
43
39
  "@deepseek-ai/dsh-client-ui-tool",
40
+ "@deepseek-ai/dsh-client-ui-chat",
44
41
  "@deepseek-ai/dsh-client-ui-slots",
45
42
  "@deepseek-ai/dsh-client-ui-primitives"
46
43
  ],
@@ -48,17 +45,18 @@
48
45
  }
49
46
  },
50
47
  "peerDependencies": {
51
- "cordis": "^4.0.0-rc.7",
48
+ "@deepseek-ai/cordis": "^4.0.1",
52
49
  "react": "^18.2.0",
53
50
  "schemastery": "^3.18.0",
54
- "@deepseek-ai/dsh-client-locale": "0.1.0-rc.6",
55
- "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.6",
56
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.6",
57
- "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.6",
58
- "@deepseek-ai/dsh-client-ui-tool": "0.1.0-rc.6"
51
+ "@deepseek-ai/dsh-client-locale": "^0.1.5-rc.1",
52
+ "@deepseek-ai/dsh-client-ui-chat": "^0.1.5-rc.1",
53
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-rc.1",
54
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.5-rc.1",
55
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.5-rc.1",
56
+ "@deepseek-ai/dsh-client-ui-tool": "^0.1.5-rc.1"
59
57
  },
60
58
  "peerDependenciesMeta": {
61
- "cordis": {
59
+ "@deepseek-ai/cordis": {
62
60
  "optional": true
63
61
  },
64
62
  "react": {
@@ -70,12 +68,15 @@
70
68
  "@deepseek-ai/dsh-client-locale": {
71
69
  "optional": true
72
70
  },
73
- "@deepseek-ai/dsh-client-runtime": {
71
+ "@deepseek-ai/dsh-client-ui-chat": {
74
72
  "optional": true
75
73
  },
76
74
  "@deepseek-ai/dsh-client-ui-primitives": {
77
75
  "optional": true
78
76
  },
77
+ "@deepseek-ai/dsh-client-ui-renderer": {
78
+ "optional": true
79
+ },
79
80
  "@deepseek-ai/dsh-client-ui-slots": {
80
81
  "optional": true
81
82
  },
@@ -84,17 +85,9 @@
84
85
  }
85
86
  },
86
87
  "devDependencies": {
87
- "@deepseek-ai/dsh-client-locale": "0.1.0-rc.6",
88
- "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.6",
89
- "@deepseek-ai/dsh-client-ui-conversation": "0.1.0-rc.6",
90
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.6",
91
- "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.6",
92
- "@deepseek-ai/dsh-client-ui-tool": "0.1.0-rc.6",
93
- "@deepseek-ai/dsh-invariants": "0.1.0-rc.6",
94
88
  "@deepseek-ai/schemastery": "^3.18.1",
95
89
  "@types/node": "^22.20.1",
96
90
  "@types/react": "~18.3.31",
97
- "cordis": "^4.0.0-rc.7",
98
91
  "jsdom": "^26.0.0",
99
92
  "react": "^18.2.0",
100
93
  "react-dom": "^18.2.0",
package/lib/invariant.js DELETED
@@ -1,11 +0,0 @@
1
- //#region src/invariant.ts
2
- const PACKAGE_NAME = "@huanlin/dsh-plugin-merge-tool-calls";
3
- const name = "merge-tool-calls-invariant";
4
- const inject = ["invariants"];
5
- /** No runtime invariant: this package contributes client-only slot entries. */
6
- const install = () => {};
7
- /** Register package ownership with the invariant service. */
8
- const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
9
-
10
- //#endregion
11
- export { apply, inject, name };
@@ -1,12 +0,0 @@
1
- /** Package invariant companion for dsh-plugin-merge-tool-calls. */
2
- import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants';
3
- export declare const name = "merge-tool-calls-invariant";
4
- export declare const inject: string[];
5
- interface InvariantContext {
6
- invariants: {
7
- register: (name: string, installer: InvariantInstaller) => () => void;
8
- };
9
- }
10
- /** Register package ownership with the invariant service. */
11
- export declare const apply: (ctx: InvariantContext) => Promise<() => void>;
12
- export {};