← 返回
未分类 中文

Pilot Role Assign

Assign and manage hierarchical roles within a swarm for coordinated task distribution. Use this skill when: 1. Agents need different responsibilities (leader...
Assign and manage hierarchical roles within a swarm for coordinated task distribution. Use this skill when: 1. Agents need different responsibilities (leader...
teoslayer teoslayer 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 354
下载
💾 0
安装
1
版本
#latest

概述

pilot-role-assign

Dynamically assign and manage roles in agent swarms using capability-based matching.

Commands

Advertise agent capabilities

pilotctl --json publish "registry-hostname" "capabilities:$SWARM_NAME" \
  --data "{\"agent\":\"$AGENT_ID\",\"capabilities\":{\"cpu_cores\":16,\"ram_gb\":64,\"gpu\":true}}"

Assign role to agent

pilotctl --json send-message "$AGENT_ADDRESS" \
  --data "{\"type\":\"role_assignment\",\"role\":\"$ROLE_NAME\",\"assigned_by\":\"$COORDINATOR_ID\"}"

pilotctl --json publish "registry-hostname" "roles:$SWARM_NAME" \
  --data "{\"agent\":\"$AGENT_ID\",\"role\":\"$ROLE_NAME\",\"assigned_at\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}"

Query current role distribution

ROLE_DIST=$(pilotctl --json inbox \
  | jq '[.messages[] | select(.topic == "roles:'$SWARM_NAME'")] | group_by(.payload.role) | map({role: .[0].payload.role, count: length})')
echo "$ROLE_DIST" | jq '.'

Workflow Example

Coordinator assigns roles based on capabilities:

#!/bin/bash
SWARM_NAME="compute-swarm"
REGISTRY_HOST="registry.example.com"

# Get agent capabilities
CAPABILITIES=$(pilotctl --json inbox | jq '[.messages[] | select(.topic == "capabilities:'$SWARM_NAME'") | .payload]')

for agent_data in $(echo "$CAPABILITIES" | jq -r '.[] | @base64'); do
  AGENT=$(echo "$agent_data" | base64 -d | jq -r '.agent')
  HAS_GPU=$(echo "$agent_data" | base64 -d | jq -r '.capabilities.gpu // false')

  if [ "$HAS_GPU" = "true" ]; then
    ROLE="gpu_worker"
  else
    ROLE="worker"
  fi

  AGENT_ADDR=$(pilotctl --json peers | jq -r '.[] | select(.node_id == "'$AGENT'") | .address')

  pilotctl --json send-message "$AGENT_ADDR" \
    --data "{\"type\":\"role_assignment\",\"role\":\"$ROLE\"}" &
done
wait

Dependencies

Requires pilot-protocol skill, jq, and base64.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 08:16 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 865 📥 344,281
ai-agent

Find Skills

root
帮助用户发现和安装智能体技能,当用户询问如「如何做X」、「找X的技能」、「有能做...的吗」等问题时
★ 1,518 📥 573,961
it-ops-security

Pilot Priority Queue

teoslayer
基于Pilot协议网络的优先级消息传递,支持紧急程度级别。适用场景:1. 需要处理带优先级的紧急消息...
★ 0 📥 542