setup-cc-room 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48778,6 +48778,18 @@ var PeerConnector = class extends import_node_events3.EventEmitter {
48778
48778
  const conn = this.connections.get(key);
48779
48779
  return conn?.ws.readyState === wrapper_default.OPEN || false;
48780
48780
  }
48781
+ /** 退室時: 再接続せずに当該ルームの outbound を切る */
48782
+ disconnectRoom(roomId) {
48783
+ for (const [key, conn] of [...this.connections.entries()]) {
48784
+ if (conn.roomId !== roomId) continue;
48785
+ conn.skipReconnect = true;
48786
+ this.cleanupConnection(conn);
48787
+ if (conn.ws.readyState === wrapper_default.OPEN || conn.ws.readyState === wrapper_default.CONNECTING) {
48788
+ conn.ws.close(1e3, "Left room");
48789
+ }
48790
+ this.connections.delete(key);
48791
+ }
48792
+ }
48781
48793
  cleanupConnection(conn) {
48782
48794
  if (conn.pingInterval) {
48783
48795
  clearInterval(conn.pingInterval);
@@ -51252,6 +51264,12 @@ ${conversationText}`
51252
51264
  const error2 = err && typeof err === "object" ? err : {};
51253
51265
  const status = typeof error2.status === "number" ? error2.status : void 0;
51254
51266
  const headers = error2.headers && typeof error2.headers === "object" ? error2.headers : void 0;
51267
+ if (status === 401 || status === 403) {
51268
+ log9.warn({ err, status }, "Auth failed, entering fallback mode");
51269
+ this.fallbackMode = true;
51270
+ this.fallbackUntil = Date.now() + SUMMARIZER_FALLBACK_DURATION_MS;
51271
+ return this.localFallbackSummary(turns);
51272
+ }
51255
51273
  if (attempt === SUMMARIZER_MAX_RETRIES) {
51256
51274
  log9.warn({ err }, "All retries exhausted, entering fallback mode");
51257
51275
  this.fallbackMode = true;
@@ -53167,7 +53185,9 @@ async function main() {
53167
53185
  if (!meta) {
53168
53186
  return { ok: false, message: "Room not found" };
53169
53187
  }
53188
+ peerConnector.disconnectRoom(body.room_id);
53170
53189
  server.unregisterRoom(body.room_id);
53190
+ discovery.removeRoomAdvertisement(body.room_id);
53171
53191
  notifier.notify({ type: "room_closed", room: meta.name });
53172
53192
  const remaining = storage.listRooms().filter((r2) => r2.id !== body.room_id).map((r2) => r2.id);
53173
53193
  showState.onRoomLeave(body.room_id, remaining);