<commit_before>(ns galleon.applications
  (:require [helmsman]
            [helmsman.uri :as h-uri]
            [helmsman.navigation :as h-nav]
            [gangway.util :as gw-util]
            [gangway.web]
            [navigator.schema :as n-schema]
            [navigator]
            [timber.core :as timber]
            [traveler.core :as tr-core]
            [traveler.schema :as tr-schema]))

(def system-applications
  [#_
   {:app-name "Poopdeck(tm)"
    :init-fn! nil
    :start-fn! nil
    :stop-fn! nil
    :helmsman-context "nil"
    :helmsman-definition nil}
   {:app-name "Timber"
    :helmsman-definition timber/helmsman-assets}
   {:app-name "Traveler"
    :schema tr-schema/traveler-schema
    :helmsman-context "traveler"
    :helmsman-definition-db-conn true
    :helmsman-definition tr-core/helmsman-definition}
   {:app-name "Navigator"
    :schema n-schema/schema
    :helmsman-context "navigator"
    :helmsman-definition-db-conn true
    :helmsman-definition navigator/helmsman-def}
   {:app-name "Gangway"
    :start-fn! gw-util/start-queues!
    :helmsman-context "gangway"
    :helmsman-definition gangway.web/helmsman-definition}])

(defn make-app-context
  [db-conn app]
  (let [hd (:helmsman-definition app)]
    (into [:context (:helmsman-context app "/")]
          (if (:helmsman-definition-db-conn app)
            (hd db-conn)
            hd))))

(defn front-page-handler
  [request]
  (timber/base-page
   {:page-name "Galleon"<commit_msg>add reference about planned secondary flare "app" to handle notifications<commit_after>(ns galleon.applications
  (:require [helmsman]
            [helmsman.uri :as h-uri]
            [helmsman.navigation :as h-nav]
            [gangway.util :as gw-util]
            [gangway.web]
            [navigator.schema :as n-schema]
            [navigator]
            [timber.core :as timber]
            [traveler.core :as tr-core]
            [traveler.schema :as tr-schema]))

(def system-applications
  [#_
   {:app-name "Poopdeck(tm)"
    :init-fn! nil
    :start-fn! nil
    :stop-fn! nil
    :helmsman-context "nil"
    :helmsman-definition nil}
   {:app-name "Timber"
    :helmsman-definition timber/helmsman-assets}
   {:app-name "Traveler"
    :schema tr-schema/traveler-schema
    :helmsman-context "traveler"
    :helmsman-definition-db-conn true
    :helmsman-definition tr-core/helmsman-definition}
   {:app-name "Navigator"
    :schema n-schema/schema
    :helmsman-context "navigator"
    :helmsman-definition-db-conn true
    :helmsman-definition navigator/helmsman-def}
   {:app-name "Gangway"
    :start-fn! gw-util/start-queues!
    :helmsman-context "gangway"
    :helmsman-definition gangway.web/helmsman-definition}
   #_
   {:app-name "Flare: Notifier"
    :start-fn! nil}])

(defn make-app-context
  [db-conn app]
  (let [hd (:helmsman-definition app)]
    (into [:context (:helmsman-context app "/")]
          (if (:helmsman-definition-db-conn app)
            (hd db-conn)
            hd))))

(defn front-page-handler
  [request]
  (timber/base-page
   {:page-name "Galleon"
{'fraction_non_alphanumeric': 0.13834635416666666, 'fraction_numerical': 0.0, 'mean_word_length': 2.556712962962963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '748699', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1098, 'n_words': 207}