Deterministic planner for human-like typing. Turns a string into a sequence of typing events — insert, delete, delay, idle — for a renderer to play back.

String.get_utf_8_uchar).opam install keyseqlet state = Random.State.make [| 1 |] in
match Keyseq.plan Keyseq.default_config state "Hello, world." with
| Ok events -> Keyseq_terminal.run events
| Error (Keyseq.Invalid_utf8 offset) ->
Printf.eprintf "invalid UTF-8 at byte %d\n" offsetSee examples/demo.ml for a complete, runnable example.
Sleep is an ordinary inter-character delay. Idle is a longer pause, following a sentence-ending . ! ?, during which a renderer may animate the cursor., ; : —) gets a Sleep pause only, no Idle.typo_rate.Random.State.t, and the library never calls Random.self_init. Same config, same unconsumed state, same input text — same output, every time.Keyseq.plan returns Error (Invalid_utf8 offset) if the input isn't valid UTF-8. offset is a byte offset.Keyseq.plan raises Invalid_argument if config violates its own preconditions (e.g. max_delay < min_delay) — this is a programmer error, not an input-validation failure.ISC. See LICENSE.