@aimail/mail

中文文档
0.1.55发布于 2026/10/20MITTypeScriptES Module构建来源已验证近 30 天下载 2915

AIMail platform-neutral config resolution: sessionId/email/recipient → agentmail.json → AgentConfig (pure functions, no framework deps).

此软件包已被标记为弃用

superseded by agent-aimail >=0.2.0 (single package for all agent hosts)

原始使用文档
文档目录3 节
  1. Install
  2. What it does
  3. Related

@aimail/mail

Platform-neutral AIMail config resolution for TypeScript: session id / email / recipient → agentmail.json → AgentConfig. Pure functions, no framework imports, no host wiring.

npm

Install

pnpm add @aimail/mail

What it does

Three lookups over the per-address agentmail.json bindings under $AIMAIL_HOME (default ~/.aimail):

  • resolveBySessionId(sessionId) — session-file match first, then agent_id field match (dsh session uuids, OpenClaw/pi agent ids).
  • resolveByEmail(email) — exact registered-address match.
  • resolveByRecipient(recipient) — exact match, then persona-strip fallback (recipient local part ends with .<registered local part>), mirroring the Python route_agent_for_email semantics for role aliases.

ResolveOptions.systemId narrows the scan to one system; otherwise AIMAIL_SYSTEM_ID is used, and failing that all systems are scanned (systems/{system_id}/{address_dir}/agentmail.json).

Unbound resolutions throw (no aimail binding for …) instead of guessing an identity.

版本与发布记录

@aimail/mail 共发布 70 个版本,首次发布于 2026/08/19;过去 12 个月发布了 70 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.55latest2026/10/2019 天前
0.1.542026/10/1820 天前
0.1.532026/10/1721 天前
0.1.522026/10/1622 天前
0.1.512026/10/1424 天前
0.1.502026/10/1127 天前

其他发布通道:rc → 0.1.12-rc.2。

关于 @aimail/mail 的常见问题

@aimail/mail 是什么?

AIMail platform-neutral config resolution: sessionId/email/recipient → agentmail.json → AgentConfig (pure functions, no framework deps).注意:该包已被作者标记为弃用——superseded by agent-aimail >=0.2.0 (single package for all agent hosts)

如何安装 @aimail/mail?

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

@aimail/mail 支持 TypeScript 吗?

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

@aimail/mail 支持 ESM 还是 CommonJS?

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

@aimail/mail 可以商用吗?

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

@aimail/mail 的下载量有多少?

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

@aimail/mail 还在维护吗?

最新版本 0.1.55 发布于 2026/10/20(19 天前);至今共发布 70 个版本,其中过去 12 个月发布了 70 个;首次发布于 2026/08/19。作者已将其标记为弃用,新项目建议寻找替代方案。