illustrator-mcp-server 1.3.1 → 1.4.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/README.ja.md +124 -8
- package/README.md +122 -7
- package/dist/bundle.cjs +444 -282
- package/dist/executor/file-transport.d.ts +2 -0
- package/dist/executor/file-transport.d.ts.map +1 -1
- package/dist/executor/file-transport.js +45 -8
- package/dist/executor/file-transport.js.map +1 -1
- package/dist/executor/jsx-runner.d.ts +17 -0
- package/dist/executor/jsx-runner.d.ts.map +1 -1
- package/dist/executor/jsx-runner.js +47 -2
- package/dist/executor/jsx-runner.js.map +1 -1
- package/dist/jsx/helpers/common.jsx +63 -6
- package/dist/tools/export/export-pdf.d.ts.map +1 -1
- package/dist/tools/export/export-pdf.js +2 -1
- package/dist/tools/export/export-pdf.js.map +1 -1
- package/dist/tools/export/export.d.ts.map +1 -1
- package/dist/tools/export/export.js +54 -3
- package/dist/tools/export/export.js.map +1 -1
- package/dist/tools/modify/align-objects.d.ts.map +1 -1
- package/dist/tools/modify/align-objects.js +4 -5
- package/dist/tools/modify/align-objects.js.map +1 -1
- package/dist/tools/modify/apply-color-profile.d.ts.map +1 -1
- package/dist/tools/modify/apply-color-profile.js +2 -1
- package/dist/tools/modify/apply-color-profile.js.map +1 -1
- package/dist/tools/modify/apply-graphic-style.d.ts.map +1 -1
- package/dist/tools/modify/apply-graphic-style.js +3 -2
- package/dist/tools/modify/apply-graphic-style.js.map +1 -1
- package/dist/tools/modify/apply-text-style.d.ts.map +1 -1
- package/dist/tools/modify/apply-text-style.js +3 -2
- package/dist/tools/modify/apply-text-style.js.map +1 -1
- package/dist/tools/modify/close-document.d.ts.map +1 -1
- package/dist/tools/modify/close-document.js +2 -1
- package/dist/tools/modify/close-document.js.map +1 -1
- package/dist/tools/modify/convert-to-outlines.d.ts.map +1 -1
- package/dist/tools/modify/convert-to-outlines.js +2 -1
- package/dist/tools/modify/convert-to-outlines.js.map +1 -1
- package/dist/tools/modify/create-crop-marks.d.ts.map +1 -1
- package/dist/tools/modify/create-crop-marks.js +34 -3
- package/dist/tools/modify/create-crop-marks.js.map +1 -1
- package/dist/tools/modify/create-document.d.ts.map +1 -1
- package/dist/tools/modify/create-document.js +2 -1
- package/dist/tools/modify/create-document.js.map +1 -1
- package/dist/tools/modify/create-ellipse.js +1 -1
- package/dist/tools/modify/create-gradient.d.ts.map +1 -1
- package/dist/tools/modify/create-gradient.js +2 -1
- package/dist/tools/modify/create-gradient.js.map +1 -1
- package/dist/tools/modify/create-line.js +1 -1
- package/dist/tools/modify/create-path-text.d.ts.map +1 -1
- package/dist/tools/modify/create-path-text.js +2 -1
- package/dist/tools/modify/create-path-text.js.map +1 -1
- package/dist/tools/modify/create-path.js +1 -1
- package/dist/tools/modify/create-rectangle.js +1 -1
- package/dist/tools/modify/create-text-frame.d.ts.map +1 -1
- package/dist/tools/modify/create-text-frame.js +4 -6
- package/dist/tools/modify/create-text-frame.js.map +1 -1
- package/dist/tools/modify/duplicate-objects.d.ts.map +1 -1
- package/dist/tools/modify/duplicate-objects.js +17 -3
- package/dist/tools/modify/duplicate-objects.js.map +1 -1
- package/dist/tools/modify/group-objects.d.ts.map +1 -1
- package/dist/tools/modify/group-objects.js +2 -1
- package/dist/tools/modify/group-objects.js.map +1 -1
- package/dist/tools/modify/manage-artboards.d.ts.map +1 -1
- package/dist/tools/modify/manage-artboards.js +9 -2
- package/dist/tools/modify/manage-artboards.js.map +1 -1
- package/dist/tools/modify/manage-datasets.d.ts.map +1 -1
- package/dist/tools/modify/manage-datasets.js +2 -1
- package/dist/tools/modify/manage-datasets.js.map +1 -1
- package/dist/tools/modify/manage-layers.d.ts.map +1 -1
- package/dist/tools/modify/manage-layers.js +2 -1
- package/dist/tools/modify/manage-layers.js.map +1 -1
- package/dist/tools/modify/manage-linked-images.d.ts.map +1 -1
- package/dist/tools/modify/manage-linked-images.js +2 -1
- package/dist/tools/modify/manage-linked-images.js.map +1 -1
- package/dist/tools/modify/manage-swatches.d.ts.map +1 -1
- package/dist/tools/modify/manage-swatches.js +2 -1
- package/dist/tools/modify/manage-swatches.js.map +1 -1
- package/dist/tools/modify/modify-object.d.ts.map +1 -1
- package/dist/tools/modify/modify-object.js +22 -17
- package/dist/tools/modify/modify-object.js.map +1 -1
- package/dist/tools/modify/move-to-layer.d.ts.map +1 -1
- package/dist/tools/modify/move-to-layer.js +2 -1
- package/dist/tools/modify/move-to-layer.js.map +1 -1
- package/dist/tools/modify/open-document.d.ts.map +1 -1
- package/dist/tools/modify/open-document.js +2 -1
- package/dist/tools/modify/open-document.js.map +1 -1
- package/dist/tools/modify/place-color-chips.d.ts.map +1 -1
- package/dist/tools/modify/place-color-chips.js +4 -5
- package/dist/tools/modify/place-color-chips.js.map +1 -1
- package/dist/tools/modify/place-image.d.ts.map +1 -1
- package/dist/tools/modify/place-image.js +5 -6
- package/dist/tools/modify/place-image.js.map +1 -1
- package/dist/tools/modify/place-style-guide.d.ts.map +1 -1
- package/dist/tools/modify/place-style-guide.js +4 -5
- package/dist/tools/modify/place-style-guide.js.map +1 -1
- package/dist/tools/modify/place-symbol.d.ts.map +1 -1
- package/dist/tools/modify/place-symbol.js +2 -1
- package/dist/tools/modify/place-symbol.js.map +1 -1
- package/dist/tools/modify/replace-color.d.ts.map +1 -1
- package/dist/tools/modify/replace-color.js +2 -1
- package/dist/tools/modify/replace-color.js.map +1 -1
- package/dist/tools/modify/resize-for-variation.d.ts.map +1 -1
- package/dist/tools/modify/resize-for-variation.js +4 -5
- package/dist/tools/modify/resize-for-variation.js.map +1 -1
- package/dist/tools/modify/save-document.d.ts.map +1 -1
- package/dist/tools/modify/save-document.js +2 -1
- package/dist/tools/modify/save-document.js.map +1 -1
- package/dist/tools/modify/select-objects.d.ts.map +1 -1
- package/dist/tools/modify/select-objects.js +2 -1
- package/dist/tools/modify/select-objects.js.map +1 -1
- package/dist/tools/modify/set-z-order.d.ts.map +1 -1
- package/dist/tools/modify/set-z-order.js +2 -1
- package/dist/tools/modify/set-z-order.js.map +1 -1
- package/dist/tools/modify/undo.d.ts.map +1 -1
- package/dist/tools/modify/undo.js +2 -1
- package/dist/tools/modify/undo.js.map +1 -1
- package/dist/tools/modify/ungroup-objects.d.ts.map +1 -1
- package/dist/tools/modify/ungroup-objects.js +2 -1
- package/dist/tools/modify/ungroup-objects.js.map +1 -1
- package/dist/tools/read/check-contrast.d.ts.map +1 -1
- package/dist/tools/read/check-contrast.js +14 -27
- package/dist/tools/read/check-contrast.js.map +1 -1
- package/dist/tools/read/convert-coordinate.d.ts.map +1 -1
- package/dist/tools/read/convert-coordinate.js +2 -1
- package/dist/tools/read/convert-coordinate.js.map +1 -1
- package/dist/tools/read/extract-design-tokens.d.ts.map +1 -1
- package/dist/tools/read/extract-design-tokens.js +2 -1
- package/dist/tools/read/extract-design-tokens.js.map +1 -1
- package/dist/tools/read/find-objects.d.ts.map +1 -1
- package/dist/tools/read/find-objects.js +3 -7
- package/dist/tools/read/find-objects.js.map +1 -1
- package/dist/tools/read/get-artboards.js +1 -1
- package/dist/tools/read/get-colors.d.ts.map +1 -1
- package/dist/tools/read/get-colors.js +2 -1
- package/dist/tools/read/get-colors.js.map +1 -1
- package/dist/tools/read/get-document-info.d.ts.map +1 -1
- package/dist/tools/read/get-document-info.js +2 -3
- package/dist/tools/read/get-document-info.js.map +1 -1
- package/dist/tools/read/get-document-structure.d.ts.map +1 -1
- package/dist/tools/read/get-document-structure.js +3 -7
- package/dist/tools/read/get-document-structure.js.map +1 -1
- package/dist/tools/read/get-effects.d.ts.map +1 -1
- package/dist/tools/read/get-effects.js +3 -7
- package/dist/tools/read/get-effects.js.map +1 -1
- package/dist/tools/read/get-groups.d.ts.map +1 -1
- package/dist/tools/read/get-groups.js +3 -7
- package/dist/tools/read/get-groups.js.map +1 -1
- package/dist/tools/read/get-guidelines.d.ts.map +1 -1
- package/dist/tools/read/get-guidelines.js +3 -7
- package/dist/tools/read/get-guidelines.js.map +1 -1
- package/dist/tools/read/get-images.d.ts.map +1 -1
- package/dist/tools/read/get-images.js +40 -13
- package/dist/tools/read/get-images.js.map +1 -1
- package/dist/tools/read/get-layers.js +1 -1
- package/dist/tools/read/get-overprint-info.d.ts.map +1 -1
- package/dist/tools/read/get-overprint-info.js +2 -3
- package/dist/tools/read/get-overprint-info.js.map +1 -1
- package/dist/tools/read/get-path-items.d.ts.map +1 -1
- package/dist/tools/read/get-path-items.js +11 -9
- package/dist/tools/read/get-path-items.js.map +1 -1
- package/dist/tools/read/get-separation-info.d.ts.map +1 -1
- package/dist/tools/read/get-separation-info.js +2 -3
- package/dist/tools/read/get-separation-info.js.map +1 -1
- package/dist/tools/read/get-symbols.d.ts.map +1 -1
- package/dist/tools/read/get-symbols.js +3 -7
- package/dist/tools/read/get-symbols.js.map +1 -1
- package/dist/tools/read/get-text-frame-detail.d.ts.map +1 -1
- package/dist/tools/read/get-text-frame-detail.js +2 -1
- package/dist/tools/read/get-text-frame-detail.js.map +1 -1
- package/dist/tools/read/list-fonts.d.ts.map +1 -1
- package/dist/tools/read/list-fonts.js +2 -1
- package/dist/tools/read/list-fonts.js.map +1 -1
- package/dist/tools/read/list-text-frames.d.ts.map +1 -1
- package/dist/tools/read/list-text-frames.js +3 -5
- package/dist/tools/read/list-text-frames.js.map +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +2 -0
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/session.d.ts.map +1 -1
- package/dist/tools/session.js +5 -1
- package/dist/tools/session.js.map +1 -1
- package/dist/tools/utility/check-text-consistency.d.ts.map +1 -1
- package/dist/tools/utility/check-text-consistency.js +14 -20
- package/dist/tools/utility/check-text-consistency.js.map +1 -1
- package/dist/tools/utility/preflight-check.d.ts.map +1 -1
- package/dist/tools/utility/preflight-check.js +48 -20
- package/dist/tools/utility/preflight-check.js.map +1 -1
- package/dist/tools/utility/set-illustrator-version.d.ts +3 -0
- package/dist/tools/utility/set-illustrator-version.d.ts.map +1 -0
- package/dist/tools/utility/set-illustrator-version.js +64 -0
- package/dist/tools/utility/set-illustrator-version.js.map +1 -0
- package/dist/tools/utility/set-workflow.js +1 -1
- package/dist/tools/utility/set-workflow.js.map +1 -1
- package/package.json +1 -1
package/dist/bundle.cjs
CHANGED
|
@@ -30283,22 +30283,47 @@ async function writeJsx(scriptPath, jsxCode60) {
|
|
|
30283
30283
|
await fs.writeFile(scriptPath, BOM + jsxCode60, "utf-8");
|
|
30284
30284
|
}
|
|
30285
30285
|
async function writeAppleScript(scptPath, scriptPath, options) {
|
|
30286
|
-
const lines = ['tell application "Adobe Illustrator"'];
|
|
30287
|
-
if (options?.activate) {
|
|
30288
|
-
lines.push(" activate");
|
|
30289
|
-
}
|
|
30290
30286
|
const escaped = scriptPath.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
30291
|
-
|
|
30292
|
-
|
|
30293
|
-
|
|
30287
|
+
const activateLine = options?.activate ? "\n activate" : "";
|
|
30288
|
+
const jsxLine = ` do javascript of file "${escaped}"`;
|
|
30289
|
+
let script;
|
|
30290
|
+
if (options?.appPath) {
|
|
30291
|
+
const appPathEscaped = options.appPath.replace(/"/g, '\\"');
|
|
30292
|
+
script = [
|
|
30293
|
+
`tell application "${appPathEscaped}"${activateLine}`,
|
|
30294
|
+
jsxLine,
|
|
30295
|
+
"end tell"
|
|
30296
|
+
].join("\n");
|
|
30297
|
+
} else {
|
|
30298
|
+
script = [
|
|
30299
|
+
`tell application "Adobe Illustrator"${activateLine}`,
|
|
30300
|
+
jsxLine,
|
|
30301
|
+
"end tell"
|
|
30302
|
+
].join("\n");
|
|
30303
|
+
}
|
|
30304
|
+
await fs.writeFile(scptPath, script, "utf-8");
|
|
30294
30305
|
}
|
|
30295
30306
|
async function writePowerShellScript(ps1Path, scriptPath, options) {
|
|
30296
30307
|
const jsxPathForward = scriptPath.replace(/\\/g, "/");
|
|
30297
30308
|
const jsxPathEscaped = jsxPathForward.replace(/'/g, "\\'");
|
|
30309
|
+
const launchLines = options?.appPath ? [
|
|
30310
|
+
" # \u8D77\u52D5\u6E08\u307F\u306E Illustrator \u304C\u3042\u308C\u3070\u305D\u3061\u3089\u3092\u512A\u5148",
|
|
30311
|
+
' if (-not (Get-Process -Name "Illustrator" -ErrorAction SilentlyContinue)) {',
|
|
30312
|
+
` Start-Process "${options.appPath.replace(/"/g, '`"')}"`,
|
|
30313
|
+
" Start-Sleep -Seconds 5",
|
|
30314
|
+
" }"
|
|
30315
|
+
] : [];
|
|
30316
|
+
const activateLines = options?.activate ? [
|
|
30317
|
+
" try {",
|
|
30318
|
+
' $wsh = New-Object -ComObject "WScript.Shell"',
|
|
30319
|
+
' $wsh.AppActivate("Adobe Illustrator") | Out-Null',
|
|
30320
|
+
" } catch {}"
|
|
30321
|
+
] : [];
|
|
30298
30322
|
const lines = [
|
|
30299
30323
|
"try {",
|
|
30324
|
+
...launchLines,
|
|
30300
30325
|
' $ai = New-Object -ComObject "Illustrator.Application" -ErrorAction Stop',
|
|
30301
|
-
...
|
|
30326
|
+
...activateLines,
|
|
30302
30327
|
` $ai.DoJavaScript("$.evalFile(new File('${jsxPathEscaped}'))")`,
|
|
30303
30328
|
"} catch {",
|
|
30304
30329
|
' Write-Error "Illustrator COM automation failed: $_"',
|
|
@@ -30353,6 +30378,27 @@ function getTransport() {
|
|
|
30353
30378
|
if (!_transport) _transport = resolveTransport();
|
|
30354
30379
|
return _transport;
|
|
30355
30380
|
}
|
|
30381
|
+
function resolveVersionToPath(version2, platform = process.platform) {
|
|
30382
|
+
if (platform === "darwin") {
|
|
30383
|
+
return `/Applications/Adobe Illustrator ${version2}/Adobe Illustrator.app`;
|
|
30384
|
+
}
|
|
30385
|
+
if (platform === "win32") {
|
|
30386
|
+
return `C:\\Program Files\\Adobe\\Adobe Illustrator ${version2}\\Support Files\\Contents\\Windows\\Illustrator.exe`;
|
|
30387
|
+
}
|
|
30388
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
30389
|
+
}
|
|
30390
|
+
var _sessionAppPath;
|
|
30391
|
+
function setAppVersion(version2, platform) {
|
|
30392
|
+
_sessionAppPath = version2 ? resolveVersionToPath(version2, platform) : void 0;
|
|
30393
|
+
}
|
|
30394
|
+
function getAppPath() {
|
|
30395
|
+
return _sessionAppPath;
|
|
30396
|
+
}
|
|
30397
|
+
function getAppVersion() {
|
|
30398
|
+
if (!_sessionAppPath) return void 0;
|
|
30399
|
+
const match = _sessionAppPath.match(/Illustrator (\d{4})/);
|
|
30400
|
+
return match ? match[1] : void 0;
|
|
30401
|
+
}
|
|
30356
30402
|
function waitForPendingExecutions() {
|
|
30357
30403
|
if (pendingCount === 0) return Promise.resolve();
|
|
30358
30404
|
return new Promise((resolve2) => {
|
|
@@ -30412,7 +30458,7 @@ async function executeViaOsascript(jsxCode60, params, timeout, activate) {
|
|
|
30412
30458
|
await writeParams(files.paramsPath, params);
|
|
30413
30459
|
const fullJsx = await buildJsx(jsxCode60, files.paramsPath, files.resultPath);
|
|
30414
30460
|
await writeJsx(files.scriptPath, fullJsx);
|
|
30415
|
-
await writeAppleScript(files.runnerPath, files.scriptPath, { activate });
|
|
30461
|
+
await writeAppleScript(files.runnerPath, files.scriptPath, { activate, appPath: getAppPath() });
|
|
30416
30462
|
await new Promise((resolve2, reject) => {
|
|
30417
30463
|
(0, import_child_process.execFile)("osascript", [files.runnerPath], { timeout }, (error48, _stdout, stderr) => {
|
|
30418
30464
|
if (error48) {
|
|
@@ -30433,7 +30479,7 @@ async function executeViaPowerShell(jsxCode60, params, timeout, activate) {
|
|
|
30433
30479
|
await writeParams(files.paramsPath, params);
|
|
30434
30480
|
const fullJsx = await buildJsx(jsxCode60, files.paramsPath, files.resultPath);
|
|
30435
30481
|
await writeJsx(files.scriptPath, fullJsx);
|
|
30436
|
-
await writePowerShellScript(files.runnerPath, files.scriptPath, { activate });
|
|
30482
|
+
await writePowerShellScript(files.runnerPath, files.scriptPath, { activate, appPath: getAppPath() });
|
|
30437
30483
|
await new Promise((resolve2, reject) => {
|
|
30438
30484
|
(0, import_child_process.execFile)(
|
|
30439
30485
|
"powershell.exe",
|
|
@@ -30628,7 +30674,7 @@ async function resolveCoordinateSystem(explicit) {
|
|
|
30628
30674
|
}
|
|
30629
30675
|
}
|
|
30630
30676
|
var coordinateSystemSchema = external_exports.enum(["artboard-web", "document"]).optional().describe(
|
|
30631
|
-
"Coordinate system.
|
|
30677
|
+
"Coordinate system. Auto-detected from document by default (CMYK/print \u2192 document, RGB/web \u2192 artboard-web). artboard-web: origin at active artboard top-left, Y-down. document: Illustrator native coords, origin at bottom-left, Y-up. Call get_document_info to check which system is active."
|
|
30632
30678
|
);
|
|
30633
30679
|
function detectWorkflow(signals) {
|
|
30634
30680
|
const { colorMode, rulerUnits, rasterEffectResolution, colorProfile } = signals;
|
|
@@ -30696,6 +30742,23 @@ function detectWorkflow(signals) {
|
|
|
30696
30742
|
};
|
|
30697
30743
|
}
|
|
30698
30744
|
|
|
30745
|
+
// src/tools/tool-executor.ts
|
|
30746
|
+
function ensureToolParams(params) {
|
|
30747
|
+
if (params && typeof params === "object" && !Array.isArray(params)) {
|
|
30748
|
+
return params;
|
|
30749
|
+
}
|
|
30750
|
+
return {};
|
|
30751
|
+
}
|
|
30752
|
+
function formatToolResult(result) {
|
|
30753
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
30754
|
+
}
|
|
30755
|
+
async function executeToolJsx(jsxCode60, params, options) {
|
|
30756
|
+
const baseParams = ensureToolParams(params);
|
|
30757
|
+
const resolvedParams = options?.resolveCoordinate ? { ...baseParams, coordinate_system: await resolveCoordinateSystem(baseParams.coordinate_system) } : baseParams;
|
|
30758
|
+
const result = options?.heavy ? await executeJsxHeavy(jsxCode60, resolvedParams) : await executeJsx(jsxCode60, resolvedParams, { activate: options?.activate ?? false });
|
|
30759
|
+
return formatToolResult(result);
|
|
30760
|
+
}
|
|
30761
|
+
|
|
30699
30762
|
// src/tools/modify/shared.ts
|
|
30700
30763
|
var coerceBoolean = external_exports.preprocess(
|
|
30701
30764
|
(val) => {
|
|
@@ -30977,30 +31040,11 @@ function register(server) {
|
|
|
30977
31040
|
});
|
|
30978
31041
|
result.workflowHint = hint;
|
|
30979
31042
|
}
|
|
30980
|
-
return
|
|
30981
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
30982
|
-
};
|
|
31043
|
+
return formatToolResult(result);
|
|
30983
31044
|
}
|
|
30984
31045
|
);
|
|
30985
31046
|
}
|
|
30986
31047
|
|
|
30987
|
-
// src/tools/tool-executor.ts
|
|
30988
|
-
function ensureToolParams(params) {
|
|
30989
|
-
if (params && typeof params === "object" && !Array.isArray(params)) {
|
|
30990
|
-
return params;
|
|
30991
|
-
}
|
|
30992
|
-
return {};
|
|
30993
|
-
}
|
|
30994
|
-
function formatToolResult(result) {
|
|
30995
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
30996
|
-
}
|
|
30997
|
-
async function executeToolJsx(jsxCode60, params, options) {
|
|
30998
|
-
const baseParams = ensureToolParams(params);
|
|
30999
|
-
const resolvedParams = options?.resolveCoordinate ? { ...baseParams, coordinate_system: await resolveCoordinateSystem(baseParams.coordinate_system) } : baseParams;
|
|
31000
|
-
const result = options?.heavy ? await executeJsxHeavy(jsxCode60, resolvedParams) : await executeJsx(jsxCode60, resolvedParams, { activate: options?.activate ?? false });
|
|
31001
|
-
return formatToolResult(result);
|
|
31002
|
-
}
|
|
31003
|
-
|
|
31004
31048
|
// src/tools/read/get-artboards.ts
|
|
31005
31049
|
var jsxCode2 = `
|
|
31006
31050
|
var preflight = preflightChecks();
|
|
@@ -31057,7 +31101,7 @@ if (preflight) {
|
|
|
31057
31101
|
artboards.push(info);
|
|
31058
31102
|
}
|
|
31059
31103
|
|
|
31060
|
-
writeResultFile(RESULT_PATH, { artboards: artboards });
|
|
31104
|
+
writeResultFile(RESULT_PATH, { coordinateSystem: coordSystem, artboards: artboards });
|
|
31061
31105
|
} // end if (!hasError)
|
|
31062
31106
|
} catch (e) {
|
|
31063
31107
|
writeResultFile(RESULT_PATH, { error: true, message: "Failed to get artboard info: " + e.message, line: e.line });
|
|
@@ -31152,7 +31196,7 @@ if (preflight) {
|
|
|
31152
31196
|
layers.push(traverseLayer(doc.layers[i]));
|
|
31153
31197
|
}
|
|
31154
31198
|
|
|
31155
|
-
writeResultFile(RESULT_PATH, { layers: layers });
|
|
31199
|
+
writeResultFile(RESULT_PATH, { coordinateSystem: coordSystem, layers: layers });
|
|
31156
31200
|
} catch (e) {
|
|
31157
31201
|
writeResultFile(RESULT_PATH, { error: true, message: "get_layers: " + e.message, line: e.line });
|
|
31158
31202
|
}
|
|
@@ -31563,9 +31607,7 @@ function register5(server) {
|
|
|
31563
31607
|
annotations: READ_ANNOTATIONS
|
|
31564
31608
|
},
|
|
31565
31609
|
async (params) => {
|
|
31566
|
-
|
|
31567
|
-
const result = await executeJsx(jsxCode5, resolvedParams);
|
|
31568
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
31610
|
+
return executeToolJsx(jsxCode5, params, { resolveCoordinate: true });
|
|
31569
31611
|
}
|
|
31570
31612
|
);
|
|
31571
31613
|
}
|
|
@@ -31794,7 +31836,7 @@ function register6(server) {
|
|
|
31794
31836
|
const resolvedParams = { ...params, coordinate_system: await resolveCoordinateSystem(params.coordinate_system) };
|
|
31795
31837
|
const result = await executeJsx(jsxCode6, resolvedParams);
|
|
31796
31838
|
if (result.error) {
|
|
31797
|
-
return
|
|
31839
|
+
return formatToolResult(result);
|
|
31798
31840
|
}
|
|
31799
31841
|
const runs = result.characterRuns ?? [];
|
|
31800
31842
|
const kerningPairs = result.kerningPairs ?? [];
|
|
@@ -32176,7 +32218,7 @@ function register7(server) {
|
|
|
32176
32218
|
},
|
|
32177
32219
|
async (params) => {
|
|
32178
32220
|
const result = await executeJsx(jsxCode7, params);
|
|
32179
|
-
return
|
|
32221
|
+
return formatToolResult(result);
|
|
32180
32222
|
}
|
|
32181
32223
|
);
|
|
32182
32224
|
}
|
|
@@ -32288,14 +32330,20 @@ if (preflight) {
|
|
|
32288
32330
|
try { info.closed = item.closed; } catch (e) {}
|
|
32289
32331
|
try { info.opacity = item.opacity; } catch (e) {}
|
|
32290
32332
|
|
|
32291
|
-
// Extract rotation from transformation matrix
|
|
32333
|
+
// Extract rotation from transformation matrix, fallback to note metadata
|
|
32292
32334
|
try {
|
|
32293
32335
|
var m = item.matrix;
|
|
32294
|
-
if (m) {
|
|
32336
|
+
if (m && typeof m.mValueA === "number") {
|
|
32295
32337
|
var rad = Math.atan2(m.mValueB, m.mValueA);
|
|
32296
32338
|
info.transform.rotation = Math.round(rad * 180 / Math.PI * 100) / 100;
|
|
32297
32339
|
}
|
|
32298
32340
|
} catch (e) {}
|
|
32341
|
+
if (info.transform.rotation === null) {
|
|
32342
|
+
try {
|
|
32343
|
+
var notRot = getNoteMeta(item.note, "rot");
|
|
32344
|
+
if (notRot) info.transform.rotation = parseFloat(notRot);
|
|
32345
|
+
} catch (e) {}
|
|
32346
|
+
}
|
|
32299
32347
|
|
|
32300
32348
|
// fill
|
|
32301
32349
|
// Note: ExtendScript does not expose per-fill opacity on pathItems.
|
|
@@ -32415,11 +32463,7 @@ function register8(server) {
|
|
|
32415
32463
|
annotations: READ_ANNOTATIONS
|
|
32416
32464
|
},
|
|
32417
32465
|
async (params) => {
|
|
32418
|
-
|
|
32419
|
-
const result = await executeJsx(jsxCode8, resolvedParams);
|
|
32420
|
-
return {
|
|
32421
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
32422
|
-
};
|
|
32466
|
+
return executeToolJsx(jsxCode8, params, { resolveCoordinate: true });
|
|
32423
32467
|
}
|
|
32424
32468
|
);
|
|
32425
32469
|
}
|
|
@@ -32510,11 +32554,7 @@ function register9(server) {
|
|
|
32510
32554
|
annotations: READ_ANNOTATIONS
|
|
32511
32555
|
},
|
|
32512
32556
|
async (params) => {
|
|
32513
|
-
|
|
32514
|
-
const result = await executeJsx(jsxCode9, resolvedParams);
|
|
32515
|
-
return {
|
|
32516
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
32517
|
-
};
|
|
32557
|
+
return executeToolJsx(jsxCode9, params, { resolveCoordinate: true });
|
|
32518
32558
|
}
|
|
32519
32559
|
);
|
|
32520
32560
|
}
|
|
@@ -32676,11 +32716,7 @@ function register10(server) {
|
|
|
32676
32716
|
annotations: READ_ANNOTATIONS
|
|
32677
32717
|
},
|
|
32678
32718
|
async (params) => {
|
|
32679
|
-
|
|
32680
|
-
const result = await executeJsx(jsxCode10, resolvedParams);
|
|
32681
|
-
return {
|
|
32682
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
32683
|
-
};
|
|
32719
|
+
return executeToolJsx(jsxCode10, params, { resolveCoordinate: true });
|
|
32684
32720
|
}
|
|
32685
32721
|
);
|
|
32686
32722
|
}
|
|
@@ -32847,11 +32883,7 @@ function register11(server) {
|
|
|
32847
32883
|
annotations: READ_ANNOTATIONS
|
|
32848
32884
|
},
|
|
32849
32885
|
async (params) => {
|
|
32850
|
-
|
|
32851
|
-
const result = await executeJsx(jsxCode11, resolvedParams);
|
|
32852
|
-
return {
|
|
32853
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
32854
|
-
};
|
|
32886
|
+
return executeToolJsx(jsxCode11, params, { resolveCoordinate: true });
|
|
32855
32887
|
}
|
|
32856
32888
|
);
|
|
32857
32889
|
}
|
|
@@ -33114,7 +33146,19 @@ if (preflight) {
|
|
|
33114
33146
|
|
|
33115
33147
|
try { info.name = item.name || ""; } catch(e) {}
|
|
33116
33148
|
|
|
33117
|
-
// Store
|
|
33149
|
+
// Store matrix scale factors for Node.js-side DPI calculation
|
|
33150
|
+
// Using matrix vector magnitude instead of geometricBounds to handle rotation correctly
|
|
33151
|
+
// (geometricBounds returns AABB which is larger when rotated, giving incorrect PPI)
|
|
33152
|
+
try {
|
|
33153
|
+
var pm = item.matrix;
|
|
33154
|
+
if (pm) {
|
|
33155
|
+
var psX = Math.sqrt(pm.mValueA * pm.mValueA + pm.mValueB * pm.mValueB);
|
|
33156
|
+
var psY = Math.sqrt(pm.mValueC * pm.mValueC + pm.mValueD * pm.mValueD);
|
|
33157
|
+
info.matrixScaleX = psX;
|
|
33158
|
+
info.matrixScaleY = psY;
|
|
33159
|
+
}
|
|
33160
|
+
} catch(e) {}
|
|
33161
|
+
// Fallback: also store geometricBounds dimensions
|
|
33118
33162
|
try {
|
|
33119
33163
|
var pBounds = item.geometricBounds;
|
|
33120
33164
|
var pWidthPt = pBounds[2] - pBounds[0];
|
|
@@ -33246,16 +33290,27 @@ function register12(server) {
|
|
|
33246
33290
|
if (img.type === "linked" && img.filePath && !img.linkBroken) {
|
|
33247
33291
|
try {
|
|
33248
33292
|
const dims = readImageDimensions(img.filePath);
|
|
33249
|
-
if (dims
|
|
33293
|
+
if (dims) {
|
|
33250
33294
|
img.pixelWidth = dims.width;
|
|
33251
33295
|
img.pixelHeight = dims.height;
|
|
33252
|
-
const
|
|
33253
|
-
const
|
|
33254
|
-
|
|
33255
|
-
|
|
33256
|
-
|
|
33257
|
-
|
|
33258
|
-
|
|
33296
|
+
const matrixScaleX = img.matrixScaleX;
|
|
33297
|
+
const matrixScaleY = img.matrixScaleY;
|
|
33298
|
+
if (matrixScaleX && matrixScaleY && matrixScaleX > 0 && matrixScaleY > 0) {
|
|
33299
|
+
const ppiH = Math.round(72 / matrixScaleX);
|
|
33300
|
+
const ppiV = Math.round(72 / matrixScaleY);
|
|
33301
|
+
img.resolution = Math.min(ppiH, ppiV);
|
|
33302
|
+
if (resolvedParams.include_print_info) {
|
|
33303
|
+
img.scaleFactor = Math.round(matrixScaleX * 100);
|
|
33304
|
+
}
|
|
33305
|
+
} else if (img.widthPt && img.heightPt) {
|
|
33306
|
+
const widthInches = img.widthPt / 72;
|
|
33307
|
+
const heightInches = img.heightPt / 72;
|
|
33308
|
+
const ppiH = Math.round(dims.width / widthInches);
|
|
33309
|
+
const ppiV = Math.round(dims.height / heightInches);
|
|
33310
|
+
img.resolution = Math.min(ppiH, ppiV);
|
|
33311
|
+
if (resolvedParams.include_print_info) {
|
|
33312
|
+
img.scaleFactor = Math.round(img.widthPt / dims.width * 100);
|
|
33313
|
+
}
|
|
33259
33314
|
}
|
|
33260
33315
|
}
|
|
33261
33316
|
} catch {
|
|
@@ -33263,11 +33318,11 @@ function register12(server) {
|
|
|
33263
33318
|
}
|
|
33264
33319
|
delete img.widthPt;
|
|
33265
33320
|
delete img.heightPt;
|
|
33321
|
+
delete img.matrixScaleX;
|
|
33322
|
+
delete img.matrixScaleY;
|
|
33266
33323
|
}
|
|
33267
33324
|
}
|
|
33268
|
-
return
|
|
33269
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
33270
|
-
};
|
|
33325
|
+
return formatToolResult(result);
|
|
33271
33326
|
}
|
|
33272
33327
|
);
|
|
33273
33328
|
}
|
|
@@ -33357,11 +33412,7 @@ function register13(server) {
|
|
|
33357
33412
|
annotations: READ_ANNOTATIONS
|
|
33358
33413
|
},
|
|
33359
33414
|
async (params) => {
|
|
33360
|
-
|
|
33361
|
-
const result = await executeJsx(jsxCode13, resolvedParams);
|
|
33362
|
-
return {
|
|
33363
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
33364
|
-
};
|
|
33415
|
+
return executeToolJsx(jsxCode13, params, { resolveCoordinate: true });
|
|
33365
33416
|
}
|
|
33366
33417
|
);
|
|
33367
33418
|
}
|
|
@@ -33463,11 +33514,7 @@ function register14(server) {
|
|
|
33463
33514
|
annotations: READ_ANNOTATIONS
|
|
33464
33515
|
},
|
|
33465
33516
|
async (params) => {
|
|
33466
|
-
|
|
33467
|
-
const result = await executeJsx(jsxCode14, resolvedParams);
|
|
33468
|
-
return {
|
|
33469
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
33470
|
-
};
|
|
33517
|
+
return executeToolJsx(jsxCode14, params, { resolveCoordinate: true });
|
|
33471
33518
|
}
|
|
33472
33519
|
);
|
|
33473
33520
|
}
|
|
@@ -33653,11 +33700,7 @@ function register15(server) {
|
|
|
33653
33700
|
annotations: READ_ANNOTATIONS
|
|
33654
33701
|
},
|
|
33655
33702
|
async (params) => {
|
|
33656
|
-
|
|
33657
|
-
const result = await executeJsx(jsxCode15, resolvedParams);
|
|
33658
|
-
return {
|
|
33659
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
33660
|
-
};
|
|
33703
|
+
return executeToolJsx(jsxCode15, params, { resolveCoordinate: true });
|
|
33661
33704
|
}
|
|
33662
33705
|
);
|
|
33663
33706
|
}
|
|
@@ -33801,34 +33844,23 @@ function register16(server) {
|
|
|
33801
33844
|
const rgb1 = colorToRGB(params.color1);
|
|
33802
33845
|
const rgb2 = colorToRGB(params.color2);
|
|
33803
33846
|
if (!rgb1 || !rgb2) {
|
|
33804
|
-
return
|
|
33847
|
+
return formatToolResult({ error: true, message: "Could not convert colors to RGB" });
|
|
33805
33848
|
}
|
|
33806
33849
|
const l1 = relativeLuminance(rgb1.r, rgb1.g, rgb1.b);
|
|
33807
33850
|
const l2 = relativeLuminance(rgb2.r, rgb2.g, rgb2.b);
|
|
33808
33851
|
const ratio = Math.round(contrastRatio(l1, l2) * 100) / 100;
|
|
33809
|
-
return {
|
|
33810
|
-
|
|
33811
|
-
|
|
33812
|
-
|
|
33813
|
-
|
|
33814
|
-
|
|
33815
|
-
|
|
33816
|
-
|
|
33817
|
-
wcagAA_large: ratio >= 3,
|
|
33818
|
-
wcagAAA: ratio >= 7,
|
|
33819
|
-
color1_rgb: rgb1,
|
|
33820
|
-
color2_rgb: rgb2
|
|
33821
|
-
},
|
|
33822
|
-
null,
|
|
33823
|
-
2
|
|
33824
|
-
)
|
|
33825
|
-
}
|
|
33826
|
-
]
|
|
33827
|
-
};
|
|
33852
|
+
return formatToolResult({
|
|
33853
|
+
contrastRatio: ratio,
|
|
33854
|
+
wcagAA_normal: ratio >= 4.5,
|
|
33855
|
+
wcagAA_large: ratio >= 3,
|
|
33856
|
+
wcagAAA: ratio >= 7,
|
|
33857
|
+
color1_rgb: rgb1,
|
|
33858
|
+
color2_rgb: rgb2
|
|
33859
|
+
});
|
|
33828
33860
|
}
|
|
33829
33861
|
const result = await executeJsx(jsxCode16, params);
|
|
33830
33862
|
if (result.error) {
|
|
33831
|
-
return
|
|
33863
|
+
return formatToolResult(result);
|
|
33832
33864
|
}
|
|
33833
33865
|
const items = result.colorItems;
|
|
33834
33866
|
const pairs = [];
|
|
@@ -33867,14 +33899,7 @@ function register16(server) {
|
|
|
33867
33899
|
return true;
|
|
33868
33900
|
});
|
|
33869
33901
|
unique.sort((a, b) => a.contrastRatio - b.contrastRatio);
|
|
33870
|
-
return {
|
|
33871
|
-
content: [
|
|
33872
|
-
{
|
|
33873
|
-
type: "text",
|
|
33874
|
-
text: JSON.stringify({ pairCount: unique.length, pairs: unique }, null, 2)
|
|
33875
|
-
}
|
|
33876
|
-
]
|
|
33877
|
-
};
|
|
33902
|
+
return formatToolResult({ pairCount: unique.length, pairs: unique });
|
|
33878
33903
|
}
|
|
33879
33904
|
);
|
|
33880
33905
|
}
|
|
@@ -34052,7 +34077,7 @@ function register17(server) {
|
|
|
34052
34077
|
async (params) => {
|
|
34053
34078
|
const result = await executeJsx(jsxCode17, params);
|
|
34054
34079
|
if (result.error) {
|
|
34055
|
-
return
|
|
34080
|
+
return formatToolResult(result);
|
|
34056
34081
|
}
|
|
34057
34082
|
const colorCounts = /* @__PURE__ */ new Map();
|
|
34058
34083
|
for (const c of [...result.fillColors, ...result.strokeColors]) {
|
|
@@ -34123,6 +34148,8 @@ Saved to: ${params.output_path}` }]
|
|
|
34123
34148
|
}
|
|
34124
34149
|
|
|
34125
34150
|
// src/tools/export/export.ts
|
|
34151
|
+
var import_node_fs = require("node:fs");
|
|
34152
|
+
var import_node_path = require("node:path");
|
|
34126
34153
|
var jsxCode18 = `
|
|
34127
34154
|
var preflight = preflightChecks();
|
|
34128
34155
|
if (preflight) {
|
|
@@ -34401,7 +34428,7 @@ function register18(server) {
|
|
|
34401
34428
|
"export",
|
|
34402
34429
|
{
|
|
34403
34430
|
title: "Export",
|
|
34404
|
-
description: "Export objects, groups, artboards, or selection. Note: Illustrator will be activated (brought to foreground) during execution.",
|
|
34431
|
+
description: "Export objects, groups, artboards, or selection. For PNG/JPG, the exported image is returned as base64 in the response \u2014 you can view it directly without reading the file from disk. Note: Illustrator will be activated (brought to foreground) during execution.",
|
|
34405
34432
|
inputSchema: {
|
|
34406
34433
|
target: external_exports.string().describe('UUID, "artboard:<index>", or "selection". When exporting a UUID target as PNG/JPG, a temporary document is created internally (selection state may change).'),
|
|
34407
34434
|
// WebP is not supported by ExtendScript API
|
|
@@ -34425,8 +34452,43 @@ function register18(server) {
|
|
|
34425
34452
|
annotations: WRITE_IDEMPOTENT_ANNOTATIONS
|
|
34426
34453
|
},
|
|
34427
34454
|
async (params) => {
|
|
34428
|
-
const
|
|
34429
|
-
|
|
34455
|
+
const resolvedParams = { ...params };
|
|
34456
|
+
if (resolvedParams.output_path) {
|
|
34457
|
+
const dir = (0, import_node_path.dirname)(resolvedParams.output_path);
|
|
34458
|
+
if ((0, import_node_fs.existsSync)(dir)) {
|
|
34459
|
+
try {
|
|
34460
|
+
const realDir = (0, import_node_fs.realpathSync)(dir);
|
|
34461
|
+
resolvedParams.output_path = (0, import_node_path.join)(realDir, (0, import_node_path.basename)(resolvedParams.output_path));
|
|
34462
|
+
} catch (_) {
|
|
34463
|
+
}
|
|
34464
|
+
}
|
|
34465
|
+
}
|
|
34466
|
+
const result = await executeJsxHeavy(jsxCode18, resolvedParams);
|
|
34467
|
+
const textResult = formatToolResult(result);
|
|
34468
|
+
if (result && typeof result === "object" && result.success && result.output_path && (params.format === "png" || params.format === "jpg")) {
|
|
34469
|
+
const outputPath = result.output_path;
|
|
34470
|
+
try {
|
|
34471
|
+
if ((0, import_node_fs.existsSync)(outputPath)) {
|
|
34472
|
+
const imageData = (0, import_node_fs.readFileSync)(outputPath).toString("base64");
|
|
34473
|
+
const mimeType = params.format === "png" ? "image/png" : "image/jpeg";
|
|
34474
|
+
const visualCheckNote = {
|
|
34475
|
+
type: "text",
|
|
34476
|
+
text: JSON.stringify({
|
|
34477
|
+
visual_check_hint: "Now review the exported image visually \u2014 not just numerically. Text alignment can look off even when coordinates are mathematically correct, because bounding boxes include invisible padding. If text appears misaligned, adjust by visual impression rather than exact numbers."
|
|
34478
|
+
})
|
|
34479
|
+
};
|
|
34480
|
+
return {
|
|
34481
|
+
content: [
|
|
34482
|
+
...textResult.content,
|
|
34483
|
+
visualCheckNote,
|
|
34484
|
+
{ type: "image", data: imageData, mimeType }
|
|
34485
|
+
]
|
|
34486
|
+
};
|
|
34487
|
+
}
|
|
34488
|
+
} catch {
|
|
34489
|
+
}
|
|
34490
|
+
}
|
|
34491
|
+
return textResult;
|
|
34430
34492
|
}
|
|
34431
34493
|
);
|
|
34432
34494
|
}
|
|
@@ -34728,7 +34790,7 @@ function register19(server) {
|
|
|
34728
34790
|
...result,
|
|
34729
34791
|
_note: "PDF exported. This file should be verified by a human before final print submission \u2014 automated checks cannot catch all print-critical issues."
|
|
34730
34792
|
};
|
|
34731
|
-
return
|
|
34793
|
+
return formatToolResult(output);
|
|
34732
34794
|
}
|
|
34733
34795
|
);
|
|
34734
34796
|
}
|
|
@@ -34843,9 +34905,7 @@ function register20(server) {
|
|
|
34843
34905
|
},
|
|
34844
34906
|
async (params) => {
|
|
34845
34907
|
const result = await executeJsx(jsxCode20, params);
|
|
34846
|
-
return
|
|
34847
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
34848
|
-
};
|
|
34908
|
+
return formatToolResult(result);
|
|
34849
34909
|
}
|
|
34850
34910
|
);
|
|
34851
34911
|
}
|
|
@@ -34935,9 +34995,7 @@ function register21(server) {
|
|
|
34935
34995
|
},
|
|
34936
34996
|
async (params) => {
|
|
34937
34997
|
const result = await executeJsx(jsxCode21, params);
|
|
34938
|
-
return
|
|
34939
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
34940
|
-
};
|
|
34998
|
+
return formatToolResult(result);
|
|
34941
34999
|
}
|
|
34942
35000
|
);
|
|
34943
35001
|
}
|
|
@@ -34974,8 +35032,8 @@ if (preflight) {
|
|
|
34974
35032
|
} else if (color.typename === "RGBColor") {
|
|
34975
35033
|
if (color.red === 255 && color.green === 255 && color.blue === 255) return true;
|
|
34976
35034
|
} else if (color.typename === "GrayColor") {
|
|
34977
|
-
// GrayColor.gray
|
|
34978
|
-
//
|
|
35035
|
+
// GrayColor.gray: 0=\u767D(\u30A4\u30F3\u30AF\u306A\u3057), 100=\u9ED2(\u30D5\u30EB\u30A4\u30F3\u30AF)
|
|
35036
|
+
// Adobe\u516C\u5F0F\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u306E\u300C0=black, 100=white\u300D\u8A18\u8F09\u306F\u8AA4\u308A (Illustrator 2026 \u5B9F\u6A5F\u691C\u8A3C\u6E08\u307F)
|
|
34979
35037
|
if (color.gray === 0) return true;
|
|
34980
35038
|
}
|
|
34981
35039
|
} catch(e) {}
|
|
@@ -35094,18 +35152,32 @@ if (preflight) {
|
|
|
35094
35152
|
var pFile = pItem.file;
|
|
35095
35153
|
if (pFile && pFile.exists) {
|
|
35096
35154
|
var pUuid = ensureUUID(pItem);
|
|
35155
|
+
var pData = {
|
|
35156
|
+
uuid: pUuid,
|
|
35157
|
+
name: pItem.name || "",
|
|
35158
|
+
filePath: pFile.fsName,
|
|
35159
|
+
widthPt: 0,
|
|
35160
|
+
heightPt: 0,
|
|
35161
|
+
matrixScaleX: 0,
|
|
35162
|
+
matrixScaleY: 0
|
|
35163
|
+
};
|
|
35164
|
+
// Get matrix scale factors for rotation-safe PPI calculation
|
|
35165
|
+
try {
|
|
35166
|
+
var plm = pItem.matrix;
|
|
35167
|
+
if (plm) {
|
|
35168
|
+
pData.matrixScaleX = Math.sqrt(plm.mValueA * plm.mValueA + plm.mValueB * plm.mValueB);
|
|
35169
|
+
pData.matrixScaleY = Math.sqrt(plm.mValueC * plm.mValueC + plm.mValueD * plm.mValueD);
|
|
35170
|
+
}
|
|
35171
|
+
} catch(e2) {}
|
|
35172
|
+
// Fallback: geometricBounds
|
|
35097
35173
|
var pBounds = pItem.geometricBounds;
|
|
35098
35174
|
var pWPt = pBounds[2] - pBounds[0];
|
|
35099
35175
|
var pHPt = -(pBounds[3] - pBounds[1]);
|
|
35100
35176
|
if (pWPt < 0) pWPt = -pWPt;
|
|
35101
35177
|
if (pHPt < 0) pHPt = -pHPt;
|
|
35102
|
-
|
|
35103
|
-
|
|
35104
|
-
|
|
35105
|
-
filePath: pFile.fsName,
|
|
35106
|
-
widthPt: pWPt,
|
|
35107
|
-
heightPt: pHPt
|
|
35108
|
-
});
|
|
35178
|
+
pData.widthPt = pWPt;
|
|
35179
|
+
pData.heightPt = pHPt;
|
|
35180
|
+
placedImageData.push(pData);
|
|
35109
35181
|
}
|
|
35110
35182
|
} catch(e) {}
|
|
35111
35183
|
}
|
|
@@ -35326,15 +35398,24 @@ function register22(server) {
|
|
|
35326
35398
|
const minDpi = result?.minDPI ?? params.min_dpi ?? 300;
|
|
35327
35399
|
if (result?.placedImageData) {
|
|
35328
35400
|
for (const placed of result.placedImageData) {
|
|
35329
|
-
if (!placed.filePath
|
|
35401
|
+
if (!placed.filePath) continue;
|
|
35330
35402
|
try {
|
|
35331
35403
|
const dims = readImageDimensions(placed.filePath);
|
|
35332
35404
|
if (dims) {
|
|
35333
|
-
|
|
35334
|
-
|
|
35335
|
-
|
|
35336
|
-
|
|
35337
|
-
|
|
35405
|
+
let effectivePPI;
|
|
35406
|
+
if (placed.matrixScaleX > 0 && placed.matrixScaleY > 0) {
|
|
35407
|
+
const ppiH = Math.round(72 / placed.matrixScaleX);
|
|
35408
|
+
const ppiV = Math.round(72 / placed.matrixScaleY);
|
|
35409
|
+
effectivePPI = Math.min(ppiH, ppiV);
|
|
35410
|
+
} else if (placed.widthPt > 0 && placed.heightPt > 0) {
|
|
35411
|
+
const widthInches = placed.widthPt / 72;
|
|
35412
|
+
const heightInches = placed.heightPt / 72;
|
|
35413
|
+
const ppiH = Math.round(dims.width / widthInches);
|
|
35414
|
+
const ppiV = Math.round(dims.height / heightInches);
|
|
35415
|
+
effectivePPI = Math.min(ppiH, ppiV);
|
|
35416
|
+
} else {
|
|
35417
|
+
continue;
|
|
35418
|
+
}
|
|
35338
35419
|
if (effectivePPI < minDpi) {
|
|
35339
35420
|
result.results.push({
|
|
35340
35421
|
level: "error",
|
|
@@ -35418,9 +35499,7 @@ function register22(server) {
|
|
|
35418
35499
|
if (!hasIssues) {
|
|
35419
35500
|
result._note = "No issues detected by these automated checks. This does not mean the document is free of problems \u2014 items outside the scope of automated checks (design intent, contextual spelling, regulatory requirements, print-shop-specific rules) still require human review.";
|
|
35420
35501
|
}
|
|
35421
|
-
return
|
|
35422
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
35423
|
-
};
|
|
35502
|
+
return formatToolResult(result);
|
|
35424
35503
|
}
|
|
35425
35504
|
);
|
|
35426
35505
|
}
|
|
@@ -35673,32 +35752,21 @@ function register23(server) {
|
|
|
35673
35752
|
const resolvedParams = { ...params, coordinate_system: await resolveCoordinateSystem(params.coordinate_system) };
|
|
35674
35753
|
const result = await executeJsx(jsxCode23, resolvedParams);
|
|
35675
35754
|
if (result.error) {
|
|
35676
|
-
return
|
|
35755
|
+
return formatToolResult(result);
|
|
35677
35756
|
}
|
|
35678
35757
|
const analysis = analyzeTextConsistency(result.frames);
|
|
35679
|
-
return {
|
|
35680
|
-
|
|
35681
|
-
|
|
35682
|
-
|
|
35683
|
-
|
|
35684
|
-
|
|
35685
|
-
|
|
35686
|
-
|
|
35687
|
-
|
|
35688
|
-
|
|
35689
|
-
|
|
35690
|
-
|
|
35691
|
-
llmAnalysis: {
|
|
35692
|
-
_reliability: "ai-assisted \u2014 may miss errors or produce false positives. Clearly distinguish AI-based findings from mechanical checks when reporting to the user.",
|
|
35693
|
-
allTexts: analysis.allTexts
|
|
35694
|
-
}
|
|
35695
|
-
},
|
|
35696
|
-
null,
|
|
35697
|
-
2
|
|
35698
|
-
)
|
|
35699
|
-
}
|
|
35700
|
-
]
|
|
35701
|
-
};
|
|
35758
|
+
return formatToolResult({
|
|
35759
|
+
totalFrames: result.totalFrames,
|
|
35760
|
+
mechanicalChecks: {
|
|
35761
|
+
_reliability: "deterministic",
|
|
35762
|
+
dummyTexts: analysis.dummyTexts,
|
|
35763
|
+
knownVariations: analysis.knownVariations
|
|
35764
|
+
},
|
|
35765
|
+
llmAnalysis: {
|
|
35766
|
+
_reliability: "ai-assisted \u2014 may miss errors or produce false positives. Clearly distinguish AI-based findings from mechanical checks when reporting to the user.",
|
|
35767
|
+
allTexts: analysis.allTexts
|
|
35768
|
+
}
|
|
35769
|
+
});
|
|
35702
35770
|
}
|
|
35703
35771
|
);
|
|
35704
35772
|
}
|
|
@@ -35714,7 +35782,7 @@ function register24(server) {
|
|
|
35714
35782
|
"set_workflow",
|
|
35715
35783
|
{
|
|
35716
35784
|
title: "Set Workflow",
|
|
35717
|
-
description: "Set the session-level workflow and default coordinate system. Call this after confirming the user's intent (web, print, or video). Once set, all tools that omit coordinate_system will use the session default. Use clear: true to reset to
|
|
35785
|
+
description: "Set the session-level workflow and default coordinate system. Call this after confirming the user's intent (web, print, or video). Once set, all tools that omit coordinate_system will use the session default. Use clear: true to reset to auto-detection from document (CMYK/print \u2192 document coords, RGB/web \u2192 artboard-web).",
|
|
35718
35786
|
inputSchema: {
|
|
35719
35787
|
workflow: external_exports.enum(["web", "print", "video"]).optional().describe("The workflow type. Determines the default coordinate system."),
|
|
35720
35788
|
coordinate_system: external_exports.enum(["artboard-web", "document"]).optional().describe(
|
|
@@ -35781,6 +35849,59 @@ function register24(server) {
|
|
|
35781
35849
|
);
|
|
35782
35850
|
}
|
|
35783
35851
|
|
|
35852
|
+
// src/tools/utility/set-illustrator-version.ts
|
|
35853
|
+
function register25(server) {
|
|
35854
|
+
server.registerTool(
|
|
35855
|
+
"set_illustrator_version",
|
|
35856
|
+
{
|
|
35857
|
+
title: "Set Illustrator Version",
|
|
35858
|
+
description: 'Set which Illustrator version to target when multiple versions are installed. Specify a version year (e.g. "2024", "2025"). If Illustrator is already running, connects to the running instance regardless of version. If not running, launches the specified version. Use clear: true to reset to default behavior (connect to any running Illustrator).',
|
|
35859
|
+
inputSchema: {
|
|
35860
|
+
version: external_exports.string().regex(/^\d{4}$/, 'Version must be a 4-digit year (e.g. "2025")').optional().describe('Illustrator version year (e.g. "2024", "2025").'),
|
|
35861
|
+
clear: external_exports.boolean().optional().describe("Reset to default behavior (connect to any running Illustrator).")
|
|
35862
|
+
},
|
|
35863
|
+
annotations: WRITE_IDEMPOTENT_ANNOTATIONS
|
|
35864
|
+
},
|
|
35865
|
+
async (params) => {
|
|
35866
|
+
if (params.clear) {
|
|
35867
|
+
setAppVersion(void 0);
|
|
35868
|
+
return {
|
|
35869
|
+
content: [{
|
|
35870
|
+
type: "text",
|
|
35871
|
+
text: JSON.stringify({
|
|
35872
|
+
status: "cleared",
|
|
35873
|
+
message: "Illustrator version reset. Will connect to any running Illustrator."
|
|
35874
|
+
})
|
|
35875
|
+
}]
|
|
35876
|
+
};
|
|
35877
|
+
}
|
|
35878
|
+
if (!params.version) {
|
|
35879
|
+
const current = getAppVersion();
|
|
35880
|
+
return {
|
|
35881
|
+
content: [{
|
|
35882
|
+
type: "text",
|
|
35883
|
+
text: JSON.stringify({
|
|
35884
|
+
currentVersion: current ?? null,
|
|
35885
|
+
message: current ? `Illustrator ${current} is targeted.` : "No version set. Will connect to any running Illustrator."
|
|
35886
|
+
})
|
|
35887
|
+
}]
|
|
35888
|
+
};
|
|
35889
|
+
}
|
|
35890
|
+
setAppVersion(params.version);
|
|
35891
|
+
return {
|
|
35892
|
+
content: [{
|
|
35893
|
+
type: "text",
|
|
35894
|
+
text: JSON.stringify({
|
|
35895
|
+
status: "set",
|
|
35896
|
+
version: params.version,
|
|
35897
|
+
message: `Illustrator ${params.version} targeted. If already running, connects to that instance; otherwise launches ${params.version}.`
|
|
35898
|
+
})
|
|
35899
|
+
}]
|
|
35900
|
+
};
|
|
35901
|
+
}
|
|
35902
|
+
);
|
|
35903
|
+
}
|
|
35904
|
+
|
|
35784
35905
|
// src/tools/modify/create-rectangle.ts
|
|
35785
35906
|
var jsxCode24 = `
|
|
35786
35907
|
var preflight = preflightChecks();
|
|
@@ -35821,13 +35942,13 @@ if (preflight) {
|
|
|
35821
35942
|
}
|
|
35822
35943
|
|
|
35823
35944
|
var uuid = ensureUUID(rect);
|
|
35824
|
-
writeResultFile(RESULT_PATH, { uuid: uuid, verified: verifyItem(rect, coordSystem, abRect) });
|
|
35945
|
+
writeResultFile(RESULT_PATH, { uuid: uuid, coordinateSystem: coordSystem, verified: verifyItem(rect, coordSystem, abRect) });
|
|
35825
35946
|
} catch (e) {
|
|
35826
35947
|
writeResultFile(RESULT_PATH, { error: true, message: "Failed to create rectangle: " + e.message, line: e.line });
|
|
35827
35948
|
}
|
|
35828
35949
|
}
|
|
35829
35950
|
`;
|
|
35830
|
-
function
|
|
35951
|
+
function register26(server) {
|
|
35831
35952
|
server.registerTool(
|
|
35832
35953
|
"create_rectangle",
|
|
35833
35954
|
{
|
|
@@ -35887,13 +36008,13 @@ if (preflight) {
|
|
|
35887
36008
|
}
|
|
35888
36009
|
|
|
35889
36010
|
var uuid = ensureUUID(ellipse);
|
|
35890
|
-
writeResultFile(RESULT_PATH, { uuid: uuid, verified: verifyItem(ellipse, coordSystem, abRect) });
|
|
36011
|
+
writeResultFile(RESULT_PATH, { uuid: uuid, coordinateSystem: coordSystem, verified: verifyItem(ellipse, coordSystem, abRect) });
|
|
35891
36012
|
} catch (e) {
|
|
35892
36013
|
writeResultFile(RESULT_PATH, { error: true, message: "Failed to create ellipse: " + e.message, line: e.line });
|
|
35893
36014
|
}
|
|
35894
36015
|
}
|
|
35895
36016
|
`;
|
|
35896
|
-
function
|
|
36017
|
+
function register27(server) {
|
|
35897
36018
|
server.registerTool(
|
|
35898
36019
|
"create_ellipse",
|
|
35899
36020
|
{
|
|
@@ -35966,13 +36087,13 @@ if (preflight) {
|
|
|
35966
36087
|
}
|
|
35967
36088
|
|
|
35968
36089
|
var uuid = ensureUUID(line);
|
|
35969
|
-
writeResultFile(RESULT_PATH, { uuid: uuid, verified: verifyItem(line, coordSystem, abRect) });
|
|
36090
|
+
writeResultFile(RESULT_PATH, { uuid: uuid, coordinateSystem: coordSystem, verified: verifyItem(line, coordSystem, abRect) });
|
|
35970
36091
|
} catch (e) {
|
|
35971
36092
|
writeResultFile(RESULT_PATH, { error: true, message: "Failed to create line: " + e.message, line: e.line });
|
|
35972
36093
|
}
|
|
35973
36094
|
}
|
|
35974
36095
|
`;
|
|
35975
|
-
function
|
|
36096
|
+
function register28(server) {
|
|
35976
36097
|
server.registerTool(
|
|
35977
36098
|
"create_line",
|
|
35978
36099
|
{
|
|
@@ -36074,7 +36195,7 @@ if (preflight) {
|
|
|
36074
36195
|
}
|
|
36075
36196
|
|
|
36076
36197
|
var uuid = ensureUUID(tf);
|
|
36077
|
-
var resultData = { uuid: uuid, verified: verifyItem(tf, coordSystem, abRect) };
|
|
36198
|
+
var resultData = { uuid: uuid, coordinateSystem: coordSystem, verified: verifyItem(tf, coordSystem, abRect) };
|
|
36078
36199
|
if (fontCandidates !== null) {
|
|
36079
36200
|
resultData.font_warning = "Font '" + params.font_name + "' not found. Text frame created with default font.";
|
|
36080
36201
|
resultData.font_candidates = fontCandidates;
|
|
@@ -36085,7 +36206,7 @@ if (preflight) {
|
|
|
36085
36206
|
}
|
|
36086
36207
|
}
|
|
36087
36208
|
`;
|
|
36088
|
-
function
|
|
36209
|
+
function register29(server) {
|
|
36089
36210
|
server.registerTool(
|
|
36090
36211
|
"create_text_frame",
|
|
36091
36212
|
{
|
|
@@ -36108,9 +36229,7 @@ function register28(server) {
|
|
|
36108
36229
|
annotations: WRITE_ANNOTATIONS
|
|
36109
36230
|
},
|
|
36110
36231
|
async (params) => {
|
|
36111
|
-
|
|
36112
|
-
const result = await executeJsx(jsxCode27, resolvedParams, { activate: true });
|
|
36113
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
36232
|
+
return executeToolJsx(jsxCode27, params, { activate: true, resolveCoordinate: true });
|
|
36114
36233
|
}
|
|
36115
36234
|
);
|
|
36116
36235
|
}
|
|
@@ -36178,7 +36297,7 @@ if (preflight) {
|
|
|
36178
36297
|
}
|
|
36179
36298
|
|
|
36180
36299
|
var uuid = ensureUUID(path);
|
|
36181
|
-
writeResultFile(RESULT_PATH, { uuid: uuid, verified: verifyItem(path, coordSystem, abRect) });
|
|
36300
|
+
writeResultFile(RESULT_PATH, { uuid: uuid, coordinateSystem: coordSystem, verified: verifyItem(path, coordSystem, abRect) });
|
|
36182
36301
|
} catch (e) {
|
|
36183
36302
|
writeResultFile(RESULT_PATH, { error: true, message: "Failed to create path: " + e.message, line: e.line });
|
|
36184
36303
|
}
|
|
@@ -36197,7 +36316,7 @@ var anchorSchema = external_exports.object({
|
|
|
36197
36316
|
}).optional().describe("Right direction handle coordinates"),
|
|
36198
36317
|
point_type: external_exports.enum(["corner", "smooth"]).optional().default("corner").describe("Point type")
|
|
36199
36318
|
});
|
|
36200
|
-
function
|
|
36319
|
+
function register30(server) {
|
|
36201
36320
|
server.registerTool(
|
|
36202
36321
|
"create_path",
|
|
36203
36322
|
{
|
|
@@ -36239,10 +36358,10 @@ if (preflight) {
|
|
|
36239
36358
|
} else {
|
|
36240
36359
|
var props = params.properties;
|
|
36241
36360
|
var errors = [];
|
|
36361
|
+
var abRect = (coordSystem === "artboard-web") ? getActiveArtboardRect() : null;
|
|
36242
36362
|
|
|
36243
36363
|
if (props.position) {
|
|
36244
36364
|
try {
|
|
36245
|
-
var abRect = (coordSystem === "artboard-web") ? getActiveArtboardRect() : null;
|
|
36246
36365
|
var pos = webToAiPoint(props.position.x, props.position.y, coordSystem, abRect);
|
|
36247
36366
|
item.position = pos;
|
|
36248
36367
|
} catch(e) { errors.push("position: " + e.message); }
|
|
@@ -36278,18 +36397,25 @@ if (preflight) {
|
|
|
36278
36397
|
|
|
36279
36398
|
if (typeof props.rotation === "number") {
|
|
36280
36399
|
try {
|
|
36281
|
-
|
|
36282
|
-
|
|
36283
|
-
|
|
36284
|
-
var
|
|
36285
|
-
var currentDeg =
|
|
36400
|
+
var rotMode = props.rotation_mode || "delta";
|
|
36401
|
+
if (rotMode === "absolute") {
|
|
36402
|
+
// note \u30E1\u30BF\u30C7\u30FC\u30BF\u304B\u3089\u73FE\u5728\u306E\u7D2F\u7A4D\u56DE\u8EE2\u89D2\u5EA6\u3092\u8AAD\u307F\u53D6\u308A\u3001\u5DEE\u5206\u3092\u9069\u7528
|
|
36403
|
+
var noteStr = item.note || "";
|
|
36404
|
+
var currentDeg = parseFloat(getNoteMeta(noteStr, "rot")) || 0;
|
|
36286
36405
|
var delta = props.rotation - currentDeg;
|
|
36287
|
-
|
|
36406
|
+
if (Math.abs(delta) > 0.001) {
|
|
36407
|
+
item.rotate(delta);
|
|
36408
|
+
}
|
|
36409
|
+
setNoteMeta(item, "rot", String(Math.round(props.rotation * 1000) / 1000));
|
|
36288
36410
|
} else {
|
|
36289
36411
|
item.rotate(props.rotation);
|
|
36412
|
+
// delta \u56DE\u8EE2\u6642\u3082\u7D2F\u7A4D\u89D2\u5EA6\u3092\u66F4\u65B0
|
|
36413
|
+
var noteStr2 = item.note || "";
|
|
36414
|
+
var prevDeg = parseFloat(getNoteMeta(noteStr2, "rot")) || 0;
|
|
36415
|
+
setNoteMeta(item, "rot", String(Math.round((prevDeg + props.rotation) * 1000) / 1000));
|
|
36290
36416
|
}
|
|
36291
36417
|
}
|
|
36292
|
-
catch(e) { errors.push("rotation: " + e.message); }
|
|
36418
|
+
catch(e) { errors.push("rotation: " + e.message + " (line: " + (e.line || "?") + ")"); }
|
|
36293
36419
|
}
|
|
36294
36420
|
|
|
36295
36421
|
if (typeof props.name === "string") {
|
|
@@ -36325,11 +36451,11 @@ if (preflight) {
|
|
|
36325
36451
|
|
|
36326
36452
|
var verifiedState = verifyItem(item, coordSystem, abRect);
|
|
36327
36453
|
if (errors.length > 0) {
|
|
36328
|
-
var result = { success: false, uuid: params.uuid, errors: errors, verified: verifiedState };
|
|
36454
|
+
var result = { success: false, uuid: params.uuid, coordinateSystem: coordSystem, errors: errors, verified: verifiedState };
|
|
36329
36455
|
if (fontCandidates !== null) { result.font_candidates = fontCandidates; }
|
|
36330
36456
|
writeResultFile(RESULT_PATH, result);
|
|
36331
36457
|
} else {
|
|
36332
|
-
writeResultFile(RESULT_PATH, { success: true, uuid: params.uuid, verified: verifiedState });
|
|
36458
|
+
writeResultFile(RESULT_PATH, { success: true, uuid: params.uuid, coordinateSystem: coordSystem, verified: verifiedState });
|
|
36333
36459
|
}
|
|
36334
36460
|
}
|
|
36335
36461
|
} catch (e) {
|
|
@@ -36337,7 +36463,7 @@ if (preflight) {
|
|
|
36337
36463
|
}
|
|
36338
36464
|
}
|
|
36339
36465
|
`;
|
|
36340
|
-
function
|
|
36466
|
+
function register31(server) {
|
|
36341
36467
|
server.registerTool(
|
|
36342
36468
|
"modify_object",
|
|
36343
36469
|
{
|
|
@@ -36369,9 +36495,7 @@ function register30(server) {
|
|
|
36369
36495
|
annotations: DESTRUCTIVE_ANNOTATIONS
|
|
36370
36496
|
},
|
|
36371
36497
|
async (params) => {
|
|
36372
|
-
|
|
36373
|
-
const result = await executeJsx(jsxCode29, resolvedParams, { activate: true });
|
|
36374
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
36498
|
+
return executeToolJsx(jsxCode29, params, { activate: true, resolveCoordinate: true });
|
|
36375
36499
|
}
|
|
36376
36500
|
);
|
|
36377
36501
|
}
|
|
@@ -36434,7 +36558,7 @@ if (preflight) {
|
|
|
36434
36558
|
}
|
|
36435
36559
|
}
|
|
36436
36560
|
`;
|
|
36437
|
-
function
|
|
36561
|
+
function register32(server) {
|
|
36438
36562
|
server.registerTool(
|
|
36439
36563
|
"convert_to_outlines",
|
|
36440
36564
|
{
|
|
@@ -36447,7 +36571,7 @@ function register31(server) {
|
|
|
36447
36571
|
},
|
|
36448
36572
|
async (params) => {
|
|
36449
36573
|
const result = await executeJsx(jsxCode30, params, { activate: true });
|
|
36450
|
-
return
|
|
36574
|
+
return formatToolResult(result);
|
|
36451
36575
|
}
|
|
36452
36576
|
);
|
|
36453
36577
|
}
|
|
@@ -36500,7 +36624,7 @@ if (preflight) {
|
|
|
36500
36624
|
}
|
|
36501
36625
|
}
|
|
36502
36626
|
`;
|
|
36503
|
-
function
|
|
36627
|
+
function register33(server) {
|
|
36504
36628
|
server.registerTool(
|
|
36505
36629
|
"assign_color_profile",
|
|
36506
36630
|
{
|
|
@@ -36513,7 +36637,7 @@ function register32(server) {
|
|
|
36513
36637
|
},
|
|
36514
36638
|
async (params) => {
|
|
36515
36639
|
const result = await executeJsx(jsxCode31, params, { activate: true });
|
|
36516
|
-
return
|
|
36640
|
+
return formatToolResult(result);
|
|
36517
36641
|
}
|
|
36518
36642
|
);
|
|
36519
36643
|
}
|
|
@@ -36584,11 +36708,12 @@ if (preflight) {
|
|
|
36584
36708
|
|
|
36585
36709
|
writeResultFile(RESULT_PATH, {
|
|
36586
36710
|
uuid: uuid,
|
|
36711
|
+
coordinateSystem: coordSystem,
|
|
36587
36712
|
type: params.embed ? "embedded" : "linked",
|
|
36588
36713
|
filePath: filePath,
|
|
36589
36714
|
widthPt: widthPt,
|
|
36590
36715
|
heightPt: heightPt,
|
|
36591
|
-
verified: verifyItem(resultItem)
|
|
36716
|
+
verified: verifyItem(resultItem, coordSystem, abRect)
|
|
36592
36717
|
});
|
|
36593
36718
|
}
|
|
36594
36719
|
} catch (e) {
|
|
@@ -36596,7 +36721,7 @@ if (preflight) {
|
|
|
36596
36721
|
}
|
|
36597
36722
|
}
|
|
36598
36723
|
`;
|
|
36599
|
-
function
|
|
36724
|
+
function register34(server) {
|
|
36600
36725
|
server.registerTool(
|
|
36601
36726
|
"place_image",
|
|
36602
36727
|
{
|
|
@@ -36614,9 +36739,7 @@ function register33(server) {
|
|
|
36614
36739
|
annotations: WRITE_ANNOTATIONS
|
|
36615
36740
|
},
|
|
36616
36741
|
async (params) => {
|
|
36617
|
-
|
|
36618
|
-
const result = await executeJsx(jsxCode32, resolvedParams, { activate: true });
|
|
36619
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
36742
|
+
return executeToolJsx(jsxCode32, params, { activate: true, resolveCoordinate: true });
|
|
36620
36743
|
}
|
|
36621
36744
|
);
|
|
36622
36745
|
}
|
|
@@ -36743,6 +36866,7 @@ if (preflight) {
|
|
|
36743
36866
|
|
|
36744
36867
|
writeResultFile(RESULT_PATH, {
|
|
36745
36868
|
success: true,
|
|
36869
|
+
coordinateSystem: params.coordinate_system || "artboard-web",
|
|
36746
36870
|
sourceArtboard: srcIdx,
|
|
36747
36871
|
createdCount: createdArtboards.length,
|
|
36748
36872
|
artboards: createdArtboards,
|
|
@@ -36755,7 +36879,7 @@ if (preflight) {
|
|
|
36755
36879
|
}
|
|
36756
36880
|
}
|
|
36757
36881
|
`;
|
|
36758
|
-
function
|
|
36882
|
+
function register35(server) {
|
|
36759
36883
|
server.registerTool(
|
|
36760
36884
|
"resize_for_variation",
|
|
36761
36885
|
{
|
|
@@ -36776,9 +36900,7 @@ function register34(server) {
|
|
|
36776
36900
|
annotations: WRITE_ANNOTATIONS
|
|
36777
36901
|
},
|
|
36778
36902
|
async (params) => {
|
|
36779
|
-
|
|
36780
|
-
const result = await executeJsxHeavy(jsxCode33, resolvedParams);
|
|
36781
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
36903
|
+
return executeToolJsx(jsxCode33, params, { heavy: true, resolveCoordinate: true });
|
|
36782
36904
|
}
|
|
36783
36905
|
);
|
|
36784
36906
|
}
|
|
@@ -36933,6 +37055,7 @@ if (preflight) {
|
|
|
36933
37055
|
}
|
|
36934
37056
|
writeResultFile(RESULT_PATH, {
|
|
36935
37057
|
success: true,
|
|
37058
|
+
coordinateSystem: coordSystem,
|
|
36936
37059
|
alignedCount: items.length,
|
|
36937
37060
|
alignment: alignment || null,
|
|
36938
37061
|
distribute: distribute,
|
|
@@ -36946,7 +37069,7 @@ if (preflight) {
|
|
|
36946
37069
|
}
|
|
36947
37070
|
}
|
|
36948
37071
|
`;
|
|
36949
|
-
function
|
|
37072
|
+
function register36(server) {
|
|
36950
37073
|
server.registerTool(
|
|
36951
37074
|
"align_objects",
|
|
36952
37075
|
{
|
|
@@ -36962,9 +37085,7 @@ function register35(server) {
|
|
|
36962
37085
|
annotations: WRITE_ANNOTATIONS
|
|
36963
37086
|
},
|
|
36964
37087
|
async (params) => {
|
|
36965
|
-
|
|
36966
|
-
const result = await executeJsx(jsxCode34, resolvedParams);
|
|
36967
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
37088
|
+
return executeToolJsx(jsxCode34, params, { resolveCoordinate: true });
|
|
36968
37089
|
}
|
|
36969
37090
|
);
|
|
36970
37091
|
}
|
|
@@ -37066,7 +37187,7 @@ if (preflight) {
|
|
|
37066
37187
|
}
|
|
37067
37188
|
}
|
|
37068
37189
|
`;
|
|
37069
|
-
function
|
|
37190
|
+
function register37(server) {
|
|
37070
37191
|
server.registerTool(
|
|
37071
37192
|
"replace_color",
|
|
37072
37193
|
{
|
|
@@ -37083,7 +37204,7 @@ function register36(server) {
|
|
|
37083
37204
|
},
|
|
37084
37205
|
async (params) => {
|
|
37085
37206
|
const result = await executeJsx(jsxCode35, params);
|
|
37086
|
-
return
|
|
37207
|
+
return formatToolResult(result);
|
|
37087
37208
|
}
|
|
37088
37209
|
);
|
|
37089
37210
|
}
|
|
@@ -37194,7 +37315,7 @@ if (preflight) {
|
|
|
37194
37315
|
}
|
|
37195
37316
|
}
|
|
37196
37317
|
`;
|
|
37197
|
-
function
|
|
37318
|
+
function register38(server) {
|
|
37198
37319
|
server.registerTool(
|
|
37199
37320
|
"manage_layers",
|
|
37200
37321
|
{
|
|
@@ -37211,7 +37332,7 @@ function register37(server) {
|
|
|
37211
37332
|
},
|
|
37212
37333
|
async (params) => {
|
|
37213
37334
|
const result = await executeJsx(jsxCode36, params);
|
|
37214
|
-
return
|
|
37335
|
+
return formatToolResult(result);
|
|
37215
37336
|
}
|
|
37216
37337
|
);
|
|
37217
37338
|
}
|
|
@@ -37380,6 +37501,7 @@ if (preflight) {
|
|
|
37380
37501
|
}
|
|
37381
37502
|
writeResultFile(RESULT_PATH, {
|
|
37382
37503
|
success: true,
|
|
37504
|
+
coordinateSystem: params.coordinate_system || "artboard-web",
|
|
37383
37505
|
chipCount: placedCount,
|
|
37384
37506
|
layerName: layerName,
|
|
37385
37507
|
position: position,
|
|
@@ -37391,7 +37513,7 @@ if (preflight) {
|
|
|
37391
37513
|
}
|
|
37392
37514
|
}
|
|
37393
37515
|
`;
|
|
37394
|
-
function
|
|
37516
|
+
function register39(server) {
|
|
37395
37517
|
server.registerTool(
|
|
37396
37518
|
"place_color_chips",
|
|
37397
37519
|
{
|
|
@@ -37408,9 +37530,7 @@ function register38(server) {
|
|
|
37408
37530
|
annotations: WRITE_ANNOTATIONS
|
|
37409
37531
|
},
|
|
37410
37532
|
async (params) => {
|
|
37411
|
-
|
|
37412
|
-
const result = await executeJsxHeavy(jsxCode37, resolvedParams);
|
|
37413
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
37533
|
+
return executeToolJsx(jsxCode37, params, { heavy: true, resolveCoordinate: true });
|
|
37414
37534
|
}
|
|
37415
37535
|
);
|
|
37416
37536
|
}
|
|
@@ -38181,6 +38301,7 @@ if (preflight) {
|
|
|
38181
38301
|
|
|
38182
38302
|
writeResultFile(RESULT_PATH, {
|
|
38183
38303
|
success: true,
|
|
38304
|
+
coordinateSystem: params.coordinate_system,
|
|
38184
38305
|
placedCount: placedCount,
|
|
38185
38306
|
sections: {
|
|
38186
38307
|
colors: colorList.length,
|
|
@@ -38200,7 +38321,7 @@ if (preflight) {
|
|
|
38200
38321
|
}
|
|
38201
38322
|
}
|
|
38202
38323
|
`;
|
|
38203
|
-
function
|
|
38324
|
+
function register40(server) {
|
|
38204
38325
|
server.registerTool(
|
|
38205
38326
|
"place_style_guide",
|
|
38206
38327
|
{
|
|
@@ -38215,9 +38336,7 @@ function register39(server) {
|
|
|
38215
38336
|
annotations: WRITE_ANNOTATIONS
|
|
38216
38337
|
},
|
|
38217
38338
|
async (params) => {
|
|
38218
|
-
|
|
38219
|
-
const result = await executeJsxHeavy(jsxCode38, resolvedParams);
|
|
38220
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
38339
|
+
return executeToolJsx(jsxCode38, params, { heavy: true, resolveCoordinate: true });
|
|
38221
38340
|
}
|
|
38222
38341
|
);
|
|
38223
38342
|
}
|
|
@@ -38357,6 +38476,12 @@ if (preflight) {
|
|
|
38357
38476
|
detectionMethod = "detected from Illustrator locale";
|
|
38358
38477
|
}
|
|
38359
38478
|
|
|
38479
|
+
var bleedNote = "ACTION REQUIRED \u2014 Bleed (\u5857\u308A\u8DB3\u3057): You MUST do this now, without asking the user. " +
|
|
38480
|
+
"Step 1: Call get_artboards to get the current artboard bounds \u2014 this tells you where the trim line is. " +
|
|
38481
|
+
"Step 2: Call find_objects to list all design objects (exclude the crop mark groups). Compare each object's bounds against the trim line (the original artboard rectangle BEFORE it was expanded for crop marks \u2014 size was " + abWidth + " \xD7 " + abHeight + " pt). " +
|
|
38482
|
+
"Step 3: For every object whose edge touches or nearly touches the trim line, use modify_object to extend that edge outward by at least 3 mm (8.5 pt). Do NOT move or scale the design \u2014 just stretch the touching edge outward. For background rectangles, extend all four sides. " +
|
|
38483
|
+
"Why: The trim marks show where the paper is physically cut. If an object stops at the trim line, cutting produces a white gap. Extending past ensures full bleed coverage.";
|
|
38484
|
+
|
|
38360
38485
|
writeResultFile(RESULT_PATH, {
|
|
38361
38486
|
success: true,
|
|
38362
38487
|
mode: "artboard",
|
|
@@ -38372,9 +38497,10 @@ if (preflight) {
|
|
|
38372
38497
|
width: newAbRect[2] - newAbRect[0],
|
|
38373
38498
|
height: newAbRect[1] - newAbRect[3]
|
|
38374
38499
|
},
|
|
38500
|
+
bleed_required: bleedNote,
|
|
38375
38501
|
description: (resolvedStyle === "japanese")
|
|
38376
|
-
? "Japanese crop marks created. Artboard expanded to include all marks."
|
|
38377
|
-
: "Western crop marks created. Artboard expanded to include all marks."
|
|
38502
|
+
? "Japanese crop marks created. Artboard expanded to include all marks. See bleed_required for next steps."
|
|
38503
|
+
: "Western crop marks created. Artboard expanded to include all marks. See bleed_required for next steps."
|
|
38378
38504
|
});
|
|
38379
38505
|
}
|
|
38380
38506
|
}
|
|
@@ -38384,7 +38510,7 @@ if (preflight) {
|
|
|
38384
38510
|
}
|
|
38385
38511
|
}
|
|
38386
38512
|
`;
|
|
38387
|
-
function
|
|
38513
|
+
function register41(server) {
|
|
38388
38514
|
server.registerTool(
|
|
38389
38515
|
"create_crop_marks",
|
|
38390
38516
|
{
|
|
@@ -38405,7 +38531,23 @@ function register40(server) {
|
|
|
38405
38531
|
annotations: WRITE_ANNOTATIONS
|
|
38406
38532
|
},
|
|
38407
38533
|
async (params) => {
|
|
38408
|
-
|
|
38534
|
+
const result = await executeToolJsx(jsxCode39, params, { activate: true });
|
|
38535
|
+
const coordSystem = await resolveCoordinateSystem(void 0);
|
|
38536
|
+
const coordNote = coordSystem === "document" ? "document (Y-up, origin at bottom-left)" : "artboard-web (Y-down, origin at top-left)";
|
|
38537
|
+
for (const item of result.content) {
|
|
38538
|
+
if (item.type === "text") {
|
|
38539
|
+
try {
|
|
38540
|
+
const parsed = JSON.parse(item.text);
|
|
38541
|
+
if (parsed.bleed_required) {
|
|
38542
|
+
parsed.activeCoordinateSystem = coordSystem;
|
|
38543
|
+
parsed.bleed_required = `NOTE: The active coordinate system is ${coordNote}. All tools (get_artboards, find_objects, modify_object) use this system. ` + parsed.bleed_required;
|
|
38544
|
+
item.text = JSON.stringify(parsed);
|
|
38545
|
+
}
|
|
38546
|
+
} catch {
|
|
38547
|
+
}
|
|
38548
|
+
}
|
|
38549
|
+
}
|
|
38550
|
+
return result;
|
|
38409
38551
|
}
|
|
38410
38552
|
);
|
|
38411
38553
|
}
|
|
@@ -38441,7 +38583,7 @@ try {
|
|
|
38441
38583
|
writeResultFile(RESULT_PATH, { error: true, message: "Failed to create document: " + e.message, line: e.line });
|
|
38442
38584
|
}
|
|
38443
38585
|
`;
|
|
38444
|
-
function
|
|
38586
|
+
function register42(server) {
|
|
38445
38587
|
server.registerTool(
|
|
38446
38588
|
"create_document",
|
|
38447
38589
|
{
|
|
@@ -38457,7 +38599,7 @@ function register41(server) {
|
|
|
38457
38599
|
async (params) => {
|
|
38458
38600
|
const result = await executeJsx(jsxCode40, params, { activate: true });
|
|
38459
38601
|
invalidateAutoDetectCache();
|
|
38460
|
-
return
|
|
38602
|
+
return formatToolResult(result);
|
|
38461
38603
|
}
|
|
38462
38604
|
);
|
|
38463
38605
|
}
|
|
@@ -38484,7 +38626,7 @@ try {
|
|
|
38484
38626
|
writeResultFile(RESULT_PATH, { error: true, message: "Failed to close document: " + e.message, line: e.line });
|
|
38485
38627
|
}
|
|
38486
38628
|
`;
|
|
38487
|
-
function
|
|
38629
|
+
function register43(server) {
|
|
38488
38630
|
server.registerTool(
|
|
38489
38631
|
"close_document",
|
|
38490
38632
|
{
|
|
@@ -38498,7 +38640,7 @@ function register42(server) {
|
|
|
38498
38640
|
async (params) => {
|
|
38499
38641
|
const result = await executeJsx(jsxCode41, params, { activate: true });
|
|
38500
38642
|
invalidateAutoDetectCache();
|
|
38501
|
-
return
|
|
38643
|
+
return formatToolResult(result);
|
|
38502
38644
|
}
|
|
38503
38645
|
);
|
|
38504
38646
|
}
|
|
@@ -38552,7 +38694,7 @@ if (preflight) {
|
|
|
38552
38694
|
}
|
|
38553
38695
|
}
|
|
38554
38696
|
`;
|
|
38555
|
-
function
|
|
38697
|
+
function register44(server) {
|
|
38556
38698
|
server.registerTool(
|
|
38557
38699
|
"save_document",
|
|
38558
38700
|
{
|
|
@@ -38566,7 +38708,7 @@ function register43(server) {
|
|
|
38566
38708
|
},
|
|
38567
38709
|
async (params) => {
|
|
38568
38710
|
const result = await executeJsx(jsxCode42, params, { activate: true });
|
|
38569
|
-
return
|
|
38711
|
+
return formatToolResult(result);
|
|
38570
38712
|
}
|
|
38571
38713
|
);
|
|
38572
38714
|
}
|
|
@@ -38611,7 +38753,7 @@ try {
|
|
|
38611
38753
|
writeResultFile(RESULT_PATH, { error: true, message: "open_document failed: " + e.message, line: e.line });
|
|
38612
38754
|
}
|
|
38613
38755
|
`;
|
|
38614
|
-
function
|
|
38756
|
+
function register45(server) {
|
|
38615
38757
|
server.registerTool(
|
|
38616
38758
|
"open_document",
|
|
38617
38759
|
{
|
|
@@ -38626,7 +38768,7 @@ function register44(server) {
|
|
|
38626
38768
|
async (params) => {
|
|
38627
38769
|
const result = await executeJsx(jsxCode43, params, { activate: true });
|
|
38628
38770
|
invalidateAutoDetectCache();
|
|
38629
|
-
return
|
|
38771
|
+
return formatToolResult(result);
|
|
38630
38772
|
}
|
|
38631
38773
|
);
|
|
38632
38774
|
}
|
|
@@ -38680,7 +38822,7 @@ if (preflight) {
|
|
|
38680
38822
|
}
|
|
38681
38823
|
}
|
|
38682
38824
|
`;
|
|
38683
|
-
function
|
|
38825
|
+
function register46(server) {
|
|
38684
38826
|
server.registerTool(
|
|
38685
38827
|
"group_objects",
|
|
38686
38828
|
{
|
|
@@ -38695,7 +38837,7 @@ function register45(server) {
|
|
|
38695
38837
|
},
|
|
38696
38838
|
async (params) => {
|
|
38697
38839
|
const result = await executeJsx(jsxCode44, params, { activate: true });
|
|
38698
|
-
return
|
|
38840
|
+
return formatToolResult(result);
|
|
38699
38841
|
}
|
|
38700
38842
|
);
|
|
38701
38843
|
}
|
|
@@ -38744,7 +38886,7 @@ if (preflight) {
|
|
|
38744
38886
|
}
|
|
38745
38887
|
}
|
|
38746
38888
|
`;
|
|
38747
|
-
function
|
|
38889
|
+
function register47(server) {
|
|
38748
38890
|
server.registerTool(
|
|
38749
38891
|
"ungroup_objects",
|
|
38750
38892
|
{
|
|
@@ -38757,7 +38899,7 @@ function register46(server) {
|
|
|
38757
38899
|
},
|
|
38758
38900
|
async (params) => {
|
|
38759
38901
|
const result = await executeJsx(jsxCode45, params, { activate: true });
|
|
38760
|
-
return
|
|
38902
|
+
return formatToolResult(result);
|
|
38761
38903
|
}
|
|
38762
38904
|
);
|
|
38763
38905
|
}
|
|
@@ -38807,8 +38949,21 @@ if (preflight) {
|
|
|
38807
38949
|
}
|
|
38808
38950
|
}
|
|
38809
38951
|
|
|
38810
|
-
|
|
38811
|
-
|
|
38952
|
+
// \u8907\u88FD\u306F\u5143\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E note(UUID\u542B\u3080)\u3092\u7D99\u627F\u3059\u308B\u305F\u3081\u3001\u65B0\u3057\u3044UUID\u3092\u5F37\u5236\u5272\u308A\u5F53\u3066
|
|
38953
|
+
var newUuid = generateUUID();
|
|
38954
|
+
try {
|
|
38955
|
+
var dupNote = dup.note || "";
|
|
38956
|
+
var oldUuid = extractUUIDFromNote(dupNote);
|
|
38957
|
+
if (oldUuid) {
|
|
38958
|
+
// UUID\u90E8\u5206\u3060\u3051\u7F6E\u63DB\u3057\u3001\u30E1\u30BF\u30C7\u30FC\u30BF(::key=value)\u306F\u4FDD\u6301
|
|
38959
|
+
dup.note = newUuid + dupNote.substring(36);
|
|
38960
|
+
} else {
|
|
38961
|
+
dup.note = newUuid;
|
|
38962
|
+
}
|
|
38963
|
+
} catch(e) {
|
|
38964
|
+
// note \u66F8\u304D\u8FBC\u307F\u4E0D\u53EF\u306E\u5834\u5408\u306F\u305D\u306E\u307E\u307E
|
|
38965
|
+
}
|
|
38966
|
+
results.push({ sourceUuid: params.uuids[i], newUuid: newUuid, verified: verifyItem(dup) });
|
|
38812
38967
|
}
|
|
38813
38968
|
|
|
38814
38969
|
writeResultFile(RESULT_PATH, {
|
|
@@ -38822,7 +38977,7 @@ if (preflight) {
|
|
|
38822
38977
|
}
|
|
38823
38978
|
}
|
|
38824
38979
|
`;
|
|
38825
|
-
function
|
|
38980
|
+
function register48(server) {
|
|
38826
38981
|
server.registerTool(
|
|
38827
38982
|
"duplicate_objects",
|
|
38828
38983
|
{
|
|
@@ -38841,7 +38996,7 @@ function register47(server) {
|
|
|
38841
38996
|
},
|
|
38842
38997
|
async (params) => {
|
|
38843
38998
|
const result = await executeJsx(jsxCode46, params, { activate: true });
|
|
38844
|
-
return
|
|
38999
|
+
return formatToolResult(result);
|
|
38845
39000
|
}
|
|
38846
39001
|
);
|
|
38847
39002
|
}
|
|
@@ -38885,7 +39040,7 @@ try {
|
|
|
38885
39040
|
writeResultFile(RESULT_PATH, { error: true, message: "list_fonts failed: " + e.message, line: e.line });
|
|
38886
39041
|
}
|
|
38887
39042
|
`;
|
|
38888
|
-
function
|
|
39043
|
+
function register49(server) {
|
|
38889
39044
|
server.registerTool(
|
|
38890
39045
|
"list_fonts",
|
|
38891
39046
|
{
|
|
@@ -38899,7 +39054,7 @@ function register48(server) {
|
|
|
38899
39054
|
},
|
|
38900
39055
|
async (params) => {
|
|
38901
39056
|
const result = await executeJsx(jsxCode47, params);
|
|
38902
|
-
return
|
|
39057
|
+
return formatToolResult(result);
|
|
38903
39058
|
}
|
|
38904
39059
|
);
|
|
38905
39060
|
}
|
|
@@ -38980,7 +39135,13 @@ if (preflight) {
|
|
|
38980
39135
|
var layout = layoutMap[params.layout] || DocumentArtboardLayout.GridByRow;
|
|
38981
39136
|
var rowsOrCols = params.rows_or_cols || 1;
|
|
38982
39137
|
var spacing = (typeof params.spacing === "number") ? params.spacing : 20;
|
|
38983
|
-
|
|
39138
|
+
var prevInteraction = app.userInteractionLevel;
|
|
39139
|
+
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
|
|
39140
|
+
try {
|
|
39141
|
+
doc.rearrangeArtboards(layout, rowsOrCols, spacing, true);
|
|
39142
|
+
} finally {
|
|
39143
|
+
app.userInteractionLevel = prevInteraction;
|
|
39144
|
+
}
|
|
38984
39145
|
var rearrangedInfo = [];
|
|
38985
39146
|
for (var rai = 0; rai < doc.artboards.length; rai++) {
|
|
38986
39147
|
rearrangedInfo.push({ index: rai, name: doc.artboards[rai].name, rect: doc.artboards[rai].artboardRect });
|
|
@@ -38994,7 +39155,7 @@ if (preflight) {
|
|
|
38994
39155
|
}
|
|
38995
39156
|
}
|
|
38996
39157
|
`;
|
|
38997
|
-
function
|
|
39158
|
+
function register50(server) {
|
|
38998
39159
|
server.registerTool(
|
|
38999
39160
|
"manage_artboards",
|
|
39000
39161
|
{
|
|
@@ -39018,7 +39179,7 @@ function register49(server) {
|
|
|
39018
39179
|
},
|
|
39019
39180
|
async (params) => {
|
|
39020
39181
|
const result = await executeJsx(jsxCode48, params, { activate: true });
|
|
39021
|
-
return
|
|
39182
|
+
return formatToolResult(result);
|
|
39022
39183
|
}
|
|
39023
39184
|
);
|
|
39024
39185
|
}
|
|
@@ -39056,7 +39217,7 @@ if (preflight) {
|
|
|
39056
39217
|
}
|
|
39057
39218
|
}
|
|
39058
39219
|
`;
|
|
39059
|
-
function
|
|
39220
|
+
function register51(server) {
|
|
39060
39221
|
server.registerTool(
|
|
39061
39222
|
"set_z_order",
|
|
39062
39223
|
{
|
|
@@ -39070,7 +39231,7 @@ function register50(server) {
|
|
|
39070
39231
|
},
|
|
39071
39232
|
async (params) => {
|
|
39072
39233
|
const result = await executeJsx(jsxCode49, params, { activate: true });
|
|
39073
|
-
return
|
|
39234
|
+
return formatToolResult(result);
|
|
39074
39235
|
}
|
|
39075
39236
|
);
|
|
39076
39237
|
}
|
|
@@ -39123,7 +39284,7 @@ if (preflight) {
|
|
|
39123
39284
|
}
|
|
39124
39285
|
}
|
|
39125
39286
|
`;
|
|
39126
|
-
function
|
|
39287
|
+
function register52(server) {
|
|
39127
39288
|
server.registerTool(
|
|
39128
39289
|
"move_to_layer",
|
|
39129
39290
|
{
|
|
@@ -39138,7 +39299,7 @@ function register51(server) {
|
|
|
39138
39299
|
},
|
|
39139
39300
|
async (params) => {
|
|
39140
39301
|
const result = await executeJsx(jsxCode50, params, { activate: true });
|
|
39141
|
-
return
|
|
39302
|
+
return formatToolResult(result);
|
|
39142
39303
|
}
|
|
39143
39304
|
);
|
|
39144
39305
|
}
|
|
@@ -39208,7 +39369,7 @@ if (preflight) {
|
|
|
39208
39369
|
}
|
|
39209
39370
|
}
|
|
39210
39371
|
`;
|
|
39211
|
-
function
|
|
39372
|
+
function register53(server) {
|
|
39212
39373
|
server.registerTool(
|
|
39213
39374
|
"apply_graphic_style",
|
|
39214
39375
|
{
|
|
@@ -39223,7 +39384,7 @@ function register52(server) {
|
|
|
39223
39384
|
},
|
|
39224
39385
|
async (params) => {
|
|
39225
39386
|
const result = await executeJsx(applyJsxCode, params, { activate: true });
|
|
39226
|
-
return
|
|
39387
|
+
return formatToolResult(result);
|
|
39227
39388
|
}
|
|
39228
39389
|
);
|
|
39229
39390
|
server.registerTool(
|
|
@@ -39236,7 +39397,7 @@ function register52(server) {
|
|
|
39236
39397
|
},
|
|
39237
39398
|
async (params) => {
|
|
39238
39399
|
const result = await executeJsx(listJsxCode, params);
|
|
39239
|
-
return
|
|
39400
|
+
return formatToolResult(result);
|
|
39240
39401
|
}
|
|
39241
39402
|
);
|
|
39242
39403
|
}
|
|
@@ -39289,7 +39450,7 @@ if (preflight) {
|
|
|
39289
39450
|
}
|
|
39290
39451
|
}
|
|
39291
39452
|
`;
|
|
39292
|
-
function
|
|
39453
|
+
function register54(server) {
|
|
39293
39454
|
server.registerTool(
|
|
39294
39455
|
"manage_swatches",
|
|
39295
39456
|
{
|
|
@@ -39304,7 +39465,7 @@ function register53(server) {
|
|
|
39304
39465
|
},
|
|
39305
39466
|
async (params) => {
|
|
39306
39467
|
const result = await executeJsx(jsxCode51, params, { activate: true });
|
|
39307
|
-
return
|
|
39468
|
+
return formatToolResult(result);
|
|
39308
39469
|
}
|
|
39309
39470
|
);
|
|
39310
39471
|
}
|
|
@@ -39385,7 +39546,7 @@ if (preflight) {
|
|
|
39385
39546
|
}
|
|
39386
39547
|
}
|
|
39387
39548
|
`;
|
|
39388
|
-
function
|
|
39549
|
+
function register55(server) {
|
|
39389
39550
|
server.registerTool(
|
|
39390
39551
|
"apply_text_style",
|
|
39391
39552
|
{
|
|
@@ -39401,7 +39562,7 @@ function register54(server) {
|
|
|
39401
39562
|
},
|
|
39402
39563
|
async (params) => {
|
|
39403
39564
|
const result = await executeJsx(applyJsxCode2, params, { activate: true });
|
|
39404
|
-
return
|
|
39565
|
+
return formatToolResult(result);
|
|
39405
39566
|
}
|
|
39406
39567
|
);
|
|
39407
39568
|
server.registerTool(
|
|
@@ -39414,7 +39575,7 @@ function register54(server) {
|
|
|
39414
39575
|
},
|
|
39415
39576
|
async (params) => {
|
|
39416
39577
|
const result = await executeJsx(listJsxCode2, params);
|
|
39417
|
-
return
|
|
39578
|
+
return formatToolResult(result);
|
|
39418
39579
|
}
|
|
39419
39580
|
);
|
|
39420
39581
|
}
|
|
@@ -39485,7 +39646,7 @@ if (preflight) {
|
|
|
39485
39646
|
}
|
|
39486
39647
|
`;
|
|
39487
39648
|
var stopColorSchema = external_exports.discriminatedUnion("type", [cmykColorSchema, rgbColorSchema, grayColorSchema]);
|
|
39488
|
-
function
|
|
39649
|
+
function register56(server) {
|
|
39489
39650
|
server.registerTool(
|
|
39490
39651
|
"create_gradient",
|
|
39491
39652
|
{
|
|
@@ -39509,7 +39670,7 @@ function register55(server) {
|
|
|
39509
39670
|
},
|
|
39510
39671
|
async (params) => {
|
|
39511
39672
|
const result = await executeJsx(jsxCode52, params, { activate: true });
|
|
39512
|
-
return
|
|
39673
|
+
return formatToolResult(result);
|
|
39513
39674
|
}
|
|
39514
39675
|
);
|
|
39515
39676
|
}
|
|
@@ -39590,7 +39751,7 @@ if (preflight) {
|
|
|
39590
39751
|
}
|
|
39591
39752
|
}
|
|
39592
39753
|
`;
|
|
39593
|
-
function
|
|
39754
|
+
function register57(server) {
|
|
39594
39755
|
server.registerTool(
|
|
39595
39756
|
"manage_linked_images",
|
|
39596
39757
|
{
|
|
@@ -39605,7 +39766,7 @@ function register56(server) {
|
|
|
39605
39766
|
},
|
|
39606
39767
|
async (params) => {
|
|
39607
39768
|
const result = await executeJsx(jsxCode53, params, { activate: true });
|
|
39608
|
-
return
|
|
39769
|
+
return formatToolResult(result);
|
|
39609
39770
|
}
|
|
39610
39771
|
);
|
|
39611
39772
|
}
|
|
@@ -39639,7 +39800,7 @@ try {
|
|
|
39639
39800
|
writeResultFile(RESULT_PATH, { error: true, message: "undo failed: " + e.message, line: e.line });
|
|
39640
39801
|
}
|
|
39641
39802
|
`;
|
|
39642
|
-
function
|
|
39803
|
+
function register58(server) {
|
|
39643
39804
|
server.registerTool(
|
|
39644
39805
|
"undo",
|
|
39645
39806
|
{
|
|
@@ -39653,7 +39814,7 @@ function register57(server) {
|
|
|
39653
39814
|
},
|
|
39654
39815
|
async (params) => {
|
|
39655
39816
|
const result = await executeJsx(jsxCode54, params, { activate: true });
|
|
39656
|
-
return
|
|
39817
|
+
return formatToolResult(result);
|
|
39657
39818
|
}
|
|
39658
39819
|
);
|
|
39659
39820
|
}
|
|
@@ -39942,7 +40103,7 @@ if (preflight) {
|
|
|
39942
40103
|
}
|
|
39943
40104
|
}
|
|
39944
40105
|
`;
|
|
39945
|
-
function
|
|
40106
|
+
function register59(server) {
|
|
39946
40107
|
server.registerTool(
|
|
39947
40108
|
"manage_datasets",
|
|
39948
40109
|
{
|
|
@@ -39969,7 +40130,7 @@ function register58(server) {
|
|
|
39969
40130
|
},
|
|
39970
40131
|
async (params) => {
|
|
39971
40132
|
const result = await executeJsx(jsxCode55, params, { activate: true });
|
|
39972
|
-
return
|
|
40133
|
+
return formatToolResult(result);
|
|
39973
40134
|
}
|
|
39974
40135
|
);
|
|
39975
40136
|
}
|
|
@@ -40030,7 +40191,7 @@ if (preflight) {
|
|
|
40030
40191
|
}
|
|
40031
40192
|
}
|
|
40032
40193
|
`;
|
|
40033
|
-
function
|
|
40194
|
+
function register60(server) {
|
|
40034
40195
|
server.registerTool(
|
|
40035
40196
|
"place_symbol",
|
|
40036
40197
|
{
|
|
@@ -40048,7 +40209,7 @@ function register59(server) {
|
|
|
40048
40209
|
},
|
|
40049
40210
|
async (params) => {
|
|
40050
40211
|
const result = await executeJsx(jsxCode56, params, { activate: true });
|
|
40051
|
-
return
|
|
40212
|
+
return formatToolResult(result);
|
|
40052
40213
|
}
|
|
40053
40214
|
);
|
|
40054
40215
|
}
|
|
@@ -40106,7 +40267,7 @@ if (preflight) {
|
|
|
40106
40267
|
}
|
|
40107
40268
|
}
|
|
40108
40269
|
`;
|
|
40109
|
-
function
|
|
40270
|
+
function register61(server) {
|
|
40110
40271
|
server.registerTool(
|
|
40111
40272
|
"create_path_text",
|
|
40112
40273
|
{
|
|
@@ -40126,7 +40287,7 @@ function register60(server) {
|
|
|
40126
40287
|
},
|
|
40127
40288
|
async (params) => {
|
|
40128
40289
|
const result = await executeJsx(jsxCode57, params, { activate: true });
|
|
40129
|
-
return
|
|
40290
|
+
return formatToolResult(result);
|
|
40130
40291
|
}
|
|
40131
40292
|
);
|
|
40132
40293
|
}
|
|
@@ -40182,7 +40343,7 @@ if (preflight) {
|
|
|
40182
40343
|
}
|
|
40183
40344
|
}
|
|
40184
40345
|
`;
|
|
40185
|
-
function
|
|
40346
|
+
function register62(server) {
|
|
40186
40347
|
server.registerTool(
|
|
40187
40348
|
"select_objects",
|
|
40188
40349
|
{
|
|
@@ -40197,7 +40358,7 @@ function register61(server) {
|
|
|
40197
40358
|
},
|
|
40198
40359
|
async (params) => {
|
|
40199
40360
|
const result = await executeJsx(jsxCode58, params, { activate: true });
|
|
40200
|
-
return
|
|
40361
|
+
return formatToolResult(result);
|
|
40201
40362
|
}
|
|
40202
40363
|
);
|
|
40203
40364
|
}
|
|
@@ -40240,7 +40401,7 @@ if (preflight) {
|
|
|
40240
40401
|
}
|
|
40241
40402
|
}
|
|
40242
40403
|
`;
|
|
40243
|
-
function
|
|
40404
|
+
function register63(server) {
|
|
40244
40405
|
server.registerTool(
|
|
40245
40406
|
"convert_coordinate",
|
|
40246
40407
|
{
|
|
@@ -40258,7 +40419,7 @@ function register62(server) {
|
|
|
40258
40419
|
},
|
|
40259
40420
|
async (params) => {
|
|
40260
40421
|
const result = await executeJsx(jsxCode59, params);
|
|
40261
|
-
return
|
|
40422
|
+
return formatToolResult(result);
|
|
40262
40423
|
}
|
|
40263
40424
|
);
|
|
40264
40425
|
}
|
|
@@ -40327,10 +40488,11 @@ function registerAllTools(server) {
|
|
|
40327
40488
|
register60(server);
|
|
40328
40489
|
register61(server);
|
|
40329
40490
|
register62(server);
|
|
40491
|
+
register63(server);
|
|
40330
40492
|
}
|
|
40331
40493
|
|
|
40332
40494
|
// src/prompts/quick-layout.ts
|
|
40333
|
-
function
|
|
40495
|
+
function register64(server) {
|
|
40334
40496
|
server.registerPrompt(
|
|
40335
40497
|
"quick-layout",
|
|
40336
40498
|
{
|
|
@@ -40373,7 +40535,7 @@ Always respond in the user's language.`
|
|
|
40373
40535
|
}
|
|
40374
40536
|
|
|
40375
40537
|
// src/prompts/print-preflight-workflow.ts
|
|
40376
|
-
function
|
|
40538
|
+
function register65(server) {
|
|
40377
40539
|
server.registerPrompt(
|
|
40378
40540
|
"print-preflight-workflow",
|
|
40379
40541
|
{
|
|
@@ -40426,8 +40588,8 @@ Always respond in the user's language.`
|
|
|
40426
40588
|
|
|
40427
40589
|
// src/prompts/registry.ts
|
|
40428
40590
|
function registerAllPrompts(server) {
|
|
40429
|
-
register63(server);
|
|
40430
40591
|
register64(server);
|
|
40592
|
+
register65(server);
|
|
40431
40593
|
}
|
|
40432
40594
|
|
|
40433
40595
|
// src/server.ts
|