@adeu/mcp-server 1.15.2 → 1.16.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.
package/dist/index.js CHANGED
@@ -1254,10 +1254,10 @@ function getAssetContent(folder, filename, fallbackMessage) {
1254
1254
  var READ_DOCX_COMMON_DESC = "Reads a DOCX file. Returns text with inline CriticMarkup for Tracked Changes and Comments: {++inserted++}, {--deleted--}, {==highlighted==}{>>comment<<}. Set clean_view=True for the finalized 'Accepted' text without markup.\n\n";
1255
1255
  var READ_DOCX_TAIL = "Modes:\n- 'full' (default): paginated body content. Use page=N to navigate.\n- 'outline': heading map only \u2014 start here for large docs to plan targeted reads. Defaults to L1-L2 headings; pass outline_max_level=3-6 to see deeper structure.\n- 'appendix': defined terms, anchors, and cross-reference targets. Consult before editing legal/technical docs to avoid breaking references.";
1256
1256
  var PROCESS_BATCH_COMMON_DESC = "Applies a batch of edits and review actions to a DOCX.\n\nAll changes evaluate against the ORIGINAL document state \u2014 do not chain dependent edits within one batch (e.g. rename X to Y, then modify Y). Apply the rename first, then send a second batch.\n\n";
1257
- var PROCESS_BATCH_OPERATIONS_DESC = "Each item in `changes` must specify a `type`:\n1. 'modify': Search-and-replace. `target_text` must uniquely match \u2014 include surrounding context if the phrase is ambiguous. `new_text` supports Markdown: '# Heading 1' through '###### Heading 6', '**bold**', '_italic_', and '\\n\\n' to split into multiple paragraphs. Empty `new_text` deletes. Do NOT write CriticMarkup tags ({++, {--, {>>) manually \u2014 use the `comment` parameter for comments.\n2. 'accept' / 'reject': Finalize or revert a tracked change by `target_id` (e.g. 'Chg:12').\n3. 'reply': Reply to a comment by `target_id` (e.g. 'Com:5') with `text`.\n4. 'insert_row' / 'delete_row': Table edits. Disk mode only \u2014 not supported on Live Word canvas.\n\nID VOLATILITY: 'Chg:N' and 'Com:N' shift between document states. Always call `read_docx` immediately before any accept/reject/reply \u2014 do not reuse IDs from earlier in the conversation.\n\n`author_name` is used for attribution on all tracked changes and comments, in both disk and Live Word modes.";
1258
- var DIFF_DOCX_DESC = "Compares two DOCX files and returns a unified diff of their text content. Useful for analyzing differences between versions before editing.";
1259
- var gitSha = "23b2879";
1260
- var packageVersion = "1.15.2";
1257
+ var PROCESS_BATCH_OPERATIONS_DESC = "Each item in `changes` must specify a `type`:\n1. 'modify': Search-and-replace. By default `target_text` must match uniquely (`match_mode`:'strict') \u2014 add surrounding context to disambiguate, or set `match_mode`:'first'/'all' to edit the first or every occurrence. Set `regex`:true to treat `target_text` as a regular expression (capture groups available in `new_text` as $1, $2\u2026). `new_text` supports Markdown: '# Heading 1' through '###### Heading 6', '**bold**', '_italic_', and '\\n\\n' to split into multiple paragraphs. Empty `new_text` deletes. Do NOT write CriticMarkup tags ({++, {--, {>>) manually \u2014 use the `comment` parameter for comments.\n2. 'accept' / 'reject': Finalize or revert a tracked change by `target_id` (e.g. 'Chg:12').\n3. 'reply': Reply to a comment by `target_id` (e.g. 'Com:5') with `text`.\n4. 'insert_row' / 'delete_row': Table edits. Disk mode only \u2014 not supported on Live Word canvas.\n\nID VOLATILITY: 'Chg:N' and 'Com:N' shift between document states. Always call `read_docx` immediately before any accept/reject/reply \u2014 do not reuse IDs from earlier in the conversation.\n\n`author_name` is used for attribution on all tracked changes and comments, in both disk and Live Word modes.";
1258
+ var DIFF_DOCX_DESC = "Compares two DOCX files and returns a compact `@@ Word Patch @@` diff \u2014 Adeu's token-level, sub-word patch format \u2014 of their text content. Useful for analyzing differences between versions before editing.";
1259
+ var gitSha = "2179c76";
1260
+ var packageVersion = "1.16.0";
1261
1261
  var buildTag = ` [Adeu v${packageVersion}+${gitSha}]`;
1262
1262
  var args = process.argv.slice(2);
1263
1263
  var scopeIdx = args.indexOf("--scope");
@@ -1270,7 +1270,7 @@ var server = new McpServer({
1270
1270
  var originalRegisterTool = server.registerTool.bind(server);
1271
1271
  server.registerTool = (name, schema, handler) => {
1272
1272
  if (schema && typeof schema === "object") {
1273
- if (schema.description) {
1273
+ if (schema.description && !schema.description.includes(buildTag.trim())) {
1274
1274
  schema.description = schema.description.trim() + buildTag;
1275
1275
  }
1276
1276
  }
@@ -1438,6 +1438,34 @@ registerAppTool(
1438
1438
  }
1439
1439
  }
1440
1440
  );
1441
+ var CHANGE_ITEM_SCHEMA = z.object({
1442
+ type: z.enum(["modify", "accept", "reject", "reply", "insert_row", "delete_row"]).describe(
1443
+ "Change kind: 'modify' (search-and-replace), 'accept'/'reject' (resolve a tracked change by id), 'reply' (reply to a comment by id), 'insert_row'/'delete_row' (table edits; disk mode only)."
1444
+ ),
1445
+ target_text: z.string().optional().describe(
1446
+ "modify / insert_row / delete_row: the existing text to locate (interpreted as a regex when regex=true)."
1447
+ ),
1448
+ new_text: z.string().optional().describe(
1449
+ "modify: replacement text. Supports Markdown (headings, **bold**, _italic_, '\\n\\n' paragraph splits); empty string deletes. Regex capture groups are available as $1, $2\u2026"
1450
+ ),
1451
+ target_id: z.string().optional().describe(
1452
+ "accept / reject / reply: the 'Chg:N' or 'Com:N' id taken from a fresh read_docx."
1453
+ ),
1454
+ text: z.string().optional().describe("reply: the reply body."),
1455
+ comment: z.string().optional().describe(
1456
+ "modify / accept / reject: attach a margin comment to the change (no manual CriticMarkup)."
1457
+ ),
1458
+ match_mode: z.enum(["strict", "first", "all"]).optional().describe(
1459
+ "modify only: 'strict' (default \u2014 target must match uniquely), 'first' (first occurrence), or 'all' (every occurrence)."
1460
+ ),
1461
+ regex: z.boolean().optional().describe(
1462
+ "modify only: treat target_text as a regular expression (default false)."
1463
+ ),
1464
+ position: z.enum(["above", "below"]).optional().describe(
1465
+ "insert_row: place the new row above or below the matched row."
1466
+ ),
1467
+ cells: z.array(z.string()).optional().describe("insert_row: the cell values for the new row, left to right.")
1468
+ }).passthrough();
1441
1469
  server.registerTool(
1442
1470
  "process_document_batch",
1443
1471
  {
@@ -1445,7 +1473,9 @@ server.registerTool(
1445
1473
  inputSchema: {
1446
1474
  original_docx_path: z.string().describe("Absolute path to the source file."),
1447
1475
  author_name: z.string().describe("Name to appear in Track Changes (e.g., 'Reviewer AI')."),
1448
- changes: z.array(z.any()).describe("List of changes to apply. Each change must specify 'type'."),
1476
+ changes: z.array(z.union([z.string(), CHANGE_ITEM_SCHEMA])).describe(
1477
+ "Ordered list of changes to apply. Each item is an object carrying a `type` discriminator plus that type's fields (see the per-field docs and the tool description). All items evaluate against the ORIGINAL document state."
1478
+ ),
1449
1479
  output_path: z.string().optional().describe("Optional output path."),
1450
1480
  dry_run: z.boolean().optional().default(false).describe(
1451
1481
  "If True, simulates the changes and returns a detailed preview report without modifying any files."
@@ -1602,7 +1632,7 @@ server.registerTool(
1602
1632
  server.registerTool(
1603
1633
  "finalize_document",
1604
1634
  {
1605
- description: "Prepares a document for external distribution or e-signature.",
1635
+ description: "Prepares a document for external distribution or e-signature. Note: in this zero-dependency environment, protection_mode='encrypt' is unsupported and falls back to a native read-only lock; export_pdf and password are ignored.",
1606
1636
  inputSchema: {
1607
1637
  file_path: z.string().describe("Absolute path to the DOCX file."),
1608
1638
  output_path: z.string().optional().describe("Optional output path."),
@@ -1610,7 +1640,9 @@ server.registerTool(
1610
1640
  accept_all: z.boolean().optional().describe(
1611
1641
  "If true, auto-accepts all unresolved track changes before finalizing."
1612
1642
  ),
1613
- protection_mode: z.enum(["read_only", "encrypt"]).optional().describe("Native OOXML document locking."),
1643
+ protection_mode: z.enum(["read_only", "encrypt"]).optional().describe(
1644
+ "Native OOXML document locking. Note: 'encrypt' is unsupported in this zero-dependency build and falls back to 'read_only'."
1645
+ ),
1614
1646
  password: z.string().optional().describe("Ignored in this environment."),
1615
1647
  author: z.string().optional().describe("Replace all remaining markup authorship with this name."),
1616
1648
  export_pdf: z.boolean().optional().describe("Ignored in this environment.")
@@ -1827,8 +1859,8 @@ ${stats.skipped_details.join("\n")}`;
1827
1859
  async function main() {
1828
1860
  const transport = new StdioServerTransport();
1829
1861
  await server.connect(transport);
1830
- const gitSha2 = "23b2879";
1831
- const buildTs = "2026-06-25T13:51:23.036Z";
1862
+ const gitSha2 = "2179c76";
1863
+ const buildTs = "2026-06-26T07:48:21.832Z";
1832
1864
  console.error(
1833
1865
  `Adeu MCP Server (Node.js Engine: ${identifyEngine()}) running on stdio build=${gitSha2}@${buildTs}`
1834
1866
  );