Skip to content

飞书:审批和任务(只读)、飞书邮箱进今天页、收件箱和知识库 - #58

Merged
NginxL merged 2 commits into
mainfrom
feat/feishu-mail-approvals
Dec 3, 2026
Merged

NginxL merged 2 commits into
mainfrom
feat/feishu-mail-approvals

Conversation

@NginxL

@NginxL NginxL commented Dec 3, 2026

Copy link
Copy Markdown
Owner

做了什么

飞书扩展新增「审批和飞书任务」(只读)和「飞书邮箱」,都经你自己的 lark-cli 读取,渲染只读本地缓存。

审批和任务

  • 后台读「待我审批」(approval tasks query --topic 1)和分给我的飞书任务(task +get-my-tasks),有人看 5 分钟一轮,没人看 15 分钟一轮。
  • 今天页新增「审批和任务」块:待审批最多 5 条(标题、发起人、类型;之后新出现的显示多久前出现),任务最多 5 条(逾期标红、今天到期标黄),点开到飞书或审批系统里处理。状态块「需要我」那格加上审批、任务的数量。
  • 只读:不调用任何同意、拒绝、转交、完成。

飞书邮箱

  • 后台读收件箱最近 20 封、未读 20 封、已发送 20 封(第一次回看 14 天),新邮件批量读正文。
  • 收件箱:发给我(不只是抄送)、标为重要、未读、发件人不像通知的邮件,一个邮件会话一条进 Persona 收件箱;读了或我回了就结束。
  • 知识库:重要邮件和我发的邮件按会话进归档(kind mail,每封一条,带发件人邮箱,方便关联到人),和会议各用独立的游标位置。
  • 今天页新增「邮件」块:48 小时内的重要邮件,点开在页面里看正文。
  • 工具:只读 matefeishu_mail(list / read);写工具 matefeishu_mail_reply,走确认卡片:卡片上列出发件邮箱、To / Cc、主题、全文,以及「直接发出」还是「只存草稿」。确认卡片的内容存进库里,批准前扩展重启也能核对;同一请求只执行一次;换了账号不发;超时或看不懂的回执当「可能已发出」,明确被拒当「没发出」。
  • 设置:approvals、mail、mail_inbox、mail_kb,都默认开。

顺手改

  • 写工具说明里的「在手机上确认」改成「在确认卡片上确认」(你在网页上点卡片)。微信扩展的说明文字跟着变,行为不变。

没有新增 hub 权限、界面位置或命令行工具,升级不需要批准。

怎么验证的

  • bash scripts/test.sh 和 PYTHON=/usr/bin/python3 bash scripts/test.sh 全部通过(core、飞书、微信三组)。
  • 在本机临时库里用真实 lark-cli 只读跑过审批、任务和邮件同步(不在仓库里,没有发任何邮件):审批 7 条、任务 1 条;邮件 14 天 8 封(7 封重要)、邮箱地址识别成功、7 个邮件会话可进知识库;每轮约 4 秒,在后台。

没做的

  • 邮件回复的真实发送没有实测。用 lark-cli 的 --dry-run 校验过两条路:只存草稿的请求正确;直接发出需要飞书应用有 mail:user_mailbox.message:send 权限,目前没有,批准后会明确提示「没发出」并给出授权命令。开不开这个权限由你决定。
  • 未读超过 20 封时,收件箱状态只依据这一轮取到的 20 封。

🤖 Generated with Claude Code

NginxL and others added 2 commits December 4, 2026 02:56
… 今天, the Inbox and the knowledge base

- sync_worker.py: the background round shared by the lark-cli caches (looked-at pacing, one owner per open id).
- approvals.py: pending approvals and the user's open tasks, a 审批和任务 block on 今天 and counts in 需要我;
  read-only (never approves, rejects or completes anything).
- mail.py / mail_store.py: the inbox, unread and sent lists, bodies read once; important direct unread mail
  becomes an Inbox item per thread (done when read or replied), important and own mail goes to the knowledge base
  as "mail" chats (its own archive feed), a 邮件 block with an in-page reader, matefeishu_mail (read) and
  matefeishu_mail_reply (behind the confirmation card; cards kept in the store across restarts).
- Core: a platform hook for extra write tools; the write tools' wording says 确认卡片 instead of 手机上确认.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 飞书:只读同步待我审批的单子和分给我的飞书任务,今天页加「审批和任务」块,「需要我」那格带上数量;不替你同意、拒绝或完成。
- 飞书:同步飞书邮箱(收件箱、未读、已发送),发给我的重要未读邮件进收件箱(读了或回了就结束),重要邮件和我发的邮件按会话进知识库,今天页加「邮件」块并能在页面里看正文;matefeishu_mail 读邮件,matefeishu_mail_reply 回邮件要在确认卡片上批准。
- 核心:平台写工具钩子;写工具说明里的「在手机上确认」改为「在确认卡片上确认」(微信只改了说明文字)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NginxL
NginxL merged commit 9945d8d into main Dec 3, 2026
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