@tiwater/office-mcp 0.21.14 → 0.21.16
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,139 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "tiwater.office-mcp-input/docx_fill_table_from_table",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"input": { "type": "string", "minLength": 1, "description": "Current target DOCX.", "x-tiwater-file-role": "read" },
|
|
7
|
+
"table": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
|
|
11
|
+
"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]*\\])*$" }
|
|
12
|
+
},
|
|
13
|
+
"required": ["part", "path"],
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"description": "Current target table address returned by docx_read_table or docx_table_index."
|
|
16
|
+
},
|
|
17
|
+
"existingRows": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"properties": {
|
|
20
|
+
"first": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"properties": {
|
|
23
|
+
"part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
|
|
24
|
+
"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]*\\])*$" }
|
|
25
|
+
},
|
|
26
|
+
"required": ["part", "path"],
|
|
27
|
+
"additionalProperties": false
|
|
28
|
+
},
|
|
29
|
+
"last": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"properties": {
|
|
32
|
+
"part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
|
|
33
|
+
"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]*\\])*$" }
|
|
34
|
+
},
|
|
35
|
+
"required": ["part", "path"],
|
|
36
|
+
"additionalProperties": false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"required": ["first", "last"],
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"description": "Exact contiguous current target row range to replace; it must enclose every vertical merge it intersects."
|
|
42
|
+
},
|
|
43
|
+
"prototypeRow": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"properties": {
|
|
46
|
+
"part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
|
|
47
|
+
"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]*\\])*$" }
|
|
48
|
+
},
|
|
49
|
+
"required": ["part", "path"],
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"description": "One current row inside existingRows whose cell formatting is reused for every generated body row."
|
|
52
|
+
},
|
|
53
|
+
"sourceInput": { "type": "string", "minLength": 1, "description": "Current source DOCX.", "x-tiwater-file-role": "read" },
|
|
54
|
+
"sourceTable": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
|
|
58
|
+
"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]*\\])*$" }
|
|
59
|
+
},
|
|
60
|
+
"required": ["part", "path"],
|
|
61
|
+
"additionalProperties": false,
|
|
62
|
+
"description": "Current source table address returned by docx_read_table or docx_table_index."
|
|
63
|
+
},
|
|
64
|
+
"sourceRows": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"properties": {
|
|
67
|
+
"first": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"properties": {
|
|
70
|
+
"part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
|
|
71
|
+
"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]*\\])*$" }
|
|
72
|
+
},
|
|
73
|
+
"required": ["part", "path"],
|
|
74
|
+
"additionalProperties": false
|
|
75
|
+
},
|
|
76
|
+
"last": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"properties": {
|
|
79
|
+
"part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
|
|
80
|
+
"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]*\\])*$" }
|
|
81
|
+
},
|
|
82
|
+
"required": ["part", "path"],
|
|
83
|
+
"additionalProperties": false
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"required": ["first", "last"],
|
|
87
|
+
"additionalProperties": false,
|
|
88
|
+
"description": "Exact contiguous source data-row range; it must enclose every vertical merge it intersects."
|
|
89
|
+
},
|
|
90
|
+
"sourceRecordColumn": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"properties": {
|
|
93
|
+
"part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
|
|
94
|
+
"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]*\\])*$" }
|
|
95
|
+
},
|
|
96
|
+
"required": ["part", "path"],
|
|
97
|
+
"additionalProperties": false,
|
|
98
|
+
"description": "Source grid-column address whose native vertical-merge owners define consecutive logical records. An unmerged cell defines one record."
|
|
99
|
+
},
|
|
100
|
+
"columnMappings": {
|
|
101
|
+
"type": "array",
|
|
102
|
+
"minItems": 1,
|
|
103
|
+
"description": "Complete source-to-target grid-column mapping. Target columns that belong to one prototype cell remain one cell. When the selected target columns cover multiple prototype cells, those cells receive the source column's logical values in source-row order and unused trailing cells stay blank.",
|
|
104
|
+
"items": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"properties": {
|
|
107
|
+
"sourceColumn": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"properties": {
|
|
110
|
+
"part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
|
|
111
|
+
"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]*\\])*$" }
|
|
112
|
+
},
|
|
113
|
+
"required": ["part", "path"],
|
|
114
|
+
"additionalProperties": false
|
|
115
|
+
},
|
|
116
|
+
"targetColumns": {
|
|
117
|
+
"type": "array",
|
|
118
|
+
"minItems": 1,
|
|
119
|
+
"items": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"properties": {
|
|
122
|
+
"part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
|
|
123
|
+
"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]*\\])*$" }
|
|
124
|
+
},
|
|
125
|
+
"required": ["part", "path"],
|
|
126
|
+
"additionalProperties": false
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"required": ["sourceColumn", "targetColumns"],
|
|
131
|
+
"additionalProperties": false
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"output": { "type": "string", "minLength": 1, "description": "Output DOCX path; may equal input for one atomic in-place update.", "x-tiwater-file-role": "write" },
|
|
135
|
+
"receiptOutput": { "type": "string", "minLength": 1, "x-tiwater-file-role": "write", "x-tiwater-file-effect": false }
|
|
136
|
+
},
|
|
137
|
+
"required": ["input", "table", "existingRows", "prototypeRow", "sourceInput", "sourceTable", "sourceRows", "sourceRecordColumn", "columnMappings", "output", "receiptOutput"],
|
|
138
|
+
"additionalProperties": false
|
|
139
|
+
}
|
|
@@ -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.16"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -82,6 +82,17 @@
|
|
|
82
82
|
"sha256": "0556937d649a1248947019f23c005786046f576e64a844f057745933f5821cd7"
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
+
{
|
|
86
|
+
"name": "docx_fill_table_from_table",
|
|
87
|
+
"providerContract": {
|
|
88
|
+
"source": "packages/docx-cli/contracts/mcp-input/docx_fill_table_from_table.schema.json",
|
|
89
|
+
"sha256": "03a5afe6443899e3daae8825070a341254c0bd23ae4505a8c6119f524fd61a9b"
|
|
90
|
+
},
|
|
91
|
+
"inputContract": {
|
|
92
|
+
"path": "office/contracts/docx_fill_table_from_table.schema.json",
|
|
93
|
+
"sha256": "03a5afe6443899e3daae8825070a341254c0bd23ae4505a8c6119f524fd61a9b"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
85
96
|
{
|
|
86
97
|
"name": "docx_insert_objects",
|
|
87
98
|
"providerContract": {
|
package/office/index.mjs
CHANGED
|
@@ -424,11 +424,18 @@ 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. 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.',
|
|
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 text; use an empty string for a blank cell. 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.',
|
|
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
|
+
{
|
|
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.',
|
|
435
|
+
inputSchema: inputContract('docx_fill_table_from_table'),
|
|
436
|
+
outputSchema: fixedEditOutput('docx_fill_table_from_table'),
|
|
437
|
+
handler: args => fixedEdit('docx_fill_table_from_table', args),
|
|
438
|
+
},
|
|
432
439
|
{
|
|
433
440
|
name: 'docx_insert_objects',
|
|
434
441
|
description: 'Insert selected current DOCX objects under an existing parent. Table rows are objects: expand a target table by copying one contiguous observed row range and use repeat for count; sourceInput may equal input. A row range beginning with vertical-merge continuations may be inserted only inside a target boundary with the same active grid spans, which extends those merges. Individual table cells are not raw insertion targets because that would bypass the table grid.',
|