illustrator-mcp-server 1.0.1 → 1.2.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 (71) hide show
  1. package/README.ja.md +36 -27
  2. package/README.md +38 -27
  3. package/dist/executor/cep-transport.d.ts +13 -0
  4. package/dist/executor/cep-transport.d.ts.map +1 -0
  5. package/dist/executor/cep-transport.js.map +1 -0
  6. package/dist/executor/file-transport.d.ts +6 -2
  7. package/dist/executor/file-transport.d.ts.map +1 -1
  8. package/dist/executor/file-transport.js +43 -11
  9. package/dist/executor/file-transport.js.map +1 -1
  10. package/dist/executor/jsx-runner.d.ts +10 -0
  11. package/dist/executor/jsx-runner.d.ts.map +1 -1
  12. package/dist/executor/jsx-runner.js +114 -33
  13. package/dist/executor/jsx-runner.js.map +1 -1
  14. package/dist/index.js +12 -2
  15. package/dist/index.js.map +1 -1
  16. package/dist/jsx/helpers/common.jsx +3 -1
  17. package/dist/tools/export/export-pdf.d.ts.map +1 -1
  18. package/dist/tools/export/export-pdf.js +2 -7
  19. package/dist/tools/export/export-pdf.js.map +1 -1
  20. package/dist/tools/export/export.d.ts.map +1 -1
  21. package/dist/tools/export/export.js +2 -14
  22. package/dist/tools/export/export.js.map +1 -1
  23. package/dist/tools/modify/apply-color-profile.d.ts.map +1 -1
  24. package/dist/tools/modify/apply-color-profile.js +2 -24
  25. package/dist/tools/modify/apply-color-profile.js.map +1 -1
  26. package/dist/tools/modify/convert-to-outlines.d.ts.map +1 -1
  27. package/dist/tools/modify/convert-to-outlines.js +2 -27
  28. package/dist/tools/modify/convert-to-outlines.js.map +1 -1
  29. package/dist/tools/modify/create-ellipse.d.ts.map +1 -1
  30. package/dist/tools/modify/create-ellipse.js +7 -55
  31. package/dist/tools/modify/create-ellipse.js.map +1 -1
  32. package/dist/tools/modify/create-line.d.ts.map +1 -1
  33. package/dist/tools/modify/create-line.js +6 -42
  34. package/dist/tools/modify/create-line.js.map +1 -1
  35. package/dist/tools/modify/create-path.d.ts.map +1 -1
  36. package/dist/tools/modify/create-path.js +7 -57
  37. package/dist/tools/modify/create-path.js.map +1 -1
  38. package/dist/tools/modify/create-rectangle.d.ts.map +1 -1
  39. package/dist/tools/modify/create-rectangle.js +7 -55
  40. package/dist/tools/modify/create-rectangle.js.map +1 -1
  41. package/dist/tools/modify/create-text-frame.d.ts.map +1 -1
  42. package/dist/tools/modify/create-text-frame.js +25 -43
  43. package/dist/tools/modify/create-text-frame.js.map +1 -1
  44. package/dist/tools/modify/modify-object.d.ts.map +1 -1
  45. package/dist/tools/modify/modify-object.js +23 -62
  46. package/dist/tools/modify/modify-object.js.map +1 -1
  47. package/dist/tools/modify/shared.d.ts +35 -0
  48. package/dist/tools/modify/shared.d.ts.map +1 -0
  49. package/dist/tools/modify/shared.js +91 -0
  50. package/dist/tools/modify/shared.js.map +1 -0
  51. package/dist/tools/read/get-colors.d.ts.map +1 -1
  52. package/dist/tools/read/get-colors.js +28 -31
  53. package/dist/tools/read/get-colors.js.map +1 -1
  54. package/dist/tools/read/get-effects.d.ts.map +1 -1
  55. package/dist/tools/read/get-effects.js +1 -3
  56. package/dist/tools/read/get-effects.js.map +1 -1
  57. package/dist/tools/read/get-images.d.ts.map +1 -1
  58. package/dist/tools/read/get-images.js +49 -7
  59. package/dist/tools/read/get-images.js.map +1 -1
  60. package/dist/tools/read/get-path-items.d.ts.map +1 -1
  61. package/dist/tools/read/get-path-items.js +5 -4
  62. package/dist/tools/read/get-path-items.js.map +1 -1
  63. package/dist/tools/read/list-text-frames.js +3 -3
  64. package/dist/tools/utility/preflight-check.d.ts.map +1 -1
  65. package/dist/tools/utility/preflight-check.js +102 -33
  66. package/dist/tools/utility/preflight-check.js.map +1 -1
  67. package/dist/utils/image-header.d.ts +11 -0
  68. package/dist/utils/image-header.d.ts.map +1 -0
  69. package/dist/utils/image-header.js +280 -0
  70. package/dist/utils/image-header.js.map +1 -0
  71. package/package.json +3 -4
