Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions packages/agent-core-v2/test/mcpCore/stubs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { randomUUID } from 'node:crypto';
import { createServer, type Server } from 'node:http';
import type { AddressInfo } from 'node:net';
import { fileURLToPath } from 'node:url';

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
Expand All @@ -17,26 +18,26 @@ import type {
ToolExecution,
} from '#/tool/toolContract';

export const fixturesDir = new URL('./fixtures/', import.meta.url).pathname;
export const stdioFixture = new URL('./fixtures/mock-stdio-server.mjs', import.meta.url).pathname;
export const cwdStdioFixture = new URL('./fixtures/cwd-stdio-server.mjs', import.meta.url).pathname;
export const slowStdioFixture = new URL('./fixtures/slow-stdio-server.mjs', import.meta.url).pathname;
export const slowToolStdioFixture = new URL(
'./fixtures/slow-tool-stdio-server.mjs',
import.meta.url,
).pathname;
export const hangingListStdioFixture = new URL(
'./fixtures/hanging-list-stdio-server.mjs',
import.meta.url,
).pathname;
export const crashAfterConnectFixture = new URL(
'./fixtures/crash-after-connect-stdio-server.mjs',
import.meta.url,
).pathname;
export const stderrThenExitFixture = new URL(
'./fixtures/stderr-then-exit-stdio-server.mjs',
import.meta.url,
).pathname;
export const fixturesDir = fileURLToPath(new URL('./fixtures/', import.meta.url));
export const stdioFixture = fileURLToPath(new URL('./fixtures/mock-stdio-server.mjs', import.meta.url));
export const cwdStdioFixture = fileURLToPath(
new URL('./fixtures/cwd-stdio-server.mjs', import.meta.url),
);
export const slowStdioFixture = fileURLToPath(
new URL('./fixtures/slow-stdio-server.mjs', import.meta.url),
);
export const slowToolStdioFixture = fileURLToPath(
new URL('./fixtures/slow-tool-stdio-server.mjs', import.meta.url),
);
export const hangingListStdioFixture = fileURLToPath(
new URL('./fixtures/hanging-list-stdio-server.mjs', import.meta.url),
);
export const crashAfterConnectFixture = fileURLToPath(
new URL('./fixtures/crash-after-connect-stdio-server.mjs', import.meta.url),
);
export const stderrThenExitFixture = fileURLToPath(
new URL('./fixtures/stderr-then-exit-stdio-server.mjs', import.meta.url),
);

export function createMemoryMcpOAuthStore(): McpOAuthStore {
const data = new Map<string, unknown>();
Expand Down
Loading