@adhdev/daemon-standalone 0.9.77-rc.46 → 0.9.77-rc.48

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
@@ -23136,6 +23136,8 @@ Follow these recovery rules:
23136
23136
  });
23137
23137
  var mesh_work_queue_exports = {};
23138
23138
  __export2(mesh_work_queue_exports, {
23139
+ ACTIVE_MESH_QUEUE_STATUSES: () => ACTIVE_MESH_QUEUE_STATUSES,
23140
+ HISTORICAL_MESH_QUEUE_STATUSES: () => HISTORICAL_MESH_QUEUE_STATUSES,
23139
23141
  cancelTask: () => cancelTask,
23140
23142
  claimNextTask: () => claimNextTask,
23141
23143
  enqueueTask: () => enqueueTask,
@@ -23292,6 +23294,15 @@ Follow these recovery rules:
23292
23294
  completed,
23293
23295
  failed,
23294
23296
  cancelled,
23297
+ activeCounts: {
23298
+ pending,
23299
+ assigned
23300
+ },
23301
+ historicalCounts: {
23302
+ completed,
23303
+ failed,
23304
+ cancelled
23305
+ },
23295
23306
  activeAssignments: queue.filter((q) => q.status === "assigned").map((q) => ({
23296
23307
  id: q.id,
23297
23308
  nodeId: q.assignedNodeId,
@@ -23303,6 +23314,8 @@ Follow these recovery rules:
23303
23314
  var import_fs4;
23304
23315
  var import_path4;
23305
23316
  var import_crypto5;
23317
+ var ACTIVE_MESH_QUEUE_STATUSES;
23318
+ var HISTORICAL_MESH_QUEUE_STATUSES;
23306
23319
  var init_mesh_work_queue = __esm2({
23307
23320
  "src/mesh/mesh-work-queue.ts"() {
23308
23321
  "use strict";
@@ -23310,6 +23323,8 @@ Follow these recovery rules:
23310
23323
  import_path4 = require("path");
23311
23324
  import_crypto5 = require("crypto");
23312
23325
  init_mesh_ledger();
23326
+ ACTIVE_MESH_QUEUE_STATUSES = ["pending", "assigned"];
23327
+ HISTORICAL_MESH_QUEUE_STATUSES = ["completed", "failed", "cancelled"];
23313
23328
  }
23314
23329
  });
23315
23330
  function parseVersion(raw) {
@@ -29439,26 +29454,8 @@ ${lastSnapshot}`;
29439
29454
  }
29440
29455
  }
29441
29456
  }
29442
- if (transport.syncMeshLedger) {
29443
- for (const local of localMeshes) {
29444
- try {
29445
- await syncMeshLedger(local.id, transport);
29446
- } catch (e) {
29447
- result.errors.push(`Ledger sync failed for "${local.name}": ${e.message}`);
29448
- }
29449
- }
29450
- }
29451
29457
  return result;
29452
29458
  }
29453
- async function syncMeshLedger(meshId, transport) {
29454
- if (!transport.syncMeshLedger) return;
29455
- const { readLedgerEntries: readLedgerEntries2, appendRemoteLedgerEntries: appendRemoteLedgerEntries2 } = await Promise.resolve().then(() => (init_mesh_ledger(), mesh_ledger_exports));
29456
- const localEntries = readLedgerEntries2(meshId);
29457
- const res = await transport.syncMeshLedger(meshId, { newEntries: localEntries });
29458
- if (res.missingEntries && res.missingEntries.length > 0) {
29459
- appendRemoteLedgerEntries2(meshId, res.missingEntries);
29460
- }
29461
- }
29462
29459
  init_mesh_ledger();
29463
29460
  init_mesh_work_queue();
29464
29461
  init_mesh_events();
@@ -46861,10 +46858,21 @@ ${(0, import_node_path.resolve)(workspace || os17.tmpdir())}`;
46861
46858
  const meshId = typeof args?.meshId === "string" ? args.meshId.trim() : "";
46862
46859
  if (!meshId) return { success: false, error: "meshId required" };
46863
46860
  try {
46864
- const { getQueue: getQueue2 } = await Promise.resolve().then(() => (init_mesh_work_queue(), mesh_work_queue_exports));
46861
+ const { getMeshQueueStats: getMeshQueueStats2, getQueue: getQueue2 } = await Promise.resolve().then(() => (init_mesh_work_queue(), mesh_work_queue_exports));
46865
46862
  const status = Array.isArray(args?.status) ? args.status.map((s) => typeof s === "string" ? s.trim() : "").filter(Boolean) : void 0;
46866
46863
  const queue = getQueue2(meshId, { status });
46867
- return { success: true, queue };
46864
+ const summary = getMeshQueueStats2(meshId);
46865
+ return {
46866
+ success: true,
46867
+ queue,
46868
+ summary,
46869
+ sourceOfTruth: {
46870
+ kind: "mesh_work_queue_file",
46871
+ activeStatuses: ["pending", "assigned"],
46872
+ historicalStatuses: ["completed", "failed", "cancelled"],
46873
+ notes: "pending/assigned are active work; completed/failed/cancelled are historical records."
46874
+ }
46875
+ };
46868
46876
  } catch (e) {
46869
46877
  return { success: false, error: e.message };
46870
46878
  }