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.
- package/CHANGELOG.md +105 -0
- package/LICENSE +26 -0
- package/README.de.md +367 -0
- package/README.md +353 -2
- package/THIRD-PARTY-NOTICES.md +2878 -0
- package/dist/src/mcp/catalog.js +131 -0
- package/dist/src/mcp/config.js +211 -0
- package/dist/src/mcp/content-credentials.js +65 -0
- package/dist/src/mcp/dispatch.js +171 -0
- package/dist/src/mcp/epub-check.js +331 -0
- package/dist/src/mcp/epub-orientation.js +132 -0
- package/dist/src/mcp/license/free-tools.js +16 -0
- package/dist/src/mcp/license/gate.js +210 -0
- package/dist/src/mcp/license/index.js +107 -0
- package/dist/src/mcp/license/instance-name.js +57 -0
- package/dist/src/mcp/license/key-source.js +59 -0
- package/dist/src/mcp/license/lemonsqueezy-verifier.js +207 -0
- package/dist/src/mcp/license/placeholder-verifier.js +10 -0
- package/dist/src/mcp/license/polar-ids.js +100 -0
- package/dist/src/mcp/license/polar-verifier.js +285 -0
- package/dist/src/mcp/license/product-ids.js +73 -0
- package/dist/src/mcp/license/state-store.js +91 -0
- package/dist/src/mcp/license/types.js +11 -0
- package/dist/src/mcp/logging.js +271 -0
- package/dist/src/mcp/pdf-postprocess.js +798 -0
- package/dist/src/mcp/product-info.js +54 -0
- package/dist/src/mcp/product.js +56 -0
- package/dist/src/mcp/server.js +253 -0
- package/dist/src/mcp/setup.js +680 -0
- package/dist/src/mcp/start.cjs +117 -0
- package/dist/src/mcp/target-folder.js +25 -0
- package/dist/src/mcp/tool-definition.js +2 -0
- package/dist/src/mcp/tools.js +2680 -0
- package/dist/src/mcp/typography-rules.js +70 -0
- package/dist/src/transport/com.js +436 -0
- package/dist/src/transport/osascript.js +171 -0
- package/dist/src/transport/queue.js +19 -0
- package/dist/src/transport/script-bundle.js +92 -0
- package/dist/src/transport/transport.js +52 -0
- package/indesign/commands/10-app.js +6 -0
- package/indesign/commands/20-documents.js +517 -0
- package/indesign/commands/22-document-setup.js +204 -0
- package/indesign/commands/23-save-package.js +258 -0
- package/indesign/commands/25-export.js +695 -0
- package/indesign/commands/26-export-image.js +202 -0
- package/indesign/commands/27-textdefaults.js +151 -0
- package/indesign/commands/28-selection.js +174 -0
- package/indesign/commands/30-pages.js +1032 -0
- package/indesign/commands/31-view.js +310 -0
- package/indesign/commands/32-sections.js +203 -0
- package/indesign/commands/35-parents.js +448 -0
- package/indesign/commands/37-layout.js +837 -0
- package/indesign/commands/40-frames.js +886 -0
- package/indesign/commands/41-shapes.js +505 -0
- package/indesign/commands/42-groups.js +117 -0
- package/indesign/commands/43-layers.js +310 -0
- package/indesign/commands/44-effects.js +274 -0
- package/indesign/commands/45-frame-options.js +247 -0
- package/indesign/commands/47-anchored.js +473 -0
- package/indesign/commands/50-modify.js +803 -0
- package/indesign/commands/52-align.js +139 -0
- package/indesign/commands/55-fit.js +106 -0
- package/indesign/commands/60-images.js +1154 -0
- package/indesign/commands/62-embed.js +120 -0
- package/indesign/commands/69-placeholders.js +132 -0
- package/indesign/commands/70-text.js +710 -0
- package/indesign/commands/71-outlines.js +92 -0
- package/indesign/commands/72-place-text.js +476 -0
- package/indesign/commands/73-story-lock.js +157 -0
- package/indesign/commands/74-stories.js +121 -0
- package/indesign/commands/75-tables.js +702 -0
- package/indesign/commands/76-text-variables.js +260 -0
- package/indesign/commands/77-story-options.js +86 -0
- package/indesign/commands/78-frame-lines.js +511 -0
- package/indesign/commands/79-check-typography.js +480 -0
- package/indesign/commands/80-styles.js +1960 -0
- package/indesign/commands/81-composition.js +355 -0
- package/indesign/commands/82-object-styles.js +263 -0
- package/indesign/commands/83-drop-caps.js +87 -0
- package/indesign/commands/83-indents-tabs.js +264 -0
- package/indesign/commands/84-import-styles.js +142 -0
- package/indesign/commands/85-swatches.js +112 -0
- package/indesign/commands/86-gradients.js +185 -0
- package/indesign/commands/87-replace-swatch.js +180 -0
- package/indesign/commands/88-replace-font.js +212 -0
- package/indesign/commands/89-toc-index.js +1002 -0
- package/indesign/commands/90-print-on-demand.js +495 -0
- package/indesign/commands/91-epub.js +629 -0
- package/indesign/commands/92-accessibility.js +1131 -0
- package/indesign/interpreter.js +829 -0
- package/package.json +41 -4
- package/rules/typography-rules.json +32 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Startdatei von layoutbridge-spm (Vermerk E-74, 21.09.2026).
|
|
5
|
+
*
|
|
6
|
+
* Prueft als Erstes die Node-Version und laedt erst danach den Server.
|
|
7
|
+
* Grund: `server.js` wird als ES-Modul mit statischen Imports geladen; eine
|
|
8
|
+
* Pruefung darin liefe erst, nachdem SDK, Lizenzpruefung (`fetch`) und
|
|
9
|
+
* Transport geladen sind – bei zu altem Node kaeme sie zu spaet oder gar
|
|
10
|
+
* nicht. Diese Datei ist deshalb CommonJS (`.cjs`), hat keine statischen
|
|
11
|
+
* Imports und verwendet nur Sprachmittel, die auch sehr alte Node-Versionen
|
|
12
|
+
* lesen koennen; `server.js` wird erst nach bestandener Pruefung per
|
|
13
|
+
* dynamischem `import()` geladen.
|
|
14
|
+
*
|
|
15
|
+
* Die Mindestversion ist dieselbe wie `engines.node` in package.json,
|
|
16
|
+
* `compatibility.runtimes.node` in manifest.json und die Installations-
|
|
17
|
+
* anleitung (Waechtertest tests/unit/node-version.test.ts).
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.INSTALL_URL_DE = exports.INSTALL_URL = exports.MIN_NODE_MAJOR = void 0;
|
|
21
|
+
exports.startProduct = startProduct;
|
|
22
|
+
exports.nodeMajor = nodeMajor;
|
|
23
|
+
exports.nodeVersionProblem = nodeVersionProblem;
|
|
24
|
+
exports.isEntryFile = isEntryFile;
|
|
25
|
+
/** Mindest-Hauptversion von Node.js. */
|
|
26
|
+
exports.MIN_NODE_MAJOR = 20;
|
|
27
|
+
/**
|
|
28
|
+
* Produkt dieses Pakets (A-70, E-109): Name aus package.json; das Light-Paket
|
|
29
|
+
* heisst `layoutbridge-light`, alles andere ist das Vollprodukt. Muss zu
|
|
30
|
+
* src/mcp/product.ts passen (Waechtertest). Nur `require('fs')`, damit die
|
|
31
|
+
* Datei auch unter sehr alten Node-Versionen lesbar bleibt.
|
|
32
|
+
*/
|
|
33
|
+
function startProduct() {
|
|
34
|
+
var name;
|
|
35
|
+
try {
|
|
36
|
+
var fs = require('fs');
|
|
37
|
+
var path = require('path');
|
|
38
|
+
name = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', '..', 'package.json'), 'utf8')).name;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
name = undefined;
|
|
42
|
+
}
|
|
43
|
+
if (name === 'layoutbridge-light')
|
|
44
|
+
return { name: 'layoutbridge-light', pagePath: 'layoutbridge-light' };
|
|
45
|
+
return { name: 'layoutbridge-spm', pagePath: 'layoutbridge' };
|
|
46
|
+
}
|
|
47
|
+
var PRODUCT_START = startProduct();
|
|
48
|
+
/** Installationsanleitung, englisch und deutsch (Produktseite + installation.html). */
|
|
49
|
+
exports.INSTALL_URL = 'https://mcp-interfaces.com/' + PRODUCT_START.pagePath + '/installation.html';
|
|
50
|
+
exports.INSTALL_URL_DE = 'https://mcp-schnittstellen.de/' + PRODUCT_START.pagePath + '/installation.html';
|
|
51
|
+
/** Hauptversion aus einer Versionsangabe wie `v18.20.8`; nicht lesbar = 0. */
|
|
52
|
+
function nodeMajor(version) {
|
|
53
|
+
var match = /^v?(\d+)\./.exec(String(version));
|
|
54
|
+
if (match === null)
|
|
55
|
+
return 0;
|
|
56
|
+
var major = parseInt(match[1], 10);
|
|
57
|
+
return isNaN(major) ? 0 : major;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Meldung fuer eine zu alte Node-Version (englisch und deutsch, je ein Satz
|
|
61
|
+
* auf einer Zeile) oder `null`, wenn die Version genuegt.
|
|
62
|
+
*/
|
|
63
|
+
function nodeVersionProblem(version) {
|
|
64
|
+
if (nodeMajor(version) >= exports.MIN_NODE_MAJOR)
|
|
65
|
+
return null;
|
|
66
|
+
var found = String(version).replace(/^v/, '');
|
|
67
|
+
return ('[' + PRODUCT_START.name + '] Node.js ' + found + ' found, but version ' + exports.MIN_NODE_MAJOR +
|
|
68
|
+
' or newer is required - please update Node.js as described in ' + exports.INSTALL_URL + '\n' +
|
|
69
|
+
'[' + PRODUCT_START.name + '] Node.js ' + found + ' gefunden, benoetigt wird Version ' + exports.MIN_NODE_MAJOR +
|
|
70
|
+
' oder neuer - bitte Node.js wie in ' + exports.INSTALL_URL_DE + ' beschrieben aktualisieren\n');
|
|
71
|
+
}
|
|
72
|
+
function start() {
|
|
73
|
+
var problem = nodeVersionProblem(process.version);
|
|
74
|
+
if (problem !== null) {
|
|
75
|
+
process.stderr.write(problem);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
import('./server.js').then(function (server) {
|
|
79
|
+
server.runCli();
|
|
80
|
+
}, function (error) {
|
|
81
|
+
process.stderr.write('[' + PRODUCT_START.name + '] fatal: ' + String(error) + '\n');
|
|
82
|
+
process.exit(1);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Ist `file` der Einstieg des Prozesses laut `process.argv[1]`? Pfad und
|
|
87
|
+
* Symlink werden aufgeloest (npx startet ueber einen Link in
|
|
88
|
+
* node_modules/.bin), `.cjs` darf fehlen.
|
|
89
|
+
*
|
|
90
|
+
* Grund (Vermerk E-77): Claude Desktop startet MCPB-Bundles mit dem
|
|
91
|
+
* eingebauten Node als Electron-UtilityProcess; dessen Starter setzt
|
|
92
|
+
* `process.argv = [node, <Einstieg>, ...]` und laedt den Einstieg mit
|
|
93
|
+
* `import()`. Dann ist `require.main` nicht dieses Modul, und eine Pruefung
|
|
94
|
+
* nur auf `require.main === module` startet den Server nie. Beim Import aus
|
|
95
|
+
* Tests oder aus `server.js` zeigt argv[1] auf eine andere Datei – dort
|
|
96
|
+
* startet nichts.
|
|
97
|
+
*/
|
|
98
|
+
function isEntryFile(argv1, file) {
|
|
99
|
+
if (typeof argv1 !== 'string' || argv1.length === 0)
|
|
100
|
+
return false;
|
|
101
|
+
var fs = require('fs');
|
|
102
|
+
var path = require('path');
|
|
103
|
+
function real(candidate) {
|
|
104
|
+
try {
|
|
105
|
+
return fs.realpathSync(candidate);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
return path.resolve(candidate);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
var target = real(file);
|
|
112
|
+
var given = path.resolve(argv1);
|
|
113
|
+
return real(given) === target || real(given + '.cjs') === target;
|
|
114
|
+
}
|
|
115
|
+
if (require.main === module || isEntryFile(process.argv[1], __filename))
|
|
116
|
+
start();
|
|
117
|
+
//# sourceMappingURL=start.cjs.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A-68 (9), Sitzung 81: Zielordner fuer export_page_image anlegen. Der
|
|
3
|
+
* Server laeuft auf demselben Rechner wie InDesign (lokaler Prozess), legt
|
|
4
|
+
* den Ordner deshalb selbst an – plattformgleich fuer Mac und Windows, ohne
|
|
5
|
+
* Ordnerobjekte im Skript (UXP kennt kein Folder). Nur auf ausdruecklichen
|
|
6
|
+
* Wunsch (create_folder true).
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync, mkdirSync } from 'node:fs';
|
|
9
|
+
import { dirname, isAbsolute } from 'node:path';
|
|
10
|
+
/** true, wenn der Ordner neu angelegt wurde; false, wenn er schon da war, der Pfad nicht absolut ist oder das Anlegen scheiterte (dann meldet der Export io_error). */
|
|
11
|
+
export function createTargetFolder(path) {
|
|
12
|
+
if (!isAbsolute(path))
|
|
13
|
+
return false;
|
|
14
|
+
const folder = dirname(path);
|
|
15
|
+
if (existsSync(folder))
|
|
16
|
+
return false;
|
|
17
|
+
try {
|
|
18
|
+
mkdirSync(folder, { recursive: true });
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=target-folder.js.map
|