@tiwater/office-mcp 0.16.14 → 0.16.15
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.
|
@@ -41,14 +41,10 @@
|
|
|
41
41
|
"sourceTableRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
|
|
42
42
|
"sourceRows": {
|
|
43
43
|
"type": "object",
|
|
44
|
-
"description": "
|
|
44
|
+
"description": "Exact contiguous source rows to copy. Select only wanted rows; the range cannot begin or end inside a vertical merge.",
|
|
45
45
|
"properties": {
|
|
46
46
|
"firstRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
|
|
47
|
-
"lastRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" }
|
|
48
|
-
"excludeRefs": {
|
|
49
|
-
"type": "array",
|
|
50
|
-
"items": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" }
|
|
51
|
-
}
|
|
47
|
+
"lastRef": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" }
|
|
52
48
|
},
|
|
53
49
|
"required": ["firstRef", "lastRef"],
|
|
54
50
|
"additionalProperties": false
|
|
@@ -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.15"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"name": "docx_copy_table_rows",
|
|
43
43
|
"providerContract": {
|
|
44
44
|
"source": "packages/docx-cli/contracts/mcp-input/docx_copy_table_rows.schema.json",
|
|
45
|
-
"sha256": "
|
|
45
|
+
"sha256": "17fafe8f67129220479cf39ae058c669e2b55958122c4286ce7128d7f7a0cb7d"
|
|
46
46
|
},
|
|
47
47
|
"inputContract": {
|
|
48
48
|
"path": "office/contracts/docx_copy_table_rows.schema.json",
|
|
49
|
-
"sha256": "
|
|
49
|
+
"sha256": "17fafe8f67129220479cf39ae058c669e2b55958122c4286ce7128d7f7a0cb7d"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
{
|
package/office/index.mjs
CHANGED
|
@@ -170,10 +170,15 @@ 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
|
+
|
|
173
178
|
const docxReadObjectOutput = artifactOutput('docx_read_object').extend({
|
|
174
179
|
revision: docxRevision,
|
|
175
180
|
object: docxObjectIdentity,
|
|
176
|
-
|
|
181
|
+
children: z.array(docxObjectNode),
|
|
177
182
|
}).strict();
|
|
178
183
|
|
|
179
184
|
const tools = [
|
|
@@ -182,6 +187,7 @@ const tools = [
|
|
|
182
187
|
description: 'Inspect one current DOCX. The response returns its revision and a bounded table identity index for the next selection; the complete observation remains in the evidence artifact.',
|
|
183
188
|
inputSchema: inputContract('docx_inspect'),
|
|
184
189
|
outputSchema: docxInspectionOutput('docx_inspect'),
|
|
190
|
+
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
185
191
|
handler: docxInspect,
|
|
186
192
|
},
|
|
187
193
|
{
|
|
@@ -200,7 +206,7 @@ const tools = [
|
|
|
200
206
|
},
|
|
201
207
|
{
|
|
202
208
|
name: 'docx_read_object',
|
|
203
|
-
description: 'Read one selected native DOCX 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.',
|
|
204
210
|
inputSchema: inputContract('docx_read_object'),
|
|
205
211
|
outputSchema: docxReadObjectOutput,
|
|
206
212
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
@@ -456,12 +462,18 @@ async function docxReadObject(args) {
|
|
|
456
462
|
artifact: await writeJsonArtifact(output, result.json),
|
|
457
463
|
revision: result.json.receipt.revision,
|
|
458
464
|
object: compactDocxObjectIdentity(result.json.observation.object),
|
|
459
|
-
|
|
460
|
-
.map(compactDocxObjectIdentity),
|
|
465
|
+
children: result.json.observation.children.map(compactDocxObjectNode),
|
|
461
466
|
};
|
|
462
467
|
});
|
|
463
468
|
}
|
|
464
469
|
|
|
470
|
+
function compactDocxObjectNode(node) {
|
|
471
|
+
return {
|
|
472
|
+
object: compactDocxObjectIdentity(node.object),
|
|
473
|
+
children: node.children.map(compactDocxObjectNode),
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
|
|
465
477
|
async function docxValidate(args) {
|
|
466
478
|
const result = await runJsonCandidateChain(docxCandidates, ['validate-openxml', requireString(args.input, 'input')], { allowedExitCodes: [0, 1] });
|
|
467
479
|
return { tool: 'docx_validate', runtime: commandRuntime(result), result: result.json };
|