feat(candidate-me): add DOCX export format - #107
Merged
Conversation
- src/services/createDocx.ts (new): buildDocxContent()/renderDocxDocument()
content-model + renderer using the `docx` package; createCVDocx() packs
and streams the response with the correct OOXML content-type/filename.
- src/candidate_me/index.ts: fnExportPDF gains a `format === 'docx'` branch,
same shape/position as the existing `format === 'json'` branch, right
before the PDF fallback — reuses the same handlerGetAboutMe() call, no
duplicate data-fetch.
- src/routers/api/v1/index.ts: Swagger doc only — `/download-pdf`'s format
enum [pdf, json] -> [pdf, json, docx], added the docx response content
entry. No route/logic change.
- package.json/package-lock.json: added docx ^9.7.1 (MIT, no native deps).
- src/__tests__/services/createDocx.test.ts (new, 6 tests).
- agent-hub/haven/diagrams/dev-loop.prime-mermaid.md: add-docx-export-format
node PENDING -> SEALED.
npx tsc --noEmit: clean.
npm test: Test Suites: 11 passed, 11 total / Tests: 60 passed, 60 total /
Time: 4.611 s.
npm run build: clean.
Live-verified: GET /download-pdf?format=docx returns a real .docx (file(1)
confirms "Microsoft Word 2007+", document.xml contains the candidate's
real data); ?format=json and no-format (PDF) paths unaffected.
Node: add-docx-export-format (SEALED)
Evidence: agent-hub/evidence/implementer/2026-09-02/add-docx-export-format-{plan,diff}.md
agent-hub/evidence/verifier/2026-09-02/add-docx-export-format-seal.md
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merged
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.
Commits going into
staging:2c6e071 feat(candidate-me): add DOCX export format
Adds
?format=docxtoGET /api/v1/download-pdf(alongside existingpdf/json), via a newsrc/services/createDocx.tsusing thedocxpackage. Reuses the existing
handlerGetAboutMedata-fetch, no new query.Node
add-docx-export-formatSEALED — seeagent-hub/evidence/verifier/2026-09-02/add-docx-export-format-seal.md.Closes #76.