@tiwater/office-mcp 0.21.16 → 0.21.18
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_fill_table_from_table.schema.json +19 -10
- package/office/contracts/{docx_copy_content.schema.json → docx_replace_content_from_source.schema.json} +10 -2
- package/office/contracts/tiwater-office-provider-contract-manifest-v1.json +14 -14
- package/office/index.mjs +7 -7
- package/package.json +1 -1
|
@@ -100,18 +100,23 @@
|
|
|
100
100
|
"columnMappings": {
|
|
101
101
|
"type": "array",
|
|
102
102
|
"minItems": 1,
|
|
103
|
-
"description": "Complete source-to-target grid-column
|
|
103
|
+
"description": "Complete source-to-target grid-column projection. Multiple adjacent source columns may compose one target cell. One source column may spread its logical values across several prototype cells. Composition and spreading cannot occur in the same mapping. Target columns that belong to one prototype cell remain one cell, and unused trailing spread cells stay blank.",
|
|
104
104
|
"items": {
|
|
105
105
|
"type": "object",
|
|
106
106
|
"properties": {
|
|
107
|
-
"
|
|
108
|
-
"type": "
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
"sourceColumns": {
|
|
108
|
+
"type": "array",
|
|
109
|
+
"minItems": 1,
|
|
110
|
+
"description": "One or more contiguous source grid columns in native order. Multiple columns compose one target cell; a source cell spanning several selected columns contributes once.",
|
|
111
|
+
"items": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"properties": {
|
|
114
|
+
"part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
|
|
115
|
+
"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]*\\])*$" }
|
|
116
|
+
},
|
|
117
|
+
"required": ["part", "path"],
|
|
118
|
+
"additionalProperties": false
|
|
119
|
+
}
|
|
115
120
|
},
|
|
116
121
|
"targetColumns": {
|
|
117
122
|
"type": "array",
|
|
@@ -125,9 +130,13 @@
|
|
|
125
130
|
"required": ["part", "path"],
|
|
126
131
|
"additionalProperties": false
|
|
127
132
|
}
|
|
133
|
+
},
|
|
134
|
+
"joinWith": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"description": "Separator used when sourceColumns compose one target cell. Defaults to a newline. It does not apply when one source column spreads across multiple target cells."
|
|
128
137
|
}
|
|
129
138
|
},
|
|
130
|
-
"required": ["
|
|
139
|
+
"required": ["sourceColumns", "targetColumns"],
|
|
131
140
|
"additionalProperties": false
|
|
132
141
|
}
|
|
133
142
|
},
|
|
@@ -5,16 +5,19 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"description": "Current target DOCX containing every target paragraph or table cell.",
|
|
8
9
|
"x-tiwater-file-role": "read"
|
|
9
10
|
},
|
|
10
11
|
"changes": {
|
|
11
12
|
"minItems": 1,
|
|
12
13
|
"type": "array",
|
|
14
|
+
"description": "Atomic source-to-target content replacements. Every source selection is resolved and validated before the target document is changed.",
|
|
13
15
|
"items": {
|
|
14
16
|
"type": "object",
|
|
15
17
|
"properties": {
|
|
16
18
|
"target": {
|
|
17
19
|
"type": "object",
|
|
20
|
+
"description": "Existing main-document paragraph or table-cell address whose inline content is replaced while its container formatting and table structure remain unchanged.",
|
|
18
21
|
"properties": {
|
|
19
22
|
"part": {
|
|
20
23
|
"type": "string",
|
|
@@ -35,16 +38,19 @@
|
|
|
35
38
|
"sourceInput": {
|
|
36
39
|
"type": "string",
|
|
37
40
|
"minLength": 1,
|
|
41
|
+
"description": "Current source DOCX containing this change's sourceSelections.",
|
|
38
42
|
"x-tiwater-file-role": "read"
|
|
39
43
|
},
|
|
40
44
|
"sourceSelections": {
|
|
41
45
|
"minItems": 1,
|
|
42
46
|
"type": "array",
|
|
47
|
+
"description": "Ordered native source paragraphs, runs, or text nodes. Their selected inline content becomes the target content without Agent transcription.",
|
|
43
48
|
"items": {
|
|
44
49
|
"type": "object",
|
|
45
50
|
"properties": {
|
|
46
51
|
"address": {
|
|
47
52
|
"type": "object",
|
|
53
|
+
"description": "Native source object address returned by docx_read_object or docx_read_table. Selecting a paragraph copies that paragraph's inline content; selecting a cell copies its direct paragraphs.",
|
|
48
54
|
"properties": {
|
|
49
55
|
"part": {
|
|
50
56
|
"type": "string",
|
|
@@ -64,6 +70,7 @@
|
|
|
64
70
|
},
|
|
65
71
|
"range": {
|
|
66
72
|
"type": "object",
|
|
73
|
+
"description": "Optional Unicode-scalar substring of a selected run or text node. Omit it to copy the complete selected object.",
|
|
67
74
|
"properties": {
|
|
68
75
|
"start": {
|
|
69
76
|
"type": "integer",
|
|
@@ -101,12 +108,13 @@
|
|
|
101
108
|
"output": {
|
|
102
109
|
"type": "string",
|
|
103
110
|
"minLength": 1,
|
|
104
|
-
"description": "Output DOCX path; may equal input for
|
|
111
|
+
"description": "Output DOCX path; may equal input for one atomic in-place update after every replacement has passed preflight.",
|
|
105
112
|
"x-tiwater-file-role": "write"
|
|
106
113
|
},
|
|
107
114
|
"receiptOutput": {
|
|
108
115
|
"type": "string",
|
|
109
116
|
"minLength": 1,
|
|
117
|
+
"description": "New JSON receipt path containing target readback for every completed replacement.",
|
|
110
118
|
"x-tiwater-file-role": "write",
|
|
111
119
|
"x-tiwater-file-effect": false
|
|
112
120
|
}
|
|
@@ -118,5 +126,5 @@
|
|
|
118
126
|
"receiptOutput"
|
|
119
127
|
],
|
|
120
128
|
"additionalProperties": false,
|
|
121
|
-
"$id": "tiwater.office-mcp-input/
|
|
129
|
+
"$id": "tiwater.office-mcp-input/docx_replace_content_from_source"
|
|
122
130
|
}
|
|
@@ -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.18"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -38,17 +38,6 @@
|
|
|
38
38
|
"sha256": "a6d59ee785d8ab3994eb6f539b48411b272565ac136219de58d39a449b3112f3"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
-
{
|
|
42
|
-
"name": "docx_copy_content",
|
|
43
|
-
"providerContract": {
|
|
44
|
-
"source": "packages/docx-cli/contracts/mcp-input/docx_copy_content.schema.json",
|
|
45
|
-
"sha256": "71deed6ea5cdd44ae753350c9069d2c4ffee22719956a4c0d05d25e32f2c6ff9"
|
|
46
|
-
},
|
|
47
|
-
"inputContract": {
|
|
48
|
-
"path": "office/contracts/docx_copy_content.schema.json",
|
|
49
|
-
"sha256": "71deed6ea5cdd44ae753350c9069d2c4ffee22719956a4c0d05d25e32f2c6ff9"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
41
|
{
|
|
53
42
|
"name": "docx_delete_object",
|
|
54
43
|
"providerContract": {
|
|
@@ -86,11 +75,11 @@
|
|
|
86
75
|
"name": "docx_fill_table_from_table",
|
|
87
76
|
"providerContract": {
|
|
88
77
|
"source": "packages/docx-cli/contracts/mcp-input/docx_fill_table_from_table.schema.json",
|
|
89
|
-
"sha256": "
|
|
78
|
+
"sha256": "473b4e8ac319c0edcf481fa8c2167ea9b1c340995311ca662e34f493772a0de4"
|
|
90
79
|
},
|
|
91
80
|
"inputContract": {
|
|
92
81
|
"path": "office/contracts/docx_fill_table_from_table.schema.json",
|
|
93
|
-
"sha256": "
|
|
82
|
+
"sha256": "473b4e8ac319c0edcf481fa8c2167ea9b1c340995311ca662e34f493772a0de4"
|
|
94
83
|
}
|
|
95
84
|
},
|
|
96
85
|
{
|
|
@@ -181,6 +170,17 @@
|
|
|
181
170
|
"sha256": "8f2f8694b6d533d7f48b6e1e0c82be3a9c5aac55c50dba00daadd0ea0a76a8a7"
|
|
182
171
|
}
|
|
183
172
|
},
|
|
173
|
+
{
|
|
174
|
+
"name": "docx_replace_content_from_source",
|
|
175
|
+
"providerContract": {
|
|
176
|
+
"source": "packages/docx-cli/contracts/mcp-input/docx_replace_content_from_source.schema.json",
|
|
177
|
+
"sha256": "d6ce53f684ea0991508cab930e101c910ac05e9725cc25d5312806070c20d320"
|
|
178
|
+
},
|
|
179
|
+
"inputContract": {
|
|
180
|
+
"path": "office/contracts/docx_replace_content_from_source.schema.json",
|
|
181
|
+
"sha256": "d6ce53f684ea0991508cab930e101c910ac05e9725cc25d5312806070c20d320"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
184
|
{
|
|
185
185
|
"name": "docx_replace_style_ids",
|
|
186
186
|
"providerContract": {
|
package/office/index.mjs
CHANGED
|
@@ -409,11 +409,11 @@ const tools = [
|
|
|
409
409
|
handler: args => docxObservation('docx_read_table', args),
|
|
410
410
|
},
|
|
411
411
|
{
|
|
412
|
-
name: '
|
|
413
|
-
description: 'Replace
|
|
414
|
-
inputSchema: inputContract('
|
|
415
|
-
outputSchema: fixedEditOutput('
|
|
416
|
-
handler: args => fixedEdit('
|
|
412
|
+
name: 'docx_replace_content_from_source',
|
|
413
|
+
description: 'Replace existing target paragraph or table-cell content from explicitly selected native source paragraphs, runs, text nodes, or exact text ranges while retaining target container formatting and table structure. Use it after docx_fill_table_from_table when the target needs selected source child content instead of the whole source cell; supply returned target-cell addresses and observed source descendant addresses, never retype source-owned text. It does not copy source rows, cells, spans, or merges.',
|
|
414
|
+
inputSchema: inputContract('docx_replace_content_from_source'),
|
|
415
|
+
outputSchema: fixedEditOutput('docx_replace_content_from_source'),
|
|
416
|
+
handler: args => fixedEdit('docx_replace_content_from_source', args),
|
|
417
417
|
},
|
|
418
418
|
{
|
|
419
419
|
name: 'docx_set_text',
|
|
@@ -424,14 +424,14 @@ const tools = [
|
|
|
424
424
|
},
|
|
425
425
|
{
|
|
426
426
|
name: 'docx_set_table_body',
|
|
427
|
-
description: 'Atomically replace one exact current target-table row range while retaining the table, target styles, grid widths, and all rows and surrounding content outside the range. When retaining leading rows reported with repeatHeader=true, existingRows starts after all of them and never at a verticalMerge=continue row. Name every target grid column in native order and choose one current row inside existingRows as the style prototype for each final row. Horizontal spans use contiguous column IDs. Set rowSpan on one logical cell to occupy multiple rows and omit those columns from the covered rows; the provider writes native vertical merge cells. Every other grid column remains explicit. Every explicit cell includes
|
|
427
|
+
description: 'Atomically replace one exact current target-table row range while retaining the table, target styles, grid widths, and all rows and surrounding content outside the range. When retaining leading rows reported with repeatHeader=true, existingRows starts after all of them and never at a verticalMerge=continue row. Name every target grid column in native order and choose one current row inside existingRows as the style prototype for each final row. Horizontal spans use contiguous column IDs. Set rowSpan on one logical cell to occupy multiple rows and omit those columns from the covered rows; the provider writes native vertical merge cells. Every other grid column remains explicit. Every explicit cell includes an already-derived value; source-owned content is not retyped here. An empty final row array removes the range when another table row remains. The provider commits once and returns structural readback. It does not read a source table, map source to target, derive text, choose business columns, identify headers, or accept non-text cell content; use docx_fill_table_from_table and docx_replace_content_from_source for source-owned table content.',
|
|
428
428
|
inputSchema: inputContract('docx_set_table_body'),
|
|
429
429
|
outputSchema: fixedEditOutput('docx_set_table_body'),
|
|
430
430
|
handler: args => fixedEdit('docx_set_table_body', args),
|
|
431
431
|
},
|
|
432
432
|
{
|
|
433
433
|
name: 'docx_fill_table_from_table',
|
|
434
|
-
description: 'Fill one current target-table body from one current source-table row range. Select the source grid column whose native vertical merges define logical records, then map source grid columns onto the target prototype cells. Target columns belonging to one prototype cell retain that horizontal span; multiple prototype cells receive source values in row order. The provider derives output rows and vertical merges, validates the complete target grid, commits once, and returns structural readback. It does not choose source or target business meaning, filter records, translate or rewrite text, or apply business-specific rules.',
|
|
434
|
+
description: 'Fill one current target-table body from one current source-table row range. Select the source grid column whose native vertical merges define logical records, then map source grid columns onto the target prototype cells. Target columns belonging to one prototype cell retain that horizontal span; multiple prototype cells receive source values in row order. The provider derives output rows and vertical merges, validates the complete target grid, commits once, and returns structural readback. It does not choose source or target business meaning, filter records, translate or rewrite text, or apply business-specific rules. When only selected source paragraphs belong in the target, use its returned target-cell addresses with docx_replace_content_from_source before readback.',
|
|
435
435
|
inputSchema: inputContract('docx_fill_table_from_table'),
|
|
436
436
|
outputSchema: fixedEditOutput('docx_fill_table_from_table'),
|
|
437
437
|
handler: args => fixedEdit('docx_fill_table_from_table', args),
|