@deepseek-ai/dsh-client-ui-tool 0.2.0-rc.1 → 0.2.1-alpha.1

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,8 +1,9 @@
1
1
  /** Tool UI slot declarations and their composed component props. */
2
- import type { HostObservable, InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime, SlotHookFactory } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { HostObservable, InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime, SessionIdOf } from '@deepseek-ai/dsh-client-ui-slots';
3
3
  import type { RemoteHostFacts } from '@deepseek-ai/dsh-api-remotes/client';
4
- import type { AssistantChatData, OpenFileOptions, PreparingToolCall, StartedToolCall, ToolResultNode, UseDisclosure } from '@deepseek-ai/dsh-client-ui-chat/client';
4
+ import type { OpenFileOptions, PreparingToolCall, StartedToolCall, ToolResultNode, UseDisclosure } from '@deepseek-ai/dsh-client-ui-chat/client';
5
5
  import type { MessageImageLoader, MessageImageSource } from '@deepseek-ai/dsh-client-ui-conversation/client';
6
+ import type { AskUserQuestionAnswerItem, AskUserQuestionItem } from '@deepseek-ai/dsh-user-questions/types';
6
7
  declare module '@deepseek-ai/dsh-client-ui-slots' {
7
8
  interface SlotMap {
8
9
  /**
@@ -11,16 +12,14 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
11
12
  * `key: '<tool name>'`; a typo never renders.
12
13
  *
13
14
  * Registering an occupied key replaces its view; unclaimed keys use the
14
- * generic row. The owner supplies the call identity and frozen running
15
- * or settled node through explicit phase props. Preparing blocks have no dispatched
16
- * arguments; useToolCallArgumentsPartial optionally subscribes to their raw prefix.
15
+ * generic row. The owner supplies the call identity and running
16
+ * or settled node through explicit phase props. Every stage supplies
17
+ * `name` and a lazy `args` view; preparing arguments may be incomplete.
17
18
  */
18
19
  'tool.call.toolview': {
19
20
  kind: 'keyed';
20
21
  scope: 'session';
21
22
  owner: ToolCallOwnerProps;
22
- hookContext: ToolCallHookContext;
23
- inject: ToolCallInjected;
24
23
  };
25
24
  /**
26
25
  * Durable images of a settled image-bearing Tool call, rendered through
@@ -42,20 +41,6 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
42
41
  };
43
42
  }
44
43
  }
45
- /** Subscribe to this preparing call's raw argument prefix; other phases return an empty string. */
46
- export type UseToolCallArgumentsPartial = () => string;
47
- /** Call-local sources supplied by the Tool tree to the slot's Hook binding. */
48
- export interface ToolCallHookContext {
49
- readonly callId: string;
50
- /** This call's Step source, present only while preparing. */
51
- readonly assistant: HostObservable<Readonly<AssistantChatData> | undefined> | undefined;
52
- }
53
- /** Framework-bound subscriptions available to atomic Tool views on demand. */
54
- export interface ToolCallInjected {
55
- hooks: {
56
- toolCallArgumentsPartial: SlotHookFactory<'tool.call.toolview', UseToolCallArgumentsPartial>;
57
- };
58
- }
59
44
  /** Owner currency of the Tool image gallery slot: references plus the loader. */
60
45
  export interface ToolImagesOwnerProps {
61
46
  /** Durable references or submission-echo previews in result order. */
@@ -103,6 +88,50 @@ export type ToolCallViewProps = PropsRuntime<'tool.call.toolview'>;
103
88
  export type StartedToolCallViewProps = Exclude<ToolCallViewProps, {
104
89
  readonly phase: 'preparing';
105
90
  }>;
91
+ /**
92
+ * One settled `ask_user_question` call as its transcript row read it. The row
93
+ * reads the questions from the recorded call JSON, and the answers from
94
+ * whichever recorded them: its own result when the answer arrived in time, or
95
+ * the `userQuestions` projection when a late reply settled the call.
96
+ */
97
+ export interface UserQuestionRecord {
98
+ /** The call's questions, with the option lists the panel renders. */
99
+ readonly questions: readonly AskUserQuestionItem[];
100
+ /** The recorded answer batch; an item with no selection and no custom text was skipped. */
101
+ readonly answers: readonly AskUserQuestionAnswerItem[];
102
+ }
103
+ /**
104
+ * Optional answer-panel provider consumed by the ask-question row. A timed
105
+ * `ask_user_question` call stays answerable after its result is recorded, and
106
+ * its panel can be closed, so the transcript row is the way back to it. A
107
+ * composition without a question UI has no panel to show.
108
+ */
109
+ export interface UserQuestionPanels {
110
+ /**
111
+ * Put one call's answer panel back in the composer, ahead of any other
112
+ * pending question.
113
+ * @param sessionId - Session the call belongs to.
114
+ * @param callId - `ask_user_question` call whose panel to show.
115
+ * @returns whether a panel for that call was there to show.
116
+ */
117
+ reveal(sessionId: SessionIdOf, callId: string): boolean;
118
+ /**
119
+ * Show one settled call's recorded answers as a read-only panel, ahead of
120
+ * any other pending question. Closing that panel drops it for good; the row
121
+ * builds it again from the same record.
122
+ * @param sessionId - Session the call belongs to.
123
+ * @param callId - `ask_user_question` call whose record to show.
124
+ * @param record - the call's questions and recorded answers.
125
+ * @returns whether the panel was shown.
126
+ */
127
+ review(sessionId: SessionIdOf, callId: string, record: UserQuestionRecord): boolean;
128
+ }
129
+ declare module '@deepseek-ai/cordis' {
130
+ interface Context {
131
+ /** Optional user-question answer-panel provider. */
132
+ userQuestionPanels: UserQuestionPanels;
133
+ }
134
+ }
106
135
  /** Injected Host description for POSIX home-path display. */
107
136
  export type ToolHostInfoInjected = {
108
137
  hooks: {
@@ -1,4 +1,4 @@
1
1
  /** Browser Tool plugin: whole-call composition and keyed atomic Tool views. */
2
2
  export { apply, inject } from './apply.ts';
3
- export type { StartedToolCallViewProps, ToolCallCommonProps, ToolCallOwnerProps, ToolCallPhaseProps, ToolCallViewProps, ToolCallHookContext, ToolCallInjected, ToolHostInfoInjected, ToolTreeProps, UseToolCallArgumentsPartial, } from './contract/slots.ts';
3
+ export type { StartedToolCallViewProps, ToolCallCommonProps, ToolCallOwnerProps, ToolCallPhaseProps, ToolCallViewProps, ToolHostInfoInjected, ToolTreeProps, UserQuestionPanels, UserQuestionRecord, } from './contract/slots.ts';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { ToolRowProps } from './ToolRow.tsx';
2
+ type QuestionToolRowProps = Pick<ToolRowProps, 'useDisclosure' | 't' | 'summary' | 'bodyRaw' | 'output' | 'askQuestion' | 'state' | 'inspect'> & {
3
+ readonly openPanel: () => boolean;
4
+ readonly panelLabel: string;
5
+ };
6
+ /**
7
+ * Render a question with its answer-panel entry point.
8
+ * @param props - Question transcript, panel action, and disclosure state.
9
+ * @returns The question's summary and optional expanded record.
10
+ */
11
+ export declare function QuestionToolRow({ useDisclosure, t, summary, bodyRaw, output, askQuestion, state, inspect, openPanel, panelLabel, }: QuestionToolRowProps): import("react").JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=QuestionToolRow.d.ts.map
@@ -23,10 +23,9 @@ export interface ToolRowProps {
23
23
  summary: string;
24
24
  /**
25
25
  * Trailing summary fragment rendered outside the ellipsized summary text, so
26
- * a narrow row clips the summary before this. For a fragment whose whole
27
- * value is surviving that clip — the todo row's parallel-active count.
28
- * null/absent = the summary is the whole collapsed content. Dropped on an
29
- * error row, whose collapsed summary is the failure line instead.
26
+ * a narrow row clips the summary before this. Appears before diff totals
27
+ * when both are present. null/absent omits this fragment. Error and stopped
28
+ * rows omit both the suffix and diff totals.
30
29
  */
31
30
  summarySuffix?: string | null | undefined;
32
31
  /** Original argument JSON formatted only while the row is expanded. */
@@ -39,6 +38,7 @@ export interface ToolRowProps {
39
38
  errorSummary?: string | null | undefined;
40
39
  /** Terminal card; card fields are mutually exclusive and replace text sections. */
41
40
  terminal?: TerminalCardModel | null | undefined;
41
+ /** Diff card with inline totals colored on header hover and while expanded. */
42
42
  diff?: DiffCardModel | null | undefined;
43
43
  read?: ReadCardModel | null | undefined;
44
44
  /**
@@ -18,11 +18,4 @@ export declare function parsedToolCall(block: ToolCallBlock): ParsedToolCall | n
18
18
  * @returns its text, or undefined for any other content layout.
19
19
  */
20
20
  export declare function singleResultText(block: ToolResultNode): string | undefined;
21
- /**
22
- * Validate the optional escalation pair shared by first-party shell and file
23
- * mutation tools.
24
- * @param args - parsed open-root Tool arguments.
25
- * @returns whether the declared escalation fields form a valid pair.
26
- */
27
- export declare function validEscalationFields(args: Record<string, unknown>): boolean;
28
21
  //# sourceMappingURL=raw-tool-call.d.ts.map
@@ -48,8 +48,9 @@ export interface ToolRowModel {
48
48
  summary: string;
49
49
  /**
50
50
  * Filesystem path from args (`path` / `file_path`) when the row is a file
51
- * tool; absent for URL reads and non-file tools. The chat view resolves
52
- * relative values against the session cwd before opening.
51
+ * tool; absent for URL reads and non-file tools. A `file_path` argument
52
+ * supplies it at every stage once its string is complete. The chat view
53
+ * resolves relative values against the session cwd before opening.
53
54
  */
54
55
  filePath: string | undefined;
55
56
  /** Original argument JSON retained for expansion-time body formatting. */
@@ -1,9 +1,25 @@
1
1
  import type { Context } from '@deepseek-ai/cordis';
2
- import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
3
- import type { ToolCallViewProps } from '../../contract/slots.ts';
4
- type AskQuestionRowProps = ToolCallViewProps & PropsLocale<'conversation'>;
2
+ import type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
3
+ import type { ToolCallViewProps, UserQuestionRecord } from '../../contract/slots.ts';
4
+ /** Injected panel verbs for the row's own Session, filled by the optional panel provider. */
5
+ interface AskQuestionPanelInjected {
6
+ /**
7
+ * Show one call's answer panel in the composer.
8
+ * @param callId - the row's own `ask_user_question` call.
9
+ * @returns whether a panel for that call was there to show.
10
+ */
11
+ revealPanel: (callId: string) => boolean;
12
+ /**
13
+ * Show one settled call's recorded answers as a read-only panel.
14
+ * @param callId - the row's own `ask_user_question` call.
15
+ * @param record - the call's questions and recorded answers, read from this row.
16
+ * @returns whether a panel provider was there to show it.
17
+ */
18
+ reviewPanel: (callId: string, record: UserQuestionRecord) => boolean;
19
+ }
20
+ type AskQuestionRowProps = ToolCallViewProps & PropsLocale<'conversation'> & InjectFace<AskQuestionPanelInjected>;
5
21
  /** Summarizes a pending, answered, cancelled, or interrupted question set. */
6
- export declare function AskQuestionRow({ toolName, block, inspect, useDisclosure, t }: AskQuestionRowProps): import("react").JSX.Element;
22
+ export declare function AskQuestionRow({ callId, toolName, block, inspect, useDisclosure, useProjection, revealPanel, reviewPanel, t, }: AskQuestionRowProps): import("react").JSX.Element;
7
23
  /** Registers the ask-user-question conversation row. */
8
24
  export declare const askQuestionToolview: {
9
25
  name: string;
@@ -3,11 +3,12 @@ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
3
3
  import type { ToolCallViewProps } from '../../contract/slots.ts';
4
4
  type BashRowProps = ToolCallViewProps & PropsLocale<'conversation'>;
5
5
  /**
6
- * Render expandable Bash output with an accessible lifecycle label.
6
+ * Render expandable Bash output with an accessible lifecycle label. While the
7
+ * call is preparing the row shows the description streamed so far and cannot expand.
7
8
  * @param props - tool call, Session sources, locale, and inspection callback.
8
9
  * @returns the Bash output row.
9
10
  */
10
- export declare const BashRow: import("react").MemoExoticComponent<(props: BashRowProps) => import("react").JSX.Element>;
11
+ export declare const BashRow: import("react").MemoExoticComponent<({ toolName, block, sessionId, useSessions, inspect, useDisclosure, t }: BashRowProps) => import("react").JSX.Element>;
11
12
  /** Registers the standalone Bash conversation-row sample. */
12
13
  export declare const bashToolviewSample: {
13
14
  name: string;
@@ -3,9 +3,10 @@ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
3
3
  import type { ToolCallViewProps } from '../../contract/slots.ts';
4
4
  type FileMutationRowProps = ToolCallViewProps & PropsLocale<'conversation'>;
5
5
  /**
6
- * Lets users expand an applied file diff and open the reported path.
6
+ * Shows the path and decoded input size through preparation, execution, and
7
+ * settlement, with the applied diff available once the call settles.
7
8
  */
8
- export declare function FileMutationRow(props: FileMutationRowProps): import("react").JSX.Element;
9
+ export declare function FileMutationRow({ toolName, block, cwd, home, openFile, inspect, useDisclosure, t }: FileMutationRowProps): import("react").JSX.Element;
9
10
  /** Registers the edit and write conversation rows. */
10
11
  export declare const fileMutationToolview: {
11
12
  name: string;
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.2.0-rc.1",
4
+ "version": "0.2.1-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "license": "MIT",
40
40
  "peerDependencies": {
41
- "@deepseek-ai/cordis": "~4.0.4"
41
+ "@deepseek-ai/cordis": "~4.0.5-alpha.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@testing-library/react": "^16.1.0",
@@ -46,32 +46,34 @@
46
46
  "react": "^18.2.0",
47
47
  "react-dom": "^18.2.0",
48
48
  "clsx": "^2.0.0",
49
- "@deepseek-ai/dsh-spill-policy": "0.2.0-rc.1",
50
- "@deepseek-ai/dsh-agent": "0.2.0-rc.1",
51
- "@deepseek-ai/dsh-llm": "0.2.0-rc.1",
52
- "@deepseek-ai/dsh-session": "0.2.0-rc.1",
53
- "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.1",
54
- "@deepseek-ai/dsh-tools": "0.2.0-rc.1",
55
- "@deepseek-ai/dsh-tool-jobs": "0.2.0-rc.1",
56
- "@deepseek-ai/dsh-tool-terminal": "0.2.0-rc.1",
57
- "@deepseek-ai/dsh-spill": "0.2.0-rc.1",
58
- "@deepseek-ai/cordis": "~4.0.4",
59
- "@deepseek-ai/dsh-api-remotes": "0.2.0-rc.1",
60
- "@deepseek-ai/dsh-tool-session-query": "0.2.0-rc.1",
61
- "@deepseek-ai/dsh-client-locale": "0.2.0-rc.1",
62
- "@deepseek-ai/dsh-client-test-runtime": "0.2.0-rc.1",
63
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.0-rc.1",
64
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.1",
65
- "@deepseek-ai/dsh-client-connection": "0.2.0-rc.1",
66
- "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.1",
67
- "@deepseek-ai/dsh-api-workspace-controller": "0.2.0-rc.1",
68
- "@deepseek-ai/dsh-client-ui-chat": "0.2.0-rc.1",
69
- "@deepseek-ai/dsh-attachment": "0.2.0-rc.1",
70
- "@deepseek-ai/dsh-ptc-runtime": "0.2.0-rc.1",
71
- "@deepseek-ai/dsh-token-meter": "0.2.0-rc.1",
72
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.1",
73
- "@deepseek-ai/dsh-client-ui-session": "0.2.0-rc.1",
74
- "@deepseek-ai/dsh-util-workspace-path": "0.2.0-rc.1"
49
+ "@deepseek-ai/dsh-spill-policy": "0.2.1-alpha.1",
50
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.1",
51
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
52
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.1",
53
+ "@deepseek-ai/dsh-tools": "0.2.1-alpha.1",
54
+ "@deepseek-ai/dsh-tool-session-query": "0.2.1-alpha.1",
55
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.1",
56
+ "@deepseek-ai/dsh-tool-terminal": "0.2.1-alpha.1",
57
+ "@deepseek-ai/dsh-spill": "0.2.1-alpha.1",
58
+ "@deepseek-ai/dsh-tool-jobs": "0.2.1-alpha.1",
59
+ "@deepseek-ai/cordis": "~4.0.5-alpha.1",
60
+ "@deepseek-ai/dsh-api-remotes": "0.2.1-alpha.1",
61
+ "@deepseek-ai/dsh-client-connection": "0.2.1-alpha.1",
62
+ "@deepseek-ai/dsh-client-locale": "0.2.1-alpha.1",
63
+ "@deepseek-ai/dsh-client-test-runtime": "0.2.1-alpha.1",
64
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-alpha.1",
65
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-alpha.1",
66
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.1",
67
+ "@deepseek-ai/dsh-api-workspace-controller": "0.2.1-alpha.1",
68
+ "@deepseek-ai/dsh-client-ui-chat": "0.2.1-alpha.1",
69
+ "@deepseek-ai/dsh-client-ui-session": "0.2.1-alpha.1",
70
+ "@deepseek-ai/dsh-util-values": "0.2.1-alpha.1",
71
+ "@deepseek-ai/dsh-util-workspace-path": "0.2.1-alpha.1",
72
+ "@deepseek-ai/dsh-attachment": "0.2.1-alpha.1",
73
+ "@deepseek-ai/dsh-token-meter": "0.2.1-alpha.1",
74
+ "@deepseek-ai/dsh-user-questions": "0.2.1-alpha.1",
75
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.1",
76
+ "@deepseek-ai/dsh-ptc-runtime": "0.2.1-alpha.1"
75
77
  },
76
78
  "files": [
77
79
  "lib/index.js",
@@ -1,19 +0,0 @@
1
- /** Tool-owned non-expandable chrome without dispatched argument material. */
2
- import type { ReactNode } from 'react';
3
- import type { ToolCallViewProps } from '../../contract/slots.ts';
4
- import { type ToolRowProps } from './ToolRow.tsx';
5
- /** Inputs contain a tool-owned icon/title and no expandable body. */
6
- type PreparingToolRowProps = Pick<ToolCallViewProps, 'toolName' | 'useDisclosure'> & {
7
- readonly icon: ReactNode;
8
- readonly title: string;
9
- readonly summary?: string;
10
- readonly t: ToolRowProps['t'];
11
- };
12
- /**
13
- * Render a non-expandable tool prefix with an optional preparation summary.
14
- * @param props - tool prefix and locale.
15
- * @returns the preparation row.
16
- */
17
- export declare function PreparingToolRow({ toolName, useDisclosure, icon, title, summary, t }: PreparingToolRowProps): import("react").JSX.Element;
18
- export {};
19
- //# sourceMappingURL=PreparingToolRow.d.ts.map
@@ -1,9 +0,0 @@
1
- import type { ToolCallInjected } from '../contract/slots.ts';
2
- /**
3
- * Bind one call without subscribing until its component invokes the Hook.
4
- * @param _standard - framework-provided scope props.
5
- * @param context - the preparing call's Step source and identity.
6
- * @returns a Hook that reads only this call's raw argument prefix.
7
- */
8
- export declare const bindToolCallArgumentsPartial: ToolCallInjected['hooks']['toolCallArgumentsPartial'];
9
- //# sourceMappingURL=tool-call-arguments-partial.d.ts.map