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:
gengruilin committed 2026-11-02 14:55:26 +08:00
1 parent f0cd6d0fe2
commit 180b3e6029
46 files changed
+1686 -465

No files matched your search

+3 -1
View File
@@ -64,6 +64,7 @@ export const SERVICE_PAGE: Record<string, string> = {
pluginRecommendations: 'boot.md',
pluginMarket: 'boot.md',
pluginRegistryProbe: 'boot.md',
mcpAccounts: 'boot.md',
configEditor: 'boot.md',
profileContext: 'boot.md',
hmr: 'boot.md',
@@ -205,7 +206,6 @@ export const SERVICE_WALK_EXEMPTIONS: Record<string, string> = {
commandUi: 'client-side interface-typed browser service — packages/client/ui-commands/README.md owns the API',
fileDrag: 'client-side file preparation and transfer service — packages/client/ui-file-drag/README.md owns the API',
feedbackUi: 'client-side feedback dialog service — packages/client/ui-message-feedback/README.md owns the API',
mcpAccounts: 'client-side connector account registry — packages/client/ui-mcp-account/README.md owns the API',
conversation: 'client-side interface-typed browser service — packages/client/ui-conversation/README.md owns the API',
layout: 'client-side interface-typed browser service — packages/client/ui-layout/README.md owns the API',
pluginNavigation: 'client-side bundle navigation — packages/client/ui-plugin-manager/README.md owns the API',
@@ -1005,6 +1005,8 @@ export const TYPE_LINK_EXEMPTIONS: Readonly<Record<string, string>> = {
Profile: 'resolved profile layers are owned by packages/boot/app-boot/README.md',
PatchOptions: 'Include patch entries are owned by vendor/include (vendored upstream)',
McpResourceProvider: 'scoped resource provider is owned by packages/mcp/mcp-resources/README.md',
McpAccountRegistration: 'Plugins page account registration is owned by packages/client/ui-mcp-account/README.md',
McpAccountsView: 'registered account stream item is owned by packages/client/ui-mcp-account/README.md',
'z.ZodType': 'Zod response validation API is owned by https://zod.dev/packages/zod',
Socket: 'Node.js byte stream API is owned by https://nodejs.org/api/net.html#class-netsocket',
z: 'schemastery schema constructor is owned by vendor/schemastery (vendored upstream)',
+7
View File
@@ -712,6 +712,13 @@ const SERVICE_ROLES: ServiceRole[] = [
mode: 'core',
note: 'Reconciles mcp-client instances against its volatile servers configuration, aggregates their connection statuses, and serves restart and probe to management surfaces.',
},
{
key: 'mcpAccounts',
pkg: 'client-ui-mcp-account',
title: 'MCP connector accounts on the Plugins page',
mode: 'service',
note: '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.',
},
{
key: 'schedule',
pkg: 'schedule',
@@ -151,7 +151,7 @@ const SENTENCE_MODEL_EXPERIENCE: Readonly<Record<string, SentenceContract>> = {
'packages/client/ui-conversation': { kind: 'none', reason: 'Browser-side UI plugin layer; registers nothing model-facing.' },
'packages/client/ui-approval': { kind: 'none', reason: 'Browser-side approval presentation; registers nothing model-facing.' },
'packages/client/ui-chat': { kind: 'none', reason: 'Browser-side Chat presentation; registers nothing model-facing.' },
'packages/client/ui-mcp-account': { kind: 'none', reason: 'Browser-side account controls over the MCP manager Remote; the connector and the MCP client document the tools a grant exposes.' },
'packages/client/ui-mcp-account': { kind: 'none', reason: 'Plugins page account registry and controls over the MCP manager; the connector and the MCP client document the tools a grant exposes.' },
'packages/client/ui-message-feedback': { kind: 'none', reason: 'Browser-side controls over log-only message feedback; ratings and notes never enter model context or change model-input tokens.' },
'packages/client/ui-tool': { kind: 'none', reason: 'Browser-side Tool presentation layer; renders logged calls without changing model context.' },
'packages/client/ui-schedule': { kind: 'none', reason: 'Browser-side catalog, editing, and deletion of Host Schedule records; dsh-schedule owns storage and delivery, and dsh-tool-schedule contributes the model-facing tools in a preset that mounts it.' },