fathom-mcp 0.6.1 → 0.6.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fathom-mcp",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "MCP server for Fathom — vault operations, search, rooms, and cross-workspace communication",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -361,8 +361,8 @@ async function runInit(flags = {}) {
361
361
 
362
362
  let selectedAgents;
363
363
  if (nonInteractive) {
364
- // In non-interactive mode, always default to claude-code unless explicitly overridden
365
- if (flagAgent && flagAgent !== "claude-code") {
364
+ if (flagAgent) {
365
+ // Validate --agent value
366
366
  if (!AGENTS[flagAgent]) {
367
367
  const valid = Object.keys(AGENTS).join(", ");
368
368
  console.error(` Error: unknown agent "${flagAgent}". Valid agents: ${valid}`);
@@ -371,8 +371,9 @@ async function runInit(flags = {}) {
371
371
  selectedAgents = [flagAgent];
372
372
  console.log(` Agent: ${AGENTS[flagAgent].name} (--agent flag)`);
373
373
  } else {
374
- selectedAgents = ["claude-code"];
375
- console.log(` Agent: Claude Code`);
374
+ // Auto-detect: use first detected agent, or default to claude-code
375
+ selectedAgents = detected.length > 0 ? [detected[0]] : ["claude-code"];
376
+ console.log(` Agent: ${AGENTS[selectedAgents[0]].name} (auto-detected)`);
376
377
  }
377
378
  } else {
378
379
  console.log("\n Detected agents:");
File without changes
package/src/index.js CHANGED
@@ -224,6 +224,21 @@ const tools = [
224
224
  required: [],
225
225
  },
226
226
  },
227
+ {
228
+ name: "fathom_send_voice",
229
+ description:
230
+ "Send a voice message to Myra via the app. Generates speech using Kokoro TTS " +
231
+ "(am_echo 70% + bf_alice 30%) and delivers it as a playable voice bubble in the chat. " +
232
+ "Use this to reply conversationally with voice when Myra sends a voice message.",
233
+ inputSchema: {
234
+ type: "object",
235
+ properties: {
236
+ text: { type: "string", description: "Text to speak and send as voice message." },
237
+ speed: { type: "number", description: "Speech speed multiplier. Default: 1.0" },
238
+ },
239
+ required: ["text"],
240
+ },
241
+ },
227
242
  {
228
243
  name: "fathom_key_rotate",
229
244
  description:
@@ -307,23 +322,6 @@ const telegramTools = [
307
322
  required: ["contact", "file_path"],
308
323
  },
309
324
  },
310
- {
311
- name: "fathom_telegram_send_voice",
312
- description:
313
- "Send a voice message to a Telegram contact. Generates speech via Kokoro TTS, " +
314
- "converts to OGG Opus, and sends as a native Telegram voice note. " +
315
- "Contact can be a name, @username, or chat_id number.",
316
- inputSchema: {
317
- type: "object",
318
- properties: {
319
- contact: { type: "string", description: "Contact name, @username, or chat_id" },
320
- text: { type: "string", description: "Text to speak" },
321
- speed: { type: "number", description: "Speech speed multiplier. Default: 1.0" },
322
- caption: { type: "string", description: "Optional caption shown with the voice note" },
323
- },
324
- required: ["contact", "text"],
325
- },
326
- },
327
325
  ];
328
326
 
329
327
  // --- Policy evaluation tool (permission-prompt-tool for stream-json) ---------
@@ -506,6 +504,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
506
504
  });
507
505
  break;
508
506
  }
507
+ case "fathom_send_voice": {
508
+ if (!args.text) {
509
+ result = { error: "text parameter is required." };
510
+ break;
511
+ }
512
+ result = await client.voiceReply({
513
+ text: args.text,
514
+ speed: args.speed,
515
+ workspace: config.workspace,
516
+ });
517
+ break;
518
+ }
509
519
 
510
520
  // --- Key rotation ---
511
521
  case "fathom_key_rotate": {
@@ -668,42 +678,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
668
678
  break;
669
679
  }
670
680
 
671
- case "fathom_telegram_send_voice": {
672
- const voiceContactArg = args.contact;
673
- if (!voiceContactArg) { result = { error: "contact is required" }; break; }
674
- if (!args.text) { result = { error: "text is required" }; break; }
675
-
676
- // Step 1: Generate speech + convert to OGG
677
- const ttsResult = await client.speak({
678
- text: args.text,
679
- speed: args.speed,
680
- format: "ogg",
681
- });
682
- if (ttsResult.error) { result = { error: `TTS failed: ${ttsResult.error}` }; break; }
683
- if (!ttsResult.ogg_file) { result = { error: ttsResult.ogg_error || "OGG conversion failed" }; break; }
684
-
685
- // Step 2: Resolve contact
686
- const voiceContacts = await client.telegramContacts(config.workspace);
687
- const voiceList = voiceContacts?.contacts || [];
688
- let voiceChatId = parseInt(voiceContactArg, 10);
689
- if (isNaN(voiceChatId)) {
690
- const lower = voiceContactArg.toLowerCase().replace(/^@/, "");
691
- const match = voiceList.find(c =>
692
- (c.username || "").toLowerCase() === lower ||
693
- (c.first_name || "").toLowerCase() === lower ||
694
- (c.first_name || "").toLowerCase().includes(lower)
695
- );
696
- voiceChatId = match ? match.chat_id : null;
697
- }
698
- if (!voiceChatId) {
699
- result = { error: `Contact not found: ${voiceContactArg}. Use fathom_telegram_contacts to list known contacts.` };
700
- break;
701
- }
702
-
703
- // Step 3: Send as voice note
704
- result = await client.telegramSendVoice(voiceChatId, ttsResult.ogg_file, args.caption);
705
- break;
706
- }
707
681
  default:
708
682
  result = { error: `Unknown tool: ${name}` };
709
683
  }
@@ -277,6 +277,13 @@ export function createClient(config) {
277
277
  });
278
278
  }
279
279
 
280
+ async function voiceReply({ text, speed, workspace } = {}) {
281
+ return request("POST", "/api/voice/reply", {
282
+ body: { text, speed, workspace },
283
+ timeout: 300000,
284
+ });
285
+ }
286
+
280
287
  // --- Settings --------------------------------------------------------------
281
288
 
282
289
  async function getSettings() {
@@ -334,6 +341,7 @@ export function createClient(config) {
334
341
  telegramSendVoice,
335
342
  telegramStatus,
336
343
  speak,
344
+ voiceReply,
337
345
  getSettings,
338
346
  getApiKey,
339
347
  rotateKey,