refactor(ui-cli-account): ship the page pieces as a Web shell platform module

Client feature packages may not request another row's runtime values through dsh.client.external, so the shared pieces become a static library the shell seeds into its module table, like ui-dockkit. Plugins import the package root, the web-app row is gone, and the badge takes a structural subject instead of importing the Plugins page types.
This commit is contained in:
gengruilin committed 2026-10-14 23:08:46 +08:00
1 parent a70c4d5d0b
commit b25f3de03c
27 files changed
+90 -135

No files matched your search

+1
View File
@@ -38,6 +38,7 @@
"@deepseek-ai/dsh-client-test-runtime": "workspace:*",
"@deepseek-ai/dsh-client-ui-deliverables": "workspace:*",
"@deepseek-ai/dsh-client-ui-dockkit": "workspace:*",
"@deepseek-ai/dsh-client-ui-cli-account": "workspace:*",
"@deepseek-ai/dsh-client-ui-primitives": "workspace:*",
"@deepseek-ai/dsh-client-ui-slots": "workspace:*",
"@deepseek-ai/dsh-client-web": "workspace:*",
+1 -1
View File
@@ -4829,7 +4829,6 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
| `@deepseek-ai/dsh-client-ui-attachment` | — | [`packages/client/ui-attachment/src/index.ts`](../packages/client/ui-attachment/src/index.ts) |
| `@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-cli-account` | — | [`packages/client/ui-cli-account/src/index.ts`](../packages/client/ui-cli-account/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-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) |
@@ -4976,6 +4975,7 @@ Imported as libraries by other packages; a `cordis.yml` cannot load them.
| `@deepseek-ai/dsh-cli-account` | — | [`packages/connector/cli-account/src/index.ts`](../packages/connector/cli-account/src/index.ts) |
| `@deepseek-ai/dsh-client-store` | — | [`packages/client/store/src/index.ts`](../packages/client/store/src/index.ts) |
| `@deepseek-ai/dsh-client-test-runtime` | — | [`packages/test-support/client-runtime/src/index.ts`](../packages/test-support/client-runtime/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-cli-account` | — | [`packages/client/ui-cli-account/src/index.ts`](../packages/client/ui-cli-account/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-dockkit` | — | [`packages/client/ui-dockkit/src/index.ts`](../packages/client/ui-dockkit/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-primitives` | — | [`packages/client/ui-primitives/src/index.ts`](../packages/client/ui-primitives/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-slots` | — | [`packages/client/ui-slots/src/index.ts`](../packages/client/ui-slots/src/index.ts) |
+1 -1
View File
@@ -4831,7 +4831,6 @@ export interface Config {
| `@deepseek-ai/dsh-client-ui-attachment` | — | [`packages/client/ui-attachment/src/index.ts`](../packages/client/ui-attachment/src/index.ts) |
| `@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-cli-account` | — | [`packages/client/ui-cli-account/src/index.ts`](../packages/client/ui-cli-account/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-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) |
@@ -4978,6 +4977,7 @@ export interface Config {
| `@deepseek-ai/dsh-cli-account` | — | [`packages/connector/cli-account/src/index.ts`](../packages/connector/cli-account/src/index.ts) |
| `@deepseek-ai/dsh-client-store` | — | [`packages/client/store/src/index.ts`](../packages/client/store/src/index.ts) |
| `@deepseek-ai/dsh-client-test-runtime` | — | [`packages/test-support/client-runtime/src/index.ts`](../packages/test-support/client-runtime/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-cli-account` | — | [`packages/client/ui-cli-account/src/index.ts`](../packages/client/ui-cli-account/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-dockkit` | — | [`packages/client/ui-dockkit/src/index.ts`](../packages/client/ui-dockkit/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-primitives` | — | [`packages/client/ui-primitives/src/index.ts`](../packages/client/ui-primitives/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-slots` | — | [`packages/client/ui-slots/src/index.ts`](../packages/client/ui-slots/src/index.ts) |
-5
View File
@@ -261,11 +261,6 @@
- id: ui-renderer
name: '@deepseek-ai/dsh-client-ui-renderer'
# Shared module that CLI app plugins request for their Plugins page account
# section, tag, activation prompt, and notices.
- id: ui-cli-account
name: '@deepseek-ai/dsh-client-ui-cli-account'
- id: ui-session
name: '@deepseek-ai/dsh-client-ui-session'
-1
View File
@@ -96,7 +96,6 @@
"@deepseek-ai/dsh-client-ui-permission-presets": "workspace:*",
"@deepseek-ai/dsh-client-ui-plan": "workspace:*",
"@deepseek-ai/dsh-client-ui-plugin-manager": "workspace:*",
"@deepseek-ai/dsh-client-ui-cli-account": "workspace:*",
"@deepseek-ai/dsh-client-ui-reference": "workspace:*",
"@deepseek-ai/dsh-client-ui-renderer": "workspace:*",
"@deepseek-ai/dsh-client-ui-secret-mask": "workspace:*",
+15 -15
View File
@@ -3,26 +3,26 @@
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/client/ui-cli-account/README.md
/:
en: b5df3dc6b6e5a8af
zh: 472be0060affe504
en: e49d68d248f36cad
zh: 3ec31254dd83e58b
/deepseek-ai-dsh-client-ui-cli-account:
en: 9459a591a9b82dd8
zh: cb4059b1ef791c5c
/deepseek-ai-dsh-client-ui-cli-account/summary:
en: d6ef9f6b6b5df3ec
zh: bc214cb8c443cafd
en: 543480ffecd1db84
zh: c6c564bd3830b1e8
/deepseek-ai-dsh-client-ui-cli-account/table-of-contents:
en: d152484eb41ac6b4
zh: 5b6bd00fce5371c3
/deepseek-ai-dsh-client-ui-cli-account/use-this-package:
en: 55c776d264ae8018
zh: 938fc1c98a178efe
en: 833ecd065f2d155a
zh: 347c28933ce652b6
/deepseek-ai-dsh-client-ui-cli-account/use-this-package/when-to-choose-it:
en: c63cdee18f15d294
zh: ce6105e42a08add5
/deepseek-ai-dsh-client-ui-cli-account/use-this-package/minimal-configuration:
en: 004e4de5db042003
zh: bc56e02a4bba37de
/deepseek-ai-dsh-client-ui-cli-account/use-this-package/import-it:
en: 11de80ae029060b6
zh: 1a015a9f08a6c077
/deepseek-ai-dsh-client-ui-cli-account/use-this-package/connection-mirror:
en: f622ce4b54e43f86
zh: a88aa2045cb67736
@@ -33,11 +33,11 @@
en: 0faf95b3a48c33c5
zh: 3d542ca37252456e
/deepseek-ai-dsh-client-ui-cli-account/understand-the-implementation:
en: f256b57573162ed0
zh: 438cea1d1f15a02f
en: 49b07dcf9d1d9810
zh: d6100e7aba70a06c
/deepseek-ai-dsh-client-ui-cli-account/further-exploration:
en: c4b972c30c3991ab
zh: 4046eceff24fe493
en: 3a734faf91117774
zh: ec057434b2d19223
/deepseek-ai-dsh-client-ui-cli-account/model-experience:
en: 525d8f762d62abcd
zh: dfdbba035632096a
@@ -45,8 +45,8 @@
en: ca75c51c89c2c9b0
zh: 6e1c9a8fdde89577
/deepseek-ai-dsh-client-ui-cli-account/known-limitations-and-deferred-work:
en: 905a3455c610e12b
zh: 6e9127ba17b09885
en: 3ef957892d693131
zh: 81e65fee74a7ef0b
/deepseek-ai-dsh-client-ui-cli-account/known-limitations-and-deferred-work/dev-note:
en: e67f633dc6fe7773
zh: e88aeb617ffb74ea
+12 -24
View File
@@ -1,6 +1,6 @@
---
description: "Give a CLI app plugin's Plugins page its account section, title tag, activation prompt, confirmations, and notices, mirrored from the plugin's Host account Remote with copy the plugin translates."
kind: "package-reference"
kind: "package-library"
---
# @deepseek-ai/dsh-client-ui-cli-account
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
## Summary
CLI app plugins such as Feishu and WeCom build their Plugins page from these shared pieces. `CliAccountConnection` follows the plugin's account stream, opens an authorization link once in the browser that started the operation, and reports outcomes. The section, tag, activation prompt, confirmation, and notice components render one of six display phases with copy the plugin translates. The web app mounts this row once, and plugins import it from the module table. Each plugin keeps its own presentation and dictionary.
CLI app plugins such as Feishu and WeCom build their Plugins page from these shared pieces. `CliAccountConnection` follows the plugin's account stream, opens an authorization link once in the browser that started the operation, and reports outcomes. The section, tag, activation prompt, confirmation, and notice components render one of six display phases with copy the plugin translates. The Web shell links this library statically and shares one copy through its module table, so plugins import it like `ui-primitives`. Each plugin keeps its own presentation and dictionary.
## Table of Contents
@@ -25,28 +25,15 @@ CLI app plugins such as Feishu and WeCom build their Plugins page from these sha
<a id="use-this-package"></a>
## Use this package
A plugin page requests this module, creates one connection over its Remote, maps the Host view to a display phase, and renders the shared components.
A plugin page imports this library, creates one connection over its Remote, maps the Host view to a display phase, and renders the shared components.
### When to choose it
Choose it for the page half of a plugin built on [`@deepseek-ai/dsh-cli-account`](../../connector/cli-account/README.md), whose Remote streams a `CliAccountView`. A plugin that connects a hosted service over MCP uses the MCP account surfaces instead.
### Minimal configuration
### Import it
The web app bundle mounts the row once; plugins never add it:
```yaml
- id: ui-cli-account
name: '@deepseek-ai/dsh-client-ui-cli-account'
```
A plugin page requests the module in its `package.json` and imports it from `@deepseek-ai/dsh-client-ui-cli-account/client`; the client bundle purity gate rejects a plugin bundle that inlines it instead:
```json
{ "dsh": { "client": { "platform": "web", "external": ["@deepseek-ai/dsh-client-ui-cli-account/client"] } } }
```
The row has no configuration fields.
A plugin page imports `@deepseek-ai/dsh-client-ui-cli-account` and lists it in its `devDependencies`. The package is one of the Web shell's `PLATFORM_MODULES`, so a plugin bundle resolves the import against the shell's copy without `dsh.client.external`, and the client bundle purity gate rejects a bundle that inlines it instead. This package is a Web-shell build input: its static ESM keeps its CSS module for Vite, and it has no Loader row or configuration fields.
### Connection mirror
@@ -74,13 +61,13 @@ The components read these keys through the plugin's translator, so every plugin
<details>
<summary>Implementation internals — click to expand</summary>
The row's client entry exports the mirror and the components; its `apply` does nothing, and its Host entry is an empty marker. Plugins request the client entry as a module-table row, so every plugin page shares one copy instead of inlining its own. The components receive translated text and display phases only; deriving the phase from a plugin's account states stays in the plugin.
[`src/index.ts`](src/index.ts) exports the mirror and the components and has no plugin entry. The Web shell seeds the package into its module table, so every plugin page shares one copy instead of inlining its own. The components receive translated text and display phases only; deriving the phase from a plugin's account states stays in the plugin.
| File | Role |
|---|---|
| [`src/client/connection.ts`](src/client/connection.ts) | The Host view mirror, link opening, notices, and pending-action guard |
| [`src/client/components.tsx`](src/client/components.tsx) | The shared components, display phases, and dictionary keys |
| [`src/client/index.ts`](src/client/index.ts) | The client entry the module table serves |
| [`src/connection.ts`](src/connection.ts) | The Host view mirror, link opening, notices, and pending-action guard |
| [`src/components.tsx`](src/components.tsx) | The shared components, display phases, and dictionary keys |
| [`src/index.ts`](src/index.ts) | The library entry the shell's module table serves |
</details>
@@ -90,7 +77,7 @@ The row's client entry exports the mirror and the components; its `apply` does n
## Further Exploration
- [CLI account library](../../connector/cli-account/README.md) — the Host half that streams the view.
- [Client modules](../../../docs/subsystems/client-modules.md) — module-table rows and `dsh.client.external` requests.
- [Web shell](../web/README.md) — `PLATFORM_MODULES`, the shared module table that supplies this library.
- [Plugin manager page](../ui-plugin-manager/README.md) — the Plugins page and its bundle slots.
-----
@@ -110,7 +97,8 @@ None; this package neither assembles nor sends a provider request.
- The six display phases are fixed; a plugin maps any further account state onto one of them.
- The shared dictionary keys are the same for every plugin; a plugin cannot rename them.
- The row registers no slots; each plugin registers its own section, tag, activation, and notice entries.
- The library registers no slots; each plugin registers its own section, tag, activation, and notice entries.
- The Web shell carries the library whether or not a CLI app plugin is installed.
<a id="dev-note"></a>
### Dev Note
+12 -24
View File
@@ -1,6 +1,6 @@
---
description: "为 CLI 应用插件的插件页提供账号区块、标题旁标签、开启引导、确认和提示,内容镜像自插件的 Host 账号 Remote,文案由插件翻译。"
kind: "package-reference"
kind: "package-library"
---
# @deepseek-ai/dsh-client-ui-cli-account
@@ -9,7 +9,7 @@ kind: "package-reference"
## 概述
飞书、企业微信等 CLI 应用插件用这些共用组件搭建自己的插件页。`CliAccountConnection` 跟随插件的账号流,在发起操作的浏览器中把授权链接打开一次,并报告结果。区块、标签、开启引导、确认和提示组件按插件翻译的文案,渲染六种显示阶段之一。Web 应用只挂载这一行一次,插件从模块表中导入它。每个插件保留各自的展示推导和字典。
飞书、企业微信等 CLI 应用插件用这些共用组件搭建自己的插件页。`CliAccountConnection` 跟随插件的账号流,在发起操作的浏览器中把授权链接打开一次,并报告结果。区块、标签、开启引导、确认和提示组件按插件翻译的文案,渲染六种显示阶段之一。Web 外壳静态链接这个库,并通过模块表共享同一份,插件像使用 `ui-primitives` 一样导入它。每个插件保留各自的展示推导和字典。
## 目录
@@ -25,28 +25,15 @@ kind: "package-reference"
<a id="use-this-package"></a>
## 使用此包
插件页请求这个模块,基于自己的 Remote 创建一个连接,把 Host 视图映射为显示阶段,再渲染共用组件。
插件页导入这个库,基于自己的 Remote 创建一个连接,把 Host 视图映射为显示阶段,再渲染共用组件。
### 何时选择
用于基于 [`@deepseek-ai/dsh-cli-account`](../../connector/cli-account/README.zh.md) 的插件的页面一半,其 Remote 流式推送 `CliAccountView`。通过 MCP 接入托管服务的插件改用 MCP 账号界面。
### 最小配置
### 导入
Web 应用 bundle 只挂载这一行一次,插件不需要添加:
```yaml
- id: ui-cli-account
name: '@deepseek-ai/dsh-client-ui-cli-account'
```
插件页在 `package.json` 中请求这个模块,并从 `@deepseek-ai/dsh-client-ui-cli-account/client` 导入;如果插件 bundle 把它内联进来,客户端 bundle 纯净性检查会拒绝:
```json
{ "dsh": { "client": { "platform": "web", "external": ["@deepseek-ai/dsh-client-ui-cli-account/client"] } } }
```
这一行没有配置字段。
插件页导入 `@deepseek-ai/dsh-client-ui-cli-account`,并把它列入 `devDependencies`。本包是 Web 外壳的 `PLATFORM_MODULES` 之一,因此插件 bundle 无需 `dsh.client.external` 就会把导入解析到外壳的那一份;如果插件 bundle 把它内联进来,客户端 bundle 纯净性检查会拒绝。本包是 Web 外壳的构建输入:其静态 ESM 为 Vite 保留 CSS module,没有 Loader 行,也没有配置字段。
### 连接镜像
@@ -74,13 +61,13 @@ Web 应用 bundle 只挂载这一行一次,插件不需要添加:
<details>
<summary>实现内部细节——点击展开</summary>
这一行的客户端入口导出连接镜像和组件,其 `apply` 什么也不做,Host 入口是一个空标记。插件把客户端入口当作模块表中的一行来请求,因此每个插件页共用同一份代码,而不是各自内联一份。组件只接收翻译好的文案和显示阶段;从插件的账号状态推导显示阶段,仍由插件负责。
[`src/index.ts`](src/index.ts) 导出连接镜像和组件,没有插件入口。Web 外壳把本包放进模块表,因此每个插件页共用同一份代码,而不是各自内联一份。组件只接收翻译好的文案和显示阶段;从插件的账号状态推导显示阶段,仍由插件负责。
| 文件 | 职责 |
|---|---|
| [`src/client/connection.ts`](src/client/connection.ts) | Host 视图镜像、链接打开、提示与未完成操作保护 |
| [`src/client/components.tsx`](src/client/components.tsx) | 共用组件、显示阶段与字典键 |
| [`src/client/index.ts`](src/client/index.ts) | 模块表提供的客户端入口 |
| [`src/connection.ts`](src/connection.ts) | Host 视图镜像、链接打开、提示与未完成操作保护 |
| [`src/components.tsx`](src/components.tsx) | 共用组件、显示阶段与字典键 |
| [`src/index.ts`](src/index.ts) | 外壳模块表提供的库入口 |
</details>
@@ -90,7 +77,7 @@ Web 应用 bundle 只挂载这一行一次,插件不需要添加:
## 延伸阅读
- [CLI 账号库](../../connector/cli-account/README.zh.md)——推送视图的 Host 一半。
- [客户端模块](../../../docs/subsystems/client-modules.zh.md)——模块表中的行与 `dsh.client.external` 请求。
- [Web 外壳](../web/README.zh.md)——`PLATFORM_MODULES`,提供本库的共享模块表。
- [插件管理页面](../ui-plugin-manager/README.zh.md)——插件页及其插件包插槽。
-----
@@ -110,7 +97,8 @@ Web 应用 bundle 只挂载这一行一次,插件不需要添加:
- 六种显示阶段是固定的;插件要把其他账号状态映射到其中之一。
- 共用字典键对所有插件都相同;插件不能改名。
- 这一行不注册插槽;每个插件注册自己的区块、标签、开启引导和提示条目。
- 本库不注册插槽;每个插件注册自己的区块、标签、开启引导和提示条目。
- 无论是否安装了 CLI 应用插件,Web 外壳都带着本库。
<a id="dev-note"></a>
### 开发备注
+2 -16
View File
@@ -1,6 +1,6 @@
{
"name": "@deepseek-ai/dsh-client-ui-cli-account",
"description": "Shared Plugins page pieces of CLI app plugins: the account connection mirror and the section, tag, activation, confirmation, and notice components",
"description": "Shared Plugins page pieces for CLI app plugins: the account connection mirror and components, linked into the Web shell",
"version": "0.2.1-alpha.2",
"publishConfig": {
"access": "public"
@@ -18,22 +18,9 @@
"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"
},
"dsh": {
"client": {
"platform": "web"
}
},
"scripts": {
"bundle": "tsdown",
"watch": "tsdown --watch"
},
"license": "MIT",
"peerDependencies": {
"@deepseek-ai/cordis": "workspace:~"
@@ -45,7 +32,6 @@
"@deepseek-ai/dsh-cli-account": "workspace:*",
"@deepseek-ai/dsh-client-store": "workspace:*",
"@deepseek-ai/dsh-client-test-runtime": "workspace:*",
"@deepseek-ai/dsh-client-ui-plugin-manager": "workspace:*",
"@deepseek-ai/dsh-client-ui-primitives": "workspace:*",
"@deepseek-ai/dsh-client-ui-slots": "workspace:*",
"@deepseek-ai/dsh-typert-protocol": "workspace:*",
@@ -55,7 +41,7 @@
},
"files": [
"lib/index.js",
"lib/client.js",
"lib/**/*.css",
"lib/types/**/*.d.ts"
]
}
@@ -1,13 +0,0 @@
/**
* Shared Plugins page pieces of CLI app plugins, browser half. The web app mounts this row once; plugins request it
* through `dsh.client.external` and import its connection mirror and components from the module table.
*/
export {
CliAccountActivation, CliAccountBadge, CliAccountConfirm, CliAccountSection, CliAccountToast,
type CliAccountAction, type CliAccountActivationProps, type CliAccountBadgeProps, type CliAccountConfirmProps, type CliAccountFailure,
type CliAccountKey, type CliAccountNote, type CliAccountPhase, type CliAccountSectionProps, type CliAccountToastProps,
} from './components.tsx'
export { CliAccountConnection, type CliAccountConnectionOptions, type CliAccountNotice, type CliAccountSnapshot } from './connection.ts'
/** The row has no browser behavior of its own; plugins use its exports. */
export function apply(): void {}
@@ -1,8 +1,7 @@
/** Plugins page components shared by CLI plugins: they render a plugin's display phase with the copy the plugin translates. */
import { useEffect, type ReactNode } from 'react'
import { Button, IconWarningOutlineRegular, Modal, StateDot, Tag, Toast, type StateDotState, type TagTone } from '@deepseek-ai/dsh-client-ui-primitives'
import type { PropsRuntime, Translate } from '@deepseek-ai/dsh-client-ui-slots'
import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'
import type { Translate } from '@deepseek-ai/dsh-client-ui-slots'
import type { CliCommandFailure } from '@deepseek-ai/dsh-cli-account/types'
import type { CliAccountNotice } from './connection.ts'
import css from './CliAccount.module.css'
@@ -114,10 +113,16 @@ export function CliAccountSection(props: CliAccountSectionProps): ReactNode {
)
}
/** The Plugins page detail the tag sits on: an item page, or a bundle page with its package. */
export type CliAccountBadgeSubject =
| { readonly kind: 'item' }
| { readonly kind: 'bundle'; readonly pkg: { readonly name: string; readonly enabled: boolean } }
/** The tag's subject and phase, with the plugin's translator. */
export interface CliAccountBadgeProps {
readonly t: Translate<CliAccountKey>
readonly subject: PropsRuntime<'plugins.detail.badge'>['subject']
/** The `subject` of the `plugins.detail.badge` slot props. */
readonly subject: CliAccountBadgeSubject
readonly packageName: string
readonly phase: CliAccountPhase
}
+11 -4
View File
@@ -1,4 +1,11 @@
/** Host marker for the shared CLI plugin page pieces; the browser half is the client export. */
/** The row has no Host behavior. */
export function apply(): void {}
/**
* Shared Plugins page pieces of CLI app plugins: the connection mirror and the account components. The Web shell links
* this library statically and shares one copy through its module table; plugins import it like any platform module.
*/
export {
CliAccountActivation, CliAccountBadge, CliAccountConfirm, CliAccountSection, CliAccountToast,
type CliAccountAction, type CliAccountActivationProps, type CliAccountBadgeProps, type CliAccountBadgeSubject,
type CliAccountConfirmProps, type CliAccountFailure,
type CliAccountKey, type CliAccountNote, type CliAccountPhase, type CliAccountSectionProps, type CliAccountToastProps,
} from './components.tsx'
export { CliAccountConnection, type CliAccountConnectionOptions, type CliAccountNotice, type CliAccountSnapshot } from './connection.ts'
@@ -2,14 +2,11 @@
/** The section, tag, activation prompt, confirmation, and notice render a plugin's display phase with the copy it translates. */
import { cleanup, fireEvent, render, screen } from '@testing-library/react'
import { makeTranslate } from '@deepseek-ai/dsh-client-test-runtime'
import type { PluginPackageRef, PluginsSubject } from '@deepseek-ai/dsh-client-ui-plugin-manager/client'
import { afterEach, expect, it, vi } from 'vitest'
import {
CliAccountActivation, CliAccountBadge, CliAccountConfirm, CliAccountSection, CliAccountToast,
type CliAccountKey, type CliAccountPhase, type CliAccountSectionProps,
} from '../src/client/components.tsx'
import { apply as applyClient } from '../src/client/index.ts'
import { apply as applyHost } from '../src/index.ts'
type CliAccountBadgeSubject, type CliAccountKey, type CliAccountPhase, type CliAccountSectionProps,
} from '../src/index.ts'
afterEach(cleanup)
@@ -95,17 +92,17 @@ it.each<[string, CliAccountSectionProps['failure'], string]>([
})
it('tags only the enabled bundle with a settled phase', () => {
const pkg = (name: string, enabled = true): PluginPackageRef => ({ name, installed: true, availability: 'profile', official: false, enabled, rows: [] })
const badge = (subject: PluginsSubject, phase: CliAccountPhase = 'connected') =>
const pkg = (name: string, enabled = true) => ({ name, enabled })
const badge = (subject: CliAccountBadgeSubject, phase: CliAccountPhase = 'connected') =>
<CliAccountBadge t={t} subject={subject} packageName={PACKAGE} phase={phase} />
const { rerender } = render(badge({ kind: 'bundle', pkg: pkg(PACKAGE) }))
expect(screen.getByText('Tag connected')).toBeTruthy()
rerender(badge({ kind: 'bundle', pkg: pkg(PACKAGE) }, 'unavailable'))
expect(screen.getByText('Tag unavailable')).toBeTruthy()
const hidden: PluginsSubject[] = [
const hidden: CliAccountBadgeSubject[] = [
{ kind: 'bundle', pkg: pkg(PACKAGE, false) },
{ kind: 'bundle', pkg: pkg('@acme/other') },
{ kind: 'item', id: 'marketplace' },
{ kind: 'item' },
]
for (const subject of hidden) {
rerender(badge(subject))
@@ -154,8 +151,3 @@ it('shows the latest notice with the success or failure tone', () => {
rerender(<CliAccountToast<'connected'> t={t} notice={{ seq: 2, kind: 'action-failed' }} onDone={onDone} />)
expect(screen.getByText('Try again')).toBeTruthy()
})
it('mounts as a module row with no Host or browser behavior of its own', () => {
expect(() => { applyHost() }).not.toThrow()
expect(() => { applyClient() }).not.toThrow()
})
@@ -5,7 +5,7 @@ import type { RemoteStreamOptions } from '@deepseek-ai/dsh-api-gateway/client'
import type { CliAccountView, CliOperationId } from '@deepseek-ai/dsh-cli-account/types'
import { RemoteError, type RemoteResult } from '@deepseek-ai/dsh-typert-protocol'
import { expect, it, onTestFinished, vi } from 'vitest'
import { CliAccountConnection } from '../src/client/connection.ts'
import { CliAccountConnection } from '../src/index.ts'
type View = CliAccountView<{ readonly state: 'out' | 'in' }, 'check' | 'connect' | 'leave', 'authorizing' | 'leaving'>
type Notice = 'connected' | 'left'
@@ -23,9 +23,6 @@
{
"path": "../store"
},
{
"path": "../ui-plugin-manager/tsconfig.client.json"
},
{
"path": "../ui-primitives"
},
@@ -1,3 +1,6 @@
import { clientBundle } from '../tsdown.client.ts'
import { staticLinked } from '../tsdown.client.ts'
export default clientBundle(import.meta.dirname, ['lib/types/index.js'])
export default staticLinked(
import.meta.dirname,
['lib/types/index.js'],
)
+1
View File
@@ -31,6 +31,7 @@
"@deepseek-ai/dsh-client-modules": "workspace:*",
"@deepseek-ai/dsh-client-store": "workspace:*",
"@deepseek-ai/dsh-client-ui-dockkit": "workspace:*",
"@deepseek-ai/dsh-client-ui-cli-account": "workspace:*",
"@deepseek-ai/dsh-client-ui-renderer": "workspace:*",
"@deepseek-ai/dsh-client-ui-primitives": "workspace:*",
"@deepseek-ai/dsh-client-ui-slots": "workspace:*",
+1
View File
@@ -12,6 +12,7 @@ export const PLATFORM_MODULES = [
'@deepseek-ai/dsh-client-ui-slots',
'@deepseek-ai/dsh-client-ui-primitives',
'@deepseek-ai/dsh-client-ui-dockkit',
'@deepseek-ai/dsh-client-ui-cli-account',
] as const
/** Client-bundle specifiers whose factories the parser preloads before the shell starts. */
+2
View File
@@ -17,6 +17,7 @@ import * as ClientStore from '@deepseek-ai/dsh-client-store'
import * as UiSlots from '@deepseek-ai/dsh-client-ui-slots'
import * as UiPrimitives from '@deepseek-ai/dsh-client-ui-primitives'
import * as UiDockkit from '@deepseek-ai/dsh-client-ui-dockkit'
import * as UiCliAccount from '@deepseek-ai/dsh-client-ui-cli-account'
import type { PlatformModule } from './platform.ts'
/**
@@ -39,5 +40,6 @@ export function getStaticModules(): Record<string, unknown> {
'@deepseek-ai/dsh-client-ui-slots': UiSlots,
'@deepseek-ai/dsh-client-ui-primitives': UiPrimitives,
'@deepseek-ai/dsh-client-ui-dockkit': UiDockkit,
'@deepseek-ai/dsh-client-ui-cli-account': UiCliAccount,
} satisfies Record<PlatformModule, unknown>
}
+3
View File
@@ -29,6 +29,9 @@
{
"path": "../ui-dockkit"
},
{
"path": "../ui-cli-account"
},
{
"path": "../ui-renderer"
},
@@ -72,7 +72,6 @@ Every package below exports a Cordis plugin that a bundle patch can name in a Lo
| `@deepseek-ai/dsh-client-ui-attachment` | no | Dynamic attachment presentation plugin for conversation input, message-image, and trajectory image slots |
| `@deepseek-ai/dsh-client-ui-brand-official` | no | Official DeepSeek Harness brand occupants for the Web client's sidebar slots |
| `@deepseek-ai/dsh-client-ui-chat` | no | Chat Conversation target, node definitions, renderers, and details surface |
| `@deepseek-ai/dsh-client-ui-cli-account` | no | Shared Plugins page pieces of CLI app plugins: the account connection mirror and the section, tag, activation, confirmation, and notice components |
| `@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-conversation` | no | Target-neutral Conversation assembly, shell, composer, queue, and view navigation |
| `@deepseek-ai/dsh-client-ui-deepseek-model-label-1017` | no | Temporary 1017 release badge for official DeepSeek Flash model labels |
+6 -6
View File
@@ -977,6 +977,9 @@ importers:
'@deepseek-ai/dsh-client-test-runtime':
specifier: workspace:*
version: link:../../packages/test-support/client-runtime
'@deepseek-ai/dsh-client-ui-cli-account':
specifier: workspace:*
version: link:../../packages/client/ui-cli-account
'@deepseek-ai/dsh-client-ui-deliverables':
specifier: workspace:*
version: link:../../packages/client/ui-deliverables
@@ -2999,9 +3002,6 @@ importers:
'@deepseek-ai/dsh-client-ui-chat':
specifier: workspace:*
version: link:../../client/ui-chat
'@deepseek-ai/dsh-client-ui-cli-account':
specifier: workspace:*
version: link:../../client/ui-cli-account
'@deepseek-ai/dsh-client-ui-commands':
specifier: workspace:*
version: link:../../client/ui-commands
@@ -3988,9 +3988,6 @@ importers:
'@deepseek-ai/dsh-client-test-runtime':
specifier: workspace:*
version: link:../../test-support/client-runtime
'@deepseek-ai/dsh-client-ui-plugin-manager':
specifier: workspace:*
version: link:../ui-plugin-manager
'@deepseek-ai/dsh-client-ui-primitives':
specifier: workspace:*
version: link:../ui-primitives
@@ -7037,6 +7034,9 @@ importers:
'@deepseek-ai/dsh-client-store':
specifier: workspace:*
version: link:../store
'@deepseek-ai/dsh-client-ui-cli-account':
specifier: workspace:*
version: link:../ui-cli-account
'@deepseek-ai/dsh-client-ui-dockkit':
specifier: workspace:*
version: link:../ui-dockkit
+1
View File
@@ -202,6 +202,7 @@ const packageFileExtras: Readonly<Record<string, readonly string[]>> = {
// unpublished, as everywhere else in the repository.
'@deepseek-ai/dsh-client-ui-primitives': ['lib/**/*.css'],
'@deepseek-ai/dsh-client-ui-dockkit': ['lib/**/*.css'],
'@deepseek-ai/dsh-client-ui-cli-account': ['lib/**/*.css'],
'@deepseek-ai/dsh-client-ui-sidebar-documentpreview': ['lib/client.*.js'],
'@deepseek-ai/dsh-client-ui-sidebar-terminal': ['lib/client.*.js'],
'@deepseek-ai/dsh-client-web': ['lib/**/*.css', 'lib/apply-injections.js'],
+1
View File
@@ -63,6 +63,7 @@ const PACKAGE_LIBRARIES: Readonly<Record<string, string>> = {
'packages/connector/cli-account': 'Host library CLI app plugins import for commands and account operations; plain class exports.',
'packages/client/store': 'Browser-side state primitives; plain function/type exports.',
'packages/client/ui-primitives': 'Browser-side UI component library; plain component exports.',
'packages/client/ui-cli-account': 'Browser-side Plugins page library for CLI app plugins; plain component and class exports.',
'packages/client/ui-slots': 'Browser-side slot-map declarations; plain type exports.',
'packages/client/web': 'Browser application boot library; exports the app entry and static module table.',
'packages/core/scope': 'Scoped-context primitives; exports functions and types without a plugin entry.',
-1
View File
@@ -351,7 +351,6 @@
"@deepseek-ai/dsh-client-ui-settings-models": ["./packages/client/ui-settings-models/src"],
"@deepseek-ai/dsh-client-ui-plugin-manager": ["./packages/client/ui-plugin-manager/src"],
"@deepseek-ai/dsh-client-ui-cli-account": ["./packages/client/ui-cli-account/src"],
"@deepseek-ai/dsh-client-ui-cli-account/client": ["./packages/client/ui-cli-account/src/client/index.ts"],
"@deepseek-ai/dsh-client-ui-plugin-market": ["./packages/client/ui-plugin-market/src"],
"@deepseek-ai/dsh-client-ui-settings-plugin-inventory": ["./packages/client/ui-settings-plugin-inventory/src"],
"@deepseek-ai/dsh-client-locale": ["./packages/client/locale/src"],