@framers/agentos-ext-email-gmail 0.1.4 → 0.1.6
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/README.md +110 -0
- package/manifest.json +1 -1
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Gmail email
|
|
2
|
+
|
|
3
|
+
This pack gives an agent message listing, reading, sending, replies, search and label inspection through the Google Gmail API using `googleapis` and OAuth2.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @framers/agentos-ext-email-gmail
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependency: `@framers/agentos` `>=0.10.40`.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { AgentOS } from '@framers/agentos';
|
|
17
|
+
|
|
18
|
+
const agentos = await AgentOS.create({
|
|
19
|
+
extensionManifest: {
|
|
20
|
+
packs: [
|
|
21
|
+
{
|
|
22
|
+
package: '@framers/agentos-ext-email-gmail',
|
|
23
|
+
options: {
|
|
24
|
+
clientId: process.env.GOOGLE_CLIENT_ID || process.env.GMAIL_CLIENT_ID,
|
|
25
|
+
clientSecret: process.env.GOOGLE_CLIENT_SECRET || process.env.GMAIL_CLIENT_SECRET,
|
|
26
|
+
refreshToken: process.env.GOOGLE_REFRESH_TOKEN || process.env.GMAIL_REFRESH_TOKEN,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Configuration
|
|
35
|
+
|
|
36
|
+
| Option | Secret id | Environment variable | Required | Default |
|
|
37
|
+
| --- | --- | --- | --- | --- |
|
|
38
|
+
| `clientId` | `google.clientId` | `GOOGLE_CLIENT_ID`, then `GMAIL_CLIENT_ID` | Yes | No default |
|
|
39
|
+
| `clientSecret` | `google.clientSecret` | `GOOGLE_CLIENT_SECRET`, then `GMAIL_CLIENT_SECRET` | Yes | No default |
|
|
40
|
+
| `refreshToken` | `google.refreshToken` | `GOOGLE_REFRESH_TOKEN`, then `GMAIL_REFRESH_TOKEN` | Yes | No default |
|
|
41
|
+
| `priority` | | | No | `50` |
|
|
42
|
+
| `secrets` | | | No | No map |
|
|
43
|
+
| Context `logger` | | | No | No logger |
|
|
44
|
+
|
|
45
|
+
Nonempty credential options precede `options.secrets`, followed by environment fallbacks in the order shown. The logger receives activation and deactivation messages.
|
|
46
|
+
|
|
47
|
+
## Tools
|
|
48
|
+
|
|
49
|
+
| Tool | What it does |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `gmailListMessages` | Lists message summaries with query, label and result filters. |
|
|
52
|
+
| `gmailReadMessage` | Reads a message's subject, sender, recipients, date, body and labels. |
|
|
53
|
+
| `gmailSendMessage` | Sends a plain text email with To, CC and BCC recipients. |
|
|
54
|
+
| `gmailReplyMessage` | Replies within a thread with reply headers and a `Re:` subject prefix. |
|
|
55
|
+
| `gmailSearchMessages` | Searches messages using Gmail search syntax. |
|
|
56
|
+
| `gmailListLabels` | Lists labels with types and message counts. |
|
|
57
|
+
|
|
58
|
+
### `gmailListMessages`
|
|
59
|
+
|
|
60
|
+
| Parameter | Type | Required | Description |
|
|
61
|
+
| --- | --- | --- | --- |
|
|
62
|
+
| `query` | string | No | Gmail search query (e.g. "is:unread", "from:alice@example.com", "subject:invoice"). Uses standard Gmail search syntax. |
|
|
63
|
+
| `labelIds` | array of strings | No | Filter by label IDs (e.g. ["INBOX", "UNREAD"]) |
|
|
64
|
+
| `maxResults` | number | No | Maximum number of messages to return (default: 10, max: 100) |
|
|
65
|
+
|
|
66
|
+
### `gmailReadMessage`
|
|
67
|
+
|
|
68
|
+
| Parameter | Type | Required | Description |
|
|
69
|
+
| --- | --- | --- | --- |
|
|
70
|
+
| `messageId` | string | Yes | The Gmail message ID to read |
|
|
71
|
+
|
|
72
|
+
### `gmailSendMessage`
|
|
73
|
+
|
|
74
|
+
| Parameter | Type | Required | Description |
|
|
75
|
+
| --- | --- | --- | --- |
|
|
76
|
+
| `to` | string | Yes | Recipient email address (comma-separated for multiple) |
|
|
77
|
+
| `subject` | string | Yes | Email subject line |
|
|
78
|
+
| `body` | string | Yes | Email body text (plain text) |
|
|
79
|
+
| `cc` | string | No | CC recipients (comma-separated email addresses) |
|
|
80
|
+
| `bcc` | string | No | BCC recipients (comma-separated email addresses) |
|
|
81
|
+
|
|
82
|
+
### `gmailReplyMessage`
|
|
83
|
+
|
|
84
|
+
| Parameter | Type | Required | Description |
|
|
85
|
+
| --- | --- | --- | --- |
|
|
86
|
+
| `messageId` | string | Yes | The Gmail message ID to reply to |
|
|
87
|
+
| `body` | string | Yes | Reply body text (plain text) |
|
|
88
|
+
|
|
89
|
+
### `gmailSearchMessages`
|
|
90
|
+
|
|
91
|
+
| Parameter | Type | Required | Description |
|
|
92
|
+
| --- | --- | --- | --- |
|
|
93
|
+
| `query` | string | Yes | Gmail search query using Gmail search syntax (e.g. "from:alice@example.com", "subject:invoice has:attachment", "is:unread after:2024/06/01") |
|
|
94
|
+
| `maxResults` | number | No | Maximum number of results to return (default: 10, max: 100) |
|
|
95
|
+
|
|
96
|
+
### `gmailListLabels`
|
|
97
|
+
|
|
98
|
+
The input schema has no parameters.
|
|
99
|
+
|
|
100
|
+
## Notes
|
|
101
|
+
|
|
102
|
+
The package requires Node.js `>=22`. Missing OAuth credentials make the factory throw. Activation initializes the OAuth client with the refresh token; service operations require initialization. The pack also registers the service as `gmailService` with kind `productivity`.
|
|
103
|
+
|
|
104
|
+
Sending and replying transmit email from the authenticated account. Replies address the original `From` header, use the original thread, and set `In-Reply-To` and `References` from its message ID header. Bodies are sent as plain text.
|
|
105
|
+
|
|
106
|
+
Listing and search clamp `maxResults` to the range from `1` to `100`. They fetch full messages before returning summaries without the body. Reading extracts plain text or strips tags from HTML. Label detail failures return the basic label without message counts. Tool failures return `success: false` and an `error` message.
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
Apache-2.0
|
package/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
|
|
3
3
|
"id": "com.framers.productivity.gmail",
|
|
4
4
|
"name": "Gmail Email Extension",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.6",
|
|
6
6
|
"description": "Gmail email integration with OAuth2 — list, read, send, reply, search messages and manage labels.",
|
|
7
7
|
"categories": ["productivity", "email"],
|
|
8
8
|
"platforms": ["gmail"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@framers/agentos-ext-email-gmail",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Gmail integration for AgentOS — email CRUD via Google Gmail API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"name": "Framers AI",
|
|
16
16
|
"url": "https://frame.dev"
|
|
17
17
|
},
|
|
18
|
-
"license": "
|
|
18
|
+
"license": "Apache-2.0",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
21
21
|
"manifest.json"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@types/node": "^20.0.0",
|
|
31
31
|
"typescript": "^5.0.0",
|
|
32
32
|
"vitest": "^3.2.7",
|
|
33
|
-
"@framers/agentos": "^0.
|
|
33
|
+
"@framers/agentos": "^0.13.47"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=22"
|