@tiwater/office-mcp 0.15.11 → 0.15.13

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/office/README.md CHANGED
@@ -8,6 +8,7 @@ values, business mappings, workflow decisions, and delivery status.
8
8
 
9
9
  Every inspect/export result binds its observation artifact to the exact source
10
10
  file path, SHA-256, and byte count used by that invocation.
11
+ Full native object reads are also written as artifacts instead of being inlined.
11
12
 
12
13
  Every filesystem argument is identified in the published MCP input schema by
13
14
  `x-tiwater-file-role`. `read` marks an existing provider input; `write` marks a
@@ -0,0 +1,67 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "tiwater.office-mcp-input/docx_copy_content",
4
+ "type": "object",
5
+ "properties": {
6
+ "targetDocument": {
7
+ "type": "object",
8
+ "properties": {
9
+ "input": { "type": "string", "minLength": 1, "x-tiwater-file-role": "read" },
10
+ "revision": { "type": "string", "pattern": "^docx-rev-v1-[0-9a-f]{64}$" }
11
+ },
12
+ "required": ["input", "revision"],
13
+ "additionalProperties": false
14
+ },
15
+ "changes": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "items": {
19
+ "type": "object",
20
+ "properties": {
21
+ "targetRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
22
+ "sourceDocument": {
23
+ "type": "object",
24
+ "properties": {
25
+ "input": { "type": "string", "minLength": 1, "x-tiwater-file-role": "read" },
26
+ "revision": { "type": "string", "pattern": "^docx-rev-v1-[0-9a-f]{64}$" }
27
+ },
28
+ "required": ["input", "revision"],
29
+ "additionalProperties": false
30
+ },
31
+ "sourceSelections": {
32
+ "type": "array",
33
+ "minItems": 1,
34
+ "items": {
35
+ "type": "object",
36
+ "properties": {
37
+ "ref": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
38
+ "range": {
39
+ "type": "object",
40
+ "properties": {
41
+ "start": { "type": "integer", "minimum": 0, "maximum": 2147483647 },
42
+ "length": { "type": "integer", "exclusiveMinimum": 0, "maximum": 2147483647 }
43
+ },
44
+ "required": ["start", "length"],
45
+ "additionalProperties": false
46
+ }
47
+ },
48
+ "required": ["ref"],
49
+ "additionalProperties": false
50
+ }
51
+ }
52
+ },
53
+ "required": ["targetRef", "sourceDocument", "sourceSelections"],
54
+ "additionalProperties": false
55
+ }
56
+ },
57
+ "output": { "type": "string", "minLength": 1, "x-tiwater-file-role": "write" },
58
+ "receiptOutput": {
59
+ "type": "string",
60
+ "minLength": 1,
61
+ "x-tiwater-file-role": "write",
62
+ "x-tiwater-file-effect": false
63
+ }
64
+ },
65
+ "required": ["targetDocument", "changes", "output", "receiptOutput"],
66
+ "additionalProperties": false
67
+ }
@@ -0,0 +1,88 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "tiwater.office-mcp-input/docx_copy_object",
4
+ "type": "object",
5
+ "properties": {
6
+ "targetDocument": {
7
+ "type": "object",
8
+ "properties": {
9
+ "input": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "x-tiwater-file-role": "read"
13
+ },
14
+ "revision": {
15
+ "type": "string",
16
+ "minLength": 1,
17
+ "description": "Exact revision id returned by the current observation."
18
+ }
19
+ },
20
+ "required": ["input", "revision"],
21
+ "additionalProperties": false
22
+ },
23
+ "changes": {
24
+ "type": "array",
25
+ "minItems": 1,
26
+ "items": {
27
+ "type": "object",
28
+ "properties": {
29
+ "sourceDocument": {
30
+ "type": "object",
31
+ "properties": {
32
+ "input": {
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "x-tiwater-file-role": "read"
36
+ },
37
+ "revision": {
38
+ "type": "string",
39
+ "minLength": 1,
40
+ "description": "Exact revision id returned by the source observation."
41
+ }
42
+ },
43
+ "required": ["input", "revision"],
44
+ "additionalProperties": false
45
+ },
46
+ "sourceRefs": {
47
+ "type": "array",
48
+ "minItems": 1,
49
+ "items": {
50
+ "type": "string",
51
+ "pattern": "^dox1_[0-9a-f]{64}$"
52
+ }
53
+ },
54
+ "targetParentRef": {
55
+ "type": "string",
56
+ "pattern": "^dox1_[0-9a-f]{64}$"
57
+ },
58
+ "beforeRef": {
59
+ "type": "string",
60
+ "pattern": "^dox1_[0-9a-f]{64}$"
61
+ },
62
+ "repeat": {
63
+ "type": "integer",
64
+ "minimum": 1,
65
+ "maximum": 1000
66
+ }
67
+ },
68
+ "required": ["sourceDocument", "sourceRefs", "targetParentRef"],
69
+ "additionalProperties": false
70
+ }
71
+ },
72
+ "output": {
73
+ "type": "string",
74
+ "minLength": 1,
75
+ "x-tiwater-file-role": "write",
76
+ "description": "New DOCX output path; an existing path is rejected."
77
+ },
78
+ "receiptOutput": {
79
+ "type": "string",
80
+ "minLength": 1,
81
+ "x-tiwater-file-role": "write",
82
+ "x-tiwater-file-effect": false,
83
+ "description": "New JSON receipt path; an existing path is rejected."
84
+ }
85
+ },
86
+ "required": ["targetDocument", "changes", "output", "receiptOutput"],
87
+ "additionalProperties": false
88
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "tiwater.office-mcp-input/docx_delete_object",
4
+ "type": "object",
5
+ "properties": {
6
+ "targetDocument": {
7
+ "type": "object",
8
+ "properties": {
9
+ "input": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "x-tiwater-file-role": "read"
13
+ },
14
+ "revision": {
15
+ "type": "string",
16
+ "minLength": 1,
17
+ "description": "Exact revision id returned by the current observation."
18
+ }
19
+ },
20
+ "required": ["input", "revision"],
21
+ "additionalProperties": false
22
+ },
23
+ "changes": {
24
+ "type": "array",
25
+ "minItems": 1,
26
+ "items": {
27
+ "type": "object",
28
+ "properties": {
29
+ "refs": {
30
+ "type": "array",
31
+ "minItems": 1,
32
+ "items": {
33
+ "type": "string",
34
+ "pattern": "^dox1_[0-9a-f]{64}$"
35
+ }
36
+ }
37
+ },
38
+ "required": ["refs"],
39
+ "additionalProperties": false
40
+ }
41
+ },
42
+ "output": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "x-tiwater-file-role": "write",
46
+ "description": "New DOCX output path; an existing path is rejected."
47
+ },
48
+ "receiptOutput": {
49
+ "type": "string",
50
+ "minLength": 1,
51
+ "x-tiwater-file-role": "write",
52
+ "x-tiwater-file-effect": false,
53
+ "description": "New JSON receipt path; an existing path is rejected."
54
+ }
55
+ },
56
+ "required": ["targetDocument", "changes", "output", "receiptOutput"],
57
+ "additionalProperties": false
58
+ }
@@ -17,9 +17,11 @@
17
17
  "part",
