@tiwater/office-mcp 0.21.54 → 0.21.56

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
@@ -20,18 +20,22 @@ OpenXML-internal identifiers, not filesystem arguments.
20
20
  - DOCX: inspect document/tables, export, compare, validate OpenXML, apply or validate font and
21
21
  table-of-contents style policies, refresh document fields, replace object text, transform styles,
22
22
  and batch one fixed edit action.
23
- - XLS/XLSX: convert legacy XLS with ET, inspect/export, validate, and batch
24
- one fixed workbook edit action.
23
+ - XLS/XLSX: convert legacy XLS with ET, inspect/export, validate, batch one
24
+ fixed workbook edit action, or atomically apply one immutable provider-ready
25
+ mixed-operation handoff.
25
26
  - PPTX: inspect/export, bind selected masters/layouts, apply text formatting,
26
27
  set exact top-level object geometry, replace existing picture media, and
27
28
  validate OpenXML.
28
29
  - Office: render DOC/DOCX/XLS/XLSX/PPT/PPTX to PDF with the corresponding native
29
30
  WPS backend.
30
31
 
31
- Each mutation tool fixes its provider operation type. Callers submit only the
32
+ Fixed-action mutation tools fix their provider operation type. Callers submit only the
32
33
  coordinates and values for that action, so they cannot provide an arbitrary
33
34
  operation discriminator or a multi-action plan language. A call may batch
34
35
  multiple changes only when every change has the same action kind.
36
+ The atomic XLSX handoff capability accepts only a file identity for an already
37
+ approved operation artifact. It does not choose, rewrite, partition, or infer
38
+ operations, and it commits workbook bytes only when the complete ordered handoff succeeds.
35
39
  When a completed mutation receipt reports `summary.pass=false`, the MCP result
36
40
  also sets the standard `isError` field; consumers do not need a private failure
37
41
  interpretation.
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "tiwater.office-mcp-input/docx_read_all_tables/v1",
4
+ "type": "object",
5
+ "properties": {
6
+ "input": {
7
+ "type": "string",
8
+ "minLength": 1,
9
+ "description": "Current DOCX to read once.",
10
+ "x-tiwater-file-role": "read"
11
+ },
12
+ "output": {
13
+ "type": "string",
14
+ "minLength": 1,
15
+ "description": "New JSON file that receives every native table in document order, including rows, cells, merges, paragraphs, and text nodes.",
16
+ "x-tiwater-file-role": "write",
17
+ "x-tiwater-file-effect": false
18
+ }
19
+ },
20
+ "required": ["input", "output"],
21
+ "additionalProperties": false
22
+ }
@@ -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.21.54"
5
+ "version": "0.21.56"
6
6
  },
7
7
  "tools": [
8
8
  {
@@ -159,6 +159,17 @@
159
159
  "sha256": "4ba37e5570ea7958c374111ae7c0f6460eec29937e5c822eba44eb1b8e908d17"
160
160
  }
161
161
  },
162
+ {
163
+ "name": "docx_read_all_tables",
164
+ "providerContract": {
165
+ "source": "packages/docx-cli/contracts/mcp-input/docx_read_all_tables.schema.json",
166
+ "sha256": "a5a22e6368977d620af1c53cc934d8934550734069d7ef7f65fc434e4136ae62"
167
+ },
168
+ "inputContract": {
169
+ "path": "office/contracts/docx_read_all_tables.schema.json",
170
+ "sha256": "a5a22e6368977d620af1c53cc934d8934550734069d7ef7f65fc434e4136ae62"
171
+ }
172
+ },
162
173
  {
163
174
  "name": "docx_read_object",
164
175
  "providerContract": {
@@ -445,6 +456,17 @@
445
456
  "sha256": "06d5f29f7ed23ab53fdf7a5de09cbfb6a800e7a19ae076a3d6d80abf22c464be"
446
457
  }
447
458
  },
459
+ {
460
+ "name": "xlsx_apply_operations",
461
+ "providerContract": {
462
+ "source": "packages/xlsx-cli/contracts/mcp-input/xlsx_apply_operations.schema.json",
463
+ "sha256": "89b0946543671b5dc75ce40db9656f23b3909bc2a9ef945e7cdf5b73f40845d2"
464
+ },
465
+ "inputContract": {
466
+ "path": "office/contracts/xlsx_apply_operations.schema.json",
467
+ "sha256": "89b0946543671b5dc75ce40db9656f23b3909bc2a9ef945e7cdf5b73f40845d2"
468
+ }
469
+ },
448
470
  {
449
471
  "name": "xlsx_convert_legacy",
450
472
  "providerContract": {
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "input": {
6
+ "type": "string",
7
+ "minLength": 1,
8
+ "pattern": "\\.[xX][lL][sS][xX]$",
9
+ "x-tiwater-file-role": "read",
10
+ "x-tiwater-document-revision-role": "current"
11
+ },
12
+ "operationsInput": {
13
+ "type": "string",
14
+ "minLength": 1,
15
+ "pattern": "\\.[jJ][sS][oO][nN]$",
16
+ "description": "Immutable provider-ready operation handoff containing only a non-empty operations array.",
17
+ "x-tiwater-file-role": "read"
18
+ },
19
+ "output": {
20
+ "type": "string",
21
+ "minLength": 1,
22
+ "pattern": "\\.[xX][lL][sS][xX]$",
23
+ "description": "Output document path; may equal input for one atomic mixed-operation update.",
24
+ "x-tiwater-file-role": "write"
25
+ },
26
+ "receiptOutput": {
27
+ "type": "string",
28
+ "minLength": 1,
29
+ "description": "New JSON receipt path. Existing files are never overwritten.",
30
+ "x-tiwater-file-role": "write",
31
+ "x-tiwater-file-effect": false
32
+ }
33
+ },
34
+ "required": ["input", "operationsInput", "output", "receiptOutput"],
35
+ "additionalProperties": false
36
+ }
package/office/index.mjs CHANGED
@@ -534,6 +534,15 @@ const docxTableReadOutput = docxObservationOutput('docx_read_table').extend({
534
534
  }).strict()).optional(),
