fix(host,cli): enforce console capability and label call --json output

- host: `打印` checks the console capability at the execution point (pure and
  project modes grant it, but the boundary is now real instead of decorative).
- cli: `marqdo call --json` reports "command":"call" instead of "run".
This commit is contained in:
cflmy committed 2026-11-20 10:56:26 +08:00
1 parent 2f1b10d0ee
commit fae0cd4b18
2 files changed
+11 -3

No files matched your search

+7
View File
@@ -254,6 +254,13 @@ impl StdHost {
args: Vec<Value>,
ctx: &ExecutionContext,
) -> Result<Value, RuntimeError> {
if !self.capabilities.console {
return Err(RuntimeError::new(
ErrorCategory::PermissionDenied,
ctx.span,
"program output (console) capability was not granted",
));
}
if args.len() != 1 {
return Err(arity(ctx.span, "打印", 1, args.len()));
}