@lawpath-tech/docx-editor-agents
v0.0.32
Published
Agent-friendly API for DOCX document review — read, comment, propose changes, accept/reject tracked changes
Maintainers
Readme
@lawpath-tech/docx-editor-agents
Word-like API for AI document review. Add comments, suggest replacements, accept/reject tracked changes — all headless, no DOM required.
Install
npm install @lawpath-tech/docx-editor-agentsUsage
import { DocxReviewer } from '@lawpath-tech/docx-editor-agents';
const reviewer = await DocxReviewer.fromBuffer(buffer, 'AI Reviewer');
// Read
const text = reviewer.getContentAsText();
// Comment
reviewer.addComment(5, 'This cap seems too low.');
// Replace (tracked change)
reviewer.replace(5, '$50k', '$500k');
// Batch from LLM response
reviewer.applyReview({
comments: [{ paragraphIndex: 5, text: 'Too low.' }],
proposals: [{ paragraphIndex: 5, search: '$50k', replaceWith: '$500k' }],
});
// Export
const output = await reviewer.toBuffer();License
AGPL-3.0 — free to use and modify, but you must open-source your code. For commercial licensing without AGPL obligations, contact [email protected].
