Provides a shared typing-debounce mechanism used by all editor plugins (JetBrains, VS Code,
Neovim, Zed) so they share identical timing logic via the agent-doc FFI layer.
In-process state: a Mutex<HashMap<PathBuf, Instant>> (LAST_CHANGE) records the last
edit timestamp per file path.
Cross-process state: each document_changed call also writes a millisecond Unix timestamp
to .agent-doc/typing/<hash> so CLI invocations running in a separate process can detect
active typing. The hash is derived from the file path string via DefaultHasher.
Cross-process writes are best-effort and never block the caller.
is_idle / await_idle operate on in-process state (same process as the plugin).
is_typing_via_file / await_idle_via_file operate on the file-based indicator (CLI use).
Files with no recorded document_changed call are considered idle by is_idle; this
prevents await_idle from blocking forever on untracked documents.
is_tracked distinguishes “never seen” from “seen and idle” for non-blocking probes.
await_idle polls every 100 ms and returns false if timeout_ms expires before idle.