package/README.ja.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # Illustrator MCP Server
4
4
 
5
+ [![npm](https://img.shields.io/npm/v/illustrator-mcp-server.svg)](https://www.npmjs.com/package/illustrator-mcp-server)
5
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![Node.js](https://img.shields.io/badge/Node.js-20%2B-green.svg)](https://nodejs.org/)
7
- [![Platform](https://img.shields.io/badge/Platform-macOS-lightgrey.svg)]()
7
+ [![Platform](https://img.shields.io/badge/Platform-macOS%20%7C%20Windows-lightgrey.svg)]()
8
8
  [![Illustrator](https://img.shields.io/badge/Illustrator-CC%202024%2B-orange.svg)](https://www.adobe.com/products/illustrator.html)
9
9
  [![MCP](https://img.shields.io/badge/MCP-Compatible-purple.svg)](https://modelcontextprotocol.io/)
10
10
 
@@ -64,52 +64,58 @@ Claude: → create_rectangle を実行
64
64
 
65
65
  | 要件 | バージョン |
66
66
  |---|---|
67
- | macOS | osascript 依存 |
67
+ | macOS または Windows | macOS: osascript / Windows: PowerShell COM(実機未検証) |
68
68
  | Adobe Illustrator | CC 2024 以降 |
69
69
  | Node.js | 20 以降 |
70
70
 
71
- > **Note:** 初回実行時に macOS のオートメーション権限ダイアログが表示されます。
71
+ > **macOS:** 初回実行時にオートメーション権限ダイアログが表示されます。
72
72
  > システム設定 > プライバシーとセキュリティ > オートメーション で許可してください。
73
73
 
74
+ > **Note:** 操作系・書き出し系ツールの実行時、Illustrator がフォアグラウンドに切り替わります。Illustrator はアクティブな状態でないとこれらの処理を実行できないためです。
75
+
74
76
  ---
75
77
 
76
78
  ## セットアップ
77
79
 
78
- ### インストール
79
-
80
- ```bash
81
- git clone https://github.com/ie3jp/illustrator-mcp-server.git
82
- cd illustrator-mcp-server
83
- npm install
84
- npm run build
85
- ```
86
-
87
- ### Claude Code に登録
80
+ ### Claude Code
88
81
 
89
82
  ```bash
90
- claude mcp add illustrator-mcp -- node /path/to/illustrator-mcp-server/dist/index.js
83
+ claude mcp add illustrator-mcp -- npx illustrator-mcp-server
91
84
  ```
92
85
 
93
- ### Claude Desktop に登録
86
+ ### Claude Desktop
94
87
 
95
88
  `claude_desktop_config.json` に追加:
89
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
90
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
96
91
 
97
92
  ```json
98
93
  {
99
94
  "mcpServers": {
100
95
  "illustrator": {
101
- "command": "node",
102
- "args": ["/path/to/illustrator-mcp-server/dist/index.js"]
96
+ "command": "npx",
97
+ "args": ["illustrator-mcp-server"]
103
98
  }
104
99
  }
105
100
  }
106
101
  ```
107
102
 
103
+ 保存後、Claude Desktop を再起動してください。入力欄にMCPサーバーのインジケーター(ハンマーアイコン)が表示されます。
104
+
105
+ ### ソースから
106
+
107
+ ```bash
108
+ git clone https://github.com/ie3jp/illustrator-mcp-server.git
109
+ cd illustrator-mcp-server
110
+ npm install
111
+ npm run build
112
+ claude mcp add illustrator-mcp -- node /path/to/illustrator-mcp-server/dist/index.js
113
+ ```
114
+
108
115
  ### 動作確認
109
116
 
110
117
  ```bash
111
- # MCP Inspector で個別ツールをテスト
112
- npx @modelcontextprotocol/inspector node dist/index.js
118
+ npx @modelcontextprotocol/inspector npx illustrator-mcp-server
113
119
  ```
114
120
 
115
121
  ---
@@ -179,15 +185,17 @@ npx @modelcontextprotocol/inspector node dist/index.js
179
185
  ```mermaid
180
186
  flowchart LR
181
187
  Claude <-->|MCP Protocol| Server["MCP Server\n(TypeScript/Node.js)"]
182
- Server <-->|execFile| osascript
188
+ Server <-->|"execFile (macOS)"| osascript
189
+ Server <-->|"execFile (Windows)"| PS["powershell.exe\n(COM Automation)"]
183
190
  osascript <-->|do javascript| AI["Adobe Illustrator\n(ExtendScript/JSX)"]
191
+ PS <-->|DoJavaScript| AI
184
192
 
185
193
  Server -.->|write| PF["params-{uuid}.json"]
186
194
  PF -.->|read| AI
187
195
  AI -.->|write| RF["result-{uuid}.json"]
188
196
  RF -.->|read| Server
189
197
  Server -.->|generate| JSX["script-{uuid}.jsx\n(BOM UTF-8)"]
190
- Server -.->|generate| AS["run-{uuid}.scpt"]
198
+ Server -.->|generate| Runner["run-{uuid}.scpt / .ps1"]
191
199
  ```
192
200
 
193
201
  ### 通信フロー
@@ -195,14 +203,14 @@ flowchart LR
195
203
  1. Claude が MCP Server のツールを呼び出す
196
204
  2. MCP Server がパラメータを JSON ファイルに書き出す
197
205
  3. 共通ヘルパー + ツール固有コードを結合して BOM 付き UTF-8 の JSX ファイルを生成
198
- 4. AppleScript ファイルを生成し、`osascript` で非同期実行
206
+ 4. macOS: AppleScript (.scpt) を生成し `osascript` で実行 / Windows: PowerShell (.ps1) を生成し COM 経由で実行
199
207
  5. JSX が結果を JSON ファイルに書き出す
200
208
  6. MCP Server が結果を読み取り、Claude に返す
201
209
  7. 一時ファイルを `try/finally` でクリーンアップ
202
210
 
203
211
  ### 座標系
204
212
 
205
- 全ツールに `coordinate_system` パラメータがあります。
213
+ 座標を扱う read / modify ツールでは `coordinate_system` パラメータを受け付けます。export やドキュメント全体に対する utility ツールは、座標変換に依存しないため受け付けません。
206
214
 
207
215
  | 値 | 原点 | Y 軸 | 用途 |
208
216
  |---|---|---|---|
@@ -229,7 +237,7 @@ E2E テストは全 30 ケース(読み取り 16 + 書き出し 4 + ユーテ
229
237
 
230
238
  | 制約 | 詳細 |
231
239
  |---|---|
232
- | macOS 専用 | osascript 依存。Windows 対応は将来検討 |
240
+ | macOS / Windows | macOS は osascript、Windows は PowerShell COM を使用(Windows は実機未検証) |
233
241
  | ライブエフェクト | ExtendScript DOM の制約により、ドロップシャドウ等のパラメータ取得不可 |
234
242
  | カラープロファイル変換 | プロファイル割り当てのみ。完全な ICC 変換は非対応 |
235
243
  | 裁ち落とし設定 | ExtendScript API で非公開のため取得不可 |
@@ -246,8 +254,8 @@ illustrator-mcp-server/
246
254
  │ ├── index.ts # エントリポイント
247
255
  │ ├── server.ts # MCP サーバー
248
256
  │ ├── executor/
249
- │ │ ├── jsx-runner.ts # osascript 実行 + 排他制御
250
- │ │ └── file-transport.ts # 一時ファイル管理
257
+ │ │ ├── jsx-runner.ts # トランスポート選択 + 排他制御
258
+ │ │ └── file-transport.ts # 一時ファイル管理 (macOS/Windows)
251
259
  │ ├── tools/
252
260
  │ │ ├── registry.ts # ツール登録
253
261
  │ │ ├── read/ # 読み取り系 15 ツール
@@ -258,6 +266,7 @@ illustrator-mcp-server/
258
266
  │ └── helpers/
259
267
  │ └── common.jsx # ExtendScript 共通ヘルパー
260
268
  ├── test/
269
+ │ ├── unit/ # ユニットテスト
261
270
  │ └── e2e/
262
271
  │ └── smoke-test.ts # E2E スモークテスト
263
272
  └── docs/ # 設計ドキュメント
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # Illustrator MCP Server
4
4
 
5
+ [![npm](https://img.shields.io/npm/v/illustrator-mcp-server.svg)](https://www.npmjs.com/package/illustrator-mcp-server)
5
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![Node.js](https://img.shields.io/badge/Node.js-20%2B-green.svg)](https://nodejs.org/)
7
- [![Platform](https://img.shields.io/badge/Platform-macOS-lightgrey.svg)]()
7
+ [![Platform](https://img.shields.io/badge/Platform-macOS%20%7C%20Windows-lightgrey.svg)]()
8
8
  [![Illustrator](https://img.shields.io/badge/Illustrator-CC%202024%2B-orange.svg)](https://www.adobe.com/products/illustrator.html)
9
9
  [![MCP](https://img.shields.io/badge/MCP-Compatible-purple.svg)](https://modelcontextprotocol.io/)
10
10
 
@@ -12,6 +12,8 @@ An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server for r
12
12
 
13
13
  Control Illustrator directly from AI assistants like Claude — extract design information for web implementation, verify print-ready data, and export assets.
14
14
 
15
+ [![illustrator mcp server MCP server](https://glama.ai/mcp/servers/ie3jp/illustrator-mcp-server/badges/card.svg)](https://glama.ai/mcp/servers/ie3jp/illustrator-mcp-server)
16
+
15
17
  ---
16
18
 
17
19
  ## Usage Examples
@@ -59,50 +61,56 @@ Claude: → create_rectangle
59
61
 
60
62
  ## Prerequisites
61
63
 
62
- - **macOS** (osascript)
64
+ - **macOS** (osascript) or **Windows** (PowerShell COM automation — not yet tested on real hardware)
63
65
  - **Adobe Illustrator CC 2024+**
64
66
 
65
- > On first run, allow automation access in System Settings > Privacy & Security > Automation.
67
+ > **macOS:** On first run, allow automation access in System Settings > Privacy & Security > Automation.
68
+
69
+ > **Note:** Modify and export tools will bring Illustrator to the foreground during execution. Illustrator requires being the active application to process these operations.
66
70
 
67
71
  ---
68
72
 
69
73
  ## Setup
70
74
 
71
- ### Installation
75
+ ### Claude Code
72
76
 
73
77
  ```bash
74
- git clone https://github.com/ie3jp/illustrator-mcp-server.git
75
- cd illustrator-mcp-server
76
- npm install
77
- npm run build
78
- ```
79
-
80
- ### Register with Claude Code
81
-
82
- ```bash
83
- claude mcp add illustrator-mcp -- node /path/to/illustrator-mcp-server/dist/index.js
78
+ claude mcp add illustrator-mcp -- npx illustrator-mcp-server
84
79
  ```
85
80
 
86
- ### Register with Claude Desktop
81
+ ### Claude Desktop
87
82
 
88
83
  Add to `claude_desktop_config.json`:
84
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
85
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
89
86
 
90
87
  ```json
91
88
  {
92
89
  "mcpServers": {
93
90
  "illustrator": {
94
- "command": "node",
95
- "args": ["/path/to/illustrator-mcp-server/dist/index.js"]
91
+ "command": "npx",
92
+ "args": ["illustrator-mcp-server"]
96
93
  }
97
94
  }
98
95
  }
99
96
  ```
100
97
 
101
- ### Verify Installation
98
+ After saving, restart Claude Desktop. The MCP server indicator (hammer icon) should appear in the input area.
99
+
100
+ ### From source
101
+
102
+ ```bash
103
+ git clone https://github.com/ie3jp/illustrator-mcp-server.git
104
+ cd illustrator-mcp-server
105
+ npm install
106
+ npm run build
107
+ claude mcp add illustrator-mcp -- node /path/to/illustrator-mcp-server/dist/index.js
108
+ ```
109
+
110
+ ### Verify
102
111
 
103
112
  ```bash
104
- # Test individual tools with MCP Inspector
105
- npx @modelcontextprotocol/inspector node dist/index.js
113
+ npx @modelcontextprotocol/inspector npx illustrator-mcp-server
106
114
  ```
107
115
 
108
116
  ---
@@ -172,20 +180,22 @@ npx @modelcontextprotocol/inspector node dist/index.js
172
180
  ```mermaid
173
181
  flowchart LR
174
182
  Claude <-->|MCP Protocol| Server["MCP Server\n(TypeScript/Node.js)"]
175
- Server <-->|execFile| osascript
183
+ Server <-->|"execFile (macOS)"| osascript
184
+ Server <-->|"execFile (Windows)"| PS["powershell.exe\n(COM Automation)"]
176
185
  osascript <-->|do javascript| AI["Adobe Illustrator\n(ExtendScript/JSX)"]
186
+ PS <-->|DoJavaScript| AI
177
187
 
178
188
  Server -.->|write| PF["params-{uuid}.json"]
179
189
  PF -.->|read| AI
180
190
  AI -.->|write| RF["result-{uuid}.json"]
181
191
  RF -.->|read| Server
182
192
  Server -.->|generate| JSX["script-{uuid}.jsx\n(BOM UTF-8)"]
183
- Server -.->|generate| AS["run-{uuid}.scpt"]
193
+ Server -.->|generate| Runner["run-{uuid}.scpt / .ps1"]
184
194
  ```
185
195
 
186
196
  ### Coordinate System
187
197
 
188
- All tools accept a `coordinate_system` parameter.
198
+ Geometry-aware read and modify tools accept a `coordinate_system` parameter. Export and document-wide utility tools do not, because their behavior does not depend on coordinate conversion.
189
199
 
190
200
  | Value | Origin | Y-axis | Use case |
191
201
  |---|---|---|---|
@@ -212,7 +222,7 @@ The E2E test suite runs all 30 cases automatically (16 read + 4 export + 2 utili
212
222
 
213
223
  | Limitation | Details |
214
224
  |---|---|
215
- | macOS only | Depends on osascript. Windows support may be considered in the future |
225
+ | macOS / Windows | macOS uses osascript, Windows uses PowerShell COM automation (not yet tested on real hardware) |
216
226
  | Live effects | ExtendScript DOM limitations prevent reading parameters for drop shadows, etc. |
217
227
  | Color profile conversion | Only profile assignment is supported; full ICC conversion is not available |
218
228
  | Bleed settings | Not accessible via the ExtendScript API (undocumented) |
@@ -229,8 +239,8 @@ illustrator-mcp-server/
229
239
  │ ├── index.ts # Entry point
230
240
  │ ├── server.ts # MCP server
231
241
  │ ├── executor/
232
- │ │ ├── jsx-runner.ts # osascript execution + concurrency control
233
- │ │ └── file-transport.ts # Temp file management
242
+ │ │ ├── jsx-runner.ts # Transport selection + concurrency control
243
+ │ │ └── file-transport.ts # Temp file management (macOS/Windows)
234
244
  │ ├── tools/
235
245
  │ │ ├── registry.ts # Tool registration
236
246
  │ │ ├── read/ # 15 read tools
@@ -241,6 +251,7 @@ illustrator-mcp-server/
241
251
  │ └── helpers/
242
252
  │ └── common.jsx # ExtendScript common helpers
243
253
  ├── test/
254
+ │ ├── unit/ # Unit tests
244
255
  │ └── e2e/
245
256
  │ └── smoke-test.ts # E2E smoke test
246
257
  └── docs/ # Design documents
@@ -0,0 +1,13 @@
1
+ export declare const CEP_PORT: number;
2
+ /**
3
+ * CEP Extension 用 JSX を構築する
4
+ * - params を直接埋め込み(ファイル I/O 不要)
5
+ * - writeResultFile をオーバーライドして evalScript 戻り値としてキャプチャ
6
+ */
7
+ export declare function buildJsxForCep(toolScript: string, params: unknown): Promise<string>;
8
+ /**
9
+ * CEP Extension の HTTP サーバーに JSX を送信し、evalScript の戻り値 (JSON 文字列) を返す
10
+ * @param port テスト時にモックサーバーのポートを渡せるよう省略可能
11
+ */
12
+ export declare function postToCep(jsxCode: string, timeout: number, port?: number): Promise<string>;
13
+ //# sourceMappingURL=cep-transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cep-transport.d.ts","sourceRoot":"","sources":["../../src/executor/cep-transport.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,EAAE,MAEd,CAAC;AAOV;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,MAAM,CAAC,CAejB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAA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I,CAAqD,CAAC;oBACpF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;wBACf,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,sBAAsB,CAAC,CAAC,CAAC;oBAC5D,CAAC;yBAAM,CAAC;wBACN,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;oBACjC,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,MAAM,CAAC,IAAI,KAAK,CAAC,qCAAqC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC/E,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAwB,EAAE,EAAE;YAC3C,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,YAAY,CAAC,KAAK,CAAC,CAAC;YAEpB,IAAI,CAAC,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;gBAC9B,MAAM,CAAC,IAAI,KAAK,CACd,8DAA8D,QAAQ,IAAI;oBAC1E,8EAA8E;oBAC9E,yEAAyE,CAC1E,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,CAAC,CAAC,CAAC;YACZ,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChB,GAAG,CAAC,GAAG,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,18 +1,22 @@
1
- export declare const TMP_DIR = "/tmp/illustrator-mcp";
1
+ export declare const TMP_DIR: string;
2
2
  export interface TempFiles {
3
3
  id: string;
4
4
  paramsPath: string;
5
5
  scriptPath: string;
6
- scptPath: string;
6
+ /** macOS: AppleScript (.scpt) / Windows: PowerShell (.ps1) */
7
+ runnerPath: string;
7
8
  resultPath: string;
8
9
  }
9
10
  export declare function ensureTmpDir(): Promise<void>;
10
11
  export declare function createTempFiles(): TempFiles;
11
12
  export declare function writeParams(paramsPath: string, params: unknown): Promise<void>;
12
13
  export declare function writeJsx(scriptPath: string, jsxCode: string): Promise<void>;
14
+ /** macOS 用 AppleScript 生成 */
13
15
  export declare function writeAppleScript(scptPath: string, scriptPath: string, options?: {
14
16
  activate?: boolean;
15
17
  }): Promise<void>;
18
+ /** Windows 用 PowerShell スクリプト生成 */
19
+ export declare function writePowerShellScript(ps1Path: string, scriptPath: string): Promise<void>;
16
20
  export declare function readResult(resultPath: string): Promise<unknown>;
17
21
  export declare function cleanupTempFiles(files: TempFiles): Promise<void>;
18
22
  export declare function cleanupTmpDirSync(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"file-transport.d.ts","sourceRoot":"","sources":["../../src/executor/file-transport.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,yBAAyB,CAAC;AAG9C,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAElD;AAED,wBAAgB,eAAe,IAAI,SAAS,CAS3C;AAED,wBAAsB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpF;AAED,wBAAsB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjF;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/B,OA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CAGrE;AAED,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAatE;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC"}
@@ -1,19 +1,21 @@
1
1
  import { randomUUID } from 'crypto';
2
2
  import * as fs from 'fs/promises';
3
3
  import { rmSync } from 'fs';
4
+ import * as os from 'os';
4
5
  import * as path from 'path';
5
- export const TMP_DIR = '/tmp/illustrator-mcp';
6
+ export const TMP_DIR = path.join(os.tmpdir(), 'illustrator-mcp');
6
7
  const BOM = '\uFEFF';
7
8
  export async function ensureTmpDir() {
8
9
  await fs.mkdir(TMP_DIR, { recursive: true });
9
10
  }
10
11
  export function createTempFiles() {
11
12
  const id = randomUUID();
13
+ const ext = process.platform === 'win32' ? 'ps1' : 'scpt';
12
14
  return {
13
15
  id,
14
16
  paramsPath: path.join(TMP_DIR, `params-${id}.json`),
15
17
  scriptPath: path.join(TMP_DIR, `script-${id}.jsx`),
16
- scptPath: path.join(TMP_DIR, `run-${id}.scpt`),
18
+ runnerPath: path.join(TMP_DIR, `run-${id}.${ext}`),
17
19
  resultPath: path.join(TMP_DIR, `result-${id}.json`),
18
20
  };
19
21
  }
@@ -23,33 +25,63 @@ export async function writeParams(paramsPath, params) {
23
25
  export async function writeJsx(scriptPath, jsxCode) {
24
26
  await fs.writeFile(scriptPath, BOM + jsxCode, 'utf-8');
25
27
  }
28
+ /** macOS 用 AppleScript 生成 */
26
29
  export async function writeAppleScript(scptPath, scriptPath, options) {
27
30
  const lines = ['tell application "Adobe Illustrator"'];
28
31
  if (options?.activate) {
29
32
  lines.push(' activate');
30
33
  }
31
- lines.push(` do javascript of file "${scriptPath}"`);
34
+ const escaped = scriptPath.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
35
+ lines.push(` do javascript of file "${escaped}"`);
32
36
  lines.push('end tell');
33
37
  await fs.writeFile(scptPath, lines.join('\n'), 'utf-8');
34
38
  }
39
+ /** Windows 用 PowerShell スクリプト生成 */
40
+ export async function writePowerShellScript(ps1Path, scriptPath) {
41
+ // ExtendScript の File() はスラッシュ区切りを要求
42
+ const jsxPathForward = scriptPath.replace(/\\/g, '/');
43
+ const jsxPathEscaped = jsxPathForward.replace(/'/g, "\\'");
44
+ const lines = [
45
+ 'try {',
46
+ ' $ai = New-Object -ComObject "Illustrator.Application" -ErrorAction Stop',
47
+ ` $ai.DoJavaScript("$.evalFile(new File('${jsxPathEscaped}'))")`,
48
+ '} catch {',
49
+ ' Write-Error "Illustrator COM automation failed: $_"',
50
+ ' exit 1',
51
+ '}',
52
+ ];
53
+ await fs.writeFile(ps1Path, lines.join('\n'), 'utf-8');
54
+ }
35
55
  export async function readResult(resultPath) {
36
56
  const raw = await fs.readFile(resultPath, 'utf-8');
37
57
  return JSON.parse(raw.replace(/^\uFEFF/, ''));
38
58
  }
39
59
  export async function cleanupTempFiles(files) {
40
- await Promise.allSettled([
41
- fs.unlink(files.paramsPath),
42
- fs.unlink(files.scriptPath),
43
- fs.unlink(files.scptPath),
44
- fs.unlink(files.resultPath),
45
- ]);
60
+ const paths = [
61
+ files.paramsPath,
62
+ files.scriptPath,
63
+ files.runnerPath,
64
+ files.resultPath,
65
+ ];
66
+ const results = await Promise.allSettled(paths.map((p) => fs.unlink(p)));
67
+ results.forEach((result, index) => {
68
+ if (result.status === 'rejected' && !isIgnorableCleanupError(result.reason)) {
69
+ console.warn('Failed to clean up temp file:', paths[index], result.reason);
70
+ }
71
+ });
46
72
  }
47
73
  export function cleanupTmpDirSync() {
48
74
  try {
49
75
  rmSync(TMP_DIR, { recursive: true, force: true });
50
76
  }
51
- catch {
52
- // 終了時のクリーンアップ失敗は無視
77
+ catch (e) {
78
+ console.warn('Failed to clean up temp directory:', TMP_DIR, e);
53
79
  }
54
80
  }
81
+ function isIgnorableCleanupError(error) {
82
+ return (typeof error === 'object'
83
+ && error !== null
84
+ && 'code' in error
85
+ && error.code === 'ENOENT');
86
+ }
55
87
  //# sourceMappingURL=file-transport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AAE,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,oCAAoC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC;AACH,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAc;IAC7C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;WACtB,KAAK,KAAK,IAAI;WACd,MAAM,IAAI,KAAK;WACf,KAAK,CAAC,IAAI,KAAK,QAAQ,CAC3B,CAAC;AACJ,CAAC"}
@@ -1,9 +1,18 @@
1
+ import type { ExecFileException } from 'child_process';
2
+ export type Transport = 'osascript' | 'powershell';
3
+ export declare function resolveTransport(platform?: string, envVar?: string | undefined): Transport;
4
+ declare const TRANSPORT: Transport;
5
+ /**
6
+ * 実行中の JSX がすべて完了するまで待機する(シャットダウン用)
7
+ */
8
+ export declare function waitForPendingExecutions(): Promise<void>;
1
9
  export interface JsxResult {
2
10
  error?: boolean;
3
11
  message?: string;
4
12
  line?: number;
5
13
  [key: string]: unknown;
6
14
  }
15
+ export declare function getExecFailureMessage(error: ExecFileException, stderr: string, timeout: number, transport?: Transport): string;
7
16
  /**
8
17
  * JSX を実行する(排他制御付き — 公開 API)
9
18
  */
@@ -15,4 +24,5 @@ export declare function executeJsx(jsxCode: string, params?: unknown, options?:
15
24
  * 重い処理用の JSX 実行(タイムアウト延長 + Illustrator をフォアグラウンドに)
16
25
  */
17
26
  export declare function executeJsxHeavy(jsxCode: string, params?: unknown): Promise<JsxResult>;
27
+ export { TRANSPORT };
18
28
  //# sourceMappingURL=jsx-runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-runner.d.ts","sourceRoot":"","sources":["../../src/executor/jsx-runner.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,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