mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-18 13:33:51 +00:00
MCP: confined exporter plug-ins and unreadable linked files keep paths outside the read roots
Under automation read roots, an exporter plug-in's format (plugin.<id>) counts as an output that carries the native document, since its plug-in is given the document's JSON. document.serialize, document.export, document.exportSelection, Export for Screens and assets.export rows and file.exportAs refuse it before the plug-in runs and before any file or folder is written when the document links a JavaScript file, a linked image or placed file, a kept relative path or a data set's image outside the roots, with the existing errors. The JSON the plug-in is given leaves out an Export for Screens folder outside the roots. file.package refuses, before anything is written, a linked file whose native document it can't read to check: a native document that doesn't load, a PDF or .ai file that can't be opened (one that needs a password to open, or a damaged one), and a PDF, .ai or EPS file whose editing data doesn't load. The error, "a linked file's editing data can't be read to check it against the read roots", names no file or folder and gets rows in the complete-message catalogs. A PDF or EPS file without editing data is copied as before, and packages made without read roots are unchanged.
This commit is contained in:
+10
@@ -286,6 +286,16 @@ the suite) keep the agent to the folders you give it:
|
||||
linked native document with `relink: false`, as it is: when the native document such a file is or carries
|
||||
keeps a folder outside the read roots, the package is refused before anything is written with "a linked
|
||||
file's export folder is outside the read roots", which names no file or folder.
|
||||
- An exporter plug-in's format (`plugin.<id>`) carries the native document too: its plug-in is given the
|
||||
document's JSON. The JavaScript and linked image rules above refuse its files from every command that writes
|
||||
them, before the plug-in runs and before any file or folder is written, and the JSON the plug-in is given
|
||||
leaves out an Export for Screens folder outside the read roots.
|
||||
- `file.package` refuses, before anything is written, a linked file whose native document it can't read to
|
||||
check against the read roots: a native document that doesn't load, a PDF or `.ai` file that can't be opened
|
||||
(one that needs a password to open, or a damaged one), and a PDF, `.ai` or EPS file whose editing data
|
||||
doesn't load. The error, "a linked file's editing data can't be read to check it against the read roots",
|
||||
names no file or folder. A PDF, `.ai` or EPS file without editing data is copied as before, and the person at
|
||||
the keyboard packages every linked file as before.
|
||||
- `plugin.list`, `plugin.safeMode`, `file.recovery.*` and `ui_inspect`'s `scriptReport` leave out the paths
|
||||
outside the read roots, also those the person or an earlier request put there. In `plugin.list`, the plug-in
|
||||
folder last loaded is `null` in `folder.folder`, and a failed file in `folder.failed` and a plug-in's `source`
|
||||
|
||||
@@ -900,6 +900,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- Clipboard flavors under `--automation-read-root`: `clipboard.flavours` leaves out the SVG, and its markup as text, that `clipboard.exportSvg` refuses. `crates/engine/src/tests/links.rs` (`confined_clipboard_flavours_leave_out_a_withheld_svg`).
|
||||
- Preserve Editing SVG under `--automation-read-root`: the native document an SVG or SVGZ carries leaves out an Export for Screens folder outside the read roots, and keeps the other export settings and the art; the open document keeps the folder, and a folder inside the roots is kept. `crates/engine/src/tests/links.rs` (`confined_preserve_editing_svg_leaves_out_an_export_folder_outside_the_read_roots`).
|
||||
- Native document output and linked images under `--automation-read-root`: the outputs that carry the native document (a native file or template, an EPS file, a `.ai` or `.ait` file of every artboard, a PDF of every artboard with Preserve Editing, also from `document.exportPdf`, the saves and Export for Screens rows) are refused, before any file or folder is written, with an error that names no file or folder, when that document names a linked image or placed file, a kept relative path or a data set's image outside the read roots, or holds a stored brush entry that does not read as a brush; files without the native document are written. Those documents, and the documents Package writes or rewrites, leave out an Export for Screens folder outside the read roots, and Package refuses a linked file it copies as it is whose native document keeps one; the open document keeps its links, data sets and folder. An Export for Screens row that writes one artboard is checked against that artboard's art, and each asset, layer or selected object writes its own native, `.ai` or EPS file. `crates/engine/src/tests/links.rs` (`confined_native_output_refuses_a_linked_image_file_outside_the_read_roots`, `confined_native_output_refuses_a_data_set_image_outside_the_read_roots`, `confined_native_output_leaves_out_an_export_folder_outside_the_read_roots`, `confined_screens_rows_check_the_artboard_each_file_holds`), `crates/engine/src/tests/package.rs` (`a_confined_package_refuses_a_linked_file_that_keeps_an_export_folder_outside_the_read_root`), `crates/engine/src/cmd/fileio/tests_screens.rs` (`each_piece_writes_its_own_native_document`).
|
||||
- Exporter plug-ins and Package's unreadable linked files under `--automation-read-root`: an exporter plug-in's format, whose plug-in is given the native document's JSON, is refused before the plug-in runs when that document links a JavaScript file, a linked image or placed file or a data set's image outside the read roots, and the JSON leaves out an Export for Screens folder outside them; Package refuses, before anything is written, a linked native document, PDF, `.ai` or EPS file whose native document can't be read to check it (a PDF that needs a password to open, damaged editing data), and copies a PDF or EPS file without editing data. Errors name no file or folder, and the person at the keyboard exports and packages as before. `crates/engine/tests/plugin_export.rs` (`a_confined_exporter_is_refused_stored_paths_outside_the_read_roots`), `crates/engine/src/tests/package.rs` (`a_confined_package_refuses_a_linked_file_whose_editing_data_cannot_be_read`).
|
||||
- Linked-file and font-file searches under `--automation-read-root`: `links.findFiles` and `text.findFontFiles` replies, also later polls and stops of a search another client started, leave out the files found, a link's saved path and the folder searched outside the caller's read roots, and a failed search gives its reason without the path; `image.info` gives `link: null` for a linked file outside them; `text.addFontFiles` gives `folder: null` and the copies' file names when the Fonts folder is outside them. `crates/engine/src/tests/linkfiles.rs`, `crates/engine/src/tests/fontfiles.rs`, `crates/engine/tests/font_folder.rs`.
|
||||
- Swatch, brush, symbol and graphic style library lists under `--automation-read-root`: every library stays listed, the paths of library files and the user library folder outside the read roots are `null`, a library loaded from outside them is listed and found as `loaded/<file name>` and keeps that id for the session unless a library loaded later without a file shows that id itself, which moves it to the next free `loaded/<file name> (N)`, and the app's own list is not changed. `crates/engine/src/tests/library_roots.rs`.
|
||||
- Preferences commands under `--automation-read-root`: `prefs.get`, `prefs.list`, `prefs.set` and `prefs.reset` show folder preferences outside the read roots as `null` and leave out an export preset's folder outside them, and the preferences are not changed. `crates/engine/src/tests/prefs_roots.rs`.
|
||||
|
||||
Reference in New Issue
Block a user