@tiwater/office-mcp 0.18.7 → 0.18.9

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.
@@ -38,6 +38,7 @@
38
38
  },
39
39
  "sourceRows": {
40
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.",
41
42
  "properties": {
42
43
  "first": {
43
44
  "type": "object",
@@ -102,6 +103,7 @@
102
103
  },
103
104
  "targetRows": {
104
105
  "type": "object",
106
+ "description": "Contiguous target data rows to replace. The header row stays outside this range. The first and last row must enclose complete vertical-merge groups as reported by docx_read_table.",
105
107
  "properties": {
106
108
  "first": {
107
109
  "type": "object",
@@ -149,6 +151,7 @@
149
151
  "columns": {
150
152
  "minItems": 1,
151
153
  "type": "array",
154
+ "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.",
152
155
  "items": {
153
156
  "type": "object",
154
157
  "properties": {
@@ -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.7"
5
+ "version": "0.18.9"
6
6
  },
7
7
  "tools": [
8
8
  {
@@ -163,11 +163,11 @@
163
163
  "name": "docx_replace_table_rows",
164
164
  "providerContract": {
165
165
  "source": "packages/docx-cli/contracts/mcp-input/docx_replace_table_rows.schema.json",
166
- "sha256": "6472793274f22415b8144f693c393ed671dbcfc8045c978c652590619d34b0fc"
166
+ "sha256": "544d36dc38d9fdf77cfefc0208591fc64321a510171a9b407ab6b46b9c1797e4"
167
167
  },
168
168
  "inputContract": {
169
169
  "path": "office/contracts/docx_replace_table_rows.schema.json",
170
- "sha256": "6472793274f22415b8144f693c393ed671dbcfc8045c978c652590619d34b0fc"
170
+ "sha256": "544d36dc38d9fdf77cfefc0208591fc64321a510171a9b407ab6b46b9c1797e4"
171
171
  }
172
172
  },
173
173
  {
package/office/index.mjs CHANGED
@@ -225,6 +225,16 @@ const docxTableIndexOutput = artifactOutput('docx_table_index').extend({
225
225
  columnCount: z.number().int().nonnegative(),
226
226
  textPreview: z.string(),
227
227
  textLength: z.number().int().nonnegative(),
228
+ precedingParagraph: z.object({
229
+ address: docxAddress,
230
+ textPreview: z.string(),
231
+ textLength: z.number().int().nonnegative(),
232
+ }).strict().nullable(),
233
+ followingParagraph: z.object({
234
+ address: docxAddress,
235
+ textPreview: z.string(),
236
+ textLength: z.number().int().nonnegative(),
237
+ }).strict().nullable(),
228
238
  }).strict()),
229
239
  }).strict();
230
240
 
@@ -233,6 +243,16 @@ const docxTableReadOutput = artifactOutput('docx_read_table').extend({
233
243
  address: docxAddress,
234
244
  rowCount: z.number().int().nonnegative(),
235
245
  columnCount: z.number().int().nonnegative(),
246
+ precedingParagraph: z.object({
247
+ address: docxAddress,
248
+ textPreview: z.string(),
249
+ textLength: z.number().int().nonnegative(),
250
+ }).strict().nullable(),
251
+ followingParagraph: z.object({
252
+ address: docxAddress,
253
+ textPreview: z.string(),
254
+ textLength: z.number().int().nonnegative(),
255
+ }).strict().nullable(),
236
256
  rows: z.array(z.object({
237
257
  address: docxAddress,
238
258
  gridBefore: z.number().int().nonnegative(),
@@ -276,7 +296,7 @@ const tools = [
276
296
  },
277
297
  {
278
298
  name: 'docx_table_index',
279
- description: 'Locate tables in one current DOCX. Returns one compact index containing every table address, shape, and short text preview. Choose the needed address from this index, then call docx_read_table. It does not return full cell content or decide table semantics.',
299
+ description: 'Locate tables in one current DOCX. Returns one compact index containing every table address, shape, short text preview, and the nearest non-empty paragraph before and after each table. Choose the needed address from this index, then call docx_read_table. It does not return full cell content or decide table semantics.',
280
300
  inputSchema: inputContract('docx_table_index'),
281
301
  outputSchema: docxTableIndexOutput,
282
302
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -292,7 +312,7 @@ const tools = [
292
312
  },
293
313
  {
294
314
  name: 'docx_read_table',
295
- description: 'Read exactly one table selected from docx_table_index by native OpenXML address. Returns its rows, cells, spans, vertical merges, paragraphs, text nodes, and reusable addresses in document order. It does not locate a table or decide business meaning.',
315
+ description: 'Read exactly one table selected from docx_table_index by native OpenXML address. Returns its nearest non-empty paragraph before and after the table, rows, cells, spans, vertical merges, paragraphs, text nodes, and reusable addresses in document order. It does not locate a table or decide business meaning.',
296
316
  inputSchema: inputContract('docx_read_table'),
297
317
  outputSchema: docxTableReadOutput,
298
318
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -314,7 +334,7 @@ const tools = [
314
334
  },
315
335
  {
316
336
  name: 'docx_replace_table_rows',
317
- description: 'Replace one or more data-row ranges in one current target document. Each tables item binds sourceInput and exact source and target OpenXML addresses. Source cells copy all paragraphs by default. To keep selected content only, each sourceSelections item is a selection object with the observed address in its address field; range is optional for a substring.',
337
+ description: 'Replace one or more data-row ranges in one current target document. Read both tables first. Each selected row range excludes its header and encloses complete vertical-merge groups; header-cell mappings cover both complete grids. Source cells copy all paragraphs by default. To keep selected content only, each sourceSelections item puts the observed address in its address field; range is optional for a substring.',
318
338
  inputSchema: inputContract('docx_replace_table_rows'),
319
339
  outputSchema: fixedEditOutput('docx_replace_table_rows'),
320
340
  handler: args => fixedEdit('docx_replace_table_rows', args),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.18.7",
3
+ "version": "0.18.9",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",