@deepseek-ai/dsh-client-ui-tool 0.1.1-rc.2 → 0.1.2-alpha.3
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.i18n.yaml +2 -2
- package/README.md +79 -17
- package/README.zh.md +80 -18
- package/lib/client.js +898 -432
- package/lib/types/client/apply.d.ts +3 -2
- package/lib/types/client/contract/slots.d.ts +13 -8
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/tool/ToolCallTree.d.ts +1 -1
- package/lib/types/client/tool/ToolDetails.d.ts +3 -3
- package/lib/types/client/tool/components/AskQuestionCard.d.ts +11 -0
- package/lib/types/client/tool/components/ToolRow.d.ts +10 -34
- package/lib/types/client/tool/models/ask-question-card-model.d.ts +22 -0
- package/lib/types/client/tool/models/diff-card-model.d.ts +7 -28
- package/lib/types/client/tool/models/primitive-labels.d.ts +36 -0
- package/lib/types/client/tool/models/raw-tool-call.d.ts +27 -0
- package/lib/types/client/tool/models/read-card-model.d.ts +4 -19
- package/lib/types/client/tool/models/search-card-model.d.ts +9 -75
- package/lib/types/client/tool/models/terminal-card-model.d.ts +46 -36
- package/lib/types/client/tool/models/tool-call-model.d.ts +31 -7
- package/lib/types/client/tool/models/web-card-model.d.ts +9 -34
- package/lib/types/client/tool/toolviews/ask-question-row.d.ts +2 -11
- package/lib/types/client/tool/toolviews/bash-sample.d.ts +2 -14
- package/lib/types/client/tool/toolviews/file-mutation-row.d.ts +2 -17
- package/lib/types/client/tool/toolviews/read-row.d.ts +2 -12
- package/lib/types/client/tool/toolviews/search-row.d.ts +2 -19
- package/lib/types/client/tool/toolviews/todo-row.d.ts +2 -13
- package/lib/types/client/tool/toolviews/web-row.d.ts +2 -14
- package/package.json +17 -19
|
@@ -1,39 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure derivation of the web-card props from a frozen call slice: the
|
|
3
|
-
* `card:'web'` render intent the `web_search`/`web_fetch` tools declare at
|
|
4
|
-
* result time arrives on the snapshot as `resultView`, and this is the one
|
|
5
|
-
* place that turns it into what {@link WebBlock} draws. Both conversation
|
|
6
|
-
* render sites (the chat tool row's resident/expanded body and the details
|
|
7
|
-
* panel's Output section) call this, so the sources and fetch summary they
|
|
8
|
-
* show are derived once.
|
|
9
|
-
*
|
|
10
|
-
* The web card is result-only by contract: those tools keep a generic pending
|
|
11
|
-
* call view, so there is nothing to derive while the call is still running and
|
|
12
|
-
* a running call always takes the generic path.
|
|
13
|
-
* @module
|
|
14
|
-
*/
|
|
1
|
+
/** Pure web-card derivation from raw web result metadata. @module */
|
|
15
2
|
import type { WebBlockProps } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
16
3
|
import type { ToolCallBlock } from './tool-call-model.ts';
|
|
4
|
+
type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
|
|
5
|
+
/** Web-card data owned by the presenter; render sites add localized labels and classes. */
|
|
6
|
+
export type WebCardModelProps = DistributiveOmit<WebBlockProps, 'labels' | 'className'>;
|
|
17
7
|
/**
|
|
18
|
-
* Derive
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* The result side supplies the whole card: the sources and answer for a
|
|
22
|
-
* `search`, the URL and status for a `fetch`. Cases producing null, all of
|
|
23
|
-
* them the documented generic-card default:
|
|
24
|
-
*
|
|
25
|
-
* - A running call (no `resultView` yet): the web tools keep a generic pending
|
|
26
|
-
* card, so nothing web-shaped exists until the call settles.
|
|
27
|
-
* - A settled call whose result view is not a web card — including a `card`
|
|
28
|
-
* value this UI version does not know, which arrives over the wire and so
|
|
29
|
-
* cannot be trusted to be one of the compiled variants, and a generic result
|
|
30
|
-
* view (a web tool's error path returns the generic card, whose text the
|
|
31
|
-
* generic path preserves).
|
|
32
|
-
* - A web card whose `kind` this UI version does not know (a newer host's
|
|
33
|
-
* value): the wire cannot be trusted to be `search` or `fetch`, so it takes
|
|
34
|
-
* the generic path rather than rendering as a malformed fetch.
|
|
35
|
-
* @param block - RunningToolCall or ToolResultNode off the snapshot caches.
|
|
36
|
-
* @returns the web-card props, or null for the generic path.
|
|
8
|
+
* Derive a settled root web-search or web-fetch card from persisted metadata.
|
|
9
|
+
* @param block - running or settled Tool block.
|
|
10
|
+
* @returns web-card props, or null for the generic path.
|
|
37
11
|
*/
|
|
38
|
-
export declare function webCardModel(block: ToolCallBlock):
|
|
12
|
+
export declare function webCardModel(block: ToolCallBlock): WebCardModelProps | null;
|
|
13
|
+
export {};
|
|
39
14
|
//# sourceMappingURL=web-card-model.d.ts.map
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
3
|
import type { ToolCallViewProps } from '../../contract/slots.ts';
|
|
4
|
-
/** Full row props: the toolview runtime share plus the standard locale seat. */
|
|
5
4
|
type AskQuestionRowProps = ToolCallViewProps & PropsLocale<'conversation'>;
|
|
6
|
-
/**
|
|
7
|
-
* Input/Output sections, ToolRow's unified expand). */
|
|
5
|
+
/** Summarizes a pending, answered, cancelled, or interrupted question set. */
|
|
8
6
|
export declare function AskQuestionRow({ toolName, block, inspect, t }: AskQuestionRowProps): import("react").JSX.Element;
|
|
9
|
-
/**
|
|
10
|
-
* The ask-question row as a plain registrant plugin following the chat
|
|
11
|
-
* toolview declaration across independent activation and reload lifetimes.
|
|
12
|
-
*/
|
|
7
|
+
/** Registers the ask-user-question conversation row. */
|
|
13
8
|
export declare const askQuestionToolview: {
|
|
14
9
|
name: string;
|
|
15
10
|
inject: string[];
|
|
16
|
-
/**
|
|
17
|
-
* Register the ask-question row into the Tool-owned keyed view slot.
|
|
18
|
-
* @param ctx - registrant context (disposal rides ctx.effect inside slots.register).
|
|
19
|
-
*/
|
|
20
11
|
apply(ctx: Context): void;
|
|
21
12
|
};
|
|
22
13
|
export {};
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
3
|
import type { ToolCallViewProps } from '../../contract/slots.ts';
|
|
4
|
-
/** Bash row props: the toolview runtime share plus the standard locale seat. */
|
|
5
4
|
type BashRowProps = ToolCallViewProps & PropsLocale<'conversation'>;
|
|
6
|
-
/**
|
|
7
|
-
* Bash row: icon + Bash · {description} in the shared ToolRow chrome, the
|
|
8
|
-
* whole row toggling the command's terminal or generic error card (ToolRow's unified
|
|
9
|
-
* expand interaction, replicated locally per the registrant posture).
|
|
10
|
-
*/
|
|
5
|
+
/** Renders expandable Bash output with an accessible lifecycle label. */
|
|
11
6
|
export declare function BashRow({ toolName, block, sessionId, useSessions, inspect, t }: BashRowProps): import("react").JSX.Element;
|
|
12
|
-
/**
|
|
13
|
-
* The sample as a plain registrant plugin. Slot injection follows the chat
|
|
14
|
-
* toolview declaration across independent activation and reload lifetimes.
|
|
15
|
-
*/
|
|
7
|
+
/** Registers the standalone Bash conversation-row sample. */
|
|
16
8
|
export declare const bashToolviewSample: {
|
|
17
9
|
name: string;
|
|
18
10
|
inject: string[];
|
|
19
|
-
/**
|
|
20
|
-
* Register the bash row into the Tool-owned keyed view slot.
|
|
21
|
-
* @param ctx - registrant context (disposal rides ctx.effect inside slots.register).
|
|
22
|
-
*/
|
|
23
11
|
apply(ctx: Context): void;
|
|
24
12
|
};
|
|
25
13
|
export {};
|
|
@@ -1,30 +1,15 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
3
|
import type { ToolCallViewProps } from '../../contract/slots.ts';
|
|
4
|
-
/** Full row props: the toolview runtime share plus the standard locale seat. */
|
|
5
4
|
type FileMutationRowProps = ToolCallViewProps & PropsLocale<'conversation'>;
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
8
|
-
* with the applied diff as the row's collapsed-by-default card body. The
|
|
9
|
-
* summary is a path link (a file tool's interaction); the host's `openFile`
|
|
10
|
-
* resolves it against the session cwd, so this passes the tool's own path
|
|
11
|
-
* verbatim. An errored mutation has no diff card, so ToolRow surfaces the
|
|
12
|
-
* model-facing error text through its Output section and its first line in the
|
|
13
|
-
* collapsed summary instead.
|
|
6
|
+
* Lets users expand an applied file diff and open the reported path.
|
|
14
7
|
*/
|
|
15
8
|
export declare function FileMutationRow({ toolName, block, cwd, home, openFile, inspect, t }: FileMutationRowProps): import("react").JSX.Element;
|
|
16
|
-
/**
|
|
17
|
-
* The file-mutation rows as a plain registrant plugin following the chat
|
|
18
|
-
* toolview declaration across independent activation and reload lifetimes.
|
|
19
|
-
*/
|
|
9
|
+
/** Registers the edit and write conversation rows. */
|
|
20
10
|
export declare const fileMutationToolview: {
|
|
21
11
|
name: string;
|
|
22
12
|
inject: string[];
|
|
23
|
-
/**
|
|
24
|
-
* Register the file-mutation row into the Tool-owned keyed view slot
|
|
25
|
-
* under both mutation tool names.
|
|
26
|
-
* @param ctx - registrant context (disposal rides ctx.effect inside slots.register).
|
|
27
|
-
*/
|
|
28
13
|
apply(ctx: Context): void;
|
|
29
14
|
};
|
|
30
15
|
export {};
|
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
3
|
import type { ToolCallViewProps } from '../../contract/slots.ts';
|
|
4
|
-
/** Full row props: the toolview runtime share plus the standard locale seat. */
|
|
5
4
|
type ReadRowProps = ToolCallViewProps & PropsLocale<'conversation'>;
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
8
|
-
* read card as the row's collapsed-by-default card body. The summary path is an
|
|
9
|
-
* openable host link when the row names a single file.
|
|
6
|
+
* Lets users expand a completed read result and open its reported path.
|
|
10
7
|
*/
|
|
11
8
|
export declare function ReadRow({ toolName, block, cwd, home, openFile, inspect, t }: ReadRowProps): import("react").JSX.Element;
|
|
12
|
-
/**
|
|
13
|
-
* The read row as a plain registrant plugin following the atomic Tool-view
|
|
14
|
-
* declaration across independent activation and reload lifetimes.
|
|
15
|
-
*/
|
|
9
|
+
/** Registers the read tool's conversation row. */
|
|
16
10
|
export declare const readToolview: {
|
|
17
11
|
name: string;
|
|
18
12
|
inject: string[];
|
|
19
|
-
/**
|
|
20
|
-
* Register the read row into the Tool-owned keyed view slot.
|
|
21
|
-
* @param ctx - registrant context (disposal rides ctx.effect inside slots.register).
|
|
22
|
-
*/
|
|
23
13
|
apply(ctx: Context): void;
|
|
24
14
|
};
|
|
25
15
|
export {};
|
|
@@ -1,30 +1,13 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
3
|
import type { ToolCallViewProps } from '../../contract/slots.ts';
|
|
4
|
-
/** Full row props: the toolview runtime share plus the standard locale seat. */
|
|
5
4
|
type SearchRowProps = ToolCallViewProps & PropsLocale<'conversation'>;
|
|
6
|
-
/**
|
|
7
|
-
* Search row: icon + Grep/Glob · {summary} in the shared ToolRow chrome, with the
|
|
8
|
-
* completed search's card as the row's collapsed-by-default card body (a capped
|
|
9
|
-
* search's recovery footer rides below it, inside ToolRow). Registered under
|
|
10
|
-
* both `grep` and `glob`; the derived model's `kind` decides the card shape. A
|
|
11
|
-
* settled call with no search card surfaces its model-facing text through
|
|
12
|
-
* ToolRow's Output section, since the keyed SearchRow owns this render slot.
|
|
13
|
-
*/
|
|
5
|
+
/** Lets users expand grep or glob results and recover capped searches. */
|
|
14
6
|
export declare function SearchRow({ toolName, block, inspect, t }: SearchRowProps): import("react").JSX.Element;
|
|
15
|
-
/**
|
|
16
|
-
* The search view follows the atomic Tool-view declaration across activation
|
|
17
|
-
* and reload. One component registers under both keys because `grep` and
|
|
18
|
-
* `glob` are the same visual object discriminated by the result view's `kind`.
|
|
19
|
-
*/
|
|
7
|
+
/** Registers the grep and glob conversation rows. */
|
|
20
8
|
export declare const searchToolview: {
|
|
21
9
|
name: string;
|
|
22
10
|
inject: string[];
|
|
23
|
-
/**
|
|
24
|
-
* Register the search row into the Tool-owned keyed view slot under both
|
|
25
|
-
* the `grep` and `glob` tool names.
|
|
26
|
-
* @param ctx - registrant context (disposal rides ctx.effect inside slots.register).
|
|
27
|
-
*/
|
|
28
11
|
apply(ctx: Context): void;
|
|
29
12
|
};
|
|
30
13
|
export {};
|
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
3
|
import type { ToolCallViewProps } from '../../contract/slots.ts';
|
|
4
|
-
/** Todo row props: the toolview runtime share plus the standard locale seat. */
|
|
5
4
|
type TodoRowProps = ToolCallViewProps & PropsLocale<'conversation'>;
|
|
6
|
-
/**
|
|
7
|
-
* sections, ToolRow's unified expand). Non-ok execution states keep the
|
|
8
|
-
* shared row's dot semantics — a cancelled call wrote no todo/write, so it
|
|
9
|
-
* must not read as a completed update. */
|
|
5
|
+
/** Summarizes a plan update without presenting a cancelled call as completed. */
|
|
10
6
|
export declare function TodoRow({ toolName, block, inspect, t }: TodoRowProps): import("react").JSX.Element;
|
|
11
|
-
/**
|
|
12
|
-
* The todo row as a plain registrant plugin following the atomic Tool-view
|
|
13
|
-
* declaration across independent activation and reload lifetimes.
|
|
14
|
-
*/
|
|
7
|
+
/** Registers the todo conversation row. */
|
|
15
8
|
export declare const todoToolview: {
|
|
16
9
|
name: string;
|
|
17
10
|
inject: string[];
|
|
18
|
-
/**
|
|
19
|
-
* Register the todo row into the Tool-owned keyed view slot.
|
|
20
|
-
* @param ctx - registrant context (disposal rides ctx.effect inside slots.register).
|
|
21
|
-
*/
|
|
22
11
|
apply(ctx: Context): void;
|
|
23
12
|
};
|
|
24
13
|
export {};
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
3
|
import type { ToolCallViewProps } from '../../contract/slots.ts';
|
|
4
|
-
/** Full row props: the toolview runtime share plus the standard locale seat. */
|
|
5
4
|
type WebRowProps = ToolCallViewProps & PropsLocale<'conversation'>;
|
|
6
|
-
/**
|
|
7
|
-
* Web row: icon + Search/Fetch · {summary} in the shared ToolRow chrome, with
|
|
8
|
-
* the completed retrieval's web card as the row's collapsed-by-default card
|
|
9
|
-
* body. The row discriminates on `toolName` only to pick its icon and title.
|
|
10
|
-
*/
|
|
5
|
+
/** Lets users expand a completed web search or fetch result. */
|
|
11
6
|
export declare function WebRow({ toolName, block, inspect, t }: WebRowProps): import("react").JSX.Element;
|
|
12
|
-
/**
|
|
13
|
-
* The web rows follow the atomic Tool-view declaration across activation and
|
|
14
|
-
* reload. One WebRow component registers under both web tool names.
|
|
15
|
-
*/
|
|
7
|
+
/** Registers the web search and fetch conversation rows. */
|
|
16
8
|
export declare const webToolview: {
|
|
17
9
|
name: string;
|
|
18
10
|
inject: string[];
|
|
19
|
-
/**
|
|
20
|
-
* Register the web row under both web tool names' keyed toolview holes.
|
|
21
|
-
* @param ctx - registrant context (disposal rides ctx.effect inside slots.register).
|
|
22
|
-
*/
|
|
23
11
|
apply(ctx: Context): void;
|
|
24
12
|
};
|
|
25
13
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-tool",
|
|
3
3
|
"description": "Client Tool call-tree renderer and keyed per-tool presentation slot",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2-alpha.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"dsh": {
|
|
33
33
|
"client": {
|
|
34
34
|
"inject": [
|
|
35
|
+
"@deepseek-ai/dsh-api-workspace-controller",
|
|
35
36
|
"@deepseek-ai/dsh-client-connection",
|
|
36
|
-
"@deepseek-ai/dsh-client-runtime",
|
|
37
37
|
"@deepseek-ai/dsh-client-locale",
|
|
38
38
|
"@deepseek-ai/dsh-client-ui-conversation"
|
|
39
39
|
],
|
|
@@ -45,29 +45,27 @@
|
|
|
45
45
|
"clsx": "^2.0.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
49
|
-
"@deepseek-ai/dsh-api-remotes": "^0.1.1-rc.2",
|
|
50
|
-
"@deepseek-ai/dsh-client-connection": "^0.1.1-rc.2",
|
|
51
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.1-rc.2",
|
|
52
|
-
"@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.2",
|
|
53
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.1-rc.2",
|
|
54
|
-
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2"
|
|
48
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
55
49
|
},
|
|
56
50
|
"devDependencies": {
|
|
57
51
|
"@testing-library/react": "^16.1.0",
|
|
58
52
|
"@types/react": "~18.3.1",
|
|
59
53
|
"react": "^18.2.0",
|
|
60
54
|
"react-dom": "^18.2.0",
|
|
61
|
-
"@deepseek-ai/dsh-api-remotes": "^0.1.
|
|
62
|
-
"@deepseek-ai/
|
|
63
|
-
"@deepseek-ai/dsh-client-
|
|
64
|
-
"@deepseek-ai/dsh-client-
|
|
65
|
-
"@deepseek-ai/dsh-client-
|
|
66
|
-
"@deepseek-ai/
|
|
67
|
-
"@deepseek-ai/dsh-client-ui-
|
|
68
|
-
"@deepseek-ai/dsh-client-ui-
|
|
69
|
-
"@deepseek-ai/dsh-
|
|
70
|
-
"@deepseek-ai/dsh-client-ui-
|
|
55
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.2-alpha.3",
|
|
56
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.2-alpha.3",
|
|
57
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.2-alpha.3",
|
|
58
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.2-alpha.3",
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.2-alpha.3",
|
|
60
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-alpha.3",
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.2-alpha.3",
|
|
63
|
+
"@deepseek-ai/dsh-api-workspace-controller": "^0.1.2-alpha.3",
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-alpha.3",
|
|
65
|
+
"@deepseek-ai/dsh-client-ui-chat": "^0.1.2-alpha.3",
|
|
66
|
+
"@deepseek-ai/dsh-client-ui-session": "^0.1.2-alpha.3",
|
|
67
|
+
"@deepseek-ai/dsh-util-workspace-path": "^0.1.2-alpha.3",
|
|
68
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3"
|
|
71
69
|
},
|
|
72
70
|
"files": [
|
|
73
71
|
"lib/index.js",
|