Repository navigation
2.2.0: canonical parameter names and UXP result parity
Canonical parameter names
One parameter name and one enum vocabulary per concept, so agents stop guessing. The older names and values are still accepted as aliases (mapped in src/handlers/aliases.js before a handler runs) and generate exactly the same scripts; they are no longer advertised in the schemas.
Names
| Concept | Canonical | Still accepted | Tools |
|---|---|---|---|
| Stroke weight (points) | strokeWeight |
strokeWidth |
create_rectangle, create_ellipse, create_polygon, create_master_rectangle (already strokeWeight: create_object_style, set_page_item_properties) |
| Font | fontName ("Family\tStyle", InDesign's Font.name, or a family name) |
fontFamily; fontFamily + fontStyle |
create_paragraph_style, create_character_style, create_master_text_frame (already fontName: create_text_frame, edit_text_frame) |
| Alignment | alignment with InDesign Justification names: LEFT_ALIGN, CENTER_ALIGN, RIGHT_ALIGN, LEFT_JUSTIFIED, RIGHT_JUSTIFIED, CENTER_JUSTIFIED, FULLY_JUSTIFIED |
LEFT, CENTER, RIGHT, JUSTIFY (= LEFT_JUSTIFIED), any case |
create_text_frame, edit_text_frame (already Justification: create_paragraph_style, create_master_text_frame) |
| Item index | itemIndex |
objectIndex |
apply_color |
Changed
create_text_frameandedit_text_framenow also acceptRIGHT_JUSTIFIED,CENTER_JUSTIFIEDandFULLY_JUSTIFIED- Every index parameter is an
integerwithminimum: 0(spreadIndex,referenceSpreadIndexandmatchIndexwerenumber; the page-item and group indexes had no minimum) - Every item index description names its collection:
page.allPageItems(thelist_page_items/list_groupsnumbering) for the page-item and group tools,page.textFramesforframeIndex,page.allGraphicsforget_image_info, and the chosen collection forapply_color/apply_object_style - Server instructions and
docs/LLM_PROMPT.mddescribe the canonical names and index spaces
Added
tests/unit/aliases.test.js: each alias generates the same script as its canonical name- Definition tests: index parameters are bounded integers, aliases are not advertised, alignment enums are the Justification names
UXP backend returns tool results
Under INDESIGN_BACKEND=uxp, most tools returned an empty result: the plugin only passed back an explicit return, while the handler scripts end with a bare expression, and the scripts used ExtendScript globals that UXP does not have. The plugin now runs them with ExtendScript semantics. This is tested against a fake InDesign DOM only; the backend stays experimental until it has been run against InDesign.
Changed
- The UXP plugin (
uxp/plugin/runtime.js, plugin version 1.1.0) evaluates each script withevaland returns its completion value, asdo script/DoScriptdo. Code with a top-levelreturnorawaitstill runs as an async function body. - Enums and classes a script names come from
require('indesign');File,Folderand$are shims.File.existsandFolder.create()use UXP'sfsmodule, so the plugin manifest now requestslocalFileSystem: fullAccess. appis wrapped socollection[i]falls back toitem(i)andconstructor.nametoconstructorName(UXP DOM differences documented by Adobe);Fileshims reach DOM methods as path strings.- UXP string results are trimmed, as the AppleScript/COM paths trim stdout.
- The plugin's WebSocket port is set in the Bridge Panel (default 3001, remembered), so
UXP_WS_PORTon the bridge no longer breaks the connection. The bridge prints the port to enter when it is not 3001. autore-checks the bridge every 5 s instead of once per process, and falls back to ExtendScript for a call only when the bridge is unreachable or the plugin is not connected (the script cannot have run).- With
BRIDGE_TOKENset, the bridge requires it on/statusas well as/execute. - A UXP bridge timeout is reported as a timeout, not as "bridge not reachable".
Added
tests/unit/uxp.test.js(npm run test:uxp, part ofnpm test): the real bridge with a fake plugin runningruntime.jsin a Nodevmagainst a UXP-shaped fake DOM. Every handler script must return over UXP what it returns when evaluated ExtendScript-style. It also covers the token,autore-check and fallback, and the shims.tests/audit/collectScripts.js: the script capture shared by the audit and the UXP test.
Known gaps
- Enum comparisons with
==may fail if UXP enum values are objects (six handler scripts compare enums). Whether every DOM method that takes a file accepts a path string is unverified. Details inuxp/README.md.
Status: tested statically and against a simulated UXP plugin; not yet run against a live InDesign. Previous parameter names keep working.