@usejunior/docx-mcp 0.9.1 → 0.11.0

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.
Files changed (160) hide show
  1. package/LICENSE +202 -21
  2. package/NOTICE +2 -0
  3. package/README.md +47 -2
  4. package/dist/.tsbuildinfo +1 -1
  5. package/dist/cli/commands/edit.d.ts.map +1 -1
  6. package/dist/cli/commands/edit.js +2 -1
  7. package/dist/cli/commands/edit.js.map +1 -1
  8. package/dist/cli/commands/grep.d.ts.map +1 -1
  9. package/dist/cli/commands/grep.js +2 -1
  10. package/dist/cli/commands/grep.js.map +1 -1
  11. package/dist/cli/help.d.ts.map +1 -1
  12. package/dist/cli/help.js +1 -0
  13. package/dist/cli/help.js.map +1 -1
  14. package/dist/cli/tool_runner.d.ts +6 -0
  15. package/dist/cli/tool_runner.d.ts.map +1 -1
  16. package/dist/cli/tool_runner.js +10 -1
  17. package/dist/cli/tool_runner.js.map +1 -1
  18. package/dist/odf_loader.d.ts +2 -0
  19. package/dist/odf_loader.d.ts.map +1 -0
  20. package/dist/odf_loader.js +20 -0
  21. package/dist/odf_loader.js.map +1 -0
  22. package/dist/server.d.ts +8 -2
  23. package/dist/server.d.ts.map +1 -1
  24. package/dist/server.js +113 -4
  25. package/dist/server.js.map +1 -1
  26. package/dist/session/manager.d.ts +48 -2
  27. package/dist/session/manager.d.ts.map +1 -1
  28. package/dist/session/manager.js +175 -7
  29. package/dist/session/manager.js.map +1 -1
  30. package/dist/tool_catalog.d.ts +56 -12
  31. package/dist/tool_catalog.d.ts.map +1 -1
  32. package/dist/tool_catalog.js +69 -17
  33. package/dist/tool_catalog.js.map +1 -1
  34. package/dist/tools/accept_changes.js +1 -1
  35. package/dist/tools/accept_changes.js.map +1 -1
  36. package/dist/tools/add_comment.d.ts.map +1 -1
  37. package/dist/tools/add_comment.js +21 -5
  38. package/dist/tools/add_comment.js.map +1 -1
  39. package/dist/tools/add_footnote.d.ts.map +1 -1
  40. package/dist/tools/add_footnote.js +15 -3
  41. package/dist/tools/add_footnote.js.map +1 -1
  42. package/dist/tools/ai_revision_guard.d.ts +38 -0
  43. package/dist/tools/ai_revision_guard.d.ts.map +1 -0
  44. package/dist/tools/ai_revision_guard.js +115 -0
  45. package/dist/tools/ai_revision_guard.js.map +1 -0
  46. package/dist/tools/apply_plan.d.ts.map +1 -1
  47. package/dist/tools/apply_plan.js +55 -5
  48. package/dist/tools/apply_plan.js.map +1 -1
  49. package/dist/tools/clear_formatting.d.ts +2 -1
  50. package/dist/tools/clear_formatting.d.ts.map +1 -1
  51. package/dist/tools/clear_formatting.js +84 -61
  52. package/dist/tools/clear_formatting.js.map +1 -1
  53. package/dist/tools/compare_documents.d.ts.map +1 -1
  54. package/dist/tools/compare_documents.js +11 -2
  55. package/dist/tools/compare_documents.js.map +1 -1
  56. package/dist/tools/convert_to_odt.d.ts +20 -0
  57. package/dist/tools/convert_to_odt.d.ts.map +1 -0
  58. package/dist/tools/convert_to_odt.js +74 -0
  59. package/dist/tools/convert_to_odt.js.map +1 -0
  60. package/dist/tools/delete_comment.d.ts.map +1 -1
  61. package/dist/tools/delete_comment.js +12 -1
  62. package/dist/tools/delete_comment.js.map +1 -1
  63. package/dist/tools/delete_footnote.d.ts.map +1 -1
  64. package/dist/tools/delete_footnote.js +12 -1
  65. package/dist/tools/delete_footnote.js.map +1 -1
  66. package/dist/tools/export.d.ts +20 -0
  67. package/dist/tools/export.d.ts.map +1 -0
  68. package/dist/tools/export.js +96 -0
  69. package/dist/tools/export.js.map +1 -0
  70. package/dist/tools/format_layout.d.ts.map +1 -1
  71. package/dist/tools/format_layout.js +21 -3
  72. package/dist/tools/format_layout.js.map +1 -1
  73. package/dist/tools/get_comments.d.ts.map +1 -1
  74. package/dist/tools/get_comments.js +9 -0
  75. package/dist/tools/get_comments.js.map +1 -1
  76. package/dist/tools/grep.d.ts.map +1 -1
  77. package/dist/tools/grep.js +4 -115
  78. package/dist/tools/grep.js.map +1 -1
  79. package/dist/tools/grep_core.d.ts +49 -0
  80. package/dist/tools/grep_core.d.ts.map +1 -0
  81. package/dist/tools/grep_core.js +126 -0
  82. package/dist/tools/grep_core.js.map +1 -0
  83. package/dist/tools/insert_paragraph.d.ts +7 -1
  84. package/dist/tools/insert_paragraph.d.ts.map +1 -1
  85. package/dist/tools/insert_paragraph.js +39 -27
  86. package/dist/tools/insert_paragraph.js.map +1 -1
  87. package/dist/tools/odf/add_comment.d.ts +21 -0
  88. package/dist/tools/odf/add_comment.d.ts.map +1 -0
  89. package/dist/tools/odf/add_comment.js +64 -0
  90. package/dist/tools/odf/add_comment.js.map +1 -0
  91. package/dist/tools/odf/close_file.d.ts +4 -0
  92. package/dist/tools/odf/close_file.d.ts.map +1 -0
  93. package/dist/tools/odf/close_file.js +16 -0
  94. package/dist/tools/odf/close_file.js.map +1 -0
  95. package/dist/tools/odf/compare_documents.d.ts +39 -0
  96. package/dist/tools/odf/compare_documents.d.ts.map +1 -0
  97. package/dist/tools/odf/compare_documents.js +156 -0
  98. package/dist/tools/odf/compare_documents.js.map +1 -0
  99. package/dist/tools/odf/get_comments.d.ts +11 -0
  100. package/dist/tools/odf/get_comments.d.ts.map +1 -0
  101. package/dist/tools/odf/get_comments.js +32 -0
  102. package/dist/tools/odf/get_comments.js.map +1 -0
  103. package/dist/tools/odf/get_file_status.d.ts +4 -0
  104. package/dist/tools/odf/get_file_status.d.ts.map +1 -0
  105. package/dist/tools/odf/get_file_status.js +28 -0
  106. package/dist/tools/odf/get_file_status.js.map +1 -0
  107. package/dist/tools/odf/grep.d.ts +19 -0
  108. package/dist/tools/odf/grep.d.ts.map +1 -0
  109. package/dist/tools/odf/grep.js +81 -0
  110. package/dist/tools/odf/grep.js.map +1 -0
  111. package/dist/tools/odf/insert_paragraph.d.ts +19 -0
  112. package/dist/tools/odf/insert_paragraph.d.ts.map +1 -0
  113. package/dist/tools/odf/insert_paragraph.js +50 -0
  114. package/dist/tools/odf/insert_paragraph.js.map +1 -0
  115. package/dist/tools/odf/read_file.d.ts +9 -0
  116. package/dist/tools/odf/read_file.d.ts.map +1 -0
  117. package/dist/tools/odf/read_file.js +124 -0
  118. package/dist/tools/odf/read_file.js.map +1 -0
  119. package/dist/tools/odf/replace_text.d.ts +9 -0
  120. package/dist/tools/odf/replace_text.d.ts.map +1 -0
  121. package/dist/tools/odf/replace_text.js +41 -0
  122. package/dist/tools/odf/replace_text.js.map +1 -0
  123. package/dist/tools/odf/save.d.ts +7 -0
  124. package/dist/tools/odf/save.d.ts.map +1 -0
  125. package/dist/tools/odf/save.js +48 -0
  126. package/dist/tools/odf/save.js.map +1 -0
  127. package/dist/tools/open_document.d.ts.map +1 -1
  128. package/dist/tools/open_document.js +36 -4
  129. package/dist/tools/open_document.js.map +1 -1
  130. package/dist/tools/path_policy.d.ts +9 -0
  131. package/dist/tools/path_policy.d.ts.map +1 -1
  132. package/dist/tools/path_policy.js +66 -5
  133. package/dist/tools/path_policy.js.map +1 -1
  134. package/dist/tools/provider_guard.d.ts +1 -0
  135. package/dist/tools/provider_guard.d.ts.map +1 -1
  136. package/dist/tools/provider_guard.js +10 -0
  137. package/dist/tools/provider_guard.js.map +1 -1
  138. package/dist/tools/read_file.d.ts +3 -0
  139. package/dist/tools/read_file.d.ts.map +1 -1
  140. package/dist/tools/read_file.js +384 -52
  141. package/dist/tools/read_file.js.map +1 -1
  142. package/dist/tools/replace_text.d.ts +7 -1
  143. package/dist/tools/replace_text.d.ts.map +1 -1
  144. package/dist/tools/replace_text.js +74 -48
  145. package/dist/tools/replace_text.js.map +1 -1
  146. package/dist/tools/save.d.ts +19 -0
  147. package/dist/tools/save.d.ts.map +1 -1
  148. package/dist/tools/save.js +161 -13
  149. package/dist/tools/save.js.map +1 -1
  150. package/dist/tools/session_resolution.d.ts +25 -1
  151. package/dist/tools/session_resolution.d.ts.map +1 -1
  152. package/dist/tools/session_resolution.js +179 -2
  153. package/dist/tools/session_resolution.js.map +1 -1
  154. package/dist/tools/tag_parser.d.ts.map +1 -1
  155. package/dist/tools/tag_parser.js +69 -14
  156. package/dist/tools/tag_parser.js.map +1 -1
  157. package/dist/tools/update_footnote.d.ts.map +1 -1
  158. package/dist/tools/update_footnote.js +20 -7
  159. package/dist/tools/update_footnote.js.map +1 -1
  160. package/package.json +21 -16
