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

Method ls

sdk/node/src/lib.rs:3746–3754  ·  view source on GitHub ↗
(&self, path: Option<String>)

Source from the content-addressed store, hash-verified

3744 /// List a directory in the workspace.
3745 #[napi]
3746 pub async fn ls(&self, path: Option<String>) -> napi::Result<ToolResult> {
3747 let session = self.inner.clone();
3748 let result = get_runtime()
3749 .spawn(async move { session.ls(path.as_deref()).await })
3750 .await
3751 .map_err(|e| napi::Error::from_reason(format!("Task join error: {e}")))?
3752 .map_err(|e| napi::Error::from_reason(format!("{e}")))?;
3753 Ok(tool_result_from_core(result))
3754 }
3755
3756 /// Edit a file by replacing text in the workspace.
3757 #[napi]

Callers 2

test.mjsFile · 0.45

Calls 4

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

Tested by

no test coverage detected