layoutbridge-light 0.0.0-stage → 1.0.1

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.
Files changed (92) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/LICENSE +26 -0
  3. package/README.de.md +367 -0
  4. package/README.md +353 -2
  5. package/THIRD-PARTY-NOTICES.md +2878 -0
  6. package/dist/src/mcp/catalog.js +131 -0
  7. package/dist/src/mcp/config.js +211 -0
  8. package/dist/src/mcp/content-credentials.js +65 -0
  9. package/dist/src/mcp/dispatch.js +171 -0
  10. package/dist/src/mcp/epub-check.js +331 -0
  11. package/dist/src/mcp/epub-orientation.js +132 -0
  12. package/dist/src/mcp/license/free-tools.js +16 -0
  13. package/dist/src/mcp/license/gate.js +210 -0
  14. package/dist/src/mcp/license/index.js +107 -0
  15. package/dist/src/mcp/license/instance-name.js +57 -0
  16. package/dist/src/mcp/license/key-source.js +59 -0
  17. package/dist/src/mcp/license/lemonsqueezy-verifier.js +207 -0
  18. package/dist/src/mcp/license/placeholder-verifier.js +10 -0
  19. package/dist/src/mcp/license/polar-ids.js +100 -0
  20. package/dist/src/mcp/license/polar-verifier.js +285 -0
  21. package/dist/src/mcp/license/product-ids.js +73 -0
  22. package/dist/src/mcp/license/state-store.js +91 -0
  23. package/dist/src/mcp/license/types.js +11 -0
  24. package/dist/src/mcp/logging.js +271 -0
  25. package/dist/src/mcp/pdf-postprocess.js +798 -0
  26. package/dist/src/mcp/product-info.js +54 -0
  27. package/dist/src/mcp/product.js +56 -0
  28. package/dist/src/mcp/server.js +253 -0
  29. package/dist/src/mcp/setup.js +680 -0
  30. package/dist/src/mcp/start.cjs +117 -0
  31. package/dist/src/mcp/target-folder.js +25 -0
  32. package/dist/src/mcp/tool-definition.js +2 -0
  33. package/dist/src/mcp/tools.js +2680 -0
  34. package/dist/src/mcp/typography-rules.js +70 -0
  35. package/dist/src/transport/com.js +436 -0
  36. package/dist/src/transport/osascript.js +171 -0
  37. package/dist/src/transport/queue.js +19 -0
  38. package/dist/src/transport/script-bundle.js +92 -0
  39. package/dist/src/transport/transport.js +52 -0
  40. package/indesign/commands/10-app.js +6 -0
  41. package/indesign/commands/20-documents.js +517 -0
  42. package/indesign/commands/22-document-setup.js +204 -0
  43. package/indesign/commands/23-save-package.js +258 -0
  44. package/indesign/commands/25-export.js +695 -0
  45. package/indesign/commands/26-export-image.js +202 -0
  46. package/indesign/commands/27-textdefaults.js +151 -0
  47. package/indesign/commands/28-selection.js +174 -0
  48. package/indesign/commands/30-pages.js +1032 -0
  49. package/indesign/commands/31-view.js +310 -0
  50. package/indesign/commands/32-sections.js +203 -0
  51. package/indesign/commands/35-parents.js +448 -0
  52. package/indesign/commands/37-layout.js +837 -0
  53. package/indesign/commands/40-frames.js +886 -0
  54. package/indesign/commands/41-shapes.js +505 -0
  55. package/indesign/commands/42-groups.js +117 -0
  56. package/indesign/commands/43-layers.js +310 -0
  57. package/indesign/commands/44-effects.js +274 -0
  58. package/indesign/commands/45-frame-options.js +247 -0
  59. package/indesign/commands/47-anchored.js +473 -0
  60. package/indesign/commands/50-modify.js +803 -0
  61. package/indesign/commands/52-align.js +139 -0
  62. package/indesign/commands/55-fit.js +106 -0
  63. package/indesign/commands/60-images.js +1154 -0
  64. package/indesign/commands/62-embed.js +120 -0
  65. package/indesign/commands/69-placeholders.js +132 -0
  66. package/indesign/commands/70-text.js +710 -0
  67. package/indesign/commands/71-outlines.js +92 -0
  68. package/indesign/commands/72-place-text.js +476 -0
  69. package/indesign/commands/73-story-lock.js +157 -0
  70. package/indesign/commands/74-stories.js +121 -0
  71. package/indesign/commands/75-tables.js +702 -0
  72. package/indesign/commands/76-text-variables.js +260 -0
  73. package/indesign/commands/77-story-options.js +86 -0
  74. package/indesign/commands/78-frame-lines.js +511 -0
  75. package/indesign/commands/79-check-typography.js +480 -0
  76. package/indesign/commands/80-styles.js +1960 -0
  77. package/indesign/commands/81-composition.js +355 -0
  78. package/indesign/commands/82-object-styles.js +263 -0
  79. package/indesign/commands/83-drop-caps.js +87 -0
  80. package/indesign/commands/83-indents-tabs.js +264 -0
  81. package/indesign/commands/84-import-styles.js +142 -0
  82. package/indesign/commands/85-swatches.js +112 -0
  83. package/indesign/commands/86-gradients.js +185 -0
  84. package/indesign/commands/87-replace-swatch.js +180 -0
  85. package/indesign/commands/88-replace-font.js +212 -0
  86. package/indesign/commands/89-toc-index.js +1002 -0
  87. package/indesign/commands/90-print-on-demand.js +495 -0
  88. package/indesign/commands/91-epub.js +629 -0
  89. package/indesign/commands/92-accessibility.js +1131 -0
  90. package/indesign/interpreter.js +829 -0
  91. package/package.json +41 -4
  92. package/rules/typography-rules.json +32 -0
package/README.md CHANGED
@@ -1,3 +1,354 @@
1
- # Temporary Holding Version
1
+ # LayoutBridge Light for Adobe InDesign®
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Deutsche Fassung: [README.de.md](README.de.md)
4
+
5
+ **LayoutBridge Light for Adobe InDesign®** – MCP server for book typesetting
6
+ in Adobe® InDesign® (npm package `layoutbridge-light`) by MCP Interfaces. It
7
+ provides the tools a book needs, for any MCP-capable AI: documents and
8
+ pages, master pages and sections, layout grid, text frames and autoflow of
9
+ whole manuscripts, text, paragraph and character styles with drop caps,
10
+ images and anchored objects, table of contents and index, typography
11
+ checks, print-on-demand checks and book covers, preflight and export (PDF –
12
+ also accessible, tagged PDF and interactive PDF –, page images and e-books
13
+ as EPUB, with a check of the EPUB).
14
+
15
+ LayoutBridge Light is the book edition of LayoutBridge for Adobe InDesign®:
16
+ same server, 85 of its tools. Not included are tables, layers, groups and
17
+ object styles, shapes, lines and effects, page reordering, packaging and the
18
+ tools for taking over third-party documents. It needs its own licence key; a key for
19
+ LayoutBridge for Adobe InDesign® does not work here, and vice versa.
20
+
21
+ Product page: https://mcp-interfaces.com/layoutbridge-light/ (German:
22
+ https://mcp-schnittstellen.de/layoutbridge-light/).
23
+ Step-by-step installation guide:
24
+ https://mcp-interfaces.com/layoutbridge-light/installation.html (German:
25
+ https://mcp-schnittstellen.de/layoutbridge-light/installation.html).
26
+
27
+ Adobe and InDesign are either registered trademarks or trademarks of Adobe in
28
+ the United States and/or other countries.
29
+
30
+ ## Requirements
31
+
32
+ - Adobe® InDesign®, installed and running – Mac or Windows (Windows 10/11
33
+ x64; tested with InDesign® 21.5.1.73 on Windows 11)
34
+ - Windows: Windows PowerShell 5.1 (`powershell.exe`, included in Windows)
35
+ - Your licence key from the purchase receipt e-mail – one key per
36
+ workstation
37
+ - A network connection for the licence check on the first call
38
+ - **Node.js version 20 or newer – only for the npm package** (entry in the
39
+ configuration file, `--setup`, `--deactivate`) **and for other MCP
40
+ clients.** With the installation package (`.mcpb`) no separate Node.js
41
+ installation is needed – Claude Desktop comes with Node.js (switch “Use
42
+ built-in Node.js for MCP” under “Advanced settings”, on by default).
43
+
44
+ ## Installation in Claude Desktop
45
+
46
+ There are two ways. Way A is the shorter one; Way B is the same entry that
47
+ other MCP clients receive. The installation guide linked above shows every
48
+ step with Mac and Windows details.
49
+
50
+ **Way A – installation package (bundle file `.mcpb`)**
51
+
52
+ 1. Download the file `layoutbridge-light-<version>.mcpb` from the product
53
+ page.
54
+ 2. In Claude Desktop, open Settings › Desktop app › Extensions and drag the
55
+ file into that window – it says “Drag .MCPB or .DXT files here to
56
+ install”. On Mac you can open the file by double-clicking it instead. On
57
+ Windows, double-clicking does not open Claude Desktop – Windows asks
58
+ which app to use; drag the file into the window, or choose “Advanced
59
+ settings” › “Install extension” and select the file. Confirm the
60
+ installation dialog with “Install”.
61
+ 3. Enter your licence key in the field “Licence key” and click “Save”. The
62
+ key is stored by Claude Desktop on your computer.
63
+ 4. **Switch the extension on.** After installation, “LayoutBridge for
64
+ Adobe InDesign®” is listed under Settings › Extensions as “Disabled”.
65
+ Switch it to enabled – otherwise no tools appear.
66
+
67
+ **Way B – npm package (Node.js version 20 or newer)**
68
+
69
+ Setup command – run in Terminal (Mac) or PowerShell (Windows):
70
+
71
+ ```
72
+ npx layoutbridge-light --setup
73
+ ```
74
+
75
+ The command adds the server to the Claude Desktop configuration file and
76
+ stores the licence key in the default location (see “Licence key”). It
77
+ only runs when you call it. Before every change it shows the full path of
78
+ the file and the new entry verbatim and asks for confirmation (`y` for
79
+ yes, `n` for no). Before writing it creates a backup
80
+ `claude_desktop_config.json.bak-YYYY-MM-DD_HHMM` in the same folder; only
81
+ the entry `layoutbridge-light` under `mcpServers` is changed, all other
82
+ entries stay unchanged. If the file is not valid JSON, it stops and names
83
+ line and column. The licence key is asked for without being shown and is
84
+ written only to `license.key`. No administrator rights, no network
85
+ connection. On Windows it uses the configuration folder of the Claude
86
+ Desktop package (see “By hand”) if there is one, otherwise
87
+ `%APPDATA%\Claude`, and says which one it chose; if it finds several
88
+ Claude Desktop packages and cannot tell which one is in use, it stops
89
+ without changing anything.
90
+
91
+ - `--dry-run` shows the same and writes nothing.
92
+ - `--license-key-file <path>` reads the key from a file instead of asking
93
+ for it.
94
+
95
+ **By hand:** open the configuration file of Claude Desktop in a text
96
+ editor. On Windows, the simplest way is Settings › Desktop app › Developer ›
97
+ “Edit Config”: it opens the folder Claude Desktop actually reads. For the
98
+ usual installation as an app package this is
99
+ `%LOCALAPPDATA%\Packages\Claude_<id>\LocalCache\Roaming\Claude\claude_desktop_config.json`
100
+ (`<id>` is a combination of letters and digits); only an installation
101
+ without a package uses `%APPDATA%\Claude\claude_desktop_config.json`. On
102
+ the Mac the file is `~/Library/Application Support/Claude/claude_desktop_config.json`
103
+ (“Edit Config” works there as well). If the file is empty or does not exist
104
+ yet, its complete content is this:
105
+
106
+ ```json
107
+ {
108
+ "mcpServers": {
109
+ "layoutbridge-light": {
110
+ "command": "npx",
111
+ "args": ["-y", "layoutbridge-light"]
112
+ }
113
+ }
114
+ }
115
+ ```
116
+
117
+ If the file already lists other servers under `"mcpServers"`, insert only
118
+ the block `"layoutbridge-light": { … }` there – with a comma between the
119
+ entries – and leave everything else unchanged. Then store the licence key
120
+ (see “Licence key”). On the first start, `npx` downloads the package
121
+ `layoutbridge-light` from the npm registry; after that it starts from the
122
+ local cache.
123
+
124
+ **Then:** quit Claude Desktop completely – on Mac with ⌘ + Q, on Windows
125
+ via “Quit” in the application menu; closing the window is not enough –
126
+ and start it again. Start Adobe® InDesign® and ask in Claude Desktop:
127
+ “Which InDesign® version is running?” Claude calls the tool
128
+ `get_app_version` and reports the version. The tools appear under the
129
+ extension name “LayoutBridge Light for Adobe InDesign®” on Way A, and with the
130
+ prefix `layoutbridge-light:` on Way B.
131
+
132
+ ## Other MCP clients
133
+
134
+ Other MCP clients (Claude Code, Cursor, GitHub Copilot and others) register
135
+ the same server according to their own documentation. The command is
136
+ always
137
+
138
+ ```
139
+ npx -y layoutbridge-light
140
+ ```
141
+
142
+ and requires Node.js version 20 or newer. The licence key is found in the
143
+ same places as described under “Licence key”.
144
+
145
+ ## Licence key
146
+
147
+ The key is in the purchase receipt e-mail and is valid for exactly one
148
+ workstation; several workstations need several keys.
149
+
150
+ **Where LayoutBridge looks for the key, in this order:**
151
+
152
+ 1. the environment variable `LAYOUTBRIDGE_LIGHT_LICENSE_KEY` – the
153
+ installation package sets it from the field “Licence key”; on Way B it
154
+ can go into the server entry as `"env": { "LAYOUTBRIDGE_LIGHT_LICENSE_KEY":
155
+ "YOUR-LICENCE-KEY" }`,
156
+ 2. the file named in the environment variable `LAYOUTBRIDGE_LIGHT_LICENSE_FILE`,
157
+ 3. the file `license.key` at the default location – the key only, no other
158
+ text:
159
+ - Mac: `~/Library/Application Support/layoutbridge-light/license.key`
160
+ - Windows: `%USERPROFILE%\.layoutbridge-light\license.key`
161
+
162
+ Create the folder `layoutbridge-light` or `.layoutbridge-light` if it does not
163
+ exist. A key added or changed later takes effect without a restart.
164
+
165
+ **Check:** on the first tool call LayoutBridge verifies the key online;
166
+ after that at most once every 24 hours. If the service cannot be reached,
167
+ LayoutBridge keeps working for 14 days from the last valid check and
168
+ appends a warning to every response; after that, or if no valid check has
169
+ ever taken place, the tools are locked until the key can be verified
170
+ again.
171
+
172
+ **Without a valid key** every tool answers with `ok: false` and
173
+ `error.kind: "license"`. The message says in plain words whether the key is
174
+ missing, expired, invalid, for another product or cannot be verified right
175
+ now, and names the location where the key was expected; `error.details`
176
+ adds the support address and the licence terms. InDesign® is not
177
+ contacted.
178
+
179
+ **What is stored and transmitted:** the result of the last check is stored
180
+ in `license-state.json` next to `license.key` – with a fingerprint of the
181
+ key, never the key itself, and without customer data. For the check, the
182
+ licence key and an identifier of this workstation go to the payment service
183
+ Polar (`api.polar.sh`, USA). The identifier is a random
184
+ name of the form `layoutbridge-<8 characters>`, created the first time and
185
+ stored in `instance-name` next to `license.key`; the computer name is not
186
+ used. Anyone who wants a readable name in the merchant account sets
187
+ `LAYOUTBRIDGE_LIGHT_INSTANCE_NAME`. Document contents, file paths and tool
188
+ calls are never transmitted.
189
+
190
+ ## Changing computers
191
+
192
+ A licence is active on one workstation. Release it on the old computer
193
+ before entering the key on the new one – no InDesign®, no Claude Desktop
194
+ needed, but Node.js version 20 or newer:
195
+
196
+ ```
197
+ npx layoutbridge-light --deactivate
198
+ ```
199
+
200
+ The command reports in plain text whether the release worked and deletes
201
+ the local check result. It reads the key from the same places as the
202
+ server (see “Licence key”); with the installation package the key is kept
203
+ by Claude Desktop, so put it into `license.key` first or write to support.
204
+ If you have no Node.js because you only use the installation package, or
205
+ if the old computer is no longer available, you can release the activation
206
+ yourself in the Polar customer portal or write to support; they release
207
+ the activation.
208
+
209
+ ## Server configuration
210
+
211
+ Defaults that differ from workplace to workplace can be set in a JSON file
212
+ that the server reads at start: path from the environment variable
213
+ `LAYOUTBRIDGE_LIGHT_CONFIG`, otherwise on the Mac
214
+ `~/Library/Application Support/layoutbridge-light/config.json`, on Windows
215
+ `%USERPROFILE%\.layoutbridge-light\config.json`. If the file is missing, the
216
+ neutral defaults apply. All keys are optional; a parameter in the call
217
+ always takes precedence.
218
+
219
+ ```json
220
+ {
221
+ "tracking_warn_beyond": 20,
222
+ "min_ppi": 300,
223
+ "export_pdf": {
224
+ "preset": "Name of the PDF preset",
225
+ "fallback_preset": "Name of the fallback preset",
226
+ "fallback_over_bytes": 4194304
227
+ }
228
+ }
229
+ ```
230
+
231
+ | Key | Effect |
232
+ |---|---|
233
+ | `tracking_warn_beyond` | `apply_character_format_to_range` warns if the absolute tracking value exceeds it. Without an entry, no warning. |
234
+ | `min_ppi` | Default for the parameter `min_ppi` of `place_image`, `scale_image_in_frame` and `fit_frame` (warning below this effective resolution). Without an entry 300. |
235
+ | `export_pdf.preset` | Default for `preset` of `export_pdf`. Without an entry the localised “High Quality Print”. |
236
+ | `export_pdf.fallback_preset`, `export_pdf.fallback_over_bytes` | Second pass with this preset if the file is larger. Without an entry no second pass. |
237
+ | `print_on_demand` | Limits of a print-on-demand service for `check_print_on_demand` (`min_page_count`, `max_page_count`, `page_count_multiple`, `inside_margin_tiers` as a list of `max_pages` and `min_mm`, `min_outside_margin_mm`, `bleed_mm`, `min_font_size_pt`) and dimensions for `create_book_cover` (`spine_per_page_mm`, `bleed_mm`, `safety_margin_mm`, `spine_safety_mm`, `barcode_area` with `width_mm`, `height_mm`, `offset_x_mm`, `offset_y_mm`). Take the values from the current requirements of your service. Without an entry the check skips that point. |
238
+ | `epub.min_ppi` | Lowest effective image resolution that `check_epub` accepts for the document check. Without an entry the image resolution is not checked (the general `min_ppi` does not apply to e-books). |
239
+
240
+ Unknown keys and wrong types are reported by the server at start on
241
+ standard error and ignored.
242
+
243
+ ## Log
244
+
245
+ One line per call, one file per running instance:
246
+ `~/Library/Logs/layoutbridge-light/` on the Mac,
247
+ `%USERPROFILE%\.layoutbridge-light\logs\` on Windows; other location via the
248
+ environment variable `LAYOUTBRIDGE_LIGHT_LOG_DIR`. The log stays on your
249
+ computer; it is not sent anywhere.
250
+
251
+ **What the line contains (default `basic`):** timestamp, tool name,
252
+ duration, success, error kind and error text, warnings and the **names** of
253
+ the parameters passed. Values appear only where they are needed for
254
+ troubleshooting and harmless (numbers, identifiers, enumeration values,
255
+ file paths). Text that can be document content appears only as a length –
256
+ `"<Text, 248 Zeichen>"`. In paths your home folder is replaced by `~`. The
257
+ licence key is never logged.
258
+
259
+ **Setting the depth –** `LAYOUTBRIDGE_LIGHT_LOG_LEVEL`:
260
+
261
+ | Value | Meaning |
262
+ |---|---|
263
+ | `off` | no logging, no file is created |
264
+ | `basic` | **default**, filtered as described above |
265
+ | `full` | all parameters verbatim, paths with user name – only for troubleshooting, at the request of support |
266
+
267
+ When `full` is active, the first line of the log and the server's start
268
+ message say so. Afterwards switch back to `basic`.
269
+
270
+ **Retention:** at start the server deletes log files older than **30
271
+ days**. Other period via `LAYOUTBRIDGE_LIGHT_LOG_KEEP_DAYS` (number of days;
272
+ `0` switches deletion off).
273
+
274
+ ## Accessible PDF
275
+
276
+ LayoutBridge prepares documents for accessible PDF (PDF/UA, WCAG) and
277
+ exports tagged PDFs:
278
+
279
+ - alternative texts for images (`list_alt_texts`, `set_alt_text` – also for
280
+ many images in one call and from the XMP metadata of the image file;
281
+ decorative images become artifacts),
282
+ - PDF tags of paragraph and character styles (`pdf_tag` in
283
+ `define_paragraph_style` and `define_character_style`),
284
+ - the reading order through articles (`list_articles`, `define_article`,
285
+ `delete_article`),
286
+ - a check before the export (`check_accessibility`),
287
+ - the export as tagged PDF (`export_pdf` with `tagged`, `pdf_language`,
288
+ `title`, `display_title`, `bookmarks`) or as interactive PDF
289
+ (`export_interactive_pdf`). Strokes and fills of text frames and the
290
+ strokes of tables, which InDesign leaves untagged, are marked as artifacts
291
+ in the finished file of every tagged export
292
+ (`artifact_untagged_paths: false` switches that off).
293
+
294
+ The PDF/UA identifier is written only on request (`pdfua_identifier`) and
295
+ only when `check_accessibility` reports no error. It claims a conformance
296
+ that the connector cannot fully check. Check every file with a PDF/UA
297
+ checker and a screen reader; some steps remain manual in Adobe Acrobat:
298
+ linking captions to their figures, complex tables (merged cells, row
299
+ headers) and contrast. Tested with InDesign 2026.
300
+
301
+ ## License terms
302
+
303
+ Use of LayoutBridge Light for Adobe InDesign® is governed by the
304
+ licence terms (EULA). The German version is authoritative.
305
+
306
+ - English: https://mcp-interfaces.com/layoutbridge-light/license.html
307
+ - Deutsch: https://mcp-schnittstellen.de/layoutbridge-light/lizenzbedingungen.html
308
+
309
+ The server names the address in its start line and in every response of the
310
+ error kind `license` (`error.details.license_terms`).
311
+
312
+ ## Privacy Policy
313
+
314
+ Which data the server processes – licence check with the payment service,
315
+ log on your own computer, nothing else – is set out in the
316
+ product's privacy policy:
317
+
318
+ - English: https://mcp-interfaces.com/layoutbridge-light/privacy.html
319
+ - Deutsch: https://mcp-schnittstellen.de/layoutbridge-light/datenschutz.html
320
+
321
+ The licence check calls the payment service Polar; its
322
+ privacy policy: https://polar.sh/legal/privacy.
323
+
324
+ ## Support
325
+
326
+ Questions and error reports to **kontakt@mcp-interfaces.com**. We answer
327
+ on working days, aiming for within two working days. Helpful are:
328
+ tool name, error text verbatim, time, InDesign version and
329
+ operating system. **Never send us your licence key.**
330
+
331
+ A copied error message may contain file names and the folder path below
332
+ your home folder as well as names from the document
333
+ (pages, frames, styles) – no user name, no
334
+ document text, no licence key. Bug fixes are implemented
335
+ as quickly as possible.
336
+
337
+ ## Third-party notices
338
+
339
+ The package contains third-party software (runtime dependencies including
340
+ transitive packages). Name, version, licence, copyright line and full
341
+ licence text per package are in `THIRD-PARTY-NOTICES.md` (included in the
342
+ npm package and in the installation package).
343
+
344
+ ## Versions and changelog
345
+
346
+ One release a month with a catalogue of new features; bug fixes are
347
+ implemented as quickly as possible, independently of that release cycle. All changes
348
+ are listed in `CHANGELOG.md` (included in the package). Within a
349
+ major version, tool names, parameters and return fields remain stable;
350
+ additions are additive.
351
+
352
+ ## Licence
353
+
354
+ Proprietary, all rights reserved. See `LICENSE`.