feat(google): let gmail send and gcal book, on one reconnect - #86
Merged
Conversation
gmail could read a thread it needed to answer and never answer it, and gcal could read a calendar it could not book. Six tools close that: send_message, modify_message and trash_message on gmail, create_event, update_event and delete_event on gcal. Both scopes move in the same change because one google grant backs all three prefixes, so doing them separately would make every existing Google connection reconnect twice instead of once. gmail.readonly becomes gmail.modify, which carries send, label changes and trash in one scope. It is the same restricted tier gmail.readonly already sat in, so nothing about Google's verification changes. gcal keeps calendar.readonly and adds calendar.events beside it: calendar.events does not grant calendarList.list, so dropping the readonly scope would break list_calendars. Two executor changes the manifests needed. A base64url argument type, because messages.send takes raw in the url-safe alphabet and the base64 validator rejected - and _; it now accepts either alphabet, refuses a mix, and converts the standard one so a model that reaches for base64 still sends mail. And the fake upstream can now model a real 204, which it could not construct with a body, which is what a delete actually answers. Every field named here appears in a response example in Google's reference: Message for the gmail three, Events for create and update, and delete answers with no body at all so it declares no fields. Attendees are left out of create_event. They are an array of objects and ArgDef can hold an array of strings, so the manifest cannot express them yet. Closes #84
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.
Six write tools:
send_message,modify_messageandtrash_messageon gmail,create_event,update_eventanddelete_eventon gcal. Both scopes move in the same change on purpose, because one google grant backs all three prefixes and doing them separately would make every existing Google connection reconnect twice.gmail.readonlybecomesgmail.modify, which carries send, label changes and trash in one scope. That is the same restricted tiergmail.readonlyalready sat in, so nothing about Google's verification changes. gcal keepscalendar.readonlyand addscalendar.eventsbeside it, becausecalendar.eventsdoes not grantcalendarList.listand dropping the readonly scope would breaklist_calendars.Two executor changes the manifests needed: a
base64urlargument type, sincemessages.sendtakesrawin the url-safe alphabet and thebase64validator rejected-and_; and the fake upstream can now model a real 204, which it could not construct with a body.Closes #84
Evidence
Every field named here appears in a response example in Google's reference, checked against the docs rather than recalled:
Messagefor the gmail three (id,threadId,labelIds),Eventsfor create and update, and delete answers with no body so it declares no fields.gmail.modifycoveringmessages.sendandcalendar.eventsnot coveringcalendarList.listwere both read off the scope lists on those endpoint pages.Four tests guard the four things inferred rather than transcribed. Broken deliberately: the standard-to-url-safe conversion removed,
param: 'start.dateTime'flattened to'start', andcalendar.readonlydropped.Restored, full suite:
What I did not do
Not called against a real Google account. Every check above is against the fetch double, so
maturitystays where it was rather than being promoted on my own say-so, and the six tools are unproven against the vendor. The reconnect this forces is also untested against a live grant.Attendees are left out of
create_event: they are an array of objects andArgDefholds an array of strings, so the manifest cannot express them. That is an executor gap and wants its own issue rather than a workaround in one provider.create_eventtakes an RFC3339 stamp with an offset instead of a separate time zone argument, because one argument cannot fill bothstart.timeZoneandend.timeZone.