trotta-mail 0.0.0-stage → 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Trotta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,49 @@
1
- # Temporary Holding Version
1
+ # trotta-mail
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An email inbox for your AI agent, screened before it reads anything. TypeScript SDK for
4
+ [Trotta Mail](https://trotta.email). No dependencies. Node 18+, Bun, Deno, Workers and browsers.
5
+
6
+ ```bash
7
+ npm install trotta-mail
8
+ ```
9
+
10
+ ## Sign up an agent
11
+
12
+ ```ts
13
+ import { TrottaMail } from "trotta-mail";
14
+
15
+ const mail = await TrottaMail.signup({ name: "ada" }); // no account, no key: one call
16
+ console.log(mail.inbox.address, mail.apiKey); // keep the key, it is shown once
17
+ console.log(mail.claimUrl); // for the human responsible for this agent
18
+ ```
19
+
20
+ Later: `new TrottaMail({ apiKey })`, or set `TROTTA_MAIL_API_KEY`.
21
+
22
+ ## Send
23
+
24
+ ```ts
25
+ await mail.messages.send(mail.inbox.id, { to: "maya@example.com", subject: "Hello", text: "Hi Maya." });
26
+ ```
27
+
28
+ `sendAt` sends it later. `waitForReply: 60` waits for the answer.
29
+
30
+ ## Wait for a code
31
+
32
+ ```ts
33
+ const msg = await mail.inboxes.wait(mail.inbox.id, { hasCode: true, timeout: 120 });
34
+ console.log(msg?.extracted.codes[0].value); // "481920"
35
+ ```
36
+
37
+ ## The rest
38
+
39
+ - Every route an agent or a developer uses: inboxes, messages, drafts, threads, the guard, lists, webhooks,
40
+ events (with a live stream), pods, keys, domains, usage, updates and sitrep.
41
+ - What you read is the safe view: hidden text removed, instructions aimed at a model marked, risky links
42
+ defanged. Held mail comes back `withheld: true` until a human releases it.
43
+ - Unwanted mail: `mail.guard.report(id, { as: "spam" })`. `"safe"` brings it back.
44
+ - Lists are arrays with `nextCursor`. Every object is typed.
45
+ - Errors are typed: `NotFoundError`, `PermissionDeniedError`, `RateLimitError` and the rest extend
46
+ `TrottaMailError`, with `code`, `fix` and `requestId`.
47
+ - Webhooks: `await mail.webhooks.verify(rawBody, headers, secret)` returns the event, or throws.
48
+
49
+ Docs: [trotta.email/docs](https://trotta.email/docs)