@chamade/mcp-server 1.1.4 → 1.1.6
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.
- package/dist/index.js +21 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -696,6 +696,7 @@ function channelWatchCall(callId) {
|
|
|
696
696
|
else if (!_closedWatchers.has(callId)) {
|
|
697
697
|
console.error(`[chamade-channel] Call ${callId}: max retries (${MAX_RETRIES}) reached, giving up`);
|
|
698
698
|
channelUnwatchCall(callId);
|
|
699
|
+
channelPush(`Call ${callId} ended (connection lost). Use chamade_leave to clean up, or chamade_join to reconnect.`, { type: "call_ended", call_id: callId });
|
|
699
700
|
}
|
|
700
701
|
});
|
|
701
702
|
ws.on("error", () => {
|
|
@@ -724,12 +725,23 @@ function channelUnwatchCall(callId) {
|
|
|
724
725
|
*/
|
|
725
726
|
function channelWatchInbox() {
|
|
726
727
|
let retryDelay = 1000;
|
|
728
|
+
let retryCount = 0;
|
|
729
|
+
let wasConnected = false;
|
|
730
|
+
const WARN_AFTER = 3; // warn agent after 3 consecutive failures
|
|
727
731
|
function connect() {
|
|
728
732
|
const url = `${CHAMADE_WS_URL}/api/inbox/stream?api_key=${API_KEY}`;
|
|
729
733
|
const ws = new WebSocket(url);
|
|
730
734
|
ws.on("open", () => {
|
|
735
|
+
if (retryCount > 0) {
|
|
736
|
+
console.error(`[chamade-channel] Inbox WS reconnected after ${retryCount} retries`);
|
|
737
|
+
channelPush("Inbox connection restored. Messages received during the outage may have been lost.", { type: "inbox_reconnected" });
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
console.error("[chamade-channel] Inbox WS connected");
|
|
741
|
+
}
|
|
731
742
|
retryDelay = 1000;
|
|
732
|
-
|
|
743
|
+
retryCount = 0;
|
|
744
|
+
wasConnected = true;
|
|
733
745
|
});
|
|
734
746
|
ws.on("message", async (raw) => {
|
|
735
747
|
try {
|
|
@@ -783,10 +795,17 @@ function channelWatchInbox() {
|
|
|
783
795
|
}
|
|
784
796
|
});
|
|
785
797
|
ws.on("close", () => {
|
|
798
|
+
retryCount++;
|
|
799
|
+
if (retryCount === WARN_AFTER && wasConnected) {
|
|
800
|
+
console.error(`[chamade-channel] Inbox WS: ${retryCount} reconnect attempts failed`);
|
|
801
|
+
channelPush(`Inbox connection lost. ${retryCount} reconnect attempts failed — messages may be missed until connection is restored.`, { type: "inbox_disconnected" });
|
|
802
|
+
}
|
|
803
|
+
console.error(`[chamade-channel] Inbox WS reconnecting in ${retryDelay / 1000}s (attempt ${retryCount})`);
|
|
786
804
|
setTimeout(connect, retryDelay);
|
|
787
805
|
retryDelay = Math.min(retryDelay * 2, 30_000);
|
|
788
806
|
});
|
|
789
|
-
ws.on("error", () => {
|
|
807
|
+
ws.on("error", (err) => {
|
|
808
|
+
console.error(`[chamade-channel] Inbox WS error: ${err.message || err}`);
|
|
790
809
|
// Close handler will fire next and handle reconnection
|
|
791
810
|
});
|
|
792
811
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chamade/mcp-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
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": {
|