@aimail/mail 0.1.0-rc.11 → 0.1.0-rc.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/lib/index.js +1 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @aimail/mail
|
|
2
|
+
|
|
3
|
+
Platform-neutral AIMail config resolution for TypeScript: session id / email
|
|
4
|
+
/ recipient → `agentmail.json` → `AgentConfig`. Pure functions — no framework
|
|
5
|
+
imports, no host wiring.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@aimail/mail)
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @aimail/mail
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## What it does
|
|
16
|
+
|
|
17
|
+
Every adapter needs the same three lookups, sourced from the per-address
|
|
18
|
+
`agentmail.json` bindings under `$AIMAIL_HOME` (default `~/.agentmail`):
|
|
19
|
+
|
|
20
|
+
- `resolveBySessionId(sessionId)` — session-file match first, then agent_id
|
|
21
|
+
field match. For dsh session uuids and OpenClaw/pi agent ids.
|
|
22
|
+
- `resolveByEmail(email)` — exact registered-address match. Throws when
|
|
23
|
+
unbound.
|
|
24
|
+
- `resolveByRecipient(recipient)` — exact match first, then persona-strip
|
|
25
|
+
fallback (recipient local part ends with `.<registered local part>`),
|
|
26
|
+
mirroring the Python `route_agent_for_email` semantics. Inbound routing for
|
|
27
|
+
single-in-multi-out platforms (one gateway hosts many agents; mail can
|
|
28
|
+
arrive at role aliases).
|
|
29
|
+
- `resolveConfig()`-style composition is left to each adapter: the identity
|
|
30
|
+
source (pointer file / factory ctx / env) is platform-specific by design.
|
|
31
|
+
|
|
32
|
+
## Scope narrowing
|
|
33
|
+
|
|
34
|
+
`ResolveOptions.systemId` narrows the scan to one system; when omitted the
|
|
35
|
+
`AIMAIL_SYSTEM_ID` env is used; when that is also empty, all systems under
|
|
36
|
+
`$AIMAIL_HOME/systems/` are scanned (two-level traversal:
|
|
37
|
+
`systems/{system_id}/{address_dir}/agentmail.json`).
|
|
38
|
+
|
|
39
|
+
Unbound resolutions throw loudly (`no agentmail binding for …`) — callers
|
|
40
|
+
surface that to the model/user instead of guessing an identity.
|
|
41
|
+
|
|
42
|
+
## Related repositories
|
|
43
|
+
|
|
44
|
+
- [metercai/aimail](https://github.com/metercai/aimail) — the AIMail agent
|
|
45
|
+
runtime (Python): CLI, gateway config, bridge provisioning, and the
|
|
46
|
+
`agentmail.json` binding layout these resolvers read.
|
|
47
|
+
- [metercai/aimail-gateway](https://github.com/metercai/aimail-gateway) — the
|
|
48
|
+
AIMail gateway: SMTP/HTTP mail service and the address & activation APIs
|
|
49
|
+
that create the bindings being resolved here.
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @aimail/mail — platform-neutral
|
|
2
|
+
* @aimail/mail — platform-neutral AIMail config resolution.
|
|
3
3
|
*
|
|
4
4
|
* Pure functions: sessionId / email / agentId → agentmail.json → AgentConfig.
|
|
5
5
|
* No framework imports (no cordis, no dsh-sdk); each platform adapter
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aimail/mail",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"description": "AIMail platform-neutral config resolution: sessionId/email/recipient → agentmail.json → AgentConfig (pure functions, no framework deps).",
|
|
4
|
+
"version": "0.1.0-rc.12",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": true
|