@tiwater/office-mcp 0.15.3 → 0.15.4

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.
package/office/README.md CHANGED
@@ -6,6 +6,9 @@ The server owns technical observation, native conversion, fixed-action edits,
6
6
  package validation, and native WPS rendering. Callers own document selections,
7
7
  values, business mappings, workflow decisions, and delivery status.
8
8
 
9
+ Every inspect/export result binds its observation artifact to the exact source
10
+ file path, SHA-256, and byte count used by that invocation.
11
+
9
12
  Every filesystem argument is identified in the published MCP input schema by
10
13
  `x-tiwater-file-role`. `read` marks an existing provider input; `write` marks a
11
14
  new provider artifact. Strings without this metadata are document values or
@@ -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.15.3"
5
+ "version": "0.15.4"
6
6
  },
7
7
  "tools": [
8
8
  {
package/office/index.mjs CHANGED
@@ -185,7 +185,7 @@ function fixedEditOutput(tool) {
185
185
  }
186
186
 
187
187
  function artifactOutput(tool) {
188
- return z.object({ tool: z.literal(tool), runtime: runtimeIdentity, artifact }).strict();
188
+ return z.object({ tool: z.literal(tool), runtime: runtimeIdentity, source: artifact, artifact }).strict();
189
189
  }
190
190
 
191
191
  const tools = [
@@ -392,18 +392,20 @@ function buildServer() {
392
392
  }
393
393
 
394
394
  async function docxInspect(args) {
395
- const input = requireString(args.input, 'input');
395
+ const input = path.resolve(requireString(args.input, 'input'));
396
396
  const result = await runJsonCandidateChain(docxCandidates, ['inspect', input, '--json']);
397
397
  return {
398
398
  tool: 'docx_inspect',
399
399
  runtime: commandRuntime(result),
400
+ source: await fileArtifact(input),
400
401
  artifact: await writeJsonArtifact(requireString(args.output, 'output'), result.json),
401
402
  };
402
403
  }
403
404
 
404
405
  async function docxInspectTables(args) {
405
- const result = await runJsonCandidateChain(docxCandidates, ['inspect-tables', requireString(args.input, 'input'), '--json']);
406
- return { tool: 'docx_inspect_tables', runtime: commandRuntime(result), artifact: await writeJsonArtifact(requireString(args.output, 'output'), result.json) };
406
+ const input = path.resolve(requireString(args.input, 'input'));
407
+ const result = await runJsonCandidateChain(docxCandidates, ['inspect-tables', input, '--json']);
408
+ return { tool: 'docx_inspect_tables', runtime: commandRuntime(result), source: await fileArtifact(input), artifact: await writeJsonArtifact(requireString(args.output, 'output'), result.json) };
407
409
  }
408
410
 
409
411
  async function docxObservation(tool, args) {
@@ -478,11 +480,12 @@ async function docxCompare(args) {
478
480
  }
479
481
 
480
482
  async function docxExportJson(args) {
481
- const input = requireString(args.input, 'input');
483
+ const input = path.resolve(requireString(args.input, 'input'));
482
484
  const result = await runJsonCandidateChain(docxCandidates, ['export-json', input]);
483
485
  return {
484
486
  tool: 'docx_export_json',
485
487
  runtime: commandRuntime(result),
488
+ source: await fileArtifact(input),
486
489
  artifact: await writeJsonArtifact(requireString(args.output, 'output'), result.json),
487
490
  };
488
491
  }
@@ -570,17 +573,18 @@ function nativeRenderBackend(sourceFormat) {
570
573
  }
571
574
 
572
575
  async function xlsxInspect(args) {
573
- const input = requireString(args.input, 'input');
576
+ const input = path.resolve(requireString(args.input, 'input'));
574
577
  const result = await runJsonCandidateChain(xlsxCandidates, ['inspect', input, '--json']);
575
578
  return {
576
579
  tool: 'xlsx_inspect',
577
580
  runtime: commandRuntime(result),
581
+ source: await fileArtifact(input),
578
582
  artifact: await writeJsonArtifact(requireString(args.output, 'output'), result.json),
579
583
  };
580
584
  }
581
585
 
582
586
  async function xlsxExportJson(args) {
583
- const input = requireString(args.input, 'input');
587
+ const input = path.resolve(requireString(args.input, 'input'));
584
588
  const cmdArgs = ['export-json', input];
585
589
  if (args.resolveMergedCells) {
586
590
  cmdArgs.push('--resolve-merged-cells');
@@ -589,6 +593,7 @@ async function xlsxExportJson(args) {
589
593
  return {
590
594
  tool: 'xlsx_export_json',
591
595
  runtime: commandRuntime(result),
596
+ source: await fileArtifact(input),
592
597
  artifact: await writeJsonArtifact(requireString(args.output, 'output'), result.json),
593
598
  };
594
599
  }
@@ -600,21 +605,23 @@ async function xlsxValidate(args) {
600
605
  }
601
606
 
602
607
  async function pptxInspect(args) {
603
- const input = requireString(args.input, 'input');
608
+ const input = path.resolve(requireString(args.input, 'input'));
604
609
  const result = await runJsonCandidateChain(pptxCandidates, ['inspect', input, '--json']);
605
610
  return {
606
611
  tool: 'pptx_inspect',
607
612
  runtime: commandRuntime(result),
613
+ source: await fileArtifact(input),
608
614
  artifact: await writeJsonArtifact(requireString(args.output, 'output'), result.json),
609
615
  };
610
616
  }
611
617
 
612
618
  async function pptxExportJson(args) {
613
- const input = requireString(args.input, 'input');
619
+ const input = path.resolve(requireString(args.input, 'input'));
614
620
  const result = await runJsonCandidateChain(pptxCandidates, ['export-json', input]);
615
621
  return {
616
622
  tool: 'pptx_export_json',
617
623
  runtime: commandRuntime(result),
624
+ source: await fileArtifact(input),
618
625
  artifact: await writeJsonArtifact(requireString(args.output, 'output'), result.json),
619
626
  };
620
627
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "description": "Published MCP server for Tiwater Office document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",