From 14719bb5bfd04ee0e44e8a6a38dfdaa2b2f736ed Mon Sep 17 00:00:00 2001 From: gengruilin Date: Fri, 6 Nov 2026 12:53:03 +0800 Subject: [PATCH] test(mcp): keep the OAuth world and manager profile in the MCP packages' tests Remove the dsh-mcp-testkit package. The OAuth world returns to mcp-client's tests and the manager profile to mcp-manager's tests, where mcp-manager's OAuth spec imports the OAuth world by relative path as it did before. The manager profile now also composes the `host: true` mcp-client entry the manager injects. The package's registrations, paths, and catalog rows go with it. --- docs/config-catalog.md | 1 - docs/config-catalog.zh.md | 1 - docs/module-graph.md | 2 - docs/module-graph.zh.md | 2 - packages/mcp/mcp-client/package.json | 2 +- packages/mcp/mcp-client/tests/host.spec.ts | 2 +- .../mcp-client/tests/oauth-adapter.spec.ts | 2 +- .../tests/oauth-credentials.spec.ts | 2 +- .../mcp-client/tests/oauth-fixture.ts} | 128 ++++-------------- packages/mcp/mcp-client/tests/oauth.spec.ts | 2 +- packages/mcp/mcp-manager/package.json | 3 +- .../mcp/mcp-manager/tests/composition.spec.ts | 2 +- .../mcp/mcp-manager/tests/manager.spec.ts | 2 +- packages/mcp/mcp-manager/tests/oauth.spec.ts | 3 +- .../mcp-manager/tests/profile-fixture.ts} | 30 +--- packages/test-support/README.i18n.yaml | 4 +- packages/test-support/README.md | 1 - packages/test-support/README.zh.md | 1 - .../test-support/mcp-testkit/README.i18n.yaml | 37 ----- packages/test-support/mcp-testkit/README.md | 87 ------------ .../test-support/mcp-testkit/README.zh.md | 87 ------------ .../test-support/mcp-testkit/package.json | 56 -------- .../test-support/mcp-testkit/src/index.ts | 11 -- .../mcp-testkit/tests/oauth-world.spec.ts | 11 -- .../test-support/mcp-testkit/tsconfig.json | 25 ---- pnpm-lock.yaml | 64 +-------- scripts/doc-standard.spec.ts | 1 - scripts/product-package-policy.ts | 1 - .../verify-package-readme-model-experience.ts | 1 - tsconfig.base.json | 1 - tsconfig.host.json | 1 - 31 files changed, 51 insertions(+), 522 deletions(-) rename packages/{test-support/mcp-testkit/src/oauth-world.ts => mcp/mcp-client/tests/oauth-fixture.ts} (61%) rename packages/{test-support/mcp-testkit/src/manager-profile.ts => mcp/mcp-manager/tests/profile-fixture.ts} (70%) delete mode 100644 packages/test-support/mcp-testkit/README.i18n.yaml delete mode 100644 packages/test-support/mcp-testkit/README.md delete mode 100644 packages/test-support/mcp-testkit/README.zh.md delete mode 100644 packages/test-support/mcp-testkit/package.json delete mode 100644 packages/test-support/mcp-testkit/src/index.ts delete mode 100644 packages/test-support/mcp-testkit/tests/oauth-world.spec.ts delete mode 100644 packages/test-support/mcp-testkit/tsconfig.json diff --git a/docs/config-catalog.md b/docs/config-catalog.md index 1ea9d2dd83..ed076fd864 100644 --- a/docs/config-catalog.md +++ b/docs/config-catalog.md @@ -5209,7 +5209,6 @@ Imported as libraries by other packages; a `cordis.yml` cannot load them. | `@deepseek-ai/dsh-llm-deepseek` | — | [`packages/llm/llm-deepseek/src/index.ts`](../packages/llm/llm-deepseek/src/index.ts) | | `@deepseek-ai/dsh-llm-mock-server` | — | [`packages/test-support/llm-mock-server/src/index.ts`](../packages/test-support/llm-mock-server/src/index.ts) | | `@deepseek-ai/dsh-loader-smoke` | — | [`packages/test-support/loader-smoke/src/index.ts`](../packages/test-support/loader-smoke/src/index.ts) | -| `@deepseek-ai/dsh-mcp-testkit` | — | [`packages/test-support/mcp-testkit/src/index.ts`](../packages/test-support/mcp-testkit/src/index.ts) | | `@deepseek-ai/dsh-native-command` | — | [`packages/util/native-command/src/index.ts`](../packages/util/native-command/src/index.ts) | | `@deepseek-ai/dsh-official-bundles` | — | [`packages/util/official-bundles/src/index.ts`](../packages/util/official-bundles/src/index.ts) | | `@deepseek-ai/dsh-output-retention` | — | [`packages/util/output-retention/src/index.ts`](../packages/util/output-retention/src/index.ts) | diff --git a/docs/config-catalog.zh.md b/docs/config-catalog.zh.md index fb1c66bd32..7c968c310f 100644 --- a/docs/config-catalog.zh.md +++ b/docs/config-catalog.zh.md @@ -5211,7 +5211,6 @@ export interface Config { | `@deepseek-ai/dsh-llm-deepseek` | — | [`packages/llm/llm-deepseek/src/index.ts`](../packages/llm/llm-deepseek/src/index.ts) | | `@deepseek-ai/dsh-llm-mock-server` | — | [`packages/test-support/llm-mock-server/src/index.ts`](../packages/test-support/llm-mock-server/src/index.ts) | | `@deepseek-ai/dsh-loader-smoke` | — | [`packages/test-support/loader-smoke/src/index.ts`](../packages/test-support/loader-smoke/src/index.ts) | -| `@deepseek-ai/dsh-mcp-testkit` | — | [`packages/test-support/mcp-testkit/src/index.ts`](../packages/test-support/mcp-testkit/src/index.ts) | | `@deepseek-ai/dsh-native-command` | — | [`packages/util/native-command/src/index.ts`](../packages/util/native-command/src/index.ts) | | `@deepseek-ai/dsh-official-bundles` | — | [`packages/util/official-bundles/src/index.ts`](../packages/util/official-bundles/src/index.ts) | | `@deepseek-ai/dsh-output-retention` | — | [`packages/util/output-retention/src/index.ts`](../packages/util/output-retention/src/index.ts) | diff --git a/docs/module-graph.md b/docs/module-graph.md index 936e810a91..337f1ae7a5 100644 --- a/docs/module-graph.md +++ b/docs/module-graph.md @@ -468,7 +468,6 @@ flowchart TD pkg_llm_mock_server["llm-mock-server"] pkg_llm_replay["llm-replay"] pkg_loader_smoke["loader-smoke"] - pkg_mcp_testkit["mcp-testkit"] pkg_remote_mock["remote-mock"] pkg_session_snapshot["session-snapshot"] pkg_tool_testkit["tool-testkit"] @@ -1687,7 +1686,6 @@ flowchart TD | [`storage`](../packages/storage/storage) | `storage` | — | | [`win32-process`](../packages/subprocess/win32-process) | `subprocess` | — | | [`llm-mock-server`](../packages/test-support/llm-mock-server) | `test-support` | — | -| [`mcp-testkit`](../packages/test-support/mcp-testkit) | `test-support` | — | | [`typert-generator`](../packages/typert/generator) | `typert` | — | | [`typert-protocol`](../packages/typert/protocol) | `typert` | — | | [`typert-registry`](../packages/typert/registry) | `typert` | — | diff --git a/docs/module-graph.zh.md b/docs/module-graph.zh.md index c19f88c42f..319d807a09 100644 --- a/docs/module-graph.zh.md +++ b/docs/module-graph.zh.md @@ -470,7 +470,6 @@ flowchart TD pkg_llm_mock_server["llm-mock-server"] pkg_llm_replay["llm-replay"] pkg_loader_smoke["loader-smoke"] - pkg_mcp_testkit["mcp-testkit"] pkg_remote_mock["remote-mock"] pkg_session_snapshot["session-snapshot"] pkg_tool_testkit["tool-testkit"] @@ -1689,7 +1688,6 @@ flowchart TD | [`storage`](../packages/storage/storage) | `storage` | — | | [`win32-process`](../packages/subprocess/win32-process) | `subprocess` | — | | [`llm-mock-server`](../packages/test-support/llm-mock-server) | `test-support` | — | -| [`mcp-testkit`](../packages/test-support/mcp-testkit) | `test-support` | — | | [`typert-generator`](../packages/typert/generator) | `typert` | — | | [`typert-protocol`](../packages/typert/protocol) | `typert` | — | | [`typert-registry`](../packages/typert/registry) | `typert` | — | diff --git a/packages/mcp/mcp-client/package.json b/packages/mcp/mcp-client/package.json index d02ff4c566..fc364a19f3 100644 --- a/packages/mcp/mcp-client/package.json +++ b/packages/mcp/mcp-client/package.json @@ -79,7 +79,7 @@ "@deepseek-ai/dsh-credentials": "workspace:*", "@deepseek-ai/dsh-authorization": "workspace:*", "@deepseek-ai/dsh-host-webserver": "workspace:*", - "@deepseek-ai/dsh-mcp-testkit": "workspace:*" + "@deepseek-ai/dsh-credentials-local": "workspace:*" }, "peerDependenciesMeta": { "@deepseek-ai/dsh-mcp-resources": { diff --git a/packages/mcp/mcp-client/tests/host.spec.ts b/packages/mcp/mcp-client/tests/host.spec.ts index 846bbe784a..eec8d2bdb2 100644 --- a/packages/mcp/mcp-client/tests/host.spec.ts +++ b/packages/mcp/mcp-client/tests/host.spec.ts @@ -6,7 +6,7 @@ import SystemPrompt from '@deepseek-ai/dsh-system-prompt' import Tools from '@deepseek-ai/dsh-tools' import * as McpClient from '@deepseek-ai/dsh-mcp-client' import { Config, type ServerConfigInput } from '@deepseek-ai/dsh-mcp-client' -import { authorize, oauthWorld } from '@deepseek-ai/dsh-mcp-testkit' +import { authorize, oauthWorld } from './oauth-fixture.ts' import { startHttpMcpFixture } from './http-fixture.ts' async function hosted() { diff --git a/packages/mcp/mcp-client/tests/oauth-adapter.spec.ts b/packages/mcp/mcp-client/tests/oauth-adapter.spec.ts index 46d53dc581..35c0294689 100644 --- a/packages/mcp/mcp-client/tests/oauth-adapter.spec.ts +++ b/packages/mcp/mcp-client/tests/oauth-adapter.spec.ts @@ -2,7 +2,7 @@ import { expect, it, onTestFinished, vi } from 'vitest' import type { auth } from '@modelcontextprotocol/client' import { McpOAuthAuthorization } from '../src/oauth.ts' -import { callback, captureLogs, oauthWorld, phase } from '@deepseek-ai/dsh-mcp-testkit' +import { callback, captureLogs, oauthWorld, phase } from './oauth-fixture.ts' const { sdkAuth } = vi.hoisted(() => ({ sdkAuth: vi.fn() })) vi.mock('@modelcontextprotocol/client', async importOriginal => ({ diff --git a/packages/mcp/mcp-client/tests/oauth-credentials.spec.ts b/packages/mcp/mcp-client/tests/oauth-credentials.spec.ts index 3595245be5..123a46fac0 100644 --- a/packages/mcp/mcp-client/tests/oauth-credentials.spec.ts +++ b/packages/mcp/mcp-client/tests/oauth-credentials.spec.ts @@ -5,7 +5,7 @@ import { credentialRef, parseCredentialKey, type CredentialRecord } from '@deeps import { expect, it, onTestFinished, vi } from 'vitest' import { McpOAuthCredentials, oauthFetch, oauthRecord } from '../src/oauth-credentials.ts' import { probeServer } from '../src/probe.ts' -import { authorize, oauthWorld, phase } from '@deepseek-ai/dsh-mcp-testkit' +import { authorize, oauthWorld, phase } from './oauth-fixture.ts' async function credentials() { const world = await oauthWorld() diff --git a/packages/test-support/mcp-testkit/src/oauth-world.ts b/packages/mcp/mcp-client/tests/oauth-fixture.ts similarity index 61% rename from packages/test-support/mcp-testkit/src/oauth-world.ts rename to packages/mcp/mcp-client/tests/oauth-fixture.ts index 125061b45d..e0f1b69700 100644 --- a/packages/test-support/mcp-testkit/src/oauth-world.ts +++ b/packages/mcp/mcp-client/tests/oauth-fixture.ts @@ -1,8 +1,4 @@ -/** - * A loopback OAuth authorization server and MCP endpoint with real credential, authorization, and callback services. - * - * @module - */ +/** Loopback OAuth/MCP server and real credential, authorization, and callback services. */ import { createServer, type IncomingMessage, type ServerResponse } from 'node:http' import { once } from 'node:events' import { mkdtemp, rm } from 'node:fs/promises' @@ -19,9 +15,9 @@ import Tools from '@deepseek-ai/dsh-tools' import { createMcpHandler, McpServer } from '@modelcontextprotocol/server' import { toNodeHandler, type NodeIncomingMessageLike } from '@modelcontextprotocol/node' import { z } from 'zod' -import { Config, type McpOAuthConfig, type StreamableHttpConfig } from '@deepseek-ai/dsh-mcp-client' -import { McpOAuthAuthorization } from '@deepseek-ai/dsh-mcp-client/src/oauth.ts' -import type { McpOAuthAttemptView } from '@deepseek-ai/dsh-mcp-client/types' +import { Config, type StreamableHttpConfig } from '../src/index.ts' +import { McpOAuthAuthorization } from '../src/oauth.ts' +import type { McpOAuthAttemptView } from '../src/types.ts' /** Recorded external request; token endpoints can be held by an explicit barrier. */ export interface OAuthRequest { @@ -31,50 +27,8 @@ export interface OAuthRequest { response: ServerResponse } -/** The protocol server's answers that a test may change. */ -export interface OAuthBehavior { - /** Answers token requests instead of issuing sequential tokens. */ - token?: (request: OAuthRequest) => Promise - /** Answers authenticated MCP requests with this status and optional challenge. */ - rejection?: { status: number; challenge?: string } - /** `false` answers metadata discovery with 404 and challenges without a metadata URL. */ - metadata?: false - /** Authorization endpoint the authorization-server metadata advertises. */ - authorizationEndpoint?: string - /** Resource the protected-resource metadata advertises. */ - resource?: string -} - -/** A loopback OAuth world and the services mounted for it, torn down with the calling test. */ -export interface OAuthWorld { - /** Context carrying the credential, authorization, Web server, and tool services. */ - ctx: Context - /** Streamable HTTP configuration of the world's MCP endpoint with OAuth. */ - config: StreamableHttpConfig & { oauth: McpOAuthConfig } - /** Create an authorization owner; teardown expects each owner to close cleanly. */ - owner: (options?: StreamableHttpConfig & { oauth: McpOAuthConfig }) => McpOAuthAuthorization - /** Switches that change the protocol server's answers. */ - behavior: OAuthBehavior - /** Every request the protocol server received. */ - requests: OAuthRequest[] - /** The protocol server's origin. */ - origin: string - /** Create a gate that teardown releases. */ - barrier: () => PromiseWithResolvers - /** Dynamic client registrations so far. */ - registrations: () => number - /** Token requests so far. */ - tokens: () => number -} - -/** - * Mount isolated credential, authorization, Web server, and tool services and a protocol server, with all teardown - * owned by the calling test. - * @param interactive - mount the authorization and Web server services that explicit authorization requires. - * @param webHost - host the Web server binds. - * @returns the world, whose teardown is registered with the calling test. - */ -export async function oauthWorld(interactive = true, webHost = '127.0.0.1'): Promise { +/** Mount isolated services and a protocol server, with all teardown owned by this test. */ +export async function oauthWorld(interactive = true, webHost = '127.0.0.1') { const ctx = new Context() const releases: Array<() => void> = [] const owners: McpOAuthAuthorization[] = [] @@ -82,18 +36,23 @@ export async function oauthWorld(interactive = true, webHost = '127.0.0.1'): Pro let registrationCount = 0 let tokenCount = 0 let origin = '' - const behavior: OAuthBehavior = {} + const behavior: { + token?: (request: OAuthRequest) => Promise + rejection?: { status: number; challenge?: string } + metadata?: false + authorizationEndpoint?: string + resource?: string + } = {} const mcp = createMcpHandler(({ requestInfo }) => { const server = new McpServer({ name: 'oauth-fixture', version: '1.0.0' }, { capabilities: { tools: {} } }) - server.registerTool('ping', { description: 'Replies pong.', inputSchema: z.object({}) }, () => ({ content: [{ type: 'text', text: 'pong' }] })) - server.registerTool('reject', { description: 'Echoes the request authorization in an error.', inputSchema: z.object({}) }, () => ({ + server.registerTool('ping', { description: 'Replies pong.', inputSchema: z.object({}) }, async () => ({ content: [{ type: 'text', text: 'pong' }] })) + server.registerTool('reject', { description: 'Echoes the request authorization in an error.', inputSchema: z.object({}) }, async () => ({ isError: true, content: [{ type: 'text', text: `rejected ${String(requestInfo?.headers.get('authorization'))}` }], })) return server }) const handleMcp = toNodeHandler(mcp) const server = createServer((request, response) => { - // A failing handler answers 500, so a fixture defect fails the request instead of leaving it open. void handle(request, response).catch(() => { response.writeHead(500).end() }) }) const dir = await mkdtemp(join(tmpdir(), 'dsh-mcp-oauth-')) @@ -105,7 +64,6 @@ export async function oauthWorld(interactive = true, webHost = '127.0.0.1'): Pro } finally { await mcp.close() await new Promise((resolve, reject) => { - /* v8 ignore next -- a close failure fails the test's teardown */ server.close((error) => { if (error === undefined) resolve(); else reject(error) }) server.closeAllConnections() }) @@ -113,11 +71,9 @@ export async function oauthWorld(interactive = true, webHost = '127.0.0.1'): Pro } }) async function handle(request: IncomingMessage, response: ServerResponse): Promise { - /* v8 ignore next -- a request a server receives always carries its URL */ - const path = new URL(request.url ?? '/', origin).pathname + const path = new URL(request.url!, origin).pathname const body: Buffer[] = [] if (path !== '/mcp') for await (const chunk of request) { - /* v8 ignore next -- Node yields Buffer chunks for a request without an encoding */ if (!(chunk instanceof Uint8Array)) throw new Error('Expected request bytes') body.push(Buffer.from(chunk)) } @@ -152,7 +108,6 @@ export async function oauthWorld(interactive = true, webHost = '127.0.0.1'): Pro server.listen(0, '127.0.0.1') await once(server, 'listening') const address = server.address() - /* v8 ignore next -- a listening TCP server reports an address object */ if (address === null || typeof address === 'string') throw new Error('OAuth fixture did not bind TCP') origin = `http://127.0.0.1:${String(address.port)}` await ctx.plugin(LocalCredentialProvider, { path: join(dir, 'credentials.yaml'), watch: false }) @@ -165,15 +120,14 @@ export async function oauthWorld(interactive = true, webHost = '127.0.0.1'): Pro await ctx.plugin(NativeToolExecutor) const resolved = Config({ transport: 'streamable-http', serverName: 'oauth', url: origin + '/mcp', headers: { 'x-resource-only': 'fixture-resource-secret' }, oauth: { credentialKey: 'mcp-client/oauth' }, reconnect: { enabled: false } }) - /* v8 ignore next -- the literal above resolves to a Streamable HTTP OAuth configuration */ if (resolved.transport !== 'streamable-http' || resolved.oauth === undefined) throw new Error('Missing HTTP OAuth configuration') - const config: StreamableHttpConfig & { oauth: McpOAuthConfig } = { ...resolved, oauth: resolved.oauth } + const config: StreamableHttpConfig & { oauth: NonNullable } = { ...resolved, oauth: resolved.oauth } const owner = (options = config): McpOAuthAuthorization => { const result = new McpOAuthAuthorization(ctx, options, () => undefined) owners.push(result) return result } - const barrier = (): PromiseWithResolvers => { + const barrier = () => { const gate: PromiseWithResolvers = Promise.withResolvers() releases.push(gate.resolve) return gate @@ -182,17 +136,10 @@ export async function oauthWorld(interactive = true, webHost = '127.0.0.1'): Pro registrations: () => registrationCount, tokens: () => tokenCount } } -/** - * Wait for an observed authorization phase. - * @param read - reads the current attempt view. - * @param expected - phase to wait for. - * @returns the view in that phase. - */ -export async function phase(read: () => McpOAuthAttemptView | undefined, expected: McpOAuthAttemptView['phase']): Promise { - await vi.waitFor(() => { expectPhase(read(), expected) }, { timeout: 5000 }) - const view = read() - expectPhase(view, expected) - return view +/** Wait for an observed authorization phase, failing promptly on a rejected flow. */ +export async function phase(read: () => McpOAuthAttemptView | undefined, expected: McpOAuthAttemptView['phase']) { + await vi.waitFor(() => { const view = read(); expectPhase(view, expected) }, { timeout: 5000 }) + return read()! } /** @@ -210,26 +157,15 @@ export function captureLogs(ctx: Context): string[] { return lines } -function expectPhase(view: McpOAuthAttemptView | undefined, expected: McpOAuthAttemptView['phase']): asserts view is McpOAuthAttemptView { +function expectPhase(view: McpOAuthAttemptView | undefined, expected: McpOAuthAttemptView['phase']): void { if (view?.phase !== expected) throw new Error(`Expected ${expected}, received ${JSON.stringify(view)}`) } -function present(value: T | null | undefined, what: string): T { - /* v8 ignore next -- an attempt waiting for the browser carries its authorization URL, redirect URI, and state */ - if (value === null || value === undefined) throw new Error(`OAuth attempt has no ${what}`) - return value -} - -/** - * Deliver a browser callback with the state and issuer advertised by this attempt. - * @param view - attempt view carrying the authorization URL. - * @param result - the authorization code or error the browser returns. - * @returns the callback's HTTP status. - */ -export async function callback(view: McpOAuthAttemptView, result: { code: string } | { error: string } = { code: 'fixture-code' }): Promise { - const authorization = new URL(present(view.authorizationUrl, 'authorization URL')) - const url = new URL(present(authorization.searchParams.get('redirect_uri'), 'redirect URI')) - url.searchParams.set('state', present(authorization.searchParams.get('state'), 'state')) +/** Deliver a browser callback with the state and issuer advertised by this attempt. */ +export async function callback(view: McpOAuthAttemptView, result: { code: string } | { error: string } = { code: 'fixture-code' }) { + const authorization = new URL(view.authorizationUrl!) + const url = new URL(authorization.searchParams.get('redirect_uri')!) + url.searchParams.set('state', authorization.searchParams.get('state')!) url.searchParams.set('iss', authorization.origin) for (const [key, value] of Object.entries(result)) url.searchParams.set(key, value) const response = await fetch(url) @@ -237,14 +173,10 @@ export async function callback(view: McpOAuthAttemptView, result: { code: string return response.status } -/** - * Finish one real discovery, registration, PKCE exchange, and durable grant commit. - * @param owner - authorization owner from the world. - */ -export async function authorize(owner: McpOAuthAuthorization): Promise { +/** Finish one real discovery, registration, PKCE exchange, and durable grant commit. */ +export async function authorize(owner: McpOAuthAuthorization) { await owner.start() const waiting = await phase(() => owner.current(), 'waiting-browser') - /* v8 ignore next -- a refused callback fails the helper instead of waiting for the attempt to time out */ if (await callback(waiting) !== 200) throw new Error('OAuth callback was rejected') await phase(() => owner.current(), 'authorized') } diff --git a/packages/mcp/mcp-client/tests/oauth.spec.ts b/packages/mcp/mcp-client/tests/oauth.spec.ts index b10007fcd1..9e26f00b41 100644 --- a/packages/mcp/mcp-client/tests/oauth.spec.ts +++ b/packages/mcp/mcp-client/tests/oauth.spec.ts @@ -9,7 +9,7 @@ import { probeServer } from '../src/probe.ts' import { connectionStatusIn as connectionStatusOf } from '../src/status.ts' import { McpTemplateBinding } from '../src/credentials.ts' import { McpOAuthCredentials, oauthRecord } from '../src/oauth-credentials.ts' -import { authorize, callback, captureLogs, oauthWorld, phase } from '@deepseek-ai/dsh-mcp-testkit' +import { authorize, callback, captureLogs, oauthWorld, phase } from './oauth-fixture.ts' // The HTTP request deadline is 10 s; no test relies on waiting for that deadline. describe('MCP OAuth', () => { diff --git a/packages/mcp/mcp-manager/package.json b/packages/mcp/mcp-manager/package.json index 4de2e2e211..8bb9cc0abe 100644 --- a/packages/mcp/mcp-manager/package.json +++ b/packages/mcp/mcp-manager/package.json @@ -78,7 +78,6 @@ "@deepseek-ai/dsh-hmr": "workspace:*", "@deepseek-ai/cordis-plugin-loader": "workspace:~", "@deepseek-ai/cordis-plugin-timer": "workspace:~", - "@deepseek-ai/dsh-typert-protocol": "workspace:*", - "@deepseek-ai/dsh-mcp-testkit": "workspace:*" + "@deepseek-ai/dsh-typert-protocol": "workspace:*" } } diff --git a/packages/mcp/mcp-manager/tests/composition.spec.ts b/packages/mcp/mcp-manager/tests/composition.spec.ts index abf0269115..c4a56062d1 100644 --- a/packages/mcp/mcp-manager/tests/composition.spec.ts +++ b/packages/mcp/mcp-manager/tests/composition.spec.ts @@ -7,7 +7,7 @@ import Timer from '@deepseek-ai/cordis-plugin-timer' import Hmr from '@deepseek-ai/dsh-hmr' import SystemPrompt from '@deepseek-ai/dsh-system-prompt' import ToolRuntime from '@deepseek-ai/dsh-tools' -import { managerProfile } from '@deepseek-ai/dsh-mcp-testkit' +import { managerProfile } from './profile-fixture.ts' const { MockClient, MockTransport } = vi.hoisted(() => { class MockTransport { diff --git a/packages/mcp/mcp-manager/tests/manager.spec.ts b/packages/mcp/mcp-manager/tests/manager.spec.ts index baad00a8b5..667823e9d4 100644 --- a/packages/mcp/mcp-manager/tests/manager.spec.ts +++ b/packages/mcp/mcp-manager/tests/manager.spec.ts @@ -80,7 +80,7 @@ import { apply as applyMcpClient, Config as ClientConfig } from '@deepseek-ai/ds import { connectionStatusIn as connectionStatusOf } from '@deepseek-ai/dsh-mcp-client/src/status.ts' import McpServerManager from '@deepseek-ai/dsh-mcp-manager/src/index.ts' import type { Config, McpManagedServerStatus } from '@deepseek-ai/dsh-mcp-manager/src/index.ts' -import { managerProfile } from '@deepseek-ai/dsh-mcp-testkit' +import { managerProfile } from './profile-fixture.ts' /** Minimal real credential provider: reference half backed by a map. */ class MemoryCredentials extends CredentialProvider { diff --git a/packages/mcp/mcp-manager/tests/oauth.spec.ts b/packages/mcp/mcp-manager/tests/oauth.spec.ts index b53c4841e4..ea0e2a82b0 100644 --- a/packages/mcp/mcp-manager/tests/oauth.spec.ts +++ b/packages/mcp/mcp-manager/tests/oauth.spec.ts @@ -4,7 +4,8 @@ import { ToolCallId } from '@deepseek-ai/dsh-llm' import { executeToolFixture } from '@deepseek-ai/dsh-tool-testkit' import { Client, UnauthorizedError } from '@modelcontextprotocol/client' import { McpOAuthCredentials } from '@deepseek-ai/dsh-mcp-client/src/oauth-credentials.ts' -import { callback, managerProfile, oauthWorld, phase } from '@deepseek-ai/dsh-mcp-testkit' +import { callback, oauthWorld, phase } from '../../mcp-client/tests/oauth-fixture.ts' +import { managerProfile } from './profile-fixture.ts' import type { McpManagedServerView } from '../src/types.ts' async function managed(layer: 'base' | 'user' = 'base') { diff --git a/packages/test-support/mcp-testkit/src/manager-profile.ts b/packages/mcp/mcp-manager/tests/profile-fixture.ts similarity index 70% rename from packages/test-support/mcp-testkit/src/manager-profile.ts rename to packages/mcp/mcp-manager/tests/profile-fixture.ts index 12a9f4b412..4024f66d65 100644 --- a/packages/test-support/mcp-testkit/src/manager-profile.ts +++ b/packages/mcp/mcp-manager/tests/profile-fixture.ts @@ -1,8 +1,4 @@ -/** - * The MCP manager and the MCP client host it injects, mounted through a real profile, ConfigEditor, and Loader. - * - * @module - */ +/** The MCP client host and manager configuration through a real profile, ConfigEditor, and Loader. */ import { mkdirSync, mkdtempSync, realpathSync, writeFileSync } from 'node:fs' import { rm } from 'node:fs/promises' import { tmpdir } from 'node:os' @@ -10,31 +6,20 @@ import { join } from 'node:path' import { pathToFileURL } from 'node:url' import { onTestFinished } from 'vitest' import type { Context } from '@deepseek-ai/cordis' -import Loader, { type Entry } from '@deepseek-ai/cordis-plugin-loader' +import Loader from '@deepseek-ai/cordis-plugin-loader' import { initProfile, mountRootInclude, readProfilePatches, type ProfileContext } from '@deepseek-ai/dsh-app-boot' import ConfigEditor from '@deepseek-ai/dsh-config-editor' import Settings from '@deepseek-ai/dsh-settings' import * as McpClient from '@deepseek-ai/dsh-mcp-client' -import McpServerManager from '@deepseek-ai/dsh-mcp-manager' - -/** A profile that composes the MCP client host and the manager, torn down with the calling test. */ -export interface ManagerProfile { - /** The launcher's profile context. */ - profile: ProfileContext - /** The manager entry in the context the profile started in. */ - entry: Entry - /** Start the same profile in another context and return its manager entry there. */ - start: (context: Context) => Promise -} +import McpServerManager from '../src/index.ts' /** * Mount the MCP client host and the manager from an inherited bundle and optional user patch. * @param ctx - Test context carrying tools and optional credentials. * @param options - Manager entry id, base configuration, and user overrides. - * @returns The profile, the manager entry, and a function that starts the same profile in another context, all owned - * by the test. + * @returns The profile and manager entry owned by the test. */ -export async function managerProfile(ctx: Context, options: { id?: string; base?: unknown; user?: unknown } = {}): Promise { +export async function managerProfile(ctx: Context, options: { id?: string; base?: unknown; user?: unknown } = {}) { const home = realpathSync(mkdtempSync(join(tmpdir(), 'dsh-mcp-manager-'))) const contexts: Context[] = [] onTestFinished(async () => { @@ -69,10 +54,7 @@ export async function managerProfile(ctx: Context, options: { id?: string; base? await context.plugin(Settings) await mountRootInclude(context, join(dir, 'cordis.yml'), readProfilePatches('test', profile)) await context.loader.await() - const entry = context.configEditor.entries().find(candidate => candidate.options.id === id) - /* v8 ignore next -- the bundle patch above inserts the manager entry with this id */ - if (entry === undefined) throw new Error(`MCP manager entry "${id}" is not composed`) - return entry + return context.configEditor.entries().find(entry => entry.options.id === id)! } return { profile, entry: await start(ctx), start } } diff --git a/packages/test-support/README.i18n.yaml b/packages/test-support/README.i18n.yaml index b6668c007a..4075580b2a 100644 --- a/packages/test-support/README.i18n.yaml +++ b/packages/test-support/README.i18n.yaml @@ -15,8 +15,8 @@ en: 1eb35b015a6c423f zh: a8a3dceee2c9e943 /packages-test-support/packages: - en: 0f7f6f785edef4c2 - zh: bf1b9abfb18d655f + en: 15c602cea9f84f94 + zh: d806d9eb4d958356 /packages-test-support/related-documentation: en: 938bb087afd96c3e zh: 0d51d0d7c0915602 diff --git a/packages/test-support/README.md b/packages/test-support/README.md index a1f32b0c03..a87f0a18fc 100644 --- a/packages/test-support/README.md +++ b/packages/test-support/README.md @@ -27,7 +27,6 @@ The test-support group gives repository tests deterministic, keyless ways to exe | [`session-snapshot`](session-snapshot/README.md) | Provides session-log snapshot support and protocol adapters for profile-driven tests | | [`agent-loop-testkit`](agent-loop-testkit/README.md) | Provides the shared prerequisite services for tests that exercise the concrete AgentLoop | | [`tool-testkit`](tool-testkit/README.md) | Defines tool fixtures and exercises invocation or executor behavior in tests | -| [`mcp-testkit`](mcp-testkit/README.md) | Serves a loopback MCP OAuth world and mounts the MCP manager through a real profile in tests | | [`client-runtime`](client-runtime/README.md) | Provides the jsdom slot test bench for browser feature specs | | [`remote-mock`](remote-mock/README.md) | Provides the endpoint-named Typert Remote mock and the Connection carrier face whole-client specs install | | [`loader-smoke`](loader-smoke/README.md) | Boots Loader-composed applications and drives fixture turns for smoke tests | diff --git a/packages/test-support/README.zh.md b/packages/test-support/README.zh.md index eab4aa57e5..0138f77e63 100644 --- a/packages/test-support/README.zh.md +++ b/packages/test-support/README.zh.md @@ -27,7 +27,6 @@ test-support 组为仓库测试提供确定且无须密钥的真实产品测试 | [`session-snapshot`](session-snapshot/README.zh.md) | 为 profile 驱动的测试提供 session-log 快照支持与协议适配器 | | [`agent-loop-testkit`](agent-loop-testkit/README.zh.md) | 为运行具体 AgentLoop 的测试提供共享先决服务 | | [`tool-testkit`](tool-testkit/README.zh.md) | 定义工具 fixture,并在测试中执行工具调用或执行器行为 | -| [`mcp-testkit`](mcp-testkit/README.zh.md) | 在测试中提供回环 MCP OAuth world,并经真实 profile 挂载 MCP 管理器 | | [`client-runtime`](client-runtime/README.zh.md) | 为浏览器功能测试提供 jsdom slot 测试台 | | [`remote-mock`](remote-mock/README.zh.md) | 为整体客户端测试提供端点具名的 Typert Remote mock 与它们安装的 Connection 载体面 | | [`loader-smoke`](loader-smoke/README.zh.md) | 启动由 Loader 组合的应用并驱动 fixture(测试前置数据)轮次以执行冒烟测试 | diff --git a/packages/test-support/mcp-testkit/README.i18n.yaml b/packages/test-support/mcp-testkit/README.i18n.yaml deleted file mode 100644 index 67c8be4346..0000000000 --- a/packages/test-support/mcp-testkit/README.i18n.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# 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/test-support/mcp-testkit/README.md -/: - en: 28748b37fdf578be - zh: 97b42377cbc0fd34 -/deepseek-ai-dsh-mcp-testkit: - en: f982e8ed4efbf9c2 - zh: de66389510fd1437 -/deepseek-ai-dsh-mcp-testkit/summary: - en: a487b6bf067549d4 - zh: 8ab780b12280eff8 -/deepseek-ai-dsh-mcp-testkit/table-of-contents: - en: d152484eb41ac6b4 - zh: 1db86285abf6c499 -/deepseek-ai-dsh-mcp-testkit/use-this-package: - en: e269c1b199064b16 - zh: 5edde55bd001dca3 -/deepseek-ai-dsh-mcp-testkit/understand-the-implementation: - en: 483aeab8de0204c0 - zh: 662fca7cba278bf8 -/deepseek-ai-dsh-mcp-testkit/further-exploration: - en: 14db1dc3f9ac693e - zh: f107f5b3429e1a88 -/deepseek-ai-dsh-mcp-testkit/model-experience: - en: 6702f62ee99a7bba - zh: a1595dc587eb2d55 -/deepseek-ai-dsh-mcp-testkit/model-experience/kv-cache-effect: - en: be3fa044c8f27bf0 - zh: 35fdb79b58ba91f6 -/deepseek-ai-dsh-mcp-testkit/known-limitations-and-deferred-work: - en: ad3e27b6e7754394 - zh: 675dc85edc4ec3dd -/deepseek-ai-dsh-mcp-testkit/known-limitations-and-deferred-work/dev-note: - en: e67f633dc6fe7773 - zh: e88aeb617ffb74ea diff --git a/packages/test-support/mcp-testkit/README.md b/packages/test-support/mcp-testkit/README.md deleted file mode 100644 index 1503b2e501..0000000000 --- a/packages/test-support/mcp-testkit/README.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -description: "Run MCP OAuth flows against a loopback authorization server and mount the MCP manager through a real profile in repository tests." -kind: "package-library" ---- - -# @deepseek-ai/dsh-mcp-testkit - -English | [中文](README.zh.md) - -## Summary - -Use this package in tests that need a real MCP OAuth exchange or a profile-composed MCP manager. It serves a loopback OAuth authorization server and MCP endpoint, and mounts the MCP client host and the manager through a real profile, ConfigEditor, and Loader. Tests import it as a development dependency; each fixture registers its own teardown with the running test. - -## 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 - -Add `@deepseek-ai/dsh-mcp-testkit` to the consuming package's `devDependencies`. Start an OAuth world, mount the manager on its context, and drive authorization through the manager: - -```ts -import { callback, managerProfile, oauthWorld, phase } from '@deepseek-ai/dsh-mcp-testkit' - -const world = await oauthWorld() -await managerProfile(world.ctx, { base: { servers: { oauth: { ...world.config, enabled: true } } } }) -const attempt = await world.ctx.mcpManager.startAuthorization('oauth') -``` - -`oauthWorld()` returns the world's context with credential, authorization, Web server, and tool services, a Streamable HTTP configuration that uses OAuth, an authorization owner factory, and switches that change the protocol server's token, rejection, and metadata answers. `phase()` waits for an attempt phase, `callback()` delivers the browser callback, and `authorize()` completes one authorization through an owner. `managerProfile()` composes the MCP client host and the manager from an inherited bundle and an optional user patch; its context must already carry the tool services. - ------ - - -## Understand the implementation - -
-Implementation internals — click to expand - -[`src/oauth-world.ts`](src/oauth-world.ts) answers OAuth discovery, dynamic registration, token, and MCP requests from one loopback HTTP server and records each request. [`src/manager-profile.ts`](src/manager-profile.ts) writes a temporary profile whose bundle inserts the host and manager entries, then mounts it through the Loader. Both register teardown through `onTestFinished`, so they run only inside a test. - -
- ------ - - -## Further Exploration - -- [MCP client](../../mcp/mcp-client/README.md#oauth) — OAuth connections, explicit authorization, and the MCP client host. -- [MCP manager](../../mcp/mcp-manager/README.md) — the server fleet the profile fixture mounts. -- [Test-support group map](../README.md) — sibling test utilities. - ------ - - -## Model Experience - -None, as these fixtures serve OAuth and MCP protocol traffic without assembling or sending model requests. - -#### KV Cache effect - -None; the package itself sends no provider request. - -## Known Limitations and Deferred Work - - - -- The authorization server always grants the request: it does not render consent or check the client secret, and tests change its answers through the world's switches. -- The fixtures call `onTestFinished` and therefore run only inside a Vitest test. - - -### Dev Note - -
-Working context for maintainers — click to expand - -None. - -
diff --git a/packages/test-support/mcp-testkit/README.zh.md b/packages/test-support/mcp-testkit/README.zh.md deleted file mode 100644 index 4b96dc68a6..0000000000 --- a/packages/test-support/mcp-testkit/README.zh.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -description: "在仓库测试中对着回环 OAuth 授权服务器运行 MCP OAuth 流程,并经真实 profile 挂载 MCP 管理器。" -kind: "package-library" ---- - -# @deepseek-ai/dsh-mcp-testkit - -[English](README.md) | 中文 - -## 概述 - -需要真实 MCP OAuth 交换或经 profile 组合的 MCP 管理器的测试使用本包。它提供回环 OAuth 授权服务器和 MCP 端点,并经真实 profile、ConfigEditor 和 Loader 挂载 MCP 客户端宿主与管理器。测试将其作为开发依赖导入;每个 fixture 都把自己的清理注册到当前测试。 - -## 目录 - -- [使用本包](#use-this-package) -- [理解实现](#understand-the-implementation) -- [进一步探索](#further-exploration) -- [模型体验](#model-experience) -- [已知限制与后续工作](#known-limitations-and-deferred-work) -- [开发备注](#dev-note) - ------ - - -## 使用本包 - -将 `@deepseek-ai/dsh-mcp-testkit` 加入消费包的 `devDependencies`。启动 OAuth world,在其 context 上挂载管理器,再通过管理器驱动授权: - -```ts -import { callback, managerProfile, oauthWorld, phase } from '@deepseek-ai/dsh-mcp-testkit' - -const world = await oauthWorld() -await managerProfile(world.ctx, { base: { servers: { oauth: { ...world.config, enabled: true } } } }) -const attempt = await world.ctx.mcpManager.startAuthorization('oauth') -``` - -`oauthWorld()` 返回带有凭据、授权、Web 服务器和工具服务的 world context、一份使用 OAuth 的 Streamable HTTP 配置、授权所有者工厂,以及改变协议服务器 token、拒绝和元数据应答的开关。`phase()` 等待尝试进入某个阶段,`callback()` 投递浏览器回调,`authorize()` 通过一个所有者完成一次授权。`managerProfile()` 用继承的 bundle 和可选的用户 patch 组合 MCP 客户端宿主与管理器;其 context 必须已带有工具服务。 - ------ - - -## 理解实现 - -
-实现内部细节——点击展开 - -[`src/oauth-world.ts`](src/oauth-world.ts) 由一台回环 HTTP 服务器应答 OAuth 发现、动态注册、token 和 MCP 请求,并记录每个请求。[`src/manager-profile.ts`](src/manager-profile.ts) 写出一个临时 profile,其 bundle 插入宿主与管理器条目,再经 Loader 挂载。两者都通过 `onTestFinished` 注册清理,因此只能在测试内运行。 - -
- ------ - - -## 进一步探索 - -- [MCP 客户端](../../mcp/mcp-client/README.zh.md#oauth)——OAuth 连接、显式授权与 MCP 客户端宿主。 -- [MCP 管理器](../../mcp/mcp-manager/README.zh.md)——profile fixture 挂载的服务器集合。 -- [test-support 分组地图](../README.zh.md)——同组测试工具。 - ------ - - -## 模型体验 - -无,这些 fixture 只承载 OAuth 和 MCP 协议流量,不组装或发送模型请求。 - -#### KV Cache 影响 - -无;本包自身不发送 provider 请求。 - -## 已知限制与后续工作 - - - -- 授权服务器总是批准请求:它不显示同意页、不校验客户端密钥,测试通过 world 的开关改变其应答。 -- fixture 调用 `onTestFinished`,因此只能在 Vitest 测试内运行。 - - -### 开发备注 - -
-维护者工作上下文——点击展开 - -无。 - -
diff --git a/packages/test-support/mcp-testkit/package.json b/packages/test-support/mcp-testkit/package.json deleted file mode 100644 index 6bfdaca311..0000000000 --- a/packages/test-support/mcp-testkit/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "@deepseek-ai/dsh-mcp-testkit", - "description": "MCP OAuth world and MCP manager profile fixtures for tests", - "version": "0.2.2-rc.1", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/deepseek-ai/deepseek-harness.git", - "directory": "packages/test-support/mcp-testkit" - }, - "type": "module", - "main": "lib/index.js", - "types": "lib/types/index.d.ts", - "exports": { - ".": { - "types": "./lib/types/index.d.ts", - "default": "./lib/index.js" - }, - "./src/*": "./src/*", - "./package.json": "./package.json" - }, - "files": [ - "lib/index.js", - "lib/types/**/*.d.ts", - "lib/types/**/*.d.ts.map", - "lib/**/*.js.map", - "src" - ], - "license": "MIT", - "peerDependencies": { - "@deepseek-ai/cordis": "workspace:~" - }, - "dependencies": { - "@deepseek-ai/cordis-plugin-loader": "workspace:~", - "@deepseek-ai/dsh-app-boot": "workspace:*", - "@deepseek-ai/dsh-authorization": "workspace:*", - "@deepseek-ai/dsh-config-editor": "workspace:*", - "@deepseek-ai/dsh-credentials-local": "workspace:*", - "@deepseek-ai/dsh-host-webserver": "workspace:*", - "@deepseek-ai/dsh-mcp-client": "workspace:*", - "@deepseek-ai/dsh-mcp-manager": "workspace:*", - "@deepseek-ai/dsh-settings": "workspace:*", - "@deepseek-ai/dsh-system-prompt": "workspace:*", - "@deepseek-ai/dsh-tool-executor-native": "workspace:*", - "@deepseek-ai/dsh-tools": "workspace:*", - "@modelcontextprotocol/node": "2.0.0", - "@modelcontextprotocol/server": "2.2.0", - "vitest": "^4.1.11", - "zod": "4.6.6" - }, - "devDependencies": { - "@deepseek-ai/cordis": "workspace:~" - } -} diff --git a/packages/test-support/mcp-testkit/src/index.ts b/packages/test-support/mcp-testkit/src/index.ts deleted file mode 100644 index 290afa8c9b..0000000000 --- a/packages/test-support/mcp-testkit/src/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * MCP test fixtures shared by the MCP client, the MCP manager, and connector plugins: a loopback OAuth world and a - * real profile that mounts the MCP client host and the manager. - * - * @module @deepseek-ai/dsh-mcp-testkit - */ - -export { authorize, callback, captureLogs, oauthWorld, phase } from './oauth-world.ts' -export type { OAuthBehavior, OAuthRequest, OAuthWorld } from './oauth-world.ts' -export { managerProfile } from './manager-profile.ts' -export type { ManagerProfile } from './manager-profile.ts' diff --git a/packages/test-support/mcp-testkit/tests/oauth-world.spec.ts b/packages/test-support/mcp-testkit/tests/oauth-world.spec.ts deleted file mode 100644 index 37bc4f9003..0000000000 --- a/packages/test-support/mcp-testkit/tests/oauth-world.spec.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** The loopback protocol server answers unrouted paths and fixture failures instead of leaving requests open. */ - -import { expect, it } from 'vitest' -import { oauthWorld } from '../src/index.ts' - -it('answers an unrouted path with 404 and a failing token behavior with 500', async () => { - const world = await oauthWorld(false) - expect((await fetch(world.origin + '/unrouted')).status).toBe(404) - world.behavior.token = async () => { throw new Error('fixture token failure') } - expect((await fetch(world.origin + '/token', { method: 'POST', body: 'grant_type=refresh_token' })).status).toBe(500) -}) diff --git a/packages/test-support/mcp-testkit/tsconfig.json b/packages/test-support/mcp-testkit/tsconfig.json deleted file mode 100644 index ae33f1496d..0000000000 --- a/packages/test-support/mcp-testkit/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "lib/types" - }, - "include": [ - "src" - ], - "references": [ - { "path": "../../../vendor/cordis" }, - { "path": "../../../vendor/loader" }, - { "path": "../../boot/app-boot" }, - { "path": "../../boot/config-editor" }, - { "path": "../../core/system-prompt" }, - { "path": "../../core/tool-executor-native" }, - { "path": "../../core/tools" }, - { "path": "../../credentials/authorization" }, - { "path": "../../credentials/credentials-local" }, - { "path": "../../host/webserver" }, - { "path": "../../mcp/mcp-client" }, - { "path": "../../mcp/mcp-manager" }, - { "path": "../../settings/settings" } - ] -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 478c721602..9ec79a4a55 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13816,6 +13816,9 @@ importers: '@deepseek-ai/dsh-credentials': specifier: workspace:* version: link:../../credentials/credentials + '@deepseek-ai/dsh-credentials-local': + specifier: workspace:* + version: link:../../credentials/credentials-local '@deepseek-ai/dsh-host-webserver': specifier: workspace:* version: link:../../host/webserver @@ -13828,9 +13831,6 @@ importers: '@deepseek-ai/dsh-mcp-resources': specifier: workspace:* version: link:../mcp-resources - '@deepseek-ai/dsh-mcp-testkit': - specifier: workspace:* - version: link:../../test-support/mcp-testkit '@deepseek-ai/dsh-scope': specifier: workspace:* version: link:../../core/scope @@ -13901,9 +13901,6 @@ importers: '@deepseek-ai/dsh-mcp-client': specifier: workspace:* version: link:../mcp-client - '@deepseek-ai/dsh-mcp-testkit': - specifier: workspace:* - version: link:../../test-support/mcp-testkit '@deepseek-ai/dsh-settings': specifier: workspace:* version: link:../../settings/settings @@ -17554,61 +17551,6 @@ importers: specifier: workspace:* version: link:../../core/tools - packages/test-support/mcp-testkit: - dependencies: - '@deepseek-ai/cordis-plugin-loader': - specifier: workspace:~ - version: link:../../../vendor/loader - '@deepseek-ai/dsh-app-boot': - specifier: workspace:* - version: link:../../boot/app-boot - '@deepseek-ai/dsh-authorization': - specifier: workspace:* - version: link:../../credentials/authorization - '@deepseek-ai/dsh-config-editor': - specifier: workspace:* - version: link:../../boot/config-editor - '@deepseek-ai/dsh-credentials-local': - specifier: workspace:* - version: link:../../credentials/credentials-local - '@deepseek-ai/dsh-host-webserver': - specifier: workspace:* - version: link:../../host/webserver - '@deepseek-ai/dsh-mcp-client': - specifier: workspace:* - version: link:../../mcp/mcp-client - '@deepseek-ai/dsh-mcp-manager': - specifier: workspace:* - version: link:../../mcp/mcp-manager - '@deepseek-ai/dsh-settings': - specifier: workspace:* - version: link:../../settings/settings - '@deepseek-ai/dsh-system-prompt': - specifier: workspace:* - version: link:../../core/system-prompt - '@deepseek-ai/dsh-tool-executor-native': - specifier: workspace:* - version: link:../../core/tool-executor-native - '@deepseek-ai/dsh-tools': - specifier: workspace:* - version: link:../../core/tools - '@modelcontextprotocol/node': - specifier: 2.0.0 - version: 2.0.0(@modelcontextprotocol/server@2.2.0)(hono@4.13.7) - '@modelcontextprotocol/server': - specifier: 2.2.0 - version: 2.2.0 - vitest: - specifier: ^4.1.11 - version: 4.1.11(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.11)(happy-dom@20.11.6)(jsdom@29.1.1(@noble/hashes@2.4.0))(vite@8.2.2(@types/node@22.20.1)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.13)(yaml@2.9.0)) - zod: - specifier: 4.6.6 - version: 4.6.6 - devDependencies: - '@deepseek-ai/cordis': - specifier: workspace:~ - version: link:../../../vendor/cordis - packages/test-support/remote-mock: dependencies: '@vitest/spy': diff --git a/scripts/doc-standard.spec.ts b/scripts/doc-standard.spec.ts index 568e19346a..55551497c8 100644 --- a/scripts/doc-standard.spec.ts +++ b/scripts/doc-standard.spec.ts @@ -85,7 +85,6 @@ const PACKAGE_LIBRARIES: Readonly> = { 'packages/test-support/session-snapshot': 'Test infrastructure; mounts nothing into a product composition.', 'packages/test-support/agent-loop-testkit': 'Test helper library; mounts nothing into a product composition.', 'packages/test-support/tool-testkit': 'Tool fixture library; exports helpers without a plugin entry.', - 'packages/test-support/mcp-testkit': 'MCP OAuth and manager profile fixture library; exports helpers without a plugin entry.', 'packages/test-support/client-runtime': 'Browser-side test infrastructure.', 'packages/test-support/llm-mock-server': 'Test server library; substitutes provider wire behavior.', 'packages/test-support/loader-smoke': 'Test harness library; mounts nothing into a product composition.', diff --git a/scripts/product-package-policy.ts b/scripts/product-package-policy.ts index 0591957414..d7ee247c03 100644 --- a/scripts/product-package-policy.ts +++ b/scripts/product-package-policy.ts @@ -39,7 +39,6 @@ export const PRODUCT_PACKAGE_POLICY: Readonly> = { 'packages/test-support/session-snapshot': { kind: 'none', reason: 'The test harness observes and normalizes transcripts without changing live requests.' }, 'packages/test-support/agent-loop-testkit': { kind: 'none', reason: 'The test helper mounts services but neither drives nor modifies model requests.' }, 'packages/test-support/tool-testkit': { kind: 'none', reason: 'Fixture helpers define and execute test tools without making model requests.' }, - 'packages/test-support/mcp-testkit': { kind: 'none', reason: 'OAuth and MCP protocol fixtures serve test traffic without making model requests.' }, 'packages/test-support/loader-smoke': { kind: 'none', reason: 'The test harness submits an ordinary user task but delegates prompt and tool composition to the loaded tree.' }, 'packages/test-support/llm-mock-server': { kind: 'none', reason: 'The test server substitutes provider wire behavior without invoking a real model.' }, 'packages/test-support/llm-replay': { kind: 'none', reason: 'The keyless adapter invokes no provider model.' }, diff --git a/tsconfig.base.json b/tsconfig.base.json index de064bc455..e836c926a5 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -489,7 +489,6 @@ "@deepseek-ai/dsh-mcp-client": ["./packages/mcp/mcp-client/src"], "@deepseek-ai/dsh-mcp-manager": ["./packages/mcp/mcp-manager/src"], "@deepseek-ai/dsh-mcp-resources": ["./packages/mcp/mcp-resources/src"], - "@deepseek-ai/dsh-mcp-testkit": ["./packages/test-support/mcp-testkit/src"], "@deepseek-ai/dsh-message-feedback": ["./packages/feedback/message-feedback/src"], "@deepseek-ai/dsh-message-quotes": ["./packages/session/message-quotes/src"], "@deepseek-ai/dsh-native-command": ["./packages/util/native-command/src"], diff --git a/tsconfig.host.json b/tsconfig.host.json index 055e862ec6..ad8cafa9a7 100644 --- a/tsconfig.host.json +++ b/tsconfig.host.json @@ -523,7 +523,6 @@ { "path": "./packages/guard/timeout-policy" }, { "path": "./packages/test-support/agent-loop-testkit" }, { "path": "./packages/test-support/tool-testkit" }, - { "path": "./packages/test-support/mcp-testkit" }, { "path": "./packages/acp/acp" }, { "path": "./packages/bundle/acp-app" }, { "path": "./packages/bundle/base" },