返回顶部
a

agentcraft智能编码可视化

Visualize coding sessions as a real-time strategy game with automatic deploy and event reporting.

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

agentcraft

AgentCraft 事件报告

AgentCraft 将你的编码会话可视化为即时战略游戏。请按照以下步骤确保 AgentCraft 正在运行并报告你的活动。

1. 检查 AgentCraft 是否正在运行

bash
curl -sf http://localhost:2468/health

如果返回包含 status:ok 的 JSON,则跳至步骤 3。

2. 如有需要则部署

如果健康检查失败(服务器未运行),在后台启动它:

bash
npx -y @idosal/agentcraft start --no-browser -d

等待几秒钟,然后验证:
bash
curl -sf http://localhost:2468/health

如果仍然失败,则继续执行任务而不进行报告——静默忽略所有 AgentCraft 错误。

3. 生成会话 ID

使用基于工作区路径的确定性 ID:

bash
AGENTCRAFTSESSION=openclaw$(echo -n $PWD | md5sum | head -c 12)

在 macOS 上(如果 md5sum 不可用):
bash
AGENTCRAFTSESSION=openclaw$(echo -n $PWD | md5 | head -c 12)

在此会话的所有事件中使用相同的 AGENTCRAFT_SESSION。

4. 报告事件

在以下时刻向 http://localhost:2468/event 发送 POST 请求。使用 curl —— 发送后即忘,不要阻塞等待响应。

开始工作(hero_active)

当你开始处理用户提示时:

bash
curl -sf -X POST http://localhost:2468/event \
-H Content-Type: application/json \
-d {\type\:\heroactive\,\sessionId\:\$AGENTCRAFTSESSION\,\client\:\openclaw\,\cwd\:\$PWD\} &>/dev/null &

任务开始(mission_start)

在 hero_active 之后立即报告任务及用户提示:

bash
curl -sf -X POST http://localhost:2468/event \
-H Content-Type: application/json \
-d {\type\:\missionstart\,\sessionId\:\$AGENTCRAFTSESSION\,\client\:\openclaw\,\missionId\:\mission_$(date +%s)\,\name\:\<提示的前50个字符>\,\prompt\:\<完整用户提示>\,\cwd\:\$PWD\} &>/dev/null &

文件访问(file_access)

当你读取、写入或编辑文件时:

bash
curl -sf -X POST http://localhost:2468/event \
-H Content-Type: application/json \
-d {\type\:\fileaccess\,\sessionId\:\$AGENTCRAFTSESSION\,\client\:\openclaw\,\filePath\:\<绝对文件路径>\,\operation\:\read\,\linesAdded\:0,\linesRemoved\:0,\cwd\:\$PWD\} &>/dev/null &

将 operation 设置为 read、write 或 edit。对于编辑操作,将 linesAdded 和 linesRemoved 设置为实际计数。

Shell 命令(bash_command)

当你执行 shell 命令时:

bash
curl -sf -X POST http://localhost:2468/event \
-H Content-Type: application/json \
-d {\type\:\bashcommand\,\sessionId\:\$AGENTCRAFTSESSION\,\client\:\openclaw\,\command\:\<命令,最多200个字符>\,\cwd\:\$PWD\} &>/dev/null &

完成/空闲(hero_idle)

当你完成处理并等待下一个提示时:

bash
curl -sf -X POST http://localhost:2468/event \
-H Content-Type: application/json \
-d {\type\:\heroidle\,\sessionId\:\$AGENTCRAFTSESSION\,\client\:\openclaw\} &>/dev/null &

规则

  • - 使用 curl 发送 POST 请求——发送后即忘(&>/dev/null &),不要阻塞等待响应。
  • 始终将 client 设置为 openclaw。
  • 在会话的所有事件中使用相同的 AGENTCRAFT_SESSION 值。
  • 将 cwd 设置为当前工作目录。
  • 不要重复报告同一操作。
  • 如果 AgentCraft 服务器无法访问,静默忽略错误——不要重试或记录失败。

邀请其他代理

其他 OpenClaw 代理可以加入你的 AgentCraft 仪表板,无需安装此技能。

快速加入(同一台机器)

与其他代理分享这些 curl 命令。他们只需要生成自己的会话 ID 并发送 POST 事件:

bash

生成唯一的会话 ID(在 macOS 上使用 md5 代替 md5sum)


AGENTCRAFTSESSION=openclaw$(echo -n $PWD | md5sum | head -c 12)

报告活跃状态

curl -sf -X POST http://localhost:2468/event \ -H Content-Type: application/json \ -d {\type\:\heroactive\,\sessionId\:\$AGENTCRAFTSESSION\,\client\:\openclaw\,\cwd\:\$PWD\} &>/dev/null &

完成后报告空闲状态

curl -sf -X POST http://localhost:2468/event \ -H Content-Type: application/json \ -d {\type\:\heroidle\,\sessionId\:\$AGENTCRAFTSESSION\,\client\:\openclaw\} &>/dev/null &

与远程代理共享

要让其他机器上的代理加入:

  1. 1. 暴露你的 AgentCraft 服务器:
bash cloudflared tunnel --url http://127.0.0.1:2468
  1. 2. 分享生成的 https://xxx.trycloudflare.com URL。
  1. 3. 远程代理在所有事件 curl 命令中将 localhost:2468 替换为该 URL。

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 agentcraft-1776180061 技能

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

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

通过命令行安装

skillhub install agentcraft-1776180061

下载

⬇ 下载 agentcraft v1.0.0(免费)

文件大小: 2.36 KB | 发布时间: 2026-4-15 13:01

v1.0.0 最新 2026-4-15 13:01
Initial ClawHub release — RTS dashboard with automatic deploy and event reporting

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

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

p2p_official_large
返回顶部