@tiwater/office-mcp 0.17.11 → 0.17.12
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.
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"x-tiwater-file-role": "read"
|
|
9
9
|
},
|
|
10
10
|
"ref": {
|
|
11
|
-
"description": "One object ref returned by
|
|
11
|
+
"description": "One object ref returned by a current DOCX observation. Read table structure through paragraph descendants first. For exact inline content, use an observed cell or paragraph ref; table-rooted run/text reads are rejected.",
|
|
12
12
|
"type": "string",
|
|
13
13
|
"pattern": "^dox1_[0-9a-f]{64}$"
|
|
14
14
|
},
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"pattern": "^docx-rev-v1-[0-9a-f]{64}$"
|
|
19
19
|
},
|
|
20
20
|
"kinds": {
|
|
21
|
-
"description": "Object kinds required by the next operation. Include paragraph
|
|
21
|
+
"description": "Object kinds required by the next operation. Include paragraph for table content boundaries. Request run or text only when ref identifies a cell or paragraph, never a whole table.",
|
|
22
22
|
"type": "array",
|
|
23
23
|
"items": {
|
|
24
24
|
"type": "string",
|
|
@@ -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.12"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -141,11 +141,11 @@
|
|
|
141
141
|
"name": "docx_read_object",
|
|
142
142
|
"providerContract": {
|
|
143
143
|
"source": "packages/docx-cli/contracts/mcp-input/docx_read_object.schema.json",
|
|
144
|
-
"sha256": "
|
|
144
|
+
"sha256": "1b92b5620f0f76f47b7a9550d79d414f5e0a76cb37a7c4c2615e02e32cf9a02c"
|
|
145
145
|
},
|
|
146
146
|
"inputContract": {
|
|
147
147
|
"path": "office/contracts/docx_read_object.schema.json",
|
|
148
|
-
"sha256": "
|
|
148
|
+
"sha256": "1b92b5620f0f76f47b7a9550d79d414f5e0a76cb37a7c4c2615e02e32cf9a02c"
|
|
149
149
|
}
|
|
150
150
|
},
|
|
151
151
|
{
|
package/office/index.mjs
CHANGED
|
@@ -265,7 +265,7 @@ const tools = [
|
|
|
265
265
|
},
|
|
266
266
|
{
|
|
267
267
|
name: 'docx_read_object',
|
|
268
|
-
description: 'Read one selected native DOCX object and requested descendants.
|
|
268
|
+
description: 'Read one selected native DOCX object and requested descendants. For a table, read row, cell, and paragraph descendants first. To select exact inline content, make a second read rooted at the observed cell or paragraph and request run or text; table-rooted inline reads are rejected so one call cannot return the document-wide character tree.',
|
|
269
269
|
inputSchema: inputContract('docx_read_object'),
|
|
270
270
|
outputSchema: docxReadObjectOutput,
|
|
271
271
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
@@ -538,14 +538,14 @@ function compactDocxObservation(observation) {
|
|
|
538
538
|
if (!observation?.object) throw new Error('docx-read-object-missing-observation');
|
|
539
539
|
function compactNode(node) {
|
|
540
540
|
const identity = compactDocxObjectIdentity(node.object);
|
|
541
|
+
const children = (node.children ?? []).map(compactNode);
|
|
541
542
|
const object = {
|
|
542
543
|
ref: identity.ref,
|
|
543
544
|
kind: identity.kind,
|
|
544
|
-
textPreview: identity.textPreview,
|
|
545
|
+
textPreview: children.length === 0 ? identity.textPreview : null,
|
|
545
546
|
...(identity.gridSpan === null ? {} : { gridSpan: identity.gridSpan }),
|
|
546
547
|
...(identity.verticalMerge === null ? {} : { verticalMerge: identity.verticalMerge }),
|
|
547
548
|
};
|
|
548
|
-
const children = (node.children ?? []).map(compactNode);
|
|
549
549
|
return {
|
|
550
550
|
object,
|
|
551
551
|
...(children.length === 0 ? {} : { children }),
|
|
@@ -602,6 +602,10 @@ async function docxReadObject(args) {
|
|
|
602
602
|
const { output: _output, ...request } = args;
|
|
603
603
|
return withTempJsonFile(request, async requestPath => {
|
|
604
604
|
const result = await runJsonCandidateChain(docxCandidates, ['docx_read_object', requestPath]);
|
|
605
|
+
if (result.json?.observation?.object?.kind === 'table'
|
|
606
|
+
&& args.kinds.some(kind => kind === 'run' || kind === 'text')) {
|
|
607
|
+
throw new Error('docx-table-inline-detail-requires-cell-or-paragraph-root');
|
|
608
|
+
}
|
|
605
609
|
return {
|
|
606
610
|
tool: 'docx_read_object',
|
|
607
611
|
runtime: commandRuntime(result),
|