fix: support officeparser exports in Bun - #3
Merged
Conversation
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.
Intent
Fix the public opencode-rich-document-reader plugin so its live read_rich_document tool parses the captain's valid DOCX in the OpenCode/Bun runtime. The supplied source is /Users/ddbaron/naventix/jobtracker-mvc/docs/maint-div/Pesticide Application Records.docx; never modify that source project or DOCX, and when smoke-testing a disposable copy invoke it with the project-relative path docs/maint-div/Pesticide Application Records.docx. Compare the direct Node TypeScript reader, which succeeds with officeparser 7.5.1, against the OpenCode/Bun plugin-loading path and fix the ESM/CJS interop boundary with the smallest robust support for named, default, and top-level parser exports without assuming named OfficeParser is available. Preserve project path safety, parser limits, media extraction, export behavior, and existing error semantics. Add behavior regression coverage through the reader/public behavior or a narrowly injected parser dependency that fails for the broken export shape, plus a real supplied-DOCX smoke that verifies readable content and metadata. The committed branch must not ship the captain's DOCX: CI must not depend on a tracked captain file, and the supplied-file smoke must use an explicit external smoke root/path or generated fixture; retain and rerun the real-file smoke evidence. Review and remove disposable scratch configs/artifacts. Run the repository check and test commands. Do not implement any JobTracker feature or modify the JobTracker repository. If the actual cause is only stale installed-plugin cache or session reload rather than code, prove that with a fresh install/load test and report the required operator action instead of making an unrelated code change. Do not make further product changes unless a no-mistakes validation gate requires a fix.
What Changed
officeparserthrough named, default, and top-level exports while preserving the parser receiver and existing format configuration.Risk Assessment
✅ Low: The change is narrowly scoped to officeparser export resolution, preserves the existing reader boundaries, and adds behavior-oriented regression and opt-in external smoke coverage.
Testing
Focused regression tests, the real supplied-DOCX test, and an isolated OpenCode/Bun public-tool smoke passed. The direct and public results matched, content and metadata were readable, the source hash was unchanged, and transient dependencies/smoke files were removed. Full-suite and typecheck commands were not run in this assigned targeted-test phase.
Evidence: OpenCode Bun public-tool supplied-DOCX smoke
Evidence: OpenCode plugin registration smoke
Evidence: Supplied DOCX regression test
Evidence: Direct Node versus public plugin comparison
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
node --experimental-strip-types --test --test-name-pattern='plugin registration|resolves named, default, and top-level officeparser exports|extracts DOCX structure, media, and section association' test/read-rich-document.test.tsOPENCODE_RICH_DOCUMENT_SMOKE_ROOT="/Users/ddbaron/naventix/jobtracker-mvc" node --experimental-strip-types --test --test-name-pattern='reads the supplied pesticide records DOCX with content and metadata' test/read-rich-document.test.tsDirect Node reader andRichDocumentReaderPlugin(...).tool.read_rich_document.execute(...)comparison usingdocs/maint-div/Pesticide Application Records.docxIsolatedopencode serve --hostname 127.0.0.1 --port 0 --log-level ERRORplugin-load smoke followed byGET /experimental/tool/ids?directory=...; the public tool executed under Bun 1.3.14Transient-artifact review withgit status --shortandgit ls-files '*.docx' '*.odt' '*.pptx'✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.