@usejunior/docx-mcp 0.9.1 → 0.10.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 (143) hide show
  1. package/README.md +46 -1
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/cli/commands/edit.d.ts.map +1 -1
  4. package/dist/cli/commands/edit.js +2 -1
  5. package/dist/cli/commands/edit.js.map +1 -1
  6. package/dist/cli/commands/grep.d.ts.map +1 -1
  7. package/dist/cli/commands/grep.js +2 -1
  8. package/dist/cli/commands/grep.js.map +1 -1
  9. package/dist/cli/tool_runner.d.ts +6 -0
  10. package/dist/cli/tool_runner.d.ts.map +1 -1
  11. package/dist/cli/tool_runner.js +10 -1
  12. package/dist/cli/tool_runner.js.map +1 -1
  13. package/dist/odf_loader.d.ts +2 -0
  14. package/dist/odf_loader.d.ts.map +1 -0
  15. package/dist/odf_loader.js +19 -0
  16. package/dist/odf_loader.js.map +1 -0
  17. package/dist/server.d.ts +5 -2
  18. package/dist/server.d.ts.map +1 -1
  19. package/dist/server.js +110 -4
  20. package/dist/server.js.map +1 -1
  21. package/dist/session/manager.d.ts +44 -2
  22. package/dist/session/manager.d.ts.map +1 -1
  23. package/dist/session/manager.js +212 -2
  24. package/dist/session/manager.js.map +1 -1
  25. package/dist/tool_catalog.d.ts +40 -12
  26. package/dist/tool_catalog.d.ts.map +1 -1
  27. package/dist/tool_catalog.js +49 -17
  28. package/dist/tool_catalog.js.map +1 -1
  29. package/dist/tools/accept_changes.js +1 -1
  30. package/dist/tools/accept_changes.js.map +1 -1
  31. package/dist/tools/add_comment.d.ts.map +1 -1
  32. package/dist/tools/add_comment.js +4 -2
  33. package/dist/tools/add_comment.js.map +1 -1
  34. package/dist/tools/add_footnote.d.ts.map +1 -1
  35. package/dist/tools/add_footnote.js +3 -1
  36. package/dist/tools/add_footnote.js.map +1 -1
  37. package/dist/tools/apply_plan.d.ts.map +1 -1
  38. package/dist/tools/apply_plan.js +6 -4
  39. package/dist/tools/apply_plan.js.map +1 -1
  40. package/dist/tools/clear_formatting.d.ts +2 -1
  41. package/dist/tools/clear_formatting.d.ts.map +1 -1
  42. package/dist/tools/clear_formatting.js +62 -49
  43. package/dist/tools/clear_formatting.js.map +1 -1
  44. package/dist/tools/compare_documents.d.ts.map +1 -1
  45. package/dist/tools/compare_documents.js +11 -2
  46. package/dist/tools/compare_documents.js.map +1 -1
  47. package/dist/tools/delete_comment.d.ts.map +1 -1
  48. package/dist/tools/delete_comment.js +3 -1
  49. package/dist/tools/delete_comment.js.map +1 -1
  50. package/dist/tools/delete_footnote.d.ts.map +1 -1
  51. package/dist/tools/delete_footnote.js +3 -1
  52. package/dist/tools/delete_footnote.js.map +1 -1
  53. package/dist/tools/export.d.ts +20 -0
  54. package/dist/tools/export.d.ts.map +1 -0
  55. package/dist/tools/export.js +96 -0
  56. package/dist/tools/export.js.map +1 -0
  57. package/dist/tools/format_layout.d.ts.map +1 -1
  58. package/dist/tools/format_layout.js +5 -3
  59. package/dist/tools/format_layout.js.map +1 -1
  60. package/dist/tools/grep.d.ts.map +1 -1
  61. package/dist/tools/grep.js +4 -115
  62. package/dist/tools/grep.js.map +1 -1
  63. package/dist/tools/grep_core.d.ts +49 -0
  64. package/dist/tools/grep_core.d.ts.map +1 -0
  65. package/dist/tools/grep_core.js +126 -0
  66. package/dist/tools/grep_core.js.map +1 -0
  67. package/dist/tools/insert_paragraph.d.ts +2 -1
  68. package/dist/tools/insert_paragraph.d.ts.map +1 -1
  69. package/dist/tools/insert_paragraph.js +4 -2
  70. package/dist/tools/insert_paragraph.js.map +1 -1
  71. package/dist/tools/odf/add_comment.d.ts +21 -0
  72. package/dist/tools/odf/add_comment.d.ts.map +1 -0
  73. package/dist/tools/odf/add_comment.js +64 -0
  74. package/dist/tools/odf/add_comment.js.map +1 -0
  75. package/dist/tools/odf/close_file.d.ts +4 -0
  76. package/dist/tools/odf/close_file.d.ts.map +1 -0
  77. package/dist/tools/odf/close_file.js +16 -0
  78. package/dist/tools/odf/close_file.js.map +1 -0
  79. package/dist/tools/odf/compare_documents.d.ts +39 -0
  80. package/dist/tools/odf/compare_documents.d.ts.map +1 -0
  81. package/dist/tools/odf/compare_documents.js +156 -0
  82. package/dist/tools/odf/compare_documents.js.map +1 -0
  83. package/dist/tools/odf/get_comments.d.ts +11 -0
  84. package/dist/tools/odf/get_comments.d.ts.map +1 -0
  85. package/dist/tools/odf/get_comments.js +32 -0
  86. package/dist/tools/odf/get_comments.js.map +1 -0
  87. package/dist/tools/odf/get_file_status.d.ts +4 -0
  88. package/dist/tools/odf/get_file_status.d.ts.map +1 -0
  89. package/dist/tools/odf/get_file_status.js +28 -0
  90. package/dist/tools/odf/get_file_status.js.map +1 -0
  91. package/dist/tools/odf/grep.d.ts +19 -0
  92. package/dist/tools/odf/grep.d.ts.map +1 -0
  93. package/dist/tools/odf/grep.js +81 -0
  94. package/dist/tools/odf/grep.js.map +1 -0
  95. package/dist/tools/odf/insert_paragraph.d.ts +19 -0
  96. package/dist/tools/odf/insert_paragraph.d.ts.map +1 -0
  97. package/dist/tools/odf/insert_paragraph.js +50 -0
  98. package/dist/tools/odf/insert_paragraph.js.map +1 -0
  99. package/dist/tools/odf/read_file.d.ts +9 -0
  100. package/dist/tools/odf/read_file.d.ts.map +1 -0
  101. package/dist/tools/odf/read_file.js +124 -0
  102. package/dist/tools/odf/read_file.js.map +1 -0
  103. package/dist/tools/odf/replace_text.d.ts +9 -0
  104. package/dist/tools/odf/replace_text.d.ts.map +1 -0
  105. package/dist/tools/odf/replace_text.js +41 -0
  106. package/dist/tools/odf/replace_text.js.map +1 -0
  107. package/dist/tools/odf/save.d.ts +7 -0
  108. package/dist/tools/odf/save.d.ts.map +1 -0
  109. package/dist/tools/odf/save.js +48 -0
  110. package/dist/tools/odf/save.js.map +1 -0
  111. package/dist/tools/open_document.d.ts.map +1 -1
  112. package/dist/tools/open_document.js +36 -4
  113. package/dist/tools/open_document.js.map +1 -1
  114. package/dist/tools/path_policy.d.ts +9 -0
  115. package/dist/tools/path_policy.d.ts.map +1 -1
  116. package/dist/tools/path_policy.js +66 -5
  117. package/dist/tools/path_policy.js.map +1 -1
  118. package/dist/tools/provider_guard.d.ts +1 -0
  119. package/dist/tools/provider_guard.d.ts.map +1 -1
  120. package/dist/tools/provider_guard.js +10 -0
  121. package/dist/tools/provider_guard.js.map +1 -1
  122. package/dist/tools/read_file.d.ts +2 -0
  123. package/dist/tools/read_file.d.ts.map +1 -1
  124. package/dist/tools/read_file.js +370 -31
  125. package/dist/tools/read_file.js.map +1 -1
  126. package/dist/tools/replace_text.d.ts +2 -1
  127. package/dist/tools/replace_text.d.ts.map +1 -1
  128. package/dist/tools/replace_text.js +26 -5
  129. package/dist/tools/replace_text.js.map +1 -1
  130. package/dist/tools/save.d.ts.map +1 -1
  131. package/dist/tools/save.js +55 -8
  132. package/dist/tools/save.js.map +1 -1
  133. package/dist/tools/session_resolution.d.ts +25 -1
  134. package/dist/tools/session_resolution.d.ts.map +1 -1
  135. package/dist/tools/session_resolution.js +179 -2
  136. package/dist/tools/session_resolution.js.map +1 -1
  137. package/dist/tools/tag_parser.d.ts.map +1 -1
  138. package/dist/tools/tag_parser.js +69 -14
  139. package/dist/tools/tag_parser.js.map +1 -1
  140. package/dist/tools/update_footnote.d.ts.map +1 -1
  141. package/dist/tools/update_footnote.js +3 -1
  142. package/dist/tools/update_footnote.js.map +1 -1
  143. package/package.json +18 -14
