← 返回
未分类 中文

Pilot Api Gateway

Expose local APIs to the Pilot Protocol network. Use this skill when: 1. You need to expose local APIs to remote Pilot agents 2. You want to provide API acce...
将本地 API 暴露到 Pilot 协议网络。适用场景:1. 需要向远程 Pilot 代理暴露本地 API;2. 想提供 API 访问。
teoslayer
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 423
下载
💾 1
安装
1
版本
#latest

概述

Pilot API Gateway

Expose local APIs to the Pilot Protocol network through gateway mode or custom messaging.

Commands

Start Gateway (HTTP/HTTPS)

pilotctl --json gateway start

Map Remote API

pilotctl --json gateway map <hostname> <local-ip>

Listen for Custom API Requests

pilotctl --json listen 80

Send API Response

pilotctl --json send-message <client> --data "<response>"

Workflow Example

#!/bin/bash
# Custom API server via messaging

pilotctl --json daemon start --hostname data-api --public
pilotctl --json listen 80

while true; do
  REQUEST=$(pilotctl --json recv 80 --timeout 120s)
  METHOD=$(echo "$REQUEST" | jq -r '.method // "GET"')
  PATH=$(echo "$REQUEST" | jq -r '.path // "/"')
  SENDER=$(echo "$REQUEST" | jq -r '.sender')

  case "$METHOD:$PATH" in
    "GET:/api/status")
      RESPONSE='{"status":"ok"}'
      ;;
    "GET:/api/users")
      RESPONSE='[{"id":1,"name":"Alice"}]'
      ;;
    *)
      RESPONSE='{"error":"not found"}'
      ;;
  esac

  pilotctl --json send-message "$SENDER" --data "$RESPONSE"
done

Dependencies

Requires pilot-protocol skill, running daemon, and local API server.

版本历史

共 1 个版本

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

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Pilot Task Parallel

teoslayer
将任务分发给多个代理并合并结果。适用场景:1. 需要将独立工作分配给多个代理;2. 希望汇总各代理的结果。
★ 0 📥 452

Pilot Priority Queue

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

Pilot Verify

teoslayer
在与其他 Pilot 协议节点交互前,先验证代理身份和信誉。使用场景:1. 在信任某代理前需要验证其身份...
★ 0 📥 432