@framers/agentos-ext-channel-email 0.1.0 → 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.
- package/LICENSE +96 -21
- package/dist/EmailChannelAdapter.d.ts +49 -0
- package/dist/EmailChannelAdapter.d.ts.map +1 -0
- package/dist/EmailChannelAdapter.js +88 -0
- package/dist/EmailChannelAdapter.js.map +1 -0
- package/dist/EmailService.d.ts +81 -0
- package/dist/EmailService.d.ts.map +1 -0
- package/dist/EmailService.js +392 -0
- package/dist/EmailService.js.map +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +128 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/extractCodes.d.ts +35 -0
- package/dist/tools/extractCodes.d.ts.map +1 -0
- package/dist/tools/extractCodes.js +34 -0
- package/dist/tools/extractCodes.js.map +1 -0
- package/dist/tools/read.d.ts +34 -0
- package/dist/tools/read.d.ts.map +1 -0
- package/dist/tools/read.js +33 -0
- package/dist/tools/read.js.map +1 -0
- package/dist/tools/reply.d.ts +40 -0
- package/dist/tools/reply.d.ts.map +1 -0
- package/dist/tools/reply.js +35 -0
- package/dist/tools/reply.js.map +1 -0
- package/dist/tools/search.d.ts +40 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +39 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/send.d.ts +66 -0
- package/dist/tools/send.d.ts.map +1 -0
- package/dist/tools/send.js +53 -0
- package/dist/tools/send.js.map +1 -0
- package/manifest.json +1 -1
- package/package.json +11 -7
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailExtractCodesTool = void 0;
|
|
4
|
+
class EmailExtractCodesTool {
|
|
5
|
+
constructor(service) {
|
|
6
|
+
this.service = service;
|
|
7
|
+
this.id = 'emailExtractCodes';
|
|
8
|
+
this.name = 'emailExtractCodes';
|
|
9
|
+
this.displayName = 'Extract Verification Codes';
|
|
10
|
+
this.description = 'Extract verification codes, OTPs, and PIN numbers from an email message body.';
|
|
11
|
+
this.category = 'communication';
|
|
12
|
+
this.version = '0.1.0';
|
|
13
|
+
this.hasSideEffects = false;
|
|
14
|
+
this.inputSchema = {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
messageId: { type: 'string', description: 'Message ID of the email to extract codes from' },
|
|
18
|
+
pattern: { type: 'string', description: 'Optional regex pattern to match codes (default: 4-8 digit numbers)' },
|
|
19
|
+
},
|
|
20
|
+
required: ['messageId'],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
async execute(args) {
|
|
24
|
+
try {
|
|
25
|
+
const result = await this.service.extractCodes(args.messageId, args.pattern);
|
|
26
|
+
return { success: true, data: result };
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return { success: false, error: err.message };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.EmailExtractCodesTool = EmailExtractCodesTool;
|
|
34
|
+
//# sourceMappingURL=extractCodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractCodes.js","sourceRoot":"","sources":["../../src/tools/extractCodes.ts"],"names":[],"mappings":";;;AAGA,MAAa,qBAAqB;IAkBhC,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;QAjBhC,OAAE,GAAG,mBAAmB,CAAC;QACzB,SAAI,GAAG,mBAAmB,CAAC;QAC3B,gBAAW,GAAG,4BAA4B,CAAC;QAC3C,gBAAW,GAAG,+EAA+E,CAAC;QAC9F,aAAQ,GAAG,eAAe,CAAC;QAC3B,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,KAAK,CAAC;QAEvB,gBAAW,GAAG;YACrB,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+CAA+C,EAAE;gBAC3F,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oEAAoE,EAAE;aAC/G;YACD,QAAQ,EAAE,CAAC,WAAW,CAAC;SACxB,CAAC;IAE0C,CAAC;IAE7C,KAAK,CAAC,OAAO,CAAC,IAGb;QACC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAC7E,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;AA/BD,sDA+BC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { EmailService } from '../EmailService.js';
|
|
2
|
+
export declare class EmailReadTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "emailRead";
|
|
5
|
+
readonly name = "emailRead";
|
|
6
|
+
readonly displayName = "Read Inbox";
|
|
7
|
+
readonly description = "Read emails from inbox or other IMAP folder. Returns most recent messages first.";
|
|
8
|
+
readonly category = "communication";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = false;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
folder: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
limit: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
constructor(service: EmailService);
|
|
25
|
+
execute(args: {
|
|
26
|
+
folder?: string;
|
|
27
|
+
limit?: number;
|
|
28
|
+
}): Promise<{
|
|
29
|
+
success: boolean;
|
|
30
|
+
data?: any;
|
|
31
|
+
error?: string;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/tools/read.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,aAAa;IAiBZ,OAAO,CAAC,OAAO;IAhB3B,QAAQ,CAAC,EAAE,eAAe;IAC1B,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,WAAW,gBAAgB;IACpC,QAAQ,CAAC,WAAW,sFAAsF;IAC1G,QAAQ,CAAC,QAAQ,mBAAmB;IACpC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,SAAS;IAEhC,QAAQ,CAAC,WAAW;;;;;;;;;;;;MAMlB;gBAEkB,OAAO,EAAE,YAAY;IAEnC,OAAO,CAAC,IAAI,EAAE;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAQ9D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailReadTool = void 0;
|
|
4
|
+
class EmailReadTool {
|
|
5
|
+
constructor(service) {
|
|
6
|
+
this.service = service;
|
|
7
|
+
this.id = 'emailRead';
|
|
8
|
+
this.name = 'emailRead';
|
|
9
|
+
this.displayName = 'Read Inbox';
|
|
10
|
+
this.description = 'Read emails from inbox or other IMAP folder. Returns most recent messages first.';
|
|
11
|
+
this.category = 'communication';
|
|
12
|
+
this.version = '0.1.0';
|
|
13
|
+
this.hasSideEffects = false;
|
|
14
|
+
this.inputSchema = {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
folder: { type: 'string', description: 'IMAP folder to read (default: INBOX)' },
|
|
18
|
+
limit: { type: 'number', description: 'Maximum number of messages to return (default: 20)' },
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
async execute(args) {
|
|
23
|
+
try {
|
|
24
|
+
const messages = await this.service.readInbox(args.folder ?? 'INBOX', args.limit ?? 20);
|
|
25
|
+
return { success: true, data: { messages, count: messages.length } };
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
return { success: false, error: err.message };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.EmailReadTool = EmailReadTool;
|
|
33
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/tools/read.ts"],"names":[],"mappings":";;;AAGA,MAAa,aAAa;IAiBxB,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;QAhBhC,OAAE,GAAG,WAAW,CAAC;QACjB,SAAI,GAAG,WAAW,CAAC;QACnB,gBAAW,GAAG,YAAY,CAAC;QAC3B,gBAAW,GAAG,kFAAkF,CAAC;QACjG,aAAQ,GAAG,eAAe,CAAC;QAC3B,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,KAAK,CAAC;QAEvB,gBAAW,GAAG;YACrB,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE;gBAC/E,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oDAAoD,EAAE;aAC7F;SACF,CAAC;IAE0C,CAAC;IAE7C,KAAK,CAAC,OAAO,CAAC,IAGb;QACC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;YACxF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;QACvE,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;AA9BD,sCA8BC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { EmailService } from '../EmailService.js';
|
|
2
|
+
export declare class EmailReplyTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "emailReply";
|
|
5
|
+
readonly name = "emailReply";
|
|
6
|
+
readonly displayName = "Reply to Email";
|
|
7
|
+
readonly description = "Reply to an email thread, maintaining conversation context with proper In-Reply-To and References headers.";
|
|
8
|
+
readonly category = "communication";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = true;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
messageId: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
body: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
html: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
required: string[];
|
|
28
|
+
};
|
|
29
|
+
constructor(service: EmailService);
|
|
30
|
+
execute(args: {
|
|
31
|
+
messageId: string;
|
|
32
|
+
body: string;
|
|
33
|
+
html?: string;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
success: boolean;
|
|
36
|
+
data?: any;
|
|
37
|
+
error?: string;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=reply.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailReplyTool = void 0;
|
|
4
|
+
class EmailReplyTool {
|
|
5
|
+
constructor(service) {
|
|
6
|
+
this.service = service;
|
|
7
|
+
this.id = 'emailReply';
|
|
8
|
+
this.name = 'emailReply';
|
|
9
|
+
this.displayName = 'Reply to Email';
|
|
10
|
+
this.description = 'Reply to an email thread, maintaining conversation context with proper In-Reply-To and References headers.';
|
|
11
|
+
this.category = 'communication';
|
|
12
|
+
this.version = '0.1.0';
|
|
13
|
+
this.hasSideEffects = true;
|
|
14
|
+
this.inputSchema = {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
messageId: { type: 'string', description: 'Message ID of the email to reply to' },
|
|
18
|
+
body: { type: 'string', description: 'Plain text reply body' },
|
|
19
|
+
html: { type: 'string', description: 'Optional HTML reply body' },
|
|
20
|
+
},
|
|
21
|
+
required: ['messageId', 'body'],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
async execute(args) {
|
|
25
|
+
try {
|
|
26
|
+
const result = await this.service.replyToEmail(args.messageId, args.body, args.html);
|
|
27
|
+
return { success: true, data: result };
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
return { success: false, error: err.message };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.EmailReplyTool = EmailReplyTool;
|
|
35
|
+
//# sourceMappingURL=reply.js.map
|
|
@@ -0,0 +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,GAAG,YAAY,CAAC;QAClB,SAAI,GAAG,YAAY,CAAC;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,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;AAjCD,wCAiCC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { EmailService } from '../EmailService.js';
|
|
2
|
+
export declare class EmailSearchTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "emailSearch";
|
|
5
|
+
readonly name = "emailSearch";
|
|
6
|
+
readonly displayName = "Search Emails";
|
|
7
|
+
readonly description = "Search emails by query string across subject, body, and sender fields.";
|
|
8
|
+
readonly category = "communication";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = false;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
query: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
folder: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
since: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
required: string[];
|
|
28
|
+
};
|
|
29
|
+
constructor(service: EmailService);
|
|
30
|
+
execute(args: {
|
|
31
|
+
query: string;
|
|
32
|
+
folder?: string;
|
|
33
|
+
since?: string;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
success: boolean;
|
|
36
|
+
data?: any;
|
|
37
|
+
error?: string;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,eAAe;IAmBd,OAAO,CAAC,OAAO;IAlB3B,QAAQ,CAAC,EAAE,iBAAiB;IAC5B,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,mBAAmB;IACvC,QAAQ,CAAC,WAAW,4EAA4E;IAChG,QAAQ,CAAC,QAAQ,mBAAmB;IACpC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,SAAS;IAEhC,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;MAQlB;gBAEkB,OAAO,EAAE,YAAY;IAEnC,OAAO,CAAC,IAAI,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAY9D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailSearchTool = void 0;
|
|
4
|
+
class EmailSearchTool {
|
|
5
|
+
constructor(service) {
|
|
6
|
+
this.service = service;
|
|
7
|
+
this.id = 'emailSearch';
|
|
8
|
+
this.name = 'emailSearch';
|
|
9
|
+
this.displayName = 'Search Emails';
|
|
10
|
+
this.description = 'Search emails by query string across subject, body, and sender fields.';
|
|
11
|
+
this.category = 'communication';
|
|
12
|
+
this.version = '0.1.0';
|
|
13
|
+
this.hasSideEffects = false;
|
|
14
|
+
this.inputSchema = {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
query: { type: 'string', description: 'Search query (matches subject, body, and sender)' },
|
|
18
|
+
folder: { type: 'string', description: 'IMAP folder to search (default: INBOX)' },
|
|
19
|
+
since: { type: 'string', description: 'Only return emails since this date (ISO 8601)' },
|
|
20
|
+
},
|
|
21
|
+
required: ['query'],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
async execute(args) {
|
|
25
|
+
try {
|
|
26
|
+
const messages = await this.service.searchEmails({
|
|
27
|
+
query: args.query,
|
|
28
|
+
folder: args.folder,
|
|
29
|
+
since: args.since,
|
|
30
|
+
});
|
|
31
|
+
return { success: true, data: { messages, count: messages.length } };
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
return { success: false, error: err.message };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.EmailSearchTool = EmailSearchTool;
|
|
39
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":";;;AAGA,MAAa,eAAe;IAmB1B,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;QAlBhC,OAAE,GAAG,aAAa,CAAC;QACnB,SAAI,GAAG,aAAa,CAAC;QACrB,gBAAW,GAAG,eAAe,CAAC;QAC9B,gBAAW,GAAG,wEAAwE,CAAC;QACvF,aAAQ,GAAG,eAAe,CAAC;QAC3B,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,KAAK,CAAC;QAEvB,gBAAW,GAAG;YACrB,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kDAAkD,EAAE;gBAC1F,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;gBACjF,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+CAA+C,EAAE;aACxF;YACD,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB,CAAC;IAE0C,CAAC;IAE7C,KAAK,CAAC,OAAO,CAAC,IAIb;QACC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;gBAC/C,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAC,CAAC;YACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;QACvE,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;AArCD,0CAqCC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { EmailService } from '../EmailService.js';
|
|
2
|
+
export declare class EmailSendTool {
|
|
3
|
+
private service;
|
|
4
|
+
readonly id = "emailSend";
|
|
5
|
+
readonly name = "emailSend";
|
|
6
|
+
readonly displayName = "Send Email";
|
|
7
|
+
readonly description = "Send an email with text or HTML body and optional attachments via SMTP.";
|
|
8
|
+
readonly category = "communication";
|
|
9
|
+
readonly version = "0.1.0";
|
|
10
|
+
readonly hasSideEffects = true;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
to: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
subject: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
body: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
html: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
attachments: {
|
|
31
|
+
type: string;
|
|
32
|
+
items: {
|
|
33
|
+
type: string;
|
|
34
|
+
properties: {
|
|
35
|
+
filename: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
path: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
required: string[];
|
|
48
|
+
};
|
|
49
|
+
constructor(service: EmailService);
|
|
50
|
+
execute(args: {
|
|
51
|
+
to: string;
|
|
52
|
+
subject: string;
|
|
53
|
+
body: string;
|
|
54
|
+
html?: string;
|
|
55
|
+
attachments?: Array<{
|
|
56
|
+
filename: string;
|
|
57
|
+
path?: string;
|
|
58
|
+
content?: string;
|
|
59
|
+
}>;
|
|
60
|
+
}): Promise<{
|
|
61
|
+
success: boolean;
|
|
62
|
+
data?: any;
|
|
63
|
+
error?: string;
|
|
64
|
+
}>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=send.d.ts.map
|
|
@@ -0,0 +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;QACd,WAAW,CAAC,EAAE,KAAK,CAAC;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC5E,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAc9D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailSendTool = void 0;
|
|
4
|
+
class EmailSendTool {
|
|
5
|
+
constructor(service) {
|
|
6
|
+
this.service = service;
|
|
7
|
+
this.id = 'emailSend';
|
|
8
|
+
this.name = 'emailSend';
|
|
9
|
+
this.displayName = 'Send Email';
|
|
10
|
+
this.description = 'Send an email with text or HTML body and optional attachments via SMTP.';
|
|
11
|
+
this.category = 'communication';
|
|
12
|
+
this.version = '0.1.0';
|
|
13
|
+
this.hasSideEffects = true;
|
|
14
|
+
this.inputSchema = {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
to: { type: 'string', description: 'Recipient email address' },
|
|
18
|
+
subject: { type: 'string', description: 'Email subject line' },
|
|
19
|
+
body: { type: 'string', description: 'Plain text email body' },
|
|
20
|
+
html: { type: 'string', description: 'Optional HTML email body' },
|
|
21
|
+
attachments: {
|
|
22
|
+
type: 'array',
|
|
23
|
+
items: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
properties: {
|
|
26
|
+
filename: { type: 'string' },
|
|
27
|
+
path: { type: 'string', description: 'File path or URL' },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
description: 'Optional file attachments',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
required: ['to', 'subject', 'body'],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
async execute(args) {
|
|
37
|
+
try {
|
|
38
|
+
const result = await this.service.sendEmail({
|
|
39
|
+
to: args.to,
|
|
40
|
+
subject: args.subject,
|
|
41
|
+
body: args.body,
|
|
42
|
+
html: args.html,
|
|
43
|
+
attachments: args.attachments,
|
|
44
|
+
});
|
|
45
|
+
return { success: true, data: result };
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
return { success: false, error: err.message };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.EmailSendTool = EmailSendTool;
|
|
53
|
+
//# sourceMappingURL=send.js.map
|
|
@@ -0,0 +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;QACC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;gBAC1C,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,IAAI,CAAC,WAAW;aAC9B,CAAC,CAAC;YACH,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;AArDD,sCAqDC"}
|
package/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
|
|
3
3
|
"id": "com.framers.channels.email",
|
|
4
4
|
"name": "Email Channel Extension",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.1",
|
|
6
6
|
"description": "Bidirectional email integration — send, read, search, extract verification codes, and reply to email threads via SMTP and IMAP.",
|
|
7
7
|
"categories": ["channel", "communication"],
|
|
8
8
|
"platforms": ["email"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@framers/agentos-ext-channel-email",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Email channel adapter for AgentOS — send, read, search, extract codes, and reply to emails via SMTP/IMAP.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,28 +9,32 @@
|
|
|
9
9
|
"manifest.json"
|
|
10
10
|
],
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@framers/agentos": "^0.
|
|
12
|
+
"@framers/agentos": "^0.10.28"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"imapflow": "^1.0.0",
|
|
16
|
+
"nodemailer": "^6.9.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "^20.0.0",
|
|
20
20
|
"@types/nodemailer": "^6.4.0",
|
|
21
21
|
"typescript": "^5.0.0",
|
|
22
22
|
"vitest": "^1.0.0",
|
|
23
|
-
"@framers/agentos": "0.
|
|
23
|
+
"@framers/agentos": "^0.10.28"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
|
-
"url": "https://github.com/
|
|
27
|
+
"url": "git+https://github.com/framerslab/agentos-extensions.git",
|
|
28
28
|
"directory": "registry/curated/channels/email"
|
|
29
29
|
},
|
|
30
|
+
"homepage": "https://github.com/framerslab/agentos-extensions/tree/master/registry/curated/channels/email#readme",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/framerslab/agentos-extensions/issues"
|
|
33
|
+
},
|
|
30
34
|
"scripts": {
|
|
31
35
|
"build": "tsc",
|
|
32
36
|
"dev": "tsc --watch",
|
|
33
|
-
"test": "vitest run",
|
|
37
|
+
"test": "vitest run --passWithNoTests",
|
|
34
38
|
"test:watch": "vitest watch",
|
|
35
39
|
"clean": "rm -rf dist"
|
|
36
40
|
}
|