@tiwater/office-mcp 0.21.61 → 0.21.63

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.
@@ -6,6 +6,12 @@
6
6
  "input": { "type": "string", "minLength": 1, "x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current" },
7
7
  "italic": { "type": "boolean" },
8
8
  "indentCharactersPerLevel": { "type": "integer", "minimum": 0, "maximum": 21474836 },
9
+ "tocStyleLevels": {
10
+ "type": "object",
11
+ "properties": {},
12
+ "description": "Optional exact mapping from current TOC entry paragraph style IDs to displayed one-based levels. When provided, every current TOC entry style must be mapped and unused styles are rejected.",
13
+ "additionalProperties": { "type": "integer", "minimum": 1, "maximum": 9 }
14
+ },
9
15
  "output": { "type": "string", "minLength": 1, "description": "Output DOCX path; may equal input for an atomic in-place update.", "x-tiwater-file-role": "write" },
10
16
  "receiptOutput": {
11
17
  "type": "string",
@@ -15,6 +15,11 @@
15
15
  "description": "New JSON file that receives every native table in document order, including rows, cells, merges, paragraphs, and text nodes.",
16
16
  "x-tiwater-file-role": "write",
17
17
  "x-tiwater-file-effect": false
18
+ },
19
+ "returnContent": {
20
+ "type": "boolean",
21
+ "const": false,
22
+ "description": "Optional compatibility flag for a uniform observation request. Only false is accepted because this tool always writes the complete result to output and never returns table content inline."
18
23
  }
19
24
  },
20
25
  "required": ["input", "output"],
@@ -15,6 +15,12 @@
15
15
  "minimum": 0,
16
16
  "maximum": 9007199254740991
17
17
  },
