Skip to content

docs(mail): document sender allow and block APIs#1938

Closed
infeng wants to merge 1 commit into
larksuite:mainfrom
infeng:feat/0a93e67
Closed

docs(mail): document sender allow and block APIs#1938
infeng wants to merge 1 commit into
larksuite:mainfrom
infeng:feat/0a93e67

Conversation

@infeng

@infeng infeng commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Documents the generated sender allow-list and block-list API resources so they are discoverable to CLI users and agents.

  • Adds list, batch_create, and batch_remove documentation for both resources.
  • Distinguishes the readonly list scope from the modify write scope.
  • Keeps the operations as native Meta API commands without a shortcut.

Validation:

  • make build
  • resource help for both resources
  • dry-run coverage for all six methods

Summary by CodeRabbit

  • Documentation
    • Expanded the mail feature guide with clearer workflows for searching recipients, confirming messages, and verifying send status.
    • Added guidance for timed sending, shared mailboxes and aliases, recall, sharing mail to chat, and calendar-invite emails.
    • Added HTML formatting, linting, and content-control guidance, including updated style rules.
    • Updated shortcut, API resource, and permissions references, including documentation for additional shortcuts.

Make the generated sender-list operations discoverable with accurate read and write scope guidance.
@github-actions github-actions Bot added domain/mail PR touches the mail domain size/L Large or sensitive change across domains or core paths labels Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

扩展邮件技能的工作流、安全确认、发送与撤回说明,新增 HTML lint、模板、快捷命令、API 资源及权限表文档,并补充收件人搜索、别名发送和多草稿发送指导。

Changes

Mail skill documentation

Layer / File(s) Summary
Workflow and recipient guidance
skills/lark-mail/SKILL.md
更新启动流程、首次使用前的 -h 要求、邮件规则概念,以及收件人搜索和确认流程。
Mail action and send lifecycle
skills/lark-mail/SKILL.md
补充发送确认、send_status 校验、定时发送、send_as、撤回、IM 分享、日历邀请和正文格式说明。
HTML, templates, and API usage
skills/lark-mail/SKILL.md
新增 HTML 风格与 lint 规则,禁止手工构造 raw EML,并扩展模板及原生 API 使用说明。
Shortcut and permission reference
skills/lark-mail/SKILL.md
更新快捷命令说明,新增 +draft-send,并扩展 API 资源与权限映射表。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • larksuite/cli#1922:同样更新邮件技能中的 HTML lint、发送确认、send_as+draft-send 和 API 资源说明。
  • larksuite/cli#1893:涉及邮件 HTML/lint、确认式写入流程及相关邮件操作规范。
  • larksuite/cli#1527:同样调整邮件工作流、-h 指引、消息读取及 API 文档结构。

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: documenting sender allow/block API resources.
Description check ✅ Passed The description covers summary, changes, and validation, with only the Related Issues section left incomplete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/lark-mail/SKILL.md`:
- Line 521: Update the +draft-send entry in the skills index to document its
required --yes confirmation gate and the preview behavior when confirmation is
omitted, matching the shortcut implementation’s contract; if the implementation
differs, align both to one exact flag and behavior.
- Around line 301-309: Update the calendar-invite example in the mail send
command to use a date after July 17, 2026, while keeping the event’s start/end
times and all other example arguments consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ed9b3448-04b4-4b57-bf6c-b39bdc259873

📥 Commits

Reviewing files that changed from the base of the PR and between 6c14c42 and 08381ad.

📒 Files selected for processing (1)
  • skills/lark-mail/SKILL.md

Comment thread skills/lark-mail/SKILL.md
Comment on lines +301 to +309
lark-cli mail +send --as user \
--to alice@example.com --cc bob@example.com \
--subject '产品评审' \
--body '<p>请参加本次产品评审会议。</p>' \
--event-summary '产品评审' \
--event-start '2026-05-10T14:00+08:00' \
--event-end '2026-05-10T15:00+08:00' \
--event-location '5F 大会议室' \
--confirm-send

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use a future date in the calendar-invite example.

2026-05-10 is already in the past as of July 17, 2026. Copying this example can produce an invalid or rejected calendar invitation.

Proposed fix
-    --event-start '2026-05-10T14:00+08:00' \
-    --event-end '2026-05-10T15:00+08:00' \
+    --event-start '2027-05-10T14:00+08:00' \
+    --event-end '2027-05-10T15:00+08:00' \
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
lark-cli mail +send --as user \
--to alice@example.com --cc bob@example.com \
--subject '产品评审' \
--body '<p>请参加本次产品评审会议。</p>' \
--event-summary '产品评审' \
--event-start '2026-05-10T14:00+08:00' \
--event-end '2026-05-10T15:00+08:00' \
--event-location '5F 大会议室' \
--confirm-send
lark-cli mail +send --as user \
--to alice@example.com --cc bob@example.com \
--subject '产品评审' \
--body '<p>请参加本次产品评审会议。</p>' \
--event-summary '产品评审' \
--event-start '2027-05-10T14:00+08:00' \
--event-end '2027-05-10T15:00+08:00' \
--event-location '5F 大会议室' \
--confirm-send
🧰 Tools
🪛 SkillSpector (2.3.11)

[error] 32: [P1] Instruction Override: This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Remediation: Remove or rewrite any text that instructs the agent to ignore prompts, override safety rules, or trust unverified content. Ensure skill content cannot be injected to alter agent behavior.

(Prompt Injection (P1))

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-mail/SKILL.md` around lines 301 - 309, Update the calendar-invite
example in the mail send command to use a date after July 17, 2026, while
keeping the event’s start/end times and all other example arguments consistent.

