@gadicc/loom 1.16.1 → 1.18.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.
Files changed (104) hide show
  1. package/README.md +74 -41
  2. package/deno.json +3 -0
  3. package/esm/_dnt.polyfills.d.ts +6 -0
  4. package/esm/_dnt.polyfills.d.ts.map +1 -1
  5. package/esm/mod.d.ts +2 -0
  6. package/esm/mod.d.ts.map +1 -1
  7. package/esm/mod.js +2 -0
  8. package/esm/src/cli/mod.d.ts +4 -2
  9. package/esm/src/cli/mod.d.ts.map +1 -1
  10. package/esm/src/cli/mod.js +2018 -369
  11. package/esm/src/cli/projectTooling.d.ts +138 -0
  12. package/esm/src/cli/projectTooling.d.ts.map +1 -0
  13. package/esm/src/cli/projectTooling.js +614 -0
  14. package/esm/src/mail/errors.d.ts +33 -0
  15. package/esm/src/mail/errors.d.ts.map +1 -0
  16. package/esm/src/mail/errors.js +89 -0
  17. package/esm/src/mail/memory.d.ts +30 -0
  18. package/esm/src/mail/memory.d.ts.map +1 -0
  19. package/esm/src/mail/memory.js +340 -0
  20. package/esm/src/mail/mod.d.ts +7 -0
  21. package/esm/src/mail/mod.d.ts.map +1 -0
  22. package/esm/src/mail/mod.js +6 -0
  23. package/esm/src/mail/postal.d.ts +57 -0
  24. package/esm/src/mail/postal.d.ts.map +1 -0
  25. package/esm/src/mail/postal.js +238 -0
  26. package/esm/src/mail/retry.d.ts +9 -0
  27. package/esm/src/mail/retry.d.ts.map +1 -0
  28. package/esm/src/mail/retry.js +19 -0
  29. package/esm/src/mail/service.d.ts +23 -0
  30. package/esm/src/mail/service.d.ts.map +1 -0
  31. package/esm/src/mail/service.js +185 -0
  32. package/esm/src/mail/types.d.ts +176 -0
  33. package/esm/src/mail/types.d.ts.map +1 -0
  34. package/esm/src/mail/types.js +1 -0
  35. package/esm/src/mui/mail.d.ts +29 -0
  36. package/esm/src/mui/mail.d.ts.map +1 -0
  37. package/esm/src/mui/mail.js +114 -0
  38. package/esm/src/mui/mailView.d.ts +20 -0
  39. package/esm/src/mui/mailView.d.ts.map +1 -0
  40. package/esm/src/mui/mailView.js +26 -0
  41. package/esm/src/mui/mod.d.ts +1 -0
  42. package/esm/src/mui/mod.d.ts.map +1 -1
  43. package/esm/src/mui/mod.js +1 -0
  44. package/esm/src/next/mail/mod.d.ts +3 -0
  45. package/esm/src/next/mail/mod.d.ts.map +1 -0
  46. package/esm/src/next/mail/mod.js +2 -0
  47. package/esm/src/next/mail/route.d.ts +12 -0
  48. package/esm/src/next/mail/route.d.ts.map +1 -0
  49. package/esm/src/next/mail/route.js +43 -0
  50. package/package.json +56 -2
  51. package/script/_dnt.polyfills.d.ts +6 -0
  52. package/script/_dnt.polyfills.d.ts.map +1 -1
  53. package/script/mod.d.ts +2 -0
  54. package/script/mod.d.ts.map +1 -1
  55. package/script/mod.js +2 -0
  56. package/script/src/cli/mod.d.ts +4 -2
  57. package/script/src/cli/mod.d.ts.map +1 -1
  58. package/script/src/cli/mod.js +2018 -369
  59. package/script/src/cli/projectTooling.d.ts +138 -0
  60. package/script/src/cli/projectTooling.d.ts.map +1 -0
  61. package/script/src/cli/projectTooling.js +634 -0
  62. package/script/src/mail/errors.d.ts +33 -0
  63. package/script/src/mail/errors.d.ts.map +1 -0
  64. package/script/src/mail/errors.js +97 -0
  65. package/script/src/mail/memory.d.ts +30 -0
  66. package/script/src/mail/memory.d.ts.map +1 -0
  67. package/script/src/mail/memory.js +345 -0
  68. package/script/src/mail/mod.d.ts +7 -0
  69. package/script/src/mail/mod.d.ts.map +1 -0
  70. package/script/src/mail/mod.js +22 -0
  71. package/script/src/mail/postal.d.ts +57 -0
  72. package/script/src/mail/postal.d.ts.map +1 -0
  73. package/script/src/mail/postal.js +245 -0
  74. package/script/src/mail/retry.d.ts +9 -0
  75. package/script/src/mail/retry.d.ts.map +1 -0
  76. package/script/src/mail/retry.js +22 -0
  77. package/script/src/mail/service.d.ts +23 -0
  78. package/script/src/mail/service.d.ts.map +1 -0
  79. package/script/src/mail/service.js +189 -0
  80. package/script/src/mail/types.d.ts +176 -0
  81. package/script/src/mail/types.d.ts.map +1 -0
  82. package/script/src/mail/types.js +2 -0
  83. package/script/src/mui/mail.d.ts +29 -0
  84. package/script/src/mui/mail.d.ts.map +1 -0
  85. package/script/src/mui/mail.js +159 -0
  86. package/script/src/mui/mailView.d.ts +20 -0
  87. package/script/src/mui/mailView.d.ts.map +1 -0
  88. package/script/src/mui/mailView.js +32 -0
  89. package/script/src/mui/mod.d.ts +1 -0
  90. package/script/src/mui/mod.d.ts.map +1 -1
  91. package/script/src/mui/mod.js +1 -0
  92. package/script/src/next/mail/mod.d.ts +3 -0
  93. package/script/src/next/mail/mod.d.ts.map +1 -0
  94. package/script/src/next/mail/mod.js +18 -0
  95. package/script/src/next/mail/route.d.ts +12 -0
  96. package/script/src/next/mail/route.d.ts.map +1 -0
  97. package/script/src/next/mail/route.js +46 -0
  98. package/skills/loom/SKILL.md +34 -22
  99. package/skills/loom-db/SKILL.md +9 -7
  100. package/skills/loom-db/references/db-stack.md +2 -1
  101. package/skills/loom-jobs/SKILL.md +9 -6
  102. package/skills/loom-lingui/SKILL.md +38 -0
  103. package/skills/loom-lingui/agents/openai.yaml +4 -0
  104. package/skills/loom-mail/SKILL.md +68 -0
