feat(sheets,calendar): add Sheets write tools and fix Calendar updateEvent to use patch#326
feat(sheets,calendar): add Sheets write tools and fix Calendar updateEvent to use patch#326tuannvm wants to merge 4 commits intogemini-cli-extensions:mainfrom
Conversation
Signed-off-by: Tommy Nguyen <tuannvm@hotmail.com>
Signed-off-by: Tommy Nguyen <tuannvm@hotmail.com>
There was a problem hiding this comment.
Code Review
This pull request significantly expands the Google Workspace integration by adding comprehensive Google Sheets management capabilities and enhancing Google Calendar event handling. New Sheets tools include updating, appending, and clearing ranges, as well as creating spreadsheets and managing individual sheets. The Google Sheets API scope has been updated to allow write access. For Google Calendar, the service now supports adding Google Meet links and file attachments during event creation and updates. A critical improvement was identified regarding the use of the update method in the Calendar service, which performs a full resource replacement and may inadvertently delete existing event data; switching to a patch operation is recommended to ensure partial updates.
Signed-off-by: Tommy Nguyen <tuannvm@hotmail.com> # Conflicts: # workspace-server/src/__tests__/services/CalendarService.test.ts # workspace-server/src/index.ts # workspace-server/src/services/CalendarService.ts # workspace-server/src/services/SheetsService.ts
…y default Signed-off-by: Tommy Nguyen <tuannvm@hotmail.com>
Summary
Fixes #253 — Adds write tools to the Google Sheets service and fixes the Calendar
updateEventmethod to useevents.patch(partial update) instead ofevents.update(full replacement).Sheets Write Tools
Six new tools:
sheets.updateRange,sheets.appendRange,sheets.clearRange,sheets.createSpreadsheet,sheets.addSheet, andsheets.deleteSheet. Upgrades the OAuth scope fromspreadsheets.readonlytospreadsheetswhen enabled.Calendar Fix
updateEventnow usesevents.patchinstead ofevents.update, preventing existing event fields (attendees, description, etc.) from being wiped when only updating specific fields.Use Case
Sheets — write data:
sheets.updateRangewithspreadsheetId,range: "Sheet1!A1:B2", andvalues: [["Name", "Score"], ["Alice", 95]]sheets.appendRangeto add rows after the last data rowSheets — manage structure:
sheets.createSpreadsheetwithtitleand optionalsheetTitlessheets.addSheet/sheets.deleteSheetto manage tabsCalendar — safe partial updates:
calendar.updateEventwitheventIdand only the fields to change — other fields are preservedEnabling Sheets Write Tools
Write tools are disabled by default (consistent with
slides.write,tasks.read,tasks.write). To enable:This adds the
spreadsheetsscope to the OAuth flow and registers all 6 write tools. See Feature Configuration for details.Changes
updateRange,appendRange,clearRange,createSpreadsheet,addSheet, anddeleteSheetmethodsupdateEventto useevents.patchinstead ofevents.updatefor partial update semanticsregisterToolhelpersheets.writefeature group with tool names (defaultEnabled: false)sheets.writeremains in the off-by-default groupevents.patchmockTesting
All 107 relevant tests pass (CalendarService, SheetsService, feature-config).