@adeu/core 1.6.8 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # @adeu/core
2
+
3
+ [![GitHub Repo stars](https://img.shields.io/github/stars/dealfluence/adeu?style=social)](https://github.com/dealfluence/adeu)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ **The AI-native Virtual DOM for Microsoft Word (TypeScript Engine)**
7
+
8
+ `@adeu/core` is a zero-dependency TypeScript library that allows AI agents and LLMs to safely read and edit Microsoft Word (`.docx`) files. It translates complex OpenXML into token-efficient CriticMarkup (Markdown) and applies AI text edits as native Word Tracked Changes and Comments.
9
+
10
+ This is the pure TypeScript implementation of the [Adeu Python SDK](https://github.com/dealfluence/adeu), built using `@xmldom/xmldom` and `jszip` to run entirely in Node.js.
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @adeu/core
16
+ ```
17
+
18
+ ## Quick Start
19
+
20
+ ```typescript
21
+ import { readFileSync, writeFileSync } from "fs";
22
+ import {
23
+ DocumentObject,
24
+ RedlineEngine,
25
+ extractTextFromBuffer
26
+ } from "@adeu/core";
27
+
28
+ async function main() {
29
+ const buffer = readFileSync("contract.docx");
30
+
31
+ // 1. Extract to CriticMarkup for an LLM to read
32
+ const markdown = await extractTextFromBuffer(buffer, false);
33
+ console.log(markdown);
34
+
35
+ // 2. Load the document DOM
36
+ const doc = await DocumentObject.load(buffer);
37
+ const engine = new RedlineEngine(doc, "AI Reviewer");
38
+
39
+ // 3. Apply an edit as a native Tracked Change
40
+ engine.process_batch([
41
+ {
42
+ type: "modify",
43
+ target_text: "State of New York",
44
+ new_text: "State of Delaware",
45
+ comment: "Standardizing governing law."
46
+ }
47
+ ]);
48
+
49
+ // 4. Save the manipulated DOCX
50
+ const outBuffer = await doc.save();
51
+ writeFileSync("contract_redlined.docx", outBuffer);
52
+ }
53
+
54
+ main();
55
+ ```
56
+
57
+ ## Documentation & Support
58
+ For full architectural details, API usage, and the project constitution, please visit the [main Adeu repository](https://github.com/dealfluence/adeu) or our [website](https://adeu.ai).