@tiwater/office-mcp 0.21.47 → 0.21.48

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.
@@ -0,0 +1,69 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "tiwater.office-mcp-input/docx_set_table_width",
4
+ "type": "object",
5
+ "properties": {
6
+ "input": {
7
+ "type": "string",
8
+ "minLength": 1,
9
+ "x-tiwater-file-role": "read",
10
+ "x-tiwater-document-revision-role": "current"
11
+ },
12
+ "changes": {
13
+ "type": "array",
14
+ "minItems": 1,
15
+ "items": {
16
+ "type": "object",
17
+ "properties": {
18
+ "table": {
19
+ "type": "object",
20
+ "properties": {
21
+ "part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
22
+ "path": { "type": "string", "pattern": "^\\/[A-Za-z_][A-Za-z0-9_.-]*:[A-Za-z_][A-Za-z0-9_.-]*\\[[1-9][0-9]*\\](?:\\/[A-Za-z_][A-Za-z0-9_.-]*:[A-Za-z_][A-Za-z0-9_.-]*\\[[1-9][0-9]*\\])*$" }
23
+ },
24
+ "required": ["part", "path"],
25
+ "additionalProperties": false
26
+ },
27
+ "width": {
28
+ "oneOf": [
29
+ {
30
+ "type": "object",
31
+ "properties": {
32
+ "type": { "type": "string", "enum": ["dxa", "pct"] },
33
+ "value": { "type": "string", "pattern": "^[1-9][0-9]*$" }
34
+ },
35
+ "required": ["type", "value"],
36
+ "additionalProperties": false
37
+ },
38
+ {
39
+ "type": "object",
40
+ "properties": {
41
+ "type": { "type": "string", "enum": ["auto", "nil"] },
42
+ "value": { "type": "string", "const": "0" }
43
+ },
44
+ "required": ["type", "value"],
45
+ "additionalProperties": false
46
+ }
47
+ ]
48
+ }
49
+ },
50
+ "required": ["table", "width"],
51
+ "additionalProperties": false
52
+ }
53
+ },
54
+ "output": {
55
+ "type": "string",
56
+ "minLength": 1,
57
+ "description": "Output DOCX path; may equal input for an atomic in-place update.",
58
+ "x-tiwater-file-role": "write"
59
+ },
60
+ "receiptOutput": {
61
+ "type": "string",
62
+ "minLength": 1,
63
+ "x-tiwater-file-role": "write",
64
+ "x-tiwater-file-effect": false
65
+ }
66
+ },
67
+ "required": ["input", "changes", "output", "receiptOutput"],
68
+ "additionalProperties": false
69
+ }
@@ -34,6 +34,11 @@
34
34
  },
35
35
  "text": {
36
36
  "type": "string"
37
+ },
38
+ "fontName": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "description": "Optional Latin and complex-script font family for the replacement run. East Asian font settings remain inherited from the target."
37
42
  }
38
43
  },
39
44
  "required": [
@@ -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.47"
5
+ "version": "0.21.48"
6
6
  },
7
7
  "tools": [
8
8
  {
@@ -214,15 +214,26 @@
214
214
  "sha256": "d04c40174ce3427689c970b26dd3a282f9d9f6889e4c5ac737eca5926ef709b9"
215
215
  }
216
216
  },
217
+ {
218
+ "name": "docx_set_table_width",
219
+ "providerContract": {
220
+ "source": "packages/docx-cli/contracts/mcp-input/docx_set_table_width.schema.json",
221
+ "sha256": "7a51a25a139ffa57c76eeed43dc2a8b9252fafdc0d299ede995f68d44021a3a6"
222
+ },
223
+ "inputContract": {
224
+ "path": "office/contracts/docx_set_table_width.schema.json",
225
+ "sha256": "7a51a25a139ffa57c76eeed43dc2a8b9252fafdc0d299ede995f68d44021a3a6"
226
+ }
227
+ },
217
228
  {
218
229
  "name": "docx_set_text",
219
230
  "providerContract": {
220
231
  "source": "packages/docx-cli/contracts/mcp-input/docx_set_text.schema.json",
221
- "sha256": "4d6f69ef474c0a3ceade95cce362fba7e000946bb890e64119177c5519524db2"
232
+ "sha256": "45d8aa5d95402ac5b17fe07540355f81afa0804214ef319f33d7da11cf3c56cc"
222
233
  },
223
234
  "inputContract": {
224
235
  "path": "office/contracts/docx_set_text.schema.json",
225
- "sha256": "4d6f69ef474c0a3ceade95cce362fba7e000946bb890e64119177c5519524db2"
236
+ "sha256": "45d8aa5d95402ac5b17fe07540355f81afa0804214ef319f33d7da11cf3c56cc"
226
237
  }
227
238
  },
