New request
#540: feat(workspace): Office document support — read/write docx/xlsx/pptx/pdf and Google Docs integration
We'll provision a sandbox, run an agent against the issue, and open a draft PR. You can pull the branch and iterate from there.
Summary
The WebUI currently treats Office documents (.docx, .xlsx, .pptx) and PDFs as download-only — clicking them in the workspace file tree triggers a browser download. The agent cannot read or write these formats either, because the required libraries (python-docx, openpyxl, python-pptx) are not installed in the agent environment. Users who want to work on a Word doc, spreadsheet, or presentation have to convert to plaintext manually before the agent can help.
Google Docs/Sheets/Slides are not integrated at all — users working in Google Workspace have no path from the WebUI to their documents.
What's missing, layer by layer
1. Agent can't read/write Office formats
The agent venv has none of the standard office libraries. Even if a .docx is in the workspace, execute_code cannot open it without python-docx.
Required additions to the agent venv:
python-docx— read/write.docxopenpyxl— read/write.xlsxpython-pptx— read/write.pptxpypdforpdfplumber— extract text from.pdf(PDFs are read-only by nature)
With these installed, the agent can already handle these formats via execute_code — no new tools needed.
2. No text extraction on upload
When a .docx or .pdf is uploaded to the workspace, its contents are opaque to the agent. A useful pattern: on upload, automatically extract the text content and write a sidecar .txt or .md file alongside it, so the agent can read the content without needing to parse the binary format itself.
This is optional but makes the common "review this document" workflow much smoother.
3. Workspace preview shows nothing for Office files
Clicking a .docx in the file tree downloads it. A basic improvement would be a text-content preview (extracted via python-docx/pdfplumber server-side) rendered in the preview pane, with a download button for the original. No editing — just "show me what's in here."
4. Google Docs/Sheets/Slides — no integration
There is a google-workspace skill for the Hermes CLI that wraps the Google Docs, Sheets, Drive, and Calendar APIs. None of it surfaces in the WebUI. Users working primarily in Google Workspace have no way to:
- Open a Google Doc and ask the agent to edit it
- Pull a Sheets range into a conversation
- Export a conversation result back to a Google Doc
A minimal integration would be: a "Google Docs" source option in workspace settings that authenticates via OAuth and lets the user browse and open Google Docs/Sheets as workspace files (read/write via the API).
This is significantly more complex than the Office library work and should be treated as a separate sub-feature or follow-on issue.
Suggested phasing
Phase 1 (library install + agent capability): Add python-docx, openpyxl, python-pptx, pypdf to requirements.txt. This alone unlocks all Office format work via execute_code. Low effort, high value.
Phase 2 (workspace preview): Server-side text extraction endpoint for Office files + PDF. Render extracted content in the workspace preview pane. No editing — download for that.
Phase 3 (upload sidecar extraction): On Office/PDF upload, optionally extract text to a sidecar .md file. Configurable.
Phase 4 (Google Workspace): OAuth flow + Google Docs/Sheets read/write in the workspace panel. Large scope — likely its own issue/sprint.
Files involved
requirements.txt— add office libs (Phase 1)api/workspace.py— text extraction endpoint (Phase 2)static/workspace.js— preview routing for Office/PDF extensions (Phase 2)api/upload.py— sidecar extraction on upload (Phase 3)- New:
api/google_workspace.py+ OAuth flow (Phase 4)
Multi-format office document support and Google Workspace integration span dependency management, upload pipelines, backend parsing, external API integration, and UI rendering.
- api/routes/workspace.py
- api/services/document_parser.py
- api/integrations/google_docs.py
- static/js/workspace/browser.js
- requirements.txt
- tests/test_workspace_documents.py
- infra/config/bootstrap.py
- api/models.py