@adhdev/daemon-core 0.9.77-rc.45 → 0.9.77-rc.46

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/index.mjs CHANGED
@@ -321,7 +321,8 @@ function ensureMachineId(config) {
321
321
  };
322
322
  }
323
323
  function getConfigDir() {
324
- const dir = join2(homedir(), ".adhdev");
324
+ const override = process.env.ADHDEV_CONFIG_DIR;
325
+ const dir = override && override.trim() ? override.trim() : join2(homedir(), ".adhdev");
325
326
  if (!existsSync2(dir)) {
326
327
  mkdirSync(dir, { recursive: true });
327
328
  }
@@ -1171,12 +1172,20 @@ function updateSessionTaskStatus(meshId, sessionId, status) {
1171
1172
  }
1172
1173
  function getMeshQueueStats(meshId) {
1173
1174
  const queue = readQueue(meshId);
1175
+ const pending = queue.filter((q) => q.status === "pending").length;
1176
+ const assigned = queue.filter((q) => q.status === "assigned").length;
1177
+ const completed = queue.filter((q) => q.status === "completed").length;
1178
+ const failed = queue.filter((q) => q.status === "failed").length;
1179
+ const cancelled = queue.filter((q) => q.status === "cancelled").length;
1174
1180
  return {
1175
- pending: queue.filter((q) => q.status === "pending").length,
1176
- assigned: queue.filter((q) => q.status === "assigned").length,
1177
- completed: queue.filter((q) => q.status === "completed").length,
1178
- failed: queue.filter((q) => q.status === "failed").length,
1179
- cancelled: queue.filter((q) => q.status === "cancelled").length,
1181
+ total: queue.length,
1182
+ active: pending + assigned,
1183
+ historical: completed + failed + cancelled,
1184
+ pending,
1185
+ assigned,
1186
+ completed,
1187
+ failed,
1188
+ cancelled,
1180
1189
  activeAssignments: queue.filter((q) => q.status === "assigned").map((q) => ({
1181
1190
  id: q.id,
1182
1191
  nodeId: q.assignedNodeId,
@@ -6727,7 +6736,7 @@ function addWorkspaceEntry(config, rawPath, label, options) {
6727
6736
  }
6728
6737
  }
6729
6738
  const v = validateWorkspacePath(abs);
6730
- if (!v.ok) return { error: v.error };
6739
+ if (v.ok !== true) return { error: v.error };
6731
6740
  const list = [...config.workspaces || []];
6732
6741
  if (list.some((w) => path5.resolve(w.path) === abs)) {
6733
6742
  return { error: "Workspace already in list" };