A client sending a byte at a time, never a newline, kept an unauthenticated connection open past
the token wait: the read timeout bounded each read, not the line. The line reader now counts the
remaining time down to the deadline before every read until the token is shown.
The CLI tests now check that a connection file a crashed app left (nothing listens on its port)
isn't used, as #2740 asks.
craft_control refuses a token file group or others can read; the test wrote one with mode 644,
so the window test failed on Linux (and the wrong-token test passed on that refusal instead of
the window's). The file is now 0600 and the wrong-token test checks the window's own refusal.
- Stopping a listener closes its registry under the lock a connection takes to queue, so a
request either is cancelled by the stop or is refused after it; none queues after the stop.
- A save a field deferred keeps the roots of the agent input that pressed it.
- Queued ui.input roots live with each window's pending batch (beside control_input_doc), so
one window's frame never takes another window's roots.
The worker kept a handle on the socket until the next connection reaped it, so
a silent client stayed connected past the token wait. Shut the socket down
when the connection thread ends.
- Live mode keeps every --automation-write-root, not only the first.
- --attach sends this machine's token file only to a loopback address; another host gets only
FIGCRAFT_CONTROL_TOKEN.
- Stopping a listener (the launcher's switch off) cancels its requests still queued, so none runs
after the stop.
- A screenshot write is checked against the request's roots again when it happens.
- The frame that applies an agent's queued ui.input batch runs confined to that agent's roots, so
a queued Save shortcut can't write outside them.
- The headless confinement test uses the registered file.saveAs; docs say both roots are
required only without the switch or with --headless.
While the ArtCraft Launcher's switch lets agents use FigCraft, figcraft-cli mcp sends each call
to the open window through craft_control::agents::Live (the connection file, the token file; a
closed app is started) and otherwise runs headless in the automation roots or the agent folder.
Without the switch it still needs both roots (rule 18); --headless forces headless. --attach
reads the token file of its port.
Requests from the agent listener carry the agent folder as their roots (ControlRequest::roots):
handle runs confined to them and a screenshot path is checked as it is admitted, unless the app
was started with roots of its own. Docs: mcp.md, control-protocol.md, cli.md.
Every control connection's first line carries the launch's token, written to an owner-only file
(craft_control::auth), so other users and web pages can't drive the app (#480). --control binds
before it writes the token, so a second launch on a taken port keeps the running app's token.
While the launcher's switch names FigCraft (with the AI-MCP flag), the app listens on a free
loopback port and publishes agent-connection.json (craft_control::agents); switching it off stops
the listener and removes the files without a restart. A Nightly never listens.
craft-libs main now carries the shared agents code (craft_control::agents) that #2740 needs.
craft-libs at that rev builds against the egui fork's 14c39fed, so egui moves with it. The one
change it needs: egui's new Shape::PaintChunk turns with the frame labels like Shape::Vec.
collab (dst_fault_tests, 32 seeds): asymmetric partitions where a legacy
and a current client are cut off while the rest push the server past its
log, mid-flight drops with offline edits queued, one-way link stalls, and
per-user undo/redo mixed with layer, style, variable, comment, component
instance, main component and page edits. Every seed must catch up from
the log, a compressed snapshot and a plain snapshot, and end converged
and valid with monotonic sequence numbers, no undo violations, and no
remembered-deleted id live in the document.
Sim gains additive hooks: set_version (reconnect as an older app), stall
(one-way, order-keeping delay) and per-kind catch-up counters.
figcraft-server (dst_crash_tests, 24 seeds): the real Store with small
compact_after, clients acked only after a clean flush (as the hub does),
crashes before a flush, mid-flush with the log cut inside the new
records, and after a flush before acks, plus everyone-leaves idle/park.
After each restart the file is exactly the server's state at some seq no
earlier than the last durable point or anything a client heard; torn
tails are reported and later appends survive; clients resume with their
ids, lose no queue and converge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A host page that opts in with `?save=managed` (or `data-save="managed"`
on the canvas) now gets each Save and Save As of the document with an
`id` (`save-1`, `save-2`, ...), and the document keeps its unsaved
changes until the host answers `figcraft:saved` with that `id`. Hosts
that don't opt in see no change: a file still counts as saved once it is
posted.
- `host_saves.rs`: the bookkeeping, apart from the browser so it is
tested natively. One save waits at a time; a newer one replaces it;
answers for any other `id` are ignored; a file the host opens forgets
the waiting save; a save unanswered after 30 s counts as not stored
(the clock is passed in). A Save As becomes the document's file only
once confirmed, so a retry after a failure is still `saveAs: true`.
- `host.rs`: the listener only queues what the host sent; the shell
handles it in order each frame. Exports and copies carry no `id` and
`saveAs: false`. A timeout tells the user and posts `figcraft:failed`
with the `id`, and the app wakes itself for it.
- ui-egui: `Services::deliver_document` hands the document's own file
over (its default is `download`, so desktop and plain browser saves
are unchanged). `Delivery::Pending` skips `file.markSaved`;
`FigApp::document_stored` and `document_not_stored` finish the save.
- engine: `FileSnapshot::delivered` marks the snapshot's tab saved as of
the snapshot, so edits made while the save was in flight stay unsaved,
and a tab closed or saved since is left alone. It shares its tail with
`FileSnapshot::save`.
`craft-web-host` at the pinned rev has no host-to-app refusal message
and no `host {confirmsSaves}` handshake (storytold/craft-libs#1338), so
a host's refusal shows as the timeout until the crate adds them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`export`, `convert` and `run --out` take `--strict`. When the .fig,
.penpot or Android Vector Drawable writer reports anything left out or
changed, nothing is written or replaced and the command exits 1 with the
reasons on the error line. A folder of drawables is written only once
none of its files leaves anything out. `--strict` with an output whose
writer reports nothing (png, svg, pdf, ...) or with `--vd-compat ignore`
is a usage error (exit 2), so it never passes without checking anything.
A .figcraft output is accepted for convert and run: it keeps everything.
.fig export writes a vector whose filled areas use both winding rules as
one fillGeometry path per rule, so other readers fill each area as the
network does. The warning that the outline used the first area's rule is
gone.
Image adjustments, list spacing, hanging punctuation and lists, and
vertical trim were already written on main. OpenType features,
variables' publishing, code syntax and inheritance settings, prototype
device settings and text styles on part of a text keep their warnings:
the .fig import (craft_fig's mapping at the pinned craft-libs rev) does
not read them back, so they cannot round-trip yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With all 8 connection slots taken, a new client now takes the slot of
the connection that has waited longest for its client; a connection
whose request the app is running keeps its slot. Request lines are
counted as they arrive against 64 MiB shared by all connections until
they are answered, so eight clients can no longer make the app hold
eight 32 MiB lines and their parsed trees.
Replica::from_snapshot borrowed the changes and cloned the whole
Vec<Change> before applying it, because the review-settings clamp
rewrites some of them in place. Every caller already owns the snapshot
(Client::join, the rejoin path, Server::restore), so it now takes the
Vec by value: a large file's snapshot is no longer copied and then
dropped twice on the way in. The server's publish path still borrows
and copies explicitly.
In a wasm32 build joining a 120k-layer file through the full-snapshot
catch-up (what an older server sends), this cut peak memory from 722 MiB
to 455 MiB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Switching the input language on Windows (Alt+Shift or Win+Space to a
Russian layout) or typing in it hung the app. A Windows start offered
wgpu Direct3D 12 and OpenGL together, and wgpu's OpenGL backend makes a
hidden window on a thread that handles no window messages as soon as its
instance exists, even when Direct3D 12 draws. Windows hands the language
change to every thread with a window, so the main window waited on that
hidden one. The reporter confirmed WGPU_BACKEND=dx12 avoids it.
A Windows start now offers Direct3D 12 alone. Vulkan and OpenGL stay as
restarts after a failed start, each on its own, and OpenGL with lower
limits is added last so the old lowered Direct3D 12 + OpenGL attempt's
reach is kept. A GPU with no Direct3D 12 driver (Intel Haswell, which
wgpu leaves out of Direct3D 12, and older GPUs) now draws on Direct3D
12's software adapter instead of its OpenGL driver.
Not run on Windows; the attempt list is tested.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main moved figcraft-cli to RFC-0018 (#2645): main.rs is a thin wrapper and the
dispatch lives in lib.rs, so mcp_roots, the --automation-allow-server handling
and its test move there; headless mcp is checked before the fonts are scanned.