@adhdev/daemon-core 0.9.77-rc.46 → 0.9.77-rc.47
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 +27 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -2
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-work-queue.d.ts +8 -0
- package/dist/shared-types.d.ts +18 -0
- package/package.json +1 -1
- package/src/commands/router.ts +13 -2
- package/src/mesh/mesh-work-queue.ts +18 -0
- package/src/shared-types.ts +18 -0
package/dist/index.js
CHANGED
|
@@ -1032,6 +1032,8 @@ var init_mesh_ledger = __esm({
|
|
|
1032
1032
|
// src/mesh/mesh-work-queue.ts
|
|
1033
1033
|
var mesh_work_queue_exports = {};
|
|
1034
1034
|
__export(mesh_work_queue_exports, {
|
|
1035
|
+
ACTIVE_MESH_QUEUE_STATUSES: () => ACTIVE_MESH_QUEUE_STATUSES,
|
|
1036
|
+
HISTORICAL_MESH_QUEUE_STATUSES: () => HISTORICAL_MESH_QUEUE_STATUSES,
|
|
1035
1037
|
cancelTask: () => cancelTask,
|
|
1036
1038
|
claimNextTask: () => claimNextTask,
|
|
1037
1039
|
enqueueTask: () => enqueueTask,
|
|
@@ -1188,6 +1190,15 @@ function getMeshQueueStats(meshId) {
|
|
|
1188
1190
|
completed,
|
|
1189
1191
|
failed,
|
|
1190
1192
|
cancelled,
|
|
1193
|
+
activeCounts: {
|
|
1194
|
+
pending,
|
|
1195
|
+
assigned
|
|
1196
|
+
},
|
|
1197
|
+
historicalCounts: {
|
|
1198
|
+
completed,
|
|
1199
|
+
failed,
|
|
1200
|
+
cancelled
|
|
1201
|
+
},
|
|
1191
1202
|
activeAssignments: queue.filter((q) => q.status === "assigned").map((q) => ({
|
|
1192
1203
|
id: q.id,
|
|
1193
1204
|
nodeId: q.assignedNodeId,
|
|
@@ -1196,7 +1207,7 @@ function getMeshQueueStats(meshId) {
|
|
|
1196
1207
|
}))
|
|
1197
1208
|
};
|
|
1198
1209
|
}
|
|
1199
|
-
var import_fs4, import_path4, import_crypto5;
|
|
1210
|
+
var import_fs4, import_path4, import_crypto5, ACTIVE_MESH_QUEUE_STATUSES, HISTORICAL_MESH_QUEUE_STATUSES;
|
|
1200
1211
|
var init_mesh_work_queue = __esm({
|
|
1201
1212
|
"src/mesh/mesh-work-queue.ts"() {
|
|
1202
1213
|
"use strict";
|
|
@@ -1204,6 +1215,8 @@ var init_mesh_work_queue = __esm({
|
|
|
1204
1215
|
import_path4 = require("path");
|
|
1205
1216
|
import_crypto5 = require("crypto");
|
|
1206
1217
|
init_mesh_ledger();
|
|
1218
|
+
ACTIVE_MESH_QUEUE_STATUSES = ["pending", "assigned"];
|
|
1219
|
+
HISTORICAL_MESH_QUEUE_STATUSES = ["completed", "failed", "cancelled"];
|
|
1207
1220
|
}
|
|
1208
1221
|
});
|
|
1209
1222
|
|
|
@@ -24909,10 +24922,21 @@ var DaemonCommandRouter = class {
|
|
|
24909
24922
|
const meshId = typeof args?.meshId === "string" ? args.meshId.trim() : "";
|
|
24910
24923
|
if (!meshId) return { success: false, error: "meshId required" };
|
|
24911
24924
|
try {
|
|
24912
|
-
const { getQueue: getQueue2 } = await Promise.resolve().then(() => (init_mesh_work_queue(), mesh_work_queue_exports));
|
|
24925
|
+
const { getMeshQueueStats: getMeshQueueStats2, getQueue: getQueue2 } = await Promise.resolve().then(() => (init_mesh_work_queue(), mesh_work_queue_exports));
|
|
24913
24926
|
const status = Array.isArray(args?.status) ? args.status.map((s) => typeof s === "string" ? s.trim() : "").filter(Boolean) : void 0;
|
|
24914
24927
|
const queue = getQueue2(meshId, { status });
|
|
24915
|
-
|
|
24928
|
+
const summary = getMeshQueueStats2(meshId);
|
|
24929
|
+
return {
|
|
24930
|
+
success: true,
|
|
24931
|
+
queue,
|
|
24932
|
+
summary,
|
|
24933
|
+
sourceOfTruth: {
|
|
24934
|
+
kind: "mesh_work_queue_file",
|
|
24935
|
+
activeStatuses: ["pending", "assigned"],
|
|
24936
|
+
historicalStatuses: ["completed", "failed", "cancelled"],
|
|
24937
|
+
notes: "pending/assigned are active work; completed/failed/cancelled are historical records."
|
|
24938
|
+
}
|
|
24939
|
+
};
|
|
24916
24940
|
} catch (e) {
|
|
24917
24941
|
return { success: false, error: e.message };
|
|
24918
24942
|
}
|