diff --git a/crates/agent/src/config.rs b/crates/agent/src/config.rs index 83edec9fc..aa2225949 100644 --- a/crates/agent/src/config.rs +++ b/crates/agent/src/config.rs @@ -91,7 +91,8 @@ pub enum Permission { /// waits for the person's Allow. #[default] AskFiles, - /// Everything runs at once. The automation roots still confine file access. + /// Everything runs at once. File access is confined only when the app was started with + /// automation roots; a window opened normally has none. Auto, } diff --git a/crates/agent/src/session.rs b/crates/agent/src/session.rs index 8d6860d73..30019c840 100644 --- a/crates/agent/src/session.rs +++ b/crates/agent/src/session.rs @@ -702,8 +702,11 @@ fn command_reason(cmd: &str) -> Option { if cmd.starts_with("collab.") { return Some("reaches a collaboration server".into()); } - if cmd.starts_with("plugin.") || cmd.starts_with("library.") { - return Some("installs or reaches a plugin or library server".into()); + if ["plugin.", "plugins.", "library.", "libraries."].iter().any(|p| cmd.starts_with(p)) { + return Some("installs or runs a plugin, or reaches a library server".into()); + } + if cmd == "pref.publishServer" { + return Some("changes where shared files are sent".into()); } if cmd.starts_with("font.download") { return Some("downloads a font".into()); @@ -770,6 +773,9 @@ mod tests { assert!(approval("run_command", &json!({"command": "file.save"})).is_some()); assert!(approval("run_command", &json!({"command": "collab.host"})).is_some()); assert!(approval("save_file", &json!({})).is_some()); + for cmd in ["plugins.runLast", "libraries.publish", "pref.publishServer"] { + assert!(approval("run_command", &json!({"command": cmd})).is_some(), "{cmd}"); + } assert!(approval("screenshot", &json!({})).is_none()); // Pages and the canvas are the agent's to read and change. for cmd in diff --git a/docs/harness.md b/docs/harness.md index 291012030..534509a24 100644 --- a/docs/harness.md +++ b/docs/harness.md @@ -205,7 +205,7 @@ images; Anthropic: `tool_result` blocks, images inside them). Two permission modes, toggled in the composer: -| Mode | Canvas edits | Files, network, plugins, fonts | +| Mode | Canvas edits | Files, network, plugins, fonts, the share server | |---|---|---| | **Ask** (default) | run at once | ask: a card names the tool and why | | **Auto** | run at once | run at once | diff --git a/xtask/src/layers.rs b/xtask/src/layers.rs index 3a83de328..0dc2e89d0 100644 --- a/xtask/src/layers.rs +++ b/xtask/src/layers.rs @@ -74,5 +74,12 @@ pub fn check(root: &std::path::Path) -> bool { fn same_layer_ok(from: &str, to: &str) -> bool { // Within L0: color uses geom types; within L2: text/layout/pathops/collab are independent; // within L6 the MCP server joins live sessions through collab-net. - matches!((from, to), ("figcraft-color", "figcraft-geom") | ("figcraft-render", "figcraft-format") | ("figcraft-mcp", "figcraft-collab-net") | ("figcraft-agent", "figcraft-mcp") | ("figcraft-ui-egui", "figcraft-agent")) + matches!( + (from, to), + ("figcraft-color", "figcraft-geom") + | ("figcraft-render", "figcraft-format") + | ("figcraft-mcp", "figcraft-collab-net") + | ("figcraft-agent", "figcraft-mcp") + | ("figcraft-ui-egui", "figcraft-agent") + ) }