@framers/agentos-ext-email-gmail 0.1.0 → 0.1.2

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,58 @@
1
+ /**
2
+ * @fileoverview ITool for listing Gmail labels (folders).
3
+ */
4
+ import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
5
+ import type { GmailService } from '../GmailService';
6
+ export declare class GmailListLabelsTool implements ITool {
7
+ private readonly service;
8
+ readonly id = "gmailListLabels";
9
+ readonly name = "gmailListLabels";
10
+ readonly displayName = "List Gmail Labels";
11
+ readonly description: string;
12
+ readonly category = "productivity";
13
+ readonly version = "0.1.0";
14
+ readonly hasSideEffects = false;
15
+ readonly inputSchema: {
16
+ type: "object";
17
+ properties: {};
18
+ };
19
+ readonly outputSchema: {
20
+ type: "object";
21
+ properties: {
22
+ labels: {
23
+ type: string;
24
+ items: {
25
+ type: string;
26
+ properties: {
27
+ id: {
28
+ type: string;
29
+ };
30
+ name: {
31
+ type: string;
32
+ };
33
+ type: {
34
+ type: string;
35
+ description: string;
36
+ };
37
+ messagesTotal: {
38
+ type: string;
39
+ };
40
+ messagesUnread: {
41
+ type: string;
42
+ };
43
+ };
44
+ };
45
+ };
46
+ labelCount: {
47
+ type: string;
48
+ };
49
+ };
50
+ };
51
+ constructor(service: GmailService);
52
+ execute(_args: Record<string, never>, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
53
+ validateArgs(_args: Record<string, any>): {
54
+ isValid: boolean;
55
+ errors?: string[];
56
+ };
57
+ }
58
+ //# sourceMappingURL=listLabels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listLabels.d.ts","sourceRoot":"","sources":["../../src/tools/listLabels.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,qBAAa,mBAAoB,YAAW,KAAK;IAoCnC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAnCpC,SAAgB,EAAE,qBAAqB;IACvC,SAAgB,IAAI,qBAAqB;IACzC,SAAgB,WAAW,uBAAuB;IAClD,SAAgB,WAAW,SAEsD;IACjF,SAAgB,QAAQ,kBAAkB;IAC1C,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,SAAS;IAEvC,SAAgB,WAAW;;;MAGzB;IAEF,SAAgB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkB1B;gBAE2B,OAAO,EAAE,YAAY;IAE5C,OAAO,CACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAC5B,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAa/B,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;CAIlF"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ /**
4
+ * @fileoverview ITool for listing Gmail labels (folders).
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.GmailListLabelsTool = void 0;
8
+ class GmailListLabelsTool {
9
+ constructor(service) {
10
+ this.service = service;
11
+ this.id = 'gmailListLabels';
12
+ this.name = 'gmailListLabels';
13
+ this.displayName = 'List Gmail Labels';
14
+ this.description = 'List all email labels (folders) in the Gmail account. ' +
15
+ 'Returns label names, types (system/user), and message counts for each label.';
16
+ this.category = 'productivity';
17
+ this.version = '0.1.0';
18
+ this.hasSideEffects = false;
19
+ this.inputSchema = {
20
+ type: 'object',
21
+ properties: {},
22
+ };
23
+ this.outputSchema = {
24
+ type: 'object',
25
+ properties: {
26
+ labels: {
27
+ type: 'array',
28
+ items: {
29
+ type: 'object',
30
+ properties: {
31
+ id: { type: 'string' },
32
+ name: { type: 'string' },
33
+ type: { type: 'string', description: 'Label type: "system" or "user"' },
34
+ messagesTotal: { type: 'number' },
35
+ messagesUnread: { type: 'number' },
36
+ },
37
+ },
38
+ },
39
+ labelCount: { type: 'number' },
40
+ },
41
+ };
42
+ }
43
+ async execute(_args, _context) {
44
+ try {
45
+ const labels = await this.service.listLabels();
46
+ return {
47
+ success: true,
48
+ output: { labels, labelCount: labels.length },
49
+ };
50
+ }
51
+ catch (error) {
52
+ return { success: false, error: error.message };
53
+ }
54
+ }
55
+ validateArgs(_args) {
56
+ // No required arguments
57
+ return { isValid: true };
58
+ }
59
+ }
60
+ exports.GmailListLabelsTool = GmailListLabelsTool;
61
+ //# sourceMappingURL=listLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listLabels.js","sourceRoot":"","sources":["../../src/tools/listLabels.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAKH,MAAa,mBAAmB;IAoC9B,YAA6B,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;QAnClC,OAAE,GAAG,iBAAiB,CAAC;QACvB,SAAI,GAAG,iBAAiB,CAAC;QACzB,gBAAW,GAAG,mBAAmB,CAAC;QAClC,gBAAW,GACzB,wDAAwD;YACxD,8EAA8E,CAAC;QACjE,aAAQ,GAAG,cAAc,CAAC;QAC1B,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,KAAK,CAAC;QAEvB,gBAAW,GAAG;YAC5B,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE,EAAE;SACf,CAAC;QAEc,iBAAY,GAAG;YAC7B,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BACxB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;4BACvE,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BACjC,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;yBACnC;qBACF;iBACF;gBACD,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aAC/B;SACF,CAAC;IAEmD,CAAC;IAEtD,KAAK,CAAC,OAAO,CACX,KAA4B,EAC5B,QAA8B;QAE9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YAE/C,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;aAC9C,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;IAED,YAAY,CAAC,KAA0B;QACrC,wBAAwB;QACxB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF;AA1DD,kDA0DC"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * @fileoverview ITool for listing Gmail messages with optional filtering.
3
+ */
4
+ import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
5
+ import type { GmailService } from '../GmailService';
6
+ interface ListMessagesArgs {
7
+ query?: string;
8
+ labelIds?: string[];
9
+ maxResults?: number;
10
+ }
11
+ export declare class GmailListMessagesTool implements ITool<ListMessagesArgs> {
12
+ private readonly service;
13
+ readonly id = "gmailListMessages";
14
+ readonly name = "gmailListMessages";
15
+ readonly displayName = "List Gmail Messages";
16
+ readonly description: string;
17
+ readonly category = "productivity";
18
+ readonly version = "0.1.0";
19
+ readonly hasSideEffects = false;
20
+ readonly inputSchema: {
21
+ type: "object";
22
+ properties: {
23
+ query: {
24
+ type: string;
25
+ description: string;
26
+ };
27
+ labelIds: {
28
+ type: string;
29
+ items: {
30
+ type: string;
31
+ };
32
+ description: string;
33
+ };
34
+ maxResults: {
35
+ type: string;
36
+ description: string;
37
+ default: number;
38
+ };
39
+ };
40
+ };
41
+ readonly outputSchema: {
42
+ type: "object";
43
+ properties: {
44
+ messages: {
45
+ type: string;
46
+ items: {
47
+ type: string;
48
+ properties: {
49
+ id: {
50
+ type: string;
51
+ };
52
+ threadId: {
53
+ type: string;
54
+ };
55
+ subject: {
56
+ type: string;
57
+ };
58
+ from: {
59
+ type: string;
60
+ };
61
+ date: {
62
+ type: string;
63
+ };
64
+ snippet: {
65
+ type: string;
66
+ };
67
+ isUnread: {
68
+ type: string;
69
+ };
70
+ labelIds: {
71
+ type: string;
72
+ items: {
73
+ type: string;
74
+ };
75
+ };
76
+ };
77
+ };
78
+ };
79
+ resultCount: {
80
+ type: string;
81
+ };
82
+ };
83
+ };
84
+ constructor(service: GmailService);
85
+ execute(args: ListMessagesArgs, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
86
+ validateArgs(args: Record<string, any>): {
87
+ isValid: boolean;
88
+ errors?: string[];
89
+ };
90
+ }
91
+ export {};
92
+ //# sourceMappingURL=listMessages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listMessages.d.ts","sourceRoot":"","sources":["../../src/tools/listMessages.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,qBAAsB,YAAW,KAAK,CAAC,gBAAgB,CAAC;IAwDvD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAvDpC,SAAgB,EAAE,uBAAuB;IACzC,SAAgB,IAAI,uBAAuB;IAC3C,SAAgB,WAAW,yBAAyB;IACpD,SAAgB,WAAW,SAEyD;IACpF,SAAgB,QAAQ,kBAAkB;IAC1C,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,SAAS;IAEvC,SAAgB,WAAW;;;;;;;;;;;;;;;;;;;;MAoBzB;IAEF,SAAgB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqB1B;gBAE2B,OAAO,EAAE,YAAY;IAE5C,OAAO,CACX,IAAI,EAAE,gBAAgB,EACtB,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAgC/B,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;CAkBjF"}
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ /**
4
+ * @fileoverview ITool for listing Gmail messages with optional filtering.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.GmailListMessagesTool = void 0;
8
+ class GmailListMessagesTool {
9
+ constructor(service) {
10
+ this.service = service;
11
+ this.id = 'gmailListMessages';
12
+ this.name = 'gmailListMessages';
13
+ this.displayName = 'List Gmail Messages';
14
+ this.description = 'List emails from Gmail inbox with optional filtering by query string, label IDs, and result limit. ' +
15
+ 'Returns message summaries including subject, sender, date, snippet, and labels.';
16
+ this.category = 'productivity';
17
+ this.version = '0.1.0';
18
+ this.hasSideEffects = false;
19
+ this.inputSchema = {
20
+ type: 'object',
21
+ properties: {
22
+ query: {
23
+ type: 'string',
24
+ description: 'Gmail search query (e.g. "is:unread", "from:alice@example.com", "subject:invoice"). ' +
25
+ 'Uses standard Gmail search syntax.',
26
+ },
27
+ labelIds: {
28
+ type: 'array',
29
+ items: { type: 'string' },
30
+ description: 'Filter by label IDs (e.g. ["INBOX", "UNREAD"])',
31
+ },
32
+ maxResults: {
33
+ type: 'number',
34
+ description: 'Maximum number of messages to return (default: 10, max: 100)',
35
+ default: 10,
36
+ },
37
+ },
38
+ };
39
+ this.outputSchema = {
40
+ type: 'object',
41
+ properties: {
42
+ messages: {
43
+ type: 'array',
44
+ items: {
45
+ type: 'object',
46
+ properties: {
47
+ id: { type: 'string' },
48
+ threadId: { type: 'string' },
49
+ subject: { type: 'string' },
50
+ from: { type: 'string' },
51
+ date: { type: 'string' },
52
+ snippet: { type: 'string' },
53
+ isUnread: { type: 'boolean' },
54
+ labelIds: { type: 'array', items: { type: 'string' } },
55
+ },
56
+ },
57
+ },
58
+ resultCount: { type: 'number' },
59
+ },
60
+ };
61
+ }
62
+ async execute(args, _context) {
63
+ try {
64
+ const maxResults = Math.min(Math.max(args.maxResults ?? 10, 1), 100);
65
+ const messages = await this.service.listMessages({
66
+ query: args.query,
67
+ labelIds: args.labelIds,
68
+ maxResults,
69
+ });
70
+ // Return summaries (omit full body for list view)
71
+ const summaries = messages.map((msg) => ({
72
+ id: msg.id,
73
+ threadId: msg.threadId,
74
+ subject: msg.subject,
75
+ from: msg.from,
76
+ to: msg.to,
77
+ date: msg.date,
78
+ snippet: msg.snippet,
79
+ isUnread: msg.isUnread,
80
+ labelIds: msg.labelIds,
81
+ }));
82
+ return {
83
+ success: true,
84
+ output: { messages: summaries, resultCount: summaries.length },
85
+ };
86
+ }
87
+ catch (error) {
88
+ return { success: false, error: error.message };
89
+ }
90
+ }
91
+ validateArgs(args) {
92
+ const errors = [];
93
+ if (args.query !== undefined && typeof args.query !== 'string') {
94
+ errors.push('query must be a string');
95
+ }
96
+ if (args.labelIds !== undefined && !Array.isArray(args.labelIds)) {
97
+ errors.push('labelIds must be an array of strings');
98
+ }
99
+ if (args.maxResults !== undefined) {
100
+ if (typeof args.maxResults !== 'number' || args.maxResults < 1) {
101
+ errors.push('maxResults must be a positive number');
102
+ }
103
+ if (args.maxResults > 100) {
104
+ errors.push('maxResults cannot exceed 100');
105
+ }
106
+ }
107
+ return { isValid: errors.length === 0, errors };
108
+ }
109
+ }
110
+ exports.GmailListMessagesTool = GmailListMessagesTool;
111
+ //# sourceMappingURL=listMessages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listMessages.js","sourceRoot":"","sources":["../../src/tools/listMessages.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAWH,MAAa,qBAAqB;IAwDhC,YAA6B,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;QAvDlC,OAAE,GAAG,mBAAmB,CAAC;QACzB,SAAI,GAAG,mBAAmB,CAAC;QAC3B,gBAAW,GAAG,qBAAqB,CAAC;QACpC,gBAAW,GACzB,qGAAqG;YACrG,iFAAiF,CAAC;QACpE,aAAQ,GAAG,cAAc,CAAC;QAC1B,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,KAAK,CAAC;QAEvB,gBAAW,GAAG;YAC5B,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,sFAAsF;wBACtF,oCAAoC;iBACvC;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,gDAAgD;iBAC9D;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,8DAA8D;oBAC3E,OAAO,EAAE,EAAE;iBACZ;aACF;SACF,CAAC;QAEc,iBAAY,GAAG;YAC7B,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,QAAQ,EAAE;o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C,IAAI,CAAC,8BAA8B,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAClD,CAAC;CACF;AA/GD,sDA+GC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @fileoverview ITool for reading a full Gmail message by ID.
3
+ */
4
+ import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
5
+ import type { GmailService } from '../GmailService';
6
+ interface ReadMessageArgs {
7
+ messageId: string;
8
+ }
9
+ export declare class GmailReadMessageTool implements ITool<ReadMessageArgs> {
10
+ private readonly service;
11
+ readonly id = "gmailReadMessage";
12
+ readonly name = "gmailReadMessage";
13
+ readonly displayName = "Read Gmail Message";
14
+ readonly description: string;
15
+ readonly category = "productivity";
16
+ readonly version = "0.1.0";
17
+ readonly hasSideEffects = false;
18
+ readonly inputSchema: {
19
+ type: "object";
20
+ required: readonly ["messageId"];
21
+ properties: {
22
+ messageId: {
23
+ type: string;
24
+ description: string;
25
+ };
26
+ };
27
+ };
28
+ readonly outputSchema: {
29
+ type: "object";
30
+ properties: {
31
+ id: {
32
+ type: string;
33
+ };
34
+ threadId: {
35
+ type: string;
36
+ };
37
+ subject: {
38
+ type: string;
39
+ };
40
+ from: {
41
+ type: string;
42
+ };
43
+ to: {
44
+ type: string;
45
+ items: {
46
+ type: string;
47
+ };
48
+ };
49
+ cc: {
50
+ type: string;
51
+ items: {
52
+ type: string;
53
+ };
54
+ };
55
+ date: {
56
+ type: string;
57
+ };
58
+ body: {
59
+ type: string;
60
+ };
61
+ snippet: {
62
+ type: string;
63
+ };
64
+ labelIds: {
65
+ type: string;
66
+ items: {
67
+ type: string;
68
+ };
69
+ };
70
+ isUnread: {
71
+ type: string;
72
+ };
73
+ };
74
+ };
75
+ constructor(service: GmailService);
76
+ execute(args: ReadMessageArgs, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
77
+ validateArgs(args: Record<string, any>): {
78
+ isValid: boolean;
79
+ errors?: string[];
80
+ };
81
+ }
82
+ export {};
83
+ //# sourceMappingURL=readMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readMessage.d.ts","sourceRoot":"","sources":["../../src/tools/readMessage.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,UAAU,eAAe;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,oBAAqB,YAAW,KAAK,CAAC,eAAe,CAAC;IAuCrD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAtCpC,SAAgB,EAAE,sBAAsB;IACxC,SAAgB,IAAI,sBAAsB;IAC1C,SAAgB,WAAW,wBAAwB;IACnD,SAAgB,WAAW,SAE8E;IACzG,SAAgB,QAAQ,kBAAkB;IAC1C,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,SAAS;IAEvC,SAAgB,WAAW;;;;;;;;;MASzB;IAEF,SAAgB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAe1B;gBAE2B,OAAO,EAAE,YAAY;IAE5C,OAAO,CACX,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAa/B,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;CAMjF"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ /**
4
+ * @fileoverview ITool for reading a full Gmail message by ID.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.GmailReadMessageTool = void 0;
8
+ class GmailReadMessageTool {
9
+ constructor(service) {
10
+ this.service = service;
11
+ this.id = 'gmailReadMessage';
12
+ this.name = 'gmailReadMessage';
13
+ this.displayName = 'Read Gmail Message';
14
+ this.description = 'Read the full content of a Gmail email by its message ID. ' +
15
+ 'Returns complete message details including subject, sender, recipients, date, body text, and labels.';
16
+ this.category = 'productivity';
17
+ this.version = '0.1.0';
18
+ this.hasSideEffects = false;
19
+ this.inputSchema = {
20
+ type: 'object',
21
+ required: ['messageId'],
22
+ properties: {
23
+ messageId: {
24
+ type: 'string',
25
+ description: 'The Gmail message ID to read',
26
+ },
27
+ },
28
+ };
29
+ this.outputSchema = {
30
+ type: 'object',
31
+ properties: {
32
+ id: { type: 'string' },
33
+ threadId: { type: 'string' },
34
+ subject: { type: 'string' },
35
+ from: { type: 'string' },
36
+ to: { type: 'array', items: { type: 'string' } },
37
+ cc: { type: 'array', items: { type: 'string' } },
38
+ date: { type: 'string' },
39
+ body: { type: 'string' },
40
+ snippet: { type: 'string' },
41
+ labelIds: { type: 'array', items: { type: 'string' } },
42
+ isUnread: { type: 'boolean' },
43
+ },
44
+ };
45
+ }
46
+ async execute(args, _context) {
47
+ try {
48
+ const message = await this.service.getMessage(args.messageId);
49
+ return {
50
+ success: true,
51
+ output: message,
52
+ };
53
+ }
54
+ catch (error) {
55
+ return { success: false, error: error.message };
56
+ }
57
+ }
58
+ validateArgs(args) {
59
+ const errors = [];
60
+ if (!args.messageId)
61
+ errors.push('messageId is required');
62
+ else if (typeof args.messageId !== 'string')
63
+ errors.push('messageId must be a string');
64
+ return { isValid: errors.length === 0, errors };
65
+ }
66
+ }
67
+ exports.GmailReadMessageTool = GmailReadMessageTool;
68
+ //# sourceMappingURL=readMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readMessage.js","sourceRoot":"","sources":["../../src/tools/readMessage.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AASH,MAAa,oBAAoB;IAuC/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IAAI,EAAE,SAAS,EAAE;aAC9B;SACF,CAAC;IAEmD,CAAC;IAEtD,KAAK,CAAC,OAAO,CACX,IAAqB,EACrB,QAA8B;QAE9B,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAE9D,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,OAAO;aAChB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;IAED,YAAY,CAAC,IAAyB;QACpC,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;aACrD,IAAI,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ;YAAE,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QACvF,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAClD,CAAC;CACF;AA/DD,oDA+DC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @fileoverview ITool for replying to an existing Gmail message thread.
3
+ */
4
+ import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
5
+ import type { GmailService } from '../GmailService';
6
+ interface ReplyMessageArgs {
7
+ messageId: string;
8
+ body: string;
9
+ }
10
+ export declare class GmailReplyMessageTool implements ITool<ReplyMessageArgs> {
11
+ private readonly service;
12
+ readonly id = "gmailReplyMessage";
13
+ readonly name = "gmailReplyMessage";
14
+ readonly displayName = "Reply to Gmail Message";
15
+ readonly description: string;
16
+ readonly category = "productivity";
17
+ readonly version = "0.1.0";
18
+ readonly hasSideEffects = true;
19
+ readonly inputSchema: {
20
+ type: "object";
21
+ required: readonly ["messageId", "body"];
22
+ properties: {
23
+ messageId: {
24
+ type: string;
25
+ description: string;
26
+ };
27
+ body: {
28
+ type: string;
29
+ description: string;
30
+ };
31
+ };
32
+ };
33
+ readonly outputSchema: {
34
+ type: "object";
35
+ properties: {
36
+ id: {
37
+ type: string;
38
+ description: string;
39
+ };
40
+ threadId: {
41
+ type: string;
42
+ description: string;
43
+ };
44
+ };
45
+ };
46
+ constructor(service: GmailService);
47
+ execute(args: ReplyMessageArgs, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
48
+ validateArgs(args: Record<string, any>): {
49
+ isValid: boolean;
50
+ errors?: string[];
51
+ };
52
+ }
53
+ export {};
54
+ //# sourceMappingURL=replyMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replyMessage.d.ts","sourceRoot":"","sources":["../../src/tools/replyMessage.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,qBAAsB,YAAW,KAAK,CAAC,gBAAgB,CAAC;IAmCvD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAlCpC,SAAgB,EAAE,uBAAuB;IACzC,SAAgB,IAAI,uBAAuB;IAC3C,SAAgB,WAAW,4BAA4B;IACvD,SAAgB,WAAW,SAGqC;IAChE,SAAgB,QAAQ,kBAAkB;IAC1C,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,QAAQ;IAEtC,SAAgB,WAAW;;;;;;;;;;;;;MAazB;IAEF,SAAgB,YAAY;;;;;;;;;;;;MAM1B;gBAE2B,OAAO,EAAE,YAAY;IAE5C,OAAO,CACX,IAAI,EAAE,gBAAgB,EACtB,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAa/B,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;CAQjF"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ /**
4
+ * @fileoverview ITool for replying to an existing Gmail message thread.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.GmailReplyMessageTool = void 0;
8
+ class GmailReplyMessageTool {
9
+ constructor(service) {
10
+ this.service = service;
11
+ this.id = 'gmailReplyMessage';
12
+ this.name = 'gmailReplyMessage';
13
+ this.displayName = 'Reply to Gmail Message';
14
+ this.description = 'Reply to an existing email thread in Gmail. ' +
15
+ 'Automatically sets In-Reply-To and References headers for proper threading, ' +
16
+ 'and prefixes the subject with "Re:" if not already present.';
17
+ this.category = 'productivity';
18
+ this.version = '0.1.0';
19
+ this.hasSideEffects = true;
20
+ this.inputSchema = {
21
+ type: 'object',
22
+ required: ['messageId', 'body'],
23
+ properties: {
24
+ messageId: {
25
+ type: 'string',
26
+ description: 'The Gmail message ID to reply to',
27
+ },
28
+ body: {
29
+ type: 'string',
30
+ description: 'Reply body text (plain text)',
31
+ },
32
+ },
33
+ };
34
+ this.outputSchema = {
35
+ type: 'object',
36
+ properties: {
37
+ id: { type: 'string', description: 'Reply message ID' },
38
+ threadId: { type: 'string', description: 'Thread ID of the reply' },
39
+ },
40
+ };
41
+ }
42
+ async execute(args, _context) {
43
+ try {
44
+ const result = await this.service.replyToMessage(args.messageId, args.body);
45
+ return {
46
+ success: true,
47
+ output: { id: result.id, threadId: result.threadId },
48
+ };
49
+ }
50
+ catch (error) {
51
+ return { success: false, error: error.message };
52
+ }
53
+ }
54
+ validateArgs(args) {
55
+ const errors = [];
56
+ if (!args.messageId)
57
+ errors.push('messageId is required');
58
+ else if (typeof args.messageId !== 'string')
59
+ errors.push('messageId must be a string');
60
+ if (!args.body)
61
+ errors.push('body is required');
62
+ else if (typeof args.body !== 'string')
63
+ errors.push('body must be a string');
64
+ return { isValid: errors.length === 0, errors };
65
+ }
66
+ }
67
+ exports.GmailReplyMessageTool = GmailReplyMessageTool;
68
+ //# sourceMappingURL=replyMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replyMessage.js","sourceRoot":"","sources":["../../src/tools/replyMessage.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAUH,MAAa,qBAAqB;IAmChC,YAA6B,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;QAlClC,OAAE,GAAG,mBAAmB,CAAC;QACzB,SAAI,GAAG,mBAAmB,CAAC;QAC3B,gBAAW,GAAG,wBAAwB,CAAC;QACvC,gBAAW,GACzB,8CAA8C;YAC9C,8EAA8E;YAC9E,6DAA6D,CAAC;QAChD,aAAQ,GAAG,cAAc,CAAC;QAC1B,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,IAAI,CAAC;QAEtB,gBAAW,GAAG;YAC5B,IAAI,EAAE,QAAiB;YACvB,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,CAAU;YACxC,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kCAAkC;iBAChD;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,8BAA8B;iBAC5C;aACF;SACF,CAAC;QAEc,iBAAY,GAAG;YAC7B,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE;gBACvD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;aACpE;SACF,CAAC;IAEm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