@tiwater/office-mcp 0.15.12 → 0.15.14
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
|
@@ -8,6 +8,7 @@ values, business mappings, workflow decisions, and delivery status.
|
|
|
8
8
|
|
|
9
9
|
Every inspect/export result binds its observation artifact to the exact source
|
|
10
10
|
file path, SHA-256, and byte count used by that invocation.
|
|
11
|
+
Full native object reads are also written as artifacts instead of being inlined.
|
|
11
12
|
|
|
12
13
|
Every filesystem argument is identified in the published MCP input schema by
|
|
13
14
|
`x-tiwater-file-role`. `read` marks an existing provider input; `write` marks a
|
|
@@ -16,11 +16,18 @@
|
|
|
16
16
|
"description": "Optional expected revision id from the observation receipt; a changed document fails as stale.",
|
|
17
17
|
"type": "string",
|
|
18
18
|
"pattern": "^docx-rev-v1-[0-9a-f]{64}$"
|
|
19
|
+
},
|
|
20
|
+
"output": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"description": "Absolute path for a new JSON artifact containing the complete native object observation.",
|
|
24
|
+
"x-tiwater-file-role": "write"
|
|
19
25
|
}
|
|
20
26
|
},
|
|
21
27
|
"required": [
|
|
22
28
|
"input",
|
|
23
|
-
"ref"
|
|
29
|
+
"ref",
|
|
30
|
+
"output"
|
|
24
31
|
],
|
|
25
32
|
"additionalProperties": false,
|
|
26
33
|
"$id": "tiwater.office-mcp-input/docx_read_object/v1"
|
|
@@ -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.15.
|
|
5
|
+
"version": "0.15.14"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -284,11 +284,11 @@
|
|
|
284
284
|
"name": "docx_read_object",
|
|
285
285
|
"providerContract": {
|
|
286
286
|
"source": "packages/docx-cli/contracts/mcp-input/docx_read_object.schema.json",
|
|
287
|
-
"sha256": "
|
|
287
|
+
"sha256": "ed4068627fe84872fb8d15d57d5950a22d03e79b4bb11cbc376a8d8b84cee0c0"
|
|
288
288
|
},
|
|
289
289
|
"inputContract": {
|
|
290
290
|
"path": "office/contracts/docx_read_object.schema.json",
|
|
291
|
-
"sha256": "
|
|
291
|
+
"sha256": "ed4068627fe84872fb8d15d57d5950a22d03e79b4bb11cbc376a8d8b84cee0c0"
|
|
292
292
|
}
|
|
293
293
|
},
|
|
294
294
|
{
|
package/office/index.mjs
CHANGED
|
@@ -205,24 +205,25 @@ const tools = [
|
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
name: 'docx_list_objects',
|
|
208
|
-
description: 'List one small page of revision-bound DOCX object identities for structure discovery, not
|
|
208
|
+
description: 'List one small page of revision-bound DOCX object identities for structure discovery, not selection by text. To select a table or row by any descendant cell text, call docx_find_literal with kind table or row instead of listing the document. Use parentRef for nearest children: a part yields top-level story blocks and a table yields rows. Without parentRef the request is story-wide; scope is only an exact story-part URI.',
|
|
209
209
|
inputSchema: inputContract('docx_list_objects'),
|
|
210
210
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
211
211
|
handler: args => docxObservation('docx_list_objects', args),
|
|
212
212
|
},
|
|
213
213
|
{
|
|
214
214
|
name: 'docx_find_literal',
|
|
215
|
-
description: 'Find exact current text in one small page of revision-bound native DOCX objects
|
|
215
|
+
description: 'Find exact current text in one small page of revision-bound native DOCX objects. With kind table or row, matching includes all descendant cell text, so no prior paragraph, cell, or document-wide list is needed. Use parentRef only to search nearest published children of a selected object.',
|
|
216
216
|
inputSchema: inputContract('docx_find_literal'),
|
|
217
217
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
218
218
|
handler: args => docxObservation('docx_find_literal', args),
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
221
|
name: 'docx_read_object',
|
|
222
|
-
description: '
|
|
222
|
+
description: 'Write one selected revision-bound native DOCX object in full technical Open XML detail to a new JSON artifact. Use a table or row ref from list/find to inspect grid spans and merges without enumerating document-wide cells.',
|
|
223
223
|
inputSchema: inputContract('docx_read_object'),
|
|
224
|
+
outputSchema: artifactOutput('docx_read_object'),
|
|
224
225
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
225
|
-
handler:
|
|
226
|
+
handler: docxReadObject,
|
|
226
227
|
},
|
|
227
228
|
{
|
|
228
229
|
name: 'docx_copy_content',
|
|
@@ -428,6 +429,21 @@ async function docxObservation(tool, args) {
|
|
|
428
429
|
});
|
|
429
430
|
}
|
|
430
431
|
|
|
432
|
+
async function docxReadObject(args) {
|
|
433
|
+
const input = path.resolve(requireString(args.input, 'input'));
|
|
434
|
+
const output = requireString(args.output, 'output');
|
|
435
|
+
const { output: _output, ...request } = args;
|
|
436
|
+
return withTempJsonFile(request, async requestPath => {
|
|
437
|
+
const result = await runJsonCandidateChain(docxCandidates, ['docx_read_object', requestPath]);
|
|
438
|
+
return {
|
|
439
|
+
tool: 'docx_read_object',
|
|
440
|
+
runtime: commandRuntime(result),
|
|
441
|
+
source: await fileArtifact(input),
|
|
442
|
+
artifact: await writeJsonArtifact(output, result.json),
|
|
443
|
+
};
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
|
|
431
447
|
async function docxValidate(args) {
|
|
432
448
|
const result = await runJsonCandidateChain(docxCandidates, ['validate-openxml', requireString(args.input, 'input')], { allowedExitCodes: [0, 1] });
|
|
433
449
|
return { tool: 'docx_validate', runtime: commandRuntime(result), result: result.json };
|