From 09ad48fceea70bef3bd392eff267fd3783bf643c Mon Sep 17 00:00:00 2001 From: David Mann Date: Thu, 12 Nov 2026 15:38:51 +0100 Subject: [PATCH] Keep the page named AI Integrations, not MCP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- README.md | 2 +- apps/photocraft-cli/src/args.rs | 4 ++-- apps/photocraft-cli/tests/it/cli.rs | 4 ++-- apps/photocraft/src/agent_link.rs | 2 +- apps/photocraft/src/control_server.rs | 2 +- apps/photocraft/src/main.rs | 16 ++++++++-------- book/src/automation/mcp.md | 2 +- book/src/security/automation-security.md | 2 +- crates/automation/src/agent_link.rs | 6 +++--- crates/automation/src/lib.rs | 2 +- crates/automation/src/live.rs | 4 ++-- crates/automation/tests/mcp_live.rs | 2 +- crates/engine/src/prefs/cmds.rs | 2 +- crates/engine/src/prefs/validate.rs | 2 +- crates/ui-egui/src/lib.rs | 2 +- crates/ui-egui/src/menu_catalog.rs | 2 +- crates/ui-egui/src/preferences_submenu_tests.rs | 2 +- crates/ui-egui/src/prefs/prefs_ui/agents.rs | 2 +- .../ui-egui/src/prefs/prefs_ui/agents_tests.rs | 2 +- crates/ui-egui/src/services.rs | 10 +++++----- docs/control-protocol.md | 8 ++++---- docs/development.md | 2 +- docs/mcp.md | 2 +- docs/roadmap.md | 4 ++-- docs/scorecard.md | 2 +- packaging/macos/package.sh | 2 +- scorecard/automation.toml | 2 +- 27 files changed, 47 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 83d1204ef5..eb577fded0 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,7 @@ photocraft-cli batch --help photocraft-cli mcp ``` -To let Claude or another AI app drive the open PhotoCraft window without a terminal, turn on **Edit › Preferences › MCP › Let AI agents connect**, then click **Add to Claude Desktop** (or Claude Code, or Cursor) in the same panel. See [`docs/mcp.md`](docs/mcp.md). +To let Claude or another AI app drive the open PhotoCraft window without a terminal, turn on **Edit › Preferences › AI Integrations › Let AI agents connect**, then click **Add to Claude Desktop** (or Claude Code, or Cursor) in the same panel. See [`docs/mcp.md`](docs/mcp.md). The desktop app also offers an authenticated, loopback-only control channel (`photocraft --control`) for inspecting UI state, driving tools with pointer events, and taking offscreen screenshots. Every image in this README was rendered that way. See [`docs/control-protocol.md`](docs/control-protocol.md). diff --git a/apps/photocraft-cli/src/args.rs b/apps/photocraft-cli/src/args.rs index 8b850e2037..5934d6f94b 100644 --- a/apps/photocraft-cli/src/args.rs +++ b/apps/photocraft-cli/src/args.rs @@ -276,7 +276,7 @@ pub(crate) struct CommandsArgs { /// Headless: each automation root grants that direction of file access; an omitted root denies it. /// Prefer absolute root paths in MCP client configurations. Bridge: set the roots on the desktop /// app; root flags are refused. The token flags require --bridge (or PHOTOCRAFT_CONTROL_PORT). -/// Live: the desktop app with Edit › Preferences › MCP › Let AI agents connect on, +/// Live: the desktop app with Edit › Preferences › AI Integrations › Let AI agents connect on, /// found again on every call (no port or token to configure); the roots are for a headless session /// while the app is closed. #[derive(Args)] @@ -284,7 +284,7 @@ pub(crate) struct CommandsArgs { pub(crate) struct McpArgs { #[command(subcommand)] pub(crate) action: Option, - /// Find the desktop app by itself on every call (Edit › Preferences › MCP › + /// Find the desktop app by itself on every call (Edit › Preferences › AI Integrations › /// Let AI agents connect), with no port or token to configure #[arg(long)] pub(crate) live: bool, diff --git a/apps/photocraft-cli/tests/it/cli.rs b/apps/photocraft-cli/tests/it/cli.rs index f0d2ab4195..e4da07dc47 100644 --- a/apps/photocraft-cli/tests/it/cli.rs +++ b/apps/photocraft-cli/tests/it/cli.rs @@ -2033,7 +2033,7 @@ fn info_detail_adds_text_runs_and_antialiasing() { } /// `mcp install --client json` prints the configuration MCP clients start `mcp --live` with; -/// Cursor's file gets the same entry, other servers kept (Preferences › MCP). +/// Cursor's file gets the same entry, other servers kept (Preferences › AI Integrations). #[test] fn mcp_install_writes_the_live_entry() { let home = tmp("mcp-install"); @@ -2115,7 +2115,7 @@ fn mcp_live_without_the_app_explains_what_to_do() { send(json!({"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"ui_inspect","arguments":{}}})); let r = recv(2); assert_eq!(r["result"]["isError"], true, "{r}"); - assert!(r["result"]["content"][0]["text"].as_str().unwrap().contains("MCP"), "{r}"); + assert!(r["result"]["content"][0]["text"].as_str().unwrap().contains("Preferences › AI Integrations › Let AI agents connect"), "{r}"); drop(stdin); let _ = child.kill(); let _ = child.wait(); diff --git a/apps/photocraft/src/agent_link.rs b/apps/photocraft/src/agent_link.rs index 267b678e08..7cc2e563d3 100644 --- a/apps/photocraft/src/agent_link.rs +++ b/apps/photocraft/src/agent_link.rs @@ -1,4 +1,4 @@ -//! Preferences › MCP on the desktop: while *Let AI agents connect* is on, the app +//! Preferences › AI Integrations on the desktop: while *Let AI agents connect* is on, the app //! serves the control protocol by itself (no `--control`) and publishes the connection file //! `photocraft-cli mcp --live` finds it by ([`photocraft_automation::agent_link`]). Turning it on //! or off, or changing the port or folders, applies at once. The token stays in the settings diff --git a/apps/photocraft/src/control_server.rs b/apps/photocraft/src/control_server.rs index 75bb02f480..004a85463e 100644 --- a/apps/photocraft/src/control_server.rs +++ b/apps/photocraft/src/control_server.rs @@ -1,7 +1,7 @@ //! Localhost JSON-lines control server (one request per line, one reply per line). //! Loopback only. This is the transport the MCP server will wrap. //! -//! `--control` starts it for the whole run ([`start`]); Preferences › MCP starts and +//! `--control` starts it for the whole run ([`start`]); Preferences › AI Integrations starts and //! stops it while the app runs ([`listen`], see `agent_link`). use std::io::{BufReader, Write}; diff --git a/apps/photocraft/src/main.rs b/apps/photocraft/src/main.rs index 0315a40302..a8e17411eb 100644 --- a/apps/photocraft/src/main.rs +++ b/apps/photocraft/src/main.rs @@ -95,7 +95,7 @@ fn custom_titlebar(prefs_file: Option<&std::path::Path>) -> bool { CUSTOM_TITLEBAR && !prefs.interface.system_title_bar } -/// Preferences › MCP, read before the window opens the way [`custom_titlebar`] is: +/// Preferences › AI Integrations, read before the window opens the way [`custom_titlebar`] is: /// whether agents may drive this launch at all, the port to listen on when no `--control` /// was given (0 = only with `--control`) and the automation folders used when no /// `--automation-read-root` / `--automation-write-root` was given. A missing or unreadable file @@ -146,7 +146,7 @@ fn integration_fields(section: &serde_json::Value, out: &mut photocraft_engine:: } /// The automation roots: `--automation-read-root` / `--automation-write-root` (or their -/// variables) win; a direction without one takes Preferences › MCP' folder. A flag's +/// variables) win; a direction without one takes Preferences › AI Integrations' folder. A flag's /// root that can't be opened stops the launch (exit status 2) as before. A preference's root that /// can't be opened, or isn't an absolute path (it would depend on the folder the app was started /// from), is left out, so that direction fails closed, and the warning says why: a folder moved @@ -176,7 +176,7 @@ fn automation_workspace( Ok(w) => workspace = w, Err(e) => { let which = if read { "Automation Read Folder" } else { "Automation Write Folder" }; - warnings.push(format!("Preferences › MCP › {which} is not used: {e}")); + warnings.push(format!("Preferences › AI Integrations › {which} is not used: {e}")); } } } @@ -191,7 +191,7 @@ fn control_port_for(cli: Option, prefs: &photocraft_engine::prefs::Integrat if !prefs.allow_agent_control { let warning = cli.map(|p| { format!( - "photocraft: Preferences › MCP › Allow Agent Control is off: not listening on port {p} + "photocraft: Preferences › AI Integrations › Allow Agent Control is off: not listening on port {p} " ) }); @@ -358,7 +358,7 @@ struct ControlNotice { } /// The `--control` server's port, token and workspace, when it is on (exits 2 on a bad -/// configuration). Preferences › MCP' folders stand in for automation roots no flag +/// configuration). Preferences › AI Integrations' folders stand in for automation roots no flag /// names. The server Preferences start (*Let AI agents connect*) is `agent_link`'s, not this. fn control_setup( cli_port: Option, @@ -368,7 +368,7 @@ fn control_setup( control_setup_in(services::config_dir(), &integrations(services::prefs_file().as_deref()), cli_port, auth, automation) } -/// [`control_setup`] with the settings folder and Preferences › MCP given. +/// [`control_setup`] with the settings folder and Preferences › AI Integrations given. fn control_setup_in( settings: Option, prefs: &photocraft_engine::prefs::Integrations, @@ -719,7 +719,7 @@ fn main() -> eframe::Result { log::warn!("couldn't remember GPU backend {}: {e}", b.name()); } }); - // Preferences › MCP: agents connect without a terminal, unless the launch + // Preferences › AI Integrations: agents connect without a terminal, unless the launch // flags (`--control`) manage the connection. let mcp = agent_link::mcp_launch(); app.agent_link.mcp_command = mcp.as_ref().map(photocraft_automation::agent_link::McpLaunch::shell_line); @@ -1196,7 +1196,7 @@ mod tests { } } - /// Preferences › MCP' folders are the automation roots when no flag names one, and + /// Preferences › AI Integrations' folders are the automation roots when no flag names one, and /// a flag wins over its preference, direction by direction. #[test] fn automation_folders_come_from_the_preferences_unless_a_flag_names_one() { diff --git a/book/src/automation/mcp.md b/book/src/automation/mcp.md index 9362d55376..4cfbb36310 100644 --- a/book/src/automation/mcp.md +++ b/book/src/automation/mcp.md @@ -4,7 +4,7 @@ - **Headless:** an in-process `Headless` session owns the engine and performs file I/O. - **Bridge:** `BridgeClient` forwards tools to a desktop application started with `photocraft --control `. -- **Live:** `photocraft-cli mcp --live` finds the desktop application through the connection file it publishes while Edit › Preferences › MCP › *Let AI agents connect* is on, before every tool call; while the app is closed it starts it, serves a headless session, or reports an error, as chosen there. +- **Live:** `photocraft-cli mcp --live` finds the desktop application through the connection file it publishes while Edit › Preferences › AI Integrations › *Let AI agents connect* is on, before every tool call; while the app is closed it starts it, serves a headless session, or reports an error, as chosen there. The simplest setup needs no terminal: turn on *Let AI agents connect* in PhotoCraft, then click *Add to Claude Desktop* (or Claude Code, or Cursor) in the same panel. See [`docs/mcp.md`](../../../docs/mcp.md#connecting-the-desktop-app-no-terminal). diff --git a/book/src/security/automation-security.md b/book/src/security/automation-security.md index 634b16d893..000a091d75 100644 --- a/book/src/security/automation-security.md +++ b/book/src/security/automation-security.md @@ -29,7 +29,7 @@ Automation is a privilege boundary because requests can cause filesystem access, Screenshots are decoded under separate dimension, pixel, and allocation ceilings before downscaling; the 5 MiB PNG limit applies to the returned image. - MCP normally uses stdio and can optionally bridge to loopback control TCP. -- Edit › Preferences › MCP › *Let AI agents connect* (off by default) opens that loopback +- Edit › Preferences › AI Integrations › *Let AI agents connect* (off by default) opens that loopback listener without launch flags. Its token is kept in a user-only file in the settings folder (`agent-control.token`) and stays the same across restarts and port changes: restarting does not revoke it. To revoke an exposed token, delete that file; the next start creates a new one. diff --git a/crates/automation/src/agent_link.rs b/crates/automation/src/agent_link.rs index 80aa7e1770..9cfd4ae8d3 100644 --- a/crates/automation/src/agent_link.rs +++ b/crates/automation/src/agent_link.rs @@ -240,7 +240,7 @@ impl McpLaunch { 2. Reload your MCP servers if your client needs that (or tell me to restart you). 3. Call the {SERVER_NAME} tool `ui_inspect` and tell me which document is open. - PhotoCraft must be running with Edit › Preferences › MCP › Let AI agents connect turned on. The command needs no port or token: it finds the app by itself on every call. + PhotoCraft must be running with Edit › Preferences › AI Integrations › Let AI agents connect turned on. The command needs no port or token: it finds the app by itself on every call. " ) } @@ -852,7 +852,7 @@ mod tests { assert!(prompt.contains("claude mcp add --scope user photocraft -- /x/photocraft-cli mcp --live"), "{prompt}"); assert!(prompt.contains("codex mcp add photocraft -- /x/photocraft-cli mcp --live"), "{prompt}"); assert!(prompt.contains(&launch.config_json()), "{prompt}"); - assert!(prompt.contains("Edit › Preferences › MCP › Let AI agents connect"), "{prompt}"); + assert!(prompt.contains("Edit › Preferences › AI Integrations › Let AI agents connect"), "{prompt}"); assert!(!prompt.contains(TOKEN_FILE) && !prompt.contains("token\":"), "{prompt}"); } @@ -976,7 +976,7 @@ mod tests { assert!(install(Client::Cursor, &launch, &env).is_err(), "no home folder: an error, not a panic"); } - // ---- connection file (Preferences › MCP) ---- + // ---- connection file (Preferences › AI Integrations) ---- #[test] fn a_published_connection_reads_back_in_the_documented_shape() { diff --git a/crates/automation/src/lib.rs b/crates/automation/src/lib.rs index 44e7d70ec0..47be6e0d8c 100644 --- a/crates/automation/src/lib.rs +++ b/crates/automation/src/lib.rs @@ -12,7 +12,7 @@ //! control protocol's envelope, used by `photocraft-cli serve`. //! * [`files`]: open/save any supported format, `.pcraft` natively. //! * [`agent_link`] and [`live`]: connecting agents to the desktop app without a terminal -//! (Edit › Preferences › MCP, `photocraft-cli mcp --live` and `mcp install`). +//! (Edit › Preferences › AI Integrations, `photocraft-cli mcp --live` and `mcp install`). //! //! L6, no UI-toolkit dependencies. #![forbid(unsafe_code)] diff --git a/crates/automation/src/live.rs b/crates/automation/src/live.rs index 67fddc43a8..c55f0a91c1 100644 --- a/crates/automation/src/live.rs +++ b/crates/automation/src/live.rs @@ -122,7 +122,7 @@ impl Live { } if Instant::now() >= deadline { return Err(format!( - "PhotoCraft didn't accept agents within {} s of starting. If it's still opening, try again in a moment; otherwise check Edit › Preferences › MCP.", + "PhotoCraft didn't accept agents within {} s of starting. If it's still opening, try again in a moment; otherwise check Edit › Preferences › AI Integrations.", self.cfg.launch_timeout.as_secs() )); } @@ -161,7 +161,7 @@ fn closed(integrations: &Integrations) -> String { if integrations.connect_agents { "PhotoCraft isn't running: open it, then try again.".into() } else { - "PhotoCraft doesn't accept AI agents: open it, turn on Edit › Preferences › MCP › Let AI agents connect, then try again.".into() + "PhotoCraft doesn't accept AI agents: open it, turn on Edit › Preferences › AI Integrations › Let AI agents connect, then try again.".into() } } diff --git a/crates/automation/tests/mcp_live.rs b/crates/automation/tests/mcp_live.rs index 14daa48e1a..81909d783a 100644 --- a/crates/automation/tests/mcp_live.rs +++ b/crates/automation/tests/mcp_live.rs @@ -1,4 +1,4 @@ -//! `photocraft-cli mcp --live` (Preferences › MCP): the MCP server finds the desktop +//! `photocraft-cli mcp --live` (Preferences › AI Integrations): the MCP server finds the desktop //! app through its connection file before every call, follows it to a new port and token, and //! applies the closed-app choice (start it, headless, or an error) when no app answers. diff --git a/crates/engine/src/prefs/cmds.rs b/crates/engine/src/prefs/cmds.rs index 564566fb8c..564306ecf5 100644 --- a/crates/engine/src/prefs/cmds.rs +++ b/crates/engine/src/prefs/cmds.rs @@ -189,7 +189,7 @@ pub fn specs() -> Vec { section!("edit.preferences.type", "Type…"), section!("edit.preferences.enhancedControls", "Enhanced Controls…"), section!("edit.preferences.rawDefaults", "RAW Defaults…"), - section!("edit.preferences.integrations", "MCP…"), + section!("edit.preferences.integrations", "Integrations…"), spec!( "edit.keyboardShortcuts", "Keyboard Shortcuts…", diff --git a/crates/engine/src/prefs/validate.rs b/crates/engine/src/prefs/validate.rs index d83a784720..771382084c 100644 --- a/crates/engine/src/prefs/validate.rs +++ b/crates/engine/src/prefs/validate.rs @@ -25,7 +25,7 @@ pub const SECTIONS: [(&str, &str); 18] = [ ("type", "Type"), ("enhancedControls", "Enhanced Controls"), ("rawDefaults", "RAW Defaults"), - ("integrations", "MCP"), + ("integrations", "Integrations"), ]; /// Preferences that nothing reads yet, so Edit › Preferences doesn't show them: a control that diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 220a4d6899..daa6caa8b2 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -460,7 +460,7 @@ pub struct PhotocraftApp { /// The first digit of a two-digit opacity typed on the number keys (`opacity_keys`, #352). pub(crate) opacity_keys: opacity_keys::Pending, control_rx: Option>, - /// Preferences › MCP: the agent connection's state (see [`Services::agent_link`]). + /// Preferences › AI Integrations: the agent connection's state (see [`Services::agent_link`]). pub agent_link: AgentLinkStatus, /// `ui.screenshot` requests: bounded admission, a weak-slot callback per issuance, monotonic /// deadlines and a capture-time geometry epoch (see `screenshot.rs`). diff --git a/crates/ui-egui/src/menu_catalog.rs b/crates/ui-egui/src/menu_catalog.rs index 3e67428731..d6db835eab 100644 --- a/crates/ui-egui/src/menu_catalog.rs +++ b/crates/ui-egui/src/menu_catalog.rs @@ -151,7 +151,7 @@ pub static CATALOG: &[(&[&str], &str, Option<&str>, &str)] = &[ (&["Edit"], "---", None, "---"), (&["Edit", "Preferences"], "General…", Some("Cmd+K"), "edit.preferences.general"), (&["Edit", "Preferences"], "---", None, "---"), - (&["Edit", "Preferences"], "MCP…", None, "edit.preferences.integrations"), + (&["Edit", "Preferences"], "AI Integrations…", None, "edit.preferences.integrations"), (&["Edit", "Preferences"], "Interface…", None, "edit.preferences.interface"), (&["Edit", "Preferences"], "Workspace…", None, "edit.preferences.workspace"), (&["Edit", "Preferences"], "Tools…", None, "edit.preferences.tools"), diff --git a/crates/ui-egui/src/preferences_submenu_tests.rs b/crates/ui-egui/src/preferences_submenu_tests.rs index 7b8ef7b143..7050d385c0 100644 --- a/crates/ui-egui/src/preferences_submenu_tests.rs +++ b/crates/ui-egui/src/preferences_submenu_tests.rs @@ -16,7 +16,7 @@ fn preferences_submenu_reads_in_the_reference_order_with_two_separators() { &labels[1..], [ "---", - "MCP…", + "AI Integrations…", "Interface…", "Workspace…", "Tools…", diff --git a/crates/ui-egui/src/prefs/prefs_ui/agents.rs b/crates/ui-egui/src/prefs/prefs_ui/agents.rs index d7dbf92986..2dbaa69cfd 100644 --- a/crates/ui-egui/src/prefs/prefs_ui/agents.rs +++ b/crates/ui-egui/src/prefs/prefs_ui/agents.rs @@ -1,4 +1,4 @@ -//! Preferences › MCP: the agent connection (`integrations.connectAgents`), the folders +//! Preferences › AI Integrations: the agent connection (`integrations.connectAgents`), the folders //! agents may use, what `photocraft-cli mcp --live` does while the app is closed, and the buttons //! that add PhotoCraft to MCP clients. Changes apply at once, without a restart. diff --git a/crates/ui-egui/src/prefs/prefs_ui/agents_tests.rs b/crates/ui-egui/src/prefs/prefs_ui/agents_tests.rs index 3e55459c0f..312b6bf4e6 100644 --- a/crates/ui-egui/src/prefs/prefs_ui/agents_tests.rs +++ b/crates/ui-egui/src/prefs/prefs_ui/agents_tests.rs @@ -1,4 +1,4 @@ -//! Preferences › MCP (`agents.rs`): the live agent connection and its buttons. +//! Preferences › AI Integrations (`agents.rs`): the live agent connection and its buttons. use super::tests::app_with_store; use super::*; diff --git a/crates/ui-egui/src/services.rs b/crates/ui-egui/src/services.rs index 5ed287b336..1741dcfd85 100644 --- a/crates/ui-egui/src/services.rs +++ b/crates/ui-egui/src/services.rs @@ -344,7 +344,7 @@ pub type AutomationCommandFn = Box Result<(), String>>; pub type AutomationAuthorizeFn = fn(&str, &Value) -> photocraft_engine::Result<()>; /// The automation half of [`Services`]: what control and MCP requests may read, write and run. -/// Replaced as a whole when Preferences › MCP starts the agent connection or +/// Replaced as a whole when Preferences › AI Integrations starts the agent connection or /// changes its folders ([`Services::set_automation`]). #[derive(Default)] pub struct AutomationServices { @@ -356,7 +356,7 @@ pub struct AutomationServices { pub authorize: Option, } -/// Preferences › MCP: the agent connection as the dialog and `ui.inspect` show it. +/// Preferences › AI Integrations: the agent connection as the dialog and `ui.inspect` show it. #[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize)] #[serde(rename_all = "camelCase")] pub struct AgentLinkStatus { @@ -382,7 +382,7 @@ pub struct AgentLink { pub status: AgentLinkStatus, } -/// Starts, moves or stops the agent connection to match Preferences › MCP. +/// Starts, moves or stops the agent connection to match Preferences › AI Integrations. pub type AgentLinkFn = Box AgentLink>; /// Adds PhotoCraft to an MCP client (`claude-desktop`, `claude-code`, `cursor`), returning what /// was done, or returns the configuration to paste into any client (`json`). @@ -582,10 +582,10 @@ pub struct Services { /// each step of `actions.play`. Installed on the session only while a control request or /// an automation-driven [`PhotocraftApp::run`] runs, so a local play of a recorded `file.*` step still works. pub automation_authorize: Option, - /// Preferences › MCP (desktop): starts, moves or stops the agent connection when + /// Preferences › AI Integrations (desktop): starts, moves or stops the agent connection when /// its settings change. `None` on the web, and when `--control` manages the connection. pub agent_link: Option, - /// Preferences › MCP' buttons that add PhotoCraft to MCP clients (desktop). + /// Preferences › AI Integrations' buttons that add PhotoCraft to MCP clients (desktop). pub agent_clients: Option, /// Encode an RGBA8 image as PNG (used for screenshots and `ui.render`). pub encode_png: Option, diff --git a/docs/control-protocol.md b/docs/control-protocol.md index c3ed0c2e4f..cbaf2c224c 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -17,9 +17,9 @@ photocraft --control 7878 --control-token-file /private/path/photocraft-control. If the file does not exist, PhotoCraft creates it with a fresh 256-bit token. On Unix the new file is mode `0600`; on Windows, protect it with an appropriate user-only ACL. An existing file is reused. If neither a token nor token file is configured, PhotoCraft generates a token for that launch and writes it to standard error. `PHOTOCRAFT_CONTROL_TOKEN` and `PHOTOCRAFT_CONTROL_TOKEN_FILE` are the environment-variable equivalents. A flag wins over its variable and an empty variable counts as unset; with `--control` (or `PHOTOCRAFT_CONTROL_PORT`), a token together with a token file, from flags or variables, is a usage error (exit status 2). Without it no token is read, so the pair is ignored. -### Without `--control`: Preferences › MCP +### Without `--control`: Preferences › AI Integrations -An app started from the Dock, the Start menu or a file manager has no command line. Edit › Preferences › MCP starts and stops the control server while the app runs: turning *Let AI agents connect* on or off, or changing its port or folders, applies at once, with no restart. +An app started from the Dock, the Start menu or a file manager has no command line. Edit › Preferences › AI Integrations starts and stops the control server while the app runs: turning *Let AI agents connect* on or off, or changing its port or folders, applies at once, with no restart. | Preference | What it does | |---|---| @@ -418,7 +418,7 @@ magenta alignment lines. `ui.pointer` drives the same code, so agents get identi - **Headless** (`photocraft-cli mcp`): an in-process `photocraft_engine::Session`. There is no window. CPU composition is the default; `--gpu` or `PHOTOCRAFT_GPU=1` enables optional GPU rendering with automatic CPU fallback. - **Bridge** (`photocraft-cli mcp --bridge 127.0.0.1:7878 --control-token-file `): every tool is forwarded to a running `photocraft --control 7878 --control-token-file ` over this protocol, so agents see and drive the live app. Explicit `--gpu` / `--no-gpu` flags are rejected with a usage error because the desktop controls rendering; `PHOTOCRAFT_GPU` is ignored in bridge mode. `--bridge 7878` is short for `--bridge 127.0.0.1:7878`. With no `--bridge`, `PHOTOCRAFT_CONTROL_PORT` selects the bridge port (`127.0.0.1:`), and the CLI says so on standard error; with neither (or the variable empty), the MCP runs headless. A value that is not a port is a usage error naming the variable. `--automation-read-root` or `--automation-write-root` with the variable set is a usage error, since the bridge would drop the roots. -- **Live** (`photocraft-cli mcp --live`): the bridge, with the address and token read before every tool call from `agent-connection.json` in the app's settings folder. The app publishes that file while Edit › Preferences › MCP › *Let AI agents connect* is on (not with `--control`), and removes it when the connection stops; a file left by a crash fails the connection probe and counts as no app. See [MCP conventions](mcp.md#connecting-the-desktop-app-no-terminal). +- **Live** (`photocraft-cli mcp --live`): the bridge, with the address and token read before every tool call from `agent-connection.json` in the app's settings folder. The app publishes that file while Edit › Preferences › AI Integrations › *Let AI agents connect* is on (not with `--control`), and removes it when the connection stops; a file left by a crash fails the connection probe and counts as no app. See [MCP conventions](mcp.md#connecting-the-desktop-app-no-terminal). `ui.inspect` reports the connection as `agentLink`: `port` while agents can connect, `launchFlags` when `--control` manages it, `error`, and `mcpCommand` (how MCP clients start the CLI). @@ -488,7 +488,7 @@ One explicit write-root flag overrides `PHOTOCRAFT_AUTOMATION_WRITE_ROOT`. These variables are not supported by headless `photocraft-cli mcp` or `serve`; supply flags explicitly. In MCP bridge mode, configure roots on the desktop process. Supplying root flags to `photocraft-cli mcp --bridge` is a usage error; a bridge client cannot grant filesystem access. -With *Let AI agents connect*, the folders chosen in Preferences › MCP (`readRoot` / +With *Let AI agents connect*, the folders chosen in Preferences › AI Integrations (`readRoot` / `writeRoot`) are the agents' roots; `mcp --live` uses them for a headless session only when the app's *When PhotoCraft is closed* choice (or `--when-closed headless`) asks for one. diff --git a/docs/development.md b/docs/development.md index fb13a03492..d37f01acbe 100644 --- a/docs/development.md +++ b/docs/development.md @@ -324,7 +324,7 @@ At startup the desktop lists recovery metadata, then decodes one document at a t - **Headless:** `photocraft-cli mcp --automation-read-root --automation-read-root --automation-write-root `. It drives an in-process engine session with ordered read directories and one write directory. - **Live app:** start `photocraft --control 7878 --control-token-file --automation-read-root --automation-read-root --automation-write-root `, then run `photocraft-cli mcp --bridge 127.0.0.1:7878 --control-token-file `. The desktop process owns the roots; root flags on the bridging CLI are a usage error. See `docs/control-protocol.md#mcp-bridge`. -- **Live app, no flags:** turn on Edit › Preferences › MCP › Let AI agents connect, then point the MCP client at `photocraft-cli mcp --live` (the panel's buttons, or `photocraft-cli mcp install --client `, do it). The app publishes its port and token file in `agent-connection.json` in the settings folder; `--live` reads it on every call. See [MCP conventions](mcp.md#connecting-the-desktop-app-no-terminal). Test it against a scratch settings folder with `PHOTOCRAFT_CONFIG_DIR`, which both the app and the CLI honour. +- **Live app, no flags:** turn on Edit › Preferences › AI Integrations › Let AI agents connect, then point the MCP client at `photocraft-cli mcp --live` (the panel's buttons, or `photocraft-cli mcp install --client `, do it). The app publishes its port and token file in `agent-connection.json` in the settings folder; `--live` reads it on every call. See [MCP conventions](mcp.md#connecting-the-desktop-app-no-terminal). Test it against a scratch settings folder with `PHOTOCRAFT_CONFIG_DIR`, which both the app and the CLI honour. For headless MCP clients, pass absolute paths to deliberately chosen trusted workspace directories in the launch arguments. Desktop `PHOTOCRAFT_AUTOMATION_READ_ROOT` and `PHOTOCRAFT_AUTOMATION_WRITE_ROOT` environment variables do **not** grant headless CLI access. Omitting a root flag deliberately denies that direction of access. diff --git a/docs/mcp.md b/docs/mcp.md index b8ddbf6ebb..8ba0de9057 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2,7 +2,7 @@ ## Connecting the desktop app (no terminal) -1. In PhotoCraft, open **Edit › Preferences › MCP** and turn on **Let AI agents +1. In PhotoCraft, open **Edit › Preferences › AI Integrations** and turn on **Let AI agents connect (MCP)**. Optionally choose the folders agents can open from and save to, and what happens when an agent needs PhotoCraft while it is closed (open it, work without a window, or ask the user to open it). Click **Apply** or **OK**. diff --git a/docs/roadmap.md b/docs/roadmap.md index e0b6e3516a..6ffcdcfd09 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap -> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-12 · **Change:** minor (M11: the desktop app connects to MCP clients from Edit › Preferences › MCP, no terminal, no restart; alpha gate, focus and estimates unchanged) · **Target:** Adobe Photoshop 2026 +> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-12 · **Change:** minor (M11: the desktop app connects to MCP clients from Edit › Preferences › AI Integrations, no terminal, no restart; alpha gate, focus and estimates unchanged) · **Target:** Adobe Photoshop 2026 - UI.5: Panels can detach, join other tab groups, split, resize and redock through shared docking transactions. Custom layouts persist with workspaces, respect workspace locking, and retain collapse flags for intact native groups. @@ -116,7 +116,7 @@ Each milestone has a **definition of done (DoD)** and must leave `main` green on | Date | Change | Summary | |---|---|---| -| 2026-11-12 | minor | M11: Edit › Preferences › MCP connects MCP clients to the running app without a terminal or restart; milestones, alpha gate and estimates unchanged | +| 2026-11-12 | minor | M11: Edit › Preferences › AI Integrations connects MCP clients to the running app without a terminal or restart; milestones, alpha gate and estimates unchanged | | 2026-10-11 | minor | Linked adaptive Unsharp Mask performance and quality evidence; milestones, alpha gate and estimates unchanged | | 2026-10-10 | minor | Photomerge is implemented; real-world quality validation remains open | | 2026-10-10 | minor | Alpha gate table (core-workflow gate): passes, stage stays alpha | diff --git a/docs/scorecard.md b/docs/scorecard.md index 69df97bbe8..f0c051c86b 100644 --- a/docs/scorecard.md +++ b/docs/scorecard.md @@ -274,7 +274,7 @@ Menu wiring (`docs/parity-checklist.md`): 664 of 664 menu items live (100.0%). T | AUTO-219-8 | xtask check that every panel button routes through a command id | partial | [#219](https://github.com/storytold/photocraft/issues/219) | cargo xtask panel-commands (run by xtask ci and CI) fails on a shell click handler that changes the document or session directly; 1 allowlisted function left (panels/color.rs color_field assigns the foreground/background colour instead of tools.setColors) | | AUTO-219-9 | Headless commands for in-canvas type editing, Liquify/Puppet strokes, transform handles | done | [#219](https://github.com/storytold/photocraft/issues/219) | type.hitTest, type.caret, type.navigate; filter.liquify strokes, edit.puppetWarp pins, type.edit, edit.transform | | AUTO-219-10 | Agent acceptance suite grown to 30-50 workflows | partial | [#219](https://github.com/storytold/photocraft/issues/219) | automation/tests/it/agent_tasks.rs runs 10 workflows over MCP | -| AUTO-MCP-LIVE | Connect an MCP client to the running app without a terminal (no flags, ports or tokens to copy) | done | | 2026-11-12 (#5525, #11363): Edit › Preferences › MCP › Let AI agents connect starts and stops the loopback control server while the app runs (no restart) and publishes agent-connection.json; photocraft-cli mcp --live finds the app on every call (launch / headless / error while it is closed); Add to Claude Desktop / Claude Code / Cursor, mcp install --client, and Copy Prompt for an Agent. automation/tests/mcp_live.rs, apps/photocraft/src/agent_link.rs tests | +| AUTO-MCP-LIVE | Connect an MCP client to the running app without a terminal (no flags, ports or tokens to copy) | done | | 2026-11-12 (#5525, #11363): Edit › Preferences › AI Integrations › Let AI agents connect starts and stops the loopback control server while the app runs (no restart) and publishes agent-connection.json; photocraft-cli mcp --live finds the app on every call (launch / headless / error while it is closed); Add to Claude Desktop / Claude Code / Cursor, mcp install --client, and Copy Prompt for an Agent. automation/tests/mcp_live.rs, apps/photocraft/src/agent_link.rs tests | ## Reliability diff --git a/packaging/macos/package.sh b/packaging/macos/package.sh index b3e8a0a6f2..ca64f30e82 100755 --- a/packaging/macos/package.sh +++ b/packaging/macos/package.sh @@ -120,7 +120,7 @@ echo "==> assembling $APP" mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" # Executable and icon carry the display name (CFBundleExecutable / CFBundleIconFile). cp "$WORK/bin/photocraft" "$APP/Contents/MacOS/PhotoCraft" -# The CLI too, beside the app: Preferences › MCP points MCP clients at it +# The CLI too, beside the app: Preferences › AI Integrations points MCP clients at it # (`photocraft-cli mcp --live`), and it starts the app when an agent needs it. cp "$WORK/bin/photocraft-cli" "$APP/Contents/MacOS/photocraft-cli" cp "$ROOT/assets/app-icon/photocraft.icns" "$APP/Contents/Resources/PhotoCraft.icns" diff --git a/scorecard/automation.toml b/scorecard/automation.toml index 2816d95346..22a198f870 100644 --- a/scorecard/automation.toml +++ b/scorecard/automation.toml @@ -85,4 +85,4 @@ note = "automation/tests/it/agent_tasks.rs runs 10 workflows over MCP" id = "AUTO-MCP-LIVE" target = "Connect an MCP client to the running app without a terminal (no flags, ports or tokens to copy)" status = "done" -note = "2026-11-12 (#5525, #11363): Edit › Preferences › MCP › Let AI agents connect starts and stops the loopback control server while the app runs (no restart) and publishes agent-connection.json; photocraft-cli mcp --live finds the app on every call (launch / headless / error while it is closed); Add to Claude Desktop / Claude Code / Cursor, mcp install --client, and Copy Prompt for an Agent. automation/tests/mcp_live.rs, apps/photocraft/src/agent_link.rs tests" +note = "2026-11-12 (#5525, #11363): Edit › Preferences › AI Integrations › Let AI agents connect starts and stops the loopback control server while the app runs (no restart) and publishes agent-connection.json; photocraft-cli mcp --live finds the app on every call (launch / headless / error while it is closed); Add to Claude Desktop / Claude Code / Cursor, mcp install --client, and Copy Prompt for an Agent. automation/tests/mcp_live.rs, apps/photocraft/src/agent_link.rs tests"