@tiwater/office-mcp 0.18.4 → 0.18.5
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,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "tiwater.office-mcp-input/docx_read_table/v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"input": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"minLength": 1,
|
|
9
|
+
"x-tiwater-file-role": "read"
|
|
10
|
+
},
|
|
11
|
+
"table": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"part": { "type": "string", "minLength": 1 },
|
|
15
|
+
"path": { "type": "string", "pattern": "^\\/" }
|
|
16
|
+
},
|
|
17
|
+
"required": ["part", "path"],
|
|
18
|
+
"additionalProperties": false
|
|
19
|
+
},
|
|
20
|
+
"output": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"x-tiwater-file-role": "write"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"required": ["input", "table", "output"],
|
|
27
|
+
"additionalProperties": false
|
|
28
|
+
}
|
|
@@ -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.5"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -126,6 +126,17 @@
|
|
|
126
126
|
"sha256": "f8d29a89c0a321332d5d964c970b2cb18c7ecd59f87e9892e6779747a00f9825"
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
|
+
{
|
|
130
|
+
"name": "docx_read_table",
|
|
131
|
+
"providerContract": {
|
|
132
|
+
"source": "packages/docx-cli/contracts/mcp-input/docx_read_table.schema.json",
|
|
133
|
+
"sha256": "3b85fb6bc390053abdcdbcf4d5a2a4f958a06154286a0327676144324706af83"
|
|
134
|
+
},
|
|
135
|
+
"inputContract": {
|
|
136
|
+
"path": "office/contracts/docx_read_table.schema.json",
|
|
137
|
+
"sha256": "3b85fb6bc390053abdcdbcf4d5a2a4f958a06154286a0327676144324706af83"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
129
140
|
{
|
|
130
141
|
"name": "docx_refresh_fields",
|
|
131
142
|
"providerContract": {
|
package/office/index.mjs
CHANGED
|
@@ -228,6 +228,31 @@ const docxTableIndexOutput = artifactOutput('docx_table_index').extend({
|
|
|
228
228
|
}).strict()),
|
|
229
229
|
}).strict();
|
|
230
230
|
|
|
231
|
+
const docxTableReadOutput = artifactOutput('docx_read_table').extend({
|
|
232
|
+
schema: z.literal('tiwater.docx-table-read/v1'),
|
|
233
|
+
address: docxAddress,
|
|
234
|
+
rowCount: z.number().int().nonnegative(),
|
|
235
|
+
columnCount: z.number().int().nonnegative(),
|
|
236
|
+
rows: z.array(z.object({
|
|
237
|
+
address: docxAddress,
|
|
238
|
+
gridBefore: z.number().int().nonnegative(),
|
|
239
|
+
gridAfter: z.number().int().nonnegative(),
|
|
240
|
+
cells: z.array(z.object({
|
|
241
|
+
address: docxAddress,
|
|
242
|
+
gridSpan: z.number().int().positive(),
|
|
243
|
+
verticalMerge: z.string().nullable(),
|
|
244
|
+
paragraphs: z.array(z.object({
|
|
245
|
+
address: docxAddress,
|
|
246
|
+
text: z.string(),
|
|
247
|
+
textNodes: z.array(z.object({
|
|
248
|
+
address: docxAddress,
|
|
249
|
+
text: z.string(),
|
|
250
|
+
}).strict()),
|
|
251
|
+
}).strict()),
|
|
252
|
+
}).strict()),
|
|
253
|
+
}).strict()),
|
|
254
|
+
}).strict();
|
|
255
|
+
|
|
231
256
|
const docxReadObjectOutput = artifactOutput('docx_read_object').extend({
|
|
232
257
|
observations: z.array(docxObservationNode).min(1),
|
|
233
258
|
}).strict();
|
|
@@ -259,12 +284,20 @@ const tools = [
|
|
|
259
284
|
},
|
|
260
285
|
{
|
|
261
286
|
name: 'docx_read_object',
|
|
262
|
-
description: 'Read selected
|
|
287
|
+
description: 'Read selected rows, cells, or paragraphs from one native DOCX in one call and return their requested descendants in address order. Use docx_read_table when the current task needs one complete table. For exact inline content, use an observed cell or paragraph address and request run or text.',
|
|
263
288
|
inputSchema: inputContract('docx_read_object'),
|
|
264
289
|
outputSchema: docxReadObjectOutput,
|
|
265
290
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
266
291
|
handler: docxReadObject,
|
|
267
292
|
},
|
|
293
|
+
{
|
|
294
|
+
name: 'docx_read_table',
|
|
295
|
+
description: 'Read one complete table selected by its native OpenXML address. Returns compact rows, cells, spans, vertical merges, paragraphs, text nodes, and their reusable addresses in document order. It does not search for a table or decide business meaning.',
|
|
296
|
+
inputSchema: inputContract('docx_read_table'),
|
|
297
|
+
outputSchema: docxTableReadOutput,
|
|
298
|
+
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
299
|
+
handler: args => docxObservation('docx_read_table', args),
|
|
300
|
+
},
|
|
268
301
|
{
|
|
269
302
|
name: 'docx_copy_content',
|
|
270
303
|
description: 'Replace content in existing plain-text target paragraphs or cells while retaining target container formatting and source inline meaning. A selection copies a whole object by OpenXML address, or an exact substring when range is attached to a run or text address.',
|
|
@@ -579,7 +612,7 @@ async function docxObservation(tool, args) {
|
|
|
579
612
|
if (tool === 'docx_list_objects') {
|
|
580
613
|
return { ...retained, ...payload, objects: payload.objects.map(compactDocxObjectIdentity) };
|
|
581
614
|
}
|
|
582
|
-
if (tool === 'docx_table_index') return { ...retained, ...payload };
|
|
615
|
+
if (tool === 'docx_table_index' || tool === 'docx_read_table') return { ...retained, ...payload };
|
|
583
616
|
throw new Error(`unsupported-docx-observation-tool:${tool}`);
|
|
584
617
|
});
|
|
585
618
|
}
|