@@ -2,21 +2,143 @@ import { randomBytes } from 'node:crypto';
2
2
  import path from 'node:path';
3
3
  import os from 'node:os';
4
4
  import fs from 'node:fs/promises';
5
- import { DocxDocument, } from '@usejunior/docx-core';
5
+ import { DocxDocument, DocxZip, REVISION_ID_ELEMENT_NAME_SET, enumerateRevisionStoryPartPaths, createRevisionContext, createRevisionIdState, parseXml, } from '@usejunior/docx-core';
6
+ const WORDPROCESSING_ML_NS = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main';
7
+ /**
8
+ * WordprocessingML elements that carry package-wide revision `w:id` attributes.
9
+ * Limiting the seed scan to these elements prevents non-revision IDs (e.g.,
10
+ * `<w:comment w:id>`, `<w:footnote w:id>`, `<w:bookmarkStart w:id>`) from
11
+ * spuriously inflating the starting revision-id counter.
12
+ */
13
+ function normalizeAiAuthor(author) {
14
+ if (typeof author !== 'string')
15
+ return null;
16
+ const trimmed = author.trim();
17
+ return trimmed.length > 0 ? trimmed : null;
18
+ }
19
+ function getWordIdValue(element) {
20
+ const raw = element.getAttributeNS(WORDPROCESSING_ML_NS, 'id')
21
+ ?? element.getAttribute('w:id')
22
+ ?? element.getAttribute('id');
23
+ if (raw === null)
24
+ return null;
25
+ const parsed = Number.parseInt(raw, 10);
26
+ return Number.isFinite(parsed) ? parsed : null;
27
+ }
28
+ /**
29
+ * Compute a starting `RevisionIdState` whose first allocated `w:id` is
30
+ * higher than any existing revision id found in the supplied documents.
31
+ *
32
+ * Only `w:id` attributes on revision-bearing elements
33
+ * (`REVISION_ID_ELEMENT_LOCAL_NAMES`) are considered. Non-revision IDs such
34
+ * as `<w:comment w:id>` or `<w:footnote w:id>` share the attribute name but
35
+ * occupy a different ID space and must not influence the counter.
36
+ *
37
+ * Callers should pass every available story/metadata part that can contain
38
+ * package-wide revision attributes, not just `document.xml`.
39
+ */
40
+ export function inferStartingRevisionIdState(...docs) {
41
+ let maxId = 0;
42
+ for (const doc of docs) {
43
+ for (const node of Array.from(doc.getElementsByTagName('*'))) {
44
+ const localName = node.localName ?? '';
45
+ if (!REVISION_ID_ELEMENT_NAME_SET.has(localName))
46
+ continue;
47
+ if (node.namespaceURI && node.namespaceURI !== WORDPROCESSING_ML_NS)
48
+ continue;
49
+ const value = getWordIdValue(node);
50
+ if (value !== null && value > maxId) {
51
+ maxId = value;
52
+ }
53
+ }
54
+ }
55
+ return createRevisionIdState(maxId + 1);
56
+ }
57
+ export async function getSidePartRevisionSeedDocs(buffer) {
58
+ const docs = [];
59
+ let zip;
60
+ try {
61
+ zip = await DocxZip.load(buffer);
62
+ }
63
+ catch {
64
+ return docs;
65
+ }
66
+ for (const partPath of enumerateRevisionStoryPartPaths(zip)) {
67
+ if (!zip.hasFile(partPath))
68
+ continue;
69
+ let xml;
70
+ try {
71
+ xml = await zip.readTextOrNull(partPath);
72
+ }
73
+ catch {
74
+ continue;
75
+ }
76
+ if (!xml)
77
+ continue;
78
+ try {
79
+ docs.push(parseXml(xml));
80
+ }
81
+ catch {
82
+ // Malformed optional side part — skip so an unrelated parse failure
83
+ // does not block every tracked edit on the session.
84
+ }
85
+ }
86
+ return docs;
87
+ }
88
+ /**
89
+ * Single-flight guard around the first revision-id seed scan per session.
90
+ * Concurrent first callers await the same in-flight scan and assign the same
91
+ * result, preventing a slower scan from clobbering a counter that a faster
92
+ * caller has already advanced via emitted revisions.
93
+ */
94
+ const revisionIdSeedPromises = new WeakMap();
95
+ export async function getRevisionContextForSession(session) {
96
+ if (!session.aiAuthor)
97
+ return undefined;
98
+ if (!session.revisionIdState) {
99
+ let pending = revisionIdSeedPromises.get(session);
100
+ if (!pending) {
101
+ pending = (async () => {
102
+ const sideDocs = await getSidePartRevisionSeedDocs(session.originalBuffer);
103
+ return inferStartingRevisionIdState(session.doc.getDocumentXmlClone(), ...sideDocs);
104
+ })();
105
+ revisionIdSeedPromises.set(session, pending);
106
+ }
107
+ try {
108
+ const seeded = await pending;
109
+ if (!session.revisionIdState) {
110
+ session.revisionIdState = seeded;
111
+ }
112
+ }
113
+ finally {
114
+ revisionIdSeedPromises.delete(session);
115
+ }
116
+ }
117
+ return createRevisionContext({
118
+ author: session.aiAuthor,
119
+ date: new Date(),
120
+ idState: session.revisionIdState,
121
+ });
122
+ }
6
123
  export function isDocxSession(s) {
7
124
  return s.provider === 'docx';
8
125
  }
