@documonster/mcp 0.10.0 → 0.11.0
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/README.md +170 -51
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +28 -0
- package/dist/capabilities.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +10 -2
- package/dist/config.js.map +1 -1
- package/dist/tools/diagram-inspect.d.ts +20 -0
- package/dist/tools/diagram-inspect.d.ts.map +1 -0
- package/dist/tools/diagram-inspect.js +91 -0
- package/dist/tools/diagram-inspect.js.map +1 -0
- package/dist/tools/diagram-markdown.d.ts +45 -0
- package/dist/tools/diagram-markdown.d.ts.map +1 -0
- package/dist/tools/diagram-markdown.js +127 -0
- package/dist/tools/diagram-markdown.js.map +1 -0
- package/dist/tools/diagram-render.d.ts +14 -0
- package/dist/tools/diagram-render.d.ts.map +1 -0
- package/dist/tools/diagram-render.js +117 -0
- package/dist/tools/diagram-render.js.map +1 -0
- package/dist/tools/diagram.d.ts +217 -0
- package/dist/tools/diagram.d.ts.map +1 -0
- package/dist/tools/diagram.js +760 -0
- package/dist/tools/diagram.js.map +1 -0
- package/dist/tools/doc-convert.d.ts.map +1 -1
- package/dist/tools/doc-convert.js +26 -4
- package/dist/tools/doc-convert.js.map +1 -1
- package/dist/tools/doc-read.d.ts.map +1 -1
- package/dist/tools/doc-read.js +32 -4
- package/dist/tools/doc-read.js.map +1 -1
- package/dist/tools/doc-write.d.ts.map +1 -1
- package/dist/tools/doc-write.js +21 -3
- package/dist/tools/doc-write.js.map +1 -1
- package/dist/tools/document.d.ts +1 -1
- package/dist/tools/document.d.ts.map +1 -1
- package/dist/tools/document.js +13 -1
- package/dist/tools/document.js.map +1 -1
- package/dist/tools/help.d.ts +263 -15
- package/dist/tools/help.d.ts.map +1 -1
- package/dist/tools/help.js +263 -15
- package/dist/tools/help.js.map +1 -1
- package/dist/tools/image.d.ts +147 -0
- package/dist/tools/image.d.ts.map +1 -0
- package/dist/tools/image.js +749 -0
- package/dist/tools/image.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/inspect.d.ts.map +1 -1
- package/dist/tools/inspect.js +98 -6
- package/dist/tools/inspect.js.map +1 -1
- package/dist/tools/pdf-edit.d.ts +13 -6
- package/dist/tools/pdf-edit.d.ts.map +1 -1
- package/dist/tools/pdf-edit.js +93 -8
- package/dist/tools/pdf-edit.js.map +1 -1
- package/dist/tools/sheet-edit.d.ts.map +1 -1
- package/dist/tools/sheet-edit.js +37 -2
- package/dist/tools/sheet-edit.js.map +1 -1
- package/dist/tools/sheet-image.d.ts +58 -0
- package/dist/tools/sheet-image.d.ts.map +1 -0
- package/dist/tools/sheet-image.js +156 -0
- package/dist/tools/sheet-image.js.map +1 -0
- package/dist/tools/sheet-read.d.ts.map +1 -1
- package/dist/tools/sheet-read.js +18 -1
- package/dist/tools/sheet-read.js.map +1 -1
- package/dist/tools/sheet-write.d.ts.map +1 -1
- package/dist/tools/sheet-write.js +41 -4
- package/dist/tools/sheet-write.js.map +1 -1
- package/dist/tools/template.d.ts +19 -0
- package/dist/tools/template.d.ts.map +1 -1
- package/dist/tools/template.js +436 -11
- package/dist/tools/template.js.map +1 -1
- package/package.json +3 -3
package/dist/tools/template.js
CHANGED
|
@@ -16,11 +16,21 @@
|
|
|
16
16
|
import path from "node:path";
|
|
17
17
|
import { Io, Template } from "documonster/word";
|
|
18
18
|
import { z } from "zod";
|
|
19
|
-
import { toolError } from "../errors.js";
|
|
19
|
+
import { McpToolError, toolError } from "../errors.js";
|
|
20
20
|
import { assertWritable, outputDisplay, resolveInRoot, resolveOutputPath } from "../sandbox.js";
|
|
21
|
+
import { summariseDiagram } from "./diagram.js";
|
|
21
22
|
import { assertReadableSize, writeWithPolicy } from "./fs-helpers.js";
|
|
23
|
+
import { imageSourceShape, newImageBudget, resolveImageSource, toEmu } from "./image.js";
|
|
22
24
|
import { textResult } from "./result.js";
|
|
23
25
|
import { defineTool } from "./types.js";
|
|
26
|
+
/**
|
|
27
|
+
* Widest an image may be inside a template, in points.
|
|
28
|
+
*
|
|
29
|
+
* US Letter less one-inch margins. A template author's page may differ, but Word
|
|
30
|
+
* does not shrink an oversized inline image — it runs it off the paper — so a cap
|
|
31
|
+
* that is occasionally conservative beats one that is occasionally broken.
|
|
32
|
+
*/
|
|
33
|
+
const MAX_TEMPLATE_IMAGE_WIDTH = 468;
|
|
24
34
|
/** Tags listed in one call. */
|
|
25
35
|
const MAX_TAGS = 200;
|
|
26
36
|
export const templateInspectTool = defineTool({
|
|
@@ -52,6 +62,7 @@ export const templateInspectTool = defineTool({
|
|
|
52
62
|
const variables = tags.filter(tag => tag.type === "variable");
|
|
53
63
|
const loops = tags.filter(tag => tag.type === "eachOpen");
|
|
54
64
|
const conditionals = tags.filter(tag => tag.type === "ifOpen");
|
|
65
|
+
const imageTags = tags.filter(tag => tag.type === "image");
|
|
55
66
|
const lines = [
|
|
56
67
|
`# ${args.path} — template placeholders`,
|
|
57
68
|
"",
|
|
@@ -59,6 +70,7 @@ export const templateInspectTool = defineTool({
|
|
|
59
70
|
`- variables: ${variables.length}`,
|
|
60
71
|
`- loops: ${loops.length}`,
|
|
61
72
|
`- conditionals: ${conditionals.length}`,
|
|
73
|
+
...(imageTags.length === 0 ? [] : [`- image placeholders: ${imageTags.length}`]),
|
|
62
74
|
"",
|
|
63
75
|
"| tag | kind | location |",
|
|
64
76
|
"| --- | --- | --- |",
|
|
@@ -73,6 +85,18 @@ export const templateInspectTool = defineTool({
|
|
|
73
85
|
// onto the JSON template_fill wants, so the model can build it in one step.
|
|
74
86
|
lines.push("", "## Data shape", "", "```json", buildShape(tags), "```");
|
|
75
87
|
lines.push("", "Loop variables written `.name` refer to a property of the current item.", "Pass this structure as `data` to template_fill.");
|
|
88
|
+
if (imageTags.length > 0) {
|
|
89
|
+
// These do NOT belong in `data`: a picture cannot travel through JSON, so
|
|
90
|
+
// they take a separate argument naming a file or a diagram. Listing them
|
|
91
|
+
// under the data shape — which is what this tool used to do by omitting
|
|
92
|
+
// them entirely — sends the model to fill them with a string.
|
|
93
|
+
lines.push("", "## Image placeholders", "", ...imageTags.map(tag => {
|
|
94
|
+
const blocker = imageBlocker(tag);
|
|
95
|
+
return blocker === undefined
|
|
96
|
+
? `- \`{{${tag.expression}}}\` → \`images.${imageKey(tag)}\` (${tag.location})`
|
|
97
|
+
: `- \`{{${tag.expression}}}\` (${tag.location}) — **cannot be filled**: ${blocker}.`;
|
|
98
|
+
}), "", "Pass the fillable ones in `images`, **not** in `data` — a picture cannot go through", 'JSON. Each takes a file (`from: "logo.png"`) or a Mermaid diagram', '(`source: "flowchart LR…"`), e.g. `images: { logo: { from: "logo.png" } }`.');
|
|
99
|
+
}
|
|
76
100
|
return textResult(config, lines.join("\n"));
|
|
77
101
|
}
|
|
78
102
|
});
|
|
@@ -80,7 +104,7 @@ export const templateFillTool = defineTool({
|
|
|
80
104
|
name: "template_fill",
|
|
81
105
|
group: "word",
|
|
82
106
|
title: "Fill a Word template",
|
|
83
|
-
description: "Fill a .docx template's placeholders from JSON and save the result. Supports variables with dotted paths, {{#each}} loops (including table rows)
|
|
107
|
+
description: "Fill a .docx template's placeholders from JSON and save the result. Supports variables with dotted paths, {{#each}} loops (including table rows), {{#if}} conditionals, and {{%name}} image placeholders filled from the `images` argument (a file or a Mermaid diagram). Call template_inspect first to learn the exact field names. The template's own styling is preserved — you supply only data.",
|
|
84
108
|
inputSchema: {
|
|
85
109
|
template: z.string().min(1).describe("Template path (.docx), relative to the server root."),
|
|
86
110
|
out: z
|
|
@@ -90,6 +114,10 @@ export const templateFillTool = defineTool({
|
|
|
90
114
|
data: z
|
|
91
115
|
.record(z.string(), z.unknown())
|
|
92
116
|
.describe('Values keyed by placeholder name, e.g. { "client": { "name": "Acme" }, "items": [{ "name": "X", "amount": 10 }], "overdue": true }.'),
|
|
117
|
+
images: z
|
|
118
|
+
.record(z.string(), z.object(imageSourceShape))
|
|
119
|
+
.optional()
|
|
120
|
+
.describe('Pictures for the template\'s `{{%name}}` placeholders, keyed without the %. Each takes a .png/.jpg/.gif file or a Mermaid diagram, e.g. { "logo": { "from": "logo.png" }, "flow": { "source": "flowchart LR\\n A --> B" } }. Images go here rather than in `data` because a picture cannot travel through JSON.'),
|
|
93
121
|
allowMissing: z
|
|
94
122
|
.boolean()
|
|
95
123
|
.optional()
|
|
@@ -115,34 +143,68 @@ export const templateFillTool = defineTool({
|
|
|
115
143
|
if (path.extname(args.out).toLowerCase() !== ".docx") {
|
|
116
144
|
throw toolError.invalidInput(`template_fill writes .docx, not ${JSON.stringify(path.extname(args.out))}`, "Fill to a .docx, then use doc_convert if you need a PDF.");
|
|
117
145
|
}
|
|
118
|
-
// Read fresh:
|
|
119
|
-
//
|
|
146
|
+
// Read fresh: a fill may mutate the document in place, so a cached or reused
|
|
147
|
+
// instance would be filled twice.
|
|
120
148
|
const doc = await readTemplate(templatePath, args.template);
|
|
121
149
|
const before = Template.listTemplateTags(doc);
|
|
122
150
|
if (before.length === 0) {
|
|
123
151
|
throw toolError.invalidInput(`${args.template} contains no placeholders`, "Run template_inspect to confirm; this may not be a template at all.");
|
|
124
152
|
}
|
|
153
|
+
// Resolved before the fill, so an unreadable picture fails without having
|
|
154
|
+
// half-filled the document. Names are checked against the template's own tags,
|
|
155
|
+
// and the media names against what the template already carries.
|
|
156
|
+
const images = await resolveTemplateImages(config, args.images);
|
|
157
|
+
assertImagePlaceholdersExist(before, [...images.keys()]);
|
|
158
|
+
const media = assignMediaNames(images, doc);
|
|
159
|
+
// Merged *before* the try, so a name collision is reported as itself rather
|
|
160
|
+
// than being caught below and re-labelled "filling the template failed" with
|
|
161
|
+
// the wrong hint attached.
|
|
162
|
+
const templateData = mergeTemplateData(args.data, images, media);
|
|
163
|
+
// Typed explicitly: a bare `let` is implicitly `any`, which would silently
|
|
164
|
+
// erase the tag types read off the result below.
|
|
165
|
+
let filled;
|
|
125
166
|
try {
|
|
126
167
|
// strict is the engine's default and the right one here: it names the
|
|
127
168
|
// first unresolved placeholder and produces no file, rather than saving a
|
|
128
169
|
// document with a blank where a client's name should be.
|
|
129
|
-
|
|
170
|
+
//
|
|
171
|
+
// `fillTemplateEnhanced` rather than `fillTemplate`: it is the same engine
|
|
172
|
+
// plus a pass that understands `{{%image}}`, so this is a superset of the
|
|
173
|
+
// previous behaviour. With the basic fill an image placeholder could only
|
|
174
|
+
// ever end up unresolved, which is why the tool could not fill one at all.
|
|
175
|
+
//
|
|
176
|
+
// **Use the return value.** Unlike `fillTemplate`, the enhanced form is not
|
|
177
|
+
// in-place: substituting an image replaces the whole paragraph, so it builds
|
|
178
|
+
// a new body and deliberately leaves the caller's document untouched — it
|
|
179
|
+
// even clones the headers to stop edits leaking back. Ignoring the result
|
|
180
|
+
// writes the *unfilled* template out, and because the fill itself succeeded
|
|
181
|
+
// nothing reports a failure.
|
|
182
|
+
filled = Template.fillTemplateEnhanced(doc, templateData, {
|
|
183
|
+
strict: args.allowMissing !== true
|
|
184
|
+
});
|
|
130
185
|
}
|
|
131
186
|
catch (cause) {
|
|
132
187
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
133
|
-
throw toolError.invalidInput(`filling the template failed: ${message}`,
|
|
134
|
-
? "The message names the placeholder that had no data. Add it to `data` — template_inspect lists every field the template needs — or pass allowMissing: true if it is genuinely optional. No file was written."
|
|
135
|
-
: "Check that every loop name in the template maps to an array in `data`. No file was written.", { cause });
|
|
188
|
+
throw toolError.invalidInput(`filling the template failed: ${message}`, unresolvedHint(message, before), { cause });
|
|
136
189
|
}
|
|
137
|
-
|
|
138
|
-
|
|
190
|
+
// Prune before writing: the engine registers a picture's bytes when it
|
|
191
|
+
// substitutes the placeholder, and a paragraph removed afterwards by a false
|
|
192
|
+
// {{#if}} leaves those bytes in the package with nothing pointing at them.
|
|
193
|
+
const dropped = pruneUnreferencedMedia(filled, media);
|
|
194
|
+
await writeWithPolicy(target, args.overwrite === true, temporary => Io.writeFile(filled, temporary));
|
|
195
|
+
// Verified against the file on disk, not against the in-memory document the
|
|
196
|
+
// writer was handed: a media part that failed to serialise, or a run pointing
|
|
197
|
+
// at a relationship that does not exist, is invisible until it is read back.
|
|
198
|
+
const verified = await verifyWrittenImages(target, media);
|
|
199
|
+
const remaining = Template.listTemplateTags(filled);
|
|
139
200
|
const lines = [
|
|
140
201
|
`Filled **${args.template}** → **${outputDisplay(args.out)}**`,
|
|
141
202
|
`- placeholders in template: ${before.length}`,
|
|
142
203
|
`- placeholders remaining: ${remaining.length}`,
|
|
143
204
|
...(args.allowMissing === true
|
|
144
205
|
? ["- `allowMissing` was set, so any field absent from `data` rendered as empty"]
|
|
145
|
-
: [])
|
|
206
|
+
: []),
|
|
207
|
+
...describeFilledImages(images, media, dropped, verified)
|
|
146
208
|
];
|
|
147
209
|
if (remaining.length > 0) {
|
|
148
210
|
// Left-over tags mean a key was missing — the document still saved, but
|
|
@@ -156,6 +218,369 @@ export const templateFillTool = defineTool({
|
|
|
156
218
|
return textResult(config, lines.join("\n"));
|
|
157
219
|
}
|
|
158
220
|
});
|
|
221
|
+
/**
|
|
222
|
+
* Read every image the caller supplied, keyed by its placeholder name.
|
|
223
|
+
*
|
|
224
|
+
* @throws {McpToolError} from `resolveImageSource` for a missing file, an
|
|
225
|
+
* unsupported extension or a header that will not parse.
|
|
226
|
+
*/
|
|
227
|
+
async function resolveTemplateImages(config, images) {
|
|
228
|
+
const resolved = new Map();
|
|
229
|
+
const budget = newImageBudget();
|
|
230
|
+
for (const [name, spec] of Object.entries(images ?? {})) {
|
|
231
|
+
resolved.set(name, await resolveImageSource(config, spec, {
|
|
232
|
+
maxWidthPoints: MAX_TEMPLATE_IMAGE_WIDTH,
|
|
233
|
+
budget
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
return resolved;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Advice for a failed fill, chosen by *what kind* of placeholder was unresolved.
|
|
240
|
+
*
|
|
241
|
+
* The generic "add it to `data`" is actively wrong for an image tag — the caller may
|
|
242
|
+
* have already put it in `images` and be told to move it to the one place it cannot
|
|
243
|
+
* go. For a placeholder the engine cannot reach at all it is wrong twice, because no
|
|
244
|
+
* argument fills that one. An error that sends the model somewhere useless costs a
|
|
245
|
+
* retry loop, so the branch is worth having.
|
|
246
|
+
*/
|
|
247
|
+
function unresolvedHint(message, tags) {
|
|
248
|
+
if (!/unresolved/i.test(message)) {
|
|
249
|
+
return "Check that every loop name in the template maps to an array in `data`. No file was written.";
|
|
250
|
+
}
|
|
251
|
+
const named = tags.find(tag => tag.type === "image" && message.includes(`{{${tag.expression}}}`));
|
|
252
|
+
if (named !== undefined) {
|
|
253
|
+
const blocker = imageBlocker(named);
|
|
254
|
+
return blocker === undefined
|
|
255
|
+
? `\`{{${named.expression}}}\` is an **image** placeholder — pass it in \`images\` (keyed \`${imageKey(named)}\`, without the %), not in \`data\`. A picture cannot travel through JSON. No file was written.`
|
|
256
|
+
: `\`{{${named.expression}}}\` is an image placeholder that nothing can fill: ${blocker}. It needs moving to a paragraph of its own in the document body. No file was written.`;
|
|
257
|
+
}
|
|
258
|
+
return "The message names the placeholder that had no data. Add it to `data` — template_inspect lists every field the template needs — or pass allowMissing: true if it is genuinely optional. No file was written.";
|
|
259
|
+
}
|
|
260
|
+
/** An image tag's `images` key — the expression without its `%` marker. */
|
|
261
|
+
function imageKey(tag) {
|
|
262
|
+
return tag.expression.replace(/^%/, "");
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Why an image placeholder cannot be filled, or `undefined` when it can.
|
|
266
|
+
*
|
|
267
|
+
* One case is left, and it is architectural rather than an omission: the engine
|
|
268
|
+
* substitutes images in a pass that runs *before* loops are expanded, so a
|
|
269
|
+
* `{{%.photo}}` inside a `{{#each}}` has no current item to read from. One picture
|
|
270
|
+
* per row would need the substitution to happen during expansion, which is a
|
|
271
|
+
* different arrangement of the two passes rather than a missing branch.
|
|
272
|
+
*
|
|
273
|
+
* Table cells and headers/footers used to be here too. Both were fixed in the engine
|
|
274
|
+
* instead — a logo in a header or a letterhead table is what a template author
|
|
275
|
+
* reaches for first, and refusing the commonest layouts was the wrong answer to
|
|
276
|
+
* "the pass does not go there".
|
|
277
|
+
*/
|
|
278
|
+
function imageBlocker(tag) {
|
|
279
|
+
if (imageKey(tag).startsWith(".")) {
|
|
280
|
+
return "it is scoped to a {{#each}} item, and images are substituted before loops are expanded — one picture per row is not expressible";
|
|
281
|
+
}
|
|
282
|
+
return undefined;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Refuse an `images` key the template cannot use, naming which and why.
|
|
286
|
+
*
|
|
287
|
+
* Two kinds of mistake, and silence would be expensive for both. A **misspelled
|
|
288
|
+
* key** leaves the document saved and looking fine with the picture simply absent
|
|
289
|
+
* behind a plausible success message, so the error lists the placeholders that do
|
|
290
|
+
* exist. An **unfillable placeholder** is worse, because the caller did everything
|
|
291
|
+
* right and the limitation is the engine's: without this the failure arrives two
|
|
292
|
+
* passes deeper as "Unresolved variable", advising the model to move the image into
|
|
293
|
+
* `data` — the one place it can never go.
|
|
294
|
+
*/
|
|
295
|
+
export function assertImagePlaceholdersExist(tags, imageKeys) {
|
|
296
|
+
if (imageKeys.length === 0) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const imageTags = tags.filter(tag => tag.type === "image");
|
|
300
|
+
const available = imageTags.map(imageKey);
|
|
301
|
+
const unknown = imageKeys.filter(name => !available.includes(name));
|
|
302
|
+
if (unknown.length > 0) {
|
|
303
|
+
throw toolError.invalidInput(`the template has no image placeholder for ${unknown.map(name => JSON.stringify(name)).join(", ")}`, available.length === 0
|
|
304
|
+
? "This template contains no `{{%name}}` image placeholder at all. Run template_inspect to see what it does have; an ordinary `{{name}}` cannot hold a picture."
|
|
305
|
+
: `Available image placeholders: ${available.map(name => `{{%${name}}}`).join(", ")}. Key \`images\` without the %.`);
|
|
306
|
+
}
|
|
307
|
+
const blocked = imageTags
|
|
308
|
+
.filter(tag => imageKeys.includes(imageKey(tag)))
|
|
309
|
+
.map(tag => ({ tag, reason: imageBlocker(tag) }))
|
|
310
|
+
.filter((entry) => entry.reason !== undefined);
|
|
311
|
+
if (blocked.length > 0) {
|
|
312
|
+
throw toolError.unsupported(`image placeholder(s) ${blocked.map(entry => `{{${entry.tag.expression}}}`).join(", ")} cannot be filled`, `${blocked
|
|
313
|
+
.map(entry => `{{${entry.tag.expression}}} (${entry.tag.location}): ${entry.reason}`)
|
|
314
|
+
.join(". ")}. Move the placeholder to a paragraph of its own in the document body, or have the template author place the picture directly — it does not need to be a placeholder to be there. No file was written.`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Give every supplied picture a media name nothing else in the package uses.
|
|
319
|
+
*
|
|
320
|
+
* Derived from the placeholder key, which is unique by construction, rather than
|
|
321
|
+
* from the source file or the diagram kind, which are not.
|
|
322
|
+
*/
|
|
323
|
+
function assignMediaNames(images, template) {
|
|
324
|
+
const takenFiles = new Set((template.images ?? []).map(entry => entry.fileName));
|
|
325
|
+
const takenIds = new Set((template.images ?? []).map(entry => entry.rId).filter((id) => id !== undefined));
|
|
326
|
+
const assigned = new Map();
|
|
327
|
+
for (const [name, image] of images) {
|
|
328
|
+
const stem = `mcpimg-${name.replace(/[^A-Za-z0-9._-]+/g, "_")}`;
|
|
329
|
+
const fileName = firstFree(`${stem}.${image.mediaType}`, candidate => takenFiles.has(candidate));
|
|
330
|
+
takenFiles.add(fileName);
|
|
331
|
+
const rId = firstFree(`rId_${stem}`, candidate => takenIds.has(candidate));
|
|
332
|
+
takenIds.add(rId);
|
|
333
|
+
assigned.set(name, { fileName, rId });
|
|
334
|
+
}
|
|
335
|
+
return assigned;
|
|
336
|
+
}
|
|
337
|
+
/** `name`, or `name-2`, `name-3`… until one is free. */
|
|
338
|
+
function firstFree(preferred, taken) {
|
|
339
|
+
if (!taken(preferred)) {
|
|
340
|
+
return preferred;
|
|
341
|
+
}
|
|
342
|
+
const dot = preferred.lastIndexOf(".");
|
|
343
|
+
const stem = dot === -1 ? preferred : preferred.slice(0, dot);
|
|
344
|
+
const extension = dot === -1 ? "" : preferred.slice(dot);
|
|
345
|
+
for (let index = 2; index < 1000; index += 1) {
|
|
346
|
+
const candidate = `${stem}-${index}${extension}`;
|
|
347
|
+
if (!taken(candidate)) {
|
|
348
|
+
return candidate;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
throw toolError.invalidInput(`could not find a free media name for ${preferred}`);
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Merge the pictures into the template data without colliding with it.
|
|
355
|
+
*
|
|
356
|
+
* The engine reads an image from the same namespace as everything else — `{{%logo}}`
|
|
357
|
+
* looks up `logo` — so the values have to be merged in. Two consequences, both of
|
|
358
|
+
* which were wrong before:
|
|
359
|
+
*
|
|
360
|
+
* 1. **A dotted key is a path, not a name.** `{{%client.logo}}` resolves `client`
|
|
361
|
+
* then `logo`, so a flat `data["client.logo"]` is never found. The value is
|
|
362
|
+
* assigned down the path instead.
|
|
363
|
+
* 2. **A collision must be refused, not silently won.** With `{{logo}}` and
|
|
364
|
+
* `{{%logo}}` in one template, a flat spread overwrote the text value with the
|
|
365
|
+
* image object — and the plain placeholder rendered the whole `TemplateImage` as
|
|
366
|
+
* JSON, pixel bytes included, into the document. Nine hundred characters of
|
|
367
|
+
* `{"0":137,"1":80,…}` where a client's name belonged.
|
|
368
|
+
*/
|
|
369
|
+
function mergeTemplateData(data, images, media) {
|
|
370
|
+
// Cloned so the caller's arguments are never mutated; the fill is retried by
|
|
371
|
+
// nothing today, but a mutated `data` would be a trap for whoever adds a retry.
|
|
372
|
+
const merged = structuredCloneSafe(data);
|
|
373
|
+
for (const [name, value] of imageValues(images, media)) {
|
|
374
|
+
const existing = readPath(merged, name);
|
|
375
|
+
if (existing !== undefined) {
|
|
376
|
+
throw toolError.invalidInput(`\`images.${name}\` collides with \`data.${name}\``, `The template engine reads images from the same namespace as text, so one name cannot be both. Remove ${JSON.stringify(name)} from \`data\`, or rename the image placeholder. No file was written.`);
|
|
377
|
+
}
|
|
378
|
+
assignPath(merged, name, value);
|
|
379
|
+
}
|
|
380
|
+
return merged;
|
|
381
|
+
}
|
|
382
|
+
/** The `TemplateImage` values, keyed by placeholder path. */
|
|
383
|
+
function imageValues(images, media) {
|
|
384
|
+
const values = new Map();
|
|
385
|
+
for (const [name, entry] of media) {
|
|
386
|
+
const image = images.get(name);
|
|
387
|
+
if (image === undefined) {
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
values.set(name, {
|
|
391
|
+
image: {
|
|
392
|
+
data: image.bytes,
|
|
393
|
+
mediaType: image.mediaType,
|
|
394
|
+
fileName: entry.fileName,
|
|
395
|
+
rId: entry.rId
|
|
396
|
+
},
|
|
397
|
+
// EMU, which is the only unit the engine accepts here.
|
|
398
|
+
width: toEmu(image.width),
|
|
399
|
+
height: toEmu(image.height),
|
|
400
|
+
altText: image.altText
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
return values;
|
|
404
|
+
}
|
|
405
|
+
/** Read a dotted path, or `undefined` when any step is absent. */
|
|
406
|
+
function readPath(target, dotted) {
|
|
407
|
+
let cursor = target;
|
|
408
|
+
for (const part of dotted.split(".").filter(step => step.length > 0)) {
|
|
409
|
+
if (typeof cursor !== "object" || cursor === null) {
|
|
410
|
+
return undefined;
|
|
411
|
+
}
|
|
412
|
+
cursor = cursor[part];
|
|
413
|
+
}
|
|
414
|
+
return cursor;
|
|
415
|
+
}
|
|
416
|
+
/** A shallow-safe clone of the caller's data, preserving arrays and plain objects. */
|
|
417
|
+
function structuredCloneSafe(data) {
|
|
418
|
+
const clone = {};
|
|
419
|
+
for (const [key, value] of Object.entries(data)) {
|
|
420
|
+
clone[key] =
|
|
421
|
+
typeof value === "object" && value !== null && !Array.isArray(value)
|
|
422
|
+
? structuredCloneSafe(value)
|
|
423
|
+
: value;
|
|
424
|
+
}
|
|
425
|
+
return clone;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Remove media the finished document does not reference, and say which.
|
|
429
|
+
*
|
|
430
|
+
* Images are substituted *before* conditionals are evaluated, so a `{{%logo}}`
|
|
431
|
+
* inside a `{{#if}}` that turns out false is registered and then removed along with
|
|
432
|
+
* its paragraph. Reporting that is not enough: the bytes stay in the package, and
|
|
433
|
+
* anyone who unzips the `.docx` can recover a picture the document was supposed to
|
|
434
|
+
* withhold. For a signature or an ID photo behind a conditional that is a data leak,
|
|
435
|
+
* not file bloat — so the part is dropped rather than merely mentioned.
|
|
436
|
+
*
|
|
437
|
+
* Only pictures this tool added are considered. The template author's own media may
|
|
438
|
+
* be referenced from parts this walk does not cover, and deleting one because it was
|
|
439
|
+
* not found would be a far worse bug than leaving it.
|
|
440
|
+
*/
|
|
441
|
+
function pruneUnreferencedMedia(filled, media) {
|
|
442
|
+
const referenced = collectDocumentImageRefs(filled);
|
|
443
|
+
const dropped = [];
|
|
444
|
+
const ours = new Set();
|
|
445
|
+
for (const [name, entry] of media) {
|
|
446
|
+
if (!referenced.has(entry.rId)) {
|
|
447
|
+
dropped.push(name);
|
|
448
|
+
ours.add(entry.rId);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
if (ours.size > 0) {
|
|
452
|
+
// Reassigned rather than mutated in place: `images` is a readonly array on the
|
|
453
|
+
// document type, and the writer reads whatever is on the object.
|
|
454
|
+
filled.images = (filled.images ?? []).filter(entry => entry.rId === undefined || !ours.has(entry.rId));
|
|
455
|
+
}
|
|
456
|
+
return dropped;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Every inline-image relationship the whole document references.
|
|
460
|
+
*
|
|
461
|
+
* Not just the body. Once the engine learned to substitute images in headers and
|
|
462
|
+
* footers, a body-only walk reported a header logo as unreferenced — and the pruning
|
|
463
|
+
* below then deleted the picture it had just correctly placed. A check that only
|
|
464
|
+
* looks where it used to be correct is worse than no check, because it destroys
|
|
465
|
+
* output while reporting a problem that does not exist.
|
|
466
|
+
*/
|
|
467
|
+
function collectDocumentImageRefs(doc) {
|
|
468
|
+
const referenced = new Set();
|
|
469
|
+
collectImageRefs(doc.body, referenced);
|
|
470
|
+
for (const part of [...(doc.headers?.values() ?? []), ...(doc.footers?.values() ?? [])]) {
|
|
471
|
+
collectImageRefs(part.content.children, referenced);
|
|
472
|
+
}
|
|
473
|
+
for (const note of [...(doc.footnotes ?? []), ...(doc.endnotes ?? [])]) {
|
|
474
|
+
collectImageRefs(note.content, referenced);
|
|
475
|
+
}
|
|
476
|
+
return referenced;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Every media file name the whole document references.
|
|
480
|
+
*
|
|
481
|
+
* Names rather than relationship ids, because a relationship is **per part**: an
|
|
482
|
+
* image referenced from a header has an rId in that header's own space, so `rId5` in
|
|
483
|
+
* `word/_rels/document.xml.rels` and `rId_x` in `word/_rels/header1.xml.rels` are
|
|
484
|
+
* unrelated numbers that happen to look comparable. Matching them across parts
|
|
485
|
+
* reported a correctly placed header logo as unverifiable. The engine writes each
|
|
486
|
+
* image run's `name` as its media file name, and those *are* global.
|
|
487
|
+
*/
|
|
488
|
+
function collectDocumentImageNames(doc) {
|
|
489
|
+
const names = new Set();
|
|
490
|
+
const walk = (blocks) => collectImageRefs(blocks, names, "name");
|
|
491
|
+
walk(doc.body);
|
|
492
|
+
for (const part of [...(doc.headers?.values() ?? []), ...(doc.footers?.values() ?? [])]) {
|
|
493
|
+
walk(part.content.children);
|
|
494
|
+
}
|
|
495
|
+
for (const note of [...(doc.footnotes ?? []), ...(doc.endnotes ?? [])]) {
|
|
496
|
+
walk(note.content);
|
|
497
|
+
}
|
|
498
|
+
return names;
|
|
499
|
+
}
|
|
500
|
+
/** Gather every inline-image relationship id, or file name, reachable in a block list. */
|
|
501
|
+
function collectImageRefs(blocks, into, key = "rId") {
|
|
502
|
+
for (const block of blocks) {
|
|
503
|
+
if (block.type === "table") {
|
|
504
|
+
for (const row of block.rows) {
|
|
505
|
+
for (const cell of row.cells) {
|
|
506
|
+
// A cell holds paragraphs and further tables, so the walk recurses.
|
|
507
|
+
collectImageRefs(cell.content, into, key);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
if (!("children" in block)) {
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
for (const run of block.children) {
|
|
516
|
+
if (!("content" in run)) {
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
for (const entry of run.content) {
|
|
520
|
+
if (entry.type === "image") {
|
|
521
|
+
const value = key === "rId" ? entry.rId : entry.name;
|
|
522
|
+
if (value !== undefined) {
|
|
523
|
+
into.add(value);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Re-open the written file and confirm each picture really arrived.
|
|
532
|
+
*
|
|
533
|
+
* The in-memory document is what the writer was *handed*, not what it produced. A
|
|
534
|
+
* relationship that failed to serialise, or a run pointing at a part that is not
|
|
535
|
+
* there, looks perfect from the document object and is broken in the file — and the
|
|
536
|
+
* file is the only artefact anyone else will open. Since nothing downstream can look
|
|
537
|
+
* at a picture, this is the last place a false claim can be caught.
|
|
538
|
+
*
|
|
539
|
+
* @returns The placeholder names whose picture is present and resolvable on disk.
|
|
540
|
+
*/
|
|
541
|
+
async function verifyWrittenImages(target, media) {
|
|
542
|
+
if (media.size === 0) {
|
|
543
|
+
return new Set();
|
|
544
|
+
}
|
|
545
|
+
const reopened = await Io.readFile(target).catch((cause) => {
|
|
546
|
+
throw new McpToolError("internal", `the document was written but could not be re-opened for verification: ${cause instanceof Error ? cause.message : String(cause)}`, {
|
|
547
|
+
hint: "The file exists but may be malformed. Read it with doc_read before relying on it.",
|
|
548
|
+
cause
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
// Re-reading renumbers relationships, so a picture is matched by its media file
|
|
552
|
+
// name — which `assignMediaNames` made unique for exactly this purpose.
|
|
553
|
+
const byFileName = new Map((reopened.images ?? []).map(entry => [entry.fileName, entry]));
|
|
554
|
+
const referenced = collectDocumentImageNames(reopened);
|
|
555
|
+
const present = new Set();
|
|
556
|
+
for (const [name, entry] of media) {
|
|
557
|
+
const definition = byFileName.get(entry.fileName);
|
|
558
|
+
// Both halves are needed: bytes in the package that nothing points at are dead
|
|
559
|
+
// weight, and a run pointing at a part that is not there is a broken picture.
|
|
560
|
+
if (definition !== undefined && definition.data.length > 0 && referenced.has(entry.fileName)) {
|
|
561
|
+
present.add(name);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
return present;
|
|
565
|
+
}
|
|
566
|
+
/** Report each picture: where it came from, and whether it is really in the file. */
|
|
567
|
+
function describeFilledImages(images, media, dropped, verified) {
|
|
568
|
+
const lines = [...images].map(([name, image]) => {
|
|
569
|
+
const drawn = image.diagram === undefined ? "" : ` — ${summariseDiagram(image.diagram)}`;
|
|
570
|
+
const size = `${Math.round(image.width)}×${Math.round(image.height)} pt`;
|
|
571
|
+
if (dropped.includes(name)) {
|
|
572
|
+
return `- \`{{%${name}}}\` ← ${image.origin} — **not in the output**: its paragraph was removed, most likely by a {{#if}} whose condition was false. Its bytes were dropped from the package too, so nothing is recoverable from the file.`;
|
|
573
|
+
}
|
|
574
|
+
const state = verified.has(name)
|
|
575
|
+
? ""
|
|
576
|
+
: " — **could not be verified in the written file**; read it with doc_read before relying on it";
|
|
577
|
+
return `- \`{{%${name}}}\` ← ${image.origin} (${size}, \`${media.get(name)?.fileName ?? "?"}\`)${drawn}${state}`;
|
|
578
|
+
});
|
|
579
|
+
if (dropped.length > 0) {
|
|
580
|
+
lines.push(`- **${dropped.length} supplied picture(s) are not in the document.** Images are substituted before conditionals are evaluated, so one inside a false {{#if}} is dropped with its block. Do not report it as added.`);
|
|
581
|
+
}
|
|
582
|
+
return lines;
|
|
583
|
+
}
|
|
159
584
|
/** Build an example JSON shape from the tag list. */
|
|
160
585
|
function buildShape(tags) {
|
|
161
586
|
const shape = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/tools/template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,+BAA+B;AAC/B,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;IAC5C,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,qCAAqC;IAC5C,WAAW,EACT,2NAA2N;IAC7N,WAAW,EAAE;QACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qDAAqD,CAAC;KACxF;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;IACzD,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;QAC/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAC3B,MAAM,QAAQ,GAAG,MAA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,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjF,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACnB,CAAC;QACD,MAAM,GAAG,MAAM,CAAC,GAAG,CAA4B,CAAC;IAClD,CAAC;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACrD,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IACvB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,QAAgB,EAAE,WAAmB;IAC/D,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC1D,MAAM,SAAS,CAAC,WAAW,CACzB,kBAAkB,WAAW,qBAAqB,EAClD,uEAAuE,EACvE,EAAE,KAAK,EAAE,CACV,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@documonster/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Model Context Protocol server for documonster — lets AI assistants read, write and convert Excel, Word, PDF, CSV and ZIP documents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
52
52
|
"zod": "^4.4.3",
|
|
53
|
-
"documonster": "0.
|
|
53
|
+
"documonster": "0.11.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "^26.2.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"vitest": "^4.1.10"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
|
-
"node": ">=22.
|
|
62
|
+
"node": ">=22.13.0"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "rimraf dist && tsc --project tsconfig.build.json",
|