MCPcopy Index your code
hub / github.com/AI45Lab/Code / program

Method program

sdk/node/src/lib.rs:3710–3719  ·  view source on GitHub ↗
(&self, options: serde_json::Value)

Source from the content-addressed store, hash-verified

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]

Calls 6

tool_result_from_coreFunction · 0.85
get_runtimeFunction · 0.70
cloneMethod · 0.45
spawnMethod · 0.45
toolMethod · 0.45

Tested by

no test coverage detected