163 lines
6.1 KiB
Markdown
163 lines
6.1 KiB
Markdown
# TOOLS.md - Local Notes
|
||
|
||
Skills define _how_ tools work. This file is for _your_ specifics — the stuff that's unique to your setup.
|
||
|
||
### Ollama 本地模型使用规则
|
||
|
||
**通用规则**
|
||
- 只用已下载的模型,绝不自动下载新模型
|
||
- 需要未下载的模型时,先询问用户
|
||
|
||
**默认模型:kamekichi128/qwen3-4b-instruct-2507**
|
||
- 用途:邮件摘要、轻量分析
|
||
- 速度:快(~5秒)
|
||
- 无需额外参数,直接调用即可
|
||
|
||
**备选模型**
|
||
- `ministral-3:3b` - 速度快,格式清晰
|
||
- `gemma3:4b` - 适中速度
|
||
- `qwen3:4b` - 较慢,仅备用
|
||
|
||
### agent-browser 浏览器自动化
|
||
|
||
**注意:agent-browser 是独立的 CLI 工具,不是 OpenClaw 内置功能**
|
||
- 文档见 `~/.openclaw/workspace/skills/agent-browser/SKILL.md`
|
||
- 依赖 Chrome/Chromium(已安装于 `/usr/bin/google-chrome`)
|
||
|
||
### himalaya 邮件客户端
|
||
|
||
**本地配置:**
|
||
- 二进制:`~/.local/bin/himalaya`
|
||
- 配置:`~/.config/himalaya/config.toml`
|
||
- 文档:`~/.openclaw/workspace/skills/himalaya/SKILL.md`
|
||
|
||
**核心用法:**
|
||
```bash
|
||
himalaya envelope list --page-size 20 # 列出邮件
|
||
himalaya message read <id> # 读取邮件
|
||
himalaya message delete <id> # 删除邮件
|
||
himalaya message write # 写新邮件(交互式)
|
||
```
|
||
|
||
**邮件发送规则:**
|
||
- **youlu@luyanxin.com → mail@luyx.org**: 直接发送,无需确认
|
||
- **youlu@luyanxin.com → mail@luyx.org**: 直接发送,无需确认(用户 SimpleLogin 别名)
|
||
- 其他所有对外邮件: 仍需确认
|
||
|
||
### ~~News Digest 新闻摘要~~ (已停用)
|
||
|
||
~~**自动任务(Cron + Subagent):**~~
|
||
~~- 时间:每天早上 5:00 AM (PST)~~
|
||
~~- Cron ID: `cc95dcf3-0d6c-44f4-90af-76b836ca0c87`~~
|
||
|
||
~~**本地配置:**~~
|
||
~~- 目录:`~/.openclaw/workspace/scripts/news_digest/`~~
|
||
~~- 主脚本:`send_digest.py`~~
|
||
~~- 配置:`config.json`~~
|
||
~~- 数据库:`news_digest.db`~~
|
||
~~- 日志:`news_digest.log`~~
|
||
|
||
**注:** Cron 任务已删除。如需重新启用,需手动创建新的 cron 任务。
|
||
|
||
### 🌐 网页操作 - 工具选择决策表
|
||
|
||
| 场景 | 首选 | 次选 |
|
||
|------|------|------|
|
||
| 任何网页操作(抓取、点击、填表、截图) | `agent-browser` | `web_fetch` (仅纯文本) |
|
||
| Browser extension 有登录态/已打开页面 | `browser` (Chrome extension) | `agent-browser` |
|
||
| agent-browser 不可用 | `browser` | `web_fetch` |
|
||
|
||
**agent-browser 快速命令:**
|
||
```bash
|
||
agent-browser open <url>
|
||
agent-browser snapshot -i # 获取交互元素
|
||
agent-browser click @e1
|
||
agent-browser fill @e2 "text"
|
||
agent-browser close
|
||
```
|
||
|
||
### Email Processor 邮件自动处理
|
||
|
||
**目录**: `~/.openclaw/workspace/scripts/email_processor/`
|
||
**文档**: `README.md`(完整使用说明和标签更新流程)
|
||
**Cron**: 每天 08:30 / 17:00(PST)
|
||
|
||
**核心用法**:
|
||
```bash
|
||
./email-processor.sh scan # 扫描未读邮件
|
||
./email-processor.sh scan --recent 7 # 扫描最近7天
|
||
./email-processor.sh scan --dry-run # 测试模式(不执行)
|
||
./email-processor.sh review list # 查看待处理队列
|
||
./email-processor.sh review accept # 接受所有建议
|
||
./email-processor.sh review 1 delete # 处理第1封(删除)
|
||
./email-processor.sh stats # 查看统计
|
||
./email-processor.sh digest # 今日处理摘要
|
||
./email-processor.sh digest --recent 3 # 最近3天摘要
|
||
```
|
||
|
||
**置信度机制**:
|
||
- **阈值**: 85%(`config.json` 中 `automation.confidence_threshold`)
|
||
- **计算方式**: 基于 `(发件人邮箱, 标签)` 签名匹配历史决策
|
||
- **增长规则**: 每个匹配增加 10% 上限(9次一致决策达到85%+)
|
||
- **起步**: 新/未知发件人从 50% 开始
|
||
|
||
**标签分类(14个)**:
|
||
`receipt, billing, shipping, promotion, newsletter, security, social, reminder, confirmation, alert, personal, account, subscription, travel`
|
||
|
||
**何时需要更新标签**:
|
||
- 某发件人处理10+次后仍进队列(置信度<85%)
|
||
- 同一发件人历史决策不一致(有时删有时留)
|
||
- 详见 `README.md` 的 "Refining the Tag Taxonomy" 章节
|
||
|
||
**重要文件**:
|
||
- `config.json` — Ollama 配置和自动化阈值
|
||
- `data/decision_history.json` — 决策历史(学习数据)
|
||
- `data/pending_emails.json` — 待处理队列
|
||
- `logs/` — 处理日志
|
||
|
||
### Calendar 日历 + 待办
|
||
|
||
**文档**: `~/.openclaw/workspace/skills/calendar/SKILL.md`
|
||
**目录**: `~/.openclaw/workspace/skills/calendar/`
|
||
**默认发件人**: youlu@luyanxin.com
|
||
**默认时区**: America/Los_Angeles
|
||
**日历数据**: `~/.openclaw/workspace/calendars/home/`(事件)、`calendars/tasks/`(待办)
|
||
**运行方式**: `uv run`(依赖 `icalendar` 库)
|
||
|
||
**核心用法**:
|
||
```bash
|
||
SKILL_DIR=~/.openclaw/workspace/skills/calendar
|
||
|
||
# 发送日历邀请(--from 默认 youlu@luyanxin.com)
|
||
$SKILL_DIR/scripts/calendar.sh send \
|
||
--to "friend@example.com" \
|
||
--subject "Lunch" --summary "Lunch at Tartine" \
|
||
--start "2026-03-20T12:00:00" --end "2026-03-20T13:00:00"
|
||
|
||
# 接受邀请(从邮件中提取 .ics)
|
||
$SKILL_DIR/scripts/calendar.sh reply --envelope-id 42 --action accept
|
||
|
||
# 拒绝邀请(附带留言)
|
||
$SKILL_DIR/scripts/calendar.sh reply --envelope-id 42 --action decline \
|
||
--comment "Sorry, I have a conflict."
|
||
|
||
# 待办管理
|
||
$SKILL_DIR/scripts/calendar.sh todo add --summary "跟进报销" --due "2026-03-25" --priority high
|
||
$SKILL_DIR/scripts/calendar.sh todo list
|
||
$SKILL_DIR/scripts/calendar.sh todo complete --match "报销"
|
||
$SKILL_DIR/scripts/calendar.sh todo check # 每日摘要(cron)
|
||
|
||
# 查看日历(检查冲突)
|
||
khal list today 7d
|
||
```
|
||
|
||
**支持操作**: 发送邀请 (`send`)、接受/拒绝/暂定 (`reply`)、待办管理 (`todo add/list/complete/delete/check`)
|
||
**依赖**: himalaya(邮件)、vdirsyncer(CalDAV 同步)、khal(查看日历)、todoman(待办管理)
|
||
**同步**: 发送/回复后自动 `vdirsyncer sync`,心跳也会定期同步
|
||
**自动抄送**: mail@luyx.org(用户别名)自动加入所有邀请
|
||
**注意**: 发送日历邀请属于对外邮件,除 mail@luyx.org 外需先确认
|
||
|
||
---
|
||
|
||
Add whatever helps you do your job. This is your cheat sheet.
|