@@ -2,21 +2,188 @@ 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, 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
+ const REVISION_ID_ELEMENT_LOCAL_NAMES = new Set([
14
+ 'ins',
15
+ 'del',
16
+ 'moveFrom',
17
+ 'moveTo',
18
+ 'moveFromRangeStart',
19
+ 'moveFromRangeEnd',
20
+ 'moveToRangeStart',
21
+ 'moveToRangeEnd',
22
+ 'pPrChange',
23
+ 'rPrChange',
24
+ 'tblPrChange',
25
+ 'trPrChange',
26
+ 'tcPrChange',
27
+ 'sectPrChange',
28
+ 'cellIns',
29
+ 'cellDel',
30
+ 'cellMerge',
31
+ 'customXmlInsRangeStart',
32
+ 'customXmlInsRangeEnd',
33
+ 'customXmlDelRangeStart',
34
+ 'customXmlDelRangeEnd',
35
+ 'customXmlMoveFromRangeStart',
36
+ 'customXmlMoveFromRangeEnd',
37
+ 'customXmlMoveToRangeStart',
38
+ 'customXmlMoveToRangeEnd',
39
+ ]);
40
+ /**
41
+ * Fixed package paths that can carry package-wide revision attributes.
42
+ * `commentsExtended.xml` and `people.xml` are intentionally excluded — they
43
+ * use `w15:paraId` / `w15:author` identifiers, not revision `w:id` values.
44
+ */
45
+ const FIXED_REVISION_ID_SEED_PARTS = [
46
+ 'word/comments.xml',
47
+ 'word/footnotes.xml',
48
+ 'word/endnotes.xml',
49
+ 'word/glossary/document.xml',
50
+ ];
51
+ /** Matches numbered header/footer parts such as `word/header1.xml`. */
52
+ const NUMBERED_HEADER_FOOTER_RE = /^word\/(header|footer)\d*\.xml$/;
53
+ function normalizeAiAuthor(author) {
54
+ if (typeof author !== 'string')
55
+ return null;
56
+ const trimmed = author.trim();
57
+ return trimmed.length > 0 ? trimmed : null;
58
+ }
59
+ function getWordIdValue(element) {
60
+ const raw = element.getAttributeNS(WORDPROCESSING_ML_NS, 'id')
61
+ ?? element.getAttribute('w:id')
62
+ ?? element.getAttribute('id');
63
+ if (raw === null)
64
+ return null;
65
+ const parsed = Number.parseInt(raw, 10);
66
+ return Number.isFinite(parsed) ? parsed : null;
67
+ }
68
+ /**
69
+ * Compute a starting `RevisionIdState` whose first allocated `w:id` is
70
+ * higher than any existing revision id found in the supplied documents.
71
+ *
72
+ * Only `w:id` attributes on revision-bearing elements
73
+ * (`REVISION_ID_ELEMENT_LOCAL_NAMES`) are considered. Non-revision IDs such
74
+ * as `<w:comment w:id>` or `<w:footnote w:id>` share the attribute name but
75
+ * occupy a different ID space and must not influence the counter.
76
+ *
77
+ * Callers should pass every available story/metadata part that can contain
78
+ * package-wide revision attributes, not just `document.xml`.
79
+ */
80
+ export function inferStartingRevisionIdState(...docs) {
81
+ let maxId = 0;
82
+ for (const doc of docs) {
83
+ for (const node of Array.from(doc.getElementsByTagName('*'))) {
84
+ const localName = node.localName ?? '';
85
+ if (!REVISION_ID_ELEMENT_LOCAL_NAMES.has(localName))
86
+ continue;
87
+ if (node.namespaceURI && node.namespaceURI !== WORDPROCESSING_ML_NS)
88
+ continue;
89
+ const value = getWordIdValue(node);
90
+ if (value !== null && value > maxId) {
91
+ maxId = value;
92
+ }
93
+ }
94
+ }
95
+ return createRevisionIdState(maxId + 1);
96
+ }
97
+ async function getSidePartRevisionSeedDocs(buffer) {
98
+ const docs = [];
99
+ let zip;
100
+ try {
101
+ zip = await DocxZip.load(buffer);
102
+ }
103
+ catch {
104
+ return docs;
105
+ }
106
+ const seedPaths = new Set(FIXED_REVISION_ID_SEED_PARTS);
107
+ for (const entry of zip.listFiles()) {
108
+ if (NUMBERED_HEADER_FOOTER_RE.test(entry))
109
+ seedPaths.add(entry);
110
+ }
111
+ for (const partPath of seedPaths) {
112
+ if (!zip.hasFile(partPath))
113
+ continue;
114
+ let xml;
115
+ try {
116
+ xml = await zip.readTextOrNull(partPath);
117
+ }
118
+ catch {
119
+ continue;
120
+ }
121
+ if (!xml)
122
+ continue;
123
+ try {
124
+ docs.push(parseXml(xml));
125
+ }
126
+ catch {
127
+ // Malformed optional side part — skip so an unrelated parse failure
128
+ // does not block every tracked edit on the session.
129
+ }
130
+ }
131
+ return docs;
132
+ }
133
+ /**
134
+ * Single-flight guard around the first revision-id seed scan per session.
135
+ * Concurrent first callers await the same in-flight scan and assign the same
136
+ * result, preventing a slower scan from clobbering a counter that a faster
137
+ * caller has already advanced via emitted revisions.
138
+ */
139
+ const revisionIdSeedPromises = new WeakMap();
140
+ export async function getRevisionContextForSession(session) {
141
+ if (!session.aiAuthor)
142
+ return undefined;
143
+ if (!session.revisionIdState) {
144
+ let pending = revisionIdSeedPromises.get(session);
145
+ if (!pending) {
146
+ pending = (async () => {
147
+ const sideDocs = await getSidePartRevisionSeedDocs(session.originalBuffer);
148
+ return inferStartingRevisionIdState(session.doc.getDocumentXmlClone(), ...sideDocs);
149
+ })();
150
+ revisionIdSeedPromises.set(session, pending);
151
+ }
152
+ try {
153
+ const seeded = await pending;
154
+ if (!session.revisionIdState) {
155
+ session.revisionIdState = seeded;
156
+ }
157
+ }
158
+ finally {
159
+ revisionIdSeedPromises.delete(session);
160
+ }
161
+ }
162
+ return createRevisionContext({
163
+ author: session.aiAuthor,
164
+ date: new Date(),
165
+ idState: session.revisionIdState,
166
+ });
167
+ }
6
168
  export function isDocxSession(s) {
7
169
  return s.provider === 'docx';
8
170
  }
