Skip to content

2.3.0: argument warnings, UXP capability probe, bridge authentication

Latest

Choose a tag to compare

@zachshallbetter zachshallbetter released this 14 Oct 21:48
· 338 commits to main since this release
v2.3.0
35316ca

Added

  • Tool results carry a warnings list when an argument was not used as written: unknown parameters (ignored, with the closest valid name suggested) and deprecated aliases. Results without warnings are unchanged, and a warning never fails a call. Errors thrown before a call runs include the warnings too.
  • tests/unit/warnings.test.js, which also checks that handlers read only advertised parameters, so "was ignored" is accurate
  • UXP capability probe: indesign_status with probe: true on the UXP backend returns backend.uxpProbe, which reports whether the completion value comes back, how enums compare, native [i], constructor.name, fs path forms and Promise-returning methods. It also lists problems (tools that will misbehave) and handled differences. It is read-only and runs from the plugin (version 1.2.0).

Changed

  • objectIndex is accepted only by apply_color; on other tools it is reported as an unknown parameter
  • Older names that individual handlers read silently are now aliases in src/handlers/aliases.js, with deprecation warnings: folderPath -> outputPath (export_images, package_document), pageRange -> pages (export_images), applyObjectStyle -> objectStyle (place_image), transparency -> opacity (create_object_style)
  • Server instructions and docs/LLM_PROMPT.md describe warnings
  • UXP plugin version 1.2.0
  • tests/unit/uxp.test.js also covers the token on the bridge's WebSocket port

Security

  • With BRIDGE_TOKEN set, the bridge's WebSocket port requires it too. A connection must send { "type": "auth", "token": ... } as its first message; a wrong token or another message closes it (code 4001), and no message within 5 s (UXP_AUTH_TIMEOUT_MS) closes it (4002). Before, any local process could connect as the plugin, receive every script and return fake results. The Bridge Panel has a token field next to the port, stored in localStorage; the plugin and bridge must come from the same version.
  • A connected plugin is no longer replaced by a new connection: other connections are closed (4009) while it is open. A connection that closes before authenticating no longer disconnects the plugin.
  • The bridge compares tokens in constant time.

Status: tested statically and against a simulated UXP plugin; not yet run against a live InDesign. Previous parameter names keep working, now with deprecation warnings.