feat(google-calendar): wire freebusy, align tools with API v3, add calendar + sharing tools#5084
feat(google-calendar): wire freebusy, align tools with API v3, add calendar + sharing tools#5084waleedlatif1 wants to merge 6 commits into
Conversation
…lendar + sharing tools
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview New block operations & tools (v1 + v2): Check Free/Busy, Create Calendar, Share Calendar, List Sharing, Remove Sharing—wired through Event create/update: Shared Fixes / refactors: Update only sends attendees when the list is non-empty (avoids clearing invitees); invite logic consolidated into Reviewed by Cursor Bugbot for commit 56099ce. Configure here. |
Greptile SummaryThis PR wires the previously unreachable
Confidence Score: 5/5Safe to merge — all changes are additive, backwards-compatible, and follow the existing tool/block patterns precisely. The PR wires five previously unreachable or missing operations into a well-tested integration. The framework's response.ok gate in tools/index.ts correctly guards transformResponse for all new tools; the only DELETE tool (unshare_calendar) handles the 204 No-Content case explicitly. Shared utilities in utils.ts replace scattered inline logic with clearly documented, tested helpers. The two-step invite refactoring is safe because the inner fetch checks putResponse.ok before proceeding, and any thrown error is caught by the framework catch block. No schema changes, no new OAuth scopes, and all pre-existing operations continue to resolve to identical tool IDs. No files require special attention. All changed files follow the established tool/block conventions. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant UI as Block UI
participant F as Framework (tools/index.ts)
participant GC as Google Calendar API
Note over UI,GC: create / update / list (existing, now enhanced)
UI->>F: operation + params
F->>GC: "POST/PATCH/GET (with conferenceDataVersion=1 if addGoogleMeet)"
GC-->>F: 200 JSON (hangoutLink, recurrence included)
F->>F: transformResponse(response, params)
F-->>UI: "{id, htmlLink, hangoutLink?, recurrence?}"
Note over UI,GC: invite (two-step, refactored)
UI->>F: eventId + attendees
F->>GC: "GET /calendars/{id}/events/{eventId}"
GC-->>F: 200 existing event
F->>GC: "PUT /calendars/{id}/events/{eventId}?sendUpdates=all"
GC-->>F: 200 updated event
F-->>UI: "{id, attendees, ...}"
Note over UI,GC: new — freebusy (now reachable)
UI->>F: calendarIds + timeMin + timeMax
F->>GC: POST /freeBusy
GC-->>F: "200 {calendars: {id: {busy: [...]}}}"
F-->>UI: "{timeMin, timeMax, calendars}"
Note over UI,GC: new — create_calendar / share_calendar / list_acl / unshare_calendar
UI->>F: summary / role+scope / calendarId / ruleId
F->>GC: "POST /calendars or POST/GET/DELETE /calendars/{id}/acl"
GC-->>F: 200 or 204
F-->>UI: "id / role+scope / rules[] / {ruleId, deleted}"
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant UI as Block UI
participant F as Framework (tools/index.ts)
participant GC as Google Calendar API
Note over UI,GC: create / update / list (existing, now enhanced)
UI->>F: operation + params
F->>GC: "POST/PATCH/GET (with conferenceDataVersion=1 if addGoogleMeet)"
GC-->>F: 200 JSON (hangoutLink, recurrence included)
F->>F: transformResponse(response, params)
F-->>UI: "{id, htmlLink, hangoutLink?, recurrence?}"
Note over UI,GC: invite (two-step, refactored)
UI->>F: eventId + attendees
F->>GC: "GET /calendars/{id}/events/{eventId}"
GC-->>F: 200 existing event
F->>GC: "PUT /calendars/{id}/events/{eventId}?sendUpdates=all"
GC-->>F: 200 updated event
F-->>UI: "{id, attendees, ...}"
Note over UI,GC: new — freebusy (now reachable)
UI->>F: calendarIds + timeMin + timeMax
F->>GC: POST /freeBusy
GC-->>F: "200 {calendars: {id: {busy: [...]}}}"
F-->>UI: "{timeMin, timeMax, calendars}"
Note over UI,GC: new — create_calendar / share_calendar / list_acl / unshare_calendar
UI->>F: summary / role+scope / calendarId / ruleId
F->>GC: "POST /calendars or POST/GET/DELETE /calendars/{id}/acl"
GC-->>F: 200 or 204
F-->>UI: "id / role+scope / rules[] / {ruleId, deleted}"
Reviews (6): Last reviewed commit: "fix(google-calendar): validate grantee b..." | Re-trigger Greptile |
…ist_acl showDeleted usable, harden unshare error parse, clarify update attendees
|
@greptile review |
|
@cursor review |
|
@greptile review |
|
@cursor review |
…te timeZone applies to start/end
|
@greptile review |
|
@cursor review |
…arify recurrence replace semantics
|
@greptile review |
|
@cursor review |
Throw a clear error when scopeType is user/group/domain but scopeValue is missing or blank, instead of POSTing a scope-type-only body that the Calendar ACL API rejects with an opaque error.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 56099ce. Configure here.
Summary
freebusytool into the Google Calendar block (operation, tools.access for both block versions, tool switch, subBlocks) — it was registered but unreachable from the UIupdateattendee-clear footgun, consistent timezone handling, and removedanyusagelistfree-text search (q),maxResults, andpageToken(pagination was a dead-end —nextPageTokenwas returned but unusable); default ordering by start timecreateandupdate; surfacedhangoutLink/recurrenceoutputscreate_calendar,share_calendar,list_acl,unshare_calendarauth/calendarscopeType of Change
Backwards Compatibility
Testing
Tested manually;
bun run lint, typecheck, andbun run check:api-validationall passChecklist