@tiwater/office-mcp 0.17.7 → 0.17.8

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.7"
5
+ "version": "0.17.8"
6
6
  },
7
7
  "tools": [
8
8
  {
package/office/index.mjs CHANGED
@@ -173,7 +173,10 @@ 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
+ openingParagraphs: z.array(z.object({
177
+ ref: z.string().regex(/^dox1_[0-9a-f]{64}$/),
178
+ textPreview: z.string().min(1).max(240),
179
+ }).strict()).max(6),
177
180
  }).strict(),
178
181
  }).strict();
179
182
  }
@@ -238,7 +241,7 @@ const docxReadObjectOutput = artifactOutput('docx_read_object').extend({
238
241
  const tools = [
239
242
  {
240
243
  name: 'docx_inspect',
241
- 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.',
244
+ description: 'Inspect one current DOCX. The response returns its revision, table count, and up to six opening non-empty body paragraphs with native refs for document identification and immediate reuse; use docx_find_literal for other text and docx_list_objects for container children. The complete inspection remains in the evidence artifact.',
242
245
  inputSchema: inputContract('docx_inspect'),
243
246
  outputSchema: docxInspectionOutput('docx_inspect'),
244
247
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -505,13 +508,18 @@ function compactDocxInspection(report) {
505
508
  if (!report?.tables?.revision || !Array.isArray(report.tables.tables) || !Array.isArray(report.flow)) {
506
509
  throw new Error('docx-table-inspection-result-invalid');
507
510
  }
508
- const openingText = report.flow
509
- .filter(item => item?.type === 'paragraph' && typeof item.text === 'string' && item.text.trim())
511
+ const openingParagraphs = report.flow
512
+ .filter(item => item?.type === 'paragraph'
513
+ && /^dox1_[0-9a-f]{64}$/u.test(item.objectRef)
514
+ && typeof item.text === 'string' && item.text.trim())
510
515
  .slice(0, 6)
511
- .map(item => item.text.trim().replace(/\s+/gu, ' ').slice(0, 240));
516
+ .map(item => ({
517
+ ref: item.objectRef,
518
+ textPreview: item.text.trim().replace(/\s+/gu, ' ').slice(0, 240),
519
+ }));
512
520
  return {
513
521
  revision: report.tables.revision,
514
- summary: { tableCount: report.tables.tables.length, openingText },
522
+ summary: { tableCount: report.tables.tables.length, openingParagraphs },
515
523
  };
516
524
  }
517
525
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.17.7",
3
+ "version": "0.17.8",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",