Skip to content

More tools: Slack, Google Drive, Contacts and free time - #11

Merged
Taskmaster-1 merged 5 commits into
mainfrom
feat/more-tools
Oct 31, 2026
Merged

Taskmaster-1 merged 5 commits into
mainfrom
feat/more-tools

Conversation

@Taskmaster-1

Copy link
Copy Markdown
Owner

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 (migration 0009_slack_user_token).

  • slack_search, slack_read (channel, DM or thread, with a cursor) and slack_list_channels. Message text is untrusted.
  • slack_find_user looks people up by email or by part of a name.
  • slack_post_message posts to #name, a channel id, a user (opens the DM) or a thread. It uses effect send, so it asks by default. Risk fact: "Posts as you in #channel" or "Sends a direct message as you".
  • A channel or user id seen only in Slack text the agent read is flagged as a new destination by the existing targets rule.
  • Installs without a user token keep approval DMs working and offer no Slack tools; Connections asks them to reconnect. A revoked user token turns the tools off.

Google

  • New optional scope groups: Drive (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, and drive_read, which reads Docs and Slides as text, Sheets as CSV, and PDFs or text files through extractText, paging through long files. Output is untrusted.
  • drive_create_doc turns light Markdown into a new Google Doc. It is a write and asks first.
  • contacts_search covers 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_time works from events.list on your primary calendar. freebusy.query needs a scope we don't request, so attendees' availability is reported as unknown. It handles time zones and DST.

UI

  • Tailored approval views for Slack posts and new Google Docs; PayloadView takes a tool prop.
  • Connections lists the new tools and greys out withheld ones.
  • I checked it in the browser against fake Slack and Google: Inbox, Connections, and the Slack and Doc approval cards at 1440 px, plus Inbox and Connections at 390 px with no overflow.

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.readonly is a restricted scope that needs Google verification for public apps), README and docs/api.md.

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
@Taskmaster-1
Taskmaster-1 merged commit 2c9d78f into main Oct 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant