use crate::policy::sandbox_types::Cap;
#[derive(Debug)]
#[allow(dead_code)]
pub(crate) struct BlockedPath {
pub path: String,
pub suggested_dir: String,
pub current_caps: Cap,
}
pub(crate) fn build_fs_hint(blocked: &[BlockedPath]) -> String {
let mut lines =
vec!["SANDBOX_FS_HINT: Command failed — sandbox is blocking filesystem access.".into()];
for bp in blocked {
lines.push(format!(
"To allow: clash sandbox add-rule --name <SANDBOX> --path \"{}\" --allow \"read + write + create\"",
bp.suggested_dir
));
}
lines.push("Do NOT retry — it will fail again until the policy is updated.".into());
lines.join("\n")
}