@prettier-ai/dsh-client-ui-chat 0.1.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +69 -0
- package/README.zh.md +69 -0
- package/lib/client.js +7588 -0
- package/lib/index.js +25 -0
- package/lib/invariant.js +16 -0
- package/lib/types/chat-settings.d.ts +20 -0
- package/lib/types/client/apply.d.ts +10 -0
- package/lib/types/client/chat/ApprovalCommand.d.ts +20 -0
- package/lib/types/client/chat/AssistantMarkdown.d.ts +22 -0
- package/lib/types/client/chat/AssistantNodeView.d.ts +4 -0
- package/lib/types/client/chat/ChatNodeSeat.d.ts +15 -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 +131 -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 +36 -0
- package/lib/types/client/chat/MessageItem.d.ts +42 -0
- package/lib/types/client/chat/ReasoningRow.d.ts +14 -0
- package/lib/types/client/chat/StatsLine.d.ts +64 -0
- package/lib/types/client/chat/SystemPromptRow.d.ts +19 -0
- package/lib/types/client/chat/TurnNavigator.d.ts +21 -0
- package/lib/types/client/chat/TurnProcessNodeView.d.ts +4 -0
- package/lib/types/client/chat/TurnTailNodeView.d.ts +7 -0
- package/lib/types/client/chat/TurnUsageDisclosure.d.ts +9 -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/searchable-hidden.d.ts +9 -0
- package/lib/types/client/chat/token-format.d.ts +25 -0
- package/lib/types/client/chat/turn-assistant.d.ts +8 -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/assistant-content.d.ts +9 -0
- package/lib/types/client/contract/chat-nodes.d.ts +110 -0
- package/lib/types/client/contract/slots.d.ts +195 -0
- package/lib/types/client/contract/snapshot.d.ts +65 -0
- package/lib/types/client/contract/store.d.ts +22 -0
- package/lib/types/client/contract/turn-metrics.d.ts +38 -0
- package/lib/types/client/contract/turn-process.d.ts +48 -0
- package/lib/types/client/conversation-nodes/assistant.d.ts +37 -0
- package/lib/types/client/conversation-nodes/chat-snapshot-builder.d.ts +42 -0
- package/lib/types/client/conversation-nodes/command.d.ts +54 -0
- package/lib/types/client/conversation-nodes/common.d.ts +41 -0
- package/lib/types/client/conversation-nodes/compaction.d.ts +22 -0
- package/lib/types/client/conversation-nodes/event-projection.d.ts +57 -0
- package/lib/types/client/conversation-nodes/fallback.d.ts +17 -0
- package/lib/types/client/conversation-nodes/inbox.d.ts +21 -0
- package/lib/types/client/conversation-nodes/message.d.ts +31 -0
- package/lib/types/client/conversation-nodes/partial.d.ts +34 -0
- package/lib/types/client/conversation-nodes/register.d.ts +7 -0
- package/lib/types/client/conversation-nodes/request-prompt.d.ts +30 -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 +31 -0
- package/lib/types/client/conversation-nodes/turn-max-tokens.d.ts +23 -0
- package/lib/types/client/conversation-nodes/turn-navigation.d.ts +17 -0
- package/lib/types/client/conversation-nodes/turn-process.d.ts +32 -0
- package/lib/types/client/conversation-nodes/turn-tail.d.ts +28 -0
- package/lib/types/client/details/DetailsPanel.d.ts +4 -0
- package/lib/types/client/details/tool-node-reader.d.ts +9 -0
- package/lib/types/client/index.d.ts +36 -0
- package/lib/types/client/locale.d.ts +224 -0
- package/lib/types/client/markdown-labels.d.ts +10 -0
- package/lib/types/client/model/conversation-context.d.ts +22 -0
- package/lib/types/client/model/steering-history.d.ts +23 -0
- package/lib/types/client/model/tool-call-tree.d.ts +45 -0
- package/lib/types/client/settings/TranscriptViewRow.d.ts +22 -0
- package/lib/types/client/stores.d.ts +22 -0
- package/lib/types/client/transcript-view.d.ts +22 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/invariant.d.ts +13 -0
- package/package.json +121 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/** Chat-owned locale namespace and dictionaries. */
|
|
2
|
+
/** Namespace for Chat target, node, statistics, and details copy. */
|
|
3
|
+
export declare const NS = "chat";
|
|
4
|
+
/** Simplified Chinese dictionary and key-set source of truth. */
|
|
5
|
+
export declare const zh: {
|
|
6
|
+
'view.chat': string;
|
|
7
|
+
'number.groupSeparator': string;
|
|
8
|
+
'duration.compactSeconds': string;
|
|
9
|
+
'duration.compactMinutes': string;
|
|
10
|
+
'duration.milliseconds': string;
|
|
11
|
+
'stats.counts': string;
|
|
12
|
+
'stats.llm': string;
|
|
13
|
+
'stats.toolCall': string;
|
|
14
|
+
'stats.ttftAverage': string;
|
|
15
|
+
'stats.tokensPerSecond': string;
|
|
16
|
+
'stats.cacheHit': string;
|
|
17
|
+
'stats.tokens': string;
|
|
18
|
+
'details.title': string;
|
|
19
|
+
'details.close': string;
|
|
20
|
+
'details.empty': string;
|
|
21
|
+
'details.notInWindow': string;
|
|
22
|
+
'details.input': string;
|
|
23
|
+
'details.output': string;
|
|
24
|
+
'details.running': string;
|
|
25
|
+
'chat.loadingHistory': string;
|
|
26
|
+
'chat.loadError': string;
|
|
27
|
+
'chat.loadOlder': string;
|
|
28
|
+
'chat.toBottom': string;
|
|
29
|
+
'chat.deepDiving': string;
|
|
30
|
+
'chat.turnNavigation.label': string;
|
|
31
|
+
'chat.turnNavigation.jump': string;
|
|
32
|
+
'chat.turnNavigation.turn': string;
|
|
33
|
+
'settings.transcript.title': string;
|
|
34
|
+
'settings.transcript.description': string;
|
|
35
|
+
'settings.transcript.normal': string;
|
|
36
|
+
'settings.transcript.compact': string;
|
|
37
|
+
'fileOpen.title': string;
|
|
38
|
+
'fileOpen.unknown': string;
|
|
39
|
+
'fileOpen.folderTitle': string;
|
|
40
|
+
'fileOpen.folderUnknown': string;
|
|
41
|
+
'message.extraBlock': string;
|
|
42
|
+
'message.systemPrompt': string;
|
|
43
|
+
'message.contextInjection': string;
|
|
44
|
+
'message.contextRecall': string;
|
|
45
|
+
'message.referenceSummary': string;
|
|
46
|
+
'message.referenceSeparator': string;
|
|
47
|
+
'message.context.instructions.loaded': string;
|
|
48
|
+
'message.context.instructions.added': string;
|
|
49
|
+
'message.context.instructions.updated': string;
|
|
50
|
+
'message.context.instructions.removed': string;
|
|
51
|
+
'message.context.catalog.replaced': string;
|
|
52
|
+
'message.context.catalog.more': string;
|
|
53
|
+
'message.context.snapshot.supersedes': string;
|
|
54
|
+
'message.context.relay.from': string;
|
|
55
|
+
'message.context.recall.counts': string;
|
|
56
|
+
'message.context.recall.truncated': string;
|
|
57
|
+
'message.compaction': string;
|
|
58
|
+
'message.compaction.running': string;
|
|
59
|
+
'message.compaction.completed': string;
|
|
60
|
+
'message.compaction.expand': string;
|
|
61
|
+
'message.compaction.unavailable': string;
|
|
62
|
+
'message.compaction.commandTitle': string;
|
|
63
|
+
'message.think': string;
|
|
64
|
+
'message.unknownSurface': string;
|
|
65
|
+
'message.unknownBlock': string;
|
|
66
|
+
'message.turnProcess.toolCalls.one': string;
|
|
67
|
+
'message.turnProcess.toolCalls.other': string;
|
|
68
|
+
'message.turnProcess.messages.one': string;
|
|
69
|
+
'message.turnProcess.messages.other': string;
|
|
70
|
+
'message.turnProcess.subagents.one': string;
|
|
71
|
+
'message.turnProcess.subagents.other': string;
|
|
72
|
+
'message.turnProcess.thoughtForAWhile': string;
|
|
73
|
+
'message.turnProcess.separator': string;
|
|
74
|
+
'message.stopped': string;
|
|
75
|
+
'message.branch': string;
|
|
76
|
+
'message.branchUnavailable': string;
|
|
77
|
+
'message.retry.active': string;
|
|
78
|
+
'message.retry.cancelled': string;
|
|
79
|
+
'message.retry.started': string;
|
|
80
|
+
'message.retry.scheduled': string;
|
|
81
|
+
'message.retry.status': string;
|
|
82
|
+
'message.retry.delay': string;
|
|
83
|
+
'message.retry.failure': string;
|
|
84
|
+
'message.failure.auth': string;
|
|
85
|
+
'message.turnError': string;
|
|
86
|
+
'message.maxTokens': string;
|
|
87
|
+
'message.maxTokens.hint': string;
|
|
88
|
+
'message.ranFor': string;
|
|
89
|
+
'message.ttft': string;
|
|
90
|
+
'message.tokensPerSecond': string;
|
|
91
|
+
'message.turnUsage.title': string;
|
|
92
|
+
'message.turnUsage.summaryWithCache': string;
|
|
93
|
+
'message.turnUsage.model': string;
|
|
94
|
+
'message.turnUsage.input': string;
|
|
95
|
+
'message.turnUsage.cacheRead': string;
|
|
96
|
+
'message.turnUsage.cacheWrite': string;
|
|
97
|
+
'message.turnUsage.output': string;
|
|
98
|
+
'message.turnUsage.reasoning': string;
|
|
99
|
+
'message.turnUsage.total': string;
|
|
100
|
+
'message.turnUsage.count': string;
|
|
101
|
+
'duration.seconds': string;
|
|
102
|
+
'duration.minutes': string;
|
|
103
|
+
'command.running': string;
|
|
104
|
+
'command.failed': string;
|
|
105
|
+
'command.done': string;
|
|
106
|
+
'command.title': string;
|
|
107
|
+
'row.running': string;
|
|
108
|
+
'row.failed': string;
|
|
109
|
+
'json.truncated': string;
|
|
110
|
+
'clock.md': string;
|
|
111
|
+
'clock.ymd': string;
|
|
112
|
+
};
|
|
113
|
+
/** Chat dictionary key union. */
|
|
114
|
+
export type ChatKey = keyof typeof zh;
|
|
115
|
+
/** English dictionary, checked against the Chinese key set. */
|
|
116
|
+
export declare const en: {
|
|
117
|
+
'view.chat': string;
|
|
118
|
+
'number.groupSeparator': string;
|
|
119
|
+
'duration.compactSeconds': string;
|
|
120
|
+
'duration.compactMinutes': string;
|
|
121
|
+
'duration.milliseconds': string;
|
|
122
|
+
'stats.counts': string;
|
|
123
|
+
'stats.llm': string;
|
|
124
|
+
'stats.toolCall': string;
|
|
125
|
+
'stats.ttftAverage': string;
|
|
126
|
+
'stats.tokensPerSecond': string;
|
|
127
|
+
'stats.cacheHit': string;
|
|
128
|
+
'stats.tokens': string;
|
|
129
|
+
'details.title': string;
|
|
130
|
+
'details.close': string;
|
|
131
|
+
'details.empty': string;
|
|
132
|
+
'details.notInWindow': string;
|
|
133
|
+
'details.input': string;
|
|
134
|
+
'details.output': string;
|
|
135
|
+
'details.running': string;
|
|
136
|
+
'chat.loadingHistory': string;
|
|
137
|
+
'chat.loadError': string;
|
|
138
|
+
'chat.loadOlder': string;
|
|
139
|
+
'chat.toBottom': string;
|
|
140
|
+
'chat.deepDiving': string;
|
|
141
|
+
'chat.turnNavigation.label': string;
|
|
142
|
+
'chat.turnNavigation.jump': string;
|
|
143
|
+
'chat.turnNavigation.turn': string;
|
|
144
|
+
'settings.transcript.title': string;
|
|
145
|
+
'settings.transcript.description': string;
|
|
146
|
+
'settings.transcript.normal': string;
|
|
147
|
+
'settings.transcript.compact': string;
|
|
148
|
+
'fileOpen.title': string;
|
|
149
|
+
'fileOpen.unknown': string;
|
|
150
|
+
'fileOpen.folderTitle': string;
|
|
151
|
+
'fileOpen.folderUnknown': string;
|
|
152
|
+
'message.extraBlock': string;
|
|
153
|
+
'message.systemPrompt': string;
|
|
154
|
+
'message.contextInjection': string;
|
|
155
|
+
'message.contextRecall': string;
|
|
156
|
+
'message.referenceSummary': string;
|
|
157
|
+
'message.referenceSeparator': string;
|
|
158
|
+
'message.context.instructions.loaded': string;
|
|
159
|
+
'message.context.instructions.added': string;
|
|
160
|
+
'message.context.instructions.updated': string;
|
|
161
|
+
'message.context.instructions.removed': string;
|
|
162
|
+
'message.context.catalog.replaced': string;
|
|
163
|
+
'message.context.catalog.more': string;
|
|
164
|
+
'message.context.snapshot.supersedes': string;
|
|
165
|
+
'message.context.relay.from': string;
|
|
166
|
+
'message.context.recall.counts': string;
|
|
167
|
+
'message.context.recall.truncated': string;
|
|
168
|
+
'message.compaction': string;
|
|
169
|
+
'message.compaction.running': string;
|
|
170
|
+
'message.compaction.completed': string;
|
|
171
|
+
'message.compaction.expand': string;
|
|
172
|
+
'message.compaction.unavailable': string;
|
|
173
|
+
'message.compaction.commandTitle': string;
|
|
174
|
+
'message.think': string;
|
|
175
|
+
'message.unknownSurface': string;
|
|
176
|
+
'message.unknownBlock': string;
|
|
177
|
+
'message.turnProcess.toolCalls.one': string;
|
|
178
|
+
'message.turnProcess.toolCalls.other': string;
|
|
179
|
+
'message.turnProcess.messages.one': string;
|
|
180
|
+
'message.turnProcess.messages.other': string;
|
|
181
|
+
'message.turnProcess.subagents.one': string;
|
|
182
|
+
'message.turnProcess.subagents.other': string;
|
|
183
|
+
'message.turnProcess.thoughtForAWhile': string;
|
|
184
|
+
'message.turnProcess.separator': string;
|
|
185
|
+
'message.stopped': string;
|
|
186
|
+
'message.branch': string;
|
|
187
|
+
'message.branchUnavailable': string;
|
|
188
|
+
'message.retry.active': string;
|
|
189
|
+
'message.retry.cancelled': string;
|
|
190
|
+
'message.retry.started': string;
|
|
191
|
+
'message.retry.scheduled': string;
|
|
192
|
+
'message.retry.status': string;
|
|
193
|
+
'message.retry.delay': string;
|
|
194
|
+
'message.retry.failure': string;
|
|
195
|
+
'message.failure.auth': string;
|
|
196
|
+
'message.turnError': string;
|
|
197
|
+
'message.maxTokens': string;
|
|
198
|
+
'message.maxTokens.hint': string;
|
|
199
|
+
'message.ranFor': string;
|
|
200
|
+
'message.ttft': string;
|
|
201
|
+
'message.tokensPerSecond': string;
|
|
202
|
+
'message.turnUsage.title': string;
|
|
203
|
+
'message.turnUsage.summaryWithCache': string;
|
|
204
|
+
'message.turnUsage.model': string;
|
|
205
|
+
'message.turnUsage.input': string;
|
|
206
|
+
'message.turnUsage.cacheRead': string;
|
|
207
|
+
'message.turnUsage.cacheWrite': string;
|
|
208
|
+
'message.turnUsage.output': string;
|
|
209
|
+
'message.turnUsage.reasoning': string;
|
|
210
|
+
'message.turnUsage.total': string;
|
|
211
|
+
'message.turnUsage.count': string;
|
|
212
|
+
'duration.seconds': string;
|
|
213
|
+
'duration.minutes': string;
|
|
214
|
+
'command.running': string;
|
|
215
|
+
'command.failed': string;
|
|
216
|
+
'command.done': string;
|
|
217
|
+
'command.title': string;
|
|
218
|
+
'row.running': string;
|
|
219
|
+
'row.failed': string;
|
|
220
|
+
'json.truncated': string;
|
|
221
|
+
'clock.md': string;
|
|
222
|
+
'clock.ymd': string;
|
|
223
|
+
};
|
|
224
|
+
//# sourceMappingURL=locale.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Localized copy adapters for Cordis-free Markdown primitives. */
|
|
2
|
+
import type { MarkdownLabels } from '@prettier-ai/dsh-client-ui-primitives';
|
|
3
|
+
import type { ChatViewSlotProps } from './contract/slots.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Build the complete Markdown chrome copy for one locale revision.
|
|
6
|
+
* @param t - Chat locale seat.
|
|
7
|
+
* @returns Labels for code fences and footnotes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function markdownLabels(t: ChatViewSlotProps['t']): MarkdownLabels;
|
|
10
|
+
//# sourceMappingURL=markdown-labels.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ConversationNode } from '../contract/snapshot.ts';
|
|
2
|
+
import type { ConversationPromptSnapshot } from '@prettier-ai/dsh-client-ui-conversation/client';
|
|
3
|
+
/** Operation that started a new append-only model context. */
|
|
4
|
+
export type ConversationContextOriginKind = 'compaction' | 'rewind' | 'rewrite';
|
|
5
|
+
/** One immutable model-context generation reconstructed from surface replacements. */
|
|
6
|
+
export interface ConversationContext {
|
|
7
|
+
/** Zero-based generation within the session; stable across later appends. */
|
|
8
|
+
id: number;
|
|
9
|
+
/** Previous generation in this session; absent for the initial context. */
|
|
10
|
+
parentId?: number;
|
|
11
|
+
/** Why this generation exists; absent for the initial context. */
|
|
12
|
+
origin?: ConversationContextOriginKind;
|
|
13
|
+
/** Event seq of the replacement that created this generation. */
|
|
14
|
+
originSeq?: number;
|
|
15
|
+
/** Unix epoch ms of the replacement that created this generation. */
|
|
16
|
+
createdAt?: number;
|
|
17
|
+
/** Latest request header observed in this generation, inherited until a later header replaces it. */
|
|
18
|
+
prompt?: ConversationPromptSnapshot;
|
|
19
|
+
/** Final frozen nodes for historical generations, or current folded nodes for the tail. */
|
|
20
|
+
nodes: readonly ConversationNode[];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=conversation-context.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Reconstruct durable steering identity from the event-sourced agent inbox. */
|
|
2
|
+
import type { SessionEvent } from '@prettier-ai/dsh-session/types';
|
|
3
|
+
/**
|
|
4
|
+
* Incrementally identifies `user/message` events claimed from the next-step
|
|
5
|
+
* inbox. The agent loop records all admitted input as `user/message`; the
|
|
6
|
+
* preceding `agent/inbox/spliced` events preserve whether it came from the
|
|
7
|
+
* queued-turn list or the next-step list.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SteeringHistory {
|
|
10
|
+
private readonly inbox;
|
|
11
|
+
private readonly claimedNextStep;
|
|
12
|
+
/** Clear all replay state before rebuilding a history window. */
|
|
13
|
+
reset(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Apply one event and report whether it is a durable human steering message.
|
|
16
|
+
* @param event - next raw session event in sequence order.
|
|
17
|
+
* @returns true only for a user-origin message previously claimed from `next-step`.
|
|
18
|
+
*/
|
|
19
|
+
apply(event: SessionEvent): boolean;
|
|
20
|
+
/** Replay one host-validated inbox splice. */
|
|
21
|
+
private applySplice;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=steering-history.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { SessionEvent } from '@prettier-ai/dsh-session/types';
|
|
2
|
+
import type { ConversationNode, RunningToolCall } from '../contract/snapshot.ts';
|
|
3
|
+
/** Fixed wire-safety ceiling for every recursive Tool call consumer. */
|
|
4
|
+
export declare const MAX_TOOL_CALL_TREE_DEPTH = 256;
|
|
5
|
+
/**
|
|
6
|
+
* Owns Code Dispatch pairing and projects its private parent index into the
|
|
7
|
+
* recursive Tool call contract exposed by conversation snapshots.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ToolCallTree {
|
|
10
|
+
private readonly childrenByParent;
|
|
11
|
+
private readonly depthByCall;
|
|
12
|
+
private readonly projectedByCall;
|
|
13
|
+
private revision;
|
|
14
|
+
private nodesCache;
|
|
15
|
+
private runningCache;
|
|
16
|
+
/** Forget all event-derived child calls before replaying a new window. */
|
|
17
|
+
reset(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Fold one event when it belongs to the Code Dispatch lifecycle.
|
|
20
|
+
* @param event - Session event from the current live or history window.
|
|
21
|
+
* @returns Whether the event was consumed as a child-call lifecycle event.
|
|
22
|
+
*/
|
|
23
|
+
apply(event: SessionEvent): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Attach recursively projected children to all settled roots in a node list.
|
|
26
|
+
* @param nodes - Cache-stable base conversation nodes.
|
|
27
|
+
* @returns The original list when no root changed, otherwise a structurally shared list.
|
|
28
|
+
*/
|
|
29
|
+
projectNodes(nodes: readonly ConversationNode[]): readonly ConversationNode[];
|
|
30
|
+
/**
|
|
31
|
+
* Attach recursively projected children to all running root calls.
|
|
32
|
+
* @param calls - Cache-stable base running calls.
|
|
33
|
+
* @returns The original list when no root changed, otherwise a structurally shared list.
|
|
34
|
+
*/
|
|
35
|
+
projectRunningCalls(calls: readonly RunningToolCall[]): readonly RunningToolCall[];
|
|
36
|
+
private projectBlock;
|
|
37
|
+
/**
|
|
38
|
+
* Accept an edge only when every recursive consumer can traverse it safely.
|
|
39
|
+
* Host-minted ids exclude cycles and current bindings emit one level; a
|
|
40
|
+
* malformed wire/history edge is consumed without hiding the rest of the session.
|
|
41
|
+
*/
|
|
42
|
+
private acceptEdge;
|
|
43
|
+
private wouldCreateCycle;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=tool-call-tree.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** General Settings row for completed-Turn transcript presentation. */
|
|
2
|
+
import type { SnapshotStore } from '@prettier-ai/dsh-client-store';
|
|
3
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@prettier-ai/dsh-client-ui-slots';
|
|
4
|
+
import type { TranscriptViewMode } from '../../chat-settings.ts';
|
|
5
|
+
/** Registration-side transcript preference face. */
|
|
6
|
+
export interface TranscriptViewRowInjected {
|
|
7
|
+
hooks: {
|
|
8
|
+
/** Persisted transcript preference bound as useTranscriptView. */
|
|
9
|
+
transcriptView: SnapshotStore<TranscriptViewMode>;
|
|
10
|
+
};
|
|
11
|
+
/** Change the completed-Turn transcript presentation. */
|
|
12
|
+
setTranscriptView: (mode: TranscriptViewMode) => void;
|
|
13
|
+
}
|
|
14
|
+
/** Full Settings-row props. */
|
|
15
|
+
export type TranscriptViewRowProps = PropsRuntime<'settings.general.item'> & PropsLocale<'chat'> & InjectFace<TranscriptViewRowInjected>;
|
|
16
|
+
/**
|
|
17
|
+
* Render the completed-Turn transcript mode selector.
|
|
18
|
+
* @param props - composed Settings slot props.
|
|
19
|
+
* @returns the preference row.
|
|
20
|
+
*/
|
|
21
|
+
export declare function TranscriptViewRow({ useTranscriptView, setTranscriptView, t }: TranscriptViewRowProps): import("react").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=TranscriptViewRow.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Per-Session Chat selection store shared by the transcript and details panel. */
|
|
2
|
+
import { type EngineStoreHandle } from '@prettier-ai/dsh-client-store';
|
|
3
|
+
import type { TurnProcessGeneration } from './contract/turn-process.ts';
|
|
4
|
+
import type { ChatStoreState, SelectionTarget, TurnProcessViewEntry } from './contract/store.ts';
|
|
5
|
+
type ChatActions = {
|
|
6
|
+
select: (draft: ChatStoreState, target: SelectionTarget | null) => void;
|
|
7
|
+
setTurnProcessOpen: (draft: ChatStoreState, turn: number, generation: TurnProcessGeneration, open: boolean) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Resolve any stored generation for one Turn.
|
|
11
|
+
* @param state - Chat store snapshot.
|
|
12
|
+
* @param turn - owning Turn.
|
|
13
|
+
* @returns the Turn's stored entry, when present.
|
|
14
|
+
*/
|
|
15
|
+
export declare function storedTurnProcessEntry(state: Readonly<ChatStoreState>, turn: number): Readonly<TurnProcessViewEntry> | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Create the Chat selection store handle.
|
|
18
|
+
* @returns a handle instantiated once per rendered Session scope.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createChatStore(): EngineStoreHandle<ChatStoreState, ChatActions>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=stores.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Host-backed completed-Turn transcript presentation policy. */
|
|
2
|
+
import { type SnapshotStore } from '@prettier-ai/dsh-client-store';
|
|
3
|
+
import type { SettingsScope } from '@prettier-ai/dsh-client-ui-settings/client';
|
|
4
|
+
import { type ChatSettings, type TranscriptViewMode } from '../chat-settings.ts';
|
|
5
|
+
/** Live transcript preference consumed by Chat and its Settings row. */
|
|
6
|
+
export declare class TranscriptViewPolicy {
|
|
7
|
+
private readonly host;
|
|
8
|
+
/** Reactive current mode; defaults to Compact before Host settings arrive. */
|
|
9
|
+
readonly mode: SnapshotStore<TranscriptViewMode>;
|
|
10
|
+
/**
|
|
11
|
+
* @param host - durable Chat settings scope.
|
|
12
|
+
*/
|
|
13
|
+
constructor(host: SettingsScope<ChatSettings>);
|
|
14
|
+
/**
|
|
15
|
+
* Publish and persist one explicit user choice.
|
|
16
|
+
* @param mode - Normal or Compact transcript presentation.
|
|
17
|
+
*/
|
|
18
|
+
setMode(mode: TranscriptViewMode): void;
|
|
19
|
+
/** Adopt the latest accepted Host section without writing it back. */
|
|
20
|
+
private adopt;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=transcript-view.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Host registration for browser Chat preferences. */
|
|
2
|
+
import type { Context } from '@prettier-ai/cordis';
|
|
3
|
+
export { CHAT_SETTINGS_NAMESPACE, DEFAULT_TRANSCRIPT_VIEW_MODE, TRANSCRIPT_VIEW_FIELD, TRANSCRIPT_VIEW_MODES, type ChatSettings, type TranscriptViewMode, } from './chat-settings.ts';
|
|
4
|
+
/** Register the durable Chat settings section when a provider exists. */
|
|
5
|
+
export declare function apply(ctx: Context): void;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Package-owned invariant companion for the Chat UI target. */
|
|
2
|
+
import type { Context } from '@prettier-ai/cordis';
|
|
3
|
+
/** Cordis companion plugin name. */
|
|
4
|
+
export declare const name = "client-ui-chat-invariant";
|
|
5
|
+
/** Service required before the companion reserves package ownership. */
|
|
6
|
+
export declare const inject: string[];
|
|
7
|
+
/**
|
|
8
|
+
* Register this package's invariant companion.
|
|
9
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
10
|
+
* @returns the installed registration's disposer.
|
|
11
|
+
*/
|
|
12
|
+
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
13
|
+
//# sourceMappingURL=invariant.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@prettier-ai/dsh-client-ui-chat",
|
|
3
|
+
"description": "Chat Conversation target, node definitions, renderers, and details surface",
|
|
4
|
+
"version": "0.1.2-alpha.1",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/client/ui-chat"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./invariant": {
|
|
22
|
+
"types": "./lib/types/invariant.d.ts",
|
|
23
|
+
"default": "./lib/invariant.js"
|
|
24
|
+
},
|
|
25
|
+
"./client": {
|
|
26
|
+
"types": "./lib/types/client/index.d.ts",
|
|
27
|
+
"default": "./lib/client.js"
|
|
28
|
+
},
|
|
29
|
+
"./src/*": "./src/*",
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"dsh": {
|
|
33
|
+
"client": {
|
|
34
|
+
"inject": [
|
|
35
|
+
"@prettier-ai/dsh-api-session-controller",
|
|
36
|
+
"@prettier-ai/dsh-api-workspace-controller",
|
|
37
|
+
"@prettier-ai/dsh-client-locale",
|
|
38
|
+
"@prettier-ai/dsh-client-ui-conversation",
|
|
39
|
+
"@prettier-ai/dsh-client-ui-layout",
|
|
40
|
+
"@prettier-ai/dsh-client-ui-renderer",
|
|
41
|
+
"@prettier-ai/dsh-client-ui-session",
|
|
42
|
+
"@prettier-ai/dsh-client-ui-settings",
|
|
43
|
+
"@prettier-ai/dsh-client-ui-workspace"
|
|
44
|
+
],
|
|
45
|
+
"platform": "web"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@prettier-ai/cordis": "^4.0.1",
|
|
51
|
+
"@prettier-ai/dsh-api-session-controller": "^0.1.2-alpha.1",
|
|
52
|
+
"@prettier-ai/dsh-api-workspace-controller": "^0.1.2-alpha.1",
|
|
53
|
+
"@prettier-ai/dsh-agent": "^0.1.2-alpha.1",
|
|
54
|
+
"@prettier-ai/dsh-api-remotes": "^0.1.2-alpha.1",
|
|
55
|
+
"@prettier-ai/dsh-client-locale": "^0.1.2-alpha.1",
|
|
56
|
+
"@prettier-ai/dsh-attachment": "^0.1.2-alpha.1",
|
|
57
|
+
"@prettier-ai/dsh-client-ui-approval": "^0.1.2-alpha.1",
|
|
58
|
+
"@prettier-ai/dsh-client-ui-conversation": "^0.1.2-alpha.1",
|
|
59
|
+
"@prettier-ai/dsh-client-ui-renderer": "^0.1.2-alpha.1",
|
|
60
|
+
"@prettier-ai/dsh-client-ui-session": "^0.1.2-alpha.1",
|
|
61
|
+
"@prettier-ai/dsh-client-ui-settings": "^0.1.2-alpha.1",
|
|
62
|
+
"@prettier-ai/dsh-client-ui-workspace": "^0.1.2-alpha.1",
|
|
63
|
+
"@prettier-ai/dsh-compaction": "^0.1.2-alpha.1",
|
|
64
|
+
"@prettier-ai/dsh-commands": "^0.1.2-alpha.1",
|
|
65
|
+
"@prettier-ai/dsh-llm": "^0.1.2-alpha.1",
|
|
66
|
+
"@prettier-ai/dsh-invariants": "^0.1.2-alpha.1",
|
|
67
|
+
"@prettier-ai/dsh-llm-retry": "^0.1.2-alpha.1",
|
|
68
|
+
"@prettier-ai/dsh-client-ui-layout": "^0.1.2-alpha.1",
|
|
69
|
+
"@prettier-ai/dsh-session": "^0.1.2-alpha.1",
|
|
70
|
+
"@prettier-ai/dsh-settings": "^0.1.2-alpha.1",
|
|
71
|
+
"@prettier-ai/dsh-session-stats": "^0.1.2-alpha.1",
|
|
72
|
+
"@prettier-ai/dsh-tools": "^0.1.2-alpha.1",
|
|
73
|
+
"@prettier-ai/dsh-token-meter": "^0.1.2-alpha.1",
|
|
74
|
+
"@prettier-ai/dsh-util-workspace-path": "^0.1.2-alpha.1"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@types/react": "~18.3.1",
|
|
78
|
+
"react": "^18.2.0",
|
|
79
|
+
"@prettier-ai/cordis": "^4.0.1",
|
|
80
|
+
"@prettier-ai/dsh-agent": "^0.1.2-alpha.1",
|
|
81
|
+
"@prettier-ai/dsh-api-remotes": "^0.1.2-alpha.1",
|
|
82
|
+
"@prettier-ai/dsh-api-session-controller": "^0.1.2-alpha.1",
|
|
83
|
+
"@prettier-ai/dsh-api-workspace-controller": "^0.1.2-alpha.1",
|
|
84
|
+
"@prettier-ai/dsh-attachment": "^0.1.2-alpha.1",
|
|
85
|
+
"@prettier-ai/dsh-client-locale": "^0.1.2-alpha.1",
|
|
86
|
+
"@prettier-ai/dsh-client-ui-approval": "^0.1.2-alpha.1",
|
|
87
|
+
"@prettier-ai/dsh-client-ui-primitives": "^0.1.2-alpha.1",
|
|
88
|
+
"@prettier-ai/dsh-client-ui-renderer": "^0.1.2-alpha.1",
|
|
89
|
+
"@prettier-ai/dsh-client-ui-conversation": "^0.1.2-alpha.1",
|
|
90
|
+
"@prettier-ai/dsh-client-ui-layout": "^0.1.2-alpha.1",
|
|
91
|
+
"@prettier-ai/dsh-client-ui-session": "^0.1.2-alpha.1",
|
|
92
|
+
"@prettier-ai/dsh-client-ui-settings": "^0.1.2-alpha.1",
|
|
93
|
+
"@prettier-ai/dsh-client-ui-workspace": "^0.1.2-alpha.1",
|
|
94
|
+
"@prettier-ai/dsh-commands": "^0.1.2-alpha.1",
|
|
95
|
+
"@prettier-ai/dsh-compaction": "^0.1.2-alpha.1",
|
|
96
|
+
"@prettier-ai/dsh-client-ui-slots": "^0.1.2-alpha.1",
|
|
97
|
+
"@prettier-ai/dsh-client-store": "^0.1.2-alpha.1",
|
|
98
|
+
"@prettier-ai/dsh-llm": "^0.1.2-alpha.1",
|
|
99
|
+
"@prettier-ai/dsh-invariants": "^0.1.2-alpha.1",
|
|
100
|
+
"@prettier-ai/dsh-llm-retry": "^0.1.2-alpha.1",
|
|
101
|
+
"@prettier-ai/dsh-session-stats": "^0.1.2-alpha.1",
|
|
102
|
+
"@prettier-ai/dsh-settings": "^0.1.2-alpha.1",
|
|
103
|
+
"@prettier-ai/dsh-session": "^0.1.2-alpha.1",
|
|
104
|
+
"@prettier-ai/dsh-token-meter": "^0.1.2-alpha.1",
|
|
105
|
+
"@prettier-ai/dsh-tools": "^0.1.2-alpha.1",
|
|
106
|
+
"@prettier-ai/dsh-util-workspace-path": "^0.1.2-alpha.1"
|
|
107
|
+
},
|
|
108
|
+
"dependencies": {
|
|
109
|
+
"@prettier-ai/schemastery": "^3.18.1"
|
|
110
|
+
},
|
|
111
|
+
"files": [
|
|
112
|
+
"lib/index.js",
|
|
113
|
+
"lib/invariant.js",
|
|
114
|
+
"lib/client.js",
|
|
115
|
+
"lib/types/**/*.d.ts"
|
|
116
|
+
],
|
|
117
|
+
"scripts": {
|
|
118
|
+
"bundle": "tsdown",
|
|
119
|
+
"watch": "tsdown --watch"
|
|
120
|
+
}
|
|
121
|
+
}
|