refactor(ui-mcp-account): register connector accounts on the Host
Connector plugins register their OAuth server's account with the Host service ctx.mcpAccounts instead of a browser registry: the server name, the bundle package, and the text that names the service as LocalizedText. The registry serves every account with the MCP manager's view of its server through one mcpAccounts Remote; authorization, cancellation, sign-out, and restart stay on the manager's Remote. One browser half follows that stream, renders each account's section, tag, activation guidance, and notices with the connector's text and the 26 strings every connector shares, and keeps authorization page opening, notices, and the pending-action guard per browser. Connectors no longer need a browser half or their own dictionary for the account.
This commit is contained in:
1 parent
f0cd6d0fe2
commit
180b3e6029
46 files changed
+1686
-465
No files matched your search
@@ -6,5 +6,5 @@
|
||||
en: 41d772192075e133
|
||||
zh: 5ef3da69b4de1d8a
|
||||
/capability-seams-and-core-services:
|
||||
en: dae89a01efc7619c
|
||||
zh: db87a92296ba84ab
|
||||
en: 127bf10f09f4f2bc
|
||||
zh: 0e3e9dfdd9b9a74e
|
||||
@@ -212,6 +212,8 @@ flowchart LR
|
||||
pkg_sdk_minimal["sdk-minimal"]
|
||||
pkg_mcp_manager["mcp-manager"]
|
||||
svc_mcpServers["ctx.mcpServers<br/>Settings-driven MCP server fleet"]
|
||||
pkg_client_ui_mcp_account["client-ui-mcp-account"]
|
||||
svc_mcpAccounts["ctx.mcpAccounts<br/>MCP connector accounts on the Plugins page"]
|
||||
pkg_schedule["schedule"]
|
||||
svc_schedule["ctx.schedule<br/>Host scheduled messages"]
|
||||
pkg_goal["goal"]
|
||||
@@ -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_mcp_account --> svc_mcpAccounts
|
||||
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
|
||||
pkg_command_feedback --> svc_sessionFeedback
|
||||
pkg_commands --> svc_commands
|
||||
@@ -730,6 +733,7 @@ flowchart LR
|
||||
| `ctx.agentDefaultModel` | `core` | [`agent-default-model`](../packages/core/agent-default-model) | - | [`api-session-controller`](../packages/api/session-controller), [`headless`](../packages/bundle/headless) | - | Reads the default ModelSelection from volatile Config and saves selections through the profile editor. |
|
||||
| `ctx.agentLoop` | `bundle` | [`agent-loop`](../packages/core/agent-loop) | - | [`base`](../packages/bundle/base), [`sdk-minimal`](../packages/bundle/sdk-minimal) | - | The one concrete loop plugin; extension packages depend on dsh-agent events and services, not on this package. |
|
||||
| `ctx.mcpServers` | `core` | [`mcp-manager`](../packages/mcp/mcp-manager) | - | - | - | Reconciles mcp-client instances against its volatile servers configuration, aggregates their connection statuses, and serves restart and probe to management surfaces. |
|
||||
| `ctx.mcpAccounts` | `service` | [`client-ui-mcp-account`](../packages/client/ui-mcp-account) | - | - | - | Holds the accounts MCP connector plugins register and serves them, with the manager's view of each server, to the Plugins page through one Remote; authorization runs through the manager. |
|
||||
| `ctx.schedule` | `core` | [`schedule`](../packages/schedule/schedule) | - | - | - | Stores tasks independently of Session activation and queues due messages in each task's target Session. |
|
||||
| `ctx.goals` | `core` | [`goal`](../packages/goal/goal) | - | - | - | Folds revisioned objective state from the session log and keeps live continuation activation process-local. |
|
||||
| `ctx.ssh` | `core` | [`ssh`](../packages/ssh/ssh) | - | [`fs-ssh`](../packages/ssh/fs-ssh), [`subprocess-ssh`](../packages/ssh/subprocess-ssh), [`sandbox-ssh`](../packages/ssh/sandbox-ssh) | - | Owns one authenticated OpenSSH connection, installed helper identity, independent program streams and disconnect cleanup for the paired remote providers. |
|
||||
|
||||
@@ -214,6 +214,8 @@ flowchart LR
|
||||
pkg_sdk_minimal["sdk-minimal"]
|
||||
pkg_mcp_manager["mcp-manager"]
|
||||
svc_mcpServers["ctx.mcpServers<br/>Settings-driven MCP server fleet"]
|
||||
pkg_client_ui_mcp_account["client-ui-mcp-account"]
|
||||
svc_mcpAccounts["ctx.mcpAccounts<br/>MCP connector accounts on the Plugins page"]
|
||||
pkg_schedule["schedule"]
|
||||
svc_schedule["ctx.schedule<br/>Host scheduled messages"]
|
||||
pkg_goal["goal"]
|
||||
@@ -348,6 +350,7 @@ flowchart LR
|
||||
pkg_client_file_upload --> svc_fileUploads
|
||||
pkg_client_modules --> svc_clientModules
|
||||
pkg_client_product_analytics --> svc_productAnalytics
|
||||
pkg_client_ui_mcp_account --> svc_mcpAccounts
|
||||
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
|
||||
pkg_command_feedback --> svc_sessionFeedback
|
||||
pkg_commands --> svc_commands
|
||||
@@ -732,6 +735,7 @@ flowchart LR
|
||||
| `ctx.agentDefaultModel` | `core` | [`agent-default-model`](../packages/core/agent-default-model) | - | [`api-session-controller`](../packages/api/session-controller), [`headless`](../packages/bundle/headless) | - | Reads the default ModelSelection from volatile Config and saves selections through the profile editor. |
|
||||
| `ctx.agentLoop` | `bundle` | [`agent-loop`](../packages/core/agent-loop) | - | [`base`](../packages/bundle/base), [`sdk-minimal`](../packages/bundle/sdk-minimal) | - | 唯一的具体循环插件;扩展包依赖 dsh-agent 的事件和服务,而不依赖此包。 |
|
||||
| `ctx.mcpServers` | `core` | [`mcp-manager`](../packages/mcp/mcp-manager) | - | - | - | 依据自身 volatile servers 配置对账 mcp-client 实例,聚合它们的连接状态,并向管理界面提供 restart 与 probe。 |
|
||||
| `ctx.mcpAccounts` | `service` | [`client-ui-mcp-account`](../packages/client/ui-mcp-account) | - | - | - | 保存 MCP 连接器插件注册的账号,并通过一个 Remote 把账号连同管理器对各服务器的视图提供给插件页;授权经由管理器完成。 |
|
||||
| `ctx.schedule` | `core` | [`schedule`](../packages/schedule/schedule) | - | - | - | 独立于 Session 的加载状态存储任务,并将到期消息排入每个任务的目标 Session。 |
|
||||
| `ctx.goals` | `core` | [`goal`](../packages/goal/goal) | - | - | - | 从会话日志折叠带修订版本的目标状态,并将实时延续激活保留在进程本地。 |
|
||||
| `ctx.ssh` | `core` | [`ssh`](../packages/ssh/ssh) | - | [`fs-ssh`](../packages/ssh/fs-ssh), [`subprocess-ssh`](../packages/ssh/subprocess-ssh), [`sandbox-ssh`](../packages/ssh/sandbox-ssh) | - | 负责一条经过认证的 OpenSSH 连接、已安装辅助程序身份、独立程序流,以及配套远端提供方的断连清理。 |
|
||||
|
||||
@@ -4954,7 +4954,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
|
||||
| `@deepseek-ai/dsh-client-ui-input-trigger` | — | [`packages/client/ui-input-trigger/src/index.ts`](../packages/client/ui-input-trigger/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-jobs` | — | [`packages/client/ui-jobs/src/index.ts`](../packages/client/ui-jobs/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-layout` | — | [`packages/client/ui-layout/src/index.ts`](../packages/client/ui-layout/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-mcp-account` | — | [`packages/client/ui-mcp-account/src/index.ts`](../packages/client/ui-mcp-account/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-mcp-account` | `mcpServers` | [`packages/client/ui-mcp-account/src/index.ts`](../packages/client/ui-mcp-account/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-message-feedback` | — | [`packages/client/ui-message-feedback/src/index.ts`](../packages/client/ui-message-feedback/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-model-selection` | — | [`packages/client/ui-model-selection/src/index.ts`](../packages/client/ui-model-selection/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-open-in-app` | — | [`packages/client/ui-open-in-app/src/index.ts`](../packages/client/ui-open-in-app/src/index.ts) |
|
||||
|
||||
@@ -4956,7 +4956,7 @@ export interface Config {
|
||||
| `@deepseek-ai/dsh-client-ui-input-trigger` | — | [`packages/client/ui-input-trigger/src/index.ts`](../packages/client/ui-input-trigger/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-jobs` | — | [`packages/client/ui-jobs/src/index.ts`](../packages/client/ui-jobs/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-layout` | — | [`packages/client/ui-layout/src/index.ts`](../packages/client/ui-layout/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-mcp-account` | — | [`packages/client/ui-mcp-account/src/index.ts`](../packages/client/ui-mcp-account/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-mcp-account` | `mcpServers` | [`packages/client/ui-mcp-account/src/index.ts`](../packages/client/ui-mcp-account/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-message-feedback` | — | [`packages/client/ui-message-feedback/src/index.ts`](../packages/client/ui-message-feedback/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-model-selection` | — | [`packages/client/ui-model-selection/src/index.ts`](../packages/client/ui-model-selection/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-open-in-app` | — | [`packages/client/ui-open-in-app/src/index.ts`](../packages/client/ui-open-in-app/src/index.ts) |
|
||||
|
||||
@@ -195,6 +195,33 @@ async reconcileProfile(requiredIds: readonly string[] = []): Promise<ProfileReco
|
||||
|
||||
Source: [`packages/boot/hmr/src/index.ts`](../../packages/boot/hmr/src/index.ts)
|
||||
|
||||
<a id="ctxmcpaccounts--mcpaccounts"></a>
|
||||
|
||||
### `ctx.mcpAccounts` — `McpAccounts`
|
||||
|
||||
Holds the registered accounts and serves them, with their servers' manager views, 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 server name, the bundle package, and the connector's text.
|
||||
* @returns an idempotent disposer that withdraws the account.
|
||||
* @throws when another account already uses the package or the server.
|
||||
*/
|
||||
register(registration: McpAccountRegistration): () => void
|
||||
|
||||
/**
|
||||
* Follow every registered account with the manager's view of its server.
|
||||
* @param signal - the Client's observation lifetime; disposal also ends the stream.
|
||||
* @returns the accounts once the manager lists its servers, then after each change of either, coalescing changes that
|
||||
* arrive before the next read; ends with the manager's stream.
|
||||
* @throws what the manager's stream throws.
|
||||
*/
|
||||
@Remote({ mode: 'stream' }) async *watch(signal: AbortSignal): AsyncIterable<McpAccountsView>
|
||||
```
|
||||
|
||||
Source: [`packages/client/ui-mcp-account/src/index.ts`](../../packages/client/ui-mcp-account/src/index.ts)
|
||||
|
||||
<a id="ctxpluginmanager--pluginmanager"></a>
|
||||
|
||||
### `ctx.pluginManager` — `PluginManager`
|
||||
|
||||
@@ -195,6 +195,33 @@ async reconcileProfile(requiredIds: readonly string[] = []): Promise<ProfileReco
|
||||
|
||||
Source: [`packages/boot/hmr/src/index.ts`](../../packages/boot/hmr/src/index.ts)
|
||||
|
||||
<a id="ctxmcpaccounts--mcpaccounts"></a>
|
||||
|
||||
### `ctx.mcpAccounts` — `McpAccounts`
|
||||
|
||||
Holds the registered accounts and serves them, with their servers' manager views, 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 server name, the bundle package, and the connector's text.
|
||||
* @returns an idempotent disposer that withdraws the account.
|
||||
* @throws when another account already uses the package or the server.
|
||||
*/
|
||||
register(registration: McpAccountRegistration): () => void
|
||||
|
||||
/**
|
||||
* Follow every registered account with the manager's view of its server.
|
||||
* @param signal - the Client's observation lifetime; disposal also ends the stream.
|
||||
* @returns the accounts once the manager lists its servers, then after each change of either, coalescing changes that
|
||||
* arrive before the next read; ends with the manager's stream.
|
||||
* @throws what the manager's stream throws.
|
||||
*/
|
||||
@Remote({ mode: 'stream' }) async *watch(signal: AbortSignal): AsyncIterable<McpAccountsView>
|
||||
```
|
||||
|
||||
Source: [`packages/client/ui-mcp-account/src/index.ts`](../../packages/client/ui-mcp-account/src/index.ts)
|
||||
|
||||
<a id="ctxpluginmanager--pluginmanager"></a>
|
||||
|
||||
### `ctx.pluginManager` — `PluginManager`
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
en: 5c0aa5a2e528af97
|
||||
zh: ae2ba2297294e3de
|
||||
/mcp/configuration:
|
||||
en: 48fd114f7abcf18e
|
||||
zh: aca729611bac5997
|
||||
en: 4a164aa382a55d28
|
||||
zh: de7794f817f2cf32
|
||||
/mcp/responsibilities-and-scope:
|
||||
en: 1cd19cd40c8b010c
|
||||
zh: 37c9cdbc9e3edba0
|
||||
|
||||
@@ -23,7 +23,7 @@ Model Context Protocol (MCP) connects the model to tools supplied by external se
|
||||
|
||||
MCP servers are opt-in. Configure one `@deepseek-ai/dsh-mcp-client` entry per server in the intended Cordis scope. Every shipped profile supplies the [tool registry](tools.md) and mounts the shared resource service once; users configure only client entries. Callers with no visible configured server receive no MCP prompt text or tools in native or PTC mode.
|
||||
|
||||
The Web and Desktop profiles also mount the [MCP server manager](../../packages/mcp/mcp-manager/README.md) once. It runs servers configured through Settings and servers that installed plugins register for their own lifetime, and serves their status, restart, and probe operations to Remote clients. A plugin that registers an OAuth server shows its account on the **Plugins** page through [`ui-mcp-account`](../../packages/client/ui-mcp-account/README.md).
|
||||
The Web and Desktop profiles also mount the [MCP server manager](../../packages/mcp/mcp-manager/README.md) once. It runs servers configured through Settings and servers that installed plugins register for their own lifetime, and serves their status, restart, and probe operations to Remote clients. A plugin that registers an OAuth server registers its account with `ctx.mcpAccounts` from [`ui-mcp-account`](../../packages/client/ui-mcp-account/README.md) to show it on the **Plugins** page.
|
||||
|
||||
| Choice | Configuration owner |
|
||||
|---|---|
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
MCP 服务器需要主动配置。在目标 Cordis 作用域中,为每台服务器配置一个 `@deepseek-ai/dsh-mcp-client` 条目。每个随附 profile 都提供[工具注册表](tools.zh.md),并统一挂载共享资源服务一次;用户只需配置客户端条目。调用方没有可见的已配置服务器时,在 native 或 PTC 模式下都不会获得 MCP 提示词文本或工具。
|
||||
|
||||
Web 与 Desktop profile 还统一挂载一次 [MCP 服务器管理器](../../packages/mcp/mcp-manager/README.zh.md)。它运行通过 Settings 配置的服务器,以及已安装插件在自身生命周期内注册的服务器,并向 Remote 客户端提供它们的状态、重启与探测操作。注册 OAuth 服务器的插件通过 [`ui-mcp-account`](../../packages/client/ui-mcp-account/README.zh.md) 在**插件**页面显示账号。
|
||||
Web 与 Desktop profile 还统一挂载一次 [MCP 服务器管理器](../../packages/mcp/mcp-manager/README.zh.md)。它运行通过 Settings 配置的服务器,以及已安装插件在自身生命周期内注册的服务器,并向 Remote 客户端提供它们的状态、重启与探测操作。注册 OAuth 服务器的插件通过 [`ui-mcp-account`](../../packages/client/ui-mcp-account/README.zh.md) 的 `ctx.mcpAccounts` 注册账号,使其显示在**插件**页面上。
|
||||
|
||||
| 选择 | 配置维护位置 |
|
||||
|---|---|
|
||||
|
||||
Reference in new issue
Block a user