@tiwater/office-mcp 0.17.18 → 0.17.20
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/index.mjs
CHANGED
|
@@ -173,6 +173,13 @@ function docxInspectionOutput(tool) {
|
|
|
173
173
|
revision: docxRevision,
|
|
174
174
|
summary: z.object({
|
|
175
175
|
tableCount: z.number().int().nonnegative(),
|
|
176
|
+
tables: z.array(z.object({
|
|
177
|
+
ref: z.string().regex(/^dox1_[0-9a-f]{64}$/),
|
|
178
|
+
parentRef: z.string().regex(/^dox1_[0-9a-f]{64}$/).nullable(),
|
|
179
|
+
rowCount: z.number().int().nonnegative(),
|
|
180
|
+
columnCount: z.number().int().nonnegative(),
|
|
181
|
+
textPreview: z.string().max(240),
|
|
182
|
+
}).strict()),
|
|
176
183
|
openingParagraphs: z.array(z.object({
|
|
177
184
|
ref: z.string().regex(/^dox1_[0-9a-f]{64}$/),
|
|
178
185
|
textPreview: z.string().min(1).max(240),
|
|
@@ -241,7 +248,7 @@ const docxReadObjectOutput = artifactOutput('docx_read_object').extend({
|
|
|
241
248
|
const tools = [
|
|
242
249
|
{
|
|
243
250
|
name: 'docx_inspect',
|
|
244
|
-
description: 'Inspect one current DOCX. The response returns its revision, table
|
|
251
|
+
description: 'Inspect one current DOCX. The response returns its revision, every table identity with shape and short text preview, and up to six opening non-empty body paragraphs. Reuse those native refs directly; use docx_find_literal only for text not exposed here and docx_list_objects only for container children. The complete inspection remains in the evidence artifact.',
|
|
245
252
|
inputSchema: inputContract('docx_inspect'),
|
|
246
253
|
outputSchema: docxInspectionOutput('docx_inspect'),
|
|
247
254
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
@@ -287,7 +294,7 @@ const tools = [
|
|
|
287
294
|
},
|
|
288
295
|
{
|
|
289
296
|
name: 'docx_copy_table_rows',
|
|
290
|
-
description: 'Populate existing target tables by replacing selected data-row ranges with selected source rows. Each changes item contains its sourceDocument, source table and rows, targetDocument, target table and rows, and header-cell mappings. Every item in one call must use the same target document; batch all resolved edits because a successful edit invalidates prior target refs. All source-cell paragraphs copy by default
|
|
297
|
+
description: 'Populate existing target tables by replacing selected data-row ranges with selected source rows. Each changes item contains its sourceDocument, source table and rows, targetDocument, target table and rows, and header-cell mappings. Every item in one call must use the same target document; batch all resolved edits because a successful edit invalidates prior target refs. All source-cell paragraphs copy by default. When a source cell contains content that the target must omit, sourceCellContents selects the exact observed content in this same call.',
|
|
291
298
|
inputSchema: inputContract('docx_copy_table_rows'),
|
|
292
299
|
outputSchema: fixedEditOutput('docx_copy_table_rows'),
|
|
293
300
|
handler: args => fixedEdit('docx_copy_table_rows', args),
|
|
@@ -519,7 +526,17 @@ function compactDocxInspection(report) {
|
|
|
519
526
|
}));
|
|
520
527
|
return {
|
|
521
528
|
revision: report.tables.revision,
|
|
522
|
-
summary: {
|
|
529
|
+
summary: {
|
|
530
|
+
tableCount: report.tables.tables.length,
|
|
531
|
+
tables: report.tables.tables.map(table => ({
|
|
532
|
+
ref: table.ref,
|
|
533
|
+
parentRef: table.parentRef,
|
|
534
|
+
rowCount: table.rowCount,
|
|
535
|
+
columnCount: table.columnCount,
|
|
536
|
+
textPreview: String(table.textPreview ?? '').trim().replace(/\s+/gu, ' ').slice(0, 240),
|
|
537
|
+
})),
|
|
538
|
+
openingParagraphs,
|
|
539
|
+
},
|
|
523
540
|
};
|
|
524
541
|
}
|
|
525
542
|
|