@boxcrew/cli 0.1.8 → 0.1.10

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.
Files changed (2) hide show
  1. package/dist/index.js +23 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -527,7 +527,7 @@ function runDaemon(agentName) {
527
527
  args = ["agent", "--message", message, "--json", "--agent", "main", "--timeout", "300"];
528
528
  } else {
529
529
  cmd = claudePath;
530
- args = ["-p", message, "--output-format", "stream-json", "--verbose"];
530
+ args = ["-p", message, "--output-format", "stream-json", "--verbose", "--dangerously-skip-permissions"];
531
531
  if (sessionId) args.push("--resume", sessionId);
532
532
  }
533
533
  const child = spawn(cmd, args, {
@@ -541,26 +541,36 @@ function runDaemon(agentName) {
541
541
  }
542
542
  if (runtime === "openclaw") {
543
543
  let stdout = "";
544
+ let stderrChunks = "";
544
545
  child.stdout.on("data", (chunk) => {
545
546
  stdout += chunk.toString();
546
547
  });
548
+ child.stderr.on("data", (chunk) => {
549
+ stderrChunks += chunk.toString();
550
+ });
547
551
  child.on("exit", (code) => {
548
552
  if (activeProcess === child) activeProcess = null;
549
553
  if (sendToServer) {
550
- const events = parseOpenClawOutput(stdout);
551
- for (const event of events) {
552
- sendToServer({ type: "event", messageId, event });
554
+ if (code && code !== 0) {
555
+ const errorMsg = stderrChunks.trim() || `OpenClaw exited with code ${code}`;
556
+ console.error(`OpenClaw exited with code ${code}: ${stderrChunks.trim()}`);
557
+ sendToServer({ type: "event", messageId, event: { kind: "text", text: `Error: ${errorMsg}` } });
558
+ } else {
559
+ const events = parseOpenClawOutput(stdout);
560
+ for (const event of events) {
561
+ sendToServer({ type: "event", messageId, event });
562
+ }
553
563
  }
554
564
  sendToServer({ type: "event", messageId, event: { kind: "done" } });
555
565
  }
556
- if (code && code !== 0) {
557
- console.error(`OpenClaw exited with code ${code}`);
558
- sendToServer?.({ type: "error", messageId, error: `OpenClaw exited with code ${code}` });
559
- }
560
566
  });
561
567
  } else {
562
568
  const parseLine = runtime === "opencode" ? parseOpenCodeLine : parseStreamJsonLine;
563
569
  const rl = createInterface3({ input: child.stdout });
570
+ let stderrChunks = "";
571
+ child.stderr.on("data", (chunk) => {
572
+ stderrChunks += chunk.toString();
573
+ });
564
574
  rl.on("line", (line) => {
565
575
  const event = parseLine(line);
566
576
  if (event && sendToServer) {
@@ -569,13 +579,14 @@ function runDaemon(agentName) {
569
579
  });
570
580
  child.on("exit", (code) => {
571
581
  if (activeProcess === child) activeProcess = null;
582
+ if (code && code !== 0 && sendToServer) {
583
+ const errorMsg = stderrChunks.trim() || `${runtime} exited with code ${code}`;
584
+ console.error(`${runtime} exited with code ${code}: ${stderrChunks.trim()}`);
585
+ sendToServer({ type: "event", messageId, event: { kind: "text", text: `Error: ${errorMsg}` } });
586
+ }
572
587
  if (sendToServer) {
573
588
  sendToServer({ type: "event", messageId, event: { kind: "done" } });
574
589
  }
575
- if (code && code !== 0) {
576
- console.error(`${runtime} exited with code ${code}`);
577
- sendToServer?.({ type: "error", messageId, error: `${runtime} exited with code ${code}` });
578
- }
579
590
  });
580
591
  }
581
592
  child.on("error", (err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boxcrew/cli",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "BoxCrew CLI — manage your agents from the terminal",
5
5
  "type": "module",
6
6
  "bin": {