@tiwater/office-mcp 0.17.9 → 0.17.10
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.
|
@@ -45,11 +45,18 @@
|
|
|
45
45
|
"continuation": {
|
|
46
46
|
"type": "string",
|
|
47
47
|
"minLength": 1
|
|
48
|
+
},
|
|
49
|
+
"output": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"minLength": 1,
|
|
52
|
+
"description": "Absolute path for a new JSON artifact containing this exact search page for later reuse.",
|
|
53
|
+
"x-tiwater-file-role": "write"
|
|
48
54
|
}
|
|
49
55
|
},
|
|
50
56
|
"required": [
|
|
51
57
|
"input",
|
|
52
|
-
"literal"
|
|
58
|
+
"literal",
|
|
59
|
+
"output"
|
|
53
60
|
],
|
|
54
61
|
"additionalProperties": false,
|
|
55
62
|
"$id": "tiwater.office-mcp-input/docx_find_literal/v1"
|
|
@@ -42,11 +42,18 @@
|
|
|
42
42
|
"continuation": {
|
|
43
43
|
"type": "string",
|
|
44
44
|
"minLength": 1
|
|
45
|
+
},
|
|
46
|
+
"output": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"minLength": 1,
|
|
49
|
+
"description": "Absolute path for a new JSON artifact containing this exact object page for later reuse.",
|
|
50
|
+
"x-tiwater-file-role": "write"
|
|
45
51
|
}
|
|
46
52
|
},
|
|
47
53
|
"required": [
|
|
48
54
|
"input",
|
|
49
|
-
"kind"
|
|
55
|
+
"kind",
|
|
56
|
+
"output"
|
|
50
57
|
],
|
|
51
58
|
"additionalProperties": false,
|
|
52
59
|
"$id": "tiwater.office-mcp-input/docx_list_objects/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.17.
|
|
5
|
+
"version": "0.17.10"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -97,11 +97,11 @@
|
|
|
97
97
|
"name": "docx_find_literal",
|
|
98
98
|
"providerContract": {
|
|
99
99
|
"source": "packages/docx-cli/contracts/mcp-input/docx_find_literal.schema.json",
|
|
100
|
-
"sha256": "
|
|
100
|
+
"sha256": "4b063c8a4c683c1d7eb06ce1feec8e51546dca78759151ff654f41d45a17d64c"
|
|
101
101
|
},
|
|
102
102
|
"inputContract": {
|
|
103
103
|
"path": "office/contracts/docx_find_literal.schema.json",
|
|
104
|
-
"sha256": "
|
|
104
|
+
"sha256": "4b063c8a4c683c1d7eb06ce1feec8e51546dca78759151ff654f41d45a17d64c"
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
{
|
|
@@ -119,11 +119,11 @@
|
|
|
119
119
|
"name": "docx_list_objects",
|
|
120
120
|
"providerContract": {
|
|
121
121
|
"source": "packages/docx-cli/contracts/mcp-input/docx_list_objects.schema.json",
|
|
122
|
-
"sha256": "
|
|
122
|
+
"sha256": "5aff2a708172ea8ccba630e5fe3c42314ca3db3d333fcf001d69df87568c18fa"
|
|
123
123
|
},
|
|
124
124
|
"inputContract": {
|
|
125
125
|
"path": "office/contracts/docx_list_objects.schema.json",
|
|
126
|
-
"sha256": "
|
|
126
|
+
"sha256": "5aff2a708172ea8ccba630e5fe3c42314ca3db3d333fcf001d69df87568c18fa"
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
129
|
{
|
package/office/index.mjs
CHANGED
|
@@ -213,14 +213,14 @@ const docxObservationReceipt = z.object({
|
|
|
213
213
|
continuation: z.string().nullable(),
|
|
214
214
|
}).strict();
|
|
215
215
|
|
|
216
|
-
const docxListObjectsOutput =
|
|
216
|
+
const docxListObjectsOutput = artifactOutput('docx_list_objects').extend({
|
|
217
217
|
schema: z.literal('tiwater.docx-observation-list/v1'),
|
|
218
218
|
receipt: docxObservationReceipt,
|
|
219
219
|
objects: z.array(docxObjectIdentity),
|
|
220
220
|
runtime: runtimeIdentity,
|
|
221
221
|
}).strict();
|
|
222
222
|
|
|
223
|
-
const docxFindLiteralOutput =
|
|
223
|
+
const docxFindLiteralOutput = artifactOutput('docx_find_literal').extend({
|
|
224
224
|
schema: z.literal('tiwater.docx-observation-find/v1'),
|
|
225
225
|
receipt: docxObservationReceipt,
|
|
226
226
|
matches: z.array(z.object({
|
|
@@ -249,7 +249,7 @@ const tools = [
|
|
|
249
249
|
},
|
|
250
250
|
{
|
|
251
251
|
name: 'docx_list_objects',
|
|
252
|
-
description: 'List one small page of revision-bound nearest-child identities. Use parentRef to restrict any container, such as body paragraphs, table rows, or row cells; use docx_find_literal when selecting by text.',
|
|
252
|
+
description: 'List one small page of revision-bound nearest-child identities and retain the exact page at output for later reuse. Use parentRef to restrict any container, such as body paragraphs, table rows, or row cells; use docx_find_literal when selecting by text.',
|
|
253
253
|
inputSchema: inputContract('docx_list_objects'),
|
|
254
254
|
outputSchema: docxListObjectsOutput,
|
|
255
255
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
@@ -257,7 +257,7 @@ const tools = [
|
|
|
257
257
|
},
|
|
258
258
|
{
|
|
259
259
|
name: 'docx_find_literal',
|
|
260
|
-
description: 'Find exact current text in one small page of revision-bound native DOCX objects. With kind table or row, matching includes descendant cell text.',
|
|
260
|
+
description: 'Find exact current text in one small page of revision-bound native DOCX objects and retain the exact page at output for later reuse. With kind table or row, matching includes descendant cell text.',
|
|
261
261
|
inputSchema: inputContract('docx_find_literal'),
|
|
262
262
|
outputSchema: docxFindLiteralOutput,
|
|
263
263
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
@@ -567,14 +567,24 @@ async function docxInspect(args) {
|
|
|
567
567
|
}
|
|
568
568
|
|
|
569
569
|
async function docxObservation(tool, args) {
|
|
570
|
-
|
|
570
|
+
const input = path.resolve(requireString(args.input, 'input'));
|
|
571
|
+
const output = requireString(args.output, 'output');
|
|
572
|
+
const { output: _output, ...request } = args;
|
|
573
|
+
return withTempJsonFile(request, async requestPath => {
|
|
571
574
|
const result = await runJsonCandidateChain(docxCandidates, [tool, requestPath]);
|
|
572
575
|
const payload = { ...result.json, runtime: commandRuntime(result) };
|
|
576
|
+
const retained = {
|
|
577
|
+
tool,
|
|
578
|
+
runtime: payload.runtime,
|
|
579
|
+
source: await fileArtifact(input),
|
|
580
|
+
artifact: await writeJsonArtifact(output, result.json),
|
|
581
|
+
};
|
|
573
582
|
if (tool === 'docx_list_objects') {
|
|
574
|
-
return { ...payload, objects: payload.objects.map(compactDocxObjectIdentity) };
|
|
583
|
+
return { ...retained, ...payload, objects: payload.objects.map(compactDocxObjectIdentity) };
|
|
575
584
|
}
|
|
576
585
|
if (tool === 'docx_find_literal') {
|
|
577
586
|
return {
|
|
587
|
+
...retained,
|
|
578
588
|
...payload,
|
|
579
589
|
matches: payload.matches.map(match => ({
|
|
580
590
|
object: compactDocxObjectIdentity(match.object),
|