@chamade/mcp-server 1.1.4 → 1.1.5

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -724,12 +724,23 @@ function channelUnwatchCall(callId) {
724
724
  */
725
725
  function channelWatchInbox() {
726
726
  let retryDelay = 1000;
727
+ let retryCount = 0;
728
+ let wasConnected = false;
729
+ const WARN_AFTER = 3; // warn agent after 3 consecutive failures
727
730
  function connect() {
728
731
  const url = `${CHAMADE_WS_URL}/api/inbox/stream?api_key=${API_KEY}`;
729
732
  const ws = new WebSocket(url);
730
733
  ws.on("open", () => {
734
+ if (retryCount > 0) {
735
+ console.error(`[chamade-channel] Inbox WS reconnected after ${retryCount} retries`);
736
+ channelPush("Inbox connection restored. Messages received during the outage may have been lost.", { type: "inbox_reconnected" });
737
+ }
738
+ else {
739
+ console.error("[chamade-channel] Inbox WS connected");
740
+ }
731
741
  retryDelay = 1000;
732
- console.error("[chamade-channel] Inbox WS connected");
742
+ retryCount = 0;
743
+ wasConnected = true;
733
744
  });
734
745
  ws.on("message", async (raw) => {
735
746
  try {
@@ -783,10 +794,17 @@ function channelWatchInbox() {
783
794
  }
784
795
  });
785
796
  ws.on("close", () => {
797
+ retryCount++;
798
+ if (retryCount === WARN_AFTER && wasConnected) {
799
+ console.error(`[chamade-channel] Inbox WS: ${retryCount} reconnect attempts failed`);
800
+ channelPush(`Inbox connection lost. ${retryCount} reconnect attempts failed — messages may be missed until connection is restored.`, { type: "inbox_disconnected" });
801
+ }
802
+ console.error(`[chamade-channel] Inbox WS reconnecting in ${retryDelay / 1000}s (attempt ${retryCount})`);
786
803
  setTimeout(connect, retryDelay);
787
804
  retryDelay = Math.min(retryDelay * 2, 30_000);
788
805
  });
789
- ws.on("error", () => {
806
+ ws.on("error", (err) => {
807
+ console.error(`[chamade-channel] Inbox WS error: ${err.message || err}`);
790
808
  // Close handler will fire next and handle reconnection
791
809
  });
792
810
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chamade/mcp-server",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "MCP server for Chamade — voice gateway for AI agents. Join Discord, Teams, Meet, Telegram, SIP, Zoom meetings and interact via speech and text. Supports Claude Code channel mode for push events.",
5
5
  "type": "module",
6
6
  "bin": {