chore: switch to module ESNext + moduleResolution bundler (#2095)
This commit is contained in:
parent
c59dc3aa1a
commit
ee732d64b6
9 changed files with 668 additions and 863 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import * as z from 'zod/v4';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { completable, getCompleter } from '../../src/server/completable.js';
|
||||
import { completable, getCompleter } from '../../src/server/completable';
|
||||
|
||||
describe('completable with Zod v4', () => {
|
||||
it('preserves types and values of underlying schema', () => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { JsonSchemaType, JsonSchemaValidatorResult, jsonSchemaValidator } from '@modelcontextprotocol/core';
|
||||
import { InMemoryTransport, LATEST_PROTOCOL_VERSION } from '@modelcontextprotocol/core';
|
||||
import { fromJsonSchema } from '../../src/fromJsonSchema.js';
|
||||
import { Server } from '../../src/server/server.js';
|
||||
import { fromJsonSchema } from '../../src/fromJsonSchema';
|
||||
import { Server } from '../../src/server/server';
|
||||
|
||||
class RecordingValidator implements jsonSchemaValidator {
|
||||
schemas: JsonSchemaType[] = [];
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import type { JSONRPCMessage } from '@modelcontextprotocol/core';
|
|||
import { InMemoryTransport, isStandardSchema, LATEST_PROTOCOL_VERSION } from '@modelcontextprotocol/core';
|
||||
import { describe, expect, expectTypeOf, it, vi } from 'vitest';
|
||||
import * as z from 'zod/v4';
|
||||
import { McpServer } from '../../src/index.js';
|
||||
import type { InferRawShape } from '../../src/server/mcp.js';
|
||||
import { completable } from '../../src/server/completable.js';
|
||||
import { McpServer } from '../../src/index';
|
||||
import type { InferRawShape } from '../../src/server/mcp';
|
||||
import { completable } from '../../src/server/completable';
|
||||
|
||||
describe('registerTool/registerPrompt accept raw Zod shape (auto-wrapped)', () => {
|
||||
it('registerTool accepts a raw shape for inputSchema and auto-wraps it', () => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { Icon, JSONRPCMessage } from '@modelcontextprotocol/core';
|
||||
import { InMemoryTransport, LATEST_PROTOCOL_VERSION } from '@modelcontextprotocol/core';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { McpServer, ResourceTemplate } from '../../src/index.js';
|
||||
import { McpServer, ResourceTemplate } from '../../src/index';
|
||||
|
||||
const ICONS: Icon[] = [
|
||||
{ src: 'https://example.com/icon.png', mimeType: 'image/png', sizes: ['48x48', '96x96'] },
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import {
|
|||
LATEST_PROTOCOL_VERSION,
|
||||
SUPPORTED_PROTOCOL_VERSIONS
|
||||
} from '@modelcontextprotocol/core';
|
||||
import { Server } from '../../src/server/server.js';
|
||||
import { Server } from '../../src/server/server';
|
||||
|
||||
/** An older protocol version the server supports out of the box. */
|
||||
const OLDER_SUPPORTED_VERSION = '2025-03-26';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Readable, Writable } from 'node:stream';
|
|||
import type { JSONRPCMessage } from '@modelcontextprotocol/core';
|
||||
import { ReadBuffer, serializeMessage } from '@modelcontextprotocol/core';
|
||||
|
||||
import { StdioServerTransport } from '../../src/server/stdio.js';
|
||||
import { StdioServerTransport } from '../../src/server/stdio';
|
||||
|
||||
let input: Readable;
|
||||
let outputBuffer: ReadBuffer;
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ import { randomUUID } from 'node:crypto';
|
|||
import type { CallToolResult, JSONRPCErrorResponse, JSONRPCMessage } from '@modelcontextprotocol/core';
|
||||
import * as z from 'zod/v4';
|
||||
|
||||
import { McpServer } from '../../src/server/mcp.js';
|
||||
import type { EventId, EventStore, StreamId } from '../../src/server/streamableHttp.js';
|
||||
import { WebStandardStreamableHTTPServerTransport } from '../../src/server/streamableHttp.js';
|
||||
import { McpServer } from '../../src/server/mcp';
|
||||
import type { EventId, EventStore, StreamId } from '../../src/server/streamableHttp';
|
||||
import { WebStandardStreamableHTTPServerTransport } from '../../src/server/streamableHttp';
|
||||
|
||||
/**
|
||||
* Common test messages
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import { randomUUID } from 'node:crypto';
|
|||
|
||||
import type { JSONRPCMessage, MessageExtraInfo } from '@modelcontextprotocol/core';
|
||||
|
||||
import { McpServer } from '../../src/server/mcp.js';
|
||||
import type { EventId, EventStore, StreamId } from '../../src/server/streamableHttp.js';
|
||||
import { WebStandardStreamableHTTPServerTransport } from '../../src/server/streamableHttp.js';
|
||||
import { McpServer } from '../../src/server/mcp';
|
||||
import type { EventId, EventStore, StreamId } from '../../src/server/streamableHttp';
|
||||
import { WebStandardStreamableHTTPServerTransport } from '../../src/server/streamableHttp';
|
||||
|
||||
/**
|
||||
* Gate-closure tests for the two protocol-version checks that guard
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import { randomUUID } from 'node:crypto';
|
|||
import type { JSONRPCMessage } from '@modelcontextprotocol/core';
|
||||
import { SUPPORTED_PROTOCOL_VERSIONS } from '@modelcontextprotocol/core';
|
||||
|
||||
import { McpServer } from '../../src/server/mcp.js';
|
||||
import { WebStandardStreamableHTTPServerTransport } from '../../src/server/streamableHttp.js';
|
||||
import { McpServer } from '../../src/server/mcp';
|
||||
import { WebStandardStreamableHTTPServerTransport } from '../../src/server/streamableHttp';
|
||||
|
||||
/**
|
||||
* Wire-level continuity tests for the "Unsupported protocol version" rejection.
|
||||
|
|
|
|||
Loading…
Reference in a new issue