@boxcrew/cli 0.1.17 → 0.1.18

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 +6 -3
  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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boxcrew/cli",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "BoxCrew CLI — manage your agents from the terminal",
5
5
  "type": "module",
6
6
  "bin": {