run events executes every event in events in order and returns () once the last one has completed.
Insert writes the codepoint's UTF-8 encoding to out.
Delete erases exactly one previously written codepoint: moves the cursor back one terminal column, erases that column, moves back again.
Sleep d waits d seconds in real time before continuing; no output is produced.
Idle d waits d seconds in real time, during which the cursor blinks at a fixed 2 Hz rate (500ms visible, 500ms hidden), starting visible. A final partial half-period shorter than 500ms is a plain wait with no further toggle. The cursor is left visible once Idle ends, before the next event runs.
Sound s calls on_sound s. on_sound defaults to a no-op — this module never produces audible output on its own.
out defaults to stdout. No check is made that out refers to a terminal; against a non-tty channel (e.g. a redirected file), the ANSI sequences for Delete and cursor blinking are written as literal bytes rather than interpreted, which is harmless but will look like escape-code noise if inspected directly.
Failure. IO failures on out (a closed channel, a broken pipe) are not caught here; they propagate as Sys_error. This function otherwise assumes its input satisfies the invariants documented on Keyseq.event — in particular, that Delete is never applied to an empty buffer — and performs no defensive check for a violation that only a bug in Keyseq.plan, not a runtime condition, could produce.