@decentnetwork/beagle

中文文档
0.1.121发布于 2026/11/01MITTypeScriptES Module

Beagle — P2P chat, file transfer and calls for regular users, on the Decent Network. No admin privilege required.

原始使用文档
文档目录4 节
  1. Run
  2. Calls (web ↔ Android)
  3. Status: Phase 1
  4. Layout

Beagle

P2P chat, file transfer and calls over the Decent Network. No account, no server, no admin privilege — your identity is a keypair on your own machine, and messages go peer-to-peer.

Beagle is the application. The protocol lives in @decentnetwork/peer (SDK) and the virtual-LAN layer in @decentnetwork/lan (decentlan, a developer and operator tool). Beagle iterates fast; those stay boring on purpose.

Run

npm install
npm run build
node dist/cli.js

Then open http://localhost:8766.

--port <n>         HTTP port (default 8766)
--host <addr>      bind address (default 127.0.0.1)
--config-dir <p>   identity/config dir (default ~/.agentnet)
--dora-dir <p>     dora roster dir, if this machine runs a dora

Port 8766 rather than decentlan's 8765, so during the transition the old agentnet ui and Beagle can run side by side on one machine.

Calls (web ↔ Android)

Online WebRTC with the Android app uses Carrier bootstrap TURN, not the tokyo messaging relay. See docs/webrtc-android-interop.md for the failure modes and how the first-call cold-start was fixed.

Status: Phase 1

Beagle picks a backend for its Carrier identity. Exactly one is ever live, because one identity must never run two Carrier peers at once — two peers on the same keypair race on session establishment and corrupt each other's state.

BackendStatusNeeds rootVirtual LAN
daemon — talks to a running decentlan daemon over IPCshippingno (the daemon does)yes
embedded — Beagle opens its own Peer in-processPhase 2nono

Today Beagle requires a decentlan daemon. Phase 2 adds the embedded backend, at which point Beagle runs standalone at ordinary user privilege and decentlan becomes the optional "I also want a virtual LAN" add-on.

Identity is read from ~/.agentnet by default, so a machine already running decentlan keeps the same userid and the same friends — it is the same node, not a new one.

Layout

src/
├── cli.ts        # the `beagle` binary — argument parsing, startup
├── peer-host.ts  # backend abstraction + selection (the split's hinge)
├── ipc.ts        # decentlan daemon wire protocol, client side
├── server.ts     # local HTTP server: /api/* + serves the UI bundle
├── exits.ts      # official exit table (network panel only)
└── desktop/      # the UI itself (JSX, concatenated + esbuild-transpiled)

scripts/build-ui.mjs bundles src/desktop/*.jsx into dist/desktop/app.js. The UI runs as one concatenated script sharing global scope with React (UMD) — no CDN, no in-browser Babel.

版本与发布记录

@decentnetwork/beagle 共发布 120 个版本,首次发布于 2026/07/27;过去 12 个月发布了 120 个版本。

版本发布日期距今
0.1.121latest2026/11/012 天前
0.1.1202026/10/313 天前
0.1.1192026/10/2113 天前
0.1.1182026/09/291 个月前
0.1.1172026/09/271 个月前
0.1.1162026/09/271 个月前

关于 @decentnetwork/beagle 的常见问题

@decentnetwork/beagle 是什么?

小猎犬- P2P聊天,文件传输和呼叫为普通用户,在体面的网络。不需要管理员权限。

如何安装 @decentnetwork/beagle?

在项目目录运行 npm install @decentnetwork/beagle,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 beagle,可以用 npx beagle 直接运行。

@decentnetwork/beagle 支持 TypeScript 吗?

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

@decentnetwork/beagle 支持 ESM 还是 CommonJS?

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

@decentnetwork/beagle 需要什么版本的 Node.js?

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

@decentnetwork/beagle 可以商用吗?

@decentnetwork/beagle 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@decentnetwork/beagle 还在维护吗?

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