9
171
  export function isGDocsSession(s) {
10
172
  return s.provider === 'gdocs';
11
173
  }
174
+ export function isOdfSession(s) {
175
+ return s.provider === 'odf';
176
+ }
12
177
  export class SessionManager {
13
178
  /** Sessions keyed by canonical file path (realpath). */
14
179
  sessions = new Map();
15
180
  ttlMs;
181
+ defaultAiAuthor;
16
182
  /** Concurrency guard: prevents double-generation of baselines for the same session. */
17
183
  baselinePromises = new WeakMap();
18
184
  constructor(opts) {
19
185
  this.ttlMs = opts?.ttlMs ?? 60 * 60 * 1000;
186
+ this.defaultAiAuthor = normalizeAiAuthor(opts?.defaultAiAuthor);
20
187
  }
21
188
  expandPath(inputPath) {
22
189
  return inputPath.startsWith('~')
@@ -71,6 +238,8 @@ export class SessionManager {
71
238
  comparisonBaseline: null,
72
239
  comparisonBaselineWithBookmarks: null,
73
240
  doc,
241
+ aiAuthor: this.defaultAiAuthor,
242
+ revisionIdState: null,
74
243
  editCount: 0,
75
244
  editRevision: 0,
76
245
  saveCache: new Map(),
@@ -83,6 +252,41 @@ export class SessionManager {
83
252
  this.sessions.set(canonicalPath, session);
84
253
  return session;
85
254
  }
255
+ /**
256
+ * Create an ODF session from an already-loaded `archive` + `doc`. The caller (the
257
+ * lazily-reached ODF resolver / open path) loads these via the optional odf-core
258
+ * provider — this method does NOT import odf-core, keeping the always-loaded
259
+ * SessionManager free of a hard dependency on the private package.
260
+ */
261
+ async createOdfSession(documentContent, filename, originalPath, archive, doc) {
262
+ const canonicalPath = await this.canonicalizePath(originalPath);
263
+ const existing = this.sessions.get(canonicalPath);
264
+ if (existing) {
265
+ await this.cleanupSessionArtifacts(existing);
266
+ }
267
+ const sessionId = this.newSessionId();
268
+ const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'safe-odf-'));
269
+ const tmpPath = path.join(dir, filename);
270
+ await fs.writeFile(tmpPath, new Uint8Array(documentContent));
271
+ const now = new Date();
272
+ const session = {
273
+ provider: 'odf',
274
+ sessionId,
275
+ filename,
276
+ tmpPath,
277
+ originalPath,
278
+ originalBuffer: Buffer.from(documentContent),
279
+ archive,
280
+ doc,
281
+ editCount: 0,
282
+ editRevision: 0,
283
+ createdAt: now,
284
+ lastAccessedAt: now,
285
+ expiresAt: new Date(now.getTime() + this.ttlMs),
286
+ };
287
+ this.sessions.set(canonicalPath, session);
288
+ return session;
289
+ }
86
290
  /**
87
291
  * Finalize a newly created session by normalizing the document and inserting
88
292
  * paragraph bookmarks. Baselines are lazily generated on first save/compare.
@@ -168,7 +372,7 @@ export class SessionManager {
168
372
  throw new Error(`SESSION_NOT_FOUND:${sessionId}`);
169
373
  }
170
374
  async cleanupSessionArtifacts(session) {
171
- if (isDocxSession(session)) {
375
+ if (isDocxSession(session) || isOdfSession(session)) {
172
376
  const tmpDir = path.dirname(session.tmpPath);
173
377
  await fs.rm(tmpDir, { recursive: true, force: true }).catch(() => undefined);
174
378
  }
@@ -257,5 +461,11 @@ export class SessionManager {
257
461
  const { buffer } = await session.doc.toBuffer({ cleanBookmarks: opts?.cleanBookmarks ?? true });
258
462
  await fs.writeFile(savePath, new Uint8Array(buffer));
259
463
  }
464
+ async saveOdfTo(session, savePath) {
465
+ session.archive.setContentXml(session.doc.toXml());
466
+ const buffer = await session.archive.save();
467
+ await fs.writeFile(savePath, new Uint8Array(buffer));
468
+ return buffer;
469
+ }
260
470
  }
261
471
  //# 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,gBAAgB,GAAG,IAAI,OAAO,EAA8B,CAAC;IAErE,YAAY,IAAyB;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,EAAE,KAAK,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC7C,CAAC;IAEO,UAAU,CAAC,SAAiB;QAClC,OAAO,SAAS,CAAC,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AAM,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,14 @@ 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>;
15
22
  google_doc_id: z.ZodOptional<z.ZodString>;
16
23
  file_path: z.ZodOptional<z.ZodString>;
17
24
  }, z.core.$strip>;
@@ -21,7 +28,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
21
28
  };
22
29
  }, {
23
30
  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.";
31
+ 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
32
  readonly input: z.ZodObject<{
26
33
  file_paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
27
34
  patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -78,7 +85,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
78
85
  };
79
86
  }, {
80
87
  readonly name: "replace_text";
81
- readonly description: "Replace text in a paragraph by _bk_* id, preserving formatting. Supports DOCX and Google Docs.";
88
+ readonly description: "Replace text in a paragraph by provider paragraph id, preserving formatting where supported. Supports DOCX, ODT, and Google Docs.";
82
89
  readonly input: z.ZodObject<{
83
90
  target_paragraph_id: z.ZodString;
84
91
  old_string: z.ZodString;
@@ -94,7 +101,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
94
101
  };
95
102
  }, {
96
103
  readonly name: "insert_paragraph";
97
- readonly description: "Insert a paragraph before/after an anchor paragraph by _bk_* id. Supports DOCX and Google Docs.";
104
+ 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
105
  readonly input: z.ZodObject<{
99
106
  positional_anchor_node_id: z.ZodString;
100
107
  new_string: z.ZodString;
@@ -113,7 +120,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
113
120
  };
114
121
  }, {
115
122
  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.";
123
+ 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
124
  readonly input: z.ZodObject<{
118
125
  save_to_local_path: z.ZodString;
119
126
  clean_bookmarks: z.ZodOptional<z.ZodBoolean>;
@@ -137,6 +144,24 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
137
144
  readonly readOnlyHint: false;
138
145
  readonly destructiveHint: true;
139
146
  };
147
+ }, {
148
+ readonly name: "export";
149
+ 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.";
150
+ readonly input: z.ZodObject<{
151
+ format: z.ZodOptional<z.ZodEnum<{
152
+ html: "html";
153
+ plaintext: "plaintext";
154
+ markdown: "markdown";
155
+ }>>;
156
+ output_path: z.ZodOptional<z.ZodString>;
157
+ allow_overwrite: z.ZodOptional<z.ZodBoolean>;
158
+ include_markdown: z.ZodOptional<z.ZodBoolean>;
159
+ file_path: z.ZodOptional<z.ZodString>;
160
+ }, z.core.$strip>;
161
+ readonly annotations: {
162
+ readonly readOnlyHint: false;
163
+ readonly destructiveHint: false;
164
+ };
140
165
  }, {
141
166
  readonly name: "format_layout";
142
167
  readonly description: "Apply layout controls (paragraph spacing, table row height, cell padding). Google Docs supports paragraph spacing only.";
@@ -201,7 +226,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
201
226
  };
202
227
  }, {
203
228
  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.";
229
+ readonly description: "Get file/session metadata including edit count, normalization stats, and cache info. Supports DOCX, ODT, and Google Docs.";
205
230
  readonly input: z.ZodObject<{
206
231
  google_doc_id: z.ZodOptional<z.ZodString>;
207
232
  file_path: z.ZodOptional<z.ZodString>;
@@ -212,7 +237,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
212
237
  };
213
238
  }, {
214
239
  readonly name: "close_file";
215
- readonly description: "Close an open file session, or close all sessions with explicit confirmation. Supports DOCX and Google Docs.";
240
+ readonly description: "Close an open file session, or close all sessions with explicit confirmation. Supports DOCX, ODT, and Google Docs.";
216
241
  readonly input: z.ZodObject<{
217
242
  clear_all: z.ZodOptional<z.ZodBoolean>;
218
243
  confirm: z.ZodOptional<z.ZodBoolean>;
@@ -225,7 +250,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
225
250
  };
226
251
  }, {
227
252
  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.";
253
+ 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
254
  readonly input: z.ZodObject<{
230
255
  target_paragraph_id: z.ZodOptional<z.ZodString>;
231
256
  anchor_text: z.ZodOptional<z.ZodString>;
@@ -241,7 +266,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
241
266
  };
242
267
  }, {
243
268
  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.";
269
+ readonly description: "Get all comments from the document with IDs, authors, dates, text, and anchored paragraph IDs. Includes threaded replies (DOCX). Supports DOCX and ODT. Read-only.";
245
270
  readonly input: z.ZodObject<{
246
271
  file_path: z.ZodString;
247
272
  }, z.core.$strip>;
@@ -262,7 +287,7 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
262
287
  };
263
288
  }, {
264
289
  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.";
290
+ 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; ODF compares at inline granularity (a modified paragraph is marked up in place — only the changed spans are struck or inserted).";
266
291
  readonly input: z.ZodObject<{
267
292
  save_to_local_path: z.ZodString;
268
293
  author: z.ZodOptional<z.ZodString>;
@@ -355,8 +380,8 @@ export declare const SAFE_DOCX_TOOL_CATALOG: readonly [{
355
380
  };
356
381
  }];
357
382
  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.";
383
+ name: "read_file" | "grep" | "init_plan" | "merge_plans" | "apply_plan" | "replace_text" | "insert_paragraph" | "save" | "export" | "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";
384
+ 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." | "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. 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; 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
385
  inputSchema: Record<string, unknown>;
361
386
  annotations: {
362
387
  readonly readOnlyHint: true;
@@ -382,6 +407,9 @@ export declare const SAFE_DOCX_MCP_TOOLS: {
382
407
  } | {
383
408
  readonly readOnlyHint: false;
384
409
  readonly destructiveHint: true;
410
+ } | {
411
+ readonly readOnlyHint: false;
412
+ readonly destructiveHint: false;
385
413
  } | {
386
414
  readonly readOnlyHint: false;
387
415
  readonly destructiveHint: true;
@@ -1 +1 @@
1
- {"version":3,"file":"tool_catal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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwWa,CAAC;AAUjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAK7B,CAAC;AAEJ,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  const FILE_FIELD = {
3
- file_path: z.string().describe('Path to the DOCX file.'),
3
+ file_path: z.string().describe('Path to the DOCX or ODT file.'),
4
4
  };
5
5
  const FILE_FIELD_OPTIONAL = {
6
- file_path: z.string().optional().describe('Path to the DOCX file.'),
6
+ file_path: z.string().optional().describe('Path to the DOCX or ODT file.'),
7
7
  };
8
8
  const GOOGLE_DOC_ID_FIELD = {
9
9
  google_doc_id: z.string().optional().describe('Google Doc ID or URL (alternative to file_path). ' +
@@ -13,7 +13,7 @@ const PLAN_OBJECT_SCHEMA = z.object({}).catchall(z.unknown());
13
13
  export const SAFE_DOCX_TOOL_CATALOG = [
14
14
  {
15
15
  name: 'read_file',
16
- 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.',
16
+ 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.',
17
17
  input: z.object({
18
18
  ...FILE_FIELD_OPTIONAL,
19
19
  ...GOOGLE_DOC_ID_FIELD,
@@ -21,16 +21,24 @@ export const SAFE_DOCX_TOOL_CATALOG = [
21
21
  limit: z.number().optional().describe('Max paragraphs to return. When omitted, output is token-limited to ~14k tokens with pagination.'),
22
22
  node_ids: z.array(z.string()).optional(),
23
23
  format: z.enum(['toon', 'json', 'simple']).optional(),
24
+ comment_rendering: z
25
+ .enum(['none', 'paragraph_notes', 'endnotes', 'inline_markers'])
26
+ .optional()
27
+ .describe('How to render comments in read_file output. Use "paragraph_notes" (default) for paragraph-local comment threads, "inline_markers" to add `[cm-start:N]`/`[cm-end:N]` milestones in TOON output (combined with the thread blocks), "endnotes" to collect threaded comments into a trailing #COMMENTS block in TOON output, or "none" for the legacy output with no comment rendering.'),
24
28
  show_formatting: z
25
29
  .boolean()
26
30
  .optional()
27
31
  .describe('When true (default), shows inline formatting tags (<b>, <i>, <u>, <highlighting>, <a>). When false, emits plain text with no inline tags.'),
32
+ include_fingerprint: z
33
+ .boolean()
34
+ .optional()
35
+ .describe('When true and format="json", include a portable content_fingerprint ("sha256:nfkc:<32hex>") on each paragraph. Read-only metadata derived from the paragraph\'s normalized visible text; NOT an edit anchor. Edit tools accept only `_bk_*` IDs. No effect on TOON/simple output. Ignored for Google Docs and ODT.'),
28
36
  }),
29
37
  annotations: { readOnlyHint: true, destructiveHint: false },
30
38
  },
31
39
  {
32
40
  name: 'grep',
33
- 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.',
41
+ 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.',
34
42
  input: z.object({
35
43
  ...FILE_FIELD_OPTIONAL,
36
44
  ...GOOGLE_DOC_ID_FIELD,
@@ -85,7 +93,7 @@ export const SAFE_DOCX_TOOL_CATALOG = [
85
93
  },
86
94
  {
87
95
  name: 'replace_text',
88
- description: 'Replace text in a paragraph by _bk_* id, preserving formatting. Supports DOCX and Google Docs.',
96
+ description: 'Replace text in a paragraph by provider paragraph id, preserving formatting where supported. Supports DOCX, ODT, and Google Docs.',
89
97
  input: z.object({
90
98
  ...FILE_FIELD_OPTIONAL,
91
99
  ...GOOGLE_DOC_ID_FIELD,
@@ -102,7 +110,7 @@ export const SAFE_DOCX_TOOL_CATALOG = [
102
110
  },
103
111
  {
104
112
  name: 'insert_paragraph',
105
- description: 'Insert a paragraph before/after an anchor paragraph by _bk_* id. Supports DOCX and Google Docs.',
113
+ 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.)',
106
114
  input: z.object({
107
115
  ...FILE_FIELD_OPTIONAL,
108
116
  ...GOOGLE_DOC_ID_FIELD,
@@ -119,7 +127,7 @@ export const SAFE_DOCX_TOOL_CATALOG = [
119
127
  },
120
128
  {
121
129
  name: 'save',
122
- description: 'Save document. For DOCX: saves clean and/or tracked changes output. For Google Docs: checkpoint (default) returns revisionId, or snapshot exports as DOCX.',
130
+ 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.',
123
131
  input: z.object({
124
132
  ...FILE_FIELD_OPTIONAL,
125
133
  ...GOOGLE_DOC_ID_FIELD,
@@ -137,6 +145,30 @@ export const SAFE_DOCX_TOOL_CATALOG = [
137
145
  }),
138
146
  annotations: { readOnlyHint: false, destructiveHint: true },
139
147
  },
148
+ {
149
+ name: 'export',
150
+ 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
+ input: z.object({
152
+ ...FILE_FIELD_OPTIONAL,
153
+ format: z
154
+ .enum(['markdown', 'html', 'plaintext'])
155
+ .optional()
156
+ .describe("Output format: 'markdown' (default, writes .md), 'html' (writes .html), or 'plaintext' (writes .txt)."),
157
+ output_path: z
158
+ .string()
159
+ .optional()
160
+ .describe('Where to write the rendering. Defaults to the source path with the format extension.'),
161
+ allow_overwrite: z
162
+ .boolean()
163
+ .optional()
164
+ .describe('Overwrite output_path if it already exists. Default: false.'),
165
+ include_markdown: z
166
+ .boolean()
167
+ .optional()
168
+ .describe('Include the rendered content (under `content`) in the response. Default: true; set false for large documents.'),
169
+ }),
170
+ annotations: { readOnlyHint: false, destructiveHint: false },
171
+ },
140
172
  {
141
173
  name: 'format_layout',
142
174
  description: 'Apply layout controls (paragraph spacing, table row height, cell padding). Google Docs supports paragraph spacing only.',
@@ -193,7 +225,7 @@ export const SAFE_DOCX_TOOL_CATALOG = [
193
225
  },
194
226
  {
195
227
  name: 'get_file_status',
196
- description: 'Get file/session metadata including edit count, normalization stats, and cache info. Supports DOCX and Google Docs.',
228
+ description: 'Get file/session metadata including edit count, normalization stats, and cache info. Supports DOCX, ODT, and Google Docs.',
197
229
  input: z.object({
198
230
  ...FILE_FIELD_OPTIONAL,
199
231
  ...GOOGLE_DOC_ID_FIELD,
@@ -202,7 +234,7 @@ export const SAFE_DOCX_TOOL_CATALOG = [
202
234
  },
203
235
  {
204
236
  name: 'close_file',
205
- description: 'Close an open file session, or close all sessions with explicit confirmation. Supports DOCX and Google Docs.',
237
+ description: 'Close an open file session, or close all sessions with explicit confirmation. Supports DOCX, ODT, and Google Docs.',
206
238
  input: z.object({
207
239
  ...FILE_FIELD_OPTIONAL,
208
240
  ...GOOGLE_DOC_ID_FIELD,
@@ -213,7 +245,7 @@ export const SAFE_DOCX_TOOL_CATALOG = [
213
245
  },
214
246
  {
215
247
  name: 'add_comment',
216
- 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.',
248
+ 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).',
217
249
  input: z.object({
218
250
  ...FILE_FIELD,
219
251
  target_paragraph_id: z.string().optional().describe('Paragraph ID to anchor the comment to (for root comments).'),
@@ -227,7 +259,7 @@ export const SAFE_DOCX_TOOL_CATALOG = [
227
259
  },
228
260
  {
229
261
  name: 'get_comments',
230
- description: 'Get all comments from the document with IDs, authors, dates, text, and anchored paragraph IDs. Includes threaded replies. Read-only.',
262
+ description: 'Get all comments from the document with IDs, authors, dates, text, and anchored paragraph IDs. Includes threaded replies (DOCX). Supports DOCX and ODT. Read-only.',
231
263
  input: z.object({
232
264
  ...FILE_FIELD,
233
265
  }),
@@ -244,14 +276,14 @@ export const SAFE_DOCX_TOOL_CATALOG = [
244
276
  },
245
277
  {
246
278
  name: 'compare_documents',
247
- 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.',
279
+ 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; ODF compares at inline granularity (a modified paragraph is marked up in place — only the changed spans are struck or inserted).',
248
280
  input: z.object({
249
- original_file_path: z.string().optional().describe('Path to the original DOCX file.'),
250
- revised_file_path: z.string().optional().describe('Path to the revised DOCX file.'),
281
+ original_file_path: z.string().optional().describe('Path to the original DOCX or .odt file.'),
282
+ revised_file_path: z.string().optional().describe('Path to the revised DOCX or .odt file.'),
251
283
  ...FILE_FIELD_OPTIONAL,
252
- save_to_local_path: z.string().describe('Path to save the tracked-changes DOCX output.'),
253
- author: z.string().optional().describe("Author name for track changes. Default: 'Comparison'."),
254
- engine: z.enum(['auto', 'atomizer']).optional().describe("Comparison engine. Default: 'auto'."),
284
+ save_to_local_path: z.string().describe('Path to save the tracked-changes output (DOCX or .odt).'),
285
+ author: z.string().optional().describe("Author name for track changes. Default: 'Comparison' (DOCX) or the configured AI author (ODF)."),
286
+ engine: z.enum(['auto', 'atomizer']).optional().describe("Comparison engine (DOCX only). Default: 'auto'."),
255
287
  }),
256
288
  annotations: { readOnlyHint: true, destructiveHint: false },
257
289
  },