Repository navigation
More tools: Slack, Google Drive, Contacts and free time - #11
Merged
Merged
Conversation
The Slack install now also asks for a user token (search, history, channels, people, chat:write), sealed like the bot token (migration 0009). With it the agent gets slack_search, slack_read, slack_list_channels, slack_find_user and slack_post_message. Posting is a send: it asks by default, shows where it goes and the exact text, and a channel or person only seen in a Slack message the agent read is flagged as a new destination. Search and read output is untrusted, with mentions resolved to names and text capped. Installs without a user token keep approvals working; the tools aren't offered and Connections asks to reconnect. A revoked user token turns them off the same way. The fake Slack moves to @synapse/tools/slack-testing and grows the read and post methods.
- Scopes are grouped by the tools they unlock. Gmail and Calendar stay required; Drive (drive.readonly, drive.file) and Contacts (contacts.readonly, contacts.other.readonly) are optional, so older grants keep working with those tools withheld until a reconnect. - drive_search, drive_read (Docs/Slides as text, Sheets as CSV, PDFs and text files through extractText, paged 12k chars), drive_create_doc (write, asks; light Markdown converted to a Google Doc). - contacts_search over saved and other contacts, with the warmup query, merged by address. Trusted output, so "email Sam" gets the normal approval without a new-recipient warning. - calendar_find_free_time from events.list in the user's time zone (freeBusy needs a scope beyond calendar.events). - Connections page shows withheld groups with a reconnect button; the prompt names them; approval cards show new Docs as title and body. - Fake Google covers Drive and People; unit and end-to-end tests.
# Conflicts: # README.md # apps/server/src/worker.ts # apps/web/components/approval/payload.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New tools for the agent, all on the existing approval and policy machinery.
Slack, acting as you
The Slack install now also asks for a user token (
user_scope), stored sealed like the bot token (migration0009_slack_user_token).slack_search,slack_read(channel, DM or thread, with a cursor) andslack_list_channels. Message text is untrusted.slack_find_userlooks people up by email or by part of a name.slack_post_messageposts to#name, a channel id, a user (opens the DM) or a thread. It uses effectsend, so it asks by default. Risk fact: "Posts as you in #channel" or "Sends a direct message as you".Google
drive.readonly,drive.file) and Contacts (contacts.readonly,contacts.other.readonly). Scope checks now work per group: older grants keep Gmail and Calendar, only the new tools are withheld, Connections shows "Reconnect Google", and the prompt tells the agent why.drive_search, anddrive_read, which reads Docs and Slides as text, Sheets as CSV, and PDFs or text files throughextractText, paging through long files. Output is untrusted.drive_create_docturns light Markdown into a new Google Doc. It is a write and asks first.contacts_searchcovers saved contacts plus "other contacts", with the warmup query. Its output is trusted (names, addresses and phones only), so "email Sam" gets the normal approval with no new-recipient warning. A test confirms this.calendar_find_free_timeworks fromevents.liston your primary calendar.freebusy.queryneeds a scope we don't request, so attendees' availability is reported as unknown. It handles time zones and DST.UI
PayloadViewtakes atoolprop.Checks
293 tests pass; lint, typecheck and the web build pass. Nothing was run against real Slack or Google; everything ran against the fakes. Docs updated:
docs/slack.md(operators must add the user scopes to their Slack app),docs/google.md(drive.readonlyis a restricted scope that needs Google verification for public apps), README anddocs/api.md.