@@ -30,21 +30,9 @@ function createImportDeclaration(
3030 return decl ;
3131}
3232
33- export interface ExecutorOptions {
34- /** Enable NodeHttpAdapter for *.localhost subdomain routing */
35- nodeHttpAdapter ?: boolean ;
36- }
37-
38- export function generateExecutorFile ( toolName : string , options ?: ExecutorOptions ) : GeneratedFile {
33+ export function generateExecutorFile ( toolName : string ) : GeneratedFile {
3934 const statements : t . Statement [ ] = [ ] ;
4035
41- // Import NodeHttpAdapter for *.localhost subdomain routing
42- if ( options ?. nodeHttpAdapter ) {
43- statements . push (
44- createImportDeclaration ( './node-fetch' , [ 'NodeHttpAdapter' ] ) ,
45- ) ;
46- }
47-
4836 statements . push (
4937 createImportDeclaration ( 'appstash' , [ 'createConfigStore' ] ) ,
5038 ) ;
@@ -215,39 +203,20 @@ export function generateExecutorFile(toolName: string, options?: ExecutorOptions
215203 ] ) ,
216204 ) ,
217205
218- // Build createClient config — use NodeHttpAdapter for *.localhost endpoints
219- ...( options ?. nodeHttpAdapter
220- ? [
221- t . returnStatement (
222- t . callExpression ( t . identifier ( 'createClient' ) , [
223- t . objectExpression ( [
224- t . objectProperty (
225- t . identifier ( 'adapter' ) ,
226- t . newExpression ( t . identifier ( 'NodeHttpAdapter' ) , [
227- t . memberExpression ( t . identifier ( 'ctx' ) , t . identifier ( 'endpoint' ) ) ,
228- t . identifier ( 'headers' ) ,
229- ] ) ,
230- ) ,
231- ] ) ,
232- ] ) ,
206+ t . returnStatement (
207+ t . callExpression ( t . identifier ( 'createClient' ) , [
208+ t . objectExpression ( [
209+ t . objectProperty (
210+ t . identifier ( 'endpoint' ) ,
211+ t . memberExpression ( t . identifier ( 'ctx' ) , t . identifier ( 'endpoint' ) ) ,
233212 ) ,
234- ]
235- : [
236- t . returnStatement (
237- t . callExpression ( t . identifier ( 'createClient' ) , [
238- t . objectExpression ( [
239- t . objectProperty (
240- t . identifier ( 'endpoint' ) ,
241- t . memberExpression ( t . identifier ( 'ctx' ) , t . identifier ( 'endpoint' ) ) ,
242- ) ,
243- t . objectProperty (
244- t . identifier ( 'headers' ) ,
245- t . identifier ( 'headers' ) ,
246- ) ,
247- ] ) ,
248- ] ) ,
213+ t . objectProperty (
214+ t . identifier ( 'headers' ) ,
215+ t . identifier ( 'headers' ) ,
249216 ) ,
250217 ] ) ,
218+ ] ) ,
219+ ) ,
251220 ] ) ;
252221
253222 const getClientFunc = t . functionDeclaration (
@@ -269,17 +238,9 @@ export function generateExecutorFile(toolName: string, options?: ExecutorOptions
269238export function generateMultiTargetExecutorFile (
270239 toolName : string ,
271240 targets : MultiTargetExecutorInput [ ] ,
272- options ?: ExecutorOptions ,
273241) : GeneratedFile {
274242 const statements : t . Statement [ ] = [ ] ;
275243
276- // Import NodeHttpAdapter for *.localhost subdomain routing
277- if ( options ?. nodeHttpAdapter ) {
278- statements . push (
279- createImportDeclaration ( './node-fetch' , [ 'NodeHttpAdapter' ] ) ,
280- ) ;
281- }
282-
283244 statements . push (
284245 createImportDeclaration ( 'appstash' , [ 'createConfigStore' ] ) ,
285246 ) ;
@@ -538,33 +499,14 @@ export function generateMultiTargetExecutorFile(
538499 ) ,
539500 ] ) ,
540501 ) ,
541- // Build createClient config — use NodeHttpAdapter for *.localhost endpoints
542- ...( options ?. nodeHttpAdapter
543- ? [
544- t . returnStatement (
545- t . callExpression ( t . identifier ( 'createFn' ) , [
546- t . objectExpression ( [
547- t . objectProperty (
548- t . identifier ( 'adapter' ) ,
549- t . newExpression ( t . identifier ( 'NodeHttpAdapter' ) , [
550- t . identifier ( 'endpoint' ) ,
551- t . identifier ( 'headers' ) ,
552- ] ) ,
553- ) ,
554- ] ) ,
555- ] ) ,
556- ) ,
557- ]
558- : [
559- t . returnStatement (
560- t . callExpression ( t . identifier ( 'createFn' ) , [
561- t . objectExpression ( [
562- t . objectProperty ( t . identifier ( 'endpoint' ) , t . identifier ( 'endpoint' ) ) ,
563- t . objectProperty ( t . identifier ( 'headers' ) , t . identifier ( 'headers' ) ) ,
564- ] ) ,
565- ] ) ,
566- ) ,
502+ t . returnStatement (
503+ t . callExpression ( t . identifier ( 'createFn' ) , [
504+ t . objectExpression ( [
505+ t . objectProperty ( t . identifier ( 'endpoint' ) , t . identifier ( 'endpoint' ) ) ,
506+ t . objectProperty ( t . identifier ( 'headers' ) , t . identifier ( 'headers' ) ) ,
567507 ] ) ,
508+ ] ) ,
509+ ) ,
568510 ] ) ;
569511
570512 const getClientFunc = t . functionDeclaration (
0 commit comments