18
18
  "paragraph",
19
19
  "table",
20
+ "gridColumn",
20
21
  "row",
21
22
  "cell",
22
23
  "run",
24
+ "text",
23
25
  "drawing"
24
26
  ]
25
27
  },
@@ -8,15 +8,17 @@
8
8
  "x-tiwater-file-role": "read"
9
9
  },
10
10
  "kind": {
11
- "description": "Object granularity for structure discovery, not document-text extraction. Use table to locate tables and row with a table parentRef for table-range discovery; use cell or run only when the task directly targets that object kind.",
11
+ "description": "Open XML object kind to list. Use parentRef to walk only the native structure needed for the direct operation.",
12
12
  "type": "string",
13
13
  "enum": [
14
14
  "part",
15
15
  "paragraph",
16
16
  "table",
17
+ "gridColumn",
17
18
  "row",
18
19
  "cell",
19
20
  "run",
21
+ "text",
20
22
  "drawing"
21
23
  ]
22
24
  },
@@ -26,7 +28,7 @@
26
28
  "minLength": 1
27
29
  },
28
30
  "parentRef": {
29
- "description": "Optional revision-bound parent object ref. Returns only its nearest published child objects: a part yields top-level story blocks, a table yields rows, a row yields cells. This is not recursive descendant search.",
31
+ "description": "Optional revision-bound parent object ref. Returns only its nearest published child objects; this is not recursive descendant search.",
30
32
  "type": "string",
31
33
  "pattern": "^dox1_[0-9a-f]{64}$"
32
34
  },
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "tiwater.office-mcp-input/docx_merge_cells",
4
+ "type": "object",
5
+ "properties": {
6
+ "targetDocument": {
7
+ "type": "object",
8
+ "properties": {
9
+ "input": { "type": "string", "minLength": 1, "x-tiwater-file-role": "read" },
10
+ "revision": { "type": "string", "minLength": 1 }
11
+ },
12
+ "required": ["input", "revision"],
13
+ "additionalProperties": false
14
+ },
15
+ "changes": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "items": {
19
+ "type": "object",
20
+ "properties": {
21
+ "cellRefs": {
22
+ "type": "array",
23
+ "minItems": 2,
24
+ "items": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" }
25
+ }
26
+ },
27
+ "required": ["cellRefs"],
28
+ "additionalProperties": false
29
+ }
30
+ },
31
+ "output": { "type": "string", "minLength": 1, "x-tiwater-file-role": "write" },
32
+ "receiptOutput": { "type": "string", "minLength": 1, "x-tiwater-file-role": "write", "x-tiwater-file-effect": false }
33
+ },
34
+ "required": ["targetDocument", "changes", "output", "receiptOutput"],
35
+ "additionalProperties": false
36
+ }
@@ -16,11 +16,18 @@
16
16
  "description": "Optional expected revision id from the observation receipt; a changed document fails as stale.",
