Commit Graph
198 Commits
Author SHA1 Message Date
dotCooCoo d9e9adbf45 MCP: answer_dialog sets the fields and answers the dialog in one request
answer_dialog sent ui.dialog.set and then ui.dialog.confirm or
ui.dialog.cancel as two requests. A dialog another control connection
opened between them was confirmed or canceled without the fields.

ui.dialog.set takes `action: confirm | cancel`, checked before any field
is set, and confirms or cancels the dialog the fields were set in within
the same request, replying {dialog, result}. answer_dialog sends set and
action together; an app whose reply has no `dialog` key did not answer
it, and the dialog is then confirmed or canceled with its own request.
2026-11-10 14:51:50 -08:00
BFlat d80e73b76e Merge pull request #6342 from christianlappin/codex/fix-6322-rotate-view-mcp
MCP: handle Rotate View gestures in the desktop canvas
2026-11-10 20:10:24 +07:00
dotCooCoo 7b44ef5737 Merge main into feat/script-run 2026-11-09 23:43:37 -08:00
dotCooCoo 9ccea9cfcb Commands: engine.apiReference returns the command API reference in Markdown
engine.apiReference {} -> {markdown} writes a reference from the built-in
commands' parameter schemas each time it runs: a section per command that
has a schema, in registry order, with its label, menu path, API levels,
what it writes, cost, summary and return, and a table of its parameters
(type, range with included or excluded ends, unit, JSON or worked-out
default, required, levels and description; object members as dotted
rows). Commands without a schema, plug-in commands included, are left
out. Schema text is escaped so it stays plain text in its cell, control
characters become spaces, and a reference past 1 MiB is an error rather
than a cut-short text. The command needs no document.

MCP serves the same text as the fixed resource
vectorcraft://commands/reference (text/markdown; charset=utf-8); the
other resources still read as JSON.

