feat(resource): add grant-checked fs resource operations

This commit is contained in:
Marqdo Agent committed 2026-11-21 08:20:31 +08:00
1 parent cd90f059b4
commit fbe36bcc43
16 files changed
+812 -31

No files matched your search

+17
View File
@@ -903,6 +903,23 @@ impl<'a> Interpreter<'a> {
})
}
/// Execute one non-streaming resource operation.
pub(crate) fn resource_request(
&mut self,
operation: &str,
args: Vec<Value>,
module: &ModuleId,
span: Option<Span>,
) -> Result<Value, RuntimeError> {
let context = ExecutionContext::new(module.to_string(), span);
self.host
.resource_request(operation, args, &context)
.map_err(|mut error| {
error.mark_callsite();
error
})
}
/// Close a resource stream.
pub(crate) fn resource_close(
&mut self,