 (defn setup
   [repl-env opts]
   (let [_ (set-logging-level "javax.jmdns" java.util.logging.Level/SEVERE)
-        [webdav-endpoint-name webdav-endpoint] (discover-and-pick-ambly-instance)
+        [webdav-endpoint-name webdav-endpoint] (discover-and-pick-ambly-instance (:choose-first-discovered repl-env))
         _ (println "\nConnecting to" (service-name->display-name webdav-endpoint-name) "...\n")
         ; Assuming IPv4 for now
         endpoint-address (.getHostAddress (:address webdav-endpoint))

                 (aget (.. js/goog -dependencies_ -nameToPath) name)))))))
    {:merge-opts {:output-dir webdav-mount-point}}))

(defrecord JscEnv [host port socket response-promise webdav-mount-point]
  repl/IParseStacktrace
  (-parse-stacktrace [this stacktrace error opts]
    (raw-stacktrace->canonical-stacktrace stacktrace opts))

    (shutdown-agents)))

(defn repl-env* [options]
  (let [{:keys [host port choose-first-discovered]}
        (merge
          {:host "localhost"
           :port 50505}
          options)]
    (JscEnv. host port (atom nil) (atom nil) (atom nil) choose-first-discovered)))

(defn repl-env
  [& {:as options}]
