-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(compat): re-export StreamableHTTPServerTransport + EventStore types from /node #1904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@modelcontextprotocol/node': patch | ||
| --- | ||
|
|
||
| Add v1-compat re-exports: `StreamableHTTPServerTransport` (alias for `NodeStreamableHTTPServerTransport`) and the `EventStore` / `EventId` / `StreamId` types, so v1 imports from `@modelcontextprotocol/sdk/server/streamableHttp.js` map cleanly onto `@modelcontextprotocol/node`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,8 @@ | ||
| export * from './streamableHttp.js'; | ||
|
|
||
| // v1-compat re-exports. | ||
| export { | ||
| /** @deprecated Use {@linkcode NodeStreamableHTTPServerTransport}. */ | ||
| NodeStreamableHTTPServerTransport as StreamableHTTPServerTransport | ||
| } from './streamableHttp.js'; | ||
|
Check failure on line 7 in packages/middleware/node/src/index.ts
|
||
| export type { EventId, EventStore, StreamId } from '@modelcontextprotocol/server'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if the direction is right - They should be importing both the |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { describe, expect, expectTypeOf, it } from 'vitest'; | ||
|
|
||
| import { NodeStreamableHTTPServerTransport, StreamableHTTPServerTransport } from '../src/index.js'; | ||
| import type { EventId, EventStore, StreamId } from '../src/index.js'; | ||
|
|
||
| describe('v1 compat exports from @modelcontextprotocol/node', () => { | ||
| it('StreamableHTTPServerTransport aliases NodeStreamableHTTPServerTransport', () => { | ||
| expect(StreamableHTTPServerTransport).toBe(NodeStreamableHTTPServerTransport); | ||
| expectTypeOf<StreamableHTTPServerTransport>().toEqualTypeOf<NodeStreamableHTTPServerTransport>(); | ||
| }); | ||
|
|
||
| it('re-exports EventStore / EventId / StreamId types', () => { | ||
| // Type-level assertions: these compile only if the types are exported. | ||
| expectTypeOf<EventId>().toBeString(); | ||
| expectTypeOf<StreamId>().toBeString(); | ||
| expectTypeOf<EventStore>().toHaveProperty('storeEvent'); | ||
| expectTypeOf<EventStore>().toHaveProperty('replayEventsAfter'); | ||
| }); | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.