MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / complete_sandbox_names

Function complete_sandbox_names

crates/openshell-cli/src/completers.rs:33–54  ·  view source on GitHub ↗

Complete sandbox names by querying the active gateway.

(_prefix: &OsStr)

Source from the content-addressed store, hash-verified

31
32/// Complete sandbox names by querying the active gateway.
33pub fn complete_sandbox_names(_prefix: &OsStr) -> Vec<CompletionCandidate> {
34 blocking_complete(async {
35 let (endpoint, gateway_name) = resolve_active_gateway()?;
36 let mut client = completion_grpc_client(&endpoint, &gateway_name).await?;
37 let response = client
38 .list_sandboxes(ListSandboxesRequest {
39 limit: 200,
40 offset: 0,
41 label_selector: String::new(),
42 })
43 .await
44 .ok()?;
45 Some(
46 response
47 .into_inner()
48 .sandboxes
49 .into_iter()
50 .map(|s| CompletionCandidate::new(s.object_name()))
51 .collect(),
52 )
53 })
54}
55
56/// Complete provider names by querying the active gateway.
57pub fn complete_provider_names(_prefix: &OsStr) -> Vec<CompletionCandidate> {

Calls 5

blocking_completeFunction · 0.85
resolve_active_gatewayFunction · 0.85
completion_grpc_clientFunction · 0.85
object_nameMethod · 0.80
list_sandboxesMethod · 0.45