Packages
@eigenpal/docx-editor-agents
Agent toolkit. 14 tools, three transports (live editor, headless, MCP). Apache 2.0, relicensed from AGPL in 1.0.
What's in it
14 document-editing tools, three transports. Same tool shapes everywhere; pick the transport that fits where the agent runs.
| Transport | API | Use case |
|---|---|---|
| Live editor | useDocxAgentTools (React or Vue) | Agent calls land on a <DocxEditor> running in a user's browser. Comments and tracked changes show up as they happen. |
| Headless | DocxReviewer (Node) | Server-side batch. Parse buffer, run the agent, get the modified buffer back. No DOM. |
| MCP | McpServer | Expose the tool catalog over JSON-RPC. Any MCP-compatible client can drive it. |
npm install @eigenpal/docx-editor-agentsSubpaths
@eigenpal/docx-editor-agents:DocxReviewer,agentTools,getToolSchemas,executeToolCall@eigenpal/docx-editor-agents/react:useDocxAgentTools,useAgentChat,getToolDisplayName@eigenpal/docx-editor-agents/vue: Vue composables matching the React hooks@eigenpal/docx-editor-agents/server: server-side types@eigenpal/docx-editor-agents/ai-sdk/server:getAiSdkTools()for Vercel AI SDKstreamText@eigenpal/docx-editor-agents/ai-sdk/react:toAgentMessages()to bridge AI SDKUIMessage[]into<AgentChatLog>shape@eigenpal/docx-editor-agents/bridge: lower-level transport for non-React hosts@eigenpal/docx-editor-agents/mcp:McpServerfor MCP integration
Full surface in the API reference for @eigenpal/docx-editor-agents.
The 14 tools
- Locate (7):
read_document,read_selection,read_page,read_pages,find_text,read_comments,read_changes - Mutate (6):
add_comment,suggest_change,apply_formatting,set_paragraph_style,reply_comment,resolve_comment - Navigate (1):
scroll
Locate-then-mutate. Locate tools return paragraphs tagged with paraId (Word's built-in w14:paraId attribute); mutate tools take paraId as input. paraId survives concurrent edits, agent loop iterations, and tool calls. So an agent can find_text in turn 1 and add_comment on the same paragraph in turn 5 without re-resolving.
Where to next
- Live editor, wire
useDocxAgentTools+ AI SDK into a<DocxEditor> - Bring your own agent: Vercel AI SDK, OpenAI, Anthropic, LangChain
- Word JS API parity: Office.js verb mapping, compile-time-enforced
- API reference