google-mcp-suite 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -13
- package/dist/calendar/entities/CalendarListEntry.d.ts +2 -2
- package/dist/calendar/entities/Event.d.ts +2 -2
- package/dist/calendar/entities/EventDateTime.d.ts.map +1 -1
- package/dist/calendar/entities/EventDateTime.js +4 -1
- package/dist/calendar/entities/EventDateTime.js.map +1 -1
- package/dist/calendar/entities/Reminder.d.ts +2 -2
- package/dist/calendar/entities/Reminder.d.ts.map +1 -1
- package/dist/calendar/entities/Reminder.js +2 -1
- package/dist/calendar/entities/Reminder.js.map +1 -1
- package/dist/calendar/lib/event.d.ts +1 -1
- package/dist/calendar/lib/event.d.ts.map +1 -1
- package/dist/calendar/lib/event.js +2 -2
- package/dist/calendar/lib/event.js.map +1 -1
- package/dist/calendar/lib/freebusy.d.ts +11 -0
- package/dist/calendar/lib/freebusy.d.ts.map +1 -0
- package/dist/calendar/lib/freebusy.js +21 -0
- package/dist/calendar/lib/freebusy.js.map +1 -0
- package/dist/calendar/lib/suggest.d.ts +2 -0
- package/dist/calendar/lib/suggest.d.ts.map +1 -1
- package/dist/calendar/lib/suggest.js +11 -1
- package/dist/calendar/lib/suggest.js.map +1 -1
- package/dist/calendar/methods/add_calendar_entry/index.d.ts +2 -2
- package/dist/calendar/methods/add_calendar_entry/schema.d.ts +2 -2
- package/dist/calendar/methods/get_calendar_entry/index.d.ts +2 -2
- package/dist/calendar/methods/get_calendar_entry/schema.d.ts +2 -2
- package/dist/calendar/methods/list_event_instances/index.d.ts +4 -4
- package/dist/calendar/methods/list_event_instances/schema.d.ts +4 -4
- package/dist/calendar/methods/move_event/index.d.ts +2 -2
- package/dist/calendar/methods/move_event/schema.d.ts +2 -2
- package/dist/calendar/methods/patch_event/index.d.ts +2 -2
- package/dist/calendar/methods/patch_event/schema.d.ts +2 -2
- package/dist/calendar/methods/query_free_busy/handler.d.ts.map +1 -1
- package/dist/calendar/methods/query_free_busy/handler.js +1 -12
- package/dist/calendar/methods/query_free_busy/handler.js.map +1 -1
- package/dist/calendar/methods/quick_add_event/index.d.ts +2 -2
- package/dist/calendar/methods/quick_add_event/schema.d.ts +2 -2
- package/dist/calendar/methods/registry.d.ts +18 -18
- package/dist/calendar/methods/update_calendar_entry/handler.js +1 -1
- package/dist/calendar/methods/update_calendar_entry/handler.js.map +1 -1
- package/dist/calendar/methods/update_calendar_entry/index.d.ts +4 -4
- package/dist/calendar/methods/update_calendar_entry/schema.d.ts +4 -4
- package/dist/calendar/operation.d.ts +1 -1
- package/dist/calendar/operation.d.ts.map +1 -1
- package/dist/calendar/operation.js.map +1 -1
- package/dist/calendar/tools/create_event/handler.d.ts.map +1 -1
- package/dist/calendar/tools/create_event/handler.js +4 -1
- package/dist/calendar/tools/create_event/handler.js.map +1 -1
- package/dist/calendar/tools/create_event/index.d.ts +4 -4
- package/dist/calendar/tools/create_event/schema.d.ts +4 -4
- package/dist/calendar/tools/delete_event/index.d.ts +2 -2
- package/dist/calendar/tools/delete_event/schema.d.ts +2 -2
- package/dist/calendar/tools/get_event/index.d.ts +2 -2
- package/dist/calendar/tools/get_event/schema.d.ts +2 -2
- package/dist/calendar/tools/list_events/index.d.ts +4 -4
- package/dist/calendar/tools/list_events/schema.d.ts +4 -4
- package/dist/calendar/tools/registry.d.ts +18 -18
- package/dist/calendar/tools/respond_to_event/index.d.ts +2 -2
- package/dist/calendar/tools/respond_to_event/schema.d.ts +2 -2
- package/dist/calendar/tools/suggest_time/handler.d.ts.map +1 -1
- package/dist/calendar/tools/suggest_time/handler.js +2 -1
- package/dist/calendar/tools/suggest_time/handler.js.map +1 -1
- package/dist/calendar/tools/suggest_time/schema.d.ts.map +1 -1
- package/dist/calendar/tools/suggest_time/schema.js +3 -4
- package/dist/calendar/tools/suggest_time/schema.js.map +1 -1
- package/dist/calendar/tools/update_event/handler.d.ts.map +1 -1
- package/dist/calendar/tools/update_event/handler.js +4 -1
- package/dist/calendar/tools/update_event/handler.js.map +1 -1
- package/dist/calendar/tools/update_event/index.d.ts +4 -4
- package/dist/calendar/tools/update_event/schema.d.ts +4 -4
- package/dist/doctor/services.d.ts.map +1 -1
- package/dist/doctor/services.js +15 -1
- package/dist/doctor/services.js.map +1 -1
- package/dist/gmail/operation.d.ts +1 -1
- package/dist/gmail/operation.d.ts.map +1 -1
- package/dist/gmail/operation.js.map +1 -1
- package/dist/lib/operation.d.ts +4 -4
- package/dist/lib/operation.d.ts.map +1 -1
- package/dist/lib/operation.js +1 -1
- package/dist/lib/operation.js.map +1 -1
- package/dist/lib/server.d.ts +6 -5
- package/dist/lib/server.d.ts.map +1 -1
- package/dist/lib/server.js +20 -7
- package/dist/lib/server.js.map +1 -1
- package/dist/sheets/capabilities.d.ts +3 -0
- package/dist/sheets/capabilities.d.ts.map +1 -0
- package/dist/sheets/capabilities.js +15 -0
- package/dist/sheets/capabilities.js.map +1 -0
- package/dist/sheets/entities/CellValue.d.ts +14 -0
- package/dist/sheets/entities/CellValue.d.ts.map +1 -0
- package/dist/sheets/entities/CellValue.js +15 -0
- package/dist/sheets/entities/CellValue.js.map +1 -0
- package/dist/sheets/entities/DataFilter.d.ts +57 -0
- package/dist/sheets/entities/DataFilter.d.ts.map +1 -0
- package/dist/sheets/entities/DataFilter.js +15 -0
- package/dist/sheets/entities/DataFilter.js.map +1 -0
- package/dist/sheets/entities/DataFilterValueRange.d.ts +64 -0
- package/dist/sheets/entities/DataFilterValueRange.d.ts.map +1 -0
- package/dist/sheets/entities/DataFilterValueRange.js +18 -0
- package/dist/sheets/entities/DataFilterValueRange.js.map +1 -0
- package/dist/sheets/entities/DateTimeRenderOption.d.ts +13 -0
- package/dist/sheets/entities/DateTimeRenderOption.d.ts.map +1 -0
- package/dist/sheets/entities/DateTimeRenderOption.js +11 -0
- package/dist/sheets/entities/DateTimeRenderOption.js.map +1 -0
- package/dist/sheets/entities/DeveloperMetadata.d.ts +40 -0
- package/dist/sheets/entities/DeveloperMetadata.d.ts.map +1 -0
- package/dist/sheets/entities/DeveloperMetadata.js +28 -0
- package/dist/sheets/entities/DeveloperMetadata.js.map +1 -0
- package/dist/sheets/entities/DeveloperMetadataLocation.d.ts +28 -0
- package/dist/sheets/entities/DeveloperMetadataLocation.d.ts.map +1 -0
- package/dist/sheets/entities/DeveloperMetadataLocation.js +25 -0
- package/dist/sheets/entities/DeveloperMetadataLocation.js.map +1 -0
- package/dist/sheets/entities/DeveloperMetadataLookup.d.ts +48 -0
- package/dist/sheets/entities/DeveloperMetadataLookup.d.ts.map +1 -0
- package/dist/sheets/entities/DeveloperMetadataLookup.js +38 -0
- package/dist/sheets/entities/DeveloperMetadataLookup.js.map +1 -0
- package/dist/sheets/entities/DimensionRange.d.ts +18 -0
- package/dist/sheets/entities/DimensionRange.d.ts.map +1 -0
- package/dist/sheets/entities/DimensionRange.js +22 -0
- package/dist/sheets/entities/DimensionRange.js.map +1 -0
- package/dist/sheets/entities/GridProperties.d.ts +16 -0
- package/dist/sheets/entities/GridProperties.d.ts.map +1 -0
- package/dist/sheets/entities/GridProperties.js +23 -0
- package/dist/sheets/entities/GridProperties.js.map +1 -0
- package/dist/sheets/entities/GridRange.d.ts +17 -0
- package/dist/sheets/entities/GridRange.d.ts.map +1 -0
- package/dist/sheets/entities/GridRange.js +32 -0
- package/dist/sheets/entities/GridRange.js.map +1 -0
- package/dist/sheets/entities/MajorDimension.d.ts +13 -0
- package/dist/sheets/entities/MajorDimension.d.ts.map +1 -0
- package/dist/sheets/entities/MajorDimension.js +11 -0
- package/dist/sheets/entities/MajorDimension.js.map +1 -0
- package/dist/sheets/entities/MatchedValueRange.d.ts +67 -0
- package/dist/sheets/entities/MatchedValueRange.d.ts.map +1 -0
- package/dist/sheets/entities/MatchedValueRange.js +17 -0
- package/dist/sheets/entities/MatchedValueRange.js.map +1 -0
- package/dist/sheets/entities/SheetProperties.d.ts +28 -0
- package/dist/sheets/entities/SheetProperties.d.ts.map +1 -0
- package/dist/sheets/entities/SheetProperties.js +32 -0
- package/dist/sheets/entities/SheetProperties.js.map +1 -0
- package/dist/sheets/entities/Spreadsheet.d.ts +44 -0
- package/dist/sheets/entities/Spreadsheet.d.ts.map +1 -0
- package/dist/sheets/entities/Spreadsheet.js +23 -0
- package/dist/sheets/entities/Spreadsheet.js.map +1 -0
- package/dist/sheets/entities/SpreadsheetProperties.d.ts +20 -0
- package/dist/sheets/entities/SpreadsheetProperties.d.ts.map +1 -0
- package/dist/sheets/entities/SpreadsheetProperties.js +24 -0
- package/dist/sheets/entities/SpreadsheetProperties.js.map +1 -0
- package/dist/sheets/entities/UpdateValuesByDataFilterResponse.d.ts +72 -0
- package/dist/sheets/entities/UpdateValuesByDataFilterResponse.d.ts.map +1 -0
- package/dist/sheets/entities/UpdateValuesByDataFilterResponse.js +30 -0
- package/dist/sheets/entities/UpdateValuesByDataFilterResponse.js.map +1 -0
- package/dist/sheets/entities/UpdateValuesResponse.d.ts +25 -0
- package/dist/sheets/entities/UpdateValuesResponse.d.ts.map +1 -0
- package/dist/sheets/entities/UpdateValuesResponse.js +29 -0
- package/dist/sheets/entities/UpdateValuesResponse.js.map +1 -0
- package/dist/sheets/entities/ValueInputOption.d.ts +14 -0
- package/dist/sheets/entities/ValueInputOption.d.ts.map +1 -0
- package/dist/sheets/entities/ValueInputOption.js +12 -0
- package/dist/sheets/entities/ValueInputOption.js.map +1 -0
- package/dist/sheets/entities/ValueRange.d.ts +17 -0
- package/dist/sheets/entities/ValueRange.d.ts.map +1 -0
- package/dist/sheets/entities/ValueRange.js +21 -0
- package/dist/sheets/entities/ValueRange.js.map +1 -0
- package/dist/sheets/entities/ValueRenderOption.d.ts +14 -0
- package/dist/sheets/entities/ValueRenderOption.d.ts.map +1 -0
- package/dist/sheets/entities/ValueRenderOption.js +11 -0
- package/dist/sheets/entities/ValueRenderOption.js.map +1 -0
- package/dist/sheets/index.d.ts +3 -0
- package/dist/sheets/index.d.ts.map +1 -0
- package/dist/sheets/index.js +22 -0
- package/dist/sheets/index.js.map +1 -0
- package/dist/sheets/lib/enums.d.ts +8 -0
- package/dist/sheets/lib/enums.d.ts.map +1 -0
- package/dist/sheets/lib/enums.js +10 -0
- package/dist/sheets/lib/enums.js.map +1 -0
- package/dist/sheets/lib/filters.d.ts +10 -0
- package/dist/sheets/lib/filters.d.ts.map +1 -0
- package/dist/sheets/lib/filters.js +82 -0
- package/dist/sheets/lib/filters.js.map +1 -0
- package/dist/sheets/lib/metadata.d.ts +5 -0
- package/dist/sheets/lib/metadata.d.ts.map +1 -0
- package/dist/sheets/lib/metadata.js +13 -0
- package/dist/sheets/lib/metadata.js.map +1 -0
- package/dist/sheets/lib/spreadsheet.d.ts +12 -0
- package/dist/sheets/lib/spreadsheet.d.ts.map +1 -0
- package/dist/sheets/lib/spreadsheet.js +42 -0
- package/dist/sheets/lib/spreadsheet.js.map +1 -0
- package/dist/sheets/lib/values.d.ts +13 -0
- package/dist/sheets/lib/values.d.ts.map +1 -0
- package/dist/sheets/lib/values.js +26 -0
- package/dist/sheets/lib/values.js.map +1 -0
- package/dist/sheets/methods/append_values/handler.d.ts +5 -0
- package/dist/sheets/methods/append_values/handler.d.ts.map +1 -0
- package/dist/sheets/methods/append_values/handler.js +23 -0
- package/dist/sheets/methods/append_values/handler.js.map +1 -0
- package/dist/sheets/methods/append_values/index.d.ts +52 -0
- package/dist/sheets/methods/append_values/index.d.ts.map +1 -0
- package/dist/sheets/methods/append_values/index.js +15 -0
- package/dist/sheets/methods/append_values/index.js.map +1 -0
- package/dist/sheets/methods/append_values/schema.d.ts +51 -0
- package/dist/sheets/methods/append_values/schema.d.ts.map +1 -0
- package/dist/sheets/methods/append_values/schema.js +40 -0
- package/dist/sheets/methods/append_values/schema.js.map +1 -0
- package/dist/sheets/methods/batch_clear_values/handler.d.ts +5 -0
- package/dist/sheets/methods/batch_clear_values/handler.d.ts.map +1 -0
- package/dist/sheets/methods/batch_clear_values/handler.js +11 -0
- package/dist/sheets/methods/batch_clear_values/handler.js.map +1 -0
- package/dist/sheets/methods/batch_clear_values/index.d.ts +14 -0
- package/dist/sheets/methods/batch_clear_values/index.d.ts.map +1 -0
- package/dist/sheets/methods/batch_clear_values/index.js +16 -0
- package/dist/sheets/methods/batch_clear_values/index.js.map +1 -0
- package/dist/sheets/methods/batch_clear_values/schema.d.ts +13 -0
- package/dist/sheets/methods/batch_clear_values/schema.d.ts.map +1 -0
- package/dist/sheets/methods/batch_clear_values/schema.js +19 -0
- package/dist/sheets/methods/batch_clear_values/schema.js.map +1 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/handler.d.ts +5 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/handler.d.ts.map +1 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/handler.js +12 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/handler.js.map +1 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/index.d.ts +61 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/index.d.ts.map +1 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/index.js +16 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/index.js.map +1 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/schema.d.ts +60 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/schema.d.ts.map +1 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/schema.js +20 -0
- package/dist/sheets/methods/batch_clear_values_by_data_filter/schema.js.map +1 -0
- package/dist/sheets/methods/batch_get_values/handler.d.ts +5 -0
- package/dist/sheets/methods/batch_get_values/handler.d.ts.map +1 -0
- package/dist/sheets/methods/batch_get_values/handler.js +16 -0
- package/dist/sheets/methods/batch_get_values/handler.js.map +1 -0
- package/dist/sheets/methods/batch_get_values/index.d.ts +29 -0
- package/dist/sheets/methods/batch_get_values/index.d.ts.map +1 -0
- package/dist/sheets/methods/batch_get_values/index.js +10 -0
- package/dist/sheets/methods/batch_get_values/index.js.map +1 -0
- package/dist/sheets/methods/batch_get_values/schema.d.ts +33 -0
- package/dist/sheets/methods/batch_get_values/schema.d.ts.map +1 -0
- package/dist/sheets/methods/batch_get_values/schema.js +25 -0
- package/dist/sheets/methods/batch_get_values/schema.js.map +1 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/handler.d.ts +5 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/handler.d.ts.map +1 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/handler.js +22 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/handler.js.map +1 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/index.d.ts +126 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/index.d.ts.map +1 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/index.js +10 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/index.js.map +1 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/schema.d.ts +130 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/schema.d.ts.map +1 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/schema.js +26 -0
- package/dist/sheets/methods/batch_get_values_by_data_filter/schema.js.map +1 -0
- package/dist/sheets/methods/batch_update_values/handler.d.ts +5 -0
- package/dist/sheets/methods/batch_update_values/handler.d.ts.map +1 -0
- package/dist/sheets/methods/batch_update_values/handler.js +23 -0
- package/dist/sheets/methods/batch_update_values/handler.js.map +1 -0
- package/dist/sheets/methods/batch_update_values/index.d.ts +48 -0
- package/dist/sheets/methods/batch_update_values/index.d.ts.map +1 -0
- package/dist/sheets/methods/batch_update_values/index.js +10 -0
- package/dist/sheets/methods/batch_update_values/index.js.map +1 -0
- package/dist/sheets/methods/batch_update_values/schema.d.ts +52 -0
- package/dist/sheets/methods/batch_update_values/schema.d.ts.map +1 -0
- package/dist/sheets/methods/batch_update_values/schema.js +46 -0
- package/dist/sheets/methods/batch_update_values/schema.js.map +1 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/handler.d.ts +5 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/handler.d.ts.map +1 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/handler.js +35 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/handler.js.map +1 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/index.d.ts +142 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/index.d.ts.map +1 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/index.js +10 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/index.js.map +1 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/schema.d.ts +146 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/schema.d.ts.map +1 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/schema.js +46 -0
- package/dist/sheets/methods/batch_update_values_by_data_filter/schema.js.map +1 -0
- package/dist/sheets/methods/clear_values/handler.d.ts +5 -0
- package/dist/sheets/methods/clear_values/handler.d.ts.map +1 -0
- package/dist/sheets/methods/clear_values/handler.js +12 -0
- package/dist/sheets/methods/clear_values/handler.js.map +1 -0
- package/dist/sheets/methods/clear_values/index.d.ts +14 -0
- package/dist/sheets/methods/clear_values/index.d.ts.map +1 -0
- package/dist/sheets/methods/clear_values/index.js +16 -0
- package/dist/sheets/methods/clear_values/index.js.map +1 -0
- package/dist/sheets/methods/clear_values/schema.d.ts +13 -0
- package/dist/sheets/methods/clear_values/schema.d.ts.map +1 -0
- package/dist/sheets/methods/clear_values/schema.js +16 -0
- package/dist/sheets/methods/clear_values/schema.js.map +1 -0
- package/dist/sheets/methods/copy_sheet/handler.d.ts +5 -0
- package/dist/sheets/methods/copy_sheet/handler.d.ts.map +1 -0
- package/dist/sheets/methods/copy_sheet/handler.js +10 -0
- package/dist/sheets/methods/copy_sheet/handler.js.map +1 -0
- package/dist/sheets/methods/copy_sheet/index.d.ts +28 -0
- package/dist/sheets/methods/copy_sheet/index.d.ts.map +1 -0
- package/dist/sheets/methods/copy_sheet/index.js +15 -0
- package/dist/sheets/methods/copy_sheet/index.js.map +1 -0
- package/dist/sheets/methods/copy_sheet/schema.d.ts +27 -0
- package/dist/sheets/methods/copy_sheet/schema.d.ts.map +1 -0
- package/dist/sheets/methods/copy_sheet/schema.js +14 -0
- package/dist/sheets/methods/copy_sheet/schema.js.map +1 -0
- package/dist/sheets/methods/create_spreadsheet/handler.d.ts +5 -0
- package/dist/sheets/methods/create_spreadsheet/handler.d.ts.map +1 -0
- package/dist/sheets/methods/create_spreadsheet/handler.js +16 -0
- package/dist/sheets/methods/create_spreadsheet/handler.js.map +1 -0
- package/dist/sheets/methods/create_spreadsheet/index.d.ts +46 -0
- package/dist/sheets/methods/create_spreadsheet/index.d.ts.map +1 -0
- package/dist/sheets/methods/create_spreadsheet/index.js +16 -0
- package/dist/sheets/methods/create_spreadsheet/index.js.map +1 -0
- package/dist/sheets/methods/create_spreadsheet/schema.d.ts +50 -0
- package/dist/sheets/methods/create_spreadsheet/schema.d.ts.map +1 -0
- package/dist/sheets/methods/create_spreadsheet/schema.js +28 -0
- package/dist/sheets/methods/create_spreadsheet/schema.js.map +1 -0
- package/dist/sheets/methods/get_developer_metadata/handler.d.ts +5 -0
- package/dist/sheets/methods/get_developer_metadata/handler.d.ts.map +1 -0
- package/dist/sheets/methods/get_developer_metadata/handler.js +9 -0
- package/dist/sheets/methods/get_developer_metadata/handler.js.map +1 -0
- package/dist/sheets/methods/get_developer_metadata/index.d.ts +33 -0
- package/dist/sheets/methods/get_developer_metadata/index.d.ts.map +1 -0
- package/dist/sheets/methods/get_developer_metadata/index.js +10 -0
- package/dist/sheets/methods/get_developer_metadata/index.js.map +1 -0
- package/dist/sheets/methods/get_developer_metadata/schema.d.ts +37 -0
- package/dist/sheets/methods/get_developer_metadata/schema.d.ts.map +1 -0
- package/dist/sheets/methods/get_developer_metadata/schema.js +11 -0
- package/dist/sheets/methods/get_developer_metadata/schema.js.map +1 -0
- package/dist/sheets/methods/get_spreadsheet/handler.d.ts +5 -0
- package/dist/sheets/methods/get_spreadsheet/handler.d.ts.map +1 -0
- package/dist/sheets/methods/get_spreadsheet/handler.js +6 -0
- package/dist/sheets/methods/get_spreadsheet/handler.js.map +1 -0
- package/dist/sheets/methods/get_spreadsheet/index.d.ts +42 -0
- package/dist/sheets/methods/get_spreadsheet/index.d.ts.map +1 -0
- package/dist/sheets/methods/get_spreadsheet/index.js +17 -0
- package/dist/sheets/methods/get_spreadsheet/index.js.map +1 -0
- package/dist/sheets/methods/get_spreadsheet/schema.d.ts +39 -0
- package/dist/sheets/methods/get_spreadsheet/schema.d.ts.map +1 -0
- package/dist/sheets/methods/get_spreadsheet/schema.js +10 -0
- package/dist/sheets/methods/get_spreadsheet/schema.js.map +1 -0
- package/dist/sheets/methods/get_values/handler.d.ts +5 -0
- package/dist/sheets/methods/get_values/handler.d.ts.map +1 -0
- package/dist/sheets/methods/get_values/handler.js +13 -0
- package/dist/sheets/methods/get_values/handler.js.map +1 -0
- package/dist/sheets/methods/get_values/index.d.ts +26 -0
- package/dist/sheets/methods/get_values/index.d.ts.map +1 -0
- package/dist/sheets/methods/get_values/index.js +10 -0
- package/dist/sheets/methods/get_values/index.js.map +1 -0
- package/dist/sheets/methods/get_values/schema.d.ts +30 -0
- package/dist/sheets/methods/get_values/schema.d.ts.map +1 -0
- package/dist/sheets/methods/get_values/schema.js +19 -0
- package/dist/sheets/methods/get_values/schema.js.map +1 -0
- package/dist/sheets/methods/registry.d.ts +775 -0
- package/dist/sheets/methods/registry.d.ts.map +1 -0
- package/dist/sheets/methods/registry.js +45 -0
- package/dist/sheets/methods/registry.js.map +1 -0
- package/dist/sheets/methods/search_developer_metadata/handler.d.ts +5 -0
- package/dist/sheets/methods/search_developer_metadata/handler.d.ts.map +1 -0
- package/dist/sheets/methods/search_developer_metadata/handler.js +17 -0
- package/dist/sheets/methods/search_developer_metadata/handler.js.map +1 -0
- package/dist/sheets/methods/search_developer_metadata/index.d.ts +132 -0
- package/dist/sheets/methods/search_developer_metadata/index.d.ts.map +1 -0
- package/dist/sheets/methods/search_developer_metadata/index.js +10 -0
- package/dist/sheets/methods/search_developer_metadata/index.js.map +1 -0
- package/dist/sheets/methods/search_developer_metadata/schema.d.ts +136 -0
- package/dist/sheets/methods/search_developer_metadata/schema.d.ts.map +1 -0
- package/dist/sheets/methods/search_developer_metadata/schema.js +25 -0
- package/dist/sheets/methods/search_developer_metadata/schema.js.map +1 -0
- package/dist/sheets/methods/update_values/handler.d.ts +5 -0
- package/dist/sheets/methods/update_values/handler.d.ts.map +1 -0
- package/dist/sheets/methods/update_values/handler.js +18 -0
- package/dist/sheets/methods/update_values/handler.js.map +1 -0
- package/dist/sheets/methods/update_values/index.d.ts +39 -0
- package/dist/sheets/methods/update_values/index.d.ts.map +1 -0
- package/dist/sheets/methods/update_values/index.js +10 -0
- package/dist/sheets/methods/update_values/index.js.map +1 -0
- package/dist/sheets/methods/update_values/schema.d.ts +43 -0
- package/dist/sheets/methods/update_values/schema.d.ts.map +1 -0
- package/dist/sheets/methods/update_values/schema.js +29 -0
- package/dist/sheets/methods/update_values/schema.js.map +1 -0
- package/dist/sheets/operation.d.ts +12 -0
- package/dist/sheets/operation.d.ts.map +1 -0
- package/dist/sheets/operation.js +10 -0
- package/dist/sheets/operation.js.map +1 -0
- package/package.json +9 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { forGoogle } from '../../../lib/google.js';
|
|
2
|
+
import { busyPeriods } from '../../lib/freebusy.js';
|
|
2
3
|
import { suggestSlots } from '../../lib/suggest.js';
|
|
3
4
|
export async function handler(calendar, args) {
|
|
4
5
|
const { data } = await calendar.freebusy.query({
|
|
@@ -21,7 +22,7 @@ export async function handler(calendar, args) {
|
|
|
21
22
|
if (unreadable.length > 0) {
|
|
22
23
|
throw new Error(`Free/busy is unavailable for ${unreadable.join(', ')}; suggestions would ignore those calendars' events. Check the calendar ids and their sharing, then retry.`);
|
|
23
24
|
}
|
|
24
|
-
const busy = Object.values(calendars).flatMap(
|
|
25
|
+
const busy = Object.values(calendars).flatMap(busyPeriods);
|
|
25
26
|
return {
|
|
26
27
|
timeSlots: suggestSlots({
|
|
27
28
|
busy,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/calendar/tools/suggest_time/handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,QAA8B,EAC9B,IAAkC;IAElC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC7C,WAAW,EAAE,SAAS,CAAC;YACrB,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,uEAAuE;YACvE,mDAAmD;YACnD,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;SACjD,CAAC;KACH,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC;IACvC,yEAAyE;IACzE,wEAAwE;IACxE,8EAA8E;IAC9E,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;SACzC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SACtD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IACrB,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,gCAAgC,UAAU,CAAC,IAAI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AAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,gCAAgC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,2GAA2G,CACjK,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3D,OAAO;QACL,SAAS,EAAE,YAAY,CAAC;YACtB,IAAI;YACJ,WAAW,EAAE,IAAI,CAAC,SAAS;YAC3B,SAAS,EAAE,IAAI,CAAC,OAAO;YACvB,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,EAAE;YAC3C,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import type { calendar_v3 } from '@googleapis/calendar';\nimport type { z } from 'zod';\nimport { forGoogle } from '../../../lib/google.js';\nimport { busyPeriods } from '../../lib/freebusy.js';\nimport { suggestSlots } from '../../lib/suggest.js';\nimport type { schema } from './schema.js';\n\nexport async function handler(\n calendar: calendar_v3.Calendar,\n args: z.infer<typeof schema.input>,\n): Promise<z.infer<typeof schema.output>> {\n const { data } = await calendar.freebusy.query({\n requestBody: forGoogle({\n timeMin: args.startTime,\n timeMax: args.endTime,\n timeZone: args.timeZone,\n // The literal 'primary' entry passes straight through; Google resolves\n // it to the authenticated user's primary calendar.\n items: args.attendeeEmails.map((id) => ({ id })),\n }),\n });\n const calendars = data.calendars ?? {};\n // A calendar that reports errors (unknown id, not shared) contributes no\n // busy intervals, so suggesting from the rest would confidently propose\n // slots that conflict with it. Refuse instead of answering from partial data.\n const unreadable = Object.entries(calendars)\n .filter(([, entry]) => (entry.errors ?? []).length > 0)\n .map(([id]) => id);\n if (unreadable.length > 0) {\n throw new Error(\n `Free/busy is unavailable for ${unreadable.join(', ')}; suggestions would ignore those calendars' events. Check the calendar ids and their sharing, then retry.`,\n );\n }\n const busy = Object.values(calendars).flatMap(busyPeriods);\n return {\n timeSlots: suggestSlots({\n busy,\n windowStart: args.startTime,\n windowEnd: args.endTime,\n durationMinutes: args.durationMinutes ?? 30,\n timeZone: args.timeZone,\n preferences: args.preferences,\n }),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/calendar/tools/suggest_time/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/calendar/tools/suggest_time/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,4GAA4G;AAC5G,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;CAwElB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
const hourOfDay = /^([01]\d|2[0-3]):[0-5]\d$/;
|
|
2
|
+
import { HOUR_OF_DAY } from '../../lib/suggest.js';
|
|
4
3
|
/** Source: https://developers.google.com/workspace/calendar/api/v3/reference/mcp/tools_list/suggest_time */
|
|
5
4
|
export const schema = {
|
|
6
5
|
input: z.object({
|
|
@@ -27,12 +26,12 @@ export const schema = {
|
|
|
27
26
|
.object({
|
|
28
27
|
startHour: z
|
|
29
28
|
.string()
|
|
30
|
-
.regex(
|
|
29
|
+
.regex(HOUR_OF_DAY, 'Expected an HH:MM hour of day, for example 09:00.')
|
|
31
30
|
.optional()
|
|
32
31
|
.describe('The preferred start hour of day, as HH:MM (for example 09:00).'),
|
|
33
32
|
endHour: z
|
|
34
33
|
.string()
|
|
35
|
-
.regex(
|
|
34
|
+
.regex(HOUR_OF_DAY, 'Expected an HH:MM hour of day, for example 17:00.')
|
|
36
35
|
.optional()
|
|
37
36
|
.describe('The preferred end hour of day, as HH:MM (for example 17:00).'),
|
|
38
37
|
excludeWeekends: z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/calendar/tools/suggest_time/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/calendar/tools/suggest_time/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,4GAA4G;AAC5G,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,cAAc,EAAE,CAAC;aACd,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,CACP,yHAAyH,CAC1H;QACH,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,QAAQ,CAAC,oEAAoE,CAAC;QACjF,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,QAAQ,CAAC,kEAAkE,CAAC;QAC/E,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,wJAAwJ,CACzJ;QACH,eAAe,EAAE,CAAC;aACf,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,EAAE;aACV,QAAQ,CACP,wGAAwG,CACzG;QACH,WAAW,EAAE,CAAC;aACX,MAAM,CAAC;YACN,SAAS,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,KAAK,CAAC,WAAW,EAAE,mDAAmD,CAAC;iBACvE,QAAQ,EAAE;iBACV,QAAQ,CAAC,gEAAgE,CAAC;YAC7E,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,KAAK,CAAC,WAAW,EAAE,mDAAmD,CAAC;iBACvE,QAAQ,EAAE;iBACV,QAAQ,CAAC,8DAA8D,CAAC;YAC3E,eAAe,EAAE,CAAC;iBACf,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,QAAQ,CAAC,sDAAsD,CAAC;YACnE,QAAQ,EAAE,CAAC;iBACR,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,QAAQ,EAAE;iBACV,GAAG,CAAC,EAAE,CAAC;iBACP,QAAQ,EAAE;iBACV,QAAQ,CAAC,6DAA6D,CAAC;SAC3E,CAAC;aACD,QAAQ,EAAE;aACV,QAAQ,CAAC,sEAAsE,CAAC;KACpF,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,SAAS,EAAE,CAAC;aACT,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;YACP,SAAS,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,QAAQ,CAAC,iEAAiE,CAAC;YAC9E,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,QAAQ,CAAC,+DAA+D,CAAC;YAC5E,eAAe,EAAE,CAAC;iBACf,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,QAAQ,CAAC,gDAAgD,CAAC;SAC9D,CAAC,CACH;aACA,QAAQ,CAAC,wDAAwD,CAAC;KACtE,CAAC;CACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport { HOUR_OF_DAY } from '../../lib/suggest.js';\n\n/** Source: https://developers.google.com/workspace/calendar/api/v3/reference/mcp/tools_list/suggest_time */\nexport const schema = {\n input: z.object({\n attendeeEmails: z\n .array(z.string())\n .describe(\n \"The attendee emails to find free time for. Include the literal 'primary' for the authenticated user's primary calendar.\",\n ),\n startTime: z\n .string()\n .describe('The start of the interval for the query, as an ISO 8601 timestamp.'),\n endTime: z\n .string()\n .describe('The end of the interval for the query, as an ISO 8601 timestamp.'),\n timeZone: z\n .string()\n .optional()\n .describe(\n 'Time zone used for the working-hour and weekend preferences, as an IANA Time Zone Database name (for example America/Los_Angeles). The default is UTC.',\n ),\n durationMinutes: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Minimum duration of a free time slot in minutes (default 30); suggested slots are exactly this length.',\n ),\n preferences: z\n .object({\n startHour: z\n .string()\n .regex(HOUR_OF_DAY, 'Expected an HH:MM hour of day, for example 09:00.')\n .optional()\n .describe('The preferred start hour of day, as HH:MM (for example 09:00).'),\n endHour: z\n .string()\n .regex(HOUR_OF_DAY, 'Expected an HH:MM hour of day, for example 17:00.')\n .optional()\n .describe('The preferred end hour of day, as HH:MM (for example 17:00).'),\n excludeWeekends: z\n .boolean()\n .optional()\n .describe('Whether to exclude weekends (Saturdays and Sundays).'),\n pageSize: z\n .number()\n .int()\n .positive()\n .max(50)\n .optional()\n .describe('Maximum number of time slots to return (default 5, max 50).'),\n })\n .optional()\n .describe('Scheduling preferences narrowing where the suggested slots may fall.'),\n }),\n output: z.object({\n timeSlots: z\n .array(\n z.object({\n startTime: z\n .string()\n .describe('The start time of the free time slot, as an ISO 8601 timestamp.'),\n endTime: z\n .string()\n .describe('The end time of the free time slot, as an ISO 8601 timestamp.'),\n durationMinutes: z\n .number()\n .int()\n .describe('The duration of the free time slot in minutes.'),\n }),\n )\n .describe('The suggested free time slots, in chronological order.'),\n }),\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/calendar/tools/update_event/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQ7B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAsB1C,wBAAsB,OAAO,CAC3B,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAC9B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,GACjC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/calendar/tools/update_event/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQ7B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAsB1C,wBAAsB,OAAO,CAC3B,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAC9B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,GACjC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAkCxC"}
|
|
@@ -38,7 +38,10 @@ export async function handler(calendar, args) {
|
|
|
38
38
|
end: args.endTime === undefined ? undefined : buildEventDateTime({ dateTime: args.endTime }),
|
|
39
39
|
attendees,
|
|
40
40
|
reminders: args.overrideReminders
|
|
41
|
-
? {
|
|
41
|
+
? {
|
|
42
|
+
useDefault: false,
|
|
43
|
+
overrides: args.overrideReminders.map((reminder) => forGoogle(reminder)),
|
|
44
|
+
}
|
|
42
45
|
: undefined,
|
|
43
46
|
conferenceData,
|
|
44
47
|
visibility: args.visibility,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/calendar/tools/update_event/handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB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S,EAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;iBACzE;gBACH,CAAC,CAAC,SAAS;YACb,cAAc;YACd,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;KACH,CAAC,CACH,CAAC;IACF,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import type { calendar_v3 } from '@googleapis/calendar';\nimport type { z } from 'zod';\nimport { forGoogle } from '../../../lib/google.js';\nimport type { Optional } from '../../../lib/types.js';\nimport { applyAttendeeDeltas } from '../../lib/attendees.js';\nimport { buildEventDateTime } from '../../lib/datetime.js';\nimport { projectEvent } from '../../lib/event.js';\nimport { meetConferenceData } from '../../lib/meet.js';\nimport { toSendUpdates } from '../../lib/notifications.js';\nimport type { schema } from './schema.js';\n\n/**\n * The patched guest list: when either attendee delta is given, read the\n * event's current attendees and apply the deltas; otherwise leave the guest\n * list out of the patch entirely.\n */\nasync function patchedAttendees(\n calendar: calendar_v3.Calendar,\n calendarId: string,\n args: z.infer<typeof schema.input>,\n): Promise<Optional<calendar_v3.Schema$EventAttendee[]>> {\n if (args.addedAttendeeEmails === undefined && args.removedAttendeeEmails === undefined) {\n return undefined;\n }\n const { data } = await calendar.events.get({ calendarId, eventId: args.eventId });\n return applyAttendeeDeltas(data.attendees ?? [], {\n added: args.addedAttendeeEmails,\n removed: args.removedAttendeeEmails,\n });\n}\n\nexport async function handler(\n calendar: calendar_v3.Calendar,\n args: z.infer<typeof schema.input>,\n): Promise<z.infer<typeof schema.output>> {\n const calendarId = args.calendarId ?? 'primary';\n const attendees = await patchedAttendees(calendar, calendarId, args);\n const conferenceData = meetConferenceData(args);\n const { data } = await calendar.events.patch(\n forGoogle({\n calendarId,\n eventId: args.eventId,\n sendUpdates: toSendUpdates(args.notificationLevel),\n conferenceDataVersion: conferenceData === undefined ? undefined : 1,\n requestBody: forGoogle({\n summary: args.summary,\n description: args.description,\n location: args.location,\n start:\n args.startTime === undefined\n ? undefined\n : buildEventDateTime({ dateTime: args.startTime }),\n end:\n args.endTime === undefined ? undefined : buildEventDateTime({ dateTime: args.endTime }),\n attendees,\n reminders: args.overrideReminders\n ? {\n useDefault: false,\n overrides: args.overrideReminders.map((reminder) => forGoogle(reminder)),\n }\n : undefined,\n conferenceData,\n visibility: args.visibility,\n colorId: args.colorId,\n }),\n }),\n );\n return projectEvent(data);\n}\n"]}
|
|
@@ -17,10 +17,10 @@ export declare const update_event: import("../../../lib/operation.js").Operation
|
|
|
17
17
|
addedAttendeeEmails: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
18
18
|
removedAttendeeEmails: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
19
19
|
overrideReminders: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
20
|
-
method: import("zod").ZodEnum<{
|
|
20
|
+
method: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
21
21
|
email: "email";
|
|
22
22
|
popup: "popup";
|
|
23
|
-
}
|
|
23
|
+
}>>;
|
|
24
24
|
minutes: import("zod").ZodNumber;
|
|
25
25
|
}, import("zod/v4/core").$strip>>>;
|
|
26
26
|
notificationLevel: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
@@ -90,10 +90,10 @@ export declare const update_event: import("../../../lib/operation.js").Operation
|
|
|
90
90
|
conferenceUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
91
91
|
colorId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
92
92
|
overrideReminders: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
93
|
-
method: import("zod").ZodEnum<{
|
|
93
|
+
method: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
94
94
|
email: "email";
|
|
95
95
|
popup: "popup";
|
|
96
|
-
}
|
|
96
|
+
}>>;
|
|
97
97
|
minutes: import("zod").ZodNumber;
|
|
98
98
|
}, import("zod/v4/core").$strip>>>;
|
|
99
99
|
}, import("zod/v4/core").$strip>>;
|
|
@@ -12,10 +12,10 @@ export declare const schema: {
|
|
|
12
12
|
addedAttendeeEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
13
13
|
removedAttendeeEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
14
|
overrideReminders: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
-
method: z.ZodEnum<{
|
|
15
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
16
16
|
email: "email";
|
|
17
17
|
popup: "popup";
|
|
18
|
-
}
|
|
18
|
+
}>>;
|
|
19
19
|
minutes: z.ZodNumber;
|
|
20
20
|
}, z.core.$strip>>>;
|
|
21
21
|
notificationLevel: z.ZodOptional<z.ZodEnum<{
|
|
@@ -86,10 +86,10 @@ export declare const schema: {
|
|
|
86
86
|
conferenceUrl: z.ZodOptional<z.ZodString>;
|
|
87
87
|
colorId: z.ZodOptional<z.ZodString>;
|
|
88
88
|
overrideReminders: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
89
|
-
method: z.ZodEnum<{
|
|
89
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
90
90
|
email: "email";
|
|
91
91
|
popup: "popup";
|
|
92
|
-
}
|
|
92
|
+
}>>;
|
|
93
93
|
minutes: z.ZodNumber;
|
|
94
94
|
}, z.core.$strip>>>;
|
|
95
95
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/doctor/services.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/doctor/services.ts"],"names":[],"mappings":"AAkBA,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEhE,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CAAC;AA+BF,eAAO,MAAM,QAAQ,EAAE,WAAW,EAkCjC,CAAC;AAEF,iEAAiE;AACjE,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC;AAED,wEAAwE;AACxE,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EAAE,EACnB,QAAQ,GAAE,MAAM,EAAqB,GACpC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAOxC"}
|
package/dist/doctor/services.js
CHANGED
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { calendar } from '@googleapis/calendar';
|
|
15
15
|
import { gmail } from '@googleapis/gmail';
|
|
16
|
+
import { sheets } from '@googleapis/sheets';
|
|
16
17
|
import { authorizedClient } from '../auth/oauth.js';
|
|
18
|
+
// Probe API versions duplicate each service's index.ts on purpose (doctor never
|
|
19
|
+
// imports service internals); when a service moves versions, move its probe too.
|
|
17
20
|
async function gmailProbe(account) {
|
|
18
21
|
const client = gmail({ version: 'v1', auth: await authorizedClient(account) });
|
|
19
22
|
const res = await client.users.getProfile({ userId: 'me' });
|
|
@@ -24,6 +27,16 @@ async function calendarProbe(account) {
|
|
|
24
27
|
const res = await client.calendars.get({ calendarId: 'primary' });
|
|
25
28
|
return res.data.summary ?? res.data.timeZone ?? '(reachable)';
|
|
26
29
|
}
|
|
30
|
+
// The Sheets API has no id-free read (listing spreadsheets is Drive's job), so
|
|
31
|
+
// the probe reads Google's long-stable public sample spreadsheet (titled
|
|
32
|
+
// "Example Spreadsheet", used throughout the Sheets API docs). If Google ever
|
|
33
|
+
// unpublishes it, the probe fails loudly and this id gets replaced.
|
|
34
|
+
const SAMPLE_SPREADSHEET_ID = '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms';
|
|
35
|
+
async function sheetsProbe(account) {
|
|
36
|
+
const client = sheets({ version: 'v4', auth: await authorizedClient(account) });
|
|
37
|
+
const res = await client.spreadsheets.get({ spreadsheetId: SAMPLE_SPREADSHEET_ID });
|
|
38
|
+
return res.data.properties?.title ?? '(reachable)';
|
|
39
|
+
}
|
|
27
40
|
const S = 'https://www.googleapis.com/auth/';
|
|
28
41
|
export const SERVICES = [
|
|
29
42
|
{
|
|
@@ -38,7 +51,8 @@ export const SERVICES = [
|
|
|
38
51
|
name: 'sheets',
|
|
39
52
|
api: 'sheets.googleapis.com',
|
|
40
53
|
scopes: [`${S}spreadsheets`],
|
|
41
|
-
implemented:
|
|
54
|
+
implemented: true,
|
|
55
|
+
probe: sheetsProbe,
|
|
42
56
|
},
|
|
43
57
|
{ name: 'docs', api: 'docs.googleapis.com', scopes: [`${S}documents`], implemented: false },
|
|
44
58
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/doctor/services.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAcpD,KAAK,UAAU,UAAU,CAAC,OAAe;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/E,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,KAAK,CA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MAAM,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC;QACxB,WAAW,EAAE,IAAI;QACjB,KAAK,EAAE,aAAa;KACrB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,qBAAqB;QAC1B,MAAM,EAAE;YACN,GAAG,CAAC,wBAAwB;YAC5B,GAAG,CAAC,yBAAyB;YAC7B,GAAG,CAAC,yBAAyB;SAC9B;QACD,WAAW,EAAE,KAAK;KACnB;CACF,CAAC;AAEF,iEAAiE;AACjE,MAAM,UAAU,cAAc;IAC5B,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,YAAY;IAC1B,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAmB,EACnB,WAAqB,cAAc,EAAE;IAErC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IACjC,OAAO;QACL,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/C,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The doctor's knowledge of the Google services this suite targets.\n *\n * Dependency direction is one-way: doctor knows services; services never import\n * doctor. To stay decoupled from each service's churning internals, a probe is\n * expressed against stable public surfaces only (`@googleapis/*` plus the shared\n * `authorizedClient`), not `src/<service>` code. Adding a service here is how the\n * doctor learns to check it.\n *\n * Scopes are attributed per service for reporting, but the canonical scope list\n * is `SCOPES` in `src/auth/config.ts` (services do not declare scopes locally).\n * `assertScopeRegistryMatches` guards the two against silent drift.\n */\nimport { calendar } from '@googleapis/calendar';\nimport { gmail } from '@googleapis/gmail';\nimport { authorizedClient } from '../auth/oauth.js';\n\n/** A cheap, read-only call that proves a service's token + API actually work. */\nexport type ServiceProbe = (account: string) => Promise<string>;\n\nexport type ServiceInfo = {\n name: string;\n /** Google Cloud API identifier to enable (as `gcloud services enable` uses). */\n api: string;\n scopes: string[];\n implemented: boolean;\n probe?: ServiceProbe;\n};\n\nasync function gmailProbe(account: string): Promise<string> {\n const client = gmail({ version: 'v1', auth: await authorizedClient(account) });\n const res = await client.users.getProfile({ userId: 'me' });\n return res.data.emailAddress ?? '(reachable)';\n}\n\nasync function calendarProbe(account: string): Promise<string> {\n const client = calendar({ version: 'v3', auth: await authorizedClient(account) });\n const res = await client.calendars.get({ calendarId: 'primary' });\n return res.data.summary ?? res.data.timeZone ?? '(reachable)';\n}\n\nconst S = 'https://www.googleapis.com/auth/';\n\nexport const SERVICES: ServiceInfo[] = [\n {\n name: 'gmail',\n api: 'gmail.googleapis.com',\n scopes: ['https://mail.google.com/', `${S}gmail.settings.basic`],\n implemented: true,\n probe: gmailProbe,\n },\n { name: 'drive', api: 'drive.googleapis.com', scopes: [`${S}drive`], implemented: false },\n {\n name: 'sheets',\n api: 'sheets.googleapis.com',\n scopes: [`${S}spreadsheets`],\n implemented:
|
|
1
|
+
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/doctor/services.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,oBA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AAC3C,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,YAAY;IAC1B,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAmB,EACnB,WAAqB,cAAc,EAAE;IAErC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IACjC,OAAO;QACL,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/C,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The doctor's knowledge of the Google services this suite targets.\n *\n * Dependency direction is one-way: doctor knows services; services never import\n * doctor. To stay decoupled from each service's churning internals, a probe is\n * expressed against stable public surfaces only (`@googleapis/*` plus the shared\n * `authorizedClient`), not `src/<service>` code. Adding a service here is how the\n * doctor learns to check it.\n *\n * Scopes are attributed per service for reporting, but the canonical scope list\n * is `SCOPES` in `src/auth/config.ts` (services do not declare scopes locally).\n * `assertScopeRegistryMatches` guards the two against silent drift.\n */\nimport { calendar } from '@googleapis/calendar';\nimport { gmail } from '@googleapis/gmail';\nimport { sheets } from '@googleapis/sheets';\nimport { authorizedClient } from '../auth/oauth.js';\n\n/** A cheap, read-only call that proves a service's token + API actually work. */\nexport type ServiceProbe = (account: string) => Promise<string>;\n\nexport type ServiceInfo = {\n name: string;\n /** Google Cloud API identifier to enable (as `gcloud services enable` uses). */\n api: string;\n scopes: string[];\n implemented: boolean;\n probe?: ServiceProbe;\n};\n\n// Probe API versions duplicate each service's index.ts on purpose (doctor never\n// imports service internals); when a service moves versions, move its probe too.\n\nasync function gmailProbe(account: string): Promise<string> {\n const client = gmail({ version: 'v1', auth: await authorizedClient(account) });\n const res = await client.users.getProfile({ userId: 'me' });\n return res.data.emailAddress ?? '(reachable)';\n}\n\nasync function calendarProbe(account: string): Promise<string> {\n const client = calendar({ version: 'v3', auth: await authorizedClient(account) });\n const res = await client.calendars.get({ calendarId: 'primary' });\n return res.data.summary ?? res.data.timeZone ?? '(reachable)';\n}\n\n// The Sheets API has no id-free read (listing spreadsheets is Drive's job), so\n// the probe reads Google's long-stable public sample spreadsheet (titled\n// \"Example Spreadsheet\", used throughout the Sheets API docs). If Google ever\n// unpublishes it, the probe fails loudly and this id gets replaced.\nconst SAMPLE_SPREADSHEET_ID = '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms';\n\nasync function sheetsProbe(account: string): Promise<string> {\n const client = sheets({ version: 'v4', auth: await authorizedClient(account) });\n const res = await client.spreadsheets.get({ spreadsheetId: SAMPLE_SPREADSHEET_ID });\n return res.data.properties?.title ?? '(reachable)';\n}\n\nconst S = 'https://www.googleapis.com/auth/';\n\nexport const SERVICES: ServiceInfo[] = [\n {\n name: 'gmail',\n api: 'gmail.googleapis.com',\n scopes: ['https://mail.google.com/', `${S}gmail.settings.basic`],\n implemented: true,\n probe: gmailProbe,\n },\n { name: 'drive', api: 'drive.googleapis.com', scopes: [`${S}drive`], implemented: false },\n {\n name: 'sheets',\n api: 'sheets.googleapis.com',\n scopes: [`${S}spreadsheets`],\n implemented: true,\n probe: sheetsProbe,\n },\n { name: 'docs', api: 'docs.googleapis.com', scopes: [`${S}documents`], implemented: false },\n {\n name: 'calendar',\n api: 'calendar-json.googleapis.com',\n scopes: [`${S}calendar`],\n implemented: true,\n probe: calendarProbe,\n },\n {\n name: 'meet',\n api: 'meet.googleapis.com',\n scopes: [\n `${S}meetings.space.created`,\n `${S}meetings.space.readonly`,\n `${S}meetings.space.settings`,\n ],\n implemented: false,\n },\n];\n\n/** Every scope the suite expects, attributed across services. */\nexport function requiredScopes(): string[] {\n return SERVICES.flatMap((s) => s.scopes);\n}\n\n/** APIs to enable in Google Cloud, in `gcloud services enable` form. */\nexport function requiredApis(): string[] {\n return SERVICES.map((s) => s.api);\n}\n\n/**\n * Guard the per-service scope attribution against the canonical `SCOPES` union.\n * Returns the symmetric difference; empty means the two agree.\n */\nexport function scopeRegistryDrift(\n canonical: string[],\n declared: string[] = requiredScopes(),\n): { missing: string[]; extra: string[] } {\n const have = new Set(declared);\n const truth = new Set(canonical);\n return {\n missing: [...truth].filter((s) => !have.has(s)),\n extra: [...have].filter((s) => !truth.has(s)),\n };\n}\n"]}
|
|
@@ -8,5 +8,5 @@ import { type Operation } from '../lib/operation.js';
|
|
|
8
8
|
* here (the client can no longer silently infer `unknown` and slip into the
|
|
9
9
|
* registry) rather than surfacing as a confusing `unknown` deep in the body.
|
|
10
10
|
*/
|
|
11
|
-
export declare const gmailOperation: <In extends z.
|
|
11
|
+
export declare const gmailOperation: <In extends z.ZodObject, Out extends z.ZodObject>(def: Operation<gmail_v1.Gmail, In, Out>) => Operation<gmail_v1.Gmail, In, Out>;
|
|
12
12
|
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/gmail/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,qBAAqB,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,EAAE,SAAS,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/gmail/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,qBAAqB,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,EAAE,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC,CAAC,SAAS,EAC5E,KAAK,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,CAAC,KACtC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,CAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/gmail/operation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,GAAuC,EACH,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC","sourcesContent":["import type { gmail_v1 } from '@googleapis/gmail';\nimport type { z } from 'zod';\nimport { type Operation, operation } from '../lib/operation.js';\n\n/**\n * `operation()` bound to the Gmail client. Every gmail op's `index.ts` uses this\n * instead of the raw `operation()` so the handler's client is always\n * `gmail_v1.Gmail`: a handler that drops or mistypes its client annotation fails\n * here (the client can no longer silently infer `unknown` and slip into the\n * registry) rather than surfacing as a confusing `unknown` deep in the body.\n */\nexport const gmailOperation = <In extends z.
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/gmail/operation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,GAAuC,EACH,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC","sourcesContent":["import type { gmail_v1 } from '@googleapis/gmail';\nimport type { z } from 'zod';\nimport { type Operation, operation } from '../lib/operation.js';\n\n/**\n * `operation()` bound to the Gmail client. Every gmail op's `index.ts` uses this\n * instead of the raw `operation()` so the handler's client is always\n * `gmail_v1.Gmail`: a handler that drops or mistypes its client annotation fails\n * here (the client can no longer silently infer `unknown` and slip into the\n * registry) rather than surfacing as a confusing `unknown` deep in the body.\n */\nexport const gmailOperation = <In extends z.ZodObject, Out extends z.ZodObject>(\n def: Operation<gmail_v1.Gmail, In, Out>,\n): Operation<gmail_v1.Gmail, In, Out> => operation(def);\n"]}
|
package/dist/lib/operation.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { z } from 'zod';
|
|
|
8
8
|
* service's authenticated client and the validated input and returns a value that
|
|
9
9
|
* conforms to `schema.output`.
|
|
10
10
|
*/
|
|
11
|
-
export type Operation<Client, In extends z.
|
|
11
|
+
export type Operation<Client, In extends z.ZodObject, Out extends z.ZodObject> = {
|
|
12
12
|
description: string;
|
|
13
13
|
schema: {
|
|
14
14
|
input: In;
|
|
@@ -28,8 +28,8 @@ export type Operation<Client, In extends z.ZodType, Out extends z.ZodType> = {
|
|
|
28
28
|
export type AnyOperation<Client> = {
|
|
29
29
|
description: string;
|
|
30
30
|
schema: {
|
|
31
|
-
input: z.
|
|
32
|
-
output: z.
|
|
31
|
+
input: z.ZodObject;
|
|
32
|
+
output: z.ZodObject;
|
|
33
33
|
};
|
|
34
34
|
handler: (client: Client, args: never) => Promise<unknown>;
|
|
35
35
|
destructive?: boolean;
|
|
@@ -40,7 +40,7 @@ export type AnyOperation<Client> = {
|
|
|
40
40
|
* from `schema`) and the front-door check that the handler consumes exactly what
|
|
41
41
|
* the schema declares.
|
|
42
42
|
*/
|
|
43
|
-
export declare const operation: <Client, In extends z.
|
|
43
|
+
export declare const operation: <Client, In extends z.ZodObject, Out extends z.ZodObject>(def: Operation<Client, In, Out>) => Operation<Client, In, Out>;
|
|
44
44
|
/**
|
|
45
45
|
* Merge operation groups (e.g. a service's tools and methods) into the single
|
|
46
46
|
* registry the server dispatches. Throws on a duplicate wire name: two operations
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/lib/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/lib/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC,CAAC,SAAS,IAAI;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QAAE,KAAK,EAAE,EAAE,CAAC;QAAC,MAAM,EAAE,GAAG,CAAA;KAAE,CAAC;IACnC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACtE,gIAAgI;IAChI,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,CAAC,MAAM,IAAI;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QAAE,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC;QAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAA;KAAE,CAAC;IACpD,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC,CAAC,SAAS,EAC/E,KAAK,SAAS,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,CAAC,KAC9B,SAAS,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,CAAQ,CAAC;AAErC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EACpC,GAAG,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,GAChD,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAWtC"}
|
package/dist/lib/operation.js
CHANGED
|
@@ -15,7 +15,7 @@ export function mergeOperations(...groups) {
|
|
|
15
15
|
const merged = {};
|
|
16
16
|
for (const group of groups) {
|
|
17
17
|
for (const [name, op] of Object.entries(group)) {
|
|
18
|
-
if (name
|
|
18
|
+
if (Object.hasOwn(merged, name)) {
|
|
19
19
|
throw new Error(`Duplicate operation name: ${name}`);
|
|
20
20
|
}
|
|
21
21
|
merged[name] = op;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/lib/operation.ts"],"names":[],"mappings":"AAiCA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,GAA+B,EACH,EAAE,CAAC,GAAG,CAAC;AAErC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAG,MAA8C;IAEjD,MAAM,MAAM,GAAyC,EAAE,CAAC;IACxD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/C,IAAI,
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/lib/operation.ts"],"names":[],"mappings":"AAiCA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,GAA+B,EACH,EAAE,CAAC,GAAG,CAAC;AAErC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAG,MAA8C;IAEjD,MAAM,MAAM,GAAyC,EAAE,CAAC;IACxD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/C,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,EAAE,CAAC,CAAC;YACvD,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { z } from 'zod';\n\n/**\n * A single operation: its documented I/O contract plus the work that fulfills it.\n * Every tool and method is an `Operation`; they differ only by which Google\n * reference the folder mirrors (MCP toolset vs REST), never by type.\n *\n * `schema` is the contract (zod, mirrored from the docs); `handler` receives the\n * service's authenticated client and the validated input and returns a value that\n * conforms to `schema.output`.\n */\nexport type Operation<Client, In extends z.ZodObject, Out extends z.ZodObject> = {\n description: string;\n schema: { input: In; output: Out };\n handler: (client: Client, args: z.infer<In>) => Promise<z.infer<Out>>;\n /** Irreversible (send, permanent delete) or a standing side effect (a forwarding filter); surfaced as MCP `destructiveHint`. */\n destructive?: boolean;\n};\n\n/**\n * An operation with its schemas erased; the shape the registry and server hold.\n * The handler's args are widened to `never` so any concrete `Operation` is\n * assignable here (a handler taking a specific input is assignable to one taking\n * `never` by contravariance; under zod 4, `z.infer<z.ZodType>` is `unknown`, which\n * would break that, so `never` restores it).\n */\nexport type AnyOperation<Client> = {\n description: string;\n schema: { input: z.ZodObject; output: z.ZodObject };\n handler: (client: Client, args: never) => Promise<unknown>;\n destructive?: boolean;\n};\n\n/**\n * Define an operation. A no-op at runtime (it returns its argument); its job is\n * type inference (`Client` from the handler's first parameter, `input`/`output`\n * from `schema`) and the front-door check that the handler consumes exactly what\n * the schema declares.\n */\nexport const operation = <Client, In extends z.ZodObject, Out extends z.ZodObject>(\n def: Operation<Client, In, Out>,\n): Operation<Client, In, Out> => def;\n\n/**\n * Merge operation groups (e.g. a service's tools and methods) into the single\n * registry the server dispatches. Throws on a duplicate wire name: two operations\n * cannot answer to the same key, and a silent `{ ...a, ...b }` spread would let\n * one shadow the other and vanish from the wire with no error.\n */\nexport function mergeOperations<Client>(\n ...groups: Record<string, AnyOperation<Client>>[]\n): Record<string, AnyOperation<Client>> {\n const merged: Record<string, AnyOperation<Client>> = {};\n for (const group of groups) {\n for (const [name, op] of Object.entries(group)) {\n if (Object.hasOwn(merged, name)) {\n throw new Error(`Duplicate operation name: ${name}`);\n }\n merged[name] = op;\n }\n }\n return merged;\n}\n"]}
|
package/dist/lib/server.d.ts
CHANGED
|
@@ -37,11 +37,12 @@ export type CapabilityGroup<Client> = {
|
|
|
37
37
|
/**
|
|
38
38
|
* Render the operations as a Markdown capability table (name, source, description,
|
|
39
39
|
* and an irreversible marker), derived from the same registries the server
|
|
40
|
-
* dispatches. The Source column makes the
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
40
|
+
* dispatches. The Source column makes the provenance explicit: a service is an
|
|
41
|
+
* MCP-toolset wrapper and a REST wrapper (or REST only, where Google publishes
|
|
42
|
+
* no toolset), because MCP's toolset alone cannot fully drive a service. A
|
|
43
|
+
* static mirror; agents that speak MCP discover the live, fully-schema'd
|
|
44
|
+
* surface via `tools/list`. Pure; a service regenerates its CAPABILITIES.md
|
|
45
|
+
* from this (and a test pins the file to it) so the doc cannot drift from the code.
|
|
45
46
|
*/
|
|
46
47
|
export declare function renderCapabilities<Client>(title: string, groups: CapabilityGroup<Client>[]): string;
|
|
47
48
|
/**
|
package/dist/lib/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/lib/server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,aAAa,CAAC,MAAM,IAAI;IAClC,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0FAA0F;IAC1F,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD,gFAAgF;IAChF,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACzD,+DAA+D;IAC/D,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,qEAAqE;IACrE,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAMF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;;;;;;iBAInB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;kBACpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAG9F;AAED,sFAAsF;AACtF,MAAM,MAAM,eAAe,CAAC,MAAM,IAAI;IACpC,+EAA+E;IAC/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AC,MAAM,CAAC,CAAC,CAAC;CAClD,CAAC;AAQF;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,GAChC,MAAM,CAqBR;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,MAAM,EACxC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,EAChD,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,cAAc,CAAC,CA6BzB;AAED;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBlF"}
|
package/dist/lib/server.js
CHANGED
|
@@ -20,23 +20,33 @@ export function toolDefinitions(operations) {
|
|
|
20
20
|
...(op.destructive ? { annotations: { destructiveHint: true } } : {}),
|
|
21
21
|
}));
|
|
22
22
|
}
|
|
23
|
+
/** Prose labels for the group kinds; the header sentence is built from these. */
|
|
24
|
+
const KIND_LABELS = {
|
|
25
|
+
'MCP Tool': 'MCP tools',
|
|
26
|
+
'REST Method': 'REST methods',
|
|
27
|
+
};
|
|
23
28
|
/**
|
|
24
29
|
* Render the operations as a Markdown capability table (name, source, description,
|
|
25
30
|
* and an irreversible marker), derived from the same registries the server
|
|
26
|
-
* dispatches. The Source column makes the
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
+
* dispatches. The Source column makes the provenance explicit: a service is an
|
|
32
|
+
* MCP-toolset wrapper and a REST wrapper (or REST only, where Google publishes
|
|
33
|
+
* no toolset), because MCP's toolset alone cannot fully drive a service. A
|
|
34
|
+
* static mirror; agents that speak MCP discover the live, fully-schema'd
|
|
35
|
+
* surface via `tools/list`. Pure; a service regenerates its CAPABILITIES.md
|
|
36
|
+
* from this (and a test pins the file to it) so the doc cannot drift from the code.
|
|
31
37
|
*/
|
|
32
38
|
export function renderCapabilities(title, groups) {
|
|
33
39
|
const rows = groups.flatMap(({ kind, operations }) => Object.entries(operations).map(([name, op]) => `| \`${name}\`${op.destructive ? ' ⚠️' : ''} | ${kind} | ${op.description} |`));
|
|
40
|
+
// Derived from the groups actually passed in, so a methods-only service
|
|
41
|
+
// (Sheets) does not claim an MCP toolset it does not have.
|
|
42
|
+
const labels = groups.map(({ kind }) => KIND_LABELS[kind] ?? `${kind}s`);
|
|
43
|
+
const sources = labels.length === 1 ? `, all ${labels[0]}` : ` across ${labels.join(' and ')}`;
|
|
34
44
|
return `${[
|
|
35
45
|
`# ${title}`,
|
|
36
46
|
'',
|
|
37
47
|
'<!-- Generated by `bun run capabilities`; do not edit by hand. -->',
|
|
38
48
|
'',
|
|
39
|
-
`${rows.length} operations
|
|
49
|
+
`${rows.length} operations${sources}. ⚠️ marks irreversible operations (MCP \`destructiveHint\`).`,
|
|
40
50
|
'',
|
|
41
51
|
'| Operation | Source | Description |',
|
|
42
52
|
'| --- | --- | --- |',
|
|
@@ -50,7 +60,10 @@ export function renderCapabilities(title, groups) {
|
|
|
50
60
|
* paths return an `isError` result rather than throwing. Exported for tests.
|
|
51
61
|
*/
|
|
52
62
|
export async function callOperation(operations, client, name, rawArgs) {
|
|
53
|
-
|
|
63
|
+
// Own-property guard: the registry is a plain object, so a bare `operations[name]`
|
|
64
|
+
// would resolve inherited keys (`__proto__`, `toString`, ...) to truthy non-operations
|
|
65
|
+
// and throw past the error envelope when an agent sends one as a tool name.
|
|
66
|
+
const op = Object.hasOwn(operations, name) ? operations[name] : undefined;
|
|
54
67
|
if (!op) {
|
|
55
68
|
return errorResult(`Unknown tool: ${name}`);
|
|
56
69
|
}
|
package/dist/lib/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/lib/server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CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAE3E,GAAG,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QACzD,KAAK,EAAE,eAAe,CAAC,UAAU,CAAC;KACnC,CAAC,CAAC,CAAC;IAEJ,GAAG,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,OAAO,EAAE,EAAE,CACvD,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CACjF,CAAC;IAEF,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,IAAI,IAAI,oBAAoB,EAAE,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import { Server } from '@modelcontextprotocol/sdk/server/index.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';\nimport {\n CallToolRequestSchema,\n type CallToolResult,\n ListToolsRequestSchema,\n} from '@modelcontextprotocol/sdk/types.js';\nimport { z } from 'zod';\nimport pkg from '../../package.json' with { type: 'json' };\nimport type { AnyOperation } from './operation.js';\n\nexport type ServerOptions<Client> = {\n /** MCP server name (the service, e.g. 'gmail'). */\n name: string;\n version?: string;\n /** Every operation this server exposes, keyed by wire name (tools and methods merged). */\n operations: Record<string, AnyOperation<Client>>;\n /** Build the authenticated client for the account this instance is bound to. */\n client: (account: string | undefined) => Promise<Client>;\n /** Optional consent flow, invoked by the `auth` subcommand. */\n runAuth?: (account: string | undefined) => Promise<void>;\n /** Transport to connect; defaults to stdio. Injectable for tests. */\n transport?: Transport;\n};\n\nfunction errorResult(message: string): CallToolResult {\n return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true };\n}\n\n/**\n * Build the MCP `tools/list` payload from the operations: each one's input and\n * output JSON Schema, plus a destructive hint for irreversible ops. On the wire,\n * every operation is a \"tool\" (MCP has no other word). Pure; exported for tests.\n */\nexport function toolDefinitions<Client>(operations: Record<string, AnyOperation<Client>>) {\n return Object.entries(operations).map(([name, op]) => ({\n name,\n description: op.description,\n inputSchema: z.toJSONSchema(op.schema.input, { io: 'input' }) as Record<string, unknown>,\n outputSchema: z.toJSONSchema(op.schema.output, { io: 'output' }) as Record<string, unknown>,\n ...(op.destructive ? { annotations: { destructiveHint: true } } : {}),\n }));\n}\n\n/** A labeled set of operations for the capability table: its provenance + the ops. */\nexport type CapabilityGroup<Client> = {\n /** Provenance shown in the Source column, e.g. 'MCP Tool' or 'REST Method'. */\n kind: string;\n operations: Record<string, AnyOperation<Client>>;\n};\n\n/**\n * Render the operations as a Markdown capability table (name, source, description,\n * and an irreversible marker), derived from the same registries the server\n * dispatches. The Source column makes the dual surface explicit: the suite is both\n * an MCP-toolset wrapper and a REST wrapper, because MCP's toolset alone cannot\n * fully drive a service. A static mirror; agents that speak MCP discover the live,\n * fully-schema'd surface via `tools/list`. Pure; a service regenerates its\n * CAPABILITIES.md from this so the doc cannot drift from the code.\n */\nexport function renderCapabilities<Client>(\n title: string,\n groups: CapabilityGroup<Client>[],\n): string {\n const rows = groups.flatMap(({ kind, operations }) =>\n Object.entries(operations).map(\n ([name, op]) => `| \\`${name}\\`${op.destructive ? ' ⚠️' : ''} | ${kind} | ${op.description} |`,\n ),\n );\n return `${[\n `# ${title}`,\n '',\n '<!-- Generated by `bun run capabilities`; do not edit by hand. -->',\n '',\n `${rows.length} operations across MCP tools and REST methods. ⚠️ marks irreversible operations (MCP \\`destructiveHint\\`).`,\n '',\n '| Operation | Source | Description |',\n '| --- | --- | --- |',\n ...rows,\n ].join('\\n')}\\n`;\n}\n\n/**\n * Run one operation by name: resolve it, validate input against its schema, run\n * the handler, validate the output, and return both a structured result and a text\n * rendering (for clients that do not yet read `structuredContent`). All failure\n * paths return an `isError` result rather than throwing. Exported for tests.\n */\nexport async function callOperation<Client>(\n operations: Record<string, AnyOperation<Client>>,\n client: Client,\n name: string,\n rawArgs: unknown,\n): Promise<CallToolResult> {\n const op = operations[name];\n if (!op) {\n return errorResult(`Unknown tool: ${name}`);\n }\n\n const parsed = op.schema.input.safeParse(rawArgs ?? {});\n if (!parsed.success) {\n return errorResult(`Invalid arguments for ${name}: ${parsed.error.message}`);\n }\n\n try {\n // `parsed.data` was just validated against this op's input schema, so it is\n // the handler's real input shape. The `AnyOperation` boundary types the\n // handler's args as `never` (so any concrete Operation stays assignable; see\n // operation.ts), and `as never` is the only call form. The validation above\n // is what makes this safe: do not call the handler before parsing.\n const result = await op.handler(client, parsed.data as never);\n const validated = op.schema.output.parse(result);\n return {\n content: [{ type: 'text', text: JSON.stringify(validated, null, 2) }],\n structuredContent: validated as Record<string, unknown>,\n };\n } catch (error) {\n return errorResult(error instanceof Error ? error.message : String(error));\n }\n}\n\n/**\n * Turn a service's operations into a running stdio MCP server. Identical for every\n * service; only the bound `Client` type and the operations differ. Owns the\n * cross-cutting concerns: the `auth` subcommand, account binding, the `tools/list`\n * payload, dispatch, validation, and error wrapping.\n */\nexport async function server<Client>(options: ServerOptions<Client>): Promise<void> {\n const { name, version = pkg.version, operations, client, runAuth } = options;\n\n if (process.argv[2] === 'auth') {\n if (!runAuth) {\n console.error(`${name}: no auth flow configured.`);\n process.exit(1);\n }\n await runAuth(process.argv[3] ?? process.env['GOOGLE_MCP_ACCOUNT']);\n process.exit(0);\n }\n\n const authed = await client(process.env['GOOGLE_MCP_ACCOUNT']);\n const mcp = new Server({ name, version }, { capabilities: { tools: {} } });\n\n mcp.setRequestHandler(ListToolsRequestSchema, async () => ({\n tools: toolDefinitions(operations),\n }));\n\n mcp.setRequestHandler(CallToolRequestSchema, (request) =>\n callOperation(operations, authed, request.params.name, request.params.arguments),\n );\n\n await mcp.connect(options.transport ?? new StdioServerTransport());\n}\n"]}
|
|
1
|
+
{"version":3,"file":"server.js","sourceR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import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';\nimport {\n CallToolRequestSchema,\n type CallToolResult,\n ListToolsRequestSchema,\n} from '@modelcontextprotocol/sdk/types.js';\nimport { z } from 'zod';\nimport pkg from '../../package.json' with { type: 'json' };\nimport type { AnyOperation } from './operation.js';\n\nexport type ServerOptions<Client> = {\n /** MCP server name (the service, e.g. 'gmail'). */\n name: string;\n version?: string;\n /** Every operation this server exposes, keyed by wire name (tools and methods merged). */\n operations: Record<string, AnyOperation<Client>>;\n /** Build the authenticated client for the account this instance is bound to. */\n client: (account: string | undefined) => Promise<Client>;\n /** Optional consent flow, invoked by the `auth` subcommand. */\n runAuth?: (account: string | undefined) => Promise<void>;\n /** Transport to connect; defaults to stdio. Injectable for tests. */\n transport?: Transport;\n};\n\nfunction errorResult(message: string): CallToolResult {\n return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true };\n}\n\n/**\n * Build the MCP `tools/list` payload from the operations: each one's input and\n * output JSON Schema, plus a destructive hint for irreversible ops. On the wire,\n * every operation is a \"tool\" (MCP has no other word). Pure; exported for tests.\n */\nexport function toolDefinitions<Client>(operations: Record<string, AnyOperation<Client>>) {\n return Object.entries(operations).map(([name, op]) => ({\n name,\n description: op.description,\n inputSchema: z.toJSONSchema(op.schema.input, { io: 'input' }) as Record<string, unknown>,\n outputSchema: z.toJSONSchema(op.schema.output, { io: 'output' }) as Record<string, unknown>,\n ...(op.destructive ? { annotations: { destructiveHint: true } } : {}),\n }));\n}\n\n/** A labeled set of operations for the capability table: its provenance + the ops. */\nexport type CapabilityGroup<Client> = {\n /** Provenance shown in the Source column, e.g. 'MCP Tool' or 'REST Method'. */\n kind: string;\n operations: Record<string, AnyOperation<Client>>;\n};\n\n/** Prose labels for the group kinds; the header sentence is built from these. */\nconst KIND_LABELS: Record<string, string> = {\n 'MCP Tool': 'MCP tools',\n 'REST Method': 'REST methods',\n};\n\n/**\n * Render the operations as a Markdown capability table (name, source, description,\n * and an irreversible marker), derived from the same registries the server\n * dispatches. The Source column makes the provenance explicit: a service is an\n * MCP-toolset wrapper and a REST wrapper (or REST only, where Google publishes\n * no toolset), because MCP's toolset alone cannot fully drive a service. A\n * static mirror; agents that speak MCP discover the live, fully-schema'd\n * surface via `tools/list`. Pure; a service regenerates its CAPABILITIES.md\n * from this (and a test pins the file to it) so the doc cannot drift from the code.\n */\nexport function renderCapabilities<Client>(\n title: string,\n groups: CapabilityGroup<Client>[],\n): string {\n const rows = groups.flatMap(({ kind, operations }) =>\n Object.entries(operations).map(\n ([name, op]) => `| \\`${name}\\`${op.destructive ? ' ⚠️' : ''} | ${kind} | ${op.description} |`,\n ),\n );\n // Derived from the groups actually passed in, so a methods-only service\n // (Sheets) does not claim an MCP toolset it does not have.\n const labels = groups.map(({ kind }) => KIND_LABELS[kind] ?? `${kind}s`);\n const sources = labels.length === 1 ? `, all ${labels[0]}` : ` across ${labels.join(' and ')}`;\n return `${[\n `# ${title}`,\n '',\n '<!-- Generated by `bun run capabilities`; do not edit by hand. -->',\n '',\n `${rows.length} operations${sources}. ⚠️ marks irreversible operations (MCP \\`destructiveHint\\`).`,\n '',\n '| Operation | Source | Description |',\n '| --- | --- | --- |',\n ...rows,\n ].join('\\n')}\\n`;\n}\n\n/**\n * Run one operation by name: resolve it, validate input against its schema, run\n * the handler, validate the output, and return both a structured result and a text\n * rendering (for clients that do not yet read `structuredContent`). All failure\n * paths return an `isError` result rather than throwing. Exported for tests.\n */\nexport async function callOperation<Client>(\n operations: Record<string, AnyOperation<Client>>,\n client: Client,\n name: string,\n rawArgs: unknown,\n): Promise<CallToolResult> {\n // Own-property guard: the registry is a plain object, so a bare `operations[name]`\n // would resolve inherited keys (`__proto__`, `toString`, ...) to truthy non-operations\n // and throw past the error envelope when an agent sends one as a tool name.\n const op = Object.hasOwn(operations, name) ? operations[name] : undefined;\n if (!op) {\n return errorResult(`Unknown tool: ${name}`);\n }\n\n const parsed = op.schema.input.safeParse(rawArgs ?? {});\n if (!parsed.success) {\n return errorResult(`Invalid arguments for ${name}: ${parsed.error.message}`);\n }\n\n try {\n // `parsed.data` was just validated against this op's input schema, so it is\n // the handler's real input shape. The `AnyOperation` boundary types the\n // handler's args as `never` (so any concrete Operation stays assignable; see\n // operation.ts), and `as never` is the only call form. The validation above\n // is what makes this safe: do not call the handler before parsing.\n const result = await op.handler(client, parsed.data as never);\n const validated = op.schema.output.parse(result);\n return {\n content: [{ type: 'text', text: JSON.stringify(validated, null, 2) }],\n structuredContent: validated,\n };\n } catch (error) {\n return errorResult(error instanceof Error ? error.message : String(error));\n }\n}\n\n/**\n * Turn a service's operations into a running stdio MCP server. Identical for every\n * service; only the bound `Client` type and the operations differ. Owns the\n * cross-cutting concerns: the `auth` subcommand, account binding, the `tools/list`\n * payload, dispatch, validation, and error wrapping.\n */\nexport async function server<Client>(options: ServerOptions<Client>): Promise<void> {\n const { name, version = pkg.version, operations, client, runAuth } = options;\n\n if (process.argv[2] === 'auth') {\n if (!runAuth) {\n console.error(`${name}: no auth flow configured.`);\n process.exit(1);\n }\n await runAuth(process.argv[3] ?? process.env['GOOGLE_MCP_ACCOUNT']);\n process.exit(0);\n }\n\n const authed = await client(process.env['GOOGLE_MCP_ACCOUNT']);\n const mcp = new Server({ name, version }, { capabilities: { tools: {} } });\n\n mcp.setRequestHandler(ListToolsRequestSchema, async () => ({\n tools: toolDefinitions(operations),\n }));\n\n mcp.setRequestHandler(CallToolRequestSchema, (request) =>\n callOperation(operations, authed, request.params.name, request.params.arguments),\n );\n\n await mcp.connect(options.transport ?? new StdioServerTransport());\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/sheets/capabilities.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Regenerate CAPABILITIES.md from the live method registry: `bun run
|
|
3
|
+
// capabilities`. The doc is derived from the same registry the server lists
|
|
4
|
+
// and dispatches, so it cannot drift from the code. Agents that speak MCP should
|
|
5
|
+
// discover the live, fully-schema'd surface via the server's `tools/list`.
|
|
6
|
+
import { writeFileSync } from 'node:fs';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { renderCapabilities } from '../lib/server.js';
|
|
9
|
+
import { methods } from './methods/registry.js';
|
|
10
|
+
if (import.meta.main) {
|
|
11
|
+
const out = fileURLToPath(new URL('./CAPABILITIES.md', import.meta.url));
|
|
12
|
+
writeFileSync(out, renderCapabilities('Sheets capabilities', [{ kind: 'REST Method', operations: methods }]));
|
|
13
|
+
console.error(`Wrote CAPABILITIES.md (${Object.keys(methods).length} operations)`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/sheets/capabilities.ts"],"names":[],"mappings":";AACA,qEAAqE;AACrE,4EAA4E;AAC5E,iFAAiF;AACjF,2EAA2E;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,mBAAmB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACzE,aAAa,CACX,GAAG,EACH,kBAAkB,CAAC,qBAAqB,EAAE,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAC1F,CAAC;IACF,OAAO,CAAC,KAAK,CAAC,0BAA0B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,cAAc,CAAC,CAAC;AACrF,CAAC","sourcesContent":["#!/usr/bin/env node\n// Regenerate CAPABILITIES.md from the live method registry: `bun run\n// capabilities`. The doc is derived from the same registry the server lists\n// and dispatches, so it cannot drift from the code. Agents that speak MCP should\n// discover the live, fully-schema'd surface via the server's `tools/list`.\nimport { writeFileSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { renderCapabilities } from '../lib/server.js';\nimport { methods } from './methods/registry.js';\n\nif (import.meta.main) {\n const out = fileURLToPath(new URL('./CAPABILITIES.md', import.meta.url));\n writeFileSync(\n out,\n renderCapabilities('Sheets capabilities', [{ kind: 'REST Method', operations: methods }]),\n );\n console.error(`Wrote CAPABILITIES.md (${Object.keys(methods).length} operations)`);\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* One cell's value as it crosses the JSON wire: a string, number, boolean, or
|
|
4
|
+
* null, depending on the cell contents and the request's render options
|
|
5
|
+
* (`FORMATTED_VALUE` renders strings; `UNFORMATTED_VALUE` preserves numbers and
|
|
6
|
+
* booleans; `FORMULA` renders the entered formula as a string). The REST docs
|
|
7
|
+
* model this as `ExtendedValue`; on the wire it is always a JSON scalar.
|
|
8
|
+
*
|
|
9
|
+
* @see https://sheets.googleapis.com/$discovery/rest?version=v4 (schemas.ValueRange.values)
|
|
10
|
+
* @see https://developers.google.com/workspace/sheets/api/guides/concepts#cell
|
|
11
|
+
*/
|
|
12
|
+
export declare const CellValue: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
|
|
13
|
+
export type CellValue = z.infer<typeof CellValue>;
|
|
14
|
+
//# sourceMappingURL=CellValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellValue.d.ts","sourceRoot":"","sources":["../../../src/sheets/entities/CellValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,0EAE4C,CAAC;AAEnE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* One cell's value as it crosses the JSON wire: a string, number, boolean, or
|
|
4
|
+
* null, depending on the cell contents and the request's render options
|
|
5
|
+
* (`FORMATTED_VALUE` renders strings; `UNFORMATTED_VALUE` preserves numbers and
|
|
6
|
+
* booleans; `FORMULA` renders the entered formula as a string). The REST docs
|
|
7
|
+
* model this as `ExtendedValue`; on the wire it is always a JSON scalar.
|
|
8
|
+
*
|
|
9
|
+
* @see https://sheets.googleapis.com/$discovery/rest?version=v4 (schemas.ValueRange.values)
|
|
10
|
+
* @see https://developers.google.com/workspace/sheets/api/guides/concepts#cell
|
|
11
|
+
*/
|
|
12
|
+
export const CellValue = z
|
|
13
|
+
.union([z.string(), z.number(), z.boolean(), z.null()])
|
|
14
|
+
.describe('One cell value: a string, number, boolean, or null.');
|
|
15
|
+
//# sourceMappingURL=CellValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellValue.js","sourceRoot":"","sources":["../../../src/sheets/entities/CellValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC;KACvB,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;KACtD,QAAQ,CAAC,qDAAqD,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * One cell's value as it crosses the JSON wire: a string, number, boolean, or\n * null, depending on the cell contents and the request's render options\n * (`FORMATTED_VALUE` renders strings; `UNFORMATTED_VALUE` preserves numbers and\n * booleans; `FORMULA` renders the entered formula as a string). The REST docs\n * model this as `ExtendedValue`; on the wire it is always a JSON scalar.\n *\n * @see https://sheets.googleapis.com/$discovery/rest?version=v4 (schemas.ValueRange.values)\n * @see https://developers.google.com/workspace/sheets/api/guides/concepts#cell\n */\nexport const CellValue = z\n .union([z.string(), z.number(), z.boolean(), z.null()])\n .describe('One cell value: a string, number, boolean, or null.');\n\nexport type CellValue = z.infer<typeof CellValue>;\n"]}
|