@ audeu/ core (中文(简体) )
用于微软 Word (TypeScript 引擎) 的 AI 本地虚拟 DOM
@adeu/core 是一个零依赖性 TypeScript 库,允许AI代理和LLMs安全地读取并编辑出Microsoft Word(.docx)档案. 它将复杂的"OpenXML"翻译为有符号效率的"批评马克普"(Markdown)并应用AI文本编辑为"本地Word Tracked Changes and Comments".
这是纯类型脚本执行 阿德乌·平通 SDK,基于专门设计的 OOXML 解析器和 fflate 完全在节点运行.
安装
npm install @adeu/core
快速启动
import { readFileSync, writeFileSync } from "fs";
import {
DocumentObject,
RedlineEngine,
extractTextFromBuffer
} from "@adeu/core";
async function main() {
const buffer = readFileSync("contract.docx");
// 1. Extract to CriticMarkup for an LLM to read
const markdown = await extractTextFromBuffer(buffer, false);
console.log(markdown);
// 2. Load the document DOM
const doc = await DocumentObject.load(buffer);
const engine = new RedlineEngine(doc, "AI Reviewer");
// 3. Apply an edit as a native Tracked Change
engine.process_batch([
{
type: "modify",
target_text: "State of New York",
new_text: "State of Delaware",
match_mode: "all",
comment: "Standardizing governing law."
}
]);
// 4. Save the manipulated DOCX
const outBuffer = await doc.save();
writeFileSync("contract_redlined.docx", outBuffer);
}
main();
文档和支持
关于建筑细节、API的使用和项目章程,请访问 主 Adeu 存储器 或者我们 网站。 。 。 .