indesign-cli 0.2.0__py3-none-any.whl

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 (72) hide show
  1. cli_anything/indesign/README.md +32 -0
  2. cli_anything/indesign/__init__.py +1 -0
  3. cli_anything/indesign/__main__.py +5 -0
  4. cli_anything/indesign/core/artifacts.py +57 -0
  5. cli_anything/indesign/core/catalog.py +405 -0
  6. cli_anything/indesign/core/domains.py +178 -0
  7. cli_anything/indesign/core/envelope.py +65 -0
  8. cli_anything/indesign/core/errors.py +30 -0
  9. cli_anything/indesign/core/health.py +46 -0
  10. cli_anything/indesign/core/hidden_backend.py +116 -0
  11. cli_anything/indesign/core/hidden_handler_schemas.py +223 -0
  12. cli_anything/indesign/core/mcp_backend.py +152 -0
  13. cli_anything/indesign/core/node_setup.py +35 -0
  14. cli_anything/indesign/core/paths.py +41 -0
  15. cli_anything/indesign/core/plugins/__init__.py +2 -0
  16. cli_anything/indesign/core/plugins/backend.py +90 -0
  17. cli_anything/indesign/core/plugins/discovery.py +69 -0
  18. cli_anything/indesign/core/plugins/host_actions.py +76 -0
  19. cli_anything/indesign/core/plugins/install.py +38 -0
  20. cli_anything/indesign/core/plugins/manifest.py +279 -0
  21. cli_anything/indesign/core/plugins/validate.py +181 -0
  22. cli_anything/indesign/core/router.py +217 -0
  23. cli_anything/indesign/core/runtime.py +59 -0
  24. cli_anything/indesign/core/scripts.py +44 -0
  25. cli_anything/indesign/core/session.py +68 -0
  26. cli_anything/indesign/indesign_cli.py +320 -0
  27. cli_anything/indesign/node/hidden_handler_bridge.mjs +111 -0
  28. cli_anything/indesign/server/package-lock.json +168 -0
  29. cli_anything/indesign/server/package.json +45 -0
  30. cli_anything/indesign/server/src/advanced/index.js +76 -0
  31. cli_anything/indesign/server/src/core/InDesignMCPServer.js +273 -0
  32. cli_anything/indesign/server/src/core/scriptExecutor.js +271 -0
  33. cli_anything/indesign/server/src/core/sessionManager.js +545 -0
  34. cli_anything/indesign/server/src/handlers/advancedTemplateHandlers.js +1072 -0
  35. cli_anything/indesign/server/src/handlers/bookHandlers.js +490 -0
  36. cli_anything/indesign/server/src/handlers/documentHandlers.js +1472 -0
  37. cli_anything/indesign/server/src/handlers/exportHandlers.js +208 -0
  38. cli_anything/indesign/server/src/handlers/graphicsHandlers.js +605 -0
  39. cli_anything/indesign/server/src/handlers/groupHandlers.js +358 -0
  40. cli_anything/indesign/server/src/handlers/helpHandlers.js +347 -0
  41. cli_anything/indesign/server/src/handlers/index.js +77 -0
  42. cli_anything/indesign/server/src/handlers/layerHandlers.js +75 -0
  43. cli_anything/indesign/server/src/handlers/masterSpreadHandlers.js +451 -0
  44. cli_anything/indesign/server/src/handlers/pageHandlers.js +698 -0
  45. cli_anything/indesign/server/src/handlers/pageItemHandlers.js +704 -0
  46. cli_anything/indesign/server/src/handlers/presentationHandlers.js +220 -0
  47. cli_anything/indesign/server/src/handlers/spreadHandlers.js +348 -0
  48. cli_anything/indesign/server/src/handlers/styleHandlers.js +458 -0
  49. cli_anything/indesign/server/src/handlers/textHandlers.js +431 -0
  50. cli_anything/indesign/server/src/handlers/utilityHandlers.js +83 -0
  51. cli_anything/indesign/server/src/index.js +17 -0
  52. cli_anything/indesign/server/src/types/index.js +106 -0
  53. cli_anything/indesign/server/src/types/toolDefinitionsAdvancedTemplates.js +144 -0
  54. cli_anything/indesign/server/src/types/toolDefinitionsBook.js +224 -0
  55. cli_anything/indesign/server/src/types/toolDefinitionsContent.js +353 -0
  56. cli_anything/indesign/server/src/types/toolDefinitionsDocument.js +409 -0
  57. cli_anything/indesign/server/src/types/toolDefinitionsExport.js +65 -0
  58. cli_anything/indesign/server/src/types/toolDefinitionsLayer.js +40 -0
  59. cli_anything/indesign/server/src/types/toolDefinitionsMasterSpread.js +160 -0
  60. cli_anything/indesign/server/src/types/toolDefinitionsPage.js +271 -0
  61. cli_anything/indesign/server/src/types/toolDefinitionsPageItemGroup.js +437 -0
  62. cli_anything/indesign/server/src/types/toolDefinitionsPresentation.js +83 -0
  63. cli_anything/indesign/server/src/types/toolDefinitionsSpread.js +158 -0
  64. cli_anything/indesign/server/src/types/toolDefinitionsUtility.js +40 -0
  65. cli_anything/indesign/server/src/utils/stringUtils.js +107 -0
  66. cli_anything/indesign/skills/SKILL.md +198 -0
  67. indesign_cli-0.2.0.dist-info/METADATA +267 -0
  68. indesign_cli-0.2.0.dist-info/RECORD +72 -0
  69. indesign_cli-0.2.0.dist-info/WHEEL +5 -0
  70. indesign_cli-0.2.0.dist-info/entry_points.txt +3 -0
  71. indesign_cli-0.2.0.dist-info/licenses/LICENSE +21 -0
  72. indesign_cli-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,409 @@
