feat(sandbox): 在有界后台工作线程中登记原生实例

This commit is contained in:
2026-09-09 01:30:57 +08:00
parent 96778c02f3
commit 8936974059
6 changed files with 844 additions and 0 deletions
@@ -44,6 +44,13 @@ fn bounded(value: &Value, bytes: usize, schema: bool) -> Result<()> {
}
Ok(())
}
pub(crate) fn argument_bounds(value: &Value) -> Result<()> {
bounded(value, 256 * 1024, false)?;
if !value.is_object() {
return Err(HostError::new("EXTENSION_MCP_ARGUMENTS_INVALID"));
}
Ok(())
}
fn compile(schema: &Value) -> Result<jsonschema::Validator> {
bounded(schema, 64 * 1024, true)?;
if !schema.is_object()