       (str/replace #"_" "-")
       symbol))
 
-(defn ^:export reload [host port]
+(defn ^:export reload []
   (fn [next-handler]
     (let [conn (atom nil)]
-      (fn reload* [fileset]
+      (fn reload* [{:keys [lumo/repl] :as fileset}]
         (if-let [conn @conn]
           (when-let [file (:reload fileset)]
-            ((:invalid-cache! fileset))
+            ((:lumo/invalid-cache! fileset))
             (.send conn
                    (str (pr-str `(require '~(file->ns file) :reload))
                         \newline)

                                   caches)))))]
    (fn [next-handler]
      (fn [fileset]
        (let [opts (clj->js (concat ["-c"
                                     (str/join ":" (concat source-paths (:classpath fileset)))]
                                    opts))]
          (invalid-cache!)
          (some-> @process .kill)
          (reset! process
                  (js/child_process.spawn "lumo" opts #js {:stdio "inherit"}))
          (next-handler (assoc fileset :invalid-cache! invalid-cache!)))))))

(defn ^:export watch [t file]
  (fn [next-handler]

            (doto c
              (.on "ready" (fn [prompt]
                             (reset! conn c)
                             (reload* fileset)))
              (.on "data" #(print (str %)))
              (.on "error" (fn [prompt]
                             (js/setTimeout #(reload* fileset) 500)))
              (.connect #js {:host        (:host repl)
                             :port        (:port repl)
                             :shellPrompt "cljs.user=> "
                             :timeout     1500}))))))))

