@firedrill-tools/resend 0.1.1

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.
Files changed (65) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +198 -0
  3. package/firedrill/agent.target.json +16 -0
  4. package/firedrill/baseline.scenario.json +1687 -0
  5. package/firedrill/conformance.suite.json +19 -0
  6. package/firedrill/contacts-outage.scenario.json +11 -0
  7. package/firedrill/quota-exhausted.scenario.json +17 -0
  8. package/firedrill/rate-limited.scenario.json +11 -0
  9. package/firedrill/resend-audience.drill.json +407 -0
  10. package/firedrill/resend-contacts-outage.drill.json +63 -0
  11. package/firedrill/resend-denied.drill.json +68 -0
  12. package/firedrill/resend-domains-and-keys.drill.json +307 -0
  13. package/firedrill/resend-email-flow.drill.json +286 -0
  14. package/firedrill/resend-fresh-install.drill.json +73 -0
  15. package/firedrill/resend-invalid-key.drill.json +803 -0
  16. package/firedrill/resend-large-page.drill.json +53 -0
  17. package/firedrill/resend-quota-exhausted.drill.json +82 -0
  18. package/firedrill/resend-rate-limited.drill.json +81 -0
  19. package/firedrill/resend-restricted-key.drill.json +441 -0
  20. package/firedrill/resend-tight-limits.drill.json +163 -0
  21. package/firedrill/tight-limits.scenario.json +16 -0
  22. package/firedrill/tools/resend/app/assets/ATTRIBUTION.md +30 -0
  23. package/firedrill/tools/resend/app/assets/fonts/Inter-OFL.txt +93 -0
  24. package/firedrill/tools/resend/app/assets/fonts/JetBrainsMono-OFL.txt +93 -0
  25. package/firedrill/tools/resend/app/assets/fonts/inter-latin-wght-normal.woff2 +0 -0
  26. package/firedrill/tools/resend/app/assets/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
  27. package/firedrill/tools/resend/app/assets/resend-icon-white.svg +3 -0
  28. package/firedrill/tools/resend/app/assets/resend-wordmark-white.svg +3 -0
  29. package/firedrill/tools/resend/app/assets/resend.svg +3 -0
  30. package/firedrill/tools/resend/app/site/app.js +90 -0
  31. package/firedrill/tools/resend/app/site/assets/fonts/inter-latin-wght-normal.woff2 +0 -0
  32. package/firedrill/tools/resend/app/site/assets/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
  33. package/firedrill/tools/resend/app/site/assets/resend-icon-white.svg +3 -0
  34. package/firedrill/tools/resend/app/site/assets/resend-wordmark-white.svg +3 -0
  35. package/firedrill/tools/resend/app/site/assets/resend.svg +3 -0
  36. package/firedrill/tools/resend/app/site/contact-panel.js +86 -0
  37. package/firedrill/tools/resend/app/site/icons.js +70 -0
  38. package/firedrill/tools/resend/app/site/index.html +56 -0
  39. package/firedrill/tools/resend/app/site/list.js +41 -0
  40. package/firedrill/tools/resend/app/site/styles.css +67 -0
  41. package/firedrill/tools/resend/app/site/ui.js +259 -0
  42. package/firedrill/tools/resend/app/site/view-audience.js +160 -0
  43. package/firedrill/tools/resend/app/site/view-domains.js +106 -0
  44. package/firedrill/tools/resend/app/site/view-email-detail.js +126 -0
  45. package/firedrill/tools/resend/app/site/view-emails.js +83 -0
  46. package/firedrill/tools/resend/app/site/view-keys.js +91 -0
  47. package/firedrill/tools/resend/app/site/views.css +141 -0
  48. package/firedrill/tools/resend/behavior.mjs +114 -0
  49. package/firedrill/tools/resend/lib/check.mjs +75 -0
  50. package/firedrill/tools/resend/lib/core.mjs +112 -0
  51. package/firedrill/tools/resend/lib/json-depth.mjs +45 -0
  52. package/firedrill/tools/resend/lib/page.mjs +66 -0
  53. package/firedrill/tools/resend/lib/time.mjs +60 -0
  54. package/firedrill/tools/resend/lib/wire.mjs +98 -0
  55. package/firedrill/tools/resend/ops/contacts.mjs +199 -0
  56. package/firedrill/tools/resend/ops/domains.mjs +125 -0
  57. package/firedrill/tools/resend/ops/email-model.mjs +100 -0
  58. package/firedrill/tools/resend/ops/emails.mjs +139 -0
  59. package/firedrill/tools/resend/ops/keys-segments.mjs +97 -0
  60. package/firedrill/tools/resend/resend.tool.json +4804 -0
  61. package/firedrill/world.json +2148 -0
  62. package/firedrill.json +5 -0
  63. package/package.json +62 -0
  64. package/starter.json +1686 -0
  65. package/test/conformance.mjs +480 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Reload Tech Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,198 @@
