---
name: gws-workspace
description: >
  Unified Google Workspace integration via the gws CLI. Syncs Calendar events,
  Gmail messages, and Drive files into WALL-E's brain. Supports multiple Google
  accounts. Replaces separate google-calendar, email-sync, and gdrive skills
  with a single, cross-platform solution (no macOS-only dependencies).
version: 1.0.0
author: wall-e
execution: script
entry: run.js
args: ["--services", "calendar,gmail,drive"]
trigger:
  type: interval
  schedule: "every 30m"
config:
  services:
    type: string
    default: "calendar,gmail,drive"
    description: "Comma-separated services to sync: calendar,gmail,drive,sheets,tasks"
  calendar_days_back:
    type: number
    default: 1
    description: "Calendar: days back to sync"
  calendar_days_ahead:
    type: number
    default: 14
    description: "Calendar: days ahead to sync"
  gmail_max_results:
    type: number
    default: 20
    description: "Gmail: max messages per sync"
  gmail_query:
    type: string
    default: "newer_than:3d"
    description: "Gmail: search query filter"
tags: [google, calendar, gmail, drive, sheets, tasks, workspace, sync, gws]
permissions:
  - google:read
  - google:write
  - brain:write
---
# Google Workspace Sync (via gws CLI)

## What This Skill Does

Syncs data from Google Workspace services into WALL-E's brain using the
`gws` CLI (https://github.com/googleworkspace/cli). Replaces the separate
macOS-only calendar (EventKit/Swift) and email (Mail.app/JXA) skills with
a cross-platform solution that works on macOS, Linux, and in cloud deployments.

## Services

- **Calendar**: events with attendees, location, notes (read + write capable)
- **Gmail**: messages with subjects, senders, snippets (read + modify)
- **Drive**: file metadata, search, upload
- **Sheets**: read/write spreadsheet data
- **Tasks**: task lists and items

## Prerequisites

Run `node setup.js` to install gws and configure OAuth credentials.
Or invoke setup programmatically: `require('./setup').setupGws()`.

## Memory Format

Same as existing calendar/email skills for backwards compatibility:
- Calendar: `source: 'calendar'`, `source_id: 'cal:{uid}:{start}'`
- Gmail: `source: 'email'`, `source_id: 'mail:{messageId}'`
- Drive: `source: 'drive'`, `source_id: 'drive:{fileId}'`

## Multiple Accounts

gws supports one OAuth credential set at a time, but this skill supports
multiple accounts by storing per-account credentials in the brain's kv_store
and swapping them before each sync. See `setup.js --account <email>`.
