@tiwater/office-mcp 0.16.14 → 0.16.16

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.
@@ -41,14 +41,10 @@
41
41
  "sourceTableRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
42
42
  "sourceRows": {
43
43
  "type": "object",
44
- "description": "Contiguous source business-row range. excludeRefs contains every physical row to remove; excluding a vertically merged group requires its restart row and all continuation rows. Do not begin on an unlabeled continuation row. If another column's visible merge began before the range, the provider carries its origin value into a new merge start.",
44
+ "description": "Exact contiguous source rows to copy. Select only wanted rows; the range cannot begin or end inside a vertical merge.",
45
45
  "properties": {
46
46
  "firstRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
47
- "lastRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
48
- "excludeRefs": {
49
- "type": "array",
50
- "items": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" }
51
- }
47
+ "lastRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" }
52
48
  },
53
49
  "required": ["firstRef", "lastRef"],
54
50
  "additionalProperties": false
@@ -62,7 +58,11 @@
62
58
  "properties": {
63
59
  "sourceHeaderRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
64
60
  "targetHeaderRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
65
- "content": { "type": "string", "enum": ["all-paragraphs", "first-paragraph"] }
61
+ "content": {
62
+ "type": "string",
63
+ "enum": ["all-paragraphs", "first-paragraph"],
64
+ "description": "Content copied from each mapped source cell. all-paragraphs preserves every source paragraph in order. first-paragraph copies only the first source paragraph. Before choosing first-paragraph, read the selected source table with docx_read_object kinds row, cell, and paragraph to prove later paragraphs are intentionally omitted."
65
+ }
66
66
  },
67
67
  "required": ["sourceHeaderRef", "targetHeaderRef", "content"],
68
68
  "additionalProperties": false
@@ -18,7 +18,7 @@
18
18
  "pattern": "^docx-rev-v1-[0-9a-f]{64}$"
19
19
  },
