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.
word_class walks back over combining marks to their base letter, but
only for the combining-diacritics blocks. Thai vowels and tone marks
written above and below a letter (U+0E31, U+0E34-0E3A, U+0E47-0E4E)
aren't alphanumeric, so Alt+Arrow, Alt+Backspace/Delete and
double-click stopped at them inside a word. They now go with their
letter, as combining accents do.
Closes#2744.
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.