@tiwater/office-mcp 0.16.16 → 0.16.18
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.
|
@@ -18,7 +18,11 @@
|
|
|
18
18
|
"items": {
|
|
19
19
|
"type": "object",
|
|
20
20
|
"properties": {
|
|
21
|
-
"targetRef": {
|
|
21
|
+
"targetRef": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^dox1_[0-9a-f]{64}$",
|
|
24
|
+
"description": "Target cell ref whose content is replaced while its cell formatting is retained."
|
|
25
|
+
},
|
|
22
26
|
"sourceDocument": {
|
|
23
27
|
"type": "object",
|
|
24
28
|
"properties": {
|
|
@@ -31,12 +35,18 @@
|
|
|
31
35
|
"sourceSelections": {
|
|
32
36
|
"type": "array",
|
|
33
37
|
"minItems": 1,
|
|
38
|
+
"description": "Ordered source content copied into the target cell. Select a whole observed object by ref alone, or select an exact substring by adding range to an observed run or text ref. Multiple selections are copied in this array order.",
|
|
34
39
|
"items": {
|
|
35
40
|
"type": "object",
|
|
36
41
|
"properties": {
|
|
37
|
-
"ref": {
|
|
42
|
+
"ref": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"pattern": "^dox1_[0-9a-f]{64}$",
|
|
45
|
+
"description": "Observed source object ref. When range is present this must be a run or text ref, not a paragraph, cell, row, or table ref."
|
|
46
|
+
},
|
|
38
47
|
"range": {
|
|
39
48
|
"type": "object",
|
|
49
|
+
"description": "Zero-based substring within the selected run or text object. Omit range to copy the whole selected object.",
|
|
40
50
|
"properties": {
|
|
41
51
|
"start": { "type": "integer", "minimum": 0, "maximum": 2147483647 },
|
|
42
52
|
"length": { "type": "integer", "exclusiveMinimum": 0, "maximum": 2147483647 }
|
|
@@ -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.16.
|
|
5
|
+
"version": "0.16.18"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"name": "docx_copy_content",
|
|
21
21
|
"providerContract": {
|
|
22
22
|
"source": "packages/docx-cli/contracts/mcp-input/docx_copy_content.schema.json",
|
|
23
|
-
"sha256": "
|
|
23
|
+
"sha256": "27110c4590087bb38bd08f77ab2dc19a62407a836f58a603d222ebdb184c97b6"
|
|
24
24
|
},
|
|
25
25
|
"inputContract": {
|
|
26
26
|
"path": "office/contracts/docx_copy_content.schema.json",
|
|
27
|
-
"sha256": "
|
|
27
|
+
"sha256": "27110c4590087bb38bd08f77ab2dc19a62407a836f58a603d222ebdb184c97b6"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
{
|
package/office/index.mjs
CHANGED
|
@@ -170,15 +170,9 @@ const docxObjectIdentity = z.object({
|
|
|
170
170
|
verticalMerge: z.string().nullable(),
|
|
171
171
|
}).strict();
|
|
172
172
|
|
|
173
|
-
const docxObjectNode = z.lazy(() => z.object({
|
|
174
|
-
object: docxObjectIdentity,
|
|
175
|
-
children: z.array(docxObjectNode),
|
|
176
|
-
}).strict());
|
|
177
|
-
|
|
178
173
|
const docxReadObjectOutput = artifactOutput('docx_read_object').extend({
|
|
179
174
|
revision: docxRevision,
|
|
180
175
|
object: docxObjectIdentity,
|
|
181
|
-
children: z.array(docxObjectNode),
|
|
182
176
|
}).strict();
|
|
183
177
|
|
|
184
178
|
const tools = [
|
|
@@ -206,7 +200,7 @@ const tools = [
|
|
|
206
200
|
},
|
|
207
201
|
{
|
|
208
202
|
name: 'docx_read_object',
|
|
209
|
-
description: 'Read one selected native DOCX object as an ordered native hierarchy. For a table, request row and cell kinds once; each row contains its ordered cells with text, grid span, and vertical merge state. Also request paragraph when paragraph boundaries determine what a later copy operation must retain.',
|
|
203
|
+
description: 'Read one selected native DOCX object as an ordered native hierarchy written to the requested output artifact. The tool response only identifies that artifact and the selected root object; read the artifact for descendant refs and content. For a table, request row and cell kinds once; each row contains its ordered cells with text, grid span, and vertical merge state. Also request paragraph when paragraph boundaries determine what a later copy operation must retain.',
|
|
210
204
|
inputSchema: inputContract('docx_read_object'),
|
|
211
205
|
outputSchema: docxReadObjectOutput,
|
|
212
206
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
@@ -214,7 +208,7 @@ const tools = [
|
|
|
214
208
|
},
|
|
215
209
|
{
|
|
216
210
|
name: 'docx_copy_content',
|
|
217
|
-
description: '
|
|
211
|
+
description: 'Replace content in existing target cells while retaining target cell formatting and source inline meaning. Use this directly or after docx_copy_table_rows when a target cell needs an exact observed subset of source content. A source selection copies a whole object by ref, or an exact substring when range is attached to a run or text ref.',
|
|
218
212
|
inputSchema: inputContract('docx_copy_content'),
|
|
219
213
|
outputSchema: fixedEditOutput('docx_copy_content'),
|
|
220
214
|
handler: args => fixedEdit('docx_copy_content', args),
|
|
@@ -462,18 +456,10 @@ async function docxReadObject(args) {
|
|
|
462
456
|
artifact: await writeJsonArtifact(output, result.json),
|
|
463
457
|
revision: result.json.receipt.revision,
|
|
464
458
|
object: compactDocxObjectIdentity(result.json.observation.object),
|
|
465
|
-
children: result.json.observation.children.map(compactDocxObjectNode),
|
|
466
459
|
};
|
|
467
460
|
});
|
|
468
461
|
}
|
|
469
462
|
|
|
470
|
-
function compactDocxObjectNode(node) {
|
|
471
|
-
return {
|
|
472
|
-
object: compactDocxObjectIdentity(node.object),
|
|
473
|
-
children: node.children.map(compactDocxObjectNode),
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
|
|
477
463
|
async function docxValidate(args) {
|
|
478
464
|
const result = await runJsonCandidateChain(docxCandidates, ['validate-openxml', requireString(args.input, 'input')], { allowedExitCodes: [0, 1] });
|
|
479
465
|
return { tool: 'docx_validate', runtime: commandRuntime(result), result: result.json };
|