返回顶部
i

imsg-mediaiMessage媒体处理

Fetch iMessage/Messages.app attachments (voice memos and images) and process them — transcribe audio via Silicon Flow ASR (SenseVoiceSmall), and analyze images via the agent's vision model. Handles the full pipeline from locating the attachment to delivering results. Use when a user sends a voice message or image and you see the placeholder character "", or when they say "语音转文字", "看图", "识别图片", "transcribe this".

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
374
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

imsg-media

imsg-media

完整的iMessage多媒体处理管道:

  • - 🎙️ 语音备忘录 → 文字:通过Silicon Flow ASR(SenseVoiceSmall,云端,无需本地模型)
  • 🖼️ 图片 → 描述/OCR:通过智能体的内置视觉模型

系统要求

macOS 权限

  • - 必须为运行OpenClaw的进程授予完全磁盘访问权限
  • 设置 → 隐私与安全性 → 完全磁盘访问权限 → 添加你的终端/应用
  • 若无此权限,imsg将无法读取~/Library/Messages/chat.db,并返回permissionDenied

API密钥(仅音频)

  • - Silicon Flow API密钥 — 免费注册:https://siliconflow.cn
  • 长期使用: 添加到~/.openclaw/.env:SILICONFLOWKEY=sk-...
  • 快速测试/覆盖: 直接向脚本传递--api-key sk-...
  • 图片分析不需要此密钥

CLI依赖

  • - imsg CLI:npm install -g imsg

触发条件

在以下情况激活此技能:

  • - 收到的消息文本包含附件占位符
  • 用户说语音转文字、转写、识别语音、transcribe
  • 用户说看图、识别图片、读图、OCR、截图里写的什么
  • 用户提及刚刚通过iMessage发送的照片/音频/文件

决策流程

检测到附件?
├── 音频(.m4a / .caf / .wav / .mp3)→ 通过Silicon Flow ASR转写
├── 图片(.jpg / .png / .heic / .gif)→ 使用视觉模型读取
└── 未知/未下载 → 增加--limit或要求用户重新发送

工作流程

步骤1 — 获取发送者标识

始终从消息信封中读取:
  • - [iMessage sender@example.com ...] → 使用sender@example.com
  • [SMS +1234567890 ...] → 使用+1234567890
  • 切勿硬编码地址

步骤2 — 获取附件

bash

从技能目录运行


cd ~/.openclaw/skills/imsg-voice-transcribe

python3 scripts/imsgvoicetranscribe.py fetch \
--identifier sender@example.com \
--limit 50

返回包含file、type(audio或image)和元数据的JSON。

若未找到,尝试--limit 100。

步骤3a — 音频:转写

bash

单行命令(获取+转写)


python3 scripts/imsgvoicetranscribe.py auto \
--identifier sender@example.com \
--limit 50 --raw

或转写特定文件

python3 scripts/imsgvoicetranscribe.py transcribe \ --file /path/to/audio.m4a --raw

使用显式API密钥快速测试(无需设置环境变量)

python3 scripts/imsgvoicetranscribe.py transcribe \ --file /path/to/audio.m4a --api-key sk-... --raw

步骤3b — 图片:分析

fetch返回图片路径后(例如{file: /path/to/photo.jpg, type: image}):

bash

示例:从发送者获取图片


python3 scripts/imsgvoicetranscribe.py fetch \
--identifier sender@example.com --type image --limit 50

→ {file: /Users/.../Messages/Attachments/photo.jpg, type: image, ...}

然后在智能体中:

  1. 1. 如果是HEIC/HEIF:先转换 → sips -s format png input.heic --out output.png
  2. 使用read工具打开 → 智能体视觉模型处理
  3. 回复内容:是什么、主要主体、任何文字/OCR、值得注意的细节

默认图片回复格式:

  • - 是什么: 照片/截图/文档
  • 主要主体: 1–2句话
  • 文字(OCR): 引用关键文字,或无明显文字
  • 细节: 3–5个要点
  • 后续: 询问是否需要OCR/表格提取/对比等

支持的格式

格式类型备注
.m4a音频标准iMessage语音备忘录
.caf
音频 | 旧版iOS语音备忘录(CAF中的AAC) | | .wav .mp3 | 音频 | 其他来源 | | .jpg .jpeg .png | 图片 | 标准照片 | | .heic .heif | 图片 | iPhone默认格式 — 先转换为PNG | | .gif | 图片 | 动态或静态 |

故障排除

错误原因解决方法
permissionDenied无完全磁盘访问权限在系统设置中授予FDA权限
SILICONFLOWKEY not set
缺少API密钥 | 添加到~/.openclaw/.env | | No attachments found | 限制过低或iCloud未同步 | 增加--limit;要求用户重新发送 | | 请求超时 | 网络或文件过大 | 重试;检查文件小于25MB | | HEIC无法显示 | read不支持该格式 | 先用sips转换 |

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 imsg-media-1776291502 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 imsg-media-1776291502 技能

通过命令行安装

skillhub install imsg-media-1776291502

下载

⬇ 下载 imsg-media v1.0.1(免费)

文件大小: 6.05 KB | 发布时间: 2026-4-16 18:21

v1.0.1 最新 2026-4-16 18:21
Fix: correct imsg attachment path resolution (original_path + expanduser); tested with real .caf voice memos

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部