Commit Graph
457 Commits
Author SHA1 Message Date
Dylan M. Taylor 01b2e48034 feat(nightly): wire craft-nightly for self-isolated direct launch (#2751)
* feat(nightly): wire craft-nightly for self-isolated direct launch

* fix(nightly): answer bare version queries before profile resolution

* test(nightly): cover launcher delimiter, spec, and launch_profile helpers

* test(nightly): retain FigCraft startup and persistence coverage

* test(nightly): keep previous write-probe files intact
2026-11-29 15:29:37 -05:00
Dylan M. Taylor baba38de22 Merge main and align newly added craft-control dependency 2026-11-29 12:14:42 -05:00
Dylan M. Taylor 66a31d076e deps: align craft-libs revision to 9949e08 2026-11-29 11:20:36 -05:00
David Mann d87b5cc9d5 control server: the plain line reader is test-only now; its docs point at read_line_by 2026-11-29 17:15:46 +01:00
David Mann 28a7dbe49c Merge remote-tracking branch 'origin/main' into feat/agents-launcher-switch 2026-11-29 16:59:34 +01:00
David Mann ccb2b62533 agents: the token wait is one deadline for the whole first line; stale connection file test
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.
2026-11-29 16:59:28 +01:00
David Mann fe3e2c3e10 Merge branch 'feat/agents-launcher-switch' of https://github.com/davidmann4/figcraft into feat/agents-launcher-switch
# Conflicts:
#	apps/figcraft-cli/src/live_tests.rs
2026-11-29 16:51:34 +01:00
bflatastic 9c89a490ef cli: the live tests write their token file owner-only
On Unix the token client refuses a token file others can read, so the
window test failed on Linux and the wrong-token test passed for that reason.
2026-11-29 22:50:04 +07:00
David Mann e1c5d99399 cli: the live tests' token file is owner-only, as the shared client requires on Unix
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.
2026-11-29 16:35:46 +01:00
David Mann 0b64b6c85f Merge branch 'feat/agents-launcher-switch' of https://github.com/davidmann4/figcraft into feat/agents-launcher-switch 2026-11-29 16:03:49 +01:00
David Mann a665a05860 agents: second round of review fixes (#2741)
- 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.
2026-11-29 16:03:17 +01:00
bflatastic a6cb63afda app: a connection that ended closes its socket for the client too
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.
2026-11-29 21:43:04 +07:00
David Mann 0d933a62f9 agents: review fixes (#2741)
- 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.
2026-11-29 15:42:04 +01:00
David Mann 48287201cf mcp: plain figcraft-cli mcp reaches the open window through the launcher's switch (#2740)
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.
2026-11-29 15:18:51 +01:00
BFlat cce2e72d3e Merge pull request #2742 from davidmann4/chore/craft-libs-pin-agents
deps: craft-libs to main 27c2cbf8 (with egui 14c39fed)
2026-11-29 21:00:40 +07:00
David Mann aaf4661e42 app: control channel token and the ArtCraft Launcher's agents switch (#2740)
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.
2026-11-29 14:36:45 +01:00
David Mann 9d863ca427 deps: craft-libs to main 27c2cbf8 and egui to 14c39fed, for craft_control::agents
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.
2026-11-29 14:03:55 +01:00
Timo Klerx d4f7072f38 fix(import): offer bounded retry for startup files 2026-11-29 13:38:35 +01:00
Bryton Cooper 5092de9b33 test(server): ensure pending_edits leaves unflushed WAL bytes past compaction 2026-11-28 12:50:30 -07:00
Bryton CooperandClaude Opus 5.5 33b4b54e48 test(collab,server): seeded fault-injection and crash/compaction DST suites
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>
2026-11-28 11:44:05 -07:00
Dylan M. Taylor d95c6a91d4 ci,packaging: roll out nightly signing, macOS docs layout, and profile reopen fix (#2709) 2026-11-28 11:50:56 -05:00
bflatastic c3e87801b8 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/file-format-parity.md
2026-11-28 20:28:50 +07:00
BFlat f316a32c59 Merge pull request #2704 from brytoncooper/feat/web-host-confirmed-saves-2366
figcraft-web: opt-in confirmed saves for host mode (#2366)
2026-11-28 19:47:36 +07:00
BFlat 719592b5d1 Merge pull request #2700 from storytold/fix/1110-control-slots-and-budget
Control channel: an idle connection gives up its slot, and request lines share one memory budget (#1110, #1111)
2026-11-28 19:46:10 +07:00
bflatastic 1a69b61a22 Control channel: use try_update, fetch_update's new name 2026-11-28 19:00:17 +07:00
Bryton CooperandClaude Opus 5.5 927408fe16 figcraft-web: confirmed saves for hosts that opt in (#2366)
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>
2026-11-28 04:59:42 -07:00
Bryton CooperandClaude Opus 5.5 96a2067684 figcraft-cli: --strict on export, convert and run; .fig fill outline per winding rule (#2384)
`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>
2026-11-28 04:37:07 -07:00
bflatastic 6b3c4c2bf4 Control channel: idle connections give up their slot; request lines share one memory budget (#1110, #1111)
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.
2026-11-28 18:19:02 +07:00
BFlat aaed433ddd Merge pull request #2587 from storytold/formats/penpot-craft-zip-9-8-2
Read Penpot archives through craft-zip
2026-11-28 18:09:43 +07:00
BFlat 350ee9f728 Merge pull request #2688 from brytoncooper/fix/win-wgl-hang-2264
M1: Windows doesn't start OpenGL beside Direct3D 12 (#2264)
2026-11-28 17:53:05 +07:00
bflatastic 2cd906ddd8 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/format/Cargo.toml
2026-11-28 17:32:22 +07:00
Bryton CooperandClaude Opus 5.5 b33b75275c M9: open a full snapshot without copying it first (#2041)
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>
2026-11-28 02:54:44 -07:00
Bryton CooperandClaude Opus 5.5 71d9f20c31 M1, #2264: Windows doesn't start OpenGL beside Direct3D 12
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>
2026-11-28 02:28:33 -07:00
BFlat dbe9eeb1bd Merge pull request #2607 from Utakata/feat/open-camera-raw
format: open camera raw files as their developed picture
2026-11-28 15:06:51 +07:00
FredApps f278b428cb Merge branch 'main' into feat/automation-allow-server-join
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.
2026-11-28 08:01:38 +01:00
FredApps b6469cd439 Merge branch 'main' into formats/penpot-craft-zip-9-8-2 2026-11-28 07:46:25 +01:00
FredApps 4561b31166 Merge branch 'main' into feat/open-camera-raw
main's craft-libs pin (8fa4db64) already contains 249a41bd, so the pins stay at
main's and the camera raw crates are added at that same rev.
2026-11-28 07:46:25 +01:00
BFlat 4e83051359 Merge pull request #2643 from mikaelweiss/shared-branches
M10: sync shared branches across live sessions
2026-11-27 15:49:48 +07:00
bflatastic 5a8dcb867e Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
2026-11-27 15:46:21 +07:00
bflatastic 0db8a4a9ba Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
2026-11-27 15:45:32 +07:00
bflatastic b29d481ee4 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
2026-11-27 15:44:32 +07:00
bflatastic 163800516f Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/collab/src/message.rs
#	crates/collab/src/server.rs
2026-11-27 15:21:59 +07:00
bflatastic 43b632c32b Merge remote-tracking branch 'origin/main' into HEAD 2026-11-27 15:21:54 +07:00
bflatastic 96e1dc922a Merge remote-tracking branch 'origin/main' into HEAD 2026-11-27 15:21:45 +07:00
bflatastic 86f1544c7b Merge remote-tracking branch 'origin/main' into HEAD 2026-11-27 15:21:36 +07:00
bflatastic 559d1e1650 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
2026-11-27 15:21:28 +07:00
bflatastic 1c5f6f60d0 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/ui-parity.md
2026-11-27 14:40:03 +07:00
bflatastic fbbe425064 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
2026-11-27 14:26:01 +07:00
bflatastic 3cac6c5051 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
2026-11-27 14:25:45 +07:00
bflatastic 11cbd37bf0 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
2026-11-27 14:25:26 +07:00