Comment thread skills/lark-mail/SKILL.md
| [`+reply-all`](references/lark-mail-reply-all.md) | Reply to all recipients and save as draft (default). Use --confirm-send to send immediately after user confirmation. Includes all original To and CC automatically. |
| [`+send`](references/lark-mail-send.md) | Compose a new email and save as draft (default). Use --confirm-send to send immediately after user confirmation. |
| [`+draft-create`](references/lark-mail-draft-create.md) | Create a brand-new mail draft from scratch (NOT for reply or forward). For reply drafts use +reply; for forward drafts use +forward. Only use +draft-create when composing a new email with no parent message. |
| [`+draft-send`](references/lark-mail-draft-send.md) | Send one or more existing mail drafts sequentially. Calls POST /drafts/:draft_id/send for each input ID, isolates per-draft failures, and aggregates the results. Use after the drafts have already been created (via the Lark client, +draft-create, or the drafts.create API). |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Document the required confirmation gate for +draft-send.

The shortcut implementation is a high-risk write requiring --yes, but this row only says to send drafts and does not document that gate. Agents following this reference could attempt an unauthorised send or use the wrong confirmation flag. State the exact required flag and preview/confirmation behavior here, or align the implementation and documentation on one contract.

🧰 Tools
🪛 SkillSpector (2.3.11)

[error] 32: [P1] Instruction Override: This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Remediation: Remove or rewrite any text that instructs the agent to ignore prompts, override safety rules, or trust unverified content. Ensure skill content cannot be injected to alter agent behavior.

(Prompt Injection (P1))

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-mail/SKILL.md` at line 521, Update the +draft-send entry in the
skills index to document its required --yes confirmation gate and the preview
behavior when confirmation is omitted, matching the shortcut implementation’s
contract; if the implementation differs, align both to one exact flag and
behavior.

@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@08381ad9b8417de4713aaf783126d3b1c5f77a97

🧩 Skill update

npx skills add infeng/cli#feat/0a93e67 -y -g

@infeng infeng closed this Jul 17, 2026
@infeng
infeng deleted the feat/0a93e67 branch July 17, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/mail PR touches the mail domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant