返回顶部
c

chatmask 聊天面具

>-

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

chatmask

ChatMask 技能

当用户发送聊天截图并要求对身份信息元素进行像素化或隐藏时,请按以下顺序执行步骤:设置 → 工作流程

无需外部 API 密钥。 本技能利用您现有的 AI 能力定位图像中的区域,然后仅将图像处理操作委托给本地 Python 脚本。



设置(运行一次,幂等)

在首次任务前运行此代码块。每一步都有保护措施,因此重新运行是安全的。

bash

默认安装路径 — 可在调用技能前通过设置 CHATPIXELATEPATH 覆盖


CHATPIXELATEPATH=${CHATPIXELATEPATH:-$HOME/.openclaw/skills/chatmask}

1. 克隆仓库并切换到固定、审计过的提交版本

审计提交:62b0d1132e8cad8455ef29f74a98da486ff102d4 (frankz2020/chatmask, v1.1.0)

PINNED_SHA=62b0d1132e8cad8455ef29f74a98da486ff102d4 if [ ! -d $CHATPIXELATEPATH/.git ]; then git clone https://github.com/frankz2020/chatmask.git $CHATPIXELATEPATH fi

强制使用固定提交 — 防止分支移动导致静默漂移

(cd $CHATPIXELATEPATH && git fetch --quiet origin && git checkout --quiet $PINNED_SHA)

2. 如果虚拟环境不存在则创建

if [ ! -d $CHATPIXELATEPATH/.venv ]; then python3 -m venv $CHATPIXELATEPATH/.venv \ || { apt-get install -y python3-venv && python3 -m venv $CHATPIXELATEPATH/.venv; } fi

3. 安装/升级依赖(Pillow, python-dotenv — 运行时无网络调用)

$CHATPIXELATEPATH/.venv/bin/pip install -q -r $CHATPIXELATEPATH/requirements.txt

export CHATPIXELATEPATH
PYTHON=$CHATPIXELATEPATH/.venv/bin/python3

安装内容: Pillow(图像处理)和 python-dotenv(仅独立使用时的 .env 加载器)。requests 包由技能安装——它仅在独立/非技能模式下需要,位于 requirements-standalone.txt 中。脚本在运行时不会进行任何网络调用。

网络行为: 设置中唯一的出站调用是 git clone(一次性)和 pip install(一次性)。在工作流程中,当提供 --bbox-json 时,process.py 不进行任何网络调用——所有处理均在本地完成。


工作流程

在运行前阅读元素选择选项配置,将自然语言请求转换为正确的标志。

1. 准备目录

bash
JOBID=job$(date +%s)
OUTDIR=/tmp/chatpixelateout$JOB_ID
mkdir -p $OUT_DIR

2. 单独处理每张图像

每张图像必须单独分析和像素化。 不同的截图具有不同的元素位置——将一张图像的边界框传递给另一张图像会导致敏感区域未被遮盖。对用户发送的每张图像重复以下代码块。

为什么逐张处理? --bbox-json 作用于单张图像。process.py 强制执行此规则:当使用 --bbox-json 时,如果输入目录中存在多张图像,则会报错退出。

对于每张图像

2a. 将图像复制到其单独的输入目录

bash

为每个文件使用新的单图像输入目录


IMG_FILE= # 替换为实际文件名
INDIR=/tmp/chatpixelatein${JOBID}${IMG_FILE%.*}
mkdir -p $IN_DIR
cp $HOME/.openclaw/media/inbound/$IMGFILE $INDIR/

2b. 使用您的视觉能力分析图像

对 $INDIR/$IMGFILE 使用以下提示,并捕获 JSON 输出。
模式使用归一化坐标(0-1000),其中 (0,0) 为左上角,(1000,1000) 为右下角,顺序为 ymin, xmin, ymax, xmax。

您是一名隐私专家,正在分析聊天/消息应用截图。
该应用可能是微信、WhatsApp、Telegram、iMessage、Slack、Discord、LINE、
KakaoTalk 或任何其他消息应用。界面可能是英文、中文或任何其他语言。
根据视觉布局和位置识别请求的元素,而不是根据应用特定的标签。

您的任务:
定位以下所有出现的元素并返回其边界框:

  1. 1. chatnames — 顶部导航/标题栏中的文本标题(对话名称、群组名称、频道标题、返回按钮联系人姓名)。
  2. profilepics — 消息气泡旁、标题栏中或参与者列表中的圆形或圆角头像图像。每个不同的头像出现都是一个独立的区域。
  3. display_names — 消息气泡旁边或上方的文本用户名/昵称标签(发送者姓名,与标题栏标题不同)。

规则:

  • - 仅返回上面列出的元素。
  • 每个元素出现必须是一个独立的区域。
  • 覆盖完整的可见区域,并添加少量内边距。
  • 如果某个元素类型不可见,则为该键返回空列表。
  • 使用归一化坐标(0-1000),其中 (0,0) 为左上角,(1000,1000) 为右下角。
  • 坐标顺序:ymin, xmin, ymax, xmax(上、左、下、右)。
  • 所有值必须为 0 到 1000 之间的整数。

仅使用以下精确模式返回 JSON 对象(JSON 外无额外文本):
{
chatnames: [{ymin: int, xmin: int, ymax: int, x_max: int}],
profilepics: [{ymin: int, xmin: int, ymax: int, x_max: int}],
displaynames: [{ymin: int, xmin: int, ymax: int, x_max: int}]
}

