Skip to content

Commit 451c098

Browse files
author
Star Lord
committed
Merge main and preserve member dialog outside-click dismissal
Both branches deduplicated opposite copies of dismissOnOutsideClick. Retain one in the merged tree, matching main. Signed-off-by: Star Lord <b89298dbe87c6b3fd8a425b535d9d161f23c88d555a47925ae0b04dfe02b201e@buzz.block.builderlab.xyz>
2 parents 3d949e3 + 55f96c2 commit 451c098

32 files changed

Lines changed: 2215 additions & 71 deletions

‎Cargo.lock‎

Lines changed: 16 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎crates/agent-controller/Cargo.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_Securit
3535

3636
[target.'cfg(any(target_os = "windows", target_os = "linux"))'.dependencies]
3737
buzz-credential-store = { path = "../credential-store" }
38+
39+
[target.'cfg(target_os = "macos")'.dev-dependencies]
40+
tungstenite = { version = "0.29", default-features = false, features = ["handshake"] }

‎crates/agent-controller/src/lib.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ mod profile;
1818
mod restart;
1919
mod runtime;
2020
mod secret;
21+
pub mod security;
2122
mod store;
2223
mod supervisor;
2324
pub use supervisor::dispatch as dispatch_agent_supervisor;

‎crates/agent-controller/src/restart.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ pub(crate) fn spawn_config(agent: &Agent) -> Value {
8282
"env": env,
8383
"effort": crate::agent_defaults::effort(agent),
8484
"session_policy": agent.session_policy.unwrap_or_default(),
85+
"launch_protection": agent.extra.get("launchProtection"),
8586
})
8687
}
8788

‎crates/agent-controller/src/runtime.rs‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,12 @@ pub struct GooseModelContext {
390390
pub struct Controller {
391391
pub(crate) store: Store,
392392
credentials: Arc<dyn Credentials>,
393-
bundle: Result<RuntimeBundle>,
393+
pub(crate) bundle: Result<RuntimeBundle>,
394394
running: BTreeMap<String, Running>,
395395
errors: BTreeMap<String, String>,
396-
ownership_root: PathBuf,
396+
pub(crate) ownership_root: PathBuf,
397+
pub(crate) protection_paths: Result<Vec<PathBuf>>,
398+
pub(crate) security_providers: BTreeMap<String, crate::security::Provider>,
397399
}
398400
impl Controller {
399401
pub fn new(
@@ -409,6 +411,8 @@ impl Controller {
409411
running: BTreeMap::new(),
410412
errors: BTreeMap::new(),
411413
ownership_root,
414+
security_providers: BTreeMap::new(),
415+
protection_paths: Ok(Vec::new()),
412416
}
413417
}
414418
pub fn snapshot(&mut self) -> Result<ControlSnapshot> {
@@ -902,6 +906,8 @@ impl Controller {
902906
.prefix("agent-")
903907
.tempdir_in(&runs)
904908
.map_err(|_| "Could not create private runtime directory")?;
909+
let scratch = temporary.path().join("tmp");
910+
crate::connection::private_directory(&scratch)?;
905911
let mut command = if let Some(preflight) = preflight {
906912
bundle.command_checked(&agent, key, &crate::build_defaults(), Some(preflight))?
907913
} else {
@@ -915,24 +921,27 @@ impl Controller {
915921
// may redirect credentials/temp signing material outside this app profile.
916922
command
917923
.env("BUZZ_AGENT_CONFIG_DIR", config)
918-
.env("TMPDIR", temporary.path())
919-
.env("TMP", temporary.path())
920-
.env("TEMP", temporary.path());
924+
.env("TMPDIR", &scratch)
925+
.env("TMP", &scratch)
926+
.env("TEMP", &scratch);
921927
if let Some(settings) = &settings {
922928
command
923929
.env("DATABRICKS_HOST", &settings.host)
924930
.env("DATABRICKS_MODEL_FILTER", &settings.filter)
925931
.env_remove("DATABRICKS_TOKEN");
926932
}
933+
let control = self.wrap_protected_worker(&agent, &mut command)?;
927934
// Disarm app-side deletion before a child can use this directory. The
928935
// supervisor deletes it only after confirmed whole-session teardown.
929936
let log_path = crate::logs::path(config, &agent.id)?;
930937
let temporary = temporary.keep();
938+
let control = control.map(tempfile::TempDir::keep);
931939
let process = Supervised::spawn(
932940
&command,
933941
&self.ownership_root,
934942
&agent.id,
935943
&temporary,
944+
control.as_deref(),
936945
&log_path,
937946
)?;
938947
self.running.insert(

0 commit comments

Comments
 (0)