mirror of
https://github.com/block/buzz.git
synced 2026-10-28 21:11:48 +00:00
fix(desktop): repair native configuration integration compilation
Carry the identical producer-owned compiler repair without rewriting the published validation head. Preserve capture, preflight and admission semantics. CI run34144148717 diagnosed these errors; native validation follows on the successor head. Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use nostr::{Keys, ToBech32};
|
||||
use tauri::{AppHandle, State};
|
||||
use tauri::{AppHandle, Manager, State};
|
||||
|
||||
use super::managed_agent_definition::validate_create_definition;
|
||||
|
||||
@@ -352,7 +352,7 @@ where
|
||||
crate::managed_agents::runtime_configurations::check_selection(
|
||||
record,
|
||||
Some(&launch_owner),
|
||||
launch_relay.as_str(),
|
||||
workspace_relay_url.as_str(),
|
||||
configuration.as_ref(),
|
||||
)?;
|
||||
}
|
||||
|
||||
@@ -110,8 +110,8 @@ pub use runtime::*;
|
||||
pub use runtime_commands::*;
|
||||
pub use runtime_types::*;
|
||||
pub(crate) use session_policy::{
|
||||
acp_session_policy, apply_app_acp_session_policy_env, insert_acp_session_policy_env,
|
||||
AcpSessionPolicy, ManagedAgentExperimentState, ACP_SESSION_POLICY_ENV_VAR,
|
||||
acp_session_policy, insert_acp_session_policy_env, AcpSessionPolicy,
|
||||
ManagedAgentExperimentState, ACP_SESSION_POLICY_ENV_VAR,
|
||||
};
|
||||
pub use storage::*;
|
||||
pub use teams::*;
|
||||
|
||||
@@ -3,8 +3,6 @@ use std::{
|
||||
sync::atomic::{AtomicBool, Ordering},
|
||||
};
|
||||
|
||||
use tauri::{AppHandle, Manager};
|
||||
|
||||
use crate::app_state::AppState;
|
||||
|
||||
pub(crate) const ACP_SESSION_POLICY_ENV_VAR: &str = "BUZZ_ACP_SESSION_POLICY";
|
||||
@@ -69,25 +67,6 @@ pub(crate) fn acp_session_policy(state: &AppState) -> AcpSessionPolicy {
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn apply_acp_session_policy_env(
|
||||
command: &mut std::process::Command,
|
||||
policy: AcpSessionPolicy,
|
||||
) {
|
||||
command.env(ACP_SESSION_POLICY_ENV_VAR, policy.as_str());
|
||||
}
|
||||
|
||||
/// Resolve the effective policy, apply it to `command`, and return it so the
|
||||
/// caller can stamp the same value onto the spawn snapshot (env and badge can
|
||||
/// never disagree about what the child launched with).
|
||||
pub(crate) fn apply_app_acp_session_policy_env<R: tauri::Runtime>(
|
||||
app: &AppHandle<R>,
|
||||
command: &mut std::process::Command,
|
||||
) -> AcpSessionPolicy {
|
||||
let policy = acp_session_policy(app.state::<AppState>().inner());
|
||||
apply_acp_session_policy_env(command, policy);
|
||||
policy
|
||||
}
|
||||
|
||||
pub(crate) fn insert_acp_session_policy_env(
|
||||
policy_env: &mut BTreeMap<String, String>,
|
||||
policy: AcpSessionPolicy,
|
||||
@@ -133,7 +112,9 @@ mod tests {
|
||||
let mut command = std::process::Command::new("true");
|
||||
command.env(ACP_SESSION_POLICY_ENV_VAR, "ambient");
|
||||
|
||||
apply_acp_session_policy_env(&mut command, AcpSessionPolicy::Thread);
|
||||
let mut prepared_env = BTreeMap::new();
|
||||
insert_acp_session_policy_env(&mut prepared_env, AcpSessionPolicy::Thread);
|
||||
command.envs(&prepared_env);
|
||||
|
||||
assert_eq!(command_policy(&command), Some("thread"));
|
||||
}
|
||||
|
||||
@@ -82,7 +82,11 @@ fn is_safe_id_char(c: char) -> bool {
|
||||
c.is_ascii_alphanumeric() || c == '-' || c == '_'
|
||||
}
|
||||
|
||||
pub fn managed_agent_log_path(app: &AppHandle, pubkey: &str) -> Result<PathBuf, String> {
|
||||
/// Legacy per-agent log path, also available to isolated runtime fixtures.
|
||||
pub fn managed_agent_log_path<R: tauri::Runtime>(
|
||||
app: &AppHandle<R>,
|
||||
pubkey: &str,
|
||||
) -> Result<PathBuf, String> {
|
||||
Ok(managed_agents_logs_dir(app)?.join(format!("{pubkey}.log")))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user