npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

acp-py

v1.0.7

Published

Python Agent SDK - 基于 WebSocket 的智能体通信库

Readme

acp-py

Python Agent SDK - 基于 WebSocket 的智能体通信库

安装

npm install -g acp-py

快速开始

启动 Agent

# 直接启动(使用默认配置)
acp-py

# 或使用 start 命令
acp-py start

# 指定 Agent 名称
acp-py start -n my_agent

# 启用调试模式
acp-py start --debug

# 指定目标 Agent(可直接发送消息)
acp-py start -t target_agent.aid.pub

交互命令

启动后可以使用以下命令:

| 命令 | 说明 | |------|------| | /target <aid> | 设置目标 Agent | | /session | 显示当前会话信息 | | /aid | 显示本机 AID | | /help | 显示帮助 | | /quit | 退出 | | 其他输入 | 发送消息给目标 |

运行自定义脚本

acp-py run my_agent.py

CLI 命令

acp-py [选项] [命令]

命令:
  acp-py start [选项]              启动 Agent
  acp-py run <script.py> [args]    运行 Python 脚本
  acp-py update                    更新到最新版本
  acp-py install                   安装 Python 依赖

启动选项:
  -d, --data <path>    数据目录 (默认: ./acp-data)
  -p, --password <pwd> 种子密码
  -n, --name <name>    Agent 名称
  -t, --target <aid>   目标 Agent AID
  --ap <address>       AP 地址 (默认: aid.pub)
  --debug              启用调试模式

选项:
  -v, --version        显示版本号
  -h, --help           显示帮助信息
  --check              检查 Python 环境
  --path               显示 agentcp 模块路径

自定义 Agent 开发

from agentcp import AgentCP

# 创建 AgentCP 实例
acp = AgentCP("./data", seed_password="your_password", debug=True)

# 创建 Agent
aid = acp.create_aid(ap="aid.pub", agent_name="my_agent")
print(f"Agent AID: {aid.id}")

# 注册消息处理器
async def handle_message(data):
    print(f"收到消息: {data}")

aid.add_message_handler(handle_message)

# 上线
aid.online()

# 发送消息
session_id = aid.create_session("my_session", "测试会话")
aid.invite_member(session_id, "target_agent.aid.pub")
aid.send_message(session_id, ["target_agent.aid.pub"], "Hello!")

# 保持运行
acp.serve_forever()

运行脚本:

acp-py run my_agent.py

系统要求

  • Node.js >= 14.0.0
  • Python >= 3.8

平台支持

  • macOS
  • Linux
  • Windows

License

MIT