layoutbridge-spm 0.0.1 → 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 (79) hide show
  1. package/CHANGELOG.md +171 -0
  2. package/LICENSE +26 -0
  3. package/README.de.md +318 -0
  4. package/README.md +304 -4
  5. package/THIRD-PARTY-NOTICES.md +2878 -0
  6. package/dist/src/mcp/config.js +125 -0
  7. package/dist/src/mcp/dispatch.js +123 -0
  8. package/dist/src/mcp/license/free-tools.js +16 -0
  9. package/dist/src/mcp/license/gate.js +209 -0
  10. package/dist/src/mcp/license/index.js +96 -0
  11. package/dist/src/mcp/license/instance-name.js +56 -0
  12. package/dist/src/mcp/license/key-source.js +58 -0
  13. package/dist/src/mcp/license/lemonsqueezy-verifier.js +207 -0
  14. package/dist/src/mcp/license/placeholder-verifier.js +10 -0
  15. package/dist/src/mcp/license/polar-ids.js +63 -0
  16. package/dist/src/mcp/license/polar-verifier.js +265 -0
  17. package/dist/src/mcp/license/product-ids.js +72 -0
  18. package/dist/src/mcp/license/state-store.js +91 -0
  19. package/dist/src/mcp/license/types.js +11 -0
  20. package/dist/src/mcp/logging.js +270 -0
  21. package/dist/src/mcp/product-info.js +48 -0
  22. package/dist/src/mcp/server.js +250 -0
  23. package/dist/src/mcp/setup.js +608 -0
  24. package/dist/src/mcp/start.cjs +95 -0
  25. package/dist/src/mcp/tool-definition.js +2 -0
  26. package/dist/src/mcp/tools.js +2004 -0
  27. package/dist/src/mcp/typography-rules.js +70 -0
  28. package/dist/src/transport/com.js +250 -0
  29. package/dist/src/transport/osascript.js +171 -0
  30. package/dist/src/transport/queue.js +19 -0
  31. package/dist/src/transport/script-bundle.js +92 -0
  32. package/dist/src/transport/transport.js +30 -0
  33. package/indesign/commands/10-app.js +6 -0
  34. package/indesign/commands/20-documents.js +513 -0
  35. package/indesign/commands/22-document-setup.js +118 -0
  36. package/indesign/commands/23-save-package.js +255 -0
  37. package/indesign/commands/25-export.js +379 -0
  38. package/indesign/commands/26-export-image.js +197 -0
  39. package/indesign/commands/27-textdefaults.js +151 -0
  40. package/indesign/commands/28-selection.js +174 -0
  41. package/indesign/commands/30-pages.js +1032 -0
  42. package/indesign/commands/31-view.js +210 -0
  43. package/indesign/commands/32-sections.js +203 -0
  44. package/indesign/commands/35-parents.js +428 -0
  45. package/indesign/commands/37-layout.js +760 -0
  46. package/indesign/commands/40-frames.js +836 -0
  47. package/indesign/commands/41-shapes.js +505 -0
  48. package/indesign/commands/42-groups.js +117 -0
  49. package/indesign/commands/43-layers.js +291 -0
  50. package/indesign/commands/44-effects.js +274 -0
  51. package/indesign/commands/45-frame-options.js +247 -0
  52. package/indesign/commands/47-anchored.js +287 -0
  53. package/indesign/commands/50-modify.js +781 -0
  54. package/indesign/commands/52-align.js +139 -0
  55. package/indesign/commands/55-fit.js +106 -0
  56. package/indesign/commands/60-images.js +771 -0
  57. package/indesign/commands/62-embed.js +120 -0
  58. package/indesign/commands/69-placeholders.js +127 -0
  59. package/indesign/commands/70-text.js +567 -0
  60. package/indesign/commands/71-outlines.js +92 -0
  61. package/indesign/commands/72-place-text.js +366 -0
  62. package/indesign/commands/74-stories.js +116 -0
  63. package/indesign/commands/75-tables.js +676 -0
  64. package/indesign/commands/76-text-variables.js +260 -0
  65. package/indesign/commands/77-story-options.js +86 -0
  66. package/indesign/commands/78-frame-lines.js +304 -0
  67. package/indesign/commands/79-check-typography.js +303 -0
  68. package/indesign/commands/80-styles.js +1620 -0
  69. package/indesign/commands/81-composition.js +355 -0
  70. package/indesign/commands/82-object-styles.js +263 -0
  71. package/indesign/commands/83-indents-tabs.js +237 -0
  72. package/indesign/commands/84-import-styles.js +142 -0
  73. package/indesign/commands/85-swatches.js +112 -0
  74. package/indesign/commands/86-gradients.js +185 -0
  75. package/indesign/commands/87-replace-swatch.js +180 -0
  76. package/indesign/commands/88-replace-font.js +217 -0
  77. package/indesign/interpreter.js +758 -0
  78. package/package.json +55 -6
  79. package/rules/typography-rules.json +31 -0
