File tree Expand file tree Collapse file tree 1 file changed +8
-41
lines changed Expand file tree Collapse file tree 1 file changed +8
-41
lines changed Original file line number Diff line number Diff line change @@ -50,21 +50,13 @@ function delay(ms: number): Promise<void> {
5050}
5151
5252async function runWebClient ( args : Args ) : Promise < void > {
53- const inspectorServerPath = resolve (
54- __dirname ,
55- "../../" ,
56- "server" ,
57- "build" ,
58- "index.js" ,
59- ) ;
60-
6153 // Path to the client entry point
6254 const inspectorClientPath = resolve (
6355 __dirname ,
6456 "../../" ,
6557 "client" ,
6658 "bin" ,
67- "client .js" ,
59+ "start .js" ,
6860 ) ;
6961
7062 const CLIENT_PORT : string = process . env . CLIENT_PORT ?? "6274" ;
@@ -83,38 +75,13 @@ async function runWebClient(args: Args): Promise<void> {
8375 let serverOk : unknown ;
8476
8577 try {
86- server = spawnPromise (
87- "node" ,
88- [
89- inspectorServerPath ,
90- ...( args . command ? [ `--env` , args . command ] : [ ] ) ,
91- ...( args . args ? [ `--args=${ args . args . join ( " " ) } ` ] : [ ] ) ,
92- ] ,
93- {
94- env : {
95- ...process . env ,
96- PORT : SERVER_PORT ,
97- MCP_ENV_VARS : JSON . stringify ( args . envArgs ) ,
98- } ,
99- signal : abort . signal ,
100- echoOutput : true ,
101- } ,
102- ) ;
103-
104- // Make sure server started before starting client
105- serverOk = await Promise . race ( [ server , delay ( 2 * 1000 ) ] ) ;
106- } catch ( error ) { }
107-
108- if ( serverOk ) {
109- try {
110- await spawnPromise ( "node" , [ inspectorClientPath ] , {
111- env : { ...process . env , PORT : CLIENT_PORT } ,
112- signal : abort . signal ,
113- echoOutput : true ,
114- } ) ;
115- } catch ( e ) {
116- if ( ! cancelled || process . env . DEBUG ) throw e ;
117- }
78+ await spawnPromise ( "node" , [ inspectorClientPath ] , {
79+ env : { ...process . env , PORT : CLIENT_PORT } ,
80+ signal : abort . signal ,
81+ echoOutput : true ,
82+ } ) ;
83+ } catch ( e ) {
84+ if ( ! cancelled || process . env . DEBUG ) throw e ;
11885 }
11986}
12087
You can’t perform that action at this time.
0 commit comments