@deepseek-ai/dsh-client-ui-chat 0.1.6-alpha.2 → 0.1.7-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +83 -10
  3. package/README.zh.md +81 -10
  4. package/lib/client.js +5260 -1541
  5. package/lib/index.js +37 -10
  6. package/lib/types/chat-settings.d.ts +41 -8
  7. package/lib/types/client/chat/AssistantMarkdown.d.ts +15 -12
  8. package/lib/types/client/chat/AssistantNodeView.d.ts +5 -2
  9. package/lib/types/client/chat/ChatGroupSeat.d.ts +14 -0
  10. package/lib/types/client/chat/ChatNodeSeat.d.ts +11 -5
  11. package/lib/types/client/chat/ChatView.d.ts +1 -1
  12. package/lib/types/client/chat/GenericCommandCard.d.ts +6 -1
  13. package/lib/types/client/chat/ReasoningRow.d.ts +11 -5
  14. package/lib/types/client/chat/StatsPills.d.ts +4 -4
  15. package/lib/types/client/chat/TurnNavigator.d.ts +11 -9
  16. package/lib/types/client/chat/TurnTailNodeView.d.ts +4 -4
  17. package/lib/types/client/chat/TurnTriggerNodeView.d.ts +4 -0
  18. package/lib/types/client/chat/TurnUsagePanel.d.ts +1 -16
  19. package/lib/types/client/chat/message-chrome.d.ts +9 -6
  20. package/lib/types/client/chat/register-node-renderers.d.ts +8 -1
  21. package/lib/types/client/chat/render-entry.d.ts +9 -0
  22. package/lib/types/client/chat/step-process.d.ts +11 -0
  23. package/lib/types/client/chat/turn-trigger.d.ts +15 -0
  24. package/lib/types/client/chat/use-chat-navigation.d.ts +69 -0
  25. package/lib/types/client/chat/use-chat-reading.d.ts +96 -0
  26. package/lib/types/client/chat/use-chat-scroll.d.ts +35 -0
  27. package/lib/types/client/chat/use-chat-viewport.d.ts +144 -0
  28. package/lib/types/client/chat/use-disclosure.d.ts +15 -0
  29. package/lib/types/client/chat/use-process-scroll.d.ts +23 -0
  30. package/lib/types/client/chat/use-scroll-follow.d.ts +105 -0
  31. package/lib/types/client/contract/chat-nodes.d.ts +0 -2
  32. package/lib/types/client/contract/chat-visibility.d.ts +9 -0
  33. package/lib/types/client/contract/process-groups.d.ts +23 -0
  34. package/lib/types/client/contract/slots.d.ts +55 -11
  35. package/lib/types/client/contract/snapshot.d.ts +14 -1
  36. package/lib/types/client/contract/turn-metrics.d.ts +1 -20
  37. package/lib/types/client/contract/turn-process.d.ts +7 -0
  38. package/lib/types/client/conversation-nodes/assistant.d.ts +1 -2
  39. package/lib/types/client/conversation-nodes/chat-snapshot-builder.d.ts +9 -2
  40. package/lib/types/client/conversation-nodes/inbox.d.ts +16 -6
  41. package/lib/types/client/conversation-nodes/message.d.ts +5 -1
  42. package/lib/types/client/conversation-nodes/process-activity.d.ts +10 -0
  43. package/lib/types/client/conversation-nodes/process-groups.d.ts +27 -0
  44. package/lib/types/client/index.d.ts +3 -1
  45. package/lib/types/client/locale.d.ts +106 -12
  46. package/lib/types/client/performance-usage.d.ts +19 -0
  47. package/lib/types/client/presentation-policy.d.ts +35 -0
  48. package/lib/types/client/settings/LinkOpeningRow.d.ts +24 -0
  49. package/lib/types/client/settings/PerformanceUsageRow.d.ts +18 -0
  50. package/lib/types/client/settings/PreferenceRow.d.ts +17 -0
  51. package/lib/types/client/settings/TranscriptViewRow.d.ts +6 -6
  52. package/lib/types/client/transcript-view.d.ts +8 -5
  53. package/lib/types/index.d.ts +26 -4
  54. package/package.json +40 -37
package/lib/index.js CHANGED
@@ -1,24 +1,51 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
2
  //#region lib/types/chat-settings.js
3
- /** Chat transcript preferences stored in the Host user-settings document. */
3
+ /** Chat display preferences stored in the Host user-settings document. */
4
4
  /** Settings namespace owned by the Chat target. */
5
5
  const CHAT_SETTINGS_NAMESPACE = "ui-chat";
6
- /** Field carrying the completed-Turn transcript presentation mode. */
6
+ /** Field carrying the work-details presentation mode. */
7
7
  const TRANSCRIPT_VIEW_FIELD = "transcriptView";
8
- /** Transcript presentation modes accepted at settings boundaries. */
9
- const TRANSCRIPT_VIEW_MODES = ["normal", "compact"];
8
+ /** Work-details presentation modes a user can choose. */
9
+ const TRANSCRIPT_VIEW_MODES = [
10
+ "compact",
11
+ "detailed",
12
+ "expanded"
13
+ ];
14
+ /**
15
+ * Saved value from the two-mode generation of this setting. Read as `detailed`;
16
+ * never offered as a choice and never written back.
17
+ */
18
+ const LEGACY_TRANSCRIPT_VIEW_MODE = "normal";
19
+ /** Every value the durable field accepts: current modes plus the legacy saved value. */
20
+ const TRANSCRIPT_VIEW_SETTING_VALUES = [...TRANSCRIPT_VIEW_MODES, LEGACY_TRANSCRIPT_VIEW_MODE];
10
21
  /** Default preserves the compact process disclosure introduced by Chat. */
