@tiwater/office-mcp 0.21.53 → 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/tiwater-office-provider-contract-manifest-v1.json +23 -1
- package/office/index.mjs +16 -0
- 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
|
+
}
|
|
@@ -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": {
|
package/office/index.mjs
CHANGED
|
@@ -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