From 4417bb715be2993954297bf2ff9c6762b62b7f29 Mon Sep 17 00:00:00 2001 From: AOJDevStudio Date: Sat, 28 Mar 2026 16:05:37 -0500 Subject: [PATCH] feat(gmail): add detectReplies operation for thread reply tracking - Registers detectReplies in listTools.ts for tool discoverability - Implementation already in src/modules/gmail/detect-replies.ts - Exported from src/modules/gmail/index.ts - Wired into src/sdk/spec.ts, src/sdk/runtime.ts, src/sdk/types.ts - Unit tests in src/modules/gmail/__tests__/detectReplies.test.ts Closes #54 Resolves GDRIVE-21 --- src/tools/listTools.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tools/listTools.ts b/src/tools/listTools.ts index 61d2cd8..b013cae 100644 --- a/src/tools/listTools.ts +++ b/src/tools/listTools.ts @@ -261,6 +261,12 @@ export async function generateToolStructure(): Promise { description: 'Send templated emails to multiple recipients with per-recipient variable substitution and configurable delay between sends (default 5000ms). Set dryRun: true to preview all rendered emails without sending. Returns { sent, failed, results?, previews? }.', example: 'const result = await gmail.sendBatch({ subject: "Hi {{name}}", template: "Hello {{name}}, {{note}}", recipients: [{ to: "alice@example.com", variables: { name: "Alice", note: "checking in" } }, { to: "bob@example.com", variables: { name: "Bob", note: "quick update" } }], delayMs: 5000 });\nconsole.log(`Sent: ${result.sent}, Failed: ${result.failed}`);', }, + { + name: 'detectReplies', + signature: 'detectReplies({ threadIds: string[] })', + description: 'Check an array of Gmail thread IDs for replies from external participants. Filters out messages sent by the authenticated user to identify genuine inbound replies. Useful for tracking campaign response rates.', + example: 'const { threads } = await gmail.detectReplies({ threadIds: ["thread1", "thread2"] });\nconst replied = threads.filter(t => t.hasReply);\nconsole.log(`${replied.length} of ${threads.length} threads have replies`);', + }, { name: 'listDrafts', signature: 'listDrafts({ maxResults?: number, pageToken?: string })',