HumanTyping icon indicating copy to clipboard operation
HumanTyping copied to clipboard

[Enhancement] Add support for TypeScript

Open samaocarpenter opened this issue 7 months ago • 2 comments

This library currently only supports Python. However, JS/TS are the native languages for Playwright, and are most commonly used for web scraping applications. It would be amazing to extend this library's capabilities to TS and build an npm package that has the same interface.

samaocarpenter avatar Apr 15 '26 19:04 samaocarpenter

Here's my take on it https://github.com/etareduction/HumanTypingTS

LLM did the heavy work of course but i tried keeping it as faithful to the original as possible (you can see implementations are almost line-to-line identical). Also pushed on tests that compare event chains, even ported numpy's random functions to make them identical.

etareduction avatar Apr 30 '26 09:04 etareduction

Hi, @Lax3n, hope you are doing well.

Your investigation into the human-like typing assistant, especially the timing adjustment approach based on Markov chains, really impressed me. I think it's a pioneering technical approach in this area and could give us a great opportunity to build a truly human-like AI helpdesk assistant. I really appreciate all the hard work you've put into researching human typing simulation.

JFYI, I found several research papers related to human typing behavior, including typographical error modeling, keystroke timing, and typing rhythm and updated the forked project.

Research shows that most users prefer AI assistants that behave more like humans. Small, natural typing mistakes followed by self-corrections tend to make the interaction feel more authentic than perfectly error-free AI responses.

I think the keystroke timing is in great shape now, so we can start focusing on more advanced error modeling. Instead of relying primarily on heuristic typographical errors generation, we could use NLTK or spaCy to simulate more natural writing mistakes, such as grammar corrections, inappropriate word substitutions, and context-aware word choices. That would make the typing behavior feel much more realistic.

If you're interested, I'd be happy to contribute to the research and help move the project forward.

Thanks, Minami

angryred027 avatar Jul 06 '26 00:07 angryred027