@tiwater/office-mcp 0.17.5 → 0.17.6

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.17.5"
5
+ "version": "0.17.6"
6
6
  },
7
7
  "tools": [
8
8
  {
package/office/index.mjs CHANGED
@@ -173,6 +173,7 @@ function docxInspectionOutput(tool) {
173
173
  revision: docxRevision,
174
174
  summary: z.object({
175
175
  tableCount: z.number().int().nonnegative(),
176
+ openingText: z.array(z.string().min(1).max(240)).max(6),
176
177
  }).strict(),
177
178
  }).strict();
178
179
  }
@@ -225,7 +226,7 @@ const docxReadObjectOutput = artifactOutput('docx_read_object').extend({
225
226
  const tools = [
226
227
  {
227
228
  name: 'docx_inspect',
228
- description: 'Inspect one current DOCX. The response returns its revision and table count; use paged docx_find_literal or docx_list_objects to select native objects. The complete inspection remains in the evidence artifact.',
229
+ description: 'Inspect one current DOCX. The response returns its revision, table count, and a bounded sample of its opening non-empty paragraphs for document identification; use paged docx_find_literal or docx_list_objects to select native objects. The complete inspection remains in the evidence artifact.',
229
230
  inputSchema: inputContract('docx_inspect'),
230
231
  outputSchema: docxInspectionOutput('docx_inspect'),
231
232
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -489,10 +490,17 @@ function buildServer() {
489
490
  }
490
491
 
491
492
  function compactDocxInspection(report) {
492
- if (!report?.revision || !Array.isArray(report.tables)) {
493
+ if (!report?.tables?.revision || !Array.isArray(report.tables.tables) || !Array.isArray(report.flow)) {
493
494
  throw new Error('docx-table-inspection-result-invalid');
494
495
  }
495
- return { revision: report.revision, summary: { tableCount: report.tables.length } };
496
+ const openingText = report.flow
497
+ .filter(item => item?.type === 'paragraph' && typeof item.text === 'string' && item.text.trim())
498
+ .slice(0, 6)
499
+ .map(item => item.text.trim().replace(/\s+/gu, ' ').slice(0, 240));
500
+ return {
501
+ revision: report.tables.revision,
502
+ summary: { tableCount: report.tables.tables.length, openingText },
503
+ };
496
504
  }
497
505
 
498
506
  function compactDocxObjectIdentity(object) {
@@ -525,7 +533,7 @@ async function docxInspect(args) {
525
533
  runtime: commandRuntime(result),
526
534
  source: await fileArtifact(input),
527
535
  artifact: await writeJsonArtifact(requireString(args.output, 'output'), result.json),
528
- ...compactDocxInspection(result.json.tables),
536
+ ...compactDocxInspection(result.json),
529
537
  };
530
538
  }
531
539
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.17.5",
3
+ "version": "0.17.6",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",