@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.mjs
CHANGED
|
@@ -1027,6 +1027,8 @@ var init_mesh_ledger = __esm({
|
|
|
1027
1027
|
// src/mesh/mesh-work-queue.ts
|
|
1028
1028
|
var mesh_work_queue_exports = {};
|
|
1029
1029
|
__export(mesh_work_queue_exports, {
|
|
1030
|
+
ACTIVE_MESH_QUEUE_STATUSES: () => ACTIVE_MESH_QUEUE_STATUSES,
|
|
1031
|
+
HISTORICAL_MESH_QUEUE_STATUSES: () => HISTORICAL_MESH_QUEUE_STATUSES,
|
|
1030
1032
|
cancelTask: () => cancelTask,
|
|
1031
1033
|
claimNextTask: () => claimNextTask,
|
|
1032
1034
|
enqueueTask: () => enqueueTask,
|
|
@@ -1186,6 +1188,15 @@ function getMeshQueueStats(meshId) {
|
|
|
1186
1188
|
completed,
|
|
1187
1189
|
failed,
|
|
1188
1190
|
cancelled,
|
|
1191
|
+
activeCounts: {
|
|
1192
|
+
pending,
|
|
1193
|
+
assigned
|
|
1194
|
+
},
|
|
1195
|
+
historicalCounts: {
|
|
1196
|
+
completed,
|
|
1197
|
+
failed,
|
|
1198
|
+
cancelled
|
|
1199
|
+
},
|
|
1189
1200
|
activeAssignments: queue.filter((q) => q.status === "assigned").map((q) => ({
|
|
1190
1201
|
id: q.id,
|
|
1191
1202
|
nodeId: q.assignedNodeId,
|
|
@@ -1194,10 +1205,13 @@ function getMeshQueueStats(meshId) {
|
|
|
1194
1205
|
}))
|
|
1195
1206
|
};
|
|
1196
1207
|
}
|
|
1208
|
+
var ACTIVE_MESH_QUEUE_STATUSES, HISTORICAL_MESH_QUEUE_STATUSES;
|
|
1197
1209
|
var init_mesh_work_queue = __esm({
|
|
1198
1210
|
"src/mesh/mesh-work-queue.ts"() {
|
|
1199
1211
|
"use strict";
|
|
1200
1212
|
init_mesh_ledger();
|
|
1213
|
+
ACTIVE_MESH_QUEUE_STATUSES = ["pending", "assigned"];
|
|
1214
|
+
HISTORICAL_MESH_QUEUE_STATUSES = ["completed", "failed", "cancelled"];
|
|
1201
1215
|
}
|
|
1202
1216
|
});
|
|
1203
1217
|
|
|
@@ -24684,10 +24698,21 @@ var DaemonCommandRouter = class {
|
|
|
24684
24698
|
const meshId = typeof args?.meshId === "string" ? args.meshId.trim() : "";
|
|
24685
24699
|
if (!meshId) return { success: false, error: "meshId required" };
|
|
24686
24700
|
try {
|
|
24687
|
-
const { getQueue: getQueue2 } = await Promise.resolve().then(() => (init_mesh_work_queue(), mesh_work_queue_exports));
|
|
24701
|
+
const { getMeshQueueStats: getMeshQueueStats2, getQueue: getQueue2 } = await Promise.resolve().then(() => (init_mesh_work_queue(), mesh_work_queue_exports));
|
|
24688
24702
|
const status = Array.isArray(args?.status) ? args.status.map((s) => typeof s === "string" ? s.trim() : "").filter(Boolean) : void 0;
|
|
24689
24703
|
const queue = getQueue2(meshId, { status });
|
|
24690
|
-
|
|
24704
|
+
const summary = getMeshQueueStats2(meshId);
|
|
24705
|
+
return {
|
|
24706
|
+
success: true,
|
|
24707
|
+
queue,
|
|
24708
|
+
summary,
|
|
24709
|
+
sourceOfTruth: {
|
|
24710
|
+
kind: "mesh_work_queue_file",
|
|
24711
|
+
activeStatuses: ["pending", "assigned"],
|
|
24712
|
+
historicalStatuses: ["completed", "failed", "cancelled"],
|
|
24713
|
+
notes: "pending/assigned are active work; completed/failed/cancelled are historical records."
|
|
24714
|
+
}
|
|
24715
|
+
};
|
|
24691
24716
|
} catch (e) {
|
|
24692
24717
|
return { success: false, error: e.message };
|
|
24693
24718
|
}
|