@tiwater/office-mcp 0.18.17 → 0.19.1

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,55 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "tiwater.office-mcp-input/docx_delete_table_columns",
4
+ "type": "object",
5
+ "properties": {
6
+ "input": { "type": "string", "minLength": 1, "x-tiwater-file-role": "read" },
7
+ "changes": {
8
+ "type": "array",
9
+ "minItems": 1,
10
+ "items": {
11
+ "type": "object",
12
+ "properties": {
13
+ "table": {
14
+ "type": "object",
15
+ "properties": {
16
+ "part": { "type": "string", "minLength": 1 },
17
+ "path": { "type": "string", "pattern": "^\\/" }
18
+ },
19
+ "required": ["part", "path"],
20
+ "additionalProperties": false
21
+ },
22
+ "columns": {
23
+ "type": "array",
24
+ "minItems": 1,
25
+ "items": {
26
+ "type": "object",
27
+ "properties": {
28
+ "part": { "type": "string", "minLength": 1 },
29
+ "path": { "type": "string", "pattern": "^\\/" }
30
+ },
31
+ "required": ["part", "path"],
32
+ "additionalProperties": false
33
+ }
34
+ }
35
+ },
36
+ "required": ["table", "columns"],
37
+ "additionalProperties": false
38
+ }
39
+ },
40
+ "output": {
41
+ "type": "string",
42
+ "minLength": 1,
43
+ "description": "Output DOCX path; may equal input for an atomic in-place update.",
44
+ "x-tiwater-file-role": "write"
45
+ },
46
+ "receiptOutput": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "x-tiwater-file-role": "write",
50
+ "x-tiwater-file-effect": false
51
+ }
52
+ },
53
+ "required": ["input", "changes", "output", "receiptOutput"],
54
+ "additionalProperties": false
55
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "tiwater.office-mcp-input/docx_insert_table_columns",
4
+ "type": "object",
5
+ "properties": {
6
+ "input": { "type": "string", "minLength": 1, "x-tiwater-file-role": "read" },
7
+ "changes": {
8
+ "type": "array",
9
+ "minItems": 1,
10
+ "items": {
11
+ "type": "object",
12
+ "properties": {
13
+ "table": {
14
+ "type": "object",
15
+ "properties": {
16
+ "part": { "type": "string", "minLength": 1 },
17
+ "path": { "type": "string", "pattern": "^\\/" }
18
+ },
19
+ "required": ["part", "path"],
20
+ "additionalProperties": false
21
+ },
22
+ "sourceColumn": {
23
+ "type": "object",
24
+ "properties": {
25
+ "part": { "type": "string", "minLength": 1 },
26
+ "path": { "type": "string", "pattern": "^\\/" }
27
+ },
28
+ "required": ["part", "path"],
29
+ "additionalProperties": false
30
+ },
31
+ "before": {
32
+ "type": "object",
33
+ "properties": {
34
+ "part": { "type": "string", "minLength": 1 },
35
+ "path": { "type": "string", "pattern": "^\\/" }
36
+ },
37
+ "required": ["part", "path"],
38
+ "additionalProperties": false
39
+ },
40
+ "repeat": { "type": "integer", "minimum": 1, "maximum": 2147483647 }
41
+ },
42
+ "required": ["table", "sourceColumn"],
43
+ "additionalProperties": false
44
+ }
45
+ },
46
+ "output": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "description": "Output DOCX path; may equal input for an atomic in-place update.",
50
+ "x-tiwater-file-role": "write"
51
+ },
52
+ "receiptOutput": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "x-tiwater-file-role": "write",
56
+ "x-tiwater-file-effect": false
57
+ }
58
+ },
59
+ "required": ["input", "changes", "output", "receiptOutput"],
60
+ "additionalProperties": false
61
+ }
@@ -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.18.17"
5
+ "version": "0.19.1"
6
6
  },
