@deepseek-ai/dsh-client-ui-chat 0.2.1-rc.4 → 0.2.2-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.
- package/README.i18n.yaml +14 -14
- package/README.md +23 -11
- package/README.zh.md +23 -11
- package/lib/assets/running-whale@2x-06738fa29b2f.png +0 -0
- package/lib/client.js +2368 -236
- package/lib/index.js +6 -0
- package/lib/types/chat-settings.d.ts +13 -0
- package/lib/types/client/chat/AssistantMarkdown.d.ts +3 -1
- package/lib/types/client/chat/ChatFlow.d.ts +1 -1
- package/lib/types/client/chat/ChatView.d.ts +1 -1
- package/lib/types/client/chat/MessageItem.d.ts +12 -3
- package/lib/types/client/chat/ReasoningRow.d.ts +2 -1
- package/lib/types/client/chat/RunningStatus.d.ts +8 -3
- package/lib/types/client/chat/flow-motion.d.ts +8 -1
- package/lib/types/client/chat/text-interaction.d.ts +19 -0
- package/lib/types/client/chat/text-selection.d.ts +20 -0
- package/lib/types/client/chat/use-chat-reading.d.ts +2 -1
- package/lib/types/client/chat/use-chat-scroll.d.ts +2 -0
- package/lib/types/client/chat/use-chat-viewport.d.ts +34 -1
- package/lib/types/client/contract/group-tree.d.ts +4 -4
- package/lib/types/client/contract/slots.d.ts +46 -4
- package/lib/types/client/contract/snapshot.d.ts +2 -1
- package/lib/types/client/conversation-nodes/inbox.d.ts +6 -1
- package/lib/types/client/conversation-nodes/message.d.ts +5 -0
- package/lib/types/client/conversation-nodes/turn-process.d.ts +13 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/locale.d.ts +1196 -0
- package/lib/types/client/presentation-policy.d.ts +13 -9
- package/lib/types/client/settings/TranscriptViewRow.d.ts +8 -3
- package/lib/types/client/transcript-view.d.ts +8 -1
- package/lib/types/index.d.ts +5 -1
- package/locale/de.json +6 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/package.json +47 -41
package/lib/index.js
CHANGED
|
@@ -11,6 +11,10 @@ const COLLAPSE_TIMING_FIELD = "collapseTiming";
|
|
|
11
11
|
const COLLAPSE_TIMINGS = ["completion", "next-input"];
|
|
12
12
|
/** Preserve completion-time folding when no timing preference is saved. */
|
|
13
13
|
const DEFAULT_COLLAPSE_TIMING = "completion";
|
|
14
|
+
/** Field carrying which Assistant replies stay visible in a folded Turn. */
|
|
15
|
+
const FOLDED_REPLIES_FIELD = "foldedReplies";
|
|
16
|
+
/** Assistant replies kept visible while a completed Turn folds its process: every reply, or only the final answer. */
|
|
17
|
+
const FOLDED_REPLIES = ["all", "final"];
|
|
14
18
|
/** Work-details presentation modes a user can choose. */
|
|
15
19
|
const TRANSCRIPT_VIEW_MODES = [
|
|
16
20
|
"compact",
|
|
@@ -42,6 +46,7 @@ const DEFAULT_LINK_OPENING = "sidebar";
|
|
|
42
46
|
/** Durable Chat schema; also the wire envelope the browser scope validates against. */
|
|
43
47
|
const ChatSettingsFields = {
|
|
44
48
|
[COLLAPSE_TIMING_FIELD]: z.union([...COLLAPSE_TIMINGS]).default(DEFAULT_COLLAPSE_TIMING),
|
|
49
|
+
[FOLDED_REPLIES_FIELD]: z.union([...FOLDED_REPLIES]).default("all"),
|
|
45
50
|
linkOpening: z.union(["sidebar", "new-tab"]).default(DEFAULT_LINK_OPENING),
|
|
46
51
|
performanceUsage: z.union([...PERFORMANCE_USAGE_MODES]).default(DEFAULT_PERFORMANCE_USAGE),
|
|
47
52
|
[TRANSCRIPT_VIEW_FIELD]: z.union([...TRANSCRIPT_VIEW_SETTING_VALUES]).loose()
|
|
@@ -53,6 +58,7 @@ z.object(ChatSettingsFields);
|
|
|
53
58
|
const Config = z.object({
|
|
54
59
|
[TRANSCRIPT_VIEW_FIELD]: ChatSettingsFields[TRANSCRIPT_VIEW_FIELD].volatile(),
|
|
55
60
|
collapseTiming: ChatSettingsFields.collapseTiming.volatile(),
|
|
61
|
+
foldedReplies: ChatSettingsFields.foldedReplies.volatile(),
|
|
56
62
|
performanceUsage: ChatSettingsFields["performanceUsage"].volatile(),
|
|
57
63
|
linkOpening: ChatSettingsFields.linkOpening.volatile()
|
|
58
64
|
});
|
|
@@ -12,6 +12,14 @@ export declare const COLLAPSE_TIMINGS: readonly ["completion", "next-input"];
|
|
|
12
12
|
export type CollapseTiming = typeof COLLAPSE_TIMINGS[number];
|
|
13
13
|
/** Preserve completion-time folding when no timing preference is saved. */
|
|
14
14
|
export declare const DEFAULT_COLLAPSE_TIMING: CollapseTiming;
|
|
15
|
+
/** Field carrying which Assistant replies stay visible in a folded Turn. */
|
|
16
|
+
export declare const FOLDED_REPLIES_FIELD = "foldedReplies";
|
|
17
|
+
/** Assistant replies kept visible while a completed Turn folds its process: every reply, or only the final answer. */
|
|
18
|
+
export declare const FOLDED_REPLIES: readonly ["all", "final"];
|
|
19
|
+
/** Which Assistant replies stay visible while a completed Turn folds its process. */
|
|
20
|
+
export type FoldedReplies = typeof FOLDED_REPLIES[number];
|
|
21
|
+
/** Keep every Assistant reply visible when no folded-reply preference is saved. */
|
|
22
|
+
export declare const DEFAULT_FOLDED_REPLIES: FoldedReplies;
|
|
15
23
|
/** Work-details presentation modes a user can choose. */
|
|
16
24
|
export declare const TRANSCRIPT_VIEW_MODES: readonly ["compact", "standard", "detailed", "verbose"];
|
|
17
25
|
/** Work-details presentation mode. */
|
|
@@ -41,6 +49,8 @@ export interface ChatSettings {
|
|
|
41
49
|
transcriptView?: TranscriptViewMode | typeof LEGACY_TRANSCRIPT_VIEW_MODE | typeof LEGACY_EXPANDED_TRANSCRIPT_VIEW_MODE | null;
|
|
42
50
|
/** Independent collapse timing; absence preserves completion-time folding. */
|
|
43
51
|
collapseTiming?: CollapseTiming;
|
|
52
|
+
/** Replies kept visible in a folded Turn; absence keeps every reply. */
|
|
53
|
+
foldedReplies?: FoldedReplies;
|
|
44
54
|
/** Detail level for composer statistics and completed-Turn usage. */
|
|
45
55
|
performanceUsage: PerformanceUsageMode;
|
|
46
56
|
/** Default destination for Chat HTTP(S) links. */
|
|
@@ -49,6 +59,7 @@ export interface ChatSettings {
|
|
|
49
59
|
/** Durable Chat schema; also the wire envelope the browser scope validates against. */
|
|
50
60
|
export declare const ChatSettingsFields: {
|
|
51
61
|
collapseTiming: z<"completion" | "next-input", "completion" | "next-input", "defined">;
|
|
62
|
+
foldedReplies: z<"all" | "final", "all" | "final", "defined">;
|
|
52
63
|
linkOpening: z<"sidebar" | "new-tab", "sidebar" | "new-tab", "defined">;
|
|
53
64
|
performanceUsage: z<"compact" | "detailed", "compact" | "detailed", "defined">;
|
|
54
65
|
transcriptView: z<"compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "plain">;
|
|
@@ -56,11 +67,13 @@ export declare const ChatSettingsFields: {
|
|
|
56
67
|
/** Schema for shared configuration values. */
|
|
57
68
|
export declare const ChatSettingsSchema: z<Schemastery.ObjectS<NoInfer<{
|
|
58
69
|
collapseTiming: z<"completion" | "next-input", "completion" | "next-input", "defined">;
|
|
70
|
+
foldedReplies: z<"all" | "final", "all" | "final", "defined">;
|
|
59
71
|
linkOpening: z<"sidebar" | "new-tab", "sidebar" | "new-tab", "defined">;
|
|
60
72
|
performanceUsage: z<"compact" | "detailed", "compact" | "detailed", "defined">;
|
|
61
73
|
transcriptView: z<"compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "plain">;
|
|
62
74
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
63
75
|
collapseTiming: z<"completion" | "next-input", "completion" | "next-input", "defined">;
|
|
76
|
+
foldedReplies: z<"all" | "final", "all" | "final", "defined">;
|
|
64
77
|
linkOpening: z<"sidebar" | "new-tab", "sidebar" | "new-tab", "defined">;
|
|
65
78
|
performanceUsage: z<"compact" | "detailed", "compact" | "detailed", "defined">;
|
|
66
79
|
transcriptView: z<"compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "plain">;
|
|
@@ -20,6 +20,8 @@ export interface AssistantMarkdownProps extends Pick<PropsRenderSlots<'conversat
|
|
|
20
20
|
useDisclosure: UseDisclosure;
|
|
21
21
|
blocks: readonly AssistantBlock[];
|
|
22
22
|
streaming: boolean;
|
|
23
|
+
/** Only finalized durable Assistant messages supply selection sources. */
|
|
24
|
+
textInteractionSource?: boolean;
|
|
23
25
|
/** Frozen partial of an aborted turn: rendered with a stopped marker. */
|
|
24
26
|
interrupted?: boolean | undefined;
|
|
25
27
|
/** Hide reasoning that belongs to the Turn-level process disclosure. */
|
|
@@ -36,5 +38,5 @@ export interface AssistantMarkdownProps extends Pick<PropsRenderSlots<'conversat
|
|
|
36
38
|
t: ChatViewSlotProps['t'];
|
|
37
39
|
}
|
|
38
40
|
/** Renders non-blank reasoning blocks as independent disclosures alongside the response. */
|
|
39
|
-
export declare const AssistantMarkdown: import("react").MemoExoticComponent<({ blocks, streaming, interrupted, loadImage, groupPart, useDisclosure, reasoningHidden, usePresentation, revealProcess, mentions, renderSlot, useGroupAction, t, }: AssistantMarkdownProps) => import("react").JSX.Element | null>;
|
|
41
|
+
export declare const AssistantMarkdown: import("react").MemoExoticComponent<({ blocks, streaming, textInteractionSource, interrupted, loadImage, groupPart, useDisclosure, reasoningHidden, usePresentation, revealProcess, mentions, renderSlot, useGroupAction, t, }: AssistantMarkdownProps) => import("react").JSX.Element | null>;
|
|
40
42
|
//# sourceMappingURL=AssistantMarkdown.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ChatFlowSlotProps } from '../contract/slots.ts';
|
|
2
2
|
/** Render the flow without adding a DOM parent or changing keyed row positions. */
|
|
3
|
-
export declare const ChatFlow: import("react").MemoExoticComponent<({ entries, pendingInputs, lastInputTurn, deferCollapse, useSession, useChat, useChatNode, useChatNodeBottom, useChatNodeProcess, useChatGroup, usePresentation, useStore, actions, renderSlot, renderFactorySlot, t, useGroupAction, useGroupHeaderAction, cwd, openFile, inspectCall, forkAt, loadImage, fileMentions, }: ChatFlowSlotProps) => import("react").JSX.Element[]>;
|
|
3
|
+
export declare const ChatFlow: import("react").MemoExoticComponent<({ entries, pendingInputs, lastInputTurn, deferCollapse, useSession, useChat, useChatNode, useChatNodeBottom, useChatNodeProcess, useChatGroup, usePresentation, useConnectionState, useStore, actions, renderSlot, renderFactorySlot, t, useGroupAction, useGroupHeaderAction, cwd, openFile, inspectCall, forkAt, loadImage, fileMentions, }: ChatFlowSlotProps) => import("react").JSX.Element[]>;
|
|
4
4
|
//# sourceMappingURL=ChatFlow.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, useConversation, useSessions, renderSlot, sessionId, openFile, openExternalLink, loadOlder, loadThrough, loadImage, inspectCall, chatScroll, forkAt, fileMentions, usePresentation, useProjection, t, }: ChatViewSlotProps): import("react").JSX.Element;
|
|
6
|
+
export declare function ChatView({ useSession, useChat, useConversation, useSessions, renderSlot, sessionId, openFile, openExternalLink, loadOlder, loadThrough, loadImage, inspectCall, chatScroll, forkAt, fileMentions, usePresentation, useProjection, useInteractionIds, dispatchInteraction, t, fileDrag, }: ChatViewSlotProps): import("react").JSX.Element;
|
|
7
7
|
//# sourceMappingURL=ChatView.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { PendingSubmission } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
3
|
-
import type { PropsRenderFactories } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
import type { PropsRenderFactories, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots';
|
|
4
4
|
import type { ChatNodeOwnerProps, ChatNodeViewProps, ChatViewSlotProps } from '../contract/slots.ts';
|
|
5
5
|
/**
|
|
6
6
|
* Render one Host-authoritative pending steering item with the same visual
|
|
@@ -26,8 +26,17 @@ export declare function PendingSubmissionBubble({ submission, loadImage, renderF
|
|
|
26
26
|
renderFactorySlot: PropsRenderFactories['renderFactorySlot'];
|
|
27
27
|
t: ChatViewSlotProps['t'];
|
|
28
28
|
} & Pick<ChatNodeOwnerProps, 'loadImage'>): ReactNode;
|
|
29
|
-
/**
|
|
30
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Official user and admitted-steering keyed Chat renderer.
|
|
31
|
+
*
|
|
32
|
+
* Renders the durable-message chain seat directly above the bubble. The seat is
|
|
33
|
+
* declared by the `user` registration alone, so a steering row renders the same
|
|
34
|
+
* bubble without asking for it.
|
|
35
|
+
*/
|
|
36
|
+
export declare const UserMessageNodeView: import("react").MemoExoticComponent<({ node, renderFactorySlot, loadImage, renderSlotChain, t, }: ChatNodeViewProps<"user" | "steering"> & {
|
|
37
|
+
/** Bound by the `user` keyed registration, the only entry that declares the seat. */
|
|
38
|
+
renderSlotChain: PropsRenderSlots<"conversation.chat.user.before">["renderSlotChain"];
|
|
39
|
+
}) => import("react").JSX.Element>;
|
|
31
40
|
/** Injected-context keyed Chat renderer. */
|
|
32
41
|
export declare const ContextMessageNodeView: import("react").MemoExoticComponent<({ node, t }: ChatNodeViewProps<"context">) => import("react").JSX.Element>;
|
|
33
42
|
/** Automatic compaction keyed Chat renderer. */
|
|
@@ -14,9 +14,10 @@ import type { ChatViewSlotProps, UseDisclosure, UsePresentation } from '../contr
|
|
|
14
14
|
* @param props.t - conversation locale seat for the disclosure and running status.
|
|
15
15
|
* @returns the reasoning disclosure.
|
|
16
16
|
*/
|
|
17
|
-
export declare const ReasoningRow: import("react").MemoExoticComponent<({ text, running, usePresentation, useDisclosure, renderSlot, t }: {
|
|
17
|
+
export declare const ReasoningRow: import("react").MemoExoticComponent<({ text, running, textInteractionSource, usePresentation, useDisclosure, renderSlot, t, }: {
|
|
18
18
|
text: string;
|
|
19
19
|
running: boolean;
|
|
20
|
+
textInteractionSource?: boolean;
|
|
20
21
|
useDisclosure: UseDisclosure;
|
|
21
22
|
usePresentation: UsePresentation;
|
|
22
23
|
t: ChatViewSlotProps["t"];
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import type { ChatViewSlotProps } from '../contract/slots.ts';
|
|
2
2
|
interface RunningStatusProps {
|
|
3
3
|
readonly startTime: number | undefined;
|
|
4
|
+
/** Freeze the shown duration while the Client cannot observe the Session. */
|
|
5
|
+
readonly paused: boolean;
|
|
6
|
+
/** Keep the slot without showing or announcing the status: the Session stopped before its Turn closed. */
|
|
7
|
+
readonly holding?: boolean;
|
|
4
8
|
readonly t: ChatViewSlotProps['t'];
|
|
5
9
|
}
|
|
6
10
|
/**
|
|
7
11
|
* Show live elapsed time after the current Turn's content without announcing ticks.
|
|
8
|
-
* @param props - Current Turn start time and localized copy.
|
|
9
|
-
* @returns the blue running indicator; mount
|
|
12
|
+
* @param props - Current Turn start time, pause state, and localized copy.
|
|
13
|
+
* @returns the blue running indicator; mount while the Session is running, or holding its slot hidden until the
|
|
14
|
+
* Turn's actions row replaces it.
|
|
10
15
|
*/
|
|
11
|
-
export declare const RunningStatus: import("react").MemoExoticComponent<({ startTime, t }: RunningStatusProps) => import("react").JSX.Element>;
|
|
16
|
+
export declare const RunningStatus: import("react").MemoExoticComponent<({ startTime, paused, holding, t }: RunningStatusProps) => import("react").JSX.Element>;
|
|
12
17
|
export {};
|
|
13
18
|
//# sourceMappingURL=RunningStatus.d.ts.map
|
|
@@ -13,6 +13,12 @@ export interface FlowMotionRows {
|
|
|
13
13
|
reveal(element: HTMLElement): void;
|
|
14
14
|
/** @param element - row whose active transition should be cancelled without hiding it. */
|
|
15
15
|
cancelMotion(element: HTMLElement): void;
|
|
16
|
+
/**
|
|
17
|
+
* Hide a row at once, outside a motion scope; the owning viewport measures the layout first.
|
|
18
|
+
* @param element - visible row.
|
|
19
|
+
* @param commit - applies the hidden state.
|
|
20
|
+
*/
|
|
21
|
+
hideNow?(element: HTMLElement, commit: () => void): void;
|
|
16
22
|
}
|
|
17
23
|
/** Geometry captured before one fold batch changes its boxes. */
|
|
18
24
|
export interface InputFoldBox {
|
|
@@ -82,9 +88,10 @@ export declare function hiddenOrCollapsing(element: HTMLElement): boolean;
|
|
|
82
88
|
* Create animation coordination without cross-viewport broadcasts.
|
|
83
89
|
* @param driver - the viewport's driver for the next batch; null while detached.
|
|
84
90
|
* @param foldingChanged - disable or restore this viewport's native scroll anchoring.
|
|
91
|
+
* @param beforeInstantHide - measures the layout before a row hides at once outside a motion scope.
|
|
85
92
|
* @returns stable callbacks and cleanup for this viewport's animations.
|
|
86
93
|
*/
|
|
87
|
-
export declare function createFlowMotion(driver: () => InputFoldDriver | null, foldingChanged: (active: boolean) => void): FlowMotion;
|
|
94
|
+
export declare function createFlowMotion(driver: () => InputFoldDriver | null, foldingChanged: (active: boolean) => void, beforeInstantHide?: (element: HTMLElement) => void): FlowMotion;
|
|
88
95
|
/**
|
|
89
96
|
* Apply searchable hiding with the containing Chat viewport's optional fold animation.
|
|
90
97
|
* @param hidden - desired visibility.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import type { TextInteractionGesture, TextInteractionSurface, TextInteractionTrigger } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
|
+
/** Current area-owned surface and its actions. */
|
|
4
|
+
export interface TextInteractionBinding extends Omit<TextInteractionSurface, 'trigger'> {
|
|
5
|
+
readonly active: {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly trigger: TextInteractionTrigger;
|
|
8
|
+
} | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Own text interactions for one positioned content area and its local surface.
|
|
12
|
+
* @param rootRef - existing content element with position: relative.
|
|
13
|
+
* @param surfaceRef - absolute surface inside that element; only the selected Slot consumer is mounted.
|
|
14
|
+
* @param dispatchInteraction - framework-injected plugin gesture dispatch.
|
|
15
|
+
* @param registeredIds - live registered owners used to dismiss removed plugins.
|
|
16
|
+
* @returns current owner and area-local selection actions.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useTextInteraction(rootRef: RefObject<HTMLElement>, surfaceRef: RefObject<HTMLElement>, dispatchInteraction: (gesture: TextInteractionGesture) => string | null, registeredIds: readonly string[]): TextInteractionBinding;
|
|
19
|
+
//# sourceMappingURL=text-interaction.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** DOM selection validation and visible-text projection, independent of business actions. */
|
|
2
|
+
/** One browser range contained by an enabled text source. */
|
|
3
|
+
export interface TextSelection {
|
|
4
|
+
readonly source: HTMLElement;
|
|
5
|
+
readonly range: Range;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Find a single noncollapsed selection inside one enabled source.
|
|
9
|
+
* @param root - mounted interaction area.
|
|
10
|
+
* @param selection - browser selection in that area's document.
|
|
11
|
+
* @returns the selected source and range, or null across sources and excluded content.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readTextSelection(root: HTMLElement, selection: Selection | null): TextSelection | null;
|
|
14
|
+
/**
|
|
15
|
+
* Project selected DOM text with visible block boundaries and without renderer chrome.
|
|
16
|
+
* @param selection - range and its source, obtained through readTextSelection.
|
|
17
|
+
* @returns trimmed visible text; empty or excluded selections return null.
|
|
18
|
+
*/
|
|
19
|
+
export declare function selectedText(selection: TextSelection): string | null;
|
|
20
|
+
//# sourceMappingURL=text-selection.d.ts.map
|
|
@@ -57,9 +57,10 @@ export declare class ChatReading {
|
|
|
57
57
|
followTail(behavior?: 'instant' | 'smooth'): void;
|
|
58
58
|
/**
|
|
59
59
|
* Follow the tail on the active fold's animation clock.
|
|
60
|
+
* @param input - whether the reader's own input requests the landing rather than a content change.
|
|
60
61
|
* @returns whether a fold batch owns the tail movement instead of a separate scroll animation.
|
|
61
62
|
*/
|
|
62
|
-
followInputFold(): boolean;
|
|
63
|
+
followInputFold(input: boolean): boolean;
|
|
63
64
|
/**
|
|
64
65
|
* Let fold batches read follow intent and commit their tail landings.
|
|
65
66
|
* @returns a disposer that disconnects this reading policy from the viewport.
|
|
@@ -15,6 +15,8 @@ export interface ChatScrollInput extends ChatNavigationInput {
|
|
|
15
15
|
readonly lastIsUser: boolean;
|
|
16
16
|
readonly steeringId: string | null;
|
|
17
17
|
readonly submissionId: string | null;
|
|
18
|
+
/** The latest visible submission steers the running Turn instead of opening a new one. */
|
|
19
|
+
readonly submissionSteers: boolean;
|
|
18
20
|
readonly running: boolean;
|
|
19
21
|
/** Enable the browser-local delayed-fold experiment and its input reveal animation. */
|
|
20
22
|
readonly deferCompletedTurns: boolean;
|
|
@@ -41,8 +41,16 @@ export declare class ChatViewport {
|
|
|
41
41
|
private observation;
|
|
42
42
|
private paging;
|
|
43
43
|
private reader;
|
|
44
|
+
/** Rows measured before an instant close; see {@link ChatViewport.keepAboveClosing}. */
|
|
45
|
+
private closing;
|
|
46
|
+
/** Discards a closing measurement that no size observation consumed by the end of its frame. */
|
|
47
|
+
private closingFrame;
|
|
48
|
+
/** Content height without fold room at the latest size observation: the content that frame painted. */
|
|
49
|
+
private settledContent;
|
|
44
50
|
/** The pending or running fold batch lands at the tail. */
|
|
45
51
|
private tailRequested;
|
|
52
|
+
/** The tail request came from the reader's own input rather than from a content change. */
|
|
53
|
+
private tailInput;
|
|
46
54
|
/** Switches the running batch to a tail landing; null while no batch runs. */
|
|
47
55
|
private retarget;
|
|
48
56
|
/** Transition state and row callbacks owned by this viewport's attachment. */
|
|
@@ -84,9 +92,11 @@ export declare class ChatViewport {
|
|
|
84
92
|
/**
|
|
85
93
|
* Land the pending or running fold batch at the tail instead of starting a separate scroll.
|
|
86
94
|
* @param follow - follow controller whose native animation yields to the batch.
|
|
95
|
+
* @param input - whether the reader's own input requests the landing; a content change, such as a Turn
|
|
96
|
+
* ending, requests it in place of the immediate follow.
|
|
87
97
|
* @returns whether a fold owns the tail movement.
|
|
88
98
|
*/
|
|
89
|
-
followInputFold(follow: ScrollFollow): boolean;
|
|
99
|
+
followInputFold(follow: ScrollFollow, input: boolean): boolean;
|
|
90
100
|
/**
|
|
91
101
|
* Drive one fold batch on its frame clock. A tail landing ends at the floor, never above the reader's
|
|
92
102
|
* compensated position; a reader landing keeps the visible content still. Both install only the room
|
|
@@ -100,6 +110,29 @@ export declare class ChatViewport {
|
|
|
100
110
|
* @returns the reference row, or null when every visible row folds.
|
|
101
111
|
*/
|
|
102
112
|
private readingReference;
|
|
113
|
+
/**
|
|
114
|
+
* Measure, before the first row of a commit closes at once, the rows a following reader's shrink keeps
|
|
115
|
+
* still: the first row visible in the last painted layout, the rows after it that were on screen, and the
|
|
116
|
+
* rows above it within one scrollport.
|
|
117
|
+
* Rows above the closing rows keep their painted screen positions, which the commit did not move; the same
|
|
118
|
+
* commit can add rows between them and the closing rows, as a Turn's duration control does, so rows from
|
|
119
|
+
* the closing rows on are placed against the current end. Reads happen only when rows close, never on the
|
|
120
|
+
* following path's size observations. A measurement the same frame's size observation does not use is
|
|
121
|
+
* discarded after that frame.
|
|
122
|
+
* @param element - the first row of this commit to close.
|
|
123
|
+
*/
|
|
124
|
+
private measureClosing;
|
|
125
|
+
private dropClosing;
|
|
126
|
+
/**
|
|
127
|
+
* Keep a following reader's content still after rows closed at once, for example work details at Turn
|
|
128
|
+
* completion: the first visible row keeps its screen position, or, when it closed, the first surviving row
|
|
129
|
+
* that followed it on screen, else the nearest surviving row above it. Room below fills the gap, at most half
|
|
130
|
+
* the scrollport; beyond that the content end stops at the scrollport's middle. Called from the size
|
|
131
|
+
* observation, after layout and before paint; only the observation of the frame that closed the rows uses
|
|
132
|
+
* the measurement, and only while the reader still follows the tail with no fold batch, native animation,
|
|
133
|
+
* unsampled movement, or paging writing positions.
|
|
134
|
+
*/
|
|
135
|
+
private keepAboveClosing;
|
|
103
136
|
/** Clear fold reservations after a display-mode change, allowing the scroll range to shrink. */
|
|
104
137
|
resetBelow(): void;
|
|
105
138
|
/**
|
|
@@ -16,10 +16,10 @@ import type { ChatConversationViewNode } from './chat-nodes.ts';
|
|
|
16
16
|
* `assistant-step` Node places its rows without one: its reasoning row joins
|
|
17
17
|
* the step run and its reply row stands outside it.
|
|
18
18
|
*
|
|
19
|
-
* Whole-Turn folding also exempts
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* Whole-Turn folding also exempts reply rows: with the default Replies After
|
|
20
|
+
* Collapse choice every `assistant-step` reply row stays visible, and with
|
|
21
|
+
* Final answer only just the final answer's reply row does. Reasoning rows
|
|
22
|
+
* stay in the folded process in both choices.
|
|
23
23
|
*/
|
|
24
24
|
export type ChatGroupTree = 'exchange' | 'input' | 'turn' | 'process';
|
|
25
25
|
/**
|
|
@@ -5,9 +5,10 @@ import type { SessionId, SessionSeq } from '@deepseek-ai/dsh-session/types';
|
|
|
5
5
|
import type { PendingSubmission } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
6
6
|
import type { FileAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
7
7
|
import type { InboxState } from '@deepseek-ai/dsh-agent/types';
|
|
8
|
-
import type { CommandNode, CompactionSummaryNode, ConversationLocationDataStore, ConversationTurnDataMap, ConversationGroupData, GroupSnapshot, MessageImageLoader, MessageImageSource, MessageImagesOwnerProps, RenderEntry, TurnLocation, UserTextFacts, UserTextInput } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
8
|
+
import type { CommandNode, CompactionSummaryNode, ConversationLocationDataStore, ConversationTurnDataMap, TextInteractionGesture, TextInteractionSurface, ConversationGroupData, GroupSnapshot, MessageImageLoader, MessageImageSource, MessageImagesOwnerProps, RenderEntry, TurnLocation, UserTextFacts, UserTextInput } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
9
9
|
import type { HostObservable, InjectFace, KeyedSnapshotSelectorHook, PropsLocale, PropsRenderSlots, PropsRuntime, PropsRenderFactories, PropsStore, SlotHookFactory, SnapshotSelectorHook } from '@deepseek-ai/dsh-client-ui-slots';
|
|
10
10
|
import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store';
|
|
11
|
+
import type { ConnectionStateSource } from '@deepseek-ai/dsh-client-connection/client';
|
|
11
12
|
import type { MarkdownFileMentions, MarkdownLabels } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
12
13
|
import type { createChatStore } from '../stores.ts';
|
|
13
14
|
import type { ChatPresentationPolicy } from '../presentation-policy.ts';
|
|
@@ -164,6 +165,19 @@ export interface ChatNodeInjected {
|
|
|
164
165
|
groupAction: SlotHookFactory<'conversation.chat.node', UseGroupAction>;
|
|
165
166
|
};
|
|
166
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Owner currency of the message-source decoration above one user message bubble.
|
|
170
|
+
*
|
|
171
|
+
* Entry selectors receive the durable message `source` and row kind. A
|
|
172
|
+
* non-null selection elects the component and reaches it as `matched`.
|
|
173
|
+
* Entries own their markup and copy; Chat does not interpret the source.
|
|
174
|
+
*/
|
|
175
|
+
export interface UserBeforeOwnerProps {
|
|
176
|
+
/** Durable message source; Chat does not interpret it. */
|
|
177
|
+
readonly source: unknown;
|
|
178
|
+
/** Chat row kind that owns the decoration site. */
|
|
179
|
+
readonly kind: 'user' | 'steering';
|
|
180
|
+
}
|
|
167
181
|
/** Stable owner currency delivered to a keyed Chat renderer. */
|
|
168
182
|
export interface ChatNodeOwnerProps {
|
|
169
183
|
/** Renderer-owned Node portion selected by the grouping Definition. */
|
|
@@ -243,7 +257,13 @@ export interface PerformanceUsageInjected {
|
|
|
243
257
|
}
|
|
244
258
|
/** Business callbacks injected into the Chat view. */
|
|
245
259
|
export interface ChatViewInjected {
|
|
260
|
+
/** File preparation and failure callbacks owned by the file-drag plugin. */
|
|
261
|
+
readonly fileDrag: import('@deepseek-ai/dsh-client-ui-primitives').FileDragActions;
|
|
262
|
+
/** Dispatch one gesture to the Conversation plugin registry. */
|
|
263
|
+
dispatchInteraction: (gesture: TextInteractionGesture) => string | null;
|
|
246
264
|
hooks: {
|
|
265
|
+
/** Live plugin IDs; removed plugins dismiss their active surface. */
|
|
266
|
+
interactionIds: ObservableSnapshot<readonly string[]>;
|
|
247
267
|
/** Live presentation policy derived from the accepted work-details mode. */
|
|
248
268
|
presentation: ObservableSnapshot<ChatPresentationPolicy>;
|
|
249
269
|
};
|
|
@@ -271,8 +291,13 @@ export interface ChatViewInjected {
|
|
|
271
291
|
forkAt: (seq: number) => void;
|
|
272
292
|
fileMentions: (owner: TurnTailOwnerProps) => MarkdownFileMentions | undefined;
|
|
273
293
|
}
|
|
274
|
-
/**
|
|
275
|
-
export type ChatFlowDataInjected = Pick<ChatViewInjected, '
|
|
294
|
+
/** Session-owned node sources shared with the view, plus the flow's connection state. */
|
|
295
|
+
export type ChatFlowDataInjected = Pick<ChatViewInjected, 'keyedHooks'> & {
|
|
296
|
+
hooks: Pick<ChatViewInjected['hooks'], 'presentation'> & {
|
|
297
|
+
/** Client connection lifecycle; the running clock pauses while it is not connected. */
|
|
298
|
+
connectionState: ConnectionStateSource;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
276
301
|
/** Ordered rows and reconciled local echoes rendered inside one Chat viewport. */
|
|
277
302
|
export interface ChatFlowOwnerProps extends Pick<ChatNodeOwnerProps, 'cwd' | 'openFile' | 'inspectCall' | 'forkAt' | 'loadImage' | 'fileMentions'> {
|
|
278
303
|
readonly entries: readonly RenderEntry[];
|
|
@@ -283,7 +308,7 @@ export interface ChatFlowOwnerProps extends Pick<ChatNodeOwnerProps, 'cwd' | 'op
|
|
|
283
308
|
/** Full props of the Chat-owned flow renderer. */
|
|
284
309
|
export type ChatFlowSlotProps = PropsRuntime<'conversation.chat.flow'> & PropsRenderSlots<'conversation.chat.node'> & PropsRenderFactories & PropsStore<ChatStore> & InjectFace<ChatFlowDataInjected> & PropsLocale<'chat'>;
|
|
285
310
|
/** Full Chat view props. */
|
|
286
|
-
export type ChatViewSlotProps = PropsRuntime<'conversation.view'> & PropsRenderSlots<'conversation.chat.flow'> & PropsStore<ChatStore> & InjectFace<ChatViewInjected> & PropsLocale<'chat'>;
|
|
311
|
+
export type ChatViewSlotProps = PropsRuntime<'conversation.view'> & PropsRenderSlots<'conversation.chat.flow' | 'conversation.chat.text-interaction'> & PropsStore<ChatStore> & InjectFace<ChatViewInjected> & PropsLocale<'chat'>;
|
|
287
312
|
/** Full props shared by the user and output image entries. */
|
|
288
313
|
export type MessageImagesProps = PropsRuntime<'conversation.chat.user.images' | 'conversation.chat.message.images'> & PropsRenderFactories;
|
|
289
314
|
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
@@ -316,6 +341,12 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
316
341
|
};
|
|
317
342
|
}
|
|
318
343
|
interface SlotMap {
|
|
344
|
+
/** Area-local text gestures and surfaces; each consumer registers its own synchronous admission. */
|
|
345
|
+
'conversation.chat.text-interaction': {
|
|
346
|
+
kind: 'keyed';
|
|
347
|
+
scope: 'session';
|
|
348
|
+
owner: TextInteractionSurface;
|
|
349
|
+
};
|
|
319
350
|
/** Ordered Chat rows and local echoes with viewport-bound visibility hooks. */
|
|
320
351
|
'conversation.chat.flow': {
|
|
321
352
|
kind: 'single';
|
|
@@ -341,6 +372,17 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
341
372
|
hookContext: ChatNodeHookContext;
|
|
342
373
|
inject: ChatNodeInjected;
|
|
343
374
|
};
|
|
375
|
+
/**
|
|
376
|
+
* Message-source decoration owned and rendered by the user Node entry.
|
|
377
|
+
* Selectors elect one component from the durable source and row kind.
|
|
378
|
+
* No match renders no visible content; steering and pending rows do not
|
|
379
|
+
* render this slot.
|
|
380
|
+
*/
|
|
381
|
+
'conversation.chat.user.before': {
|
|
382
|
+
kind: 'chain';
|
|
383
|
+
scope: 'session';
|
|
384
|
+
owner: UserBeforeOwnerProps;
|
|
385
|
+
};
|
|
344
386
|
/**
|
|
345
387
|
* Renderer for one consecutive group of durable message images. The owner
|
|
346
388
|
* supplies image references, an authorized loader, and alignment. A
|
|
@@ -76,9 +76,10 @@ export interface ChatTurnProcessPresentation {
|
|
|
76
76
|
readonly turnStarted: boolean;
|
|
77
77
|
readonly turnClosed: boolean;
|
|
78
78
|
readonly hasExternalProcess: boolean;
|
|
79
|
+
/** Like `hasExternalProcess`, but a reply from another Step counts only through its reasoning. */
|
|
80
|
+
readonly hasNonReplyProcess: boolean;
|
|
79
81
|
/** A visible input after process output prevents one disclosure from hiding its surrounding groups. */
|
|
80
82
|
readonly hasInterleavedInput: boolean;
|
|
81
|
-
readonly compactAnswer: boolean;
|
|
82
83
|
}
|
|
83
84
|
/** Compatibility projection backing the composer stats pills (StatsPills.tsx) and the legacy top-level snapshot fields. */
|
|
84
85
|
export interface LegacyConversationSlice {
|
|
@@ -25,7 +25,12 @@ export interface InboxState {
|
|
|
25
25
|
/** Message ids in the current claim, shared until the next claim. */
|
|
26
26
|
readonly currentClaimed: ReadonlySet<string>;
|
|
27
27
|
readonly claimSeq: number;
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* First human message id of the current claim in Inbox order; undefined
|
|
30
|
+
* when the claim took no human message. The AgentLoop logs a claim's
|
|
31
|
+
* messages in this order, so this message is the claim's first steering row.
|
|
32
|
+
*/
|
|
33
|
+
readonly firstClaimedHuman: string | undefined;
|
|
29
34
|
}
|
|
30
35
|
/** Persistent next-step claims identify messages admitted into a running Turn. */
|
|
31
36
|
export declare const nextStepInboxDefinition: ConversationNodeDefinition<InboxState>;
|
|
@@ -11,6 +11,11 @@ interface ReferencedSteeringMessageNode extends SteeringMessageNode {
|
|
|
11
11
|
readonly referenceLabels?: readonly string[];
|
|
12
12
|
/** Skill names the same step's `skill-invocation` injections loaded. */
|
|
13
13
|
readonly skillNames?: readonly string[];
|
|
14
|
+
/**
|
|
15
|
+
* First human message of its `next-step` claim that Chat orders after its Turn's process control;
|
|
16
|
+
* the row keeps the Turn tail slot above it.
|
|
17
|
+
*/
|
|
18
|
+
readonly batchStart?: true;
|
|
14
19
|
}
|
|
15
20
|
type MessageNode = ReferencedUserMessageNode | ReferencedSteeringMessageNode | (ContextMessageNode & {
|
|
16
21
|
readonly waking?: boolean;
|
|
@@ -23,10 +23,22 @@ interface TurnProcessState {
|
|
|
23
23
|
readonly toolCallCount: number;
|
|
24
24
|
readonly subagentCount: number;
|
|
25
25
|
}
|
|
26
|
+
/** Turn of one Step that recorded durable process evidence. */
|
|
27
|
+
export interface ProcessEvidenceState {
|
|
28
|
+
readonly turn: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* State-only record of each Step whose durable events include process evidence, keyed by Turn and Step.
|
|
32
|
+
* An input follows its Turn's process control exactly when its Turn recorded evidence before it, so an
|
|
33
|
+
* input reads the nearest earlier record through `reader.previous`. A Step's evidence is logged before
|
|
34
|
+
* a later Step admits input, so the record a later input reads no longer changes; transient live chunks
|
|
35
|
+
* are not needed because a Step's durable settlement precedes the next Step's input.
|
|
36
|
+
*/
|
|
37
|
+
export declare const processEvidenceDefinition: ConversationNodeDefinition<ProcessEvidenceState>;
|
|
26
38
|
/** Turn-scoped process range and answer-boundary Definition. */
|
|
27
39
|
export declare const turnProcessDefinition: ConversationNodeDefinition<TurnProcessState>;
|
|
28
40
|
/**
|
|
29
|
-
* Register the Turn-scoped process disclosure projection.
|
|
41
|
+
* Register the Turn-scoped process disclosure projection and its per-Step evidence record.
|
|
30
42
|
* @param ctx - owning UI Conversation context.
|
|
31
43
|
*/
|
|
32
44
|
export declare function registerTurnProcess(ctx: Context): void;
|
|
@@ -19,7 +19,7 @@ export type { ChatStoreState, ToolCallId, TurnProcessViewEntry } from './contrac
|
|
|
19
19
|
export type { TranscriptViewRowInjected, TranscriptViewRowProps } from './settings/TranscriptViewRow.tsx';
|
|
20
20
|
export type { TranscriptViewMode } from '../chat-settings.ts';
|
|
21
21
|
export type { ChatPresentationPolicy } from './presentation-policy.ts';
|
|
22
|
-
export type { AssistantActionOwnerProps, ChatFileMentions, ChatNodeHookContext, ChatNodeInjected, ChatNodeOwnerProps, ChatNodeViewProps, ChatScrollPosition, ChatStore, ChatViewInjected, ChatViewSlotProps, ChatFlowDataInjected, ChatFlowHookContext, ChatFlowInjected, ChatFlowOwnerProps, ChatFlowSlotProps, UseGroupHeaderAction, CommandRowOwnerProps, CommandRowProps, MessageImagesProps, OpenFileOptions, PresentationInjected, QuotaNoticeCode, QuotaNoticeHostProps, QuotaNoticeInjected, QuotaNoticeOwnerProps, QuotaNoticeState, ReasoningBodyOwnerProps, ReasoningContentInput, UserContentAttachment, UserContentData, UserContentInput, TurnProcessOwnerProps, TurnTailOwnerProps, UseChat, UseChatNodeTurnData, UseDisclosure, UsePresentation, UseGroupAction, } from './contract/slots.ts';
|
|
22
|
+
export type { AssistantActionOwnerProps, ChatFileMentions, ChatNodeHookContext, ChatNodeInjected, ChatNodeOwnerProps, ChatNodeViewProps, ChatScrollPosition, ChatStore, ChatViewInjected, ChatViewSlotProps, ChatFlowDataInjected, ChatFlowHookContext, ChatFlowInjected, ChatFlowOwnerProps, ChatFlowSlotProps, UseGroupHeaderAction, CommandRowOwnerProps, CommandRowProps, MessageImagesProps, OpenFileOptions, PresentationInjected, QuotaNoticeCode, QuotaNoticeHostProps, QuotaNoticeInjected, QuotaNoticeOwnerProps, QuotaNoticeState, ReasoningBodyOwnerProps, ReasoningContentInput, UserContentAttachment, UserContentData, UserContentInput, UserBeforeOwnerProps, TurnProcessOwnerProps, TurnTailOwnerProps, UseChat, UseChatNodeTurnData, UseDisclosure, UsePresentation, UseGroupAction, } from './contract/slots.ts';
|
|
23
23
|
export type { TurnProcessSpec, } from './contract/turn-process.ts';
|
|
24
24
|
export type { ChatKey } from './locale.ts';
|
|
25
25
|
export type { ConversationContext, ConversationContextOriginKind } from './model/conversation-context.ts';
|