From d867ff86ea98b7c553d9aca5e7de180fd00f91c2 Mon Sep 17 00:00:00 2001 From: cyphercodes Date: Fri, 8 May 2026 06:33:32 +0300 Subject: [PATCH] fix: add root package export barrel --- src/index.ts | 4 ++++ test/index.test.ts | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/index.ts create mode 100644 test/index.test.ts diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 000000000..fc88e51c1 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,4 @@ +export * from './types.js'; +export * from './client/index.js'; +export * from './server/index.js'; +export * from './inMemory.js'; diff --git a/test/index.test.ts b/test/index.test.ts new file mode 100644 index 000000000..656188a9c --- /dev/null +++ b/test/index.test.ts @@ -0,0 +1,15 @@ +import { describe, expect, it } from 'vitest'; + +import { Client, ErrorCode, InMemoryTransport, LATEST_PROTOCOL_VERSION, McpError, Server } from '../src/index.js'; + +describe('root package exports', () => { + it('re-exports the package root public API', () => { + expect(Client).toBeTypeOf('function'); + expect(Server).toBeTypeOf('function'); + expect(InMemoryTransport.createLinkedPair).toBeTypeOf('function'); + expect(LATEST_PROTOCOL_VERSION).toBeTypeOf('string'); + + const error = new McpError(ErrorCode.InvalidRequest, 'bad request'); + expect(error.code).toBe(ErrorCode.InvalidRequest); + }); +});