@@ -0,0 +1,238 @@
1
+ import "../../_dnt.polyfills.js";
2
+ import { LoomMailError, LoomMailTransportError } from "./errors.js";
3
+ export class LoomPostalWebhookError extends LoomMailError {
4
+ constructor(message, options) {
5
+ super(message, { code: options.code });
6
+ Object.defineProperty(this, "status", {
7
+ enumerable: true,
8
+ configurable: true,
9
+ writable: true,
10
+ value: void 0
11
+ });
12
+ this.name = "LoomPostalWebhookError";
13
+ this.status = options.status ?? 400;
14
+ }
15
+ }
16
+ function postalBaseUrl(host) {
17
+ const normalized = host.trim();
18
+ if (!normalized) {
19
+ throw new LoomMailTransportError("Postal host is not configured.", {
20
+ code: "postal_not_configured",
21
+ retryable: false,
22
+ });
23
+ }
24
+ return normalized.startsWith("http://") || normalized.startsWith("https://")
25
+ ? normalized
26
+ : `https://${normalized}`;
27
+ }
28
+ function fromAddress(message) {
29
+ return message.fromName
30
+ ? `${message.fromName} <${message.fromEmail}>`
31
+ : message.fromEmail;
32
+ }
33
+ function retryableHttpStatus(status) {
34
+ return status === 408 || status === 429 || status >= 500;
35
+ }
36
+ async function responseJson(response) {
37
+ try {
38
+ return await response.json();
39
+ }
40
+ catch {
41
+ return null;
42
+ }
43
+ }
44
+ function normalizePostalResult(response) {
45
+ return {
46
+ deliveries: Object.entries(response.data?.messages ?? {}).map(([email, delivery]) => ({
47
+ email,
48
+ providerDeliveryId: delivery.id === undefined
49
+ ? null
50
+ : String(delivery.id),
51
+ providerToken: delivery.token ?? null,
52
+ })),
53
+ providerMessageId: response.data?.message_id ?? null,
54
+ providerResponse: {
55
+ data: response.data ?? {},
56
+ flags: response.flags ?? {},
57
+ time: response.time ?? null,
58
+ },
59
+ };
60
+ }
61
+ /** Postal outgoing transport without persistence or environment ownership. */
62
+ export function createPostalMailTransport(options) {
63
+ const fetchImpl = options.fetch ?? globalThis.fetch;
64
+ return {
65
+ provider: "postal",
66
+ async send(message) {
67
+ if (!options.apiKey.trim()) {
68
+ throw new LoomMailTransportError("Postal API key is not configured.", { code: "postal_not_configured", retryable: false });
69
+ }
70
+ let response;
71
+ try {
72
+ response = await fetchImpl(new URL("/api/v1/send/message", postalBaseUrl(options.host)), {
73
+ body: JSON.stringify({
74
+ attachments: message.attachments.map((attachment) => ({
75
+ content_type: attachment.contentType ?? undefined,
76
+ data: attachment.data,
77
+ name: attachment.name,
78
+ })),
79
+ bcc: message.bcc,
80
+ cc: message.cc,
81
+ from: fromAddress(message),
82
+ headers: message.headers,
83
+ html_body: message.htmlBody ?? undefined,
84
+ plain_body: message.plainBody ?? undefined,
85
+ reply_to: message.replyTo ?? undefined,
86
+ subject: message.subject,
87
+ tag: message.tag ?? undefined,
88
+ to: message.to,
89
+ }),
90
+ headers: {
91
+ "Content-Type": "application/json",
92
+ "X-Server-API-Key": options.apiKey,
93
+ },
94
+ method: "POST",
95
+ });
96
+ }
97
+ catch (error) {
98
+ throw new LoomMailTransportError("Postal request failed to connect.", {
99
+ cause: error,
100
+ code: "postal_network_error",
101
+ retryable: true,
102
+ });
103
+ }
104
+ const body = await responseJson(response);
105
+ if (!response.ok) {
106
+ throw new LoomMailTransportError(`Postal request failed with HTTP ${response.status}.`, {
107
+ code: `postal_http_${response.status}`,
108
+ payload: { status: response.status },
109
+ retryable: retryableHttpStatus(response.status),
110
+ });
111
+ }
112
+ if (!body) {
113
+ throw new LoomMailTransportError("Postal returned an invalid JSON response.", { code: "postal_invalid_response", retryable: true });
114
+ }
115
+ if (body.status !== "success") {
116
+ const code = body.error?.code ?? "postal_error";
117
+ const providerMessage = body.error?.message ?? body.message ??
118
+ "Postal rejected the message.";
119
+ throw new LoomMailTransportError(providerMessage, {
120
+ code,
121
+ payload: { postalCode: code },
122
+ retryable: false,
123
+ });
124
+ }
125
+ return normalizePostalResult(body);
126
+ },
127
+ };
128
+ }
129
+ function bytes(value) {
130
+ return typeof value === "string"
131
+ ? new TextEncoder().encode(value)
132
+ : Uint8Array.from(value);
133
+ }
134
+ function base64Bytes(value) {
135
+ try {
136
+ const binary = atob(value.trim());
137
+ return Uint8Array.from(binary, (character) => character.charCodeAt(0));
138
+ }
139
+ catch {
140
+ throw new LoomPostalWebhookError("Postal webhook signature is not valid base64.", { code: "invalid_signature" });
141
+ }
142
+ }
143
+ /** Verifies Postal's RSA-SHA256 signature over the exact request body. */
144
+ export async function verifyPostalWebhookSignature(options) {
145
+ const keyId = options.headers.get("x-postal-signature-kid")?.trim();
146
+ const signature = options.headers.get("x-postal-signature-256")?.trim();
147
+ if (!keyId || !signature) {
148
+ throw new LoomPostalWebhookError("Postal webhook signature headers are missing.", { code: "missing_signature" });
149
+ }
150
+ const jwk = options.publicKeys.find((candidate) => candidate.kid === keyId);
151
+ if (!jwk) {
152
+ throw new LoomPostalWebhookError("Postal webhook signature key is not configured.", { code: "unknown_signature_key", status: 401 });
153
+ }
154
+ if (jwk.kty !== "RSA") {
155
+ throw new LoomPostalWebhookError("Postal webhook signature key must be RSA.", { code: "invalid_signature_key", status: 500 });
156
+ }
157
+ let key;
158
+ try {
159
+ key = await crypto.subtle.importKey("jwk", jwk, { hash: "SHA-256", name: "RSASSA-PKCS1-v1_5" }, false, ["verify"]);
160
+ }
161
+ catch (error) {
162
+ throw new LoomPostalWebhookError(`Postal webhook signature key could not be imported: ${error instanceof Error ? error.message : "invalid key"}`, { code: "invalid_signature_key", status: 500 });
163
+ }
164
+ const valid = await crypto.subtle.verify("RSASSA-PKCS1-v1_5", key, base64Bytes(signature), bytes(options.body));
165
+ if (!valid) {
166
+ throw new LoomPostalWebhookError("Postal webhook signature is invalid.", { code: "invalid_signature", status: 401 });
167
+ }
168
+ return { keyId };
169
+ }
170
+ function requiredString(value, label) {
171
+ if (typeof value !== "string" || !value.trim()) {
172
+ throw new LoomPostalWebhookError(`Postal webhook ${label} is missing.`, { code: "invalid_payload" });
173
+ }
174
+ return value;
175
+ }
176
+ function record(value) {
177
+ return typeof value === "object" && value !== null && !Array.isArray(value)
178
+ ? value
179
+ : {};
180
+ }
181
+ function optionalString(value) {
182
+ return typeof value === "string" && value.trim() ? value : null;
183
+ }
184
+ function postalOccurredAt(value) {
185
+ const number = typeof value === "number"
186
+ ? value
187
+ : typeof value === "string" && /^\d+(?:\.\d+)?$/.test(value)
188
+ ? Number(value)
189
+ : Number.NaN;
190
+ const date = Number.isFinite(number)
191
+ ? new Date(number < 10_000_000_000 ? number * 1_000 : number)
192
+ : new Date(String(value));
193
+ if (Number.isNaN(date.valueOf())) {
194
+ throw new LoomPostalWebhookError("Postal webhook timestamp is invalid.", { code: "invalid_payload" });
195
+ }
196
+ return date;
197
+ }
198
+ function normalizedPostalEventType(event) {
199
+ switch (event) {
200
+ case "MessageSent":
201
+ return "delivered";
202
+ case "MessageDelayed":
203
+ return "delayed";
204
+ case "MessageDeliveryFailed":
205
+ return "failed";
206
+ case "MessageHeld":
207
+ return "held";
208
+ case "MessageBounced":
209
+ return "bounced";
210
+ default:
211
+ return "unknown";
212
+ }
213
+ }
214
+ /** Parses an already-verified Postal webhook into the provider-neutral event. */
215
+ export function parsePostalWebhook(body) {
216
+ let envelope;
217
+ try {
218
+ envelope = JSON.parse(body);
219
+ }
220
+ catch {
221
+ throw new LoomPostalWebhookError("Postal webhook body is not valid JSON.", { code: "invalid_json" });
222
+ }
223
+ const event = requiredString(envelope.event, "event");
224
+ const providerEventId = requiredString(envelope.uuid, "uuid");
225
+ const payload = record(envelope.payload);
226
+ const message = record(payload.message);
227
+ return {
228
+ eventType: normalizedPostalEventType(event),
229
+ occurredAt: postalOccurredAt(envelope.timestamp),
230
+ payload,
231
+ provider: "postal",
232
+ providerDeliveryId: message.id === undefined ? null : String(message.id),
233
+ providerEventId,
234
+ providerMessageId: optionalString(message.message_id),
235
+ recipient: optionalString(message.to),
236
+ sourceEvent: event,
237
+ };
238
+ }
@@ -0,0 +1,9 @@
1
+ import type { LoomMailRetryPolicy } from "./types.js";
2
+ export interface CreateExponentialMailRetryPolicyOptions {
3
+ baseDelayMs?: number;
4
+ maxAttempts?: number;
5
+ maxDelayMs?: number;
6
+ }
7
+ /** Bounded deterministic backoff; jitter belongs in an app-specific policy. */
8
+ export declare function createExponentialMailRetryPolicy(options?: CreateExponentialMailRetryPolicyOptions): LoomMailRetryPolicy;
9
+ //# sourceMappingURL=retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../src/src/mail/retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,uCAAuC;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,+EAA+E;AAC/E,wBAAgB,gCAAgC,CAC9C,OAAO,GAAE,uCAA4C,GACpD,mBAAmB,CAkBrB"}
@@ -0,0 +1,19 @@
1
+ /** Bounded deterministic backoff; jitter belongs in an app-specific policy. */
2
+ export function createExponentialMailRetryPolicy(options = {}) {
3
+ const baseDelayMs = options.baseDelayMs ?? 30_000;
4
+ const maxDelayMs = options.maxDelayMs ?? 60 * 60_000;
5
+ const maxAttempts = options.maxAttempts ?? 5;
6
+ if (baseDelayMs < 0 || maxDelayMs < 0 || maxAttempts < 1) {
7
+ throw new TypeError("Mail retry policy values must be non-negative.");
8
+ }
9
+ return {
10
+ maxAttempts,
11
+ retryAt({ attemptCount, failure, now }) {
12
+ if (!failure.retryable || attemptCount >= maxAttempts)
13
+ return null;
14
+ const exponent = Math.max(0, attemptCount - 1);
15
+ const delayMs = Math.min(maxDelayMs, baseDelayMs * 2 ** exponent);
16
+ return new Date(now.valueOf() + delayMs);
17
+ },
18
+ };
19
+ }
@@ -0,0 +1,23 @@
1
+ import type { LoomMailEnqueueInput, LoomMailInput, LoomMailMessageRecord, LoomMailRepository, LoomMailRetryPolicy, LoomMailService, LoomMailTransport } from "./types.js";
2
+ export interface CreateLoomMailServiceOptions<TMessage extends LoomMailMessageRecord = LoomMailMessageRecord> {
3
+ createLeaseToken?: () => string;
4
+ defaultFromEmail: string;
5
+ defaultFromName?: string;
6
+ leaseDurationMs?: number;
7
+ now?: () => Date;
8
+ repository: LoomMailRepository<TMessage>;
9
+ retryPolicy?: LoomMailRetryPolicy;
10
+ transport: LoomMailTransport;
11
+ }
12
+ export declare function normalizeLoomMailInput(input: LoomMailInput, defaults: {
13
+ fromEmail: string;
14
+ fromName?: string;
15
+ provider: string;
16
+ }): LoomMailEnqueueInput;
17
+ /**
18
+ * Creates a durable mail service. Repository claim/completion methods must be
19
+ * atomic and lease-token checked; the service deliberately does not emulate
20
+ * those guarantees in process memory.
21
+ */
22
+ export declare function createLoomMailService<TMessage extends LoomMailMessageRecord = LoomMailMessageRecord>(options: CreateLoomMailServiceOptions<TMessage>): LoomMailService<TMessage>;
23
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/src/mail/service.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,oBAAoB,EAEpB,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,4BAA4B,CAC3C,QAAQ,SAAS,qBAAqB,GAAG,qBAAqB;IAE9D,gBAAgB,CAAC,EAAE,MAAM,MAAM,CAAC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,UAAU,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,SAAS,EAAE,iBAAiB,CAAC;CAC9B;AAsCD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE;IACR,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,GACA,oBAAoB,CA0BtB;AAWD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,SAAS,qBAAqB,GAAG,qBAAqB,EAC9D,OAAO,EAAE,4BAA4B,CAAC,QAAQ,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC,CA2H5E"}
@@ -0,0 +1,185 @@
1
+ import { LoomMailDeliveryError, LoomMailLeaseLostError, LoomMailTransportError, LoomMailValidationError, } from "./errors.js";
2
+ import { createExponentialMailRetryPolicy } from "./retry.js";
3
+ function recipients(value) {
4
+ if (!value)
5
+ return [];
6
+ return (Array.isArray(value) ? value : [value])
7
+ .map((item) => item.trim())
8
+ .filter(Boolean);
9
+ }
10
+ function nullableText(value) {
11
+ const normalized = value?.trim();
12
+ return normalized ? normalized : null;
13
+ }
14
+ function assertMailInput(input, normalized) {
15
+ if (!normalized.fromEmail) {
16
+ throw new LoomMailValidationError("A From address is required.");
17
+ }
18
+ if (!input.subject.trim()) {
19
+ throw new LoomMailValidationError("A subject is required.");
20
+ }
21
+ if (normalized.to.length + normalized.cc.length + normalized.bcc.length === 0) {
22
+ throw new LoomMailValidationError("At least one recipient is required.");
23
+ }
24
+ if (!nullableText(input.plainBody) && !nullableText(input.htmlBody)) {
25
+ throw new LoomMailValidationError("Either plainBody or htmlBody is required.");
26
+ }
27
+ }
28
+ export function normalizeLoomMailInput(input, defaults) {
29
+ const normalized = {
30
+ bcc: recipients(input.bcc),
31
+ cc: recipients(input.cc),
32
+ fromEmail: input.fromEmail?.trim() || defaults.fromEmail.trim(),
33
+ to: recipients(input.to),
34
+ };
35
+ assertMailInput(input, normalized);
36
+ return {
37
+ attachments: (input.attachments ?? []).map((attachment) => ({
38
+ contentType: nullableText(attachment.contentType ?? undefined),
39
+ data: attachment.data,
40
+ name: attachment.name,
41
+ })),
42
+ ...normalized,
43
+ fromName: nullableText(input.fromName ?? defaults.fromName),
44
+ headers: { ...input.headers },
45
+ htmlBody: nullableText(input.htmlBody),
46
+ metadata: { ...input.metadata },
47
+ plainBody: nullableText(input.plainBody),
48
+ provider: defaults.provider,
49
+ replyTo: nullableText(input.replyTo),
50
+ subject: input.subject.trim(),
51
+ tag: nullableText(input.tag),
52
+ };
53
+ }
54
+ function failureFromError(error) {
55
+ if (error instanceof LoomMailTransportError)
56
+ return error.toFailure();
57
+ return {
58
+ code: "transport_error",
59
+ message: error instanceof Error ? error.message : "Unknown mail error",
60
+ retryable: false,
61
+ };
62
+ }
63
+ /**
64
+ * Creates a durable mail service. Repository claim/completion methods must be
65
+ * atomic and lease-token checked; the service deliberately does not emulate
66
+ * those guarantees in process memory.
67
+ */
68
+ export function createLoomMailService(options) {
69
+ const now = options.now ?? (() => new Date());
70
+ const createLeaseToken = options.createLeaseToken ??
71
+ (() => crypto.randomUUID());
72
+ const retryPolicy = options.retryPolicy ??
73
+ createExponentialMailRetryPolicy();
74
+ const leaseDurationMs = options.leaseDurationMs ?? 5 * 60_000;
75
+ if (leaseDurationMs < 1) {
76
+ throw new TypeError("Mail lease duration must be positive.");
77
+ }
78
+ if (options.transport.provider.trim() === "") {
79
+ throw new TypeError("Mail transport provider must not be empty.");
80
+ }
81
+ async function deliverNext(messageId) {
82
+ const claimedAt = now();
83
+ const claimed = await options.repository.claim({
84
+ leaseExpiresAt: new Date(claimedAt.valueOf() + leaseDurationMs),
85
+ leaseToken: createLeaseToken(),
86
+ messageId,
87
+ now: claimedAt,
88
+ });
89
+ if (!claimed)
90
+ return null;
91
+ let result;
92
+ try {
93
+ result = await options.transport.send(claimed);
94
+ }
95
+ catch (error) {
96
+ const failure = failureFromError(error);
97
+ const failedAt = now();
98
+ const retryAt = retryPolicy.retryAt({
99
+ attemptCount: claimed.attemptCount,
100
+ failure,
101
+ now: failedAt,
102
+ });
103
+ const completed = await options.repository.completeFailure({
104
+ failure,
105
+ leaseToken: claimed.leaseToken,
106
+ messageId: claimed.id,
107
+ occurredAt: failedAt,
108
+ retryAt,
109
+ });
110
+ if (!completed)
111
+ throw new LoomMailLeaseLostError(claimed.id);
112
+ return {
113
+ failure,
114
+ messageId: claimed.id,
115
+ retryAt,
116
+ status: "failed",
117
+ };
118
+ }
119
+ // Keep provider acceptance outside the transport catch. If persistence
120
+ // fails here, the live lease remains observable instead of falsely marking
121
+ // the accepted message as a transport failure.
122
+ const completed = await options.repository.completeSuccess({
123
+ leaseToken: claimed.leaseToken,
124
+ messageId: claimed.id,
125
+ occurredAt: now(),
126
+ result,
127
+ });
128
+ if (!completed)
129
+ throw new LoomMailLeaseLostError(claimed.id);
130
+ return {
131
+ messageId: claimed.id,
132
+ status: "sent",
133
+ transportResult: result,
134
+ };
135
+ }
136
+ return {
137
+ cancelMail(messageId) {
138
+ return options.repository.cancel(messageId, now());
139
+ },
140
+ deliverNext,
141
+ async drain(limit = 20) {
142
+ const boundedLimit = Number.isFinite(limit)
143
+ ? Math.min(1_000, Math.max(0, Math.floor(limit)))
144
+ : 0;
145
+ const result = { attempted: 0, failed: 0, retried: 0, sent: 0 };
146
+ for (let index = 0; index < boundedLimit; index++) {
147
+ const attempt = await deliverNext();
148
+ if (!attempt)
149
+ break;
150
+ result.attempted++;
151
+ if (attempt.status === "sent") {
152
+ result.sent++;
153
+ }
154
+ else {
155
+ result.failed++;
156
+ if (attempt.retryAt)
157
+ result.retried++;
158
+ }
159
+ }
160
+ return result;
161
+ },
162
+ handleProviderEvent(event) {
163
+ return options.repository.recordProviderEvent(event);
164
+ },
165
+ queueMail(input) {
166
+ const occurredAt = now();
167
+ return options.repository.enqueue(normalizeLoomMailInput(input, {
168
+ fromEmail: options.defaultFromEmail,
169
+ fromName: options.defaultFromName,
170
+ provider: options.transport.provider,
171
+ }), occurredAt);
172
+ },
173
+ async sendMail(input) {
174
+ const message = await this.queueMail(input);
175
+ const attempt = await deliverNext(message.id);
176
+ if (!attempt) {
177
+ throw new LoomMailLeaseLostError(message.id);
178
+ }
179
+ if (attempt.status === "failed") {
180
+ throw new LoomMailDeliveryError(message.id, attempt.failure, attempt.retryAt ?? null);
181
+ }
182
+ return { message, result: attempt.transportResult };
183
+ },
184
+ };
185
+ }
@@ -0,0 +1,176 @@
1
+ export type LoomMailMessageStatus = "cancelled" | "delivered" | "failed" | "partially_delivered" | "queued" | "sending" | "sent";
2
+ export type LoomMailDeliveryStatus = "accepted" | "bounced" | "cancelled" | "delayed" | "delivered" | "failed" | "held" | "queued";
3
+ export type LoomMailRecipientKind = "bcc" | "cc" | "to";
4
+ export type LoomMailProviderEventType = "bounced" | "delayed" | "delivered" | "failed" | "held" | "unknown";
5
+ export interface LoomMailAttachment {
6
+ contentType?: string | null;
7
+ data: string;
8
+ name: string;
9
+ }
10
+ export interface LoomMailInput {
11
+ attachments?: LoomMailAttachment[];
12
+ bcc?: string | string[];
13
+ cc?: string | string[];
14
+ fromEmail?: string;
15
+ fromName?: string;
16
+ headers?: Record<string, string>;
17
+ htmlBody?: string;
18
+ metadata?: Record<string, unknown>;
19
+ plainBody?: string;
20
+ replyTo?: string;
21
+ subject: string;
22
+ tag?: string;
23
+ to: string | string[];
24
+ }
25
+ export interface LoomMailEnqueueInput {
26
+ attachments: LoomMailAttachment[];
27
+ bcc: string[];
28
+ cc: string[];
29
+ fromEmail: string;
30
+ fromName: string | null;
31
+ headers: Record<string, string>;
32
+ htmlBody: string | null;
33
+ metadata: Record<string, unknown>;
34
+ plainBody: string | null;
35
+ provider: string;
36
+ replyTo: string | null;
37
+ subject: string;
38
+ tag: string | null;
39
+ to: string[];
40
+ }
41
+ export interface LoomMailMessageRecord extends LoomMailEnqueueInput {
42
+ attemptCount: number;
43
+ availableAt: Date;
44
+ cancelledAt: Date | null;
45
+ createdAt: Date;
46
+ deliveredAt: Date | null;
47
+ failedAt: Date | null;
48
+ id: string;
49
+ lastErrorCode: string | null;
50
+ lastErrorMessage: string | null;
51
+ leaseExpiresAt: Date | null;
52
+ leaseToken: string | null;
53
+ providerMessageId: string | null;
54
+ sentAt: Date | null;
55
+ status: LoomMailMessageStatus;
56
+ updatedAt: Date;
57
+ }
58
+ export interface LoomMailDeliveryRecord {
59
+ createdAt: Date;
60
+ deliveredAt: Date | null;
61
+ email: string;
62
+ id: string;
63
+ kind: LoomMailRecipientKind;
64
+ lastErrorCode: string | null;
65
+ lastErrorMessage: string | null;
66
+ messageId: string;
67
+ providerDeliveryId: string | null;
68
+ providerToken: string | null;
69
+ status: LoomMailDeliveryStatus;
70
+ updatedAt: Date;
71
+ }
72
+ export interface LoomMailProviderDeliveryResult {
73
+ email: string;
74
+ providerDeliveryId: string | null;
75
+ providerToken: string | null;
76
+ }
77
+ export interface LoomMailTransportResult {
78
+ deliveries: LoomMailProviderDeliveryResult[];
79
+ providerMessageId: string | null;
80
+ providerResponse?: Record<string, unknown>;
81
+ }
82
+ export interface LoomMailTransport {
83
+ readonly provider: string;
84
+ send(message: LoomMailMessageRecord): Promise<LoomMailTransportResult>;
85
+ }
86
+ export interface LoomMailFailure {
87
+ code: string;
88
+ message: string;
89
+ payload?: Record<string, unknown>;
90
+ retryable: boolean;
91
+ }
92
+ export interface LoomMailClaimRequest {
93
+ leaseExpiresAt: Date;
94
+ leaseToken: string;
95
+ messageId?: string;
96
+ now: Date;
97
+ }
98
+ export interface LoomMailClaimedMessage extends LoomMailMessageRecord {
99
+ leaseExpiresAt: Date;
100
+ leaseToken: string;
101
+ status: "sending";
102
+ }
103
+ export interface LoomMailCompleteSuccessInput {
104
+ leaseToken: string;
105
+ messageId: string;
106
+ occurredAt: Date;
107
+ result: LoomMailTransportResult;
108
+ }
109
+ export interface LoomMailCompleteFailureInput {
110
+ failure: LoomMailFailure;
111
+ leaseToken: string;
112
+ messageId: string;
113
+ occurredAt: Date;
114
+ retryAt: Date | null;
115
+ }
116
+ export interface LoomMailProviderEvent {
117
+ eventType: LoomMailProviderEventType;
118
+ occurredAt: Date;
119
+ payload: Record<string, unknown>;
120
+ provider: string;
121
+ providerDeliveryId: string | null;
122
+ providerEventId: string;
123
+ providerMessageId: string | null;
124
+ recipient: string | null;
125
+ sourceEvent: string;
126
+ }
127
+ export interface LoomMailProviderEventResult {
128
+ inserted: boolean;
129
+ messageId: string | null;
130
+ }
131
+ /**
132
+ * Persistence is app-owned so Drizzle and database clients never leak into the
133
+ * Deno-first core. `claim` and both completion methods are atomic boundaries.
134
+ */
135
+ export interface LoomMailRepository<TMessage extends LoomMailMessageRecord = LoomMailMessageRecord> {
136
+ cancel(messageId: string, occurredAt: Date): Promise<boolean>;
137
+ claim(request: LoomMailClaimRequest): Promise<(TMessage & LoomMailClaimedMessage) | null>;
138
+ completeFailure(input: LoomMailCompleteFailureInput): Promise<boolean>;
139
+ completeSuccess(input: LoomMailCompleteSuccessInput): Promise<boolean>;
140
+ enqueue(input: LoomMailEnqueueInput, occurredAt: Date): Promise<TMessage>;
141
+ findById?(messageId: string): Promise<TMessage | null>;
142
+ recordProviderEvent(event: LoomMailProviderEvent): Promise<LoomMailProviderEventResult>;
143
+ }
144
+ export interface LoomMailRetryPolicy {
145
+ maxAttempts: number;
146
+ retryAt(input: {
147
+ attemptCount: number;
148
+ failure: LoomMailFailure;
149
+ now: Date;
150
+ }): Date | null;
151
+ }
152
+ export interface LoomMailDeliveryAttempt {
153
+ failure?: LoomMailFailure;
154
+ messageId: string;
155
+ retryAt?: Date | null;
156
+ status: "failed" | "sent";
157
+ transportResult?: LoomMailTransportResult;
158
+ }
159
+ export interface LoomMailDrainResult {
160
+ attempted: number;
161
+ failed: number;
162
+ retried: number;
163
+ sent: number;
164
+ }
165
+ export interface LoomMailService<TMessage extends LoomMailMessageRecord = LoomMailMessageRecord> {
166
+ cancelMail(messageId: string): Promise<boolean>;
167
+ deliverNext(messageId?: string): Promise<LoomMailDeliveryAttempt | null>;
168
+ drain(limit?: number): Promise<LoomMailDrainResult>;
169
+ handleProviderEvent(event: LoomMailProviderEvent): Promise<LoomMailProviderEventResult>;
170
+ queueMail(input: LoomMailInput): Promise<TMessage>;
171
+ sendMail(input: LoomMailInput): Promise<{
172
+ message: TMessage;
173
+ result: LoomMailTransportResult;
174
+ }>;
175
+ }
176
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/mail/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,WAAW,GACX,QAAQ,GACR,qBAAqB,GACrB,QAAQ,GACR,SAAS,GACT,MAAM,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAC9B,UAAU,GACV,SAAS,GACT,WAAW,GACX,SAAS,GACT,WAAW,GACX,QAAQ,GACR,MAAM,GACN,QAAQ,CAAC;AAEb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