calendar: add EXDATE support for cancelling single occurrences of recurring events

event delete on a recurring event previously deleted the entire .ics file,
killing the whole series. Now requires --date (adds EXDATE) or --all (deletes
series) for recurring events, refusing to act without either flag.
This commit is contained in:
Yanxin Lu
2026-03-26 09:19:02 -07:00
parent d2bc01f16c
commit e1f1c0f334
4 changed files with 147 additions and 16 deletions

View File

@@ -131,7 +131,12 @@ $SKILL_DIR/scripts/calendar.sh reply --envelope-id 42 --action accept
# 事件管理(查看、搜索、删除)
$SKILL_DIR/scripts/calendar.sh event list
$SKILL_DIR/scripts/calendar.sh event list --search "Allergy"
$SKILL_DIR/scripts/calendar.sh event delete --match "Allergy Shot (Tue)"
# 取消周期性事件的单次(加 EXDATE系列保留
$SKILL_DIR/scripts/calendar.sh event delete --match "Allergy Shot" --date "2026-03-28"
# 删除整个周期性系列(需要 --all 安全标志)
$SKILL_DIR/scripts/calendar.sh event delete --match "Allergy Shot" --all
# 删除非周期性事件
$SKILL_DIR/scripts/calendar.sh event delete --match "Lunch"
# 待办管理
$SKILL_DIR/scripts/calendar.sh todo add --summary "跟进报销" --due "2026-03-25" --priority high
@@ -142,7 +147,7 @@ $SKILL_DIR/scripts/calendar.sh todo delete --match "报销"
$SKILL_DIR/scripts/calendar.sh todo check # 每日摘要cron
```
**支持操作**: 发送邀请 (`send`)、接受/拒绝/暂定 (`reply`)、事件管理 (`event list/delete`)、待办管理 (`todo add/list/edit/complete/delete/check`)
**支持操作**: 发送邀请 (`send`)、接受/拒绝/暂定 (`reply`)、事件管理 (`event list/delete --date/--all`)、待办管理 (`todo add/list/edit/complete/delete/check`)
**依赖**: himalaya邮件、vdirsyncerCalDAV 同步、khal查看日历、todoman待办管理
**同步**: 发送/回复/待办变更后自动 `vdirsyncer sync`,心跳也会定期同步
**注意**: 发送日历邀请属于对外邮件,需先确认
@@ -150,6 +155,7 @@ $SKILL_DIR/scripts/calendar.sh todo check # 每日摘要cron
**安全规则**:
- 周期性邀请务必先 `--dry-run` 验证 ICS 内容
- **绝不用 `rm` 删日历 .ics 文件**,只用 `event delete`
- **取消周期性事件的单次用 `--date`**,不要用 `--all`(会删掉整个系列)
- 连续发多封邮件时,每封间隔 10 秒以上Migadu SMTP 限频)
### OpenClaw Cron 定时任务