File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 6161 "start:dev" : " tsx src/main.ts" ,
6262 "lint" : " ./node_modules/.bin/eslint ." ,
6363 "lint:fix" : " ./node_modules/.bin/eslint . --fix" ,
64- "build" : " tsc -b src " ,
65- "build:watch" : " tsc -b src - w" ,
64+ "build" : " tsc" ,
65+ "build:watch" : " tsc -w" ,
6666 "inspector" : " npx @modelcontextprotocol/inspector dist/stdio.js" ,
6767 "test" : " vitest run" ,
6868 "type-check" : " tsc --noEmit" ,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
1313import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js' ;
1414import { CallToolResultSchema } from '@modelcontextprotocol/sdk/types.js' ;
1515import dotenv from 'dotenv' ;
16- import { EventSource } from 'eventsource' ;
16+ import { EventSource , EventSourceInit } from 'eventsource' ;
1717
1818import { actorNameToToolName } from '../tools/utils.js' ;
1919
@@ -34,8 +34,19 @@ if (!process.env.APIFY_TOKEN) {
3434 process . exit ( 1 ) ;
3535}
3636
37+ // Declare EventSource on globalThis if not available (needed for Node.js environment)
38+ declare global {
39+ var EventSource : {
40+ new ( url : string , eventSourceInitDict ?: EventSourceInit ) : EventSource ;
41+ prototype : EventSource ;
42+ CONNECTING : 0 ;
43+ OPEN : 1 ;
44+ CLOSED : 2 ;
45+ } ; // eslint-disable-line no-var
46+ }
47+
3748if ( typeof globalThis . EventSource === 'undefined' ) {
38- globalThis . EventSource = EventSource as unknown as typeof globalThis . EventSource ;
49+ globalThis . EventSource = EventSource ;
3950}
4051
4152async function main ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments