calendar: add contacts system to prevent recipient address hallucination
Agent hallucinated "xiaojuzi@meta.com" instead of looking up the correct address from USER.md. Prompting rules can't reliably prevent this, so recipient validation is now enforced at the tool level. - Add contact list/add/delete subcommands (vCard .vcf files synced via CardDAV) - send --to now resolves through contacts: accepts names, name:type, or known emails; rejects unknown addresses with available contacts shown - Multi-email contacts supported with type qualifier (e.g. "小橘子:work") - Adding contacts and sending are separate operations (no chaining)
This commit is contained in:
18
TOOLS.md
18
TOOLS.md
@@ -105,23 +105,29 @@ agent-browser close
|
||||
**目录**: `~/.openclaw/workspace/skills/calendar/`
|
||||
**默认发件人**: youlu@luyanxin.com
|
||||
**默认时区**: America/Los_Angeles
|
||||
**日历数据**: `~/.openclaw/workspace/calendars/home/`(事件)、`calendars/tasks/`(待办)
|
||||
**日历数据**: `~/.openclaw/workspace/calendars/home/`(事件)、`calendars/tasks/`(待办)、`contacts/default/`(通讯录)
|
||||
**运行方式**: `uv run`(依赖 `icalendar` 库)
|
||||
|
||||
**核心用法**:
|
||||
```bash
|
||||
SKILL_DIR=~/.openclaw/workspace/skills/calendar
|
||||
|
||||
# 发送日历邀请(--from 默认 youlu@luyanxin.com)
|
||||
# 通讯录管理(send 命令会校验收件人必须在通讯录中)
|
||||
$SKILL_DIR/scripts/calendar.sh contact list
|
||||
$SKILL_DIR/scripts/calendar.sh contact add --name "小橘子" --email "Erica.Jiang@anderson.ucla.edu" --type work
|
||||
$SKILL_DIR/scripts/calendar.sh contact add --name "小橘子" --email "xueweijiang0313@gmail.com" --type home
|
||||
$SKILL_DIR/scripts/calendar.sh contact delete --name "小橘子"
|
||||
|
||||
# 发送日历邀请(--to 用通讯录名称,不要直接写邮箱地址)
|
||||
$SKILL_DIR/scripts/calendar.sh send \
|
||||
--to "friend@example.com" \
|
||||
--to "小橘子:work" \
|
||||
--subject "Lunch" --summary "Lunch at Tartine" \
|
||||
--start "2026-03-20T12:00:00" --end "2026-03-20T13:00:00" \
|
||||
--alarm 1h # 提前1小时提醒(默认1d,支持 1d/2h/30m)
|
||||
|
||||
# 发送周期性邀请(--start 必须落在 BYDAY 指定的那天!)
|
||||
$SKILL_DIR/scripts/calendar.sh send \
|
||||
--to "alice@example.com" \
|
||||
--to "小橘子:work" \
|
||||
--subject "Weekly Shot" --summary "Allergy Shot (Tue)" \
|
||||
--start "2026-03-31T14:30:00" --end "2026-03-31T15:00:00" \
|
||||
--rrule "FREQ=WEEKLY;COUNT=13;BYDAY=TU"
|
||||
@@ -148,12 +154,14 @@ $SKILL_DIR/scripts/calendar.sh todo delete --match "报销"
|
||||
$SKILL_DIR/scripts/calendar.sh todo check # 每日摘要(cron)
|
||||
```
|
||||
|
||||
**支持操作**: 发送邀请 (`send`)、接受/拒绝/暂定 (`reply`)、事件管理 (`event list/delete --date/--all`)、待办管理 (`todo add/list/edit/complete/delete/check`)
|
||||
**支持操作**: 通讯录 (`contact list/add/delete`)、发送邀请 (`send`)、接受/拒绝/暂定 (`reply`)、事件管理 (`event list/delete --date/--all`)、待办管理 (`todo add/list/edit/complete/delete/check`)
|
||||
**依赖**: himalaya(邮件)、vdirsyncer(CalDAV 同步)、khal(查看日历)、todoman(待办管理)
|
||||
**同步**: 发送/回复/待办变更后自动 `vdirsyncer sync`,心跳也会定期同步
|
||||
**注意**: 发送日历邀请属于对外邮件,需先确认
|
||||
|
||||
**安全规则**:
|
||||
- **`send --to` 只接受通讯录中的联系人**,不认识的地址会被拒绝(防止地址幻觉)
|
||||
- **添加联系人和发送邮件是独立操作**,不要在同一次请求中先 add 再 send
|
||||
- 周期性邀请务必先 `--dry-run` 验证 ICS 内容
|
||||
- **绝不用 `rm` 删日历 .ics 文件**,只用 `event delete`
|
||||
- **取消周期性事件的单次用 `--date`**,不要用 `--all`(会删掉整个系列)
|
||||
|
||||
Reference in New Issue
Block a user