@tiwater/office-mcp 0.18.11 → 0.18.13

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.
@@ -103,7 +103,7 @@
103
103
  },
104
104
  "targetRows": {
105
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.",
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
107
  "properties": {
108
108
  "first": {
109
109
  "type": "object",
@@ -143,8 +143,7 @@
143
143
  }
144
144
  },
145
145
  "required": [
146
- "first",
147
- "last"
146
+ "first"
148
147
  ],
149
148
  "additionalProperties": false
150
149
  },
@@ -282,6 +281,11 @@
282
281
  ],
283
282
  "additionalProperties": false
284
283
  }
284
+ },
285
+ "sourceParagraphMode": {
286
+ "type": "string",
287
+ "const": "omit-paired-latin-prose",
288
+ "description": "Optional deterministic paragraph selection for every mapped source cell. omit-paired-latin-prose preserves Han or mixed-language paragraphs and standalone technical expressions, while omitting adjacent Latin prose paired after Han text. It cannot be combined with sourceCellContents."
285
289
  }
286
290
  },
287
291
  "required": [
@@ -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.11"
5
+ "version": "0.18.13"
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": "544d36dc38d9fdf77cfefc0208591fc64321a510171a9b407ab6b46b9c1797e4"
166
+ "sha256": "b5ea315e8a21e7a2ca4e52857504f190ace7dffb6666fa549994799be242ce20"
167
167
  },
168
168
  "inputContract": {
169
169
  "path": "office/contracts/docx_replace_table_rows.schema.json",
170
- "sha256": "544d36dc38d9fdf77cfefc0208591fc64321a510171a9b407ab6b46b9c1797e4"
170
+ "sha256": "b5ea315e8a21e7a2ca4e52857504f190ace7dffb6666fa549994799be242ce20"
171
171
  }
172
172
  },
173
173
  {
package/office/index.mjs CHANGED
@@ -311,7 +311,7 @@ const tools = [
311
311
  },
312
312
  {
313
313
  name: 'docx_list_objects',
314
- description: 'Page through mixed nearest-child OpenXML objects when document order or paragraph relationships are required. Continue with nextOffset and descend through a returned parent address. Do not use this tool to locate tables or read a whole document: use docx_table_index to locate tables, then docx_read_table for one selected table.',
314
+ description: 'Page through mixed nearest-child OpenXML objects when document order or paragraph relationships are required. The complete requested provider page is retained at output; the response returns a byte-bounded prefix. Continue with receipt.nextOffset and descend through a returned parent address. Do not use this tool to locate tables or read a whole document: use docx_table_index to locate tables, then docx_read_table for one selected table.',
315
315
  inputSchema: inputContract('docx_list_objects'),
316
316
  outputSchema: docxListObjectsOutput,
317
317
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -357,7 +357,7 @@ const tools = [
357
357
  },
358
358
  {
359
359
  name: 'docx_replace_table_rows',
360
- 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.',
360
+ description: 'Replace data rows 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. Source cells copy all paragraphs by default. sourceParagraphMode can omit paired Latin prose while retaining Han text and standalone technical expressions; explicit sourceCellContents remains available for exact selections.',
361
361
  inputSchema: inputContract('docx_replace_table_rows'),
362
362
  outputSchema: fixedEditOutput('docx_replace_table_rows'),
363
363
  handler: args => fixedEdit('docx_replace_table_rows', args),
@@ -653,7 +653,28 @@ async function docxObservation(tool, args) {
653
653
  artifact: await writeJsonArtifact(output, result.json),
654
654
  };
655
655
  if (tool === 'docx_list_objects') {
656
- return { ...retained, ...payload, objects: payload.objects.map(compactDocxObjectIdentity) };
656
+ const totalCount = payload.receipt.totalCount;
657
+ const offset = Math.min(args.offset ?? 0, totalCount);
658
+ const objects = [];
659
+ for (const sourceObject of payload.objects.map(compactDocxObjectIdentity)) {
660
+ const candidate = [...objects, sourceObject];
661
+ if (objects.length > 0 && Buffer.byteLength(JSON.stringify(candidate)) > 6_500) break;
662
+ objects.push(sourceObject);
663
+ }
664
+ const nextOffset = offset + objects.length < totalCount ? offset + objects.length : null;
665
+ return {
666
+ ...retained,
667
+ schema: payload.schema,
668
+ receipt: {
669
+ schema: 'tiwater.docx-observation-receipt/v1',
670
+ operation: 'list',
671
+ totalCount,
672
+ returnedCount: objects.length,
673
+ remaining: totalCount - offset - objects.length,
674
+ nextOffset,
675
+ },
676
+ objects,
677
+ };
657
678
  }
658
679
  if (tool === 'docx_table_index') {
659
680
  const totalCount = payload.tables.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.18.11",
3
+ "version": "0.18.13",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",