Repository navigation
feat(mcp): add clean_office tool (part of #61) - #93
Conversation
|
Hi @kingrishabdugar — opened #93 for clean_office, the first "no canvas" engine you suggested. Node adapter, MCP tool, and a test that opens the output and checks its contents. Also included a small Windows fixture-path fix (fileURLToPath) that was blocking the test suite on Windows. Next on my list is one of the Excel/CSV converters in src/engine/convert.ts — happy to start once this one lands, or in parallel if you prefer. |
|
Thanks a lot, @avanithumballi, and no worries at all about the timing, I hope the exams went well! This is a really nice first engine: it reuses Two small things before I merge:
Once those are in and CI is green, I'll merge it. And yes, an Excel/CSV converter from |
|
Done — both changes are in:
Pushed as b73a832. CI should re-run automatically. |
|
@kingrishabdugar check this once |
|
Merged, thank you @avanithumballi! 🎉 Whenever you're ready, the Excel/CSV converter from |
What does this change?
Adds the first "no canvas" engine from #61: a
clean_officeMCP tool that strips author, editor, company, title and embedded thumbnail from.docx/.xlsx/.pptxfiles, running entirely on disk with no network.Part of #61 (does not close it — the issue asks for several engines, one PR each).
Type of change
How did you test it?
tests/mcp.test.tscleans thereport.docxfixture, re-opens the written file withunzipSync, and checks the author is gone fromdocProps/core.xmlwhileword/document.xmlis still present. Runs withnpx vitest run tests/mcp.test.ts(11/11 pass).npx vitest run tests/mcp.test.tsexercisesclean_officeover the realInMemoryTransport, not just the engine.npx tsc --noEmitclean;npx vitest run214 passed / 1 failed (transcribe.test.ts, Windows CRLF line endings, fails onmaintoo);npm run build:mcppasses;npm run buildpasses with no Node code in the browser bundle;npx playwright test1139 passed / 1 failed (app.e2e.ts:378, pre-existing Windows touch-emulation issue, not in scope).Also in this PR: a Windows fixture-path fix.
new URL(..., import.meta.url).pathnamereturns/C:/Users/...on Windows, which Node resolves toC:\C:\Users\.... Two helpers switched tofileURLToPath. Without this,tests/mcp.test.tscouldn't run on Windows at all, and 26 e2e tests failed. This is a separate commit.Checklist
npm run checkpasses — see notes belownpm run test:e2epasses — 1139/1140, one pre-existing Windows touch-emulation failuresrc/i18n.ts(English) — N/A, this tool only runs on the MCP server, not in the browser UInode:bufferandfflate, both already in the projectNotes on
npm run check: I don't have that exact script name in my local checkout; I ran the equivalent commands the issue asked for —npx tsc --noEmit,npx vitest run,npm run build:mcp,npm run build,npx playwright test. Happy to runnpm run checkif it exists and I've missed it.