11
22
  const DEFAULT_TRANSCRIPT_VIEW_MODE = "compact";
23
+ /** Performance and usage detail levels accepted by user settings. */
24
+ const PERFORMANCE_USAGE_MODES = ["compact", "detailed"];
25
+ /** Preserve detailed accounting for users without an explicit preference. */
26
+ const DEFAULT_PERFORMANCE_USAGE = "detailed";
12
27
  /** Durable Chat schema; also the wire envelope the browser scope validates against. */
13
- const ChatSettingsSchema = z.object({ [TRANSCRIPT_VIEW_FIELD]: z.union([...TRANSCRIPT_VIEW_MODES]).default(DEFAULT_TRANSCRIPT_VIEW_MODE) });
28
+ const ChatSettingsFields = {
29
+ linkOpening: z.union(["sidebar", "new-tab"]).default("sidebar"),
30
+ performanceUsage: z.union([...PERFORMANCE_USAGE_MODES]).default(DEFAULT_PERFORMANCE_USAGE),
31
+ [TRANSCRIPT_VIEW_FIELD]: z.union([...TRANSCRIPT_VIEW_SETTING_VALUES]).default(DEFAULT_TRANSCRIPT_VIEW_MODE)
32
+ };
33
+ z.object(ChatSettingsFields);
14
34
  //#endregion
15
35
  //#region lib/types/index.js
