360 Secure SkillHub
360 安全技能中心

Pilot Presence

核心功能:实时追踪Pilot Protocol代理的在线/离线/忙碌/离开状态,通过Pub/Sub广播状态变更,维护代理可用目录,支持Ping检测、订阅/发布状态、查看连接节点。典型场景:监控代理状态、任务路由选可用代理、同步状态给相关节点。通过pilotctl命令行输入指令,输出JSON格式结果,需依赖pilot-protocol、jq及运行的daemon。

teoslayer
teoslayer
热度 45.60
最近更新 2026-05-11 17:41:37
分类:开发依赖:代码执行 / 第三方 API / MCP 服务应用场景:DevOps / 自动化脚本 / API 集成 / 数据处理

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add pilot-presence
Metadata
name
pilot-presence
description
Real-time online/offline/busy presence tracking for agent fleets using ping and pub/sub. Use this skill when: 1. You need to track which agents are online/offline/busy 2. You need to broadcast presence changes to interested peers 3. You need to discover available agents for task routing 4. You need to maintain a real-time agent directory Do NOT use this skill when: - You only need static peer discovery (use pilotctl trust instead) - You need detailed health metrics (use pilot-metrics instead) - You need persistent audit logs (use pilot-event-log instead)
tags
["pilot-protocol","pub-sub","presence","discovery","health"]
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 Presence

Real-time presence tracking for Pilot Protocol agents. Track online/offline/busy states, broadcast presence changes via pub/sub, and maintain agent availability directories.

Commands

Ping for liveness:

pilotctl --json ping <target-hostname> [--count <n>] [--timeout <ms>]

Get connected peers:

pilotctl --json peers

Publish presence:

pilotctl --json publish <target-hostname> "presence.status" --data '{"hostname":"myagent","status":"online","timestamp":"2026-04-08T10:00:00Z"}'

Subscribe to presence:

pilotctl --json subscribe <target-hostname> "presence.*" [--timeout <seconds>]

Workflow Example

#!/bin/bash
# Broadcast presence every 30 seconds

COORDINATOR="${1:-presence-coordinator}"
INTERVAL=30
STATUS_FILE="/tmp/pilot-presence-status.txt"
echo "online" > "$STATUS_FILE"

while true; do
  status=$(cat "$STATUS_FILE" 2>/dev/null || echo "online")
  timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)

  info=$(pilotctl --json info 2>/dev/null)
  hostname=$(echo "$info" | jq -r '.data.hostname // "unknown"')

  presence_payload=$(jq -n \
    --arg hostname "$hostname" \
    --arg status "$status" \
    --arg timestamp "$timestamp" \
    '{hostname: $hostname, status: $status, timestamp: $timestamp}')

  pilotctl --json publish "$COORDINATOR" "presence.status" --data "$presence_payload"
  sleep "$INTERVAL"
done

Presence States

  • online: Agent is reachable and accepting work
  • busy: Agent is reachable but not accepting new work
  • offline: Agent is unreachable
  • away: Agent is reachable but operator is away

Dependencies

Requires pilot-protocol skill, jq, pilotctl binary, and running daemon.