Gmail rich compose + Docs previews + email→PDF + GAS link - #19
Merged
Conversation
…link
Gmail:
- Fix HTML-entity leak in Docs injection (html-to-braille used .rawText; now .text)
- cc/bcc on all compose tools (drafts included); multi-recipient to/cc/bcc (array or CSV)
- Inline images (as:"inline"+contentId → multipart/related Content-ID), href links, blob attach
- gmail_get_message: text/html/rfc body + always urls[{label,href}]; thread carries body+urls
- gmail_to_pdf: thread/message → PDF (Browser Rendering render OR native Apps Script via:appscript),
optional term highlighting
Docs/preview:
- preview_file + docs_create_from_markdown: per-page PNG previews (R2 previews bucket, 48h TTL,
/api/preview/:id) + optional Ollama vision critique via core-guardian (lib/guardian-ai.ts)
Apps Script (email-to-pdf):
- gas-projects.ts registry (scriptId per account) + set_gas_script; run via scripts.run
- gas/ git submodule → core-template-gas (source lives there; CI deploys)
Docs: AGENTS.md directive #20 (submodule + follow gas/AGENTS.md) + feature-map bullets.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
email-to-pdf PR #8 merged; verified live end-to-end (thread → Drive PDF). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- doc-preview: render pages concurrently (Promise.all) instead of sequentially — avoids stacking Browser-Rendering latencies on default-on create previews - thread-pdf sanitizeBody: strip javascript:/vbscript: URLs before headless render; document the remote-image fetch tradeoff - fix stale docstrings (preview route R2 key, wrangler previews-bucket TTL) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Includes base64 Gmail-logo header fix + account routing + V8/render hardening. email-to-pdf verified live end-to-end (thread → Drive PDF, logo renders). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Culmination of this session's work on the Gmail/Docs MCP surface. tsc clean, 362 tests pass, lint exit 0.
Bug fix
html-to-braille.tsread text nodes via.rawText(entities intact) so"/'landed literally in docs. Now.text(decoded). Root fix covers every doc-write path (markdown import, append, tab updates). Plain-text tools already decode viasanitizeArgs; Gmail HTML→text already decodes.Gmail compose
to/cc/bccaccept an array or comma-separated string.attachments[{ as:"inline", contentId }]→multipart/related+Content-ID; reference in HTML as<img src="cid:…">(never link-falls-back). Plus href links (html/markdown) and blob attachments (already supported).gmail_create_reply_draft(defaults reply-all, keeps thread).Gmail read
gmail_get_message— body astext(default) /html/rfc, ALWAYS withurls:[{label,href}];gmail_get_threadcarries per-messagebody+urls.Email → PDF
gmail_to_pdf— thread / message / message-subset.via:"render"(Browser Rendering REST/pdf→ R2pdf_url, supportshighlights) orvia:"appscript"(native Apps Script → Drive URL).Docs/Sheet/PDF preview
preview_file(+ default ondocs_create_from_markdown) — export → per-page PNG (R2 previews bucket, 48h TTL via lifecycle + hourly purge, served/api/preview/:id) + optional Ollama vision critique routed through core-guardian (lib/guardian-ai.ts, authWORKER_API_KEY). Returns{ pdf_url, pages:{pg_N:{image_url, vision_ai_notes}} }.google-workspace-mcp-previews(lifecycle: expire 2 days), bound asR2_PREVIEWS_BUCKET.Apps Script (email-to-pdf)
gas-projects.tsregistry — per-accountscriptId(live IDs for both accounts) + runtime override viaset_gas_script/global_config. Run viascripts.run(gmail_to_pdf via:"appscript").gas/git submodule → core-template-gas — GAS source lives there (PR Gmail send-as, Drive attachments/audit, Code Mode, Apps Script deploy pipeline, per-account OAuth #8), that repo's CI deploys. Worker only runs the deployed scripts.isa_type-guard — fix handed to the core-template-gas agent.)Docs
gas/AGENTS.md") + Feature-Map bullets.New migration: none. New binding:
R2_PREVIEWS_BUCKET(bucket already created). Requires deploy to take effect.🤖 Generated with Claude Code