(&self, path: String, content: String)
| 3732 | /// Write a file in the workspace. |
| 3733 | #[napi] |
| 3734 | pub async fn write_file(&self, path: String, content: String) -> napi::Result<ToolResult> { |
| 3735 | let session = self.inner.clone(); |
| 3736 | let result = get_runtime() |
| 3737 | .spawn(async move { session.write_file(&path, &content).await }) |
| 3738 | .await |
| 3739 | .map_err(|e| napi::Error::from_reason(format!("Task join error: {e}")))? |
| 3740 | .map_err(|e| napi::Error::from_reason(format!("{e}")))?; |
| 3741 | Ok(tool_result_from_core(result)) |
| 3742 | } |
| 3743 | |
| 3744 | /// List a directory in the workspace. |
| 3745 | #[napi] |
nothing calls this directly
no test coverage detected