@deepseek-ai/dsh-client-ui-conversation 0.0.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +28 -0
- package/README.i18n.yaml +6 -0
- package/README.md +65 -0
- package/README.zh.md +65 -0
- package/lib/client.js +9612 -0
- package/lib/index.js +28 -0
- package/lib/invariant.js +25 -0
- package/lib/types/client/apply.d.ts +16 -0
- package/lib/types/client/chat/AssistantMarkdown.d.ts +19 -0
- package/lib/types/client/chat/AssistantNodeView.d.ts +4 -0
- package/lib/types/client/chat/ChatNodeSeat.d.ts +11 -0
- package/lib/types/client/chat/ChatView.d.ts +7 -0
- package/lib/types/client/chat/CommandNodeView.d.ts +9 -0
- package/lib/types/client/chat/CompactionCommandCard.d.ts +8 -0
- package/lib/types/client/chat/CompactionItem.d.ts +19 -0
- package/lib/types/client/chat/ContextBody.d.ts +130 -0
- package/lib/types/client/chat/ContextInjectionRow.d.ts +26 -0
- package/lib/types/client/chat/GenericCommandCard.d.ts +9 -0
- package/lib/types/client/chat/MessageIconActions.d.ts +30 -0
- package/lib/types/client/chat/MessageImage.d.ts +20 -0
- package/lib/types/client/chat/MessageItem.d.ts +27 -0
- package/lib/types/client/chat/ReasoningRow.d.ts +14 -0
- package/lib/types/client/chat/StatsLine.d.ts +83 -0
- package/lib/types/client/chat/TurnTailNodeView.d.ts +7 -0
- package/lib/types/client/chat/message-chrome.d.ts +49 -0
- package/lib/types/client/chat/register-node-renderers.d.ts +7 -0
- package/lib/types/client/chat/tool-node-reader.d.ts +16 -0
- package/lib/types/client/chat/turn-assistant.d.ts +8 -0
- package/lib/types/client/chat/turn-metrics.d.ts +38 -0
- package/lib/types/client/chat/use-calendar-day.d.ts +6 -0
- package/lib/types/client/chat/use-throttled-visual-update.d.ts +8 -0
- package/lib/types/client/contract/chat-nodes.d.ts +68 -0
- package/lib/types/client/contract/composer-submission.d.ts +8 -0
- package/lib/types/client/contract/queue.d.ts +9 -0
- package/lib/types/client/contract/slots.d.ts +614 -0
- package/lib/types/client/contract/views.d.ts +39 -0
- package/lib/types/client/conversation-nodes/assistant.d.ts +35 -0
- package/lib/types/client/conversation-nodes/chat-snapshot-builder.d.ts +28 -0
- package/lib/types/client/conversation-nodes/command.d.ts +54 -0
- package/lib/types/client/conversation-nodes/common.d.ts +37 -0
- package/lib/types/client/conversation-nodes/compaction.d.ts +21 -0
- package/lib/types/client/conversation-nodes/fallback.d.ts +16 -0
- package/lib/types/client/conversation-nodes/inbox.d.ts +21 -0
- package/lib/types/client/conversation-nodes/message.d.ts +22 -0
- package/lib/types/client/conversation-nodes/register.d.ts +7 -0
- package/lib/types/client/conversation-nodes/retry.d.ts +23 -0
- package/lib/types/client/conversation-nodes/tool.d.ts +23 -0
- package/lib/types/client/conversation-nodes/turn-error.d.ts +27 -0
- package/lib/types/client/conversation-nodes/turn-tail.d.ts +28 -0
- package/lib/types/client/index.d.ts +29 -0
- package/lib/types/client/input/blocks.d.ts +57 -0
- package/lib/types/client/input/contract.d.ts +333 -0
- package/lib/types/client/input/decorations.d.ts +63 -0
- package/lib/types/client/input/facade.d.ts +219 -0
- package/lib/types/client/input/hub.d.ts +88 -0
- package/lib/types/client/input/machine.d.ts +114 -0
- package/lib/types/client/input/submission-policy.d.ts +46 -0
- package/lib/types/client/locales.d.ts +312 -0
- package/lib/types/client/queue/QueueDock.d.ts +29 -0
- package/lib/types/client/queue/store.d.ts +19 -0
- package/lib/types/client/service.d.ts +148 -0
- package/lib/types/client/settings/EnterBehaviorRow.d.ts +21 -0
- package/lib/types/client/skeleton/ApprovalPanel.d.ts +13 -0
- package/lib/types/client/skeleton/ContextMeter.d.ts +14 -0
- package/lib/types/client/skeleton/ConversationRoot.d.ts +5 -0
- package/lib/types/client/skeleton/ConversationSession.d.ts +20 -0
- package/lib/types/client/skeleton/DetailsPanel.d.ts +5 -0
- package/lib/types/client/skeleton/EmptyHero.d.ts +55 -0
- package/lib/types/client/skeleton/ImageLightbox.d.ts +9 -0
- package/lib/types/client/skeleton/InputBar.d.ts +16 -0
- package/lib/types/client/skeleton/PermissionSelect.d.ts +11 -0
- package/lib/types/client/skeleton/TodoPanel.d.ts +28 -0
- package/lib/types/client/stores.d.ts +22 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/invariant.d.ts +16 -0
- package/lib/types/submission-settings.d.ts +20 -0
- package/package.json +105 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { AssistantBlock, ConversationMatch, ConversationNodeDefinition } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
import type { AssistantChatData } from '../contract/chat-nodes.ts';
|
|
4
|
+
declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
|
|
5
|
+
interface ChatNodeDataMap {
|
|
6
|
+
/** Streaming, settled, or interrupted Assistant step. */
|
|
7
|
+
'assistant-step': AssistantChatData;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
declare module '@deepseek-ai/dsh-client-runtime/client' {
|
|
11
|
+
interface ConversationStepDataMap {
|
|
12
|
+
/** Streaming, settled, or interrupted Assistant material for this Step. */
|
|
13
|
+
'assistant-step': AssistantChatData;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
interface AssistantState {
|
|
17
|
+
readonly turn: number;
|
|
18
|
+
readonly step: number;
|
|
19
|
+
readonly blocks: readonly (AssistantBlock | undefined)[];
|
|
20
|
+
readonly firstVisibleSeq: number | undefined;
|
|
21
|
+
readonly firstVisibleTime: number | undefined;
|
|
22
|
+
readonly firstTokenTime: number | undefined;
|
|
23
|
+
readonly hidden: boolean;
|
|
24
|
+
readonly final: ConversationMatch | undefined;
|
|
25
|
+
readonly usage: unknown;
|
|
26
|
+
}
|
|
27
|
+
/** Per-step Assistant streaming/final/interruption Definition. */
|
|
28
|
+
export declare const assistantDefinition: ConversationNodeDefinition<AssistantState>;
|
|
29
|
+
/**
|
|
30
|
+
* Register the Assistant lifecycle business contribution.
|
|
31
|
+
* @param ctx - owning UI Conversation context.
|
|
32
|
+
*/
|
|
33
|
+
export declare function registerAssistantConversationNode(ctx: Context): void;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=assistant.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ChatConversationViewNode, ChatSnapshot, ConversationTimelineSnapshot, ConversationViewBuilder, ConversationViewDefinition } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
/** Incremental keyed Chat builder registered under the `chat` target. */
|
|
4
|
+
export declare class ChatSnapshotBuilder implements ConversationViewBuilder<ChatConversationViewNode, ChatSnapshot> {
|
|
5
|
+
private readonly store;
|
|
6
|
+
private readonly locations;
|
|
7
|
+
private readonly legacy;
|
|
8
|
+
private order;
|
|
9
|
+
readonly empty: ChatSnapshot;
|
|
10
|
+
constructor();
|
|
11
|
+
replace(input: {
|
|
12
|
+
readonly nodes: readonly ChatConversationViewNode[];
|
|
13
|
+
readonly timeline: ConversationTimelineSnapshot;
|
|
14
|
+
}): ChatSnapshot;
|
|
15
|
+
apply(input: {
|
|
16
|
+
readonly upserts: readonly ChatConversationViewNode[];
|
|
17
|
+
readonly timeline: ConversationTimelineSnapshot;
|
|
18
|
+
}): ChatSnapshot;
|
|
19
|
+
private snapshot;
|
|
20
|
+
}
|
|
21
|
+
/** Chat target factory contributed to the Runtime view registry. */
|
|
22
|
+
export declare const chatViewDefinition: ConversationViewDefinition<ChatConversationViewNode, ChatSnapshot>;
|
|
23
|
+
/**
|
|
24
|
+
* Register the incremental Chat target builder.
|
|
25
|
+
* @param ctx - owning UI Conversation context.
|
|
26
|
+
*/
|
|
27
|
+
export declare function registerChatConversationView(ctx: Context): void;
|
|
28
|
+
//# sourceMappingURL=chat-snapshot-builder.d.ts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { CommandNode, CompactionSummaryNode, ConversationMatch, ConversationNodeDefinition } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
import type { ManualCompactionChatData } from '../contract/chat-nodes.ts';
|
|
4
|
+
declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
|
|
5
|
+
interface ChatNodeDataMap {
|
|
6
|
+
/** Ordinary slash-command lifecycle. */
|
|
7
|
+
command: CommandNode;
|
|
8
|
+
/** Manual compact command combined with its compaction transaction. */
|
|
9
|
+
'manual-compaction': ManualCompactionChatData;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
type CommandId = CommandNode['commandId'];
|
|
13
|
+
interface CommandState {
|
|
14
|
+
readonly command: CommandNode;
|
|
15
|
+
readonly summary?: ConversationMatch;
|
|
16
|
+
readonly checkpoint?: ConversationMatch;
|
|
17
|
+
}
|
|
18
|
+
interface CompactionEvidence {
|
|
19
|
+
readonly summary?: ConversationMatch;
|
|
20
|
+
readonly checkpoint?: ConversationMatch;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Read correlation identity from a compaction replacement checkpoint.
|
|
24
|
+
* @param event - candidate Session event.
|
|
25
|
+
* @returns correlated compaction and optional command identity.
|
|
26
|
+
*/
|
|
27
|
+
declare function compactSource(event: Parameters<ConversationNodeDefinition['match']>[0]): {
|
|
28
|
+
compactionId: string;
|
|
29
|
+
sourceCommandId?: CommandId;
|
|
30
|
+
} | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Build the visible summary marker from optional lifecycle evidence.
|
|
33
|
+
* @param match - compact/summary Match, when loaded.
|
|
34
|
+
* @param checkpoint - replacement checkpoint Match.
|
|
35
|
+
* @returns final compaction summary Node data.
|
|
36
|
+
*/
|
|
37
|
+
declare function compactSummary(match: ConversationMatch | undefined, checkpoint: ConversationMatch): CompactionSummaryNode;
|
|
38
|
+
/**
|
|
39
|
+
* Fold shared compaction evidence into a Definition-owned State.
|
|
40
|
+
* @param state - current business State carrying optional compaction evidence.
|
|
41
|
+
* @param match - next compaction lifecycle Match.
|
|
42
|
+
* @returns adopted State, preserving reference identity when the Match adds no evidence.
|
|
43
|
+
*/
|
|
44
|
+
export declare function updateCompactionState<State extends CompactionEvidence>(state: State, match: ConversationMatch): State;
|
|
45
|
+
/** Slash-command lifecycle, including integrated manual compaction, Definition. */
|
|
46
|
+
export declare const commandDefinition: ConversationNodeDefinition<CommandState>;
|
|
47
|
+
/**
|
|
48
|
+
* Register the command lifecycle business contribution.
|
|
49
|
+
* @param ctx - owning UI Conversation context.
|
|
50
|
+
*/
|
|
51
|
+
export declare function registerCommandConversationNode(ctx: Context): void;
|
|
52
|
+
/** Shared structural checkpoint recognizer for automatic compaction. */
|
|
53
|
+
export { compactSource, compactSummary };
|
|
54
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ConversationLocation, ConversationNodeContext } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
|
+
import type { ChatNode, ChatNodeDataMap, ChatNodeKind } from '../contract/chat-nodes.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Relative positions in one durable event's seq neighborhood: interrupted
|
|
5
|
+
* Assistant, its follow-up Nodes, then follow-ups to an ordinary final.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CHAT_SYNTHETIC_SEQ_OFFSETS: {
|
|
8
|
+
readonly interruptedAssistant: -0.9;
|
|
9
|
+
readonly interruptedFollowup: -0.8;
|
|
10
|
+
readonly finalizedFollowup: 0.1;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Resolve one Context's best currently loaded event Location.
|
|
14
|
+
* @param context - assembled business Context.
|
|
15
|
+
* @returns start or first-match Location, otherwise unresolved.
|
|
16
|
+
*/
|
|
17
|
+
export declare function contextLocation(context: ConversationNodeContext): ConversationLocation;
|
|
18
|
+
/**
|
|
19
|
+
* Build one final Chat target Node with the engine-owned stable key.
|
|
20
|
+
* @param context - assembled business Context.
|
|
21
|
+
* @param kind - Chat renderer dispatch key.
|
|
22
|
+
* @param anchorSeq - sortable render position.
|
|
23
|
+
* @param data - renderer-owned payload.
|
|
24
|
+
* @param options - optional Location and visibility overrides.
|
|
25
|
+
* @returns final Chat view Node.
|
|
26
|
+
*/
|
|
27
|
+
export declare function chatNode<Kind extends ChatNodeKind>(context: ConversationNodeContext, kind: Kind, anchorSeq: number, data: ChatNodeDataMap[Kind], options?: {
|
|
28
|
+
readonly location?: ConversationLocation;
|
|
29
|
+
readonly visibility?: 'visible' | 'hidden';
|
|
30
|
+
}): ChatNode<Kind>;
|
|
31
|
+
/**
|
|
32
|
+
* Read a finite non-negative integer from a structurally narrowed payload.
|
|
33
|
+
* @param value - untrusted payload field.
|
|
34
|
+
* @returns valid coordinate, otherwise undefined.
|
|
35
|
+
*/
|
|
36
|
+
export declare function coordinate(value: unknown): number | undefined;
|
|
37
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { CompactionSummaryNode, ConversationMatch, ConversationNodeDefinition } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
|
|
4
|
+
interface ChatNodeDataMap {
|
|
5
|
+
/** Automatic compaction checkpoint marker. */
|
|
6
|
+
compaction: CompactionSummaryNode;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
interface CompactionState {
|
|
10
|
+
readonly summary?: ConversationMatch;
|
|
11
|
+
readonly checkpoint?: ConversationMatch;
|
|
12
|
+
}
|
|
13
|
+
/** Automatic compaction lifecycle and landed checkpoint Definition. */
|
|
14
|
+
export declare const compactionDefinition: ConversationNodeDefinition<CompactionState>;
|
|
15
|
+
/**
|
|
16
|
+
* Register the automatic-compaction business contribution.
|
|
17
|
+
* @param ctx - owning UI Conversation context.
|
|
18
|
+
*/
|
|
19
|
+
export declare function registerCompactionConversationNode(ctx: Context): void;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=compaction.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ConversationNodeDefinition, UnknownSurfaceNode } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
|
|
4
|
+
interface ChatNodeDataMap {
|
|
5
|
+
/** Generic presentation of an unclaimed append-surface event. */
|
|
6
|
+
unknown: UnknownSurfaceNode;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/** Unclaimed append-surface fallback Definition. */
|
|
10
|
+
export declare const unknownFallbackDefinition: ConversationNodeDefinition<UnknownSurfaceNode>;
|
|
11
|
+
/**
|
|
12
|
+
* Register the unmatched append-surface fallback contribution.
|
|
13
|
+
* @param ctx - owning UI Conversation context.
|
|
14
|
+
*/
|
|
15
|
+
export declare function registerUnknownConversationFallback(ctx: Context): void;
|
|
16
|
+
//# sourceMappingURL=fallback.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ConversationNodeDefinition } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
interface InboxIdentity {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
}
|
|
6
|
+
/** Cumulative state after one durable inbox splice. */
|
|
7
|
+
export interface InboxState {
|
|
8
|
+
readonly pending: readonly InboxIdentity[];
|
|
9
|
+
readonly claimed: ReadonlySet<string>;
|
|
10
|
+
}
|
|
11
|
+
/** Cumulative next-turn inbox splice Definition. */
|
|
12
|
+
export declare const nextTurnInboxDefinition: ConversationNodeDefinition<InboxState>;
|
|
13
|
+
/** Cumulative next-step inbox splice Definition used to classify steering. */
|
|
14
|
+
export declare const nextStepInboxDefinition: ConversationNodeDefinition<InboxState>;
|
|
15
|
+
/**
|
|
16
|
+
* Register the two durable Inbox-state contributions.
|
|
17
|
+
* @param ctx - owning UI Conversation context.
|
|
18
|
+
*/
|
|
19
|
+
export declare function registerInboxConversationNodes(ctx: Context): void;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=inbox.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ContextMessageNode, ConversationNodeDefinition, SteeringMessageNode, UserMessageNode } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
type MessageNode = UserMessageNode | SteeringMessageNode | ContextMessageNode;
|
|
4
|
+
declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
|
|
5
|
+
interface ChatNodeDataMap {
|
|
6
|
+
/** Ordinary turn-opening user message. */
|
|
7
|
+
user: UserMessageNode;
|
|
8
|
+
/** User message admitted into an active turn. */
|
|
9
|
+
steering: SteeringMessageNode;
|
|
10
|
+
/** Non-user context injected into model history. */
|
|
11
|
+
context: ContextMessageNode;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/** User, steering, and injected-context message classification Definition. */
|
|
15
|
+
export declare const messageDefinition: ConversationNodeDefinition<MessageNode>;
|
|
16
|
+
/**
|
|
17
|
+
* Register the user, steering, and injected-context message contribution.
|
|
18
|
+
* @param ctx - owning UI Conversation context.
|
|
19
|
+
*/
|
|
20
|
+
export declare function registerMessageConversationNode(ctx: Context): void;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=message.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
/**
|
|
3
|
+
* Register the Chat business Definitions and target builder contributed by this package.
|
|
4
|
+
* @param ctx - owning UI Conversation context.
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerConversationNodes(ctx: Context): void;
|
|
7
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ConversationNodeDefinition, ModelRetryNode } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
import type { RetryChatData } from '../contract/chat-nodes.ts';
|
|
4
|
+
declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
|
|
5
|
+
interface ChatNodeDataMap {
|
|
6
|
+
/** Producer-correlated model retry chain. */
|
|
7
|
+
'model-retry': RetryChatData;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/** Accumulated retry attempts sharing one producer-owned RetryId. */
|
|
11
|
+
export interface RetryState {
|
|
12
|
+
readonly turn: number;
|
|
13
|
+
readonly step: number;
|
|
14
|
+
readonly attempts: readonly ModelRetryNode[];
|
|
15
|
+
}
|
|
16
|
+
/** Producer-correlated model retry chain Definition. */
|
|
17
|
+
export declare const retryDefinition: ConversationNodeDefinition<RetryState>;
|
|
18
|
+
/**
|
|
19
|
+
* Register the correlated model-retry business contribution.
|
|
20
|
+
* @param ctx - owning UI Conversation context.
|
|
21
|
+
*/
|
|
22
|
+
export declare function registerRetryConversationNode(ctx: Context): void;
|
|
23
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ConversationNodeDefinition, ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
import type { ToolChatData } from '../contract/chat-nodes.ts';
|
|
4
|
+
declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
|
|
5
|
+
interface ChatNodeDataMap {
|
|
6
|
+
/** Root Tool lifecycle with recursively nested subcalls. */
|
|
7
|
+
'tool-call': ToolChatData;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
interface ToolState {
|
|
11
|
+
readonly root: ToolCallBlock;
|
|
12
|
+
readonly children: ReadonlyMap<string, readonly ToolCallBlock[]>;
|
|
13
|
+
readonly parents: ReadonlyMap<string, string>;
|
|
14
|
+
}
|
|
15
|
+
/** Root Tool lifecycle and nested Code Dispatch Definition. */
|
|
16
|
+
export declare const toolDefinition: ConversationNodeDefinition<ToolState>;
|
|
17
|
+
/**
|
|
18
|
+
* Register the root Tool lifecycle and nested-subcall contribution.
|
|
19
|
+
* @param ctx - owning UI Conversation context.
|
|
20
|
+
*/
|
|
21
|
+
export declare function registerToolConversationNode(ctx: Context): void;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ConversationNodeDefinition, TurnErrorNode } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
|
|
4
|
+
interface ChatNodeDataMap {
|
|
5
|
+
/** Terminal turn failure not superseded by retry. */
|
|
6
|
+
'turn-error': TurnErrorNode;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
interface TurnErrorState {
|
|
10
|
+
readonly turn: number;
|
|
11
|
+
readonly hidden: boolean;
|
|
12
|
+
readonly failure?: {
|
|
13
|
+
readonly seq: number;
|
|
14
|
+
readonly time: number;
|
|
15
|
+
readonly message: string;
|
|
16
|
+
readonly code?: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** Terminal turn failure Definition, suppressed when the turn owns a retry chain. */
|
|
20
|
+
export declare const turnErrorDefinition: ConversationNodeDefinition<TurnErrorState>;
|
|
21
|
+
/**
|
|
22
|
+
* Register the terminal Turn-error business contribution.
|
|
23
|
+
* @param ctx - owning UI Conversation context.
|
|
24
|
+
*/
|
|
25
|
+
export declare function registerTurnErrorConversationNode(ctx: Context): void;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=turn-error.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ConversationMatch, ConversationNodeDefinition } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
import type { TurnTailChatData } from '../contract/chat-nodes.ts';
|
|
4
|
+
declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
|
|
5
|
+
interface ChatNodeDataMap {
|
|
6
|
+
/** Completed-turn actions and extension tail. */
|
|
7
|
+
'turn-tail': TurnTailChatData;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
declare module '@deepseek-ai/dsh-client-runtime/client' {
|
|
11
|
+
interface ConversationTurnDataMap {
|
|
12
|
+
/** Closing Assistant and footer facts derived for this completed Turn. */
|
|
13
|
+
'turn-tail': TurnTailChatData;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
interface TurnTailState {
|
|
17
|
+
readonly turn: number;
|
|
18
|
+
readonly end?: ConversationMatch;
|
|
19
|
+
}
|
|
20
|
+
/** Completed-turn footer Definition independent of any Assistant row. */
|
|
21
|
+
export declare const turnTailDefinition: ConversationNodeDefinition<TurnTailState>;
|
|
22
|
+
/**
|
|
23
|
+
* Register completed-Turn footer data and its Chat node contribution.
|
|
24
|
+
* @param ctx - owning UI Conversation context.
|
|
25
|
+
*/
|
|
26
|
+
export declare function registerTurnTailConversationNode(ctx: Context): void;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=turn-tail.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser conversation plugin. `contract/` is the shared type boundary
|
|
3
|
+
* between the independently implemented skeleton and chat domains; `apply.ts`
|
|
4
|
+
* owns their slot assembly.
|
|
5
|
+
*/
|
|
6
|
+
export type {} from './conversation-nodes/assistant.ts';
|
|
7
|
+
export type {} from './conversation-nodes/command.ts';
|
|
8
|
+
export type {} from './conversation-nodes/compaction.ts';
|
|
9
|
+
export type {} from './conversation-nodes/fallback.ts';
|
|
10
|
+
export type {} from './conversation-nodes/message.ts';
|
|
11
|
+
export type {} from './conversation-nodes/retry.ts';
|
|
12
|
+
export type {} from './conversation-nodes/tool.ts';
|
|
13
|
+
export type {} from './conversation-nodes/turn-error.ts';
|
|
14
|
+
export type {} from './conversation-nodes/turn-tail.ts';
|
|
15
|
+
export { apply, inject } from './apply.ts';
|
|
16
|
+
export { ConversationService } from './service.ts';
|
|
17
|
+
export type { IConversation } from './service.ts';
|
|
18
|
+
export type { DraftAttachmentId } from './input/contract.ts';
|
|
19
|
+
export type { CallId, ChatStoreState, SelectionTarget, ViewTab, } from './contract/views.ts';
|
|
20
|
+
export type { ConversationKey } from './locales.ts';
|
|
21
|
+
export type { AssistantChatData, ChatNode, ChatNodeDataMap, ChatNodeKind, ManualCompactionChatData, RetryChatData, ToolChatData, TurnTailChatData, } from './contract/chat-nodes.ts';
|
|
22
|
+
export type { ChatFileMentions, ChatNodeOwnerProps, ChatNodeViewProps, ChatStore, ChatViewInjected, ChatViewSlotProps, CommandRowOwnerProps, CommandRowProps, ComposerBarInjected, ComposerAttachment, ComposerChainProps, ConversationInjected, ConversationSessionHeaderInjected, ConversationSessionInjected, ConversationSlotProps, ConvViewOwnerProps, ConvViewProps, DetailsInjected, DetailsSlotProps, DetailsToolOwnerProps, EmptyWorkspaceOwnerProps, TurnTailOwnerProps, UseChatNodeTurnData, } from './contract/slots.ts';
|
|
23
|
+
declare module '@deepseek-ai/cordis' {
|
|
24
|
+
interface Context {
|
|
25
|
+
/** The outward face only; the concrete service stays inside this plugin. */
|
|
26
|
+
conversation: import('./service.ts').IConversation;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composer blocks: the one way another plugin stops a session's input.
|
|
3
|
+
*
|
|
4
|
+
* The composer cannot read the plugins that would know — the dependency runs
|
|
5
|
+
* ui-model → ui-conversation, never back — so a blocker pushes here and the
|
|
6
|
+
* bar reads its own session's store. A block carries the localized reason it
|
|
7
|
+
* exists, because the plugin that raised it owns that copy; the composer only
|
|
8
|
+
* knows how to render an inert textarea with a placeholder, exactly as it
|
|
9
|
+
* already does for a session with no workspace.
|
|
10
|
+
*
|
|
11
|
+
* This is an affordance, not enforcement: the Host refuses a prompt it cannot
|
|
12
|
+
* route regardless of what any client disables.
|
|
13
|
+
*/
|
|
14
|
+
import type { SessionId, SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client';
|
|
15
|
+
/** Why one session's composer is inert. */
|
|
16
|
+
export interface ComposerBlock {
|
|
17
|
+
/**
|
|
18
|
+
* Localized placeholder replacing the composer's own, owned by the plugin
|
|
19
|
+
* that raised the block.
|
|
20
|
+
*/
|
|
21
|
+
readonly reason: string;
|
|
22
|
+
}
|
|
23
|
+
/** The registry face other plugins reach through `ctx.conversation.blocks`. */
|
|
24
|
+
export interface ComposerBlocks {
|
|
25
|
+
/**
|
|
26
|
+
* Raise or clear this session's block. Idempotent: setting a block equal to
|
|
27
|
+
* the current one, or clearing an absent one, notifies nobody.
|
|
28
|
+
* @param sessionId - the session whose composer is affected.
|
|
29
|
+
* @param block - the block to raise, or undefined to clear it.
|
|
30
|
+
*/
|
|
31
|
+
set(sessionId: SessionId, block: ComposerBlock | undefined): void;
|
|
32
|
+
/**
|
|
33
|
+
* The store the composer subscribes to for one session. Created on first
|
|
34
|
+
* read from either side, so a blocker may raise a block before the session's
|
|
35
|
+
* composer mounts and the composer still sees it.
|
|
36
|
+
* @param sessionId - the session to observe.
|
|
37
|
+
* @returns that session's block store (undefined value = not blocked).
|
|
38
|
+
*/
|
|
39
|
+
storeFor(sessionId: SessionId): SnapshotStore<ComposerBlock | undefined>;
|
|
40
|
+
/**
|
|
41
|
+
* Drop one session's store. The session scope's disposer calls this; a
|
|
42
|
+
* blocker never needs to.
|
|
43
|
+
* @param sessionId - the session being torn down.
|
|
44
|
+
*/
|
|
45
|
+
forget(sessionId: SessionId): void;
|
|
46
|
+
}
|
|
47
|
+
/** The per-session composer-block registry (one instance per plugin fiber). */
|
|
48
|
+
export declare class ComposerBlockRegistry implements ComposerBlocks {
|
|
49
|
+
private readonly stores;
|
|
50
|
+
/** @inheritdoc */
|
|
51
|
+
set(sessionId: SessionId, block: ComposerBlock | undefined): void;
|
|
52
|
+
/** @inheritdoc */
|
|
53
|
+
storeFor(sessionId: SessionId): SnapshotStore<ComposerBlock | undefined>;
|
|
54
|
+
/** @inheritdoc */
|
|
55
|
+
forget(sessionId: SessionId): void;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=blocks.d.ts.map
|