@tiwater/office-mcp 0.21.62 → 0.21.64

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,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.62"
5
+ "version": "0.21.64"
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
  {
@@ -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
@@ -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.62",
3
+ "version": "0.21.64",
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.62"
5
+ "version": "0.21.64"
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.62"
5
+ "version": "0.21.64"
6
6
  },
7
7
  "tools": [
8
8
  {