535
535
  }).strict();
536
536
 
537
+ const docxReadAllTablesOutput = z.object({
538
+ tool: z.literal('docx_read_all_tables'),
539
+ runtime: runtimeIdentity,
540
+ source: artifact,
541
+ artifact,
542
+ schema: z.literal('tiwater.docx-table-read-set/v1'),
543
+ tableCount: z.number().int().nonnegative(),
544
+ }).strict();
545
+
537
546
  const docxReadObjectOutput = docxObservationOutput('docx_read_object').extend({
538
547
  receipt: z.object({
539
548
  schema: z.literal('tiwater.docx-read-object-receipt/v1'),
@@ -595,6 +604,14 @@ const tools = [
595
604
  annotations: { readOnlyHint: true, idempotentHint: true },
596
605
  handler: args => docxObservation('docx_read_table', args),
597
606
  },
607
+ {
608
+ name: 'docx_read_all_tables',
609
+ description: 'Read every native table from one current DOCX in document order. The document is opened once and the complete rows, cells, merge ownership, paragraphs, and text nodes are written to output. Only a compact receipt is returned. This tool does not select business tables or infer their meaning.',
610
+ inputSchema: inputContract('docx_read_all_tables'),
611
+ outputSchema: docxReadAllTablesOutput,
612
+ annotations: { readOnlyHint: true, idempotentHint: true },
613
+ handler: docxReadAllTables,
614
+ },
598
615
  {
599
616
  name: 'docx_replace_content_from_source',
600
617
  effectKind: 'document-mutation',
@@ -830,6 +847,14 @@ const tools = [
830
847
  handler: xlsxReadRange,
831
848
  },
832
849
  ...fixedToolDefinitions(xlsxFixedTools, xlsxCandidates),
850
+ {
851
+ name: 'xlsx_apply_operations',
852
+ effectKind: 'document-mutation',
853
+ description: 'Apply one immutable provider-ready XLSX operation handoff as a single atomic workbook edit. The provider preflights and executes the complete ordered operation list, commits output bytes only when every operation succeeds, and returns one complete receipt.',
854
+ inputSchema: inputContract('xlsx_apply_operations'),
855
+ outputSchema: fixedEditOutput('xlsx_apply_operations'),
856
+ handler: (args, tool) => fixedEdit(tool, args, xlsxCandidates),
857
+ },
833
858
  {
834
859
  name: 'xlsx_validate',
835
860
  description: 'Validate an XLSX workbook package and produce OpenXML validation evidence. Set returnContent true to return the complete result when it fits the response limit. Provide output to write the complete result to a new JSON file. The two choices are independent and may be used together; at least one is required.',
@@ -1230,6 +1255,22 @@ async function docxObservation(tool, args) {
1230
1255
  });
1231
1256
  }
1232
1257
 
1258
+ async function docxReadAllTables(args) {
1259
+ const input = path.resolve(requireString(args.input, 'input'));
1260
+ const output = path.resolve(requireString(args.output, 'output'));
1261
+ return withTempJsonFile({ input }, async requestPath => {
1262
+ const result = await runJsonCandidateChain(docxCandidates, ['docx_read_all_tables', requestPath]);
1263
+ return {
1264
+ tool: 'docx_read_all_tables',
1265
+ runtime: commandRuntime(result),
1266
+ source: await fileArtifact(input),
1267
+ artifact: await writeIdempotentJsonArtifact(output, result.json),
1268
+ schema: result.json.schema,
1269
+ tableCount: result.json.tables.length,
1270
+ };
1271
+ });
1272
+ }
1273
+
1233
1274
  async function docxReadObject(args) {
1234
1275
  const input = path.resolve(requireString(args.input, 'input'));
1235
1276
  const delivery = resultChannels(args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.21.54",
3
+ "version": "0.21.56",
4
4
  "description": "Published MCP distribution for independent Tiwater Office, PDF, and Text document capabilities",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -2,7 +2,7 @@
2
2
  "schema": "tiwater.pdf-provider-contract-manifest/v1",
3
3
  "provider": {
4
4
  "id": "@tiwater/office-mcp",
5
- "version": "0.21.54"
5
+ "version": "0.21.56"
6
6
  },
7
7
  "runtime": {
8
8
  "command": "tiwater-pdf"
@@ -2,7 +2,7 @@
2
2
  "schema": "tiwater.text-provider-contract-manifest/v1",
3
3
  "provider": {
4
4
  "id": "@tiwater/office-mcp",
5
- "version": "0.21.54"
5
+ "version": "0.21.56"
6
6
  },
7
7
  "tools": [
8
8
  {