@boxcrew/cli 0.1.17 → 0.1.19

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 +13 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -229,7 +229,8 @@ function registerAgentsCommands(program2) {
229
229
  }
230
230
  const home = homedir2();
231
231
  const shortenPath = (p) => p.startsWith(home) ? "~" + p.slice(home.length) : p;
232
- const localMeta = /* @__PURE__ */ new Map();
232
+ const localMetaById = /* @__PURE__ */ new Map();
233
+ const localMetaByName = /* @__PURE__ */ new Map();
233
234
  try {
234
235
  const stateDir = getStateDir();
235
236
  const metaFiles = readdirSync2(stateDir).filter((f) => f.endsWith(".meta.json"));
@@ -237,7 +238,9 @@ function registerAgentsCommands(program2) {
237
238
  const key = file.replace(".meta.json", "");
238
239
  const meta = readMeta(key);
239
240
  if (meta) {
240
- localMeta.set(meta.agentId, { pid: readPid(key), cwd: meta.cwd });
241
+ const entry = { pid: readPid(key), cwd: meta.cwd };
242
+ if (meta.agentId) localMetaById.set(meta.agentId, entry);
243
+ if (meta.agentName) localMetaByName.set(meta.agentName, entry);
241
244
  }
242
245
  }
243
246
  } catch {
@@ -252,7 +255,7 @@ function registerAgentsCommands(program2) {
252
255
  if (agent.agent_type !== "remote") {
253
256
  status = "-";
254
257
  } else {
255
- const local = localMeta.get(agent.id);
258
+ const local = localMetaById.get(agent.id) || localMetaByName.get(agent.name);
256
259
  if (local?.pid) {
257
260
  status = "online (here)";
258
261
  directory = shortenPath(local.cwd);
@@ -635,6 +638,7 @@ function runDaemon(agentId) {
635
638
  child.stdin.end();
636
639
  }
637
640
  let producedOutput = false;
641
+ let producedOnlyError = false;
638
642
  if (runtime === "openclaw") {
639
643
  let stdout = "";
640
644
  let stderrChunks = "";
@@ -671,10 +675,15 @@ function runDaemon(agentId) {
671
675
  producedOutput = true;
672
676
  enqueueMessage({ type: "event", messageId, event });
673
677
  }
678
+ try {
679
+ const obj = JSON.parse(line);
680
+ if (obj.type === "result" && obj.is_error) producedOnlyError = true;
681
+ } catch {
682
+ }
674
683
  });
675
684
  child.on("exit", (code) => {
676
685
  if (activeProcess === child) activeProcess = null;
677
- if (code && code !== 0 && sessionId && !retriedWithoutSession && !producedOutput) {
686
+ if (code && code !== 0 && sessionId && !retriedWithoutSession && (!producedOutput || producedOnlyError)) {
678
687
  console.log(`[${(/* @__PURE__ */ new Date()).toISOString()}] Session resume failed, retrying without --resume`);
679
688
  spawnRuntime(messageId, message, void 0, true);
680
689
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boxcrew/cli",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "BoxCrew CLI — manage your agents from the terminal",
5
5
  "type": "module",
6
6
  "bin": {