@slates-integrations/google-chat 0.1.0 → 0.1.4
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 +10 -5
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/docs/SPEC.md +24 -9
- package/package.json +3 -3
- package/slate.json +7 -2
package/docs/SPEC.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
Google Chat is Google Workspace's team messaging service. This integration exposes
|
|
5
|
+
Google Chat is Google Workspace's team messaging service. This integration exposes 26 tools for messages, spaces, memberships, reactions, direct messages, attachments, space events, the signed-in user's read state, space notification settings, sidebar sections, custom emoji, and organization-wide admin space search. It has no triggers.
|
|
6
6
|
|
|
7
7
|
## Tool surface
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Google Chat is Google Workspace's team messaging service. This integration expos
|
|
|
10
10
|
|---|---|---|
|
|
11
11
|
| `send_message` | User OAuth or Chat app | `spaces.messages.create`, including thread replies and uploaded attachment tokens |
|
|
12
12
|
| `list_messages` | User OAuth | `spaces.messages.list` with thread/time filtering, `createTime ASC`/`DESC` ordering, and pagination |
|
|
13
|
-
| `search_messages` | User OAuth |
|
|
13
|
+
| `search_messages` | User OAuth | `POST /v1/spaces/-/messages:search`, with a `spaces.messages.list` keyword fallback when the search API is unavailable for the account or project |
|
|
14
14
|
| `search_conversations` | User OAuth or Chat app | `spaces.list`, followed by client-side name matching on each returned page |
|
|
15
15
|
| `manage_space` | User OAuth | Create, setup, get, update, and delete space workflows |
|
|
16
16
|
| `manage_member` | User OAuth | Add, get, list, update, and remove memberships |
|
|
@@ -21,8 +21,21 @@ Google Chat is Google Workspace's team messaging service. This integration expos
|
|
|
21
21
|
| `download_attachment` | User OAuth or Chat app | `media.download`; returns a downloadable file |
|
|
22
22
|
| `upload_attachment` | User OAuth or Chat app | Multipart `media.upload`; returns an upload token, not a posted message |
|
|
23
23
|
| `list_space_events` | User OAuth | List events or get one event by ID |
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
| `get_space_read_state` | User OAuth | `users.spaces.getSpaceReadState` for `users/me` |
|
|
25
|
+
| `get_thread_read_state` | User OAuth | `users.spaces.threads.getThreadReadState` for `users/me` |
|
|
26
|
+
| `update_space_read_state` | User OAuth | `users.spaces.updateSpaceReadState`; `markAsRead=true` sends a future `lastReadTime` that Google coerces to the latest message, or an explicit RFC 3339 `lastReadTime` marks later messages unread |
|
|
27
|
+
| `get_space_notification_setting` | User OAuth | `users.spaces.spaceNotificationSetting.get` |
|
|
28
|
+
| `update_space_notification_setting` | User OAuth | `users.spaces.spaceNotificationSetting.patch` for notification and mute settings |
|
|
29
|
+
| `list_sections` | User OAuth | `users.sections.list` for the signed-in user's sidebar |
|
|
30
|
+
| `list_section_items` | User OAuth | `users.sections.items.list`, including the `-` section wildcard with a space filter |
|
|
31
|
+
| `manage_section` | User OAuth | Create, update (rename), reposition, and delete custom sections |
|
|
32
|
+
| `move_section_item` | User OAuth | `users.sections.items.move` into another section |
|
|
33
|
+
| `list_custom_emojis` | User OAuth | `customEmojis.list`, optionally filtered by creator |
|
|
34
|
+
| `get_custom_emoji` | User OAuth | `customEmojis.get` by resource name or `:shortcode:` |
|
|
35
|
+
| `manage_custom_emoji` | User OAuth | `customEmojis.create` from base64 image bytes, or `customEmojis.delete` |
|
|
36
|
+
| `search_spaces_admin` | User OAuth (Workspace admin) | `spaces.search` with `useAdminAccess=true` and a caller-supplied admin query |
|
|
37
|
+
|
|
38
|
+
The four official-named core tools are `send_message`, `list_messages`, `search_messages`, and `search_conversations`. Read state, notification settings, sidebar sections, and custom emoji tools always act on the signed-in user (`users/me`) and change only that user's own view; custom emoji tools additionally require an organization where custom emoji are enabled. `search_spaces_admin` requires a Workspace administrator with the Manage Chat and spaces conversations privilege; its `query` must include `customer = "customers/my_customer" AND spaceType = "SPACE"`, and its instructions list the documented filter fields and operators. Import-mode completion is intentionally outside the selected surface.
|
|
26
39
|
|
|
27
40
|
## Authentication
|
|
28
41
|
|
|
@@ -36,9 +49,11 @@ The consent surface contains:
|
|
|
36
49
|
- `chat.spaces`, `chat.spaces.readonly`, and the separate `chat.delete` scope
|
|
37
50
|
- `chat.memberships`, `chat.memberships.readonly`, and `chat.memberships.app`
|
|
38
51
|
- `chat.messages.reactions`
|
|
52
|
+
- `chat.users.readstate`, `chat.users.spacesettings`, `chat.users.sections`, and `chat.customemojis`
|
|
53
|
+
- `chat.admin.spaces.readonly`
|
|
39
54
|
- `userinfo.email` and `userinfo.profile`
|
|
40
55
|
|
|
41
|
-
|
|
56
|
+
Connections request every scope declared on the OAuth method. Consolidated tools use relaxed `anyOf` static gates and document the per-action scope Google actually enforces in their instructions: `manage_space` accepts `chat.spaces`, `chat.spaces.readonly`, or `chat.delete` (get works read-only; create/setup/update need `chat.spaces`; delete needs `chat.delete`, and without it the tool reports that the connection must be reauthorized). `manage_message` accepts a message read scope so `action=get` works with read-only grants, while update/delete need `chat.messages`. `manage_member` accepts `chat.memberships` or `chat.memberships.app`; the app scope is required only for adding or removing the calling Chat app itself. `list_space_events` accepts any one message, reaction, membership, or space read scope because Google enforces the scope per requested `eventTypes` family. Read-only tools for read state, sections, and custom emoji also accept the matching `.readonly` scope; their write tools require the full scope. `search_spaces_admin` accepts `chat.admin.spaces.readonly` or `chat.admin.spaces`.
|
|
42
57
|
|
|
43
58
|
### Chat app service account
|
|
44
59
|
|
|
@@ -48,11 +63,11 @@ The Google Cloud project must have a configured Chat app, and that app must be i
|
|
|
48
63
|
|
|
49
64
|
## Search behavior
|
|
50
65
|
|
|
51
|
-
`search_messages` first calls the
|
|
66
|
+
`search_messages` first calls the generally available endpoint exactly: `POST https://chat.googleapis.com/v1/spaces/-/messages:search`. That primary path depends on Workspace tenant eligibility and OAuth user access. Provider search exclusions still apply, including omitted private, blocked-user, app-authored, app-DM, and muted-space results described by Google.
|
|
52
67
|
|
|
53
|
-
When the search endpoint fails with HTTP 403/`PERMISSION_DENIED` or 404 (
|
|
68
|
+
When the search endpoint fails with HTTP 403/`PERMISSION_DENIED` or 404 (the search API is unavailable for the tenant or project), the tool falls back to `spaces.messages.list` plus client-side case-insensitive keyword matching. The fallback requires `conversationId` to scope the list; without it the tool throws a `ServiceError` that explains the search API is unavailable and advises passing `conversationId`. Fallback semantics are weaker: it scans a single conversation (up to 5 pages of 50 messages, newest first), matches keywords and quoted phrases against message text, and applies only the `createTime` filters that `spaces.messages.list` supports — other structured search filters and relevance ordering are dropped. The output `searchMethod` field and the human-readable message state which path served each request.
|
|
54
69
|
|
|
55
|
-
`search_conversations` does not use the
|
|
70
|
+
`search_conversations` does not use the non-admin `spaces.search` method, which only searches named spaces (`spaceType = "SPACE"`) and returns an empty response without a `displayName` clause. It calls `spaces.list` with an optional `spaceType` filter and then performs a case-insensitive substring match against `displayName` and the resource name on the current page. The output preserves `nextPageToken`; an empty result page does not prove that later pages contain no match.
|
|
56
71
|
|
|
57
72
|
## Attachment workflow
|
|
58
73
|
|
|
@@ -69,4 +84,4 @@ Google Drive download flow.
|
|
|
69
84
|
|
|
70
85
|
## Live verification boundary
|
|
71
86
|
|
|
72
|
-
The private E2E
|
|
87
|
+
The private E2E suite defines scenarios for all 26 tools. A real run requires both a fully consented user OAuth profile and a Chat app service-account profile, a Workspace tenant where the app can be installed, a disposable member fixture, existing OAuth/app direct-message fixtures, and stable user/app attachment fixtures. Where the search API is available the suite exercises the primary `messages.search` path; otherwise `search_messages` exercises its `spaces.messages.list` fallback instead. The read state, notification setting, section, and custom emoji scenarios need their user scopes, and `search_spaces_admin` runs only for a Workspace administrator profile. Scenarios whose profile, scope, or fixture is missing skip individually rather than claiming live provider coverage.
|
package/package.json
CHANGED
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@lowerdeck/error": "^1.1.0",
|
|
12
12
|
"@types/node": "^20",
|
|
13
|
-
"slates": "1.0.0-rc.
|
|
13
|
+
"slates": "1.0.0-rc.25",
|
|
14
14
|
"zod": "^4.2"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@slates/test": "1.0.0-rc.
|
|
17
|
+
"@slates/test": "1.0.0-rc.23",
|
|
18
18
|
"typescript": "^5",
|
|
19
19
|
"vitest": "^3.1.2"
|
|
20
20
|
},
|
|
21
|
-
"version": "0.1.
|
|
21
|
+
"version": "0.1.4",
|
|
22
22
|
"files": [
|
|
23
23
|
"dist/**",
|
|
24
24
|
"docs/**",
|
package/slate.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google/google-chat",
|
|
3
|
-
"description": "Connect Google Chat for authenticated space, membership, message, reaction, attachment,
|
|
3
|
+
"description": "Connect Google Chat for authenticated space, membership, message, reaction, attachment, space-event, read-state, notification-setting, sidebar-section, custom-emoji, and admin space search workflows.",
|
|
4
4
|
"categories": ["email-and-messaging"],
|
|
5
5
|
"skills": [
|
|
6
6
|
"send and manage messages",
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
"manage space memberships",
|
|
9
9
|
"manage message reactions",
|
|
10
10
|
"upload and download attachments",
|
|
11
|
-
"inspect Google Chat space events"
|
|
11
|
+
"inspect Google Chat space events",
|
|
12
|
+
"mark spaces read or unread",
|
|
13
|
+
"manage space notification settings",
|
|
14
|
+
"organize sidebar sections",
|
|
15
|
+
"manage custom emoji",
|
|
16
|
+
"search organization spaces as an admin"
|
|
12
17
|
],
|
|
13
18
|
"logoUrl": "https://provider-logos.metorial-cdn.com/google-chat.svg"
|
|
14
19
|
}
|