9
126
  export function isGDocsSession(s) {
10
127
  return s.provider === 'gdocs';
11
128
  }
129
+ export function isOdfSession(s) {
130
+ return s.provider === 'odf';
131
+ }
12
132
  export class SessionManager {
13
133
  /** Sessions keyed by canonical file path (realpath). */
14
134
  sessions = new Map();
15
135
  ttlMs;
136
+ defaultAiAuthor;
16
137
  /** Concurrency guard: prevents double-generation of baselines for the same session. */
17
138
  baselinePromises = new WeakMap();
18
139
  constructor(opts) {
19
140
  this.ttlMs = opts?.ttlMs ?? 60 * 60 * 1000;
141
+ this.defaultAiAuthor = normalizeAiAuthor(opts?.defaultAiAuthor);
20
142
  }
21
143
  expandPath(inputPath) {
22
144
  return inputPath.startsWith('~')
@@ -71,6 +193,8 @@ export class SessionManager {
71
193
  comparisonBaseline: null,
72
194
  comparisonBaselineWithBookmarks: null,
73
195
  doc,
196
+ aiAuthor: this.defaultAiAuthor,
197
+ revisionIdState: null,
74
198
  editCount: 0,
75
199
  editRevision: 0,
76
200
  saveCache: new Map(),
@@ -83,6 +207,41 @@ export class SessionManager {
83
207
  this.sessions.set(canonicalPath, session);
84
208
  return session;
85
209
  }
210
+ /**
211
+ * Create an ODF session from an already-loaded `archive` + `doc`. The caller (the
212
+ * lazily-reached ODF resolver / open path) loads these via the optional odf-core
213
+ * provider — this method does NOT import odf-core, keeping the always-loaded
214
+ * SessionManager free of a hard dependency on the private package.
215
+ */
216
+ async createOdfSession(documentContent, filename, originalPath, archive, doc) {
217
+ const canonicalPath = await this.canonicalizePath(originalPath);
218
+ const existing = this.sessions.get(canonicalPath);
219
+ if (existing) {
220
+ await this.cleanupSessionArtifacts(existing);
221
+ }
222
+ const sessionId = this.newSessionId();
223
+ const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'safe-odf-'));
224
+ const tmpPath = path.join(dir, filename);
225
+ await fs.writeFile(tmpPath, new Uint8Array(documentContent));
226
+ const now = new Date();
227
+ const session = {
228
+ provider: 'odf',
229
+ sessionId,
230
+ filename,
231
+ tmpPath,
232
+ originalPath,
233
+ originalBuffer: Buffer.from(documentContent),
234
+ archive,
235
+ doc,
236
+ editCount: 0,
237
+ editRevision: 0,
238
+ createdAt: now,
239
+ lastAccessedAt: now,
240
+ expiresAt: new Date(now.getTime() + this.ttlMs),
241
+ };
242
+ this.sessions.set(canonicalPath, session);
243
+ return session;
244
+ }
86
245
  /**
87
246
  * Finalize a newly created session by normalizing the document and inserting
88
247
  * paragraph bookmarks. Baselines are lazily generated on first save/compare.
@@ -126,10 +285,12 @@ export class SessionManager {
126
285
  const doc = await DocxDocument.load(session.originalBuffer);
127
286
  doc.normalize();
128
287
  doc.insertParagraphBookmarks('_baseline');
129
- const [clean, bookmarked] = await Promise.all([
130
- doc.toBuffer({ cleanBookmarks: true }),
131
- doc.toBuffer({ cleanBookmarks: false }),
132
- ]);
288
+ // Sequential on purpose: toBuffer() temporarily swaps document.xml inside
289
+ // the shared zip, so concurrent calls on one document race on that state.
290
+ // Baselines stay fully normalized (no minimalReserialization) the
291
+ // comparison pipeline expects normalized-vs-normalized inputs.
292
+ const clean = await doc.toBuffer({ cleanBookmarks: true });
293
+ const bookmarked = await doc.toBuffer({ cleanBookmarks: false });
133
294
  session.comparisonBaseline = clean.buffer;
134
295
  session.comparisonBaselineWithBookmarks = bookmarked.buffer;
135
296
  }
@@ -168,7 +329,7 @@ export class SessionManager {
168
329
  throw new Error(`SESSION_NOT_FOUND:${sessionId}`);
169
330
  }
170
331
  async cleanupSessionArtifacts(session) {
171
- if (isDocxSession(session)) {
332
+ if (isDocxSession(session) || isOdfSession(session)) {
172
333
  const tmpDir = path.dirname(session.tmpPath);
173
334
  await fs.rm(tmpDir, { recursive: true, force: true }).catch(() => undefined);
174
335
  }
@@ -254,8 +415,15 @@ export class SessionManager {
254
415
  return session;
255
416
  }
256
417
  async saveTo(session, savePath, opts) {
257
- const { buffer } = await session.doc.toBuffer({ cleanBookmarks: opts?.cleanBookmarks ?? true });
418
+ const cleanBookmarks = opts?.cleanBookmarks ?? true;
419
+ const { buffer } = await session.doc.toBuffer({ cleanBookmarks, minimalReserialization: cleanBookmarks });
420
+ await fs.writeFile(savePath, new Uint8Array(buffer));
421
+ }
422
+ async saveOdfTo(session, savePath) {
423
+ session.archive.setContentXml(session.doc.toXml());
424
+ const buffer = await session.archive.save();
258
425
  await fs.writeFile(savePath, new Uint8Array(buffer));
426
+ return buffer;
259
427
  }
260
428
  }
261
429
  //# sourceMappingURL=manager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/session/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EACL,YAAY,GAMb,MAAM,sBAAsB,CAAC;AA6E9B,MAAM,UAAU,aAAa,CAAC,CAAU;IACtC,OAAO,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,CAAU;IACvC,OAAO,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC;AAChC,CAAC;AAED,MAAM,OAAO,cAAc;IACzB,wDAAwD;IAChD,QAAQ,GAAG,IAAI,GAAG,EAAmB,CAAC;IACtC,KAAK,CAAS;IAEtB,uFAAuF;IAC/E,g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YACZ,YAAY,EAAE,CAAC;YACf,SAAS,EAAE,GAAG;YACd,cAAc,EAAE,GAAG;YACnB,SAAS,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;SAChD,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACvC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAoB,EAAE,QAAgB,EAAE,IAAmC;QACtF,MAAM,cAAc,GAAG,IAAI,EAAE,cAAc,IAAI,IAAI,CAAC;QACpD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,sBAAsB,EAAE,cAAc,EAAE,CAAC,CAAC;QAC1G,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAmB,EAAE,QAAgB;QACnD,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAC5C,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QACrD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
3
3
  readonly name: "read_file";
4
- readonly description: "Read document content (DOCX or Google Doc). Output is token-limited (~14k tokens) by default with pagination metadata (has_more, next_offset). Use offset/limit to paginate.";
4
+ readonly description: "Read document content (DOCX, ODT, or Google Doc). Output is token-limited (~14k tokens) by default with pagination metadata (has_more, next_offset). Use offset/limit to paginate.";
5
5
  readonly input: z.ZodObject<{
6
6
  offset: z.ZodOptional<z.ZodNumber>;
7
7
  limit: z.ZodOptional<z.ZodNumber>;
@@ -11,7 +11,15 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
11
11
  json: "json";
12
12
  simple: "simple";
13
13
  }>>;
14
+ comment_rendering: z.ZodOptional<z.ZodEnum<{
15
+ none: "none";
16
+ paragraph_notes: "paragraph_notes";
17
+ endnotes: "endnotes";
18
+ inline_markers: "inline_markers";
19
+ }>>;
14
20
  show_formatting: z.ZodOptional<z.ZodBoolean>;
21
+ include_fingerprint: z.ZodOptional<z.ZodBoolean>;
22
+ include_footnotes: z.ZodOptional<z.ZodBoolean>;
15
23
  google_doc_id: z.ZodOptional<z.ZodString>;
16
24
  file_path: z.ZodOptional<z.ZodString>;
17
25
  }, z.core.$strip>;
@@ -21,7 +29,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
21
29
  };
22
30
  }, {
23
31
  readonly name: "grep";
24
- readonly description: "Search paragraphs with regex. Use file_path for session-based search, file_paths for stateless multi-file search, or google_doc_id for Google Docs.";
32
+ readonly description: "Search paragraphs with regex. Use file_path for session-based search, file_paths for stateless multi-file search, or google_doc_id for Google Docs. ODT supported via file_path (single-file) only.";
25
33
  readonly input: z.ZodObject<{
26
34
  file_paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
27
35
  patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -78,7 +86,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
78
86
  };
79
87
  }, {
80
88
  readonly name: "replace_text";
81
- readonly description: "Replace text in a paragraph by _bk_* id, preserving formatting. Supports DOCX and Google Docs.";
89
+ readonly description: "Replace text in a paragraph by provider paragraph id, preserving formatting where supported. Supports DOCX, ODT, and Google Docs.";
82
90
  readonly input: z.ZodObject<{
83
91
  target_paragraph_id: z.ZodString;
84
92
  old_string: z.ZodString;
@@ -94,7 +102,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
94
102
  };
95
103
  }, {
96
104
  readonly name: "insert_paragraph";
97
- readonly description: "Insert a paragraph before/after an anchor paragraph by _bk_* id. Supports DOCX and Google Docs.";
105
+ readonly description: "Insert a paragraph before/after an anchor paragraph by paragraph id. Supports DOCX, ODT, and Google Docs. (ODT paragraph ids are positional and shift after insertion — re-read before further edits.)";
98
106
  readonly input: z.ZodObject<{
99
107
  positional_anchor_node_id: z.ZodString;
100
108
  new_string: z.ZodString;
@@ -113,7 +121,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
113
121
  };
114
122
  }, {
115
123
  readonly name: "save";
116
- readonly description: "Save document. For DOCX: saves clean and/or tracked changes output. For Google Docs: checkpoint (default) returns revisionId, or snapshot exports as DOCX.";
124
+ readonly description: "Save document. For DOCX: saves clean and/or tracked changes output. For ODT: saves an .odt package. For Google Docs: checkpoint (default) returns revisionId, or snapshot exports as DOCX.";
117
125
  readonly input: z.ZodObject<{
118
126
  save_to_local_path: z.ZodString;
119
127
  clean_bookmarks: z.ZodOptional<z.ZodBoolean>;
@@ -137,6 +145,36 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
137
145
  readonly readOnlyHint: false;
138
146
  readonly destructiveHint: true;
139
147
  };
148
+ }, {
149
+ readonly name: "export";
150
+ readonly description: "Export a document to a portable rendering (Markdown, semantic HTML, or plain text). Writes an output file (default: source path with the format extension, e.g. .md, .html, or .txt) and returns its path, byte count, and the rendered content (under `content`). Intentionally lossy (no round-trip); HTML is the semantic tier, not pixel-faithful. DOCX only — Google Docs is not supported.";
151
+ readonly input: z.ZodObject<{
152
+ format: z.ZodOptional<z.ZodEnum<{
153
+ html: "html";
154
+ plaintext: "plaintext";
155
+ markdown: "markdown";
156
+ }>>;
157
+ output_path: z.ZodOptional<z.ZodString>;
158
+ allow_overwrite: z.ZodOptional<z.ZodBoolean>;
159
+ include_markdown: z.ZodOptional<z.ZodBoolean>;
160
+ file_path: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>;
162
+ readonly annotations: {
163
+ readonly readOnlyHint: false;
164
+ readonly destructiveHint: false;
165
+ };
166
+ }, {
167
+ readonly name: "convert_to_odt";
168
+ readonly description: "Convert a DOCX document to OpenDocument Text (.odt) using the native model-to-model converter (no LibreOffice involved). Writes the .odt (default: source path with the .odt extension), validates ODF packaging safety before writing, and returns the output path plus a `lossiness` summary itemizing every downgraded construct. Conversion is semantic and intentionally lossy: text, headings, bold/italic/underline, hyperlinks, lists, and tables are mapped; richer styling, tracked changes, comments, and headers/footers are not. DOCX in, ODT out — Google Docs and .odt inputs are not supported.";
169
+ readonly input: z.ZodObject<{
170
+ output_path: z.ZodOptional<z.ZodString>;
171
+ allow_overwrite: z.ZodOptional<z.ZodBoolean>;
172
+ file_path: z.ZodOptional<z.ZodString>;
173
+ }, z.core.$strip>;
174
+ readonly annotations: {
175
+ readonly readOnlyHint: false;
176
+ readonly destructiveHint: false;
177
+ };
140
178
  }, {
141
179
  readonly name: "format_layout";
142
180
  readonly description: "Apply layout controls (paragraph spacing, table row height, cell padding). Google Docs supports paragraph spacing only.";
@@ -201,7 +239,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
201
239
  };
202
240
  }, {
203
241
  readonly name: "get_file_status";
204
- readonly description: "Get file/session metadata including edit count, normalization stats, and cache info. Supports DOCX and Google Docs.";
242
+ readonly description: "Get file/session metadata including edit count, normalization stats, and cache info. Supports DOCX, ODT, and Google Docs.";
205
243
  readonly input: z.ZodObject<{
206
244
  google_doc_id: z.ZodOptional<z.ZodString>;
207
245
  file_path: z.ZodOptional<z.ZodString>;
@@ -212,7 +250,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
212
250
  };
213
251
  }, {
214
252
  readonly name: "close_file";
215
- readonly description: "Close an open file session, or close all sessions with explicit confirmation. Supports DOCX and Google Docs.";
253
+ readonly description: "Close an open file session, or close all sessions with explicit confirmation. Supports DOCX, ODT, and Google Docs.";
216
254
  readonly input: z.ZodObject<{
217
255
  clear_all: z.ZodOptional<z.ZodBoolean>;
218
256
  confirm: z.ZodOptional<z.ZodBoolean>;
@@ -225,7 +263,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
225
263
  };
226
264
  }, {
227
265
  readonly name: "add_comment";
228
- readonly description: "Add a comment or threaded reply to a document. Provide target_paragraph_id + anchor_text for root comments, or parent_comment_id for replies.";
266
+ readonly description: "Add a comment or threaded reply to a document. Provide target_paragraph_id + anchor_text for root comments, or parent_comment_id for replies. Supports DOCX and ODT (ODT backs comments with office:annotation; threaded replies are DOCX-only).";
229
267
  readonly input: z.ZodObject<{
230
268
  target_paragraph_id: z.ZodOptional<z.ZodString>;
231
269
  anchor_text: z.ZodOptional<z.ZodString>;
@@ -241,7 +279,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
241
279
  };
242
280
  }, {
243
281
  readonly name: "get_comments";
244
- readonly description: "Get all comments from the document with IDs, authors, dates, text, and anchored paragraph IDs. Includes threaded replies. Read-only.";
282
+ readonly description: "Get all comments from the document with IDs, authors, dates, text, and anchored paragraph IDs. Range-anchored DOCX comments also expose optional end_paragraph_id, start_run_index, start_char_offset, end_run_index, and end_char_offset fields describing the covered span. Includes threaded replies (DOCX). Supports DOCX and ODT. Read-only.";
245
283
  readonly input: z.ZodObject<{
246
284
  file_path: z.ZodString;
247
285
  }, z.core.$strip>;
@@ -262,7 +300,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
262
300
  };
263
301
  }, {
264
302
  readonly name: "compare_documents";
265
- readonly description: "Compare two DOCX documents and produce a tracked-changes output document. Provide original_file_path + revised_file_path for standalone comparison, or file_path to compare session edits against the original.";
303
+ readonly description: "Compare two documents and produce a tracked-changes output document. Provide original_file_path + revised_file_path for standalone comparison, or file_path to compare session edits against the original. DOCX and ODF (.odt) support both modes. DOCX stats count insertions/deletions as contiguous ranges, expose atom totals as insertedAtoms/deletedAtoms, and report formatChanges separately from modifiedParagraphs. ODF compares at inline granularity (a modified paragraph is marked up in place — only the changed spans are struck or inserted).";
266
304
  readonly input: z.ZodObject<{
267
305
  save_to_local_path: z.ZodString;
268
306
  author: z.ZodOptional<z.ZodString>;
@@ -355,8 +393,8 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
355
393
  };
356
394
  }];
357
395
  export declare const SAFE_DOCX_MCP_TOOLS: {
358
- name: "read_file" | "grep" | "init_plan" | "merge_plans" | "apply_plan" | "replace_text" | "insert_paragraph" | "save" | "format_layout" | "accept_changes" | "has_tracked_changes" | "get_file_status" | "close_file" | "add_comment" | "get_comments" | "delete_comment" | "compare_documents" | "get_footnotes" | "add_footnote" | "update_footnote" | "delete_footnote" | "clear_formatting" | "extract_revisions";
359
- description: "Read document content (DOCX or Google Doc). Output is token-limited (~14k tokens) by default with pagination metadata (has_more, next_offset). Use offset/limit to paginate." | "Search paragraphs with regex. Use file_path for session-based search, file_paths for stateless multi-file search, or google_doc_id for Google Docs." | "Initialize revision-bound context metadata for coordinated multi-agent planning." | "Deterministically merge multiple sub-agent plans and detect hard conflicts before apply." | "Validate and apply a batch of edit steps (replace_text, insert_paragraph) to a document in one call. Validates all steps first; applies only if all pass. Accepts inline steps or a plan_file_path. Compatible with merge_plans output." | "Replace text in a paragraph by _bk_* id, preserving formatting. Supports DOCX and Google Docs." | "Insert a paragraph before/after an anchor paragraph by _bk_* id. Supports DOCX and Google Docs." | "Save document. For DOCX: saves clean and/or tracked changes output. For Google Docs: checkpoint (default) returns revisionId, or snapshot exports as DOCX." | "Apply layout controls (paragraph spacing, table row height, cell padding). Google Docs supports paragraph spacing only." | "Accept all tracked changes in the document body, producing a clean document with no revision markup. Returns acceptance stats." | "Check whether the document body contains tracked-change markers (insertions, deletions, moves, and property-change records). Read-only." | "Get file/session metadata including edit count, normalization stats, and cache info. Supports DOCX and Google Docs." | "Close an open file session, or close all sessions with explicit confirmation. Supports DOCX and Google Docs." | "Add a comment or threaded reply to a document. Provide target_paragraph_id + anchor_text for root comments, or parent_comment_id for replies." | "Get all comments from the document with IDs, authors, dates, text, and anchored paragraph IDs. Includes threaded replies. Read-only." | "Delete a comment and all its threaded replies from the document. Cascade-deletes all descendants." | "Compare two DOCX documents and produce a tracked-changes output document. Provide original_file_path + revised_file_path for standalone comparison, or file_path to compare session edits against the original." | "Get all footnotes from the document with IDs, display numbers, text, and anchored paragraph IDs. Read-only." | "Add a footnote anchored to a paragraph. Optionally position the reference after specific text using after_text. Note: [^N] markers in read_file output are display-only and not part of the editable text used by replace_text." | "Update the text content of an existing footnote." | "Delete a footnote and its reference from the document." | "Clear specific run-level formatting (bold, italic, underline, highlight, color, font) from paragraphs." | "Extract tracked changes as structured JSON with before/after text per paragraph, revision details, and comments. Supports pagination via offset and limit. Read-only - does not modify the document.";
396
+ name: "read_file" | "grep" | "init_plan" | "merge_plans" | "apply_plan" | "replace_text" | "insert_paragraph" | "save" | "export" | "convert_to_odt" | "format_layout" | "accept_changes" | "has_tracked_changes" | "get_file_status" | "close_file" | "add_comment" | "get_comments" | "delete_comment" | "compare_documents" | "get_footnotes" | "add_footnote" | "update_footnote" | "delete_footnote" | "clear_formatting" | "extract_revisions";
397
+ description: "Read document content (DOCX, ODT, or Google Doc). Output is token-limited (~14k tokens) by default with pagination metadata (has_more, next_offset). Use offset/limit to paginate." | "Search paragraphs with regex. Use file_path for session-based search, file_paths for stateless multi-file search, or google_doc_id for Google Docs. ODT supported via file_path (single-file) only." | "Initialize revision-bound context metadata for coordinated multi-agent planning." | "Deterministically merge multiple sub-agent plans and detect hard conflicts before apply." | "Validate and apply a batch of edit steps (replace_text, insert_paragraph) to a document in one call. Validates all steps first; applies only if all pass. Accepts inline steps or a plan_file_path. Compatible with merge_plans output." | "Replace text in a paragraph by provider paragraph id, preserving formatting where supported. Supports DOCX, ODT, and Google Docs." | "Insert a paragraph before/after an anchor paragraph by paragraph id. Supports DOCX, ODT, and Google Docs. (ODT paragraph ids are positional and shift after insertion — re-read before further edits.)" | "Save document. For DOCX: saves clean and/or tracked changes output. For ODT: saves an .odt package. For Google Docs: checkpoint (default) returns revisionId, or snapshot exports as DOCX." | "Export a document to a portable rendering (Markdown, semantic HTML, or plain text). Writes an output file (default: source path with the format extension, e.g. .md, .html, or .txt) and returns its path, byte count, and the rendered content (under `content`). Intentionally lossy (no round-trip); HTML is the semantic tier, not pixel-faithful. DOCX only — Google Docs is not supported." | "Convert a DOCX document to OpenDocument Text (.odt) using the native model-to-model converter (no LibreOffice involved). Writes the .odt (default: source path with the .odt extension), validates ODF packaging safety before writing, and returns the output path plus a `lossiness` summary itemizing every downgraded construct. Conversion is semantic and intentionally lossy: text, headings, bold/italic/underline, hyperlinks, lists, and tables are mapped; richer styling, tracked changes, comments, and headers/footers are not. DOCX in, ODT out — Google Docs and .odt inputs are not supported." | "Apply layout controls (paragraph spacing, table row height, cell padding). Google Docs supports paragraph spacing only." | "Accept all tracked changes in the document body, producing a clean document with no revision markup. Returns acceptance stats." | "Check whether the document body contains tracked-change markers (insertions, deletions, moves, and property-change records). Read-only." | "Get file/session metadata including edit count, normalization stats, and cache info. Supports DOCX, ODT, and Google Docs." | "Close an open file session, or close all sessions with explicit confirmation. Supports DOCX, ODT, and Google Docs." | "Add a comment or threaded reply to a document. Provide target_paragraph_id + anchor_text for root comments, or parent_comment_id for replies. Supports DOCX and ODT (ODT backs comments with office:annotation; threaded replies are DOCX-only)." | "Get all comments from the document with IDs, authors, dates, text, and anchored paragraph IDs. Range-anchored DOCX comments also expose optional end_paragraph_id, start_run_index, start_char_offset, end_run_index, and end_char_offset fields describing the covered span. Includes threaded replies (DOCX). Supports DOCX and ODT. Read-only." | "Delete a comment and all its threaded replies from the document. Cascade-deletes all descendants." | "Compare two documents and produce a tracked-changes output document. Provide original_file_path + revised_file_path for standalone comparison, or file_path to compare session edits against the original. DOCX and ODF (.odt) support both modes. DOCX stats count insertions/deletions as contiguous ranges, expose atom totals as insertedAtoms/deletedAtoms, and report formatChanges separately from modifiedParagraphs. ODF compares at inline granularity (a modified paragraph is marked up in place — only the changed spans are struck or inserted)." | "Get all footnotes from the document with IDs, display numbers, text, and anchored paragraph IDs. Read-only." | "Add a footnote anchored to a paragraph. Optionally position the reference after specific text using after_text. Note: [^N] markers in read_file output are display-only and not part of the editable text used by replace_text." | "Update the text content of an existing footnote." | "Delete a footnote and its reference from the document." | "Clear specific run-level formatting (bold, italic, underline, highlight, color, font) from paragraphs." | "Extract tracked changes as structured JSON with before/after text per paragraph, revision details, and comments. Supports pagination via offset and limit. Read-only - does not modify the document.";
360
398
  inputSchema: Record<string, unknown>;
361
399
  annotations: {
362
400
  readonly readOnlyHint: true;
@@ -382,6 +420,12 @@ export declare const SAFE_DOCX_MCP_TOOLS: {
382
420
  } | {
383
421
  readonly readOnlyHint: false;
384
422
  readonly destructiveHint: true;
423
+ } | {
424
+ readonly readOnlyHint: false;
425
+ readonly destructiveHint: false;
426
+ } | {
427
+ readonly readOnlyHint: false;
428
+ readonly destructiveHint: false;
385
429
  } | {
386
430
  readonly readOnlyHint: false;
387
431
  readonly destructiveHint: true;
@@ -1 +1 @@
1
- {"version":3,"file":"tool_catalog.d.ts","sourceRoot":"","sources":["../src/tool_catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+BxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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