fix: correct reconnect attempts, add exhausted event, merge param methods
- scheduleReconnect: check maxAttempts before incrementing so maxAttempts:N
yields N real reconnects (was N-1) — matches documented contract
- emit new "exhausted" event when reconnect gives up after all attempts/cycles;
wire through WebSocketClient, document in README + JSDoc
- merge setParams into updateParams(params, { immediate }); setParams kept as
deprecated alias for updateParams(params, { immediate: false })
- rewrite jetstream demo to z.discriminatedUnion + one handler for O(1) dispatch
instead of O(handlers) safeParse per message
- add regression tests: off-by-one attempt count, exhausted event, deferred
params, setParams alias
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: pi (MiniMax-M3) <noreply@minimax.io>