@deepseek-ai/dsh-client-ui-chat 0.1.7-rc.1 → 0.2.0-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/README.i18n.yaml +51 -5
- package/README.md +7 -3
- package/README.zh.md +7 -3
- package/lib/client.js +389 -108
- package/lib/index.js +4 -4
- package/lib/types/chat-settings.d.ts +7 -7
- package/lib/types/client/apply.d.ts +0 -1
- package/lib/types/client/chat/AssistantMarkdown.d.ts +1 -1
- package/lib/types/client/chat/QuotaNoticeHost.d.ts +7 -0
- package/lib/types/client/chat/RunningStatus.d.ts +13 -0
- package/lib/types/client/chat/RunningWhaleTail.d.ts +6 -0
- package/lib/types/client/contract/chat-visibility.d.ts +1 -0
- package/lib/types/client/contract/slots.d.ts +54 -1
- package/lib/types/client/conversation-nodes/message.d.ts +3 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/locale.d.ts +26 -2
- package/lib/types/client/transcript-view.d.ts +4 -2
- package/lib/types/index.d.ts +4 -4
- package/package.json +37 -36
package/README.i18n.yaml
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
|
-
# Bilingual-pair consistency record (docs/i18n/README.md):
|
|
2
|
-
#
|
|
3
|
-
#
|
|
1
|
+
# Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
|
|
2
|
+
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
|
3
|
+
# After editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/client/ui-chat/README.md
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/:
|
|
6
|
+
en: d88f75fc0178ba53
|
|
7
|
+
zh: 52bc7ae9551ab1cf
|
|
8
|
+
/deepseek-ai-dsh-client-ui-chat:
|
|
9
|
+
en: 02bd72c12ada3218
|
|
10
|
+
zh: 331b3a38b3ddfc6e
|
|
11
|
+
/deepseek-ai-dsh-client-ui-chat/summary:
|
|
12
|
+
en: fba5b2fb8080e2dd
|
|
13
|
+
zh: 32c337123b7dfbcb
|
|
14
|
+
/deepseek-ai-dsh-client-ui-chat/table-of-contents:
|
|
15
|
+
en: 41cd21266011d571
|
|
16
|
+
zh: 3172d1a2acbb27b7
|
|
17
|
+
/deepseek-ai-dsh-client-ui-chat/reference-previews:
|
|
18
|
+
en: 3fda3d75483ce7c1
|
|
19
|
+
zh: 4d96ba654f70c021
|
|
20
|
+
/deepseek-ai-dsh-client-ui-chat/hidden-chat-rows:
|
|
21
|
+
en: 5706ae03ceacf251
|
|
22
|
+
zh: 2e59d0815351349f
|
|
23
|
+
/deepseek-ai-dsh-client-ui-chat/command-and-failure-rows:
|
|
24
|
+
en: 2157fcd6b0d100b5
|
|
25
|
+
zh: 9e865ac3953ebe30
|
|
26
|
+
/deepseek-ai-dsh-client-ui-chat/turn-token-usage:
|
|
27
|
+
en: 29346bd0f9a5ff51
|
|
28
|
+
zh: 54dbed55f67aeecd
|
|
29
|
+
/deepseek-ai-dsh-client-ui-chat/completed-turn-footer:
|
|
30
|
+
en: b4cd36e7ab91281e
|
|
31
|
+
zh: 8ccf412b9dde61d5
|
|
32
|
+
/deepseek-ai-dsh-client-ui-chat/turn-process-folding:
|
|
33
|
+
en: 0ca3e8c4eab1ca78
|
|
34
|
+
zh: 1a1c71bab151eb7d
|
|
35
|
+
/deepseek-ai-dsh-client-ui-chat/grouped-rendering:
|
|
36
|
+
en: f7b5260bea372361
|
|
37
|
+
zh: 2daa3ff650ec9246
|
|
38
|
+
/deepseek-ai-dsh-client-ui-chat/scroll-ownership:
|
|
39
|
+
en: 69b021c5a5d8b5a7
|
|
40
|
+
zh: 091ae7986c7a8a20
|
|
41
|
+
/deepseek-ai-dsh-client-ui-chat/model-experience:
|
|
42
|
+
en: c17b4dd43a61c569
|
|
43
|
+
zh: f7414309810c3a08
|
|
44
|
+
/deepseek-ai-dsh-client-ui-chat/model-experience/kv-cache-effect:
|
|
45
|
+
en: 15a7151ff9268f15
|
|
46
|
+
zh: 6eae68c718be579b
|
|
47
|
+
/deepseek-ai-dsh-client-ui-chat/known-limitations-and-deferred-work:
|
|
48
|
+
en: 1e7e55adf5c87246
|
|
49
|
+
zh: dd5befdf58ea084f
|
|
50
|
+
/deepseek-ai-dsh-client-ui-chat/known-limitations-and-deferred-work/dev-note:
|
|
51
|
+
en: b8b7eeb4ae675d2a
|
|
52
|
+
zh: fbe7022074ba81b9
|
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ kind: "package-reference"
|
|
|
6
6
|
|
|
7
7
|
English | [中文](README.zh.md)
|
|
8
8
|
|
|
9
|
+
Desktop product events use the optional [product analytics service](../product-analytics/README.md); ordinary Web interactions are excluded.
|
|
10
|
+
|
|
9
11
|
## Summary
|
|
10
12
|
|
|
11
13
|
Use this package to render a browser chat from recorded Session conversations, including historical images, localized actions, and restored scroll position. Work-details modes control reasoning previews and process visibility without hiding final answers; Verbose keeps completed-turn process rows visible. Local transcript and steering submissions appear immediately, remain in their original surface, and disappear atomically when authoritative Session records arrive, while queued submissions stay outside Chat. The package does not assemble or modify model requests.
|
|
@@ -40,14 +42,14 @@ Settings → General → Open chat links in selects the destination for ordinary
|
|
|
40
42
|
<a id="system-prompt-row"></a>
|
|
41
43
|
## Hidden Chat rows
|
|
42
44
|
|
|
43
|
-
Chat omits system-prompt, ordinary Context injection, and `permission` command rows in every work-details mode. The filter changes neither recorded Session events nor Trajectory inspection. Non-human Turn triggers remain independent notices; other command rows remain in Chat.
|
|
45
|
+
Chat omits system-prompt, ordinary Context injection, and `permission` command rows in every work-details mode. Context containing tool additions or removals remains visible. The filter changes neither recorded Session events nor Trajectory inspection. Non-human Turn triggers remain independent notices; other command rows remain in Chat.
|
|
44
46
|
|
|
45
47
|
When an Assistant attempt retires without a visible message, Chat hides its already-published Node instead of removing its key. A retry in the same Step reuses that key when visible content returns. This also applies when the loaded window lacks the Step start.
|
|
46
48
|
|
|
47
49
|
<a id="command-and-failure-rows"></a>
|
|
48
50
|
## Command and failure rows
|
|
49
51
|
|
|
50
|
-
Generic command rows retain the ordinary command glyph in every lifecycle state; failure remains explicit through the row state and summary.
|
|
52
|
+
Generic command rows retain the ordinary command glyph in every lifecycle state; failure remains explicit through the row state and summary. Every terminal Turn failure renders its inline red-dot row; a quota failure's row states the neutral `message.failure.quota` copy instead of the provider message. The transient notice for a newly appended `QUOTA` or `ACCOUNT_QUOTA` comes from this package's frame-wide entry in `shell.overlay`, which outlives the Chat panel: it offers the one live notice to the `shell.quota-notice` chain and falls back to its own warning Toast, while an entry that claims the code replaces that fallback. Only Sessions this Client has bound and materialized publish; quota failures in Sessions it never opened do not. A newer notice replaces the current one unless a claiming entry retains it with `keepOpen()`: that call returns a release the caller owns and must run on unmount, any live hold keeps the claiming entry mounted and drops later notices, and releasing resumes later notices without replaying the dropped ones. The fallback Toast has no deferral of its own: while the Desktop account's opaque native Platform page covers the document, it still runs underneath and its display timer may elapse unseen, dismissing the notice itself, so only the persistent failure row remains. A release drops only its own hold, so one that runs after a dismissal or a newer hold leaves that newer hold intact. Dismissal and sign-out clear every hold, and dropped notices are not queued while their persistent failure rows still render. History replacement and pagination never publish a notice. Intermediate retries do not create a terminal row; output-token limits use the amber warning dot.
|
|
51
53
|
|
|
52
54
|
-----
|
|
53
55
|
|
|
@@ -93,6 +95,8 @@ Live tool deltas share reasoning's frame-batched publication; durable calls and
|
|
|
93
95
|
|
|
94
96
|
The process group uses a stable `div` layout box, a scroll body, and an uncapped content box that reports growth inside the body. Business styles must adapt spacing within and across groups, including hidden or empty members and the answer-spacing exception. CSS variables do not belong in the Group Definition.
|
|
95
97
|
|
|
98
|
+
Running group titles, reasoning previews, tool and command rows, the active retry line, and the bottom running status use the shared [TextShimmer](../ui-primitives/README.md#component-catalog). Each row’s text shares one left-to-right highlight, including collapsed group titles; icons and hover chevrons retain their base appearance. Tool and process rows sit 6px apart. An expanded group title has 8px before its content, Assistant responses have 12px from adjacent process rows, and completed-Turn duration/status controls have 16px around them. Hidden and empty rows, including retained empty slot anchors, add no gap. The running “Deep diving” text retains its blue base while its theme-specific highlight sweeps across it.
|
|
99
|
+
|
|
96
100
|
Scroll-edge fades initialize when `ResizeObserver` reports the open group's layout; opening the group performs no immediate scroll-dimension read in a layout effect.
|
|
97
101
|
|
|
98
102
|
Each group owns local `useDisclosure` state that survives mode changes while its component stays mounted.
|
|
@@ -154,7 +158,7 @@ None; Chat presentation does not assemble or mutate provider requests.
|
|
|
154
158
|
<a id="known-limitations-and-deferred-work"></a>
|
|
155
159
|
|
|
156
160
|
|
|
157
|
-
- **
|
|
161
|
+
- **Tool-change presentation** — The `developer-message` Definition shares context presentation with `input-message`. Tool-only developer messages name a single added or removed tool inline without expansion. Multiple changes show added/removed counts and expand to comma-separated tool lists, one line per change kind. Mixed content uses the generic context presentation.
|
|
158
162
|
|
|
159
163
|
- **Opening echoes predict local order** — several submissions made before the running update can all remain in Chat. Their initial order follows local submission order, not Host queue order; admission can reposition them when the Host receives requests in a different order.
|
|
160
164
|
|
package/README.zh.md
CHANGED
|
@@ -6,6 +6,8 @@ kind: "package-reference"
|
|
|
6
6
|
|
|
7
7
|
[English](README.md) | 中文
|
|
8
8
|
|
|
9
|
+
桌面端产品事件使用可选的[产品埋点服务](../product-analytics/README.zh.md),不包含普通 Web 交互。
|
|
10
|
+
|
|
9
11
|
## 概述
|
|
10
12
|
|
|
11
13
|
使用本包可在浏览器中渲染已记录的 Session 对话,包括历史图片、本地化操作和滚动位置恢复。工作步骤展示模式控制思考预览与过程显隐,不隐藏最终答案;完全展开模式保持已完成轮次的过程行可见。本地 transcript(文本记录)与 steering(中途引导)提交会立即显示并保留在原区域,在权威会话记录到达时原子地消失,而排队中的提交始终不进入 Chat。本包不组装或修改模型请求。
|
|
@@ -40,14 +42,14 @@ Chat 在节点列表外通过一个 `MarkdownDelegateProvider` 提供文件及 H
|
|
|
40
42
|
<a id="system-prompt-row"></a>
|
|
41
43
|
## Chat 隐藏的行
|
|
42
44
|
|
|
43
|
-
Chat 在所有工作步骤展示模式下都不显示系统提示词行、普通上下文注入和 `permission`
|
|
45
|
+
Chat 在所有工作步骤展示模式下都不显示系统提示词行、普通上下文注入和 `permission` 命令行。包含工具添加或移除记录的上下文仍然可见。该过滤不改变已记录的 Session 事件或 Trajectory 查看能力。非人工轮次触发仍作为独立通知显示,其他命令行仍保留在 Chat 中。
|
|
44
46
|
|
|
45
47
|
Assistant 尝试结束且没有可见消息时,Chat 隐藏已发布的 Node,不移除其 key。同一 Step 的重试再次产生可见内容时,复用该 key。已加载窗口缺少 Step 起点时也遵循此规则。
|
|
46
48
|
|
|
47
49
|
<a id="command-and-failure-rows"></a>
|
|
48
50
|
## 指令与失败行
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
通用指令行在所有生命周期状态中都保留普通指令图标;失败仍通过行状态与摘要表达。每个终止轮次都渲染自己的红点行;欠费失败的行使用中立的 `message.failure.quota` 文案,而不是提供方消息。新追加的 `QUOTA` 或 `ACCOUNT_QUOTA` 产生的瞬时提示来自本包注册在 `shell.overlay` 的全局条目,它不随 Chat 面板消失:该条目把唯一一条实时提示交给 `shell.quota-notice` 链,并在无人接管时回退到自己的警告 Toast,接管该错误码的条目会替换该回退。只有本 Client 已绑定并已物化的 Session 会发布提示;它从未打开的 Session 中的欠费不会发布。更新的提示会替换当前提示,除非认领条目用 `keepOpen()` 保持住当前提示:该调用返回一个由调用方持有、必须在卸载时调用的释放函数,只要存在保持,认领条目就继续挂载,后续提示被丢弃,释放后恢复后续提示但不重放已丢弃的提示。回退 Toast 自身没有延后策略:当 Desktop 账号的不透明原生 Platform 页盖住本页时,它仍会在下方运行,其显示计时器可能在不可见时走完并自行撤下提示,因此只留下持久化失败行。释放只移除自己的保持,因此它在关闭或更新的保持之后执行时不会影响更新的保持。关闭与退出登录会清空所有保持;被丢弃的提示不排队,其对应的持久化失败行仍会渲染。历史替换和分页不会发布提示。中间重试不会创建终止行;输出 token 上限使用琥珀色警告点。
|
|
51
53
|
|
|
52
54
|
-----
|
|
53
55
|
|
|
@@ -93,6 +95,8 @@ Chat 通过 `uiConversation.groups` 注册过程 Group Definition。React 通过
|
|
|
93
95
|
|
|
94
96
|
过程组使用稳定的 `div` 布局盒子、滚动正文及不限高的内容盒子,后者报告正文内部的内容增长。业务样式必须适配组内及组边界间距,处理隐藏或空成员以及回答前的间距特例。CSS 变量不属于 Group Definition。
|
|
95
97
|
|
|
98
|
+
运行中的分组标题、思考预览、工具与命令行、当前重试行以及底部运行状态使用共享的 [TextShimmer](../ui-primitives/README.zh.md#component-catalog)。每行的文字共用一道从左到右的高光,包括折叠的分组标题;图标和悬停箭头保留底色。工具和过程行之间相隔 6px;展开的分组标题与内容之间相隔 8px;Assistant 回复与相邻过程行之间相隔 12px;每轮完成/耗时控件周围保留 16px。隐藏行与空行(包括保留的空 slot 锚点)不产生间距。“深度求索”运行文字保留蓝色底色,并使用主题专用高光扫过文字。
|
|
99
|
+
|
|
96
100
|
滚动边缘渐隐在 `ResizeObserver` 报告已展开组的布局后初始化;展开组时不会在 layout effect 中立即读取滚动尺寸。
|
|
97
101
|
|
|
98
102
|
每个组拥有本地 `useDisclosure` 状态,组件保持挂载时,模式切换保留该状态。
|
|
@@ -154,7 +158,7 @@ Chat 会在历史前插与 renderer 重新挂载时恢复语义锚点,并且
|
|
|
154
158
|
<a id="known-limitations-and-deferred-work"></a>
|
|
155
159
|
|
|
156
160
|
|
|
157
|
-
-
|
|
161
|
+
- **工具变更展示** — `developer-message` Definition 与 `input-message` 共用上下文展示。仅包含工具变更的 developer 消息在单个工具新增或移除时直接显示工具名,不提供展开操作。多个变更显示新增、移除数量,展开后按变更类型分别以逗号分隔显示一行工具列表。混合内容使用通用上下文展示。
|
|
158
162
|
|
|
159
163
|
- **开场回显预测本地顺序**——运行状态更新前连续发出的多条消息可能都留在 Chat。初始排列遵循本地提交顺序,而非 Host 队列顺序;Host 按不同顺序接收请求时,入档可能调整它们的位置。
|
|
160
164
|
|