@framers/agentos-ext-channel-email 0.1.2 → 0.2.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.
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @fileoverview The check that a message's subject, its bodies and the message id a reply names are text, which
3
+ * `EmailService.sendEmail` and `EmailService.replyToEmail` run before either transport sees them. nodemailer takes an
4
+ * object as a body and reads the file its `path` names, or fetches the address its `href` names, into the message,
5
+ * and it writes an object header value marked `prepared` into the message as it is, line breaks included. A model
6
+ * writes the tools' arguments and the channel's blocks as JSON, so such an object reaches the service whatever the
7
+ * TypeScript types say.
8
+ */
9
+ /**
10
+ * Returns `value` when it is a string, and otherwise throws a `TypeError` that names `field` and never the value.
11
+ *
12
+ * @param field The field's name as the caller wrote it, such as `body`.
13
+ * @param value The value the caller gave.
14
+ */
15
+ export declare function requireText(field: string, value: unknown): string;
16
+ /**
17
+ * Returns `value` when it is a string and `undefined` when it is `undefined` or `null`, which nodemailer leaves out as
18
+ * no part, and otherwise throws a `TypeError` that names `field` and never the value.
19
+ *
20
+ * @param field The field's name as the caller wrote it, such as `html`.
21
+ * @param value The value the caller gave.
22
+ */
23
+ export declare function optionalText(field: string, value: unknown): string | undefined;
24
+ //# sourceMappingURL=messageText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageText.d.ts","sourceRoot":"","sources":["../src/messageText.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAGjE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAI9E"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview The check that a message's subject, its bodies and the message id a reply names are text, which
4
+ * `EmailService.sendEmail` and `EmailService.replyToEmail` run before either transport sees them. nodemailer takes an
5
+ * object as a body and reads the file its `path` names, or fetches the address its `href` names, into the message,
6
+ * and it writes an object header value marked `prepared` into the message as it is, line breaks included. A model
7
+ * writes the tools' arguments and the channel's blocks as JSON, so such an object reaches the service whatever the
8
+ * TypeScript types say.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.requireText = requireText;
12
+ exports.optionalText = optionalText;
13
+ /**
14
+ * Returns `value` when it is a string, and otherwise throws a `TypeError` that names `field` and never the value.
15
+ *
16
+ * @param field The field's name as the caller wrote it, such as `body`.
17
+ * @param value The value the caller gave.
18
+ */
19
+ function requireText(field, value) {
20
+ if (typeof value === 'string')
21
+ return value;
22
+ throw new TypeError(`The ${field} was refused: give it as a string`);
23
+ }
24
+ /**
25
+ * Returns `value` when it is a string and `undefined` when it is `undefined` or `null`, which nodemailer leaves out as
26
+ * no part, and otherwise throws a `TypeError` that names `field` and never the value.
27
+ *
28
+ * @param field The field's name as the caller wrote it, such as `html`.
29
+ * @param value The value the caller gave.
30
+ */
31
+ function optionalText(field, value) {
32
+ if (value === undefined || value === null)
33
+ return undefined;
34
+ if (typeof value === 'string')
35
+ return value;
36
+ throw new TypeError(`The ${field} was refused: give it as a string or leave it out`);
37
+ }
38
+ //# sourceMappingURL=messageText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageText.js","sourceRoot":"","sources":["../src/messageText.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAQH,kCAGC;AASD,oCAIC;AAtBD;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,KAAa,EAAE,KAAc;IACvD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,IAAI,SAAS,CAAC,OAAO,KAAK,mCAAmC,CAAC,CAAC;AACvE,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,YAAY,CAAC,KAAa,EAAE,KAAc;IACxD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,IAAI,SAAS,CAAC,OAAO,KAAK,mDAAmD,CAAC,CAAC;AACvF,CAAC"}
@@ -27,6 +27,11 @@ export declare class EmailReplyTool {
27
27
  required: string[];
28
28
  };
29
29
  constructor(service: EmailService);