17
17
  "type": "string",
18
18
  "pattern": "^docx-rev-v1-[0-9a-f]{64}$"
19
+ },
20
+ "output": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "description": "Absolute path for a new JSON artifact containing the complete native object observation.",
24
+ "x-tiwater-file-role": "write"
19
25
  }
20
26
  },
21
27
  "required": [
22
28
  "input",
23
- "ref"
29
+ "ref",
30
+ "output"
24
31
  ],
25
32
  "additionalProperties": false,
26
33
  "$id": "tiwater.office-mcp-input/docx_read_object/v1"
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "tiwater.office-mcp-input/docx_split_cells",
4
+ "type": "object",
5
+ "properties": {
6
+ "targetDocument": {
7
+ "type": "object",
8
+ "properties": {
9
+ "input": { "type": "string", "minLength": 1, "x-tiwater-file-role": "read" },
10
+ "revision": { "type": "string", "minLength": 1 }
11
+ },
12
+ "required": ["input", "revision"],
13
+ "additionalProperties": false
14
+ },
15
+ "changes": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "items": {
19
+ "type": "object",
20
+ "properties": {
21
+ "cellRefs": {
22
+ "type": "array",
23
+ "minItems": 1,
24
+ "items": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" }
25
+ }
26
+ },
27
+ "required": ["cellRefs"],
28
+ "additionalProperties": false
29
+ }
30
+ },
31
+ "output": { "type": "string", "minLength": 1, "x-tiwater-file-role": "write" },
32
+ "receiptOutput": { "type": "string", "minLength": 1, "x-tiwater-file-role": "write", "x-tiwater-file-effect": false }
33
+ },
34
+ "required": ["targetDocument", "changes", "output", "receiptOutput"],
35
+ "additionalProperties": false
36
+ }
@@ -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.15.11"
5
+ "version": "0.15.13"
6
6
  },
7
7
  "tools": [
8
8
  {
@@ -61,14 +61,25 @@
61
61
  }
62
62
  },
63
63
  {
64
- "name": "docx_copy_table_range",
64
+ "name": "docx_copy_content",
65
65
  "providerContract": {
66
- "source": "packages/docx-cli/contracts/mcp-input/docx_copy_table_range.schema.json",
67
- "sha256": "f6b98f12a3f7faaf7fe9dc0b874ee03ca9696d47b0f0b735fca8730488b39aa5"
66
+ "source": "packages/docx-cli/contracts/mcp-input/docx_copy_content.schema.json",
67
+ "sha256": "f85a71fa40cc378b007baf36c76b1a114a046ef6810f3933614f8683749d1cc1"
68
68
  },
69
69
  "inputContract": {
70
- "path": "office/contracts/docx_copy_table_range.schema.json",
71
- "sha256": "f6b98f12a3f7faaf7fe9dc0b874ee03ca9696d47b0f0b735fca8730488b39aa5"
70
+ "path": "office/contracts/docx_copy_content.schema.json",
71
+ "sha256": "f85a71fa40cc378b007baf36c76b1a114a046ef6810f3933614f8683749d1cc1"
72
+ }
73
+ },
74
+ {
75
+ "name": "docx_copy_object",
76
+ "providerContract": {
77
+ "source": "packages/docx-cli/contracts/mcp-input/docx_copy_object.schema.json",
78
+ "sha256": "45d30d97ba58ece704beb352ea41b4105f64cf9f43f11e94b6fb3de52b0b5823"
79
+ },
80
+ "inputContract": {
81
+ "path": "office/contracts/docx_copy_object.schema.json",
82
+ "sha256": "45d30d97ba58ece704beb352ea41b4105f64cf9f43f11e94b6fb3de52b0b5823"
72
83
  }
73
84
  },
