Hosts from before api 3 refuse the manifest. A host at api 3 without writes
installs the filter, ignores the key and refuses an output that changes the
objects it was given.
plugin.remove now deletes an installed plug-in's stored module along with
its grant, before its settings and cache are deleted. When the module file
can't be deleted, the command returns "can't delete <file>", the settings
and cache are moved back, the plug-in stays installed, and the grant the
signed grants file held for it is written back, so the stored module
still loads at the next launch. Before, the command returned {removed}
and left the module in the plug-in folder.
The Safe Mode choice after a stopped launch moves to main's dialog host and keeps listing every
plug-in that was loading: one name in the sentence, or the list with "Disable Listed Plug-ins and
Continue". Automation requests wait in the queue while plug-ins load, and one past its deadline is
answered as expired. File > Open and opening a file still wait for the plug-ins still loading.
- A stored module's file is read again on its worker thread once the module
has loaded, whatever the file's modified time, and the install still skips
a file whose stamp changed since. The UI thread no longer reads the file.
- Stored and folder modules install through registry::install_for_load,
which checks for an install or removal of the id elsewhere while the
plug-ins' write lock is held, and records the module's grant in the same
step. A grant is forgotten only while the plug-in that took that revision
is still installed (registry::revoke_if_installed).
- A grant that a stored load removed and must put back for a later file is
written to grants.json first; when that write fails, the module is not
installed, and a grant put back for a module that then did not install is
removed again.
- A folder load in which a file found no loader thread is loaded again the
next time the preferences are applied. A plugin.reload keeps its report as
the folder last loaded only when no load started after it.
- Loads: a job's time is read while it is marked finished, the deadline check
reads the clock under the same lock, and only the jobs taken from the queue
fail when no worker is left. wait() counts outcomes taken with ready() as
released, so the jobs after them start.
- File › Open checks the path again after waiting for the plug-in loads.
- Tests wait for workers with bounded receives.
docs/plugins.md now says that each new member keeps only the id of the
old member in its place, with its name, live shape, opacity, blending
mode, appearance, opacity mask and other settings of its own reset, and
that `guide: false` on a compound path makes each guide member an
ordinary path.
The compound path test also checks that `type: "path"` without `guide`
is refused for a compound path with a guide member and leaves the member
a guide, and its doc comment names members that are not paths.
A member that is not a path (a compound path inside a compound path) is
not in the input's `path`, so a changed `path` or `type: "path"` deleted
it, together with any hidden or locked members it held. The host now
refuses such an output with an error naming the compound path. A
compound handed back as it was still keeps the member.
docs/plugins.md also says that new members keep the old ids by position
but not their names or live shapes. The test covers a nested compound
member and turning a compound with a guide member into a guide path.
A filter that handed a compound path back rebuilt every member from the
returned path, even when the path was unchanged, so its hidden members
were shown and its locked members unlocked after any run.
- A compound path whose path comes back as it was, or is left out, keeps
its members as they are.
- While a member is hidden, locked or a guide, a changed path or
`type: "path"` is refused with an error naming the compound path. A
guide member is allowed when the output also sets `guide`.
- A changed path still replaces the members, one per subpath, keeping
the old members' ids by position.
Docs: docs/plugins.md.
- A read-only image entry may leave out `opacity`, which hosts before API
level 3 don't give, so a level 2 filter that rebuilds an image entry from
the fields it knows still matches.
- A `text.paragraphs` list returned as it was given next to changed
`text.runs` is checked against the new paragraphs: a count that no longer
matches is refused instead of being dropped.
- Written runs hold at most 4,096 paragraphs, the limit for runs and for
the paragraphs a filter is given.
- A fill or stroke in a written run's style with a key its `type` doesn't
read (`tintt`) is refused with the `unknown key` error.
- The font family limit counts the name as given, not the trimmed name.
- The run styles of a type object are indexed once per object, not
compared with every run's style.
- Character styles loaded from another document are skipped when their
tracking, kerning, rotation, miter limit, dashes, Small Caps or variable
font axes are out of range, as `charStyle.new` checks them.
- The plug-in command test's Size command adds a square, since an output
that changes nothing records no undo step.
Docs: docs/plugins.md, docs/mcp.md, plugin.run params text.
- file.place with `importer` and `params` and `paths`, or with no file,
opened the Place dialog with only the files, so its OK read them with the
built-in reader. Each dialog entry now carries the importer and its
params, from the paths given, the desktop pick and the web pick, and OK
passes them to file.place and file.place.queue.
- On the web, each picked file carries its own pick's importer and params.
Picked files with other ones, or that arrive while a Place dialog is open,
wait for the next dialog.
- The Place dialog does not read the start of a PDF, .ai, EPS or PostScript
file placed with an importer named to tell whether Link would place it as
a document.
- A path placed or opened with `importer` named is refused from its size
before any of it is read. Before, its first 64 KiB were read first.
- docs/plugins.md and docs/mcp.md say when the size check runs, that the
web's File › Place reads the picked file in the browser, that File ›
Place's filters leave out extensions a built-in format reads, and that a
dropped file a built-in format reads goes to that format.
docs/plugins.md said a batch step does not count when a later step
installs, removes or reloads any plug-in. The step is dropped only when
a later step installs or removes that same plug-in, or reloads
plug-ins; installing or removing another plug-in keeps it.
A batch that ran several filters remembered only the last one, so the
earlier filters' dialogs opened with older parameters or their defaults.
Each plugin.run step of a command.batch or Action Batch is now noted in
the order it ran: the last one stays the filter Apply Last Filter runs,
and a filter that ran twice keeps its newer parameters.
A later install, removal or reload drops a filter's parameters only when
it may have changed that filter: a removal of its id, an install that
reports its id (or whose result is unknown), or a reload. Installing
another plug-in later in the batch keeps them.
An importer plug-in with "place": true in its manifest now reads its files
for File › Place as well as File › Open. file.place, file.place.info and
file.place.queue take importer and params; without importer, a file no
built-in format reads goes to the first placing importer by id that lists
its extension. The importer is given at most 128 MiB of the file (a larger
file is refused from its size before it is read) with _context.mode
"place", and its objects, guides left out, become one group named after
the file, as one undo step, embedded. A decline, invalid output, a trap or
Cancel places nothing.
- The Place dialog lists placing importers' extensions under "All
placeable files" and in a filter named after each importer.
- On the web, a placing importer's file dropped on the canvas is placed.
- A file placed with a named importer skips the text, PDF, DXF and PSD
import options.
- document.formats and plugin.list mark placing importers with place:
true; place on any other kind is refused at install.
Docs: docs/plugins.md, docs/mcp.md, docs/gaps.md, docs/target-app-parity.md.
Runs written without text.paragraphs that change the paragraph count at
two separate places gave every paragraph between the first and last change
the first one's style. The host now matches the old and new paragraphs by
their text: an unchanged paragraph keeps its style, changed paragraphs take
the styles of those they replace in order, and an added paragraph takes the
style of the one before it (the next one at the start) without a list
number. Past 262,144 compared pairs the paragraphs are paired in order.
Object › Plug-ins now starts with Apply Last Filter (plugin.applyLastFilter)
and Last Filter… (plugin.lastFilter). Once a filter plug-in's plugin.run
succeeds (its menu item, its dialog's OK, a shortcut, a request, the last
plugin.run step of a command.batch or of an Action Batch that processed a
file or data set, or a background run once its result is applied), Apply
<name> runs it again on the selection with the same parameters, without
its dialog, as one undo step, and <name>… opens its dialog with those
parameters. A filter's own dialog opens with the parameters it last ran
with in the session. Previews, Cancel, failed runs, a plug-in's own
commands and live effects don't count.
Both items are grayed out, and return an error through automation, with
no document open, before a filter ran, once that filter was removed or
installed again, or when its manifest no longer takes the parameters as
they are. The parameters are kept for the session only, for at most 64
filters.
The help page describes the same pair for filters:
https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=357
Where the items sit and when they are grayed out are VectorCraft's own
rules.
Docs: docs/plugins.md, docs/mcp.md, docs/target-app-parity.md.
Type a filter returned went to layout with its character and paragraph
styles only parsed, and a style equal to one of the type's runs was not
checked at all, so a filter could set leading of 1e9, 100,000 tab stops,
a scale of 0 or a Kinsoku set the document does not have.
- The ranges the character and paragraph style commands keep each
attribute to move to CharStyle::check_ranges and
ParaStyle::check_ranges in vectorcraft-doc (text/attr_ranges.rs).
charStyle.new, charStyle.edit, charStyle.setAttrs and the paragraph
style commands call them, and so does the filter write path, for every
run and paragraph style, including one the type already has.
- A paragraph style's custom Kinsoku set must name one of the
document's sets, and takes that set's characters.
- The character style commands now also refuse tracking and kerning
outside -1000 to 10000, rotation outside -360 to 360, a miter limit
outside 1 to 500, Small Caps outside 1 to 200, negative dash lengths
and a variable font axis setting that is not a number.
Each refusal names the object and the field, and the document does not
change. Docs: docs/plugins.md, docs/mcp.md, docs/target-app-parity.md.
A filter run, a plug-in command, or a run that calls commands applied its
output through Session::edit, which records an undo step and marks the
document modified even when the output changes nothing. The output is now
applied to a copy first, as colorcmds::edit_if_changed does: only a copy
whose objects or kept documentData differ becomes the document, as one undo
step. Otherwise the document, its undo history and its saved state stay as
they were, and the run's objects are still selected.
Docs: params text of plugin.run and plug-in commands, docs/plugins.md,
docs/mcp.md, docs/target-app-parity.md.
At plug-in API level 2 a command may give `menu`: `{"path": [...],
"after"?: label}`. The menus list it in that menu, right after the
built-in item `after` names (either label of an item that switches
between two), or at the end of the menu, with the plug-in's name in
parentheses after its label. Keyboard Shortcuts, the command palette
and `command_list` list it under that menu, and `plugin.list` gives its
`menu` with `after` escaped.
A manifest may name 14 menus of Edit, Object, Type, Select, Effect and
View. File, Window, Help, the application menu and the submenus that
list files, fonts, panels or plug-ins are refused when the module is
installed, as is any other `menu`, an `after` that is not 1-64
printable characters and a repeated `menu`. A command whose label with
the plug-in's name reads like a built-in item or submenu of that menu,
or like a command a plug-in with a lower id places there, stays in its
plug-in's submenu, and `plugin.list` and `plugin.inspect` mark it
`placed: false`. The desktop app and `vectorcraft-cli` give the same
result. Commands of several plug-ins at one spot are listed in plug-in
id order and then manifest order. A plug-in whose commands are all
placed elsewhere is a single item in Object › Plug-ins. At API level 1
the key is ignored, repeated or not.
- crates/engine/src/store.rs: each stored plug-in's load reports how
much of its file it read. What a failed read did not read goes back to
the 512 MiB the stored plug-ins may read together, on every platform;
the permission check before the loads is removed. A file that what is
left does not cover, but would if earlier reads failed, waits until
those reads are done, so the files still install in file-name order.
Disabled files and file stamps are taken once, when the store is
listed. A file's content is compared with its loaded module at install
only when the file was modified less than 2 s before the store was
listed; the clock is read only when a file was listed. A grant the load
removed goes back for a later file with the same id only when the
grants file has no entry for the id, and each install turn reads the
grants file once. At quit, a stored load takes no locks and a folder
load does not wait for the store's turn or for another window that is
changing the plug-ins.
- crates/engine/src/cmd/plugin.rs and crates/plugins/src/registry.rs:
when a folder load turns off the file of a plug-in disabled by its id,
the disabled list is saved in the same install turn, not only when the
load ends. A change made in another window while the folder is being
listed is one the load does not undo.
- crates/ui-egui: an export and File > Open install the plug-ins still
loading before they look up the formats, and a control request waiting
for the loads no longer asks for a frame of its own.
- crates/engine/src/file_access.rs: `ScopeHandle::capture` is as on
`main` again. The new `ScopeHandle::capture_now` keeps the process's
automation roots in force at capture time, and only the Additional
Plug-ins Folder's per-file check uses it.
- New tests: a stored file replaced with one of the same length and
modified time while it loaded is skipped; another window's
`plugin.list` reports a folder still loading as loading; a grant given
elsewhere after the load removed one is kept.
- docs/plugins.md: a module whose read and load take 10 s or longer is
skipped also when it would have finished later, and at quit the app
waits for the modules already loading, for at most 10 s. File > Open
waits for the loads. The Loading
paragraph and the docs/mcp.md lines are rewrapped.
A filter's `notice` made only of default-ignorable characters that the
host keeps as they are (U+034F combining grapheme joiner, the Hangul
fillers, variation selectors, invisible operators, tags and the like) was
accepted and showed an empty status message. Such a notice now refuses the
output, as one of only zero-width characters already did. The visible
character must also fall within the part the status bar shows: a notice
whose visible text comes after the 200-character cut is refused instead of
showing only the ellipsis. Text with a visible character keeps these
characters, and its bidirectional ones are still escaped.
A painted live effect that returned `notice` was refused and drew its
input unchanged, while the docs said the key is ignored. The painted
decoder now ignores a top-level `notice` and still refuses any other
unknown top-level key; the message and its catalog rows say so.
A plug-in step of an action or a `command.batch` now shows its notice in
the status bar too; when several steps report one, the last shows. The
run's result carries `pluginName`, the name of the plug-in that ran, next
to `notice`, so the status bar names the right plug-in even when a later
step of the batch removes or replaces it. The `plugin.run` and plug-in
command params text lists the new keys.
Docs: docs/plugins.md, docs/mcp.md.
A filter's manifest may list `writes`, the kinds among its `inputs` it
may change, at `api` 3 with `doc.write` in `permissions`. Such a filter
returns those objects with the fields it changes: type's runs and
paragraph styles, an image's transform and opacity, an instance's
transform and symbol (one already in the document), and each one's
name. Every value is checked as the input's limits and a path's paints
are; any other changed field, or a value out of range, refuses the run
naming the object and the field, and the document stays as it was.
The changes of one run are one undo step, and an output that changes
nothing records no undo step for any filter. Images are now also given
with their opacity.
Docs: docs/plugins.md, docs/mcp.md, docs/target-app-parity.md.
A filter, or a live effect with commands, at plug-in API level 3 lists
`context` (settings, artboards, layers, swatches) with `doc.read` in its
permissions. Each filter or command run is then given those parts of the
active document in `_context.document`, whether or not anything is
selected: the document's name without its folder, color mode, units,
active artboard size, bleed and raster effects resolution; every
artboard's id, index, name, rectangle and whether it is active; every
layer and sublayer with its parent, depth, name, visibility, lock,
template, color and whether it is current; and every swatch as
swatch.list lists it. It holds no path, object or write handle, and
live-effect drawing, exporters and importers get none.
More than 10,000 rows or 4 MiB of them fail the run before the plug-in
starts, with the document unchanged, and each row takes 1,000
instructions from the run's budget. The install prompt names the wider
read. API_LEVEL is now 3, so older hosts refuse such a manifest.
plugin.list and plugin.info give `context`, and their params text names
it and API level 3.
The plug-in fuzz tests add hostile `context` manifests, installed and
run with and without a selection.
Docs: docs/plugins.md (Document information), docs/mcp.md,
docs/target-app-parity.md.
A `number` or `int` parameter may now declare `"widget": "slider"`, with
an optional `step` counted from `min`. The filter, live-effect and
exporter dialogs and the Appearance panel's effect editor then show a
slider over the parameter's range before its number field. The slider is
named by the row's label for screen readers and moves by the step with
the arrow keys. A value off the slider's steps, typed in the field or set
by a script, is kept until the slider is moved. Install refuses the keys
on any other parameter, on a range with no room, or with a step that
cannot apply, and the refusals have rows in every complete catalog.
Hosts from before these keys ignore them, as they do the other display
keys.
While a slider is dragged, the preview runs the plug-in at most about ten
times a second, on the latest value, and the value the drag ends on
always previews. In the Appearance panel a drag is one undo step.
A filter's output may hold `notice`, one string reporting what the run did.
It needs no permission and no host import. Once the output is applied,
plugin.run and plug-in commands return it as `notice`, and the desktop app
and the web build show it in the status bar as `Plug-in “name”: notice`.
The status bar translates the words around it and never the notice.
The host trims the notice, escapes control, bidirectional and separator
characters, and cuts it at 200 characters, escapes included. A notice that
is not a string or has no visible character refuses the output, and nothing
changes. A run that declines, fails, is refused or is canceled shows none,
and a live effect's notice is ignored.
Docs: docs/plugins.md, docs/mcp.md, docs/target-app-parity.md.
At launch the desktop app loaded every stored plug-in and every module in
the Additional Plug-ins Folder on the UI thread before the window
appeared, one after the other. A slow or panicking module held up or
ended startup.
- crates/plugins/src/loader.rs (new): `Loads` runs load jobs on up to
four threads. Each job runs inside `catch_unwind`; a panic or a load
that takes 10 s or longer fails that job alone, and the others go on.
Outcomes come back in job order.
- registry::FolderLoad and store::StoredLoad list in one step, load on
the workers and install in file-name order. A module whose id was
installed or removed in another window while it loaded is skipped.
- The desktop app loads in the background only during launch; frames
install the finished loads. Plug-in commands, commands that edit,
exports, control requests and files opened at launch wait for the
loads first; view commands and queries do not.
- The launch marker names every plug-in still loading, not only the
oldest. After a launch that stopped during the loads, the Safe Mode
choice lists all of them, and Disable Listed Plug-ins and Continue
turns them all off. `plugin.safeMode` adds `pendingItems`. A module
whose load panicked is no longer named.
Docs: docs/plugins.md, docs/mcp.md.
plugin.remove now fails and leaves the plug-in installed while the key
store can't be reached, also when grants.json is missing or doesn't name
the plug-in, since an earlier signed copy put back could otherwise grant
it again. A grants file that is too large or doesn't hold a list no
longer stops a removal once the generation is raised. Removing an id
that isn't installed deletes the module stored for it that didn't load
and reports it removed.
The system key store is reached through keyring-core and the platform
store crates keyring 4.2 uses; a failed connection is tried again on
the next call. The key is read from the key store each time grants.json
is checked or signed, so a key removed or replaced there is not used.
The key and the generations are kept as hexadecimal text. On Windows
the lock for making the first key is in %LOCALAPPDATA%.
The wrong-key and copied-file cases of the edited-file test are at the
generation kept for their folder, so only the MAC rejects them.
The key store's generation for a plug-in folder now only goes up. When
writing or removing a signed grants.json fails after the raise, the
generation stays raised: the file left in place grants nothing and its
plug-ins ask for approval again. Before, the earlier generation was put
back, so a later raise could reach a generation a copy of the file was
already signed at, and that copy granted again.
- Keeping a lower generation than the kept one is an error.
- A signed file larger than 1 MiB is found before the raise, so the
file in place keeps its grants when nothing can be written.
- A kept generation within two of the largest 64-bit value is not
raised, so a signed write never fails after the raise for lack of a
next generation.
A revoke raised the kept generation past the one the grants file
carried. The file can be edited, so a file carrying the largest
generation made every revoke fail, and one just below it left the kept
generation at the limit, so later grants could not be kept. The
generation is now read from the key store only.
A raise went to the generation after the kept one, which is the
generation a signed write whose keep failed had used, so a copy of that
write put back after a revoke granted again. A raise now goes two past
the kept generation, and each signed write raises first and is written
at the generation after the raised one. Every signed write is at a
generation no file was signed at before. When the file can't be
written, the earlier generation is put back. When the generation can't
be raised without passing the largest 64-bit value, the change is
refused with a log record.
Revoking a grant while grants.json was missing, or while a file that
grants nothing (no valid MAC, too large, or not a list) was in its place
and had no entry for the plug-in, left the folder's generation as it
was. The last signed copy, still at the kept generation, then granted
the plug-in again once it was put back.
Such a revoke now raises the generation whenever the key store holds a
key. Every raise also goes past the generation the file in place
carries, so a signed write whose generation was not kept does not start
to grant when the generation catches up with it.
The key store now keeps a generation for each plug-in folder next to
the grants key, and grants.json carries its generation inside the MAC.
Every signed write puts the file at the next generation and then keeps
it; removing the file, or taking an entry out of a file VectorCraft
didn't sign, raises the generation first. A file at any other
generation grants nothing, so a signed copy put back after a grant was
revoked no longer brings the grant back, and a write whose generation
the key store couldn't keep leaves the file granting nothing. A key
store that holds a key and no generation counts as generation 0.
grants.json now holds {"version": 1, "grants": [...], "mac": "..."}, where
mac is an HMAC-SHA-256 of the grants and of the plug-in folder, made with a
random 32-byte key kept in the system key store: the Keychain on macOS,
Credential Manager on Windows, the Secret Service on Linux and the BSDs. The
MAC is compared in constant time. A file without a valid MAC for its folder
(an edited or added grant, a removed or changed MAC, a file copied from
another folder) grants nothing, and its plug-ins ask for approval again.
This changes the default for existing files: a grants.json written by an
earlier version is a plain list without a MAC, so its plug-ins ask once
more, and the next approval replaces it with a signed file.
When the key store can't be reached, an approval lasts for the session
only, nothing claims to persist, and the existing file is left as it is.
The first key is made under a per-user lock and read back, so processes
that approve their first plug-in at the same time keep one key. The web
build keeps no grants file.
New native-only dependencies of vectorcraft-engine: hmac, sha2, getrandom
and keyring (all MIT OR Apache-2.0).