feat(sandbox): 添加明确的标准输入输出通道与有界帧传输

This commit is contained in:
2026-09-09 00:26:06 +08:00
parent 0a347bee6d
commit 237ab0f952
9 changed files with 409 additions and 8 deletions
@@ -50,6 +50,30 @@ impl PreparedLaunch {
lease: self.lease,
})
}
pub fn create_suspended_with_stdio<'a>(
self,
profile: &'a crate::extension_container::Profile,
entry: &'a BoundEntry<'a>,
) -> Result<(LeasedSuspended<'a>, crate::extension_stdio::HostIo)> {
self.lease.check()?;
if self.path != entry.path()
|| self.entry != entry.relative_name()
|| self.tree != entry.tree_sha256()
{
return Err(HostError::new("EXTENSION_ENTRY_PERMIT_MISMATCH"));
}
let (process, io) = crate::extension_process::Suspended::create_bound_with_stdio(
profile, entry, self.data,
)?;
self.lease.check()?;
Ok((
LeasedSuspended {
process,
lease: self.lease,
},
io,
))
}
}
impl<'a> LeasedSuspended<'a> {
/// # Safety