74
85
  {
@@ -115,6 +126,17 @@
115
126
  "sha256": "7b7a901a8be893936cb137684c90bbde3245231914da7ecd8b06ff88811e7201"
116
127
  }
117
128
  },
129
+ {
130
+ "name": "docx_delete_object",
131
+ "providerContract": {
132
+ "source": "packages/docx-cli/contracts/mcp-input/docx_delete_object.schema.json",
133
+ "sha256": "a9ef8f5a195a9fd6731023e76731f3aef0905002b160c876e2fbc5288dcde66b"
134
+ },
135
+ "inputContract": {
136
+ "path": "office/contracts/docx_delete_object.schema.json",
137
+ "sha256": "a9ef8f5a195a9fd6731023e76731f3aef0905002b160c876e2fbc5288dcde66b"
138
+ }
139
+ },
118
140
  {
119
141
  "name": "docx_delete_table_rows",
120
142
  "providerContract": {
@@ -141,11 +163,11 @@
141
163
  "name": "docx_find_literal",
142
164
  "providerContract": {
143
165
  "source": "packages/docx-cli/contracts/mcp-input/docx_find_literal.schema.json",
144
- "sha256": "4d5465456d58c0375276e93ee21023c4b14b2caf7c4e1840b60414a7d3c7fd64"
166
+ "sha256": "a81b88ee6fa7d897d01c4cb05a18ca3b92738f2690b6f2fa6aff402c4c1ff182"
145
167
  },
146
168
  "inputContract": {
147
169
  "path": "office/contracts/docx_find_literal.schema.json",
148
- "sha256": "4d5465456d58c0375276e93ee21023c4b14b2caf7c4e1840b60414a7d3c7fd64"
170
+ "sha256": "a81b88ee6fa7d897d01c4cb05a18ca3b92738f2690b6f2fa6aff402c4c1ff182"
149
171
  }
150
172
  },
151
173
  {
@@ -229,11 +251,11 @@
229
251
  "name": "docx_list_objects",
230
252
  "providerContract": {
231
253
  "source": "packages/docx-cli/contracts/mcp-input/docx_list_objects.schema.json",
232
- "sha256": "329952b59c2b614e956ed8c00208a0fec17a06cb586dddc205aa4581f8d8e0d5"
254
+ "sha256": "7f0c3213addbeab2ff96579bcdd860ad65b8ae95c9e6b1e3fb7e5497f3e5a89d"
233
255
  },
234
256
  "inputContract": {
235
257
  "path": "office/contracts/docx_list_objects.schema.json",
236
- "sha256": "329952b59c2b614e956ed8c00208a0fec17a06cb586dddc205aa4581f8d8e0d5"
258
+ "sha256": "7f0c3213addbeab2ff96579bcdd860ad65b8ae95c9e6b1e3fb7e5497f3e5a89d"
237
259
  }
238
260
  },
239
261
  {
@@ -248,25 +270,25 @@
248
270
  }
249
271
  },
250
272
  {
251
- "name": "docx_merge_table_cells",
273
+ "name": "docx_merge_cells",
252
274
  "providerContract": {
253
- "source": "packages/docx-cli/contracts/mcp-input/docx_merge_table_cells.schema.json",
254
- "sha256": "19a6f09334c41f30a64b7b2b91653b7ad4b748e06f967887762f425711aa847d"
275
+ "source": "packages/docx-cli/contracts/mcp-input/docx_merge_cells.schema.json",
276
+ "sha256": "35958ebea8ef3123c2122b505a3c02fef3a8d423a3f054a9162d144089092d8b"
255
277
  },
256
278
  "inputContract": {
257
- "path": "office/contracts/docx_merge_table_cells.schema.json",
258
- "sha256": "19a6f09334c41f30a64b7b2b91653b7ad4b748e06f967887762f425711aa847d"
279
+ "path": "office/contracts/docx_merge_cells.schema.json",
280
+ "sha256": "35958ebea8ef3123c2122b505a3c02fef3a8d423a3f054a9162d144089092d8b"
259
281
  }
260
282
  },