The command's own schema raises the schema API level to 2. Its label and
its size error have rows in every catalog that needs them.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-09 21:24:13 -08:00
dotCooCoo 9d01c0e7b5 MCP: test that list_commands gives input schemas over stdio 2026-11-09 19:59:29 -08:00
dotCooCoo 9172950ad5 MCP: command listings give each command with a schema an inputSchema
engine.commands, command_list and list_commands now list an inputSchema
next to schema for each command with a parameter schema. It is the same
JSON Schema 2020-12 schema with the root type "object", the form an MCP
tool's inputSchema takes
(https://modelcontextprotocol.io/specification/2026-07-28/schema);
schema keeps the root type ["object", "null"] when no parameter is
required. A command without a schema lists neither field. tools/list is
unchanged, and the commands are still run with command_run or
run_command.

brief now leaves out schema and inputSchema as well as the params text;
a listing filtered to the command's id gives them.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-09 19:34:24 -08:00
dotCooCoo 2c0d09e079 Scripts: File › Scripts › Other Script… runs JavaScript files
File › Scripts › Other Script… picks a .js or .jsx file, shows a warning
that can be turned off in Preferences › General, and runs the script
against the open documents through the `vc` object. The new
`script.run` and `script.stop` commands run and stop a script over MCP.

- A run is one transaction. Each document it changed gets one undo step
  named Run Script. An uncaught error, a limit or a stop puts every
  document, the paint, the clipboard, menu state and preferences back.
- A command that fails inside a run, or whose result is too large to
  reach the script, is undone and throws an error the script can catch.
- Files a command wrote stay on disk and the report names them, also
  when the run is stopped from the quit question.
- While a script runs, other commands that change anything fail with a
  busy error; MCP reports it as JSON-RPC error -32003.
- In the app the run advances one slice per frame with a Stop button in
  the status bar. A run that adds a great many objects asks whether to
  continue; Stop and Escape end it.
- Commands that change state outside the documents, such as prefs.*,
  plugin.* and file.place.queue, are refused to scripts.

Docs: docs/mcp.md, docs/gaps.md, docs/roadmap.md,
docs/target-app-parity.md.
2026-11-09 18:35:41 -08:00
Christian Lappin ef25dffe01 fix(mcp): validate and cancel Rotate View gestures (#6322) 2026-11-09 15:31:35 -05:00
dotCooCoo c2753c1169 Merge main into fix/plugin-grant-app-approval 2026-11-08 22:17:36 -08:00
BFlat cc02f7b35e Merge pull request #4379 from dotCooCoo/fix/shape-builder-merge-off-ui-thread
Shape Builder: a large selection merges on another thread
2026-11-09 13:10:54 +08:00
dotCooCoo e7c3307f07 Merge main into fix/plugin-grant-app-approval 2026-11-08 20:58:47 -08:00
dotCooCoo fc728b909e Merge main into fix/shape-builder-merge-off-ui-thread 2026-11-08 20:23:21 -08:00
dotCooCoo 4941b377f9 Merge main into fix/plugin-grant-app-approval 2026-11-08 19:01:49 -08:00
dotCooCoo bf4ec4253d Merge main into fix/save-screens-unknown-options 2026-11-08 18:13:32 -08:00
dotCooCoo 0f002e7625 Plug-ins: tests cover each route that cannot approve an install
Add tests that an action step running plugin.install with grant is
refused, that ui.key, ui.click and ui.pointer sent through the control
path at the open approval dialog approve nothing, with OK focused too,
that MCP answer_dialog reports the app's refusal, that ui.installPlugin
given grant or allowHeavy approves nothing, and that a module recorded
in grants.json installs from a session with that store and no flag
while other bytes under its id are refused.

The batch assertion now checks the refusal's message. The docs and
comments state that Enter confirms the dialog only when OK has the
keyboard focus.
2026-11-08 17:47:02 -08:00
BFlat b652599548 Merge pull request #6264 from dotCooCoo/feat/plugin-importers
Plug-ins: importer plug-ins open file types VectorCraft does not read
2026-11-09 09:24:07 +08:00
dotCooCoo 918ef940cb Merge main into feat/plugin-importers 2026-11-08 16:45:20 -08:00
dotCooCoo 8579f436f7 Merge main into fix/save-screens-unknown-options 2026-11-08 16:12:24 -08:00
BFlat 52ee41f897 Merge pull request #6253 from Silvertree2010/fix/h12972-mcp-object-resource-uri-accepts
Reject non-digit object ids in MCP object resource URIs
2026-11-09 07:55:33 +08:00
NetterSilverandClaude Haiku 5.5 5a4772d24a Reject non-digit object ids in MCP object resource URIs
Found while testing crates/mcp/src/resources.rs:191 (read_object)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 21:10:17 +01:00
dotCooCoo fd3482c272 Merge main into fix/shape-builder-merge-off-ui-thread 2026-11-08 11:28:00 -08:00
dotCooCoo e152973836 Save: saved Export for Screens keys no longer read don't block the export
The Export for Screens dialog and the Asset Export panel open
remembered settings and presets without the row and settings keys the
export no longer reads, and without settings for a format it doesn't
write, so their export and Save Preset are not refused.

A format row and a format's settings take `params`, an exporter
plug-in's own, and `security.passwordRequired`, which remembered
settings hold where PDF passwords were left out, and `settings` takes an
exporter plug-in's format, as before the key check. assets.export and assets.settings.set check the
rows and settings they are given as document.exportForScreens does.
An unknown top-level key of document.exportForScreens gets the
command's usual "the command takes" error.

The MCP save and Export for Screens calls no longer check the params
themselves: Session::execute checks them before anything runs.
2026-11-08 09:51:22 -08:00
dotCooCoo 5522059417 Save: the save commands and Export for Screens refuse an unknown option key
document.save, file.saveAs, file.saveCopy and file.saveAsTemplate wrote
the file when given a key that no save format reads, beside the path or
in options, or an unknown key inside a PDF option object such as
marks.useDocumentBleed. document.exportForScreens did the same for an
unknown top-level key, a key in a format row and a key in the settings
of a format.

These commands now refuse such a key and name its path
(options.noSuchOption, formats[1].marks.useDocumentBleed). The svg
object is checked in every save, export and format row, also when the
file written is not SVG. A save still leaves out a key that only another
save format reads, and warns as before. A format row and a format's
settings still take includeArtboardFill and richBlack, which the
encoders read. document.exportPresets.save checks its settings, with the
rows and settings in it, the same way.

In the app, file.save and file.exportForScreens sent as commands are
checked as document.save and document.exportForScreens, and app.save is
checked before anything is written; MCP's app.save, file.save and
file.exportForScreens are checked the same way. The SVG Options dialog
no longer passes its internal fields on to the save.
2026-11-08 08:31:24 -08:00
dotCooCoo 58f5789e9a Plug-ins: Open With passes an importer its parameters and adds the file to Open Recent
File › Open With asks for the parameters of an importer that declares
any, at their defaults, once the file is picked (dialog `pluginImport`),
and opens the file with the values set. `file.openWith`, `app.open` and
MCP's `open_file` take `params` and pass them to the importer;
`app.open` without them runs the importer on their defaults, with no
dialog. A file opened with Open With is added to Open Recent, as File ›
Open adds the files it opens.
2026-11-08 05:07:08 -08:00
dotCooCoo 36eec28617 MCP: open_file takes an importer plug-in to open the file with
open_file passes `importer` (an importer plug-in's format id,
plugin.<id>) on to app.open. Headless, it becomes document.open's
`importer`; in the app, app.open with `importer` runs file.openWith, so
the file opens with that importer as File > Open With does, also when a
built-in format reads its extension.
2026-11-08 04:40:23 -08:00
dotCooCoo 6ffcf800c8 Export: the export commands refuse an unknown option key
document.export, document.exportSelection, document.serialize, app.export
and file.export took {noSuchOption: true} and wrote the file with no
warning. They now refuse a key that no format lists in document.formats,
and name the nearest key when one is close. document.exportPdf,
document.pdfSettings and pdf.preset.save refuse a key PDF doesn't take,
document.exportEps one EPS doesn't take and document.exportDxf one DXF
doesn't take. Each refuses an unknown key inside an option object it takes,
such as marks.useDocumentBleed, and names its path.

A key that only another format reads, such as {format: pdf, quality: 80},
is still ignored: docs/mcp.md says one object can carry several formats'
options. The check runs for callers (the control channel, MCP, the CLI).
A journal or a recorded action isn't checked, and a saved PDF preset with
a key that is no longer read still loads.

document.formats now also lists PDF's thumbnails, fastWebView and
viewAfterSaving.
2026-11-06 23:09:15 -08:00
dotCooCoo 7ee6b429ba MCP: save_file notes name the legacy or non-PDF-compatible .ai
save_file's note for a key in `options` that the written format doesn't
read named every .ai file a PDF-compatible .ai, also when the save wrote
a version 7 file (`aiVersion: "7"`) or one without PDF content
(`pdfCompatible: false`).

The save itself now writes that note, beside its note on a top-level
`compress`, `version`, `preview` or `precision`, and names the file it
writes, including when it reuses the options the document was last saved
with. save_file returns the save's reply unchanged, and
`run_command document.save` and the other save commands give the same
notes.
2026-11-07 08:19:24 +07:00
KnottyDyes c9588457b9 Export: raster output defaults to the document resolution 2026-11-05 19:02:23 +07:00
dotCooCoo e9be911c9b MCP: pointer_gesture rejects a backquote that is not a boolean
A `backquote` given as a string or a number, on the request or on an
event, was read as absent, so `"true"` moved the object's geometry
instead of its pattern. `pointer_gesture` and `ui.pointer`, headless
and desktop, now answer with an error before any event runs.
2026-11-05 14:12:18 +07:00
Dylan M. Taylor 4338ef75e3 MCP: render_preview and window captures decode the app's PNG under size limits (#5445) 2026-11-03 17:28:38 -05:00
dotCooCoo bbbce4318f Add Enclosing Lasso as an optional tool
Squashed from #5362 onto main.
2026-11-03 23:30:06 +07:00
Dylan M. Taylor 1806da580c fix(mcp): busy replies don't repeat a long request id 2026-11-03 22:17:45 +07:00
dotCooCoo 33f429972b Merge main (11862f61) into feat/native-save-precision 2026-11-02 16:29:45 -08:00
dotCooCoo b5c91ece24 File formats: .dib and .rle bitmaps, .pdd Photoshop files and .pns PNGs open and place
File > Open and File > Place read BMP files named .dib or .rle (run-length
encoded bitmaps included), Photoshop files named .pdd and PNG files named
.pns, in any letter case. The Open and Place dialogs list them in "All
readable files", "All placeable files" and their format's own filter, and
Glass's Load Texture lists them too. Linked files with these names update
and relink, the Links panel shows their format, and Edit Original opens
them.

The extensions are read-only: exports still write .bmp, .psd and .png, and
an export to a path with one of the new extensions is refused as before.
The desktop packaging does not associate them with the app.
2026-11-02 15:21:48 +07:00
dotCooCoo e8e09af782 Brushes: Calligraphic and Scatter values follow pen tilt, bearing and rotation
Squashed from #5031 onto main.
2026-11-02 14:33:02 +07:00
dotCooCoo 05ac9ce040 Merge main into fix/shape-builder-merge-off-ui-thread 2026-11-01 22:20:23 -08:00
dotCooCoo d72022daf5 Grid tools: F, V, X and C change the divider skews by 10 while a grid is dragged out
Squashed from #5019 onto main.
2026-11-01 08:33:02 +07:00
dotCooCoo caafc2a02a Merge main (433ddb59) into feat/native-save-precision 2026-10-31 17:22:00 -07:00
bflatastic 9c17301c46 Fix #4937: artboards can have a background fill, included in exports and print 2026-11-01 04:13:57 +07:00
dotCooCoo 6a034c77c3 Transform tools: backquote drag transforms only the pattern
Holding backquote while dragging with the Selection tool (move, bounding-box
scale or rotate) or the Rotate, Reflect, Scale or Shear tool applies the drag
to the selected objects' pattern fills and strokes and leaves their geometry
in place. The key state at release decides the result: the key may be pressed
after the mouse button goes down, and releasing it before the button comes up
commits an ordinary transform. Objects without pattern paint do not move.

PointerEvent gains a `backquote` flag (false when absent). The desktop canvas
reads it from the held key on every pointer event, and `ui.pointer` and the
`pointer_gesture` tool accept it per event or as a default for the gesture.
2026-10-31 03:34:55 +07:00
dotCooCoo 4e59c3f0be Merge main into fix/shape-builder-merge-off-ui-thread 2026-10-29 07:58:05 -07:00
dotCooCoo d856c210c2 Merge main into feat/native-save-precision 2026-10-29 07:58:03 -07:00
dotCooCoo 6fd042e4be Tests: the MCP concurrency, folder search and artboard export tests pass on a loaded machine
Squashed from #4473 onto main.
2026-10-29 18:50:24 +07:00
dotCooCoo adbb4a4b53 Merge main into feat/native-save-precision
EPS saves, new on main, name `precision` in their warnings as SVG, PDF and .ai saves do.
2026-10-29 04:37:09 -07:00
dotCooCoo cf5ed86729 Merge main into fix/shape-builder-merge-off-ui-thread 2026-10-29 03:59:34 -07:00
dotCooCoo 9a71c35261 Tests: each timed refused-reconnect run starts from a closed connection
remote_call_reports_nothing_sent_when_reconnect_is_refused set up the
closed connection once, so only its first run went through the
stale-connection probe. Each run now sets up its own closed connection
before the timed call.
2026-10-29 13:00:39 +07:00
dotCooCoo e02b43b6be Tests: the MCP remote-backend tests pass on a loaded machine
The vectorcraft-mcp tests of the remote backend in tests.rs gave a fake
app 2 or 5 s to accept a connection or to read a request, and waited
2 s for a connection to end or a line to arrive. When a busy machine
held the client's thread for longer, the fake app gave up and the test
failed. These waits now use WAIT (20 s).

remote_connect_fails_fast asserted that a refused connect returned
within 5 s, and remote_call_reports_nothing_sent_when_reconnect_is_refused
asserted that the call returned within 2 s. On Windows a refused local connect
ends at the backend's own 800 ms connect timeout. A connect without
that timeout takes about 2 s. The 5 s bound did not tell the two apart,
and the 2 s bound left 1.2 s for any pause of the thread. Both tests
now bound the connect by FAILED_CONNECT (1.5 s) and run it up to five
times, until one run is under the bound. The second test checks the
error of every run.
2026-10-29 13:00:38 +07:00
dotCooCoo 968642da45 Merge main into fix/shape-builder-merge-off-ui-thread
# Conflicts:
#	crates/ui-egui/src/menus/invoke.rs
2026-10-28 21:37:57 -07:00
dotCooCoo 5ab220d462 Merge main into fix/shape-builder-merge-off-ui-thread 2026-10-28 20:36:38 -07:00
dotCooCoo aa503c2648 Arc tool: C, F and Up/Down change the arc while it is dragged out
The reference app switches an arc between open and closed with C,
flips it with F and changes its angle with Up/Down while it is dragged
out. VectorCraft's Arc tool ignored these keys during a drag.

While an arc is dragged out, C now switches it between an open and a
closed path, F switches its base between the X and Y axes in the same
box, and Up/Down raise and lower its slope by 10 within -100 to 100.
Each press switches once. The arc drawn on release uses the new values,
and they stay as the Arc tool's options. With nothing dragged, C and F
are shortcuts as before.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-10-29 10:02:03 +07:00