diff --git a/docs/config-catalog.md b/docs/config-catalog.md index 42f7a9f360..d6046aaf56 100644 --- a/docs/config-catalog.md +++ b/docs/config-catalog.md @@ -4968,7 +4968,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` | `mcpServers` | [`packages/client/ui-mcp-account/src/index.ts`](../packages/client/ui-mcp-account/src/index.ts) | +| `@deepseek-ai/dsh-client-ui-mcp-account` | `mcpManager` | [`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) | diff --git a/docs/config-catalog.zh.md b/docs/config-catalog.zh.md index 9f330f700d..d729f28052 100644 --- a/docs/config-catalog.zh.md +++ b/docs/config-catalog.zh.md @@ -4970,7 +4970,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` | `mcpServers` | [`packages/client/ui-mcp-account/src/index.ts`](../packages/client/ui-mcp-account/src/index.ts) | +| `@deepseek-ai/dsh-client-ui-mcp-account` | `mcpManager` | [`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) | diff --git a/packages/client/ui-mcp-account/src/client/connection.ts b/packages/client/ui-mcp-account/src/client/connection.ts index b850bd18dd..6d1035e52f 100644 --- a/packages/client/ui-mcp-account/src/client/connection.ts +++ b/packages/client/ui-mcp-account/src/client/connection.ts @@ -109,7 +109,7 @@ export class McpAccountsConnection { /** * @param ctx - the browser context carrying the Remote client. * @param registry - the `mcpAccounts` Remote. - * @param servers - the manager's `mcpServers` Remote. + * @param servers - the manager's `mcpManager` Remote. */ constructor(ctx: Context, registry: McpAccountsRemote, private readonly servers: McpServersRemote) { this.stream = ctx.remote.$stream({ diff --git a/packages/client/ui-mcp-account/src/client/mount.ts b/packages/client/ui-mcp-account/src/client/mount.ts index 0edea4d504..d42f955cb8 100644 --- a/packages/client/ui-mcp-account/src/client/mount.ts +++ b/packages/client/ui-mcp-account/src/client/mount.ts @@ -42,7 +42,7 @@ function registerAccount( function showAccounts(ctx: Context): void { ctx.effect(() => ctx.locale.register(NS, { zh, en, ja, es, fr, de, ru, pt }), 'mcp-account: dictionaries') - const connection = new McpAccountsConnection(ctx, ctx.remote.mcpAccounts, ctx.remote.mcpServers) + const connection = new McpAccountsConnection(ctx, ctx.remote.mcpAccounts, ctx.remote.mcpManager) ctx.effect(() => async () => { await connection.dispose() }, 'mcp-account: connection') ctx.effect(() => { const shown = new Map void>() @@ -72,7 +72,7 @@ function showAccounts(ctx: Context): void { */ export async function mountMcpAccounts(ctx: Context, contribution: TypertRemoteContribution): Promise<() => Promise> { const unmount = await ctx.remote.$mount(contribution) - const ui = ctx.inject(['remote.mcpAccounts', 'remote.mcpServers', 'slots', 'locale'], showAccounts) + const ui = ctx.inject(['remote.mcpAccounts', 'remote.mcpManager', 'slots', 'locale'], showAccounts) try { await ui } catch (error) { await ui.dispose(); await unmount(); throw error } return async () => { await ui.dispose(); await unmount() } } diff --git a/packages/client/ui-mcp-account/src/index.ts b/packages/client/ui-mcp-account/src/index.ts index d44eace35a..82a40c3ae5 100644 --- a/packages/client/ui-mcp-account/src/index.ts +++ b/packages/client/ui-mcp-account/src/index.ts @@ -22,7 +22,7 @@ declare module '@deepseek-ai/cordis' { /** Holds the registered accounts and serves them, with their servers' manager views, to the Plugins page. */ export default class McpAccounts extends TypertRemoteService { - static inject = ['mcpServers'] + static inject = ['mcpManager'] private readonly accounts = new Map() private readonly listeners = new Set<() => void>() @@ -77,7 +77,7 @@ export default class McpAccounts extends TypertRemoteService { ended.addEventListener('abort', notify, { once: true }) const following = (async () => { try { - for await (const next of this.ctx.mcpServers.watch(ended)) { + for await (const next of this.ctx.mcpManager.watch(ended)) { servers = next notify() } diff --git a/packages/client/ui-mcp-account/tests/mount.client.spec.ts b/packages/client/ui-mcp-account/tests/mount.client.spec.ts index 7c7663f258..d46de7ca58 100644 --- a/packages/client/ui-mcp-account/tests/mount.client.spec.ts +++ b/packages/client/ui-mcp-account/tests/mount.client.spec.ts @@ -80,7 +80,7 @@ async function bench() { } new Remote() ctx.provide('remote.mcpAccounts', { watch: vi.fn() }) - ctx.provide('remote.mcpServers', { startAuthorization, cancelAuthorization: vi.fn(), signOut: vi.fn(), restart: vi.fn() }) + ctx.provide('remote.mcpManager', { startAuthorization, cancelAuthorization: vi.fn(), signOut: vi.fn(), restart: vi.fn() }) const locale = new LocaleRuntime(ctx) ctx.provide('locale', locale) await ctx.plugin(SlotRegistry) diff --git a/packages/client/ui-mcp-account/tests/registry.host.spec.ts b/packages/client/ui-mcp-account/tests/registry.host.spec.ts index 8343d898b3..f8e2b0d71d 100644 --- a/packages/client/ui-mcp-account/tests/registry.host.spec.ts +++ b/packages/client/ui-mcp-account/tests/registry.host.spec.ts @@ -56,7 +56,7 @@ function manager() { async function registry(servers = manager()) { const ctx = new Context() onTestFinished(async () => { await ctx.fiber.dispose() }) - ctx.provide('mcpServers', servers.service) + ctx.provide('mcpManager', servers.service) const fiber = ctx.plugin(McpAccounts) await fiber return { ctx, fiber, servers } diff --git a/packages/experimental/liveshare/src/endpoint-classification.ts b/packages/experimental/liveshare/src/endpoint-classification.ts index 1e5c45d521..b04b6717cc 100644 --- a/packages/experimental/liveshare/src/endpoint-classification.ts +++ b/packages/experimental/liveshare/src/endpoint-classification.ts @@ -210,9 +210,9 @@ export const VIEWER_ENDPOINT_CLASSES = { 'mcpManager/probe': 'owner-only', // owner MCP server management 'mcpManager/restart': 'owner-only', // owner MCP server management 'mcpManager/watch': 'owner-only', // owner MCP server management - 'mcpServers/startAuthorization': 'owner-only', // owner MCP server management - 'mcpServers/cancelAuthorization': 'owner-only', // owner MCP server management - 'mcpServers/signOut': 'owner-only', // owner MCP server management + 'mcpManager/startAuthorization': 'owner-only', // owner MCP server management + 'mcpManager/cancelAuthorization': 'owner-only', // owner MCP server management + 'mcpManager/signOut': 'owner-only', // owner MCP server management 'commands/execute': 'owner-only', // owner executes a slash command 'permissionPresets/catalog': 'owner-only', // owner permission presets 'userQuestions/answer': 'owner-only', // owner answers a pending question diff --git a/packages/mcp/mcp-manager/tests/composition.spec.ts b/packages/mcp/mcp-manager/tests/composition.spec.ts index f50a4b8fa8..95b0fe5377 100644 --- a/packages/mcp/mcp-manager/tests/composition.spec.ts +++ b/packages/mcp/mcp-manager/tests/composition.spec.ts @@ -124,7 +124,7 @@ describe('mcp-manager real composition', () => { ]) { await expect(ctx.settings.update('mcp', { servers })).rejects.toThrow() expect(await readFile(profile.patchPath, 'utf8')).toBe(saved) - expect(ctx.mcpServers.list()).toEqual([]) + expect(ctx.mcpManager.list()).toEqual([]) } }) @@ -136,6 +136,6 @@ describe('mcp-manager real composition', () => { transport: 'streamable-http', url: 'https://example.invalid/mcp', oauth: { credentialKey: 'mcp-client/Foo' }, enabled: false, } } })).rejects.toThrow('servers.one.oauth.credentialKey: credential key segment "Foo" must match') expect(await readFile(profile.patchPath, 'utf8')).toBe(saved) - expect(ctx.mcpServers.list()).toEqual([]) + expect(ctx.mcpManager.list()).toEqual([]) }) }) diff --git a/packages/mcp/mcp-manager/tests/oauth.spec.ts b/packages/mcp/mcp-manager/tests/oauth.spec.ts index deb924ea61..ea0e2a82b0 100644 --- a/packages/mcp/mcp-manager/tests/oauth.spec.ts +++ b/packages/mcp/mcp-manager/tests/oauth.spec.ts @@ -12,7 +12,7 @@ async function managed(layer: 'base' | 'user' = 'base') { const world = await oauthWorld() const servers = { oauth: { ...world.config, enabled: true } } await managerProfile(world.ctx, layer === 'base' ? { base: { servers } } : { base: { servers: {} }, user: { servers } }) - const manager = world.ctx.mcpServers + const manager = world.ctx.mcpManager const view = () => manager.list().find(entry => entry.name === 'oauth')! const state = async (expected: string) => { await vi.waitFor(() => { expect(view().status.state).toBe(expected) }, { timeout: 5000 }) @@ -31,7 +31,7 @@ async function managed(layer: 'base' | 'user' = 'base') { it.each(['signOut', 'restart'] as const)('notifies authorization removal from a disabled entry after %s', async (operation) => { const world = await oauthWorld() await managerProfile(world.ctx, { base: { servers: { oauth: { ...world.config, enabled: false } } } }) - const manager = world.ctx.mcpServers + const manager = world.ctx.mcpManager const view = () => manager.list()[0]! await manager.startAuthorization('oauth') expect(await callback(await phase(() => view().authorization, 'waiting-browser'))).toBe(200) @@ -50,7 +50,7 @@ it.each(['signOut', 'restart'] as const)('notifies authorization removal from a it('cancels only the selected attempt and retires authorization when a disabled entry changes', async () => { const world = await oauthWorld() await managerProfile(world.ctx, { base: { servers: { oauth: { ...world.config, enabled: false } } } }) - const manager = world.ctx.mcpServers + const manager = world.ctx.mcpManager const view = () => manager.list()[0]!.authorization const first = await manager.startAuthorization('oauth') await manager.cancelAuthorization('missing', first.id) @@ -334,7 +334,7 @@ it.each(['unauthorized', 'invalid-grant', 'scope', 'forbidden'] as const)('handl it('registers an OAuth server, streams its authorization, and redacts its access token from tool errors', async () => { const world = await oauthWorld() await managerProfile(world.ctx, { base: { servers: {} } }) - const manager = world.ctx.mcpServers + const manager = world.ctx.mcpManager manager.register('oauth', { transport: 'streamable-http', url: world.origin + '/mcp', oauth: { credentialKey: 'mcp-client/oauth' }, reconnect: { enabled: false }, }) @@ -363,8 +363,8 @@ it('registers an OAuth server, streams its authorization, and redacts its access it('refuses a registration whose OAuth credential key a configured entry already owns', async () => { const world = await oauthWorld() await managerProfile(world.ctx, { base: { servers: { configured: { ...world.config, enabled: false } } } }) - expect(() => world.ctx.mcpServers.register('registered', { + expect(() => world.ctx.mcpManager.register('registered', { transport: 'streamable-http', url: world.origin + '/mcp', oauth: { credentialKey: 'mcp-client/oauth' }, })).toThrow('OAuth credentialKey is already assigned to another server') - expect(world.ctx.mcpServers.list().map(view => view.name)).toEqual(['configured']) + expect(world.ctx.mcpManager.list().map(view => view.name)).toEqual(['configured']) })