261
283
  {
262
284
  "name": "docx_read_object",
263
285
  "providerContract": {
264
286
  "source": "packages/docx-cli/contracts/mcp-input/docx_read_object.schema.json",
265
- "sha256": "66637468203435e04545045c9be0ac118956d353501b14e12e9ceae03ac4bd9a"
287
+ "sha256": "ed4068627fe84872fb8d15d57d5950a22d03e79b4bb11cbc376a8d8b84cee0c0"
266
288
  },
267
289
  "inputContract": {
268
290
  "path": "office/contracts/docx_read_object.schema.json",
269
- "sha256": "66637468203435e04545045c9be0ac118956d353501b14e12e9ceae03ac4bd9a"
291
+ "sha256": "ed4068627fe84872fb8d15d57d5950a22d03e79b4bb11cbc376a8d8b84cee0c0"
270
292
  }
271
293
  },
272
294
  {
@@ -610,6 +632,17 @@
610
632
  "sha256": "1c10cfc9147591411fa3531a8737019215f8c2900529bf2d2079b3e68d5b298a"
611
633
  }
612
634
  },
635
+ {
636
+ "name": "docx_split_cells",
637
+ "providerContract": {
638
+ "source": "packages/docx-cli/contracts/mcp-input/docx_split_cells.schema.json",
639
+ "sha256": "d25ff4b44dade94bf3f09676feae31c93d4ec3a14c22d9f5602f3016d6fd40ec"
640
+ },
641
+ "inputContract": {
642
+ "path": "office/contracts/docx_split_cells.schema.json",
643
+ "sha256": "d25ff4b44dade94bf3f09676feae31c93d4ec3a14c22d9f5602f3016d6fd40ec"
644
+ }
645
+ },
613
646
  {
614
647
  "name": "docx_start_section",
615
648
  "providerContract": {
@@ -632,28 +665,6 @@
632
665
  "sha256": "49a6682f7c8aecce6e30e5a4bfc08111151d9c755d38e759de6b7efb66979cac"
633
666
  }
634
667
  },
