360 Secure SkillHub
360 安全技能中心

Pilot Event Replay

该 Skill 使用 pilotctl 订阅源主机的事件主题,把事件以 NDJSON 格式追加写入文件,并按行读取录制文件、提取 topic 与 data 后逐条发布到目标主机,可设置回放间隔。适用于捕获事件流、回放测试下游消费者、调试事件驱动工作流和审计事件历史;依赖 pilot-protocol skill、pilotctl 二进制、运行中的守护进程和 jq。

teoslayer
teoslayer
热度 33.82
最近更新 2026-05-11 17:41:32
分类:自动化依赖:代码执行 / 读写文件 / 第三方 API应用场景:自动化脚本 / 调试排错 / 工作流 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pilot-event-replay
Metadata
name
pilot-event-replay
description
Record and replay event streams for debugging, testing, and audit purposes. Use this skill when: 1. You need to capture event streams for later analysis 2. You need to replay events to test downstream consumers 3. You need to debug event-driven workflows 4. You need to audit event history with timestamps Do NOT use this skill when: - You need real-time event forwarding (use pilot-event-bus instead) - You need long-term storage with rotation (use pilot-event-log instead) - You need filtering before recording (use pilot-event-filter first)
tags
["pilot-protocol","pub-sub","debugging","testing","replay"]
license
AGPL-3.0
compatibility
Requires pilot-protocol skill and pilotctl binary on PATH. The daemon must be running (pilotctl daemon start). Requires jq for JSON processing.
metadata
{"author":"vulture-labs","version":"1.0","openclaw":{"requires":{"bins":["pilotctl","jq"]},"homepage":"https://pilotprotocol.network"}}
allowed-tools
["Bash"]

Pilot Event Replay

Record event streams to NDJSON files and replay them for debugging and testing.

Commands

Record events to file

pilotctl --json subscribe <source-hostname> <topic> --timeout <seconds> | \
  jq -c '.data.events[]' >> <recording-file.ndjson>

Replay events from file

cat <recording-file.ndjson> | jq -c '.' | while IFS= read -r event; do
  topic=$(echo "$event" | jq -r '.topic')
  data=$(echo "$event" | jq -r '.data')

  pilotctl --json publish <target-hostname> "$topic" --data "$data"
  sleep <delay-seconds>
done

Workflow Example

Record debug session:

#!/bin/bash
SOURCE="buggy-worker"
DURATION=300
RECORDING="/tmp/debug-session-$(date +%Y%m%d-%H%M%S).ndjson"

pilotctl --json subscribe "$SOURCE" "*" --timeout "$DURATION" | \
  jq -c '.data.events[]' >> "$RECORDING"

event_count=$(wc -l < "$RECORDING")
echo "Recorded $event_count events"

Replay to test agent:

#!/bin/bash
RECORDING="$1"
TEST_TARGET="test-agent"

jq -c '.' "$RECORDING" | while IFS= read -r event; do
  topic=$(echo "$event" | jq -r '.topic')
  data=$(echo "$event" | jq -r '.data')

  pilotctl --json publish "$TEST_TARGET" "$topic" --data "$data"
  sleep 0.5
done

Dependencies

Requires pilot-protocol skill, jq, and a running daemon.