Files
nanoclaw/.claude/skills/add-gmail/modify/src/index.ts.intent.md
Fritzzzz 6dd90829e1 refactor: remove GMAIL_CHANNEL_ENABLED env flag from add-gmail skill
Channel vs tool-only is now a code-level decision at skill apply time.
If the user chose channel mode, GmailChannel is wired unconditionally.
If tool-only, no channel code is added. No runtime flag needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 23:46:24 +02:00

1.1 KiB

Intent: src/index.ts modifications

What changed

Added Gmail as a channel.

Key sections

Imports (top of file)

  • Added: GmailChannel from ./channels/gmail.js

main()

  • Added Gmail channel creation:
    const gmail = new GmailChannel(channelOpts);
    channels.push(gmail);
    await gmail.connect();
    
  • Gmail uses the same channelOpts callbacks as other channels
  • Incoming emails are delivered to the main group (agent decides how to respond, user can configure)

Invariants

  • All existing message processing logic (triggers, cursors, idle timers) is preserved
  • The runAgent function is completely unchanged
  • State management (loadState/saveState) is unchanged
  • Recovery logic is unchanged
  • Container runtime check is unchanged
  • Any other channel creation is untouched
  • Shutdown iterates channels array (Gmail is included automatically)

Must-keep

  • The escapeXml and formatMessages re-exports
  • The _setRegisteredGroups test helper
  • The isDirectRun guard at bottom
  • All error handling and cursor rollback logic in processGroupMessages
  • The outgoing queue flush and reconnection logic