From 45e873da0bcc3436aba8f8ccc1572f77a5aa9d8e Mon Sep 17 00:00:00 2001 From: yudshj Date: Thu, 19 Nov 2026 13:37:41 +0800 Subject: [PATCH] Keep compaction summary previews in Chat --- apps/web/tests/seeded-history.e2e.ts | 6 -- docs/config-catalog.md | 1 - docs/config-catalog.zh.md | 1 - docs/module-graph.md | 2 - docs/module-graph.zh.md | 2 - .../sidebar-content-preview/guide.i18n.yaml | 4 +- .../sidebar-content-preview/guide.md | 2 +- .../sidebar-content-preview/guide.zh.md | 2 +- packages/bundle/web-app/cordis.patch.yml | 5 -- packages/bundle/web-app/package.json | 1 - packages/client/README.i18n.yaml | 4 +- packages/client/README.md | 1 - packages/client/README.zh.md | 1 - packages/client/ui-chat/README.i18n.yaml | 4 +- packages/client/ui-chat/README.md | 2 +- packages/client/ui-chat/README.zh.md | 2 +- packages/client/ui-chat/package.json | 3 +- .../src/client/chat/compaction-preview.ts | 76 ++++++++++++++++ .../client/chat/register-node-renderers.ts | 25 +----- packages/client/ui-chat/src/client/locale.ts | 24 +++++ .../tests/apply-inject.client.spec.tsx | 88 ++++++++++++------ packages/client/ui-chat/tsconfig.client.json | 3 - .../client/ui-compaction/README.i18n.yaml | 34 ------- packages/client/ui-compaction/README.md | 58 ------------ packages/client/ui-compaction/README.zh.md | 58 ------------ packages/client/ui-compaction/locale/de.json | 6 -- packages/client/ui-compaction/locale/en.json | 6 -- packages/client/ui-compaction/locale/es.json | 6 -- packages/client/ui-compaction/locale/fr.json | 6 -- packages/client/ui-compaction/locale/ja.json | 6 -- packages/client/ui-compaction/locale/pt.json | 6 -- packages/client/ui-compaction/locale/ru.json | 6 -- packages/client/ui-compaction/locale/zh.json | 6 -- packages/client/ui-compaction/package.json | 67 -------------- .../client/ui-compaction/src/client/index.ts | 89 ------------------- .../ui-compaction/src/client/locales.ts | 67 -------------- packages/client/ui-compaction/src/index.ts | 9 -- .../ui-compaction/tests/apply.client.spec.ts | 85 ------------------ packages/client/ui-compaction/tsconfig.json | 33 ------- .../client/ui-compaction/tsdown.config.ts | 3 - .../skills/dsh-doc/references/packages.md | 1 - pnpm-lock.yaml | 30 ------- scripts/gen-cordis-catalog.ts | 1 - .../verify-package-readme-model-experience.ts | 1 - tsconfig.base.json | 2 - tsconfig.client.json | 1 - 46 files changed, 175 insertions(+), 671 deletions(-) create mode 100644 packages/client/ui-chat/src/client/chat/compaction-preview.ts delete mode 100644 packages/client/ui-compaction/README.i18n.yaml delete mode 100644 packages/client/ui-compaction/README.md delete mode 100644 packages/client/ui-compaction/README.zh.md delete mode 100644 packages/client/ui-compaction/locale/de.json delete mode 100644 packages/client/ui-compaction/locale/en.json delete mode 100644 packages/client/ui-compaction/locale/es.json delete mode 100644 packages/client/ui-compaction/locale/fr.json delete mode 100644 packages/client/ui-compaction/locale/ja.json delete mode 100644 packages/client/ui-compaction/locale/pt.json delete mode 100644 packages/client/ui-compaction/locale/ru.json delete mode 100644 packages/client/ui-compaction/locale/zh.json delete mode 100644 packages/client/ui-compaction/package.json delete mode 100644 packages/client/ui-compaction/src/client/index.ts delete mode 100644 packages/client/ui-compaction/src/client/locales.ts delete mode 100644 packages/client/ui-compaction/src/index.ts delete mode 100644 packages/client/ui-compaction/tests/apply.client.spec.ts delete mode 100644 packages/client/ui-compaction/tsconfig.json delete mode 100644 packages/client/ui-compaction/tsdown.config.ts diff --git a/apps/web/tests/seeded-history.e2e.ts b/apps/web/tests/seeded-history.e2e.ts index 9699f59abb..1fd1595322 100644 --- a/apps/web/tests/seeded-history.e2e.ts +++ b/apps/web/tests/seeded-history.e2e.ts @@ -54,12 +54,6 @@ const COMMAND_ROW_EXPECTED = fileURLToPath(new URL('../../../snapshots/web/seede const FEEDBACK_ROW_EXPECTED = fileURLToPath(new URL('../../../snapshots/web/seeded-history/feedback-row.expected.md', import.meta.url)) const FILE_PREVIEW_EXPECTED = join(SNAPSHOT_DIR, 'file-preview.expected.md') const CHECKPOINT_SIDEBAR_EXPECTED = join(SNAPSHOT_DIR, 'checkpoint-sidebar.expected.md') -// Copies of MARKDOWN_BODY_ID in -// packages/client/ui-sidebar-documentpreview/src/client/markdown/index.ts and -// of the English `preview.title` in -// packages/client/ui-compaction/src/client/locales.ts. apps/web does not -// declare either feature plugin as a dependency, so this spec cannot import -// their source values. const CHECKPOINT_TITLE = 'Context summary' const MODE = webSnapshotMode() const SEED_ID = 'seeded-history-web-e2e' diff --git a/docs/config-catalog.md b/docs/config-catalog.md index fc08530d07..1677edf573 100644 --- a/docs/config-catalog.md +++ b/docs/config-catalog.md @@ -5436,7 +5436,6 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co | `@deepseek-ai/dsh-client-ui-brand-official` | — | [`packages/client/ui-brand-official/src/index.ts`](../packages/client/ui-brand-official/src/index.ts) | | `@deepseek-ai/dsh-client-ui-chat` | — | [`packages/client/ui-chat/src/index.ts`](../packages/client/ui-chat/src/index.ts) | | `@deepseek-ai/dsh-client-ui-commands` | — | [`packages/client/ui-commands/src/index.ts`](../packages/client/ui-commands/src/index.ts) | -| `@deepseek-ai/dsh-client-ui-compaction` | — | [`packages/client/ui-compaction/src/index.ts`](../packages/client/ui-compaction/src/index.ts) | | `@deepseek-ai/dsh-client-ui-connector-account` | — | [`packages/client/ui-connector-account/src/index.ts`](../packages/client/ui-connector-account/src/index.ts) | | `@deepseek-ai/dsh-client-ui-conversation` | — | [`packages/client/ui-conversation/src/index.ts`](../packages/client/ui-conversation/src/index.ts) | | `@deepseek-ai/dsh-client-ui-cordis` | — | [`packages/extensions/ui-cordis/src/index.ts`](../packages/extensions/ui-cordis/src/index.ts) | diff --git a/docs/config-catalog.zh.md b/docs/config-catalog.zh.md index a1b8914fe6..c95fcbd47f 100644 --- a/docs/config-catalog.zh.md +++ b/docs/config-catalog.zh.md @@ -5438,7 +5438,6 @@ export interface Config { | `@deepseek-ai/dsh-client-ui-brand-official` | — | [`packages/client/ui-brand-official/src/index.ts`](../packages/client/ui-brand-official/src/index.ts) | | `@deepseek-ai/dsh-client-ui-chat` | — | [`packages/client/ui-chat/src/index.ts`](../packages/client/ui-chat/src/index.ts) | | `@deepseek-ai/dsh-client-ui-commands` | — | [`packages/client/ui-commands/src/index.ts`](../packages/client/ui-commands/src/index.ts) | -| `@deepseek-ai/dsh-client-ui-compaction` | — | [`packages/client/ui-compaction/src/index.ts`](../packages/client/ui-compaction/src/index.ts) | | `@deepseek-ai/dsh-client-ui-connector-account` | — | [`packages/client/ui-connector-account/src/index.ts`](../packages/client/ui-connector-account/src/index.ts) | | `@deepseek-ai/dsh-client-ui-conversation` | — | [`packages/client/ui-conversation/src/index.ts`](../packages/client/ui-conversation/src/index.ts) | | `@deepseek-ai/dsh-client-ui-cordis` | — | [`packages/extensions/ui-cordis/src/index.ts`](../packages/extensions/ui-cordis/src/index.ts) | diff --git a/docs/module-graph.md b/docs/module-graph.md index fa6a6ddf64..2e18191e32 100644 --- a/docs/module-graph.md +++ b/docs/module-graph.md @@ -176,7 +176,6 @@ flowchart TD pkg_client_ui_brand_official["client-ui-brand-official"] pkg_client_ui_chat["client-ui-chat"] pkg_client_ui_commands["client-ui-commands"] - pkg_client_ui_compaction["client-ui-compaction"] pkg_client_ui_connector_account["client-ui-connector-account"] pkg_client_ui_context_menu["client-ui-context-menu"] pkg_client_ui_conversation["client-ui-conversation"] @@ -1667,7 +1666,6 @@ flowchart TD | [`client-ui-brand-official`](../packages/client/ui-brand-official) | `client` | — | | [`client-ui-chat`](../packages/client/ui-chat) | `client` | — | | [`client-ui-commands`](../packages/client/ui-commands) | `client` | — | -| [`client-ui-compaction`](../packages/client/ui-compaction) | `client` | — | | [`client-ui-connector-account`](../packages/client/ui-connector-account) | `client` | — | | [`client-ui-context-menu`](../packages/client/ui-context-menu) | `client` | — | | [`client-ui-conversation`](../packages/client/ui-conversation) | `client` | — | diff --git a/docs/module-graph.zh.md b/docs/module-graph.zh.md index 2f572c1e48..c281107e79 100644 --- a/docs/module-graph.zh.md +++ b/docs/module-graph.zh.md @@ -178,7 +178,6 @@ flowchart TD pkg_client_ui_brand_official["client-ui-brand-official"] pkg_client_ui_chat["client-ui-chat"] pkg_client_ui_commands["client-ui-commands"] - pkg_client_ui_compaction["client-ui-compaction"] pkg_client_ui_connector_account["client-ui-connector-account"] pkg_client_ui_context_menu["client-ui-context-menu"] pkg_client_ui_conversation["client-ui-conversation"] @@ -1669,7 +1668,6 @@ flowchart TD | [`client-ui-brand-official`](../packages/client/ui-brand-official) | `client` | — | | [`client-ui-chat`](../packages/client/ui-chat) | `client` | — | | [`client-ui-commands`](../packages/client/ui-commands) | `client` | — | -| [`client-ui-compaction`](../packages/client/ui-compaction) | `client` | — | | [`client-ui-connector-account`](../packages/client/ui-connector-account) | `client` | — | | [`client-ui-context-menu`](../packages/client/ui-context-menu) | `client` | — | | [`client-ui-conversation`](../packages/client/ui-conversation) | `client` | — | diff --git a/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.i18n.yaml b/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.i18n.yaml index 353e5f8576..212a67398e 100644 --- a/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.i18n.yaml +++ b/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.i18n.yaml @@ -12,5 +12,5 @@ en: 13655501c3ad3c14 zh: 5ca7d430dc797250 /shared-sidebar-content-previews/migration: - en: 465c685a88e300d4 - zh: b6f25e9308b5060f + en: 7494c41cce37c0e3 + zh: d881da3d8ca1d0f5 diff --git a/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.md b/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.md index 14fbbb3402..4861c08b1f 100644 --- a/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.md +++ b/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.md @@ -18,4 +18,4 @@ Custom document bodies use the `sidebar.right.document.body` Factory. Its input 1. Close unavailable saved plan tabs and reopen their plan or review cards. Include `@deepseek-ai/dsh-client-ui-sidebar-documentpreview` in compositions that need previews; without its optional service, plan openers are disabled. 2. Open text with `ctx.sidebarRight.openContent({ mediaType: 'text/markdown', text }, { title, key })`. The method opens the sidebar directly; use `destination: 'float'` for a floating panel. Reopen previews after a browser reload. 3. Mount custom document renderers through `sidebar.right.document.body`, supplying `rendererId` and `useTabInfo`. Pass `baseAddress: resourceAddress` for workspace files and omit it for content without a file base. -4. Pass the marker’s non-null `summaryEventSeq` to the compaction preview service to display the recorded summary. +4. Use the marker’s `summaryEventSeq` to read its recorded summary from Session history. diff --git a/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.zh.md b/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.zh.md index d3fa76bb37..d00e90d79f 100644 --- a/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.zh.md +++ b/docs/upgrade-guide/v0.2.2-rc.5/sidebar-content-preview/guide.zh.md @@ -18,4 +18,4 @@ description: 重新打开已保存的计划预览,并把自定义文档正文 1. 关闭旧布局中不可用的计划标签,并从计划或审批卡片重新打开。需要预览的组合应加载 `@deepseek-ai/dsh-client-ui-sidebar-documentpreview`;它的可选服务缺席时,计划打开按钮保持禁用。 2. 调用 `ctx.sidebarRight.openContent({ mediaType: 'text/markdown', text }, { title, key })` 打开正文。方法直接打开侧栏,`destination: 'float'` 使用浮窗。刷新浏览器后请重新打开预览。 3. 通过 `sidebar.right.document.body` 挂载自定义渲染器,提供 `rendererId` 和 `useTabInfo`。工作区文件传入 `baseAddress: resourceAddress`,没有文件基址的正文省略它。 -4. 将压缩标记上非空的 `summaryEventSeq` 传给压缩预览服务以显示记录的摘要。 +4. 使用压缩标记上的 `summaryEventSeq` 从会话历史读取对应摘要。 diff --git a/packages/bundle/web-app/cordis.patch.yml b/packages/bundle/web-app/cordis.patch.yml index 31e57d9fbd..a2388407e4 100644 --- a/packages/bundle/web-app/cordis.patch.yml +++ b/packages/bundle/web-app/cordis.patch.yml @@ -329,11 +329,6 @@ - id: ui-sidebar-documentpreview name: '@deepseek-ai/dsh-client-ui-sidebar-documentpreview' - # Compaction checkpoints in the content tab: the replacement message the - # model reads after a compact, opened from Chat's compact rows. - - id: ui-compaction - name: '@deepseek-ai/dsh-client-ui-compaction' - # Web profiles opt in; Desktop retains sandboxed HTTP(S) Browser tabs. - id: ui-sidebar-browser name: '@deepseek-ai/dsh-client-ui-sidebar-browser' diff --git a/packages/bundle/web-app/package.json b/packages/bundle/web-app/package.json index 489592a6f5..7b8e134034 100644 --- a/packages/bundle/web-app/package.json +++ b/packages/bundle/web-app/package.json @@ -87,7 +87,6 @@ "@deepseek-ai/dsh-client-ui-brand-official": "workspace:*", "@deepseek-ai/dsh-client-ui-chat": "workspace:*", "@deepseek-ai/dsh-client-ui-commands": "workspace:*", - "@deepseek-ai/dsh-client-ui-compaction": "workspace:*", "@deepseek-ai/dsh-client-ui-connector-account": "workspace:*", "@deepseek-ai/dsh-client-ui-context-menu": "workspace:*", "@deepseek-ai/dsh-client-ui-conversation": "workspace:*", diff --git a/packages/client/README.i18n.yaml b/packages/client/README.i18n.yaml index 45108c4da9..4b229ab7a8 100644 --- a/packages/client/README.i18n.yaml +++ b/packages/client/README.i18n.yaml @@ -15,8 +15,8 @@ en: 1eb35b015a6c423f zh: a8a3dceee2c9e943 /client-web-gui-browser-half/packages: - en: e6ff2dcda65beacf - zh: 98f103a7c8028160 + en: a88259ae25f1c6d4 + zh: 3bc18746457f7dbf /client-web-gui-browser-half/related-documentation: en: d1d506e68fab7333 zh: 1a90fe6f3f8f24a9 diff --git a/packages/client/README.md b/packages/client/README.md index 0565024653..ab729c1fff 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -48,7 +48,6 @@ The kernel packages boot and serve the page; the UI feature packages present it. | [`ui-sidebar/`](ui-sidebar/README.md) | Presents workspace and session navigation | — | | [`ui-sidebar-right/`](ui-sidebar-right/README.md) | Owns the right Sidebar and its tab types | `ctx.sidebarRight`, `ctx.sidebarRightTabs` | | [`ui-sidebar-documentpreview/`](ui-sidebar-documentpreview/README.md) | Displays documents in right Sidebar tabs: workspace files, and in-memory content that is not a workspace file | `ctx.documentPreviews` | -| [`ui-compaction/`](ui-compaction/README.md) | Opens recorded compaction summaries in temporary sidebar tabs | `ctx.compactionPreviews` | | [`ui-sidebar-browser/`](ui-sidebar-browser/README.md) | Browses sandboxed HTTP(S) pages, including loopback services, in right-Sidebar tabs | — | | [`resources/`](resources/README.md) | Unified resource model: protocol providers behind the `useResource` session standard hook | `ctx.resources` | | [`ui-sidebar-files/`](ui-sidebar-files/README.md) | The workspace files page and one workspace tree per pane beside docked and floating previews | — | diff --git a/packages/client/README.zh.md b/packages/client/README.zh.md index 6724d66e41..ede940edc8 100644 --- a/packages/client/README.zh.md +++ b/packages/client/README.zh.md @@ -48,7 +48,6 @@ kind: "package-group" | [`ui-sidebar/`](ui-sidebar/README.zh.md) | 展示工作区与会话导航 | — | | [`ui-sidebar-right/`](ui-sidebar-right/README.zh.md) | 管理右侧 Sidebar 及其 tab 类型 | `ctx.sidebarRight`, `ctx.sidebarRightTabs` | | [`ui-sidebar-documentpreview/`](ui-sidebar-documentpreview/README.zh.md) | 在右侧 Sidebar 的 tab 中显示文档:工作区文件,以及不是工作区文件的内存内容 | `ctx.documentPreviews` | -| [`ui-compaction/`](ui-compaction/README.zh.md) | 在临时侧栏标签中显示已记录的压缩摘要 | `ctx.compactionPreviews` | | [`ui-sidebar-browser/`](ui-sidebar-browser/README.zh.md) | 在右侧 Sidebar tab 中浏览 sandboxed HTTP(S) 页面,包括 loopback 服务 | — | | [`resources/`](resources/README.zh.md) | 统一资源模型:`useResource` 会话标准钩子背后的协议提供方 | `ctx.resources` | | [`ui-sidebar-files/`](ui-sidebar-files/README.zh.md) | 工作区文件页,以及停靠与浮动文件预览旁每个分栏一棵的工作区目录树 | — | diff --git a/packages/client/ui-chat/README.i18n.yaml b/packages/client/ui-chat/README.i18n.yaml index 0a26cc95db..0bcdef0d47 100644 --- a/packages/client/ui-chat/README.i18n.yaml +++ b/packages/client/ui-chat/README.i18n.yaml @@ -21,8 +21,8 @@ en: 8ca277dc7fed699f zh: 167478dba50f3904 /deepseek-ai-dsh-client-ui-chat/command-and-failure-rows: - en: 89a525179bcd92a7 - zh: 2a4795cc1b451f67 + en: 6b89f99bb3d378d9 + zh: 18e7b084164577ba /deepseek-ai-dsh-client-ui-chat/inherited-history-divider: en: a191f90e9a64f6fe zh: 8e91b8660f9baa18 diff --git a/packages/client/ui-chat/README.md b/packages/client/ui-chat/README.md index 03c85ec9bc..23453b9b49 100644 --- a/packages/client/ui-chat/README.md +++ b/packages/client/ui-chat/README.md @@ -70,7 +70,7 @@ Text and reasoning contribute to Assistant visibility only when they contain a n Subagent result notices use the Users icon and show only the localized execution outcome in their heading, without a task description or child ID. Completed means that execution ended normally, not that its output passed validation. Historical notices without a readable outcome retain the generic title; unfamiliar outcomes display “Subagent run ended unexpectedly”. Expanded notices preserve their original model-facing body. -Automatic compaction shows a progress row until a checkpoint lands or the operation ends. Completed automatic and manual rows show the replaced item and token counts. The optional `compactionPreviews` service opens the recorded `compaction/summary` text in a temporary sidebar tab. Rows disable the opener while the service or summary sequence is unavailable; the row displays read errors. +Automatic compaction shows a progress row until a checkpoint lands or the operation ends. Completed automatic and manual rows show the replaced item and token counts. Chat opens the recorded `compaction/summary` text in a temporary sidebar tab. Rows disable the opener while the document viewer or summary sequence is unavailable; the row displays read errors. 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 whose `conversation` retain facet a rendering reference currently holds publish; quota failures in Sessions this Client never opened, or that occur while a Session is kept only as a recent view, do not, and resuming the facet does not replay them. 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. A Turn that restart recovery closed as `interrupted` renders a localized stopped row stating that the DSH process exited mid-Turn, without a code chip, and its process summary reads Stopped. diff --git a/packages/client/ui-chat/README.zh.md b/packages/client/ui-chat/README.zh.md index 8529bc4e3f..aded870042 100644 --- a/packages/client/ui-chat/README.zh.md +++ b/packages/client/ui-chat/README.zh.md @@ -70,7 +70,7 @@ Assistant 尝试结束且没有可见消息时,Chat 隐藏已发布的 Node, 子智能体结果通知使用 Users 图标,标题仅显示本地化的执行状态,不附加任务描述或子智能体 ID。完成表示执行正常结束,不表示输出已通过验证。历史通知没有可读取的结束状态时保留通用标题;未知状态显示“子智能体异常结束”。展开后的通知保留原始模型可见正文。 -自动压缩从开始到生成 checkpoint 或结束期间显示进度行。自动和手动压缩完成后显示替换条目数与 token 数。可选的 `compactionPreviews` 服务在临时侧栏标签中打开 `compaction/summary` 记录的正文。服务或摘要序号不可用时按钮禁用,读取错误显示在压缩行中。 +自动压缩从开始到生成 checkpoint 或结束期间显示进度行。自动和手动压缩完成后显示替换条目数与 token 数。Chat 在临时侧栏标签中打开 `compaction/summary` 记录的正文。文档预览或摘要序号不可用时按钮禁用,读取错误显示在压缩行中。 通用指令行在所有生命周期状态中都保留普通指令图标;失败仍通过行状态与摘要表达。每个终止轮次都渲染自己的红点行;欠费失败的行使用中立的 `message.failure.quota` 文案,而不是提供方消息。新追加的 `QUOTA` 或 `ACCOUNT_QUOTA` 产生的瞬时提示来自本包注册在 `shell.overlay` 的全局条目,它不随 Chat 面板消失:该条目把唯一一条实时提示交给 `shell.quota-notice` 链,并在无人接管时回退到自己的警告 Toast,接管该错误码的条目会替换该回退。只有当前被渲染方引用保留了 `conversation` retain 子要素的 Session 会发布提示;本 Client 从未打开的 Session,以及仅作为最近访问会话保留期间发生的欠费都不会发布,恢复保留后也不补发。更新的提示会替换当前提示,除非认领条目用 `keepOpen()` 保持住当前提示:该调用返回一个由调用方持有、必须在卸载时调用的释放函数,只要存在保持,认领条目就继续挂载,后续提示被丢弃,释放后恢复后续提示但不重放已丢弃的提示。回退 Toast 自身没有延后策略:当 Desktop 账号的不透明原生 Platform 页盖住本页时,它仍会在下方运行,其显示计时器可能在不可见时走完并自行撤下提示,因此只留下持久化失败行。释放只移除自己的保持,因此它在关闭或更新的保持之后执行时不会影响更新的保持。关闭与退出登录会清空所有保持;被丢弃的提示不排队,其对应的持久化失败行仍会渲染。历史替换和分页不会发布提示。中间重试不会创建终止行;输出 token 上限使用琥珀色警告点。重启恢复以 `interrupted` 结束的轮次会渲染本地化的停止行,说明 DSH 进程在轮次中途退出,不显示代码标签,其过程摘要显示“已停止”。 diff --git a/packages/client/ui-chat/package.json b/packages/client/ui-chat/package.json index ea25b39537..8409f91e9f 100644 --- a/packages/client/ui-chat/package.json +++ b/packages/client/ui-chat/package.json @@ -100,8 +100,7 @@ "@deepseek-ai/dsh-settings": "workspace:*", "@deepseek-ai/dsh-client-product-analytics": "workspace:*", "@deepseek-ai/dsh-client-ui-file-drag": "workspace:*", - "@deepseek-ai/dsh-client-ui-context-menu": "workspace:*", - "@deepseek-ai/dsh-client-ui-compaction": "workspace:*" + "@deepseek-ai/dsh-client-ui-context-menu": "workspace:*" }, "dependencies": { "@deepseek-ai/schemastery": "workspace:~" diff --git a/packages/client/ui-chat/src/client/chat/compaction-preview.ts b/packages/client/ui-chat/src/client/chat/compaction-preview.ts new file mode 100644 index 0000000000..c7ebe18b92 --- /dev/null +++ b/packages/client/ui-chat/src/client/chat/compaction-preview.ts @@ -0,0 +1,76 @@ +/** Session-bound Markdown previews for manual and automatic compaction rows. */ +import type { Context } from '@deepseek-ai/cordis' +import type { SessionAddress } from '@deepseek-ai/dsh-api-session-controller/types' +import type {} from '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/client' +import { createSnapshotStore } from '@deepseek-ai/dsh-client-store' +import type { SessionId } from '@deepseek-ai/dsh-session/types' +import { NS } from '../locale.ts' +import type { CompactionRowInjected } from './CompactionItem.tsx' + +/** Bind summary reads to the requesting row and the document viewer lifetime. + * @param ctx - Chat plugin context. + * @returns the preview action and availability hook for a Session. + */ +export function compactionRows(ctx: Context): (sessionId: SessionId) => CompactionRowInjected { + const compactionPreview = createSnapshotStore(false) + const t = ctx.locale.bind(NS) + let lifetime: AbortController | undefined + ctx.inject(['documentPreviews'], scope => scope.effect(() => { + const controller = new AbortController() + lifetime = controller + compactionPreview.set(true) + return () => { + controller.abort() + lifetime = undefined + compactionPreview.set(false) + } + })) + return sessionId => ({ + hooks: { compactionPreview }, + async openCompaction(summarySeq, signal) { + if (lifetime === undefined) return null + const child = ctx.sessions.subagentAddress(sessionId) + const address: SessionAddress = child === undefined ? { kind: 'session', sessionId } : { kind: 'subagent', ...child } + const active = AbortSignal.any([signal, lifetime.signal]) + const cancelled = (): boolean => active.aborted + if (cancelled()) return null + let result + try { + result = await ctx.remote.session.events({ address, throughSeq: summarySeq, maxMessages: 1 }, active) + } catch (_error) { + // A cancelled row has no read failure to display. + return cancelled() ? null : t('message.compaction.readFailed') + } + if (cancelled()) return null + if (!result.ok) return t('message.compaction.readFailed') + const event = result.value.records.find(entry => entry.event.seq === summarySeq)?.event + const text = event && summaryText(event) + if (text === undefined) return t('message.compaction.notFound') + const identity = address.kind === 'session' ? [address.sessionId] : [address.parentSessionId, address.childSessionId, address.mode] + const opened = ctx.sidebarRight.openContent({ mediaType: 'text/markdown', text }, { + title: t('message.compaction.title'), key: `compaction:${JSON.stringify([...identity, summarySeq])}`, + }) + return opened ? null : t('message.compaction.notFound') + }, + }) +} + +/** Extract text only from a valid summary event returned by the history API. + * @param event - Wire event with untrusted JSON data. + * @returns Markdown, or undefined for unrelated, empty or malformed content. + */ +function summaryText(event: { readonly type: string; readonly data: unknown }): string | undefined { + if (event.type !== 'compaction/summary') return undefined + const data = event.data + if (typeof data !== 'object' || data === null || !('summary' in data) || !Array.isArray(data.summary)) return undefined + const text: string[] = [] + const blocks: readonly unknown[] = data.summary + for (const block of blocks) { + if (typeof block !== 'object' || block === null || !('type' in block)) return undefined + if (block.type !== 'text') continue + if (!('text' in block) || typeof block.text !== 'string') return undefined + text.push(block.text) + } + const markdown = text.join('') + return markdown.trim() === '' ? undefined : markdown +} diff --git a/packages/client/ui-chat/src/client/chat/register-node-renderers.ts b/packages/client/ui-chat/src/client/chat/register-node-renderers.ts index ace33589c3..c81bbc0c28 100644 --- a/packages/client/ui-chat/src/client/chat/register-node-renderers.ts +++ b/packages/client/ui-chat/src/client/chat/register-node-renderers.ts @@ -1,9 +1,6 @@ import type { Context } from '@deepseek-ai/cordis' -import type { SessionAddress } from '@deepseek-ai/dsh-api-session-controller/types' -import type {} from '@deepseek-ai/dsh-client-ui-compaction/client' -import type { SessionId } from '@deepseek-ai/dsh-session/types' -import type { CompactionRowInjected } from './CompactionItem.tsx' -import { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-client-store' +import { compactionRows } from './compaction-preview.ts' +import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store' import type { PerformanceUsageMode } from '../../chat-settings.ts' import type { ChatPresentationPolicy } from '../presentation-policy.ts' import { NS } from '../locale.ts' @@ -33,23 +30,7 @@ export function registerChatNodeRenderers( performanceUsage: ObservableSnapshot, presentation: ObservableSnapshot, ): void { - const compactionPreview = createSnapshotStore(false) - let compactionPreviews: Context['compactionPreviews'] | undefined - ctx.inject(['compactionPreviews'], (scope) => { - scope.effect(() => { - compactionPreviews = scope.compactionPreviews - compactionPreview.set(true) - return () => { compactionPreviews = undefined; compactionPreview.set(false) } - }, 'ui-chat: compaction preview availability') - }) - const injectCompaction = (sessionId: SessionId): CompactionRowInjected => ({ - hooks: { compactionPreview }, - openCompaction: (seq, signal) => { - const child = ctx.sessions.subagentAddress(sessionId) - const address: SessionAddress = child === undefined ? { kind: 'session', sessionId } : { kind: 'subagent', ...child } - return compactionPreviews?.open(address, seq, signal) ?? Promise.resolve(null) - }, - }) + const injectCompaction = compactionRows(ctx) ctx.effect(() => ctx.slots.registerFactory({ name: 'conversation.chat.reasoning.content', scope: 'root', diff --git a/packages/client/ui-chat/src/client/locale.ts b/packages/client/ui-chat/src/client/locale.ts index f944180d17..e294c6d4f8 100644 --- a/packages/client/ui-chat/src/client/locale.ts +++ b/packages/client/ui-chat/src/client/locale.ts @@ -157,6 +157,9 @@ export const zh = { 'message.compaction.running': '正在压缩…', 'message.compaction.completed': '已压缩 {items} 条历史记录(约 {tokens} tokens)', 'message.compaction.open': '在侧栏查看压缩摘要', + 'message.compaction.title': '上下文摘要', + 'message.compaction.notFound': '摘要不可用:预览服务不可用,或摘要记录缺失、为空或无效。', + 'message.compaction.readFailed': '无法读取摘要', 'message.compaction.landed': '较早的历史已压缩为摘要', 'message.compaction.commandTitle': 'compact', 'message.think': '思考', @@ -372,6 +375,9 @@ export const en = { 'message.compaction.running': 'Compacting context…', 'message.compaction.completed': 'Compacted {items} history items (~{tokens} tokens)', 'message.compaction.open': 'View compaction summary in the sidebar', + 'message.compaction.title': 'Context summary', + 'message.compaction.notFound': 'Summary unavailable: the preview service is unavailable, or the summary record is missing, empty or invalid.', + 'message.compaction.readFailed': 'Unable to read the summary', 'message.compaction.landed': 'Earlier history condensed into a summary', 'message.compaction.commandTitle': 'compact', 'message.think': 'Think', @@ -584,6 +590,9 @@ export const ja = { 'message.compaction.running': 'コンテキストを圧縮中…', 'message.compaction.completed': '履歴 {items} 件を圧縮しました(約 {tokens} トークン)', 'message.compaction.open': '圧縮の要約をサイドバーで表示', + 'message.compaction.title': 'コンテキストの要約', + 'message.compaction.notFound': '要約を利用できません。プレビューサービスが利用できないか、要約が存在しない、空、または無効です。', + 'message.compaction.readFailed': '要約を読み込めません', 'message.compaction.landed': '以前の履歴を要約に圧縮しました', 'message.compaction.commandTitle': 'compact', 'message.think': '思考', @@ -796,6 +805,9 @@ export const es = { 'message.compaction.running': 'Contexto de compactación…', 'message.compaction.completed': 'Elementos del historial {items} compactados (~tokens {tokens})', 'message.compaction.open': 'Ver el resumen de compactación en la barra lateral', + 'message.compaction.title': 'Resumen del contexto', + 'message.compaction.notFound': 'Resumen no disponible: el servicio no está disponible o el registro falta, está vacío o no es válido.', + 'message.compaction.readFailed': 'No se pudo leer el resumen', 'message.compaction.landed': 'Historial anterior condensado en un resumen', 'message.compaction.commandTitle': 'compacto', 'message.think': 'pensar', @@ -1008,6 +1020,9 @@ export const fr = { 'message.compaction.running': 'Contexte de compactage…', 'message.compaction.completed': "Éléments d'historique {items} compactés (~jetons {tokens})", 'message.compaction.open': 'Afficher le résumé de compactage dans le panneau latéral', + 'message.compaction.title': 'Résumé du contexte', + 'message.compaction.notFound': 'Résumé indisponible : le service est indisponible ou le résumé est absent, vide ou invalide.', + 'message.compaction.readFailed': 'Impossible de lire le résumé', 'message.compaction.landed': 'Historique antérieur condensé en résumé', 'message.compaction.commandTitle': 'compacte', 'message.think': 'Pensez', @@ -1220,6 +1235,9 @@ export const de = { 'message.compaction.running': 'Kontext verdichten…', 'message.compaction.completed': 'Komprimierte {items}-Verlaufselemente (~{tokens}-Tokens)', 'message.compaction.open': 'Zusammenfassung der Komprimierung in der Seitenleiste anzeigen', + 'message.compaction.title': 'Kontextzusammenfassung', + 'message.compaction.notFound': 'Zusammenfassung nicht verfügbar: Der Dienst ist nicht verfügbar oder der Eintrag fehlt, ist leer oder ungültig.', + 'message.compaction.readFailed': 'Zusammenfassung konnte nicht gelesen werden', 'message.compaction.landed': 'Früherer Verlauf zu einer Zusammenfassung verdichtet', 'message.compaction.commandTitle': 'kompakt', 'message.think': 'Denken Sie nach', @@ -1432,6 +1450,9 @@ export const ru = { 'message.compaction.running': 'Сжатие контекста…', 'message.compaction.completed': 'Сжатые элементы истории {items} (токены ~{tokens})', 'message.compaction.open': 'Открыть сводку сжатия на боковой панели', + 'message.compaction.title': 'Сводка контекста', + 'message.compaction.notFound': 'Сводка недоступна: сервис недоступен либо запись отсутствует, пуста или недействительна.', + 'message.compaction.readFailed': 'Не удалось прочитать сводку', 'message.compaction.landed': 'Ранняя история сжата в сводку', 'message.compaction.commandTitle': 'компактный', 'message.think': 'Подумайте', @@ -1644,6 +1665,9 @@ export const pt = { 'message.compaction.running': 'Contexto compactado…', 'message.compaction.completed': '{items} itens de histórico compactados (~{tokens} tokens)', 'message.compaction.open': 'Ver o resumo da compactação na barra lateral', + 'message.compaction.title': 'Resumo do contexto', + 'message.compaction.notFound': 'Resumo indisponível: o serviço está indisponível ou o registro está ausente, vazio ou inválido.', + 'message.compaction.readFailed': 'Não foi possível ler o resumo', 'message.compaction.landed': 'Histórico anterior condensado em um resumo', 'message.compaction.commandTitle': 'compacto', 'message.think': 'Pense', diff --git a/packages/client/ui-chat/tests/apply-inject.client.spec.tsx b/packages/client/ui-chat/tests/apply-inject.client.spec.tsx index 48b96a1409..d70bb0570f 100644 --- a/packages/client/ui-chat/tests/apply-inject.client.spec.tsx +++ b/packages/client/ui-chat/tests/apply-inject.client.spec.tsx @@ -24,6 +24,8 @@ import { import { apply as applyChat, inject as injectChat, type ChatFlowDataInjected, type ChatViewInjected, } from '@deepseek-ai/dsh-client-ui-chat/client' +import { RemoteError } from '@deepseek-ai/dsh-typert-protocol' +import type { SessionWireEvent } from '@deepseek-ai/dsh-api-session-controller/types' import { SessionSeq, type SessionId } from '@deepseek-ai/dsh-session/types' import type { WorkspaceId } from '@deepseek-ai/dsh-workspace/types' import { createChatStore } from '../src/client/stores.ts' @@ -72,6 +74,7 @@ async function bench(initialSettings?: ChatSettings, withBrowserRegistry = true, runtime.ctx.provide('fileDrag', { actions: fileDrag, read: () => undefined }) runtime.ctx.provide('layout', layout as never) const sidebarRight = { + openContent: vi.fn(() => true), openResource: vi.fn<(address: string) => void>(), openTab: vi.fn<(kind: string, options?: unknown) => void>(), } @@ -87,7 +90,12 @@ async function bench(initialSettings?: ChatSettings, withBrowserRegistry = true, const openWorkspacePath = vi.fn( () => Promise.resolve({ ok: true, value: { opened: true } }), ) - runtime.remote.provideNamespaces({ session: { openWorkspacePath } }) + const events = vi.fn(async ({ throughSeq }) => ({ + ok: true, value: { cursor: 42, hasMore: false, records: [{ type: 'event', event: { + type: 'compaction/summary', seq: throughSeq ?? 42, time: 0, data: { summary: [{ type: 'text', text: '# Summary' }] }, + } }] }, + })) + runtime.remote.provideNamespaces({ session: { openWorkspacePath, events } }) const openSession = vi.fn<(id: SessionId) => void>() runtime.ctx.provide('uiWorkspace', { openWorkspace: vi.fn(async (_workspaceId: WorkspaceId, beforeOpen: (id: SessionId) => void) => { @@ -147,7 +155,7 @@ async function bench(initialSettings?: ChatSettings, withBrowserRegistry = true, const preference: object = row.inject!() return preference as LinkOpeningRowInjected }, - runtime, chat, chatSettings, browserAvailable, + events, runtime, chat, chatSettings, browserAvailable, layout, openWorkspacePath, sidebarRight, sidebarRightTabs, session, chatViewApi, chatFlowApi, rootReference, openSession, } } @@ -456,40 +464,66 @@ describe('Chat inject API', () => { } }) - it('opens ordinary and subagent checkpoints through the optional preview service', async () => { + it('opens recorded summaries by Session and stops pending reads when the viewer unloads', async () => { const b = await bench() - const open = vi.fn(async () => null) try { - const injected = b.compactionRow('compaction') + const row = b.compactionRow('manual-compaction') const signal = new AbortController().signal - expect(await injected.openCompaction(42, signal)).toBeNull() - const service = await b.runtime.mount({ apply(ctx) { ctx.provide('compactionPreviews', { open }) } }) - await vi.waitFor(() => { expect(injected.hooks.compactionPreview.getSnapshot()).toBe(true) }) - await injected.openCompaction(42, signal) - expect(open).toHaveBeenLastCalledWith({ kind: 'session', sessionId: ROOT }, 42, signal) + expect(await row.openCompaction(42, signal)).toBeNull() + expect(b.events).not.toHaveBeenCalled() + const viewer = await b.runtime.mount({ apply(ctx) { ctx.provide('documentPreviews', {} as never) } }) + await vi.waitFor(() => { expect(row.hooks.compactionPreview.getSnapshot()).toBe(true) }) + await row.openCompaction(42, signal) + expect(b.events).toHaveBeenLastCalledWith({ address: { kind: 'session', sessionId: ROOT }, throughSeq: 42, maxMessages: 1 }, expect.any(AbortSignal)) + expect(b.sidebarRight.openContent).toHaveBeenCalledWith({ mediaType: 'text/markdown', text: '# Summary' }, + expect.objectContaining({ title: '上下文摘要' })) const child = { parentSessionId: 'parent/1' as SessionId, childSessionId: ROOT, mode: 'continuable' as const } vi.spyOn(b.runtime.ctx.sessions, 'subagentAddress').mockReturnValue(child) - await injected.openCompaction(7, signal) - expect(open).toHaveBeenLastCalledWith({ kind: 'subagent', ...child }, 7, signal) - await service.dispose() - expect(injected.hooks.compactionPreview.getSnapshot()).toBe(false) + await row.openCompaction(42, signal) + expect(b.events).toHaveBeenLastCalledWith({ address: { kind: 'subagent', ...child }, throughSeq: 42, maxMessages: 1 }, expect.any(AbortSignal)) + expect(b.sidebarRight.openContent.mock.calls[0]![1].key).not.toBe(b.sidebarRight.openContent.mock.calls[1]![1].key) + b.events.mockImplementationOnce(async (_query, active) => { + await viewer.dispose() + expect(active?.aborted).toBe(true) + throw new Error('cancelled') + }) + expect(await row.openCompaction(42, signal)).toBeNull() + expect(row.hooks.compactionPreview.getSnapshot()).toBe(false) + expect(b.sidebarRight.openContent).toHaveBeenCalledTimes(2) } finally { await b.runtime.dispose() } }) - it('tracks preview service availability independently of sidebar tab registration', async () => { - const b = await bench(undefined, false) + it('reports unreadable summaries and keeps cancelled reads out of the sidebar', async () => { + const b = await bench() try { - const preview = b.compactionRow('manual-compaction').hooks.compactionPreview - expect(preview.getSnapshot()).toBe(false) - const changed = vi.fn() - const unsubscribe = preview.subscribe(changed) - const service = await b.runtime.mount({ apply(ctx) { ctx.provide('compactionPreviews', { open: async () => null }) } }) - await vi.waitFor(() => { expect(preview.getSnapshot()).toBe(true) }) - expect(changed).toHaveBeenCalledOnce() - await service.dispose() - expect(preview.getSnapshot()).toBe(false) - expect(changed).toHaveBeenCalledTimes(2) - unsubscribe() + const row = b.compactionRow('compaction') + const signal = new AbortController().signal + await b.runtime.mount({ apply(ctx) { ctx.provide('documentPreviews', {} as never) } }) + await vi.waitFor(() => { expect(row.hooks.compactionPreview.getSnapshot()).toBe(true) }) + const event = { seq: 42, time: 0, type: 'compaction/summary', data: { summary: [{ type: 'text', text: 'summary' }] } } + const records: SessionWireEvent[] = [{ ...event, seq: 41 }, { ...event, type: 'other' }, + ...[null, {}, { summary: [null] }, { summary: [{}] }, { summary: [{ type: 'text', text: 5 }] }, + { summary: [{ type: 'image' }, { type: 'text', text: ' ' }] }].map(data => ({ ...event, data }))] + for (const invalid of records) { + b.events.mockResolvedValueOnce({ ok: true, value: { cursor: 42, hasMore: false, records: [{ type: 'event', event: invalid }] } }) + expect(await row.openCompaction(42, signal)).toContain('摘要不可用') + } + b.events.mockRejectedValueOnce(new Error('offline')) + expect(await row.openCompaction(42, signal)).toBe('无法读取摘要') + b.events.mockResolvedValueOnce({ ok: false, error: new RemoteError('gateway/internal', 'offline', {}) }) + expect(await row.openCompaction(42, signal)).toBe('无法读取摘要') + b.events.mockResolvedValueOnce({ ok: true, value: { cursor: 42, hasMore: false, records: [] } }) + expect(await row.openCompaction(42, signal)).toContain('摘要不可用') + expect(await row.openCompaction(42, AbortSignal.abort())).toBeNull() + const pending = new AbortController() + b.events.mockImplementationOnce(async () => { + pending.abort() + return { ok: true, value: { cursor: 42, hasMore: false, records: [{ type: 'event', event }] } } + }) + expect(await row.openCompaction(42, pending.signal)).toBeNull() + expect(b.sidebarRight.openContent).not.toHaveBeenCalled() + b.sidebarRight.openContent.mockReturnValueOnce(false) + expect(await row.openCompaction(42, signal)).toContain('摘要不可用') } finally { await b.runtime.dispose() } }) diff --git a/packages/client/ui-chat/tsconfig.client.json b/packages/client/ui-chat/tsconfig.client.json index 4785893233..d45708b9fa 100644 --- a/packages/client/ui-chat/tsconfig.client.json +++ b/packages/client/ui-chat/tsconfig.client.json @@ -125,9 +125,6 @@ }, { "path": "../ui-context-menu" - }, - { - "path": "../ui-compaction" } ], "exclude": [ diff --git a/packages/client/ui-compaction/README.i18n.yaml b/packages/client/ui-compaction/README.i18n.yaml deleted file mode 100644 index 3d3b7fc32c..0000000000 --- a/packages/client/ui-compaction/README.i18n.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading -# section, a hash of its English and Chinese blocks outside code blocks and generated regions. -# After editing either side, bring the other along and re-record with: -# pnpm run verify-translation-pairing --write packages/client/ui-compaction/README.md -/: - en: f08e4f7372e89553 - zh: e14e4dab70119e88 -/deepseek-ai-dsh-client-ui-compaction: - en: 453f619db5ec29a6 - zh: 962a998670eb8253 -/deepseek-ai-dsh-client-ui-compaction/summary: - en: aa6865eaafdbf837 - zh: 3bddc62b0765f428 -/deepseek-ai-dsh-client-ui-compaction/table-of-contents: - en: d3ca4204ae112422 - zh: 7b3a3c6e211edeb0 -/deepseek-ai-dsh-client-ui-compaction/what-it-registers: - en: 98a28bdf0c002067 - zh: 95459ac0d88655cc -/deepseek-ai-dsh-client-ui-compaction/reading-a-summary: - en: 098b709b76a6068f - zh: 86848c4bfc43f0a6 -/deepseek-ai-dsh-client-ui-compaction/model-experience: - en: f51ca904b3454532 - zh: 92b6f1bcaeeaf3f2 -/deepseek-ai-dsh-client-ui-compaction/model-experience/kv-cache-effect: - en: 900e7c177de0539e - zh: 08875689803df6c6 -/deepseek-ai-dsh-client-ui-compaction/known-limitations-and-deferred-work: - en: fcd9b8c47f1b719b - zh: d49e599d119b0850 -/deepseek-ai-dsh-client-ui-compaction/known-limitations-and-deferred-work/dev-note: - en: e67f633dc6fe7773 - zh: e88aeb617ffb74ea diff --git a/packages/client/ui-compaction/README.md b/packages/client/ui-compaction/README.md deleted file mode 100644 index b3db664c5b..0000000000 --- a/packages/client/ui-compaction/README.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -description: "Right sidebar previews of recorded conversation compaction summaries." -kind: "package-reference" ---- - -# @deepseek-ai/dsh-client-ui-compaction - -English | [中文](README.zh.md) - -## Summary - -Chat opens a recorded summary with `ctx.compactionPreviews.open(address, summarySeq, signal)`. After reloading the browser, reopen it from its compaction row. - -## Table of Contents - -- [What it registers](#what-it-registers) -- [Reading a summary](#reading-a-summary) -- [Model Experience](#model-experience) -- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work) -- [Dev Note](#dev-note) - ------ - - -## What it registers - -While document previews are available, the plugin provides the compaction preview service to Chat. - - -## Reading a summary - -The service reads the exact `compaction/summary` event with the Session address, `throughSeq`, and `maxMessages: 1`. Missing or empty summaries and read failures appear on the requesting row. Cancellation stops navigation. - -The service passes the joined Markdown text to `sidebarRight.openContent`. Reopening the same event reuses its tab. - - -## Model Experience - -None, as the package displays a logged summary and registers no tool, prompt section, or session event. - -#### KV Cache effect - -No direct effect on model requests or caching. - -## Known Limitations and Deferred Work - - -- **Partial history.** The preview button is disabled while the associated summary event is outside the loaded history. - - -### Dev Note - -
-Working context for maintainers — click to expand - -None. - -
diff --git a/packages/client/ui-compaction/README.zh.md b/packages/client/ui-compaction/README.zh.md deleted file mode 100644 index 4c283c2c98..0000000000 --- a/packages/client/ui-compaction/README.zh.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -description: "在右侧栏预览会话日志中的压缩摘要。" -kind: "package-reference" ---- - -# @deepseek-ai/dsh-client-ui-compaction - -[English](README.md) | 中文 - -## 概述 - -Chat 通过 `ctx.compactionPreviews.open(address, summarySeq, signal)` 打开已记录的摘要。刷新浏览器后,从压缩行重新打开摘要。 - -## 目录 - -- [注册了什么](#what-it-registers) -- [读取摘要](#reading-a-summary) -- [模型体验](#model-experience) -- [已知限制与延期工作](#known-limitations-and-deferred-work) -- [开发备注](#dev-note) - ------ - - -## 注册了什么 - -文档预览可用时,插件向 Chat 提供压缩摘要预览服务。 - - -## 读取摘要 - -服务使用会话地址、`throughSeq` 和 `maxMessages: 1` 读取指定的 `compaction/summary` 事件。摘要缺失、为空或读取失败时,发起请求的压缩行显示错误。取消请求会停止导航。 - -服务将按顺序拼接的 Markdown 文本传给 `sidebarRight.openContent`。重复打开同一事件会复用标签。 - - -## 模型体验 - -无,本包只显示会话日志中的摘要,不注册工具、提示词段或会话事件。 - -#### KV Cache 影响 - -对模型请求和缓存无直接影响。 - -## 已知限制与延期工作 - - -- **部分历史。** 关联的摘要事件尚未加载时,预览按钮禁用。 - - -### 开发备注 - -
-维护者工作上下文——点击展开 - -无。 - -
diff --git a/packages/client/ui-compaction/locale/de.json b/packages/client/ui-compaction/locale/de.json deleted file mode 100644 index b20e2edfe9..0000000000 --- a/packages/client/ui-compaction/locale/de.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "meta": { - "title": "Vorschau der Komprimierungszusammenfassung", - "description": "Zeigt Zusammenfassungen komprimierter Gespräche in der rechten Seitenleiste an." - } -} diff --git a/packages/client/ui-compaction/locale/en.json b/packages/client/ui-compaction/locale/en.json deleted file mode 100644 index ca78ba7f43..0000000000 --- a/packages/client/ui-compaction/locale/en.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "meta": { - "title": "Compaction summary preview", - "description": "Read conversation compaction summaries in the right sidebar." - } -} diff --git a/packages/client/ui-compaction/locale/es.json b/packages/client/ui-compaction/locale/es.json deleted file mode 100644 index fbfbb70ff4..0000000000 --- a/packages/client/ui-compaction/locale/es.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "meta": { - "title": "Vista previa del resumen de compactación", - "description": "Consulta los resúmenes de compactación de conversaciones en la barra lateral derecha." - } -} diff --git a/packages/client/ui-compaction/locale/fr.json b/packages/client/ui-compaction/locale/fr.json deleted file mode 100644 index c1ba5103db..0000000000 --- a/packages/client/ui-compaction/locale/fr.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "meta": { - "title": "Aperçu du résumé de compactage", - "description": "Consultez les résumés de compactage des conversations dans la barre latérale droite." - } -} diff --git a/packages/client/ui-compaction/locale/ja.json b/packages/client/ui-compaction/locale/ja.json deleted file mode 100644 index 07dfbc5f19..0000000000 --- a/packages/client/ui-compaction/locale/ja.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "meta": { - "title": "圧縮要約プレビュー", - "description": "右サイドバーで会話の圧縮要約を表示します。" - } -} diff --git a/packages/client/ui-compaction/locale/pt.json b/packages/client/ui-compaction/locale/pt.json deleted file mode 100644 index 3459f4ae1a..0000000000 --- a/packages/client/ui-compaction/locale/pt.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "meta": { - "title": "Prévia do resumo de compactação", - "description": "Consulte os resumos de compactação de conversas na barra lateral direita." - } -} diff --git a/packages/client/ui-compaction/locale/ru.json b/packages/client/ui-compaction/locale/ru.json deleted file mode 100644 index 98def28a83..0000000000 --- a/packages/client/ui-compaction/locale/ru.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "meta": { - "title": "Предпросмотр сводки сжатия", - "description": "Просматривайте сводки сжатых разговоров на правой боковой панели." - } -} diff --git a/packages/client/ui-compaction/locale/zh.json b/packages/client/ui-compaction/locale/zh.json deleted file mode 100644 index 95f14b5a2d..0000000000 --- a/packages/client/ui-compaction/locale/zh.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "meta": { - "title": "压缩摘要预览", - "description": "在右侧栏查看对话压缩摘要。" - } -} diff --git a/packages/client/ui-compaction/package.json b/packages/client/ui-compaction/package.json deleted file mode 100644 index dfec67c69b..0000000000 --- a/packages/client/ui-compaction/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@deepseek-ai/dsh-client-ui-compaction", - "description": "Right sidebar previews of recorded conversation compaction summaries", - "version": "0.2.2-rc.5", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/deepseek-ai/deepseek-harness.git", - "directory": "packages/client/ui-compaction" - }, - "type": "module", - "main": "lib/index.js", - "types": "lib/types/index.d.ts", - "exports": { - ".": { - "types": "./lib/types/index.d.ts", - "default": "./lib/index.js" - }, - "./client": { - "types": "./lib/types/client/index.d.ts", - "default": "./lib/client.js" - }, - "./src/*": "./src/*", - "./package.json": "./package.json", - "./locale/*.json": "./locale/*.json" - }, - "dsh": { - "client": { - "inject": [ - "@deepseek-ai/dsh-api-remotes", - "@deepseek-ai/dsh-api-session-controller", - "@deepseek-ai/dsh-client-locale", - "@deepseek-ai/dsh-client-ui-sidebar-documentpreview", - "@deepseek-ai/dsh-client-ui-sidebar-right" - ], - "platform": "web" - } - }, - "scripts": { - "bundle": "tsdown", - "watch": "tsdown --watch" - }, - "license": "MIT", - "peerDependencies": { - "@deepseek-ai/cordis": "workspace:~" - }, - "devDependencies": { - "@deepseek-ai/cordis": "workspace:~", - "@deepseek-ai/dsh-api-remotes": "workspace:*", - "@deepseek-ai/dsh-api-session-controller": "workspace:*", - "@deepseek-ai/dsh-client-locale": "workspace:*", - "@deepseek-ai/dsh-client-ui-sidebar-documentpreview": "workspace:*", - "@deepseek-ai/dsh-client-ui-sidebar-right": "workspace:*", - "@deepseek-ai/dsh-client-ui-slots": "workspace:*" - }, - "files": [ - "locale/*.json", - "lib/index.js", - "lib/client.js", - "lib/types/**/*.d.ts", - "lib/types/**/*.d.ts.map", - "lib/**/*.js.map", - "src" - ] -} diff --git a/packages/client/ui-compaction/src/client/index.ts b/packages/client/ui-compaction/src/client/index.ts deleted file mode 100644 index fe7cf6f44d..0000000000 --- a/packages/client/ui-compaction/src/client/index.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** Read a recorded summary into a temporary Markdown preview. */ -import type { Context } from '@deepseek-ai/cordis' -import type {} from '@deepseek-ai/dsh-api-remotes/client' -import type {} from '@deepseek-ai/dsh-api-session-controller/remote' -import type {} from '@deepseek-ai/dsh-client-locale/client' -import type {} from '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/client' -import type { SessionAddress } from '@deepseek-ai/dsh-api-session-controller/types' -import { en, ja, es, fr, de, ru, pt, zh } from './locales.ts' -import type {} from '@deepseek-ai/dsh-client-ui-sidebar-right/client' - -export type { CompactionKey } from './locales.ts' - -/** Summary preview navigation. */ -export interface CompactionPreviews { - /** - * Open the recorded summary unless the requesting row has been cancelled. - * @param address - complete history address. - * @param summarySeq - compaction/summary event sequence. - * @param signal - requesting row lifetime. - * @returns a localized failure for the row, or null after navigation or cancellation. - */ - open(address: SessionAddress, summarySeq: number, signal: AbortSignal): Promise -} - -declare module '@deepseek-ai/cordis' { - interface Context { - /** Available while document previews are loaded. */ - compactionPreviews: CompactionPreviews - } -} - -/** Services required to read summary text. */ -export const inject = ['locale', 'remote', 'remote.session', 'sidebarRight'] - -/** @param ctx - browser context with Session history and locale services. */ -export function apply(ctx: Context): void { - const t = ctx.locale.bind('compaction') - ctx.effect(() => ctx.locale.register('compaction', { zh, en, ja, es, fr, de, ru, pt }), 'ui-compaction: dictionaries') - ctx.inject(['documentPreviews'], (scope) => { - const lifetime = new AbortController() - scope.effect(() => () => { lifetime.abort() }, 'ui-compaction: navigation lifetime') - const service: CompactionPreviews = { - async open(address, summarySeq, signal) { - const active = AbortSignal.any([signal, lifetime.signal]) - const cancelled = (): boolean => active.aborted - if (cancelled()) return null - let result - try { - result = await scope.remote.session.events({ address, throughSeq: summarySeq, maxMessages: 1 }, active) - } catch (_error) { - // A cancelled row has no read failure to display. - return cancelled() ? null : t('preview.readFailed') - } - if (cancelled()) return null - if (!result.ok) return t('preview.readFailed') - const event = result.value.records.find(entry => entry.event.seq === summarySeq)?.event - const text = event && summaryText(event) - if (text === undefined) return t('preview.notFound') - const identity = address.kind === 'session' ? [address.sessionId] : [address.parentSessionId, address.childSessionId, address.mode] - const opened = scope.sidebarRight.openContent({ mediaType: 'text/markdown', text }, { - title: t('preview.title'), key: `compaction:${JSON.stringify([...identity, summarySeq])}`, - }) - return opened ? null : t('preview.notFound') - }, - } - const dispose = scope.reflect.provide('compactionPreviews', service) - scope.effect(() => dispose, 'ui-compaction: preview service') - }) -} - -/** Extract text only from a valid summary event returned by the history API. - * @param event - Wire event with untrusted JSON data. - * @returns Markdown, or undefined for unrelated, empty or malformed content. - */ -function summaryText(event: { readonly type: string; readonly data: unknown }): string | undefined { - if (event.type !== 'compaction/summary') return undefined - const data = event.data - if (typeof data !== 'object' || data === null || !('summary' in data) || !Array.isArray(data.summary)) return undefined - const text: string[] = [] - const blocks: readonly unknown[] = data.summary - for (const block of blocks) { - if (typeof block !== 'object' || block === null || !('type' in block)) return undefined - if (block.type !== 'text') continue - if (!('text' in block) || typeof block.text !== 'string') return undefined - text.push(block.text) - } - const markdown = text.join('') - return markdown.trim() === '' ? undefined : markdown -} diff --git a/packages/client/ui-compaction/src/client/locales.ts b/packages/client/ui-compaction/src/client/locales.ts deleted file mode 100644 index 15d3f2f662..0000000000 --- a/packages/client/ui-compaction/src/client/locales.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** `compaction` namespace dictionaries: the summary title and read failures. */ - -/** Simplified Chinese dictionary and key-set source of truth. */ -export const zh = { - 'preview.title': '上下文摘要', - 'preview.notFound': '摘要不可用:预览服务不可用,或摘要记录缺失、为空或无效。', - 'preview.readFailed': '无法读取摘要', -} satisfies Record - -/** Compaction preview dictionary key union. */ -export type CompactionKey = keyof typeof zh - -/** English dictionary, checked against the Chinese key set. */ -export const en = { - 'preview.title': 'Context summary', - 'preview.notFound': 'Summary unavailable: the preview service is unavailable, or the summary record is missing, empty or invalid.', - 'preview.readFailed': 'Unable to read the summary', -} satisfies Record - -/** Japanese dictionary. */ -export const ja = { - 'preview.title': 'コンテキストの要約', - 'preview.notFound': '要約を利用できません。プレビューサービスが利用できないか、要約が存在しない、空、または無効です。', - 'preview.readFailed': '要約を読み込めません', -} satisfies Record - -/** Spanish dictionary. */ -export const es = { - 'preview.title': 'Resumen del contexto', - 'preview.notFound': 'Resumen no disponible: el servicio no está disponible o el registro falta, está vacío o no es válido.', - 'preview.readFailed': 'No se pudo leer el resumen', -} satisfies Record - -/** French dictionary. */ -export const fr = { - 'preview.title': 'Résumé du contexte', - 'preview.notFound': 'Résumé indisponible : le service est indisponible ou le résumé est absent, vide ou invalide.', - 'preview.readFailed': 'Impossible de lire le résumé', -} satisfies Record - -/** German dictionary. */ -export const de = { - 'preview.title': 'Kontextzusammenfassung', - 'preview.notFound': 'Zusammenfassung nicht verfügbar: Der Dienst ist nicht verfügbar oder der Eintrag fehlt, ist leer oder ungültig.', - 'preview.readFailed': 'Zusammenfassung konnte nicht gelesen werden', -} satisfies Record - -/** Russian dictionary. */ -export const ru = { - 'preview.title': 'Сводка контекста', - 'preview.notFound': 'Сводка недоступна: сервис недоступен либо запись отсутствует, пуста или недействительна.', - 'preview.readFailed': 'Не удалось прочитать сводку', -} satisfies Record - -/** Portuguese dictionary. */ -export const pt = { - 'preview.title': 'Resumo do contexto', - 'preview.notFound': 'Resumo indisponível: o serviço está indisponível ou o registro está ausente, vazio ou inválido.', - 'preview.readFailed': 'Não foi possível ler o resumo', -} satisfies Record - -declare module '@deepseek-ai/dsh-client-ui-slots' { - interface LocaleNamespaceMap { - /** The compaction summary title and read failures. */ - compaction: CompactionKey - } -} diff --git a/packages/client/ui-compaction/src/index.ts b/packages/client/ui-compaction/src/index.ts deleted file mode 100644 index 1f61e9d192..0000000000 --- a/packages/client/ui-compaction/src/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Compaction summary preview plugin, node half. Pure UI plugin: the empty - * apply exists so the plugin appears in the host cordis.yml / Loader; the - * browser half ships via exports["./client"], discovered through the - * package.json dsh.client declaration. - */ - -/** Host plugin body — no host-side behavior for this surface plugin. */ -export function apply(): void {} diff --git a/packages/client/ui-compaction/tests/apply.client.spec.ts b/packages/client/ui-compaction/tests/apply.client.spec.ts deleted file mode 100644 index 966cff1f25..0000000000 --- a/packages/client/ui-compaction/tests/apply.client.spec.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { Context } from '@deepseek-ai/cordis' -import { brandString } from '@deepseek-ai/dsh-brand' -import type { SessionEventEntry } from '@deepseek-ai/dsh-api-session-controller/types' -import type { SessionId } from '@deepseek-ai/dsh-session/types' -import { RemoteError } from '@deepseek-ai/dsh-typert-protocol' -import { expect, it, onTestFinished, vi } from 'vitest' -import { apply, inject } from '../src/client/index.ts' -import { apply as hostApply } from '../src/index.ts' - -const sessionId = brandString('session/1') -const address = { kind: 'session' as const, sessionId } -const signal = new AbortController().signal -function history(data: SessionEventEntry['event']['data'], type = 'compaction/summary', seq = 7) { - const records: SessionEventEntry[] = [{ type: 'event', event: { type, seq, time: 100, data } }] - return { ok: true as const, value: { cursor: seq, records, hasMore: true } } -} - -async function boot() { - const ctx = new Context() - const events = vi.fn(async () => history({ - summary: [{ type: 'text', text: '# A' }, { type: 'image' }, { type: 'text', text: ' summary' }], - })) - const openContent = vi.fn(() => true) - ctx.provide('locale', { bind: () => (key: string) => key, register: () => () => {} } as never) - ctx.provide('remote', { session: { events } } as never) - ctx.provide('remote.session', { events } as never) - ctx.provide('sidebarRight', { openContent } as never) - const fiber = ctx.plugin({ inject: [...inject], apply }) - onTestFinished(async () => { await fiber.dispose() }) - await fiber.await() - expect(ctx.get('compactionPreviews')).toBeUndefined() - const withdraw = ctx.provide('documentPreviews', {} as never) - await vi.waitFor(() => { expect(ctx.get('compactionPreviews')).toBeDefined() }) - return { ctx, preview: ctx.compactionPreviews, events, openContent, withdraw } -} - -it('opens the exact event with a repeatable key scoped to its Session', async () => { - const { preview, events, openContent } = await boot() - const child = { kind: 'subagent' as const, parentSessionId: sessionId, childSessionId: sessionId, mode: 'continuable' as const } - for (const target of [address, address, child]) { - expect(await preview.open(target, 7, signal)).toBeNull() - expect(events).toHaveBeenLastCalledWith({ address: target, throughSeq: 7, maxMessages: 1 }, expect.any(AbortSignal)) - expect(openContent).toHaveBeenLastCalledWith({ mediaType: 'text/markdown', text: '# A summary' }, - expect.objectContaining({ title: 'preview.title' })) - } - const keys = openContent.mock.calls.map(([, options]) => options.key) - expect(keys[0]).toEqual(expect.any(String)) - expect(keys[0]).toBe(keys[1]) - expect(keys[1]).not.toBe(keys[2]) -}) - -it('reports missing or malformed history and failed reads on the requesting row', async () => { - const { preview, events, openContent } = await boot() - for (const result of [history({}, 'other'), history({}, undefined, 8), history(null), history({}), - history({ summary: [null] }), history({ summary: [{}] }), history({ summary: [{ type: 'text', text: 5 }] }), - history({ summary: [{ type: 'text', text: ' ' }] })]) { - events.mockResolvedValueOnce(result) - expect(await preview.open(address, 7, signal)).toBe('preview.notFound') - } - events.mockResolvedValueOnce({ ok: false, error: new RemoteError('gateway/internal', 'offline', {}) }) - expect(await preview.open(address, 7, signal)).toBe('preview.readFailed') - events.mockRejectedValueOnce(new Error('offline')) - expect(await preview.open(address, 7, signal)).toBe('preview.readFailed') - expect(openContent).not.toHaveBeenCalled() - openContent.mockReturnValueOnce(false) - expect(await preview.open(address, 7, signal)).toBe('preview.notFound') -}) - -it('suppresses navigation and read errors after row cancellation or plugin disposal', async () => { - const { preview, events, openContent, ctx, withdraw } = await boot() - expect(await preview.open(address, 7, AbortSignal.abort())).toBeNull() - expect(events).not.toHaveBeenCalled() - const row = new AbortController() - events.mockImplementationOnce(async () => { row.abort(); throw new Error('cancelled') }) - expect(await preview.open(address, 7, row.signal)).toBeNull() - events.mockImplementationOnce(async () => { - withdraw() - await vi.waitFor(() => { expect(ctx.get('compactionPreviews')).toBeUndefined() }) - return history({}) - }) - expect(await preview.open(address, 7, signal)).toBeNull() - expect(openContent).not.toHaveBeenCalled() -}) - -it('loads the host entry without browser services', () => { expect(() => { hostApply() }).not.toThrow() }) diff --git a/packages/client/ui-compaction/tsconfig.json b/packages/client/ui-compaction/tsconfig.json deleted file mode 100644 index 32ec90dd8f..0000000000 --- a/packages/client/ui-compaction/tsconfig.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "extends": "../../../tsconfig.base.client.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "lib/types" - }, - "include": [ - "src" - ], - "references": [ - { - "path": "../../../vendor/cordis" - }, - { - "path": "../../api/remotes/tsconfig.client.json" - }, - { - "path": "../../api/session-controller/tsconfig.client.json" - }, - { - "path": "../locale/tsconfig.client.json" - }, - { - "path": "../ui-sidebar-documentpreview/tsconfig.client.json" - }, - { - "path": "../ui-slots" - }, - { - "path": "../ui-sidebar-right" - } - ] -} diff --git a/packages/client/ui-compaction/tsdown.config.ts b/packages/client/ui-compaction/tsdown.config.ts deleted file mode 100644 index 7aa03cebc1..0000000000 --- a/packages/client/ui-compaction/tsdown.config.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { clientBundle } from '../tsdown.client.ts' - -export default clientBundle(import.meta.dirname, ['lib/types/index.js']) diff --git a/packages/preset/agent-preset/skills/dsh-doc/references/packages.md b/packages/preset/agent-preset/skills/dsh-doc/references/packages.md index 5b3a4ef8e1..427c595116 100644 --- a/packages/preset/agent-preset/skills/dsh-doc/references/packages.md +++ b/packages/preset/agent-preset/skills/dsh-doc/references/packages.md @@ -84,7 +84,6 @@ Every package below exports a Cordis plugin that a bundle patch can name in a Lo | `@deepseek-ai/dsh-client-ui-brand-official` | no | Official DeepSeek Harness brand artwork and click-triggered home background | | `@deepseek-ai/dsh-client-ui-chat` | no | Chat Conversation target, node definitions, renderers, and details surface | | `@deepseek-ai/dsh-client-ui-commands` | no | Client command surface: global directory cache, '/' source, three command UI kinds, popupSelect registry | -| `@deepseek-ai/dsh-client-ui-compaction` | no | Right sidebar previews of recorded conversation compaction summaries | | `@deepseek-ai/dsh-client-ui-connector-account` | no | Connector account surfaces: the Host registry CLI app plugins and MCP connectors register their accounts with, and the Plugins page section, title tag, activation prompt, and notices it serves over one Remote | | `@deepseek-ai/dsh-client-ui-context-menu` | yes | Typed, plugin-extensible context menus with captured targets and shared Web presentation | | `@deepseek-ai/dsh-client-ui-conversation` | no | Target-neutral Conversation assembly, shell, composer, queue, and view navigation | diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 234155c7e9..329536f31c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3200,9 +3200,6 @@ importers: '@deepseek-ai/dsh-client-ui-commands': specifier: workspace:* version: link:../../client/ui-commands - '@deepseek-ai/dsh-client-ui-compaction': - specifier: workspace:* - version: link:../../client/ui-compaction '@deepseek-ai/dsh-client-ui-connector-account': specifier: workspace:* version: link:../../client/ui-connector-account @@ -4331,9 +4328,6 @@ importers: '@deepseek-ai/dsh-client-ui-approval': specifier: workspace:* version: link:../ui-approval - '@deepseek-ai/dsh-client-ui-compaction': - specifier: workspace:* - version: link:../ui-compaction '@deepseek-ai/dsh-client-ui-context-menu': specifier: workspace:* version: link:../ui-context-menu @@ -4491,30 +4485,6 @@ importers: specifier: ^18.2.0 version: 18.3.1 - packages/client/ui-compaction: - devDependencies: - '@deepseek-ai/cordis': - specifier: workspace:~ - version: link:../../../vendor/cordis - '@deepseek-ai/dsh-api-remotes': - specifier: workspace:* - version: link:../../api/remotes - '@deepseek-ai/dsh-api-session-controller': - specifier: workspace:* - version: link:../../api/session-controller - '@deepseek-ai/dsh-client-locale': - specifier: workspace:* - version: link:../locale - '@deepseek-ai/dsh-client-ui-sidebar-documentpreview': - specifier: workspace:* - version: link:../ui-sidebar-documentpreview - '@deepseek-ai/dsh-client-ui-sidebar-right': - specifier: workspace:* - version: link:../ui-sidebar-right - '@deepseek-ai/dsh-client-ui-slots': - specifier: workspace:* - version: link:../ui-slots - packages/client/ui-connector-account: dependencies: '@deepseek-ai/dsh-typert-protocol': diff --git a/scripts/gen-cordis-catalog.ts b/scripts/gen-cordis-catalog.ts index 9d21cb07b9..759380effe 100644 --- a/scripts/gen-cordis-catalog.ts +++ b/scripts/gen-cordis-catalog.ts @@ -238,7 +238,6 @@ export const SERVICE_WALK_EXEMPTIONS: Record = { sidebarRightTabs: 'client-side right-Sidebar tab-type registry — packages/client/ui-sidebar-right/README.md owns the API', forgeChanges: 'client-side changes view face for other plugins — docs/subsystems/forge.md#extension-api owns the API', documentPreviews: 'client-side document renderer registry — docs/subsystems/sidebar-right.md owns the API', - compactionPreviews: 'client-side checkpoint preview navigation — packages/client/ui-compaction/README.md owns the API', } /** diff --git a/scripts/verify-package-readme-model-experience.ts b/scripts/verify-package-readme-model-experience.ts index c33bdc04a9..6b51c8b62e 100644 --- a/scripts/verify-package-readme-model-experience.ts +++ b/scripts/verify-package-readme-model-experience.ts @@ -186,7 +186,6 @@ const SENTENCE_MODEL_EXPERIENCE: Readonly> = { 'packages/client/ui-directory-picker-native': { kind: 'none', reason: 'Browser-side surface driving the local Desktop or Host OS chooser; registers nothing model-facing.' }, 'packages/client/ui-theme': { kind: 'none', reason: 'Browser-side UI plugin layer; registers nothing model-facing.' }, 'packages/client/ui-sidebar-documentpreview': { kind: 'none', reason: 'Browser-only viewer for workspace files and in-memory content; registers no tool, prompt section, or session event, and what the user reads never enters a model request.' }, - 'packages/client/ui-compaction': { kind: 'none', reason: 'Browser-only viewer of a compaction checkpoint the model has already read; registers no tool, prompt section, or session event.' }, 'packages/client/ui-sidebar-browser': { kind: 'none', reason: 'Browser-only navigation surface; visited content never enters a model request.' }, 'packages/client/ui-sidebar-files': { kind: 'none', reason: 'Browser-only workspace file tree; registers no tool, prompt section, or session event.' }, 'packages/client/resources': { kind: 'none', reason: 'Browser-side resource model (providers, pinning, useResource); registers nothing model-facing.' }, diff --git a/tsconfig.base.json b/tsconfig.base.json index 7d05893997..be9f29d354 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -291,8 +291,6 @@ "@deepseek-ai/dsh-client-ui-sidebar-right/client": ["./packages/client/ui-sidebar-right/src/client"], "@deepseek-ai/dsh-client-ui-sidebar-documentpreview": ["./packages/client/ui-sidebar-documentpreview/src"], "@deepseek-ai/dsh-client-ui-sidebar-documentpreview/client": ["./packages/client/ui-sidebar-documentpreview/src/client"], - "@deepseek-ai/dsh-client-ui-compaction": ["./packages/client/ui-compaction/src"], - "@deepseek-ai/dsh-client-ui-compaction/client": ["./packages/client/ui-compaction/src/client"], "@deepseek-ai/dsh-client-ui-sidebar-browser": ["./packages/client/ui-sidebar-browser/src"], "@deepseek-ai/dsh-client-ui-sidebar-browser/client": ["./packages/client/ui-sidebar-browser/src/client"], "@deepseek-ai/dsh-client-ui-sidebar-browser/types": ["./packages/client/ui-sidebar-browser/src/types.ts"], diff --git a/tsconfig.client.json b/tsconfig.client.json index 6adf86d170..458ed45a87 100644 --- a/tsconfig.client.json +++ b/tsconfig.client.json @@ -137,7 +137,6 @@ { "path": "./packages/client/ui-sidebar-right" }, { "path": "./packages/client/ui-entry-customization" }, { "path": "./packages/client/ui-sidebar-documentpreview/tsconfig.client.json" }, - { "path": "./packages/client/ui-compaction" }, { "path": "./packages/client/ui-sidebar-browser/tsconfig.client.json" }, { "path": "./packages/client/ui-sidebar-files" }, { "path": "./packages/client/ui-jobs" },