Skip to content

feat(emulators): add multi-account Google Gmail/Calendar v3 and Slack V2 file uploads - #2396

Merged
lalalune merged 1 commit into
developfrom
feat/emulators-multi-google-slack-uploads
Dec 4, 2026
Merged

lalalune merged 1 commit into
developfrom
feat/emulators-multi-google-slack-uploads

Conversation

@NubsCarson

Copy link
Copy Markdown
Collaborator

Summary

Expands @repo/eliza-harness offline service emulators (tracking #2382) so multi-account Google Workspace and Slack Stage 2 file-upload flows run deterministically offline over loopback HTTP:

  • Multi-account Google OAuth2 + Gmail + Calendar v3 + FaultArmory (packages/eliza-harness/src/providers/google-gmail.ts):
    • Preserves full backward compatibility with single-seed googleGmailFake(seed, clientSecret) and qaGmail(now, email) while isolating per-account mailboxes, drafts, calendars, and events via seed.accounts + x-qa-google-email / login_hint.
    • Adds stateful Gmail drafts CRUD + send (/gmail/v1/users/me/drafts, /drafts/:id with format=raw, /drafts/send, /messages/send with RFC 2822 base64url raw parsing and rfc822msgid: search).
    • Adds stateful Google Calendar v3 (/calendar/v3/users/me/calendarList, /calendarList/:calId, /calendars/:calId/events list/get/insert/patch/put/delete with If-Match ETag 412, 409 duplicate ID, showDeleted=true, and /calendar/v3/freeBusy).
    • Wires FaultArmory + /__control/{fault,reset,state,revoke} (including 401 invalid_grant refresh expiry and 429 RESOURCE_EXHAUSTED with Retry-After) and exports standalone loopback startGoogleProvider.
  • Slack Stage 2 V2 External File Uploads (packages/eliza-harness/src/providers/slack-provider.ts, packages/eliza-harness/src/providers/shared.ts):
    • Implements POST /api/files.getUploadURLExternal, unauthenticated loopback binary/multipart upload sink POST|PUT /__upload/:fileId, POST /api/files.completeUploadExternal (channel and thread targeting, JSON or form-urlencoded files), and auth-gated GET /__files/:fileId downloads.
    • Propagates uploaded files attachments across conversations.history, conversations.replies, search.messages, and live SSE message events; raises default startSlackProvider maxBodyBytes to 8 MiB and adds files:read,files:write to DEFAULT_USER_SCOPES.
  • Manifest & Exports (emulators/manifest.json, packages/eliza-harness/src/index.ts):
    • Updates contractHash and notes for google and slack; provider-routes.ts, spec/, and gen/ are untouched so all 4 verified services (cartesia, cerebras, google-maps, stripe) remain verified.

Verification

  • pnpm --filter @repo/eliza-harness test: 3/3 files, 23/23 tests PASS (providers.test.ts 14/14, services.test.ts 3/3, harness.test.ts 6/6)
  • pnpm --filter @repo/eliza-harness typecheck + build: PASS (0 errors)
  • pnpm cli emulate audit: PASS (946 src files scanned, 13/13 covered, 0 uncovered)
  • pnpm cli emulate status: 4 verified, 9 unverified, 0 stale
  • eslint --max-warnings 0 and jscpd --threshold 0 on all 5 touched .ts files: PASS (0 warnings, 0 clones)
  • pnpm no-bun, git diff --check: PASS

Copilot AI balanced review requested due to automatic review settings December 4, 2026 19:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@lalalune
lalalune merged commit 9c4dd9a into develop Dec 4, 2026
6 of 11 checks passed

This branch was previously deployed

1 inactive deployment
turbo-cache-read — 11ab125a Deployed Dec 4, 2026 by NubsCarson via selftest-rest #1619
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants