AI-native design editor. Open-source Figma alternative.
fix(settings): set up the MCP server in one click and align the MCP settings pages (#1091)
Danila Poyarkove8c3c7f1d374
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 533e9f3b5..923c93005 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,6 +13,7 @@### Changed+- **Settings…** (<kbd>⌘</kbd><kbd>,</kbd>) is in the **OpenPencil** menu on macOS and at the end of the **File** menu elsewhere, instead of under **View → Preferences**.- A selected layer resizes and rotates where Figma's does: every edge resizes along its whole length within 7.5 px outside it and up to a tenth of the side inside it, corners within 7.5 px, and the area outside a corner within 16 px rotates; a frame's name takes a press before rotation but not before resizing. Layers under 24 px keep these zones outside them, and a layer under 10 px on both sides has none, taking presses within 16 px across its centre instead. A selection draws Figma's four corner handles, without the edge midpoints, and none on such a small layer.- Pasted layers keep how they were turned and flipped on the canvas, as in Figma, so a layer copied out of a rotated frame stays at its angle in an upright one, and paste to replace keeps the copied layer's angle too. Layers copied out of a frame or section keep their offset from its box on the canvas, and move into the frame only when they start past its far edge, or, for top-level layers, miss it: then layers that fit are centred on that axis, and larger ones go to the frame's top-left, or are centred if top-level. Layers overlapping an edge stay where they are, and layers copied from different places are placed each from its own.- The demo at `/demo` is a tour of one player card in eight chapters stacked on one canvas, each showing one thing with a numbered card that says what to try and draws the piece of the app to click: preview, the artwork slot, the controls' behaviours, the theme's modes, shader fills, the Code tab, Lint on a card with planted issues, and sharing and opening your own files. It opens on the first chapter with the rest below it and follows the app's light or dark theme. The welcome dialog on first launch offers it next to AI setup, and File > Open the Tour opens it any time.@@ -25,10 +26,11 @@- An instance whose own content makes it taller or wider than its component, such as a hug frame around longer text, reopens at its saved size.- SVG export, and the HTML, JSX, and preview drawings built on it, draw a vector's open strokes beside its filled regions, such as the bar of a skip icon, instead of the regions alone.- The contrast check asks 3:1 of large text, 24 px or 18.66 px bold, as WCAG AA does, and 4.5:1 of the rest, holding a text layer to the strictest threshold any of its style runs needs.---### Fixed-+- When saved credentials are paused, the home screen's storage section offers **Retry access** instead of a raw error that pointed to Settings with no way there.+- Settings → MCP installs or updates a missing or outdated MCP server with one click, through Bun when Bun installed it, explains that it installs separately to keep the download small, and falls back to the install command and a prompt for your agent when npm is missing or the install fails; it no longer suggests reinstalling the old server's own version.+- Where npm keeps global packages in a folder that needs administrator rights, as with Node from a Linux distribution or the nodejs.org installer on macOS, setup says so and shows the `sudo` command and a prompt for your agent instead of an install that fails, and installs a new MCP server or Harness with Bun when Bun is available.+- Settings → Tool access lists the local MCP server's tools while the server is stopped, instead of an empty list saying no tools match the search.+- Settings → MCP shows the local server in the desktop app and WebMCP in the browser, where each works, instead of a WebMCP section the desktop app can never use and a local server the browser reports as unreachable.- Lines of text that mix font sizes or line heights are spaced as in Figma: each line is as tall as the tallest line height on it, with its largest font centred in it, instead of stacking the tallest parts of every style on it, which put lines after a large word or a taller line height up to 10 px off.- A line height in pixels shorter than the font, such as 24 px on 24 px text, opens from `.fig` files as set instead of as the font's own height.- Text with an empty line, or ending in one, saved to `.fig` or copied to Figma shows there, where Figma showed it blank.diff --git a/desktop/capabilities/default.json b/desktop/capabilities/default.jsonindex 4ca35f5b5..94e27a561 100644--- a/desktop/capabilities/default.json+++ b/desktop/capabilities/default.json@@ -142,6 +142,18 @@"--registry=https://registry.npmjs.org"]},+ {+ "name": "bun",+ "cmd": "bun",+ "args": [+ "add",+ "--global",+ {+ "validator": "^@open-pencil/(mcp|harness)@[0-9]+\\.[0-9]+\\.[0-9]+(-beta\\.[1-9][0-9]*)?$"+ },+ "--registry=https://registry.npmjs.org"+ ]+ },{ "name": "openpencil-mcp-http", "cmd": "openpencil-mcp-http", "args": false },{ "name": "openpencil-harness", "cmd": "openpencil-harness", "args": false },{ "name": "cmd-claude-agent-acp", "cmd": "cmd", "args": ["/c", "claude-agent-acp"] },@@ -161,6 +173,20 @@"--registry=https://registry.npmjs.org"]},+ {+ "name": "cmd-bun",+ "cmd": "cmd",+ "args": [+ "/c",+ "bun",+ "add",+ "--global",+ {+ "validator": "^@open-pencil/(mcp|harness)@[0-9]+\\.[0-9]+\\.[0-9]+(-beta\\.[1-9][0-9]*)?$"+ },+ "--registry=https://registry.npmjs.org"+ ]+ },{ "name": "cmd-openpencil-mcp-http", "cmd": "cmd", "args": ["/c", "openpencil-mcp-http"] },{ "name": "cmd-openpencil-harness", "cmd": "cmd", "args": ["/c", "openpencil-harness"] }]diff --git a/desktop/generated/app-menu.json b/desktop/generated/app-menu.jsonindex d5e6179e7..f34a715b6 100644--- a/desktop/generated/app-menu.json+++ b/desktop/generated/app-menu.json@@ -5,6 +5,10 @@"check-updates": {"label": "Check for Updates…"},+ "settings": {+ "label": "Settings…",+ "accelerator": "CmdOrCtrl+,"+ },"quit": {"label": "Quit OpenPencil","accelerator": "CmdOrCtrl+Q"diff --git a/desktop/generated/menu.json b/desktop/generated/menu.jsonindex bb3a2c1a1..b7dcef1cc 100644--- a/desktop/generated/menu.json+++ b/desktop/generated/menu.json@@ -79,6 +79,14 @@"id": "close","label": "Close Tab","accelerator": "CmdOrCtrl+W"+ },+ {+ "type": "separator"+ },+ {+ "id": "settings",+ "label": "Settings…",+ "accelerator": "CmdOrCtrl+,"}]},@@ -272,14 +280,6 @@"label": "Snap to Pixel Grid","accelerator": "CmdOrCtrl+Shift+'","checkbox": true- },- {- "type": "separator"- },- {- "id": "settings",- "label": "Settings…",- "accelerator": "CmdOrCtrl+,"}]},diff --git a/desktop/src/agents.rs b/desktop/src/agents.rsindex a066e040b..c8f96106b 100644--- a/desktop/src/agents.rs+++ b/desktop/src/agents.rs@@ -15,6 +15,7 @@ const EXECUTABLES: &[&str] = &["openpencil-mcp-http","openpencil-harness","npm",+ "bun",];// OpenPencil's own companions, whose installed version must match the app.@@ -29,6 +30,9 @@ pub struct AgentLookup {executables: BTreeMap<String, Option<String>>,/// Versions OpenPencil's companions report for `--version`; `None` when one predates it.versions: BTreeMap<String, Option<String>>,+ /// Whether this user can write npm's global package folder; `None` without npm or when npm+ /// does not say where it is. A distribution's Node usually needs administrator rights there.+ npm_global_writable: Option<bool>,search_path: String,}@@ -52,9 +56,25 @@ fn parse_version(output: &str) -> Option<String> {/// `--help` follows so that a release older than `--version` prints its help and exits; it has/// no version line, which reads as outdated.fn companion_version(executable: &Path, search_path: &str, timeout: Duration) -> Option<String> {+ parse_version(&run_for_output(+ executable,+ &["--version", "--help"],+ search_path,+ timeout,+ )?)+}++/// Runs a discovered program without a window and returns what it printed, or `None` when it+/// fails to start or outlives `timeout`.+fn run_for_output(+ executable: &Path,+ args: &[&str],+ search_path: &str,+ timeout: Duration,+) -> Option<String> {let mut command = Command::new(executable);command- .args(["--version", "--help"])+ .args(args).env("PATH", search_path).stdin(Stdio::null()).stdout(Stdio::piped())@@ -77,19 +97,69 @@ fn companion_version(executable: &Path, search_path: &str, timeout: Duration) ->}let mut output = String::new();child.stdout.take()?.read_to_string(&mut output).ok()?;- parse_version(&output)+ Some(output)+}++/// The folder `npm install --global` writes packages into, below the prefix npm reports.+fn npm_global_packages(prefix: &Path) -> PathBuf {+ if cfg!(windows) {+ prefix.join("node_modules")+ } else {+ prefix.join("lib").join("node_modules")+ }+}++/// The closest folder that exists at or above `path`. npm creates the missing ones, so writing+/// there is what decides whether an install can succeed.+fn nearest_existing(path: &Path) -> Option<&Path> {+ path.ancestors().find(|dir| dir.is_dir())+}++/// Whether this process can create files in `dir`, checked by creating and removing one, since+/// permission bits alone do not account for ownership, ACLs, or read-only mounts.+fn can_write(dir: &Path) -> bool {+ let probe = dir.join(format!(".openpencil-write-check-{}", std::process::id()));+ match std::fs::OpenOptions::new()+ .write(true)+ .create_new(true)+ .open(&probe)+ {+ Ok(_) => {+ let _ = std::fs::remove_file(&probe);+ true+ }+ Err(_) => false,+ }+}++fn npm_global_writable(npm: &Path, search_path: &str, timeout: Duration) -> Option<bool> {+ let output = run_for_output(npm, &["prefix", "--global"], search_path, timeout)?;+ let prefix = output.lines().next()?.trim();+ if prefix.is_empty() {+ return None;+ }+ Some(can_write(nearest_existing(&npm_global_packages(+ Path::new(prefix),+ ))?))}fn lookup_with(search_path: String,resolve: impl Fn(&str) -> Option<PathBuf>,version: impl Fn(&Path) -> Option<String>,+ npm_writable: impl Fn(&Path) -> Option<bool>,) -> AgentLookup {let resolved: BTreeMap<&str, Option<PathBuf>> = EXECUTABLES.iter().map(|command| (*command, resolve(command))).collect();+ let npm_global_writable = resolved+ .get("npm")+ .cloned()+ .flatten()+ .and_then(|npm| npm_writable(&npm));AgentLookup {+ npm_global_writable,executables: resolved.iter().map(|(command, path)| {@@ -121,6 +191,7 @@ pub async fn agent_lookup() -> Result<AgentLookup, String> {search_path.clone(),|command| which::which_in(command, Some(&search_path), &cwd).ok(),|executable| companion_version(executable, &search_path, VERSION_TIMEOUT),+ |npm| npm_global_writable(npm, &search_path, VERSION_TIMEOUT),)}).await@@ -142,7 +213,9 @@ mod tests {_ => None,},|_| Some("0.15.1".to_owned()),+ |_| Some(false),);+ assert_eq!(result.npm_global_writable, Some(false));assert_eq!(result.executables["claude"],Some("/agents/bin/claude".to_owned())@@ -155,6 +228,36 @@ mod tests {assert_eq!(result.versions["@open-pencil/harness"], None);}+ #[test]+ fn checks_npm_only_when_npm_is_found() {+ let result = lookup_with("/bin".to_owned(), |_| None, |_| None, |_| Some(true));+ assert_eq!(result.npm_global_writable, None);+ }++ #[test]+ fn probes_write_access_to_the_global_package_folder() {+ let prefix = std::env::temp_dir().join(format!("open-pencil-npm-{}", std::process::id()));+ let packages = if cfg!(windows) {+ prefix.join("node_modules")+ } else {+ prefix.join("lib").join("node_modules")+ };+ // A fresh user prefix has no package folder yet; npm creates it, so the prefix decides.+ std::fs::create_dir_all(&prefix).expect("create prefix");+ assert_eq!(npm_global_packages(&prefix), packages);+ assert_eq!(nearest_existing(&packages), Some(prefix.as_path()));+ std::fs::create_dir_all(&packages).expect("create package folder");+ assert_eq!(nearest_existing(&packages), Some(packages.as_path()));+ assert!(can_write(&packages));+ // The probe leaves nothing behind.+ assert_eq!(+ std::fs::read_dir(&packages).expect("read folder").count(),+ 0+ );+ assert!(!can_write(&prefix.join("missing")));+ std::fs::remove_dir_all(&prefix).expect("clean up");+ }+#[test]fn reads_only_a_version_line() {assert_eq!(parse_version("0.15.1\n"), Some("0.15.1".to_owned()));diff --git a/desktop/src/lib.rs b/desktop/src/lib.rsindex 866b78f87..c85e3cfae 100644--- a/desktop/src/lib.rs+++ b/desktop/src/lib.rs@@ -90,7 +90,14 @@ const MAX_REPORTED_SEARCH_DIRS: usize = 12;/// cover managers that only modify an interactive rc file.fn mcp_candidate_dirs() -> Vec<PathBuf> {let mut dirs: Vec<PathBuf> = Vec::new();- if let Some(home) = std::env::var_os("HOME").map(PathBuf::from) {+ // Bun, Volta, and npm keep their Windows folders under USERPROFILE, which a HOME set by+ // Unix-style tools does not always match; HOME remains the fallback there.+ let home = if cfg!(windows) {+ std::env::var_os("USERPROFILE").or_else(|| std::env::var_os("HOME"))+ } else {+ std::env::var_os("HOME")+ };+ if let Some(home) = home.map(PathBuf::from) {dirs.push(home.join(".bun/bin"));dirs.push(home.join(".local/bin"));dirs.push(home.join(".npm-global/bin"));diff --git a/desktop/src/menu.rs b/desktop/src/menu.rsindex 7c4d3f426..6002d3101 100644--- a/desktop/src/menu.rs+++ b/desktop/src/menu.rs@@ -41,6 +41,7 @@ struct AppMenuFile {about: AppMenuItem,#[serde(rename = "check-updates")]check_updates: AppMenuItem,+ settings: AppMenuItem,quit: AppMenuItem,}@@ -51,6 +52,22 @@ fn app_menu_file() -> tauri::Result<AppMenuFile> {))?)}+/// The macOS application menu holds Settings…, so the schema's copy is left out there, along+/// with a separator it would leave at the end of its menu.+fn platform_entries(items: &[MenuEntry]) -> Vec<&MenuEntry> {+ let mut entries: Vec<&MenuEntry> = items+ .iter()+ .filter(|entry| !(cfg!(target_os = "macos") && entry.id.as_deref() == Some("settings")))+ .collect();+ while entries+ .last()+ .is_some_and(|entry| entry.r#type.as_deref() == Some("separator"))+ {+ entries.pop();+ }+ entries+}+fn build_submenu<R: tauri::Runtime>(app: &tauri::AppHandle<R>,label: &str,@@ -59,7 +76,7 @@ fn build_submenu<R: tauri::Runtime>() -> tauri::Result<Submenu<R>> {let mut builder = SubmenuBuilder::new(app, label);- for entry in items {+ for entry in platform_entries(items) {if entry.r#type.as_deref() == Some("separator") {builder = builder.separator();continue;@@ -240,6 +257,10 @@ pub fn install_app_menu<R: tauri::Runtime>(if let Some(accelerator) = &items.check_updates.accelerator {check_updates = check_updates.accelerator(accelerator);}+ let mut settings = MenuItemBuilder::new(&items.settings.label).id("settings");+ if let Some(accelerator) = &items.settings.accelerator {+ settings = settings.accelerator(accelerator);+ }let mut quit = MenuItemBuilder::new(&items.quit.label).id("quit");if let Some(accelerator) = &items.quit.accelerator {quit = quit.accelerator(accelerator);@@ -252,6 +273,8 @@ pub fn install_app_menu<R: tauri::Runtime>()?).item(&check_updates.build(app)?).separator()+ .item(&settings.build(app)?)+ .separator().item(&PredefinedMenuItem::services(app, None)?).separator().item(&PredefinedMenuItem::hide(app, None)?)diff --git a/packages/docs/programmable/mcp-server.md b/packages/docs/programmable/mcp-server.mdindex ec88ae7bc..18efdc122 100644--- a/packages/docs/programmable/mcp-server.md+++ b/packages/docs/programmable/mcp-server.md@@ -15,7 +15,7 @@ Tool definitions own native Valibot input schemas, execution/mutation metadata,Use **Settings → Tool access** (select **Local MCP**) to search and toggle the local server's tools, individually or by read-only/side-effect group. Group switches affect all group members, even during search. **Restore defaults** enables the configurable MCP tools again. Existing MCP preferences are preserved separately from the **Built-in AI** settings.-Restart the MCP server, then reconnect stdio clients, to apply changes. For an externally managed server, restart its owning process. The list reflects the tools discovered from the server; disabling a dedicated tool does not prevent an enabled script tool from performing the same operation. These switches are not a sandbox and do not configure remote MCP servers or WebMCP.+Restart the MCP server, then reconnect stdio clients, to apply changes. For an externally managed server, restart its owning process. The list shows the tools the server offers, also while it is stopped; disabling a dedicated tool does not prevent an enabled script tool from performing the same operation. These switches are not a sandbox and do not configure remote MCP servers or WebMCP.## Share only the selection {#selection-scope}diff --git a/packages/mcp/src/tool/index.ts b/packages/mcp/src/tool/index.tsindex 2a5d86740..c83b7e24e 100644--- a/packages/mcp/src/tool/index.ts+++ b/packages/mcp/src/tool/index.ts@@ -1,4 +1,5 @@export * from './metadata'+export { createToolDescriptors } from './manifest'export { isToolEnabled, serializeDisabledTools } from './policy'export {MCP_TOOL_SCOPES,diff --git a/packages/vue/src/i18n/locales/de/ai.json b/packages/vue/src/i18n/locales/de/ai.jsonindex 4af40acc9..04efcaaec 100644--- a/packages/vue/src/i18n/locales/de/ai.json+++ b/packages/vue/src/i18n/locales/de/ai.json@@ -265,7 +265,6 @@"aiSetupAgentPromptHint": "Nutzt du schon {agent} oder einen anderen Coding-Agenten? Kopiere den Einrichtungs-Prompt und füge ihn dort ein; er installiert, was OpenPencil braucht.","aiSetupAgentCopyPrompt": "Einrichtungs-Prompt kopieren","aiSetupAgentCheckAgain": "Erneut prüfen",- "aiSetupAgentGuide": "Einrichtungsanleitung","aiSetupPiDescription": "OpenPencil führt Pi über seinen Harness-Begleiter aus und nutzt die Anbieter, bei denen du dich in Pi angemeldet hast.","aiSetupPiCompanion": "Harness-Begleiter","aiSetupPiInstallCompanion": "Begleiter installieren",@@ -283,6 +282,7 @@"aiSetupAgentInstalling": "Wird installiert…","aiSetupAgentGetCLI": "{agent} installieren","aiSetupAgentNeedsNpm": "Zum Installieren wird npm benötigt, das mit Node.js geliefert wird. Installiere Node.js und prüfe dann erneut.",+ "aiSetupAgentNeedsAdmin": "Die Installation braucht Administratorrechte, weil npm globale Pakete in einem geschützten Ordner ablegt. Führe den Befehl unten im Terminal aus oder lass deinen Agenten einen Ordner einrichten, der dir gehört.","aiSetupAgentInstallFailed": "Die Installation wurde nicht abgeschlossen. Prüfe deine Verbindung oder führe den Befehl selbst aus.","aiSetupAgentMCPStartFailed": "Der MCP-Server ist installiert, startet aber nicht. Starte OpenPencil neu und prüfe dann erneut.","aiSetupAgentLookupFailed": "Dieser Computer konnte nicht geprüft werden. Versuche es erneut.",diff --git a/packages/vue/src/i18n/locales/de/automation.json b/packages/vue/src/i18n/locales/de/automation.jsonindex cb37c66a2..14b1ca555 100644--- a/packages/vue/src/i18n/locales/de/automation.json+++ b/packages/vue/src/i18n/locales/de/automation.json@@ -54,7 +54,9 @@"statusStopped": "Gestoppt","statusError": "Fehler","localServer": "Lokaler Server",+ "localServerDesktopOnly": "Der lokale MCP-Server läuft mit der OpenPencil-Desktop-App. Im Browser nutzt du stattdessen WebMCP unten.","webmcpDescription": "Browser-Agenten können dieses Dokument direkt verwenden, ohne lokalen MCP-Server oder Bearer-Token. Die Einstellungen des lokalen Servers gelten hier nicht.",+ "webmcpFailed": "WebMCP konnte nicht starten","browserAccess": "Zugriff für Browser-Agenten","accessOff": "Aus","accessInspect": "Prüfen",@@ -63,13 +65,17 @@"accessInspectDescription": "Agenten können das Dokument prüfen, aber nicht ändern.","accessEditDescription": "Agenten können auch vorhandene Eigenschaften, Texte und Variablenwerte bearbeiten. Änderungen sind rückgängig machbar; das Erstellen oder Löschen von Inhalten, Skripte und Dateizugriffe sind ausgeschlossen.","webmcpUnsupported": "Dieser Browser stellt WebMCP nicht bereit. Verwende eine unterstützte Chrome-Version, aktiviere WebMCP-Tests und starte den Browser neu.",- "webmcpSetup": "WebMCP-Einrichtungsanleitung","noMatchingTools": "Keine Tools entsprechen deiner Suche.","connectionNameHint": "Verwende einen eindeutigen Namen mit höchstens 80 Zeichen. Der Name open-pencil ist reserviert.","connectionNameInvalid": "Wähle einen eindeutigen Namen mit höchstens 80 Zeichen, der nicht open-pencil lautet.","serverURLHint": "Verwende HTTPS. HTTP ist nur für localhost oder eine Loopback-Adresse erlaubt. Die URL darf keine Zugangsdaten enthalten.",- "mcpFailureNotInstalled": "MCP-Automatisierung ist nicht installiert",- "mcpFailureNotInstalledHint": "{package} global mit dem Paketmanager installieren und OpenPencil neu starten.",+ "mcpFailureNotInstalled": "MCP-Server ist nicht installiert",+ "mcpFailureNotInstalledHint": "Damit der OpenPencil-Download klein bleibt, wird der MCP-Server separat installiert.",+ "mcpFailureOutdated": "MCP-Server passt nicht zu dieser OpenPencil-Version",+ "mcpFailureOutdatedHint": "Installiert ist der MCP-Server {running}, diese OpenPencil-Version braucht {version}. Der Server wird separat installiert, damit der Download klein bleibt, und aktualisiert sich deshalb nicht mit der App.",+ "mcpInstallByHand": "Installiere ihn im Terminal oder kopiere einen Prompt, mit dem dein Agent das übernimmt.",+ "mcpCopyAgentPrompt": "Prompt für deinen Agenten kopieren",+ "mcpUpdating": "Wird aktualisiert…","mcpFailurePermission": "OpenPencil kann den MCP-Server nicht starten","mcpFailurePermissionHint": "Das System hat den Befehl abgelehnt. OpenPencil mit den Shell-Berechtigungen neu installieren oder den Server manuell starten.","mcpFailureExited": "MCP-Server wurde beim Start beendet",@@ -79,12 +85,11 @@"mcpFailureRejected": "MCP-Server hat die lokale Verbindung abgelehnt","mcpFailureRejectedHint": "MCP-Server neu starten, um ein neues Token auszugeben.","mcpFailureMalformed": "MCP-Server hat unerwartet geantwortet",- "mcpFailureMalformedHint": "App- und Serverversion passen möglicherweise nicht zusammen. Beide aktualisieren und OpenPencil neu starten.",+ "mcpFailureMalformedHint": "Starte ihn neu. Wenn das wieder passiert, kopiere die Details und melde das Problem.","mcpFailureUnreachable": "MCP-Server ist nicht erreichbar",- "mcpFailureUnreachableHint": "Unter {endpoint} antwortet nichts. Adresse freigeben und den Server starten.",+ "mcpFailureUnreachableHint": "Unter {endpoint} antwortet nichts. Starte den Server neu; falls eine andere App diese Adresse nutzt, schließe sie zuerst.","mcpFailureUnknown": "MCP-Server konnte nicht gestartet werden","mcpFailureUnknownHint": "Erneut starten oder die technischen Details unten prüfen.","mcpFailureDetails": "Details",- "mcpFailureCopy": "Details kopieren",- "mcpFailureCopied": "Technische Details kopiert."+ "mcpFailureCopy": "Details kopieren"}diff --git a/packages/vue/src/i18n/locales/de/common.json b/packages/vue/src/i18n/locales/de/common.jsonindex 3c3c9f7aa..8aa8ccd8e 100644--- a/packages/vue/src/i18n/locales/de/common.json+++ b/packages/vue/src/i18n/locales/de/common.json@@ -5,6 +5,7 @@"ok": "OK","copy": "Kopieren","copied": "Kopiert",+ "learnMore": "Mehr erfahren","copiedExclamation": "Kopiert!","copyMessage": "Nachricht kopieren","paste": "Einfügen",diff --git a/packages/vue/src/i18n/locales/de/diagnostics.json b/packages/vue/src/i18n/locales/de/diagnostics.jsonindex 805203160..3d49dc0b5 100644--- a/packages/vue/src/i18n/locales/de/diagnostics.json+++ b/packages/vue/src/i18n/locales/de/diagnostics.json@@ -28,7 +28,6 @@"clear": "Löschen","clearDescription": "Dadurch werden lokal gespeicherte Diagnosedaten von diesem Gerät entfernt.","cleared": "Diagnosedaten gelöscht.",- "copied": "Diagnosedaten in die Zwischenablage kopiert.","copyFailed": "Diagnosedaten konnten nicht in die Zwischenablage kopiert werden.","retentionCustom": "Eigener Wert…","retentionRange": "Gib eine ganze Zahl von {min} bis {max} ein.",diff --git a/packages/vue/src/i18n/locales/es/ai.json b/packages/vue/src/i18n/locales/es/ai.jsonindex a8ad32c9b..673fdf776 100644--- a/packages/vue/src/i18n/locales/es/ai.json+++ b/packages/vue/src/i18n/locales/es/ai.json@@ -265,7 +265,6 @@"aiSetupAgentPromptHint": "¿Ya usas {agent} u otro agente de programación? Copia el prompt de configuración y pégalo allí; instalará lo que OpenPencil necesita.","aiSetupAgentCopyPrompt": "Copiar prompt de configuración","aiSetupAgentCheckAgain": "Comprobar de nuevo",- "aiSetupAgentGuide": "Guía de configuración","aiSetupPiDescription": "OpenPencil ejecuta Pi mediante su complemento Harness y usa los proveedores en los que iniciaste sesión en Pi.","aiSetupPiCompanion": "Complemento Harness","aiSetupPiInstallCompanion": "Instalar complemento",@@ -283,6 +282,7 @@"aiSetupAgentInstalling": "Instalando…","aiSetupAgentGetCLI": "Instalar {agent}","aiSetupAgentNeedsNpm": "Para instalar hace falta npm, que viene con Node.js. Instala Node.js y vuelve a comprobar.",+ "aiSetupAgentNeedsAdmin": "La instalación necesita permisos de administrador, porque npm guarda los paquetes globales en una carpeta protegida. Ejecuta el comando de abajo en una terminal o deja que tu agente configure una carpeta tuya.","aiSetupAgentInstallFailed": "La instalación no terminó. Revisa tu conexión o ejecuta el comando tú mismo.","aiSetupAgentMCPStartFailed": "El servidor MCP está instalado pero no se inició. Reinicia OpenPencil y vuelve a comprobar.","aiSetupAgentLookupFailed": "No se pudo comprobar este equipo. Vuelve a intentarlo.",diff --git a/packages/vue/src/i18n/locales/es/automation.json b/packages/vue/src/i18n/locales/es/automation.jsonindex 2c418d864..45ddb414d 100644--- a/packages/vue/src/i18n/locales/es/automation.json+++ b/packages/vue/src/i18n/locales/es/automation.json@@ -54,7 +54,9 @@"statusStopped": "Detenido","statusError": "Error","localServer": "Servidor local",+ "localServerDesktopOnly": "El servidor MCP local funciona con la app de escritorio de OpenPencil. En el navegador, usa WebMCP abajo.","webmcpDescription": "Permite a los agentes del navegador usar este documento directamente, sin servidor MCP local ni token de portador. La configuración del servidor local no se aplica aquí.",+ "webmcpFailed": "WebMCP no pudo iniciarse","browserAccess": "Acceso de agentes del navegador","accessOff": "Desactivado","accessInspect": "Inspeccionar",@@ -63,13 +65,17 @@"accessInspectDescription": "Los agentes pueden inspeccionar el documento, pero no modificarlo.","accessEditDescription": "Los agentes también pueden editar propiedades, texto y valores de variables existentes. Los cambios se pueden deshacer; se excluyen la creación o eliminación de contenido, los scripts y el acceso a archivos.","webmcpUnsupported": "Este navegador no ofrece WebMCP. Usa una versión compatible de Chrome, activa las pruebas de WebMCP y reinicia el navegador.",- "webmcpSetup": "Guía de configuración de WebMCP","noMatchingTools": "Ninguna herramienta coincide con tu búsqueda.","connectionNameHint": "Usa un nombre único de hasta 80 caracteres. El nombre open-pencil está reservado.","connectionNameInvalid": "Elige un nombre único de hasta 80 caracteres que no sea open-pencil.","serverURLHint": "Usa HTTPS. HTTP solo se permite para localhost o una dirección de bucle local. No incluyas credenciales en la URL.",- "mcpFailureNotInstalled": "La automatización MCP no está instalada",- "mcpFailureNotInstalledHint": "Instala {package} globalmente con tu gestor de paquetes y reinicia OpenPencil.",+ "mcpFailureNotInstalled": "El servidor MCP no está instalado",+ "mcpFailureNotInstalledHint": "Para que la descarga de OpenPencil sea pequeña, el servidor MCP se instala por separado.",+ "mcpFailureOutdated": "El servidor MCP no coincide con esta versión de OpenPencil",+ "mcpFailureOutdatedHint": "El servidor MCP instalado es {running} y esta versión de OpenPencil necesita {version}. El servidor se instala por separado para que la descarga sea pequeña, así que no se actualiza con la app.",+ "mcpInstallByHand": "Instálalo desde una terminal o copia un prompt para que tu agente lo haga.",+ "mcpCopyAgentPrompt": "Copiar prompt para tu agente",+ "mcpUpdating": "Actualizando…","mcpFailurePermission": "OpenPencil no puede iniciar el servidor MCP","mcpFailurePermissionHint": "El sistema denegó el comando. Reinstala OpenPencil con sus permisos de shell o inicia el servidor manualmente.","mcpFailureExited": "El servidor MCP se detuvo durante el inicio",@@ -79,12 +85,11 @@"mcpFailureRejected": "El servidor MCP rechazó la conexión local","mcpFailureRejectedHint": "Reinicia el servidor MCP para emitir un token nuevo.","mcpFailureMalformed": "El servidor MCP devolvió una respuesta inesperada",- "mcpFailureMalformedHint": "Es posible que las versiones de la app y del servidor no coincidan. Actualiza ambas y reinicia OpenPencil.",+ "mcpFailureMalformedHint": "Reinícialo. Si vuelve a pasar, copia los detalles e informa del problema.","mcpFailureUnreachable": "El servidor MCP no es accesible",- "mcpFailureUnreachableHint": "Nada escucha en {endpoint}. Libera la dirección e inicia el servidor.",+ "mcpFailureUnreachableHint": "Nada responde en {endpoint}. Reinicia el servidor; si otra app usa esta dirección, ciérrala primero.","mcpFailureUnknown": "No se pudo iniciar el servidor MCP","mcpFailureUnknownHint": "Vuelve a iniciarlo o revisa los detalles técnicos de abajo.","mcpFailureDetails": "Detalles",- "mcpFailureCopy": "Copiar detalles",- "mcpFailureCopied": "Detalles técnicos copiados."+ "mcpFailureCopy": "Copiar detalles"}diff --git a/packages/vue/src/i18n/locales/es/common.json b/packages/vue/src/i18n/locales/es/common.jsonindex d984b80ff..04c528464 100644--- a/packages/vue/src/i18n/locales/es/common.json+++ b/packages/vue/src/i18n/locales/es/common.json@@ -5,6 +5,7 @@"ok": "Aceptar","copy": "Copiar","copied": "Copiado",+ "learnMore": "Más información","copiedExclamation": "¡Copiado!","copyMessage": "Copiar mensaje","paste": "Pegar",diff --git a/packages/vue/src/i18n/locales/es/diagnostics.json b/packages/vue/src/i18n/locales/es/diagnostics.jsonindex 03e04295a..95fb10400 100644--- a/packages/vue/src/i18n/locales/es/diagnostics.json+++ b/packages/vue/src/i18n/locales/es/diagnostics.json@@ -28,7 +28,6 @@"clear": "Borrar","clearDescription": "Esto elimina del dispositivo los eventos de diagnóstico almacenados localmente.","cleared": "Diagnóstico borrado.",- "copied": "Diagnóstico copiado al portapapeles.","copyFailed": "No se pudo copiar el diagnóstico al portapapeles.","retentionCustom": "Personalizado…","retentionRange": "Introduce un número entero entre {min} y {max}.",diff --git a/packages/vue/src/i18n/locales/fr/ai.json b/packages/vue/src/i18n/locales/fr/ai.jsonindex d5561a4be..e798c592a 100644--- a/packages/vue/src/i18n/locales/fr/ai.json+++ b/packages/vue/src/i18n/locales/fr/ai.json@@ -265,7 +265,6 @@"aiSetupAgentPromptHint": "Vous utilisez déjà {agent} ou un autre agent de code ? Copiez le prompt de configuration et collez-le dedans ; il installe ce dont OpenPencil a besoin.","aiSetupAgentCopyPrompt": "Copier le prompt de configuration","aiSetupAgentCheckAgain": "Vérifier à nouveau",- "aiSetupAgentGuide": "Guide de configuration","aiSetupPiDescription": "OpenPencil exécute Pi via son compagnon Harness et utilise les fournisseurs auxquels vous êtes connecté dans Pi.","aiSetupPiCompanion": "Compagnon Harness","aiSetupPiInstallCompanion": "Installer le compagnon",@@ -283,6 +282,7 @@"aiSetupAgentInstalling": "Installation…","aiSetupAgentGetCLI": "Installer {agent}","aiSetupAgentNeedsNpm": "L’installation nécessite npm, fourni avec Node.js. Installez Node.js, puis vérifiez à nouveau.",+ "aiSetupAgentNeedsAdmin": "L’installation nécessite des droits administrateur, car npm place les paquets globaux dans un dossier protégé. Exécutez la commande ci-dessous dans un terminal, ou laissez votre agent configurer un dossier qui vous appartient.","aiSetupAgentInstallFailed": "L’installation n’a pas abouti. Vérifiez votre connexion ou exécutez la commande vous-même.","aiSetupAgentMCPStartFailed": "Le serveur MCP est installé mais n’a pas démarré. Redémarrez OpenPencil, puis vérifiez à nouveau.","aiSetupAgentLookupFailed": "Impossible de vérifier cet ordinateur. Réessayez.",diff --git a/packages/vue/src/i18n/locales/fr/automation.json b/packages/vue/src/i18n/locales/fr/automation.jsonindex c798398bb..33a93af07 100644--- a/packages/vue/src/i18n/locales/fr/automation.json+++ b/packages/vue/src/i18n/locales/fr/automation.json@@ -54,7 +54,9 @@"statusStopped": "Arrêté","statusError": "Erreur","localServer": "Serveur local",+ "localServerDesktopOnly": "Le serveur MCP local fonctionne avec l’app de bureau OpenPencil. Dans le navigateur, utilisez WebMCP ci-dessous.","webmcpDescription": "Permettez aux agents du navigateur d’utiliser directement ce document, sans serveur MCP local ni jeton Bearer. Les paramètres du serveur local ne s’appliquent pas ici.",+ "webmcpFailed": "WebMCP n’a pas pu démarrer","browserAccess": "Accès des agents du navigateur","accessOff": "Désactivé","accessInspect": "Inspecter",@@ -63,13 +65,17 @@"accessInspectDescription": "Les agents peuvent inspecter le document, mais pas le modifier.","accessEditDescription": "Les agents peuvent aussi modifier les propriétés, le texte et les valeurs de variables existants. Les modifications sont annulables ; la création ou la suppression de contenu, les scripts et l’accès aux fichiers sont exclus.","webmcpUnsupported": "Ce navigateur ne propose pas WebMCP. Utilisez une version compatible de Chrome, activez les tests WebMCP, puis relancez le navigateur.",- "webmcpSetup": "Guide de configuration de WebMCP","noMatchingTools": "Aucun outil ne correspond à votre recherche.","connectionNameHint": "Utilisez un nom unique de 80 caractères maximum. Le nom open-pencil est réservé.","connectionNameInvalid": "Choisissez un nom unique de 80 caractères maximum, différent de open-pencil.","serverURLHint": "Utilisez HTTPS. HTTP n’est autorisé que pour localhost ou une adresse de bouclage. N’incluez pas d’identifiants dans l’URL.",- "mcpFailureNotInstalled": "L’automatisation MCP n’est pas installée",- "mcpFailureNotInstalledHint": "Installez {package} globalement avec votre gestionnaire de paquets, puis redémarrez OpenPencil.",+ "mcpFailureNotInstalled": "Le serveur MCP n’est pas installé",+ "mcpFailureNotInstalledHint": "Pour que le téléchargement d’OpenPencil reste léger, le serveur MCP s’installe séparément.",+ "mcpFailureOutdated": "Le serveur MCP ne correspond pas à cette version d’OpenPencil",+ "mcpFailureOutdatedHint": "Le serveur MCP installé est {running} et cette version d’OpenPencil nécessite {version}. Il s’installe séparément pour que le téléchargement reste léger, et ne se met donc pas à jour avec l’app.",+ "mcpInstallByHand": "Installez-le depuis un terminal ou copiez un prompt qui demande à votre agent de le faire.",+ "mcpCopyAgentPrompt": "Copier le prompt pour votre agent",+ "mcpUpdating": "Mise à jour…","mcpFailurePermission": "OpenPencil ne peut pas démarrer le serveur MCP","mcpFailurePermissionHint": "Le système a refusé la commande. Réinstallez OpenPencil avec ses permissions de shell ou démarrez le serveur manuellement.","mcpFailureExited": "Le serveur MCP s’est arrêté au démarrage",@@ -79,12 +85,11 @@"mcpFailureRejected": "Le serveur MCP a refusé la connexion locale","mcpFailureRejectedHint": "Redémarrez le serveur MCP pour émettre un nouveau jeton.","mcpFailureMalformed": "Le serveur MCP a renvoyé une réponse inattendue",- "mcpFailureMalformedHint": "Les versions de l’application et du serveur peuvent différer. Mettez à jour les deux et redémarrez OpenPencil.",+ "mcpFailureMalformedHint": "Redémarrez-le. Si cela se reproduit, copiez les détails et signalez le problème.","mcpFailureUnreachable": "Le serveur MCP est injoignable",- "mcpFailureUnreachableHint": "Rien n’écoute sur {endpoint}. Libérez l’adresse puis démarrez le serveur.",+ "mcpFailureUnreachableHint": "Rien ne répond à {endpoint}. Redémarrez le serveur ; si une autre app utilise cette adresse, fermez-la d’abord.","mcpFailureUnknown": "Le serveur MCP n’a pas pu démarrer","mcpFailureUnknownHint": "Relancez-le ou consultez les détails techniques ci-dessous.","mcpFailureDetails": "Détails",- "mcpFailureCopy": "Copier les détails",- "mcpFailureCopied": "Détails techniques copiés."+ "mcpFailureCopy": "Copier les détails"}diff --git a/packages/vue/src/i18n/locales/fr/common.json b/packages/vue/src/i18n/locales/fr/common.jsonindex 18af7f0a2..eefb19751 100644--- a/packages/vue/src/i18n/locales/fr/common.json+++ b/packages/vue/src/i18n/locales/fr/common.json@@ -5,6 +5,7 @@"ok": "OK","copy": "Copier","copied": "Copié",+ "learnMore": "En savoir plus","copiedExclamation": "Copié !","copyMessage": "Copier le message","paste": "Coller",diff --git a/packages/vue/src/i18n/locales/fr/diagnostics.json b/packages/vue/src/i18n/locales/fr/diagnostics.jsonindex cfde11ee8..26b4a7752 100644--- a/packages/vue/src/i18n/locales/fr/diagnostics.json+++ b/packages/vue/src/i18n/locales/fr/diagnostics.json@@ -28,7 +28,6 @@"clear": "Effacer","clearDescription": "Cette action supprime de cet appareil les événements de diagnostic stockés localement.","cleared": "Diagnostics effacés.",- "copied": "Diagnostics copiés dans le presse-papiers.","copyFailed": "Impossible de copier les diagnostics dans le presse-papiers.","retentionCustom": "Personnalisé…","retentionRange": "Saisissez un nombre entier entre {min} et {max}.",diff --git a/packages/vue/src/i18n/locales/it/ai.json b/packages/vue/src/i18n/locales/it/ai.jsonindex 220f8ac4e..9a3ff74c7 100644--- a/packages/vue/src/i18n/locales/it/ai.json+++ b/packages/vue/src/i18n/locales/it/ai.json@@ -265,7 +265,6 @@"aiSetupAgentPromptHint": "Usi già {agent} o un altro agente di programmazione? Copia il prompt di configurazione e incollalo lì: installerà ciò che serve a OpenPencil.","aiSetupAgentCopyPrompt": "Copia il prompt di configurazione","aiSetupAgentCheckAgain": "Controlla di nuovo",- "aiSetupAgentGuide": "Guida alla configurazione","aiSetupPiDescription": "OpenPencil esegue Pi tramite il suo companion Harness e usa i provider a cui hai effettuato l’accesso in Pi.","aiSetupPiCompanion": "Companion Harness","aiSetupPiInstallCompanion": "Installa companion",@@ -283,6 +282,7 @@"aiSetupAgentInstalling": "Installazione…","aiSetupAgentGetCLI": "Installa {agent}","aiSetupAgentNeedsNpm": "Per installare serve npm, incluso in Node.js. Installa Node.js e poi controlla di nuovo.",+ "aiSetupAgentNeedsAdmin": "L’installazione richiede i diritti di amministratore, perché npm salva i pacchetti globali in una cartella protetta. Esegui il comando qui sotto in un terminale, oppure lascia che il tuo agente configuri una cartella tua.","aiSetupAgentInstallFailed": "L’installazione non è stata completata. Controlla la connessione o esegui il comando manualmente.","aiSetupAgentMCPStartFailed": "Il server MCP è installato ma non si è avviato. Riavvia OpenPencil e controlla di nuovo.","aiSetupAgentLookupFailed": "Impossibile controllare questo computer. Riprova.",diff --git a/packages/vue/src/i18n/locales/it/automation.json b/packages/vue/src/i18n/locales/it/automation.jsonindex 041dd9985..38d7ab5fa 100644--- a/packages/vue/src/i18n/locales/it/automation.json+++ b/packages/vue/src/i18n/locales/it/automation.json@@ -54,7 +54,9 @@"statusStopped": "Arrestato","statusError": "Errore","localServer": "Server locale",+ "localServerDesktopOnly": "Il server MCP locale funziona con l’app desktop di OpenPencil. Nel browser, usa WebMCP qui sotto.","webmcpDescription": "Consenti agli agenti del browser di usare direttamente questo documento, senza un server MCP locale o un token Bearer. Le impostazioni del server locale non si applicano qui.",+ "webmcpFailed": "Impossibile avviare WebMCP","browserAccess": "Accesso degli agenti del browser","accessOff": "Disattivato","accessInspect": "Ispeziona",@@ -63,13 +65,17 @@"accessInspectDescription": "Gli agenti possono ispezionare il documento, ma non modificarlo.","accessEditDescription": "Gli agenti possono anche modificare proprietà, testo e valori delle variabili esistenti. Le modifiche sono annullabili; la creazione o eliminazione di contenuti, gli script e l’accesso ai file sono esclusi.","webmcpUnsupported": "Questo browser non espone WebMCP. Usa una versione compatibile di Chrome, abilita i test WebMCP e riavvia il browser.",- "webmcpSetup": "Guida alla configurazione di WebMCP","noMatchingTools": "Nessuno strumento corrisponde alla ricerca.","connectionNameHint": "Usa un nome univoco di massimo 80 caratteri. Il nome open-pencil è riservato.","connectionNameInvalid": "Scegli un nome univoco di massimo 80 caratteri, diverso da open-pencil.","serverURLHint": "Usa HTTPS. HTTP è consentito solo per localhost o un indirizzo di loopback. Non includere credenziali nell’URL.",- "mcpFailureNotInstalled": "L’automazione MCP non è installata",- "mcpFailureNotInstalledHint": "Installa {package} a livello globale con il gestore di pacchetti, poi riavvia OpenPencil.",+ "mcpFailureNotInstalled": "Il server MCP non è installato",+ "mcpFailureNotInstalledHint": "Per mantenere leggero il download di OpenPencil, il server MCP si installa separatamente.",+ "mcpFailureOutdated": "Il server MCP non corrisponde a questa versione di OpenPencil",+ "mcpFailureOutdatedHint": "Il server MCP installato è {running} e questa versione di OpenPencil richiede {version}. Il server si installa separatamente per mantenere leggero il download, quindi non si aggiorna con l’app.",+ "mcpInstallByHand": "Installalo da un terminale oppure copia un prompt che chiede al tuo agente di farlo.",+ "mcpCopyAgentPrompt": "Copia il prompt per il tuo agente",+ "mcpUpdating": "Aggiornamento…","mcpFailurePermission": "OpenPencil non può avviare il server MCP","mcpFailurePermissionHint": "Il sistema ha negato il comando. Reinstalla OpenPencil con i permessi di shell o avvia il server manualmente.","mcpFailureExited": "Il server MCP si è arrestato durante l’avvio",@@ -79,12 +85,11 @@"mcpFailureRejected": "Il server MCP ha rifiutato la connessione locale","mcpFailureRejectedHint": "Riavvia il server MCP per emettere un nuovo token.","mcpFailureMalformed": "Il server MCP ha restituito una risposta inattesa",- "mcpFailureMalformedHint": "Le versioni dell’app e del server potrebbero non coincidere. Aggiorna entrambe e riavvia OpenPencil.",+ "mcpFailureMalformedHint": "Riavvialo. Se succede di nuovo, copia i dettagli e segnala il problema.","mcpFailureUnreachable": "Il server MCP non è raggiungibile",- "mcpFailureUnreachableHint": "Nessuno risponde su {endpoint}. Libera l’indirizzo e avvia il server.",+ "mcpFailureUnreachableHint": "Nulla risponde a {endpoint}. Riavvia il server; se un’altra app usa questo indirizzo, chiudila prima.","mcpFailureUnknown": "Impossibile avviare il server MCP","mcpFailureUnknownHint": "Avvialo di nuovo o controlla i dettagli tecnici qui sotto.","mcpFailureDetails": "Dettagli",- "mcpFailureCopy": "Copia dettagli",- "mcpFailureCopied": "Dettagli tecnici copiati."+ "mcpFailureCopy": "Copia dettagli"}diff --git a/packages/vue/src/i18n/locales/it/common.json b/packages/vue/src/i18n/locales/it/common.jsonindex 73f0003a1..574154d8f 100644--- a/packages/vue/src/i18n/locales/it/common.json+++ b/packages/vue/src/i18n/locales/it/common.json@@ -5,6 +5,7 @@"ok": "OK","copy": "Copia","copied": "Copiato",+ "learnMore": "Scopri di più","copiedExclamation": "Copiato!","copyMessage": "Copia messaggio","paste": "Incolla",diff --git a/packages/vue/src/i18n/locales/it/diagnostics.json b/packages/vue/src/i18n/locales/it/diagnostics.jsonindex a1e23a87e..35b36bd00 100644--- a/packages/vue/src/i18n/locales/it/diagnostics.json+++ b/packages/vue/src/i18n/locales/it/diagnostics.json@@ -28,7 +28,6 @@"clear": "Cancella","clearDescription": "Questa operazione rimuove da questo dispositivo gli eventi diagnostici archiviati localmente.","cleared": "Diagnostica cancellata.",- "copied": "Diagnostica copiata negli appunti.","copyFailed": "Impossibile copiare la diagnostica negli appunti.","retentionCustom": "Personalizzato…","retentionRange": "Inserisci un numero intero da {min} a {max}.",diff --git a/packages/vue/src/i18n/locales/ja/ai.json b/packages/vue/src/i18n/locales/ja/ai.jsonindex 2b0a0a972..27e543eda 100644--- a/packages/vue/src/i18n/locales/ja/ai.json+++ b/packages/vue/src/i18n/locales/ja/ai.json@@ -265,7 +265,6 @@"aiSetupAgentPromptHint": "{agent} などのコーディングエージェントをすでに使っていますか?セットアップ用プロンプトをコピーして貼り付けると、OpenPencil に必要なものをインストールします。","aiSetupAgentCopyPrompt": "セットアップ用プロンプトをコピー","aiSetupAgentCheckAgain": "もう一度確認",- "aiSetupAgentGuide": "セットアップガイド","aiSetupPiDescription": "OpenPencil は Harness コンパニオンを通じて Pi を実行し、Pi でサインインしたプロバイダーを使います。","aiSetupPiCompanion": "Harness コンパニオン","aiSetupPiInstallCompanion": "コンパニオンをインストール",@@ -283,6 +282,7 @@"aiSetupAgentInstalling": "インストールしています…","aiSetupAgentGetCLI": "{agent} をインストール","aiSetupAgentNeedsNpm": "インストールには Node.js に含まれる npm が必要です。Node.js をインストールしてから、もう一度確認してください。",+ "aiSetupAgentNeedsAdmin": "npm はグローバルパッケージを保護されたフォルダーに置くため、インストールには管理者権限が必要です。下のコマンドをターミナルで実行するか、エージェントにあなた専用のフォルダーを設定させてください。","aiSetupAgentInstallFailed": "インストールが完了しませんでした。接続を確認するか、コマンドを自分で実行してください。","aiSetupAgentMCPStartFailed": "MCP サーバーはインストール済みですが起動しませんでした。OpenPencil を再起動してから、もう一度確認してください。","aiSetupAgentLookupFailed": "このコンピューターを確認できませんでした。もう一度お試しください。",diff --git a/packages/vue/src/i18n/locales/ja/automation.json b/packages/vue/src/i18n/locales/ja/automation.jsonindex e5f2b5f97..c3f903d12 100644--- a/packages/vue/src/i18n/locales/ja/automation.json+++ b/packages/vue/src/i18n/locales/ja/automation.json@@ -54,7 +54,9 @@"statusStopped": "停止","statusError": "エラー","localServer": "ローカルサーバー",+ "localServerDesktopOnly": "ローカル MCP サーバーは OpenPencil デスクトップアプリで動作します。ブラウザでは下の WebMCP を使用してください。","webmcpDescription": "ローカルMCPサーバーやBearerトークンを使わずに、ブラウザーエージェントがこのドキュメントを直接操作できるようにします。ローカルサーバーの設定はここには適用されません。",+ "webmcpFailed": "WebMCP を開始できませんでした","browserAccess": "ブラウザーエージェントのアクセス","accessOff": "オフ","accessInspect": "参照",@@ -63,13 +65,17 @@"accessInspectDescription": "エージェントはドキュメントを参照できますが、変更はできません。","accessEditDescription": "エージェントは既存のプロパティ、テキスト、変数の値も編集できます。編集は元に戻せます。コンテンツの作成や削除、スクリプト、ファイルへのアクセスは許可されません。","webmcpUnsupported": "このブラウザーはWebMCPを公開していません。対応するChromeバージョンでWebMCPテストを有効にして、ブラウザーを再起動してください。",- "webmcpSetup": "WebMCP設定ガイド","noMatchingTools": "検索に一致するツールはありません。","connectionNameHint": "80 文字以内の重複しない名前を使用してください。open-pencil は予約済みです。","connectionNameInvalid": "open-pencil 以外の、80 文字以内で重複しない名前を選んでください。","serverURLHint": "HTTPS を使用してください。HTTP は localhost またはループバックアドレスでのみ使用できます。URL に認証情報を含めないでください。",- "mcpFailureNotInstalled": "MCP 自動化がインストールされていません",- "mcpFailureNotInstalledHint": "パッケージマネージャーで {package} をグローバルにインストールし、OpenPencil を再起動してください。",+ "mcpFailureNotInstalled": "MCP サーバーがインストールされていません",+ "mcpFailureNotInstalledHint": "OpenPencil のダウンロードサイズを小さく保つため、MCP サーバーは別途インストールします。",+ "mcpFailureOutdated": "MCP サーバーがこのバージョンの OpenPencil と一致しません",+ "mcpFailureOutdatedHint": "インストールされている MCP サーバーは {running} ですが、このバージョンの OpenPencil には {version} が必要です。サーバーはダウンロードサイズを小さく保つために別途インストールするため、アプリと一緒には更新されません。",+ "mcpInstallByHand": "ターミナルからインストールするか、エージェントに任せるためのプロンプトをコピーしてください。",+ "mcpCopyAgentPrompt": "エージェント用のプロンプトをコピー",+ "mcpUpdating": "更新中…","mcpFailurePermission": "OpenPencil が MCP サーバーを起動できません","mcpFailurePermissionHint": "システムがコマンドを拒否しました。シェル権限を含めて OpenPencil を再インストールするか、サーバーを手動で起動してください。","mcpFailureExited": "起動中に MCP サーバーが停止しました",@@ -79,12 +85,11 @@"mcpFailureRejected": "MCP サーバーがローカル接続を拒否しました","mcpFailureRejectedHint": "MCP サーバーを再起動して新しいトークンを発行してください。","mcpFailureMalformed": "MCP サーバーが予期しない応答を返しました",- "mcpFailureMalformedHint": "アプリとサーバーのバージョンが一致していない可能性があります。両方を更新して OpenPencil を再起動してください。",+ "mcpFailureMalformedHint": "再起動してください。繰り返し起こる場合は、詳細をコピーして問題を報告してください。","mcpFailureUnreachable": "MCP サーバーに到達できません",- "mcpFailureUnreachableHint": "{endpoint} で応答がありません。アドレスを解放してからサーバーを起動してください。",+ "mcpFailureUnreachableHint": "{endpoint} で応答がありません。サーバーを再起動してください。別のアプリがこのアドレスを使っている場合は、先に終了してください。","mcpFailureUnknown": "MCP サーバーを起動できませんでした","mcpFailureUnknownHint": "もう一度起動するか、以下の技術的な詳細を確認してください。","mcpFailureDetails": "詳細",- "mcpFailureCopy": "詳細をコピー",- "mcpFailureCopied": "技術的な詳細をコピーしました。"+ "mcpFailureCopy": "詳細をコピー"}diff --git a/packages/vue/src/i18n/locales/ja/common.json b/packages/vue/src/i18n/locales/ja/common.jsonindex e3251b3c6..d0082666a 100644--- a/packages/vue/src/i18n/locales/ja/common.json+++ b/packages/vue/src/i18n/locales/ja/common.json@@ -5,6 +5,7 @@"ok": "確定","copy": "コピー","copied": "コピーしました",+ "learnMore": "詳細","copiedExclamation": "コピーしました!","copyMessage": "メッセージをコピー","paste": "貼り付け",diff --git a/packages/vue/src/i18n/locales/ja/diagnostics.json b/packages/vue/src/i18n/locales/ja/diagnostics.jsonindex 216346c4e..c418e5975 100644--- a/packages/vue/src/i18n/locales/ja/diagnostics.json+++ b/packages/vue/src/i18n/locales/ja/diagnostics.json@@ -28,7 +28,6 @@"clear": "消去","clearDescription": "このデバイスに保存されている診断イベントを削除します。","cleared": "診断データを消去しました。",- "copied": "診断データをクリップボードにコピーしました。","copyFailed": "診断データをクリップボードにコピーできませんでした。","retentionCustom": "カスタム…","retentionRange": "{min} から {max} までの整数を入力してください。",diff --git a/packages/vue/src/i18n/locales/pl/ai.json b/packages/vue/src/i18n/locales/pl/ai.jsonindex 9424811af..ac45cfa18 100644--- a/packages/vue/src/i18n/locales/pl/ai.json+++ b/packages/vue/src/i18n/locales/pl/ai.json@@ -265,7 +265,6 @@"aiSetupAgentPromptHint": "Korzystasz już z {agent} lub innego agenta programistycznego? Skopiuj prompt konfiguracji i wklej go tam — zainstaluje to, czego potrzebuje OpenPencil.","aiSetupAgentCopyPrompt": "Kopiuj prompt konfiguracji","aiSetupAgentCheckAgain": "Sprawdź ponownie",- "aiSetupAgentGuide": "Przewodnik konfiguracji","aiSetupPiDescription": "OpenPencil uruchamia Pi przez towarzyszący program Harness i korzysta z dostawców, do których zalogowano się w Pi.","aiSetupPiCompanion": "Program towarzyszący Harness","aiSetupPiInstallCompanion": "Zainstaluj program towarzyszący",@@ -283,6 +282,7 @@"aiSetupAgentInstalling": "Instalowanie…","aiSetupAgentGetCLI": "Zainstaluj {agent}","aiSetupAgentNeedsNpm": "Instalacja wymaga npm, który jest częścią Node.js. Zainstaluj Node.js i sprawdź ponownie.",+ "aiSetupAgentNeedsAdmin": "Instalacja wymaga uprawnień administratora, ponieważ npm trzyma pakiety globalne w chronionym folderze. Uruchom poniższe polecenie w terminalu albo pozwól agentowi skonfigurować folder należący do Ciebie.","aiSetupAgentInstallFailed": "Instalacja nie została ukończona. Sprawdź połączenie lub uruchom polecenie samodzielnie.","aiSetupAgentMCPStartFailed": "Serwer MCP jest zainstalowany, ale się nie uruchomił. Uruchom ponownie OpenPencil i sprawdź jeszcze raz.","aiSetupAgentLookupFailed": "Nie udało się sprawdzić tego komputera. Spróbuj ponownie.",diff --git a/packages/vue/src/i18n/locales/pl/automation.json b/packages/vue/src/i18n/locales/pl/automation.jsonindex 6f1d39884..9964df07e 100644--- a/packages/vue/src/i18n/locales/pl/automation.json+++ b/packages/vue/src/i18n/locales/pl/automation.json@@ -54,7 +54,9 @@"statusStopped": "Zatrzymany","statusError": "Błąd","localServer": "Serwer lokalny",+ "localServerDesktopOnly": "Lokalny serwer MCP działa z aplikacją desktopową OpenPencil. W przeglądarce użyj WebMCP poniżej.","webmcpDescription": "Pozwól agentom przeglądarki korzystać z tego dokumentu bezpośrednio, bez lokalnego serwera MCP ani tokena Bearer. Ustawienia serwera lokalnego nie mają tu zastosowania.",+ "webmcpFailed": "Nie udało się uruchomić WebMCP","browserAccess": "Dostęp agentów przeglądarki","accessOff": "Wyłączony","accessInspect": "Inspekcja",@@ -63,13 +65,17 @@"accessInspectDescription": "Agenci mogą przeglądać dokument, ale nie mogą go zmieniać.","accessEditDescription": "Agenci mogą także edytować istniejące właściwości, tekst i wartości zmiennych. Zmiany można cofnąć; tworzenie lub usuwanie treści, skrypty i dostęp do plików są wykluczone.","webmcpUnsupported": "Ta przeglądarka nie udostępnia WebMCP. Użyj obsługiwanej wersji Chrome, włącz testowanie WebMCP i uruchom ponownie przeglądarkę.",- "webmcpSetup": "Instrukcja konfiguracji WebMCP","noMatchingTools": "Brak narzędzi pasujących do wyszukiwania.","connectionNameHint": "Użyj unikalnej nazwy o długości do 80 znaków. Nazwa open-pencil jest zarezerwowana.","connectionNameInvalid": "Wybierz unikalną nazwę o długości do 80 znaków, inną niż open-pencil.","serverURLHint": "Użyj HTTPS. HTTP jest dozwolone tylko dla localhost lub adresu pętli zwrotnej. Nie umieszczaj danych uwierzytelniających w adresie URL.",- "mcpFailureNotInstalled": "Automatyzacja MCP nie jest zainstalowana",- "mcpFailureNotInstalledHint": "Zainstaluj {package} globalnie w menedżerze pakietów i uruchom ponownie OpenPencil.",+ "mcpFailureNotInstalled": "Serwer MCP nie jest zainstalowany",+ "mcpFailureNotInstalledHint": "Aby pobieranie OpenPencil było niewielkie, serwer MCP instaluje się osobno.",+ "mcpFailureOutdated": "Serwer MCP nie pasuje do tej wersji OpenPencil",+ "mcpFailureOutdatedHint": "Zainstalowany serwer MCP to {running}, a ta wersja OpenPencil wymaga {version}. Serwer instaluje się osobno, aby pobieranie było niewielkie, więc nie aktualizuje się razem z aplikacją.",+ "mcpInstallByHand": "Zainstaluj go w terminalu albo skopiuj prompt, który poprosi o to Twojego agenta.",+ "mcpCopyAgentPrompt": "Kopiuj prompt dla agenta",+ "mcpUpdating": "Aktualizowanie…","mcpFailurePermission": "OpenPencil nie może uruchomić serwera MCP","mcpFailurePermissionHint": "System odrzucił polecenie. Zainstaluj ponownie OpenPencil z uprawnieniami powłoki lub uruchom serwer ręcznie.","mcpFailureExited": "Serwer MCP zatrzymał się podczas uruchamiania",@@ -79,12 +85,11 @@"mcpFailureRejected": "Serwer MCP odrzucił połączenie lokalne","mcpFailureRejectedHint": "Uruchom ponownie serwer MCP, aby wystawić nowy token.","mcpFailureMalformed": "Serwer MCP zwrócił nieoczekiwaną odpowiedź",- "mcpFailureMalformedHint": "Wersje aplikacji i serwera mogą się różnić. Zaktualizuj obie i uruchom ponownie OpenPencil.",+ "mcpFailureMalformedHint": "Uruchom go ponownie. Jeśli to się powtarza, skopiuj szczegóły i zgłoś problem.","mcpFailureUnreachable": "Serwer MCP jest nieosiągalny",- "mcpFailureUnreachableHint": "Pod adresem {endpoint} nikt nie nasłuchuje. Zwolnij adres i uruchom serwer.",+ "mcpFailureUnreachableHint": "Pod {endpoint} nic nie odpowiada. Uruchom serwer ponownie; jeśli inna aplikacja używa tego adresu, najpierw ją zamknij.","mcpFailureUnknown": "Nie udało się uruchomić serwera MCP","mcpFailureUnknownHint": "Uruchom go ponownie lub sprawdź szczegóły techniczne poniżej.","mcpFailureDetails": "Szczegóły",- "mcpFailureCopy": "Kopiuj szczegóły",- "mcpFailureCopied": "Skopiowano szczegóły techniczne."+ "mcpFailureCopy": "Kopiuj szczegóły"}diff --git a/packages/vue/src/i18n/locales/pl/common.json b/packages/vue/src/i18n/locales/pl/common.jsonindex 9a3823c86..3623318d6 100644--- a/packages/vue/src/i18n/locales/pl/common.json+++ b/packages/vue/src/i18n/locales/pl/common.json@@ -5,6 +5,7 @@"ok": "OK","copy": "Kopiuj","copied": "Skopiowano",+ "learnMore": "Więcej informacji","copiedExclamation": "Skopiowano!","copyMessage": "Kopiuj wiadomość","paste": "Wklej",diff --git a/packages/vue/src/i18n/locales/pl/diagnostics.json b/packages/vue/src/i18n/locales/pl/diagnostics.jsonindex 0c8aec5a0..c196d3b3a 100644--- a/packages/vue/src/i18n/locales/pl/diagnostics.json+++ b/packages/vue/src/i18n/locales/pl/diagnostics.json@@ -28,7 +28,6 @@"clear": "Wyczyść","clearDescription": "Spowoduje to usunięcie lokalnie zapisanych zdarzeń diagnostycznych z tego urządzenia.","cleared": "Wyczyszczono dane diagnostyczne.",- "copied": "Skopiowano dane diagnostyczne do schowka.","copyFailed": "Nie można skopiować danych diagnostycznych do schowka.","retentionCustom": "Własna wartość…","retentionRange": "Wpisz liczbę całkowitą od {min} do {max}.",diff --git a/packages/vue/src/i18n/locales/ru/ai.json b/packages/vue/src/i18n/locales/ru/ai.jsonindex 6be4b96c0..c52a557cc 100644--- a/packages/vue/src/i18n/locales/ru/ai.json+++ b/packages/vue/src/i18n/locales/ru/ai.json@@ -265,7 +265,6 @@"aiSetupAgentPromptHint": "Уже пользуетесь {agent} или другим агентом для программирования? Скопируйте промпт настройки и вставьте его туда — он установит всё нужное OpenPencil.","aiSetupAgentCopyPrompt": "Скопировать промпт настройки","aiSetupAgentCheckAgain": "Проверить снова",- "aiSetupAgentGuide": "Руководство по настройке","aiSetupPiDescription": "OpenPencil запускает Pi через компаньон Harness и использует провайдеров, в которые вы вошли в Pi.","aiSetupPiCompanion": "Компаньон Harness","aiSetupPiInstallCompanion": "Установить компаньон",@@ -283,6 +282,7 @@"aiSetupAgentInstalling": "Устанавливаем…","aiSetupAgentGetCLI": "Установить {agent}","aiSetupAgentNeedsNpm": "Для установки нужен npm, который входит в Node.js. Установите Node.js и проверьте снова.",+ "aiSetupAgentNeedsAdmin": "Для установки нужны права администратора: npm хранит глобальные пакеты в защищённой папке. Выполните команду ниже в терминале или попросите агента настроить папку, принадлежащую вам.","aiSetupAgentInstallFailed": "Установка не завершилась. Проверьте подключение или выполните команду вручную.","aiSetupAgentMCPStartFailed": "MCP-сервер установлен, но не запустился. Перезапустите OpenPencil и проверьте снова.","aiSetupAgentLookupFailed": "Не удалось проверить этот компьютер. Попробуйте снова.",diff --git a/packages/vue/src/i18n/locales/ru/automation.json b/packages/vue/src/i18n/locales/ru/automation.jsonindex 84049e9a5..b43449854 100644--- a/packages/vue/src/i18n/locales/ru/automation.json+++ b/packages/vue/src/i18n/locales/ru/automation.json@@ -54,7 +54,9 @@"statusStopped": "Остановлен","statusError": "Ошибка","localServer": "Локальный сервер",+ "localServerDesktopOnly": "Локальный MCP-сервер работает в настольном приложении OpenPencil. В браузере используйте WebMCP ниже.","webmcpDescription": "Разрешите браузерным агентам работать с документом напрямую, без локального MCP-сервера и Bearer-токена. Настройки локального сервера здесь не действуют.",+ "webmcpFailed": "Не удалось запустить WebMCP","browserAccess": "Доступ браузерных агентов","accessOff": "Выключен","accessInspect": "Просмотр",@@ -63,13 +65,17 @@"accessInspectDescription": "Агенты могут просматривать документ, но не изменять его.","accessEditDescription": "Агенты также могут изменять существующие свойства, текст и значения переменных. Правки можно отменить; создание и удаление содержимого, скрипты и доступ к файлам недоступны.","webmcpUnsupported": "Этот браузер не предоставляет WebMCP. Используйте поддерживаемую версию Chrome, включите тестирование WebMCP и перезапустите браузер.",- "webmcpSetup": "Настройка WebMCP","noMatchingTools": "По вашему запросу инструменты не найдены.","connectionNameHint": "Укажите уникальное название длиной до 80 символов. Название open-pencil зарезервировано.","connectionNameInvalid": "Выберите уникальное название длиной до 80 символов, отличное от open-pencil.","serverURLHint": "Используйте HTTPS. HTTP разрешён только для localhost или адреса обратной петли. Не включайте учётные данные в URL.",- "mcpFailureNotInstalled": "Автоматизация MCP не установлена",- "mcpFailureNotInstalledHint": "Установите {package} глобально через менеджер пакетов и перезапустите OpenPencil.",+ "mcpFailureNotInstalled": "MCP-сервер не установлен",+ "mcpFailureNotInstalledHint": "Чтобы загрузка OpenPencil оставалась небольшой, MCP-сервер устанавливается отдельно.",+ "mcpFailureOutdated": "MCP-сервер не соответствует этой версии OpenPencil",+ "mcpFailureOutdatedHint": "Установлен MCP-сервер {running}, а этой версии OpenPencil нужен {version}. Сервер устанавливается отдельно, чтобы загрузка оставалась небольшой, поэтому он не обновляется вместе с приложением.",+ "mcpInstallByHand": "Установите его в терминале или скопируйте промпт, чтобы это сделал ваш агент.",+ "mcpCopyAgentPrompt": "Скопировать промпт для агента",+ "mcpUpdating": "Обновление…","mcpFailurePermission": "OpenPencil не может запустить MCP-сервер","mcpFailurePermissionHint": "Система отклонила команду. Переустановите OpenPencil с правами оболочки или запустите сервер вручную.","mcpFailureExited": "MCP-сервер остановился при запуске",@@ -79,12 +85,11 @@"mcpFailureRejected": "MCP-сервер отклонил локальное подключение","mcpFailureRejectedHint": "Перезапустите MCP-сервер, чтобы выпустить новый токен.","mcpFailureMalformed": "MCP-сервер вернул неожиданный ответ",- "mcpFailureMalformedHint": "Версии приложения и сервера могут не совпадать. Обновите оба и перезапустите OpenPencil.",+ "mcpFailureMalformedHint": "Перезапустите его. Если это повторяется, скопируйте подробности и сообщите о проблеме.","mcpFailureUnreachable": "MCP-сервер недоступен",- "mcpFailureUnreachableHint": "По адресу {endpoint} никто не отвечает. Освободите адрес и запустите сервер.",+ "mcpFailureUnreachableHint": "По адресу {endpoint} никто не отвечает. Перезапустите сервер; если этот адрес занят другим приложением, сначала закройте его.","mcpFailureUnknown": "MCP-сервер не удалось запустить","mcpFailureUnknownHint": "Запустите его снова или посмотрите технические подробности ниже.","mcpFailureDetails": "Подробности",- "mcpFailureCopy": "Копировать подробности",- "mcpFailureCopied": "Технические подробности скопированы."+ "mcpFailureCopy": "Копировать подробности"}diff --git a/packages/vue/src/i18n/locales/ru/common.json b/packages/vue/src/i18n/locales/ru/common.jsonindex 0b8e04a9a..46b81d604 100644--- a/packages/vue/src/i18n/locales/ru/common.json+++ b/packages/vue/src/i18n/locales/ru/common.json@@ -5,6 +5,7 @@"ok": "ОК","copy": "Копировать","copied": "Скопировано",+ "learnMore": "Подробнее","copiedExclamation": "Скопировано!","copyMessage": "Скопировать сообщение","paste": "Вставить",diff --git a/packages/vue/src/i18n/locales/ru/diagnostics.json b/packages/vue/src/i18n/locales/ru/diagnostics.jsonindex 8aca8c074..394369aab 100644--- a/packages/vue/src/i18n/locales/ru/diagnostics.json+++ b/packages/vue/src/i18n/locales/ru/diagnostics.json@@ -28,7 +28,6 @@"clear": "Очистить","clearDescription": "Локально сохранённые диагностические события будут удалены с этого устройства.","cleared": "Диагностические данные очищены.",- "copied": "Диагностические данные скопированы в буфер обмена.","copyFailed": "Не удалось скопировать диагностические данные в буфер обмена.","retentionCustom": "Своё значение…","retentionRange": "Введите целое число от {min} до {max}.",diff --git a/packages/vue/src/i18n/locales/zh-cn/ai.json b/packages/vue/src/i18n/locales/zh-cn/ai.jsonindex 86bf0dce2..e22afaede 100644--- a/packages/vue/src/i18n/locales/zh-cn/ai.json+++ b/packages/vue/src/i18n/locales/zh-cn/ai.json@@ -265,7 +265,6 @@"aiSetupAgentPromptHint": "已经在用 {agent} 或其他编程智能体?复制设置提示词并粘贴进去,它会安装 OpenPencil 所需的内容。","aiSetupAgentCopyPrompt": "复制设置提示词","aiSetupAgentCheckAgain": "重新检查",- "aiSetupAgentGuide": "设置指南","aiSetupPiDescription": "OpenPencil 通过 Harness 配套程序运行 Pi,并使用你在 Pi 中登录的提供商。","aiSetupPiCompanion": "Harness 配套程序","aiSetupPiInstallCompanion": "安装配套程序",@@ -283,6 +282,7 @@"aiSetupAgentInstalling": "正在安装…","aiSetupAgentGetCLI": "安装 {agent}","aiSetupAgentNeedsNpm": "安装需要 Node.js 自带的 npm。请先安装 Node.js,然后重新检查。",+ "aiSetupAgentNeedsAdmin": "安装需要管理员权限,因为 npm 将全局包放在受保护的文件夹中。请在终端中运行下方命令,或让你的智能体设置一个属于你的文件夹。","aiSetupAgentInstallFailed": "安装未完成。请检查网络连接,或自行运行该命令。","aiSetupAgentMCPStartFailed": "MCP 服务器已安装但未能启动。请重启 OpenPencil,然后重新检查。","aiSetupAgentLookupFailed": "无法检查这台电脑,请重试。",diff --git a/packages/vue/src/i18n/locales/zh-cn/automation.json b/packages/vue/src/i18n/locales/zh-cn/automation.jsonindex 0cfd1ad2e..3f05c63db 100644--- a/packages/vue/src/i18n/locales/zh-cn/automation.json+++ b/packages/vue/src/i18n/locales/zh-cn/automation.json@@ -54,7 +54,9 @@"statusStopped": "已停止","statusError": "错误","localServer": "本地服务器",+ "localServerDesktopOnly": "本地 MCP 服务器随 OpenPencil 桌面应用运行。在浏览器中,请使用下方的 WebMCP。","webmcpDescription": "允许浏览器代理直接使用此文档,无需本地 MCP 服务器或 Bearer 令牌。本地服务器设置不适用于此处。",+ "webmcpFailed": "WebMCP 无法启动","browserAccess": "浏览器代理访问权限","accessOff": "关闭","accessInspect": "查看",@@ -63,13 +65,17 @@"accessInspectDescription": "代理可以查看文档,但不能修改。","accessEditDescription": "代理还可以编辑现有属性、文本和变量值。编辑可以撤销;不允许创建或删除内容、运行脚本或访问文件。","webmcpUnsupported": "此浏览器未提供 WebMCP。请使用受支持的 Chrome 版本,启用 WebMCP 测试,然后重新启动浏览器。",- "webmcpSetup": "WebMCP 设置指南","noMatchingTools": "没有与搜索匹配的工具。","connectionNameHint": "使用不超过 80 个字符的唯一名称。open-pencil 为保留名称。","connectionNameInvalid": "请选择不超过 80 个字符且不是 open-pencil 的唯一名称。","serverURLHint": "请使用 HTTPS。仅 localhost 或回环地址允许使用 HTTP。请勿在 URL 中包含凭据。",- "mcpFailureNotInstalled": "MCP 自动化未安装",- "mcpFailureNotInstalledHint": "请使用包管理器全局安装 {package},然后重启 OpenPencil。",+ "mcpFailureNotInstalled": "未安装 MCP 服务器",+ "mcpFailureNotInstalledHint": "为了让 OpenPencil 的下载体积保持较小,MCP 服务器需要单独安装。",+ "mcpFailureOutdated": "MCP 服务器与此版本的 OpenPencil 不匹配",+ "mcpFailureOutdatedHint": "已安装的 MCP 服务器为 {running},此版本的 OpenPencil 需要 {version}。服务器单独安装以保持下载体积较小,因此不会随应用一起更新。",+ "mcpInstallByHand": "可以在终端中安装,或复制提示词让你的智能体来完成。",+ "mcpCopyAgentPrompt": "复制给智能体的提示词",+ "mcpUpdating": "正在更新…","mcpFailurePermission": "OpenPencil 无法启动 MCP 服务器","mcpFailurePermissionHint": "系统拒绝了该命令。请重新安装 OpenPencil 以包含其命令行权限,或手动启动服务器。","mcpFailureExited": "MCP 服务器在启动过程中停止",@@ -79,12 +85,11 @@"mcpFailureRejected": "MCP 服务器拒绝了本地连接","mcpFailureRejectedHint": "重启 MCP 服务器以签发新的令牌。","mcpFailureMalformed": "MCP 服务器返回了意外的响应",- "mcpFailureMalformedHint": "应用与服务器版本可能不一致。请同时更新并重启 OpenPencil。",+ "mcpFailureMalformedHint": "请重启它。如果问题反复出现,请复制详细信息并报告问题。","mcpFailureUnreachable": "无法访问 MCP 服务器",- "mcpFailureUnreachableHint": "{endpoint} 上没有任何服务在监听。请释放该地址,然后启动服务器。",+ "mcpFailureUnreachableHint": "{endpoint} 没有响应。请重启服务器;如果其他应用占用了此地址,请先关闭该应用。","mcpFailureUnknown": "无法启动 MCP 服务器","mcpFailureUnknownHint": "请重新启动,或查看下方的技术细节。","mcpFailureDetails": "详细信息",- "mcpFailureCopy": "复制详细信息",- "mcpFailureCopied": "已复制技术细节。"+ "mcpFailureCopy": "复制详细信息"}diff --git a/packages/vue/src/i18n/locales/zh-cn/common.json b/packages/vue/src/i18n/locales/zh-cn/common.jsonindex 7a5414a31..03bea28e9 100644--- a/packages/vue/src/i18n/locales/zh-cn/common.json+++ b/packages/vue/src/i18n/locales/zh-cn/common.json@@ -5,6 +5,7 @@"ok": "确定","copy": "复制","copied": "已复制",+ "learnMore": "了解更多","copiedExclamation": "已复制!","copyMessage": "复制消息","paste": "粘贴",diff --git a/packages/vue/src/i18n/locales/zh-cn/diagnostics.json b/packages/vue/src/i18n/locales/zh-cn/diagnostics.jsonindex 95330d42c..acc7a7a0c 100644--- a/packages/vue/src/i18n/locales/zh-cn/diagnostics.json+++ b/packages/vue/src/i18n/locales/zh-cn/diagnostics.json@@ -28,7 +28,6 @@"clear": "清除","clearDescription": "这会从此设备中删除本地保存的诊断事件。","cleared": "诊断数据已清除。",- "copied": "诊断数据已复制到剪贴板。","copyFailed": "无法将诊断数据复制到剪贴板。","retentionCustom": "自定义…","retentionRange": "请输入 {min} 到 {max} 之间的整数。",diff --git a/packages/vue/src/i18n/messages/ai.ts b/packages/vue/src/i18n/messages/ai.tsindex a7c90e919..d8696019c 100644--- a/packages/vue/src/i18n/messages/ai.ts+++ b/packages/vue/src/i18n/messages/ai.ts@@ -272,6 +272,8 @@ export const aiMessageDefaults = {aiSetupAgentGetCLI: params('Install {agent}'),aiSetupAgentNeedsNpm:'Installing needs npm, which comes with Node.js. Install Node.js, then check again.',+ aiSetupAgentNeedsAdmin:+ 'Installing needs administrator rights, because npm keeps global packages in a protected folder. Run the command below in a terminal, or let your agent set up a folder you own.',aiSetupAgentInstallFailed:'The installation didn’t finish. Check your connection, or run the command yourself.',aiSetupAgentMCPStartFailed:@@ -279,7 +281,6 @@ export const aiMessageDefaults = {aiSetupAgentLookupFailed: 'Couldn’t check this computer. Try again.',aiSetupAgentCopyPrompt: 'Copy setup prompt',aiSetupAgentCheckAgain: 'Check again',- aiSetupAgentGuide: 'Setup guide',aiSetupPiDescription:'OpenPencil runs Pi through its Harness companion and uses the providers you signed in to in Pi.',aiSetupPiCompanion: 'Harness companion',diff --git a/packages/vue/src/i18n/messages/automation.ts b/packages/vue/src/i18n/messages/automation.tsindex fea1bcd2f..77ce396be 100644--- a/packages/vue/src/i18n/messages/automation.ts+++ b/packages/vue/src/i18n/messages/automation.ts@@ -15,10 +15,16 @@ export const automationMessageDefaults = {'Choose tools advertised by the local server to connected agents and clients.',aiToolsNotice:'Changes apply to your next message. Tool switches are not a sandbox: enabled script tools can still perform other design operations.',- mcpFailureNotInstalled: 'MCP automation is not installed',- mcpFailureNotInstalledHint: params(- 'Install {package} globally with your package manager, then restart OpenPencil.'+ mcpFailureNotInstalled: 'MCP server is not installed',+ mcpFailureNotInstalledHint:+ 'To keep the OpenPencil download small, the MCP server is installed separately.',+ mcpFailureOutdated: 'MCP server does not match this version of OpenPencil',+ mcpFailureOutdatedHint: params(+ 'The installed MCP server is {running}, and this version of OpenPencil needs {version}. The server is installed separately to keep the download small, so it does not update with the app.'),+ mcpInstallByHand: 'Install it from a terminal, or copy a prompt that asks your agent to do it.',+ mcpCopyAgentPrompt: 'Copy prompt for your agent',+ mcpUpdating: 'Updating…',mcpFailurePermission: 'OpenPencil cannot start the MCP server',mcpFailurePermissionHint:'The system denied the command. Reinstall OpenPencil with its shell permissions, or start the server manually.',@@ -30,17 +36,18 @@ export const automationMessageDefaults = {mcpFailureRejectedHint: 'Restart the MCP server to issue a new token.',mcpFailureMalformed: 'MCP server returned an unexpected response',mcpFailureMalformedHint:- 'The configured version and the running server may not match. Update both and restart OpenPencil.',+ 'Restart it. If this keeps happening, copy the details and report the problem.',mcpFailureUnreachable: 'MCP server is not reachable',mcpFailureUnreachableHint: params(- 'Nothing is listening at {endpoint}. Check that the address is free, then start the server.'+ 'Nothing answers at {endpoint}. Restart the server; if another app uses this address, close it first.'),mcpFailureUnknown: 'MCP server could not start',mcpFailureUnknownHint: 'Start it again, or check the diagnostic details below.',mcpFailureDetails: 'Details',mcpFailureCopy: 'Copy details',- mcpFailureCopied: 'Diagnostic details copied.',localServer: 'Local server',+ localServerDesktopOnly:+ 'The local MCP server runs with the OpenPencil desktop app. In the browser, use WebMCP below.',webmcpDescription:'Let browser agents use this document directly, without a local MCP server or bearer token. Local server settings do not apply here.',browserAccess: 'Browser agent access',@@ -51,9 +58,9 @@ export const automationMessageDefaults = {accessInspectDescription: 'Agents can inspect the document but cannot change it.',accessEditDescription:'Agents can also edit existing properties, text, and variable values. Edits are undoable; creating or deleting content, scripts, and file access are excluded.',+ webmcpFailed: 'WebMCP could not start',webmcpUnsupported:'This browser does not expose WebMCP. Use a supported Chrome version and enable WebMCP testing, then relaunch the browser.',- webmcpSetup: 'WebMCP setup guide',noMatchingTools: 'No tools match your search.',connections: 'MCP connections',connectionsDescription: 'Give ACP agents access to trusted remote tools and services.',diff --git a/packages/vue/src/i18n/messages/common.ts b/packages/vue/src/i18n/messages/common.tsindex 1bb13f4bd..ea1c9318e 100644--- a/packages/vue/src/i18n/messages/common.ts+++ b/packages/vue/src/i18n/messages/common.ts@@ -7,6 +7,7 @@ export const commonMessageDefaults = {ok: 'OK',copy: 'Copy',copied: 'Copied',+ learnMore: 'Learn more',copiedExclamation: 'Copied!',copyMessage: 'Copy message',paste: 'Paste',diff --git a/packages/vue/src/i18n/messages/diagnostics.ts b/packages/vue/src/i18n/messages/diagnostics.tsindex 86d4d5945..e70f85194 100644--- a/packages/vue/src/i18n/messages/diagnostics.ts+++ b/packages/vue/src/i18n/messages/diagnostics.ts@@ -69,7 +69,6 @@ export const diagnosticsMessageDefaults = {clear: 'Clear',clearDescription: 'This removes locally stored diagnostic events from this device.',cleared: 'Diagnostics cleared.',- copied: 'Diagnostics copied to clipboard.',copyFailed: 'Could not copy diagnostics to the clipboard.'} as constdiff --git a/src/AGENTS.md b/src/AGENTS.mdindex 54d7a68d3..02423a57b 100644--- a/src/AGENTS.md+++ b/src/AGENTS.md@@ -69,11 +69,14 @@ The supported browser baseline lives in `src/app/shell/support/baseline.ts` and- Compose Settings sections with `SettingsSection` and its `title`, `description`, `actions`, and default content slots. It owns heading association and internal spacing; `SettingsGroup` owns bordered row grouping. Do not repeat section, header, or spacing markup per feature.- Settings components own layout, translated copy, confirmation visibility, and emits; small presentation-only computed bindings may stay in components. Workflows, persistence, and credentials: `src/AGENTS.md`.- `SettingsSaveFeedback` maps domain outcomes (`saved`, `failed`, `partial`) to `AppAlert`. `SettingsLink` owns external-link styling, the icon, and native opening for provider key pages and setup guides; keep arrow glyphs out of translated labels.+- A section's header-level action (Add, Reset, Restart) goes in its `actions` slot; a link to another settings tab is a `SettingsRow` with an outline `xs` button; status, warning, and error `AppAlert`s come last inside the section they describe, offering only the fix (`src/components/settings/mcp/MCPSettingsPanel.vue`).+- An integration section links its guide once, as `common.learnMore` at the end of its description; alerts link only to the fix (Node.js, the desktop app), never to docs. Guide URLs live in `src/constants.ts`, except the unsupported-browser guidance, which stays self-contained (`src/app/shell/support/guidance.ts`).+- Empty lists use `AppPlaceholder`: `size="compact" :fill="false"` for no results or nothing added yet, an icon, description, and action for a feature that still needs setting up (`src/components/assets-panel/AssetsPanel.vue`, `src/components/chat/ProviderSetup.vue`).### Feedback and forms- `AppAlert` (`src/components/ui/feedback/AppAlert.vue`, theme `src/theme/feedback/alert.ts`) for persistent contextual errors, warnings, recovery guidance, and informative results, with translated `heading`/`description` and an `actions` slot. Do not hand-roll alert markup or colored error paragraphs. Alerts announce changes without taking keyboard focus.-- The toast service is for transient confirmations such as copying or completing an action after its view closes. Never show a toast and an alert for the same event; partial saves and actionable failures must not disappear in a toast.+- The toast service is for transient confirmations without a visible control to carry them, such as a copy from a menu or shortcut, or an action completed after its view closes. A copy button confirms in place instead: a leading copy icon that turns into a check and the label `common.copied` (`src/components/ui/input/AppCopyField.vue`). Never show a toast and an alert for the same event; partial saves and actionable failures must not disappear in a toast.- Field validation stays inline in the shared field component with `aria-invalid`, error text before hints, and first-invalid-field focus.- Ordinary labels such as Running/Stopped remain status text or badges. Destructive confirmation belongs in the shared confirmation dialog.diff --git a/src/app/ai/acp/setup-prompt.ts b/src/app/ai/acp/setup-prompt.tsindex 45d2983f2..51b7da3bf 100644--- a/src/app/ai/acp/setup-prompt.ts+++ b/src/app/ai/acp/setup-prompt.ts@@ -2,13 +2,8 @@ import dedent from 'dedent'import { ACP_AGENTS, type ACPAgentID } from '@open-pencil/core/constants'-import { MCP_INSTALL_TARGET } from '@/app/automation/mcp/failure'--/** Installs OpenPencil's MCP server at the version that matches the app. */-export const MCP_INSTALL_COMMAND = `npm i -g ${MCP_INSTALL_TARGET}`--/** The public guide for connecting a coding agent, one section per agent. */-export const CODING_AGENTS_GUIDE_URL = 'https://openpencil.dev/programmable/coding-agents'+import { MCP_INSTALL_COMMAND } from '@/app/automation/mcp/failure'+import { CODING_AGENTS_GUIDE_URL } from '@/constants'const SIGN_IN: Record<ACPAgentID, string> = {'claude-code':@@ -36,8 +31,9 @@ export function codingAgentSetupPrompt(agentID: ACPAgentID): string {1. If \`${agent.command}\` is not on my PATH, install it: \`${install}\`2. If \`openpencil-mcp-http\` is not on my PATH, install OpenPencil's MCP server: \`${MCP_INSTALL_COMMAND}\`- 3. Confirm both commands are found, for example with \`which ${agent.command}\` and \`which openpencil-mcp-http\` (\`where\` on Windows). If a global npm folder is missing from my PATH, tell me how to add it.- 4. ${SIGN_IN[agentID]}+ 3. If npm fails with a permission error (EACCES), set up a global npm folder in my home directory (for example \`npm config set prefix ~/.npm-global\` and add \`~/.npm-global/bin\` to my PATH) and install again; use sudo only if I agree.+ 4. Confirm both commands are found, for example with \`which ${agent.command}\` and \`which openpencil-mcp-http\` (\`where\` on Windows). If a global npm folder is missing from my PATH, tell me how to add it.+ 5. ${SIGN_IN[agentID]}Then tell me what you installed and anything I still need to do myself. I will press "Check again" in OpenPencil's AI setup afterwards.diff --git a/src/app/ai/agents/companions.ts b/src/app/ai/agents/companions.tsindex 0fc70f53e..22b645919 100644--- a/src/app/ai/agents/companions.ts+++ b/src/app/ai/agents/companions.ts@@ -20,9 +20,26 @@ export function isOutdatedCompanion(const BUN_GLOBAL_BIN = /[\\/]\.bun[\\/]/-/** The command that replaces a global package with the package manager that installed it. */-export function globalInstallCommand(target: string, executablePath?: string | null): string {- return executablePath && BUN_GLOBAL_BIN.test(executablePath)- ? `bun add -g ${target}`- : `npm i -g ${target}`+export type PackageManager = 'npm' | 'bun'++/**+ * The package manager that installed a global companion. Updating it with another one would+ * leave the old copy first on PATH, so installs and commands follow this.+ */+export function companionPackageManager(executablePath?: string | null): PackageManager {+ return executablePath && BUN_GLOBAL_BIN.test(executablePath) ? 'bun' : 'npm'+}++/**+ * The command that installs a global package by hand. npm whose global folder needs+ * administrator rights runs through sudo on macOS and Linux; Windows keeps npm per user.+ */+export function globalInstallCommand(+ target: string,+ manager: PackageManager,+ options: { admin?: boolean; windows?: boolean } = {}+): string {+ if (manager === 'bun') return `bun add -g ${target}`+ const command = `npm i -g ${target}`+ return options.admin && !options.windows ? `sudo ${command}` : command}diff --git a/src/app/ai/agents/discovery.ts b/src/app/ai/agents/discovery.tsindex ee6173a54..cd57b4104 100644--- a/src/app/ai/agents/discovery.ts+++ b/src/app/ai/agents/discovery.ts@@ -12,9 +12,15 @@ import {HARNESS_INSTALL_TARGET,HARNESS_PACKAGE} from '@/app/ai/harness/companion'-import { MCP_INSTALL_TARGET, MCP_PACKAGE_NAME } from '@/app/automation/mcp/failure'+import { MCP_EXECUTABLE, MCP_INSTALL_TARGET, MCP_PACKAGE_NAME } from '@/app/automation/mcp/failure'+import { detectUserAgent } from '@/app/tauri/command'-import { globalInstallCommand, isOutdatedCompanion } from './companions'+import {+ companionPackageManager,+ globalInstallCommand,+ isOutdatedCompanion,+ type PackageManager+} from './companions'import {installAgentAdapter,installCanvasBridge,@@ -23,8 +29,6 @@ import {type AgentLookup} from './native'-const MCP_EXECUTABLE = 'openpencil-mcp-http'-export type DetectedAgent = {definition: ACPAgentDefcliPath: string | null@@ -54,14 +58,16 @@ export type DiscoveryError =| 'canvas-install'| 'canvas-start'| 'harness-install'+ /** npm's global folder needs administrator rights, which the app never asks for. */+ | 'npm-admin'export function createAgentDiscovery(options: {enabled: booleanlookup: () => Promise<AgentLookup>install: (agent: ACPAgentDef, searchPath: string) => Promise<void>- installBridge?: (searchPath: string) => Promise<void>+ installBridge?: (searchPath: string, manager: PackageManager) => Promise<void>restartBridge?: () => Promise<void>- installHarness?: (searchPath: string) => Promise<void>+ installHarness?: (searchPath: string, manager: PackageManager) => Promise<void>}) {const snapshot = shallowRef<AgentLookup | null>(null)const scanning = ref(false)@@ -83,6 +89,34 @@ export function createAgentDiscovery(options: {function bridgeOutdated(): boolean {return hasBridge() && isOutdatedCompanion(snapshot.value?.versions[MCP_PACKAGE_NAME])}+ function canInstallWith(manager: PackageManager): boolean {+ return Boolean(snapshot.value?.executables[manager])+ }+ /** npm installs global packages where this user cannot write, so only an administrator can. */+ function npmNeedsAdmin(): boolean {+ return snapshot.value?.npmGlobalWritable === false+ }+ /**+ * The package manager that installed a companion updates it, so the new copy replaces the+ * old one on PATH; another manager would install beside it and leave the old copy first.+ * A new install uses npm, or Bun when npm would need administrator rights.+ */+ function managerFor(executable: string): PackageManager {+ const path = snapshot.value?.executables[executable]+ if (path) return companionPackageManager(path)+ return npmNeedsAdmin() && canInstallWith('bun') ? 'bun' : 'npm'+ }+ /** Installing this companion would need administrator rights. */+ function needsAdmin(executable: string): boolean {+ return managerFor(executable) === 'npm' && npmNeedsAdmin()+ }+ function installCommand(target: string, executable: string): string {+ // Run by hand in the person's own terminal, which may find a manager the app cannot.+ return globalInstallCommand(target, managerFor(executable), {+ admin: needsAdmin(executable),+ windows: detectUserAgent().includes('Windows')+ })+ }function hasHarness(): boolean {return Boolean(snapshot.value?.executables[HARNESS_EXECUTABLE])}@@ -95,12 +129,18 @@ export function createAgentDiscovery(options: {const harnessAvailable = computed(hasHarness)const harnessOutdatedVersion = computed(harnessOutdated)/** Commands to install or update a companion by hand, for the package manager that has it. */- const canvasBridgeCommand = computed(() =>- globalInstallCommand(MCP_INSTALL_TARGET, snapshot.value?.executables[MCP_EXECUTABLE])- )- const harnessCommand = computed(() =>- globalInstallCommand(HARNESS_INSTALL_TARGET, snapshot.value?.executables[HARNESS_EXECUTABLE])- )+ const canvasBridgeCommand = computed(() => installCommand(MCP_INSTALL_TARGET, MCP_EXECUTABLE))+ const harnessCommand = computed(() => installCommand(HARNESS_INSTALL_TARGET, HARNESS_EXECUTABLE))+ const canvasBridgeNeedsAdmin = computed(() => needsAdmin(MCP_EXECUTABLE))+ const harnessNeedsAdmin = computed(() => needsAdmin(HARNESS_EXECUTABLE))+ /** One click can install or update it, with the package manager that would run. */+ function installable(executable: string): boolean {+ return canInstallWith(managerFor(executable)) && !needsAdmin(executable)+ }+ const canvasBridgeInstallable = computed(() => installable(MCP_EXECUTABLE))+ const harnessInstallable = computed(() => installable(HARNESS_EXECUTABLE))+ /** Agent adapters always come from npm. */+ const adapterNeedsAdmin = computed(npmNeedsAdmin)function refresh(force = false): Promise<void> {if (!options.enabled) return Promise.resolve()@@ -131,6 +171,10 @@ export function createAgentDiscovery(options: {error.value = 'npm'return}+ if (npmNeedsAdmin()) {+ error.value = 'npm-admin'+ return+ }installing.value = iderror.value = nulltry {@@ -151,8 +195,14 @@ export function createAgentDiscovery(options: {async function setupCanvasBridge(): Promise<void> {if (!options.enabled || installing.value || !snapshot.value) returnlet installed = hasBridge() && !bridgeOutdated()- if (!installed && !npmAvailable.value) {- error.value = 'npm'+ const manager = managerFor(MCP_EXECUTABLE)+ if (!installed && !canInstallWith(manager)) {+ // A Bun copy the app cannot update leaves only the command run by hand.+ error.value = manager === 'npm' ? 'npm' : 'canvas-install'+ return+ }+ if (!installed && needsAdmin(MCP_EXECUTABLE)) {+ error.value = 'npm-admin'return}installing.value = 'canvas'@@ -160,7 +210,7 @@ export function createAgentDiscovery(options: {try {if (!installed) {if (!options.installBridge) throw new Error('Canvas bridge setup is unavailable.')- await options.installBridge(snapshot.value.searchPath)+ await options.installBridge(snapshot.value.searchPath, manager)await refresh(true)if (!hasBridge() || bridgeOutdated())throw new Error('A matching MCP server was not found.')@@ -177,15 +227,20 @@ export function createAgentDiscovery(options: {async function setupHarness(): Promise<void> {if (!options.enabled || installing.value || !snapshot.value) returnif (hasHarness() && !harnessOutdated()) return- if (!npmAvailable.value) {- error.value = 'npm'+ const manager = managerFor(HARNESS_EXECUTABLE)+ if (!canInstallWith(manager)) {+ error.value = manager === 'npm' ? 'npm' : 'harness-install'+ return+ }+ if (needsAdmin(HARNESS_EXECUTABLE)) {+ error.value = 'npm-admin'return}installing.value = 'harness'error.value = nulltry {if (!options.installHarness) throw new Error('Harness companion setup is unavailable.')- await options.installHarness(snapshot.value.searchPath)+ await options.installHarness(snapshot.value.searchPath, manager)await refresh(true)if (!hasHarness() || harnessOutdated()) error.value = 'harness-install'} catch {@@ -207,9 +262,14 @@ export function createAgentDiscovery(options: {canvasBridgeAvailable,canvasBridgeOutdated,canvasBridgeCommand,+ canvasBridgeNeedsAdmin,+ canvasBridgeInstallable,harnessAvailable,harnessOutdated: harnessOutdatedVersion,harnessCommand,+ harnessNeedsAdmin,+ harnessInstallable,+ adapterNeedsAdmin,setupCanvasBridge,setupHarness,refresh,diff --git a/src/app/ai/agents/native.ts b/src/app/ai/agents/native.tsindex 4e5fd373f..c78d8fb37 100644--- a/src/app/ai/agents/native.ts+++ b/src/app/ai/agents/native.ts@@ -6,10 +6,14 @@ import { HARNESS_INSTALL_TARGET } from '@/app/ai/harness/companion'import { MCP_INSTALL_TARGET } from '@/app/automation/mcp/failure'import { resolvePlatformCommand } from '@/app/tauri/command'+import type { PackageManager } from './companions'+const lookupSchema = v.object({executables: v.record(v.string(), v.nullable(v.string())),/** Versions of OpenPencil's own companions, keyed by package name. */versions: v.record(v.string(), v.nullable(v.string())),+ /** Whether this user can write npm's global folder; null without npm. */+ npmGlobalWritable: v.nullish(v.boolean()),searchPath: v.string()})@@ -27,23 +31,43 @@ export async function installAgentAdapter(agent: ACPAgentDef, searchPath: stringreturn installPackage(agent.adapterPackage, searchPath)}-export async function installCanvasBridge(searchPath: string): Promise<void> {- await installPackage(MCP_INSTALL_TARGET, searchPath)+export async function installCanvasBridge(+ searchPath: string,+ manager: PackageManager = 'npm'+): Promise<void> {+ await installPackage(MCP_INSTALL_TARGET, searchPath, manager)}-export async function installHarnessCompanion(searchPath: string): Promise<void> {- await installPackage(HARNESS_INSTALL_TARGET, searchPath)+export async function installHarnessCompanion(+ searchPath: string,+ manager: PackageManager = 'npm'+): Promise<void> {+ await installPackage(HARNESS_INSTALL_TARGET, searchPath, manager)}+// These are public packages; a user's private project registry may not mirror them.+const PUBLIC_REGISTRY = '--registry=https://registry.npmjs.org'+/** The npm arguments that install a package globally; the desktop shell scope pins them. */export function npmInstallArgs(packageName: string): string[] {- // These are public packages; a user's private project registry may not mirror them.- return ['install', '--global', packageName, '--registry=https://registry.npmjs.org']+ return ['install', '--global', packageName, PUBLIC_REGISTRY]+}++/** The Bun arguments that install a package globally; the desktop shell scope pins them. */+export function bunInstallArgs(packageName: string): string[] {+ return ['add', '--global', packageName, PUBLIC_REGISTRY]}-async function installPackage(packageName: string, searchPath: string): Promise<void> {+async function installPackage(+ packageName: string,+ searchPath: string,+ manager: PackageManager = 'npm'+): Promise<void> {const { Command } = await import('@tauri-apps/plugin-shell')- const resolved = resolvePlatformCommand('npm', npmInstallArgs(packageName))+ const resolved = resolvePlatformCommand(+ manager,+ manager === 'bun' ? bunInstallArgs(packageName) : npmInstallArgs(packageName)+ )const command = Command.create(resolved.command, resolved.args, {env: { PATH: searchPath }})diff --git a/src/app/ai/agents/setup.ts b/src/app/ai/agents/setup.tsindex b3c222cc1..a583091fd 100644--- a/src/app/ai/agents/setup.ts+++ b/src/app/ai/agents/setup.ts@@ -2,8 +2,9 @@ import { computed, ref, toValue, watch, type MaybeRefOrGetter } from 'vue'import type { ACPAgentDef } from '@open-pencil/core/constants'-import { MCP_INSTALL_COMMAND } from '@/app/ai/acp/setup-prompt'import { readPiAccount } from '@/app/ai/harness/pi-settings'+import { MCP_INSTALL_COMMAND } from '@/app/automation/mcp/failure'+import { detectUserAgent } from '@/app/tauri/command'import { agentDiscovery, type DetectedAgent, type DiscoveryError } from './discovery'@@ -25,6 +26,14 @@ export interface AgentSetupState {bridgeCommand: string/** npm, which one-click installation runs. */npm: boolean+ /** Installing the MCP server or the agent's adapter needs administrator rights; absent means no. */+ bridgeNeedsAdmin?: boolean+ /**+ * One click can install or update the MCP server with the package manager that would run,+ * which may be Bun without npm; absent means npm decides.+ */+ bridgeInstallable?: boolean+ adapterNeedsAdmin?: booleaninstallingAgent: booleaninstallingBridge: booleanerror: DiscoveryError | null@@ -43,6 +52,12 @@ export interface PiSetupState {bridgeOutdated: booleanbridgeCommand: stringnpm: boolean+ /** Installing the companion or the MCP server needs administrator rights; absent means no. */+ companionNeedsAdmin?: boolean+ bridgeNeedsAdmin?: boolean+ /** One click can install or update each, as `AgentSetupState.bridgeInstallable` says. */+ companionInstallable?: boolean+ bridgeInstallable?: booleaninstallingCompanion: booleaninstallingBridge: boolean/** The default model set in Pi, used unless OpenPencil names another. */@@ -50,18 +65,38 @@ export interface PiSetupState {error: DiscoveryError | null}+/** What setup knows about OpenPencil's MCP server on its own, for Settings → MCP. */+export type MCPServerSetupState = Pick<+ AgentSetupState,+ | 'supported'+ | 'checked'+ | 'bridge'+ | 'bridgeOutdated'+ | 'bridgeCommand'+ | 'npm'+ | 'bridgeNeedsAdmin'+ | 'bridgeInstallable'+ | 'installingBridge'+ | 'error'+>+/** An OpenPencil companion as setup presents it, with the one-click fix that applies. */export interface CompanionCheck {/** Installed and matching this app. */ready: booleanoutdated: booleaninstalling: boolean- /** Absent once ready, and without npm, which one-click installation runs. */+ /** Absent once ready, and where one-click installation cannot run or needs administrator rights. */action: 'install' | 'update' | null}/** Why setup cannot finish on its own, in the order the person should address it. */-export type SetupProblem = 'needs-npm' | 'install-failed' | 'mcp-start-failed' | 'lookup-failed'+export type SetupProblem =+ | 'needs-npm'+ | 'needs-admin'+ | 'install-failed'+ | 'mcp-start-failed'+ | 'lookup-failed'function companionCheck(installed: boolean,@@ -74,12 +109,23 @@ function companionCheck(return { ready, outdated, installing, action: outdated ? 'update' : 'install' }}+/** One-click availability: what discovery reports, or npm without administrator rights. */+function oneClickInstallable(+ installable: boolean | undefined,+ npm: boolean,+ admin: boolean+): boolean {+ return installable ?? (npm && !admin)+}+function setupProblem(error: DiscoveryError | null,needsNpm: boolean,- installErrors: readonly DiscoveryError[]+ installErrors: readonly DiscoveryError[],+ needsAdmin = false): SetupProblem | null {if (error === 'npm' || needsNpm) return 'needs-npm'+ if (error === 'npm-admin' || needsAdmin) return 'needs-admin'if (error !== null && installErrors.includes(error)) return 'install-failed'if (error === 'canvas-start') return 'mcp-start-failed'if (error === 'lookup') return 'lookup-failed'@@ -98,33 +144,86 @@ export interface AgentSetupView {manualBridgeCommand: string | null}+/** The agent's install command to run by hand, or null where one click installs its adapter. */+function manualAgentCommand(agent: ACPAgentDef, setup: AgentSetupState): string | null {+ if (!agent.installCommand || setup.detected?.status === 'available') return null+ const admin = setup.adapterNeedsAdmin === true+ const oneClick = setup.supported && setup.npm && !admin && setup.error !== 'install'+ if (oneClick && agent.adapterPackage) return null+ return admin && !detectUserAgent().includes('Windows')+ ? `sudo ${agent.installCommand}`+ : agent.installCommand+}++/** The MCP server's install command to run by hand, or null where one click installs it. */+function manualBridgeCommand(setup: AgentSetupState, bridge: CompanionCheck): string | null {+ if (!setup.supported) return MCP_INSTALL_COMMAND+ const oneClick =+ oneClickInstallable(setup.bridgeInstallable, setup.npm, setup.bridgeNeedsAdmin === true) &&+ setup.error !== 'canvas-install'+ return bridge.ready || oneClick ? null : setup.bridgeCommand+}+export function agentSetupView(agent: ACPAgentDef, setup: AgentSetupState): AgentSetupView {+ const bridgeAdmin = setup.bridgeNeedsAdmin === true+ const adapterAdmin = setup.adapterNeedsAdmin === true+ const bridgeInstallable = oneClickInstallable(setup.bridgeInstallable, setup.npm, bridgeAdmin)const bridge = companionCheck(setup.bridge,setup.bridgeOutdated,setup.installingBridge,- setup.npm+ bridgeInstallable)const status = setup.detected?.status+ const bridgeMissing = setup.detected !== null && !bridge.readyconst needsNpm =- !setup.npm && (status === 'needs-adapter' || (setup.detected !== null && !bridge.ready))- let manualAgentCommand: string | null = null- if (agent.installCommand && status !== 'available') {- const oneClick = setup.supported && setup.npm && setup.error !== 'install'- manualAgentCommand = oneClick && agent.adapterPackage ? null : agent.installCommand- }- let manualBridgeCommand: string | null = null- if (!setup.supported) manualBridgeCommand = MCP_INSTALL_COMMAND- else if (!bridge.ready && (!setup.npm || setup.error === 'canvas-install')) {- manualBridgeCommand = setup.bridgeCommand- }+ !setup.npm &&+ (status === 'needs-adapter' || (bridgeMissing && !bridgeInstallable && !bridgeAdmin))+ const needsAdmin = (status === 'needs-adapter' && adapterAdmin) || (bridgeMissing && bridgeAdmin)return {bridge,- canInstallAdapter: status === 'needs-adapter' && setup.npm,+ canInstallAdapter: status === 'needs-adapter' && setup.npm && !adapterAdmin,busy: setup.installingAgent || setup.installingBridge,- problem: setupProblem(setup.error, needsNpm, ['install', 'canvas-install']),- manualAgentCommand,- manualBridgeCommand+ problem: setupProblem(setup.error, needsNpm, ['install', 'canvas-install'], needsAdmin),+ manualAgentCommand: manualAgentCommand(agent, setup),+ manualBridgeCommand: manualBridgeCommand(setup, bridge)+ }+}++/** The MCP server's setup: the one-click fix, and the command for when one click cannot help. */+export interface MCPServerSetupView {+ bridge: CompanionCheck+ problem: SetupProblem | null+ /** Installs the server by hand, by the person or their agent, when one click cannot. */+ manualCommand: string | null+}++export function mcpServerSetupView(setup: MCPServerSetupState): MCPServerSetupView {+ const admin = setup.bridgeNeedsAdmin === true+ const installable =+ setup.supported && oneClickInstallable(setup.bridgeInstallable, setup.npm, admin)+ const bridge = companionCheck(+ setup.bridge,+ setup.bridgeOutdated,+ setup.installingBridge,+ installable+ )+ const oneClick = installable && setup.error !== 'canvas-install'+ let manualCommand: string | null = null+ if (!setup.supported) manualCommand = MCP_INSTALL_COMMAND+ else if (setup.checked && !bridge.ready && !oneClick) manualCommand = setup.bridgeCommand+ return {+ bridge,+ // Where the app cannot install at all, npm and install problems are not the person's to fix.+ problem: setup.supported+ ? setupProblem(+ setup.error,+ setup.checked && !setup.npm && !bridge.ready && !installable && !admin,+ ['canvas-install'],+ setup.checked && admin && !bridge.ready+ )+ : null,+ manualCommand}}@@ -137,33 +236,62 @@ export interface PiSetupView {manualCommands: string[]}+/** One companion as Pi's setup weighs it: its check and what blocks a one-click install. */+function piCompanion(+ installed: boolean,+ outdated: boolean,+ installing: boolean,+ installable: boolean | undefined,+ npm: boolean,+ needsAdmin: boolean | undefined+) {+ const admin = needsAdmin === true+ const oneClick = oneClickInstallable(installable, npm, admin)+ const check = companionCheck(installed, outdated, installing, oneClick)+ return {+ check,+ /** Missing, and nothing that runs without npm can install it. */+ needsNpm: !check.ready && !oneClick && !admin,+ needsAdmin: !check.ready && admin,+ /** Missing, and only a command run by hand installs it. */+ manual: !check.ready && !oneClick+ }+}+export function piSetupView(setup: PiSetupState): PiSetupView {- const companion = companionCheck(+ const harness = piCompanion(setup.companion,setup.companionOutdated,setup.installingCompanion,- setup.npm+ setup.companionInstallable,+ setup.npm,+ setup.companionNeedsAdmin)- const bridge = companionCheck(+ const server = piCompanion(setup.bridge,setup.bridgeOutdated,setup.installingBridge,- setup.npm+ setup.bridgeInstallable,+ setup.npm,+ setup.bridgeNeedsAdmin)- const missing = !companion.ready || !bridge.ready- const manual = !setup.npm || setup.error === 'harness-install' || setup.error === 'canvas-install'+ const needsAdmin = setup.checked && (harness.needsAdmin || server.needsAdmin)+ const failed = setup.error === 'harness-install' || setup.error === 'canvas-install'+ const manual = harness.manual || server.manual || needsAdmin || failedreturn {- companion,- bridge,+ companion: harness.check,+ bridge: server.check,busy: setup.installingCompanion || setup.installingBridge,- problem: setupProblem(setup.error, setup.checked && !setup.npm && missing, [- 'harness-install',- 'canvas-install'- ]),+ problem: setupProblem(+ setup.error,+ setup.checked && !setup.npm && (harness.needsNpm || server.needsNpm),+ ['harness-install', 'canvas-install'],+ needsAdmin+ ),manualCommands: manual? [- ...(companion.ready ? [] : [setup.companionCommand]),- ...(bridge.ready ? [] : [setup.bridgeCommand])+ ...(harness.check.ready ? [] : [setup.companionCommand]),+ ...(server.check.ready ? [] : [setup.bridgeCommand])]: []}@@ -184,36 +312,40 @@ export function useAgentSetup(function agentSetup(providerID: string): AgentSetupState {const id = agentID(providerID)return {- supported: discovery.supported,- checked: discovery.checked.value,+ ...mcpServerSetup(),scanning: discovery.scanning.value,detected: discovery.agents.value.find((agent) => agent.definition.id === id) ?? null,- bridge: discovery.canvasBridgeAvailable.value,- bridgeOutdated: discovery.canvasBridgeOutdated.value,- bridgeCommand: discovery.canvasBridgeCommand.value,- npm: discovery.npmAvailable.value,- installingAgent: discovery.installing.value === id,- installingBridge: discovery.installing.value === 'canvas',- error: discovery.error.value+ adapterNeedsAdmin: discovery.adapterNeedsAdmin.value,+ installingAgent: discovery.installing.value === id}}function piSetup(providerID: string): PiSetupState | undefined {if (providerID !== 'harness:pi') return undefinedreturn {- supported: discovery.supported,- checked: discovery.checked.value,+ ...mcpServerSetup(),scanning: discovery.scanning.value || readingPi.value,companion: discovery.harnessAvailable.value,companionOutdated: discovery.harnessOutdated.value,companionCommand: discovery.harnessCommand.value,+ companionNeedsAdmin: discovery.harnessNeedsAdmin.value,+ companionInstallable: discovery.harnessInstallable.value,+ installingCompanion: discovery.installing.value === 'harness',+ defaultModel: piDefaultModel.value+ }+ }++ function mcpServerSetup(): MCPServerSetupState {+ return {+ supported: discovery.supported,+ checked: discovery.checked.value,bridge: discovery.canvasBridgeAvailable.value,bridgeOutdated: discovery.canvasBridgeOutdated.value,bridgeCommand: discovery.canvasBridgeCommand.value,npm: discovery.npmAvailable.value,- installingCompanion: discovery.installing.value === 'harness',+ bridgeNeedsAdmin: discovery.canvasBridgeNeedsAdmin.value,+ bridgeInstallable: discovery.canvasBridgeInstallable.value,installingBridge: discovery.installing.value === 'canvas',- defaultModel: piDefaultModel.value,error: discovery.error.value}}@@ -238,6 +370,7 @@ export function useAgentSetup(return {agentSetup,piSetup,+ mcpServerSetup,installAgent,refreshAgents,setupCanvasBridge: () => discovery.setupCanvasBridge()@@ -267,3 +400,26 @@ export function usePiSetup(active: MaybeRefOrGetter<boolean>, setup = useAgentSeinstallBridge: setup.setupCanvasBridge}}++/**+ * The MCP server's setup while `active`, checked each time it becomes active, so Settings → MCP+ * can install or update the server with one click.+ */+export function useMCPServerSetup(+ active: MaybeRefOrGetter<boolean>,+ discovery: AgentDiscovery = agentDiscovery+) {+ const setup = useAgentSetup(discovery)+ watch(+ () => toValue(active),+ (on) => {+ if (on) void discovery.refresh(true)+ },+ { immediate: true }+ )+ return {+ state: computed(() => setup.mcpServerSetup()),+ install: () => discovery.setupCanvasBridge(),+ check: () => discovery.refresh(true)+ }+}diff --git a/src/app/automation/mcp/failure.ts b/src/app/automation/mcp/failure.tsindex 11c1442d3..d82b9e04b 100644--- a/src/app/automation/mcp/failure.ts+++ b/src/app/automation/mcp/failure.ts@@ -1,16 +1,20 @@import { APP_VERSION } from '@/app/runtime/version'/**- * Name of the entry point installed by `@open-pencil/mcp`.+ * The package and the entry point the desktop app starts.*- * Kept here rather than in the spawner so Settings can render the install- * instruction without importing the spawning code.+ * Kept here rather than in the spawner so Settings and setup can name them+ * without importing the spawning code.*/export const MCP_PACKAGE_NAME = '@open-pencil/mcp'+export const MCP_EXECUTABLE = 'openpencil-mcp-http'/** Exact package spec a user should install to match this app. */export const MCP_INSTALL_TARGET = `${MCP_PACKAGE_NAME}@${APP_VERSION}`+/** Installs OpenPencil's MCP server at the version that matches the app. */+export const MCP_INSTALL_COMMAND = `npm i -g ${MCP_INSTALL_TARGET}`+/*** Why the local MCP server is unavailable.*@@ -19,6 +23,7 @@ export const MCP_INSTALL_TARGET = `${MCP_PACKAGE_NAME}@${APP_VERSION}`*/export type MCPFailureCode =| 'not-installed'+ | 'outdated'| 'permission-denied'| 'exited'| 'timeout'@@ -29,13 +34,33 @@ export type MCPFailureCode =export interface MCPFailure {code: MCPFailureCode- /** Technical detail such as captured stderr or an HTTP status. Never translated. */+ /**+ * Technical detail such as captured stderr or an HTTP status, or the running server's version+ * for `outdated`. Never translated.+ */detail?: string}/** Maximum diagnostic detail length retained for display. */export const MCP_FAILURE_DETAIL_LIMIT = 400+/**+ * Reasons a restart fixes. A missing or outdated server is fixed by installing it, which restarts+ * it; a refused command needs the app reinstalled with its permissions.+ */+const RESTART_FIXES: ReadonlySet<MCPFailureCode> = new Set([+ 'exited',+ 'timeout',+ 'rejected',+ 'malformed',+ 'unreachable',+ 'unknown'+])++export function restartFixesMCPFailure(failure: MCPFailure): boolean {+ return RESTART_FIXES.has(failure.code)+}+export function mcpFailure(code: MCPFailureCode, detail?: string): MCPFailure {const trimmed = detail?.trim()return trimmed ? { code, detail: trimmed.slice(0, MCP_FAILURE_DETAIL_LIMIT) } : { code }diff --git a/src/app/automation/mcp/preferences.ts b/src/app/automation/mcp/preferences.tsindex 84126e214..96a30f0d9 100644--- a/src/app/automation/mcp/preferences.ts+++ b/src/app/automation/mcp/preferences.ts@@ -1,14 +1,28 @@import { useLocalStorage } from '@vueuse/core'import { ref } from 'vue'-import type { MCPToolScope, ToolDescriptor } from '@open-pencil/mcp/tools'+import {+ createToolDescriptors,+ type MCPToolScope,+ type ToolDescriptor+} from '@open-pencil/mcp/tools'const DISABLED_TOOLS_STORAGE_KEY = 'open-pencil:mcp:disabled-tools'const ROOT_DIRECTORY_STORAGE_KEY = 'open-pencil:mcp:root-directory'const AUTHENTICATION_ENABLED_STORAGE_KEY = 'open-pencil:mcp:authentication-enabled'const SELECTION_ONLY_STORAGE_KEY = 'open-pencil:mcp:selection-only'-export const configurableMCPTools = ref<ToolDescriptor[]>([])+function configurable(tools: ToolDescriptor[]): ToolDescriptor[] {+ return tools.filter((tool) => tool.availability !== 'eval')+}++const CORE_MCP_TOOLS = configurable(createToolDescriptors(true))++/**+ * The tools the local server offers. Known from Core, so Settings can configure them while no+ * server runs; a running server's own list replaces them.+ */+export const configurableMCPTools = ref<ToolDescriptor[]>(CORE_MCP_TOOLS)export const disabledMCPTools = useLocalStorage<string[]>(DISABLED_TOOLS_STORAGE_KEY, [])export const mcpRootDirectory = useLocalStorage(ROOT_DIRECTORY_STORAGE_KEY, '')@@ -21,5 +35,6 @@ export function mcpScope(): MCPToolScope {}export function setMCPToolDescriptors(tools: ToolDescriptor[]): void {- configurableMCPTools.value = tools.filter((tool) => tool.availability !== 'eval')+ // A stopped server, or one that hides its tools behind authentication, reports none.+ configurableMCPTools.value = tools.length > 0 ? configurable(tools) : CORE_MCP_TOOLS}diff --git a/src/app/automation/mcp/runtime.ts b/src/app/automation/mcp/runtime.tsindex e98a9e634..c6390c036 100644--- a/src/app/automation/mcp/runtime.ts+++ b/src/app/automation/mcp/runtime.ts@@ -206,9 +206,14 @@ export function createMCPRuntimeService(dependencies: MCPRuntimeDependencies) {}}+/** The local server runs with the desktop app, and in development with the dev server. */+export function localMCPAvailable(): boolean {+ return import.meta.env.DEV || isTauri()+}+const appMCPRuntime = createMCPRuntimeService({connect: (getStore, authToken) => connectAutomation(getStore, authToken).disconnect,- canConnect: () => import.meta.env.DEV || isTauri(),+ canConnect: localMCPAvailable,readHealth: readAutomationHealth,setToolDescriptors: setMCPToolDescriptors,spawn: spawnMCPIfNeeded,diff --git a/src/app/automation/mcp/setup-prompt.ts b/src/app/automation/mcp/setup-prompt.tsnew file mode 100644index 000000000..2e0512751--- /dev/null+++ b/src/app/automation/mcp/setup-prompt.ts@@ -0,0 +1,35 @@+import dedent from 'dedent'++import { APP_VERSION } from '@/app/runtime/version'++import { MCP_INSTALL_COMMAND, type MCPFailure } from './failure'++/** Reasons the person can fix by installing the MCP server at this app's version. */+export function needsMCPInstall(failure: MCPFailure): boolean {+ return failure.code === 'not-installed' || failure.code === 'outdated'+}++/**+ * Markdown to paste into the agent the person connects over MCP, asking it to install the+ * server that matches this app when OpenPencil cannot do it with one click. Written for the+ * agent, so it stays in English.+ */+export function mcpServerSetupPrompt(+ failure: MCPFailure,+ installCommand: string = MCP_INSTALL_COMMAND+): string {+ const found =+ failure.code === 'outdated'+ ? `OpenPencil found version ${failure.detail ?? 'an older version'} installed, which does not match the app.`+ : 'OpenPencil could not find the `openpencil-mcp-http` command.'+ return dedent`+ Help me set up OpenPencil's MCP server so you can work on my designs in OpenPencil, an open-source design editor. The server is a separate npm package, kept out of the app to keep its download small, and its version must match the app. ${found}++ Please do this for me:++ 1. Install the version that matches my app: \`${installCommand}\`. If Node.js or npm is missing, tell me how to install it. If npm fails with a permission error (EACCES), set up a global npm folder in my home directory (for example \`npm config set prefix ~/.npm-global\` and add \`~/.npm-global/bin\` to my PATH) and install again; use sudo only if I agree.+ 2. Confirm that \`openpencil-mcp-http --version\` prints ${APP_VERSION}. If the command is not found, check that the global npm or Bun folder is on my PATH and tell me how to add it.++ Then tell me what you did. I will press "Restart MCP server" in OpenPencil's Settings → MCP afterwards.+ `+}diff --git a/src/app/automation/mcp/spawn.ts b/src/app/automation/mcp/spawn.tsindex 17c10f1f3..4272ad999 100644--- a/src/app/automation/mcp/spawn.ts+++ b/src/app/automation/mcp/spawn.ts@@ -20,7 +20,10 @@ import { DEV_MCP_RESTART_PATH, type DevMCPConfiguration } from './dev-control'import {classifySpawnFailure,mcpFailure,+ MCP_EXECUTABLE,+ MCP_INSTALL_COMMAND,MCP_INSTALL_TARGET,+ MCP_PACKAGE_NAME,MCPStartupError,type MCPFailure} from './failure'@@ -34,7 +37,6 @@ import {export interface AutomationHealth {status: 'ok' | 'no_app'version?: string- installCommand?: stringauthRequired?: booleandiscoveryPath?: stringtools?: ToolDescriptor[]@@ -59,7 +61,6 @@ const DEV_AUTOMATION_AUTH_TOKEN =: nullconst noop = () => undefinedconst MAX_STARTUP_STDERR_LENGTH = 8_192-const MCP_EXECUTABLE = 'openpencil-mcp-http'interface MCPLookup {available: boolean@@ -268,22 +269,14 @@ function parseAutomationHealth(value: unknown): AutomationHealth | null {if (!isAutomationHealthRecord(value)) return nullif (value.status !== 'ok' && value.status !== 'no_app') return nullconst version = optionalString(value.version)- const installCommand = optionalString(value.installCommand)const authRequired = optionalBoolean(value.authRequired)const discoveryPath = optionalString(value.discoveryPath)const tools = parseToolDescriptors(value.tools)- if (- version === null ||- installCommand === null ||- authRequired === null ||- discoveryPath === null ||- tools === null- ) {+ if (version === null || authRequired === null || discoveryPath === null || tools === null) {return null}const health: AutomationHealth = { status: value.status }if (version !== undefined) health.version = version- if (installCommand !== undefined) health.installCommand = installCommandif (authRequired !== undefined) health.authRequired = authRequiredif (discoveryPath !== undefined) health.discoveryPath = discoveryPathif (tools !== undefined) health.tools = tools@@ -336,12 +329,13 @@ function assertCompatibleMCPVersion(health: AutomationHealth): void {if (!oursMajorMinor) returnif (runningMajorMinor === oursMajorMinor) returnconst runningVersion = health.version ? `v${health.version}` : 'an older version'- const updateHint = health.installCommand- ? `Run: ${health.installCommand}, then restart OpenPencil.`- : `Update the global @open-pencil/mcp package to v${APP_VERSION} with your package manager, then restart OpenPencil.`- throw new Error(- `OpenPencil desktop v${APP_VERSION} requires @open-pencil/mcp v${oursMajorMinor}.x ` +- `(major.minor compatibility), but the running MCP server is ${runningVersion}. ${updateHint}`+ // The running server's own install command names its own version, so the fix always+ // comes from this app's version.+ throw new MCPStartupError(+ `OpenPencil desktop v${APP_VERSION} requires ${MCP_PACKAGE_NAME} v${oursMajorMinor}.x ` ++ `(major.minor compatibility), but the running MCP server is ${runningVersion}. ` ++ `Run: ${MCP_INSTALL_COMMAND}, then restart the MCP server.`,+ mcpFailure('outdated', health.version))}diff --git a/src/app/shell/menu/schema.ts b/src/app/shell/menu/schema.tsindex 21716756a..643f619fb 100644--- a/src/app/shell/menu/schema.ts+++ b/src/app/shell/menu/schema.ts@@ -61,6 +61,14 @@ export interface AppMenuGroupSchema {items: AppMenuEntry[]}+/** Settings…, where each platform expects it: the macOS application menu, otherwise File. */+const SETTINGS_MENU_ITEM = {+ id: 'settings',+ label: 'Settings…',+ shortcut: 'MOD+,',+ accelerator: 'CmdOrCtrl+,'+} satisfies AppMenuActionItem+export const APP_MENU_SCHEMA = [{label: 'File',@@ -106,7 +114,10 @@ export const APP_MENU_SCHEMA = [},{ type: 'separator' },{ id: 'autosave', label: 'Autosave', checkbox: true },- { id: 'close', label: 'Close Tab', shortcut: 'MOD+W' }+ { id: 'close', label: 'Close Tab', shortcut: 'MOD+W' },+ // Windows, Linux, and the browser menu; macOS shows it in the application menu instead.+ { type: 'separator' },+ { ...SETTINGS_MENU_ITEM, handler: 'shell' }]},{@@ -231,14 +242,6 @@ export const APP_MENU_SCHEMA = [checkbox: true,shortcut: "MOD+SHIFT+'",handler: 'shell'- },- { type: 'separator' },- {- id: 'settings',- label: 'Settings…',- shortcut: 'MOD+,',- accelerator: 'CmdOrCtrl+,',- handler: 'shell'}]},@@ -458,5 +461,6 @@ export const APP_MENU_SCHEMA = [export const APP_MENU_APP_ITEMS = [{ id: 'about', label: 'About OpenPencil' },{ id: 'check-updates', label: 'Check for Updates…' },+ SETTINGS_MENU_ITEM,{ id: 'quit', label: 'Quit OpenPencil', shortcut: 'MOD+Q' }] satisfies AppMenuActionItem[]diff --git a/src/app/tauri/command.ts b/src/app/tauri/command.tsindex f36c1996e..fba95033a 100644--- a/src/app/tauri/command.ts+++ b/src/app/tauri/command.ts@@ -17,7 +17,7 @@* navigator value at runtime, falling back to an empty string in non-browser* contexts (e.g. headless tests) where `navigator` is unavailable.*/-function detectUserAgent(): string {+export function detectUserAgent(): string {const ua = typeof navigator === 'undefined' ? undefined : navigator.userAgentreturn typeof ua === 'string' ? ua : ''}diff --git a/src/components/home/HomeWorkspace.vue b/src/components/home/HomeWorkspace.vueindex 89e8c8fb7..c9b957a92 100644--- a/src/components/home/HomeWorkspace.vue+++ b/src/components/home/HomeWorkspace.vue@@ -18,6 +18,7 @@ import {recentFiles,type RecentDocument} from '@/app/recent-files'+import { useCredentialSettings } from '@/app/settings/credentials/preferences/use'import { openSettingsDialog } from '@/app/settings/dialog'import { openFileFromPath } from '@/app/shell/menu/use'import { createStorageWorkspaceSource } from '@/app/storage/workspace/source'@@ -29,7 +30,7 @@ import IconButton from '@/components/ui/button/IconButton.vue'import SegmentedControl from '@/components/ui/select/SegmentedControl.vue'const emit = defineEmits<{ 'new-document': [] }>()-const { panels, locale, storage, files, common, settings } = useI18n()+const { panels, locale, storage, files, common, settings, credentials } = useI18n()const { isMobile } = useViewportKind()const view = useLocalStorage<'grid' | 'list'>('open-pencil:home-files-view', 'grid')const query = ref('')@@ -66,6 +67,12 @@ const storageWorkspace = useDocumentWorkspace<StorageDocument>({})const storageDocuments = storageWorkspace.documentsconst storageLoading = storageWorkspace.loading+// Paused credential access has its own fix, so the card offers it instead of the raw native error.+const credentialAccess = useCredentialSettings()+async function retryCredentialAccess() {+ await credentialAccess.retry()+ if (!credentialAccess.paused.value) await storageWorkspace.refresh()+}const storageError = computed(() => {const error = storageWorkspace.error.valueif (error == null) return null@@ -293,10 +300,24 @@ function formattedDate(updatedAt: string): string {class="rounded-lg border border-danger/40 px-4 py-6 text-center"role="alert">- <p class="text-xs text-danger">{{ storageError }}</p>- <AppButton variant="outline" class="mt-3" @click="storageWorkspace.refresh">- {{ common.refresh }}- </AppButton>+ <template v-if="credentialAccess.paused.value">+ <p class="text-xs text-danger">{{ credentials.accessPaused }}</p>+ <AppButton+ variant="outline"+ class="mt-3"+ :loading="credentialAccess.busy.value"+ data-test-id="home-storage-retry-access"+ @click="retryCredentialAccess"+ >+ {{ credentials.retryAccess }}+ </AppButton>+ </template>+ <template v-else>+ <p class="text-xs text-danger">{{ storageError }}</p>+ <AppButton variant="outline" class="mt-3" @click="storageWorkspace.refresh">+ {{ common.refresh }}+ </AppButton>+ </template></div><divdiff --git a/src/components/settings/agents/AgentSetup.vue b/src/components/settings/agents/AgentSetup.vueindex 6513b229c..923e0555e 100644--- a/src/components/settings/agents/AgentSetup.vue+++ b/src/components/settings/agents/AgentSetup.vue@@ -54,7 +54,10 @@ function agentState(): string {</script><template>- <p :class="styles.help()">{{ ai.aiSetupAgentDescription({ agent: agent.name }) }}</p>+ <p :class="styles.help()">+ {{ ai.aiSetupAgentDescription({ agent: agent.name }) }}+ <SettingsLink :href="codingAgentGuideURL(agent.id)">{{ common.learnMore }}</SettingsLink>+ </p><template v-if="setup.supported"><p v-if="setup.scanning && !setup.checked" role="status" :class="styles.status()">@@ -113,7 +116,10 @@ function agentState(): string {<p :class="styles.help()">{{ ai.aiSetupAgentPromptHint({ agent: agent.name }) }}</p><div :class="styles.actions()"><AppButton size="xs" variant="outline" @click="copy(prompt)">- <template #leading><icon-lucide-clipboard-copy class="size-3" /></template>+ <template #leading>+ <icon-lucide-check v-if="copied" class="size-3" />+ <icon-lucide-copy v-else class="size-3" />+ </template>{{ copied ? common.copied : ai.aiSetupAgentCopyPrompt }}</AppButton><AppButton@@ -124,6 +130,5 @@ function agentState(): string {>{{ ai.aiSetupAgentCheckAgain }}</AppButton>- <SettingsLink :href="codingAgentGuideURL(agent.id)">{{ ai.aiSetupAgentGuide }}</SettingsLink></div></template>diff --git a/src/components/settings/agents/PiSetup.vue b/src/components/settings/agents/PiSetup.vueindex b67091c02..1e78f3713 100644--- a/src/components/settings/agents/PiSetup.vue+++ b/src/components/settings/agents/PiSetup.vue@@ -9,7 +9,7 @@ import SettingsLink from '@/components/settings/layout/SettingsLink.vue'import AppButton from '@/components/ui/button/AppButton.vue'import AppAlert from '@/components/ui/feedback/AppAlert.vue'import AppCopyField from '@/components/ui/input/AppCopyField.vue'-import { NODE_DOWNLOAD_URL } from '@/constants'+import { NODE_DOWNLOAD_URL, PI_GUIDE_URL } from '@/constants'import theme from '@/theme/settings/agents'import AgentSetupItem from './AgentSetupItem.vue'@@ -41,7 +41,10 @@ function actionLabel(</script><template>- <p :class="styles.help()">{{ ai.aiSetupPiDescription }}</p>+ <p :class="styles.help()">+ {{ ai.aiSetupPiDescription }}+ <SettingsLink :href="PI_GUIDE_URL">{{ common.learnMore }}</SettingsLink>+ </p><p v-if="setup.scanning && !setup.checked" role="status" :class="styles.status()"><icon-lucide-loader-2 :class="styles.spinner()" aria-hidden="true" />diff --git a/src/components/settings/agents/problem.ts b/src/components/settings/agents/problem.tsindex 016022afa..9b296abec 100644--- a/src/components/settings/agents/problem.ts+++ b/src/components/settings/agents/problem.ts@@ -7,6 +7,7 @@ export function useSetupProblemMessage() {const { ai } = useI18n()return (problem: SetupProblem | null): string | null => {if (problem === 'needs-npm') return ai.value.aiSetupAgentNeedsNpm+ if (problem === 'needs-admin') return ai.value.aiSetupAgentNeedsAdminif (problem === 'install-failed') return ai.value.aiSetupAgentInstallFailedif (problem === 'mcp-start-failed') return ai.value.aiSetupAgentMCPStartFailedif (problem === 'lookup-failed') return ai.value.aiSetupAgentLookupFaileddiff --git a/src/components/settings/chat/ChatSettingsSection.vue b/src/components/settings/chat/ChatSettingsSection.vueindex 04ddb018e..7bc893252 100644--- a/src/components/settings/chat/ChatSettingsSection.vue+++ b/src/components/settings/chat/ChatSettingsSection.vue@@ -13,7 +13,7 @@ import AppButton from '@/components/ui/button/AppButton.vue'import PresetNumberField from '@/components/ui/input/PresetNumberField.vue'import AppSelect from '@/components/ui/select/AppSelect.vue'-const { ai, settings } = useI18n()+const { ai, automation, settings } = useI18n()const stepPresets = [25, 50, 100, 200]const limitMessage = computed(() =>ai.value.maxAgentStepsRange({ min: AGENT_STEP_LIMIT_MIN, max: AGENT_STEP_LIMIT_MAX })@@ -72,10 +72,14 @@ const previewOptions = computed(() => [</SettingsRow></SettingsGroup><SettingsGroup>- <SettingsRow :label="settings.toolAccess">- <AppButton size="xs" variant="outline" @click="openToolAccessSettings('ai')">{{- settings.toolAccess- }}</AppButton>+ <SettingsRow :label="settings.toolAccess" :description="automation.aiToolAccessDescription">+ <AppButton+ size="xs"+ variant="outline"+ data-test-id="settings-ai-tool-access"+ @click="openToolAccessSettings('ai')"+ >{{ settings.edit }}</AppButton+ ></SettingsRow></SettingsGroup></SettingsSection>diff --git a/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vue b/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vueindex 127fbd4a1..9b3089879 100644--- a/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vue+++ b/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vue@@ -1,4 +1,5 @@<script setup lang="ts">+import { useClipboard } from '@vueuse/core'import { computed, ref } from 'vue'import { useI18n } from '@open-pencil/vue'@@ -23,6 +24,7 @@ import PresetNumberField from '@/components/ui/input/PresetNumberField.vue'import AppSwitch from '@/components/ui/toggle/AppSwitch.vue'const { common, diagnostics: diagnosticMessages } = useI18n()+const { copy: copyText, copied } = useClipboard({ copiedDuring: 1500 })const clearOpen = ref(false)const {@@ -55,10 +57,8 @@ async function clearDiagnostics() {}async function exportDiagnostics() {- const text = await diagnostics.export(diagnosticsEnvironment())try {- await navigator.clipboard.writeText(text)- toast.info(diagnosticMessages.value.copied)+ await copyText(await diagnostics.export(diagnosticsEnvironment()))} catch {toast.error(diagnosticMessages.value.copyFailed)}@@ -120,8 +120,9 @@ async function exportDiagnostics() {}}</span><div class="flex items-center gap-1.5"><AppButton size="xs" color="neutral" variant="ghost" @click="exportDiagnostics"- ><template #leading><icon-lucide-copy /></template- >{{ diagnosticMessages.copy }}</AppButton+ ><template #leading+ ><icon-lucide-check v-if="copied" /><icon-lucide-copy v-else /></template+ >{{ copied ? common.copied : diagnosticMessages.copy }}</AppButton><AppButtonsize="xs"diff --git a/src/components/settings/layout/SettingsRow.vue b/src/components/settings/layout/SettingsRow.vueindex d50fefd70..167c8b307 100644--- a/src/components/settings/layout/SettingsRow.vue+++ b/src/components/settings/layout/SettingsRow.vue@@ -4,7 +4,7 @@ const { label, description } = defineProps<{ label: string; description?: string<template><div class="flex items-center justify-between gap-4 px-3 py-2.5" data-slot="settings-row">- <div class="min-w-0">+ <div class="min-w-0 flex-1"><p class="text-xs font-medium text-surface">{{ label }}</p><p v-if="description" class="mt-1 text-xs leading-relaxed text-muted">{{ description }}</p><slot name="description" />diff --git a/src/components/settings/mcp/MCPConnectionsSection.vue b/src/components/settings/mcp/MCPConnectionsSection.vueindex a09bfde7e..0e10f7372 100644--- a/src/components/settings/mcp/MCPConnectionsSection.vue+++ b/src/components/settings/mcp/MCPConnectionsSection.vue@@ -8,12 +8,14 @@ import { mcpConnectionSettings } from '@/app/integrations/mcp'import { useMCPConnectionForm } from '@/app/integrations/mcp/settings/form'import { useMCPConnectionSettings } from '@/app/integrations/mcp/settings/use'import { useSettingsFormGuard } from '@/app/settings/navigation/use'+import SettingsLink from '@/components/settings/layout/SettingsLink.vue'import SettingsPage from '@/components/settings/layout/SettingsPage.vue'import SettingsSection from '@/components/settings/layout/SettingsSection.vue'import AppButton from '@/components/ui/button/AppButton.vue'import { AppAlertDialogRoot, AppDialogFooter, AppDialogHeader } from '@/components/ui/dialog'import AppPlaceholder from '@/components/ui/feedback/AppPlaceholder.vue'import AppActionRow from '@/components/ui/list/AppActionRow.vue'+import { MCP_CONNECTIONS_DOCS_URL } from '@/constants'import MCPConnectionEditor from './MCPConnectionEditor.vue'@@ -86,11 +88,16 @@ async function remove() {<slot /><SettingsSection :aria-busy="busy" data-mcp-connections><template #title>{{ automation.connections }}</template>- <template #description>{{ automation.connectionsDescription }}</template>- <AppButton class="self-start" variant="outline" :loading="busy" @click="startAdd">- <template #leading><icon-lucide-plus class="size-3.5" /></template>- {{ automation.addConnection }}- </AppButton>+ <template #description>+ {{ automation.connectionsDescription }}+ <SettingsLink :href="MCP_CONNECTIONS_DOCS_URL">{{ common.learnMore }}</SettingsLink>+ </template>+ <template #actions>+ <AppButton variant="outline" :loading="busy" @click="startAdd">+ <template #leading><icon-lucide-plus class="size-3.5" /></template>+ {{ automation.addConnection }}+ </AppButton>+ </template><div v-if="mcpConnectionSettings.connections.length" class="flex flex-col gap-1.5"><AppActionRowv-for="item in mcpConnectionSettings.connections"@@ -107,7 +114,7 @@ async function remove() {</template></AppActionRow></div>- <AppPlaceholder v-else :label="automation.noConnections" />+ <AppPlaceholder v-else size="compact" :fill="false" :label="automation.noConnections" /></SettingsSection></div></SettingsPage>diff --git a/src/components/settings/mcp/MCPFailureAlert.stories.ts b/src/components/settings/mcp/MCPFailureAlert.stories.tsindex d20602086..65ee85c2a 100644--- a/src/components/settings/mcp/MCPFailureAlert.stories.ts+++ b/src/components/settings/mcp/MCPFailureAlert.stories.ts@@ -1,7 +1,12 @@import type { Meta, StoryObj } from '@storybook/vue3-vite'import { expect, userEvent, within } from 'storybook/test'-import type { MCPFailure, MCPFailureCode } from '@/app/automation/mcp/failure'+import type { MCPServerSetupState } from '@/app/ai/agents/setup'+import {+ MCP_INSTALL_COMMAND,+ type MCPFailure,+ type MCPFailureCode+} from '@/app/automation/mcp/failure'import MCPFailureAlert from './MCPFailureAlert.vue'@@ -13,6 +18,7 @@ const reasons: Record<MCPFailureCode, MCPFailure> = {code: 'not-installed',detail: '/opt/homebrew/bin, /usr/local/bin, /Users/you/.bun/bin'},+ outdated: { code: 'outdated', detail: '0.15.1' },'permission-denied': {code: 'permission-denied',detail: 'shell command openpencil-mcp-http not allowed by ACL'@@ -28,10 +34,22 @@ const reasons: Record<MCPFailureCode, MCPFailure> = {unknown: { code: 'unknown', detail: 'Failed to fetch' }}+/** The desktop app with npm available, so one click installs or updates the server. */+const oneClick: MCPServerSetupState = {+ supported: true,+ checked: true,+ bridge: true,+ bridgeOutdated: true,+ bridgeCommand: MCP_INSTALL_COMMAND,+ npm: true,+ installingBridge: false,+ error: null+}+const meta = {title: 'App/Settings/MCP/Failure Alert',component: MCPFailureAlert,- args: { failure: reasons.timeout, restarting: false, externallyManaged: false },+ args: { failure: reasons.timeout, setup: oneClick, restarting: false },render: (args) => ({components: { MCPFailureAlert },setup: () => ({ args }),@@ -39,22 +57,99 @@ const meta = {<div class="max-w-xl bg-panel p-4 text-surface"><MCPFailureAlert:failure="args.failure"+ :setup="args.setup":restarting="args.restarting"- :externally-managed="args.externallyManaged"/></div>`})-} satisfies Meta<{ failure: MCPFailure; restarting: boolean; externallyManaged: boolean }>+} satisfies Meta<{+ failure: MCPFailure+ setup: MCPServerSetupState+ restarting: boolean+}>export default metatype Story = StoryObj<typeof meta>export const StartupTimeout: Story = {}-export const NotInstalled: Story = { args: { failure: reasons['not-installed'] } }-export const RejectedToken: Story = { args: { failure: reasons.rejected } }+export const NotInstalled: Story = {+ args: {+ failure: reasons['not-installed'],+ setup: { ...oneClick, bridge: false, bridgeOutdated: false }+ }+}++/** An older server with npm available: one click updates it, with no commands to run. */+export const Outdated: Story = {+ args: { failure: reasons.outdated },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement)+ await expect(canvas.getByText(/The installed MCP server is v0\.15\.1/)).toBeVisible()+ await expect(canvas.getByRole('button', { name: 'Update MCP server' })).toBeVisible()+ await expect(canvas.queryByTestId('settings-mcp-install-command')).toBeNull()+ await expect(canvas.queryByRole('button', { name: 'Copy prompt for your agent' })).toBeNull()+ // Updating restarts the server, so Restart is not offered beside it.+ await expect(canvas.queryByRole('button', { name: 'Restart MCP server' })).toBeNull()+ // The running version is already in the guidance, so it is not repeated under Details.+ await expect(canvas.queryByRole('button', { name: 'Details' })).toBeNull()+ }+}++export const Updating: Story = {+ args: { failure: reasons.outdated, setup: { ...oneClick, installingBridge: true } }+}++/** Without npm the app cannot install, so the command and the agent prompt take over. */+export const NeedsNode: Story = {+ args: {+ failure: reasons['not-installed'],+ setup: { ...oneClick, bridge: false, bridgeOutdated: false, npm: false }+ },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement)+ await expect(canvas.queryByRole('button', { name: 'Install MCP server' })).toBeNull()+ await expect(canvas.getByRole('link', { name: 'Node.js' })).toBeVisible()+ await expect(canvas.getByTestId('settings-mcp-install-command')).toBeVisible()+ await expect(canvas.getByRole('button', { name: 'Copy prompt for your agent' })).toBeVisible()+ await expect(canvas.getByRole('button', { name: 'Check again' })).toBeVisible()+ }+}++/** npm keeps global packages in a protected folder, so the app offers the admin command instead. */+export const NeedsAdmin: Story = {+ args: {+ failure: reasons['not-installed'],+ setup: {+ ...oneClick,+ bridge: false,+ bridgeOutdated: false,+ bridgeNeedsAdmin: true,+ bridgeCommand: `sudo ${MCP_INSTALL_COMMAND}`+ }+ },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement)+ await expect(canvas.queryByRole('button', { name: 'Install MCP server' })).toBeNull()+ await expect(canvas.getByText(/needs administrator rights/)).toBeVisible()+ await expect(canvas.getByRole('button', { name: 'Copy prompt for your agent' })).toBeVisible()+ }+}++/** A failed one-click install keeps the retry and adds the command to run by hand. */+export const InstallFailed: Story = {+ args: { failure: reasons.outdated, setup: { ...oneClick, error: 'canvas-install' } }+}++/** A rejected token is fixed by restarting, so the alert offers Restart as its action. */+export const RejectedToken: Story = {+ args: { failure: reasons.rejected },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement)+ await expect(canvas.getByRole('button', { name: 'Restart MCP server' })).toBeVisible()+ }+}+export const Restarting: Story = { args: { failure: reasons.rejected, restarting: true } }export const Unreachable: Story = { args: { failure: reasons.unreachable } }-export const InternallyManaged: Story = { args: { restarting: true } }-export const ExternallyManaged: Story = { args: { externallyManaged: true } }/** Every reason side by side: copy, guidance, and whether detail is offered. */export const AllReasons: Story = {diff --git a/src/components/settings/mcp/MCPFailureAlert.vue b/src/components/settings/mcp/MCPFailureAlert.vueindex 4f20c0365..eff475cc3 100644--- a/src/components/settings/mcp/MCPFailureAlert.vue+++ b/src/components/settings/mcp/MCPFailureAlert.vue@@ -3,40 +3,93 @@ import { useClipboard } from '@vueuse/core'import { compact } from 'es-toolkit/array'import { computed, ref } from 'vue'-import { useAutomationMessages } from '@open-pencil/vue'+import { useAutomationMessages, useI18n } from '@open-pencil/vue'+import { mcpServerSetupView, type MCPServerSetupState } from '@/app/ai/agents/setup'import {- MCP_INSTALL_TARGET,+ restartFixesMCPFailure,type MCPFailure,type MCPFailureCode} from '@/app/automation/mcp/failure'-import { toast } from '@/app/shell/ui'+import { mcpServerSetupPrompt, needsMCPInstall } from '@/app/automation/mcp/setup-prompt'+import { APP_VERSION } from '@/app/runtime/version'+import { useSetupProblemMessage } from '@/components/settings/agents/problem'+import SettingsLink from '@/components/settings/layout/SettingsLink.vue'import AppButton from '@/components/ui/button/AppButton.vue'import AppCollapsible from '@/components/ui/collapsible/AppCollapsible.vue'import AppAlert from '@/components/ui/feedback/AppAlert.vue'+import AppCopyField from '@/components/ui/input/AppCopyField.vue'+import { NODE_DOWNLOAD_URL } from '@/constants'+/** Where one-click installation is unavailable, only the manual fallback applies. */+const MANUAL_SETUP: MCPServerSetupState = {+ supported: false,+ checked: true,+ bridge: false,+ bridgeOutdated: false,+ bridgeCommand: '',+ npm: false,+ installingBridge: false,+ error: null+}++// The alert carries the fix: install or update, or restart where that is what fixes it; the+// section header hides its own Restart while the alert offers one.const {failure,+ setup,restarting = false,externallyManaged = false} = defineProps<{failure: MCPFailure+ /** The MCP server's install state, for one-click installation on the desktop. */+ setup?: MCPServerSetupStaterestarting?: booleanexternallyManaged?: boolean}>()-const emit = defineEmits<{ restart: [] }>()+const emit = defineEmits<{ install: []; restart: []; check: [] }>()+const restartFixes = computed(() => restartFixesMCPFailure(failure))const automation = useAutomationMessages()-const { copy } = useClipboard()+const { ai, common } = useI18n()+const setupProblemMessage = useSetupProblemMessage()+const { copy: copyDetailsText, copied: detailsCopied } = useClipboard({ copiedDuring: 1500 })+const { copy: copyPrompt, copied: promptCopied } = useClipboard({ copiedDuring: 1500 })const detailsOpen = ref(false)+/** One-click install or update first; a command and an agent prompt only where it cannot help. */+const installView = computed(() =>+ needsMCPInstall(failure) ? mcpServerSetupView(setup ?? MANUAL_SETUP) : null+)+const installAction = computed(() => {+ const bridge = installView.value?.bridge+ if (!bridge?.action) return null+ if (bridge.installing) {+ return bridge.action === 'update'+ ? automation.value.mcpUpdating+ : ai.value.aiSetupAgentInstalling+ }+ return bridge.action === 'update'+ ? ai.value.aiSetupAgentUpdateMCP+ : ai.value.aiSetupAgentInstallMCP+})+const problem = computed(() => installView.value?.problem ?? null)+const manualCommand = computed(() => installView.value?.manualCommand ?? null)+/** Translated copy for each reason; the technical detail stays secondary. */const copy$ = computed(() => {const messages = automation.valueconst map: Record<MCPFailureCode, { heading: string; description: string }> = {'not-installed': {heading: messages.mcpFailureNotInstalled,- description: messages.mcpFailureNotInstalledHint({ package: MCP_INSTALL_TARGET })+ description: messages.mcpFailureNotInstalledHint+ },+ outdated: {+ heading: messages.mcpFailureOutdated,+ description: messages.mcpFailureOutdatedHint({+ running: failure.detail ? `v${failure.detail}` : 'an older version',+ version: `v${APP_VERSION}`+ })},'permission-denied': {heading: messages.mcpFailurePermission,@@ -67,7 +120,11 @@ const copy$ = computed(() => {* Reasons whose cause already appears in the guidance, so repeating the same* value under Details would only add noise.*/-const EXPLAINED_REASONS: ReadonlySet<MCPFailureCode> = new Set(['rejected', 'unreachable'])+const EXPLAINED_REASONS: ReadonlySet<MCPFailureCode> = new Set([+ 'outdated',+ 'rejected',+ 'unreachable'+])const detail = computed(() =>EXPLAINED_REASONS.has(failure.code) ? null : failure.detail?.trim() || null@@ -78,10 +135,7 @@ async function copyDetails(): Promise<void> {`code=${failure.code}`,failure.detail ? `detail=${failure.detail}` : null]).join('\n')- // VueUse falls back to a legacy write and never rejects, so awaiting the write- // is what keeps the confirmation honest.- await copy(payload)- toast.info(automation.value.mcpFailureCopied)+ await copyDetailsText(payload)}</script>@@ -92,31 +146,89 @@ async function copyDetails(): Promise<void> {:description="copy$.description"data-test-id="settings-mcp-failure">- <template v-if="detail" #details>- <AppCollapsible- v-model:open="detailsOpen"- :label="automation.mcpFailureDetails"- :ui="{ trigger: 'text-muted hover:text-surface', content: 'mt-1' }"- data-test-id="settings-mcp-failure-details"- >- <pre- class="max-h-40 overflow-auto rounded border border-border bg-input p-2 font-mono text-[11px] whitespace-pre-wrap text-muted"- data-test-id="settings-mcp-failure-detail"- >{{ detail }}</pre>- </AppCollapsible>+ <template v-if="problem || manualCommand || detail" #details>+ <!-- Guidance reads like the description; only the heading carries the error colour. -->+ <div class="flex flex-col gap-2 leading-relaxed text-surface">+ <p v-if="problem" data-test-id="settings-mcp-install-problem">+ {{ setupProblemMessage(problem) }}+ <SettingsLink v-if="problem === 'needs-npm'" :href="NODE_DOWNLOAD_URL"+ >Node.js</SettingsLink+ >+ </p>+ <template v-if="manualCommand">+ <p>{{ automation.mcpInstallByHand }}</p>+ <AppCopyField+ :value="manualCommand"+ :copy-label="common.copy"+ :copied-label="common.copied"+ data-test-id="settings-mcp-install-command"+ />+ </template>+ <AppCollapsible+ v-if="detail"+ v-model:open="detailsOpen"+ :label="automation.mcpFailureDetails"+ :ui="{ trigger: 'text-muted hover:text-surface', content: 'mt-1' }"+ data-test-id="settings-mcp-failure-details"+ >+ <pre+ class="max-h-40 overflow-auto rounded border border-border bg-input p-2 font-mono text-[11px] whitespace-pre-wrap text-muted"+ data-test-id="settings-mcp-failure-detail"+ >{{ detail }}</pre>+ </AppCollapsible>+ </div></template><template #actions>- <AppButton size="xs" variant="outline" @click="copyDetails">{{- automation.mcpFailureCopy- }}</AppButton><AppButton+ v-if="installAction"size="xs"- variant="outline"+ color="primary"+ variant="solid"+ :loading="installView?.bridge.installing"+ data-test-id="settings-mcp-install"+ @click="emit('install')"+ >{{ installAction }}</AppButton+ >+ <AppButton+ v-if="manualCommand"+ size="xs"+ :color="installAction ? 'neutral' : 'primary'"+ :variant="installAction ? 'outline' : 'solid'"+ data-test-id="settings-mcp-copy-agent-prompt"+ @click="copyPrompt(mcpServerSetupPrompt(failure, manualCommand))"+ >+ <template #leading>+ <icon-lucide-check v-if="promptCopied" class="size-3" />+ <icon-lucide-copy v-else class="size-3" />+ </template>+ {{ promptCopied ? common.copied : automation.mcpCopyAgentPrompt }}+ </AppButton>+ <AppButton+ v-if="restartFixes"+ size="xs"+ color="primary"+ variant="solid":disabled="externallyManaged":loading="restarting"+ data-test-id="settings-mcp-restart"@click="emit('restart')">{{ externallyManaged ? automation.externallyManaged : automation.restart }}</AppButton>+ <AppButton+ v-if="problem === 'needs-npm'"+ size="xs"+ variant="outline"+ data-test-id="settings-mcp-check-again"+ @click="emit('check')"+ >{{ ai.aiSetupAgentCheckAgain }}</AppButton+ >+ <AppButton size="xs" variant="outline" @click="copyDetails">+ <template #leading>+ <icon-lucide-check v-if="detailsCopied" class="size-3" />+ <icon-lucide-copy v-else class="size-3" />+ </template>+ {{ detailsCopied ? common.copied : automation.mcpFailureCopy }}+ </AppButton></template></AppAlert></template>diff --git a/src/components/settings/mcp/MCPSettingsPanel.vue b/src/components/settings/mcp/MCPSettingsPanel.vueindex acfd90de6..b9a08e53f 100644--- a/src/components/settings/mcp/MCPSettingsPanel.vue+++ b/src/components/settings/mcp/MCPSettingsPanel.vue@@ -1,29 +1,47 @@<script setup lang="ts">import { computed } from 'vue'-import { useAutomationMessages, useCommonMessages, useSettingsMessages } from '@open-pencil/vue'+import {+ useAIMessages,+ useAutomationMessages,+ useCommonMessages,+ useSettingsMessages+} from '@open-pencil/vue'+import { useMCPServerSetup } from '@/app/ai/agents/setup'+import { restartFixesMCPFailure } from '@/app/automation/mcp/failure'import {mcpAuthenticationEnabled,mcpRootDirectory,mcpSelectionOnly} from '@/app/automation/mcp/preferences'-import { mcpRuntime } from '@/app/automation/mcp/runtime'+import { localMCPAvailable, mcpRuntime } from '@/app/automation/mcp/runtime'import { useMCPSettings } from '@/app/automation/mcp/settings/use'+import { needsMCPInstall } from '@/app/automation/mcp/setup-prompt'import { openToolAccessSettings } from '@/app/automation/tool-access/settings/use'import { isTauri } from '@/app/tauri/env'import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'+import SettingsLink from '@/components/settings/layout/SettingsLink.vue'import SettingsRow from '@/components/settings/layout/SettingsRow.vue'import SettingsSection from '@/components/settings/layout/SettingsSection.vue'import AppButton from '@/components/ui/button/AppButton.vue'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'+import AppStatus from '@/components/ui/feedback/AppStatus.vue'import AppCopyField from '@/components/ui/input/AppCopyField.vue'import AppSwitch from '@/components/ui/toggle/AppSwitch.vue'+import { DESKTOP_DOWNLOAD_URL, MCP_SERVER_DOCS_URL } from '@/constants'import MCPFailureAlert from './MCPFailureAlert.vue'const automation = useAutomationMessages()const settings = useSettingsMessages()const common = useCommonMessages()+const ai = useAIMessages()+const available = localMCPAvailable()+const restarting = computed(() => mcpRuntime.status === 'starting' || mcpRuntime.checking)+const alertRestarts = computed(() =>+ Boolean(mcpRuntime.failure && restartFixesMCPFailure(mcpRuntime.failure))+)const statusMessage = computed(() =>({@@ -34,100 +52,141 @@ const statusMessage = computed(error: automation.value.statusError})[mcpRuntime.status])+const statusTone = computed(+ () =>+ (+ ({+ idle: 'neutral',+ starting: 'pending',+ running: 'success',+ stopped: 'neutral',+ error: 'error'+ }) as const+ )[mcpRuntime.status]+)const { restart, chooseRootDirectory } = useMCPSettings()+// Checked only while the failure is one an install fixes.+const serverSetup = useMCPServerSetup(() =>+ Boolean(mcpRuntime.failure && needsMCPInstall(mcpRuntime.failure))+)</script><template><SettingsSection data-test-id="settings-mcp-automation-panel"><template #title>{{ automation.localServer }}</template>- <template #description>{{ automation.description }}</template>- <SettingsGroup>- <SettingsRow :label="automation.status"- ><span class="text-xs text-surface" role="status">{{ statusMessage }}</span></SettingsRow- >- <div class="px-3 py-2.5">- <p class="mb-1 text-xs font-medium text-surface">{{ automation.address }}</p>- <AppCopyField- look="plain"- :value="mcpRuntime.endpoint"- :copy-label="common.copy"- :copied-label="common.copied"- />- </div>- <SettingsRow v-if="mcpRuntime.version" :label="automation.version"- ><code class="text-xs text-surface">{{ mcpRuntime.version }}</code></SettingsRow- >- <SettingsRow- :label="automation.authentication"- :description="automation.authenticationDescription"- >- <AppSwitch- v-model="mcpAuthenticationEnabled"- :label="automation.authentication"- data-test-id="settings-mcp-authentication"- />- </SettingsRow>- <SettingsRow- :label="automation.selectionScope"- :description="automation.selectionScopeDescription"- >- <AppSwitch- v-model="mcpSelectionOnly"- :label="automation.selectionScope"- data-test-id="settings-mcp-selection-scope"- />- </SettingsRow>- <div class="flex flex-col gap-2 px-3 py-2.5">- <p class="text-xs font-medium text-surface">{{ automation.rootDirectory }}</p>- <p class="break-all font-mono text-xs text-surface">- {{ mcpRootDirectory || automation.rootDirectoryDefault }}- </p>- <p class="text-xs leading-relaxed text-muted">- {{ automation.rootDirectoryDescription }}- </p>- <div v-if="mcpRootDirectory || isTauri()" class="flex flex-wrap gap-2">- <AppButton- v-if="mcpRootDirectory"- size="xs"- variant="outline"- @click="mcpRootDirectory = ''"- >{{ automation.useDefaultRoot }}</AppButton- >- <AppButton- v-if="isTauri()"- size="xs"- variant="outline"- data-test-id="settings-mcp-root-directory"- @click="chooseRootDirectory"- >{{ automation.chooseRootDirectory }}</AppButton- >- </div>- </div>- </SettingsGroup>- <MCPFailureAlert- v-if="mcpRuntime.failure"- :failure="mcpRuntime.failure"- :restarting="mcpRuntime.status === 'starting' || mcpRuntime.checking"- :externally-managed="mcpRuntime.externallyManaged"- @restart="restart"- />- <div>- <AppButton variant="link" @click="openToolAccessSettings('mcp')">{{- settings.toolAccess- }}</AppButton>- </div>- <!-- The failure alert carries its own restart action. -->- <div v-if="!mcpRuntime.failure">+ <template #description>+ {{ automation.description }}+ <SettingsLink :href="MCP_SERVER_DOCS_URL">{{ common.learnMore }}</SettingsLink>+ </template>+ <!-- While the alert offers Restart as its fix, it is the only Restart on the page. -->+ <template v-if="available && !alertRestarts" #actions><AppButton- color="primary"- variant="solid"+ variant="outline":disabled="mcpRuntime.externallyManaged"- :loading="mcpRuntime.status === 'starting' || mcpRuntime.checking"+ :loading="restarting"data-test-id="settings-mcp-restart"@click="restart">{{ mcpRuntime.externallyManaged ? automation.externallyManaged : automation.restart }}</AppButton>- </div>+ </template>+ <AppAlert v-if="!available" :heading="automation.localServerDesktopOnly">+ <template #actions>+ <SettingsLink :href="DESKTOP_DOWNLOAD_URL">{{ ai.aiSetupGetDesktop }}</SettingsLink>+ </template>+ </AppAlert>+ <template v-else>+ <SettingsGroup>+ <SettingsRow :label="automation.status">+ <AppStatus :tone="statusTone">{{ statusMessage }}</AppStatus>+ </SettingsRow>+ <SettingsRow :label="automation.address">+ <!-- Below the label on one line, so a long address truncates instead of overflowing. -->+ <template #description>+ <AppCopyField+ look="plain"+ :value="mcpRuntime.endpoint"+ :copy-label="common.copy"+ :copied-label="common.copied"+ :ui="{ root: 'mt-1', value: 'truncate' }"+ />+ </template>+ </SettingsRow>+ <SettingsRow v-if="mcpRuntime.version" :label="automation.version">+ <code class="text-xs text-surface">{{ mcpRuntime.version }}</code>+ </SettingsRow>+ <SettingsRow+ :label="automation.authentication"+ :description="automation.authenticationDescription"+ >+ <AppSwitch+ v-model="mcpAuthenticationEnabled"+ :label="automation.authentication"+ data-test-id="settings-mcp-authentication"+ />+ </SettingsRow>+ <SettingsRow+ :label="automation.selectionScope"+ :description="automation.selectionScopeDescription"+ >+ <AppSwitch+ v-model="mcpSelectionOnly"+ :label="automation.selectionScope"+ data-test-id="settings-mcp-selection-scope"+ />+ </SettingsRow>+ <SettingsRow :label="automation.rootDirectory">+ <template #description>+ <p class="mt-1 font-mono text-xs break-all text-surface">+ {{ mcpRootDirectory || automation.rootDirectoryDefault }}+ </p>+ <p class="mt-1 text-xs leading-relaxed text-muted">+ {{ automation.rootDirectoryDescription }}+ </p>+ </template>+ <div v-if="mcpRootDirectory || isTauri()" class="flex flex-wrap justify-end gap-2">+ <AppButton+ v-if="mcpRootDirectory"+ size="xs"+ variant="outline"+ @click="mcpRootDirectory = ''"+ >{{ automation.useDefaultRoot }}</AppButton+ >+ <AppButton+ v-if="isTauri()"+ size="xs"+ variant="outline"+ data-test-id="settings-mcp-root-directory"+ @click="chooseRootDirectory"+ >{{ automation.chooseRootDirectory }}</AppButton+ >+ </div>+ </SettingsRow>+ </SettingsGroup>+ <SettingsGroup>+ <SettingsRow+ :label="settings.toolAccess"+ :description="automation.mcpToolAccessDescription"+ >+ <AppButton+ size="xs"+ variant="outline"+ data-test-id="settings-mcp-tool-access"+ @click="openToolAccessSettings('mcp')"+ >{{ settings.edit }}</AppButton+ >+ </SettingsRow>+ </SettingsGroup>+ <MCPFailureAlert+ v-if="mcpRuntime.failure"+ :failure="mcpRuntime.failure"+ :setup="serverSetup.state.value"+ :restarting="restarting"+ :externally-managed="mcpRuntime.externallyManaged"+ @install="serverSetup.install"+ @restart="restart"+ @check="serverSetup.check"+ />+ </template></SettingsSection></template>diff --git a/src/components/settings/mcp/MCPWorkspacePanel.vue b/src/components/settings/mcp/MCPWorkspacePanel.vueindex c3f3691b4..31fb3f2a4 100644--- a/src/components/settings/mcp/MCPWorkspacePanel.vue+++ b/src/components/settings/mcp/MCPWorkspacePanel.vue@@ -1,6 +1,7 @@<script setup lang="ts">import { webmcpMode } from '@/app/automation/webmcp/preferences'import { webmcpRuntime } from '@/app/automation/webmcp/runtime'+import { isTauri } from '@/app/tauri/env'import MCPConnectionsSection from './MCPConnectionsSection.vue'import MCPSettingsPanel from './MCPSettingsPanel.vue'@@ -11,7 +12,8 @@ import WebMCPSettingsPanel from './WebMCPSettingsPanel.vue'<div class="flex min-h-0 min-w-0 flex-1 flex-col" data-test-id="settings-mcp-panel"><MCPConnectionsSection><MCPSettingsPanel />- <WebMCPSettingsPanel v-model="webmcpMode" :state="webmcpRuntime" />+ <!-- WebMCP serves agents built into a browser; the desktop webview has neither the API nor an agent. -->+ <WebMCPSettingsPanel v-if="!isTauri()" v-model="webmcpMode" :state="webmcpRuntime" /></MCPConnectionsSection></div></template>diff --git a/src/components/settings/mcp/WebMCPSettingsPanel.vue b/src/components/settings/mcp/WebMCPSettingsPanel.vueindex 39e22a533..21f27c3de 100644--- a/src/components/settings/mcp/WebMCPSettingsPanel.vue+++ b/src/components/settings/mcp/WebMCPSettingsPanel.vue@@ -1,7 +1,7 @@<script setup lang="ts">import { computed } from 'vue'-import { useAutomationMessages } from '@open-pencil/vue'+import { useAutomationMessages, useCommonMessages } from '@open-pencil/vue'import type { WebMCPMode } from '@/app/automation/webmcp/policy'import type { WebMCPRuntimeState } from '@/app/automation/webmcp/service'@@ -10,11 +10,14 @@ import SettingsLink from '@/components/settings/layout/SettingsLink.vue'import SettingsRow from '@/components/settings/layout/SettingsRow.vue'import SettingsSection from '@/components/settings/layout/SettingsSection.vue'import AppAlert from '@/components/ui/feedback/AppAlert.vue'+import AppStatus from '@/components/ui/feedback/AppStatus.vue'import AppSelect from '@/components/ui/select/AppSelect.vue'+import { WEBMCP_DOCS_URL } from '@/constants'const mode = defineModel<WebMCPMode>({ required: true })const { state } = defineProps<{ state: WebMCPRuntimeState }>()const automation = useAutomationMessages()+const common = useCommonMessages()const options = computed(() => [{ value: 'off' as const, label: automation.value.accessOff },{ value: 'inspect' as const, label: automation.value.accessInspect },@@ -42,6 +45,20 @@ const detail = computed(() => {if (state.status === 'ready') return `${automation.value.tools}: ${state.toolCount}`return undefined})+const statusTone = computed(+ () =>+ (+ ({+ off: 'neutral',+ starting: 'pending',+ ready: 'success',+ unsupported: 'neutral',+ error: 'neutral'+ }) as const+ )[state.status]+)+/** Unsupported or failed WebMCP is a problem to fix, not a status to read. */+const problem = computed(() => state.status === 'unsupported' || state.status === 'error')const status = computed(() =>({@@ -57,25 +74,27 @@ const status = computed(<template><SettingsSection data-slot="webmcp-settings"><template #title>WebMCP</template>- <template #description>{{ automation.webmcpDescription }}</template>+ <template #description>+ {{ automation.webmcpDescription }}+ <SettingsLink :href="WEBMCP_DOCS_URL">{{ common.learnMore }}</SettingsLink>+ </template><SettingsGroup>- <SettingsRow :label="automation.browserAccess">+ <SettingsRow :label="automation.browserAccess" :description="descriptions[mode]"><AppSelect v-model="mode" :options="options" :label="automation.browserAccess" /></SettingsRow>- <p class="px-3 py-2.5 text-xs leading-relaxed text-muted">{{ descriptions[mode] }}</p>+ <SettingsRow+ v-if="!problem && state.status !== 'off'"+ :label="automation.status"+ :description="detail"+ >+ <AppStatus :tone="statusTone">{{ status }}</AppStatus>+ </SettingsRow></SettingsGroup><AppAlert- v-if="state.status === 'unsupported' || state.status === 'error'"+ v-if="problem":tone="tone"- :heading="status"+ :heading="state.status === 'error' ? automation.webmcpFailed : status":description="detail"/>- <div v-else class="text-xs leading-relaxed text-surface" role="status">- <p>{{ status }}</p>- <p v-if="detail" class="mt-1 text-muted">{{ detail }}</p>- </div>- <SettingsLink href="https://openpencil.dev/programmable/mcp-server#webmcp">- {{ automation.webmcpSetup }}- </SettingsLink></SettingsSection></template>diff --git a/src/components/settings/tool-access/ToolAccessSettingsPanel.vue b/src/components/settings/tool-access/ToolAccessSettingsPanel.vueindex 11319382f..b5d0da50e 100644--- a/src/components/settings/tool-access/ToolAccessSettingsPanel.vue+++ b/src/components/settings/tool-access/ToolAccessSettingsPanel.vue@@ -72,7 +72,12 @@ function setExpanded(effect: 'read' | 'write', open: boolean) {target === 'ai' ? automation.aiToolAccessDescription : automation.mcpToolAccessDescription}}</p>- <AppPlaceholder v-if="!hasMatches" :label="automation.noMatchingTools" />+ <AppPlaceholder+ v-if="!hasMatches"+ size="compact"+ :fill="false"+ :label="automation.noMatchingTools"+ /><ToolAccessListv-else:groups="labelledGroups"diff --git a/src/components/ui/feedback/AppStatus.stories.ts b/src/components/ui/feedback/AppStatus.stories.tsnew file mode 100644index 000000000..17b11c962--- /dev/null+++ b/src/components/ui/feedback/AppStatus.stories.ts@@ -0,0 +1,31 @@+import type { Meta, StoryObj } from '@storybook/vue3-vite'++import type { StatusTone } from '@/theme/feedback/status'++import AppStatus from './AppStatus.vue'++const tones: Record<StatusTone, string> = {+ neutral: 'Stopped',+ pending: 'Starting…',+ success: 'Running',+ warning: 'Unreachable',+ error: 'Error'+}++const meta = {+ title: 'Design System/Feedback/Status',+ component: AppStatus,+ render: () => ({+ components: { AppStatus },+ setup: () => ({ tones: Object.entries(tones) }),+ template: `+ <div class="flex flex-col gap-3 bg-panel p-4">+ <AppStatus v-for="[tone, label] in tones" :key="tone" :tone="tone">{{ label }}</AppStatus>+ </div>`+ })+} satisfies Meta<typeof AppStatus>++export default meta+type Story = StoryObj<typeof meta>++export const Tones: Story = {}diff --git a/src/components/ui/feedback/AppStatus.vue b/src/components/ui/feedback/AppStatus.vuenew file mode 100644index 000000000..036ad0263--- /dev/null+++ b/src/components/ui/feedback/AppStatus.vue@@ -0,0 +1,17 @@+<script setup lang="ts">+import { tv } from 'tailwind-variants'+import { computed } from 'vue'++import statusTheme, { type StatusTone } from '@/theme/feedback/status'++/** A state as a coloured dot and its label, announced politely when it changes. */+const { tone = 'neutral' } = defineProps<{ tone?: StatusTone }>()+const styles = computed(() => tv(statusTheme)({ tone }))+</script>++<template>+ <span :class="styles.indicator()" role="status" :data-tone="tone">+ <span :class="styles.dot()" aria-hidden="true" />+ <slot />+ </span>+</template>diff --git a/src/components/ui/input/AppCopyField.vue b/src/components/ui/input/AppCopyField.vueindex 48722e9ef..507fadad1 100644--- a/src/components/ui/input/AppCopyField.vue+++ b/src/components/ui/input/AppCopyField.vue@@ -33,6 +33,10 @@ const cls = computed(() => copyField({ look }))<div data-slot="copy-field" :data-look="look" :class="cls.root({ class: ui?.root })"><code :class="cls.value({ class: ui?.value })">{{ value }}</code><AppButton size="xs" :variant="look === 'plain' ? 'link' : 'ghost'" @click="copy(value)">+ <template #leading>+ <icon-lucide-check v-if="copied" class="size-3" />+ <icon-lucide-copy v-else class="size-3" />+ </template>{{ copied ? copiedLabel : copyLabel }}</AppButton></div>diff --git a/src/constants.ts b/src/constants.tsindex 1a2d0f4e5..04fd57bda 100644--- a/src/constants.ts+++ b/src/constants.ts@@ -82,6 +82,17 @@ export const WEB_APP_ORIGIN = 'https://app.openpencil.dev'export const DESKTOP_DOWNLOAD_URL = 'https://github.com/open-pencil/open-pencil/releases/latest'export const NODE_DOWNLOAD_URL = 'https://nodejs.org/en/download'+/**+ * Published guides. Settings links each integration section to its guide with one "Learn more"+ * at the end of the section description; alerts link only to the fix, never to docs.+ */+const DOCS_ORIGIN = 'https://openpencil.dev'+export const MCP_SERVER_DOCS_URL = `${DOCS_ORIGIN}/programmable/mcp-server`+export const WEBMCP_DOCS_URL = `${MCP_SERVER_DOCS_URL}#webmcp`+export const MCP_CONNECTIONS_DOCS_URL = `${DOCS_ORIGIN}/programmable/ai-chat#external-mcp-connections`+export const CODING_AGENTS_GUIDE_URL = `${DOCS_ORIGIN}/programmable/coding-agents`+export const PI_GUIDE_URL = `${CODING_AGENTS_GUIDE_URL}#pi`+/** The published release page, with its full notes, for a desktop version. */export function releaseNotesURL(version: string): string {return `https://github.com/open-pencil/open-pencil/releases/tag/v${version}`diff --git a/src/theme/feedback/status.ts b/src/theme/feedback/status.tsindex bfc559868..33d191184 100644--- a/src/theme/feedback/status.ts+++ b/src/theme/feedback/status.ts@@ -1,13 +1,33 @@const statusTheme = {slots: {- text: 'text-[10px] leading-snug'+ text: 'text-[10px] leading-snug',+ /** A state as a coloured dot and its label, as room status shows it. */+ indicator: 'inline-flex items-center gap-1.5 text-xs',+ dot: 'size-2 shrink-0 rounded-full'},variants: {tone: {- neutral: { text: 'text-muted' },- success: { text: 'text-[var(--color-success)]' },- warning: { text: 'text-[var(--color-warning-text)]' },- error: { text: 'text-[var(--color-error)]' }+ neutral: { text: 'text-muted', indicator: 'text-surface', dot: 'bg-muted' },+ pending: {+ text: 'text-muted',+ indicator: 'text-surface',+ dot: 'animate-pulse bg-muted motion-reduce:animate-none'+ },+ success: {+ text: 'text-[var(--color-success)]',+ indicator: 'text-surface',+ dot: 'bg-success'+ },+ warning: {+ text: 'text-[var(--color-warning-text)]',+ indicator: 'text-warning-text',+ dot: 'bg-warning-text'+ },+ error: {+ text: 'text-[var(--color-error)]',+ indicator: 'text-error',+ dot: 'bg-error'+ }}},defaultVariants: {@@ -16,4 +36,5 @@ const statusTheme = {}export type StatusTheme = typeof statusTheme+export type StatusTone = keyof typeof statusTheme.variants.toneexport default statusThemediff --git a/tests/app/ai/agents/companions.test.ts b/tests/app/ai/agents/companions.test.tsindex 3f8c9f454..c53270111 100644--- a/tests/app/ai/agents/companions.test.ts+++ b/tests/app/ai/agents/companions.test.ts@@ -1,6 +1,10 @@import { describe, expect, test } from 'bun:test'-import { globalInstallCommand, isOutdatedCompanion } from '@/app/ai/agents/companions'+import {+ companionPackageManager,+ globalInstallCommand,+ isOutdatedCompanion+} from '@/app/ai/agents/companions'describe('isOutdatedCompanion', () => {test('requires the app’s major and minor version', () => {@@ -14,17 +18,24 @@ describe('isOutdatedCompanion', () => {})})+describe('companionPackageManager', () => {+ test('recognises a companion Bun installed on any platform', () => {+ expect(companionPackageManager('/Users/me/.bun/bin/x')).toBe('bun')+ expect(companionPackageManager('C:\\Users\\me\\.bun\\bin\\x.exe')).toBe('bun')+ expect(companionPackageManager('/usr/local/bin/x')).toBe('npm')+ expect(companionPackageManager(null)).toBe('npm')+ })+})+describe('globalInstallCommand', () => {- test('uses the package manager that installed the program', () => {- expect(globalInstallCommand('@open-pencil/[email protected]', '/Users/me/.bun/bin/x')).toBe(- 'bun add -g @open-pencil/[email protected]'- )- expect(globalInstallCommand('@open-pencil/[email protected]', 'C:\\Users\\me\\.bun\\bin\\x.exe')).toBe(- 'bun add -g @open-pencil/[email protected]'- )- expect(globalInstallCommand('@open-pencil/[email protected]', '/usr/local/bin/x')).toBe(- 'npm i -g @open-pencil/[email protected]'+ test('names the package manager, and sudo only where npm needs administrator rights', () => {+ const target = '@open-pencil/[email protected]'+ expect(globalInstallCommand(target, 'bun', { admin: true })).toBe(`bun add -g ${target}`)+ expect(globalInstallCommand(target, 'npm')).toBe(`npm i -g ${target}`)+ expect(globalInstallCommand(target, 'npm', { admin: true })).toBe(`sudo npm i -g ${target}`)+ // Windows has no sudo, and its default npm folder belongs to the user.+ expect(globalInstallCommand(target, 'npm', { admin: true, windows: true })).toBe(+ `npm i -g ${target}`)- expect(globalInstallCommand('@open-pencil/[email protected]')).toBe('npm i -g @open-pencil/[email protected]')})})diff --git a/tests/app/ai/agents/discovery.test.ts b/tests/app/ai/agents/discovery.test.tsindex 5782ee93d..fa67ac104 100644--- a/tests/app/ai/agents/discovery.test.ts+++ b/tests/app/ai/agents/discovery.test.ts@@ -53,6 +53,73 @@ describe('local agent discovery', () => {expect(discovery.error.value).toBeNull()})+ test('updates a server installed with Bun through Bun, even without npm', async () => {+ let version = '0.15.1'+ const installBridge = mock(async () => {+ version = '0.0.0-test'+ })+ const discovery = createAgentDiscovery({+ enabled: true,+ lookup: async () => ({+ searchPath: '/home/test/.bun/bin',+ versions: { '@open-pencil/mcp': version },+ executables: {+ bun: '/home/test/.bun/bin/bun',+ 'openpencil-mcp-http': '/home/test/.bun/bin/openpencil-mcp-http'+ }+ }),+ install: async () => undefined,+ installBridge,+ restartBridge: async () => undefined+ })+ await discovery.refresh()+ expect(discovery.canvasBridgeOutdated.value).toBe(true)+ await discovery.setupCanvasBridge()+ // npm would install beside the Bun copy, which stays first on PATH.+ expect(installBridge).toHaveBeenCalledWith('/home/test/.bun/bin', 'bun')+ expect(discovery.error.value).toBeNull()+ })++ test('installs a new server with Bun when npm would need administrator rights', async () => {+ const installBridge = mock(async () => undefined)+ const discovery = createAgentDiscovery({+ enabled: true,+ lookup: async () => ({+ ...lookup('npm', 'bun'),+ npmGlobalWritable: false+ }),+ install: async () => undefined,+ installBridge,+ restartBridge: async () => undefined+ })+ await discovery.refresh()+ expect(discovery.canvasBridgeNeedsAdmin.value).toBe(false)+ await discovery.setupCanvasBridge()+ expect(installBridge).toHaveBeenCalledWith('/test/bin', 'bun')+ })++ test('never runs an npm install that needs administrator rights', async () => {+ const installBridge = mock(async () => undefined)+ const install = mock(async () => undefined)+ const discovery = createAgentDiscovery({+ enabled: true,+ lookup: async () => ({ ...lookup('npm', 'claude'), npmGlobalWritable: false }),+ install,+ installBridge,+ restartBridge: async () => undefined+ })+ await discovery.refresh()+ expect(discovery.canvasBridgeNeedsAdmin.value).toBe(true)+ // Outside Windows the command an administrator runs goes through sudo.+ expect(discovery.canvasBridgeCommand.value).toStartWith('sudo npm i -g @open-pencil/mcp@')+ await discovery.setupCanvasBridge()+ expect(installBridge).not.toHaveBeenCalled()+ expect(discovery.error.value).toBe('npm-admin')+ await discovery.install('claude-code')+ expect(install).not.toHaveBeenCalled()+ expect(discovery.error.value).toBe('npm-admin')+ })+test('retries bridge startup without reinstalling a successfully installed companion', async () => {const installBridge = mock(async () => undefined)const restartBridge = mock(async (): Promise<void> => {@@ -206,7 +273,7 @@ describe('Harness companion setup', () => {await discovery.refresh()expect(discovery.harnessAvailable.value).toBe(false)await discovery.setupHarness()- expect(installHarness).toHaveBeenCalledWith('/test/bin')+ expect(installHarness).toHaveBeenCalledWith('/test/bin', 'npm')expect(discovery.harnessAvailable.value).toBe(true)expect(discovery.error.value).toBeNull()})@@ -233,7 +300,7 @@ describe('Harness companion setup', () => {expect(discovery.error.value).toBeNull()})- test('reports an update that left the old MCP server first on the path', async () => {+ test('never updates a Bun copy through npm, which would leave it first on the path', async () => {const installBridge = mock(async () => undefined)const restartBridge = mock(async () => undefined)const discovery = createAgentDiscovery({@@ -248,9 +315,11 @@ describe('Harness companion setup', () => {restartBridge})await discovery.refresh()+ // The app cannot find Bun, but the person's terminal may; the command keeps Bun.expect(discovery.canvasBridgeCommand.value).toStartWith('bun add -g @open-pencil/mcp@')+ expect(discovery.canvasBridgeInstallable.value).toBe(false)await discovery.setupCanvasBridge()- expect(installBridge).toHaveBeenCalledTimes(1)+ expect(installBridge).not.toHaveBeenCalled()expect(restartBridge).not.toHaveBeenCalled()expect(discovery.error.value).toBe('canvas-install')})diff --git a/tests/app/ai/agents/setup.test.ts b/tests/app/ai/agents/setup.test.tsindex bc9f74a70..b33939dac 100644--- a/tests/app/ai/agents/setup.test.ts+++ b/tests/app/ai/agents/setup.test.ts@@ -8,12 +8,16 @@ import { createAgentDiscovery, type DetectedAgent } from '@/app/ai/agents/discovimport type { AgentLookup } from '@/app/ai/agents/native'import {agentSetupView,+ mcpServerSetupView,piSetupView,useAgentSetup,+ useMCPServerSetup,usePiSetup,type AgentSetupState,+ type MCPServerSetupState,type PiSetupState} from '@/app/ai/agents/setup'+import { MCP_INSTALL_COMMAND } from '@/app/automation/mcp/failure'function lookup(...commands: string[]): AgentLookup {return {@@ -216,3 +220,104 @@ describe('usePiSetup', () => {).toBeUndefined()})})++function mcpServerState(overrides: Partial<MCPServerSetupState> = {}): MCPServerSetupState {+ return {+ supported: true,+ checked: true,+ bridge: false,+ bridgeOutdated: false,+ bridgeCommand: 'bun add -g @open-pencil/[email protected]',+ npm: true,+ installingBridge: false,+ error: null,+ ...overrides+ }+}++describe('mcpServerSetupView', () => {+ test('installs or updates the MCP server with one click when npm is available', () => {+ const missing = mcpServerSetupView(mcpServerState())+ expect(missing.bridge.action).toBe('install')+ expect(missing.manualCommand).toBeNull()+ expect(missing.problem).toBeNull()+ const outdated = mcpServerState({ bridge: true, bridgeOutdated: true })+ expect(mcpServerSetupView(outdated).bridge.action).toBe('update')+ })++ test('falls back to the command by hand without npm, after a check', () => {+ expect(mcpServerSetupView(mcpServerState({ npm: false, checked: false })).manualCommand).toBe(+ null+ )+ const view = mcpServerSetupView(mcpServerState({ npm: false }))+ expect(view.bridge.action).toBeNull()+ expect(view.problem).toBe('needs-npm')+ expect(view.manualCommand).toBe('bun add -g @open-pencil/[email protected]')+ })++ test('keeps the retry and adds the command by hand after a failed installation', () => {+ const view = mcpServerSetupView(mcpServerState({ error: 'canvas-install' }))+ expect(view.bridge.action).toBe('install')+ expect(view.problem).toBe('install-failed')+ expect(view.manualCommand).not.toBeNull()+ })++ test('offers the update one click can make with Bun, even without npm', () => {+ const view = mcpServerSetupView(+ mcpServerState({ bridge: true, bridgeOutdated: true, npm: false, bridgeInstallable: true })+ )+ expect(view.bridge.action).toBe('update')+ expect(view.problem).toBeNull()+ expect(view.manualCommand).toBeNull()+ })++ test('asks for administrator rights instead of a one-click install npm cannot finish', () => {+ const view = mcpServerSetupView(+ mcpServerState({ bridgeNeedsAdmin: true, bridgeCommand: 'sudo npm i -g x' })+ )+ expect(view.bridge.action).toBeNull()+ expect(view.problem).toBe('needs-admin')+ expect(view.manualCommand).toBe('sudo npm i -g x')+ })++ test('gives only the command where the app cannot install', () => {+ const view = mcpServerSetupView(mcpServerState({ supported: false }))+ expect(view.bridge.action).toBeNull()+ expect(view.manualCommand).toBe(MCP_INSTALL_COMMAND)+ // Nothing to install with, so no npm problem to report.+ expect(view.problem).toBeNull()+ })+})++describe('useMCPServerSetup', () => {+ test('checks while active, then installs and restarts the server with one click', async () => {+ let installed = false+ const installBridge = mock(async () => {+ installed = true+ })+ const restartBridge = mock(async () => undefined)+ const discovery = createAgentDiscovery({+ enabled: true,+ lookup: async (): Promise<AgentLookup> => ({+ ...lookup('npm', ...(installed ? ['openpencil-mcp-http'] : [])),+ versions: installed ? { '@open-pencil/mcp': '0.0.0-test' } : {}+ }),+ install: async () => undefined,+ installBridge,+ restartBridge+ })+ const active = ref(false)+ const server = useMCPServerSetup(active, discovery)+ expect(server.state.value.checked).toBe(false)++ active.value = true+ await nextTick()+ await discovery.refresh()+ expect(mcpServerSetupView(server.state.value).bridge.action).toBe('install')++ await server.install()+ expect(installBridge).toHaveBeenCalledTimes(1)+ expect(restartBridge).toHaveBeenCalledTimes(1)+ expect(mcpServerSetupView(server.state.value).bridge.ready).toBe(true)+ })+})diff --git a/tests/app/automation/mcp/failure.test.ts b/tests/app/automation/mcp/failure.test.tsnew file mode 100644index 000000000..bc93ef03b--- /dev/null+++ b/tests/app/automation/mcp/failure.test.ts@@ -0,0 +1,21 @@+import { describe, expect, test } from 'bun:test'++import { restartFixesMCPFailure, type MCPFailureCode } from '@/app/automation/mcp/failure'++describe('restartFixesMCPFailure', () => {+ test.each<[MCPFailureCode, boolean]>([+ ['rejected', true],+ ['timeout', true],+ ['exited', true],+ ['malformed', true],+ ['unreachable', true],+ ['unknown', true],+ // Installing or updating fixes these, and restarts the server itself.+ ['not-installed', false],+ ['outdated', false],+ // The system refuses the command; restarting would fail the same way.+ ['permission-denied', false]+ ])('%s → %p', (code, fixes) => {+ expect(restartFixesMCPFailure({ code })).toBe(fixes)+ })+})diff --git a/tests/app/automation/mcp/setup-prompt.test.ts b/tests/app/automation/mcp/setup-prompt.test.tsnew file mode 100644index 000000000..30fcc2b88--- /dev/null+++ b/tests/app/automation/mcp/setup-prompt.test.ts@@ -0,0 +1,33 @@+import { describe, expect, test } from 'bun:test'++import { mcpServerSetupPrompt, needsMCPInstall } from '@/app/automation/mcp/setup-prompt'++describe('MCP server setup prompt', () => {+ test('offers the prompt only for reasons an install fixes', () => {+ expect(needsMCPInstall({ code: 'not-installed' })).toBe(true)+ expect(needsMCPInstall({ code: 'outdated', detail: '0.15.1' })).toBe(true)+ expect(needsMCPInstall({ code: 'timeout' })).toBe(false)+ })++ test('asks the agent to install and verify the version that matches the app', () => {+ const prompt = mcpServerSetupPrompt({ code: 'outdated', detail: '0.15.1' })+ expect(prompt).toContain('`npm i -g @open-pencil/[email protected]`')+ expect(prompt).toContain('`openpencil-mcp-http --version` prints 0.0.0-test')+ expect(prompt).toContain('found version 0.15.1 installed')+ expect(prompt).toContain('to keep its download small')+ })++ test('uses the command for the package manager that installed the server', () => {+ const prompt = mcpServerSetupPrompt(+ { code: 'outdated', detail: '0.15.1' },+ 'bun add -g @open-pencil/[email protected]'+ )+ expect(prompt).toContain('`bun add -g @open-pencil/[email protected]`')+ })++ test('explains a missing command when nothing is installed', () => {+ expect(mcpServerSetupPrompt({ code: 'not-installed' })).toContain(+ 'could not find the `openpencil-mcp-http` command'+ )+ })+})diff --git a/tests/e2e/native/mcp.spec.ts b/tests/e2e/native/mcp.spec.tsindex 800f4a9a0..24a43bdb8 100644--- a/tests/e2e/native/mcp.spec.ts+++ b/tests/e2e/native/mcp.spec.ts@@ -73,21 +73,10 @@ function mcpFailureDetail(): Promise<string | null> {})}-/**- * Restart is offered by the healthy-state button and by the failure alert, so- * click whichever one is currently rendered.- */+/** Restart lives in the Local server section header, whether or not the server failed. */function clickRestart(): Promise<void> {return browser.execute(() => {- const panel = document.querySelector<HTMLElement>(- '[data-test-id="settings-mcp-automation-panel"]'- )- for (const button of panel?.querySelectorAll<HTMLButtonElement>('button') ?? []) {- if (button.textContent?.includes('MCP server') && button.offsetParent !== null) {- button.click()- return- }- }+ document.querySelector<HTMLButtonElement>('[data-test-id="settings-mcp-restart"]')?.click()})}diff --git a/tests/e2e/settings/credentials.spec.ts b/tests/e2e/settings/credentials.spec.tsindex 20bb3f23f..671fade95 100644--- a/tests/e2e/settings/credentials.spec.ts+++ b/tests/e2e/settings/credentials.spec.ts@@ -133,7 +133,7 @@ test('MCP automation settings filter and persist tool availability', async ({ paawait expect(authentication).toHaveAttribute('data-state', 'unchecked')await authentication.click()- await page.getByRole('button', { name: 'Tool access', exact: true }).click()+ await page.getByTestId('settings-mcp-tool-access').click()const search = page.getByRole('searchbox', { name: 'Search tools' })await search.fill('create_shape')await expect(search).toHaveValue('create_shape')@@ -146,7 +146,7 @@ test('MCP automation settings filter and persist tool availability', async ({ paawait canvas.waitForInit()await page.getByTestId('app-settings-trigger').click()await page.getByTestId('settings-section-mcp').click()- await page.getByRole('button', { name: 'Tool access', exact: true }).click()+ await page.getByTestId('settings-mcp-tool-access').click()await expect(createShape).toHaveAttribute('data-state', 'unchecked')await page.getByRole('button', { name: 'Restore defaults' }).click()diff --git a/tests/e2e/settings/diagnostics.spec.ts b/tests/e2e/settings/diagnostics.spec.tsindex 1d2462271..61a4360db 100644--- a/tests/e2e/settings/diagnostics.spec.ts+++ b/tests/e2e/settings/diagnostics.spec.ts@@ -35,7 +35,7 @@ test('Settings exports correlated chat telemetry without conversation content',await page.getByTestId('app-settings-trigger').click()await page.getByTestId('settings-section-diagnostics').click()await page.getByRole('button', { name: 'Copy diagnostics', exact: true }).click()- await expect(page.getByText('Diagnostics copied to clipboard.', { exact: true })).toBeVisible()+ await expect(page.getByRole('button', { name: 'Copied', exact: true })).toBeVisible()const text = await page.evaluate(() => navigator.clipboard.readText())const { environment, events } = v.parse(ReportJSON, text)expect(environment).toMatchObject({ app: expect.any(String), shell: 'browser' })@@ -133,7 +133,7 @@ test('uncaught errors are listed with their stack and can be filtered and copiedawait page.getByRole('button', { name: 'Copy diagnostics', exact: true }).click()// The clipboard outlives the test's page, so read it only once this copy has finished.- await expect(page.getByText('Diagnostics copied to clipboard.', { exact: true })).toBeVisible()+ await expect(page.getByRole('button', { name: 'Copied', exact: true })).toBeVisible()const report = v.parse(ReportJSON, await page.evaluate(() => navigator.clipboard.readText()))const runtime = report.events.find((event) => event.name === 'runtime.error')expect(runtime?.attributes).toMatchObject({ source: 'window', errorName: 'TypeError' })diff --git a/tests/e2e/settings/mcp-failure.spec.ts b/tests/e2e/settings/mcp-failure.spec.tsindex 9ad3b22d8..0a1afd7de 100644--- a/tests/e2e/settings/mcp-failure.spec.ts+++ b/tests/e2e/settings/mcp-failure.spec.ts@@ -53,7 +53,7 @@ test('technical details stay collapsed inside the alert and can be copied', asynawait expect(page.getByTestId('settings-mcp-failure-detail')).toBeVisible()await page.getByRole('button', { name: 'Copy details' }).click()- await expect(page.getByText('Diagnostic details copied.', { exact: true })).toBeVisible()+ await expect(page.getByRole('button', { name: 'Copied', exact: true })).toBeVisible()const clipboard = await page.evaluate(() => navigator.clipboard.readText())expect(clipboard).toMatch(/code=(unreachable|timeout)/)})diff --git a/tests/e2e/settings/mcp.spec.ts b/tests/e2e/settings/mcp.spec.tsindex 99ec077c4..0f93730de 100644--- a/tests/e2e/settings/mcp.spec.ts+++ b/tests/e2e/settings/mcp.spec.ts@@ -25,7 +25,7 @@ for (const viewport of [await page.keyboard.press(process.platform === 'darwin' ? 'Meta+,' : 'Control+,')await selectMCPSection(page, viewport.width < 640)await expect(page.getByRole('heading', { name: 'Local server', exact: true })).toBeVisible()- await page.getByRole('button', { name: 'Tool access', exact: true }).click()+ await page.getByTestId('settings-mcp-tool-access').click()const search = page.getByRole('searchbox', { name: 'Search tools' })await search.fill('no-such-mcp-tool')await expect(page.getByText('No tools match your search.', { exact: true })).toBeVisible()diff --git a/tests/engine/app/shell/menu/schema.test.ts b/tests/engine/app/shell/menu/schema.test.tsindex 7b0e7580a..9674172ef 100644--- a/tests/engine/app/shell/menu/schema.test.ts+++ b/tests/engine/app/shell/menu/schema.test.ts@@ -51,14 +51,14 @@ describe('APP_MENU_SCHEMA', () => {expect(shellEntries.map((entry) => ('type' in entry ? '' : entry.id))).toEqual(['open-storage-workspace','open-tour',+ 'settings','view-design-issues','theme-light','theme-dark','theme-auto','snap-geometry','snap-objects',- 'snap-pixel-grid',- 'settings'+ 'snap-pixel-grid'])})diff --git a/tests/engine/tauri/command.test.ts b/tests/engine/tauri/command.test.tsindex 2b0f0cef5..43e3dfdae 100644--- a/tests/engine/tauri/command.test.ts+++ b/tests/engine/tauri/command.test.ts@@ -5,7 +5,7 @@ import * as v from 'valibot'import { ACP_AGENTS } from '@open-pencil/core/constants'-import { npmInstallArgs } from '@/app/ai/agents/native'+import { bunInstallArgs, npmInstallArgs } from '@/app/ai/agents/native'import { HARNESS_PACKAGE } from '@/app/ai/harness/companion'import { MCP_PACKAGE_NAME } from '@/app/automation/mcp/failure'import { resolvePlatformCommand } from '@/app/tauri/command'@@ -113,7 +113,12 @@ describe('shell scope', () => {...ACP_AGENTS.map((agent): [string, string[]] => [agent.command, agent.args]),['openpencil-mcp-http', []],['openpencil-harness', []],- ...installs.map((target): [string, string[]] => ['npm', npmInstallArgs(target)])+ ...installs.map((target): [string, string[]] => ['npm', npmInstallArgs(target)]),+ // Bun updates the companions it installed; agent adapters always come from npm.+ ...[+ `${MCP_PACKAGE_NAME}@${rootPackage.version}`,+ `${HARNESS_PACKAGE}@${rootPackage.version}`+ ].map((target): [string, string[]] => ['bun', bunInstallArgs(target)])]for (const userAgent of [WINDOWS_UA, MAC_UA]) {@@ -167,6 +172,24 @@ describe('shell scope', () => {}})+ test('lets Bun install only the OpenPencil companions', () => {+ for (const userAgent of [WINDOWS_UA, MAC_UA]) {+ const allowed = resolvePlatformCommand(+ 'bun',+ bunInstallArgs('@open-pencil/[email protected]'),+ userAgent+ )+ const entry = spawnScope().find((candidate) => candidate.name === allowed.command)+ expect(allowedArgs(entry?.args, allowed.args)).toEqual(allowed.args)+ const adapter = resolvePlatformCommand(+ 'bun',+ bunInstallArgs('@agentclientprotocol/claude-agent-acp'),+ userAgent+ )+ expect(allowedArgs(entry?.args, adapter.args)).not.toEqual(adapter.args)+ }+ })+test('lets no program take arbitrary arguments', () => {expect(spawnScope().filter((entry) => entry.args === true)).toEqual([])})diff --git a/tests/engine/tauri/mcp-spawn.test.ts b/tests/engine/tauri/mcp-spawn.test.tsindex e0e6495ba..66c99851e 100644--- a/tests/engine/tauri/mcp-spawn.test.ts+++ b/tests/engine/tauri/mcp-spawn.test.ts@@ -158,6 +158,38 @@ describe('Tauri MCP spawning', () => {})})+ test('reports an older running server as outdated with the install command for this app', async () => {+ installTauriMockWindow()+ Object.assign(globalThis.window, { location: { origin: 'tauri://localhost' } })+ Object.defineProperty(globalThis, 'navigator', {+ configurable: true,+ value: { platform: 'MacIntel', userAgent: 'Macintosh' }+ })++ vi.spyOn(globalThis, 'fetch').mockImplementation(+ fetchStub(async () =>+ Response.json({+ status: 'ok',+ version: '0.15.1',+ installCommand: 'npm i -g @open-pencil/[email protected]'+ })+ )+ )+ await mockTauriIPC((cmd) => {+ if (cmd === 'plugin:path|resolve_directory') return '/mock/home'+ if (cmd === 'plugin:fs|exists') return true+ return null+ })++ expect(await spawnMCPIfNeeded()).toBeNull()+ expect(getAutomationStartupFailure()).toEqual({ code: 'outdated', detail: '0.15.1' })+ // The old server names its own version; the fix must name this app's.+ const error = await getAutomationAuthToken().catch((reason: unknown) => reason)+ expect(error).toBeInstanceOf(Error)+ expect(String(error)).toContain('npm i -g @open-pencil/[email protected]')+ expect(String(error)).not.toContain('@open-pencil/[email protected]')+ })+test('spawns MCP server with shell plugin when health check is missing', async () => {installTauriMockWindow()Object.assign(globalThis.window, { location: { origin: 'tauri://localhost' } })diff --git a/tools/checks/i18n/mixed-script-baseline.txt b/tools/checks/i18n/mixed-script-baseline.txtindex 0651fe24b..034e568ff 100644--- a/tools/checks/i18n/mixed-script-baseline.txt+++ b/tools/checks/i18n/mixed-script-baseline.txt@@ -7,6 +7,7 @@ ja:ai.aiSetupAgentMCPja:ai.aiSetupAgentMCPInstallja:ai.aiSetupAgentMCPStartFailedja:ai.aiSetupAgentNeedsAdapter+ja:ai.aiSetupAgentNeedsAdminja:ai.aiSetupAgentNeedsNpmja:ai.aiSetupAgentPromptHintja:ai.aiSetupConnectTitle@@ -87,11 +88,13 @@ ja:automation.descriptionja:automation.editConnectionja:automation.enableConnectionja:automation.localMCP+ja:automation.localServerDesktopOnlyja:automation.mcpFailureExitedja:automation.mcpFailureMalformed-ja:automation.mcpFailureMalformedHintja:automation.mcpFailureNotInstalledja:automation.mcpFailureNotInstalledHint+ja:automation.mcpFailureOutdated+ja:automation.mcpFailureOutdatedHintja:automation.mcpFailurePermissionja:automation.mcpFailurePermissionHintja:automation.mcpFailureRejected@@ -109,7 +112,7 @@ ja:automation.serverURLHintja:automation.toolAccessDescriptionja:automation.toolsRestartNoticeja:automation.webmcpDescription-ja:automation.webmcpSetup+ja:automation.webmcpFailedja:automation.webmcpUnsupportedja:code.copyJSXReferenceja:code.editorHTMLCSSLabel@@ -204,6 +207,7 @@ zh-cn:ai.aiSetupAgentMCPzh-cn:ai.aiSetupAgentMCPInstallzh-cn:ai.aiSetupAgentMCPStartFailedzh-cn:ai.aiSetupAgentNeedsAdapter+zh-cn:ai.aiSetupAgentNeedsAdminzh-cn:ai.aiSetupAgentNeedsNpmzh-cn:ai.aiSetupAgentPromptHintzh-cn:ai.aiSetupConnectTitle@@ -286,11 +290,13 @@ zh-cn:automation.descriptionzh-cn:automation.editConnectionzh-cn:automation.enableConnectionzh-cn:automation.localMCP+zh-cn:automation.localServerDesktopOnlyzh-cn:automation.mcpFailureExitedzh-cn:automation.mcpFailureMalformed-zh-cn:automation.mcpFailureMalformedHintzh-cn:automation.mcpFailureNotInstalledzh-cn:automation.mcpFailureNotInstalledHint+zh-cn:automation.mcpFailureOutdated+zh-cn:automation.mcpFailureOutdatedHintzh-cn:automation.mcpFailurePermissionzh-cn:automation.mcpFailurePermissionHintzh-cn:automation.mcpFailureRejected@@ -308,7 +314,7 @@ zh-cn:automation.serverURLHintzh-cn:automation.toolAccessDescriptionzh-cn:automation.toolsRestartNoticezh-cn:automation.webmcpDescription-zh-cn:automation.webmcpSetup+zh-cn:automation.webmcpFailedzh-cn:automation.webmcpUnsupportedzh-cn:code.copyJSXReferencezh-cn:code.editorHTMLCSSLabel