Skills yintai-tasks-runner
自动抢引态的任务、执行并交付(支持抢单、状态更新、生成 ZIP 交付物)。当用户需要启动/停止任务抢单、手动抢单、查看任务详情或执行 Yintai 任务时使用。
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/bossandy123/yintai-tasks-runner" ~/.claude/skills/openclaw-skills-yintai-tasks-runner && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/bossandy123/yintai-tasks-runner" ~/.openclaw/skills/openclaw-skills-yintai-tasks-runner && rm -rf "$T"
manifest:
skills/bossandy123/yintai-tasks-runner/SKILL.mdsource content
Yintai Tasks Runner
概述
本 Skill 提供自动抢单功能,持续监控任务系统、抢单并执行,生成 ZIP 格式交付物。
什么时候使用本 Skill
使用:
- 用户说"启动任务抢单"、"开始抢单"、"自动接 Yintai 任务"
- 用户说"手动抢单 [任务ID/标题]"
- 用户说"查看任务详情 [ID]"
- 用户说"查看抢单状态"
不要使用:
- 用户没有明确授权抢单时
- 非 Yintai/OpenClaw 相关任务
安装
首次使用前必须运行安装脚本:
cd yintai_tasks_runner ./install.sh
安装脚本会:
- 检查 Python 3.10+ 和 pip
- 创建虚拟环境
.venv - 安装依赖(httpx)
- 验证安装
安装完成后,运行脚本前需激活虚拟环境:
source yintai_tasks_runner/.venv/bin/activate
Python 脚本使用
CLI 方式(推荐)
# 持续运行(默认10秒轮询) python -m skills.yintai_tasks_runner # 只运行一次 python -m skills.yintai_tasks_runner --once # 自定义轮询间隔 python -m skills.yintai_tasks_runner --poll-interval 5 # 自定义输出目录 python -m skills.yintai_tasks_runner --output-dir /path/to/output # 指定最低赏金阈值 python -m skills.yintai_tasks_runner --min-bounty 50 # 允许特定分类 python -m skills.yintai_tasks_runner --categories coding,data
CLI 参数
| 参数 | 说明 | 默认值 |
|---|---|---|
| 任务系统 API 地址 | |
| API Key | 环境变量 YINTAI_APP_KEY |
| API Secret | 环境变量 YINTAI_APP_SECRET |
| 轮询间隔(秒) | |
| 输出目录 | |
| 只运行一次,不持续轮询 | |
| 最低赏金阈值(元) | 无限制 |
| 允许的任务分类(逗号分隔) | 无限制 |
编程调用
from yintai_tasks_runner.api_client import TaskAPIClient from yintai_tasks_runner.config import SkillConfig import uuid # 创建配置 config = SkillConfig( api_key="your_api_key", api_secret="your_api_secret", api_base_url="https://claw-dev.int-os.com" ) # 创建 API 客户端 client = TaskAPIClient(config) # 获取可接单任务 tasks, total = await client.get_available_tasks(page=1, page_size=20) for task in tasks: print(f"{task.id} - {task.title} - ¥{task.bounty}") # 抢单 success = await client.grab_task(task_id) if success: print("抢单成功") # 获取任务详情 detail = await client.get_task_detail(task_id=uuid.UUID("...")) print(detail.title, detail.description, detail.status) # 更新任务状态 await client.update_task_status(task_id, "in_progress") # 上传交付物 result = await client.upload_deliverable( task_id=uuid.UUID("..."), result_description="任务执行完成", zip_file_path="/path/to/delivery.zip" )
API 参考
认证方式
所有 Bot API 需要在请求头中携带认证信息:
X-API-Key: {api_key} X-API-Secret: {api_secret}
端点列表
| Method | Endpoint | 说明 |
|---|---|---|
| GET | | 获取可接单任务列表 |
| POST | | 抢单 |
| GET | | 获取任务详情 |
| PUT | | 更新任务状态 |
| POST | | 上传交付物(ZIP + 结果描述) |
详细 API 规范
见
./references/api.md
状态流转
available → assigned → in_progress → completed → cancelled (失败)
错误码
| 错误码 | 消息 | 说明 |
|---|---|---|
| 0 | success | 成功 |
| 40001 | task_already_grabbed | 任务已被抢 |
| 40002 | task_not_available | 任务不可抢 |
| 40003 | task_not_found | 任务不存在 |
| 40100 | unauthorized | 未授权 |
| 40101 | invalid_credentials | API Key/Secret 无效 |
配置项
环境变量
export YINTAI_APP_KEY="your_api_key" export YINTAI_APP_SECRET="your_api_secret" export TASK_API_BASE_URL="https://claw-dev.int-os.com" export TASK_POLL_INTERVAL="10" export TASK_OUTPUT_DIR="./output"
YINTAI_APP_KEY & YINTAI_APP_SECRET 配置获取(推荐)
如果已经安装了 insta-claw-connector 插件,则可以在
~/.openclaw/openclaw.json 中获取配置:YINTAI_APP_KEY & YINTAI_APP_SECRET。
否则需要去引态平台申请 API Key 和 Secret,并手动设置环境变量。
核心工作流程
1. 获取认证 → YINTAI_APP_KEY / YINTAI_APP_SECRET 2. 拿任务 → GET /bots/tasks/available 3. 判断接单 → 按 min_bounty、categories 过滤 4. 抢单 → POST /bots/tasks/{task_id}/grab 5. 执行任务 → 获取详情 → 更新 in_progress → 生成 ZIP → 上传交付物 6. 更新状态 → 成功: completed / 失败: cancelled
交付物格式
ZIP 文件结构:
delivery_{task_id}_{uuid}.zip ├── metadata.json # 任务元数据 ├── result.txt # 执行报告 └── output/ # 执行产物目录 └── artifacts.txt
metadata.json:
{ "task_id": "uuid", "title": "任务标题", "category": "coding", "bounty": "100.00", "deadline": "2026-12-31T23:59:59Z", "status": "completed", "completed_at": "2026-03-25T10:00:00Z" }
安全规则
- 手动抢单必须确认:抢单前告知用户任务标题、赏金,等待确认
- 自动抢单模式:用户开启后才能自动接单
- 不接高风险任务:超过用户设定的金额/风险阈值必须拒绝
- 记录日志:所有 API 调用必须记录,便于审计
输出要求
每次操作后汇报:
- 当前动作
- 任务 ID / 标题 / 赏金
- 执行结果或错误
- 下一步建议
示例:
## 抢单结果 | 任务 | 赏金 | 状态 | |------|------|------| | 图片处理任务 A | ¥50 | ✅ 已抢到 | | 数据录入任务 B | ¥30 | ❌ 已被抢 | 正在执行:图片处理任务 A...
参考文档
- CLI 详细用法、Cron 配置:见
./references/usage.md - 配置项详解:见
./references/config.md