1
+ /**
2
+ * Document tool definitions for InDesign MCP Server
3
+ * Document management and advanced functionality
4
+ */
5
+
6
+ export const documentToolDefinitions = [
7
+ // =================== DOCUMENT MANAGEMENT ===================
8
+ {
9
+ name: 'get_document_info',
10
+ description: 'Get information about the active document',
11
+ inputSchema: { type: 'object', properties: {},
12
+ additionalProperties: false
13
+ },
14
+ },
15
+ {
16
+ name: 'create_document',
17
+ description: 'Create a new document',
18
+ inputSchema: {
19
+ type: 'object',
20
+ properties: {
21
+ width: { type: 'number', description: 'Document width in mm', default: 210 },
22
+ height: { type: 'number', description: 'Document height in mm', default: 297 },
23
+ pages: { type: 'number', description: 'Number of pages', default: 1 },
24
+ facingPages: { type: 'boolean', description: 'Enable facing pages', default: false },
25
+ pageOrientation: { type: 'string', enum: ['PORTRAIT', 'LANDSCAPE'], default: 'PORTRAIT' },
26
+ bleedTop: { type: 'number', description: 'Top bleed in mm', default: 3 },
27
+ bleedBottom: { type: 'number', description: 'Bottom bleed in mm', default: 3 },
28
+ bleedInside: { type: 'number', description: 'Inside bleed in mm', default: 3 },
29
+ bleedOutside: { type: 'number', description: 'Outside bleed in mm', default: 3 },
30
+ marginTop: { type: 'number', description: 'Top margin in mm', default: 20 },
31
+ marginBottom: { type: 'number', description: 'Bottom margin in mm', default: 20 },
32
+ marginLeft: { type: 'number', description: 'Left margin in mm', default: 20 },
33
+ marginRight: { type: 'number', description: 'Right margin in mm', default: 20 },
34
+ },
35
+ },
36
+ },
37
+ {
38
+ name: 'open_document',
39
+ description: 'Open an existing document',
40
+ inputSchema: {
41
+ type: 'object',
42
+ properties: {
43
+ filePath: { type: 'string', description: 'Path to the document file' },
44
+ },
45
+ required: ['filePath'],
46
+ },
47
+ },
48
+ {
49
+ name: 'save_document',
50
+ description: 'Save the active document',
51
+ inputSchema: {
52
+ type: 'object',
53
+ properties: {
54
+ filePath: { type: 'string', description: 'Path where to save the document' },
55
+ },
56
+ required: ['filePath'],
57
+ },
58
+ },
59
+ {
60
+ name: 'close_document',
61
+ description: 'Close the active document',
62
+ inputSchema: { type: 'object', properties: {},
63
+ additionalProperties: false
64
+ },
65
+ },
66
+
67
+ // =================== DOCUMENT ADVANCED TOOLS ===================
68
+ /* 注释:Preflight检查功能对设计流程不必要
69
+ {
70
+ name: 'preflight_document',
71
+ description: 'Run preflight on the document',
72
+ inputSchema: {
73
+ type: 'object',
74
+ properties: {
75
+ profile: { type: 'string', description: 'Preflight profile name', default: 'Basic' },
76
+ includeWarnings: { type: 'boolean', description: 'Include warnings in report', default: true },
77
+ },
78
+ },
79
+ },
80
+ */
81
+ {
82
+ name: 'zoom_to_page',
83
+ description: 'Zoom to fit page in view',
84
+ inputSchema: {
85
+ type: 'object',
86
+ properties: {
87
+ pageIndex: { type: 'number', description: 'Page index to zoom to' },
88
+ zoomLevel: { type: 'number', description: 'Zoom level (percentage)', default: 100 },
89
+ },
90
+ required: ['pageIndex'],
91
+ },
92
+ },
93
+ /* 注释:数据合并功能对纯设计流程不必要
94
+ {
95
+ name: 'data_merge',
96
+ description: 'Perform data merge operation',
97
+ inputSchema: {
98
+ type: 'object',
99
+ properties: {
100
+ dataSource: { type: 'string', description: 'Path to data source file (CSV, XML, etc.)' },
101
+ targetPage: { type: 'number', description: 'Target page index', default: 0 },
102
+ createNewPages: { type: 'boolean', description: 'Create new pages for each record', default: false },
103
+ removeUnusedPages: { type: 'boolean', description: 'Remove unused pages after merge', default: false },
104
+ },
105
+ required: ['dataSource'],
106
+ },
107
+ },
108
+ */
109
+
110
+ // =================== DOCUMENT ELEMENTS & STYLES ===================
111
+ {
112
+ name: 'get_document_elements',
113
+ description: 'Get all elements in the document',
114
+ inputSchema: {
115
+ type: 'object',
116
+ properties: {
117
+ elementType: { type: 'string', description: 'Type of elements to get (e.g., "all", "text", "graphics", "tables")', default: 'all' },
118
+ },
119
+ },
120
+ },
121
+ {
122
+ name: 'get_document_styles',
123
+ description: 'Get all styles in the document',
124
+ inputSchema: {
125
+ type: 'object',
126
+ properties: {
127
+ styleType: { type: 'string', enum: ['PARAGRAPH', 'CHARACTER', 'OBJECT', 'TABLE', 'CELL'], description: 'Type of styles to get', default: 'PARAGRAPH' },
128
+ },
129
+ },
130
+ },
131
+ {
132
+ name: 'get_document_colors',
133
+ description: 'Get all colors and swatches in the document',
134
+ inputSchema: {
135
+ type: 'object',
136
+ properties: {
137
+ includeSwatches: { type: 'boolean', description: 'Include swatches', default: true },
138
+ includeGradients: { type: 'boolean', description: 'Include gradients', default: true },
139
+ includeTints: { type: 'boolean', description: 'Include tints', default: true },
140
+ },
141
+ },
142
+ },
143
+
144
+ // =================== DOCUMENT PREFERENCES ===================
145
+ {
146
+ name: 'get_document_preferences',
147
+ description: 'Get document preferences and settings',
148
+ inputSchema: {
149
+ type: 'object',
150
+ properties: {
151
+ preferenceType: { type: 'string', enum: ['GENERAL', 'GRID', 'GUIDES', 'HYPHENATION', 'STORY', 'TEXT', 'VIEW'], description: 'Type of preferences to get', default: 'GENERAL' },
152
+ },
153
+ },
154
+ },
155
+ {
156
+ name: 'set_document_preferences',
157
+ description: 'Set document preferences',
158
+ inputSchema: {
159
+ type: 'object',
160
+ properties: {
161
+ preferenceType: { type: 'string', enum: ['GENERAL', 'GRID', 'GUIDES', 'HYPHENATION', 'STORY', 'TEXT', 'VIEW'], description: 'Type of preferences to set', required: true },
162
+ preferences: { type: 'object', description: 'Preference values to set' },
163
+ },
164
+ required: ['preferenceType', 'preferences'],
165
+ },
166
+ },
167
+
168
+ // =================== DOCUMENT STORIES & TEXT ===================
169
+ {
170
+ name: 'get_document_stories',
171
+ description: 'Get all stories in the document',
172
+ inputSchema: {
173
+ type: 'object',
174
+ properties: {
175
+ includeOverset: { type: 'boolean', description: 'Include overset text', default: true },
176
+ includeHidden: { type: 'boolean', description: 'Include hidden text', default: false },
177
+ },
178
+ },
179
+ },
180
+ {
181
+ name: 'find_text_in_document',
182
+ description: 'Find text across the entire document',
183
+ inputSchema: {
184
+ type: 'object',
185
+ properties: {
186
+ searchText: { type: 'string', description: 'Text to search for', required: true },
187
+ replaceText: { type: 'string', description: 'Text to replace with (optional)' },
188
+ caseSensitive: { type: 'boolean', description: 'Case sensitive search', default: false },
189
+ wholeWord: { type: 'boolean', description: 'Whole word search', default: false },
190
+ useRegex: { type: 'boolean', description: 'Use regular expressions', default: false },
191
+ },
192
+ required: ['searchText'],
193
+ },
194
+ },
195
+
196
+ // =================== DOCUMENT LAYERS & ORGANIZATION ===================
197
+ {
198
+ name: 'get_document_layers',
199
+ description: 'Get all layers in the document',
200
+ inputSchema: {
201
+ type: 'object',
202
+ properties: {
203
+ includeHidden: { type: 'boolean', description: 'Include hidden layers', default: true },
204
+ includeLocked: { type: 'boolean', description: 'Include locked layers', default: true },
205
+ },
206
+ },
207
+ },
208
+ {
209
+ name: 'organize_document_layers',
210
+ description: 'Organize and clean up document layers',
211
+ inputSchema: {
212
+ type: 'object',
213
+ properties: {
214
+ deleteEmptyLayers: { type: 'boolean', description: 'Delete empty layers', default: false },
215
+ mergeSimilarLayers: { type: 'boolean', description: 'Merge layers with similar names', default: false },
216
+ sortLayers: { type: 'boolean', description: 'Sort layers alphabetically', default: false },
217
+ },
218
+ },
219
+ },
220
+
221
+ // =================== DOCUMENT HYPERLINKS & INTERACTIVITY ===================
222
+ {
223
+ name: 'get_document_hyperlinks',
224
+ description: 'Get all hyperlinks in the document',
225
+ inputSchema: {
226
+ type: 'object',
227
+ properties: {
228
+ includeDestinations: { type: 'boolean', description: 'Include link destinations', default: true },
229
+ includeSources: { type: 'boolean', description: 'Include link sources', default: true },
230
+ },
231
+ },
232
+ },
233
+ {
234
+ name: 'create_document_hyperlink',
235
+ description: 'Create a hyperlink in the document',
236
+ inputSchema: {
237
+ type: 'object',
238
+ properties: {
239
+ sourceText: { type: 'string', description: 'Text to link', required: true },
240
+ destination: { type: 'string', description: 'URL or destination', required: true },
241
+ linkType: { type: 'string', enum: ['URL', 'PAGE', 'TEXT'], description: 'Type of hyperlink', default: 'URL' },
242
+ pageIndex: { type: 'number', description: 'Target page index (for page links)' },
243
+ },
244
+ required: ['sourceText', 'destination'],
245
+ },
246
+ },
247
+
248
+ // =================== DOCUMENT SECTIONS & NUMBERING ===================
249
+ {
250
+ name: 'get_document_sections',
251
+ description: 'Get all sections in the document',
252
+ inputSchema: { type: 'object', properties: {},
253
+ additionalProperties: false
254
+ },
255
+ },
256
+ {
257
+ name: 'create_document_section',
258
+ description: 'Create a new section in the document',
259
+ inputSchema: {
260
+ type: 'object',
261
+ properties: {
262
+ startPage: { type: 'number', description: 'Page to start section on', required: true },
263
+ sectionPrefix: { type: 'string', description: 'Section prefix' },
264
+ startNumber: { type: 'number', description: 'Starting page number', default: 1 },
265
+ numberingStyle: { type: 'string', enum: ['ARABIC', 'ROMAN_UPPER', 'ROMAN_LOWER', 'LETTER_UPPER', 'LETTER_LOWER'], description: 'Numbering style', default: 'ARABIC' },
266
+ },
267
+ required: ['startPage'],
268
+ },
269
+ },
270
+
271
+ // =================== DOCUMENT XML & STRUCTURE ===================
272
+ /* 注释:XML结构和导出功能对纯设计流程不必要
273
+ {
274
+ name: 'get_document_xml_structure',
275
+ description: 'Get XML structure of the document',
276
+ inputSchema: {
277
+ type: 'object',
278
+ properties: {
279
+ includeTags: { type: 'boolean', description: 'Include XML tags', default: true },
280
+ includeElements: { type: 'boolean', description: 'Include XML elements', default: true },
281
+ },
282
+ },
283
+ },
284
+ {
285
+ name: 'export_document_xml',
286
+ description: 'Export document as XML',
287
+ inputSchema: {
288
+ type: 'object',
289
+ properties: {
290
+ filePath: { type: 'string', description: 'Path to save XML file', required: true },
291
+ includeImages: { type: 'boolean', description: 'Include images in export', default: true },
292
+ includeStyles: { type: 'boolean', description: 'Include style information', default: true },
293
+ },
294
+ required: ['filePath'],
295
+ },
296
+ },
297
+ */
298
+
299
+ // =================== DOCUMENT CLOUD & COLLABORATION ===================
300
+ /* 注释:云存储功能对本地设计流程不必要
301
+ {
302
+ name: 'save_document_to_cloud',
303
+ description: 'Save document to Adobe Creative Cloud',
304
+ inputSchema: {
305
+ type: 'object',
306
+ properties: {
307
+ cloudName: { type: 'string', description: 'Name for the cloud document', required: true },
308
+ includeAssets: { type: 'boolean', description: 'Include linked assets', default: true },
309
+ },
310
+ required: ['cloudName'],
311
+ },
312
+ },
313
+ {
314
+ name: 'open_cloud_document',
315
+ description: 'Open a document from Adobe Creative Cloud',
316
+ inputSchema: {
317
+ type: 'object',
318
+ properties: {
319
+ cloudDocumentId: { type: 'string', description: 'Cloud document ID', required: true },
320
+ },
321
+ required: ['cloudDocumentId'],
322
+ },
323
+ },
324
+ */
325
+
326
+ // =================== DOCUMENT GRID & LAYOUT ===================
327
+ {
328
+ name: 'get_document_grid_settings',
329
+ description: 'Get comprehensive grid settings for the document',
330
+ inputSchema: { type: 'object', properties: {},
331
+ additionalProperties: false
332
+ },
333
+ },
334
+ {
335
+ name: 'set_document_grid_settings',
336
+ description: 'Set comprehensive grid settings for the document',
337
+ inputSchema: {
338
+ $schema: 'https://json-schema.org/draft/2020-12/schema',
339
+ type: 'object',
340
+ properties: {
341
+ documentGrid: { type: 'boolean', description: 'Enable/disable document grid' },
342
+ documentGridColor: { type: 'string', description: 'Document grid color' },
343
+ documentGridIncrement: { type: 'string', description: 'Document grid increment (e.g., "12pt")' },
344
+ documentGridSubdivision: { type: 'number', description: 'Document grid subdivision' },
345
+ baselineGrid: { type: 'boolean', description: 'Enable/disable baseline grid' },
346
+ baselineGridColor: { type: 'string', description: 'Baseline grid color' },
347
+ baselineGridIncrement: { type: 'string', description: 'Baseline grid increment (e.g., "12pt")' },
348
+ baselineGridOffset: { type: 'string', description: 'Baseline grid offset (e.g., "0pt")' },
349
+ baselineGridViewThreshold: { type: 'number', description: 'Baseline grid view threshold' },
350
+ gridViewThreshold: { type: 'number', description: 'Grid view threshold' },
351
+ gridAlignment: { type: 'string', enum: ['ALIGN_TO_GRID', 'ALIGN_TO_BASELINE_GRID', 'ALIGN_TO_DOCUMENT_GRID'], description: 'Grid alignment option' },
352
+ },
353
+ additionalProperties: false
354
+ },
355
+ },
356
+ {
357
+ name: 'get_document_layout_preferences',
358
+ description: 'Get layout preferences and settings for the document',
359
+ inputSchema: { type: 'object', properties: {},
360
+ additionalProperties: false
361
+ },
362
+ },
363
+ {
364
+ name: 'set_document_layout_preferences',
365
+ description: 'Set layout preferences for the document',
366
+ inputSchema: {
367
+ type: 'object',
368
+ properties: {
369
+ adjustLayout: { type: 'boolean', description: 'Enable/disable adjust layout' },
370
+ adjustLayoutMargins: { type: 'boolean', description: 'Enable/disable adjust layout margins' },
371
+ adjustLayoutPageBreaks: { type: 'boolean', description: 'Enable/disable adjust layout page breaks' },
372
+ adjustLayoutRules: { type: 'string', description: 'Adjust layout rules' },
373
+ alignDistributeBounds: { type: 'string', enum: ['ALIGN_TO_SELECTION', 'ALIGN_TO_MARGINS', 'ALIGN_TO_PAGE'], description: 'Align distribute bounds' },
374
+ alignDistributeSpacing: { type: 'string', enum: ['DISTRIBUTE_SPACE_BETWEEN', 'DISTRIBUTE_SPACE_AROUND'], description: 'Align distribute spacing' },
375
+ smartGuidePreferences: { type: 'boolean', description: 'Enable/disable smart guide preferences' },
376
+ },
377
+ },
378
+ },
379
+
380
+ // =================== DOCUMENT VALIDATION & CLEANUP ===================
381
+ /* 注释:文档验证和清理功能对设计创作流程不必要
382
+ {
383
+ name: 'validate_document',
384
+ description: 'Validate document structure and content',
385
+ inputSchema: {
386
+ type: 'object',
387
+ properties: {
388
+ checkLinks: { type: 'boolean', description: 'Check for broken links', default: true },
389
+ checkFonts: { type: 'boolean', description: 'Check for missing fonts', default: true },
390
+ checkImages: { type: 'boolean', description: 'Check for missing images', default: true },
391
+ checkStyles: { type: 'boolean', description: 'Check for unused styles', default: false },
392
+ },
393
+ },
394
+ },
395
+ {
396
+ name: 'cleanup_document',
397
+ description: 'Clean up document (remove unused elements)',
398
+ inputSchema: {
399
+ type: 'object',
400
+ properties: {
401
+ removeUnusedStyles: { type: 'boolean', description: 'Remove unused styles', default: false },
402
+ removeUnusedColors: { type: 'boolean', description: 'Remove unused colors', default: false },
403
+ removeUnusedLayers: { type: 'boolean', description: 'Remove unused layers', default: false },
404
+ removeHiddenElements: { type: 'boolean', description: 'Remove hidden elements', default: false },
405
+ },
406
+ },
407
+ },
408
+ */
409
+ ];
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Export tool definitions for InDesign MCP Server
3
+ * Export, packaging, and production functionality
4
+ */
5
+
6
+ export const exportToolDefinitions = [
7
+ // =================== EXPORT MANAGEMENT ===================
8
+ {
9
+ name: 'export_pdf',
10
+ description: 'Export document to PDF',
11
+ inputSchema: {
12
+ type: 'object',
13
+ properties: {
14
+ filePath: { type: 'string', description: 'Output PDF file path' },
15
+ quality: { type: 'string', enum: ['PRESS', 'PRINT', 'SCREEN', 'DIGITAL'], default: 'PRINT' },
16
+ includeMarks: { type: 'boolean', description: 'Include printer marks', default: false },
17
+ includeBleed: { type: 'boolean', description: 'Include bleed', default: false },
18
+ pages: { type: 'string', description: 'Page range (e.g., "1-5", "all")', default: 'all' },
19
+ },
20
+ required: ['filePath'],
21
+ },
22
+ },
23
+ {
24
+ name: 'export_images',
25
+ description: 'Export pages as images',
26
+ inputSchema: {
27
+ type: 'object',
28
+ properties: {
29
+ outputPath: { type: 'string', description: 'Output directory path' },
30
+ format: { type: 'string', enum: ['JPEG', 'PNG', 'TIFF'], default: 'JPEG' },
31
+ resolution: { type: 'number', description: 'Resolution in DPI', default: 300 },
32
+ pages: { type: 'string', description: 'Page range (e.g., "1-5", "all")', default: 'all' },
33
+ quality: { type: 'number', description: 'Quality (1-100 for JPEG)', default: 80 },
34
+ },
35
+ required: ['outputPath'],
36
+ },
37
+ },
38
+ {
39
+ name: 'export_epub',
40
+ description: 'Export document to EPUB',
41
+ inputSchema: {
42
+ type: 'object',
43
+ properties: {
44
+ filePath: { type: 'string', description: 'Output EPUB file path' },
45
+ includeImages: { type: 'boolean', description: 'Include images', default: true },
46
+ includeStyles: { type: 'boolean', description: 'Include styles', default: true },
47
+ },
48
+ required: ['filePath'],
49
+ },
50
+ },
51
+ {
52
+ name: 'package_document',
53
+ description: 'Package document for printing',
54
+ inputSchema: {
55
+ type: 'object',
56
+ properties: {
57
+ outputPath: { type: 'string', description: 'Output directory path' },
58
+ includeFonts: { type: 'boolean', description: 'Include fonts', default: true },
59
+ includeLinks: { type: 'boolean', description: 'Include linked files', default: true },
60
+ includeProfiles: { type: 'boolean', description: 'Include color profiles', default: true },
61
+ },
62
+ required: ['outputPath'],
63
+ },
64
+ },
65
+ ];
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Layer tool definitions for InDesign MCP Server
3
+ * Layer management and functionality
4
+ */
5
+
6
+ export const layerToolDefinitions = [
7
+ // =================== LAYERS MANAGEMENT ===================
8
+ {
9
+ name: 'create_layer',
10
+ description: 'Create a new layer',
11
+ inputSchema: {
12
+ type: 'object',
13
+ properties: {
14
+ name: { type: 'string', description: 'Layer name' },
15
+ visible: { type: 'boolean', description: 'Layer visibility', default: true },
16
+ locked: { type: 'boolean', description: 'Layer locked state', default: false },
17
+ color: { type: 'string', description: 'Layer color (RGB values as comma-separated string or UI color name)', default: 'BLUE' },
18
+ },
19
+ required: ['name'],
20
+ },
21
+ },
22
+ {
23
+ name: 'set_active_layer',
24
+ description: 'Set the active layer',
25
+ inputSchema: {
26
+ type: 'object',
27
+ properties: {
28
+ layerName: { type: 'string', description: 'Layer name to activate' },
29
+ },
30
+ required: ['layerName'],
31
+ },
32
+ },
33
+ {
34
+ name: 'list_layers',
35
+ description: 'List all layers in the document',
36
+ inputSchema: { type: 'object', properties: {},
37
+ additionalProperties: false
38
+ },
39
+ },
40
+ ];
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Master Spread tool definitions for InDesign MCP Server
3
+ * Master spread template management and functionality
4
+ */
5
+
6
+ export const masterSpreadToolDefinitions = [
7
+ // =================== MASTER SPREAD MANAGEMENT ===================
8
+ {
9
+ name: 'create_master_spread',
10
+ description: 'Create a new master spread',
11
+ inputSchema: {
12
+ type: 'object',
13
+ properties: {
14
+ name: { type: 'string', description: 'Master spread name' },
15
+ baseName: { type: 'string', description: 'Base name for the master spread' },
16
+ namePrefix: { type: 'string', description: 'Name prefix for the master spread' },
17
+ pageColor: { type: 'string', description: 'Page color (RGB values as comma-separated string or UI color name)' },
18
+ showMasterItems: { type: 'boolean', description: 'Show master items on document pages', default: true },
19
+ },
20
+ required: ['name'],
21
+ },
22
+ },
23
+ {
24
+ name: 'list_master_spreads',
25
+ description: 'List all master spreads in the document',
26
+ inputSchema: { type: 'object', properties: {},
27
+ additionalProperties: false
28
+ },
29
+ },
30
+ {
31
+ name: 'delete_master_spread',
32
+ description: 'Delete a master spread',
33
+ inputSchema: {
34
+ type: 'object',
35
+ properties: {
36
+ name: { type: 'string', description: 'Master spread name to delete' },
37
+ },
38
+ required: ['name'],
39
+ },
40
+ },
41
+ {
42
+ name: 'duplicate_master_spread',
43
+ description: 'Duplicate a master spread',
44
+ inputSchema: {
45
+ type: 'object',
46
+ properties: {
47
+ name: { type: 'string', description: 'Master spread name to duplicate' },
48
+ newName: { type: 'string', description: 'Name for the duplicated master spread' },
49
+ position: { type: 'string', enum: ['AT_END', 'AT_BEGINNING', 'BEFORE', 'AFTER'], default: 'AT_END' },
50
+ },
51
+ required: ['name', 'newName'],
52
+ },
53
+ },
54
+ {
55
+ name: 'apply_master_spread',
56
+ description: 'Apply a master spread to pages',
57
+ inputSchema: {
58
+ type: 'object',
59
+ properties: {
60
+ masterName: { type: 'string', description: 'Master spread name to apply' },
61
+ pageRange: { type: 'string', description: 'Page range (e.g., "1-5", "all")', default: 'all' },
62
+ },
63
+ required: ['masterName'],
64
+ },
65
+ },
66
+ {
67
+ name: 'create_master_text_frame',
68
+ description: 'Create a text frame on a master spread',
69
+ inputSchema: {
70
+ type: 'object',
71
+ properties: {
72
+ masterName: { type: 'string', description: 'Master spread name' },
73
+ content: { type: 'string', description: 'Text content for the frame' },
74
+ x: { type: 'number', description: 'X position in mm', default: 10 },
75
+ y: { type: 'number', description: 'Y position in mm', default: 10 },
76
+ width: { type: 'number', description: 'Width in mm', default: 100 },
77
+ height: { type: 'number', description: 'Height in mm', default: 50 },
78
+ fontSize: { type: 'number', description: 'Font size in points', default: 12 },
79
+ fontFamily: { type: 'string', description: 'Font family name', default: 'Helvetica Neue' },
80
+ textColor: { type: 'string', description: 'Text color (RGB hex or name)', default: 'Black' },
81
+ alignment: { type: 'string', enum: ['LEFT_ALIGN', 'CENTER_ALIGN', 'RIGHT_ALIGN', 'JUSTIFY'], default: 'LEFT_ALIGN' },
82
+ isPrimaryTextFrame: { type: 'boolean', description: 'Set as primary text frame', default: false },
83
+ },
84
+ required: ['masterName', 'content'],
85
+ },
86
+ },
87
+ {
88
+ name: 'create_master_rectangle',
89
+ description: 'Create a rectangle on a master spread',
90
+ inputSchema: {
91
+ type: 'object',
92
+ properties: {
93
+ masterName: { type: 'string', description: 'Master spread name' },
94
+ x: { type: 'number', description: 'X position in mm' },
95
+ y: { type: 'number', description: 'Y position in mm' },
96
+ width: { type: 'number', description: 'Width in mm' },
97
+ height: { type: 'number', description: 'Height in mm' },
98
+ fillColor: { type: 'string', description: 'Fill color (RGB hex or swatch name)' },
99
+ strokeColor: { type: 'string', description: 'Stroke color' },
100
+ strokeWidth: { type: 'number', description: 'Stroke width in points', default: 1 },
101
+ cornerRadius: { type: 'number', description: 'Corner radius in mm', default: 0 },
102
+ },
103
+ required: ['masterName', 'x', 'y', 'width', 'height'],
104
+ },
105
+ },
106
+ {
107
+ name: 'create_master_guides',
108
+ description: 'Create guides on a master spread',
109
+ inputSchema: {
110
+ type: 'object',
111
+ properties: {
112
+ masterName: { type: 'string', description: 'Master spread name' },
113
+ numberOfRows: { type: 'number', description: 'Number of rows', default: 0 },
114
+ numberOfColumns: { type: 'number', description: 'Number of columns', default: 0 },
115
+ rowGutter: { type: 'number', description: 'Row gutter in mm', default: 5 },
116
+ columnGutter: { type: 'number', description: 'Column gutter in mm', default: 5 },
117
+ guideColor: { type: 'string', description: 'Guide color (RGB values as comma-separated string or UI color name)', default: 'BLUE' },
118
+ fitMargins: { type: 'boolean', description: 'Fit guides to margins', default: true },
119
+ removeExisting: { type: 'boolean', description: 'Remove existing guides', default: false },
120
+ layerName: { type: 'string', description: 'Layer name to create guides on' },
121
+ },
122
+ required: ['masterName'],
123
+ },
124
+ },
125
+ {
126
+ name: 'get_master_spread_info',
127
+ description: 'Get detailed information about a master spread',
128
+ inputSchema: {
129
+ type: 'object',
130
+ properties: {
131
+ name: { type: 'string', description: 'Master spread name' },
132
+ },
133
+ required: ['name'],
134
+ },
135
+ },
136
+ {
137
+ name: 'detach_master_items',
138
+ description: 'Detach master page items from a page',
139
+ inputSchema: {
140
+ type: 'object',
141
+ properties: {
142
+ pageIndex: { type: 'number', description: 'Page index' },
143
+ itemIndex: { type: 'number', description: 'Master item index to detach (optional, detaches all if not specified)' },
144
+ },
145
+ required: ['pageIndex'],
146
+ },
147
+ },
148
+ {
149
+ name: 'remove_master_override',
150
+ description: 'Remove override from a master page item',
151
+ inputSchema: {
152
+ type: 'object',
153
+ properties: {
154
+ pageIndex: { type: 'number', description: 'Page index' },
155
+ itemIndex: { type: 'number', description: 'Master item index to remove override from' },
156
+ },
157
+ required: ['pageIndex', 'itemIndex'],
158
+ },
159
+ },
160
+ ];