@tiwater/office-mcp 0.16.17 → 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.
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 },
|
|
@@ -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 };
|