@assemblyline-agents/gmail 5.0.10 → 6.0.0

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 CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Official Assembly Line Gmail connection plugin.
4
4
 
5
- It exposes Gmail threads, messages, attachments, drafts, and sends through a reviewed direct Gmail REST API connection. Gmail authorization is stored independently from Google Calendar and Google Drive. The package exports `defineGmailConnection(options)`.
5
+ The selected plugin exposes Gmail threads, messages, attachments, drafts, and sends through a reviewed direct REST connection. Gmail authorization is independent from Google Calendar and Google Drive.
6
6
 
7
7
  ## Install
8
8
 
9
9
  ```sh
10
- npm install @assemblyline-agents/gmail
10
+ assembly-line add gmail agent
11
11
  ```
12
12
 
13
- Create a Google OAuth web client, enable the Gmail API, and set `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`. Optionally set `GOOGLE_REDIRECT_URI` or `GMAIL_API_BASE_URL`. Assembly Line runs Authorization Code + PKCE, requests offline access, and stores the refreshable grant host-side. New connections enable reviewed Gmail tools without requiring an approval surface. Set `access: "approval-required"` if drafts and sends should pause for approval, or `access: "read-only"` to request only `gmail.readonly`.
13
+ Create a Google OAuth web client, enable the Gmail API, and set `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`. Optionally set `GOOGLE_REDIRECT_URI` or `GMAIL_API_BASE_URL`. Assembly Line runs Authorization Code + PKCE, requests offline access, and stores the refreshable grant host-side. Gate or remove named actions through `plugins.gmail.connections.gmail.approval` or `disable`.
14
14
 
15
15
  Gmail connections also expose the reviewed `email.received` event. Enable the
16
16
  Gmail API and Pub/Sub API, then set `GOOGLE_CLOUD_PROJECT`,
@@ -0,0 +1,96 @@
1
+ {
2
+ "kind": "gmail",
3
+ "role": "connection",
4
+ "packageName": "@assemblyline-agents/gmail",
5
+ "helper": "defineGmailConnection",
6
+ "protocol": "http",
7
+ "provider": "gmail",
8
+ "description": "Gmail threads, messages, attachments, drafts, and sends through the Gmail REST API.",
9
+ "defaultBaseUrl": "https://gmail.googleapis.com/gmail/v1",
10
+ "baseUrlEnv": "GMAIL_API_BASE_URL",
11
+ "capabilities": [
12
+ "http-api",
13
+ "oauth",
14
+ "pkce",
15
+ "refresh-token",
16
+ "live-tools"
17
+ ],
18
+ "scopes": [
19
+ "https://www.googleapis.com/auth/gmail.readonly",
20
+ "https://www.googleapis.com/auth/gmail.compose",
21
+ "https://www.googleapis.com/auth/gmail.send"
22
+ ],
23
+ "subject": "user",
24
+ "tools": {
25
+ "allow": [
26
+ "gmail_get_profile",
27
+ "gmail_list_messages",
28
+ "gmail_get_message",
29
+ "gmail_get_attachment",
30
+ "gmail_list_threads",
31
+ "gmail_get_thread",
32
+ "gmail_list_labels",
33
+ "gmail_get_label",
34
+ "gmail_list_drafts",
35
+ "gmail_get_draft",
36
+ "gmail_create_draft",
37
+ "gmail_update_draft",
38
+ "gmail_delete_draft",
39
+ "gmail_send_draft",
40
+ "gmail_send_message"
41
+ ]
42
+ },
43
+ "readToolPatterns": [
44
+ "gmail_get_profile",
45
+ "gmail_list_messages",
46
+ "gmail_get_message",
47
+ "gmail_get_attachment",
48
+ "gmail_list_threads",
49
+ "gmail_get_thread",
50
+ "gmail_list_labels",
51
+ "gmail_get_label",
52
+ "gmail_list_drafts",
53
+ "gmail_get_draft"
54
+ ],
55
+ "writeToolPatterns": [
56
+ "gmail_create_draft",
57
+ "gmail_update_draft",
58
+ "gmail_delete_draft",
59
+ "gmail_send_draft",
60
+ "gmail_send_message"
61
+ ],
62
+ "eventCatalog": [
63
+ "email.received"
64
+ ],
65
+ "defaultEvents": [
66
+ "email.received"
67
+ ],
68
+ "eventMode": "watch",
69
+ "eventScope": "principal",
70
+ "setup": [
71
+ {
72
+ "kind": "connection",
73
+ "name": "gmail-oauth-configuration",
74
+ "required": true,
75
+ "message": "Create a Google OAuth web client, enable the Gmail API, set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET, and register the Assembly Line connection callback URL. Gmail authorization is stored as its own connection grant."
76
+ }
77
+ ],
78
+ "requiredConfig": [
79
+ "GOOGLE_CLIENT_ID"
80
+ ],
81
+ "optionalConfig": [
82
+ "GOOGLE_REDIRECT_URI",
83
+ "GMAIL_API_BASE_URL"
84
+ ],
85
+ "requiredCredentials": [
86
+ "GOOGLE_CLIENT_SECRET"
87
+ ],
88
+ "optionalCredentials": [],
89
+ "eventRequiredConfig": [
90
+ "GOOGLE_CLOUD_PROJECT",
91
+ "GMAIL_PUBSUB_TOPIC"
92
+ ],
93
+ "eventRequiredCredentials": [
94
+ "GMAIL_PUBSUB_VERIFICATION_TOKEN"
95
+ ]
96
+ }
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ "connections": {
3
+ "gmail": {
4
+ "contract": "./ai.assemblyline/connections/gmail.json",
5
+ "definition": "@assemblyline-agents/gmail",
6
+ "factory": "defineGmailConnection"
7
+ }
8
+ }
9
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACpC,MAAM,2BAA2B,CAAC;AAOnC,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,8BAA8B,EAAE,MAAM,GAAG,YAAY,CAAC;IACzG,IAAI,CAAC,EAAE,wBAAwB,GAAG,KAAK,CAAC;CACzC;AAED,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,sBAA2B,oIAUzE;AAED,eAAO,MAAM,kBAAkB,kDAA0C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACpC,MAAM,2BAA2B,CAAC;AAOnC,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,8BAA8B,EAAE,MAAM,GAAG,YAAY,CAAC;IACzG,IAAI,CAAC,EAAE,wBAAwB,GAAG,KAAK,CAAC;CACzC;AAED,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,sBAA2B,oIAUzE;AAED,eAAO,MAAM,kBAAkB,kDAA0C,CAAC"}
package/dist/index.js CHANGED
@@ -1,8 +1,9 @@
1
- import { connectionPluginMetadata, defineConnectionPluginEvents, defineHttpApiPluginConnection, definePlugin } from "@assemblyline-agents/core";
1
+ import connectionContract_gmail from "../ai.assemblyline/connections/gmail.json" with { type: "json" };
2
+ import { defineConnectionPluginEvents, defineHttpApiPluginConnection, definePlugin } from "@assemblyline-agents/core";
2
3
  import { gmailOAuth } from "./auth.js";
