<commit_before>(ns inspect.core
  (:require [inspect.communicator :as comm]
            [inspect.appstate :as appstate]
            [reagent.core :as reagent :refer [atom]]
            [cljs.core.async :as async :refer [<! >! chan put! alts! timeout]]))

(enable-console-print!)

;;;; Main file of the inspect tool written in ClojureScript

(defn by-id [id] (.getElementById js/document id))

(defn get-next
  []
  (comm/chsk-send! [:cmd/get-next {:next-n 10}]))

(defn lister [items]
  [:div
   (for [item items]
     [:pre [:code (:pp item)]])])

(defn lister-user []
  [:div
   [:button#get-next {:on-click get-next} "Next"]
   [lister (reverse (:events @appstate/app))]])

(defn run []
  (reagent/render-component (fn [] [lister-user])
                            (by-id "code")))

(run)<commit_msg>:origin in h1, :received in div, pretty-printed payload in pre code<commit_after>(ns inspect.core
  (:require [inspect.communicator :as comm]
            [inspect.appstate :as appstate]
            [reagent.core :as reagent :refer [atom]]
            [cljs.core.async :as async :refer [<! >! chan put! alts! timeout]]))

(enable-console-print!)

;;;; Main file of the inspect tool written in ClojureScript

(defn by-id [id] (.getElementById js/document id))

(defn get-next
  []
  (comm/chsk-send! [:cmd/get-next {:next-n 10}]))

(defn lister [items]
  [:div
   (for [item items]
     [:div
      [:h4 (str (:origin item))]
      [:p (:received item)]
      [:pre [:code (:payload item)]]
      [:br]])])

(defn lister-user []
  [:div
   [:button#get-next {:on-click get-next} "Next"]
   [lister (reverse (:events @appstate/app))]])

(defn run []
  (reagent/render-component (fn [] [lister-user])
                            (by-id "code")))

(run)
{'fraction_non_alphanumeric': 0.1810394060536836, 'fraction_numerical': 0.0034266133637921186, 'mean_word_length': 2.8675496688741724, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2803817', 'n_tokens_mistral': 657, 'n_tokens_neox': 617, 'n_words': 166}