@tiwater/office-mcp 0.17.19 → 0.17.21
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.
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"properties": {
|
|
6
6
|
"changes": {
|
|
7
7
|
"type": "array",
|
|
8
|
+
"description": "Complete resolved table-edit set for one target document. A successful call invalidates every prior target ref, so do not split this set across calls.",
|
|
8
9
|
"minItems": 1,
|
|
9
10
|
"items": {
|
|
10
11
|
"type": "object",
|
|
@@ -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.17.
|
|
5
|
+
"version": "0.17.21"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"name": "docx_copy_table_rows",
|
|
65
65
|
"providerContract": {
|
|
66
66
|
"source": "packages/docx-cli/contracts/mcp-input/docx_copy_table_rows.schema.json",
|
|
67
|
-
"sha256": "
|
|
67
|
+
"sha256": "76cb4ee7a8a4ce3871fbf2773619b337a2aa95622699f08aa92e0448bb76721c"
|
|
68
68
|
},
|
|
69
69
|
"inputContract": {
|
|
70
70
|
"path": "office/contracts/docx_copy_table_rows.schema.json",
|
|
71
|
-
"sha256": "
|
|
71
|
+
"sha256": "76cb4ee7a8a4ce3871fbf2773619b337a2aa95622699f08aa92e0448bb76721c"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
{
|
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: '
|
|
297
|
+
description: 'Apply all resolved row replacements for one target document in one call. changes is the only edit payload; each item names its source document and table rows, target document and table rows, and header-cell mappings. A success invalidates every prior target ref. All source-cell paragraphs copy by default; sourceCellContents selects exact observed content that the target keeps.',
|
|
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
|
|