app-server: accept command permission profiles

This commit is contained in:
Michael Bolin
2026-04-21 17:09:36 -07:00
parent 2086a54768
commit 65b71f79de
10 changed files with 532 additions and 16 deletions
@@ -18,6 +18,7 @@ impl From<v1::ExecOneOffCommandParams> for v2::CommandExecParams {
env: None,
size: None,
sandbox_policy: value.sandbox_policy.map(std::convert::Into::into),
permission_profile: None,
}
}
}
@@ -3003,9 +3003,16 @@ pub struct CommandExecParams {
/// Optional sandbox policy for this command.
///
/// Uses the same shape as thread/turn execution sandbox configuration and
/// defaults to the user's configured policy when omitted.
/// defaults to the user's configured policy when omitted. Cannot be
/// combined with `permissionProfile`.
#[ts(optional = nullable)]
pub sandbox_policy: Option<SandboxPolicy>,
/// Optional full permissions profile for this command.
///
/// Defaults to the user's configured permissions when omitted. Cannot be
/// combined with `sandboxPolicy`.
#[ts(optional = nullable)]
pub permission_profile: Option<PermissionProfile>,
}
/// Final buffered result for `command/exec`.
@@ -7998,6 +8005,7 @@ mod tests {
env: None,
size: None,
sandbox_policy: None,
permission_profile: None,
}
);
}
@@ -8018,6 +8026,7 @@ mod tests {
env: None,
size: None,
sandbox_policy: None,
permission_profile: None,
};
let value = serde_json::to_value(&params).expect("serialize command/exec params");
@@ -8032,6 +8041,7 @@ mod tests {
"env": null,
"size": null,
"sandboxPolicy": null,
"permissionProfile": null,
"outputBytesCap": null,
})
);
@@ -8057,6 +8067,7 @@ mod tests {
env: None,
size: None,
sandbox_policy: None,
permission_profile: None,
};
let value = serde_json::to_value(&params).expect("serialize command/exec params");
@@ -8073,6 +8084,7 @@ mod tests {
"env": null,
"size": null,
"sandboxPolicy": null,
"permissionProfile": null,
})
);
@@ -8101,6 +8113,7 @@ mod tests {
])),
size: None,
sandbox_policy: None,
permission_profile: None,
};
let value = serde_json::to_value(&params).expect("serialize command/exec params");
@@ -8119,6 +8132,7 @@ mod tests {
},
"size": null,
"sandboxPolicy": null,
"permissionProfile": null,
})
);
@@ -8188,6 +8202,7 @@ mod tests {
cols: 120,
}),
sandbox_policy: None,
permission_profile: None,
};
let value = serde_json::to_value(&params).expect("serialize command/exec params");
@@ -8206,6 +8221,7 @@ mod tests {
"cols": 120,
},
"sandboxPolicy": null,
"permissionProfile": null,
})
);