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

@agentauto/agent-gateway

v1.0.7

Published

Standalone Agent Gateway for AionUI remote ACP sessions (OpenCode, Claude Code, Flowise, LangGraph)

Readme

@aionui/agent-gateway

独立部署的 Agent Gateway,负责把不同执行后端转换为统一 WebSocket 服务,供 AionUI 或其他客户端远程接入。

功能

  • WebSocket 命令入口:/ws
  • 健康检查接口:/healthz
  • 运行时可切换:opencode / flowise / langgraph / claude-code
  • 支持远程运行目录 workspace 指定
  • 支持目录白名单限制(allowedRoots
  • 支持 token 鉴权

快速启动

本地开发

pnpm install
pnpm dev -- --port 18790 --token your-token --allowed-roots /srv/projects,/data/workspaces

构建后运行

pnpm build
pnpm start -- --runtime opencode --port 18790 --token your-token --allowed-roots /srv/projects

发布后服务器一条命令运行

pnpm dlx @aionui/agent-gateway --runtime opencode --port 18790 --token your-token --allowed-roots /srv/projects

CLI 参数

  • --host 监听地址,默认 0.0.0.0
  • --port 监听端口,默认 18790
  • --runtime 运行时类型,opencode|flowise|langgraph|claude-code,默认 opencode
  • --token 连接 token(客户端需带 ?token=...
  • --allowed-roots 远程目录白名单,逗号分隔绝对路径
  • --max-sessions 最大会话数,默认 30
  • --idle-timeout-ms 空闲回收毫秒数,默认 1800000
  • --request-timeout-ms RPC 超时毫秒数,默认 20000
  • --opencode-command opencode 可执行命令,默认 opencode
  • --opencode-args opencode 参数,逗号分隔,默认 acp
  • --claude-code-command claude code 可执行命令,默认 claude
  • --claude-code-args claude code 参数,逗号分隔,默认 --experimental-acp
  • --flowise-base-url Flowise 服务地址(flowise runtime 可选默认)
  • --flowise-workflow-id Flowise 默认 workflowId(flowise runtime 可选默认)
  • --flowise-authorization Flowise 默认 Authorization(flowise runtime 可选默认)

环境变量

CLI 参数会覆盖同名环境变量。

  • AGENT_GATEWAY_HOST
  • AGENT_GATEWAY_PORT
  • AGENT_GATEWAY_RUNTIME
  • AGENT_GATEWAY_TOKEN
  • AGENT_GATEWAY_ALLOWED_ROOTS
  • AGENT_GATEWAY_MAX_SESSIONS
  • AGENT_GATEWAY_IDLE_TIMEOUT_MS
  • AGENT_GATEWAY_REQUEST_TIMEOUT_MS
  • AGENT_GATEWAY_OPENCODE_COMMAND
  • AGENT_GATEWAY_OPENCODE_ARGS
  • AGENT_GATEWAY_CLAUDE_CODE_COMMAND
  • AGENT_GATEWAY_CLAUDE_CODE_ARGS
  • AGENT_GATEWAY_FLOWISE_BASE_URL
  • AGENT_GATEWAY_FLOWISE_WORKFLOW_ID
  • AGENT_GATEWAY_FLOWISE_AUTHORIZATION

WebSocket 协议

连接地址:

ws://host:port/ws?token=your-token

客户端请求格式:

{
  "action": "create_session",
  "requestId": "req-1",
  "payload": {
    "workspace": "/srv/projects/demo-repo"
  }
}

action 支持:

  • create_session
  • send_message
  • set_model
  • set_config_option
  • confirm_permission
  • stop_session
  • list_sessions
  • list_workspace
  • read_file
  • write_file
  • create_entry
  • rename_entry
  • delete_entry

服务端响应格式:

{
  "type": "response",
  "requestId": "req-1",
  "success": true,
  "data": {
    "sessionId": "gateway-session-id"
  }
}

服务端事件格式:

{
  "type": "event",
  "sessionId": "gateway-session-id",
  "event": {
    "type": "acp_message",
    "payload": {}
  }
}