@tiwater/office-mcp 0.17.31 → 0.17.33
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.
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
"minLength": 1,
|
|
8
8
|
"x-tiwater-file-role": "read"
|
|
9
9
|
},
|
|
10
|
-
"
|
|
11
|
-
"description": "
|
|
12
|
-
"type": "
|
|
13
|
-
"pattern": "^dox1_[0-9a-f]{64}$"
|
|
10
|
+
"refs": {
|
|
11
|
+
"description": "Object refs from one current DOCX observation, returned in this order. Use row, cell, or paragraph refs; table-rooted reads are rejected.",
|
|
12
|
+
"type": "array",
|
|
13
|
+
"items": { "type": "string", "pattern": "^dox1_[0-9a-f]{64}$" },
|
|
14
|
+
"minItems": 1
|
|
14
15
|
},
|
|
15
16
|
"revision": {
|
|
16
17
|
"description": "Optional expected revision id from the observation receipt; a changed document fails as stale.",
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
},
|
|
45
46
|
"required": [
|
|
46
47
|
"input",
|
|
47
|
-
"
|
|
48
|
+
"refs",
|
|
48
49
|
"kinds",
|
|
49
50
|
"output"
|
|
50
51
|
],
|
|
@@ -111,7 +111,12 @@
|
|
|
111
111
|
"additionalProperties": false
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
|
-
"output": {
|
|
114
|
+
"output": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"minLength": 1,
|
|
117
|
+
"description": "New DOCX revision. Every targetDocument object ref becomes stale after success; observe this output before any later structural call.",
|
|
118
|
+
"x-tiwater-file-role": "write"
|
|
119
|
+
},
|
|
115
120
|
"receiptOutput": {
|
|
116
121
|
"type": "string",
|
|
117
122
|
"minLength": 1,
|
|
@@ -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.33"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -119,11 +119,11 @@
|
|
|
119
119
|
"name": "docx_read_object",
|
|
120
120
|
"providerContract": {
|
|
121
121
|
"source": "packages/docx-cli/contracts/mcp-input/docx_read_object.schema.json",
|
|
122
|
-
"sha256": "
|
|
122
|
+
"sha256": "589b616fa60e39107fb6061a67b23387f07acf0d3974a8bf1580cc2567857ff1"
|
|
123
123
|
},
|
|
124
124
|
"inputContract": {
|
|
125
125
|
"path": "office/contracts/docx_read_object.schema.json",
|
|
126
|
-
"sha256": "
|
|
126
|
+
"sha256": "589b616fa60e39107fb6061a67b23387f07acf0d3974a8bf1580cc2567857ff1"
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
129
|
{
|
|
@@ -152,11 +152,11 @@
|
|
|
152
152
|
"name": "docx_replace_table_rows",
|
|
153
153
|
"providerContract": {
|
|
154
154
|
"source": "packages/docx-cli/contracts/mcp-input/docx_replace_table_rows.schema.json",
|
|
155
|
-
"sha256": "
|
|
155
|
+
"sha256": "2b2aa0f981767c57b974ff088e8bfe51091cc73bd10ad3eb86a6ce5ff3a798e9"
|
|
156
156
|
},
|
|
157
157
|
"inputContract": {
|
|
158
158
|
"path": "office/contracts/docx_replace_table_rows.schema.json",
|
|
159
|
-
"sha256": "
|
|
159
|
+
"sha256": "2b2aa0f981767c57b974ff088e8bfe51091cc73bd10ad3eb86a6ce5ff3a798e9"
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
162
|
{
|
package/office/index.mjs
CHANGED
|
@@ -222,7 +222,7 @@ const docxListObjectsOutput = artifactOutput('docx_list_objects').extend({
|
|
|
222
222
|
|
|
223
223
|
const docxReadObjectOutput = artifactOutput('docx_read_object').extend({
|
|
224
224
|
revision: docxRevision,
|
|
225
|
-
|
|
225
|
+
observations: z.array(docxObservationNode).min(1),
|
|
226
226
|
}).strict();
|
|
227
227
|
|
|
228
228
|
const tools = [
|
|
@@ -244,7 +244,7 @@ const tools = [
|
|
|
244
244
|
},
|
|
245
245
|
{
|
|
246
246
|
name: 'docx_read_object',
|
|
247
|
-
description: 'Read one
|
|
247
|
+
description: 'Read selected rows, cells, or paragraphs from one native DOCX in one call and return them in refs order. Pass the document path once and all refs needed for the current target. For exact inline content, use observed cell or paragraph refs and request run or text.',
|
|
248
248
|
inputSchema: inputContract('docx_read_object'),
|
|
249
249
|
outputSchema: docxReadObjectOutput,
|
|
250
250
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
@@ -574,7 +574,7 @@ async function docxReadObject(args) {
|
|
|
574
574
|
const { output: _output, ...request } = args;
|
|
575
575
|
return withTempJsonFile(request, async requestPath => {
|
|
576
576
|
const result = await runJsonCandidateChain(docxCandidates, ['docx_read_object', requestPath]);
|
|
577
|
-
if (result.json?.observation?.object?.kind === 'table') {
|
|
577
|
+
if (result.json?.observations?.some(observation => observation?.object?.kind === 'table')) {
|
|
578
578
|
throw new Error('docx-table-read-requires-paged-row-selection');
|
|
579
579
|
}
|
|
580
580
|
return {
|
|
@@ -583,7 +583,7 @@ async function docxReadObject(args) {
|
|
|
583
583
|
source: await fileArtifact(input),
|
|
584
584
|
artifact: await writeJsonArtifact(output, result.json),
|
|
585
585
|
revision: result.json.receipt.revision,
|
|
586
|
-
|
|
586
|
+
observations: result.json.observations.map(compactDocxObservation),
|
|
587
587
|
};
|
|
588
588
|
});
|
|
589
589
|
}
|