@open-neko/connector-google-workspace 0.1.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/LICENSE +202 -0
- package/README.md +89 -0
- package/dist/google-client.d.ts +96 -0
- package/dist/google-client.d.ts.map +1 -0
- package/dist/google-client.js +155 -0
- package/dist/google-client.js.map +1 -0
- package/dist/plugin.d.ts +51 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +248 -0
- package/dist/plugin.js.map +1 -0
- package/dist/run.d.ts +2 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +15372 -0
- package/dist/run.js.map +1 -0
- package/package.json +111 -0
- package/skill/SKILL.md +96 -0
package/dist/run.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@open-neko/connector-google-workspace",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Google Workspace connector for OpenNeko — per-operator OAuth via PKCE against the operator's own Google Cloud OAuth client. Provides Gmail, Calendar, Drive, Docs, and Sheets actions backed by each operator's authorised account. Runs in a microsandbox VM with network egress limited to accounts.google.com and *.googleapis.com.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/open-neko/plugins.git",
|
|
9
|
+
"directory": "packages/google-workspace"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md",
|
|
15
|
+
"skill"
|
|
16
|
+
],
|
|
17
|
+
"openneko": {
|
|
18
|
+
"runner": "./dist/run.js",
|
|
19
|
+
"skill": "./skill",
|
|
20
|
+
"permissions": {
|
|
21
|
+
"network": [
|
|
22
|
+
"accounts.google.com",
|
|
23
|
+
"oauth2.googleapis.com",
|
|
24
|
+
"gmail.googleapis.com",
|
|
25
|
+
"www.googleapis.com",
|
|
26
|
+
"sheets.googleapis.com",
|
|
27
|
+
"docs.googleapis.com"
|
|
28
|
+
],
|
|
29
|
+
"env": [
|
|
30
|
+
{
|
|
31
|
+
"key": "GOOGLE_CLIENT_ID",
|
|
32
|
+
"required": true,
|
|
33
|
+
"secret": false,
|
|
34
|
+
"description": "OAuth 2.0 Client ID from your Google Cloud Console project. Deployment-wide — every operator who connects uses the same client. Create at https://console.cloud.google.com/apis/credentials → Create credentials → OAuth client ID → Web application. Set Authorized redirect URI to https://<your-deployment>/api/integrations/connect/%40open-neko%2Fconnector-google-workspace/callback."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"key": "GOOGLE_CLIENT_SECRET",
|
|
38
|
+
"required": true,
|
|
39
|
+
"secret": true,
|
|
40
|
+
"description": "OAuth 2.0 Client Secret paired with the client ID above. Stored in the per-user secrets file, never echoed."
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"capabilities": {
|
|
45
|
+
"connect": {
|
|
46
|
+
"providerLabel": "Google Workspace",
|
|
47
|
+
"scopes": [
|
|
48
|
+
"openid",
|
|
49
|
+
"https://www.googleapis.com/auth/userinfo.email",
|
|
50
|
+
"https://www.googleapis.com/auth/gmail.send",
|
|
51
|
+
"https://www.googleapis.com/auth/calendar.events.readonly",
|
|
52
|
+
"https://www.googleapis.com/auth/spreadsheets",
|
|
53
|
+
"https://www.googleapis.com/auth/documents"
|
|
54
|
+
],
|
|
55
|
+
"flow": "oauth2-pkce"
|
|
56
|
+
},
|
|
57
|
+
"action": {
|
|
58
|
+
"kinds": [
|
|
59
|
+
{
|
|
60
|
+
"kind": "send_gmail",
|
|
61
|
+
"description": "Send an email from the connected user's Gmail account.",
|
|
62
|
+
"default_mode": "ask",
|
|
63
|
+
"example": {
|
|
64
|
+
"to": "amit@example.com",
|
|
65
|
+
"subject": "Weekly revenue summary",
|
|
66
|
+
"body": "Hi Amit,\n\nQ3 revenue is in — see the dashboard for details.\n\n— OpenNeko"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"kind": "list_calendar_events",
|
|
71
|
+
"description": "List upcoming events on the connected user's primary calendar.",
|
|
72
|
+
"default_mode": "auto",
|
|
73
|
+
"example": {
|
|
74
|
+
"maxResults": 10,
|
|
75
|
+
"timeMin": "2026-05-24T00:00:00Z"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"kind": "append_sheet_row",
|
|
80
|
+
"description": "Append a row to a Google Sheet the connected user can edit.",
|
|
81
|
+
"default_mode": "ask",
|
|
82
|
+
"example": {
|
|
83
|
+
"spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
|
|
84
|
+
"range": "Sheet1!A1",
|
|
85
|
+
"values": [
|
|
86
|
+
"2026-05-24",
|
|
87
|
+
"Revenue",
|
|
88
|
+
"12000"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"dependencies": {
|
|
97
|
+
"@open-neko/plugin-types": "0.1.0"
|
|
98
|
+
},
|
|
99
|
+
"devDependencies": {
|
|
100
|
+
"@types/node": "^20.19.0",
|
|
101
|
+
"esbuild": "^0.25.0",
|
|
102
|
+
"typescript": "^5.6.3",
|
|
103
|
+
"vitest": "^2.1.8"
|
|
104
|
+
},
|
|
105
|
+
"scripts": {
|
|
106
|
+
"build": "tsc -p tsconfig.json && node scripts/bundle.mjs",
|
|
107
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
108
|
+
"test": "vitest run",
|
|
109
|
+
"test:watch": "vitest"
|
|
110
|
+
}
|
|
111
|
+
}
|
package/skill/SKILL.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: google-workspace
|
|
3
|
+
description: Patterns for using the @open-neko/connector-google-workspace actions — Gmail send, Calendar list, Sheets append — against the currently-connected operator's account. Use whenever the agent needs to send email, look up upcoming meetings, or log a finding to a spreadsheet on the operator's behalf. The operator must have already connected via /integrations; this skill assumes that's done.
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
metadata:
|
|
6
|
+
authoredBy: open-neko
|
|
7
|
+
pairsWith: "@open-neko/connector-google-workspace"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Google Workspace patterns
|
|
11
|
+
|
|
12
|
+
The `@open-neko/connector-google-workspace` plugin contributes three
|
|
13
|
+
sandboxed actions, each scoped to the **currently connected operator**:
|
|
14
|
+
|
|
15
|
+
| Action | Mode | Use when |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| `send_gmail` | `ask` | Operator wants OpenNeko to send a real email on their behalf. |
|
|
18
|
+
| `list_calendar_events` | `auto` | Operator asks about their schedule, or you need calendar context for a finding. |
|
|
19
|
+
| `append_sheet_row` | `ask` | Logging a finding to an external Sheets log the operator maintains. |
|
|
20
|
+
|
|
21
|
+
## Prerequisites the agent must verify
|
|
22
|
+
|
|
23
|
+
1. **The operator has connected.** Check the `/integrations` status
|
|
24
|
+
before assuming a Google action is available. If they haven't,
|
|
25
|
+
prompt them: *"Connect Google Workspace at /integrations first."*
|
|
26
|
+
2. **The action you need is in scope.** Some operators connect with a
|
|
27
|
+
narrower set of OAuth scopes than the plugin declares. If
|
|
28
|
+
`send_gmail` returns `insufficient_authentication_scopes`, ask the
|
|
29
|
+
operator to reconnect with the gmail.send scope checked.
|
|
30
|
+
|
|
31
|
+
## `send_gmail` drafting rules
|
|
32
|
+
|
|
33
|
+
The same `ask`-mode → approval-queue → fire flow as Slack. Draft to be
|
|
34
|
+
operator-readable on a phone screen.
|
|
35
|
+
|
|
36
|
+
1. **Subject lines under 60 chars.** Mobile preview clips at ~60.
|
|
37
|
+
2. **One ask per email.** If a finding requires two follow-ups, draft
|
|
38
|
+
two emails. The operator can approve both independently.
|
|
39
|
+
3. **Sign off with the operator's name, not "OpenNeko".** You're acting
|
|
40
|
+
on their behalf — the recipient should see the operator as the sender.
|
|
41
|
+
4. **Include the source.** "(Detected by your OpenNeko Revenue Drop
|
|
42
|
+
watcher at 14:03 UTC.)" at the bottom of the body. Operators in
|
|
43
|
+
regulated industries need traceability.
|
|
44
|
+
|
|
45
|
+
## `list_calendar_events` consumption
|
|
46
|
+
|
|
47
|
+
Returns up to N upcoming events sorted by start time. For "what's on my
|
|
48
|
+
calendar tomorrow?" prompts:
|
|
49
|
+
|
|
50
|
+
- Filter client-side to events whose `start.dateTime` falls in the next
|
|
51
|
+
24-48h — don't ask Google for more than you need.
|
|
52
|
+
- Render times in the operator's timezone if known; otherwise use ISO
|
|
53
|
+
with `Z` and let the UI localize.
|
|
54
|
+
- Suppress the standing weekly recurring stand-up unless the operator
|
|
55
|
+
asked specifically about it; it's noise.
|
|
56
|
+
|
|
57
|
+
## `append_sheet_row` patterns
|
|
58
|
+
|
|
59
|
+
Operators who run "findings logs" in Sheets benefit from this. The
|
|
60
|
+
shape that works:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
spreadsheetId: "1AbC..." (from the URL of the sheet)
|
|
64
|
+
range: "Findings!A:E"
|
|
65
|
+
values: [
|
|
66
|
+
"2026-05-21T14:03:00Z", // ISO timestamp
|
|
67
|
+
"germany-revenue-drop", // watcher slug
|
|
68
|
+
"Germany hourly revenue down 62% vs baseline", // description
|
|
69
|
+
"approved", // outcome
|
|
70
|
+
"https://app/work/runs/abc" // link back
|
|
71
|
+
]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Use ISO timestamps in the first column; operators sort by it. The
|
|
75
|
+
plugin's `range` argument uses A1 notation — `Sheet1!A:E` lets Sheets
|
|
76
|
+
auto-find the next empty row.
|
|
77
|
+
|
|
78
|
+
## Failure modes the operator should see
|
|
79
|
+
|
|
80
|
+
- **`invalid_grant`** (refresh): the operator's refresh token was
|
|
81
|
+
revoked (account password change, OAuth client deleted, scope
|
|
82
|
+
removed). Prompt: *"Your Google connection expired — reconnect at
|
|
83
|
+
/integrations."*
|
|
84
|
+
- **`insufficient_authentication_scopes`** (action): the connected
|
|
85
|
+
scope set doesn't include the one this action needs. Prompt the
|
|
86
|
+
operator to reconnect with the right scope checked.
|
|
87
|
+
- **`quotaExceeded`**: Google's daily quota for that API. Surface the
|
|
88
|
+
exact API ("Gmail send quota") so the operator knows which one to
|
|
89
|
+
request an increase for.
|
|
90
|
+
|
|
91
|
+
## What this skill is NOT for
|
|
92
|
+
|
|
93
|
+
- One-off email to a person not in Gmail — that's a webhook or the
|
|
94
|
+
built-in `send_webhook` action.
|
|
95
|
+
- Long Google Doc authoring — the connector's scopes include `documents`
|
|
96
|
+
but no `create_doc` action is shipped yet. (Coming after M10 ships.)
|