@deepseek-ai/dsh-client-ui-chat 0.2.1-alpha.1 → 0.2.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +12 -12
- package/README.md +32 -10
- package/README.zh.md +32 -10
- package/lib/client.js +5764 -5695
- package/lib/index.js +11 -1
- package/lib/types/chat-settings.d.ts +13 -0
- package/lib/types/client/apply.d.ts +5 -0
- package/lib/types/client/chat/AssistantMarkdown.d.ts +7 -6
- package/lib/types/client/chat/AssistantNodeView.d.ts +3 -3
- package/lib/types/client/chat/ChatFlow.d.ts +4 -0
- package/lib/types/client/chat/ChatGroupSeat.d.ts +4 -3
- package/lib/types/client/chat/ChatNodeSeat.d.ts +11 -8
- package/lib/types/client/chat/ChatView.d.ts +1 -1
- package/lib/types/client/chat/MessageItem.d.ts +10 -9
- package/lib/types/client/chat/ReasoningContent.d.ts +16 -0
- package/lib/types/client/chat/ReasoningRow.d.ts +5 -3
- package/lib/types/client/chat/TurnTailNodeView.d.ts +1 -1
- package/lib/types/client/chat/UserContent.d.ts +9 -0
- package/lib/types/client/chat/flow-motion.d.ts +103 -0
- package/lib/types/client/chat/searchable-hidden.d.ts +10 -2
- package/lib/types/client/chat/turn-trigger.d.ts +1 -1
- package/lib/types/client/chat/use-chat-reading.d.ts +22 -4
- package/lib/types/client/chat/use-chat-scroll.d.ts +9 -1
- package/lib/types/client/chat/use-chat-viewport.d.ts +63 -4
- package/lib/types/client/chat/use-scroll-follow.d.ts +4 -3
- package/lib/types/client/contract/chat-nodes.d.ts +8 -0
- package/lib/types/client/contract/group-tree.d.ts +32 -0
- package/lib/types/client/contract/slots.d.ts +133 -20
- package/lib/types/client/contract/snapshot.d.ts +5 -0
- package/lib/types/client/contract/store.d.ts +3 -1
- package/lib/types/client/contract/turn-process.d.ts +0 -2
- package/lib/types/client/conversation-nodes/common.d.ts +12 -1
- package/lib/types/client/conversation-nodes/group-tree-segments.d.ts +42 -0
- package/lib/types/client/index.d.ts +2 -1
- package/lib/types/client/locale.d.ts +12 -2
- package/lib/types/client/performance-usage.d.ts +2 -2
- package/lib/types/client/presentation-policy.d.ts +14 -15
- package/lib/types/client/settings/TranscriptViewRow.d.ts +7 -2
- package/lib/types/client/stores.d.ts +11 -1
- package/lib/types/client/transcript-view.d.ts +9 -1
- package/lib/types/index.d.ts +5 -1
- package/locale/en.json +5 -0
- package/locale/zh.json +6 -0
- package/package.json +44 -44
package/lib/index.js
CHANGED
|
@@ -5,6 +5,12 @@ import z from "@deepseek-ai/schemastery";
|
|
|
5
5
|
const CHAT_SETTINGS_NAMESPACE = "ui-chat";
|
|
6
6
|
/** Field carrying the work-details presentation mode. */
|
|
7
7
|
const TRANSCRIPT_VIEW_FIELD = "transcriptView";
|
|
8
|
+
/** Field carrying the independent work-details collapse timing. */
|
|
9
|
+
const COLLAPSE_TIMING_FIELD = "collapseTiming";
|
|
10
|
+
/** Available points when a completed Turn returns to its historical presentation. */
|
|
11
|
+
const COLLAPSE_TIMINGS = ["completion", "next-input"];
|
|
12
|
+
/** Preserve completion-time folding when no timing preference is saved. */
|
|
13
|
+
const DEFAULT_COLLAPSE_TIMING = "completion";
|
|
8
14
|
/** Work-details presentation modes a user can choose. */
|
|
9
15
|
const TRANSCRIPT_VIEW_MODES = [
|
|
10
16
|
"compact",
|
|
@@ -31,9 +37,12 @@ const DEFAULT_TRANSCRIPT_VIEW_MODE = "detailed";
|
|
|
31
37
|
const PERFORMANCE_USAGE_MODES = ["compact", "detailed"];
|
|
32
38
|
/** Preserve detailed accounting for users without an explicit preference. */
|
|
33
39
|
const DEFAULT_PERFORMANCE_USAGE = "detailed";
|
|
40
|
+
/** Preserve the built-in browser for users without an explicit preference. */
|
|
41
|
+
const DEFAULT_LINK_OPENING = "sidebar";
|
|
34
42
|
/** Durable Chat schema; also the wire envelope the browser scope validates against. */
|
|
35
43
|
const ChatSettingsFields = {
|
|
36
|
-
|
|
44
|
+
[COLLAPSE_TIMING_FIELD]: z.union([...COLLAPSE_TIMINGS]).default(DEFAULT_COLLAPSE_TIMING),
|
|
45
|
+
linkOpening: z.union(["sidebar", "new-tab"]).default(DEFAULT_LINK_OPENING),
|
|
37
46
|
performanceUsage: z.union([...PERFORMANCE_USAGE_MODES]).default(DEFAULT_PERFORMANCE_USAGE),
|
|
38
47
|
[TRANSCRIPT_VIEW_FIELD]: z.union([...TRANSCRIPT_VIEW_SETTING_VALUES]).loose()
|
|
39
48
|
};
|
|
@@ -43,6 +52,7 @@ z.object(ChatSettingsFields);
|
|
|
43
52
|
/** Live preferences projected to the browser. */
|
|
44
53
|
const Config = z.object({
|
|
45
54
|
[TRANSCRIPT_VIEW_FIELD]: ChatSettingsFields[TRANSCRIPT_VIEW_FIELD].volatile(),
|
|
55
|
+
collapseTiming: ChatSettingsFields.collapseTiming.volatile(),
|
|
46
56
|
performanceUsage: ChatSettingsFields["performanceUsage"].volatile(),
|
|
47
57
|
linkOpening: ChatSettingsFields.linkOpening.volatile()
|
|
48
58
|
});
|
|
@@ -4,6 +4,14 @@ import z from '@deepseek-ai/schemastery';
|
|
|
4
4
|
export declare const CHAT_SETTINGS_NAMESPACE = "ui-chat";
|
|
5
5
|
/** Field carrying the work-details presentation mode. */
|
|
6
6
|
export declare const TRANSCRIPT_VIEW_FIELD = "transcriptView";
|
|
7
|
+
/** Field carrying the independent work-details collapse timing. */
|
|
8
|
+
export declare const COLLAPSE_TIMING_FIELD = "collapseTiming";
|
|
9
|
+
/** Available points when a completed Turn returns to its historical presentation. */
|
|
10
|
+
export declare const COLLAPSE_TIMINGS: readonly ["completion", "next-input"];
|
|
11
|
+
/** When a completed Turn returns to its historical presentation. */
|
|
12
|
+
export type CollapseTiming = typeof COLLAPSE_TIMINGS[number];
|
|
13
|
+
/** Preserve completion-time folding when no timing preference is saved. */
|
|
14
|
+
export declare const DEFAULT_COLLAPSE_TIMING: CollapseTiming;
|
|
7
15
|
/** Work-details presentation modes a user can choose. */
|
|
8
16
|
export declare const TRANSCRIPT_VIEW_MODES: readonly ["compact", "standard", "detailed", "verbose"];
|
|
9
17
|
/** Work-details presentation mode. */
|
|
@@ -31,6 +39,8 @@ export declare const DEFAULT_LINK_OPENING: LinkOpening;
|
|
|
31
39
|
export interface ChatSettings {
|
|
32
40
|
/** Work-details preference; absence uses the client default, and legacy saved values remain accepted. */
|
|
33
41
|
transcriptView?: TranscriptViewMode | typeof LEGACY_TRANSCRIPT_VIEW_MODE | typeof LEGACY_EXPANDED_TRANSCRIPT_VIEW_MODE | null;
|
|
42
|
+
/** Independent collapse timing; absence preserves completion-time folding. */
|
|
43
|
+
collapseTiming?: CollapseTiming;
|
|
34
44
|
/** Detail level for composer statistics and completed-Turn usage. */
|
|
35
45
|
performanceUsage: PerformanceUsageMode;
|
|
36
46
|
/** Default destination for Chat HTTP(S) links. */
|
|
@@ -38,16 +48,19 @@ export interface ChatSettings {
|
|
|
38
48
|
}
|
|
39
49
|
/** Durable Chat schema; also the wire envelope the browser scope validates against. */
|
|
40
50
|
export declare const ChatSettingsFields: {
|
|
51
|
+
collapseTiming: z<"completion" | "next-input", "completion" | "next-input", "defined">;
|
|
41
52
|
linkOpening: z<"sidebar" | "new-tab", "sidebar" | "new-tab", "defined">;
|
|
42
53
|
performanceUsage: z<"compact" | "detailed", "compact" | "detailed", "defined">;
|
|
43
54
|
transcriptView: z<"compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "plain">;
|
|
44
55
|
};
|
|
45
56
|
/** Schema for shared configuration values. */
|
|
46
57
|
export declare const ChatSettingsSchema: z<Schemastery.ObjectS<NoInfer<{
|
|
58
|
+
collapseTiming: z<"completion" | "next-input", "completion" | "next-input", "defined">;
|
|
47
59
|
linkOpening: z<"sidebar" | "new-tab", "sidebar" | "new-tab", "defined">;
|
|
48
60
|
performanceUsage: z<"compact" | "detailed", "compact" | "detailed", "defined">;
|
|
49
61
|
transcriptView: z<"compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "plain">;
|
|
50
62
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
63
|
+
collapseTiming: z<"completion" | "next-input", "completion" | "next-input", "defined">;
|
|
51
64
|
linkOpening: z<"sidebar" | "new-tab", "sidebar" | "new-tab", "defined">;
|
|
52
65
|
performanceUsage: z<"compact" | "detailed", "compact" | "detailed", "defined">;
|
|
53
66
|
transcriptView: z<"compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "compact" | "standard" | "detailed" | "verbose" | "normal" | "expanded", "plain">;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ChatFlowInjected, ChatNodeInjected } from './contract/slots.ts';
|
|
3
|
+
/** Bind group and header visibility to the viewport of one flow render. */
|
|
4
|
+
export declare const CHAT_FLOW_INJECT: ChatFlowInjected;
|
|
5
|
+
/** Bind node-local sources and forward the flow's existing visibility hook. */
|
|
6
|
+
export declare const CHAT_NODE_INJECT: ChatNodeInjected;
|
|
2
7
|
/** Services required by the Chat target and its presentation registrations. */
|
|
3
8
|
export declare const inject: string[];
|
|
4
9
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots';
|
|
1
2
|
import type { MarkdownFileMentions } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
2
|
-
import type { ChatNodeOwnerProps, ChatViewSlotProps, UseDisclosure, UsePresentation } from '../contract/slots.ts';
|
|
3
|
+
import type { ChatNodeOwnerProps, ChatViewSlotProps, UseDisclosure, UsePresentation, UseGroupAction } from '../contract/slots.ts';
|
|
3
4
|
import type { AssistantBlock } from '../contract/snapshot.ts';
|
|
4
5
|
/**
|
|
5
6
|
* Standalone fallback for image destinations (query/fragment suffixes are ignored).
|
|
@@ -12,7 +13,7 @@ import type { AssistantBlock } from '../contract/snapshot.ts';
|
|
|
12
13
|
* protocols and non-local paths.
|
|
13
14
|
*/
|
|
14
15
|
export declare function localPathMediaUrl(base: string, value: string): string | undefined;
|
|
15
|
-
export interface AssistantMarkdownProps {
|
|
16
|
+
export interface AssistantMarkdownProps extends Pick<PropsRenderSlots<'conversation.chat.reasoning.body' | 'conversation.chat.message.images'>, 'renderSlot'>, Pick<ChatNodeOwnerProps, 'loadImage'> {
|
|
16
17
|
/** Render only the requested business portion, preserving original block indexes. */
|
|
17
18
|
groupPart?: string | undefined;
|
|
18
19
|
/** Stable Hook forwarded to each independently expandable reasoning block. */
|
|
@@ -21,10 +22,10 @@ export interface AssistantMarkdownProps {
|
|
|
21
22
|
streaming: boolean;
|
|
22
23
|
/** Frozen partial of an aborted turn: rendered with a stopped marker. */
|
|
23
24
|
interrupted?: boolean | undefined;
|
|
24
|
-
/** Render consecutive image blocks through the attachment slot. */
|
|
25
|
-
renderMessageImages: ChatNodeOwnerProps['renderMessageImages'];
|
|
26
25
|
/** Hide reasoning that belongs to the Turn-level process disclosure. */
|
|
27
26
|
reasoningHidden?: boolean | undefined;
|
|
27
|
+
/** Process hiding bound by the node slot to its current viewport. */
|
|
28
|
+
useGroupAction: UseGroupAction;
|
|
28
29
|
/** Live display policy for reasoning summaries. */
|
|
29
30
|
usePresentation: UsePresentation;
|
|
30
31
|
/** Reveal the disclosure that hides this reasoning. */
|
|
@@ -34,6 +35,6 @@ export interface AssistantMarkdownProps {
|
|
|
34
35
|
/** The owning view's locale seat, passed down as a plain prop. */
|
|
35
36
|
t: ChatViewSlotProps['t'];
|
|
36
37
|
}
|
|
37
|
-
/**
|
|
38
|
-
export declare const AssistantMarkdown: import("react").MemoExoticComponent<({ blocks, streaming, interrupted,
|
|
38
|
+
/** 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>;
|
|
39
40
|
//# sourceMappingURL=AssistantMarkdown.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { InjectFace } from '@deepseek-ai/dsh-client-ui-slots';
|
|
1
|
+
import type { InjectFace, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
2
|
import type { ChatNodeViewProps, PresentationInjected } from '../contract/slots.ts';
|
|
3
|
-
type AssistantNodeViewProps = ChatNodeViewProps<'assistant-step'> & InjectFace<PresentationInjected>;
|
|
3
|
+
type AssistantNodeViewProps = ChatNodeViewProps<'assistant-step'> & InjectFace<PresentationInjected> & PropsRenderSlots<'conversation.chat.reasoning.body' | 'conversation.chat.message.images'>;
|
|
4
4
|
/** Streaming, settled, and interrupted Assistant states share one keyed renderer instance. */
|
|
5
|
-
export declare const AssistantNodeView: import("react").MemoExoticComponent<({ node, groupPart, useDisclosure, useTurnData, turnProcess, openFile,
|
|
5
|
+
export declare const AssistantNodeView: import("react").MemoExoticComponent<({ node, groupPart, useDisclosure, useGroupAction, useTurnData, turnProcess, openFile, loadImage, fileMentions, usePresentation, renderSlot, t, }: AssistantNodeViewProps) => import("react").JSX.Element>;
|
|
6
6
|
export {};
|
|
7
7
|
//# sourceMappingURL=AssistantNodeView.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ChatFlowSlotProps } from '../contract/slots.ts';
|
|
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[]>;
|
|
4
|
+
//# sourceMappingURL=ChatFlow.d.ts.map
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/** Stable process container; display policy changes visibility, never member parents. */
|
|
2
2
|
import { type ComponentProps } from 'react';
|
|
3
3
|
import type { GroupKey } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ChatFlowSlotProps } from '../contract/slots.ts';
|
|
5
5
|
import { ChatNodeSeat } from './ChatNodeSeat.tsx';
|
|
6
6
|
type SeatProps = Omit<ComponentProps<typeof ChatNodeSeat>, 'nodeKey' | 'groupPart'>;
|
|
7
7
|
type ChatGroupSeatProps = SeatProps & {
|
|
8
8
|
readonly groupKey: GroupKey;
|
|
9
|
-
readonly useChatGroup:
|
|
9
|
+
readonly useChatGroup: ChatFlowSlotProps['useChatGroup'];
|
|
10
|
+
readonly useGroupHeaderAction: ChatFlowSlotProps['useGroupHeaderAction'];
|
|
10
11
|
};
|
|
11
12
|
/** 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 declare const ChatGroupSeat: import("react").MemoExoticComponent<({ groupKey, useChatGroup, useGroupHeaderAction, ...props }: ChatGroupSeatProps) => import("react").JSX.Element | null>;
|
|
13
14
|
export {};
|
|
14
15
|
//# sourceMappingURL=ChatGroupSeat.d.ts.map
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import type { ChatNodeOwnerProps,
|
|
1
|
+
import type { ChatNodeOwnerProps, ChatFlowSlotProps, UsePresentation } from '../contract/slots.ts';
|
|
2
2
|
import type { ChatNodeStore } from '../contract/snapshot.ts';
|
|
3
3
|
interface ChatNodeSeatProps extends ChatNodeOwnerProps {
|
|
4
4
|
readonly nodeKey: string;
|
|
5
5
|
/** A replaced Builder must rebind keyed hooks even when references and keys survive. */
|
|
6
6
|
readonly nodeStore: ChatNodeStore;
|
|
7
|
-
readonly useChatNode:
|
|
8
|
-
readonly useChatNodeProcess:
|
|
7
|
+
readonly useChatNode: ChatFlowSlotProps['useChatNode'];
|
|
8
|
+
readonly useChatNodeProcess: ChatFlowSlotProps['useChatNodeProcess'];
|
|
9
9
|
readonly usePresentation: UsePresentation;
|
|
10
|
-
readonly useStore:
|
|
11
|
-
readonly actions:
|
|
12
|
-
readonly renderSlot:
|
|
13
|
-
readonly t:
|
|
10
|
+
readonly useStore: ChatFlowSlotProps['useStore'];
|
|
11
|
+
readonly actions: ChatFlowSlotProps['actions'];
|
|
12
|
+
readonly renderSlot: ChatFlowSlotProps['renderSlot'];
|
|
13
|
+
readonly t: ChatFlowSlotProps['t'];
|
|
14
|
+
readonly useChatNodeBottom: ChatFlowSlotProps['useChatNodeBottom'];
|
|
15
|
+
readonly deferCollapse: boolean;
|
|
16
|
+
readonly useGroupAction: ChatFlowSlotProps['useGroupAction'];
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* Subscribe, apply Turn-process visibility, and dispatch one stable Context key.
|
|
17
20
|
* Policy reads select this seat's own conclusion, so a mode change re-renders
|
|
18
21
|
* only seats whose visibility actually changes.
|
|
19
22
|
*/
|
|
20
|
-
export declare const ChatNodeSeat: import("react").MemoExoticComponent<({ nodeKey, groupPart, useChatNode, useChatNodeProcess, usePresentation, cwd, openFile,
|
|
23
|
+
export declare const ChatNodeSeat: import("react").MemoExoticComponent<({ nodeKey, groupPart, useChatNode, useChatNodeProcess, usePresentation, cwd, openFile, inspectCall, forkAt, loadImage, fileMentions, useStore, actions, renderSlot, t, useChatNodeBottom, deferCollapse, useGroupAction, }: ChatNodeSeatProps) => import("react").JSX.Element | null>;
|
|
21
24
|
export {};
|
|
22
25
|
//# 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,
|
|
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;
|
|
7
7
|
//# sourceMappingURL=ChatView.d.ts.map
|
|
@@ -1,32 +1,33 @@
|
|
|
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
4
|
import type { ChatNodeOwnerProps, ChatNodeViewProps, ChatViewSlotProps } from '../contract/slots.ts';
|
|
4
5
|
/**
|
|
5
6
|
* Render one Host-authoritative pending steering item with the same visual
|
|
6
7
|
* language as its eventual durable transcript node.
|
|
7
|
-
* @param props -
|
|
8
|
+
* @param props - pending content, authorized image loader, and Factory/locale seats.
|
|
8
9
|
* @returns the pending steering bubble.
|
|
9
10
|
*/
|
|
10
|
-
export declare function PendingSteeringBubble({ content,
|
|
11
|
+
export declare function PendingSteeringBubble({ content, loadImage, renderFactorySlot, t }: {
|
|
11
12
|
content: readonly unknown[];
|
|
12
|
-
|
|
13
|
+
renderFactorySlot: PropsRenderFactories['renderFactorySlot'];
|
|
13
14
|
t: ChatViewSlotProps['t'];
|
|
14
|
-
}): ReactNode;
|
|
15
|
+
} & Pick<ChatNodeOwnerProps, 'loadImage'>): ReactNode;
|
|
15
16
|
/**
|
|
16
17
|
* Render one local transcript or steering submission echo with the same
|
|
17
18
|
* visual language and surface marker as the Host occurrence that replaces
|
|
18
19
|
* it: draft text plus object-URL previews, visible from the submit click
|
|
19
20
|
* until the durable `user/message` or steering occurrence renders.
|
|
20
|
-
* @param props - the
|
|
21
|
+
* @param props - the pending submission, authorized image loader, and render seats.
|
|
21
22
|
* @returns the echoed user bubble.
|
|
22
23
|
*/
|
|
23
|
-
export declare function PendingSubmissionBubble({ submission,
|
|
24
|
+
export declare function PendingSubmissionBubble({ submission, loadImage, renderFactorySlot, t }: {
|
|
24
25
|
submission: PendingSubmission;
|
|
25
|
-
|
|
26
|
+
renderFactorySlot: PropsRenderFactories['renderFactorySlot'];
|
|
26
27
|
t: ChatViewSlotProps['t'];
|
|
27
|
-
}): ReactNode;
|
|
28
|
+
} & Pick<ChatNodeOwnerProps, 'loadImage'>): ReactNode;
|
|
28
29
|
/** User and admitted-steering keyed Chat renderer. */
|
|
29
|
-
export declare const UserMessageNodeView: import("react").MemoExoticComponent<({ node,
|
|
30
|
+
export declare const UserMessageNodeView: import("react").MemoExoticComponent<({ node, renderFactorySlot, loadImage, t, }: ChatNodeViewProps<"user" | "steering">) => import("react").JSX.Element>;
|
|
30
31
|
/** Injected-context keyed Chat renderer. */
|
|
31
32
|
export declare const ContextMessageNodeView: import("react").MemoExoticComponent<({ node, t }: ChatNodeViewProps<"context">) => import("react").JSX.Element>;
|
|
32
33
|
/** Automatic compaction keyed Chat renderer. */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FactoryComponentPropsOf, PropsRenderFactories, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
+
type ReasoningBodyProps = PropsRuntime<'conversation.chat.reasoning.body'> & PropsRenderFactories;
|
|
3
|
+
/**
|
|
4
|
+
* Render compact reasoning with caller-supplied labels or Chat's defaults.
|
|
5
|
+
* @param props - display text, streaming state, optional localized labels, and the Factory's locale seat; no Session is required.
|
|
6
|
+
* @returns the standard reasoning content; supplied labels are used without merging defaults.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ReasoningContent: import("react").MemoExoticComponent<({ text, running, labels, t }: FactoryComponentPropsOf<"conversation.chat.reasoning.content">) => import("react").JSX.Element>;
|
|
9
|
+
/**
|
|
10
|
+
* Render the default Body through the same Factory available to third-party wrappers.
|
|
11
|
+
* @param props - original reasoning and the framework's Factory renderer.
|
|
12
|
+
* @returns an occurrence of the official reasoning Content Factory.
|
|
13
|
+
*/
|
|
14
|
+
export declare function DefaultReasoningBody({ text, running, renderFactorySlot }: ReasoningBodyProps): import("react").ReactNode;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=ReasoningContent.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots';
|
|
1
2
|
import type { ChatViewSlotProps, UseDisclosure, UsePresentation } from '../contract/slots.ts';
|
|
2
3
|
/**
|
|
3
4
|
* Render one assistant reasoning block collapsed until the reader opens it. The
|
|
@@ -9,14 +10,15 @@ import type { ChatViewSlotProps, UseDisclosure, UsePresentation } from '../contr
|
|
|
9
10
|
* @param props.running - whether this block is the streaming tail.
|
|
10
11
|
* @param props.usePresentation - live display-policy selector for this reasoning row.
|
|
11
12
|
* @param props.useDisclosure - independent open state with enclosing-Turn resets.
|
|
12
|
-
* @param props.
|
|
13
|
+
* @param props.renderSlot - framework renderer for the standard reasoning Body Slot.
|
|
14
|
+
* @param props.t - conversation locale seat for the disclosure and running status.
|
|
13
15
|
* @returns the reasoning disclosure.
|
|
14
16
|
*/
|
|
15
|
-
export declare const ReasoningRow: import("react").MemoExoticComponent<({ text, running, usePresentation, useDisclosure, t }: {
|
|
17
|
+
export declare const ReasoningRow: import("react").MemoExoticComponent<({ text, running, usePresentation, useDisclosure, renderSlot, t }: {
|
|
16
18
|
text: string;
|
|
17
19
|
running: boolean;
|
|
18
20
|
useDisclosure: UseDisclosure;
|
|
19
21
|
usePresentation: UsePresentation;
|
|
20
22
|
t: ChatViewSlotProps["t"];
|
|
21
|
-
}) => import("react").JSX.Element>;
|
|
23
|
+
} & Pick<PropsRenderSlots<"conversation.chat.reasoning.body">, "renderSlot">) => import("react").JSX.Element>;
|
|
22
24
|
//# sourceMappingURL=ReasoningRow.d.ts.map
|
|
@@ -2,6 +2,6 @@ import type { InjectFace, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-sl
|
|
|
2
2
|
import type { ChatNodeViewProps, PerformanceUsageInjected } from '../contract/slots.ts';
|
|
3
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, usePerformanceUsage, }: TurnTailNodeViewProps) => import("react").JSX.Element | null>;
|
|
5
|
+
export declare const TurnTailNodeView: import("react").MemoExoticComponent<({ node, openFile, forkAt, renderSlot, t, useAccess, useChat, usePerformanceUsage, }: TurnTailNodeViewProps) => import("react").JSX.Element | null>;
|
|
6
6
|
export {};
|
|
7
7
|
//# sourceMappingURL=TurnTailNodeView.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FactoryComponentPropsOf } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
+
/**
|
|
3
|
+
* Render prepared text, ordered attachments, and references without message chrome.
|
|
4
|
+
* The caller owns row identity, pending/echo state, time, and message actions.
|
|
5
|
+
* @param props - prepared content, facts, authorized image loader, and framework Factory/locale seats.
|
|
6
|
+
* @returns the content stack using the existing user-message layout.
|
|
7
|
+
*/
|
|
8
|
+
export declare function UserContent({ content, loadImage, facts, interactive, ellipsis, renderSlot, renderFactorySlot, t }: FactoryComponentPropsOf<'conversation.chat.user.content'>): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=UserContent.d.ts.map
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fold transitions owned by one Chat viewport. Every batch containing a closing row moves its boxes and
|
|
3
|
+
* the scrollport on one frame clock; a batch that only reveals rows, or a viewport without a reading
|
|
4
|
+
* policy, uses CSS transitions. Motion is opt-in under `[data-chat-motion]`, respects reduced motion,
|
|
5
|
+
* and clears temporary styles.
|
|
6
|
+
*/
|
|
7
|
+
import { type RefObject } from 'react';
|
|
8
|
+
/** Row-local operations supplied by the containing viewport. */
|
|
9
|
+
export interface FlowMotionRows {
|
|
10
|
+
/** @param element - visible row. @param done - commits hidden state before idle callbacks run. */
|
|
11
|
+
collapse(element: HTMLElement, done: () => void): void;
|
|
12
|
+
/** @param element - newly visible row to grow to its natural size. */
|
|
13
|
+
reveal(element: HTMLElement): void;
|
|
14
|
+
/** @param element - row whose active transition should be cancelled without hiding it. */
|
|
15
|
+
cancelMotion(element: HTMLElement): void;
|
|
16
|
+
}
|
|
17
|
+
/** Geometry captured before one fold batch changes its boxes. */
|
|
18
|
+
export interface InputFoldBox {
|
|
19
|
+
readonly element: HTMLElement;
|
|
20
|
+
readonly height: number;
|
|
21
|
+
readonly marginTop: number;
|
|
22
|
+
readonly closing: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** The viewport moves on the same progress that changes the folded boxes. */
|
|
25
|
+
export interface InputFoldDriver {
|
|
26
|
+
/**
|
|
27
|
+
* Capture geometry and choose the landing before the frame clock changes the boxes.
|
|
28
|
+
* @param boxes - non-nested boxes whose layout changes on this clock.
|
|
29
|
+
* @returns closing boxes that scroll with the content and stay opaque; the rest fade in place. The driver
|
|
30
|
+
* may add boxes while the batch runs, when a newer tail request takes it over.
|
|
31
|
+
*/
|
|
32
|
+
begin(boxes: readonly InputFoldBox[]): ReadonlySet<HTMLElement>;
|
|
33
|
+
/**
|
|
34
|
+
* Reserve scroll range before box writes.
|
|
35
|
+
* @param progress - shared eased progress from zero to one.
|
|
36
|
+
* @param cancelled - a reading gesture stopped a tail landing's automatic target; a landing that keeps
|
|
37
|
+
* the reader's content still continues and includes the reader's own movement.
|
|
38
|
+
*/
|
|
39
|
+
prepare(progress: number, cancelled: boolean): void;
|
|
40
|
+
/**
|
|
41
|
+
* Apply viewport geometry after box writes.
|
|
42
|
+
* @param progress - shared eased progress from zero to one.
|
|
43
|
+
* @param cancelled - a reading gesture stopped a tail landing's automatic target.
|
|
44
|
+
* @returns actual scrollTop displacement from the batch start, for closing-content visual compensation.
|
|
45
|
+
*/
|
|
46
|
+
frame(progress: number, cancelled: boolean): number;
|
|
47
|
+
/**
|
|
48
|
+
* Install the final geometry after the last frame or cancellation.
|
|
49
|
+
* @param cancelled - a reading gesture stopped the automatic target, every closing row reopened, or the
|
|
50
|
+
* viewport detached; the driver commits no obsolete landing.
|
|
51
|
+
*/
|
|
52
|
+
finish(cancelled: boolean): void;
|
|
53
|
+
}
|
|
54
|
+
/** Animation lifetime and fold coordination for one viewport. */
|
|
55
|
+
export interface FlowMotion extends FlowMotionRows {
|
|
56
|
+
/** @returns whether a row owned by this viewport is closing. */
|
|
57
|
+
foldActive(): boolean;
|
|
58
|
+
/** @param listener - callback after the last fold. @returns cancellation for a pending callback. */
|
|
59
|
+
onFoldIdle(listener: () => void): () => void;
|
|
60
|
+
/** Stop the running batch's automatic target while letting its boxes finish. */
|
|
61
|
+
cancelInput(): void;
|
|
62
|
+
/** Restore the running batch's automatic target after a newer request takes it over. */
|
|
63
|
+
resumeInput(): void;
|
|
64
|
+
/** @returns whether a fold batch runs, or one is scheduled for this commit's closing rows. */
|
|
65
|
+
inputActive(): boolean;
|
|
66
|
+
/** Cancel owned animations and pending work when the viewport detaches. */
|
|
67
|
+
clear(): void;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Decide whether a row may animate: inside a live scope and not under reduced motion.
|
|
71
|
+
* @param element - row about to be hidden.
|
|
72
|
+
* @returns whether the fade-then-close transition applies.
|
|
73
|
+
*/
|
|
74
|
+
export declare function motionEnabled(element: HTMLElement): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Whether a row is already hidden or on its way there.
|
|
77
|
+
* @param element - row under Turn-level visibility control.
|
|
78
|
+
* @returns hidden attribute present or a collapse transition outstanding.
|
|
79
|
+
*/
|
|
80
|
+
export declare function hiddenOrCollapsing(element: HTMLElement): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Create animation coordination without cross-viewport broadcasts.
|
|
83
|
+
* @param driver - the viewport's driver for the next batch; null while detached.
|
|
84
|
+
* @param foldingChanged - disable or restore this viewport's native scroll anchoring.
|
|
85
|
+
* @returns stable callbacks and cleanup for this viewport's animations.
|
|
86
|
+
*/
|
|
87
|
+
export declare function createFlowMotion(driver: () => InputFoldDriver | null, foldingChanged: (active: boolean) => void): FlowMotion;
|
|
88
|
+
/**
|
|
89
|
+
* Apply searchable hiding with the containing Chat viewport's optional fold animation.
|
|
90
|
+
* @param hidden - desired visibility.
|
|
91
|
+
* @param reveal - browser-find and focus-protection callback.
|
|
92
|
+
* @param motion - owning viewport's row callbacks; undefined applies visibility synchronously.
|
|
93
|
+
* @returns the stable subtree ref.
|
|
94
|
+
*/
|
|
95
|
+
export declare function useFlowHidden(hidden: boolean, reveal: () => void, motion: FlowMotionRows | undefined): RefObject<HTMLDivElement>;
|
|
96
|
+
/**
|
|
97
|
+
* Toggle a plain hidden attribute on the fold clock, growing newly revealed headers.
|
|
98
|
+
* @param ref - element whose visibility follows hidden.
|
|
99
|
+
* @param hidden - desired hidden state.
|
|
100
|
+
* @param motion - containing viewport's row callbacks.
|
|
101
|
+
*/
|
|
102
|
+
export declare function useMotionHidden(ref: RefObject<HTMLElement | null>, hidden: boolean, motion: FlowMotionRows): void;
|
|
103
|
+
//# sourceMappingURL=flow-motion.d.ts.map
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Optional visibility operation; its caller owns cancellation and eventually commits the attribute.
|
|
4
|
+
* @param element - stable subtree root.
|
|
5
|
+
* @param hidden - desired hidden state.
|
|
6
|
+
* @param commit - apply the final visibility before reporting the operation complete.
|
|
7
|
+
*/
|
|
8
|
+
export type HiddenTransition = (element: HTMLElement, hidden: boolean, commit: () => void) => void;
|
|
2
9
|
/**
|
|
3
10
|
* Apply searchable hidden state without unmounting a stable subtree.
|
|
4
11
|
* @param hidden - whether the subtree is currently hidden.
|
|
5
|
-
* @param reveal - callback for browser find's
|
|
12
|
+
* @param reveal - callback for browser find's beforematch reveal.
|
|
13
|
+
* @param transition - optional caller-owned visibility operation; otherwise apply synchronously.
|
|
6
14
|
* @returns ref for the stable subtree root.
|
|
7
15
|
*/
|
|
8
|
-
export declare function useSearchableHidden(hidden: boolean, reveal: () => void): RefObject<HTMLDivElement>;
|
|
16
|
+
export declare function useSearchableHidden(hidden: boolean, reveal: () => void, transition?: HiddenTransition): RefObject<HTMLDivElement>;
|
|
9
17
|
//# sourceMappingURL=searchable-hidden.d.ts.map
|
|
@@ -4,7 +4,7 @@ import type { ChatKey } from '../locale.ts';
|
|
|
4
4
|
/** Existing primitive glyph selected for a Turn trigger's source family. */
|
|
5
5
|
export type TurnTriggerIcon = 'agent' | 'github' | 'goal' | 'job' | 'plugin' | 'request' | 'schedule' | 'subagent' | 'team' | 'webhook';
|
|
6
6
|
/**
|
|
7
|
-
* Describe a waking message using its source
|
|
7
|
+
* Describe a waking message using its recorded source.
|
|
8
8
|
* @param node - durable context, including the original notification body.
|
|
9
9
|
* @returns localized title key and source-family icon.
|
|
10
10
|
*/
|
|
@@ -50,8 +50,23 @@ export declare class ChatReading {
|
|
|
50
50
|
dispose(): void;
|
|
51
51
|
/** Release bottom follow and pending sampling for an explicit navigation. */
|
|
52
52
|
pauseFollowing(): void;
|
|
53
|
-
/**
|
|
54
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Land at the current floor and clear saved reader position.
|
|
55
|
+
* @param behavior - immediate positioning, or one native animation when the reader's own input moved the tail.
|
|
56
|
+
*/
|
|
57
|
+
followTail(behavior?: 'instant' | 'smooth'): void;
|
|
58
|
+
/**
|
|
59
|
+
* Follow the tail on the active fold's animation clock.
|
|
60
|
+
* @returns whether a fold batch owns the tail movement instead of a separate scroll animation.
|
|
61
|
+
*/
|
|
62
|
+
followInputFold(): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Let fold batches read follow intent and commit their tail landings.
|
|
65
|
+
* @returns a disposer that disconnects this reading policy from the viewport.
|
|
66
|
+
*/
|
|
67
|
+
bindFolds(): () => void;
|
|
68
|
+
/** Stop a native follow animation where it is; the next sampled position decides follow intent. */
|
|
69
|
+
interruptFollow(): void;
|
|
55
70
|
/** Restore the Session's semantic position, or follow the tail when none is saved. */
|
|
56
71
|
restore(): void;
|
|
57
72
|
/**
|
|
@@ -69,8 +84,11 @@ export declare class ChatReading {
|
|
|
69
84
|
* @param scroll - attributed scroll delivery; other reader movement remains pending until sampled.
|
|
70
85
|
*/
|
|
71
86
|
readonly onScroll: (scroll: ViewportScroll) => void;
|
|
72
|
-
/**
|
|
73
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Settle pending reader movement; only the outer scroller can finish its native follow animation.
|
|
89
|
+
* @param outer - whether the event belongs to the outer scroller rather than a process body.
|
|
90
|
+
*/
|
|
91
|
+
readonly onScrollEnd: (outer?: boolean) => void;
|
|
74
92
|
/** Reconcile a layout change without overriding unsampled reader input. */
|
|
75
93
|
onResize(): void;
|
|
76
94
|
/** Resolve the active turn from tail ownership or a coalesced reading-line probe. */
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/** Composes viewport operations, reading policy, and history navigation for Chat. */
|
|
2
2
|
import { type RefObject } from 'react';
|
|
3
|
+
import type { TranscriptViewMode } from '../../chat-settings.ts';
|
|
3
4
|
import type { ChatSnapshot } from '../contract/snapshot.ts';
|
|
4
5
|
import type { ChatViewSlotProps } from '../contract/slots.ts';
|
|
5
6
|
import { type ChatNavigation, type ChatNavigationInput } from './use-chat-navigation.ts';
|
|
6
7
|
import { type ChatReadingState } from './use-chat-reading.ts';
|
|
8
|
+
import type { FlowMotionRows } from './flow-motion.ts';
|
|
7
9
|
/** Committed content and Session operations used to reconcile scroll ownership. */
|
|
8
10
|
export interface ChatScrollInput extends ChatNavigationInput {
|
|
9
11
|
readonly chatScroll: ChatViewSlotProps['chatScroll'];
|
|
@@ -14,6 +16,10 @@ export interface ChatScrollInput extends ChatNavigationInput {
|
|
|
14
16
|
readonly steeringId: string | null;
|
|
15
17
|
readonly submissionId: string | null;
|
|
16
18
|
readonly running: boolean;
|
|
19
|
+
/** Enable the browser-local delayed-fold experiment and its input reveal animation. */
|
|
20
|
+
readonly deferCompletedTurns: boolean;
|
|
21
|
+
/** A changed work-details preference resets fold reservations after the layout settles. */
|
|
22
|
+
readonly transcriptView: TranscriptViewMode;
|
|
17
23
|
readonly loadedTurns: ReturnType<ChatSnapshot['navigation']['items']>;
|
|
18
24
|
}
|
|
19
25
|
interface ChatScrollState extends ChatReadingState {
|
|
@@ -23,9 +29,11 @@ interface ChatScrollState extends ChatReadingState {
|
|
|
23
29
|
readonly navigateToTurn: ChatNavigation['navigateToTurn'];
|
|
24
30
|
readonly loadEarlier: ChatNavigation['loadEarlier'];
|
|
25
31
|
readonly returnToBottom: () => void;
|
|
32
|
+
readonly motion: FlowMotionRows;
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
28
|
-
* Coordinate scroll policy after Chat content commits.
|
|
35
|
+
* Coordinate scroll policy after Chat content commits. Initial history must be ready
|
|
36
|
+
* before automatic scroll or resize handling can initialize reading state and fold motion.
|
|
29
37
|
* New submitted input supersedes pending reader sampling.
|
|
30
38
|
* @param input - current Chat content, scroll memory, and history operations.
|
|
31
39
|
* @returns element refs, visible reading state, and navigation callbacks.
|