@tiwater/office-mcp 0.21.55 → 0.21.57

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,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "tiwater.office-mcp-input/docx_set_drawing_checkbox_state",
4
+ "type": "object",
5
+ "properties": {
6
+ "input": {
7
+ "type": "string",
8
+ "minLength": 1,
9
+ "x-tiwater-file-role": "read",
10
+ "x-tiwater-document-revision-role": "current"
11
+ },
12
+ "changes": {
13
+ "type": "array",
14
+ "minItems": 1,
15
+ "items": {
16
+ "type": "object",
17
+ "properties": {
18
+ "drawing": {
19
+ "type": "object",
20
+ "properties": {
21
+ "part": { "type": "string", "minLength": 1, "pattern": "^\\/" },
22
+ "path": { "type": "string", "pattern": "^\\/[A-Za-z_][A-Za-z0-9_.-]*:[A-Za-z_][A-Za-z0-9_.-]*\\[[1-9][0-9]*\\](?:\\/[A-Za-z_][A-Za-z0-9_.-]*:[A-Za-z_][A-Za-z0-9_.-]*\\[[1-9][0-9]*\\])*$" }
23
+ },
24
+ "required": ["part", "path"],
25
+ "additionalProperties": false,
26
+ "description": "Exact current native address of one observed image-based checkbox drawing."
27
+ },
28
+ "checked": {
29
+ "type": "boolean",
30
+ "description": "Requested visible checkbox state."
31
+ }
32
+ },
33
+ "required": ["drawing", "checked"],
34
+ "additionalProperties": false
35
+ }
36
+ },
37
+ "output": {
38
+ "type": "string",
39
+ "minLength": 1,
40
+ "description": "Output DOCX path; may equal input for one atomic in-place update.",
41
+ "x-tiwater-file-role": "write"
42
+ },
43
+ "receiptOutput": {
44
+ "type": "string",
45
+ "minLength": 1,
46
+ "x-tiwater-file-role": "write",
47
+ "x-tiwater-file-effect": false
48
+ }
49
+ },
50
+ "required": ["input", "changes", "output", "receiptOutput"],
51
+ "additionalProperties": false
52
+ }
@@ -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.55"
5
+ "version": "0.21.57"
6
6
  },
7
7
  "tools": [
8
8
  {
@@ -225,6 +225,17 @@
225
225
  "sha256": "5466f70cc69974d4cb2158760491820a43ab2c25ce1c950465a5169c9185ab81"
226
226
  }
227
227
  },
228
+ {
229
+ "name": "docx_set_drawing_checkbox_state",
230
+ "providerContract": {
231
+ "source": "packages/docx-cli/contracts/mcp-input/docx_set_drawing_checkbox_state.schema.json",
232
+ "sha256": "acab84fcd23f91c700778eac33334d33b6199ed9da0604897bf3bde2146245e0"
233
+ },
234
+ "inputContract": {
235
+ "path": "office/contracts/docx_set_drawing_checkbox_state.schema.json",
236
+ "sha256": "acab84fcd23f91c700778eac33334d33b6199ed9da0604897bf3bde2146245e0"
237
+ }
238
+ },
228
239
  {
229
240
  "name": "docx_set_paragraph_pagination",
230
241
  "providerContract": {
@@ -456,6 +467,17 @@
456
467
  "sha256": "06d5f29f7ed23ab53fdf7a5de09cbfb6a800e7a19ae076a3d6d80abf22c464be"
457
468
  }
458
469
  },
470
+ {
471
+ "name": "xlsx_apply_operations",
472
+ "providerContract": {
473
+ "source": "packages/xlsx-cli/contracts/mcp-input/xlsx_apply_operations.schema.json",
474
+ "sha256": "89b0946543671b5dc75ce40db9656f23b3909bc2a9ef945e7cdf5b73f40845d2"
475
+ },
476
+ "inputContract": {
477
+ "path": "office/contracts/xlsx_apply_operations.schema.json",
478
+ "sha256": "89b0946543671b5dc75ce40db9656f23b3909bc2a9ef945e7cdf5b73f40845d2"
479
+ }
480
+ },
459
481
  {
460
482
  "name": "xlsx_convert_legacy",
461
483
  "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
+ }
@@ -7,5 +7,6 @@ export function compactDocxObjectIdentity(object) {
7
7
  gridSpan: object.gridSpan ?? null,
8
8
  verticalMerge: object.verticalMerge ?? null,
9
9
  verticalTextAlignment: object.verticalTextAlignment ?? null,
10
+ checked: object.checked ?? null,
10
11
  };
11
12
  }
package/office/index.mjs CHANGED
@@ -430,6 +430,7 @@ const docxObjectIdentity = z.object({
430
430
  gridSpan: z.number().int().positive().nullable(),
431
431
  verticalMerge: z.string().nullable(),
432
432
  verticalTextAlignment: z.enum(['baseline', 'superscript', 'subscript']).nullable(),
433
+ checked: z.boolean().nullable(),
433
434
  }).strict();