635
- {
636
- "name": "docx_unmerge_table_column_cells",
637
- "providerContract": {
638
- "source": "packages/docx-cli/contracts/mcp-input/docx_unmerge_table_column_cells.schema.json",
639
- "sha256": "36d196deebc535274e5e4729b6e94fe3cf96a95e2e149e911b1b7dae0883b02f"
640
- },
641
- "inputContract": {
642
- "path": "office/contracts/docx_unmerge_table_column_cells.schema.json",
643
- "sha256": "36d196deebc535274e5e4729b6e94fe3cf96a95e2e149e911b1b7dae0883b02f"
644
- }
645
- },
646
- {
647
- "name": "docx_unmerge_table_row_cells",
648
- "providerContract": {
649
- "source": "packages/docx-cli/contracts/mcp-input/docx_unmerge_table_row_cells.schema.json",
650
- "sha256": "fe23986f030473c4802b6c29a896b6b5857ce24799bb078fb3e39846f0e29fa9"
651
- },
652
- "inputContract": {
653
- "path": "office/contracts/docx_unmerge_table_row_cells.schema.json",
654
- "sha256": "fe23986f030473c4802b6c29a896b6b5857ce24799bb078fb3e39846f0e29fa9"
655
- }
656
- },
657
668
  {
658
669
  "name": "docx_validate",
659
670
  "providerContract": {
package/office/index.mjs CHANGED
@@ -143,9 +143,8 @@ const docxFixedTools = [
143
143
  {"name":"docx_set_header_paragraph_font_size","description":"Set current header paragraph font size."},
144
144
  {"name":"docx_collapse_trailing_empty_section","description":"Collapse a current trailing empty section."},
145
145
  {"name":"docx_collapse_trailing_empty_paragraphs","description":"Collapse current trailing empty body paragraphs."},
146
- {"name":"docx_merge_table_cells","description":"Merge current body table cells."},
147
- {"name":"docx_unmerge_table_row_cells","description":"Unmerge current horizontal table cells."},
148
- {"name":"docx_unmerge_table_column_cells","description":"Unmerge current vertical table cell ranges."},
146
+ {"name":"docx_merge_cells","description":"Merge selected current DOCX cells when they form one closed rectangle."},
147
+ {"name":"docx_split_cells","description":"Split selected current DOCX merged cells."},
149
148
  {"name":"docx_delete_comments","description":"Delete explicit current DOCX comments."},
150
149
  {"name":"docx_mark_fields_dirty","description":"Mark current DOCX fields for native refresh."},
151
150
  {"name":"docx_sanitize_fields","description":"Remove update prompts and dirty markers from current DOCX fields."},
@@ -220,17 +219,32 @@ const tools = [
220
219
  },
221
220
  {
222
221
  name: 'docx_read_object',
223
- description: 'Read one selected revision-bound native DOCX object in full technical Open XML detail. Use a table or row ref from list/find to inspect grid spans and merges without enumerating document-wide cells.',
222
+ description: 'Write one selected revision-bound native DOCX object in full technical Open XML detail to a new JSON artifact. Use a table or row ref from list/find to inspect grid spans and merges without enumerating document-wide cells.',
224
223
  inputSchema: inputContract('docx_read_object'),
224
+ outputSchema: artifactOutput('docx_read_object'),
225
225
  annotations: { readOnlyHint: true, idempotentHint: true },
226
- handler: args => docxObservation('docx_read_object', args),
226
+ handler: docxReadObject,
227
227
  },
228
228
  {
229
- name: 'docx_copy_table_range',
230
- description: 'Copy contiguous source rows verbatim, one source row per output row, into a repeating target row pattern whose mapped vertical-merge topology already matches the source. This does not regroup rows, change semantic columns, remove translations, or rewrite values; use docx_replace_table_rows for those operations. Get row refs from list/find with kind=row; a merged physical cell may be selected only once.',
231
- inputSchema: inputContract('docx_copy_table_range'),
232
- outputSchema: fixedEditOutput('docx_copy_table_range'),
233
- handler: args => fixedEdit('docx_copy_table_range', args),
229
+ name: 'docx_copy_content',
230
+ description: 'Copy selected current DOCX content directly into selected current target cells while retaining target cell formatting and source inline meaning.',
231
+ inputSchema: inputContract('docx_copy_content'),
232
+ outputSchema: fixedEditOutput('docx_copy_content'),
233
+ handler: args => fixedEdit('docx_copy_content', args),
234
+ },
235
+ {
236
+ name: 'docx_copy_object',
237
+ description: 'Copy selected current DOCX objects directly under a selected current target parent object.',
238
+ inputSchema: inputContract('docx_copy_object'),
239
+ outputSchema: fixedEditOutput('docx_copy_object'),
240
+ handler: args => fixedEdit('docx_copy_object', args),
241
+ },
242
+ {
243
+ name: 'docx_delete_object',
244
+ description: 'Delete selected current DOCX objects directly from the current target document.',
245
+ inputSchema: inputContract('docx_delete_object'),
246
+ outputSchema: fixedEditOutput('docx_delete_object'),
247
+ handler: args => fixedEdit('docx_delete_object', args),
234
248
  },
235
249
  {
236
250
  name: 'docx_compare',
@@ -415,6 +429,21 @@ async function docxObservation(tool, args) {
415
429
  });
416
430
  }
417
431
 
432
+ async function docxReadObject(args) {
433
+ const input = path.resolve(requireString(args.input, 'input'));
434
+ const output = requireString(args.output, 'output');
435
+ const { output: _output, ...request } = args;
436
+ return withTempJsonFile(request, async requestPath => {
437
+ const result = await runJsonCandidateChain(docxCandidates, ['docx_read_object', requestPath]);
438
+ return {
439
+ tool: 'docx_read_object',
440
+ runtime: commandRuntime(result),
441
+ source: await fileArtifact(input),
442
+ artifact: await writeJsonArtifact(output, result.json),
443
+ };
444
+ });
445
+ }
446
+
418
447
  async function docxValidate(args) {
419
448
  const result = await runJsonCandidateChain(docxCandidates, ['validate-openxml', requireString(args.input, 'input')], { allowedExitCodes: [0, 1] });
420
449
  return { tool: 'docx_validate', runtime: commandRuntime(result), result: result.json };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.15.11",
3
+ "version": "0.15.13",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,121 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "type": "object",
4
- "properties": {
5
- "schema": {
6
- "type": "string",
7
- "const": "tiwater.docx-copy-table-range/v1"
8
- },
9
- "source": {
10
- "type": "object",
11
- "properties": {
12
- "input": {
13
- "type": "string",
14
- "minLength": 1,
15
- "x-tiwater-file-role": "read"
16
- },
17
- "revision": {
18
- "type": "string",
19
- "pattern": "^docx-rev-v1-[0-9a-f]{64}$"
20
- },
21
- "rowRefs": {
22
- "description": "Unique contiguous source row refs in document order, obtained from list/find with kind=row.",
23
- "minItems": 1,
24
- "type": "array",
25
- "items": {
26
- "type": "string",
27
- "pattern": "^dox1_[0-9a-f]{64}$"
28
- }
29
- }
30
- },
31
- "required": [
32
- "input",
33
- "revision",
34
- "rowRefs"
35
- ],
36
- "additionalProperties": false
37
- },
38
- "target": {
39
- "type": "object",
40
- "properties": {
41
- "input": {
42
- "type": "string",
43
- "minLength": 1,
44
- "x-tiwater-file-role": "read"
45
- },
46
- "revision": {
47
- "type": "string",
48
- "pattern": "^docx-rev-v1-[0-9a-f]{64}$"
49
- },
50
- "tableRef": {
51
- "description": "Target table ref from docx_list_objects with kind=table.",
52
- "type": "string",
53
- "pattern": "^dox1_[0-9a-f]{64}$"
54
- },
55
- "rowPatternRefs": {
56
- "description": "Unique contiguous target row refs belonging to tableRef. The complete pattern repeats when the source has more rows.",
57
- "minItems": 1,
58
- "type": "array",
59
- "items": {
60
- "type": "string",
61
- "pattern": "^dox1_[0-9a-f]{64}$"
62
- }
63
- }
64
- },
65
- "required": [
66
- "input",
67
- "revision",
68
- "tableRef",
69
- "rowPatternRefs"
70
- ],
71
- "additionalProperties": false
72
- },
73
- "columns": {
74
- "minItems": 1,
75
- "type": "array",
76
- "items": {
77
- "type": "object",
78
- "properties": {
79
- "sourceGridColumn": {
80
- "description": "Zero-based logical source grid column. A horizontally merged cell spans several grid indexes and may be selected only once.",
81
- "type": "integer",
82
- "minimum": 0,
83
- "maximum": 9007199254740991
84
- },
85
- "targetGridColumn": {
86
- "description": "Zero-based logical target grid column. A horizontally merged cell spans several grid indexes and may be selected only once.",
87
- "type": "integer",
88
- "minimum": 0,
89
- "maximum": 9007199254740991
90
- }
91
- },
92
- "required": [
93
- "sourceGridColumn",
94
- "targetGridColumn"
95
- ],
96
- "additionalProperties": false
97
- }
98
- },
99
- "output": {
100
- "type": "string",
101
- "minLength": 1,
102
- "x-tiwater-file-role": "write"
103
- },
104
- "receiptOutput": {
105
- "type": "string",
106
- "minLength": 1,
107
- "x-tiwater-file-role": "write",
108
- "x-tiwater-file-effect": false
109
- }
110
- },
111
- "required": [
112
- "schema",
113
- "source",
114
- "target",
115
- "columns",
116
- "output",
117
- "receiptOutput"
118
- ],
119
- "additionalProperties": false,
120
- "$id": "tiwater.docx-copy-table-range/v1"
121
- }
@@ -1,84 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "type": "object",
4
- "properties": {
5
- "input": {
6
- "type": "string",
7
- "minLength": 1,
8
- "x-tiwater-file-role": "read"
9
- },
10
- "output": {
11
- "type": "string",
12
- "minLength": 1,
13
- "description": "New document output path. Existing files are never overwritten.",
14
- "x-tiwater-file-role": "write"
15
- },
16
- "receiptOutput": {
17
- "type": "string",
18
- "minLength": 1,
19
- "description": "New JSON receipt path. Existing files are never overwritten.",
20
- "x-tiwater-file-role": "write",
21
- "x-tiwater-file-effect": false
22
- },
23
- "changes": {
24
- "minItems": 1,
25
- "type": "array",
26
- "items": {
27
- "type": "object",
28
- "properties": {
29
- "tableIndex": {
30
- "type": "integer",
31
- "minimum": 0,
32
- "maximum": 9007199254740991
33
- },
34
- "rowIndex": {
35
- "type": "integer",
36
- "minimum": 0,
37
- "maximum": 9007199254740991
38
- },
39
- "startCellIndex": {
40
- "type": "integer",
41
- "minimum": 0,
42
- "maximum": 9007199254740991
43
- },
44
- "endCellIndex": {
45
- "type": "integer",
46
- "minimum": 0,
47
- "maximum": 9007199254740991
48
- },
49
- "startRowIndex": {
50
- "type": "integer",
51
- "minimum": 0,
52
- "maximum": 9007199254740991
53
- },
54
- "endRowIndex": {
55
- "type": "integer",
56
- "minimum": 0,
57
- "maximum": 9007199254740991
58
- },
59
- "cellIndex": {
60
- "type": "integer",
61
- "minimum": 0,
62
- "maximum": 9007199254740991
63
- },
64
- "gridColumn": {
65
- "type": "integer",
66
- "minimum": 0,
67
- "maximum": 9007199254740991
68
- }
69
- },
70
- "required": [
71
- "tableIndex"
72
- ],
73
- "additionalProperties": false
74
- }
75
- }
76
- },
77
- "required": [
78
- "input",
79
- "output",
80
- "receiptOutput",
81
- "changes"
82
- ],
83
- "additionalProperties": false
84
- }
@@ -1,67 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "type": "object",
4
- "properties": {
5
- "input": {
6
- "type": "string",
7
- "minLength": 1,
8
- "x-tiwater-file-role": "read"
9
- },
10
- "output": {
11
- "type": "string",
12
- "minLength": 1,
13
- "description": "New document output path. Existing files are never overwritten.",
14
- "x-tiwater-file-role": "write"
15
- },
16
- "receiptOutput": {
17
- "type": "string",
18
- "minLength": 1,
19
- "description": "New JSON receipt path. Existing files are never overwritten.",
20
- "x-tiwater-file-role": "write",
21
- "x-tiwater-file-effect": false
22
- },
23
- "changes": {
24
- "minItems": 1,
25
- "type": "array",
26
- "items": {
27
- "type": "object",
28
- "properties": {
29
- "tableIndex": {
30
- "type": "integer",
31
- "minimum": 0,
32
- "maximum": 9007199254740991
33
- },
34
- "cellIndex": {
35
- "type": "integer",
36
- "minimum": 0,
37
- "maximum": 9007199254740991
38
- },
39
- "startRowIndex": {
40
- "type": "integer",
41
- "minimum": 0,
42
- "maximum": 9007199254740991
43
- },
44
- "endRowIndex": {
45
- "type": "integer",
46
- "minimum": 0,
47
- "maximum": 9007199254740991
48
- }
49
- },
50
- "required": [
51
- "tableIndex",
52
- "cellIndex",
53
- "startRowIndex",
54
- "endRowIndex"
55
- ],
56
- "additionalProperties": false
57
- }
58
- }
59
- },
60
- "required": [
61
- "input",
62
- "output",
63
- "receiptOutput",
64
- "changes"
65
- ],
66
- "additionalProperties": false
67
- }
@@ -1,61 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "type": "object",
4
- "properties": {
5
- "input": {
6
- "type": "string",
7
- "minLength": 1,
8
- "x-tiwater-file-role": "read"
9
- },
10
- "output": {
11
- "type": "string",
12
- "minLength": 1,
13
- "description": "New document output path. Existing files are never overwritten.",
14
- "x-tiwater-file-role": "write"
15
- },
16
- "receiptOutput": {
17
- "type": "string",
18
- "minLength": 1,
19
- "description": "New JSON receipt path. Existing files are never overwritten.",
20
- "x-tiwater-file-role": "write",
21
- "x-tiwater-file-effect": false
22
- },
23
- "changes": {
24
- "minItems": 1,
25
- "type": "array",
26
- "items": {
27
- "type": "object",
28
- "properties": {
29
- "tableIndex": {
30
- "type": "integer",
31
- "minimum": 0,
32
- "maximum": 9007199254740991
33
- },
34
- "rowIndex": {
35
- "type": "integer",
36
- "minimum": 0,
37
- "maximum": 9007199254740991
38
- },
39
- "cellIndex": {
40
- "type": "integer",
41
- "minimum": 0,
42
- "maximum": 9007199254740991
43
- }
44
- },
45
- "required": [
46
- "tableIndex",
47
- "rowIndex",
48
- "cellIndex"
49
- ],
50
- "additionalProperties": false
51
- }
52
- }
53
- },
54
- "required": [
55
- "input",
56
- "output",
57
- "receiptOutput",
58
- "changes"
59
- ],
60
- "additionalProperties": false
61
- }