A script that opens a document and then throws, runs out of budget or is
abandoned loses that document with its working copy, so its waiting
document.opened event is now dropped when the run ends. The saves it made
before failing are still delivered, and so is a document the frontend opened
while the run was paused.
- A waiting event names each recipient by its installation serial too, so a
module that another session removed and installed again is not given an
event from before.
- A merged layer.changed keeps the reasons per plug-in: one installed between
two changes is given only the later change's reasons.
- Delivery waits while an interaction is open; the events go out at the first
delivery after it ends.
- A failed top-level request still delivers what finished before the failure,
such as a save in a command.batch whose later step fails. A document.opened
for a document that the rollback closes again (a batch, or a failed command
of a script or a plug-in call) is dropped.
- An event's handler checks the deadline before vc_alloc and before vc_event.
- The shared-budget test uses a small instruction budget and checks for an
instruction-budget error, and the UI test removes its plug-in when it ends.
A plug-in at API level 2 with the new `events` permission can name any of
`selection.changed`, `document.opened`, `document.saved` and
`layer.changed` in its manifest's `events` list. Its `vc_event` export is
then called with a small JSON event after each change of that kind has
finished, outside any undo step. Changes between two deliveries are one
event. The desktop app delivers twice a frame, after the work that
finished in the background and at the end of the frame after the canvas,
panels and dialogs ran; control-channel requests run in the desktop app
and are delivered by the frame. vectorcraft-cli and headless MCP deliver
after each request. A plug-in installed after a change is not given it,
and a change made after an install reaches the new plug-in at the next
delivery.
- A handler only reads. It may call ten commands that read
(dataset.list, graphicStyle.list, guide.list, image.info,
object.blend.info, swatch.list, symbol.list, text.getRange,
transparency.info and variable.list); any other call fails before it
runs with an error naming the event. After each call every document
with its selection, current layer and undo history, the active
document, the paint defaults, the active Appearance row and the
preferences are put back, and a call that changed a document is
refused.
- A handler gets 5 M instructions and 200 ms, shared by the module's start
function, `vc_alloc` and `vc_event`. A handler that fails 3 times in a
row gets no more events until VectorCraft starts again.
- An event raised while a handler runs waits for the next delivery.
- Events carry the document number and counts; selected ids (at most
2,048) only with `doc.read`. No paths or file contents.
- A save that finishes after its document closed is still reported.
- A document opened or created since the last delivery is compared with
its state when the command that added it ended, so the first change
made to it is an event.
- A waiting event is dropped for a plug-in that was removed, so the same
module installed again is not given it.
- The desktop app delivers the events of a script in the frame the script
ends in.
plugin.list and plugin.info report `events`, `eventsOff` and
`lastEventError`. Docs: docs/plugins.md (Events), docs/mcp.md and one
progress line in docs/target-app-parity.md. The new plug-in messages, the
status lines for a failed handler and the permission's words in Install
Plug-in... have rows in every complete catalog.
A color a library pattern's art brings now skips the library's numbered
names while the pattern is imported, instead of being renamed after the
import. The rename also rewrote every other paint in the document linked
to the name the import first gave, such as art still linked to a deleted
"Ink 2", so adding the pattern changed that art. Now the names are held
with placeholder swatches during the import and removed afterwards, and
links that were already in the document stay as they were.
A pattern whose art brings both "Ink" and the library's "Ink 2" keeps the
library's "Ink 2" under its own name when the document gives "Ink"
another color, and the library's "Ink" takes the next free name. A library
pattern with a numbered name, such as "Tiles 2", keeps that name when the
document does not use it.