228
239
  {
package/office/index.mjs CHANGED
@@ -497,6 +497,10 @@ const docxTableReadOutput = docxObservationOutput('docx_read_table').extend({
497
497
  address: docxAddress,
498
498
  rowCount: z.number().int().nonnegative(),
499
499
  columnCount: z.number().int().nonnegative(),
500
+ tableWidth: z.object({
501
+ type: z.enum(['auto', 'dxa', 'nil', 'pct']),
502
+ value: z.string(),
503
+ }).strict().nullable(),
500
504
  gridColumns: z.array(z.object({
501
505
  address: docxAddress,
502
506
  widthTwips: z.number().int().positive().nullable(),
@@ -601,7 +605,7 @@ const tools = [
601
605
  {
602
606
  name: 'docx_set_text',
603
607
  effectKind: 'document-mutation',
604
- description: 'Replace the whole text content of paragraph or cell objects observed from this exact input DOCX while retaining target formatting, bookmarks, spans, and vertical merges. For a vertically merged logical cell, write its visible text to the restart cell rather than a continue cell. Tabs and line breaks remain native document text controls; targets containing non-text objects are rejected. Use this only for newly derived text. Content copied or selected from a source DOCX uses docx_replace_content_from_source so native runs such as superscript and subscript are retained. This does not insert objects, change table structure, copy source formatting, or decide business wording.',
608
+ description: 'Replace the whole text content of paragraph or cell objects observed from this exact input DOCX while retaining target formatting, bookmarks, spans, and vertical merges. A change may explicitly set the Latin and complex-script font family of its nonempty replacement run; East Asian font settings remain inherited from the target. For a vertically merged logical cell, write its visible text to the restart cell rather than a continue cell. Tabs and line breaks remain native document text controls; targets containing non-text objects are rejected. Use this only for newly derived text. Content copied or selected from a source DOCX uses docx_replace_content_from_source so native runs such as superscript and subscript are retained. This does not insert objects, change table structure, copy source formatting, or decide business wording.',
605
609
  inputSchema: inputContract('docx_set_text'),
606
610
  outputSchema: fixedEditOutput('docx_set_text'),
607
611
  handler: (args, tool) => fixedEdit(tool, args, docxCandidates),
@@ -614,6 +618,14 @@ const tools = [
614
618
  outputSchema: fixedEditOutput('docx_set_paragraph_pagination'),
615
619
  handler: (args, tool) => fixedEdit(tool, args, docxCandidates),
616
620
  },
621
+ {
622
+ name: 'docx_set_table_width',
623
+ effectKind: 'document-mutation',
624
+ description: 'Set the explicit native width of one or more selected current DOCX tables. Width type is pct, dxa, auto, or nil; pct/dxa take an exact positive Open XML value and auto/nil take 0. This does not change grid-column widths, autofit behavior, cell widths, table structure, content, or business meaning.',
625
+ inputSchema: inputContract('docx_set_table_width'),
626
+ outputSchema: fixedEditOutput('docx_set_table_width'),
627
+ handler: (args, tool) => fixedEdit(tool, args, docxCandidates),
628
+ },
617
629
  {
618
630
  name: 'docx_set_table',
619
631
  effectKind: 'document-mutation',
@@ -1103,6 +1115,7 @@ async function docxObservation(tool, args) {
1103
1115
  address: payload.address,
1104
1116
  rowCount: payload.rowCount,
1105
1117
  columnCount: payload.columnCount,
1118
+ tableWidth: payload.tableWidth,
1106
1119
  gridColumns: payload.gridColumns,
1107
1120
  precedingParagraph: payload.precedingParagraph,
1108
1121
  followingParagraph: payload.followingParagraph,
@@ -1120,6 +1133,7 @@ async function docxObservation(tool, args) {
1120
1133
  address: payload.address,
1121
1134
  rowCount: payload.rowCount,
1122
1135
  columnCount: payload.columnCount,
1136
+ tableWidth: payload.tableWidth,
1123
1137
  gridColumns: payload.gridColumns,
1124
1138
  precedingParagraph: payload.precedingParagraph,
1125
1139
  followingParagraph: payload.followingParagraph,
@@ -1175,6 +1189,7 @@ async function docxObservation(tool, args) {
1175
1189
  address: payload.address,
1176
1190
  rowCount: payload.rowCount,
1177
1191
  columnCount: payload.columnCount,
1192
+ tableWidth: payload.tableWidth,
1178
1193
  gridColumns: payload.gridColumns,
1179
1194
  precedingParagraph: payload.precedingParagraph,
1180
1195
  followingParagraph: payload.followingParagraph,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.21.47",
3
+ "version": "0.21.48",
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.47"
5
+ "version": "0.21.48"
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.47"
5
+ "version": "0.21.48"
6
6
  },
7
7
  "tools": [
8
8
  {