@tiwater/office-mcp 0.20.0 → 0.20.2
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
|
@@ -194,6 +194,8 @@ const docxNestedObjectIdentity = docxObjectIdentity.pick({
|
|
|
194
194
|
}).extend({
|
|
195
195
|
gridSpan: z.number().int().positive().optional(),
|
|
196
196
|
verticalMerge: z.string().optional(),
|
|
197
|
+
verticalMergeOwner: docxAddress.optional(),
|
|
198
|
+
logicalText: z.string().optional(),
|
|
197
199
|
}).strict();
|
|
198
200
|
const docxObservationNode = z.lazy(() => z.object({
|
|
199
201
|
object: docxNestedObjectIdentity,
|
|
@@ -286,6 +288,7 @@ const docxTableReadOutput = artifactOutput('docx_read_table').extend({
|
|
|
286
288
|
verticalMerge: z.string().nullable(),
|
|
287
289
|
verticalMergeOwner: docxAddress.nullable(),
|
|
288
290
|
text: z.string(),
|
|
291
|
+
logicalText: z.string(),
|
|
289
292
|
}).strict()),
|
|
290
293
|
}).strict()),
|
|
291
294
|
}).strict();
|
|
@@ -328,7 +331,7 @@ const tools = [
|
|
|
328
331
|
},
|
|
329
332
|
{
|
|
330
333
|
name: 'docx_read_object',
|
|
331
|
-
description: 'Read selected rows, cells, or paragraphs from one native DOCX and retain the complete result at output. The response returns compact requested descendants when bounded; if receipt.narrowingRequired is true, request fewer observed addresses or descendants. Use docx_read_table for a table.',
|
|
334
|
+
description: 'Read selected rows, cells, or paragraphs from one native DOCX and retain the complete result at output. A selected cell exposes its vertical-merge owner and logical text, so a continue cell keeps its physical identity while resolving the restart cell value. The response returns compact requested descendants when bounded; if receipt.narrowingRequired is true, request fewer observed addresses or descendants. Use docx_read_table for a table.',
|
|
332
335
|
inputSchema: inputContract('docx_read_object'),
|
|
333
336
|
outputSchema: docxReadObjectOutput,
|
|
334
337
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
@@ -336,7 +339,7 @@ const tools = [
|
|
|
336
339
|
},
|
|
337
340
|
{
|
|
338
341
|
name: 'docx_read_table',
|
|
339
|
-
description: 'Read exactly one table selected from docx_table_index by native OpenXML address. Each call retains full paragraph and text-node detail for exactly the returned row page at output; it never builds another whole-table data object. The machine response is the compact form of that page: each row and cell keeps its reusable native address, grid position and span, vertical-merge owner, and
|
|
342
|
+
description: 'Read exactly one table selected from docx_table_index by native OpenXML address. Each call retains full paragraph and text-node detail for exactly the returned row page at output; it never builds another whole-table data object. The machine response is the compact form of that page: each row and cell keeps its reusable native address, grid position and span, vertical-merge owner, physical text, and logical text. In a vertical merge, restart begins one logical cell and a continue cell is not an independent row value: logicalText resolves the restart cell value while text remains the physical cell value. Process the current page before continuing once with receipt.nextOffset; never revisit an earlier offset. Use docx_read_object only when one selected object needs a narrower descendant view. The provider reports physical structure only; the Agent decides the template and business meaning.',
|
|
340
343
|
inputSchema: inputContract('docx_read_table'),
|
|
341
344
|
outputSchema: docxTableReadOutput,
|
|
342
345
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
@@ -626,6 +629,8 @@ function compactDocxObservation(observation) {
|
|
|
626
629
|
textPreview: children.length === 0 ? identity.textPreview : null,
|
|
627
630
|
...(identity.gridSpan === null ? {} : { gridSpan: identity.gridSpan }),
|
|
628
631
|
...(identity.verticalMerge === null ? {} : { verticalMerge: identity.verticalMerge }),
|
|
632
|
+
...(node.object.verticalMergeOwner === null ? {} : { verticalMergeOwner: node.object.verticalMergeOwner }),
|
|
633
|
+
...(node.object.logicalText === null ? {} : { logicalText: node.object.logicalText }),
|
|
629
634
|
};
|
|
630
635
|
return {
|
|
631
636
|
object,
|
|
@@ -730,6 +735,7 @@ async function docxObservation(tool, args) {
|
|
|
730
735
|
verticalMerge: cell.verticalMerge,
|
|
731
736
|
verticalMergeOwner: cell.verticalMergeOwner,
|
|
732
737
|
text: cell.paragraphs.map(paragraph => paragraph.text).join('\n'),
|
|
738
|
+
logicalText: cell.logicalText,
|
|
733
739
|
})),
|
|
734
740
|
};
|
|
735
741
|
const candidate = [...rows, row];
|