@tiwater/office-mcp 0.17.9 → 0.17.11

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
  }
@@ -45,11 +45,18 @@
45
45
  "continuation": {
46
46
  "type": "string",
47
47
  "minLength": 1
48
+ },
49
+ "output": {
50
+ "type": "string",
51
+ "minLength": 1,
52
+ "description": "Absolute path for a new JSON artifact containing this exact search page for later reuse.",
53
+ "x-tiwater-file-role": "write"
48
54
  }
49
55
  },
50
56
  "required": [
51
57
  "input",
52
- "literal"
58
+ "literal",
59
+ "output"
53
60
  ],
54
61
  "additionalProperties": false,
55
62
  "$id": "tiwater.office-mcp-input/docx_find_literal/v1"
@@ -42,11 +42,18 @@
42
42
  "continuation": {
43
43
  "type": "string",
44
44
  "minLength": 1
45
+ },
46
+ "output": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "description": "Absolute path for a new JSON artifact containing this exact object page for later reuse.",
50
+ "x-tiwater-file-role": "write"
45
51
  }
46
52
  },
47
53
  "required": [
48
54
  "input",
49
- "kind"
55
+ "kind",
56
+ "output"
50
57
  ],
51
58
  "additionalProperties": false,
52
59
  "$id": "tiwater.office-mcp-input/docx_list_objects/v1"
@@ -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.9"
5
+ "version": "0.17.11"
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
  {
@@ -97,11 +97,11 @@
97
97
  "name": "docx_find_literal",
98
98
  "providerContract": {
99
99
  "source": "packages/docx-cli/contracts/mcp-input/docx_find_literal.schema.json",
100
- "sha256": "a81b88ee6fa7d897d01c4cb05a18ca3b92738f2690b6f2fa6aff402c4c1ff182"
100
+ "sha256": "4b063c8a4c683c1d7eb06ce1feec8e51546dca78759151ff654f41d45a17d64c"
101
101
  },
102
102
  "inputContract": {
103
103
  "path": "office/contracts/docx_find_literal.schema.json",
104
- "sha256": "a81b88ee6fa7d897d01c4cb05a18ca3b92738f2690b6f2fa6aff402c4c1ff182"
104
+ "sha256": "4b063c8a4c683c1d7eb06ce1feec8e51546dca78759151ff654f41d45a17d64c"
105
105
  }
106
106
  },
107
107
  {
@@ -119,11 +119,11 @@
119
119
  "name": "docx_list_objects",
120
120
  "providerContract": {
121
121
  "source": "packages/docx-cli/contracts/mcp-input/docx_list_objects.schema.json",
122
- "sha256": "d8894a1b453fc780c1d2b355f34de27759a055ef6859333796665ac6439dd464"
122
+ "sha256": "5aff2a708172ea8ccba630e5fe3c42314ca3db3d333fcf001d69df87568c18fa"
123
123
  },
124
124
  "inputContract": {
125
125
  "path": "office/contracts/docx_list_objects.schema.json",
126
- "sha256": "d8894a1b453fc780c1d2b355f34de27759a055ef6859333796665ac6439dd464"
126
+ "sha256": "5aff2a708172ea8ccba630e5fe3c42314ca3db3d333fcf001d69df87568c18fa"
127
127
  }
128
128
  },
129
129
  {
package/office/index.mjs CHANGED
@@ -213,14 +213,14 @@ const docxObservationReceipt = z.object({
213
213
  continuation: z.string().nullable(),
214
214
  }).strict();
215
215
 
216
- const docxListObjectsOutput = z.object({
216
+ const docxListObjectsOutput = artifactOutput('docx_list_objects').extend({
217
217
  schema: z.literal('tiwater.docx-observation-list/v1'),
218
218
  receipt: docxObservationReceipt,
219
219
  objects: z.array(docxObjectIdentity),
220
220
  runtime: runtimeIdentity,
221
221
  }).strict();
222
222
 
223
- const docxFindLiteralOutput = z.object({
223
+ const docxFindLiteralOutput = artifactOutput('docx_find_literal').extend({
224
224
  schema: z.literal('tiwater.docx-observation-find/v1'),
225
225
  receipt: docxObservationReceipt,
226
226
  matches: z.array(z.object({
@@ -249,7 +249,7 @@ const tools = [
249
249
  },
250
250
  {
251
251
  name: 'docx_list_objects',
252
- description: 'List one small page of revision-bound nearest-child identities. Use parentRef to restrict any container, such as body paragraphs, table rows, or row cells; use docx_find_literal when selecting by text.',
252
+ description: 'List one small page of revision-bound nearest-child identities and retain the exact page at output for later reuse. Use parentRef to restrict any container, such as body paragraphs, table rows, or row cells; use docx_find_literal when selecting by text.',
253
253
  inputSchema: inputContract('docx_list_objects'),
254
254
  outputSchema: docxListObjectsOutput,
255
255
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -257,7 +257,7 @@ const tools = [
257
257
  },
258
258
  {
259
259
  name: 'docx_find_literal',
260
- description: 'Find exact current text in one small page of revision-bound native DOCX objects. With kind table or row, matching includes descendant cell text.',
260
+ description: 'Find exact current text in one small page of revision-bound native DOCX objects and retain the exact page at output for later reuse. With kind table or row, matching includes descendant cell text.',
261
261
  inputSchema: inputContract('docx_find_literal'),
262
262
  outputSchema: docxFindLiteralOutput,
263
263
  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),
@@ -567,14 +567,24 @@ async function docxInspect(args) {
567
567
  }
568
568
 
569
569
  async function docxObservation(tool, args) {
570
- return withTempJsonFile(args, async requestPath => {
570
+ const input = path.resolve(requireString(args.input, 'input'));
571
+ const output = requireString(args.output, 'output');
572
+ const { output: _output, ...request } = args;
573
+ return withTempJsonFile(request, async requestPath => {
571
574
  const result = await runJsonCandidateChain(docxCandidates, [tool, requestPath]);
572
575
  const payload = { ...result.json, runtime: commandRuntime(result) };
576
+ const retained = {
577
+ tool,
578
+ runtime: payload.runtime,
579
+ source: await fileArtifact(input),
580
+ artifact: await writeJsonArtifact(output, result.json),
581
+ };
573
582
  if (tool === 'docx_list_objects') {
574
- return { ...payload, objects: payload.objects.map(compactDocxObjectIdentity) };
583
+ return { ...retained, ...payload, objects: payload.objects.map(compactDocxObjectIdentity) };
575
584
  }
576
585
  if (tool === 'docx_find_literal') {
577
586
  return {
587
+ ...retained,
578
588
  ...payload,
579
589
  matches: payload.matches.map(match => ({
580
590
  object: compactDocxObjectIdentity(match.object),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.17.9",
3
+ "version": "0.17.11",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",