@tiwater/office-mcp 0.21.52 → 0.21.54
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/contracts/docx_collapse_trailing_empty_section.schema.json +12 -0
- package/office/contracts/docx_set_section_margins.schema.json +24 -0
- package/office/contracts/docx_set_text.schema.json +6 -1
- package/office/contracts/tiwater-office-provider-contract-manifest-v1.json +25 -3
- package/office/index.mjs +18 -2
- package/package.json +1 -1
- package/pdf/contracts/tiwater-pdf-provider-contract-manifest-v1.json +1 -1
- package/text/contracts/tiwater-text-provider-contract-manifest-v1.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "tiwater.office-mcp-input/docx_collapse_trailing_empty_section",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"input": { "type": "string", "minLength": 1, "x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current" },
|
|
7
|
+
"output": { "type": "string", "minLength": 1, "description": "Output DOCX path; may equal input for an atomic in-place update.", "x-tiwater-file-role": "write" },
|
|
8
|
+
"receiptOutput": { "type": "string", "minLength": 1, "x-tiwater-file-role": "write", "x-tiwater-file-effect": false }
|
|
9
|
+
},
|
|
10
|
+
"required": ["input", "output", "receiptOutput"],
|
|
11
|
+
"additionalProperties": false
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "tiwater.office-mcp-input/docx_set_section_margins",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"input": { "type": "string", "minLength": 1, "x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current" },
|
|
7
|
+
"changes": { "type": "array", "minItems": 1, "items": { "type": "object", "properties": {
|
|
8
|
+
"sectionIndex": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
|
|
9
|
+
"unit": { "type": "string", "const": "twip", "description": "Unit for every supplied margin value." },
|
|
10
|
+
"margins": { "type": "object", "description": "At least one margin must be supplied; omitted margins remain unchanged.", "properties": {
|
|
11
|
+
"top": { "type": "integer", "minimum": 0, "maximum": 31680 },
|
|
12
|
+
"bottom": { "type": "integer", "minimum": 0, "maximum": 31680 },
|
|
13
|
+
"left": { "type": "integer", "minimum": 0, "maximum": 31680 },
|
|
14
|
+
"right": { "type": "integer", "minimum": 0, "maximum": 31680 },
|
|
15
|
+
"header": { "type": "integer", "minimum": 0, "maximum": 31680 },
|
|
16
|
+
"footer": { "type": "integer", "minimum": 0, "maximum": 31680 }
|
|
17
|
+
}, "additionalProperties": false }
|
|
18
|
+
}, "required": ["sectionIndex", "unit", "margins"], "additionalProperties": false } },
|
|
19
|
+
"output": { "type": "string", "minLength": 1, "description": "Output DOCX path; may equal input for an atomic in-place update.", "x-tiwater-file-role": "write" },
|
|
20
|
+
"receiptOutput": { "type": "string", "minLength": 1, "x-tiwater-file-role": "write", "x-tiwater-file-effect": false }
|
|
21
|
+
},
|
|
22
|
+
"required": ["input", "changes", "output", "receiptOutput"],
|
|
23
|
+
"additionalProperties": false
|
|
24
|
+
}
|
|
@@ -48,6 +48,12 @@
|
|
|
48
48
|
"additionalProperties": false
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
+
"changesInput": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"minLength": 1,
|
|
54
|
+
"description": "Absolute path to a JSON file containing the same non-empty changes array accepted by changes. Use this for large batches so the array stays out of the tool call.",
|
|
55
|
+
"x-tiwater-file-role": "read"
|
|
56
|
+
},
|
|
51
57
|
"output": {
|
|
52
58
|
"type": "string",
|
|
53
59
|
"minLength": 1,
|
|
@@ -63,7 +69,6 @@
|
|
|
63
69
|
},
|
|
64
70
|
"required": [
|
|
65
71
|
"input",
|
|
66
|
-
"changes",
|
|
67
72
|
"output",
|
|
68
73
|
"receiptOutput"
|
|
69
74
|
],
|
|
@@ -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.
|
|
5
|
+
"version": "0.21.54"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -27,6 +27,17 @@
|
|
|
27
27
|
"sha256": "975fd24572ae28fb2181edaae9da856417cdcd657f8d83c5eb46c3ff069d2376"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
+
{
|
|
31
|
+
"name": "docx_collapse_trailing_empty_section",
|
|
32
|
+
"providerContract": {
|
|
33
|
+
"source": "packages/docx-cli/contracts/mcp-input/docx_collapse_trailing_empty_section.schema.json",
|
|
34
|
+
"sha256": "aa111bc52626aad17c6a7efd9af1b31a0209c7e40811ba0b80cc96bddf6553ac"
|
|
35
|
+
},
|
|
36
|
+
"inputContract": {
|
|
37
|
+
"path": "office/contracts/docx_collapse_trailing_empty_section.schema.json",
|
|
38
|
+
"sha256": "aa111bc52626aad17c6a7efd9af1b31a0209c7e40811ba0b80cc96bddf6553ac"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
30
41
|
{
|
|
31
42
|
"name": "docx_compare",
|
|
32
43
|
"providerContract": {
|
|
@@ -214,6 +225,17 @@
|
|
|
214
225
|
"sha256": "02343da9dd2072257781e7e94a07682639f3de80b4bec0c7d9c0fc5da6a3b2f5"
|
|
215
226
|
}
|
|
216
227
|
},
|
|
228
|
+
{
|
|
229
|
+
"name": "docx_set_section_margins",
|
|
230
|
+
"providerContract": {
|
|
231
|
+
"source": "packages/docx-cli/contracts/mcp-input/docx_set_section_margins.schema.json",
|
|
232
|
+
"sha256": "7a58c93c36789394fa624d1dbba617346685e2dc3fd74b9bbae76c124a97b1a1"
|
|
233
|
+
},
|
|
234
|
+
"inputContract": {
|
|
235
|
+
"path": "office/contracts/docx_set_section_margins.schema.json",
|
|
236
|
+
"sha256": "7a58c93c36789394fa624d1dbba617346685e2dc3fd74b9bbae76c124a97b1a1"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
217
239
|
{
|
|
218
240
|
"name": "docx_set_table",
|
|
219
241
|
"providerContract": {
|
|
@@ -240,11 +262,11 @@
|
|
|
240
262
|
"name": "docx_set_text",
|
|
241
263
|
"providerContract": {
|
|
242
264
|
"source": "packages/docx-cli/contracts/mcp-input/docx_set_text.schema.json",
|
|
243
|
-
"sha256": "
|
|
265
|
+
"sha256": "6a69b2ba25551698b8cbc6040fda2c1d2b81afde4a9629a613ca37c9120bebe6"
|
|
244
266
|
},
|
|
245
267
|
"inputContract": {
|
|
246
268
|
"path": "office/contracts/docx_set_text.schema.json",
|
|
247
|
-
"sha256": "
|
|
269
|
+
"sha256": "6a69b2ba25551698b8cbc6040fda2c1d2b81afde4a9629a613ca37c9120bebe6"
|
|
248
270
|
}
|
|
249
271
|
},
|
|
250
272
|
{
|
package/office/index.mjs
CHANGED
|
@@ -614,10 +614,10 @@ const tools = [
|
|
|
614
614
|
{
|
|
615
615
|
name: 'docx_set_text',
|
|
616
616
|
effectKind: 'document-mutation',
|
|
617
|
-
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.',
|
|
617
|
+
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. Pass small batches in changes or keep a large batch out of the tool call by putting the same changes array in changesInput; both may be combined in one atomic commit. 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.',
|
|
618
618
|
inputSchema: inputContract('docx_set_text'),
|
|
619
619
|
outputSchema: fixedEditOutput('docx_set_text'),
|
|
620
|
-
handler: (args, tool) => fixedEdit(tool, args, docxCandidates),
|
|
620
|
+
handler: async (args, tool) => fixedEdit(tool, await resolveFileBackedChanges(args), docxCandidates),
|
|
621
621
|
},
|
|
622
622
|
{
|
|
623
623
|
name: 'docx_set_paragraph_pagination',
|
|
@@ -635,6 +635,22 @@ const tools = [
|
|
|
635
635
|
outputSchema: fixedEditOutput('docx_set_table_width'),
|
|
636
636
|
handler: (args, tool) => fixedEdit(tool, args, docxCandidates),
|
|
637
637
|
},
|
|
638
|
+
{
|
|
639
|
+
name: 'docx_set_section_margins',
|
|
640
|
+
effectKind: 'document-mutation',
|
|
641
|
+
description: 'Atomically set explicitly supplied page or header/footer margins on selected current DOCX sections. Sections use zero-based native document order, values use twips, and omitted margins remain unchanged. This does not select sections, calculate layout clearance, insert content, or decide business formatting.',
|
|
642
|
+
inputSchema: inputContract('docx_set_section_margins'),
|
|
643
|
+
outputSchema: fixedEditOutput('docx_set_section_margins'),
|
|
644
|
+
handler: (args, tool) => fixedEdit(tool, args, docxCandidates),
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
name: 'docx_collapse_trailing_empty_section',
|
|
648
|
+
effectKind: 'document-mutation',
|
|
649
|
+
description: 'Atomically remove exactly one observed trailing empty DOCX section by promoting the preceding section properties and removing only intervening empty paragraphs. The operation fails when that native structure is absent and preserves all visible document content. This does not choose business sections, delete nonempty content, or normalize other section breaks.',
|
|
650
|
+
inputSchema: inputContract('docx_collapse_trailing_empty_section'),
|
|
651
|
+
outputSchema: fixedEditOutput('docx_collapse_trailing_empty_section'),
|
|
652
|
+
handler: (args, tool) => fixedEdit(tool, args, docxCandidates),
|
|
653
|
+
},
|
|
638
654
|
{
|
|
639
655
|
name: 'docx_set_table',
|
|
640
656
|
effectKind: 'document-mutation',
|
package/package.json
CHANGED