<commit_before>import { useEffect } from 'react'
import { createRoot } from 'react-dom/client'
import { createBot } from '../../botui'

import {
  BotUI,
  BotUIAction,
  BotUIMessageList
} from '../src/index.ts'

import '../src/styles/default.theme.scss'

function askNameBot(bot, type = 'select') {
  return bot
    .wait({ waitTime: 1000 })
    .then(() => myBot.message.add({ text: 'hello, what is your name?' }))
    .then(() =>
      bot.action.set(
        {
          options: [
            { label: 'John', value: 'john' },
            { label: 'Jane', value: 'jane' },
          ],
        },
        { actionType: type }
      )
    )
    .then((data) =>
      bot.message.add({ text: `nice to meet you ${data.selected.label}` })
    )
}

function checkStarsBot(bot) {
  return bot
    .wait({ waitTime: 1000 })
    .then(() => bot.message.add({ text: 'hello, enter a repo' }))
    .then(() => bot.wait({ waitTime: 500 }))
    .then(() =>
      bot.action.set({ placeholder: 'repo' }, { actionType: 'input' })
    )
    .then((data) => {
      fetch(`https://api.github.com/repos/${data.value}`)
        .then((res) => res.json())
        .then((res) => {
          bot.next({ count: res.stargazers_count })
        })

      return bot.wait()
    })
    .then((data) => bot.message.add({ text: `it has ${data.count} ⭐️⭐️⭐️` }))
}

const myBot = createBot()
const MyBotUI = () => {
  return (
    <>
      <BotUIMessageList />
      <BotUIAction />
    </>
  )
}

const App = () => {
  useEffect(() => {
    askNameBot(myBot)
  }, [])

  return (
    <div>
      <BotUI bot={myBot}>
        <MyBotUI />
      </BotUI>
    </div>
  )
}

const containerElement = document.getElementById('botui')
const root = createRoot(containerElement)
root.render(<App />)<commit_msg>local: minor<commit_after>import { useEffect } from 'react'
import { createRoot } from 'react-dom/client'
import { createBot } from '../../botui'

import {
  BotUI,
  BotUIAction,
  BotUIMessageList
} from '../src/index.ts'

import '../src/styles/default.theme.scss'

function askNameBot(bot, type = 'select') {
  return bot
    .wait({ waitTime: 1000 })
    .then(() => bot.message.add({ text: 'hello, what is your name?' }))
    .then(() =>
      bot.action.set(
        {
          options: [
            { label: 'John', value: 'john' },
            { label: 'Jane', value: 'jane' },
          ],
        },
        { actionType: type }
      )
    )
    .then((data) =>
      bot.message.add({ text: `nice to meet you ${data.selected.label}` })
    )
}

function checkStarsBot(bot) {
  return bot
    .wait({ waitTime: 1000 })
    .then(() => bot.message.add({ text: 'hello, enter a repo' }))
    .then(() => bot.wait({ waitTime: 500 }))
    .then(() =>
      bot.action.set({ placeholder: 'repo' }, { actionType: 'input' })
    )
    .then((data) => {
      fetch(`https://api.github.com/repos/${data.value}`)
        .then((res) => res.json())
        .then((res) => {
          bot.next({ count: res.stargazers_count })
        })

      return bot.wait()
    })
    .then((data) => bot.message.add({ text: `it has ${data.count} ⭐️⭐️⭐️` }))
}

const myBot = createBot()
const MyBotUI = () => {
  return (
    <>
      <BotUIMessageList />
      <BotUIAction />
    </>
  )
}

const App = () => {
  useEffect(() => {
    askNameBot(myBot, 'selectButtons')
  }, [])

  return (
    <div>
      <BotUI bot={myBot}>
        <MyBotUI />
      </BotUI>
    </div>
  )
}

const containerElement = document.getElementById('botui')
const root = createRoot(containerElement)
root.render(<App />)
{'fraction_non_alphanumeric': 0.19932810750279956, 'fraction_numerical': 0.006159014557670772, 'mean_word_length': 2.251137397634213, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 49, 'https://': 2, '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': '2126130', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1261, 'n_words': 252}