export class ShardReadiness { constructor() { this.bootstrapped = false; this.shards = new Set(); } bootstrap(shardIds) { this.bootstrapped = true; for (const shardId of shardIds) this.shards.add(shardId); } ready(shardId) { if (!this.bootstrapped) return false; this.shards.add(shardId); return true; } resume(shardId) { return this.ready(shardId); } unavailable(shardId) { this.shards.delete(shardId); } has(shardId) { return this.shards.has(shardId); } }