Skip to content

feat(email): add email-joke agent with Gmail OAuth and IMAP support#561

Merged
zbigniewsobiecki merged 1 commit intodevfrom
feature/email-client-tools
Feb 26, 2026
Merged

feat(email): add email-joke agent with Gmail OAuth and IMAP support#561
zbigniewsobiecki merged 1 commit intodevfrom
feature/email-client-tools

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

This PR adds a new email-joke agent that can respond to emails with humorous replies, along with comprehensive email integration infrastructure including Gmail OAuth and IMAP/SMTP support.

Key Features

  • Email-Joke Agent: New agent type for responding to emails with jokes

    • Agent definition with prompts and gadget configuration
    • Reads unread emails, sends joke replies, marks emails as read
    • Configurable sender email filter
  • Email Integration Infrastructure

    • Gmail OAuth support with browser-based authentication flow
    • IMAP/SMTP support for any email provider
    • Credential management per integration role
    • Email wizard UI for multi-step setup
  • CLI Commands

    • cascade email integration-set - Configure email integration
    • cascade email joke-config - Configure sender email filter
    • cascade email oauth - Gmail OAuth authentication
    • cascade email verify - Verify IMAP connection
  • Database Migrations

    • Migration 0018: Gmail OAuth token storage
    • Migration 0019: Make repo column optional (for email-only projects)

Code Quality Improvements

  • Added error handling to markEmailAsSeen() in email client
  • Fixed duplicate comment in email/client.ts
  • Added parseEmailJokeTriggers() helper with proper type safety
  • Updated triggerConfig schema to allow null senderEmail
  • Added guards for email-only projects in setup-webhooks tool
  • Refactored CLI joke-config to reduce cognitive complexity

Tests Added

  • Tests for EmailJokeTriggerConfigSchema
  • Tests for parseEmailJokeTriggers and resolveEmailJokeTriggerConfig
  • Tests for markEmailAsSeen gadget function

Test plan

  • Run npm test - all 3330 tests pass
  • Run npm run typecheck - no type errors
  • Run npm run lint - no lint errors
  • Create email-only project via dashboard (no repo)
  • Configure Gmail OAuth integration
  • Configure IMAP/SMTP integration
  • Set sender email filter via CLI
  • Trigger email-joke agent manually

🤖 Generated with Claude Code

## Email-Joke Agent
- New agent type for responding to emails with humorous replies
- Agent definition in YAML with prompts and gadget configuration
- Reads unread emails, sends joke replies, marks as read

## Email Integration
- Gmail OAuth support with browser-based authentication flow
- IMAP/SMTP support for any email provider
- Credential management per integration role (imap_host, smtp_port, etc.)
- Email wizard UI for setup with multi-step flow
- CLI commands: email integration-set, joke-config, oauth, verify

## Database Schema
- Migration 0018: Gmail OAuth token storage
- Migration 0019: Make repo column optional (for email-only projects)
- Updated ProjectConfigRaw and ProjectRow types

## UI Improvements
- Email wizard component with Gmail OAuth and IMAP configuration
- OAuth callback route for Gmail authentication
- Project forms now support optional repo field
- EmailJokeConfig component for sender email filtering

## Code Quality Fixes
- Added error handling to markEmailAsSeen() in email client
- Fixed duplicate comment in email/client.ts
- Added parseEmailJokeTriggers() helper with proper type safety
- Updated triggerConfig schema to allow null senderEmail
- Added guards for email-only projects in setup-webhooks tool
- Refactored CLI joke-config to reduce cognitive complexity

## Tests
- Added tests for EmailJokeTriggerConfigSchema
- Added tests for parseEmailJokeTriggers and resolveEmailJokeTriggerConfig
- Added tests for markEmailAsSeen gadget function

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 1a43d0d into dev Feb 26, 2026
6 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the feature/email-client-tools branch February 26, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant