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