llm-provider-billing: 新增百炼 Token Plan 余量查询(bailian-token-plan.sh + SKILL.md 文档)

This commit is contained in:
2026-09-10 13:58:33 +08:00
parent 31d02dd1bd
commit e62f3067e0
6 changed files with 170 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ category: custom
tags: [rss, blog, monitoring, automation, export, category]
metadata:
author: Hermes Agent
last_updated: 2026-09-01
last_updated: "2026-09-01"
platform: macos, ubuntu
custom_skill_path: /Users/weishen/.hermes/skills/custom/
installation_note: "blogwatcher-daily 脚本在 Mac mini 本地运行(依赖 feedparser)。需要 RSSHub 服务(http://192.168.3.45:1200)访问 YouTube/Bilibili 等被墙源。"

Binary file not shown.

View File

@@ -0,0 +1,74 @@
# AgentMail 发送邮件工作流(配合 blogwatcher-daily 等导出技能)
> 从 blogwatcher-daily 的 SKILL.md 中拆出,因为「AgentMail 发信」是独立于「RSS 抓取导出」的能力。任何需要先导出再发邮件的场景都可复用。
## 前置条件
- `agentmail` CLI 已安装(`/opt/homebrew/bin/agentmail`)
- API key 在 `~/.zshrc` 的 `AGENTMAIL_API_KEY` 里(当前 Hermes shell 不会自动加载 .zshrc,需手动 source 或提取)
- **出站网络需要走代理**:`ALL_PROXY=socks5://127.0.0.1:10808`(否则 agentmail API 返回 403 被 CloudFront 拦截)
## 标准发送流程
```bash
# 1) 提取 API key + 设置代理(每次新 shell 都要做)
export AGENTMAIL_API_KEY=$(grep '^export AGENTMAIL_API_KEY=' ~/.zshrc | sed 's/.*="\(.*\)"/\1/')
export ALL_PROXY=socks5://127.0.0.1:10808
export HTTP_PROXY=http://127.0.0.1:10808
export HTTPS_PROXY=http://127.0.0.1:10808
# 2) 列出 inbox 拿 inbox_id(首次;一般是 star-agent@agentmail.to)
agentmail inboxes list
# 3) 发送(--html 直接读 HTML 内容字符串)
agentmail inboxes messages send \
--inbox-id "star-agent@agentmail.to" \
--to "billyshen@163.com" \
--subject "主题" \
--html "$(cat /tmp/file.html)"
```
返回 JSON:
```json
{
"message_id": "<...>@email.amazonses.com",
"thread_id": "..."
}
```
## 常见陷阱
### 1. 403 "Request blocked"
- 没走代理。CloudFront 拦了直连 IP。
- 修复:export 上面 3 个 PROXY 环境变量后重试。
### 2. 401 "credentials are missing"
- 当前 shell 没加载 .zshrc,`AGENTMAIL_API_KEY` 不在环境里。
- 修复:用上面的 `export $(grep ...)` 提取。
### 3. HTML 太长
- `--html "$(cat file)"` 把整个文件塞进命令行参数。对很大的 HTML(>500KB)可能撞到 ARG_MAX。
- 应对:先压缩 HTML(去掉 base64 图片、压缩 CSS),或者改用 `--json @payload.json` 走 stdin。
## 与 blogwatcher-daily 配合的固定模式
```bash
# 导出 → 发邮件
python3 ~/.hermes/skills/custom/blogwatcher-daily/scripts/blogwatcher-daily.py \
--export html --date 2026-08-30 > /tmp/digest.html
agentmail inboxes messages send \
--inbox-id "star-agent@agentmail.to" \
--to "billyshen@163.com" \
--subject "Blogwatcher Daily Digest $(date +%Y-%m-%d)" \
--html "$(cat /tmp/digest.html)"
```
## 当前用户的 inbox
- `star-agent@agentmail.to`(默认发件箱)
## 已发送示例
- Blogwatcher 每日摘要 → billyshen@163.com
- 单订阅文章打包(异次元软件世界、惫懒の欧阳川)→ billyshen@163.com

View File

@@ -37,3 +37,4 @@ AI技术|AI懒人报|http://192.168.3.45:1200/youtube/channel/UCNyBkFPz_IPWaincc
未分类|Dan Koe|http://192.168.3.45:1200/youtube/channel/UCWXYDYv5STLk-zoxMP2I1Lw
技术博客|技术爬爬虾 TechShrimp|http://192.168.3.45:1200/youtube/channel/UCa6D2k5qhpOI9I-WT8fpd6g
AI技术|AI Foundations|http://192.168.3.45:1200/youtube/channel/UCWZwfV3ICOt3uEPpW6hYK4g
生活方式|马蜂窝游记|http://192.168.3.45:1200/mafengwo/note/hot