16
- /** Host registration for browser Chat preferences. */
17
- /** Register the durable Chat settings section when a provider exists. */
36
+ /** Live preferences projected to the browser. */
37
+ const Config = z.object({
38
+ [TRANSCRIPT_VIEW_FIELD]: ChatSettingsFields[TRANSCRIPT_VIEW_FIELD].volatile(),
39
+ performanceUsage: ChatSettingsFields["performanceUsage"].volatile(),
40
+ linkOpening: ChatSettingsFields.linkOpening.volatile()
41
+ });
42
+ /** Host preferences are consumed through the configuration form projection.
43
+ * @param ctx Plugin context used for optional settings presentation.
44
+ */
18
45
  function apply(ctx) {
19
- ctx.inject(["settings"], (settingsCtx) => {
20
- settingsCtx.settings.register(CHAT_SETTINGS_NAMESPACE, ChatSettingsSchema);
46
+ ctx.inject(["settings"], (child) => {
47
+ child.effect(() => child.settings.configure({ auto: false }, ctx.fiber));
21
48
  });
22
49
  }
23
50
  //#endregion
24
- export { CHAT_SETTINGS_NAMESPACE, DEFAULT_TRANSCRIPT_VIEW_MODE, TRANSCRIPT_VIEW_FIELD, TRANSCRIPT_VIEW_MODES, apply };
51
+ export { CHAT_SETTINGS_NAMESPACE, Config, DEFAULT_TRANSCRIPT_VIEW_MODE, LEGACY_TRANSCRIPT_VIEW_MODE, TRANSCRIPT_VIEW_FIELD, TRANSCRIPT_VIEW_MODES, apply };
@@ -1,20 +1,53 @@
1
- /** Chat transcript preferences stored in the Host user-settings document. */
1
+ /** Chat display preferences stored in the Host user-settings document. */
2
2
  import z from '@deepseek-ai/schemastery';
3
3
  /** Settings namespace owned by the Chat target. */
4
4
  export declare const CHAT_SETTINGS_NAMESPACE = "ui-chat";
5
- /** Field carrying the completed-Turn transcript presentation mode. */
5
+ /** Field carrying the work-details presentation mode. */
6
6
  export declare const TRANSCRIPT_VIEW_FIELD = "transcriptView";
7
- /** Transcript presentation modes accepted at settings boundaries. */
8
- export declare const TRANSCRIPT_VIEW_MODES: readonly ["normal", "compact"];
9
- /** Completed-Turn transcript presentation. */
7
+ /** Work-details presentation modes a user can choose. */
8
+ export declare const TRANSCRIPT_VIEW_MODES: readonly ["compact", "detailed", "expanded"];
9
+ /** Work-details presentation mode. */
10
10
  export type TranscriptViewMode = typeof TRANSCRIPT_VIEW_MODES[number];
11
+ /**
12
+ * Saved value from the two-mode generation of this setting. Read as `detailed`;
13
+ * never offered as a choice and never written back.
14
+ */
15
+ export declare const LEGACY_TRANSCRIPT_VIEW_MODE = "normal";
11
16
  /** Default preserves the compact process disclosure introduced by Chat. */
12
17
  export declare const DEFAULT_TRANSCRIPT_VIEW_MODE: TranscriptViewMode;
18
+ /** Performance and usage detail levels accepted by user settings. */
19
+ export declare const PERFORMANCE_USAGE_MODES: readonly ["compact", "detailed"];
20
+ /** Performance and usage presentation. */
21
+ export type PerformanceUsageMode = typeof PERFORMANCE_USAGE_MODES[number];
22
+ /** Preserve detailed accounting for users without an explicit preference. */
23
+ export declare const DEFAULT_PERFORMANCE_USAGE: PerformanceUsageMode;
24
+ /** Destinations for ordinary clicks on Chat HTTP(S) links. */
25
+ export type LinkOpening = 'sidebar' | 'new-tab';
26
+ /** Preserve the built-in browser for users without an explicit preference. */
27
+ export declare const DEFAULT_LINK_OPENING: LinkOpening;
13
28
  /** Durable Chat section shared by the Host schema and browser scope. */
14
29
  export interface ChatSettings {
15
- /** Presentation mode for completed Turn process content. */
16
- transcriptView: TranscriptViewMode;
30
+ /** Work-details preference; the legacy value is accepted only from existing saved settings. */
31
+ transcriptView: TranscriptViewMode | typeof LEGACY_TRANSCRIPT_VIEW_MODE;
32
+ /** Detail level for composer statistics and completed-Turn usage. */
33
+ performanceUsage: PerformanceUsageMode;
34
+ /** Default destination for Chat HTTP(S) links. */
35
+ linkOpening: LinkOpening;
17
36
  }
18
37
  /** Durable Chat schema; also the wire envelope the browser scope validates against. */
19
- export declare const ChatSettingsSchema: z<ChatSettings>;
38
+ export declare const ChatSettingsFields: {
39
+ linkOpening: z<"sidebar" | "new-tab", "sidebar" | "new-tab", "defined">;
40
+ performanceUsage: z<"compact" | "detailed", "compact" | "detailed", "defined">;
41
+ transcriptView: z<"compact" | "detailed" | "expanded" | "normal", "compact" | "detailed" | "expanded" | "normal", "defined">;
42
+ };
43
+ /** Schema for shared configuration values. */
44
+ export declare const ChatSettingsSchema: z<Schemastery.ObjectS<NoInfer<{
45
+ linkOpening: z<"sidebar" | "new-tab", "sidebar" | "new-tab", "defined">;
46
+ performanceUsage: z<"compact" | "detailed", "compact" | "detailed", "defined">;
47
+ transcriptView: z<"compact" | "detailed" | "expanded" | "normal", "compact" | "detailed" | "expanded" | "normal", "defined">;
48
+ }>>, Schemastery.ObjectT<NoInfer<{
49
+ linkOpening: z<"sidebar" | "new-tab", "sidebar" | "new-tab", "defined">;
50
+ performanceUsage: z<"compact" | "detailed", "compact" | "detailed", "defined">;
51
+ transcriptView: z<"compact" | "detailed" | "expanded" | "normal", "compact" | "detailed" | "expanded" | "normal", "defined">;
52
+ }>>, "plain">;
20
53
  //# sourceMappingURL=chat-settings.d.ts.map
@@ -1,18 +1,19 @@
1
1
  import type { MarkdownFileMentions } from '@deepseek-ai/dsh-client-ui-primitives';
2
- import type { ChatNodeOwnerProps, ChatViewSlotProps } from '../contract/slots.ts';
2
+ import type { ChatNodeOwnerProps, ChatViewSlotProps, UseDisclosure, UsePresentation } from '../contract/slots.ts';
3
3
  import type { AssistantBlock } from '../contract/snapshot.ts';
4
4
  /**
5
- * Map one authored media destination to the same-origin workspace-file URL.
6
- * @param protocol - `window.location.protocol` at render time.
7
- * @param origin - `window.location.origin` at render time.
8
- * @param value - The authored markdown destination, exactly as written.
9
- * @returns The API URL for an absolute POSIX path on an HTTP(S) page, or
10
- * undefined when the destination cannot be a Host-served local file
11
- * (non-HTTP transport such as Electron `file://`, protocol-relative or
12
- * relative destinations).
5
+ * Resolve an authored POSIX image path against the document's file API.
6
+ * @param base - canonical `document.baseURI` at render time.
7
+ * @param value - authored markdown destination.
8
+ * @returns an absolute HTTP(S) file-API URL, or undefined for unsupported
9
+ * protocols and non-local paths.
13
10
  */
14
- export declare function localPathMediaUrl(protocol: string, origin: string, value: string): string | undefined;
11
+ export declare function localPathMediaUrl(base: string, value: string): string | undefined;
15
12
  export interface AssistantMarkdownProps {
13
+ /** Render only the requested business portion, preserving original block indexes. */
14
+ groupPart?: string | undefined;
15
+ /** Stable Hook forwarded to each independently expandable reasoning block. */
16
+ useDisclosure: UseDisclosure;
16
17
  blocks: readonly AssistantBlock[];
17
18
  streaming: boolean;
18
19
  /** Frozen partial of an aborted turn: rendered with a stopped marker. */
@@ -21,7 +22,9 @@ export interface AssistantMarkdownProps {
21
22
  renderMessageImages: ChatNodeOwnerProps['renderMessageImages'];
22
23
  /** Hide reasoning that belongs to the Turn-level process disclosure. */
23
24
  reasoningHidden?: boolean | undefined;
24
- /** Reveal the owning Turn-level process disclosure. */
25
+ /** Live display policy for reasoning summaries. */
26
+ usePresentation: UsePresentation;
27
+ /** Reveal the disclosure that hides this reasoning. */
25
28
  revealProcess?: (() => void) | undefined;
26
29
  /** Resolved prose file mentions for this Assistant's closing turn. */
27
30
  mentions?: MarkdownFileMentions | undefined;
@@ -29,5 +32,5 @@ export interface AssistantMarkdownProps {
29
32
  t: ChatViewSlotProps['t'];
30
33
  }
31
34
  /** Reasoning block as the Think variant summary row (figma 39:28304). */
32
- export declare const AssistantMarkdown: import("react").MemoExoticComponent<({ blocks, streaming, interrupted, renderMessageImages, reasoningHidden, revealProcess, mentions, t, }: AssistantMarkdownProps) => import("react").JSX.Element | null>;
35
+ export declare const AssistantMarkdown: import("react").MemoExoticComponent<({ blocks, streaming, interrupted, renderMessageImages, groupPart, useDisclosure, reasoningHidden, usePresentation, revealProcess, mentions, t, }: AssistantMarkdownProps) => import("react").JSX.Element | null>;
33
36
  //# sourceMappingURL=AssistantMarkdown.d.ts.map
@@ -1,4 +1,7 @@
1
- import type { ChatNodeViewProps } from '../contract/slots.ts';
1
+ import type { InjectFace } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { ChatNodeViewProps, PresentationInjected } from '../contract/slots.ts';
3
+ type AssistantNodeViewProps = ChatNodeViewProps<'assistant-step'> & InjectFace<PresentationInjected>;
2
4
  /** Streaming, settled, and interrupted Assistant states share one keyed renderer instance. */
3
- export declare const AssistantNodeView: import("react").MemoExoticComponent<({ node, useTurnData, turnProcess, openFile, renderMessageImages, fileMentions, t, }: ChatNodeViewProps<"assistant-step">) => import("react").JSX.Element>;
5
+ export declare const AssistantNodeView: import("react").MemoExoticComponent<({ node, groupPart, useDisclosure, useTurnData, turnProcess, openFile, renderMessageImages, fileMentions, usePresentation, t, }: AssistantNodeViewProps) => import("react").JSX.Element>;
6
+ export {};
4
7
  //# sourceMappingURL=AssistantNodeView.d.ts.map
@@ -0,0 +1,14 @@
1
+ /** Stable process container; display policy changes visibility, never member parents. */
2
+ import { type ComponentProps } from 'react';
3
+ import type { GroupKey } from '@deepseek-ai/dsh-client-ui-conversation/client';
4
+ import type { ChatViewSlotProps } from '../contract/slots.ts';
5
+ import { ChatNodeSeat } from './ChatNodeSeat.tsx';
6
+ type SeatProps = Omit<ComponentProps<typeof ChatNodeSeat>, 'nodeKey' | 'groupPart'>;
7
+ type ChatGroupSeatProps = SeatProps & {
8
+ readonly groupKey: GroupKey;
9
+ readonly useChatGroup: ChatViewSlotProps['useChatGroup'];
10
+ };
11
+ /** Render a process group with local disclosure and the existing outer-Turn visibility. */
12
+ export declare const ChatGroupSeat: import("react").MemoExoticComponent<({ groupKey, useChatGroup, ...props }: ChatGroupSeatProps) => import("react").JSX.Element | null>;
13
+ export {};
14
+ //# sourceMappingURL=ChatGroupSeat.d.ts.map
@@ -1,16 +1,22 @@
1
- import type { ChatNodeOwnerProps, ChatViewSlotProps } from '../contract/slots.ts';
1
+ import type { ChatNodeOwnerProps, ChatViewSlotProps, UsePresentation } from '../contract/slots.ts';
2
+ import type { ChatNodeStore } from '../contract/snapshot.ts';
2
3
  interface ChatNodeSeatProps extends ChatNodeOwnerProps {
3
4
  readonly nodeKey: string;
5
+ /** A replaced Builder must rebind keyed hooks even when references and keys survive. */
6
+ readonly nodeStore: ChatNodeStore;
4
7
  readonly useChatNode: ChatViewSlotProps['useChatNode'];
5
8
  readonly useChatNodeProcess: ChatViewSlotProps['useChatNodeProcess'];
6
- readonly historyIncomplete: boolean;
7
- readonly compactTranscript: boolean;
9
+ readonly usePresentation: UsePresentation;
8
10
  readonly useStore: ChatViewSlotProps['useStore'];
9
11
  readonly actions: ChatViewSlotProps['actions'];
10
12
  readonly renderSlot: ChatViewSlotProps['renderSlot'];
11
13
  readonly t: ChatViewSlotProps['t'];
12
14
  }
13
- /** Subscribe, apply Turn-process visibility, and dispatch one stable Context key. */
14
- export declare const ChatNodeSeat: import("react").MemoExoticComponent<({ nodeKey, useChatNode, useChatNodeProcess, historyIncomplete, compactTranscript, cwd, openFile, openSkill, inspectCall, forkAt, loadImage, renderMessageImages, fileMentions, useStore, actions, renderSlot, t, }: ChatNodeSeatProps) => import("react").JSX.Element | null>;
15
+ /**
16
+ * Subscribe, apply Turn-process visibility, and dispatch one stable Context key.
17
+ * Policy reads select this seat's own conclusion, so a mode change re-renders
18
+ * only seats whose visibility actually changes.
19
+ */
20
+ export declare const ChatNodeSeat: import("react").MemoExoticComponent<({ nodeKey, groupPart, useChatNode, useChatNodeProcess, usePresentation, cwd, openFile, openSkill, inspectCall, forkAt, loadImage, renderMessageImages, fileMentions, useStore, actions, renderSlot, t, }: ChatNodeSeatProps) => import("react").JSX.Element | null>;
15
21
  export {};
16
22
  //# sourceMappingURL=ChatNodeSeat.d.ts.map
@@ -3,5 +3,5 @@ import type { ChatViewSlotProps } from '../contract/slots.ts';
3
3
  * The chat view slot entry: pure component over the composed props; each
4
4
  * ordered business Node crosses the keyed renderer seat.
5
5
  */
6
- export declare function ChatView({ useSession, useChat, useChatNode, useChatNodeProcess, useSessions, useStore, actions, renderSlot, sessionId, openFile, openSkill, openExternalLink, loadOlder, loadThrough, loadImage, openView, chatScroll, forkAt, fileMentions, useTranscriptView, useProjection, t, }: ChatViewSlotProps): import("react").JSX.Element;
6
+ export declare function ChatView({ useSession, useChat, useChatNode, useChatNodeProcess, useChatGroup, useConversation, useSessions, useStore, actions, renderSlot, sessionId, openFile, openSkill, openExternalLink, loadOlder, loadThrough, loadImage, inspectCall, chatScroll, forkAt, fileMentions, usePresentation, useProjection, t, }: ChatViewSlotProps): import("react").JSX.Element;
7
7
  //# sourceMappingURL=ChatView.d.ts.map
@@ -5,5 +5,10 @@ export interface GenericCommandCardProps extends CommandRowOwnerProps {
5
5
  /** Command-specific running copy; absent uses the generic command label. */
6
6
  runningSummary?: string | undefined;
7
7
  }
8
- export declare function GenericCommandCard({ node, t, runningSummary }: GenericCommandCardProps): import("react").JSX.Element;
8
+ /**
9
+ * Render a command summary and its lazily mounted multiline output.
10
+ * @param props - command, locale, and optional running label.
11
+ * @returns the command disclosure.
12
+ */
13
+ export declare const GenericCommandCard: import("react").MemoExoticComponent<({ node, t, runningSummary }: GenericCommandCardProps) => import("react").JSX.Element>;
9
14
  //# sourceMappingURL=GenericCommandCard.d.ts.map
@@ -1,16 +1,22 @@
1
- import type { ChatViewSlotProps } from '../contract/slots.ts';
1
+ import type { ChatViewSlotProps, UseDisclosure, UsePresentation } from '../contract/slots.ts';
2
2
  /**
3
3
  * Render one assistant reasoning block collapsed until the reader opens it. The
4
4
  * collapsed summary omits double-asterisk markers; expanded content renders
5
- * the complete Markdown with secondary typography.
5
+ * the complete Markdown with secondary typography. A streaming preview advances
6
+ * when a paragraph's first line completes. Mode changes toggle CSS display without unmounting
7
+ * collapsed summaries.
6
8
  * @param props.text - complete or streaming reasoning text.
7
9
  * @param props.running - whether this block is the streaming tail.
10
+ * @param props.usePresentation - live display-policy selector for this reasoning row.
11
+ * @param props.useDisclosure - independent open state with enclosing-Turn resets.
8
12
  * @param props.t - conversation locale seat for status and Markdown actions.
9
13
  * @returns the reasoning disclosure.
10
14
  */
11
- export declare function ReasoningRow({ text, running, t }: {
15
+ export declare const ReasoningRow: import("react").MemoExoticComponent<({ text, running, usePresentation, useDisclosure, t }: {
12
16
  text: string;
13
17
  running: boolean;
14
- t: ChatViewSlotProps['t'];
15
- }): import("react").JSX.Element;
18
+ useDisclosure: UseDisclosure;
19
+ usePresentation: UsePresentation;
20
+ t: ChatViewSlotProps["t"];
21
+ }) => import("react").JSX.Element>;
16
22
  //# sourceMappingURL=ReasoningRow.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import type { UseProjection } from '@deepseek-ai/dsh-api-session-controller/client';
2
- import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { InjectFace, SnapshotSelectorHook } from '@deepseek-ai/dsh-client-ui-slots';
3
3
  import type { TokenUsageProjection } from '@deepseek-ai/dsh-token-meter/client';
4
- import type { ChatViewSlotProps } from '../contract/slots.ts';
4
+ import type { ChatViewSlotProps, PerformanceUsageInjected } from '../contract/slots.ts';
5
5
  import type { ChatSnapshot } from '../contract/snapshot.ts';
6
6
  interface WindowStats {
7
7
  turns: number;
@@ -53,12 +53,12 @@ export declare function cacheHitPercent(usage: TokenUsageProjection): string | n
53
53
  */
54
54
  export declare function billedInputTokens(usage: TokenUsageProjection): number;
55
55
  /** Props: the conversation-snapshot selector plus the projection read seat. */
56
- export interface StatsPillsProps {
56
+ export interface StatsPillsProps extends InjectFace<PerformanceUsageInjected> {
57
57
  useChat: SnapshotSelectorHook<ChatSnapshot>;
58
58
  useProjection: UseProjection;
59
59
  /** The owning dock's locale seat. */
60
60
  t: ChatViewSlotProps['t'];
61
61
  }
62
- export declare const StatsPills: import("react").MemoExoticComponent<({ useChat, useProjection, t }: StatsPillsProps) => import("react").JSX.Element | null>;
62
+ export declare const StatsPills: import("react").MemoExoticComponent<({ useChat, useProjection, usePerformanceUsage, t }: StatsPillsProps) => import("react").JSX.Element | null>;
63
63
  export {};
64
64
  //# sourceMappingURL=StatsPills.d.ts.map
@@ -8,19 +8,21 @@ interface TurnNavigatorProps {
8
8
  readonly onNavigate: (item: TurnRailItem) => void;
9
9
  readonly t: ChatViewSlotProps['t'];
10
10
  }
11
- declare function TurnNavigatorRail({ items, activeTurn, busyTurn, onNavigate, t }: TurnNavigatorProps): import("react").JSX.Element | null;
11
+ /** Imperative controls for known turns; unknown turn numbers are ignored. */
12
+ export interface TurnNavigatorHandle {
13
+ /** @param turn - turn to activate through the navigation callback. */
14
+ activateTurn(turn: number): void;
15
+ /** @param turn - turn to center in the rail without navigating the transcript. */
16
+ scrollToTurn(turn: number): void;
17
+ }
12
18
  /**
13
19
  * Fixed-pitch rail of every known Turn — loaded marks scroll, unloaded marks
14
20
  * page history in first — with hover and focus previews. Overflow scrolls
15
21
  * inside the frame, gradient fades marking each scrollable end, and the
16
- * active mark keeps itself in view while the pointer is elsewhere.
17
- *
18
- * Memoized because it renders two host elements per Turn while the
19
- * enclosing view re-renders on every streaming delta: without the guard a long
20
- * session rebuilds hundreds of marks per commit for a rail that only changes
21
- * when a Turn is added, removed, or becomes active. Its props must therefore
22
- * stay referentially stable across those commits.
22
+ * active mark centers only outside the fade-free band while the pointer is
23
+ * elsewhere. Previews follow pointer movement or focus, not scrolling under
24
+ * a stationary pointer.
23
25
  */
24
- export declare const TurnNavigator: import("react").MemoExoticComponent<typeof TurnNavigatorRail>;
26
+ export declare const TurnNavigator: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<TurnNavigatorProps & import("react").RefAttributes<TurnNavigatorHandle>>>;
25
27
  export {};
26
28
  //# sourceMappingURL=TurnNavigator.d.ts.map
@@ -1,7 +1,7 @@
1
- import type { PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots';
2
- import type { ChatNodeViewProps } from '../contract/slots.ts';
3
- type TurnTailNodeViewProps = ChatNodeViewProps<'turn-tail'> & PropsRenderSlots<'conversation.chat.turnTail' | 'conversation.chat.assistant-actions'>;
1
+ import type { InjectFace, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { ChatNodeViewProps, PerformanceUsageInjected } from '../contract/slots.ts';
3
+ type TurnTailNodeViewProps = ChatNodeViewProps<'turn-tail'> & PropsRenderSlots<'conversation.chat.turnTail' | 'conversation.chat.assistant-actions'> & InjectFace<PerformanceUsageInjected>;
4
4
  /** Turn-local actions and feature tail over the Location index, independent of Assistant placement. */
5
- export declare const TurnTailNodeView: import("react").MemoExoticComponent<({ node, openFile, forkAt, renderSlot, t, useChat, }: TurnTailNodeViewProps) => import("react").JSX.Element | null>;
5
+ export declare const TurnTailNodeView: import("react").MemoExoticComponent<({ node, openFile, forkAt, renderSlot, t, useChat, usePerformanceUsage, }: TurnTailNodeViewProps) => import("react").JSX.Element | null>;
6
6
  export {};
7
7
  //# sourceMappingURL=TurnTailNodeView.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { ChatNodeViewProps } from '../contract/slots.ts';
2
+ /** Render recorded trigger attribution above the whole-Turn disclosure. */
3
+ export declare function TurnTriggerNodeView({ node, t }: Pick<ChatNodeViewProps<'turn-trigger'>, 'node' | 't'>): import("react").JSX.Element;
4
+ //# sourceMappingURL=TurnTriggerNodeView.d.ts.map
@@ -1,3 +1,4 @@
1
+ /** Completed-Turn token usage action and its accounting details dialog. */
1
2
  import type { TurnTokenUsage } from '../contract/chat-nodes.ts';
2
3
  import type { ChatViewSlotProps } from '../contract/slots.ts';
3
4
  export interface TurnUsagePanelProps {
@@ -5,26 +6,10 @@ export interface TurnUsagePanelProps {
5
6
  /** The owning view's locale seat, passed down as a plain prop. */
6
7
  t: ChatViewSlotProps['t'];
7
8
  }
8
- export interface TurnTimePanelProps {
9
- /** Turn wall time in ms, the pill's label. */
10
- runMs: number;
11
- /** Turn decode throughput, a dialog row when known. */
12
- tokensPerSecond?: number | undefined;
13
- /** Turn first-step TTFT in ms, a dialog row when known. */
14
- ttftMs?: number | undefined;
15
- /** The owning view's locale seat, passed down as a plain prop. */
16
- t: ChatViewSlotProps['t'];
17
- }
18
9
  /**
19
10
  * Turn-usage IconActions pill with a click-open Turn-usage details dialog.
20
11
  * @param props - Turn usage buckets and locale seat.
21
12
  * @returns The trigger and, while open, its portaled dialog anchored above the trigger.
22
13
  */
23
14
  export declare function TurnUsagePanel({ usage, t }: TurnUsagePanelProps): import("react").JSX.Element;
24
- /**
25
- * Turn-time IconActions pill with a click-open Turn-time details dialog.
26
- * @param props - Turn timing facts and locale seat.
27
- * @returns The clock-and-duration trigger and, while open, its portaled dialog anchored above the trigger.
28
- */
29
- export declare function TurnTimePanel({ runMs, tokensPerSecond, ttftMs, t }: TurnTimePanelProps): import("react").JSX.Element;
30
15
  //# sourceMappingURL=TurnUsagePanel.d.ts.map
@@ -3,6 +3,8 @@ import type { Translate } from '@deepseek-ai/dsh-client-ui-slots';
3
3
  export type ClockTranslate = Translate<'clock.md' | 'clock.ymd'>;
4
4
  /** The elapsed-duration share of the conversation dictionary. */
5
5
  export type RunDurationTranslate = Translate<'duration.seconds' | 'duration.minutes' | 'duration.hours'>;
6
+ /** Refresh interval for whole-second live run clocks. */
7
+ export declare const LIVE_RUN_CLOCK_INTERVAL_MS = 1000;
6
8
  /**
7
9
  * Local calendar-day epoch (ms at local midnight) for an instant.
8
10
  * @param ms - Unix epoch ms.
@@ -16,7 +18,7 @@ export declare function startOfLocalDay(ms: number): number;
16
18
  */
17
19
  export declare function msUntilNextLocalMidnight(ms: number): number;
18
20
  /**
19
- * Localized elapsed-time label shared by running and settled turn chrome.
21
+ * Localized elapsed-time label for the running conversation clock.
20
22
  * @param ms - Elapsed duration in milliseconds (negatives clamp to zero).
21
23
  * @param t - Translate seat supplying the duration templates.
22
24
  * @returns Display string in whole seconds; minutes and seconds once the
@@ -25,12 +27,13 @@ export declare function msUntilNextLocalMidnight(ms: number): number;
25
27
  */
26
28
  export declare function formatRunDuration(ms: number, t: RunDurationTranslate): string;
27
29
  /**
28
- * Sub-turn latency figure: one decimal under ten seconds, whole seconds
29
- * beyond. Unit-less so the locale template owns the second suffix.
30
- * @param ms - Latency in milliseconds (negatives clamp to zero).
31
- * @returns Display number in seconds without unit.
30
+ * Localized live elapsed time without padded seconds or early rollover.
31
+ * @param ms - Elapsed duration in milliseconds (negatives clamp to zero).
32
+ * @param t - Translate seat supplying the duration templates.
33
+ * @returns Whole seconds without a leading zero; minutes start at 60 seconds
34
+ * and hours start at exactly 60 minutes.
32
35
  */
33
- export declare function formatLatencySeconds(ms: number): string;
36
+ export declare function formatLiveRunDuration(ms: number, t: RunDurationTranslate): string;
34
37
  /**
35
38
  * Decode-throughput figure: whole tokens from ten up, one decimal below.
36
39
  * @param tps - Tokens per second.
@@ -1,7 +1,14 @@
1
1
  import type { Context } from '@deepseek-ai/cordis';
2
+ import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store';
3
+ import type { PerformanceUsageMode } from '../../chat-settings.ts';
4
+ import type { ChatPresentationPolicy } from '../presentation-policy.ts';
2
5
  /**
3
6
  * Register this package's business renderers behind the keyed Chat Node seat.
7
+ * Renderers whose output depends on the work-details mode receive the policy
8
+ * through their own registration; the seat and the other renderers do not.
4
9
  * @param ctx - owning UI Conversation context.
10
+ * @param performanceUsage - live statistics detail preference.
11
+ * @param presentation - live presentation policy.
5
12
  */
6
- export declare function registerChatNodeRenderers(ctx: Context): void;
13
+ export declare function registerChatNodeRenderers(ctx: Context, performanceUsage: ObservableSnapshot<PerformanceUsageMode>, presentation: ObservableSnapshot<ChatPresentationPolicy>): void;
7
14
  //# sourceMappingURL=register-node-renderers.d.ts.map
@@ -0,0 +1,9 @@
1
+ /** Stable React identities for the two grouping reference kinds. */
2
+ import type { RenderEntry } from '@deepseek-ai/dsh-client-ui-conversation/client';
3
+ /**
4
+ * Identify a rendering position independently of presentation mode.
5
+ * @param entry - mode-independent rendering reference.
6
+ * @returns its collision-free React key.
7
+ */
8
+ export declare function chatRenderKey(entry: RenderEntry): string;
9
+ //# sourceMappingURL=render-entry.d.ts.map
@@ -0,0 +1,11 @@
1
+ /** Localized titles for projected step-process activity. */
2
+ import type { ChatViewSlotProps } from '../contract/slots.ts';
3
+ import type { ProcessActivitySummary } from '../contract/process-groups.ts';
4
+ /**
5
+ * Compose a closed group's localized title from its top three categories without counts.
6
+ * @param summary - ranked work and phase evidence for this range.
7
+ * @param t - Chat namespace translator.
8
+ * @returns the secondary disclosure title.
9
+ */
10
+ export declare function processTitle(summary: ProcessActivitySummary, t: ChatViewSlotProps['t']): string;
11
+ //# sourceMappingURL=step-process.d.ts.map
@@ -0,0 +1,15 @@
1
+ /** Presentation of durable non-human messages claimed to begin a Turn. */
2
+ import type { ContextMessageNode } from '../contract/snapshot.ts';
3
+ import type { ChatKey } from '../locale.ts';
4
+ /** Existing primitive glyph selected for a Turn trigger's source family. */
5
+ export type TurnTriggerIcon = 'agent' | 'github' | 'goal' | 'job' | 'plugin' | 'request' | 'schedule' | 'subagent' | 'team' | 'webhook';
6
+ /**
7
+ * Describe a waking message using its source and recognized producer framing.
8
+ * @param node - durable context, including the original notification body.
9
+ * @returns localized title key and source-family icon.
10
+ */
11
+ export declare function turnTriggerDetails(node: ContextMessageNode): {
12
+ title: ChatKey;
13
+ icon: TurnTriggerIcon;
14
+ };
15
+ //# sourceMappingURL=turn-trigger.d.ts.map
@@ -0,0 +1,69 @@
1
+ import type { ChatNode } from '../contract/chat-nodes.ts';
2
+ import type { ChatViewSlotProps } from '../contract/slots.ts';
3
+ import type { TurnRailItem } from './turn-rail-items.ts';
4
+ import type { ChatReading, ReadingSample } from './use-chat-reading.ts';
5
+ import type { ChatViewport } from './use-chat-viewport.ts';
6
+ /** History availability and loading operations for the committed Chat window. */
7
+ export interface ChatNavigationInput extends Pick<ChatViewSlotProps, 'loadOlder' | 'loadThrough'> {
8
+ readonly firstSeq: ChatNode['anchorSeq'] | null;
9
+ readonly hasMore: boolean;
10
+ readonly loadingOlder: boolean;
11
+ }
12
+ /** Owns one replaceable turn jump and the anchor retained while history loads. */
13
+ export declare class ChatNavigation {
14
+ private readonly viewport;
15
+ private readonly reading;
16
+ private input;
17
+ private readonly onBusyTurn;
18
+ private jump;
19
+ private settleFrame;
20
+ constructor(viewport: ChatViewport, reading: ChatReading, input: ChatNavigationInput, onBusyTurn: (turn: number | null) => void);
21
+ /**
22
+ * Adopt committed history availability without starting a request.
23
+ * @param input - history state from the latest committed render.
24
+ */
25
+ setInput(input: ChatNavigationInput): void;
26
+ /** Cancel navigation when opening a Chat view. */
27
+ reset(): void;
28
+ /** Cancel local callbacks; late history completions cannot revive a task. */
29
+ dispose(): void;
30
+ /** Release the jump, paging anchor, and busy indicator without cancelling shared history I/O. */
31
+ cancel(): void;
32
+ private clearTask;
33
+ /**
34
+ * Replace the current jump with an explicit turn selection.
35
+ * @param item - loaded anchor or unloaded turn to fetch before landing.
36
+ */
37
+ readonly navigateToTurn: (item: TurnRailItem) => void;
38
+ /** Request one older page while retaining the current semantic position. */
39
+ readonly loadEarlier: () => void;
40
+ /**
41
+ * Preserve reader ownership across pending history work.
42
+ * @param sample - settled reader movement that can update or interrupt an anchor.
43
+ */
44
+ readerSampled(sample: ReadingSample): void;
45
+ /**
46
+ * Preserve one paging anchor after a commit or a later size change, regardless of head identity.
47
+ * @returns whether the retained anchor handled the layout change.
48
+ */
49
+ contentCommitted(): boolean;
50
+ /** Retarget a still-loading page only after inner or outer reader scrolling ends. */
51
+ readerSettled(): void;
52
+ /** Land, retry, or complete the current jump against the committed window. */
53
+ reconcile(): void;
54
+ private landJump;
55
+ private request;
56
+ private cancelFrame;
57
+ }
58
+ /**
59
+ * Retain one navigation owner for the component's lifetime.
60
+ * @param viewport - turn-aware DOM operations.
61
+ * @param reading - reading and follow policy receiving navigation landings.
62
+ * @param input - committed history state and load operations.
63
+ * @returns the navigation owner and its visible busy turn.
64
+ */
65
+ export declare function useChatNavigation(viewport: ChatViewport, reading: ChatReading, input: ChatNavigationInput): {
66
+ navigation: ChatNavigation;
67
+ busyTurn: number | null;
68
+ };
69
+ //# sourceMappingURL=use-chat-navigation.d.ts.map