feat: add Gmail Pub/Sub watcher for inbound email automation
New ChannelAdapter that monitors Gmail via Google Cloud Pub/Sub push notifications with polling fallback. Supports OAuth2 auth, configurable watch labels, template rendering with email metadata placeholders (from, to, subject, snippet, date, id, labels). Wired into daemon lifecycle and gateway (POST /gmail/push endpoint). Includes 16 tests covering auth, templates, push notifications, and channel routing.
This commit is contained in:
+10
-1
@@ -17,7 +17,7 @@ import type { EmbeddingProvider as EmbeddingProviderInterface } from '../memory/
|
||||
import { createMemoryTools } from '../tools/builtin/index.js';
|
||||
import { GatewayServer } from '../gateway/index.js';
|
||||
import { ChannelRegistry, TelegramAdapter, WebChatAdapter, DiscordAdapter, SlackAdapter, WhatsAppAdapter } from '../channels/index.js';
|
||||
import { CronScheduler, WebhookHandler, HeartbeatMonitor } from '../automation/index.js';
|
||||
import { CronScheduler, WebhookHandler, HeartbeatMonitor, GmailWatcher } from '../automation/index.js';
|
||||
import type { InboundMessage, OutboundMessage } from '../channels/index.js';
|
||||
import { McpManager } from '../mcp/index.js';
|
||||
import { SkillRegistry, SkillInstaller, loadAllSkills } from '../skills/index.js';
|
||||
@@ -884,6 +884,15 @@ export async function startDaemon(config: Config): Promise<DaemonContext> {
|
||||
console.log(`Registered ${config.automation.webhooks.length} webhook(s)`);
|
||||
}
|
||||
|
||||
// Register Gmail watcher adapter (if configured and enabled)
|
||||
let gmailWatcher: GmailWatcher | undefined;
|
||||
if (config.automation.gmail?.enabled) {
|
||||
gmailWatcher = new GmailWatcher(config.automation.gmail, channelRegistry);
|
||||
channelRegistry.register(gmailWatcher);
|
||||
gateway.setGmailHandler(gmailWatcher);
|
||||
console.log('Registered Gmail watcher');
|
||||
}
|
||||
|
||||
// ── Register Tier 1 agent tools ─────────────────────────────
|
||||
|
||||
// Session management tools (list, history, create, delete)
|
||||
|
||||
Reference in New Issue
Block a user