@tiwater/office-mcp 0.18.11 → 0.18.12

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.
@@ -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.12"
6
6
  },
7
7
  "tools": [
8
8
  {
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 },
@@ -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.12",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",