call-me-cloud-mcp 1.0.3 → 1.1.0

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/index.ts +53 -4
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -125,22 +125,71 @@ async function main() {
125
125
  try {
126
126
  if (request.params.name === 'initiate_call') {
127
127
  const { message } = request.params.arguments as { message: string };
128
- const result = await apiCall('/api/call', { message }) as { callId: string; response: string };
128
+ const result = await apiCall('/api/call', { message }) as {
129
+ callId: string;
130
+ response: string;
131
+ contactMode?: 'voice' | 'whatsapp';
132
+ whatsappSessionWindow?: {
133
+ expiresAt: number;
134
+ minutesRemaining: number;
135
+ status: 'active' | 'expiring_soon' | 'expired';
136
+ };
137
+ };
138
+
139
+ let responseText = `Call initiated successfully.\n\nCall ID: ${result.callId}`;
140
+
141
+ // Add contact mode information if present
142
+ if (result.contactMode) {
143
+ responseText += `\nContact mode: ${result.contactMode}`;
144
+
145
+ // Add WhatsApp session window info if in WhatsApp mode
146
+ if (result.contactMode === 'whatsapp' && result.whatsappSessionWindow) {
147
+ const { minutesRemaining, status } = result.whatsappSessionWindow;
148
+ responseText += `\nWhatsApp session: ${Math.round(minutesRemaining)} minutes remaining`;
149
+
150
+ if (status === 'expiring_soon') {
151
+ responseText += ` (expires soon - switch to template messages after expiry)`;
152
+ }
153
+ }
154
+ }
155
+
156
+ responseText += `\n\nUser's response:\n${result.response}\n\nUse continue_call to ask follow-ups or end_call to hang up.`;
129
157
 
130
158
  return {
131
159
  content: [{
132
160
  type: 'text',
133
- text: `Call initiated successfully.\n\nCall ID: ${result.callId}\n\nUser's response:\n${result.response}\n\nUse continue_call to ask follow-ups or end_call to hang up.`,
161
+ text: responseText,
134
162
  }],
135
163
  };
136
164
  }
137
165
 
138
166
  if (request.params.name === 'continue_call') {
139
167
  const { call_id, message } = request.params.arguments as { call_id: string; message: string };
140
- const result = await apiCall(`/api/call/${call_id}/continue`, { message }) as { response: string };
168
+ const result = await apiCall(`/api/call/${call_id}/continue`, { message }) as {
169
+ response: string;
170
+ contactMode?: 'voice' | 'whatsapp';
171
+ whatsappSessionWindow?: {
172
+ expiresAt: number;
173
+ minutesRemaining: number;
174
+ status: 'active' | 'expiring_soon' | 'expired';
175
+ };
176
+ };
177
+
178
+ let responseText = `User's response:\n${result.response}`;
179
+
180
+ // Add WhatsApp session window warning if expiring soon
181
+ if (result.contactMode === 'whatsapp' && result.whatsappSessionWindow) {
182
+ const { minutesRemaining, status } = result.whatsappSessionWindow;
183
+
184
+ if (status === 'expiring_soon') {
185
+ responseText += `\n\n⚠️ WhatsApp session expiring in ${Math.round(minutesRemaining)} minutes. Consider wrapping up or asking user to reply to extend window.`;
186
+ } else if (status === 'expired') {
187
+ responseText += `\n\n⚠️ WhatsApp session expired. Future messages require approved templates.`;
188
+ }
189
+ }
141
190
 
142
191
  return {
143
- content: [{ type: 'text', text: `User's response:\n${result.response}` }],
192
+ content: [{ type: 'text', text: responseText }],
144
193
  };
145
194
  }
146
195
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "call-me-cloud-mcp",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "MCP client for Call-Me Cloud - lets Claude call you via phone",
5
5
  "type": "module",
6
6
  "bin": {