import type { CorePluginApi } from "@racletteCore"
import router from "@racletteOrchestrator/router"
import { registerRouterEventHandlers } from "@racletteOrchestrator/router/registerEventHandlers"

let routerHandlersRegistered = false

export const initApp = async (corePluginApi: CorePluginApi) => {
  if (!routerHandlersRegistered) {
    registerRouterEventHandlers(router, corePluginApi.$eventbus)
    routerHandlersRegistered = true
  }
}
