Retain the Classic Actions feature unchanged and incorporate official main fixes for workspace write policy, Format persistence, RAW fixtures and SVG resource accounting. No manual merge resolution.
* chore: cut over remaining resvg and roxmltree usages to craft-svg and craft-xml
* Cut over remaining photocraft-io TIFF tests, rawinfo example, and move exr to dev-dependencies
* chore: remove unused zune-jpeg workspace dependency
* style: cargo fmt
- Without the AI-MCP flag plain `photocraft-cli mcp` is headless as before: a
Control Port saved before the agents switch no longer makes it look for the
app, start it or apply When PhotoCraft Is Closed. Test in
mcp_without_consent_works_headless (fails without the gate).
- `prefs::read_integrations_section` (migrate + lenient read) is shared by the
app's launch read and `photocraft-cli mcp`: one bad value resets only itself,
so a saved "error" closed-app choice no longer falls back to Launch in the CLI.
Replaces the app's hand-written per-field reader. Test in
integrations_come_from_the_saved_preferences_or_default (fails without it).
- docs/development.md: the headless client examples pass --headless.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As agreed in craft-ai-integrations#195: one switch for every Craft app, in
the launcher; only the launcher writes MCP client configurations; plain
`<app>-cli mcp` works in the open app.
- Consent: with the AI-MCP flag, the launcher's switch alone decides,
read through `craft-ai-agents` (craft-ai-integrations#197), the crate the
launcher writes the app list with and the gateway reads it with. The
"Let AI agents connect" box is gone; without the flag everything is as on
main (a saved Control Port keeps its connection).
- `photocraft-cli mcp`: works in the open window while agents may use it
(what `--live` did), and headless otherwise, exactly as before (only the
roots given to it; the app is never started). `--headless` forces that;
`--bridge` / PHOTOCRAFT_CONTROL_PORT as before. `--live` and `mcp install`
are gone. Several read roots work again, invalid roots stop the start, and
`--gpu` applies to the headless session.
- Client setup is the launcher's: the client code (Claude Desktop, Claude
Code, Cursor, JSON), Copy Configuration, its service and its docs are
removed (about 740 lines net).
- CLI tests run with their own settings, launcher and flags folders: plain
`mcp` would otherwise find (or start) the developer's own PhotoCraft.
- Docs, book, README, scorecard row, packaging comments follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test expects agents off, but `mcp --live` now also accepts the ArtCraft
Launcher's switch, read from the real per-user folder: on a machine with the
launcher's agents on it failed. It points CRAFT_MCP_DIR at its own folder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Clear the clippy 1.100 lints that fail the gate on main (#13531)
Clippy 1.100.0 flags needless_range_loop in cms synth.rs (the gate
failure on main), algo photo_util.rs and an engine multichannel test,
and, on Windows only, needless_bool in format noreplace.rs, where the
cfg(unix) branch compiles away. Each loop now iterates the slice it
indexed, with the same values in the same order.
* Clear the Linux-only clippy 1.100 needless_bool lints (#13531)
paths_match in ui-egui and is_redirect in the app ended with a
cfg(not(windows)) branch that is just `false`, which clippy 1.100
flags on Linux. Each platform's branch now returns the whole
comparison: the same results, in the same order.
Resolve public occurrence identity and main playback budgets, nested Batch context and Pen history together. Migrate the deleted local parser to main shared API while preserving public legacy-suffix refusal. No unpublished behavior fixes or local gate runs.
The launcher's Settings > AI agents adds one entry for every Craft app to
Claude Desktop, Claude Code, Cursor and LM Studio (craft-launcher#1432), so
PhotoCraft's page drops its Add to Claude Desktop / Claude Code / Cursor and
Copy Prompt for an Agent buttons. Copy Configuration stays for people
without the launcher, and so does `photocraft-cli mcp install --client`.
Docs, README and the AUTO-MCP-LIVE scorecard row follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turning on ArtCraft Launcher > Settings > AI agents is the person's consent
for every Craft app (craft-ai-integrations#195). While the AI-MCP flag is on
and the launcher's app list (ArtCraft/mcp/apps.json) names photocraft,
PhotoCraft accepts agents as if Let AI agents connect were ticked: the
desktop app watches those files every 2 s and starts or stops the
connection, and `mcp --live` checks them before every call. The page shows
the box ticked and says the launcher turned it on; PhotoCraft's own choice
is kept. Allow Agent Control off still refuses agents.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preferences › AI Integrations shows the new agent settings (Let AI agents
connect, the agent folders, When PhotoCraft is closed, the buttons that add
PhotoCraft to MCP clients) only while the Craft suite's AI-MCP feature flag is
on (craft-flags, storytold/craft-libs#1118: ArtCraft/flags.toml, which the
ArtCraft Launcher's Experimental features switch writes, or CRAFT_FLAGS).
Without it the page shows Allow Agent Control and Control Port as before, and
a Control Port already set keeps its connection.
craft-flags is pinned to the head of storytold/craft-libs#1119 until it merges.
The Integrations page holds more than the agent connection: open PRs add the
AI services for Generative Fill and other AI features to it (#10903, #12391,
#7007). The menu item stays "AI Integrations…" and the page "Integrations", as
on main; messages and docs say Edit › Preferences › AI Integrations.
`install_claude_code` ignored the result of `claude mcp remove`, so a failed
remove (on CI, a freshly written script briefly busy) led to a second
"already exists" and an error claiming the entry had been removed. It now
reports the failed remove with the command to run instead, and the test
covers it.
Also the CLI tests for the new `mcp install` subcommand: a stray word after
`mcp` is an unrecognized subcommand, and it has its own man page.
* Use craft-psd from craft-libs; remove crates/psd
* Regenerate the scorecard (28 crate roots)
* Take craft-psd at craft-libs 55d120f2
* Regenerate lockfile for current shared format crates
* Pin shared format crates to current craft-libs main
* Match brush import cap to shared decoder budget
* xtask: update layer fixtures after PSD extraction
- Allow Agent Control off refuses the Preferences connection too, as it refuses --control.
- A connection that is on but failed to start (taken port) is tried again every 5 s.
- Listening::drop waits for the accept loop, so the port is free when it returns.
- The session's automation gate follows the live policy (actions agents record).
- The folder picker answers the Preferences dialog that opened it.
- One controlPort migration (engine::prefs::migrate_integrations) for the app, its launch
read and photocraft-cli mcp --live.
- --live: a batch stops when the app changes under it; a waited job is cancelled where it
started; the bridge is keyed by pid too.
- mcp --live ignores an exported PHOTOCRAFT_CONTROL_PORT and refuses --gpu/--no-gpu.
- Claude Code: add first, replace an existing entry only when it exists, and stop a
`claude` that hangs after 20 s.
- Book: the token survives restarts; the challenge handshake, not the probe, protects it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page only holds the MCP connection, so Edit › Preferences › AI Integrations… is now
Edit › Preferences › MCP… (command id and the `integrations` preference keys unchanged).
Copy Prompt for an Agent puts a text on the clipboard that an agent with a terminal
(Claude Code, Codex, Cursor's agent) pastes to register `photocraft-cli mcp --live` itself
and check the connection; Claude Desktop has no terminal and keeps Add to Claude Desktop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ported onto current main and #11363:
- The dialog moved into prefs/prefs_ui/agents.rs (prefs_ui.rs was split on main); the port
field is labelled for the accessibility check.
- One agent connection: Preferences start and stop it live (agent_link service); only
--control opens a port at launch. #11363's token reuse, folder rules (absolute paths,
warnings) and readRoot/writeRoot names are kept; a saved controlPort from before loads
with connectAgents on.
- agent_link.rs: #11363's connection file code plus #5525's client install code.
- CLI: mcp --live, --when-closed and mcp install --client on main's clap parser.
- control_server: listen()/Listening on top of main's challenge authentication.
- app_dirs: main's resolver moved to photocraft-automation so the CLI finds the same folder.
- Interface catalogs moved to craft-i18n on main; the PR's rows are not carried over.
Co-Authored-By: Furoxfufu <Furoxfufu@users.noreply.github.com>
Co-Authored-By: ingling <ingling@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Escape control characters in log lines and diagnostic output taken from files and plug-ins
* address review: escape the plug-in load error and the atn_dump path before printing
craft-cms was extracted from crates/cms (storytold/craft-libs#779), and both
copies changed afterwards. storytold/craft-libs#PRNUM ports the 41 commits made
here since the extraction, so the shared crate now has everything this copy
had, and PhotoCraft depends on it.
craft-cms returns errors where the local crate panicked on caller input:
transforms, tables and LUT constructors return Result. Call sites propagate
the error where the function already returns one, and fall back where the
arguments are fixed by construction (each with a comment saying why).
Lut3d's fields are private there; the proof and HDR display table is built
with Lut3d::from_fn.
The pin is the head of the craft-libs branch and moves to main when that
pull request merges.
* Use craft-heif from craft-libs; remove crates/heif
PhotoCraft's HEIF decoder had drifted from LightCraft's by about 700 lines;
both now use craft-heif (storytold/craft-libs#784), built from LightCraft's
copy. HEIC colours now follow the HEVC VUI's range and matrix and libheif's
chroma upsampling. 8-bit files still open as 8-bit documents; a colour
description the VUI specifies now tags the image as an nclx did.
The codecs -> heif standalone exception ends with the local crate, and the
HEIF nextest step drops -p photocraft-heif, which no longer exists.
* Pin craft-heif to the merge of storytold/craft-libs#794
* heif: count the decoder's 16-bit buffer against max_alloc
* heif: match Apple's chroma upsampling; pin craft-heif to storytold/craft-libs#799
* heif: free the decoder's buffer before the HDR conversion and count that conversion's peak
* heif: hold the canvas the decoder really allocates to max_alloc
## Summary
`photocraft-cli mcp --bridge` sent the control token in clear as its first frame, to whatever had accepted the connection: a `[::1]` listener reached through a `localhost` lookup, or any process holding `127.0.0.1:<port>` while the app was not listening. This PR fixes both cases:
- **Literal loopback only.** `BridgeClient` parses its address into a socket address and connects to it. Only `127.0.0.1:<port>` and `[::1]:<port>` are accepted. `localhost:<port>` means `127.0.0.1:<port>` (what the desktop app binds) and is never looked up.
- **Challenge authentication.** The bridge authenticates with `auth.challenge {clientNonce}` → `{serverNonce, serverProof}` → `auth {proof}`. Both proofs are HMAC-SHA256 keyed by the token over both nonces, each under its own label. The client checks the server's proof before it sends its own and never falls back to sending the token. The token never crosses the wire, so a listener that is not the app gets only a random nonce.
- **One shared server implementation.** `security::ServerHandshake` replaces `authentication_reply`, and both the desktop control server and `photocraft-cli serve` use it. The servers still accept the one-frame `auth {token}`, so existing scripts and older clients keep working. A repeat `auth.challenge` after authenticating gets "already authenticated", like a repeat `auth`.
- HMAC comes from RustCrypto's `hmac` 0.12 with `sha2` 0.10 (`sha2` was already in the lockfile). The proofs are compared without an early exit.
- `docs/control-protocol.md` documents the handshake, the exact HMAC message, and the bridge's address rules. The book's protocol summary is updated too.
Compatibility: a new bridge needs an app from the same release. Against an older app it fails with "refused challenge authentication … the control token was not sent". It does not downgrade.
Known limit: the channel is plain TCP with no TLS, so nothing binds the handshake to the connection. A party sitting between a bridge and a real app could relay the handshake without learning the token. On loopback that needs it to hold the port the bridge dials while the app listens on another, which the literal-address rule above narrows. Older clients that still send `auth {token}` keep their old exposure until they upgrade.
Closes#9777
## Tests
New in `crates/automation/tests/it/bridge_token.rs`:
- `localhost_reaches_the_ipv4_app_not_an_ipv6_listener`: a listener on `[::1]:P` gets no connection, and the app on `127.0.0.1:P` does.
- `a_listener_that_is_not_the_app_never_receives_the_token`: on both loopbacks, a listener that stays silent, refuses, or fakes the challenge receives only the challenge frame, never the token. The error says why.
- `the_bridge_authenticates_to_the_headless_server_by_challenge`: end to end against `rpc::serve_tcp`. A wrong token is refused before its proof is sent.
Unit tests: the handshake in both directions, and that wrong, missing or replayed proofs, the token after a challenge, a second challenge and malformed nonces are all refused (`security.rs`). `loopback_socket` address parsing (`bridge.rs`). The desktop server answering a challenge, then dispatching (`control_server.rs`). The existing bridge and MCP fakes now run the real `ServerHandshake`.
Run locally (Windows 11, targeted tests only):
- **Fail before.** I put upstream's `crates/automation/src/bridge.rs` (the old client) back and ran `cargo test -p photocraft-automation --test it bridge_token`: **3 failed**. The `[::1]` listener received `{"method":"auth","params":{"token":"<the token>"}}`, a `127.0.0.1` listener received the raw token, and the headless test got "authentication required" instead of the refusal. The original audit tests (`audit_nv6_bridge_sends_token_to_ipv6_impostor`, `audit_nv6_bridge_sends_token_to_any_ipv4_holder`) fail the same way on upstream/main.
- **Pass after.**
- `cargo test -p photocraft-automation --lib --test it -- bridge security tcp`: 23 + 21 passed. This covers the new tests, the existing bridge, MCP-bridge, security and serve TCP tests, and the legacy-token tests that still pass unchanged.
- `cargo test -p photocraft control_server`: 6 passed, including the new challenge test. The legacy-token tests still pass.
- `cargo clippy -p photocraft-automation --all-targets -- -D warnings`: clean.
- `cargo fmt`: clean.
- `Cargo.lock` adds only `hmac` 0.12.1, plus `subtle` under `digest` (already in the lock). Checked with `cargo metadata --locked`.
Not run here: the full gate (`cargo xtask ...`, the workspace-wide tests, wasm, clippy on the desktop app crate). That is left to CI.
API note: the workspace-internal `security::authentication_reply` is replaced by `ServerHandshake::reply`, which returns an `AuthStep`.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Security**
* Control connections support challenge-response authentication, verifying possession of the configured token without sending it. Token-in-frame authentication remains available for scripts.
* The MCP bridge accepts literal loopback addresses and maps `localhost` directly to IPv4 loopback. It rejects servers that refuse or cannot complete challenge authentication.
* **Bug Fixes**
* Rejected authentication exchanges close the connection; successful authentication allows requests to proceed.
* **Documentation**
* Control protocol and bridge authentication behavior are documented.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Keep all 34 catalog deletions; sync crop options and fill rasterization text via craft-i18n 4a642c06dbcb8172f307f827c1167cd5dd8ac341. Adapt the fill prompt catalog test to embedded catalogs and preserve both parity-document updates.
* Windows: a pen or a finger moves and resizes the window through the custom title bar (#7967)
winit takes pen and touch input as WM_POINTER messages and Windows makes no mouse
input from them, so the OS move/size loop that StartDrag/BeginResize start saw no
button down and never ran. winit only clears its dragging flag when that loop ends,
so after one pen try the mouse could no longer move the window either. A pen or
touch press on the title bar's gap or an edge now moves or resizes the window
itself (OuterPosition/InnerSize), restores a maximized window under the pen, and
stops at the minimum size; the mouse still hands the move to the OS.
* Pen title-bar move and resize follow the pen's own screen position (#7967)
On Windows winit moves the window asynchronously (SWP_ASYNCWINDOWPOS), so the
window position egui reads can be ahead of the window-relative pen position and
the drag counted the move twice (an injected pen ran +687/+909 for +200/+120).
The tablet hook now keeps the pen's screen pixels from GetPointerPenInfo
(ptPixelLocation) while the pen is down, and a PenDrag follows that.
A drag that follows the OS position no longer needs egui's pointer position: the
parked mouse cursor can leave the window as it moves away, and egui-winit's
PointerGone ended the drag after a few steps. It ends on release or when no
touch is down.
Main's ordered read roots (#3023) made --automation-read-root a list and
let an implicit save happen only when the read and write roots share one
held capability (same configured path). The preference folders now open
through that same sharing (AuthorizedWorkspace::with_read_root /
with_write_root, replacing with_read_from / with_write_from), so one
folder for both directions behaves as it does when given by flags; a
read-root flag (or its variable) still replaces the read folder. Tests
cover both cases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps the TSV deletions. The Hindi and RAW Develop catalog tests read the
embedded craft-i18n catalogs behind needs_catalogs(); display_names scans
CRAFT_I18N_DIR's locales/*/photocraft.tsv instead of the deleted src/i18n.
Pins craft-i18n 31d158f (storytold/craft-i18n#216 head, the #12403 top-up)
until #216 merges.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Related to #5310. Display labels only; command ids (filter.cameraRaw, edit.preferences.rawDefaults), preference keys, serialized settings, PSD/action/XMP Adobe Camera Raw identifiers and .atn step names are unchanged.
- Camera Raw / Camera Raw Filter / Camera Raw Defaults -> RAW Develop / RAW Develop Filter / RAW Defaults in menus, preferences, filter names, diagnostics and all 34 catalogs.
- Saved Photoshop actions keep the "Camera Raw Filter" step name, so .atn files round-trip byte for byte (test extended).
- "Camera Raw" stays a command-search keyword.
- Removes dormant Adobe/Photoshop-branded catalog rows; display-name guard tests.