<commit_before>
class LREP::Message {
  has $.context is rw;
  has $.input is rw = "";
  has $.output is rw = "";
  method append($text) {
    $.output = $text;
  }
}

class LREP {

  use Linenoise;

  has $.context is rw;
  has $.composed is rw;

  # Ignore &handler
  sub echo_middleware(&handler) {
    -> $message {
      $message.append($message.input);
      $message;
    }
  }

  sub eval_middleware(&handler) {
    -> $message {
      if $message {
        my $eval_result = EVAL $message.input, context => $message.context;
        # TODO: Does the result here overwrite input? output? new thing?<commit_msg>Use the new monkey see no eval pragma<commit_after>
class LREP::Message {
  use IO::String;
  has $.context is rw;
  has $.input is rw = "";
  has IO::String $.output is rw = IO::String.new;
}

class LREP {

  use MONKEY-SEE-NO-EVAL;
  use Linenoise;

  has $.context is rw;
  has $.composed is rw;

  # Ignore &handler
  sub echo_middleware(&handler) {
    -> $message {
      $message.append($message.input);
      $message;
    }
  }

  sub eval_middleware(&handler) {
    -> $message {
      if $message {
        my $eval_result = EVAL $message.input, context => $message.context;
        # TODO: Does the result here overwrite input? output? new thing?
{'fraction_non_alphanumeric': 0.13479623824451412, 'fraction_numerical': 0.0, 'mean_word_length': 2.659025787965616, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '447382', 'n_tokens_mistral': 443, 'n_tokens_neox': 431, 'n_words': 126}