20
20
  "kinds": {
21
- "description": "Object kinds required by the next operation. Both the response and artifact contain only matching descendant identities.",
21
+ "description": "Object kinds required by the next operation. Both the response and artifact contain only matching descendant identities. Include paragraph whenever paragraph boundaries affect a later content selection such as docx_copy_table_rows first-paragraph versus all-paragraphs.",
22
22
  "type": "array",
23
23
  "items": {
24
24
  "type": "string",
@@ -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.16.14"
5
+ "version": "0.16.16"
6
6
  },
7
7
  "tools": [
8
8
  {
@@ -42,11 +42,11 @@
42
42
  "name": "docx_copy_table_rows",
43
43
  "providerContract": {
44
44
  "source": "packages/docx-cli/contracts/mcp-input/docx_copy_table_rows.schema.json",
45
- "sha256": "2b6ba0a54290ab8671f1f5547850bb37370655f05170f6dcaffa9586e9f409f2"
45
+ "sha256": "a246ed7a97fce47ab0cde6f6ad9c97a2936a775d8b390b4ad807c1dff5720fb7"
46
46
  },
47
47
  "inputContract": {
48
48
  "path": "office/contracts/docx_copy_table_rows.schema.json",
49
- "sha256": "2b6ba0a54290ab8671f1f5547850bb37370655f05170f6dcaffa9586e9f409f2"
49
+ "sha256": "a246ed7a97fce47ab0cde6f6ad9c97a2936a775d8b390b4ad807c1dff5720fb7"
50
50
  }
51
51
  },
52
52
  {
@@ -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": "9b78138005fc6f875cf9ed530b8389ec4b2a751294c9d316e8b9fc2463560a3f"
122
+ "sha256": "29ba026050f1120219491f918e74c344551224795b1d15e49ec886d4e81e092a"
123
123
  },
124
124
  "inputContract": {
125
125
  "path": "office/contracts/docx_read_object.schema.json",
126
- "sha256": "9b78138005fc6f875cf9ed530b8389ec4b2a751294c9d316e8b9fc2463560a3f"
126
+ "sha256": "29ba026050f1120219491f918e74c344551224795b1d15e49ec886d4e81e092a"
127
127
  }
128
128
  },
129
129
  {
package/office/index.mjs CHANGED
@@ -170,10 +170,15 @@ const docxObjectIdentity = z.object({
170
170
  verticalMerge: z.string().nullable(),
171
171
  }).strict();
172
172
 
173
+ const docxObjectNode = z.lazy(() => z.object({
174
+ object: docxObjectIdentity,
175
+ children: z.array(docxObjectNode),
176
+ }).strict());
177
+
173
178
  const docxReadObjectOutput = artifactOutput('docx_read_object').extend({
174
179
  revision: docxRevision,
175
180
  object: docxObjectIdentity,
176
- descendants: z.array(docxObjectIdentity),
181
+ children: z.array(docxObjectNode),
177
182
  }).strict();
178
183
 
179
184
  const tools = [
@@ -182,6 +187,7 @@ const tools = [
182
187
  description: 'Inspect one current DOCX. The response returns its revision and a bounded table identity index for the next selection; the complete observation remains in the evidence artifact.',
183
188
  inputSchema: inputContract('docx_inspect'),
184
189
  outputSchema: docxInspectionOutput('docx_inspect'),
190
+ annotations: { readOnlyHint: true, idempotentHint: true },
185
191
  handler: docxInspect,
186
192
  },
187
193
  {
@@ -200,7 +206,7 @@ const tools = [
200
206
  },
201
207
  {
202
208
  name: 'docx_read_object',
203
- description: 'Read one selected native DOCX object. Declare only the descendant kinds required by the next operation; the response returns those identities and the evidence artifact retains the complete object.',
209
+ description: 'Read one selected native DOCX object as an ordered native hierarchy. For a table, request row and cell kinds once; each row contains its ordered cells with text, grid span, and vertical merge state. Also request paragraph when paragraph boundaries determine what a later copy operation must retain.',
204
210
  inputSchema: inputContract('docx_read_object'),
205
211
  outputSchema: docxReadObjectOutput,
206
212
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -215,7 +221,7 @@ const tools = [
215
221
  },
216
222
  {
217
223
  name: 'docx_copy_table_rows',
218
- description: 'Populate existing target tables by replacing selected data-row ranges with selected source rows. Use this whenever the target table already exists; explicit header-cell mappings preserve target presentation and native source grouping even when source and target grid spans differ.',
224
+ description: 'Populate existing target tables by replacing selected data-row ranges with selected source rows. Use this whenever the target table already exists; explicit header-cell mappings preserve target presentation and native source grouping even when source and target grid spans differ. Each column must explicitly copy all source-cell paragraphs or only the first; inspect paragraph children before choosing.',
219
225
  inputSchema: inputContract('docx_copy_table_rows'),
220
226
  outputSchema: fixedEditOutput('docx_copy_table_rows'),
221
227
  handler: args => fixedEdit('docx_copy_table_rows', args),
@@ -456,12 +462,18 @@ async function docxReadObject(args) {
456
462
  artifact: await writeJsonArtifact(output, result.json),
457
463
  revision: result.json.receipt.revision,
458
464
  object: compactDocxObjectIdentity(result.json.observation.object),
459
- descendants: result.json.observation.descendants
460
- .map(compactDocxObjectIdentity),
465
+ children: result.json.observation.children.map(compactDocxObjectNode),
461
466
  };
462
467
  });
463
468
  }
464
469
 
470
+ function compactDocxObjectNode(node) {
471
+ return {
472
+ object: compactDocxObjectIdentity(node.object),
473
+ children: node.children.map(compactDocxObjectNode),
474
+ };
475
+ }
476
+
465
477
  async function docxValidate(args) {
466
478
  const result = await runJsonCandidateChain(docxCandidates, ['validate-openxml', requireString(args.input, 'input')], { allowedExitCodes: [0, 1] });
467
479
  return { tool: 'docx_validate', runtime: commandRuntime(result), result: result.json };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.16.14",
3
+ "version": "0.16.16",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",