@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.js CHANGED
@@ -322,7 +322,8 @@ function ensureMachineId(config) {
322
322
  };
323
323
  }
324
324
  function getConfigDir() {
325
- const dir = (0, import_path.join)((0, import_os.homedir)(), ".adhdev");
325
+ const override = process.env.ADHDEV_CONFIG_DIR;
326
+ const dir = override && override.trim() ? override.trim() : (0, import_path.join)((0, import_os.homedir)(), ".adhdev");
326
327
  if (!(0, import_fs.existsSync)(dir)) {
327
328
  (0, import_fs.mkdirSync)(dir, { recursive: true });
328
329
  }
@@ -1173,12 +1174,20 @@ function updateSessionTaskStatus(meshId, sessionId, status) {
1173
1174
  }
1174
1175
  function getMeshQueueStats(meshId) {
1175
1176
  const queue = readQueue(meshId);
1177
+ const pending = queue.filter((q) => q.status === "pending").length;
1178
+ const assigned = queue.filter((q) => q.status === "assigned").length;
1179
+ const completed = queue.filter((q) => q.status === "completed").length;
1180
+ const failed = queue.filter((q) => q.status === "failed").length;
1181
+ const cancelled = queue.filter((q) => q.status === "cancelled").length;
1176
1182
  return {
1177
- pending: queue.filter((q) => q.status === "pending").length,
1178
- assigned: queue.filter((q) => q.status === "assigned").length,
1179
- completed: queue.filter((q) => q.status === "completed").length,
1180
- failed: queue.filter((q) => q.status === "failed").length,
1181
- cancelled: queue.filter((q) => q.status === "cancelled").length,
1183
+ total: queue.length,
1184
+ active: pending + assigned,
1185
+ historical: completed + failed + cancelled,
1186
+ pending,
1187
+ assigned,
1188
+ completed,
1189
+ failed,
1190
+ cancelled,
1182
1191
  activeAssignments: queue.filter((q) => q.status === "assigned").map((q) => ({
1183
1192
  id: q.id,
1184
1193
  nodeId: q.assignedNodeId,
@@ -6957,7 +6966,7 @@ function addWorkspaceEntry(config, rawPath, label, options) {
6957
6966
  }
6958
6967
  }
6959
6968
  const v = validateWorkspacePath(abs);
6960
- if (!v.ok) return { error: v.error };
6969
+ if (v.ok !== true) return { error: v.error };
6961
6970
  const list = [...config.workspaces || []];
6962
6971
  if (list.some((w) => path5.resolve(w.path) === abs)) {
6963
6972
  return { error: "Workspace already in list" };