1
+ # @firedrill-tools/resend
2
+
3
+ A synthetic **Resend** team for [Firedrill](https://firedrill.run): send and batch-send e-mails with deterministic synthetic
4
+ delivery, manage sending domains with generated DNS records, API keys, segments and contacts — through Resend-shaped REST
5
+ routes, canonical `resend.<operation>` calls and Resend MCP tool names. All state lives in the Firedrill world; nothing is
6
+ delivered, no DNS is queried and no real service is ever contacted.
7
+
8
+ A browser app that recreates the Resend dashboard (Emails, Domains, API Keys, Audience) ships with the Tool; see
9
+ [Browser app](#browser-app).
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ firedrill tool add @firedrill-tools/resend --install
15
+ firedrill serve
16
+ ```
17
+
18
+ A new world receives the starter data below and grants for every operation. For an existing world, grant the operations
19
+ you need to your actor (`packageId: "resend"`, operation ids from the table) and add the starter rows yourself.
20
+
21
+ ## Identities
22
+
23
+ The calling API key is modelled with one actor attribute:
24
+
25
+ | attribute | meaning |
26
+ |---|---|
27
+ | `resendApiKeyId` (UUID, optional) | Row of `api-keys` the actor calls with. **Absent** → the team's default key (`Production`, full access), so an actor created by `firedrill tool add` sees the seeded team. **Present but unknown** (never existed or removed) → every operation fails `invalid_api_key` (403). |
28
+
29
+ A `sending_access` key may call only `emails.send`, `emails.send_batch` and `workspace.context`; everything else fails
30
+ `restricted_api_key` (401). A `sending_access` key with a domain may send only from that domain (403 `validation_error`).
31
+ The team's default key (`Production`) cannot be removed (422 `validation_error`), because it is the identity of actors
32
+ without `resendApiKeyId`; any other key, including one an actor explicitly calls with, can be removed, after which that
33
+ actor's calls fail `invalid_api_key`. HTTP authentication itself uses the Firedrill world token (`FIREDRILL_HTTP_TOKEN`); `re_…` tokens are never validated.
34
+
35
+ ## Starting data
36
+
37
+ Virtual time 2026-09-15T14:00:00Z. Team "Northwind Labs" (free plan, daily quota 100, 7 sent today); 4 domains
38
+ (`mail.northwind.test` and `updates.northwind.test` verified, `billing.northwind.test` not started,
39
+ `legacy.northwind.invalid` failed); 3 API keys (`Production`, `Marketing sender` restricted to `updates.northwind.test`,
40
+ `Staging CI`); 23 e-mails (delivered, bounced, 3 pending scheduled, 1 scheduled for 13:30 that is already due, 2 canceled,
41
+ a 3-email batch, a 50-recipient newsletter, a Unicode subject); 3 segments ("Newsletter" 9 members, "Beta testers" 5,
42
+ "Empty segment"); 14 contacts with names, properties and unsubscribes. All addresses are fictional (`example.com`,
43
+ `.test`, `.invalid`).
44
+
45
+ ## Operations
46
+
47
+ Canonical inputs use camelCase argument names (the MCP tool argument names); REST routes take Resend's snake_case JSON
48
+ bodies and query parameters. Mutations accept `Idempotency-Key` (REST) — see *Idempotency*.
49
+
50
+ | operation | MCP alias | REST route | notes |
51
+ |---|---|---|---|
52
+ | `emails.send` | `send-email` | `POST /emails` | `from`, `to` (≤ 50), `subject`, `html`/`text`, `cc`, `bcc`, `reply_to`, `headers`, `tags`, `scheduled_at` (ISO 8601 with zone, ≤ 30 days) |
53
+ | `emails.send_batch` | `send-batch-emails` | `POST /emails/batch` | JSON array of 1–100 emails, all-or-nothing, no `scheduled_at` |
54
+ | `emails.list` | `list-emails` | `GET /emails` | `limit`, `after`, `before`; canonical-only `query` (to/subject substring) and `status` |
55
+ | `emails.get` | `get-email` | `GET /emails/{email_id}` | |
56
+ | `emails.update` | `update-email` | `PATCH /emails/{email_id}` | reschedule a pending scheduled email |
57
+ | `emails.cancel` | `cancel-email` | `POST /emails/{email_id}/cancel` | |
58
+ | `domains.create` | `create-domain` | `POST /domains` (201) | `name`, `region`, `custom_return_path`, `open_tracking`, `click_tracking`, `tls`, `capabilities` |
59
+ | `domains.list` | `list-domains` | `GET /domains` | |
60
+ | `domains.get` | `get-domain` | `GET /domains/{domain_id}` | includes DNS `records` |
61
+ | `domains.verify` | `verify-domain` | `POST /domains/{domain_id}/verify` | |
62
+ | `domains.remove` | `remove-domain` | `DELETE /domains/{domain_id}` | |
63
+ | `api_keys.create` | `create-api-key` | `POST /api-keys` (201) | `name`, `permission`, `domain_id`; token returned once, never stored |
64
+ | `api_keys.list` | `list-api-keys` | `GET /api-keys` | |
65
+ | `api_keys.remove` | `remove-api-key` | `DELETE /api-keys/{api_key_id}` | |
66
+ | `segments.create` | `create-segment` | `POST /segments` (201) | |
67
+ | `segments.list` | `list-segments` | `GET /segments` | |
68
+ | `segments.remove` | `remove-segment` | `DELETE /segments/{id}` | also removes memberships |
69
+ | `contacts.create` | `create-contact` | `POST /contacts` (201) | `email`, `first_name`, `last_name`, `unsubscribed`, `properties`, `segments: [{ id }]` |
70
+ | `contacts.list` | `list-contacts` | `GET /contacts` | `segment_id`; canonical-only `query` |
71
+ | `contacts.get` | `get-contact` | `GET /contacts/{id}` | `{id}` is a UUID or an e-mail address (case-insensitive) |
72
+ | `contacts.update` | `update-contact` | `PATCH /contacts/{id}` | body `email` changes the address (canonical `newEmail`) |
73
+ | `contacts.remove` | `remove-contact` | `DELETE /contacts/{id}` | |
74
+ | `contacts.add_segment` | `add-contact-to-segment` | `POST /contacts/{contact_id}/segments/{segment_id}` | |
75
+ | `contacts.remove_segment` | `remove-contact-from-segment` | `DELETE /contacts/{contact_id}/segments/{segment_id}` | |
76
+ | `contacts.list_segments` | `list-contact-segments` | `GET /contacts/{contact_id}/segments` | |
77
+ | `workspace.context` | — | — (canonical only) | team, calling key, virtual `now` |
78
+
79
+ Lists are newest first with Resend's cursor pagination: `limit` 1–100 (default 20), exclusive `after`/`before` object
80
+ ids, response `{ "object": "list", "has_more": …, "data": [...] }`. Unknown or malformed cursors fail `validation_error`.
81
+
82
+ ## Synthetic behaviour
83
+
84
+ - **Delivery.** An immediate send is `delivered`, or `bounced` when any `to`/`cc`/`bcc` address is in the reserved
85
+ `.invalid` TLD; the same operation emits `email.sent` and then `email.delivered` or `email.bounced`. A scheduled send is
86
+ `scheduled`; once its time has passed, reads show `delivered`/`bounced` by the same rule, but **no event is emitted at
87
+ that moment** and it can no longer be updated or canceled.
88
+ - **Domains.** Records are generated from the name and region (SPF MX/TXT on `send.<name>`, DKIM TXT with a random key,
89
+ a Receiving MX when receiving is enabled). Verification is instant: `verified`, or `failed` for names ending in
90
+ `.invalid`. Sending requires the `from` domain to exist, be verified and have sending enabled.
91
+ - **Quota.** The team's daily quota (100) counts accepted e-mails per virtual UTC day; a batch that would exceed it is
92
+ rejected whole with 429 `daily_quota_exceeded`.
93
+ - **Bounds.** Scanning operations read at most `meta/limits.maxScanRows` rows (5000 by default, ≤ 10000) and fail with
94
+ 500 `application_error` ("state exceeds the supported bound of N rows") instead of returning a truncated list.
95
+ - **Nesting.** JSON request bodies nested deeper than 512 levels are refused with 400 before validation.
96
+
97
+ ## Errors
98
+
99
+ REST errors use Resend's envelope `{ "statusCode", "message", "name" }`:
100
+
101
+ | declared code | status | `name` |
102
+ |---|---|---|
103
+ | `VALIDATION_ERROR` | 422 | `validation_error` |
104
+ | `MISSING_REQUIRED_FIELD` | 422 | `missing_required_field` |
105
+ | `INVALID_PARAMETER` | 422 | `invalid_parameter` (malformed id or e-mail in a path) |
106
+ | `INVALID_IDEMPOTENCY_KEY` | 400 | `invalid_idempotency_key` |
107
+ | `RESTRICTED_API_KEY` | 401 | `restricted_api_key` |
108
+ | `INVALID_API_KEY` | 403 | `invalid_api_key` |
109
+ | `DOMAIN_NOT_VERIFIED` | 403 | `validation_error` |
110
+ | `NOT_FOUND` | 404 | `not_found` |
111
+ | `DAILY_QUOTA_EXCEEDED` | 429 | `daily_quota_exceeded` |
112
+ | `RATE_LIMIT_EXCEEDED` | 429 | `rate_limit_exceeded` (+ `ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`, `retry-after`) |
113
+ | `APPLICATION_ERROR` | 500 | `application_error` |
114
+
115
+ Framework outcomes keep the framework's HTTP status and get a Resend-shaped body: a request whose field has the wrong
116
+ JSON type (for example a non-object batch entry) fails schema validation with **400** `validation_error` (Resend would usually answer 422); a call the actor is
117
+ not granted answers 403 `invalid_access`; unknown paths are the framework's 404. Validation messages, the 30-day
118
+ scheduling window, "Contact already exists", `object: "contact_segment"` and the 201 statuses of create routes are
119
+ approximations of the public documentation.
120
+
121
+ ## Events and faults
122
+
123
+ | id | kind | when |
124
+ |---|---|---|
125
+ | `email.sent` | event | every accepted immediate e-mail (`email_id`, `from`, `to`, `subject`, `created_at`, `batch_id`) |
126
+ | `email.delivered` | event | after `email.sent` when no recipient is in `.invalid` |
127
+ | `email.bounced` | event | after `email.sent` when a recipient is in `.invalid` (`bounce.type: "Permanent"`) |
128
+ | `send-rate-limited` | fault, before | `emails.send`, `emails.send_batch` → 429 `rate_limit_exceeded`; nothing is written |
129
+ | `contacts-create-unavailable` | fault, after commit | `contacts.create` → 500 `application_error` although the contact **was created**; a retry answers 422 "Contact already exists" |
130
+
131
+ ## Idempotency
132
+
133
+ `Idempotency-Key` values of 1–128 characters become the Firedrill idempotency key (a replay returns the first result
134
+ without a second write). Keys of 129–256 characters are accepted **without deduplication** because Firedrill records
135
+ keys of at most 128 characters. Empty keys and keys over 256 characters fail 400 `invalid_idempotency_key`. Over MCP or
136
+ the canonical endpoint, an `idempotencyKey` argument is only length-checked; use the framework's idempotency key there.
137
+ Reusing a key with a different request body fails **400** `validation_error` ("Invalid request: the idempotency key was already used with different arguments") and writes nothing; Resend answers 409 `invalid_idempotent_request`, but HTTP statuses of framework-rejected requests are framework-owned.
138
+
139
+ ## Compatibility
140
+
141
+ The routes, field names, pagination and error envelope follow Resend's public API reference for the implemented subset.
142
+ **Not verified against a real client**: the manifest's `compatibility` block is empty and no official SDK or the Resend
143
+ MCP server has been exercised against this Tool. MCP aliases reuse the Resend MCP server's tool names and argument names
144
+ but return JSON results. Response headers cannot depend on request headers (Firedrill encoders see only the invocation),
145
+ and `User-Agent` is not required.
146
+
147
+ ## Not implemented
148
+
149
+ Received e-mails, attachments (sending or listing; `attachments` in a send → 422), templates (`template` → 422),
150
+ broadcasts, automations, custom events, topics (`topic_id`/`topics` → 422), contact property definitions (properties are
151
+ free-form: ≤ 20 lowercase keys with string ≤ 500 characters, number or null values), contact imports, suppressions,
152
+ webhooks and callbacks, logs, metrics, OAuth grants, `/audiences` (deprecated upstream; use segments), segment `filter`,
153
+ `GET`/`PATCH /segments/{id}`, `PATCH /domains/{id}`, `PATCH /api-keys/{id}`, tracking subdomains, open/click tracking
154
+ effects, batch `x-batch-validation: permissive`, natural-language `scheduled_at`, monthly quotas and real request-rate
155
+ counting (429 `rate_limit_exceeded` only comes from the fault). Unimplemented endpoints do not exist (404).
156
+
157
+ ## Conformance
158
+
159
+ `firedrill tool test resend` runs 12 drills (`test/conformance.mjs`, Node built-ins only) across the actors `owner`,
160
+ `fresh`, `sender`, `revoked` and `no-grants` and the scenarios `baseline`, `rate-limited`, `contacts-outage`,
161
+ `quota-exhausted` and `tight-limits`, covering every operation, declared error, event and fault.
162
+
163
+ ## Browser app
164
+
165
+ `firedrill serve` prints the app link (inspector: **Tools → Open app**). The app is a dark dashboard in the Resend layout:
166
+ sidebar with the team switcher, navigation and daily-usage card; every screen calls this Tool's operations for the selected
167
+ actor, so app writes are visible over HTTP and MCP and vice versa.
168
+
169
+ | screen | what works | operations |
170
+ |---|---|---|
171
+ | Emails (Sending) | table To · Status · Subject · Sent, search (recipient/subject), status filter, Previous/Next pages | `emails.list`, `workspace.context` |
172
+ | Email detail | From, Subject, To, ID (copy), Cc/Bcc/Reply-To/tags, event timeline, Preview / Plain Text / HTML tabs; Cancel (confirm) and Reschedule for scheduled emails | `emails.get`, `emails.cancel`, `emails.update` |
173
+ | Domains | list, Add domain (name, region), domain page with DNS records (copy), Verify DNS Records, Delete (confirm) | `domains.list/create/get/verify/remove` |
174
+ | API Keys | list, Create API Key (name, permission, domain for sending access) with the token shown once, Delete (confirm) | `api_keys.list/create/remove`, `domains.list` |
175
+ | Audience › Contacts | table, search, segment filter, Add contacts (with segments), contact panel: names, subscription, segment membership, properties, Delete | `contacts.list/create/get/update/remove/add_segment/remove_segment/list_segments`, `segments.list` |
176
+ | Audience › Segments | list, Create segment, Delete (confirm), open a segment's contacts | `segments.list/create/remove` |
177
+
178
+ Relative dates ("2 days ago") use the world's virtual time from `workspace.context`, never the browser clock; absolute
179
+ times are shown in UTC. Mutations send a fresh idempotency key per action; screens re-read after writes and when the
180
+ world revision changes. Loading, empty, error and denied states are rendered from the real outcomes. Email HTML is
181
+ previewed by rebuilding an allowlisted, attribute-free DOM (links never navigate).
182
+
183
+ **Not simulated** (visible, open a short "not simulated by this Tool" note): Broadcasts, Templates, Audience Topics and
184
+ Properties, Metrics, Logs, Webhooks, Settings, the Emails "Receiving" tab, the date-range and API-key filters, Export,
185
+ the Insights tab, Docs, Help, the team switcher and the account menu. The API Keys **Permission** column shows the
186
+ permission of the calling key only (the list response carries no permission field); other rows show "—". Tokens are
187
+ masked in the list (the list response carries no token); a new token is shown once in the create dialog.
188
+
189
+ ## Trademarks
190
+
191
+ Resend and the Resend logo are trademarks of their owner. The name and the official logo files bundled in the app (sources in
192
+ `firedrill/tools/resend/app/assets/ATTRIBUTION.md`) are used only to identify the simulated service in a test environment;
193
+ this package is not affiliated with or endorsed by Resend. The bundled fonts (Inter, JetBrains Mono) are licensed under the
194
+ SIL Open Font License 1.1.
195
+
196
+ ## License
197
+
198
+ Apache-2.0
@@ -0,0 +1,16 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "target": {
4
+ "id": "conformance-agent",
5
+ "kind": "command",
6
+ "bindings": [
7
+ "http"
8
+ ],
9
+ "executable": "node",
10
+ "arguments": [
11
+ "test/conformance.mjs"
12
+ ],
13
+ "workingDirectory": ".",
14
+ "timeoutMs": 120000
15
+ }
16
+ }