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
@@ -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