|
1 | 1 | // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
2 | 2 | // SPDX-License-Identifier: Apache-2.0 |
3 | 3 |
|
4 | | -import { exec } from "node:child_process"; |
| 4 | +import { execFile } from "node:child_process"; |
5 | 5 | import { existsSync } from "node:fs"; |
6 | 6 | import { promisify } from "node:util"; |
7 | 7 | import type { PluginLogger, NemoClawConfig } from "../index.js"; |
8 | 8 | import { loadState } from "../blueprint/state.js"; |
9 | 9 |
|
10 | | -const execAsync = promisify(exec); |
| 10 | +const execFileAsync = promisify(execFile); |
11 | 11 |
|
12 | 12 | /** |
13 | 13 | * Detect whether the plugin is running inside an OpenShell sandbox. |
@@ -128,7 +128,7 @@ async function getSandboxStatus(sandboxName: string, insideSandbox: boolean): Pr |
128 | 128 | return { name: sandboxName, running: false, uptime: null, insideSandbox: true }; |
129 | 129 | } |
130 | 130 | try { |
131 | | - const { stdout } = await execAsync(`openshell sandbox status ${sandboxName} --json`, { |
| 131 | + const { stdout } = await execFileAsync("openshell", ["sandbox", "status", sandboxName, "--json"], { |
132 | 132 | timeout: 5000, |
133 | 133 | }); |
134 | 134 | const parsed = JSON.parse(stdout) as SandboxStatusResponse; |
@@ -162,7 +162,7 @@ async function getInferenceStatus(insideSandbox: boolean): Promise<InferenceStat |
162 | 162 | return { configured: false, provider: null, model: null, endpoint: null, insideSandbox: true }; |
163 | 163 | } |
164 | 164 | try { |
165 | | - const { stdout } = await execAsync("openshell inference get --json", { |
| 165 | + const { stdout } = await execFileAsync("openshell", ["inference", "get", "--json"], { |
166 | 166 | timeout: 5000, |
167 | 167 | }); |
168 | 168 | const parsed = JSON.parse(stdout) as InferenceStatusResponse; |
|
0 commit comments