@poncho-ai/messaging 0.2.6 → 0.2.7
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/package.json +2 -2
- package/src/adapters/resend/index.ts +8 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/messaging@0.2.
|
|
2
|
+
> @poncho-ai/messaging@0.2.7 build /home/runner/work/poncho-ai/poncho-ai/packages/messaging
|
|
3
3
|
> tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
[34mCLI[39m tsup v8.5.1
|
|
8
8
|
[34mCLI[39m Target: es2022
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[32mESM[39m [1mdist/index.js [22m[32m29.
|
|
11
|
-
[32mESM[39m ⚡️ Build success in
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m29.65 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 53ms
|
|
12
12
|
[34mDTS[39m Build start
|
|
13
|
-
[32mDTS[39m ⚡️ Build success in
|
|
14
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m8.
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 4785ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m8.98 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -144,6 +144,7 @@ interface ResendAdapterOptions {
|
|
|
144
144
|
apiKeyEnv?: string;
|
|
145
145
|
webhookSecretEnv?: string;
|
|
146
146
|
fromEnv?: string;
|
|
147
|
+
replyToEnv?: string;
|
|
147
148
|
allowedSenders?: string[];
|
|
148
149
|
mode?: "auto-reply" | "tool";
|
|
149
150
|
allowedRecipients?: string[];
|
|
@@ -157,9 +158,11 @@ declare class ResendAdapter implements MessagingAdapter {
|
|
|
157
158
|
private apiKey;
|
|
158
159
|
private webhookSecret;
|
|
159
160
|
private fromAddress;
|
|
161
|
+
private replyToAddress;
|
|
160
162
|
private readonly apiKeyEnv;
|
|
161
163
|
private readonly webhookSecretEnv;
|
|
162
164
|
private readonly fromEnv;
|
|
165
|
+
private readonly replyToEnv;
|
|
163
166
|
private readonly allowedSenders;
|
|
164
167
|
private readonly allowedRecipients;
|
|
165
168
|
private readonly maxSendsPerRun;
|
package/dist/index.js
CHANGED
|
@@ -518,9 +518,11 @@ var ResendAdapter = class {
|
|
|
518
518
|
apiKey = "";
|
|
519
519
|
webhookSecret = "";
|
|
520
520
|
fromAddress = "";
|
|
521
|
+
replyToAddress = "";
|
|
521
522
|
apiKeyEnv;
|
|
522
523
|
webhookSecretEnv;
|
|
523
524
|
fromEnv;
|
|
525
|
+
replyToEnv;
|
|
524
526
|
allowedSenders;
|
|
525
527
|
allowedRecipients;
|
|
526
528
|
maxSendsPerRun;
|
|
@@ -535,6 +537,7 @@ var ResendAdapter = class {
|
|
|
535
537
|
this.apiKeyEnv = options.apiKeyEnv ?? "RESEND_API_KEY";
|
|
536
538
|
this.webhookSecretEnv = options.webhookSecretEnv ?? "RESEND_WEBHOOK_SECRET";
|
|
537
539
|
this.fromEnv = options.fromEnv ?? "RESEND_FROM";
|
|
540
|
+
this.replyToEnv = options.replyToEnv ?? "RESEND_REPLY_TO";
|
|
538
541
|
this.allowedSenders = options.allowedSenders;
|
|
539
542
|
this.mode = options.mode ?? "auto-reply";
|
|
540
543
|
this.autoReply = this.mode !== "tool";
|
|
@@ -552,6 +555,7 @@ var ResendAdapter = class {
|
|
|
552
555
|
this.apiKey = process.env[this.apiKeyEnv] ?? "";
|
|
553
556
|
this.webhookSecret = process.env[this.webhookSecretEnv] ?? "";
|
|
554
557
|
this.fromAddress = process.env[this.fromEnv] ?? "";
|
|
558
|
+
this.replyToAddress = process.env[this.replyToEnv] ?? "";
|
|
555
559
|
if (!this.apiKey) {
|
|
556
560
|
throw new Error(
|
|
557
561
|
`Resend messaging: ${this.apiKeyEnv} environment variable is not set`
|
|
@@ -605,6 +609,7 @@ var ResendAdapter = class {
|
|
|
605
609
|
subject,
|
|
606
610
|
text: content,
|
|
607
611
|
html: markdownToEmailHtml(content),
|
|
612
|
+
reply_to: this.replyToAddress ? [this.replyToAddress] : void 0,
|
|
608
613
|
headers,
|
|
609
614
|
attachments: attachments && attachments.length > 0 ? attachments : void 0
|
|
610
615
|
});
|
|
@@ -712,6 +717,7 @@ var ResendAdapter = class {
|
|
|
712
717
|
html: markdownToEmailHtml(body),
|
|
713
718
|
cc: cc && cc.length > 0 ? cc : void 0,
|
|
714
719
|
bcc: bcc && bcc.length > 0 ? bcc : void 0,
|
|
720
|
+
reply_to: this.replyToAddress ? [this.replyToAddress] : void 0,
|
|
715
721
|
headers: Object.keys(headers).length > 0 ? headers : void 0
|
|
716
722
|
});
|
|
717
723
|
if (result.error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poncho-ai/messaging",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Messaging platform adapters for Poncho agents (Slack, Telegram, etc.)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@poncho-ai/sdk": "1.
|
|
23
|
+
"@poncho-ai/sdk": "1.4.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"resend": ">=4.0.0"
|
|
@@ -34,6 +34,7 @@ interface ResendClient {
|
|
|
34
34
|
html?: string;
|
|
35
35
|
cc?: string[];
|
|
36
36
|
bcc?: string[];
|
|
37
|
+
reply_to?: string[];
|
|
37
38
|
headers?: Record<string, string>;
|
|
38
39
|
attachments?: Array<{ filename: string; content?: string; path?: string; contentType?: string }>;
|
|
39
40
|
}): Promise<{ data?: { id: string }; error?: unknown }>;
|
|
@@ -158,6 +159,7 @@ export interface ResendAdapterOptions {
|
|
|
158
159
|
apiKeyEnv?: string;
|
|
159
160
|
webhookSecretEnv?: string;
|
|
160
161
|
fromEnv?: string;
|
|
162
|
+
replyToEnv?: string;
|
|
161
163
|
allowedSenders?: string[];
|
|
162
164
|
mode?: "auto-reply" | "tool";
|
|
163
165
|
allowedRecipients?: string[];
|
|
@@ -188,9 +190,11 @@ export class ResendAdapter implements MessagingAdapter {
|
|
|
188
190
|
private apiKey = "";
|
|
189
191
|
private webhookSecret = "";
|
|
190
192
|
private fromAddress = "";
|
|
193
|
+
private replyToAddress = "";
|
|
191
194
|
private readonly apiKeyEnv: string;
|
|
192
195
|
private readonly webhookSecretEnv: string;
|
|
193
196
|
private readonly fromEnv: string;
|
|
197
|
+
private readonly replyToEnv: string;
|
|
194
198
|
private readonly allowedSenders: string[] | undefined;
|
|
195
199
|
private readonly allowedRecipients: string[] | undefined;
|
|
196
200
|
private readonly maxSendsPerRun: number;
|
|
@@ -208,6 +212,7 @@ export class ResendAdapter implements MessagingAdapter {
|
|
|
208
212
|
this.apiKeyEnv = options.apiKeyEnv ?? "RESEND_API_KEY";
|
|
209
213
|
this.webhookSecretEnv = options.webhookSecretEnv ?? "RESEND_WEBHOOK_SECRET";
|
|
210
214
|
this.fromEnv = options.fromEnv ?? "RESEND_FROM";
|
|
215
|
+
this.replyToEnv = options.replyToEnv ?? "RESEND_REPLY_TO";
|
|
211
216
|
this.allowedSenders = options.allowedSenders;
|
|
212
217
|
this.mode = options.mode ?? "auto-reply";
|
|
213
218
|
this.autoReply = this.mode !== "tool";
|
|
@@ -228,6 +233,7 @@ export class ResendAdapter implements MessagingAdapter {
|
|
|
228
233
|
this.apiKey = process.env[this.apiKeyEnv] ?? "";
|
|
229
234
|
this.webhookSecret = process.env[this.webhookSecretEnv] ?? "";
|
|
230
235
|
this.fromAddress = process.env[this.fromEnv] ?? "";
|
|
236
|
+
this.replyToAddress = process.env[this.replyToEnv] ?? "";
|
|
231
237
|
|
|
232
238
|
if (!this.apiKey) {
|
|
233
239
|
throw new Error(
|
|
@@ -298,6 +304,7 @@ export class ResendAdapter implements MessagingAdapter {
|
|
|
298
304
|
subject,
|
|
299
305
|
text: content,
|
|
300
306
|
html: markdownToEmailHtml(content),
|
|
307
|
+
reply_to: this.replyToAddress ? [this.replyToAddress] : undefined,
|
|
301
308
|
headers,
|
|
302
309
|
attachments: attachments && attachments.length > 0 ? attachments : undefined,
|
|
303
310
|
});
|
|
@@ -423,6 +430,7 @@ export class ResendAdapter implements MessagingAdapter {
|
|
|
423
430
|
html: markdownToEmailHtml(body),
|
|
424
431
|
cc: cc && cc.length > 0 ? cc : undefined,
|
|
425
432
|
bcc: bcc && bcc.length > 0 ? bcc : undefined,
|
|
433
|
+
reply_to: this.replyToAddress ? [this.replyToAddress] : undefined,
|
|
426
434
|
headers: Object.keys(headers).length > 0 ? headers : undefined,
|
|
427
435
|
});
|
|
428
436
|
|