(&self, options: serde_json::Value)
| 3708 | /// Run a bounded JavaScript script through the embedded QuickJS `program` tool. |
| 3709 | #[napi(ts_args_type = "options: ProgramScriptOptions")] |
| 3710 | pub async fn program(&self, options: serde_json::Value) -> napi::Result<ToolResult> { |
| 3711 | let args = normalize_program_script_options(options)?; |
| 3712 | let session = self.inner.clone(); |
| 3713 | let result = get_runtime() |
| 3714 | .spawn(async move { session.tool("program", args).await }) |
| 3715 | .await |
| 3716 | .map_err(|e| napi::Error::from_reason(format!("Task join error: {e}")))? |
| 3717 | .map_err(|e| napi::Error::from_reason(format!("Program execution failed: {e}")))?; |
| 3718 | Ok(tool_result_from_core(result)) |
| 3719 | } |
| 3720 | |
| 3721 | /// Read a file from the workspace. |
| 3722 | #[napi] |
no test coverage detected