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.
- package/CHANGELOG.md +171 -0
- package/LICENSE +26 -0
- package/README.de.md +318 -0
- package/README.md +304 -4
- package/THIRD-PARTY-NOTICES.md +2878 -0
- package/dist/src/mcp/config.js +125 -0
- package/dist/src/mcp/dispatch.js +123 -0
- package/dist/src/mcp/license/free-tools.js +16 -0
- package/dist/src/mcp/license/gate.js +209 -0
- package/dist/src/mcp/license/index.js +96 -0
- package/dist/src/mcp/license/instance-name.js +56 -0
- package/dist/src/mcp/license/key-source.js +58 -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 +63 -0
- package/dist/src/mcp/license/polar-verifier.js +265 -0
- package/dist/src/mcp/license/product-ids.js +72 -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 +270 -0
- package/dist/src/mcp/product-info.js +48 -0
- package/dist/src/mcp/server.js +250 -0
- package/dist/src/mcp/setup.js +608 -0
- package/dist/src/mcp/start.cjs +95 -0
- package/dist/src/mcp/tool-definition.js +2 -0
- package/dist/src/mcp/tools.js +2004 -0
- package/dist/src/mcp/typography-rules.js +70 -0
- package/dist/src/transport/com.js +250 -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 +30 -0
- package/indesign/commands/10-app.js +6 -0
- package/indesign/commands/20-documents.js +513 -0
- package/indesign/commands/22-document-setup.js +118 -0
- package/indesign/commands/23-save-package.js +255 -0
- package/indesign/commands/25-export.js +379 -0
- package/indesign/commands/26-export-image.js +197 -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 +210 -0
- package/indesign/commands/32-sections.js +203 -0
- package/indesign/commands/35-parents.js +428 -0
- package/indesign/commands/37-layout.js +760 -0
- package/indesign/commands/40-frames.js +836 -0
- package/indesign/commands/41-shapes.js +505 -0
- package/indesign/commands/42-groups.js +117 -0
- package/indesign/commands/43-layers.js +291 -0
- package/indesign/commands/44-effects.js +274 -0
- package/indesign/commands/45-frame-options.js +247 -0
- package/indesign/commands/47-anchored.js +287 -0
- package/indesign/commands/50-modify.js +781 -0
- package/indesign/commands/52-align.js +139 -0
- package/indesign/commands/55-fit.js +106 -0
- package/indesign/commands/60-images.js +771 -0
- package/indesign/commands/62-embed.js +120 -0
- package/indesign/commands/69-placeholders.js +127 -0
- package/indesign/commands/70-text.js +567 -0
- package/indesign/commands/71-outlines.js +92 -0
- package/indesign/commands/72-place-text.js +366 -0
- package/indesign/commands/74-stories.js +116 -0
- package/indesign/commands/75-tables.js +676 -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 +304 -0
- package/indesign/commands/79-check-typography.js +303 -0
- package/indesign/commands/80-styles.js +1620 -0
- package/indesign/commands/81-composition.js +355 -0
- package/indesign/commands/82-object-styles.js +263 -0
- package/indesign/commands/83-indents-tabs.js +237 -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 +217 -0
- package/indesign/interpreter.js +758 -0
- package/package.json +55 -6
- package/rules/typography-rules.json +31 -0
package/package.json
CHANGED
|
@@ -1,10 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "layoutbridge-spm",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
5
|
+
"description": "LayoutBridge for Adobe InDesign® – MCP server for Adobe® InDesign® (npm package layoutbridge-spm). Adobe and InDesign are either registered trademarks or trademarks of Adobe in the United States and/or other countries.",
|
|
6
|
+
"mcpName": "com.mcp-interfaces/layoutbridge-spm",
|
|
7
|
+
"homepage": "https://mcp-interfaces.com/layoutbridge/",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"email": "kontakt@mcp-interfaces.com"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"indesign",
|
|
13
|
+
"layout",
|
|
14
|
+
"typesetting",
|
|
15
|
+
"publishing",
|
|
16
|
+
"mcp",
|
|
17
|
+
"mcp-server"
|
|
18
|
+
],
|
|
19
|
+
"author": "MCP Interfaces <kontakt@mcp-interfaces.com> (https://mcp-interfaces.com/)",
|
|
20
|
+
"type": "module",
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=20"
|
|
23
|
+
},
|
|
24
|
+
"bin": {
|
|
25
|
+
"layoutbridge-spm": "dist/src/mcp/start.cjs"
|
|
26
|
+
},
|
|
7
27
|
"files": [
|
|
8
|
-
"
|
|
9
|
-
|
|
28
|
+
"dist/src",
|
|
29
|
+
"!dist/src/**/*.map",
|
|
30
|
+
"indesign",
|
|
31
|
+
"rules",
|
|
32
|
+
"README.md",
|
|
33
|
+
"README.de.md",
|
|
34
|
+
"LICENSE",
|
|
35
|
+
"THIRD-PARTY-NOTICES.md",
|
|
36
|
+
"CHANGELOG.md"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc -p tsconfig.json",
|
|
40
|
+
"clean": "rm -rf dist",
|
|
41
|
+
"test": "npm run build && node --test \"dist/tests/unit/*.test.js\"",
|
|
42
|
+
"test:integration": "npm run build && mkdir -p logs && node --test \"dist/tests/integration/*.test.js\" 2>&1 | tee logs/integration-last.log",
|
|
43
|
+
"test:integration:win": "npm run build && node --test \"dist/tests/integration/*.test.js\"",
|
|
44
|
+
"start": "node dist/src/mcp/server.js",
|
|
45
|
+
"notices": "node scripts/third-party-notices.mjs",
|
|
46
|
+
"bundle": "node scripts/bundle.mjs",
|
|
47
|
+
"pack:check": "npm run build && npm pack --dry-run",
|
|
48
|
+
"version": "node scripts/version-sync.mjs && git add server.json manifest.json"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
52
|
+
"zod": "^4.5.4"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@anthropic-ai/mcpb": "2.1.2",
|
|
56
|
+
"@types/node": "^22.20.1",
|
|
57
|
+
"typescript": "^5.9.3"
|
|
58
|
+
}
|
|
10
59
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_hinweis": "Regelkatalog fuer check_typography (Auftrag A-7.6, Sitzung 9). Daten, kein Code: der Server liest die Tabelle, waehlt nach locale, rules und exclude_rules aus und reicht die Zeilen an den Interpreter. kind grep = InDesign-GREP-Muster (Zeichenregeln), kind lines = Umbruchregel ueber get_frame_lines (check nennt die Pruefung). Eine Kennung darf je Sprache eine eigene Zeile haben. Quellen: Forssman/de Jong, Detailtypografie (8. Aufl.); Duden, Satz und Korrektur; DIN 5008; Bier, typokurz 1.6; Bringhurst, Elements of Typographic Style; typolexikon.de; Wikipedia Hurenkind und Schusterjunge.",
|
|
3
|
+
"rules": [
|
|
4
|
+
{ "id": "double_space", "locales": ["de", "de-CH", "en"], "category": "spacing", "severity": "warning", "kind": "grep", "pattern": "\\x{0020}{2,}", "message": "Two or more consecutive spaces (doppeltes Leerzeichen)", "suggestion": "find_replace mode grep: find \"\\x{0020}{2,}\", replace \" \"", "source": "Duden, Satz und Korrektur; typokurz 1.6" },
|
|
5
|
+
{ "id": "space_before_punct", "locales": ["de", "de-CH", "en"], "category": "spacing", "severity": "warning", "kind": "grep", "pattern": "[\\x{0020}\\x{00A0}\\x{202F}]+(?=[.,;:!?])", "message": "Space before a punctuation mark (Leerzeichen vor Satzzeichen)", "suggestion": "find_replace mode grep: find \"[\\x{0020}\\x{00A0}\\x{202F}]+(?=[.,;:!?])\", replace \"\"", "source": "Duden, Satz und Korrektur; typokurz 1.6" },
|
|
6
|
+
{ "id": "straight_quotes", "locales": ["de"], "category": "quotes", "severity": "warning", "kind": "grep", "pattern": "~\"", "message": "Straight double quote instead of typographic quotes (gerades Anführungszeichen statt „…“)", "suggestion": "Replace the pair with „ (U+201E) and “ (U+201C); with find_replace mode grep: find \"~\\\"(.+?)~\\\"\", replace \"~[$1~]\" or \"„$1“\"", "source": "Duden, Satz und Korrektur; typokurz 1.6" },
|
|
7
|
+
{ "id": "straight_quotes", "locales": ["de-CH"], "category": "quotes", "severity": "warning", "kind": "grep", "pattern": "~\"", "message": "Straight double quote instead of guillemets (gerades Anführungszeichen statt «…»)", "suggestion": "Replace the pair with « (U+00AB) and » (U+00BB); with find_replace mode grep: find \"~\\\"(.+?)~\\\"\", replace \"«$1»\"", "source": "Duden, Satz und Korrektur (Schweiz)" },
|
|
8
|
+
{ "id": "straight_quotes", "locales": ["en"], "category": "quotes", "severity": "warning", "kind": "grep", "pattern": "~\"", "message": "Straight double quote instead of curly quotes", "suggestion": "Replace the pair with “ (U+201C) and ” (U+201D); with find_replace mode grep: find \"~\\\"(.+?)~\\\"\", replace \"“$1”\"", "source": "Bringhurst, Elements of Typographic Style" },
|
|
9
|
+
{ "id": "apostrophe", "locales": ["de", "de-CH", "en"], "category": "quotes", "severity": "warning", "kind": "grep", "pattern": "~'|[´`]", "message": "Straight or acute apostrophe instead of the typographic apostrophe ’ (Apostroph)", "suggestion": "find_replace mode grep: find \"~'|[´`]\", replace \"’\" (U+2019) – check single quotes by hand", "source": "Duden, Satz und Korrektur; typokurz 1.6" },
|
|
10
|
+
{ "id": "hyphen_as_dash", "locales": ["de", "de-CH", "en"], "category": "dashes", "severity": "warning", "kind": "grep", "pattern": "[\\x{0020}\\x{00A0}]-[\\x{0020}\\x{00A0}]", "message": "Hyphen with spaces used as a dash (Bindestrich statt Gedankenstrich)", "suggestion": "find_replace mode grep: find \" - \", replace \" – \" (en dash U+2013; en: em dash — without spaces)", "source": "Duden, Satz und Korrektur; typokurz 1.6" },
|
|
11
|
+
{ "id": "dash_spacing", "locales": ["de", "de-CH"], "category": "dashes", "severity": "info", "kind": "grep", "pattern": "(?<=[\\l\\u])–(?=[\\l\\u])", "message": "En dash between letters without spaces – a Gedankenstrich takes spaces, only the bis-Strich between numbers is closed", "suggestion": "Insert spaces around the dash when it is a Gedankenstrich; leave ranges like 10–12 as they are", "source": "Duden, Satz und Korrektur; Forssman/de Jong, Detailtypografie" },
|
|
12
|
+
{ "id": "dash_spacing", "locales": ["en"], "category": "dashes", "severity": "info", "kind": "grep", "pattern": "\\x{0020}—\\x{0020}", "message": "Em dash with spaces – the em dash is set closed in English typography", "suggestion": "Remove the spaces around the em dash (or use a spaced en dash consistently)", "source": "Bringhurst, Elements of Typographic Style" },
|
|
13
|
+
{ "id": "three_dots", "locales": ["de", "de-CH", "en"], "category": "dashes", "severity": "warning", "kind": "grep", "pattern": "\\.\\.\\.", "message": "Three periods instead of the ellipsis … (Auslassungspunkte)", "suggestion": "find_replace mode grep: find \"\\.\\.\\.\", replace \"…\" (U+2026)", "source": "Duden, Satz und Korrektur; typokurz 1.6" },
|
|
14
|
+
{ "id": "number_unit_space", "locales": ["de", "de-CH"], "category": "numbers", "severity": "warning", "kind": "grep", "pattern": "\\d\\x{0020}(?=%|‰|€|°C|(?:EUR|CHF|mm|cm|dm|m|km|g|kg|t|ml|l|h|min|s|Uhr|Prozent|Mio\\.|Mrd\\.)(?![\\l\\u]))", "message": "Normal space between a number and its unit or % – it can break at the line end (Ziffer und Einheit gehören zusammen)", "suggestion": "find_replace mode grep: find \"(\\d)\\x{0020}(?=%|€|mm|cm|kg)\", replace \"$1~s\" (narrow no-break space U+202F) or \"$1~S\" (no-break space U+00A0)", "source": "Duden, Satz und Korrektur; DIN 5008" },
|
|
15
|
+
{ "id": "number_unit_space", "locales": ["en"], "category": "numbers", "severity": "warning", "kind": "grep", "pattern": "\\d\\x{0020}(?=°C|°F|(?:mm|cm|m|km|kg|g|ml|l|h|min|s|in|ft|lb|oz)(?![\\l\\u]))", "message": "Normal space between a number and its unit – it can break at the line end", "suggestion": "find_replace mode grep: find \"(\\d)\\x{0020}(?=mm|cm|kg)\", replace \"$1~S\" (no-break space U+00A0)", "source": "Bringhurst, Elements of Typographic Style" },
|
|
16
|
+
{ "id": "number_unit_missing_space", "locales": ["de", "de-CH"], "category": "numbers", "severity": "warning", "kind": "grep", "pattern": "\\d(?=%|‰|€|(?:mm|cm|km|kg|ml)(?![\\l\\u]))", "message": "No space between a number and its unit or % (50% instead of 50 %)", "suggestion": "find_replace mode grep: find \"(\\d)(?=%|€|mm|cm|km|kg|ml)\", replace \"$1~s\" (narrow no-break space U+202F)", "source": "DIN 5008; Duden, Satz und Korrektur" },
|
|
17
|
+
{ "id": "abbreviation_space", "locales": ["de", "de-CH"], "category": "abbreviations", "severity": "warning", "kind": "grep", "pattern": "\\b(?:z\\.\\x{0020}?B\\.|u\\.\\x{0020}?a\\.|d\\.\\x{0020}?h\\.|z\\.\\x{0020}?T\\.|u\\.\\x{0020}?U\\.|v\\.\\x{0020}?a\\.|s\\.\\x{0020}?o\\.|s\\.\\x{0020}?u\\.|u\\.\\x{0020}?v\\.\\x{0020}?m\\.|i\\.\\x{0020}?d\\.\\x{0020}?R\\.)", "message": "Multi-part abbreviation without a space or with a normal space (z.B. / z. B. – gehört ein schmales geschütztes Leerzeichen)", "suggestion": "find_replace mode grep: find \"z\\.\\x{0020}?B\\.\", replace \"z.~sB.\" (narrow no-break space U+202F) – one pattern per abbreviation", "source": "Duden, Satz und Korrektur; typokurz 1.6" },
|
|
18
|
+
{ "id": "thousands_grouping", "locales": ["de", "de-CH", "en"], "category": "numbers", "severity": "info", "kind": "grep", "pattern": "(?<![\\d.,])\\d{5,}(?![\\d.,])", "message": "Five or more digits without grouping (Tausendergliederung)", "suggestion": "Group with a narrow no-break space (de: 12 345) or a point/comma as the house style demands; leave years, phone numbers and codes as they are", "source": "DIN 5008; Duden, Satz und Korrektur" },
|
|
19
|
+
{ "id": "empty_paragraph", "locales": ["de", "de-CH", "en"], "category": "paragraph", "severity": "warning", "kind": "grep", "pattern": "^\\r", "message": "Empty paragraph in the text flow (Leerabsatz) – spacing belongs into the paragraph style", "suggestion": "Delete the empty paragraph and set space_before_pt/space_after_pt in the paragraph style; find_replace mode grep: find \"^\\r\", replace \"\"", "source": "Forssman/de Jong, Detailtypografie; typokurz 1.6" },
|
|
20
|
+
{ "id": "double_paragraph_break", "locales": ["de", "de-CH", "en"], "category": "paragraph", "severity": "warning", "kind": "grep", "pattern": "\\r\\r\\r", "message": "Two empty paragraphs in a row", "suggestion": "find_replace mode grep: find \"\\r{2,}\", replace \"\\r\" and use paragraph spacing", "source": "Forssman/de Jong, Detailtypografie" },
|
|
21
|
+
{ "id": "tab_as_indent", "locales": ["de", "de-CH", "en"], "category": "paragraph", "severity": "warning", "kind": "grep", "pattern": "^[\\t\\x{0020}]+", "message": "Tab or spaces at the paragraph start used as an indent (Einzug über Tabulator oder Leerzeichen)", "suggestion": "Remove them and set the first-line indent in the paragraph style; find_replace mode grep: find \"^[\\t\\x{0020}]+\", replace \"\"", "source": "Forssman/de Jong, Detailtypografie; typokurz 1.6" },
|
|
22
|
+
{ "id": "trailing_space", "locales": ["de", "de-CH", "en"], "category": "spacing", "severity": "info", "kind": "grep", "pattern": "[\\t\\x{0020}]+$", "message": "Space or tab before the paragraph mark (Leerzeichen am Absatzende)", "suggestion": "find_replace mode grep: find \"[\\t\\x{0020}]+$\", replace \"\"", "source": "typokurz 1.6" },
|
|
23
|
+
{ "id": "widow", "locales": ["de", "de-CH", "en"], "category": "line_break", "severity": "error", "kind": "lines", "check": "widow", "message": "Column starts with the last line of a paragraph (Hurenkind / widow)", "suggestion": "Set keep_options {keep_lines_together: true, keep_last_lines: 2} on the paragraph style, or rebreak the text", "source": "Forssman/de Jong, Detailtypografie; Wikipedia Hurenkind und Schusterjunge" },
|
|
24
|
+
{ "id": "orphan", "locales": ["de", "de-CH", "en"], "category": "line_break", "severity": "warning", "kind": "lines", "check": "orphan", "message": "Column ends with the first line of a paragraph (Schusterjunge / orphan)", "suggestion": "Set keep_options {keep_lines_together: true, keep_first_lines: 2} on the paragraph style, or rebreak the text", "source": "Forssman/de Jong, Detailtypografie" },
|
|
25
|
+
{ "id": "heading_at_column_end", "locales": ["de", "de-CH", "en"], "category": "line_break", "severity": "warning", "kind": "lines", "check": "heading_at_column_end", "message": "Last line of the column is a one-line paragraph followed by another paragraph (Zwischentitel allein am Spaltenende)", "suggestion": "Set keep_options {keep_with_next: 2} on the heading style", "source": "Forssman/de Jong, Detailtypografie" },
|
|
26
|
+
{ "id": "single_word_last_line", "locales": ["de", "de-CH", "en"], "category": "line_break", "severity": "info", "kind": "lines", "check": "single_word_last_line", "message": "Last line of a paragraph holds a single word or is shorter than min_last_line_chars (Einzelwort-Ausgang)", "suggestion": "Adjust the justification options or tracking of the paragraph, or ask for a small text change", "source": "Forssman/de Jong, Detailtypografie" },
|
|
27
|
+
{ "id": "hyphen_ladder", "locales": ["de", "de-CH", "en"], "category": "hyphenation", "severity": "warning", "kind": "lines", "check": "hyphen_ladder", "message": "More consecutive hyphenated lines than max_consecutive_hyphens allows (Trennstrichleiter)", "suggestion": "Set hyphenation_options {ladder_limit: 3} on the paragraph style", "source": "Forssman/de Jong, Detailtypografie" },
|
|
28
|
+
{ "id": "empty_line_at_column_start", "locales": ["de", "de-CH", "en"], "category": "line_break", "severity": "warning", "kind": "lines", "check": "empty_line_at_column_start", "message": "First line of the column is an empty paragraph (Leerzeile am Spaltenanfang)", "suggestion": "Delete the empty paragraph; use paragraph spacing instead", "source": "Forssman/de Jong, Detailtypografie" },
|
|
29
|
+
{ "id": "column_first_baselines_differ", "locales": ["de", "de-CH", "en"], "category": "line_break", "severity": "info", "kind": "lines", "check": "column_first_baselines_differ", "message": "First baselines of neighbouring columns of the same frame differ by more than 0.1 mm (Spaltenanfänge nicht auf gleicher Höhe)", "suggestion": "Align the paragraphs to the baseline grid or set the same first-baseline offset", "source": "Forssman/de Jong, Detailtypografie" }
|
|
30
|
+
]
|
|
31
|
+
}
|