@agenticmail/core 0.9.7 → 0.9.8
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 +12 -0
- package/dist/index.cjs +8 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -188,6 +188,18 @@ Uses your existing Gmail or Outlook account as a middleman. This is the easiest
|
|
|
188
188
|
|
|
189
189
|
**Deduplication:** The system tracks delivered messages by (message_id, agent_name) to prevent the same email from being delivered twice. Sent message tracking keeps up to 10,000 entries in memory for reply routing.
|
|
190
190
|
|
|
191
|
+
### External inbox exposure — read before enabling the relay
|
|
192
|
+
|
|
193
|
+
> **The RelayGateway makes every sub-agent publicly reachable from the internet** the moment relay mode is configured (typically via `agenticmail setup-email` or the `gateway/relay` POST). This is by design — agents that can email each other locally aren't very useful for talking to real people — but the implications surprise some operators:
|
|
194
|
+
|
|
195
|
+
- **Plus-addresses are publicly guessable.** Anyone who knows your relay address can hit `your-relay+secretary@gmail.com`, `your-relay+kepler@gmail.com`, etc. and the corresponding agent's inbox receives the message. The `+sub` part is not a secret.
|
|
196
|
+
- **External mail wakes the dispatcher identically to internal `@localhost` mail.** When an inbound message lands on a watched account, the dispatcher emits an SSE `new-mail` event and the host integration (`@agenticmail/claudecode`, `@agenticmail/codex`) spawns a worker turn. There's no source-based filter — `bob@gmail.com` and `secretary@localhost` are indistinguishable from the wake path's point of view.
|
|
197
|
+
- **The host bridges take a different path.** Mail to `your-relay+claudecode@gmail.com` / `your-relay+codex@gmail.com` routes to `handleBridgeMail`, which uses the host SDK's `resume` option to wake the operator's last session headlessly, falling through to the bridge-escalation email at `setup_operator_email` if resume fails.
|
|
198
|
+
- **Spam = worker turns.** A scraper that guesses a plus-address can drive Claude / Codex invocations at the operator's expense. Throttles in order of escalation:
|
|
199
|
+
1. The `wake-budget` guard in `dispatcher.handleEvent` (default cap per minute per agent — kicks in automatically).
|
|
200
|
+
2. Relay-layer spam filtering — the built-in spam filter runs on inbound mail before publishing the SSE event.
|
|
201
|
+
3. For agents that should be internal-only, set `metadata.host` to a value no dispatcher matches, so the SSE event fires but no host wakes on it.
|
|
202
|
+
|
|
191
203
|
### Domain Mode
|
|
192
204
|
|
|
193
205
|
Full custom domain through Cloudflare. Agents send from `agent@yourdomain.com` with proper email authentication (DKIM, SPF, DMARC).
|
package/dist/index.cjs
CHANGED
|
@@ -969,6 +969,14 @@ var MailReceiver = class {
|
|
|
969
969
|
name: a.name,
|
|
970
970
|
address: a.address ?? ""
|
|
971
971
|
})),
|
|
972
|
+
cc: (env.cc ?? []).map((a) => ({
|
|
973
|
+
name: a.name,
|
|
974
|
+
address: a.address ?? ""
|
|
975
|
+
})),
|
|
976
|
+
bcc: (env.bcc ?? []).map((a) => ({
|
|
977
|
+
name: a.name,
|
|
978
|
+
address: a.address ?? ""
|
|
979
|
+
})),
|
|
972
980
|
date: env.date ?? /* @__PURE__ */ new Date(),
|
|
973
981
|
flags: msg.flags ?? /* @__PURE__ */ new Set(),
|
|
974
982
|
size: msg.size ?? 0
|
package/dist/index.d.cts
CHANGED
|
@@ -37,6 +37,12 @@ interface EmailEnvelope {
|
|
|
37
37
|
subject: string;
|
|
38
38
|
from: AddressInfo[];
|
|
39
39
|
to: AddressInfo[];
|
|
40
|
+
/** Cc/Bcc from the IMAP ENVELOPE response. Added so message-view's
|
|
41
|
+
* quote-audience backfill can pull the previous rounds' Cc/Bcc
|
|
42
|
+
* without a full FETCH BODY round-trip — ENVELOPE already carries
|
|
43
|
+
* them, we just weren't surfacing them. */
|
|
44
|
+
cc?: AddressInfo[];
|
|
45
|
+
bcc?: AddressInfo[];
|
|
40
46
|
date: Date;
|
|
41
47
|
flags: Set<string>;
|
|
42
48
|
size: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,12 @@ interface EmailEnvelope {
|
|
|
37
37
|
subject: string;
|
|
38
38
|
from: AddressInfo[];
|
|
39
39
|
to: AddressInfo[];
|
|
40
|
+
/** Cc/Bcc from the IMAP ENVELOPE response. Added so message-view's
|
|
41
|
+
* quote-audience backfill can pull the previous rounds' Cc/Bcc
|
|
42
|
+
* without a full FETCH BODY round-trip — ENVELOPE already carries
|
|
43
|
+
* them, we just weren't surfacing them. */
|
|
44
|
+
cc?: AddressInfo[];
|
|
45
|
+
bcc?: AddressInfo[];
|
|
40
46
|
date: Date;
|
|
41
47
|
flags: Set<string>;
|
|
42
48
|
size: number;
|
package/dist/index.js
CHANGED
|
@@ -191,6 +191,14 @@ var MailReceiver = class {
|
|
|
191
191
|
name: a.name,
|
|
192
192
|
address: a.address ?? ""
|
|
193
193
|
})),
|
|
194
|
+
cc: (env.cc ?? []).map((a) => ({
|
|
195
|
+
name: a.name,
|
|
196
|
+
address: a.address ?? ""
|
|
197
|
+
})),
|
|
198
|
+
bcc: (env.bcc ?? []).map((a) => ({
|
|
199
|
+
name: a.name,
|
|
200
|
+
address: a.address ?? ""
|
|
201
|
+
})),
|
|
194
202
|
date: env.date ?? /* @__PURE__ */ new Date(),
|
|
195
203
|
flags: msg.flags ?? /* @__PURE__ */ new Set(),
|
|
196
204
|
size: msg.size ?? 0
|