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>
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>
Resolve the packaging/linux/AppRun conflict by keeping both sides: main's early
`--cli` / `photocraft-cli` ARGV0 dispatch runs first, then this branch's
valid_baseline() check for the desktop-integration launcher.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Resolve AppRun conflict by retaining upstream AM/AppMan detection and the owned branch's conservative generated-snapshot preservation. Retain both regression suites.
* fix(linux): avoid duplicate AppImage desktop launcher when managed by AM / AppMan (#6392)
* test(linux): cover AM / AppMan launcher detection in AppRun smoke test (#6392)
Follow up on the overlap with #5168 without integrating its branch.
Keep links and special files intact during refresh and deduplication.
Add eight linked-path regressions and document snapshot ownership.
The full AppRun harness passes; the test-only patch fails before the fix.
AI-assisted with OpenAI Codex for FredApps.
AppImageLauncher exports DESKTOPINTEGRATION even after
X-AppImage-Integrate=false makes it skip the AppImage. AppRun treated that
variable as "already integrated" and wrote no .desktop file, so the menu
stayed empty. Skip our entry only when another .desktop file's Exec already
points at this AppImage.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: nrq6993-a11y <nrq6993-a11y@users.noreply.github.com>
Edit › Preferences › AI Integrations › Let AI agents connect (off by
default) starts the loopback control server at runtime, with a fresh
token on every start, and publishes agent-connection.json in the
settings folder. Agent requests go through the automation policy with
the read/write folders chosen in the panel.
`photocraft-cli mcp --live` finds the app from that file before every
tool call, so MCP clients survive app restarts and port changes. While
the app is closed, `whenAppClosed` (or --when-closed) decides: start the
app, serve a headless session with the same folders, or explain what to
do. The panel's Add to Claude Desktop / Claude Code / Cursor buttons and
`photocraft-cli mcp install --client` write the client configuration
(merged, with a backup); Copy Configuration gives the JSON.
`--control`, `mcp --bridge` and headless `mcp` behave as before; with
--control the panel says the launch options manage the connection.
- automation: agent_link (connection file, client install), live
backend, app_dirs moved here so the app and the CLI agree.
- prefs: connectAgents, readFolder, writeFolder, whenAppClosed;
controlPort is now read (settings that do nothing 26 -> 25).
- packaging: photocraft-cli inside PhotoCraft.app; AppImage `--cli`.
- 18 new strings translated in all 20 catalogs; docs and book updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(linux): AppImage registers its desktop entry and icon on launch
On Wayland the compositor resolves the dock icon from the window's app_id
(ai.storyteller.photocraft, already set) against a host-installed .desktop
file. An AppImage installs nothing, so every run showed the generic Wayland
logo (#593). The app cannot set the icon itself: winit 0.30.13 (egui 0.36.2's
pin) has an empty set_window_icon on Wayland; xdg-toplevel-icon-v1 landed on
winit's 0.31 line only.
- packaging/linux/AppRun is a script instead of a symlink: best-effort
integration into $XDG_DATA_HOME before launch (desktop entry with Exec
rewritten to the AppImage's path and TryExec dropped, hicolor icons
copied), content-compared so an unchanged install costs a few cmp calls,
refreshed when the AppImage moves, PHOTOCRAFT_NO_DESKTOP_INTEGRATION=1
opts out, and no failure can block the launch (best-effort steps silent).
- packaging/linux/apprun-test.sh: 8-case smoke (passthrough, Exec rewrite
with spaces, metadata preserved, idempotence, move refresh, opt-out,
unwritable data dir, extracted AppDir). packaging-lint runs it and now
shellchecks AppRun.
- Docs: releasing.md Linux section; README install paragraph.
Fixes#593
* AppRun: skip desktop integration when the AppImage path needs Exec escaping
A quote, backquote, dollar, backslash, percent or line break in the path would need
desktop-entry escaping (a line break could even add keys), so integration is skipped
and the app still launches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>