30
+ /**
31
+ * Sends the reply through `EmailService.replyToEmail`. A `messageId` or `body` that is not a string, or an `html`
32
+ * that is given and is not one, is refused before the original is read or anything is sent, with
33
+ * `{ success: false, error }` naming the field.
34
+ */
30
35
  execute(args: {
31
36
  messageId: string;
32
37
  body: string;
@@ -1 +1 @@
1
- {"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../src/tools/reply.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,cAAc;IAmBb,OAAO,CAAC,OAAO;IAlB3B,QAAQ,CAAC,EAAE,gBAAgB;IAC3B,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,oBAAoB;IACxC,QAAQ,CAAC,WAAW,gHAAgH;IACpI,QAAQ,CAAC,QAAQ,mBAAmB;IACpC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;MAQlB;gBAEkB,OAAO,EAAE,YAAY;IAEnC,OAAO,CAAC,IAAI,EAAE;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAQ9D"}
1
+ {"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../src/tools/reply.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,cAAc;IAmBb,OAAO,CAAC,OAAO;IAlB3B,QAAQ,CAAC,EAAE,gBAAgB;IAC3B,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,oBAAoB;IACxC,QAAQ,CAAC,WAAW,gHAAgH;IACpI,QAAQ,CAAC,QAAQ,mBAAmB;IACpC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;MAQlB;gBAEkB,OAAO,EAAE,YAAY;IAEzC;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAQ9D"}
@@ -21,6 +21,11 @@ class EmailReplyTool {
21
21
  required: ['messageId', 'body'],
22
22
  };
23
23
  }
24
+ /**
25
+ * Sends the reply through `EmailService.replyToEmail`. A `messageId` or `body` that is not a string, or an `html`
26
+ * that is given and is not one, is refused before the original is read or anything is sent, with
27
+ * `{ success: false, error }` naming the field.
28
+ */
24
29
  async execute(args) {
25
30
  try {
26
31
  const result = await this.service.replyToEmail(args.messageId, args.body, args.html);
@@ -1 +1 @@
1
- {"version":3,"file":"reply.js","sourceRoot":"","sources":["../../src/tools/reply.ts"],"names":[],"mappings":";;;AAGA,MAAa,cAAc;IAmBzB,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;QAlBhC,OAAE,G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QACpB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,gBAAW,GAAG,4GAA4G,CAAC;QAC3H,aAAQ,GAAG,eAAe,CAAC;QAC3B,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,IAAI,CAAC;QAEtB,gBAAW,GAAG;YACrB,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;gBACjF,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;gBAC9D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B,EAAE;aAClE;YACD,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC;SAChC,CAAC;IAE0C,CAAC;IAE7C;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,IAIb;QACC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACrF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACzC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAtCD,wCAsCC"}
@@ -4,7 +4,7 @@ export declare class EmailSendTool {
4
4
  readonly id = "emailSend";
5
5
  readonly name = "emailSend";
6
6
  readonly displayName = "Send Email";
7
- readonly description = "Send an email with text or HTML body and optional attachments via SMTP.";
7
+ readonly description = "Send an email with text or HTML body and optional attachments via SMTP or Resend's HTTPS API.";
8
8
  readonly category = "communication";
9
9
  readonly version = "0.1.0";
10
10
  readonly hasSideEffects = true;
@@ -39,6 +39,10 @@ export declare class EmailSendTool {
39
39
  type: string;
40
40
  description: string;
41
41
  };
42
+ content: {
43
+ type: string;
44
+ description: string;
45
+ };
42
46
  };
43
47
  };
44
48
  description: string;
@@ -47,6 +51,14 @@ export declare class EmailSendTool {
47
51
  required: string[];
48
52
  };
49
53
  constructor(service: EmailService);
54
+ /**
55
+ * Sends the email. An attachment passes only as `content`, a `data:` address or, through Resend, an `http(s)`
56
+ * address: any other is refused before anything is sent, with `{ success: false, error }` naming its filename, and
57
+ * what is sent is the copy `requireAgentAttachments` made of each attachment's own `filename`, `content`, `path`
58
+ * and `contentType`. A `subject` or `body` that is not a string, or an `html` that is given and is not one, is
59
+ * refused the same way, with an error naming the field, since `EmailService.sendEmail` checks them before either
60
+ * transport is used.
61
+ */
50
62
  execute(args: {
51
63
  to: string;
52
64
  subject: string;
@@ -1 +1 @@
1
- {"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/tools/send.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,aAAa;IA+BZ,OAAO,CAAC,OAAO;IA9B3B,QAAQ,CAAC,EAAE,eAAe;IAC1B,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,WAAW,gBAAgB;IACpC,QAAQ,CAAC,WAAW,6EAA6E;IACjG,QAAQ,CAAC,QAAQ,mBAAmB;IACpC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAoBlB;gBAEkB,OAAO,EAAE,YAAY;IAEnC,OAAO,CAAC,IAAI,EAAE;QAClB,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QAC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G,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAe9D"}
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EmailSendTool = void 0;
4
+ const agentAttachments_js_1 = require("../agentAttachments.js");
4
5
  class EmailSendTool {
5
6
  constructor(service) {
6
7
  this.service = service;
7
8
  this.id = 'emailSend';
8
9
  this.name = 'emailSend';
9
10
  this.displayName = 'Send Email';
10
- this.description = 'Send an email with text or HTML body and optional attachments via SMTP.';
11
+ this.description = "Send an email with text or HTML body and optional attachments via SMTP or Resend's HTTPS API.";
11
12
  this.category = 'communication';
12
13
  this.version = '0.1.0';
13
14
  this.hasSideEffects = true;
@@ -24,7 +25,8 @@ class EmailSendTool {
24
25
  type: 'object',
25
26
  properties: {
26
27
  filename: { type: 'string' },
27
- path: { type: 'string', description: 'File path or URL' },
28
+ path: { type: 'string', description: 'A data: address, or an http(s) address when sending through Resend; files on this machine are not read' },
29
+ content: { type: 'string', description: "The file's content as text; give a binary file in path as a Base64 data: address" },
28
30
  },
29
31
  },
30
32
  description: 'Optional file attachments',
@@ -33,14 +35,23 @@ class EmailSendTool {
33
35
  required: ['to', 'subject', 'body'],
34
36
  };
35
37
  }
38
+ /**
39
+ * Sends the email. An attachment passes only as `content`, a `data:` address or, through Resend, an `http(s)`
40
+ * address: any other is refused before anything is sent, with `{ success: false, error }` naming its filename, and
41
+ * what is sent is the copy `requireAgentAttachments` made of each attachment's own `filename`, `content`, `path`
42
+ * and `contentType`. A `subject` or `body` that is not a string, or an `html` that is given and is not one, is
43
+ * refused the same way, with an error naming the field, since `EmailService.sendEmail` checks them before either
44
+ * transport is used.
45
+ */
36
46
  async execute(args) {
37
47
  try {
48
+ const attachments = (0, agentAttachments_js_1.requireAgentAttachments)(args.attachments, this.service.transport === 'resend');
38
49
  const result = await this.service.sendEmail({
39
50
  to: args.to,
40
51
  subject: args.subject,
41
52
  body: args.body,
42
53
  html: args.html,
43
- attachments: args.attachments,
54
+ attachments,
44
55
  });
45
56
  return { success: true, data: result };
46
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/tools/send.ts"],"names":[],"mappings":";;;AAGA,MAAa,aAAa;IA+BxB,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;QA9BhC,OAAE,GAAG,WAAW,CAAC;QACjB,SAAI,GAAG,WAAW,CAAC;QACnB,gBAAW,GAAG,YAAY,CAAC;QAC3B,gBAAW,GAAG,yEAAyE,CAAC;QACxF,aAAQ,GAAG,eAAe,CAAC;QAC3B,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,IAAI,CAAC;QAEtB,gBAAW,GAAG;YACrB,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE;gBAC9D,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;gBAC9D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;gBAC9D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B,EAAE;gBACjE,WAAW,EAAE;oBACX,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BAC5B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE;yBAC1D;qBACF;oBACD,WAAW,EAAE,2BAA2B;iBACzC;aACF;YACD,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC;SACpC,CAAC;IAE0C,CAAC;IAE7C,KAAK,CAAC,OAAO,CAAC,IAMb;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://agentos.sh/schemas/extension-manifest-v1.json",
3
3
  "id": "com.framers.channels.email",
4
4
  "name": "Email Channel Extension",
5
- "version": "0.1.2",
6
- "description": "Bidirectional email integration — send, read, search, extract verification codes, and reply to email threads via SMTP and IMAP.",
5
+ "version": "0.2.1",
6
+ "description": "Bidirectional email integration: send through SMTP or Resend's HTTPS API, and read, search, extract verification codes and reply through IMAP.",
7
7
  "categories": ["channel", "communication"],
8
8
  "platforms": ["email"],
9
9
  "sdk": "nodemailer",
@@ -16,9 +16,9 @@
16
16
  { "kind": "messaging-channel", "id": "emailChannel", "displayName": "Email Channel Adapter" }
17
17
  ],
18
18
  "requiredSecrets": ["email.smtpHost", "email.smtpUser", "email.smtpPassword"],
19
- "optionalSecrets": ["email.imap.host", "email.imap.user", "email.imap.password"],
19
+ "optionalSecrets": ["email.imap.host", "email.imap.user", "email.imap.password", "email.resendApiKey"],
20
20
  "features": [
21
- "Send emails with text, HTML, and attachments via SMTP",
21
+ "Send emails with text, HTML, and attachments via SMTP or Resend's HTTPS API",
22
22
  "Read inbox and other IMAP folders",
23
23
  "Search emails by query, folder, and date range",
24
24
  "Extract verification codes and OTPs from email bodies",
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@framers/agentos-ext-channel-email",
3
- "version": "0.1.2",
4
- "description": "Email channel adapter for AgentOS — send, read, search, extract codes, and reply to emails via SMTP/IMAP.",
3
+ "version": "0.2.1",
4
+ "description": "Email channel adapter for AgentOS: send through SMTP or Resend's HTTPS API, and read, search, extract codes and reply through IMAP.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "license": "Apache-2.0",
7
8
  "files": [
8
9
  "dist",
9
10
  "manifest.json"
@@ -11,16 +12,20 @@
11
12
  "peerDependencies": {
12
13
  "@framers/agentos": ">=0.10.40"
13
14
  },
15
+ "peerDependenciesMeta": {
16
+ "@framers/agentos": {
17
+ "optional": true
18
+ }
19
+ },
14
20
  "dependencies": {
15
21
  "imapflow": "^1.0.0",
16
- "nodemailer": "^6.9.0"
22
+ "nodemailer": "^10.0.16"
17
23
  },
18
24
  "devDependencies": {
19
25
  "@types/node": "^20.0.0",
20
- "@types/nodemailer": "^6.4.0",
21
26
  "typescript": "^5.0.0",
22
27
  "vitest": "^3.2.7",
23
- "@framers/agentos": "^0.10.40"
28
+ "@framers/agentos": "^0.13.40"
24
29
  },
25
30
  "repository": {
26
31
  "type": "git",