@@ -0,0 +1,95 @@
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.nodeMajor = nodeMajor;
22
+ exports.nodeVersionProblem = nodeVersionProblem;
23
+ exports.isEntryFile = isEntryFile;
24
+ /** Mindest-Hauptversion von Node.js. */
25
+ exports.MIN_NODE_MAJOR = 20;
26
+ /** Installationsanleitung, englisch und deutsch (Produktseite + installation.html). */
27
+ exports.INSTALL_URL = 'https://mcp-interfaces.com/layoutbridge/installation.html';
28
+ exports.INSTALL_URL_DE = 'https://mcp-schnittstellen.de/layoutbridge/installation.html';
29
+ /** Hauptversion aus einer Versionsangabe wie `v18.20.8`; nicht lesbar = 0. */
30
+ function nodeMajor(version) {
31
+ var match = /^v?(\d+)\./.exec(String(version));
32
+ if (match === null)
33
+ return 0;
34
+ var major = parseInt(match[1], 10);
35
+ return isNaN(major) ? 0 : major;
36
+ }
37
+ /**
38
+ * Meldung fuer eine zu alte Node-Version (englisch und deutsch, je ein Satz
39
+ * auf einer Zeile) oder `null`, wenn die Version genuegt.
40
+ */
41
+ function nodeVersionProblem(version) {
42
+ if (nodeMajor(version) >= exports.MIN_NODE_MAJOR)
43
+ return null;
44
+ var found = String(version).replace(/^v/, '');
45
+ return ('[layoutbridge-spm] Node.js ' + found + ' found, but version ' + exports.MIN_NODE_MAJOR +
46
+ ' or newer is required - please update Node.js as described in ' + exports.INSTALL_URL + '\n' +
47
+ '[layoutbridge-spm] Node.js ' + found + ' gefunden, benoetigt wird Version ' + exports.MIN_NODE_MAJOR +
48
+ ' oder neuer - bitte Node.js wie in ' + exports.INSTALL_URL_DE + ' beschrieben aktualisieren\n');
49
+ }
50
+ function start() {
51
+ var problem = nodeVersionProblem(process.version);
52
+ if (problem !== null) {
53
+ process.stderr.write(problem);
54
+ process.exit(1);
55
+ }
56
+ import('./server.js').then(function (server) {
57
+ server.runCli();
58
+ }, function (error) {
59
+ process.stderr.write('[layoutbridge-spm] fatal: ' + String(error) + '\n');
60
+ process.exit(1);
61
+ });
62
+ }
63
+ /**
64
+ * Ist `file` der Einstieg des Prozesses laut `process.argv[1]`? Pfad und
65
+ * Symlink werden aufgeloest (npx startet ueber einen Link in
66
+ * node_modules/.bin), `.cjs` darf fehlen.
67
+ *
68
+ * Grund (Vermerk E-77): Claude Desktop startet MCPB-Bundles mit dem
69
+ * eingebauten Node als Electron-UtilityProcess; dessen Starter setzt
70
+ * `process.argv = [node, <Einstieg>, ...]` und laedt den Einstieg mit
71
+ * `import()`. Dann ist `require.main` nicht dieses Modul, und eine Pruefung
72
+ * nur auf `require.main === module` startet den Server nie. Beim Import aus
73
+ * Tests oder aus `server.js` zeigt argv[1] auf eine andere Datei – dort
74
+ * startet nichts.
75
+ */
76
+ function isEntryFile(argv1, file) {
77
+ if (typeof argv1 !== 'string' || argv1.length === 0)
78
+ return false;
79
+ var fs = require('fs');
80
+ var path = require('path');
81
+ function real(candidate) {
82
+ try {
83
+ return fs.realpathSync(candidate);
84
+ }
85
+ catch (error) {
86
+ return path.resolve(candidate);
87
+ }
88
+ }
89
+ var target = real(file);
90
+ var given = path.resolve(argv1);
91
+ return real(given) === target || real(given + '.cjs') === target;
92
+ }
93
+ if (require.main === module || isEntryFile(process.argv[1], __filename))
94
+ start();
95
+ //# sourceMappingURL=start.cjs.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tool-definition.js.map