Merge main into fix/script-console-report-text

This commit is contained in:
dotCooCoo
2026-11-11 02:26:40 -08:00
66 changed files with 2933 additions and 188 deletions
+21 -8
View File
@@ -74,14 +74,27 @@ paths and text as ordinary art. Object › Expand, Object › Expand Appearance,
and Object › Path › Outline Stroke turn a dimension whose art they change into a plain group of that
art, also when they reach only a part of it: moving or scaling the group does not redraw it, it does
not follow the art it measured, and undoing the command gives the live dimension back. The menus dim
Object › Expand… while a whole dimension is selected, because its label has appearance items;
Object › Expand Appearance and the `object.expand` command still reach it. A dimension selected with
the art it measures also becomes a plain group when Object › Expand, Object › Expand Appearance or
Object › Path › Outline Stroke changes only that art and the art no longer fits the dimension's link,
for example because its number of anchors changed. When the art keeps its id and anchor count and the
dimension's own art does not change, the dimension stays live and its label shows the new length. Pasted
dimensions keep their geometry and drop their links, so they never bind to unrelated art in another
document.
Object › Expand… while a whole dimension is selected without the art it measures, because its label
has appearance items; Object › Expand Appearance and the `object.expand` command still reach it.
When a whole dimension is selected together with art it measures, directly or in selected groups
without fills, strokes or effects of their own, Object › Expand, Object › Expand Appearance and
Object › Path › Outline Stroke leave the dimension's lines and label as they are and change only the
other art. The menus do not dim Object › Expand… for the label of such a dimension. If the new art no
longer fits the dimension's link, for example because its number of anchors changed, the dimension
stays where it was, no longer linked, as it does when its art is deleted. Undoing the command links
it again. When the art keeps its id and anchor count, the dimension stays linked and its label shows
the new length. When the dimension is all the command would change, the command changes nothing and
reports the error it gives for a selection with nothing to change: "Expand: nothing to expand",
"Expand Appearance: the selection has a basic appearance" or "Outline Stroke: no stroked paths
selected". A selected group with fills, strokes or effects of its own changes everything it holds
when its appearance expands, its dimensions included: a geometry effect is baked into their lines
and label, which become a plain group, and a blur, feather or inner glow turns them into part of the
image that replaces the group's art. Type › Create Outlines still outlines the label of a dimension
selected with its art, which turns the dimension into a plain group.
Pasted dimensions keep their geometry and drop their links, so they never bind to unrelated art in
another document.
## Commands
+59 -6
View File
@@ -1569,6 +1569,8 @@ app through the global object `vc`, and writes to the Script Console and runs ot
missing file and a refused path throw errors the script can catch.
- `$.fileName` is the file being run, which is the file `$.evalFile` is running while it runs, and is empty for a
script given as `source`. `$.includePath` is the current `#includepath` list, separated by `;`.
- `alert(message[, title, errorIcon])`, `confirm(message[, noAsDflt, title])` and `prompt(message, preset[, title])`
open a dialog, described below. `vc.api.has("dialogs")` is true.
- `vc.args` is the `args` object.
- `vc.api.version` is `"1.0"`, and `vc.api.has(feature)` says whether the API has a feature.
@@ -1634,16 +1636,18 @@ VectorCraft sets these limits itself:
| `args` as JSON | 1 MiB |
| Log | 10,000 entries and 4 MiB |
| Script Console | 2,048 lines and 1 MiB of text; 4,096 bytes a line; 256 bytes of a script's name |
| A dialog's message, title and prompt preset | 16 KiB, 256 bytes and 16 KiB |
| `answers` | 10,000 answers and 1 MiB as JSON |
| `dialogs` in the report | 10,000 dialogs and 1 MiB as JSON |
| Growth before a person is asked | 100,000 objects and 512 MiB of new document data |
In the app, a script past the growth limit stops at a question to continue or to stop and undo. Stop, Escape and
`ui.dialog.cancel` all stop the run. A run with nobody to ask, such as a call over MCP or the command line, ends
with an error at that limit. The headless reply is `{ok: true, name, changed, written, log, fuelUsed, hostCalls,
runTimeMs, timingAvailable, hostCallCounts, slowestCommands, console}`. In the app the reply is `{running: true,
name}`, and the report appears later as `scriptReport` in `ui.inspect`. The report of a failed run has the same
fields after `kind`, `message`, `line`, `column`, `file` (when the error is in another file than the script) and
`fuelLeft`. `answers` takes only an empty object, since scripts
have no prompts yet.
runTimeMs, timingAvailable, hostCallCounts, slowestCommands, console, dialogs, dialogCount, dialogsTruncated}`. In
the app the reply is `{running: true, name}`, and the report appears later as `scriptReport` in `ui.inspect`. The
report of a failed run has the same fields after `kind`, `message`, `line`, `column`, `file` (when the error is in
another file than the script) and `fuelLeft`.
- `runTimeMs` is the time the script ran, its commands included. Waits between frames and for a person's answer are
left out. `timingAvailable` is false on the web, where `runTimeMs` is 0.
@@ -1651,6 +1655,11 @@ have no prompts yet.
- `slowestCommands` lists at most 5 commands as `{id, calls, totalMs, maxMs}`, the longest in all first, then by id.
- `console` is `{lines, droppedLines, truncatedLines}`: the run's own output, `vc.log` lines and uncaught error, as
text.
- `dialogs` lists the run's dialogs in the order they opened, as `{kind, message, title, errorIcon, answer}` for
`alert`, `{kind, message, title, noAsDefault, answer}` for `confirm` and `{kind, message, title, preset, answer}`
for `prompt`. `answer` is `"ok"`, `true`, `false`, the prompt's text, `null` for Cancel, `"stop"` for a dialog the
run ended at, or `"missing"` for a dialog `answers` had no answer for. `dialogCount` counts every dialog, and
`dialogsTruncated` is true when the list stopped at its limit.
```json
{"name":"run_command","arguments":{"command":"script.run","params":{"source":"vc.run('shape.rectangle', {x: 0, y: 0, width: 10, height: 10});"}}}
@@ -1660,6 +1669,47 @@ have no prompts yet.
vectorcraft-cli run --cmd script.run --params '{"path": "Tidy Layers.js", "args": {"margin": 12}}'
```
The help page https://extendscript.docsforadobe.dev/extendscript-tools-features/user-notification-dialogs/
describes the three dialog functions. A script calls them as globals:
- `alert(message[, title, errorIcon])` shows the message with OK, and an error icon when `errorIcon` is true. It
returns `undefined`.
- `confirm(message[, noAsDflt, title])` shows the message with Yes and No. Yes is the default button, and No is the
default when `noAsDflt` is true. It returns `true` for Yes and `false` for No.
- `prompt(message, preset[, title])` shows the message and a text field that starts with `preset`, with OK and
Cancel. It returns the field's text for OK, an empty string included, and `null` for Cancel.
The message, the preset and a given title are read as `String(value)` gives them, and `errorIcon` and `noAsDflt` as
`Boolean(value)` gives them. A title that is left out or `undefined` is Script Alert. A call without a message, or a
`prompt` without a preset, throws a `TypeError`. A message or a prompt's preset longer than 16 KiB, or a title longer than
256 bytes, throws a `RangeError` and opens no dialog. The dialog shows line feeds, carriage returns and the two
together as line breaks, and other control characters as their Unicode Control Pictures. The title stays on one
line, with line breaks shown as Control Pictures too.
In the app, the run waits at the call until the person answers, and spends no instructions while it waits. Enter
gives the default button's answer. Escape gives Cancel for a prompt, No for a confirm and Stop for an alert. Every
dialog also has Stop, which ends the run as `script.stop` does and puts back every document. A dialog can open only
from the script's own code: called inside a callback of a built-in function such as `Array.prototype.forEach`, a
getter, a `toString` conversion or a file `$.evalFile` runs, it throws an `Error`. The code of an `#include` file
is part of the script's own code, and its dialogs open as the script's do. Quitting while a dialog waits asks whether to stop the
script, and Cancel shows the dialog again with the text typed so far. In the app, `ui.dialog.confirm` answers the
open dialog (kind `scriptDialog`) with its `answer` field (`ok`, `yes`, `no`, `cancel` or `stop`), or with the
default button's answer when `answer` is left out. A prompt's `value` longer than 16 KiB is an error, and the
dialog stays open.
A run with nobody to ask takes its answers from `answers`, a list of `{kind: "alert", value: "ok"}`, `{kind:
"confirm", value: true}` or `{kind: "confirm", value: false}`, and `{kind: "prompt", value: text}` or `{kind:
"prompt", value: null}` for Cancel. Each dialog takes the next answer in order, callbacks of built-in functions
included. The run ends with an error that the script cannot catch, and every document goes back, when no answer is
left, when the next answer is for another kind of dialog, or when the script ends with answers it did not use.
`script.run` refuses a list that is malformed, longer than 10,000 answers or larger than 1 MiB before the run starts,
and refuses any answers for a run in the app, where the person answers. An omitted `answers`, an empty list and an
empty object are the same.
```sh
vectorcraft-cli run --cmd script.run --params '{"source": "if (confirm(\"Add a frame?\")) vc.log(prompt(\"Name\", \"Frame\"));", "answers": [{"kind": "confirm", "value": true}, {"kind": "prompt", "value": "Border"}]}'
```
Window › Script Console shows the session's script lines, oldest first: each run's start, its `$.write` and
`$.writeln` output, its `vc.log` entries, its uncaught error as `name:line:column: message` (or `name: file:line:column: message` when the error is in another
file), its end, and a report of
@@ -3607,7 +3657,10 @@ holds symbol instances that `object` expands, whether only their art holds it, w
`object` on), and `object.mesh.create` on a gradient-filled object colours the
mesh points as the gradient paints them, with the colors Object › Expand gives them.
`object.expand`, `effect.expandAppearance`, `type.createOutlines` and `object.path.outlineStroke` turn a dimension whose
art they change into a plain group of that art, in the same undo step (see [dimensions.md](dimensions.md)).
art they change into a plain group of that art, in the same undo step. `object.expand`, `effect.expandAppearance` and
`object.path.outlineStroke` leave a dimension selected with art it measures, directly or in groups without fills,
strokes or effects of their own, as it is and change only the other art; if the new art no longer fits the dimension's
link, the dimension stays where it was, no longer linked (see [dimensions.md](dimensions.md)).
`object.expand` rejects a param of the wrong type, such as `"fill": "yes"`, `"gradient": 3` or `"steps": "16"`, and
changes nothing. Omitting a param or giving null keeps its default.
+3 -1
View File
@@ -566,6 +566,7 @@ since 2026-10-01.
**Drawing tools, Star inner radius held with Ctrl/Cmd:** While a star is dragged out, Ctrl/Cmd keeps the inner radius the star showed when the key went down, also when the key is pressed with the pointer still. `a_star_drag_holds_its_inner_radius_with_ctrl_and_straightens_with_alt` and `a_star_drag_holds_the_inner_radius_it_shows_when_ctrl_goes_down` cover it, with Alt's straight shoulders and a drag canceled with Escape.
**Drawing tools, Dimension tool horizontal and vertical linear dimensions:** A linear dimension between two clicked points or dragged out from a segment is aligned, horizontal or vertical, chosen by where the pointer moves while it is placed, and a click again by the second point gives aligned; `dimension.create` and `dimension.update` take `orientation`, and the dimension stays linked to the anchors it measures, keeps its orientation when it or the art turns, with a line that lay outside the points kept outside them; an unlinked horizontal or vertical dimension that is reflected has its line on the reflected side. `the_pointer_chooses_aligned_horizontal_or_vertical`, `two_points_measure_horizontally_vertically_or_aligned`, `clicking_again_by_the_second_point_places_an_aligned_dimension`, `a_segment_drag_measures_horizontally_vertically_or_aligned`, `points_on_a_vertical_line_measure_aligned`, `horizontal_and_vertical_dimensions_draw_lines_along_their_axis`, `turned_horizontal_dimensions_stay_horizontal`, `a_linked_horizontal_dimension_keeps_its_gap_from_turned_art`, `a_linked_horizontal_dimension_below_or_between_its_points_follows_turned_art`, `a_reflected_horizontal_dimension_keeps_its_line_on_the_reflected_side`, `a_dimension_without_an_orientation_reads_as_aligned`, `dimension_orientation_is_checked` and `a_turned_dimension_keeps_its_line_on_its_side` cover it.
**Drawing tools, Dimension tool points that are not anchors follow the art:** A clicked point on a segment stays at its place along the segment, also when the segment curves, and a point off the art is linked to anchors (or, when the anchors lie on one line, anchors and handles) of the path, so both ends of the dimension follow when the art is moved, scaled, turned or reflected, also when the point was placed by a Smart Guide and when the dimension is saved and opened again; a linked linear dimension of reflected art (other than art on one line) has its line on the reflected side; deleting the art, changing its anchor count or whether it is closed, turning an angle's arm into a curve, or making a measured circle or arc no longer circular leaves the dimension where it was, no longer linked, instead of removing it. `a_dimension_to_a_point_on_a_segment_follows_the_art_at_both_ends`, `a_dimension_to_a_point_off_the_art_moves_with_the_art`, `a_dimension_whose_art_changes_its_anchors_stays_where_it_was`, `a_dimension_whose_art_is_opened_stays_where_it_was`, `angle_and_arc_dimensions_whose_art_no_longer_fits_stay_where_they_were`, `a_dimension_that_cannot_be_drawn_again_keeps_its_art`, `a_linked_dimension_of_reflected_art_has_its_line_on_the_reflected_side`, `a_dimension_to_a_point_off_a_line_follows_the_line`, `a_point_off_an_arch_is_reflected_with_the_arch`, `a_point_beside_an_almost_straight_curve_follows_it`, `a_point_off_a_loop_with_its_anchors_in_one_place_follows_it`, `a_point_beside_a_reflected_line_moves_as_a_half_turn_would`, `a_point_on_a_segment_stays_on_it_when_the_segment_curves`, `a_linked_dimension_of_a_reflected_curve_has_its_line_on_the_reflected_side`, `a_dimension_of_art_reflected_across_its_points_changes_sides`, `a_dimension_between_paths_reflected_each_in_its_own_way_keeps_its_offset`, `free_points_survive_a_native_file`, `dimension_free_points_are_checked`, `points_off_anchors_are_held_against_the_path` and `a_point_smart_guides_place_is_held_against_the_path` cover it.
**Drawing tools, Dimension tool dimensions selected with their art keep their lines and label:** Object › Expand, Object › Expand Appearance and Object › Path › Outline Stroke leave a dimension selected with art it measures, directly or in selected groups without fills, strokes or effects of their own, as it is and change only the other art; when the new art no longer fits its link, the dimension stays where it was, no longer linked, and undo links it again. `expand_leaves_a_dimension_selected_with_its_art_as_it_is`, `expand_appearance_leaves_a_dimension_selected_with_its_art_as_it_is`, `outline_stroke_leaves_a_dimension_selected_with_its_art_as_it_is`, `a_dimension_selected_with_art_that_has_nothing_to_expand_changes_nothing`, `a_group_effect_expanded_reaches_the_dimension_it_holds`, `expand_keeps_a_dimension_in_its_asset_and_its_variable_binding`, `a_dimension_keeps_no_link_to_the_art_expand_replaced`, `a_dimension_outlasts_the_art_outline_stroke_or_expand_appearance_replaced`, `a_dimension_outlasts_the_stroke_expand_outlined` and `expand_appearance_in_safe_mode_leaves_a_dimension_selected_with_its_art` cover it.
**Live trace result bounds and selection highlights exclude the retained bitmap except in source-image views:** `live_trace_result_bounds_exclude_the_retained_bitmap_at_any_angle` checks every TraceView, geometric and visual bounds and rotated result bounds. `live_trace_selection_highlight_excludes_the_retained_source_rectangle` checks result highlights and the existing ordinary-group policy. Shared editing-child traversal also preserves Shaper handling.
**Artboard Options shares existing presets and orientation controls and can fit artwork without moving it; artwork fitting includes all drawn document art across artboards and off-board; artwork bounds are cached by active document and revision, and selection uses the shared bounds cache across artboards:** Shared existing preset definitions are reused; no external preset assets are added. Presets preserve each selected artboard's orientation, and orientation choices apply even when the active board already matches. Fit operations draft bounds until OK, affect only the active artboard and leave artwork in place. Regression coverage checks draft/Cancel, selected-set application, active-only fitting and Undo.
@@ -732,6 +733,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- Scripts: the Script Console panel's report line reads as `script.console` gives it, `time unavailable` included on a platform without a clock; counts of host calls, dropped lines and cut lines take the singular for one, in each language's own plural forms; and a run that is no longer available still gets its end line (`crates/engine/src/tests/script_console.rs`, `crates/ui-egui/src/panels/tests_script_console.rs`).
- Scripts: a run reads its preprocessor lines before any of it runs: `#include` and `//@include` put another file in place of the line, looked for beside the including file, in the `#includepath` folders and in `JSINCLUDE`; `#script` names the run; `#target` and `#strict off` are taken, and `#strict on`, `#targetengine` and `#engine` are refused. `$.evalFile` runs a file with the same globals and returns its last value, and `$.fileName` and `$.includePath` give the file being run and the include folders. A script run from a file reads these files only in its folder and below, without `..` names or links that lead out, and an error in one is reported at its own file, line and column ([preprocessor directives](https://extendscript.docsforadobe.dev/extendscript-tools-features/preprocessor-directives/), [the `$` object](https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object/); `crates/engine/src/tests/script_include.rs`).
- Scripts folder: File › Scripts lists the `.js` and `.jsx` files of the `Scripts` folder next to the preferences, each named after its file without the extension, with each subfolder as a submenu, above Check Script… and Other Script… (https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/install-and-run-scripts.html). VectorCraft's own rules: the folder is read again when the window becomes active and when the File menu opens, links are not followed, and one read stops at 2,048 entries, 512 scripts, 128 subfolders, 4 levels or 250 ms. `script.listInstalled` returns the listing. `crates/engine/src/tests/script_folder.rs`, `crates/ui-egui/src/tests/scripts_menu.rs`.
- Scripts: `alert`, `confirm` and `prompt` open dialogs during a run, each with a Stop button that ends the run and puts every document back. In the app the run waits at the call for the person's answer; a run over MCP or the command line takes its answers in order from `script.run`'s `answers`, and the report lists each dialog with its answer. `crates/engine/src/tests/script_dialogs.rs`, `crates/ui-egui/src/tests/script_dialogs.rs`.
- Parameter keys: the engine refuses a key that a command's params description doesn't name before the command runs, in every build and for every caller, including the app's own calls, the commands a command runs and the steps of `command.batch` and `action.batch`. An action recorded by an older version still plays from the Actions panel and the Batch dialog (`Session::replay`). `crates/engine/tests/it/param_keys.rs`.
- MCP server with 25 tools (drawing, text, effects, Pathfinder, transforms, graphs, text wrap, export, screenshots, any command), attached to the running app or headless. Tool descriptions and replies agree with the engine: format lists come from its format table, `save_file` says it keeps the document's own format, `inspect_document` reports the paint type's characters show, and selection exports report the encoder's warnings. `--automation-read-root` / `--automation-write-root` (on `vectorcraft-cli mcp` and on `vectorcraft --control`) confine the files commands read and write to chosen folders, links followed, with the flags PhotoCraft takes (#832); each flag may be given more than once, a path inside any of its folders being allowed (#3546, `file_access::tests::several_roots_of_a_kind_each_grant_their_access`, `cli::mcp_automation_roots_take_several_folders`). A long export can be cancelled (`notifications/cancelled` stops it at the next page or group and writes nothing), reports page progress to a client that sent a progress token, and does not make other requests wait: engine-free ones answer at once, the rest are refused as busy after two seconds (#2165, #2171, #2172).
- MCP protocol: five prompts (`prompts/list` / `prompts/get`: poster, icon set, recolour, trace-and-style, export set), `completion/complete` for prompt arguments and template variables read from the live catalogues (formats, effect ids, command ids, trace presets, swatch and object ids), four resource templates (`vectorcraft://object/{id}`, `//command/{id}`, `//effect/{id}`, `//swatch/{name}`) so an agent reads one thing instead of the whole document, and `logging/setLevel` with `notifications/message`. `window.panel` ids are case-insensitive (display labels work too), `vectorcraft://object/{id}` reads through `document.node {summary: true}` (the same reply bytes from one lookup instead of summarizing the whole document: a leaf read on a 2,000-object document drops from ~20 ms to ~0.06 ms), large containers slice with `document.node {depth?, childLimit?}` (truncated levels report `childCount`), `document.inspect` and the `inspect_document` tool slice the same way so a depth-0 read is the layer skeleton (~9.7 KB instead of ~2 MB on a 2,000-object document), `document.find` locates nodes by name/kind/text with ancestor paths, and the CLI sweeps the protocol surface over stdio against the compiled binary. `docs/mcp.md` has a Protocol section covering the capability table and what is deliberately absent (subscriptions, progress, cancellation, sampling, elicitation, Streamable HTTP — all of which need the transport to interleave reads).
@@ -1897,7 +1899,7 @@ A VectorCraft addition, not a feature of the reference app, so no area score mov
## Dynamic symbols (2026-11-01)
Symbols area (#4938), from the public symbol documentation ([create and place symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-and-place-symbols.html), [edit symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/edit-symbols.html)). Symbol Options has Symbol Type (Dynamic Symbol / Static Symbol; the dialog's default is Dynamic, `symbol.new`'s `type` defaults to static so scripts behave as before). An instance of a dynamic symbol keeps its own opacity and blend for any object of the symbol's art, and its own fill and stroke for an object that draws them, named by a child-index path (`symbol.instance.setAppearance`), and stays an instance: the canvas, SVG, PDF, EPS, legacy `.ai`, EMF/WMF and DXF writers, effects and Expand draw the art with those changes. Redefining the symbol reshapes every instance and keeps each change whose object the new art still has; Break Link bakes the changes into the art; Edit Symbol expands the symbol's own art; Reset (`symbol.instance.reset`: the Properties panel's Quick Actions and the Symbols panel menu) and making the symbol static drop them, and Replace Symbol drops them when it gives the instance a different symbol. The type is stored on the symbol and the changes on the instance in the native format, both left out when unset, so documents without them save byte for byte as before. Remaining: on-canvas editing beyond a solid fill and stroke on a path, compound path or type object inside a dynamic instance; reading and writing the type and changes in `.ai` files. Evidence: `crates/engine/src/tests/dynamic_symbols.rs`, `crates/doc/src/symbol_overrides.rs` tests. Score unchanged at 87% (estimated); hours 5–9 → 4–8.
Symbols area (#4938), from the public symbol documentation ([create and place symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-and-place-symbols.html), [edit symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/edit-symbols.html)). Symbol Options has Symbol Type (Dynamic Symbol / Static Symbol; the dialog's default is Dynamic, `symbol.new`'s `type` defaults to static so scripts behave as before). An instance of a dynamic symbol keeps its own opacity and blend for any object of the symbol's art, and its own fill and stroke for an object that draws them, named by a child-index path (`symbol.instance.setAppearance`), and stays an instance: the canvas, SVG, PDF, EPS, legacy `.ai`, EMF/WMF and DXF writers, effects and Expand draw the art with those changes. Redefining the symbol reshapes every instance and keeps each change whose object the new art still has; Break Link bakes the changes into the art; Edit Symbol keeps the instances linked and keeps each change whose object the edited art still has; Reset (`symbol.instance.reset`: the Properties panel's Quick Actions and the Symbols panel menu) and making the symbol static drop them, and Replace Symbol drops them when it gives the instance a different symbol. The type is stored on the symbol and the changes on the instance in the native format, both left out when unset, so documents without them save byte for byte as before. Remaining: on-canvas editing beyond a solid fill and stroke on a path, compound path or type object inside a dynamic instance; reading and writing the type and changes in `.ai` files. Evidence: `crates/engine/src/tests/dynamic_symbols.rs`, `crates/doc/src/symbol_overrides.rs` tests, `crates/engine/src/tests/symboledit.rs`. Score unchanged at 87% (estimated); hours 5–9 → 4–8.
## Document Tools add-on: Export All Open Documents (2026-11-01)