@fungi.computer/seam

中文文档
0.2.5发布于 2026/11/08MITTypeScriptES Module近 30 天下载 1万

Ed25519 authentication between Fungi Hub and on-box hosts

原始使用文档
文档目录7 节
  1. Install
  2. Machine link
  3. Quick start
  4. Core concepts
  5. Examples and checks
  6. Contribute and license
  7. Packed consumer readiness

Seam (@fungi.computer/seam)

Seam signs and verifies requests between the Fungi Hub and the hosts it runs on, with Ed25519 signatures and replay protection, and carries the machine-link protocol between them. Keys stay with the operator; the package ships the protocol and the replay guard.

Install

npm install @fungi.computer/seam

@fungi.computer/seam/machine-link-protocol owns the shared machine-link audience/dial URL, bounded read/leave and Agent-operation grammar, Agent mail address schema, and createMachineLinkPostChannel. The channel carries ordinary Carrier Post envelopes and receipts; Carrier retains retries. Hosts own live authorization, socket lifetime and durable replay storage. Delegation request keys and execution policy remain with the delegation engine, not Seam.

Quick start

import { SeamReplayGuard } from "@fungi.computer/seam";

const replay = new SeamReplayGuard();
const now = Date.now();
const record = {
  nonce: "00112233445566778899aabbccddeeff",
  now,
  expiresAt: now + 120_000,
};
console.log(replay.admit(record)); // admitted
console.log(replay.admit(record)); // replayed

Core concepts

The sender signs method, audience, path, timestamp, nonce and payload digest. The receiver checks the signature, freshness and replay guard against its pinned keys.

verifySeamRequest accepts one SeamReplayStore. It verifies the signature before awaiting atomic admission, and supplies a deadline covering the complete freshness window, including its last instant. The store must preserve that deadline, record before reporting success, and refuse at its finite capacity rather than evict still-live nonces. Its closed decisions are admitted, replayed, at-capacity, and unavailable; all refusals fail verification.

SeamReplayGuard is the process-local implementation, with a private 10,000-record ceiling. It is not persistent. A durable receiver must bind one store to its reconstruction-stable receiver namespace; storage and numeric capacity are host implementation decisions. There is no memory fallback on persistence failure. A record remains live when expiresAt === now; prune only strictly older deadlines, without assuming insertion order is expiry order.

Examples and checks

The packed runtime fixture at test/stranger/runtime.mjs exercises the public API in a fresh consumer. Run pnpm run stranger after building the package.

Contribute and license

See LICENSE for the MIT terms.

Packed consumer readiness

Run pnpm run build, pnpm run pack and pnpm run stranger in this package. The maintained stranger proof installs only package tarballs into a fresh npm consumer, checks the exact shipped files, runs the public runtime fixture and compiles every JavaScript entrypoint with strict NodeNext and no library-check skip. This qualification does not publish npm releases or push a repository split.

Run pnpm --filter @fungi.computer/seam test for signature, audience, body and replay laws. Computer and game-server host tests exercise its real consumers. See LICENSE.

版本与发布记录

@fungi.computer/seam 共发布 9 个版本,首次发布于 2026/10/17;过去 12 个月发布了 9 个版本。

版本发布日期距今
0.2.5latest2026/11/087 天前
0.2.42026/11/087 天前
0.2.32026/11/088 天前
0.2.22026/11/0510 天前
0.2.12026/11/0412 天前
0.2.02026/10/2620 天前

关于 @fungi.computer/seam 的常见问题

@fungi.computer/seam 是什么?

Ed25519 authentication between Fungi Hub and on-box hosts

如何安装 @fungi.computer/seam?

在项目目录运行 npm install @fungi.computer/seam,或使用 pnpm add / yarn add / bun add。

@fungi.computer/seam 支持 TypeScript 吗?

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

@fungi.computer/seam 支持 ESM 还是 CommonJS?

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

@fungi.computer/seam 可以商用吗?

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

@fungi.computer/seam 的下载量有多少?

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

@fungi.computer/seam 还在维护吗?

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