@tiwater/office-mcp 0.17.30 → 0.17.32

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.
@@ -8,7 +8,7 @@
8
8
  "x-tiwater-file-role": "read"
9
9
  },
10
10
  "kinds": {
11
- "description": "Open XML object kinds to list in native document order. Start at the selected story part, then follow returned refs through parentRef-scoped child pages. Request paragraph and table together when their adjacency carries meaning. Text previews describe already located objects; they do not identify a document or select a source. Returned parentRef is the valid targetParentRef for inserting beside that object.",
11
+ "description": "Open XML object kinds to list in native document order. Request only the kinds needed by the current local traversal, then follow returned refs through parentRef-scoped child pages. Text previews describe already located objects; they do not identify a document or select a source. Returned parentRef is the valid targetParentRef for inserting beside that object.",
12
12
  "type": "array",
13
13
  "items": {
14
14
  "type": "string",
@@ -7,10 +7,11 @@
7
7
  "minLength": 1,
8
8
  "x-tiwater-file-role": "read"
9
9
  },
10
- "ref": {
11
- "description": "One object ref returned by a current DOCX observation. Read table structure through paragraph descendants first. For exact inline content, use an observed cell or paragraph ref; table-rooted run/text reads are rejected.",
12
- "type": "string",
13
- "pattern": "^dox1_[0-9a-f]{64}$"
10
+ "refs": {
11
+ "description": "Object refs from one current DOCX observation, returned in this order. Use row, cell, or paragraph refs; table-rooted reads are rejected.",
12
+ "type": "array",
13
+ "items": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
14
+ "minItems": 1
14
15
  },
15
16
  "revision": {
16
17
  "description": "Optional expected revision id from the observation receipt; a changed document fails as stale.",
@@ -44,7 +45,7 @@
44
45
  },
45
46
  "required": [
46
47
  "input",
47
- "ref",
48
+ "refs",
48
49
  "kinds",
49
50
  "output"
50
51
  ],
@@ -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.30"
5
+ "version": "0.17.32"
6
6
  },
7
7
  "tools": [
8
8
  {
@@ -97,11 +97,11 @@
97
97
  "name": "docx_list_objects",
98
98
  "providerContract": {
99
99
  "source": "packages/docx-cli/contracts/mcp-input/docx_list_objects.schema.json",
100
- "sha256": "418e758c979a0a7dc8b7401091ac92efcf7ea53b77ceb263746588fcd546a0c8"
100
+ "sha256": "f496d10fefe414d49993b447b50ccce4d808fd11e6df8625f8f906de8a2d90bb"
101
101
  },
102
102
  "inputContract": {
103
103
  "path": "office/contracts/docx_list_objects.schema.json",
104
- "sha256": "418e758c979a0a7dc8b7401091ac92efcf7ea53b77ceb263746588fcd546a0c8"
104
+ "sha256": "f496d10fefe414d49993b447b50ccce4d808fd11e6df8625f8f906de8a2d90bb"
105
105
  }
106
106
  },
107
107
  {
@@ -119,11 +119,11 @@
119
119
  "name": "docx_read_object",
120
120
  "providerContract": {
121
121
  "source": "packages/docx-cli/contracts/mcp-input/docx_read_object.schema.json",
122
- "sha256": "1b92b5620f0f76f47b7a9550d79d414f5e0a76cb37a7c4c2615e02e32cf9a02c"
122
+ "sha256": "589b616fa60e39107fb6061a67b23387f07acf0d3974a8bf1580cc2567857ff1"
123
123
  },
124
124
  "inputContract": {
125
125
  "path": "office/contracts/docx_read_object.schema.json",
126
- "sha256": "1b92b5620f0f76f47b7a9550d79d414f5e0a76cb37a7c4c2615e02e32cf9a02c"
126
+ "sha256": "589b616fa60e39107fb6061a67b23387f07acf0d3974a8bf1580cc2567857ff1"
127
127
  }
128
128
  },
129
129
  {
package/office/index.mjs CHANGED
@@ -222,7 +222,7 @@ const docxListObjectsOutput = artifactOutput('docx_list_objects').extend({
222
222
 
223
223
  const docxReadObjectOutput = artifactOutput('docx_read_object').extend({
224
224
  revision: docxRevision,
225
- observation: docxObservationNode,
225
+ observations: z.array(docxObservationNode).min(1),
226
226
  }).strict();
227
227
 
228
228
  const tools = [
@@ -236,7 +236,7 @@ const tools = [
236
236
  },
237
237
  {
238
238
  name: 'docx_list_objects',
239
- description: 'List one small page of revision-bound nearest-child identities in native document order and retain the exact page at output for later reuse. Start at the selected story part, follow continuation in order, and descend only through returned refs with parentRef. Request paragraph and table together when their adjacency carries meaning. Text previews describe already located objects; never use matching text to identify a document or select a source.',
239
+ description: 'List one small page of revision-bound nearest-child identities in native document order and retain the exact page at output for later reuse. Request only the object kinds needed by the current local traversal, follow continuation in order, and descend only through returned refs with parentRef. Text previews describe already located objects; never use matching text to identify a document or select a source.',
240
240
  inputSchema: inputContract('docx_list_objects'),
241
241
  outputSchema: docxListObjectsOutput,
242
242
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -244,7 +244,7 @@ const tools = [
244
244
  },
245
245
  {
246
246
  name: 'docx_read_object',
247
- description: 'Read one selected native DOCX row, cell, or paragraph and requested descendants. For a table, page its row identities with docx_list_objects, then read only the current row. To select exact inline content, make a second read rooted at the observed cell or paragraph and request run or text.',
247
+ description: 'Read selected rows, cells, or paragraphs from one native DOCX in one call and return them in refs order. Pass the document path once and all refs needed for the current target. For exact inline content, use observed cell or paragraph refs and request run or text.',
248
248
  inputSchema: inputContract('docx_read_object'),
249
249
  outputSchema: docxReadObjectOutput,
250
250
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -574,7 +574,7 @@ async function docxReadObject(args) {
574
574
  const { output: _output, ...request } = args;
575
575
  return withTempJsonFile(request, async requestPath => {
576
576
  const result = await runJsonCandidateChain(docxCandidates, ['docx_read_object', requestPath]);
577
- if (result.json?.observation?.object?.kind === 'table') {
577
+ if (result.json?.observations?.some(observation => observation?.object?.kind === 'table')) {
578
578
  throw new Error('docx-table-read-requires-paged-row-selection');
579
579
  }
580
580
  return {
@@ -583,7 +583,7 @@ async function docxReadObject(args) {
583
583
  source: await fileArtifact(input),
584
584
  artifact: await writeJsonArtifact(output, result.json),
585
585
  revision: result.json.receipt.revision,
586
- observation: compactDocxObservation(result.json.observation),
586
+ observations: result.json.observations.map(compactDocxObservation),
587
587
  };
588
588
  });
589
589
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.17.30",
3
+ "version": "0.17.32",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",