<commit_before>robochick =
  "ICTU Cloud Terminal ~ Powered by RoboChick\n\n
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;___//\n
&nbsp;&nbsp;&nbsp;&nbsp;/.__.\\\n
&nbsp;&nbsp;&nbsp;&nbsp;\\ \\/ /\n
&nbsp;'__/    \\\n
&nbsp;&nbsp;\\-      )\n
&nbsp;&nbsp;&nbsp;\\_____/\n
_____|_|____\n
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\" \""

Template.terminal.onRendered ->
  instance = @data.instance
  console.log instance
  service = instance.services[@data.serviceName]
  connectionId = null

  window.document.title = "RoboChick ~ #{service.hostname}"
  $('html').css 'cssText', 'height:100% !important;'
  $('body').css 'cssText', 'height:100% !important; background:none !important; background-color: #000 !important;'

  evt = new EventSource "/api/v1/stream/#{service.dockerContainerName}"
  evt.addEventListener 'connectionId', (event) =>
    connectionId = event.data
    @$('#terminal').terminal().echo "Connection established to #{service.hostname}"
  evt.addEventListener 'data', (event) =>
    @$('#terminal').terminal().echo EJSON.parse(event.data).data
  evaluator = (command, term) ->
    console.log (EJSON.stringify cmd: command)
    HTTP.post "/api/v1/stream/#{connectionId}/send", (data: cmd: command), (err, response) ->
      term.error err if err
    undefined
  @$('#terminal').terminal evaluator, prompt: '$ ', greetings: robochick, exit: false<commit_msg>update prompt based on event<commit_after>robochick =
  "ICTU Cloud Terminal ~ Powered by RoboChick\n\n
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;___//\n
&nbsp;&nbsp;&nbsp;&nbsp;/.__.\\\n
&nbsp;&nbsp;&nbsp;&nbsp;\\ \\/ /\n
&nbsp;'__/    \\\n
&nbsp;&nbsp;\\-      )\n
&nbsp;&nbsp;&nbsp;\\_____/\n
_____|_|____\n
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\" \""

Template.terminal.onRendered ->
  instance = @data.instance
  console.log instance
  service = instance.services[@data.serviceName]
  connectionId = null
  prompt = null
  setPrompt = null

  window.document.title = "RoboChick ~ #{service.hostname}"
  $('html').css 'cssText', 'height:100% !important;'
  $('body').css 'cssText', 'height:100% !important; background:none !important; background-color: #000 !important;'

  evt = new EventSource "/api/v1/stream/#{service.dockerContainerName}"
  evt.addEventListener 'connectionId', (event) =>
    connectionId = event.data
    @$('#terminal').terminal().echo "Connection established to #{service.hostname}"
  evt.addEventListener 'data', (event) =>
    @$('#terminal').terminal().echo EJSON.parse(event.data).data
  evt.addEventListener 'prompt', (event) ->
    console.log 'prompt', event.data
    prompt = EJSON.parse(event.data).data
    setPrompt prompt
  evaluator = (command, term) ->
    console.log (EJSON.stringify cmd: command)
    term.echo "#{prompt}#{command}"
    HTTP.post "/api/v1/stream/#{connectionId}/send", (data: cmd: command), (err, response) ->
      term.error err if err
    undefined
  @$('#terminal').terminal evaluator, prompt: ((x)-> setPrompt = x), greetings: robochick, exit: false
{'fraction_non_alphanumeric': 0.1946422516107155, 'fraction_numerical': 0.007460155985079688, 'mean_word_length': 4.344202898550725, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '7133842', 'n_tokens_mistral': 1000, 'n_tokens_neox': 970, 'n_words': 198}