7
7
  "tools": [
8
8
  {
@@ -60,6 +60,17 @@
60
60
  "sha256": "4497eb24df0e5631601232a8b35a9eddf914d02146992dd22f1cfba93ef7780f"
61
61
  }
62
62
  },
63
+ {
64
+ "name": "docx_delete_table_columns",
65
+ "providerContract": {
66
+ "source": "packages/docx-cli/contracts/mcp-input/docx_delete_table_columns.schema.json",
67
+ "sha256": "4ce8f6d047fe30f50c711a4d9c1ee10efd6de886294f217e5d11f0bab58c9a90"
68
+ },
69
+ "inputContract": {
70
+ "path": "office/contracts/docx_delete_table_columns.schema.json",
71
+ "sha256": "4ce8f6d047fe30f50c711a4d9c1ee10efd6de886294f217e5d11f0bab58c9a90"
72
+ }
73
+ },
63
74
  {
64
75
  "name": "docx_export_json",
65
76
  "providerContract": {
@@ -82,6 +93,17 @@
82
93
  "sha256": "7cf239b13a9a5bfe15d426f9ed5747c5900a908d4877eeb77ddd9088afe8966f"
83
94
  }
84
95
  },
96
+ {
97
+ "name": "docx_insert_table_columns",
98
+ "providerContract": {
99
+ "source": "packages/docx-cli/contracts/mcp-input/docx_insert_table_columns.schema.json",
100
+ "sha256": "bd07a489c6b6cd3538e133b99613fac84438de3097ff6ed8f5f1a32ef18a7b5a"
101
+ },
102
+ "inputContract": {
103
+ "path": "office/contracts/docx_insert_table_columns.schema.json",
104
+ "sha256": "bd07a489c6b6cd3538e133b99613fac84438de3097ff6ed8f5f1a32ef18a7b5a"
105
+ }
106
+ },
85
107
  {
86
108
  "name": "docx_inspect",
87
109
  "providerContract": {
@@ -159,17 +181,6 @@
159
181
  "sha256": "25f4d4e7c69fa5a2c4a82621aa58ea8eda21245636f84f2243ca4e9092616b68"
160
182
  }
161
183
  },