省略用户未请求的元素键(参见下面的元素选择)。

2c. 对此图像运行像素化

通过 --bbox-json 传递 2b 中的 JSON。不会读取或写入 API 密钥。

bash
BBOX=<2b 的 JSON 输出>
$PYTHON $CHATPIXELATEPATH/process.py \
$IN_DIR \
$OUT_DIR \
--bbox-json $BBOX \
[选项] # 参见下面的元素选择和选项配置

在继续之前,对每张图像重复步骤 2a–2c。

3. 向用户返回结果

bash
ls $OUTDIR/*pixelated.png

附加或分享来自 $OUT_DIR/ 的所有已处理图像。



元素选择

将用户的意图转换为 --elements。默认(无标志)像素化所有三个元素。

用户说法(英文 / 中文)--elements 标志
all / default / 全部 / 默认 / 全部打码(省略标志 — 默认:全部三个)
chat name only / 只隐藏聊天名称
--elements chat_name |
| profile pics only / 只隐藏头像 | --elements profile_pic |
| display names only / 只隐藏昵称 / 只隐藏用户名 | --elements display_name |
| avatars and display names / 隐藏头像和昵称 | --elements profilepic,displayname |
| chat name and avatars / 隐藏聊天名称和头像 | --elements chatname,profilepic |
| chat name and display names / 隐藏聊天名称和昵称 | --elements chatname,displayname |

当未请求全部三个元素时,从步骤 2 的边界框 JSON 提示中省略未使用的键以减少干扰。

元素定义:

  • - chatname:顶部导航栏中的标题文本(群组名称、联系人姓名、频道标题)
  • profilepic:消息气泡旁的圆形/圆角头像图像
  • display_name:消息气泡旁边或上方的文本用户名/昵称标签



选项配置


用户说法(英文 / 中文)标志
soft blur / mist effect / 模糊效果 / 雾化(默认)--pixel-mode A (默认)
block / mosaic / pixelate blocks / 马赛克 / 方块效果
--pixel-mode B

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 chatmask-1776115921 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 chatmask-1776115921 技能

通过命令行安装

skillhub install chatmask-1776115921

下载

⬇ 下载 chatmask v1.1.1(免费)

文件大小: 7.24 KB | 发布时间: 2026-4-17 14:18

v1.1.1 最新 2026-4-17 14:18
## [1.1.1] — 2026-03-19

### Added
- `--bbox-json` flag on `process.py`: accepts pre-computed bounding-box JSON (or `-` for stdin), bypassing the vision API entirely. No `OPENROUTER_API_KEY` is required when this flag is used. Input directory must contain exactly one image per invocation.
- OpenClaw skill (`SKILL.md`) now uses the agent's own built-in AI for image analysis instead of routing through OpenRouter — zero credentials required, zero runtime network calls.
- `metadata` frontmatter in `SKILL.md`: explicit `requires.bins` gates (`python3`, `git`) and `homepage` link so OpenClaw can surface and gate the skill correctly.
- `requirements-standalone.txt`: separates the `requests` package (only needed for standalone/OpenRouter mode) from the skill-mode install, so the skill setup installs the minimum possible footprint.

### Changed
- `SKILL.md` workflow restructured for correctness: each image is now analysed and pixelated in its own isolated invocation (separate `$IN_DIR` per image). Previously a single `process.py` call covered all images with one shared bounding-box dict, which would silently apply one image's coordinates to all others.
- `process.py` enforces the single-image constraint when `--bbox-json` is supplied: exits with a clear error if more than one image is found in the input directory.
- `vision.py`: replaced bare `assert` on missing API key with a `ValueError` whose message explicitly identifies the standalone-only context and points OpenClaw users to `--bbox-json`.
- `dotenv` and `vision` imports are now lazy (loaded only in the standalone code path), so `process.py` has zero module-level side-effects and passes ruff E402.
- Removed three spurious `f`-string prefixes (ruff F541).
- Removed `OpenRouter` badge from README header; updated Features table, How It Works diagrams, Requirements, Installation, Usage, Configuration, and module descriptions to accurately reflect both operating modes.
- Dependency versions in `requirements.txt` pinned exactly (`Pillow==11.2.1`, `python-dotenv==1.2.2`) — previously `>=` floor bounds allowed silent upgrades to unreviewed versions.

### Security
- Eliminated credential prompt and `.env` write from the OpenClaw skill Setup block. No secret is ever requested, stored on disk, or written by the skill.
- Narrowed inbound file copy from a wildcard glob (`*.{png,jpg,jpeg}`) to explicit per-image copy, limiting file-system access to only the files the user sent.
- Skill Setup now executes `git checkout ` after cloning, enforcing the pinned audited commit (`62b0d1132e8cad8455ef29f74a98da486ff102d4`). Previously the SHA was documented in a comment but never actually checked out, so installs silently tracked the branch tip.
- Replaced all remaining `assert` statements in `process.py` with explicit `ValueError` / `sys.exit(1)` calls. `assert` can be silenced by running Python with `-O`, which would have bypassed input validation in `_parse_elements()`, `_parse_json_response()`, and the input-directory existence check.
- Removed `requests` from `requirements.txt` (skill-mode install). The package is only used by `vision.py` in standalone mode and had no purpose in skill operation; its presence in the install unnecessarily added a network-capable dependency.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部