fix(client): shorten agent message target labels

This commit is contained in:
Dudu-0223 committed 2026-10-29 00:02:50 +08:00
1 parent 66e9db2b6c
commit f09d260578
5 files changed
+11 -7

No files matched your search

+2 -2
View File
@@ -15,8 +15,8 @@
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
/deepseek-ai-dsh-client-ui-tool/use-this-package:
en: 68cd10e5fadc2f0f
zh: fbee33dd8c7f25df
en: cb2a7d61909cb893
zh: cb8eb60c89563fa9
/deepseek-ai-dsh-client-ui-tool/use-this-package/registering-a-business-tool-view:
en: 2e3c306b13d3bc25
zh: 77127f01763b3976
+1 -1
View File
@@ -25,7 +25,7 @@ English | [中文](README.zh.md)
<a id="use-this-package"></a>
## Use this package
Tool calls appear in the conversation as cards: a root call tree with its nested subcalls, each atomic call rendered by its owning view. Every lifecycle state retains the tool's ordinary business glyph; failure and interruption remain explicit through the frozen call/result state, accessible status text, and failure summary. Users can open files or inspect calls through the Host callbacks. A collapsed `web_fetch` row links its http(s) URL, which opens in a new browser tab. Control receipts display agent `name` arguments; historical `agent_id` recordings remain readable. Text agent lists show the name or path above a single-line description, with compact spacing and recorded status. Click the description to expand or collapse its full text; its accessible name follows the selected locale.
Tool calls appear in the conversation as cards: a root call tree with its nested subcalls, each atomic call rendered by its owning view. Every lifecycle state retains the tool's ordinary business glyph; failure and interruption remain explicit through the frozen call/result state, accessible status text, and failure summary. Users can open files or inspect calls through the Host callbacks. A collapsed `web_fetch` row links its http(s) URL, which opens in a new browser tab. Control receipts display agent `name` arguments; historical `agent_id` recordings remain readable. `send_message` receipts omit the leading `lead/` from target labels while preserving nested paths and the original arguments for inspection. Text agent lists show the name or path above a single-line description, with compact spacing and recorded status. Click the description to expand or collapse its full text; its accessible name follows the selected locale.
Settled foreground commands with a nonzero exit code, a terminating signal, or an explicit missing exit code keep their description in the ordinary gray text and show a neutral capsule with a red dot immediately after it. The capsule displays only the recorded code, signal, or localized missing-code status and stays on the same line; the description truncates with an ellipsis to reserve its space. Running, successful, and background calls omit it. Generic execution errors and stopped summaries retain their error and warning colors, including on hover.
+1 -1
View File
@@ -25,7 +25,7 @@ kind: "package-reference"
<a id="use-this-package"></a>
## 使用本包
工具调用在对话中显示为卡片:一个根调用树带其嵌套子调用,每个原子调用由所属视图渲染。所有生命周期状态都保留工具的普通业务图标;失败与中断仍通过冻结调用/结果状态、无障碍状态文本和失败摘要明确表达。用户可通过宿主回调打开文件或检查调用。折叠的 `web_fetch` 行把其 http(s) URL 显示为链接,在新浏览器标签页中打开。控制工具回执显示 agent 的 `name` 参数;历史 `agent_id` 记录仍可读取。文本形式的智能体列表以紧凑间距展示名称或路径、下方的单行描述及记录中的状态。点击描述可展开或收起全文;其无障碍名称使用当前语言。
工具调用在对话中显示为卡片:一个根调用树带其嵌套子调用,每个原子调用由所属视图渲染。所有生命周期状态都保留工具的普通业务图标;失败与中断仍通过冻结调用/结果状态、无障碍状态文本和失败摘要明确表达。用户可通过宿主回调打开文件或检查调用。折叠的 `web_fetch` 行把其 http(s) URL 显示为链接,在新浏览器标签页中打开。控制工具回执显示 agent 的 `name` 参数;历史 `agent_id` 记录仍可读取。`send_message` 回执的目标标签省略开头的 `lead/`,保留嵌套路径,检查视图仍显示原始参数。文本形式的智能体列表以紧凑间距展示名称或路径、下方的单行描述及记录中的状态。点击描述可展开或收起全文;其无障碍名称使用当前语言。
已结束的前台命令若返回非零退出码、终止信号,或明确记录为无退出码,描述保持普通灰色,后面紧接带红点的中性胶囊。胶囊仅显示记录的退出码、信号或本地化的“未正常退出”状态,并保持在同一行;描述超出可用宽度时显示省略号,为胶囊预留空间。运行中、成功和后台调用不显示胶囊。通用执行错误与停止摘要仍保留错误色和警告色,悬停时也不改变。
@@ -128,11 +128,12 @@ export function controlDetails(
...(json.nextCursor === undefined ? {} : { caption: t('detail.tasks.nextPage', { cursor: String(json.nextCursor) }) }),
}
case 'send_message': {
const title = target.replace(/^lead\//u, '')
const status = detailRecord(json) ? json.status : undefined
if (status === 'accepted' || status === 'queued') return receipt(target, {
if (status === 'accepted' || status === 'queued') return receipt(title, {
label: t(status === 'queued' ? 'detail.status.queued' : 'detail.receipt.delivered'), tone: status === 'queued' ? 'warning' : 'success',
}, t, [], arg(args, 'message'))
return text === `message delivered to agent ${target}` ? receipt(target, { label: t('detail.receipt.delivered'), tone: 'success' }, t, [], arg(args, 'message')) : null
return text === `message delivered to agent ${target}` ? receipt(title, { label: t('detail.receipt.delivered'), tone: 'success' }, t, [], arg(args, 'message')) : null
}
case 'interrupt_agent':
if (detailRecord(json) && typeof json.previousStatus === 'string') return receipt(target, { label: t('detail.receipt.interrupt'), tone: 'warning' }, t, [{ label: t('detail.field.previousStatus'), value: detailBadge(json.previousStatus, t).label }])
@@ -91,7 +91,10 @@ describe('control detail adapters', () => {
it('shows named agent targets in recorded messaging and interruption receipts', () => {
expect(details('send_message', 'message delivered to agent lead/reviewer', {
name: 'lead/reviewer', message: 'Review the change.',
})?.summary).toBe('lead/reviewer · Message delivered')
})).toMatchObject({
summary: 'reviewer · Message delivered', expandedSummary: 'reviewer',
items: [{ title: 'reviewer', description: 'Review the change.' }],
})
expect(details('interrupt_agent', '{"previousStatus":"running"}', {
name: 'lead/reviewer',
})?.items[0]).toMatchObject({