18
+ "tocStyleLevels": {
19
+ "type": "object",
20
+ "properties": {},
21
+ "description": "Optional exact mapping from current TOC entry paragraph style IDs to displayed one-based levels. When provided, every current TOC entry style must be mapped and unused styles are rejected.",
22
+ "additionalProperties": { "type": "integer", "minimum": 1, "maximum": 9 }
23
+ },
18
24
  "returnContent": {
19
25
  "type": "boolean",
20
26
  "description": "Return the complete result directly when it fits the published response limit."
@@ -2,7 +2,7 @@
2
2
  "schema": "tiwater.office-provider-contract-manifest/v1",
3
3
  "provider": {
4
4
  "id": "@tiwater/office-mcp",
5
- "version": "0.21.61"
5
+ "version": "0.21.63"
6
6
  },
7
7
  "tools": [
8
8
  {
@@ -20,11 +20,11 @@
20
20
  "name": "docx_apply_toc_style_policy",
21
21
  "providerContract": {
22
22
  "source": "packages/docx-cli/contracts/mcp-input/docx_apply_toc_style_policy.schema.json",
23
- "sha256": "975fd24572ae28fb2181edaae9da856417cdcd657f8d83c5eb46c3ff069d2376"
23
+ "sha256": "ffc43335216af8c214eadf0aa87cddd95a9269e3b97370eee58890df04e66d5d"
24
24
  },
25
25
  "inputContract": {
26
26
  "path": "office/contracts/docx_apply_toc_style_policy.schema.json",
27
- "sha256": "975fd24572ae28fb2181edaae9da856417cdcd657f8d83c5eb46c3ff069d2376"
27
+ "sha256": "ffc43335216af8c214eadf0aa87cddd95a9269e3b97370eee58890df04e66d5d"
28
28
  }
29
29
  },
30
30
  {
@@ -174,11 +174,11 @@
174
174
  "name": "docx_read_all_tables",
175
175
  "providerContract": {
176
176
  "source": "packages/docx-cli/contracts/mcp-input/docx_read_all_tables.schema.json",
177
- "sha256": "a5a22e6368977d620af1c53cc934d8934550734069d7ef7f65fc434e4136ae62"
177
+ "sha256": "e9b2ff2d66c7574fa20216af908f41c22decf18edd14ed297e53f4c6599f5c60"
178
178
  },
179
179
  "inputContract": {
180
180
  "path": "office/contracts/docx_read_all_tables.schema.json",
181
- "sha256": "a5a22e6368977d620af1c53cc934d8934550734069d7ef7f65fc434e4136ae62"
181
+ "sha256": "e9b2ff2d66c7574fa20216af908f41c22decf18edd14ed297e53f4c6599f5c60"
182
182
  }
183
183
  },
184
184
  {
@@ -361,11 +361,11 @@
361
361
  "name": "docx_validate_toc_style_policy",
362
362
  "providerContract": {
363
363
  "source": "packages/docx-cli/contracts/mcp-input/docx_validate_toc_style_policy.schema.json",
364
- "sha256": "5a98a3073a8e149a591254ef4e93f27d3b8f5dbce3204199d7155365f00088ef"
364
+ "sha256": "da5a001a699adba31269cfbe0dd055cdbb9bbd53d0d4447f1b881981ec8dcf66"
365
365
  },
366
366
  "inputContract": {
367
367
  "path": "office/contracts/docx_validate_toc_style_policy.schema.json",
368
- "sha256": "5a98a3073a8e149a591254ef4e93f27d3b8f5dbce3204199d7155365f00088ef"
368
+ "sha256": "da5a001a699adba31269cfbe0dd055cdbb9bbd53d0d4447f1b881981ec8dcf66"
369
369
  }
370
370
  },
371
371
  {
package/office/index.mjs CHANGED
@@ -608,7 +608,7 @@ const tools = [
608
608
  },
609
609
  {
610
610
  name: 'docx_read_all_tables',
611
- description: 'Read every native table from one current DOCX in document order. The document is opened once and the complete rows, cells, merge ownership, paragraphs, and text nodes are written to output. Only a compact receipt is returned. This tool does not select business tables or infer their meaning.',
611
+ description: 'Read every native table from one current DOCX in document order. The document is opened once and the complete rows, cells, merge ownership, paragraphs, and text nodes are written to output. Only a compact receipt is returned. The optional compatibility argument returnContent may only be false; true is unsupported because table content is never returned inline. This tool does not select business tables or infer their meaning.',
612
612
  inputSchema: inputContract('docx_read_all_tables'),
613
613
  outputSchema: docxReadAllTablesOutput,
614
614
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -785,7 +785,7 @@ const tools = [
785
785
  },
786
786
  {
787
787
  name: 'docx_validate_toc_style_policy',
788
- description: 'Validate current DOCX table-of-contents paragraph styles against an explicit policy. Set returnContent true to return the complete result when it fits the response limit. Provide output to write the complete result to a new JSON file. The two choices are independent and may be used together; at least one is required.',
788
+ description: 'Validate current DOCX table-of-contents paragraph styles against an explicit policy. Optionally provide an exact mapping from current TOC entry paragraph style IDs to displayed levels. Set returnContent true to return the complete result when it fits the response limit. Provide output to write the complete result to a new JSON file. The two choices are independent and may be used together; at least one is required.',
789
789
  inputSchema: inputContract('docx_validate_toc_style_policy'),
790
790
  outputSchema: largeResultOutput('docx_validate_toc_style_policy'),
791
791
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -794,7 +794,7 @@ const tools = [
794
794
  {
795
795
  name: 'docx_apply_toc_style_policy',
796
796
  effectKind: 'document-mutation',
797
- description: 'Apply explicit italic and per-level indentation values to current built-in table-of-contents paragraph styles. It does not change heading text or refresh fields.',
797
+ description: 'Apply explicit italic and per-level indentation values to current table-of-contents entries. Optionally provide an exact mapping from current TOC entry paragraph style IDs to displayed levels. It does not change heading text or refresh fields.',
798
798
  inputSchema: inputContract('docx_apply_toc_style_policy'),
799
799
  outputSchema: fixedEditOutput('docx_apply_toc_style_policy'),
800
800
  handler: (args, tool) => fixedEdit(tool, args, docxCandidates),
@@ -1335,10 +1335,15 @@ async function docxValidateFontPolicy(args) {
1335
1335
 
1336
1336
  async function docxValidateTocStylePolicy(args) {
1337
1337
  const input = path.resolve(requireString(args.input, 'input'));
1338
- const result = await runJsonCandidateChain(docxCandidates, [
1339
- 'validate-toc-style-policy', input, String(args.italic), String(args.indentCharactersPerLevel),
1340
- ], { allowedExitCodes: [0, 1] });
1341
- return deliverLargeJsonResult({ tool: 'docx_validate_toc_style_policy', args, runtime: commandRuntime(result), payload: result.json, sourcePaths: [input] });
1338
+ const validate = async tocStyleLevelsPath => {
1339
+ const commandArgs = ['validate-toc-style-policy', input, String(args.italic), String(args.indentCharactersPerLevel)];
1340
+ if (tocStyleLevelsPath) commandArgs.push(tocStyleLevelsPath);
1341
+ const result = await runJsonCandidateChain(docxCandidates, commandArgs, { allowedExitCodes: [0, 1] });
1342
+ return deliverLargeJsonResult({ tool: 'docx_validate_toc_style_policy', args, runtime: commandRuntime(result), payload: result.json, sourcePaths: [input] });
1343
+ };
1344
+ return args.tocStyleLevels === undefined
1345
+ ? validate(undefined)
1346
+ : withTempJsonFile(args.tocStyleLevels, validate);
1342
1347
  }
1343
1348
 
1344
1349
  async function docxStripDirectFormatting(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.21.61",
3
+ "version": "0.21.63",
4
4
  "description": "Published MCP distribution for independent Tiwater Office, PDF, and Text document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -2,7 +2,7 @@
2
2
  "schema": "tiwater.pdf-provider-contract-manifest/v1",
3
3
  "provider": {
4
4
  "id": "@tiwater/office-mcp",
5
- "version": "0.21.61"
5
+ "version": "0.21.63"
6
6
  },
7
7
  "runtime": {
8
8
  "command": "tiwater-pdf"
@@ -2,7 +2,7 @@
2
2
  "schema": "tiwater.text-provider-contract-manifest/v1",
3
3
  "provider": {
4
4
  "id": "@tiwater/office-mcp",
5
- "version": "0.21.61"
5
+ "version": "0.21.63"
6
6
  },
7
7
  "tools": [
8
8
  {