@@ -14,7 +14,7 @@ import { DEFAULT_PORT, SECURITY_TOKENS } from '@shared/constants/websocket'
1414import { dictionary } from '@shared/constants/dictionary'
1515import { Logger } from '@shared/utils/logger'
1616import { WebConfiguration } from '@shared/types/web-configuration'
17- import { ConfigWebConfigurationFormat } from '@/views/ utils/web-configuration-format-converters'
17+ import { ConfigWebConfigurationFormat } from '@/utils/web-configuration-format-converters'
1818import { LAST_SELECTED_BROWSER_ID_STATE_KEY } from '@/constants/state-keys'
1919import { ApplyChatResponseCommandArgs } from '@/commands/apply-chat-response-command/response-processor'
2020import { WebPromptType } from '@shared/types/prompt-types'
@@ -81,11 +81,15 @@ export class WebSocketManager {
8181 )
8282
8383 try {
84- const spawned = child_process . spawn ( process . execPath , [ server_script_path ] , {
85- detached : true ,
86- stdio : 'ignore' ,
87- env : { ...process . env , ELECTRON_RUN_AS_NODE : '1' }
88- } )
84+ const spawned = child_process . spawn (
85+ process . execPath ,
86+ [ server_script_path ] ,
87+ {
88+ detached : true ,
89+ stdio : 'ignore' ,
90+ env : { ...process . env , ELECTRON_RUN_AS_NODE : '1' }
91+ }
92+ )
8993
9094 if ( spawned . pid ) {
9195 spawned . unref ( )
@@ -115,24 +119,25 @@ export class WebSocketManager {
115119 let attempts = 0
116120
117121 const check = ( ) => {
118- const req = http . get (
119- `http://localhost:${ this . port } /health` ,
120- ( res ) => {
121- if ( res . statusCode === 200 ) {
122- resolve ( )
123- } else {
124- retry ( )
125- }
122+ const req = http . get ( `http://localhost:${ this . port } /health` , ( res ) => {
123+ if ( res . statusCode === 200 ) {
124+ resolve ( )
125+ } else {
126+ retry ( )
126127 }
127- )
128+ } )
128129 req . on ( 'error' , retry )
129130 req . end ( )
130131 }
131132
132133 const retry = ( ) => {
133134 attempts ++
134135 if ( attempts >= retries ) {
135- reject ( new Error ( `WebSocket server did not become ready after ${ retries } attempts` ) )
136+ reject (
137+ new Error (
138+ `WebSocket server did not become ready after ${ retries } attempts`
139+ )
140+ )
136141 } else {
137142 setTimeout ( check , interval_ms )
138143 }
@@ -369,7 +374,9 @@ export class WebSocketManager {
369374 return false
370375 }
371376
372- const web_configuration = web_configurations . find ( ( p ) => p . name == params . web_configuration_name )
377+ const web_configuration = web_configurations . find (
378+ ( p ) => p . name == params . web_configuration_name
379+ )
373380 if ( ! web_configuration ) {
374381 return false
375382 }
@@ -475,7 +482,8 @@ export class WebSocketManager {
475482 const ai_studio_user_id = config . get < number | null > ( 'aiStudioUserId' )
476483 const reuse_last_tab = config . get < boolean > ( 'reuseLastTab' , false )
477484
478- const chatbot = CHATBOTS [ params . web_configuration . chatbot as keyof typeof CHATBOTS ]
485+ const chatbot =
486+ CHATBOTS [ params . web_configuration . chatbot as keyof typeof CHATBOTS ]
479487 let url : string
480488 if ( params . web_configuration . chatbot == 'AI Studio' ) {
481489 let base_url = chatbot . url
@@ -508,7 +516,10 @@ export class WebSocketManager {
508516 gemini_user_number !== null
509517 ) {
510518 url = `https://gemini.google.com/u/${ gemini_user_number } `
511- } else if ( chatbot . supports_url_override && params . web_configuration . new_url ) {
519+ } else if (
520+ chatbot . supports_url_override &&
521+ params . web_configuration . new_url
522+ ) {
512523 try {
513524 const original_domain = new URL ( chatbot . url ) . hostname
514525 const new_domain = new URL ( params . web_configuration . new_url ) . hostname
0 commit comments