(&self)
| 3562 | /// Return the currently running operation, or null when idle. |
| 3563 | #[napi(js_name = "currentRun")] |
| 3564 | pub async fn current_run(&self) -> napi::Result<serde_json::Value> { |
| 3565 | let session = self.inner.clone(); |
| 3566 | let snapshot = get_runtime() |
| 3567 | .spawn(async move { |
| 3568 | match session.current_run().await { |
| 3569 | Some(run) => run.snapshot().await, |
| 3570 | None => None, |
| 3571 | } |
| 3572 | }) |
| 3573 | .await |
| 3574 | .map_err(|e| napi::Error::from_reason(format!("Task join error: {e}")))?; |
| 3575 | serde_json::to_value(snapshot) |
| 3576 | .map_err(|e| napi::Error::from_reason(format!("Serialization error: {e}"))) |
| 3577 | } |
| 3578 | |
| 3579 | /// Return active tool calls observed for the currently running operation. |
| 3580 | #[napi(js_name = "activeTools")] |
nothing calls this directly
no test coverage detected