Skip to content

Add Microsoft Graph draft, reply, and file attachment flows - #26

Draft
erik-kroon wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
erik-kroon:codex/microsoft-draft-reply-attachments
Draft

erik-kroon wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
erik-kroon:codex/microsoft-draft-reply-attachments

Conversation

@erik-kroon

Copy link
Copy Markdown

Applications that compose mail through Microsoft Graph drafts currently hit the unsupported-route fallback when creating a message or reply. This adds the JSON draft lifecycle so clients can create a draft, update it, attach files, send it, and read the saved message and attachment bytes through the existing Graph surface.

  • Add draft creation, draft PATCH, createReply, and send, with delegated scopes and mailbox ownership checks. Sending returns an empty 202 and moves the same message into sent items; replies retain the original conversation and respect replyTo.
  • Persist file attachments supplied during draft creation or through the attachment endpoint, with list, metadata, and raw-byte reads. Validate base64 and the simple attachment size limit before mutation. Inline-only files do not set hasAttachments.
  • Record mutations in the request ledger, advertise operations in the manifest/OpenAPI, and update the README, service docs, agent skill and CLI help.
  • Cover compose/reply sequences, binary round trips, Bcc retention, cross-mailbox access, scope failures, injected send failures, invalid input, size boundaries and concurrent draft edits with nine integration tests.

The manifest marks limited operations as partial. This deliberately supports delegated /me JSON mail with file attachments smaller than 3 MB. MIME, upload sessions, item/reference attachments, generated quoted reply bodies, mail-folder/user-scoped routes and external delivery are outside this change. IDs remain stable even without the immutable-ID preference; default Outlook ID changes are not simulated.

Validation:

  • pnpm install --frozen-lockfile
  • pnpm exec turbo run build --concurrency=3 (29 successful tasks)
  • pnpm format:check and node scripts/sync-versions.mjs --check
  • pnpm exec turbo run type-check lint test --concurrency=3 (92 successful tasks)
  • After the final concurrency fix: pnpm exec turbo run build type-check lint test --filter=@emulators/microsoft --concurrency=2 (57 Microsoft tests passed; three existing live tests skipped)
  • Microsoft Graph PHP SDK v2.46.0 against a separately running local emulator: compose, reply, attachment POST, send, attachment JSON decoding and raw download passed. This used synthetic credentials and no external provider calls.

No live Microsoft validation was performed. Relevant API contracts: create draft, create reply, add attachment, send draft.

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.

1 participant