diff --git a/.agents/notes/implemented/architecture/2026-11-06-connector-account-registry.i18n.yaml b/.agents/notes/implemented/architecture/2026-11-06-connector-account-registry.i18n.yaml
new file mode 100644
index 0000000000..121a9d669b
--- /dev/null
+++ b/.agents/notes/implemented/architecture/2026-11-06-connector-account-registry.i18n.yaml
@@ -0,0 +1,19 @@
+# Bilingual-pair consistency record for 2026-11-06-connector-account-registry.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 .agents/notes/implemented/architecture/2026-11-06-connector-account-registry.md
+/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts:
+ en: 3950421fb526f6b7
+ zh: 47c5f6cc4b735058
+/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/problem:
+ en: 2a7b59cd509a0b9a
+ zh: 38130ce17829342d
+/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/decision:
+ en: d96b43106a1ba837
+ zh: 97bc8f9436ec07d0
+/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/alternatives-considered:
+ en: ee0aa3f9ea40ef15
+ zh: fded69a6dcc8ca87
+/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/consequences:
+ en: 5228f32becfbdec3
+ zh: 013f1073e70d46f7
diff --git a/.agents/notes/implemented/architecture/2026-11-06-connector-account-registry.md b/.agents/notes/implemented/architecture/2026-11-06-connector-account-registry.md
new file mode 100644
index 0000000000..93138b065e
--- /dev/null
+++ b/.agents/notes/implemented/architecture/2026-11-06-connector-account-registry.md
@@ -0,0 +1,42 @@
+# Agent Note: One Host registry and one browser half for connector accounts
+
+Status: implemented
+
+English | [中文](2026-11-06-connector-account-registry.zh.md)
+
+## Problem
+
+Connector plugins show an account section on the Plugins page. CLI app plugins keep the account in their vendor CLI; MCP connectors keep an OAuth grant through the MCP manager. Both kinds need the same surfaces: a bundle's section, title tag, and activation prompt, a confirmation before an action that changes the account outside DSH, and a notice in the browser that started the operation. A client plugin cannot share runtime code with another feature plugin ([packages/client/AGENTS.md](../../../../packages/client/AGENTS.md) rule 3), so one browser half per connector kind duplicates the same code and lets the copies drift. When the browser decides an account's state or relays an identifier from one Remote to another, the Host can no longer run the flow without the browser.
+
+## Decision
+
+[`@deepseek-ai/dsh-client-ui-connector-account`](../../../../packages/client/ui-connector-account/README.md) provides one Host registry, `ctx.connectorAccounts`, one `connectorAccounts` Remote, and one browser half for every connector kind.
+
+| Part | Contract |
+|---|---|
+| Registration | `register({ key, packageName?, source, operations, copy, present })` returns the disposer that withdraws the account |
+| Key | Unique among registered accounts and independent of the package, so an account that no bundle owns, such as a server configured in Settings, registers too |
+| Package | Decides which bundle page carries the section and tag; a package carries at most one account |
+| Source | The registrant's account: `snapshot`, `observe`, `refresh`, `start`, and `cancel` |
+| Display | `present(view)` on the Host gives the phase, status text, title tag, buttons and their commands, confirmations, failure, and the operation the activation prompt starts |
+| Remote | `watch`, plus `start(key, operation)` and `cancel(key, id)`, which route by key to the account's source |
+
+The Host decides everything except opening the authorization page. The browser never learns how an account connects: it receives only the display, the operation in progress with its authorization page, and the latest result with its success text. The browser half keeps only what belongs to one browser: the operations it started, so their authorization pages open and their success is reported only there; the latest notice; and whether its stream is delivering. Buttons call `start` and `cancel` on the Remote themselves, and each surface keeps its own pending state.
+
+The page registers one title tag entry and one notice entry. It also registers a section and an activation prompt for each account that names a package, because those two slots are keyed by package.
+
+## Alternatives considered
+
+**Two registries behind one browser half.** Rejected: the browser would follow both Remotes and choose which one each button calls, which relays between Host services again, and the two Host registries would hold the same code.
+
+**One browser half per connector kind.** Rejected: client plugins cannot import each other's values, so the shared surfaces would be written twice and diverge.
+
+**Share the browser half through `PLATFORM_MODULES` or a browser-side service.** Rejected: the module table is reserved for shell-seeded and static infrastructure libraries, and a browser-side service would keep the registrations in the browser, which only repeat what the Host knows.
+
+**Let the browser derive an account's phase and actions from the registrant's raw state.** Rejected: the rules for which actions apply would live where the Host cannot test or run them, and the browser would need the registrant's own Remote.
+
+## Consequences
+
+The registry and browser half exist once. A new connector kind writes a source and `present` on the Host and needs no browser code. The account rules live beside the services that own them, and the Host can run every operation without a browser.
+
+Registrants map their account states onto five phases (checking, connecting, connected, disconnected, unavailable); a state outside them shows through its status text and detail. The Web and Desktop compositions load the registry whether or not a connector plugin is installed. An authorization page that opens after the start call answers can be blocked by the browser; the section's open button shows it again.
diff --git a/.agents/notes/implemented/architecture/2026-11-06-connector-account-registry.zh.md b/.agents/notes/implemented/architecture/2026-11-06-connector-account-registry.zh.md
new file mode 100644
index 0000000000..e2c7a56b41
--- /dev/null
+++ b/.agents/notes/implemented/architecture/2026-11-06-connector-account-registry.zh.md
@@ -0,0 +1,42 @@
+# Agent Note:连接器账号使用一个 Host 注册表和一个浏览器一半
+
+Status: implemented
+
+[English](2026-11-06-connector-account-registry.md) | 中文
+
+## 问题
+
+连接器插件会在插件页显示账号区块。CLI 应用插件的账号保存在厂商 CLI 中;MCP 连接器通过 MCP 管理器保存 OAuth 授权。两类插件需要同样的界面:插件包的区块、标题旁标签和开启引导,在会改变 DSH 之外账号状态的操作前确认,以及只在发起操作的浏览器中显示的提示。客户端插件不能与其他功能插件共享运行时代码([packages/client/AGENTS.md](../../../../packages/client/AGENTS.md) 第 3 条),因此每类连接器各有一个浏览器一半,就会把同样的代码写两遍,副本还会逐渐不一致。如果由浏览器决定账号状态,或在两个 Remote 之间转发标识,Host 就无法在没有浏览器的情况下完成流程。
+
+## 决定
+
+[`@deepseek-ai/dsh-client-ui-connector-account`](../../../../packages/client/ui-connector-account/README.zh.md) 为所有连接器类型提供一个 Host 注册表 `ctx.connectorAccounts`、一个 `connectorAccounts` Remote 和一个浏览器一半。
+
+| 部分 | 约定 |
+|---|---|
+| 注册 | `register({ key, packageName?, source, operations, copy, present })` 返回撤下账号的销毁函数 |
+| 键 | 在已注册账号中唯一,且与包无关,因此没有插件包承载的账号(如在 Settings 中配置的服务器)也能注册 |
+| 包 | 决定由哪个插件包页面承载区块和标签;一个包最多承载一个账号 |
+| 来源 | 注册方的账号:`snapshot`、`observe`、`refresh`、`start` 和 `cancel` |
+| 展示 | Host 上的 `present(view)` 给出阶段、状态文字、标题旁标签、按钮及其命令、确认、失败信息,以及开启引导启动的操作 |
+| Remote | `watch`,以及按键路由到账号来源的 `start(key, operation)` 和 `cancel(key, id)` |
+
+除了打开授权页,其余都由 Host 决定。浏览器不知道账号如何连接:它只收到展示内容、进行中的操作及其授权页,以及带成功文本的最新结果。浏览器一半只保存属于本浏览器的东西:它发起的操作(授权页只在这里打开,成功只在这里报告)、最新提示,以及它的流是否在推送。按钮自己调用 Remote 的 `start` 和 `cancel`,每个界面自己保存未完成状态。
+
+页面只注册一个标题旁标签条目和一个提示条目;对每个带包名的账号,再注册一个区块和一个开启引导,因为这两个插槽以包为键。
+
+## 考虑过的替代方案
+
+**一个浏览器一半背后有两个注册表。** 否决:浏览器要同时跟随两个 Remote,并为每个按钮选择调用哪一个,这又是在 Host 服务之间转发;两个 Host 注册表的代码也会相同。
+
+**每类连接器各有一个浏览器一半。** 否决:客户端插件不能导入彼此的值,共用界面就要写两遍,并逐渐不一致。
+
+**通过 `PLATFORM_MODULES` 或浏览器端服务共享浏览器一半。** 否决:模块表只留给由 shell 预置的基础设施和静态库;浏览器端服务会把注册留在浏览器中,而这些注册只是重复 Host 已知的信息。
+
+**由浏览器根据注册方的原始状态推算账号阶段和操作。** 否决:哪些操作可用的规则会放在 Host 无法测试和执行的地方,浏览器还需要注册方自己的 Remote。
+
+## 后果
+
+注册表和浏览器一半只有一份。新的连接器类型只需在 Host 上编写来源和 `present`,不需要浏览器代码。账号规则与拥有它们的服务在一起,Host 不依赖浏览器就能执行每个操作。
+
+注册方需要把账号状态映射到五个阶段(检查中、连接中、已连接、未连接、不可用);超出这些阶段的状态通过状态文字和说明表达。无论是否安装了连接器插件,Web 与桌面端组合都会加载注册表。启动调用返回后才打开的授权页可能被浏览器拦截;区块中的打开按钮可以再次打开它。
diff --git a/docs/capability-seams.i18n.yaml b/docs/capability-seams.i18n.yaml
index 77f025f1e9..38090bd827 100644
--- a/docs/capability-seams.i18n.yaml
+++ b/docs/capability-seams.i18n.yaml
@@ -6,5 +6,5 @@
en: 41d772192075e133
zh: 5ef3da69b4de1d8a
/capability-seams-and-core-services:
- en: b76743a3ff14d2f4
- zh: 82431aa3ded14a89
+ en: b3be76b595765ee3
+ zh: 85de5f625a7a15a6
diff --git a/docs/capability-seams.md b/docs/capability-seams.md
index 145a4f5317..b4fcad0d21 100644
--- a/docs/capability-seams.md
+++ b/docs/capability-seams.md
@@ -28,6 +28,8 @@ flowchart LR
pkg_plugin_manager["plugin-manager"]
svc_pluginManager["ctx.pluginManager Current-profile plugin and bundle management"]
pkg_ui_settings_plugin_inventory["ui-settings-plugin-inventory"]
+ pkg_client_ui_connector_account["client-ui-connector-account"]
+ svc_connectorAccounts["ctx.connectorAccounts Connector accounts on the Plugins page"]
pkg_plugin_market["plugin-market"]
svc_pluginMarket["ctx.pluginMarket Plugin market index reader"]
pkg_client_ui_plugin_market["client-ui-plugin-market"]
@@ -344,6 +346,7 @@ flowchart LR
pkg_client_file_upload --> svc_fileUploads
pkg_client_modules --> svc_clientModules
pkg_client_product_analytics --> svc_productAnalytics
+ pkg_client_ui_connector_account --> svc_connectorAccounts
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
pkg_command_feedback --> svc_sessionFeedback
pkg_commands --> svc_commands
@@ -659,6 +662,7 @@ flowchart LR
| `ctx.hmr` | `core` | [`hmr`](../packages/boot/hmr) | - | [`app-boot`](../packages/boot/app-boot) | - | Owns module and exact configuration watchers; application mutations share its queue and automatic reloads await the application file lock. |
| `ctx.pluginRegistryProbe` | `core` | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | Races public registry responses on the Host; the Client owns the initial registry recommendation. |
| `ctx.pluginManager` | `core` | [`plugin-manager`](../packages/boot/plugin-manager) | - | [`plugin-manager`](../packages/boot/plugin-manager), `ui-settings-plugin-inventory` | - | Shares profile package operations with the CLI and reports persisted and running state to Web and agent callers. |
+| `ctx.connectorAccounts` | `service` | [`client-ui-connector-account`](../packages/client/ui-connector-account) | - | - | - | Holds the accounts CLI app plugins and MCP connectors register and serves their Host-computed displays to the Plugins page through one Remote; authorization pages and notices stay in the browser that started the operation. |
| `ctx.pluginMarket` | `core` | [`plugin-market`](../packages/boot/plugin-market) | - | [`client-ui-plugin-market`](../packages/client/ui-plugin-market), [`plugin-market`](../packages/boot/plugin-market) | - | Fetches and validates the index sources the user configures; installation goes through the plugin manager. |
| `ctx.profileContext` | `core` | [`app-boot`](../packages/boot/app-boot) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | The dsh launcher supplies data-only profile locations and composition inputs; reload scheduling belongs to dsh-hmr. |
| `ctx.connection` | `core` | [`client-connection`](../packages/client/connection) | - | [`api-gateway`](../packages/api/gateway), [`host-frontend-static`](../packages/host/frontend-static) | - | Owns browser authentication and shared HTTP request dispatch; API adapters register endpoints and streams. |
diff --git a/docs/capability-seams.zh.md b/docs/capability-seams.zh.md
index 5effa1f8c4..57543c3bd5 100644
--- a/docs/capability-seams.zh.md
+++ b/docs/capability-seams.zh.md
@@ -30,6 +30,8 @@ flowchart LR
pkg_plugin_manager["plugin-manager"]
svc_pluginManager["ctx.pluginManager Current-profile plugin and bundle management"]
pkg_ui_settings_plugin_inventory["ui-settings-plugin-inventory"]
+ pkg_client_ui_connector_account["client-ui-connector-account"]
+ svc_connectorAccounts["ctx.connectorAccounts Connector accounts on the Plugins page"]
pkg_plugin_market["plugin-market"]
svc_pluginMarket["ctx.pluginMarket Plugin market index reader"]
pkg_client_ui_plugin_market["client-ui-plugin-market"]
@@ -346,6 +348,7 @@ flowchart LR
pkg_client_file_upload --> svc_fileUploads
pkg_client_modules --> svc_clientModules
pkg_client_product_analytics --> svc_productAnalytics
+ pkg_client_ui_connector_account --> svc_connectorAccounts
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
pkg_command_feedback --> svc_sessionFeedback
pkg_commands --> svc_commands
@@ -661,6 +664,7 @@ flowchart LR
| `ctx.hmr` | `core` | [`hmr`](../packages/boot/hmr) | - | [`app-boot`](../packages/boot/app-boot) | - | 负责模块和精确配置监听;应用修改共用其队列,自动重载等待应用文件锁。 |
| `ctx.pluginRegistryProbe` | `core` | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | 在 Host 上并发比较公共安装源响应;初始安装源推荐由 Client 负责。 |
| `ctx.pluginManager` | `core` | [`plugin-manager`](../packages/boot/plugin-manager) | - | [`plugin-manager`](../packages/boot/plugin-manager), `ui-settings-plugin-inventory` | - | 与 CLI 共享 profile 包操作,并向 Web 和 Agent 调用方分别报告持久状态与运行状态。 |
+| `ctx.connectorAccounts` | `service` | [`client-ui-connector-account`](../packages/client/ui-connector-account) | - | - | - | 保存 CLI 应用插件和 MCP 连接器注册的账号,并通过一个 Remote 把 Host 算好的展示内容提供给插件页;授权页和提示只出现在发起操作的浏览器中。 |
| `ctx.pluginMarket` | `core` | [`plugin-market`](../packages/boot/plugin-market) | - | [`client-ui-plugin-market`](../packages/client/ui-plugin-market), [`plugin-market`](../packages/boot/plugin-market) | - | 获取并校验用户配置的索引源;安装通过插件管理器完成。 |
| `ctx.profileContext` | `core` | [`app-boot`](../packages/boot/app-boot) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | dsh launcher 提供纯数据形式的 profile 位置与组合输入;重载调度由 dsh-hmr 负责。 |
| `ctx.connection` | `core` | [`client-connection`](../packages/client/connection) | - | [`api-gateway`](../packages/api/gateway), [`host-frontend-static`](../packages/host/frontend-static) | - | 负责浏览器认证与共享 HTTP 请求分发;API 适配器注册端点和流。 |
diff --git a/docs/config-catalog.md b/docs/config-catalog.md
index 6c75efde1d..3a24364ee1 100644
--- a/docs/config-catalog.md
+++ b/docs/config-catalog.md
@@ -5022,6 +5022,7 @@ 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-connector-account` | — | [`packages/client/ui-connector-account/src/index.ts`](../packages/client/ui-connector-account/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-context-menu` | — | [`packages/client/ui-context-menu/src/index.ts`](../packages/client/ui-context-menu/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 c7a7ba3c7a..9535e76458 100644
--- a/docs/config-catalog.zh.md
+++ b/docs/config-catalog.zh.md
@@ -5024,6 +5024,7 @@ 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-connector-account` | — | [`packages/client/ui-connector-account/src/index.ts`](../packages/client/ui-connector-account/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-context-menu` | — | [`packages/client/ui-context-menu/src/index.ts`](../packages/client/ui-context-menu/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 2e73bd13bc..e63ca7d1c6 100644
--- a/docs/module-graph.md
+++ b/docs/module-graph.md
@@ -166,6 +166,7 @@ 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_connector_account["client-ui-connector-account"]
pkg_client_ui_context_menu["client-ui-context-menu"]
pkg_client_ui_conversation["client-ui-conversation"]
pkg_client_ui_deliverables["client-ui-deliverables"]
@@ -1586,6 +1587,7 @@ 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-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` | — |
| [`client-ui-deliverables`](../packages/client/ui-deliverables) | `client` | — |
diff --git a/docs/module-graph.zh.md b/docs/module-graph.zh.md
index 1b697fe591..fb305c3557 100644
--- a/docs/module-graph.zh.md
+++ b/docs/module-graph.zh.md
@@ -168,6 +168,7 @@ 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_connector_account["client-ui-connector-account"]
pkg_client_ui_context_menu["client-ui-context-menu"]
pkg_client_ui_conversation["client-ui-conversation"]
pkg_client_ui_deliverables["client-ui-deliverables"]
@@ -1588,6 +1589,7 @@ 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-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` | — |
| [`client-ui-deliverables`](../packages/client/ui-deliverables) | `client` | — |
diff --git a/docs/subsystems/boot.md b/docs/subsystems/boot.md
index 6780e92c43..c8f36d14e2 100644
--- a/docs/subsystems/boot.md
+++ b/docs/subsystems/boot.md
@@ -143,6 +143,50 @@ async edit( entry: Entry, change: (current: Record, inherited:
Source: [`packages/boot/config-editor/src/index.ts`](../../packages/boot/config-editor/src/index.ts)
+
+
+### `ctx.connectorAccounts` — `ConnectorAccounts`
+
+Holds the registered accounts and serves them to the Plugins page.
+
+```ts cordis-catalog
+/**
+ * Show one account on the Plugins page for as long as the returned disposer has not run.
+ * @param registration - the account key, its bundle package, the account source, the page operations, and the
+ * presentation.
+ * @returns an idempotent disposer that withdraws the account.
+ * @throws when another account already uses the key or the package.
+ */
+register(registration: ConnectorAccountRegistration): () => void
+
+/**
+ * Follow every registered account; each new subscriber starts a check of each account that runs no operation.
+ * @param signal - the Client's observation lifetime; disposal also ends the stream.
+ * @returns the current accounts, then each changed set, coalescing changes that arrive before the next read.
+ */
+@Remote({ mode: 'stream' }) async *watch(signal: AbortSignal): AsyncIterable
+
+/**
+ * Start one of the operations the account registered as page actions.
+ * @param key - the account key.
+ * @param operation - the operation kind.
+ * @returns the operation identity.
+ * @throws for an unknown account or operation, or whatever the account's source refuses, such as a second operation.
+ */
+@Remote start(key: string, operation: string): ConnectorOperationId
+
+/**
+ * Cancel one operation while its phase is cancellable, and wait for it to settle.
+ * @param key - the account key.
+ * @param id - the operation to cancel; a finished one or a phase that is not cancellable is ignored.
+ * @returns after the operation settles, or at once when nothing is cancelled.
+ * @throws for an unknown account.
+ */
+@Remote cancel(key: string, id: ConnectorOperationId): Promise
+```
+
+Source: [`packages/client/ui-connector-account/src/index.ts`](../../packages/client/ui-connector-account/src/index.ts)
+
### `ctx.headlessStartup` — `HeadlessStartupValues`
diff --git a/docs/subsystems/boot.zh.md b/docs/subsystems/boot.zh.md
index 915b6e8112..ab6383e0b3 100644
--- a/docs/subsystems/boot.zh.md
+++ b/docs/subsystems/boot.zh.md
@@ -143,6 +143,50 @@ async edit( entry: Entry, change: (current: Record, inherited:
Source: [`packages/boot/config-editor/src/index.ts`](../../packages/boot/config-editor/src/index.ts)
+
+
+### `ctx.connectorAccounts` — `ConnectorAccounts`
+
+Holds the registered accounts and serves them to the Plugins page.
+
+```ts cordis-catalog
+/**
+ * Show one account on the Plugins page for as long as the returned disposer has not run.
+ * @param registration - the account key, its bundle package, the account source, the page operations, and the
+ * presentation.
+ * @returns an idempotent disposer that withdraws the account.
+ * @throws when another account already uses the key or the package.
+ */
+register(registration: ConnectorAccountRegistration): () => void
+
+/**
+ * Follow every registered account; each new subscriber starts a check of each account that runs no operation.
+ * @param signal - the Client's observation lifetime; disposal also ends the stream.
+ * @returns the current accounts, then each changed set, coalescing changes that arrive before the next read.
+ */
+@Remote({ mode: 'stream' }) async *watch(signal: AbortSignal): AsyncIterable
+
+/**
+ * Start one of the operations the account registered as page actions.
+ * @param key - the account key.
+ * @param operation - the operation kind.
+ * @returns the operation identity.
+ * @throws for an unknown account or operation, or whatever the account's source refuses, such as a second operation.
+ */
+@Remote start(key: string, operation: string): ConnectorOperationId
+
+/**
+ * Cancel one operation while its phase is cancellable, and wait for it to settle.
+ * @param key - the account key.
+ * @param id - the operation to cancel; a finished one or a phase that is not cancellable is ignored.
+ * @returns after the operation settles, or at once when nothing is cancelled.
+ * @throws for an unknown account.
+ */
+@Remote cancel(key: string, id: ConnectorOperationId): Promise
+```
+
+Source: [`packages/client/ui-connector-account/src/index.ts`](../../packages/client/ui-connector-account/src/index.ts)
+
### `ctx.headlessStartup` — `HeadlessStartupValues`
diff --git a/packages/api/remotes/README.i18n.yaml b/packages/api/remotes/README.i18n.yaml
index 4178adfa26..b05bc795e0 100644
--- a/packages/api/remotes/README.i18n.yaml
+++ b/packages/api/remotes/README.i18n.yaml
@@ -15,8 +15,8 @@
en: a7a78c6d1aeebeb3
zh: 4bb69f32d8b05ba3
/deepseek-ai-dsh-api-remotes/use-this-package:
- en: 5e5770cc1cbf49db
- zh: b9ee3c309d0cd93c
+ en: d8622091b217f050
+ zh: c36cb87f10e7802a
/deepseek-ai-dsh-api-remotes/forwarded-host-events:
en: 1dea001229f8c06a
zh: 3acb1fa1c5d24f8c
diff --git a/packages/api/remotes/README.md b/packages/api/remotes/README.md
index 71e5dc385f..a01a776f3e 100644
--- a/packages/api/remotes/README.md
+++ b/packages/api/remotes/README.md
@@ -29,7 +29,7 @@ Two-sided BFF for Host Remote capabilities selected by this application. The Hos
[`@deepseek-ai/dsh-api-session-controller`](../session-controller/README.md) owns Agent and Session identity policy, including the Typert lookup resolvers used by other namespaces. This package selects and mounts that generated Session contribution without a direct runtime dependency on `@deepseek-ai/dsh-session`; activation policy stays with Session Controller.
-The Client assembly mounts Office conversion, Commands, Agent Teams, credentials, settings, Goal, Schedule, dynamic Cordis, file and Session references, read-only Host plugin inventory, plugin-installation registry response comparison, message feedback, permission presets, Session Controller, subagents, web provider list, and Workspace Controller contributions. The `permissionPresets` namespace returns the complete process-level catalog used by current-session controls. Cordis effect ownership withdraws every contribution when this assembly unloads, while `@deepseek-ai/dsh-api-gateway/client` owns descriptor validation, traced namespace Services, direct and scoped methods, invocation, streams, and cancellation. The Client entry consumes the shared `TypertClientRemote` interface through Cordis and does not import the concrete Gateway. It re-exports the Gateway Client face's declaration merges type-only, so a consumer reaching the forwarded-event vocabulary through this facade gains no runtime edge to the Gateway implementation.
+The Client assembly mounts Office conversion, Commands, Agent Teams, credentials, settings, Goal, Schedule, dynamic Cordis, file and Session references, read-only Host plugin inventory, plugin-installation registry response comparison, connector accounts, message feedback, permission presets, Session Controller, subagents, web provider list, and Workspace Controller contributions. The `permissionPresets` namespace returns the complete process-level catalog used by current-session controls. Cordis effect ownership withdraws every contribution when this assembly unloads, while `@deepseek-ai/dsh-api-gateway/client` owns descriptor validation, traced namespace Services, direct and scoped methods, invocation, streams, and cancellation. The Client entry consumes the shared `TypertClientRemote` interface through Cordis and does not import the concrete Gateway. It re-exports the Gateway Client face's declaration merges type-only, so a consumer reaching the forwarded-event vocabulary through this facade gains no runtime edge to the Gateway implementation.
This facade is also the front door for the wire type vocabulary a Client package names. It re-exports, type-only, the Remote failure vocabulary (`RemoteResult`, `RemoteFailure`, `RemoteErrorCode`, `RemoteErrorDetailsMap`), the Host facts (`RemoteHostFacts`), and each selected domain's client-safe payload types, so a Client feature package imports one specifier instead of reaching into `dsh-typert-protocol`, the Gateway, or an owner's Host entry. Two kinds of package deliberately skip this door: the API-layer packages this assembly itself selects — importing it back would close a dependency cycle — and their tests, which take the failure vocabulary from `dsh-typert-protocol` directly. A UI package's tests instead take the `RemoteError` constructor from [`dsh-client-test-runtime`](../../test-support/client-runtime/README.md).
diff --git a/packages/api/remotes/README.zh.md b/packages/api/remotes/README.zh.md
index 5bef7cb29c..cc3c407f49 100644
--- a/packages/api/remotes/README.zh.md
+++ b/packages/api/remotes/README.zh.md
@@ -29,7 +29,7 @@ kind: "package-reference"
[`@deepseek-ai/dsh-api-session-controller`](../session-controller/README.zh.md) 拥有 agent(智能体)与会话身份策略,包括供其他 namespace 使用的 Typert lookup 解析器。本包选择并挂载生成的会话 contribution,无需直接依赖 `@deepseek-ai/dsh-session` 的运行时;激活策略由会话控制器负责。
-Client 组合挂载 Office 转换、Commands、Agent Teams、凭据、settings、Goal、Schedule、动态 Cordis、文件与会话引用、只读 Host 插件清单、插件安装源响应比较、消息反馈、权限预设、会话控制器、subagents、Web 提供方列表和 Workspace 控制器 contribution。`permissionPresets` namespace 返回 current-session 控件使用的完整进程级目录。该组合卸载时,Cordis effect 的所有权机制会撤回所有贡献;`@deepseek-ai/dsh-api-gateway/client` 负责描述符校验、可追踪的 namespace 服务、直接与作用域方法、调用、流与取消。Client 入口通过 Cordis 消费共享的 `TypertClientRemote` 接口,不导入具体 Gateway;它只以 type-only 形式重新导出 Gateway Client face 的声明合并,因此消费端经由本外观取到转发事件词汇时,运行时不会多出一条通往 Gateway 实现的边。
+Client 组合挂载 Office 转换、Commands、Agent Teams、凭据、settings、Goal、Schedule、动态 Cordis、文件与会话引用、只读 Host 插件清单、插件安装源响应比较、连接器账号、消息反馈、权限预设、会话控制器、subagents、Web 提供方列表和 Workspace 控制器 contribution。`permissionPresets` namespace 返回 current-session 控件使用的完整进程级目录。该组合卸载时,Cordis effect 的所有权机制会撤回所有贡献;`@deepseek-ai/dsh-api-gateway/client` 负责描述符校验、可追踪的 namespace 服务、直接与作用域方法、调用、流与取消。Client 入口通过 Cordis 消费共享的 `TypertClientRemote` 接口,不导入具体 Gateway;它只以 type-only 形式重新导出 Gateway Client face 的声明合并,因此消费端经由本外观取到转发事件词汇时,运行时不会多出一条通往 Gateway 实现的边。
本 facade 同时是 Client 包指称 wire 类型词汇的正门。它以 type-only 方式转出 Remote 失败词汇(`RemoteResult`、`RemoteFailure`、`RemoteErrorCode`、`RemoteErrorDetailsMap`)、Host 事实(`RemoteHostFacts`),以及各已选领域对 Client 安全的载荷类型,因此 Client 功能包只 import 一个 specifier,不必伸手进 `dsh-typert-protocol`、Gateway 或某个拥有方的 Host 入口。有两类包刻意不走这道门:本装配自己选中的 API 层包——反向 import 会形成依赖环——以及它们的测试,后者直接从 `dsh-typert-protocol` 取失败词汇。UI 包的测试则从 [`dsh-client-test-runtime`](../../test-support/client-runtime/README.zh.md) 取 `RemoteError` 构造器。
diff --git a/packages/api/remotes/package.json b/packages/api/remotes/package.json
index 25718e223b..ffc73c917b 100644
--- a/packages/api/remotes/package.json
+++ b/packages/api/remotes/package.json
@@ -98,6 +98,7 @@
"@deepseek-ai/dsh-plugin-manager": "workspace:*",
"@deepseek-ai/dsh-mcp-manager": "workspace:*",
"@deepseek-ai/dsh-plugin-market": "workspace:*",
+ "@deepseek-ai/dsh-client-ui-connector-account": "workspace:*",
"@deepseek-ai/dsh-client-ui-plugin-manager": "workspace:*",
"@deepseek-ai/dsh-office-kit": "workspace:*",
"@deepseek-ai/dsh-deepseek-account": "workspace:*",
diff --git a/packages/api/remotes/src/client/index.ts b/packages/api/remotes/src/client/index.ts
index 5d91957c0a..ade29eff4e 100644
--- a/packages/api/remotes/src/client/index.ts
+++ b/packages/api/remotes/src/client/index.ts
@@ -19,6 +19,7 @@ import pluginManagerRemote from '@deepseek-ai/dsh-plugin-manager/remote'
import mcpManagerRemote from '@deepseek-ai/dsh-mcp-manager/remote'
import toolResultsRemote from '@deepseek-ai/dsh-client-ui-trajectory/remote'
import pluginRegistryProbeRemote from '@deepseek-ai/dsh-client-ui-plugin-manager/remote'
+import connectorAccountsRemote from '@deepseek-ai/dsh-client-ui-connector-account/remote'
import pluginMarketRemote from '@deepseek-ai/dsh-plugin-market/remote'
import pluginInventoryRemote from '@deepseek-ai/dsh-host-plugin-inventory/remote'
import messageFeedbackRemote from '@deepseek-ai/dsh-message-feedback/remote'
@@ -48,6 +49,7 @@ export type { McpManagedServerStatus, McpManagedServerView } from '@deepseek-ai/
export type {} from '@deepseek-ai/dsh-plugin-manager/remote'
export type {} from '@deepseek-ai/dsh-mcp-manager/remote'
export type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/remote'
+export type {} from '@deepseek-ai/dsh-client-ui-connector-account/remote'
export type {} from '@deepseek-ai/dsh-client-ui-trajectory/remote'
export type {} from '@deepseek-ai/dsh-plugin-market/remote'
export type {
@@ -200,6 +202,7 @@ export async function apply(ctx: Context): Promise<() => Promise> {
productAnalyticsRemote, agentPresetsRemote, commandsRemote, agentTeamsRemote, settingsControllerRemote, accountRemote,
goalsRemote, llmRemote, dynamicRemote, scheduleRemote,
pluginInventoryRemote, pluginManagerRemote, mcpManagerRemote, pluginMarketRemote, pluginRegistryProbeRemote,
+ connectorAccountsRemote,
toolResultsRemote,
messageFeedbackRemote, sessionFeedbackRemote,
fileUploadsRemote, sessionReferencesRemote,
diff --git a/packages/bundle/web-app/cordis.patch.yml b/packages/bundle/web-app/cordis.patch.yml
index e842d8e3e1..fc7b384795 100644
--- a/packages/bundle/web-app/cordis.patch.yml
+++ b/packages/bundle/web-app/cordis.patch.yml
@@ -341,6 +341,11 @@
- id: ui-plugin-manager
name: '@deepseek-ai/dsh-client-ui-plugin-manager'
+ # Connector account sections on the Plugins page; CLI app plugins and MCP
+ # connectors register their accounts with `ctx.connectorAccounts`.
+ - id: ui-connector-account
+ name: '@deepseek-ai/dsh-client-ui-connector-account'
+
# Read-only Plugin list tab in the Settings Plugins section; the built-in
# bundles the sidebar page leaves out are inspected here.
- id: ui-settings-plugin-inventory
diff --git a/packages/bundle/web-app/package.json b/packages/bundle/web-app/package.json
index 2858130d13..82ce2dd4a3 100644
--- a/packages/bundle/web-app/package.json
+++ b/packages/bundle/web-app/package.json
@@ -86,6 +86,7 @@
"@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-connector-account": "workspace:*",
"@deepseek-ai/dsh-client-ui-context-menu": "workspace:*",
"@deepseek-ai/dsh-client-ui-conversation": "workspace:*",
"@deepseek-ai/dsh-client-ui-cordis": "workspace:*",
diff --git a/packages/client/README.i18n.yaml b/packages/client/README.i18n.yaml
index f77d3835d7..54854f5f19 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: 2165938f26300774
- zh: 5f739534a8509545
+ en: affd6d8506276e34
+ zh: 92730ec91d83d609
/client-web-gui-browser-half/related-documentation:
en: d1d506e68fab7333
zh: 1a90fe6f3f8f24a9
diff --git a/packages/client/README.md b/packages/client/README.md
index 3047a181c1..6edf512eb4 100644
--- a/packages/client/README.md
+++ b/packages/client/README.md
@@ -83,6 +83,7 @@ The kernel packages boot and serve the page; the UI feature packages present it.
| [`ui-settings-subagent/`](ui-settings-subagent/README.md) | Provides the Subagent settings page on the Plugins page | — |
| [`ui-settings-web-search/`](ui-settings-web-search/README.md) | Provides the web search and fetch settings page on the Plugins page | — |
| [`ui-plugin-manager/`](ui-plugin-manager/README.md) | Contributes the sidebar Plugins panel: install, enable, disable, retry, and compose installed packages | — |
+| [`ui-connector-account/`](ui-connector-account/README.md) | Holds the accounts connector plugins register on the Host and shows each bundle's account section, tag, activation prompt, confirmations, and notices on the Plugins page | `ctx.connectorAccounts` |
| [`ui-entry-customization/`](ui-entry-customization/README.md) | Adds region-local More menus that pin or unpin plugin launchers and start a plugin draft | — |
| [`ui-plugin-market/`](ui-plugin-market/README.md) | Contributes the Discover tab to the Plugins page: browse market indexes and install their bundles | — |
| [`ui-settings-plugin-inventory/`](ui-settings-plugin-inventory/README.md) | Contributes the read-only Host Loader inventory tab to Plugins settings | — |
diff --git a/packages/client/README.zh.md b/packages/client/README.zh.md
index e327a717d9..635750069e 100644
--- a/packages/client/README.zh.md
+++ b/packages/client/README.zh.md
@@ -83,6 +83,7 @@ kind: "package-group"
| [`ui-settings-subagent/`](ui-settings-subagent/README.zh.md) | 在插件页提供子智能体设置页 | — |
| [`ui-settings-web-search/`](ui-settings-web-search/README.zh.md) | 在插件页提供网页搜索与获取设置页 | — |
| [`ui-plugin-manager/`](ui-plugin-manager/README.zh.md) | 贡献侧栏的“插件”面板:安装、启用、停用、重试与组合已安装的包 | — |
+| [`ui-connector-account/`](ui-connector-account/README.zh.md) | 保存连接器插件在 Host 上注册的账号,并在插件页显示每个插件包的账号区块、标签、开启引导、确认和提示 | `ctx.connectorAccounts` |
| [`ui-entry-customization/`](ui-entry-customization/README.zh.md) | 添加分区域的“更多”菜单,固定或收起插件入口,并开始创建插件的草稿 | — |
| [`ui-plugin-market/`](ui-plugin-market/README.zh.md) | 为“插件”页面贡献“发现”标签页:浏览市场索引并安装其中的组合包 | — |
| [`ui-settings-plugin-inventory/`](ui-settings-plugin-inventory/README.zh.md) | 向「插件」设置贡献只读的 Host Loader 清单标签页 | — |
diff --git a/packages/client/ui-connector-account/README.i18n.yaml b/packages/client/ui-connector-account/README.i18n.yaml
new file mode 100644
index 0000000000..347d021162
--- /dev/null
+++ b/packages/client/ui-connector-account/README.i18n.yaml
@@ -0,0 +1,49 @@
+# 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-connector-account/README.md
+/:
+ en: f09638e4097c52fb
+ zh: 2fb344b05a189ad0
+/deepseek-ai-dsh-client-ui-connector-account:
+ en: bdb528546ec26353
+ zh: 0dd55dbc0c8e837a
+/deepseek-ai-dsh-client-ui-connector-account/summary:
+ en: b25fc16fb18a63c1
+ zh: 4508e8a44745b08d
+/deepseek-ai-dsh-client-ui-connector-account/table-of-contents:
+ en: d152484eb41ac6b4
+ zh: 5b6bd00fce5371c3
+/deepseek-ai-dsh-client-ui-connector-account/use-this-package:
+ en: 9d8d49a0b1b3ce24
+ zh: 8eba3710036afa00
+/deepseek-ai-dsh-client-ui-connector-account/use-this-package/register-an-account:
+ en: e618281ea7721daf
+ zh: a5d5f5e307ea3435
+/deepseek-ai-dsh-client-ui-connector-account/use-this-package/present-the-section:
+ en: 73ca134d685b5872
+ zh: 05b929fd28dc955e
+/deepseek-ai-dsh-client-ui-connector-account/use-this-package/following-operations:
+ en: a9e64f316efcac3e
+ zh: d059d31b65573bf5
+/deepseek-ai-dsh-client-ui-connector-account/use-this-package/shared-copy:
+ en: f88db8d50a68a0ca
+ zh: 6169fd1ffc9c79a0
+/deepseek-ai-dsh-client-ui-connector-account/understand-the-implementation:
+ en: da424b56f995bef5
+ zh: 298fc8e50149fea5
+/deepseek-ai-dsh-client-ui-connector-account/further-exploration:
+ en: 029949903a73d283
+ zh: 6f9a8c2f7620de69
+/deepseek-ai-dsh-client-ui-connector-account/model-experience:
+ en: bdbc56a07884f8d6
+ zh: 22ca2ee613472c0b
+/deepseek-ai-dsh-client-ui-connector-account/model-experience/kv-cache-effect:
+ en: 4cd0965a7997970e
+ zh: 690e5a9d945f7f6e
+/deepseek-ai-dsh-client-ui-connector-account/known-limitations-and-deferred-work:
+ en: d2c5f54b80b86b15
+ zh: 8b637f97ac1d0223
+/deepseek-ai-dsh-client-ui-connector-account/known-limitations-and-deferred-work/dev-note:
+ en: 2ab3c4acae06850c
+ zh: bd2093ba1fdd6860
diff --git a/packages/client/ui-connector-account/README.md b/packages/client/ui-connector-account/README.md
new file mode 100644
index 0000000000..1013fb4f48
--- /dev/null
+++ b/packages/client/ui-connector-account/README.md
@@ -0,0 +1,138 @@
+---
+description: "Register a connector plugin's account on the Host with `ctx.connectorAccounts` and show its section, title tag, activation prompt, confirmations, and notices on the Plugins page through one `connectorAccounts` Remote, with the registrant's own text and the shared copy of this package."
+kind: "package-reference"
+---
+
+# @deepseek-ai/dsh-client-ui-connector-account
+
+English | [中文](README.zh.md)
+
+## Summary
+
+Connector plugins register their account on the Host with `ctx.connectorAccounts` to show it on the Plugins page: CLI app plugins register the account their vendor CLI keeps, and MCP connectors their OAuth server's account. The Host decides what the page shows and does: each registrant maps its account to a display, and the registry starts or cancels only the operations the account lists. The browser half renders each bundle's section, title tag, and activation prompt, and opens authorization pages and reports notices only in the browser that started the operation. The Web and Desktop compositions load both halves through [`dsh-web-app`](../../bundle/web-app/README.md).
+
+## Table of Contents
+
+- [Use this package](#use-this-package)
+- [Understand the implementation](#understand-the-implementation)
+- [Further Exploration](#further-exploration)
+- [Model Experience](#model-experience)
+- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
+- [Dev Note](#dev-note)
+
+-----
+
+
+## Use this package
+
+A registrant's Host row registers its account once; the registrant ships no browser code for the account.
+
+### Register an account
+
+The registrant's Host row registers its account source while the registry runs, so a composition without the registry, such as a headless profile, skips the registration:
+
+```ts ignore-check
+import type {} from '@deepseek-ai/dsh-client-ui-connector-account'
+
+export function apply(ctx: Context): void {
+ const account = new AcmeAccount(options)
+ ctx.effect(() => () => account.dispose(), 'acme: account')
+ ctx.inject(['connectorAccounts'], (scope) => {
+ scope.effect(() => scope.connectorAccounts.register({
+ key: '@acme/cli', packageName: '@acme/cli', source: account, copy,
+ operations: [{ kind: 'check' }, { kind: 'connect', notice: { en: 'Acme connected', zh: 'Acme 已连接' } }],
+ present: presentAccount,
+ }), 'acme: Plugins page account')
+ })
+}
+```
+
+- `key` identifies the account in the Remote; the page passes it back to start and cancel operations. A second registration with the same key throws.
+- `packageName` is the npm package whose bundle page carries the section and tag; a package carries at most one account. An account without one, such as a server configured in Settings, appears on no bundle page.
+- `source` is the account: its current view, change observation, a check, and starting and cancelling operations.
+- `operations` lists the kinds a page button may start, each with the optional text its success reports in the browser that started it; the registry rejects any other kind.
+- `copy` holds the section title, the hint under it, and the activation prompt's title, body, and Connect label.
+
+The registrant imports the registry's types with `import type` from the package root or `./types`. The returned disposer withdraws the account from every page.
+
+### Present the section
+
+`present(view)` maps the account view to a `ConnectorAccountDisplay`: the phase, the status line, the optional title tag, buttons, the operation Connect starts in the activation prompt, detail, notes, and failure with its untranslated diagnostic items. The registry calls it for every stream on each change, so it only maps the view. Every string is `LocalizedText`, which each browser resolves in its active language. A button carries a command: `start` with one of the registered operation kinds, `cancel` for the operation in progress, which the source ignores in a phase that is not cancellable, or `open` to reopen its authorization page. A button with `confirm` asks first and runs only after the user accepts.
+
+| Surface | Behavior |
+|---|---|
+| Section | Title, status, buttons, detail, notes, failure, and hint. Buttons are disabled while a call the section made is pending or the Host stream is down. A failure shows the registrant's text, then its diagnostic items |
+| Title tag | The display's `badge`, shown only on the enabled bundle's page or one of its row pages, and only while the display has one |
+| Activation prompt | Open while the phase is `disconnected` after the bundle is switched on; Connect opens the bundle page and starts the display's `connect` operation, if it names one. It dismisses itself once the phase settles elsewhere |
+| Notice | The latest outcome in this browser, outside the Plugins panel's lifetime: the operation's success text, or the shared failure copy with a warning icon |
+
+### Following operations
+
+Each browser opens one stream when the Web app loads, and the Host checks every account that runs no operation for each new stream; an account registered while a stream is open is checked at once. A browser follows the operation its latest start returned, from that answer until the stream delivers the operation's result. Each page the followed operation offers opens once in a new tab, over HTTPS or over HTTP on a loopback address; other browsers show the same section but open no page and report no notice. A second click before the first call answers starts nothing. A stream that fails for good shows the account service as not running with Retry, which reopens the stream once however often it is pressed. Unloading the browser half closes the stream; Host-owned operations keep running.
+
+### Shared copy
+
+The `connectorAccount` dictionary holds the copy every account shares: Close, Cancel, Retry, Later, the diagnostic label, the failure notice, and the not-running status, tag, and detail. Every other string comes from the registrant.
+
+-----
+
+
+## Understand the implementation
+
+
+Implementation internals — click to expand
+
+The Host half, `ConnectorAccounts`, is a Remote service. `register()` observes the account's source, and each `watch` stream reads every account's entry after each change, coalescing changes that arrive before the next read: the key and package, the copy, `present(view)`, the operation in progress, and the latest result with its success text. `start` and `cancel` route by key to the account's source.
+
+[`dsh-api-remotes`](../../api/remotes/README.md) mounts the generated `connectorAccounts` Remote. The browser half opens one `watch` stream through `BrowserAccounts`, whose one store holds the Host's accounts by key, whether the stream is delivering or has stopped, and the latest notice; it also remembers the operations this browser started. It registers one `plugins.detail.badge` entry and one `shell.overlay` notice for the page, and for each account with a package, `plugins.bundle.config` and `plugins.bundle.activation` keyed by the package name, all under the `connectorAccount` namespace. The buttons call `start` and `cancel` on the Remote themselves and report the started operation to `BrowserAccounts`. An account the Host drops loses its bundle entries, and unloading withdraws every entry and the stream.
+
+| File | Role |
+|---|---|
+| [`src/index.ts`](src/index.ts) | The `ctx.connectorAccounts` registry and its Remote |
+| [`src/types.ts`](src/types.ts) | Registration, source, view, display, and entry types |
+| [`src/client/index.ts`](src/client/index.ts) | The browser entry: the dictionary and the slot registrations |
+| [`src/client/state.ts`](src/client/state.ts) | The stream store, the operations this browser started, and their pages and notices |
+| [`src/client/components.tsx`](src/client/components.tsx) | The surfaces, the slot entries, and the buttons' Remote calls |
+| [`src/client/locales.ts`](src/client/locales.ts) | The shared dictionary |
+| [`src/client/types.ts`](src/client/types.ts) | Browser state, notice, Remote, and face types |
+
+
+
+-----
+
+
+## Further Exploration
+
+- [Plugin manager page](../ui-plugin-manager/README.md) — the Plugins page and its bundle slots.
+- [Client package map](../README.md) — adjacent browser UI packages.
+
+-----
+
+
+## Model Experience
+
+None, as the registry and its surfaces are Plugins page UI and add no model input. Each registrant documents the tools and skills its account enables.
+
+#### KV Cache effect
+
+None; registering or removing an account changes no model-visible text.
+
+## Known Limitations and Deferred Work
+
+
+
+- The five display phases are fixed; a registrant maps any further account state onto one of them.
+- A registrant whose Host row fails to load shows no account section; the Plugins page still lists the bundle with its load failure.
+- Each browser that loads the Web app starts a check of every idle account.
+- The Web and Desktop compositions load the registry whether or not a connector plugin is installed.
+- An authorization page that opens after the call answers can be blocked by the browser; the section's open button shows it again.
+
+
+### Dev Note
+
+
+Working context for maintainers — click to expand
+
+Host specs drive the registry with fake account sources. Client specs drive `BrowserAccounts` with a fake Remote stream, render the surfaces with the Chinese dictionary and a fake Remote, and mount the browser half against a real slot registry and locale runtime.
+
+
diff --git a/packages/client/ui-connector-account/README.zh.md b/packages/client/ui-connector-account/README.zh.md
new file mode 100644
index 0000000000..a32ed876b2
--- /dev/null
+++ b/packages/client/ui-connector-account/README.zh.md
@@ -0,0 +1,138 @@
+---
+description: "通过 `ctx.connectorAccounts` 在 Host 上注册连接器插件的账号,并经由一个 `connectorAccounts` Remote 在插件页显示其区块、标题旁标签、开启引导、确认和提示,文案来自注册方自己的文本和本包的共用文案。"
+kind: "package-reference"
+---
+
+# @deepseek-ai/dsh-client-ui-connector-account
+
+[English](README.md) | 中文
+
+## 概述
+
+连接器插件在 Host 上通过 `ctx.connectorAccounts` 注册账号,在插件页显示账号:CLI 应用插件注册其厂商 CLI 保存的账号,MCP 连接器注册其 OAuth 服务器的账号。页面显示什么、能做什么由 Host 决定:每个注册方把自己的账号映射为展示内容,注册表只启动或取消该账号列出的操作。浏览器一半渲染每个插件包的区块、标题旁标签和开启引导,并且只在发起操作的浏览器中打开授权页、报告提示。Web 与桌面端组合通过 [`dsh-web-app`](../../bundle/web-app/README.zh.md) 加载这两半。
+
+## 目录
+
+- [使用此包](#use-this-package)
+- [理解实现](#understand-the-implementation)
+- [延伸阅读](#further-exploration)
+- [模型体验](#model-experience)
+- [已知限制与后续工作](#known-limitations-and-deferred-work)
+- [开发备注](#dev-note)
+
+-----
+
+
+## 使用此包
+
+注册方的 Host 行注册一次账号;注册方不为账号提供任何浏览器代码。
+
+### 注册账号
+
+注册方的 Host 行在注册表运行时注册其账号来源,因此没有注册表的组合(如 headless profile)会跳过注册:
+
+```ts ignore-check
+import type {} from '@deepseek-ai/dsh-client-ui-connector-account'
+
+export function apply(ctx: Context): void {
+ const account = new AcmeAccount(options)
+ ctx.effect(() => () => account.dispose(), 'acme: account')
+ ctx.inject(['connectorAccounts'], (scope) => {
+ scope.effect(() => scope.connectorAccounts.register({
+ key: '@acme/cli', packageName: '@acme/cli', source: account, copy,
+ operations: [{ kind: 'check' }, { kind: 'connect', notice: { en: 'Acme connected', zh: 'Acme 已连接' } }],
+ present: presentAccount,
+ }), 'acme: Plugins page account')
+ })
+}
+```
+
+- `key` 在 Remote 中标识该账号;页面启动和取消操作时把它传回。用同一个键再次注册会抛出异常。
+- `packageName` 是其插件包页面承载区块和标签的 npm 包;一个包最多承载一个账号。没有包名的账号(如在 Settings 中配置的服务器)不出现在任何插件包页面上。
+- `source` 是账号:其当前视图、变化观察、检查,以及启动和取消操作。
+- `operations` 列出页面按钮可以启动的操作类型,每项可带该操作成功时在发起它的浏览器中报告的文本;注册表拒绝其他类型。
+- `copy` 包含区块标题、区块下方的提示,以及开启引导的标题、正文和连接按钮文案。
+
+注册方用 `import type` 从包根或 `./types` 导入注册表的类型。返回的销毁函数会把账号从所有页面撤下。
+
+### 展示区块
+
+`present(view)` 把账号视图映射为 `ConnectorAccountDisplay`:阶段、状态行、可选的标题旁标签、按钮、开启引导中“连接”启动的操作、说明、附加行,以及带不翻译诊断项的失败信息。注册表在每次变化时为每条流调用它,因此它只做视图映射。所有文案都是 `LocalizedText`,由各浏览器按当前语言解析。按钮携带一个命令:`start` 启动某个已注册的操作类型,`cancel` 取消进行中的操作(处于不可取消的阶段时来源会忽略),`open` 重新打开其授权页。带 `confirm` 的按钮会先询问,用户确认后才执行。
+
+| 界面 | 行为 |
+|---|---|
+| 区块 | 标题、状态、按钮、说明、附加行、失败信息和提示。区块发起的调用未返回,或 Host 流中断时,按钮不可用。失败时先显示注册方的文案,再显示其诊断项 |
+| 标题旁标签 | 显示 display 的 `badge`,只出现在已启用插件包的页面或其某一行的页面上,且只在 display 带有标签时显示 |
+| 开启引导 | 插件包开启后,阶段为 `disconnected` 时打开;“连接”会打开插件包页面,并在 display 给出 `connect` 时启动该操作。阶段确定为其他值后自动关闭 |
+| 提示 | 本浏览器的最新结果,不受插件面板生命周期限制:操作成功的文本,或带警告图标的共用失败文案 |
+
+### 跟随操作
+
+每个浏览器在 Web 应用加载时打开一条流,Host 为每条新流检查每个没有在运行操作的账号;流打开期间注册的账号会立即检查。浏览器跟随其最近一次启动返回的操作,从返回时起,直到流推送该操作的结果。被跟随的操作提供的每个页面只在新标签页中打开一次,只打开 HTTPS 页面或回环地址上的 HTTP 页面;其他浏览器显示同样的区块,但不打开页面,也不报告提示。第一次调用返回前的第二次点击不会启动任何操作。流永久失败时,区块显示账号服务未运行,并提供“重试”;无论按多少次,都只重新打开流一次。卸载浏览器一半会关闭流;Host 持有的操作继续运行。
+
+### 共用文案
+
+`connectorAccount` 字典包含所有账号共用的文案:关闭、取消、重试、稍后、排障信息标签、失败提示,以及未运行时的状态、标签和说明。其余文案都来自注册方。
+
+-----
+
+
+## 理解实现
+
+
+实现细节——点击展开
+
+Host 一半 `ConnectorAccounts` 是一个 Remote 服务。`register()` 观察账号来源,每条 `watch` 流在每次变化后读取每个账号的条目,并合并在下一次读取前到达的变化:键和包、文案、`present(view)`、进行中的操作,以及带成功文本的最新结果。`start` 和 `cancel` 按键路由到该账号的来源。
+
+[`dsh-api-remotes`](../../api/remotes/README.zh.md) 挂载生成的 `connectorAccounts` Remote。浏览器一半通过 `BrowserAccounts` 打开一条 `watch` 流;它的一个 store 保存按键索引的 Host 账号、流是否在推送或已停止,以及最新提示,同时记住本浏览器发起的操作。它为页面注册一个 `plugins.detail.badge` 条目和一个 `shell.overlay` 提示,并为每个带包名的账号注册以包名为键的 `plugins.bundle.config` 和 `plugins.bundle.activation`,全部使用 `connectorAccount` 命名空间。按钮自己调用 Remote 的 `start` 和 `cancel`,并把启动的操作报告给 `BrowserAccounts`。Host 撤下的账号会失去其插件包条目;卸载时撤下所有条目和流。
+
+| 文件 | 职责 |
+|---|---|
+| [`src/index.ts`](src/index.ts) | `ctx.connectorAccounts` 注册表及其 Remote |
+| [`src/types.ts`](src/types.ts) | 注册、来源、视图、display 和条目类型 |
+| [`src/client/index.ts`](src/client/index.ts) | 浏览器入口:字典和插槽注册 |
+| [`src/client/state.ts`](src/client/state.ts) | 流的 store、本浏览器发起的操作,以及它们的页面和提示 |
+| [`src/client/components.tsx`](src/client/components.tsx) | 各界面、插槽条目,以及按钮的 Remote 调用 |
+| [`src/client/locales.ts`](src/client/locales.ts) | 共用字典 |
+| [`src/client/types.ts`](src/client/types.ts) | 浏览器状态、提示、Remote 和 face 类型 |
+
+
+
+-----
+
+
+## 延伸阅读
+
+- [插件管理页](../ui-plugin-manager/README.zh.md)——插件页及其插件包插槽。
+- [客户端包地图](../README.zh.md)——相邻的浏览器 UI 包。
+
+-----
+
+
+## 模型体验
+
+无,注册表及其界面属于插件页 UI,不增加模型输入。各注册方自行说明其账号启用的工具和技能。
+
+#### KV Cache 影响
+
+无;注册或移除账号不改变任何模型可见文本。
+
+## 已知限制与后续工作
+
+
+
+- 五个显示阶段固定不变;注册方需把其他账号状态映射到其中之一。
+- Host 行加载失败的注册方不显示账号区块;插件页仍会列出该插件包及其加载失败。
+- 每个加载 Web 应用的浏览器都会触发一次对所有空闲账号的检查。
+- 无论是否安装了连接器插件,Web 与桌面端组合都会加载注册表。
+- 调用返回后才打开的授权页可能被浏览器拦截;区块中的打开按钮可以再次打开它。
+
+
+### 开发备注
+
+
+维护者工作上下文——点击展开
+
+Host 测试用假的账号来源驱动注册表。客户端测试用假的 Remote 流驱动 `BrowserAccounts`,用中文字典和假的 Remote 渲染各界面,并在真实的插槽注册表和 locale 运行时上挂载浏览器一半。
+
+
diff --git a/packages/client/ui-connector-account/locale/de.json b/packages/client/ui-connector-account/locale/de.json
new file mode 100644
index 0000000000..98f0f64dea
--- /dev/null
+++ b/packages/client/ui-connector-account/locale/de.json
@@ -0,0 +1,6 @@
+{
+ "meta": {
+ "title": "Connector-Kontoverbindung",
+ "description": "Kontobereich, Titel-Tag, Aktivierungshinweis und Benachrichtigungen auf der Seite „Plugins“ für Connector-Plugins."
+ }
+}
diff --git a/packages/client/ui-connector-account/locale/en.json b/packages/client/ui-connector-account/locale/en.json
new file mode 100644
index 0000000000..f0d6ca2f20
--- /dev/null
+++ b/packages/client/ui-connector-account/locale/en.json
@@ -0,0 +1,6 @@
+{
+ "meta": {
+ "title": "Connector account connection",
+ "description": "Account section, title tag, activation prompt, and notices on the Plugins page for connector plugins."
+ }
+}
diff --git a/packages/client/ui-connector-account/locale/es.json b/packages/client/ui-connector-account/locale/es.json
new file mode 100644
index 0000000000..90e3835555
--- /dev/null
+++ b/packages/client/ui-connector-account/locale/es.json
@@ -0,0 +1,6 @@
+{
+ "meta": {
+ "title": "Conexión de cuenta de conectores",
+ "description": "Sección de cuenta, etiqueta del título, aviso de activación y notificaciones en la página Complementos para los complementos de conectores."
+ }
+}
diff --git a/packages/client/ui-connector-account/locale/fr.json b/packages/client/ui-connector-account/locale/fr.json
new file mode 100644
index 0000000000..6aa61577ee
--- /dev/null
+++ b/packages/client/ui-connector-account/locale/fr.json
@@ -0,0 +1,6 @@
+{
+ "meta": {
+ "title": "Connexion de compte de connecteur",
+ "description": "Section de compte, étiquette de titre, invite d’activation et notifications sur la page Plugins pour les plugins de connecteur."
+ }
+}
diff --git a/packages/client/ui-connector-account/locale/ja.json b/packages/client/ui-connector-account/locale/ja.json
new file mode 100644
index 0000000000..d8a18a8135
--- /dev/null
+++ b/packages/client/ui-connector-account/locale/ja.json
@@ -0,0 +1,6 @@
+{
+ "meta": {
+ "title": "コネクターアカウント接続",
+ "description": "コネクタープラグイン向けに、「プラグイン」ページでのアカウントセクション、タイトルタグ、有効化時の案内、通知を提供します。"
+ }
+}
diff --git a/packages/client/ui-connector-account/locale/pt.json b/packages/client/ui-connector-account/locale/pt.json
new file mode 100644
index 0000000000..abec0eafe9
--- /dev/null
+++ b/packages/client/ui-connector-account/locale/pt.json
@@ -0,0 +1,6 @@
+{
+ "meta": {
+ "title": "Conexão de conta de conector",
+ "description": "Seção da conta, etiqueta do título, aviso de ativação e notificações na página Plug-ins para plugins de conector."
+ }
+}
diff --git a/packages/client/ui-connector-account/locale/ru.json b/packages/client/ui-connector-account/locale/ru.json
new file mode 100644
index 0000000000..be0914f34b
--- /dev/null
+++ b/packages/client/ui-connector-account/locale/ru.json
@@ -0,0 +1,6 @@
+{
+ "meta": {
+ "title": "Подключение аккаунта коннектора",
+ "description": "Раздел аккаунта, метка у заголовка, подсказка при включении и уведомления на странице «Плагины» для плагинов-коннекторов."
+ }
+}
diff --git a/packages/client/ui-connector-account/locale/zh.json b/packages/client/ui-connector-account/locale/zh.json
new file mode 100644
index 0000000000..af4aade6f6
--- /dev/null
+++ b/packages/client/ui-connector-account/locale/zh.json
@@ -0,0 +1,6 @@
+{
+ "meta": {
+ "title": "连接器账号连接",
+ "description": "在插件页为连接器插件提供账号区块、标题标签、开启引导与提示。"
+ }
+}
diff --git a/packages/client/ui-connector-account/package.json b/packages/client/ui-connector-account/package.json
new file mode 100644
index 0000000000..a571731e29
--- /dev/null
+++ b/packages/client/ui-connector-account/package.json
@@ -0,0 +1,96 @@
+{
+ "name": "@deepseek-ai/dsh-client-ui-connector-account",
+ "description": "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",
+ "version": "0.2.2-rc.1",
+ "publishConfig": {
+ "access": "public"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
+ "directory": "packages/client/ui-connector-account"
+ },
+ "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"
+ },
+ "./types": {
+ "types": "./lib/types/types.d.ts"
+ },
+ "./src/*": "./src/*",
+ "./package.json": "./package.json",
+ "./typert": {
+ "types": "./lib/typert.host.d.ts",
+ "default": "./lib/typert.host.js"
+ },
+ "./remote": {
+ "types": "./lib/typert.remote-client.d.ts",
+ "default": "./lib/typert.remote-client.js"
+ },
+ "./locale/*.json": "./locale/*.json"
+ },
+ "dsh": {
+ "client": {
+ "inject": [
+ "@deepseek-ai/dsh-api-remotes",
+ "@deepseek-ai/dsh-client-locale",
+ "@deepseek-ai/dsh-client-ui-layout",
+ "@deepseek-ai/dsh-client-ui-plugin-manager"
+ ],
+ "platform": "web"
+ }
+ },
+ "scripts": {
+ "bundle": "tsdown",
+ "watch": "tsdown --watch"
+ },
+ "license": "MIT",
+ "dependencies": {
+ "@deepseek-ai/dsh-typert-protocol": "workspace:*",
+ "zod": "4.6.6"
+ },
+ "peerDependencies": {
+ "@deepseek-ai/cordis": "workspace:~"
+ },
+ "devDependencies": {
+ "@deepseek-ai/cordis": "workspace:~",
+ "@deepseek-ai/dsh-api-gateway": "workspace:*",
+ "@deepseek-ai/dsh-api-remotes": "workspace:*",
+ "@deepseek-ai/dsh-brand": "workspace:*",
+ "@deepseek-ai/dsh-client-locale": "workspace:*",
+ "@deepseek-ai/dsh-client-store": "workspace:*",
+ "@deepseek-ai/dsh-client-test-runtime": "workspace:*",
+ "@deepseek-ai/dsh-client-ui-layout": "workspace:*",
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "workspace:*",
+ "@deepseek-ai/dsh-client-ui-primitives": "workspace:*",
+ "@deepseek-ai/dsh-client-ui-renderer": "workspace:*",
+ "@deepseek-ai/dsh-client-ui-slots": "workspace:*",
+ "@deepseek-ai/dsh-package-manifest": "workspace:*",
+ "@deepseek-ai/dsh-util-values": "workspace:*",
+ "@testing-library/react": "^16.3.3",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0"
+ },
+ "files": [
+ "locale/*.json",
+ "lib/index.js",
+ "lib/client.js",
+ "lib/types/**/*.d.ts",
+ "lib/types/**/*.d.ts.map",
+ "lib/**/*.js.map",
+ "lib/typert.host.js",
+ "lib/typert.host.d.ts",
+ "lib/typert.remote-client.js",
+ "lib/typert.remote-client.d.ts",
+ "lib/typert.remote-client.d.ts.map",
+ "src"
+ ]
+}
diff --git a/packages/client/ui-connector-account/src/client/ConnectorAccount.module.css b/packages/client/ui-connector-account/src/client/ConnectorAccount.module.css
new file mode 100644
index 0000000000..c15f495d50
--- /dev/null
+++ b/packages/client/ui-connector-account/src/client/ConnectorAccount.module.css
@@ -0,0 +1,51 @@
+.section {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+
+.title {
+ margin: 0 0 4px;
+ font-size: 14px;
+ line-height: 20px;
+ font-weight: 500;
+}
+
+.status {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ min-height: 28px;
+}
+
+.label {
+ font-size: 13px;
+ line-height: 20px;
+ color: var(--dsw-alias-label-primary);
+}
+
+.actions {
+ display: flex;
+ gap: 8px;
+ margin-left: auto;
+}
+
+.detail,
+.hint,
+.failure {
+ margin: 0;
+ font-size: 13px;
+ line-height: 20px;
+}
+
+.detail {
+ color: var(--dsw-alias-label-secondary);
+}
+
+.hint {
+ color: var(--dsw-alias-label-tertiary);
+}
+
+.failure {
+ color: var(--dsw-alias-state-error-primary);
+}
diff --git a/packages/client/ui-connector-account/src/client/components.tsx b/packages/client/ui-connector-account/src/client/components.tsx
new file mode 100644
index 0000000000..93bc807582
--- /dev/null
+++ b/packages/client/ui-connector-account/src/client/components.tsx
@@ -0,0 +1,337 @@
+/**
+ * The account surfaces the Plugins page shows for registered connector accounts: a bundle's section, title tag, and
+ * activation prompt, the confirmation a button asks for, and the notice, with the slot entries that read them.
+ */
+import { useEffect, useRef, useState, type ReactNode } from 'react'
+import { Button, IconWarningOutlineRegular, Modal, StateDot, Tag, Toast, type StateDotState, type TagTone } from '@deepseek-ai/dsh-client-ui-primitives'
+import type { InjectFace, PropsRuntime, Translate } from '@deepseek-ai/dsh-client-ui-slots'
+import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'
+import type { LocalizedText } from '@deepseek-ai/dsh-package-manifest'
+import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'
+import { assertNever } from '@deepseek-ai/dsh-util-values'
+import type {
+ ConnectorAccountButton, ConnectorAccountCommand, ConnectorAccountEntry, ConnectorAccountFailure, ConnectorAccountPhase,
+} from '../types.ts'
+import css from './ConnectorAccount.module.css'
+import type { ConnectorAccountKey } from './locales.ts'
+import { openAuthorizationPage } from './state.ts'
+import type { ConnectorAccountFace, ConnectorAccountNotice, ConnectorAccountsState, ConnectorBundleAccountFace } from './types.ts'
+
+type FaceProps = InjectFace & { t: Translate }
+type BundleFaceProps = InjectFace & { t: Translate }
+type Resolve = (text: LocalizedText) => string
+/** The phase a surface shows: the Host's, or `stopped` once this browser's stream failed for good. */
+type ShownPhase = ConnectorAccountPhase | 'stopped'
+
+const TONE: Record = {
+ checking: 'ongoing', connecting: 'ongoing', connected: 'done', disconnected: 'idle', unavailable: 'warning', stopped: 'warning',
+}
+
+const BADGE_TONE: Record = {
+ checking: 'outline', connecting: 'info', connected: 'success', disconnected: 'outline', unavailable: 'warning', stopped: 'warning',
+}
+
+function shownPhase(entry: ConnectorAccountEntry, stopped: boolean): ShownPhase {
+ return stopped ? 'stopped' : entry.display.phase
+}
+
+async function settle(call: Promise>): Promise {
+ const result = await call
+ if (!result.ok) throw new Error(result.error.message)
+ return result.value
+}
+
+/**
+ * Run a section button's command against the Host: start and cancel call the Remote directly, and open shows the
+ * operation's authorization page again in this browser.
+ * @param face - the Remote and the browser state the commands report to.
+ * @returns whether a call this surface made has not answered, and the runner of one account's command.
+ */
+function useAccountCommand(
+ face: Pick,
+): { readonly busy: boolean; readonly run: (entry: ConnectorAccountEntry, command: ConnectorAccountCommand) => void } {
+ const [busy, setBusy] = useState(false)
+ // A second click before the re-render still finds the first call pending.
+ const pending = useRef(false)
+ const call = (operation: () => Promise): void => {
+ if (pending.current) return
+ pending.current = true
+ setBusy(true)
+ // The Host keeps the diagnostic; the page reports one retryable outcome.
+ void operation().catch(() => { face.failed() }).finally(() => { pending.current = false; setBusy(false) })
+ }
+ const run = (entry: ConnectorAccountEntry, command: ConnectorAccountCommand): void => {
+ const { key } = entry
+ switch (command.kind) {
+ case 'start':
+ call(async () => { face.follow(key, await settle(face.remote.start(key, command.operation))) })
+ return
+ case 'cancel': {
+ const operation = entry.operation
+ if (operation !== undefined) call(async () => { await settle(face.remote.cancel(key, operation.id)) })
+ return
+ }
+ case 'open':
+ openAuthorizationPage(entry.operation?.authorizationUrl)
+ return
+ /* v8 ignore next -- closed command union */
+ default: assertNever(command)
+ }
+ }
+ return { busy, run }
+}
+
+/** What the section shows about one account in this browser. */
+export interface ConnectorAccountSectionProps {
+ readonly t: Translate
+ readonly resolveText: Resolve
+ readonly entry: ConnectorAccountEntry
+ /** Whether the Host stream is delivering. */
+ readonly linked: boolean
+ /** Whether the Host stream failed for good. */
+ readonly stopped: boolean
+ /** Whether a call the section made has not answered. */
+ readonly busy: boolean
+ readonly onCommand: (command: ConnectorAccountCommand) => void
+ readonly onRetry: () => void
+}
+
+function describe(t: Translate, failure: ConnectorAccountFailure): string | undefined {
+ const details = failure.details ?? []
+ return details.length === 0 ? undefined : t('failure.details', { details: details.join(' · ') })
+}
+
+/**
+ * The account section on a bundle page.
+ * @param props - the account, the stream state, the command and retry callbacks, and the translators.
+ * @returns the title, status line, detail, rows, failure, hint, and the confirmation a button asked for.
+ */
+export function ConnectorAccountSection(props: ConnectorAccountSectionProps): ReactNode {
+ const { t, resolveText, entry, linked, stopped, busy, onCommand, onRetry } = props
+ const [confirming, setConfirming] = useState()
+ const display = entry.display
+ const phase = shownPhase(entry, stopped)
+ // Reopening a stopped stream is the one action that does not need the Host stream.
+ const disabled = busy || (!linked && !stopped)
+ const button = (item: ConnectorAccountButton): ReactNode => {
+ const label = resolveText(item.label)
+ const onClick = item.confirm === undefined ? () => { onCommand(item.command) } : () => { setConfirming(item) }
+ return
+ }
+ const failure = stopped ? undefined : display.failure
+ const diagnostic = failure === undefined ? undefined : describe(t, failure)
+ const confirm = confirming?.confirm
+ return (
+