@tiwater/office-mcp 0.18.3 → 0.18.4
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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "tiwater.office-mcp-input/docx_table_index/v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"input": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"minLength": 1,
|
|
9
|
+
"description": "Current DOCX path.",
|
|
10
|
+
"x-tiwater-file-role": "read"
|
|
11
|
+
},
|
|
12
|
+
"output": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"description": "New JSON artifact path for the complete table index.",
|
|
16
|
+
"x-tiwater-file-role": "write"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"required": ["input", "output"],
|
|
20
|
+
"additionalProperties": false
|
|
21
|
+
}
|
|
@@ -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.18.
|
|
5
|
+
"version": "0.18.4"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -192,6 +192,17 @@
|
|
|
192
192
|
"sha256": "4931d4432c574154eb7a344ee4dc485d99d8840c07d2e46f647e14490cbeedae"
|
|
193
193
|
}
|
|
194
194
|
},
|
|
195
|
+
{
|
|
196
|
+
"name": "docx_table_index",
|
|
197
|
+
"providerContract": {
|
|
198
|
+
"source": "packages/docx-cli/contracts/mcp-input/docx_table_index.schema.json",
|
|
199
|
+
"sha256": "7549ce28e3cc51ae17cd86c77c97698b6e90f0125afd34ae8831fde7f87ddf67"
|
|
200
|
+
},
|
|
201
|
+
"inputContract": {
|
|
202
|
+
"path": "office/contracts/docx_table_index.schema.json",
|
|
203
|
+
"sha256": "7549ce28e3cc51ae17cd86c77c97698b6e90f0125afd34ae8831fde7f87ddf67"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
195
206
|
{
|
|
196
207
|
"name": "docx_validate",
|
|
197
208
|
"providerContract": {
|
package/office/index.mjs
CHANGED
|
@@ -216,6 +216,18 @@ const docxListObjectsOutput = artifactOutput('docx_list_objects').extend({
|
|
|
216
216
|
runtime: runtimeIdentity,
|
|
217
217
|
}).strict();
|
|
218
218
|
|
|
219
|
+
const docxTableIndexOutput = artifactOutput('docx_table_index').extend({
|
|
220
|
+
schema: z.literal('tiwater.docx-table-index/v1'),
|
|
221
|
+
tables: z.array(z.object({
|
|
222
|
+
address: docxAddress,
|
|
223
|
+
parentAddress: docxAddress.nullable(),
|
|
224
|
+
rowCount: z.number().int().nonnegative(),
|
|
225
|
+
columnCount: z.number().int().nonnegative(),
|
|
226
|
+
textPreview: z.string(),
|
|
227
|
+
textLength: z.number().int().nonnegative(),
|
|
228
|
+
}).strict()),
|
|
229
|
+
}).strict();
|
|
230
|
+
|
|
219
231
|
const docxReadObjectOutput = artifactOutput('docx_read_object').extend({
|
|
220
232
|
observations: z.array(docxObservationNode).min(1),
|
|
221
233
|
}).strict();
|
|
@@ -237,6 +249,14 @@ const tools = [
|
|
|
237
249
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
238
250
|
handler: args => docxObservation('docx_list_objects', args),
|
|
239
251
|
},
|
|
252
|
+
{
|
|
253
|
+
name: 'docx_table_index',
|
|
254
|
+
description: 'List every table in one current DOCX as a compact native index with its OpenXML address, row count, column count, and short text preview. Use it to choose a table and confirm its shape before listing rows or reading selected content. It does not return full cell content or decide table semantics.',
|
|
255
|
+
inputSchema: inputContract('docx_table_index'),
|
|
256
|
+
outputSchema: docxTableIndexOutput,
|
|
257
|
+
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
258
|
+
handler: args => docxObservation('docx_table_index', args),
|
|
259
|
+
},
|
|
240
260
|
{
|
|
241
261
|
name: 'docx_read_object',
|
|
242
262
|
description: 'Read selected tables, rows, cells, or paragraphs from one native DOCX in one call and return them in address order. Pass the document path once and only the OpenXML addresses needed for the current target. For exact inline content, use an observed cell or paragraph address and request run or text.',
|
|
@@ -559,6 +579,7 @@ async function docxObservation(tool, args) {
|
|
|
559
579
|
if (tool === 'docx_list_objects') {
|
|
560
580
|
return { ...retained, ...payload, objects: payload.objects.map(compactDocxObjectIdentity) };
|
|
561
581
|
}
|
|
582
|
+
if (tool === 'docx_table_index') return { ...retained, ...payload };
|
|
562
583
|
throw new Error(`unsupported-docx-observation-tool:${tool}`);
|
|
563
584
|
});
|
|
564
585
|
}
|