162
- {
163
- "name": "docx_replace_table_rows",
164
- "providerContract": {
165
- "source": "packages/docx-cli/contracts/mcp-input/docx_replace_table_rows.schema.json",
166
- "sha256": "180cd21147fcd8158d640d769d9b6e435f0fe8761a0c41a03b711582dfb9c64c"
167
- },
168
- "inputContract": {
169
- "path": "office/contracts/docx_replace_table_rows.schema.json",
170
- "sha256": "180cd21147fcd8158d640d769d9b6e435f0fe8761a0c41a03b711582dfb9c64c"
171
- }
172
- },
173
184
  {
174
185
  "name": "docx_set_text",
175
186
  "providerContract": {
package/office/index.mjs CHANGED
@@ -246,7 +246,7 @@ const docxTableIndexOutput = artifactOutput('docx_table_index').extend({
246
246
  }).strict();
247
247
 
248
248
  const docxTableReadOutput = artifactOutput('docx_read_table').extend({
249
- schema: z.literal('tiwater.docx-table-read/v1'),
249
+ schema: z.literal('tiwater.docx-table-read/v2'),
250
250
  receipt: z.object({
251
251
  schema: z.literal('tiwater.docx-table-read-receipt/v1'),
252
252
  totalRowCount: z.number().int().nonnegative(),
@@ -259,6 +259,10 @@ const docxTableReadOutput = artifactOutput('docx_read_table').extend({
259
259
  address: docxAddress,
260
260
  rowCount: z.number().int().nonnegative(),
261
261
  columnCount: z.number().int().nonnegative(),
262
+ gridColumns: z.array(z.object({
263
+ address: docxAddress,
264
+ widthTwips: z.number().int().positive().nullable(),
265
+ }).strict()),
262
266
  precedingParagraph: z.object({
263
267
  address: docxAddress,
264
268
  textPreview: z.string(),
@@ -271,12 +275,16 @@ const docxTableReadOutput = artifactOutput('docx_read_table').extend({
271
275
  }).strict().nullable(),
272
276
  rows: z.array(z.object({
273
277
  address: docxAddress,
278
+ repeatHeader: z.boolean(),
279
+ cantSplit: z.boolean(),
274
280
  gridBefore: z.number().int().nonnegative(),
275
281
  gridAfter: z.number().int().nonnegative(),
276
282
  cells: z.array(z.object({
277
283
  address: docxAddress,
284
+ gridColumnStart: z.number().int().nonnegative(),
278
285
  gridSpan: z.number().int().positive(),
279
286
  verticalMerge: z.string().nullable(),
287
+ verticalMergeOwner: docxAddress.nullable(),
280
288
  paragraphs: z.array(z.object({
281
289
  address: docxAddress,
282
290
  text: z.string(),
@@ -335,7 +343,7 @@ const tools = [
335
343
  },
336
344
  {
337
345
  name: 'docx_read_table',
338
- description: 'Read exactly one table selected from docx_table_index by native OpenXML address. Writes the complete table, including text nodes, to output and returns a bounded row page with cells, spans, vertical merges, paragraph text, and reusable addresses. In a vertical merge, restart begins one logical cell and following continue cells belong to it; a continue cell is not an independent row value. Continue with receipt.nextOffset. If receipt.narrowingRequired is true, list rows under the same table and read smaller objects. It does not locate a table or decide business meaning.',
346
+ description: 'Read exactly one table selected from docx_table_index by native OpenXML address. Writes the complete table, including text nodes, to output and returns a bounded row page with grid-column addresses and widths, each cell\'s zero-based grid start and span, vertical-merge owner, repeated-header and no-split row properties, paragraph text, and reusable addresses. In a vertical merge, restart begins one logical cell and a continue cell is not an independent row value. The provider reports physical structure only; the Agent decides the template and business meaning. Continue with receipt.nextOffset. If receipt.narrowingRequired is true, list rows under the same table and read smaller objects.',
339
347
  inputSchema: inputContract('docx_read_table'),
340
348
  outputSchema: docxTableReadOutput,
341
349
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -355,23 +363,16 @@ const tools = [
355
363
  outputSchema: fixedEditOutput('docx_set_text'),
356
364
  handler: args => fixedEdit('docx_set_text', args),
357
365
  },
358
- {
359
- name: 'docx_replace_table_rows',
360
- description: 'Atomically replace a contiguous data-row range in existing target tables after reading both tables. Each range excludes its header and closes vertical merges; omit targetRows.last to replace through the table end. It maps complete source columns into the target grid and copies every source paragraph. Prepare any semantic content changes with separate published text or object operations before this structural replacement.',
361
- inputSchema: inputContract('docx_replace_table_rows'),
362
- outputSchema: fixedEditOutput('docx_replace_table_rows'),
363
- handler: args => fixedEdit('docx_replace_table_rows', args),
364
- },
365
366
  {
366
367
  name: 'docx_insert_objects',
367
- description: 'Insert selected current DOCX objects under an existing parent. Table rows are objects: expand a target table by copying observed row patterns into that table, using before for insertion position and repeat for count; sourceInput may equal input. This inserts new rows only; use docx_replace_table_rows to replace an existing data-row range from a source table.',
368
+ 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.',
368
369
  inputSchema: inputContract('docx_insert_objects'),
369
370
  outputSchema: fixedEditOutput('docx_insert_objects'),
370
371
  handler: args => fixedEdit('docx_insert_objects', args),
371
372
  },
372
373
  {
373
374
  name: 'docx_delete_object',
374
- description: 'Delete selected current DOCX objects directly from the current target document.',
375
+ description: 'Delete selected current DOCX objects directly from the current target document. Selected table rows must close every vertical merge and cannot remove the whole table. Individual table cells are not raw deletion targets; use column or merge operations for table structure.',
375
376
  inputSchema: inputContract('docx_delete_object'),
376
377
  outputSchema: fixedEditOutput('docx_delete_object'),
377
378
  handler: args => fixedEdit('docx_delete_object', args),
@@ -390,6 +391,20 @@ const tools = [
390
391
  outputSchema: fixedEditOutput('docx_split_cells'),
391
392
  handler: args => fixedEdit('docx_split_cells', args),
392
393
  },
394
+ {
395
+ name: 'docx_insert_table_columns',
396
+ description: 'Insert empty template-shaped grid columns into one current main-document table. Select an observed source grid column for width and per-row cell formatting, and optionally a before grid-column address; cells spanning the insertion boundary expand instead of being split. It does not copy business values or decide column meaning.',
397
+ inputSchema: inputContract('docx_insert_table_columns'),
398
+ outputSchema: fixedEditOutput('docx_insert_table_columns'),
399
+ handler: args => fixedEdit('docx_insert_table_columns', args),
400
+ },
401
+ {
402
+ name: 'docx_delete_table_columns',
403
+ description: 'Delete selected observed grid columns from one current main-document table while shrinking spanning cells and preserving the remaining table grid. It cannot remove every column and does not decide whether a business column is unused.',
404
+ inputSchema: inputContract('docx_delete_table_columns'),
405
+ outputSchema: fixedEditOutput('docx_delete_table_columns'),
406
+ handler: args => fixedEdit('docx_delete_table_columns', args),
407
+ },
393
408
  {
394
409
  name: 'docx_compare',
395
410
  description: 'Compare two DOCX files and report package, metric, and style differences.',
@@ -730,6 +745,7 @@ async function docxObservation(tool, args) {
730
745
  address: payload.address,
731
746
  rowCount: payload.rowCount,
732
747
  columnCount: payload.columnCount,
748
+ gridColumns: payload.gridColumns,
733
749
  precedingParagraph: payload.precedingParagraph,
734
750
  followingParagraph: payload.followingParagraph,
735
751
  receipt: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.18.17",
3
+ "version": "0.19.1",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,234 +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
- "tables": {
11
- "minItems": 1,
12
- "type": "array",
13
- "items": {
14
- "type": "object",
15
- "properties": {
16
- "sourceInput": {
17
- "type": "string",
18
- "minLength": 1,
19
- "x-tiwater-file-role": "read"
20
- },
21
- "sourceTable": {
22
- "type": "object",
23
- "properties": {
24
- "part": {
25
- "type": "string",
26
- "minLength": 1
27
- },
28
- "path": {
29
- "type": "string",
30
- "pattern": "^\\/"
31
- }
32
- },
33
- "required": [
34
- "part",
35
- "path"
36
- ],
37
- "additionalProperties": false
38
- },
39
- "sourceRows": {
40
- "type": "object",
41
- "description": "Contiguous source data rows. The header row stays outside this range. The first and last row must enclose complete vertical-merge groups as reported by docx_read_table.",
42
- "properties": {
43
- "first": {
44
- "type": "object",
45
- "properties": {
46
- "part": {
47
- "type": "string",
48
- "minLength": 1
49
- },
50
- "path": {
51
- "type": "string",
52
- "pattern": "^\\/"
53
- }
54
- },
55
- "required": [
56
- "part",
57
- "path"
58
- ],
59
- "additionalProperties": false
60
- },
61
- "last": {
62
- "type": "object",
63
- "properties": {
64
- "part": {
65
- "type": "string",
66
- "minLength": 1
67
- },
68
- "path": {
69
- "type": "string",
70
- "pattern": "^\\/"
71
- }
72
- },
73
- "required": [
74
- "part",
75
- "path"
76
- ],
77
- "additionalProperties": false
78
- }
79
- },
80
- "required": [
81
- "first",
82
- "last"
83
- ],
84
- "additionalProperties": false
85
- },
86
- "targetTable": {
87
- "type": "object",
88
- "properties": {
89
- "part": {
90
- "type": "string",
91
- "minLength": 1
92
- },
93
- "path": {
94
- "type": "string",
95
- "pattern": "^\\/"
96
- }
97
- },
98
- "required": [
99
- "part",
100
- "path"
101
- ],
102
- "additionalProperties": false
103
- },
104
- "targetRows": {
105
- "type": "object",
106
- "description": "Contiguous target data rows to replace. The header row stays outside this range. Omit last to replace from first through the table's final row. An explicit first and last must enclose complete vertical-merge groups as reported by docx_read_table.",
107
- "properties": {
108
- "first": {
109
- "type": "object",
110
- "properties": {
111
- "part": {
112
- "type": "string",
113
- "minLength": 1
114
- },
115
- "path": {
116
- "type": "string",
117
- "pattern": "^\\/"
118
- }
119
- },
120
- "required": [
121
- "part",
122
- "path"
123
- ],
124
- "additionalProperties": false
125
- },
126
- "last": {
127
- "type": "object",
128
- "properties": {
129
- "part": {
130
- "type": "string",
131
- "minLength": 1
132
- },
133
- "path": {
134
- "type": "string",
135
- "pattern": "^\\/"
136
- }
137
- },
138
- "required": [
139
- "part",
140
- "path"
141
- ],
142
- "additionalProperties": false
143
- }
144
- },
145
- "required": [
146
- "first"
147
- ],
148
- "additionalProperties": false
149
- },
150
- "columns": {
151
- "minItems": 1,
152
- "type": "array",
153
- "description": "Source-to-target header-cell mappings. Source headers share one row, target headers share one row, both header rows stay outside the selected data rows, and each side covers its complete table grid.",
154
- "items": {
155
- "type": "object",
156
- "properties": {
157
- "sourceHeader": {
158
- "type": "object",
159
- "properties": {
160
- "part": {
161
- "type": "string",
162
- "minLength": 1
163
- },
164
- "path": {
165
- "type": "string",
166
- "pattern": "^\\/"
167
- }
168
- },
169
- "required": [
170
- "part",
171
- "path"
172
- ],
173
- "additionalProperties": false
174
- },
175
- "targetHeader": {
176
- "type": "object",
177
- "properties": {
178
- "part": {
179
- "type": "string",
180
- "minLength": 1
181
- },
182
- "path": {
183
- "type": "string",
184
- "pattern": "^\\/"
185
- }
186
- },
187
- "required": [
188
- "part",
189
- "path"
190
- ],
191
- "additionalProperties": false
192
- }
193
- },
194
- "required": [
195
- "sourceHeader",
196
- "targetHeader"
197
- ],
198
- "additionalProperties": false
199
- }
200
- }
201
- },
202
- "required": [
203
- "sourceInput",
204
- "sourceTable",
205
- "sourceRows",
206
- "targetTable",
207
- "targetRows",
208
- "columns"
209
- ],
210
- "additionalProperties": false
211
- }
212
- },
213
- "output": {
214
- "type": "string",
215
- "minLength": 1,
216
- "description": "Output DOCX path; may equal input for an atomic in-place update.",
217
- "x-tiwater-file-role": "write"
218
- },
219
- "receiptOutput": {
220
- "type": "string",
221
- "minLength": 1,
222
- "x-tiwater-file-role": "write",
223
- "x-tiwater-file-effect": false
224
- }
225
- },
226
- "required": [
227
- "input",
228
- "tables",
229
- "output",
230
- "receiptOutput"
231
- ],
232
- "additionalProperties": false,
233
- "$id": "tiwater.office-mcp-input/docx_replace_table_rows"
234
- }