11import  type  {  Tracer  }  from  "@opentelemetry/api" ; 
22import  type  {  Logger  }  from  "@opentelemetry/api-logs" ; 
33import  { 
4+   AnyOnCatchErrorHookFunction , 
5+   AnyOnFailureHookFunction , 
6+   AnyOnInitHookFunction , 
7+   AnyOnStartHookFunction , 
8+   AnyOnSuccessHookFunction , 
9+   apiClientManager , 
410  clock , 
11+   ExecutorToWorkerMessageCatalog , 
512  type  HandleErrorFunction , 
13+   lifecycleHooks , 
14+   localsAPI , 
615  logger , 
716  LogLevel , 
8-   runtime , 
917  resourceCatalog , 
18+   runMetadata , 
19+   runtime , 
20+   runTimelineMetrics , 
1021  TaskRunErrorCodes , 
1122  TaskRunExecution , 
12-   WorkerToExecutorMessageCatalog , 
13-   TriggerConfig , 
14-   WorkerManifest , 
15-   ExecutorToWorkerMessageCatalog , 
1623  timeout , 
17-   runMetadata , 
24+   TriggerConfig , 
1825  waitUntil , 
19-   apiClientManager , 
20-   runTimelineMetrics , 
21-   lifecycleHooks , 
22-   lifecycleHooksAdapters , 
23-   localsAPI , 
26+   WorkerManifest , 
27+   WorkerToExecutorMessageCatalog , 
2428}  from  "@trigger.dev/core/v3" ; 
2529import  {  TriggerTracer  }  from  "@trigger.dev/core/v3/tracer" ; 
2630import  { 
@@ -30,20 +34,20 @@ import {
3034  getEnvVar , 
3135  getNumberEnvVar , 
3236  logLevels , 
37+   ManagedRuntimeManager , 
3338  OtelTaskLogger , 
3439  ProdUsageManager , 
40+   StandardLifecycleHooksManager , 
41+   StandardLocalsManager , 
42+   StandardMetadataManager , 
3543  StandardResourceCatalog , 
44+   StandardRunTimelineMetricsManager , 
45+   StandardWaitUntilManager , 
3646  TaskExecutor , 
3747  TracingDiagnosticLogLevel , 
3848  TracingSDK , 
3949  usage , 
4050  UsageTimeoutManager , 
41-   StandardMetadataManager , 
42-   StandardWaitUntilManager , 
43-   ManagedRuntimeManager , 
44-   StandardRunTimelineMetricsManager , 
45-   StandardLifecycleHooksManager , 
46-   StandardLocalsManager , 
4751}  from  "@trigger.dev/core/v3/workers" ; 
4852import  {  ZodIpcConnection  }  from  "@trigger.dev/core/v3/zodIpc" ; 
4953import  {  readFile  }  from  "node:fs/promises" ; 
@@ -194,35 +198,35 @@ async function bootstrap() {
194198  if  ( config . init )  { 
195199    lifecycleHooks . registerGlobalInitHook ( { 
196200      id : "config" , 
197-       fn : lifecycleHooksAdapters . createInitHookAdapter ( config . init ) , 
201+       fn : config . init   as   AnyOnInitHookFunction , 
198202    } ) ; 
199203  } 
200204
201205  if  ( config . onStart )  { 
202206    lifecycleHooks . registerGlobalStartHook ( { 
203207      id : "config" , 
204-       fn : lifecycleHooksAdapters . createStartHookAdapter ( config . onStart ) , 
208+       fn : config . onStart   as   AnyOnStartHookFunction , 
205209    } ) ; 
206210  } 
207211
208212  if  ( config . onSuccess )  { 
209213    lifecycleHooks . registerGlobalSuccessHook ( { 
210214      id : "config" , 
211-       fn : lifecycleHooksAdapters . createSuccessHookAdapter ( config . onSuccess ) , 
215+       fn : config . onSuccess   as   AnyOnSuccessHookFunction , 
212216    } ) ; 
213217  } 
214218
215219  if  ( config . onFailure )  { 
216220    lifecycleHooks . registerGlobalFailureHook ( { 
217221      id : "config" , 
218-       fn : lifecycleHooksAdapters . createFailureHookAdapter ( config . onFailure ) , 
222+       fn : config . onFailure   as   AnyOnFailureHookFunction , 
219223    } ) ; 
220224  } 
221225
222226  if  ( handleError )  { 
223227    lifecycleHooks . registerGlobalCatchErrorHook ( { 
224228      id : "config" , 
225-       fn : lifecycleHooksAdapters . createHandleErrorHookAdapter ( handleError ) , 
229+       fn : handleError   as   AnyOnCatchErrorHookFunction , 
226230    } ) ; 
227231  } 
228232
0 commit comments