Convenience: bus.use(plugin, { priority: 200 }) + keep the bus ref for flush() / auto-flush.
Replay the queue sequentially (strict FIFO). Each record is re-dispatched
through the full pipeline with its ORIGINAL idempotency key stamped on
cmd.meta.idempotencyKey, so the HTTP bridge sends the same
Idempotency-Key the backend may have already seen. The first failed
replay stops the flush — that record and everything after it stay queued.
Re-entrant calls join the in-progress flush.
Optionalbus: AsyncCommandBus<CommandMap>Load the persisted queue from storage. Call once at startup, before the first flush.
Drop every queued record (memory + storage).
Remove the window 'online' listener. Idempotent.
The object returned by createOutbox.