434
435
 
435
436
  const docxNestedObjectIdentity = docxObjectIdentity.pick({
@@ -442,6 +443,7 @@ const docxNestedObjectIdentity = docxObjectIdentity.pick({
442
443
  verticalMergeOwner: docxAddress.optional(),
443
444
  logicalText: z.string().optional(),
444
445
  verticalTextAlignment: z.enum(['baseline', 'superscript', 'subscript']).optional(),
446
+ checked: z.boolean().optional(),
445
447
  }).strict();
446
448
  const docxObservationNode = z.lazy(() => z.object({
447
449
  object: docxNestedObjectIdentity,
@@ -590,7 +592,7 @@ const tools = [
590
592
  },
591
593
  {
592
594
  name: 'docx_read_object',
593
- description: 'Read explicitly selected rows, cells, or paragraphs from one native DOCX. Set returnContent true to return compact requested descendants; if receipt.narrowingRequired is true, request fewer addresses or descendant kinds. Provide output to store the complete selected observation and return its artifact receipt. These channels are independent and may be used together; at least one is required. A selected cell exposes its vertical-merge owner and logical text, so a continue cell keeps its physical identity while resolving the restart cell value. Run and text descendants expose their native verticalTextAlignment when it is baseline, superscript, or subscript. Use docx_read_table for a table range.',
595
+ description: 'Read explicitly selected rows, cells, paragraphs, or drawings from one native DOCX. Set returnContent true to return compact requested descendants; if receipt.narrowingRequired is true, request fewer addresses or descendant kinds. Provide output to store the complete selected observation and return its artifact receipt. These channels are independent and may be used together; at least one is required. A selected cell exposes its vertical-merge owner and logical text, so a continue cell keeps its physical identity while resolving the restart cell value. Run and text descendants expose their native verticalTextAlignment when it is baseline, superscript, or subscript. A technically recognized image-based checkbox drawing exposes checked; unsupported drawings omit it. Use docx_read_table for a table range.',
594
596
  inputSchema: inputContract('docx_read_object'),
595
597
  outputSchema: docxReadObjectOutput,
596
598
  annotations: { readOnlyHint: true, idempotentHint: true },
@@ -644,6 +646,14 @@ const tools = [
644
646
  outputSchema: fixedEditOutput('docx_set_paragraph_pagination'),
645
647
  handler: (args, tool) => fixedEdit(tool, args, docxCandidates),
646
648
  },
649
+ {
650
+ name: 'docx_set_drawing_checkbox_state',
651
+ effectKind: 'document-mutation',
652
+ description: 'Set the visible checked or unchecked state of explicitly selected current DOCX image-based checkbox drawings while retaining each drawing container, native address, size, paragraph, label text, and every unselected drawing. The current provider accepts embedded 24-bit DIB-backed WMF checkboxes and rejects other drawings or images instead of guessing. Shared image parts are isolated before mutation so selecting one checkbox cannot change another. The caller chooses checkbox drawings and states; this tool does not select business options or edit text.',
653
+ inputSchema: inputContract('docx_set_drawing_checkbox_state'),
654
+ outputSchema: fixedEditOutput('docx_set_drawing_checkbox_state'),
655
+ handler: (args, tool) => fixedEdit(tool, args, docxCandidates),
656
+ },
647
657
  {
648
658
  name: 'docx_set_table_width',
649
659
  effectKind: 'document-mutation',
@@ -847,6 +857,14 @@ const tools = [
847
857
  handler: xlsxReadRange,
848
858
  },
849
859
  ...fixedToolDefinitions(xlsxFixedTools, xlsxCandidates),
860
+ {
861
+ name: 'xlsx_apply_operations',
862
+ effectKind: 'document-mutation',
863
+ 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.',
864
+ inputSchema: inputContract('xlsx_apply_operations'),
865
+ outputSchema: fixedEditOutput('xlsx_apply_operations'),
866
+ handler: (args, tool) => fixedEdit(tool, args, xlsxCandidates),
867
+ },
850
868
  {
851
869
  name: 'xlsx_validate',
852
870
  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.',
@@ -1020,6 +1038,7 @@ function compactDocxObservation(observation) {
1020
1038
  ...(node.object.verticalMergeOwner === null ? {} : { verticalMergeOwner: node.object.verticalMergeOwner }),
1021
1039
  ...(node.object.logicalText === null ? {} : { logicalText: node.object.logicalText }),
1022
1040
  ...(identity.verticalTextAlignment === null ? {} : { verticalTextAlignment: identity.verticalTextAlignment }),
1041
+ ...(identity.checked === null ? {} : { checked: identity.checked }),
1023
1042
  };
1024
1043
  return {
1025
1044
  object,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiwater/office-mcp",
3
- "version": "0.21.55",
3
+ "version": "0.21.57",
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.55"
5
+ "version": "0.21.57"
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.55"
5
+ "version": "0.21.57"
6
6
  },
7
7
  "tools": [
8
8
  {