<commit_before>(ns plongeur.core
  (:require [cljs.core.async :as a :refer [mult tap chan pipe sliding-buffer]]
            [kierros.core :as cycle]
            [plongeur.intent :as i]
            [plongeur.model  :as m]
            [plongeur.view   :as v]
            [kierros.quiescent-dom-driver   :as dom]
            [kierros.sente-websocket-driver :as ws]
            [kierros.local-storage-driver   :as st]))

(enable-console-print!)

(defn on-js-reload [] (print "on-js-reload"))

(defn plongeur-main
  "Cycle main."
  [{dom-event-chan       :DOM
    ;websocket-event-chan :WEB
    saved-state-chan     :STORAGE}]
  (let [intent-chans (i/intents)
        states-chan  (m/model saved-state-chan intent-chans)
        states-mult  (mult states-chan)
        view-states-chan   (->> (chan) (tap states-mult))
        pickle-states-chan (->> (sliding-buffer 1) (chan) (tap states-mult))
        views-chan   (v/view view-states-chan intent-chans)
        request-chan (chan)]
    {:DOM     views-chan
     ;:WEB     request-chan
     :STORAGE pickle-states-chan}))

(cycle/run
  plongeur-main
  {:DOM     (dom/make-dom-driver "plongeur-app")
   ;:WEB     (ws/make-websocket-driver "/chsk")
   :STORAGE (st/make-storage-driver "plongeur" m/default-state)})<commit_msg>plug sigma-driver into the MAIN function<commit_after>(ns plongeur.core
  (:require [cljs.core.async :as a :refer [mult tap chan pipe sliding-buffer]]
            [kierros.core :as cycle]
            [plongeur.intent :as i]
            [plongeur.model  :as m]
            [plongeur.view   :as v]
            [plongeur.sigma-driver :as sig]
            [kierros.quiescent-dom-driver   :as dom]
            [kierros.sente-websocket-driver :as ws]
            [kierros.local-storage-driver   :as st]))

(enable-console-print!)

(defn on-js-reload [] (print "on-js-reload"))

(defn plongeur-main
  "Cycle main."
  [{dom-event-chan       :DOM
    sigma-event-chan     :SIGMA
    saved-state-chan     :STORAGE
    websocket-event-chan :WEB
    }]
  (let [sigma-chan         (chan 10)
        intent-chans       (-> (i/intents)
                               (assoc :sigma-ctrl sigma-chan))

        states-chan        (m/model saved-state-chan intent-chans)
        states-mult        (mult states-chan)

        pickle-states-chan (->> (sliding-buffer 1) (chan) (tap states-mult))

        view-states-chan   (->> (chan 10) (tap states-mult))

        request-chan       (chan 10)

        views-chan         (v/view view-states-chan intent-chans)]
    {:DOM     views-chan
     :SIGMA   sigma-chan
     :STORAGE pickle-states-chan
     :WEB     request-chan}))

(cycle/run
  plongeur-main
  {:DOM     (dom/make-dom-driver "plongeur-app")
   :SIGMA   (sig/make-sigma-driver)
   :STORAGE (st/make-storage-driver "plongeur" m/default-state)
   ;:WEB    (ws/make-websocket-driver "/chsk")
   })
{'fraction_non_alphanumeric': 0.14245712285614281, 'fraction_numerical': 0.00280014000700035, 'mean_word_length': 2.0897297297297297, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '4428357', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1008, 'n_words': 205}