openclaw-lark-multi-agent 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +30 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -123,7 +123,12 @@ WantedBy=${params.mode === "system" ? "multi-user.target" : "default.target"}
|
|
|
123
123
|
`;
|
|
124
124
|
}
|
|
125
125
|
function run(cmd, args) {
|
|
126
|
-
|
|
126
|
+
// On Windows, npm-installed CLIs (like `openclaw`) are .cmd shims. Node's
|
|
127
|
+
// execFileSync does NOT resolve/execute .cmd files without shell:true (it
|
|
128
|
+
// fails with ENOENT before the subprocess ever starts — no output from the
|
|
129
|
+
// target command at all). Native .exe tools (nssm, systemctl on Linux) are
|
|
130
|
+
// unaffected by this flag either way, so enabling it only on win32 is safe.
|
|
131
|
+
execFileSync(cmd, args, { stdio: "inherit", shell: process.platform === "win32" });
|
|
127
132
|
}
|
|
128
133
|
function runSudo(args) {
|
|
129
134
|
run("sudo", args);
|
|
@@ -183,11 +188,21 @@ function cmdInstallWindowsService(args) {
|
|
|
183
188
|
}
|
|
184
189
|
function runCapture(cmd, args) {
|
|
185
190
|
try {
|
|
186
|
-
|
|
191
|
+
// See run()'s comment: Windows needs shell:true to execute a .cmd shim
|
|
192
|
+
// (e.g. openclaw installed via `npm install -g`), otherwise the subprocess
|
|
193
|
+
// never starts (ENOENT) and no output from it is ever produced.
|
|
194
|
+
execFileSync(cmd, args, { stdio: "inherit", shell: process.platform === "win32" });
|
|
187
195
|
return { code: 0 };
|
|
188
196
|
}
|
|
189
197
|
catch (err) {
|
|
190
|
-
|
|
198
|
+
const code = typeof err?.status === "number" ? err.status : 1;
|
|
199
|
+
// A spawn failure (command never started) has no numeric exit status/signal
|
|
200
|
+
// from the target process — surface that distinctly from "the command ran
|
|
201
|
+
// and returned non-zero", since the fix differs (PATH vs. the tool's own error).
|
|
202
|
+
const spawnError = typeof err?.status !== "number" && !err?.signal
|
|
203
|
+
? (err?.message || String(err))
|
|
204
|
+
: undefined;
|
|
205
|
+
return { code, spawnError };
|
|
191
206
|
}
|
|
192
207
|
}
|
|
193
208
|
/**
|
|
@@ -216,8 +231,18 @@ function cmdInstallSteerPlugin(args) {
|
|
|
216
231
|
console.log(`Installing lma-steer plugin from: ${pluginDir}`);
|
|
217
232
|
const res = runCapture(openclawBin, installArgs);
|
|
218
233
|
if (res.code !== 0) {
|
|
219
|
-
|
|
220
|
-
|
|
234
|
+
if (res.spawnError) {
|
|
235
|
+
// The subprocess never started (e.g. Windows failing to exec a .cmd shim
|
|
236
|
+
// without a shell, or the binary truly missing from PATH). This is
|
|
237
|
+
// distinct from "openclaw ran and returned an error" — no output above
|
|
238
|
+
// this line came from openclaw itself.
|
|
239
|
+
console.error(`\nCould not start "${openclawBin}": ${res.spawnError}`);
|
|
240
|
+
console.error(`Make sure the OpenClaw CLI is installed and on PATH (or set OPENCLAW_BIN to its full path),`);
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
console.error(`\n"${openclawBin} plugins install" failed (exit ${res.code}).`);
|
|
244
|
+
console.error(`Make sure the OpenClaw CLI is installed and on PATH (or set OPENCLAW_BIN),`);
|
|
245
|
+
}
|
|
221
246
|
console.error(`then rerun: ${CLI_NAME} install-steer-plugin`);
|
|
222
247
|
process.exit(res.code);
|
|
223
248
|
}
|