'use strict';

var mlink = require('./midware/index');
var Router = mlink.Router;
var Hub = mlink.Hub;
var debuggerRouter = new Router('debugger');
var nativeProxyHub = new Hub('proxy.native');
var debuggerHub = new Hub('page.debugger');
var inspectorHub = new Hub('proxy.inspector');
var runtimeWorkerHub = new Hub('runtime.worker');
var entryHub = new Hub('page.entry');
var runtimeProxyHub = new Hub('runtime.proxy');
var syncHub = new Hub('sync');

var init = function init() {
  debuggerRouter.link(nativeProxyHub);
  debuggerRouter.link(debuggerHub);
  debuggerRouter.link(inspectorHub);
  debuggerRouter.link(entryHub);
  debuggerRouter.link(syncHub);
  debuggerRouter.link(runtimeWorkerHub);
  debuggerRouter.link(runtimeProxyHub);
  mlink.load(__dirname);
};
module.exports = {
  init: init
};