3
4
  import { gmailEvents } from "./events.js";
4
5
  import { GMAIL_OPERATIONS } from "./operations.js";
5
- const PLUGIN = connectionPluginMetadata("gmail");
6
+ const PLUGIN = connectionContract_gmail;
6
7
  export function defineGmailConnection(options = {}) {
7
8
  const { auth, ...connection } = options;
8
9
  const definition = defineHttpApiPluginConnection(PLUGIN, {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,YAAY,EAGb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAE,CAAC;AAMlD,MAAM,UAAU,qBAAqB,CAAC,UAAkC,EAAE;IACxE,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,UAAU,GAAG,6BAA6B,CAAC,MAAM,EAAE;QACvD,GAAG,UAAU;QACb,UAAU,EAAE,gBAAgB;QAC5B,IAAI,E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E,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACjF,IAAI,MAAM;QAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC;IACvC,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assemblyline-agents/gmail",
3
- "version": "5.0.10",
3
+ "version": "6.0.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -9,11 +9,13 @@
9
9
  }
10
10
  },
11
11
  "dependencies": {
12
- "@assemblyline-agents/core": "5.0.10"
12
+ "@assemblyline-agents/core": "6.0.0"
13
13
  },
14
14
  "description": "Official Assembly Line direct Gmail API connection plugin.",
15
15
  "files": [
16
- "dist"
16
+ "dist",
17
+ "plugin.json",
18
+ "ai.assemblyline"
17
19
  ],
18
20
  "engines": {
19
21
  "node": ">=22.19.0"
package/plugin.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
+ "name": "gmail",
4
+ "version": "6.0.0",
5
+ "description": "Official Assembly Line direct Gmail API connection plugin.",
6
+ "extensions": {
7
+ "ai.assemblyline": {
8
+ "entry": "./ai.assemblyline/index.cjs"
9
+ }
10
+ }
11
+ }