@tiwater/office-mcp 0.21.54 → 0.21.55
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/contracts/docx_read_all_tables.schema.json +22 -0
- package/office/contracts/tiwater-office-provider-contract-manifest-v1.json +12 -1
- package/office/index.mjs +33 -0
- package/package.json +1 -1
- package/pdf/contracts/tiwater-pdf-provider-contract-manifest-v1.json +1 -1
- package/text/contracts/tiwater-text-provider-contract-manifest-v1.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "tiwater.office-mcp-input/docx_read_all_tables/v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"input": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"minLength": 1,
|
|
9
|
+
"description": "Current DOCX to read once.",
|
|
10
|
+
"x-tiwater-file-role": "read"
|
|
11
|
+
},
|
|
12
|
+
"output": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"description": "New JSON file that receives every native table in document order, including rows, cells, merges, paragraphs, and text nodes.",
|
|
16
|
+
"x-tiwater-file-role": "write",
|
|
17
|
+
"x-tiwater-file-effect": false
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"required": ["input", "output"],
|
|
21
|
+
"additionalProperties": false
|
|
22
|
+
}
|
|
@@ -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.21.
|
|
5
|
+
"version": "0.21.55"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -159,6 +159,17 @@
|
|
|
159
159
|
"sha256": "4ba37e5570ea7958c374111ae7c0f6460eec29937e5c822eba44eb1b8e908d17"
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
|
+
{
|
|
163
|
+
"name": "docx_read_all_tables",
|
|
164
|
+
"providerContract": {
|
|
165
|
+
"source": "packages/docx-cli/contracts/mcp-input/docx_read_all_tables.schema.json",
|
|
166
|
+
"sha256": "a5a22e6368977d620af1c53cc934d8934550734069d7ef7f65fc434e4136ae62"
|
|
167
|
+
},
|
|
168
|
+
"inputContract": {
|
|
169
|
+
"path": "office/contracts/docx_read_all_tables.schema.json",
|
|
170
|
+
"sha256": "a5a22e6368977d620af1c53cc934d8934550734069d7ef7f65fc434e4136ae62"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
162
173
|
{
|
|
163
174
|
"name": "docx_read_object",
|
|
164
175
|
"providerContract": {
|
package/office/index.mjs
CHANGED
|
@@ -534,6 +534,15 @@ const docxTableReadOutput = docxObservationOutput('docx_read_table').extend({
|
|
|
534
534
|
}).strict()).optional(),
|
|
535
535
|
}).strict();
|
|
536
536
|
|
|
537
|
+
const docxReadAllTablesOutput = z.object({
|
|
538
|
+
tool: z.literal('docx_read_all_tables'),
|
|
539
|
+
runtime: runtimeIdentity,
|
|
540
|
+
source: artifact,
|
|
541
|
+
artifact,
|
|
542
|
+
schema: z.literal('tiwater.docx-table-read-set/v1'),
|
|
543
|
+
tableCount: z.number().int().nonnegative(),
|
|
544
|
+
}).strict();
|
|
545
|
+
|
|
537
546
|
const docxReadObjectOutput = docxObservationOutput('docx_read_object').extend({
|
|
538
547
|
receipt: z.object({
|
|
539
548
|
schema: z.literal('tiwater.docx-read-object-receipt/v1'),
|
|
@@ -595,6 +604,14 @@ const tools = [
|
|
|
595
604
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
596
605
|
handler: args => docxObservation('docx_read_table', args),
|
|
597
606
|
},
|
|
607
|
+
{
|
|
608
|
+
name: 'docx_read_all_tables',
|
|
609
|
+
description: 'Read every native table from one current DOCX in document order. The document is opened once and the complete rows, cells, merge ownership, paragraphs, and text nodes are written to output. Only a compact receipt is returned. This tool does not select business tables or infer their meaning.',
|
|
610
|
+
inputSchema: inputContract('docx_read_all_tables'),
|
|
611
|
+
outputSchema: docxReadAllTablesOutput,
|
|
612
|
+
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
613
|
+
handler: docxReadAllTables,
|
|
614
|
+
},
|
|
598
615
|
{
|
|
599
616
|
name: 'docx_replace_content_from_source',
|
|
600
617
|
effectKind: 'document-mutation',
|
|
@@ -1230,6 +1247,22 @@ async function docxObservation(tool, args) {
|
|
|
1230
1247
|
});
|
|
1231
1248
|
}
|
|
1232
1249
|
|
|
1250
|
+
async function docxReadAllTables(args) {
|
|
1251
|
+
const input = path.resolve(requireString(args.input, 'input'));
|
|
1252
|
+
const output = path.resolve(requireString(args.output, 'output'));
|
|
1253
|
+
return withTempJsonFile({ input }, async requestPath => {
|
|
1254
|
+
const result = await runJsonCandidateChain(docxCandidates, ['docx_read_all_tables', requestPath]);
|
|
1255
|
+
return {
|
|
1256
|
+
tool: 'docx_read_all_tables',
|
|
1257
|
+
runtime: commandRuntime(result),
|
|
1258
|
+
source: await fileArtifact(input),
|
|
1259
|
+
artifact: await writeIdempotentJsonArtifact(output, result.json),
|
|
1260
|
+
schema: result.json.schema,
|
|
1261
|
+
tableCount: result.json.tables.length,
|
|
1262
|
+
};
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1233
1266
|
async function docxReadObject(args) {
|
|
1234
1267
|
const input = path.resolve(requireString(args.input, 'input'));
|
|
1235
1268
|
const delivery = resultChannels(args);
|
package/package.json
CHANGED