Skip to content

feat: add clawemail channel#1719

Open
gzlicanyi wants to merge 44 commits intonetease-youdao:mainfrom
gzlicanyi:develop
Open

feat: add clawemail channel#1719
gzlicanyi wants to merge 44 commits intonetease-youdao:mainfrom
gzlicanyi:develop

Conversation

@gzlicanyi
Copy link
Copy Markdown

Summary

将 Lobster Email (龙虾邮箱) 作为新的 IM 网关通道进行集成,支持基于电子邮件的 AI 代理通信,并具有完整的配置 UI、配置同步、会话映射和连接性验证功能。

Related Issue

Fixes #(issue number)

Changes Made

  • 在 package.json 的 OpenClaw 插件列表中添加了 clawemail-email 插件声明
  • 在 platform/constants.ts 中添加了电子邮件平台类型、注册表和图标 (public/email.svg)
  • 通过 openclawConfigSync.ts(凭据 → 环境变量)和
    openclawChannelSessionSync.ts(账户级代理绑定)实现了电子邮件通道配置同步
  • 在 imGatewayManager.ts 和 main.ts 中添加了电子邮件网关生命周期和连接性测试处理程序
  • 在渲染器中创建了电子邮件通道 UI:IM 设置面板集成、开/关切换、连接性检查、允许发件人/代理域配置
  • 在 preload.ts 中添加了 IPC 通道,在 imSlice.ts 中添加了 Redux 操作,并在 im.ts 中添加了服务调用
  • 在 validation.ts 中添加了电子邮件地址验证
  • 在主进程和渲染器进程的 i18n.ts 中添加了完整的中英文国际化支持
  • 将电子邮件依赖项升级到 @clawemail/email@0.9.12

Type of Change

  • [] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] Code refactoring
  • Documentation update
  • Performance improvement
  • Other (please describe):

Testing

  • Tested locally
  • Added new tests
  • Updated existing tests
  • Manual testing performed

Screenshots (if applicable)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Electron-Specific Changes

  • Changes to main process (src/main/)
  • Changes to preload script (src/main/preload.ts)
  • Changes to IPC communication
  • Changes to window management
  • None

Additional Notes

电子邮件通道实现分三个阶段进行:(1) 核心集成,(2) 配置简化(仅限电子邮件 + API 密钥),(3) 开关状态管理和 UI 优化。新的电子邮件实例默认为禁用状态,并在启用时进行连接性验证。

gzlicanyi and others added 30 commits April 9, 2026 19:57
- Add missing DEFAULT_EMAIL_*_CONFIG constants
- Simplify environment variable naming (EMAIL_1 not EMAIL_EMAIL_1)
- Standardize session key format and defensive parsing
- Add complete IPC channel specifications
- Add validation function definitions (isValidEmail, validateConfig)
- Add test connection implementation details
- Fix agent binding race condition with config caching
- Add plugin installation error handling policy
- Fix internationalization hardcoded strings
- Document lastInboundAt/lastOutboundAt as runtime stats
- Make email field optional in IMGatewayConfig for backward compatibility
- Clarify type system modifications in types.ts
- 添加 im:email:instance:config:set IPC 通道,消除全量写入的并发竞争
- instanceId 生成改用 crypto.randomUUID(),避免时间戳碰撞
- email 加入 MULTI_INSTANCE_PLATFORMS,统一走标准 agent binding 解析
- setEmailConfig 改用 setConfigValue,修复 updated_at NOT NULL 约束报错
- email:testConnection 的 require() 添加 try-catch 保护
- 移除 email 在 IMGatewayConfig/Status 中的 optional 标记,减少冗余 null check
- 升级 @clawemail/email 插件版本至 0.9.11
- email 平台 region 从 global 改为 china
- 更新 API Key 获取地址为正式 URL
- 添加 email.svg logo 资源
- 调整 i18n 翻译 key
# Conflicts:
#	src/main/i18n.ts
#	src/main/libs/openclawConfigSync.ts
#	src/main/main.ts
#	src/renderer/components/Settings.tsx
#	src/renderer/services/i18n.ts
#	src/renderer/types/electron.d.ts
EmailSkillConfig 是邮件工具/skill 配置,IM 设置中的 EmailSettings 是
邮件 IM 通道配置,两者职责不同不应混用
- email 实例 header 改为与 QQ 一致的单行布局(状态、开关、删除按钮)
- 开关改用 updateEmailInstanceConfig(syncGateway: true)修复关闭后仍显示已连接
- 删除按钮改为直接调用 imService.deleteEmailInstance 修复沙箱环境下无响应
- 新增真实连通性测试:IMAP 模式验证登录,WS 模式通过 API Key 换 token 验证
- 连通性测试按当前选中实例测试,避免多实例串测
- 修复 UUID instanceId 生成环境变量名含连字符导致密码无法传递
将 A2A 开关、Agent 域名、最大往返次数配置补充到 IMSettings
内联表单中,删除未使用的独立 EmailSettings 组件
将 A2A 配置改为高级设置折叠面板,开关改为 toggle 按钮样式,
A2A 默认开启,域名提示文案改为逗号分隔
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gzlicanyi and others added 14 commits April 16, 2026 11:29
When enabling an email instance, run testGateway first to verify
connectivity. If the test fails (verdict === 'fail'), the toggle stays
off and an alert is shown. Turning off still works immediately without
a connectivity check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Make loading/normal className branches mutually exclusive to prevent
conflicting bg-* classes when both loading and enabled states are true.
- Change DEFAULT_EMAIL_INSTANCE_CONFIG.enabled to false in main process
  types (was only changed in renderer types, not the one used for actual
  instance creation)
- Sync main process default transport to 'ws' to match renderer
- Add dialog:showMessageBox IPC channel for reliable native dialogs
- Replace alert() with window.electron.dialog.showMessageBox() for the
  connectivity failure notification (alert() may not show in sandboxed
  Electron renderer)
Merge main branch changes into develop, resolving conflicts in 11 files.
Key changes from main:
- WeCom multi-instance support (wecom-openclaw-plugin)
- DingTalk OpenClaw channel constant refactoring
- Existing config preservation to prevent gateway restart loops
- Stale plugin cleanup logic
- acpx plugin disable
- Removed deprecated yd_cowork engine and related files
- OpenClaw session model override support
- Various bug fixes and improvements

Develop branch email/clawEmail changes preserved alongside main's additions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 感谢你提交第一个 Pull Request!欢迎参与 LobsterAI 社区。

请确认 PR 已满足以下要求:

  • 遵循 Conventional Commits 规范
  • 包含清晰的变更说明
  • UI 变更附上截图
  • 通过所有 CI 检查

维护者会尽快 Review,感谢你的贡献!


👋 Thanks for your first pull request to LobsterAI! We appreciate your contribution.

Please make sure your PR:

  • Follows the Conventional Commits spec
  • Includes a clear description of the changes
  • Has screenshots for UI changes
  • Passes all CI checks

A maintainer will review your PR soon. Thank you! 🚀

@gzlicanyi gzlicanyi changed the title Develop feat: add clawemail channel Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant