@tiwater/office-mcp 0.17.10 → 0.17.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.
@@ -57,14 +57,9 @@
57
57
  "type": "object",
58
58
  "properties": {
59
59
  "sourceHeaderRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
60
- "targetHeaderRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
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
- }
60
+ "targetHeaderRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" }
66
61
  },
67
- "required": ["sourceHeaderRef", "targetHeaderRef", "content"],
62
+ "required": ["sourceHeaderRef", "targetHeaderRef"],
68
63
  "additionalProperties": false
69
64
  }
70
65
  }
@@ -8,7 +8,7 @@
8
8
  "x-tiwater-file-role": "read"
9
9
  },
10
10
  "ref": {
11
- "description": "One object ref returned by docx_list_objects or docx_find_literal. Read a complete small or medium table once; page rows only when the complete table is too large for one response.",
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
12
  "type": "string",
13
13
  "pattern": "^dox1_[0-9a-f]{64}$"
14
14
  },
@@ -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. Include paragraph when paragraph boundaries affect a later content selection.",
21
+ "description": "Object kinds required by the next operation. Include paragraph for table content boundaries. Request run or text only when ref identifies a cell or paragraph, never a whole table.",
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.17.10"
5
+ "version": "0.17.12"
6
6
  },
7
7
  "tools": [
8
8
  {
@@ -64,11 +64,11 @@
64
64
  "name": "docx_copy_table_rows",
65
65
  "providerContract": {
66
66
  "source": "packages/docx-cli/contracts/mcp-input/docx_copy_table_rows.schema.json",
67
- "sha256": "a246ed7a97fce47ab0cde6f6ad9c97a2936a775d8b390b4ad807c1dff5720fb7"
67
+ "sha256": "15418038e4478aad8a9244d29a2ccf8578df10a3769836db8381a2e58d0f6b4c"
68
68
  },
69
69
  "inputContract": {
70
70
  "path": "office/contracts/docx_copy_table_rows.schema.json",
71
- "sha256": "a246ed7a97fce47ab0cde6f6ad9c97a2936a775d8b390b4ad807c1dff5720fb7"
71
+ "sha256": "15418038e4478aad8a9244d29a2ccf8578df10a3769836db8381a2e58d0f6b4c"
72
72
  }
73
73
  },
74
74
  {
@@ -141,11 +141,11 @@
141
141
  "name": "docx_read_object",
142
142
  "providerContract": {
143
143
  "source": "packages/docx-cli/contracts/mcp-input/docx_read_object.schema.json",
144
- "sha256": "662e3b64dfefcab36f05c123b7f6144b9942a2f7c7b34e40c9bebcb16171b09d"
144
+ "sha256": "1b92b5620f0f76f47b7a9550d79d414f5e0a76cb37a7c4c2615e02e32cf9a02c"
145
145
  },
146
146
  "inputContract": {
147
147
  "path": "office/contracts/docx_read_object.schema.json",
148
- "sha256": "662e3b64dfefcab36f05c123b7f6144b9942a2f7c7b34e40c9bebcb16171b09d"
148
+ "sha256": "1b92b5620f0f76f47b7a9550d79d414f5e0a76cb37a7c4c2615e02e32cf9a02c"
149
149
  }
150
150
  },
151
151
  {
package/office/index.mjs CHANGED
@@ -265,7 +265,7 @@ const tools = [
265
265
  },
266
266
  {
267
267
  name: 'docx_read_object',
268
- description: 'Read one selected native DOCX object and requested descendants. Read a complete small or medium table once with row, cell, and paragraph descendants; add run or text only for an exact inline selection. Page rows only when the complete table is too large for one response.',
268
+ description: 'Read one selected native DOCX object and requested descendants. For a table, read row, cell, and paragraph descendants first. To select exact inline content, make a second read rooted at the observed cell or paragraph and request run or text; table-rooted inline reads are rejected so one call cannot return the document-wide character tree.',
269
269
  inputSchema: inputContract('docx_read_object'),
270
270
  outputSchema: docxReadObjectOutput,
271
271
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -287,7 +287,7 @@ const tools = [
287
287
  },
288
288
  {
289
289
  name: 'docx_copy_table_rows',
290
- description: 'Populate existing target tables by replacing selected data-row ranges with selected source rows. Explicit header-cell mappings preserve target presentation and source grouping. A column content mode applies to every copied cell in that column; when cells need different subsets, copy the row structure first and batch those cells with docx_copy_content.',
290
+ description: 'Populate existing target tables by replacing selected data-row ranges with selected source rows. Explicit header-cell mappings preserve target presentation, source grouping, and every source-cell paragraph. When a target cell needs an exact subset, copy the row structure first and batch those cells with docx_copy_content.',
291
291
  inputSchema: inputContract('docx_copy_table_rows'),
292
292
  outputSchema: fixedEditOutput('docx_copy_table_rows'),
293
293
  handler: args => fixedEdit('docx_copy_table_rows', args),
@@ -538,14 +538,14 @@ function compactDocxObservation(observation) {
538
538
  if (!observation?.object) throw new Error('docx-read-object-missing-observation');
539
539
  function compactNode(node) {
540
540
  const identity = compactDocxObjectIdentity(node.object);
541
+ const children = (node.children ?? []).map(compactNode);
541
542
  const object = {
542
543
  ref: identity.ref,
543
544
  kind: identity.kind,
544
- textPreview: identity.textPreview,
545
+ textPreview: children.length === 0 ? identity.textPreview : null,
545
546
  ...(identity.gridSpan === null ? {} : { gridSpan: identity.gridSpan }),
546
547
  ...(identity.verticalMerge === null ? {} : { verticalMerge: identity.verticalMerge }),
547
548
  };
548
- const children = (node.children ?? []).map(compactNode);
549
549
  return {
550
550
  object,
551
551
  ...(children.length === 0 ? {} : { children }),
@@ -602,6 +602,10 @@ async function docxReadObject(args) {
602
602
  const { output: _output, ...request } = args;
603
603
  return withTempJsonFile(request, async requestPath => {
604
604
  const result = await runJsonCandidateChain(docxCandidates, ['docx_read_object', requestPath]);
605
+ if (result.json?.observation?.object?.kind === 'table'
606
+ && args.kinds.some(kind => kind === 'run' || kind === 'text')) {
607
+ throw new Error('docx-table-inline-detail-requires-cell-or-paragraph-root');
608
+ }
605
609
  return {
606
610
  tool: 'docx_read_object',
607
611
  runtime: commandRuntime(result),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.17.10",
3
+ "version": "0.17.12",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",