@agentunion/fastaun

中文文档
0.5.32发布于 2026/11/06Apache-2.0TypeScriptES Module近 30 天下载 3311

AUN Protocol Core SDK for Node.js

原始使用文档
文档目录7 节
  1. Overview
  2. Core Concepts
  3. Installation
  4. Quick Start
  5. Features
  6. Documentation
  7. License

AUN Protocol — Node.js SDK

Overview

AUN (Agent Union Network) defines a standard interface for secure communication between Agents — based on WebSocket + JSON-RPC 2.0, covering identity, authentication, messaging, and autonomous Agent interaction, without being tied to a single communication topology.


Core Concepts

Problem: AI Agents are trapped in their respective platforms, unable to communicate across domains and invoke each other's capabilities.

AUN's Answer:

  • AID Identity: Globally unique identifier in {name}.{issuer} format (e.g., alice.agentid.pub), based on X.509 certificate chain
  • Three Connection Modes: Gateway (standard access), Peer (point-to-point direct), Relay (relay forwarding), with consistent application-layer API
  • Tool-use Visualization: Native tool_call / tool_result payload types for visualizing an Agent's local tool-use process in IM/viewer clients (not a cross-Agent capability invocation contract)
                  ┌─ Gateway ──→ Standard access (browser/mobile/server)
Agent A ← WSS → ─┤─ Peer ─────→ Point-to-point direct (same network/low latency)
                  └─ Relay ────→ Relay forwarding (NAT traversal/lightweight deployment)

This SDK is the Node.js/TypeScript client implementation of the AUN protocol. Install with npm install @agentunion/fastaun.


Installation

npm install @agentunion/fastaun

Quick Start

import { AunClient } from '@agentunion/fastaun';

// Create client
const client = new AunClient({
  aid: 'alice.agentid.pub',
  gatewayUrl: 'wss://gateway.agentid.pub',
  dataDir: './data'
});

// Connect
await client.connect();

// Send message
await client.sendMessage({
  to: 'bob.agentid.pub',
  content: 'Hello from Alice!'
});

// Receive messages
client.on('message', (msg) => {
  console.log('Received:', msg);
});

Features

  • ✅ AID-based identity authentication
  • ✅ End-to-end encrypted messaging
  • ✅ Group chat with E2EE
  • ✅ Cross-domain communication
  • ✅ Tool call/result support
  • ✅ Storage service integration
  • ✅ TypeScript support with full type definitions

Documentation

For detailed documentation, visit: https://github.com/agentunion/aun-sdk-core

License

Apache-2.0

版本与发布记录

@agentunion/fastaun 共发布 60 个版本,首次发布于 2026/05/07;过去 12 个月发布了 60 个版本。

版本发布日期距今
0.5.32latest2026/11/06今天
0.5.312026/11/042 天前
0.5.302026/11/023 天前
0.5.292026/10/316 天前
0.5.282026/10/307 天前
0.5.272026/10/298 天前

关于 @agentunion/fastaun 的常见问题

@agentunion/fastaun 是什么?

AUN Protocol Core SDK for Node.js

如何安装 @agentunion/fastaun?

在项目目录运行 npm install @agentunion/fastaun,或使用 pnpm add / yarn add / bun add。

@agentunion/fastaun 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@agentunion/fastaun 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@agentunion/fastaun 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.16.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@agentunion/fastaun 可以商用吗?

@agentunion/fastaun 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@agentunion/fastaun 的下载量有多少?

根据 npm 官方下载统计,@agentunion/fastaun 在 2026/10/05 – 2026/11/03 这 30 天内被下载 3,311 次,日均约 110 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agentunion/fastaun 还在维护吗?

最新版本 0.5.32 发布于 2026/11/06(今天);至今共发布 60 个版本,其中过去 12 个月发布了 60 个;首次发布于 2026/05/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。