@adhdev/daemon-standalone 0.9.82-rc.66 → 0.9.82-rc.67

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-standalone",
3
- "version": "0.9.82-rc.66",
3
+ "version": "0.9.82-rc.67",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -546,6 +546,18 @@ function filterQueueForView(queue, view, statuses) {
546
546
  if (view === "historical") return queue.filter((task) => HISTORICAL_QUEUE_STATUSES.has(String(task?.status || "")));
547
547
  return queue;
548
548
  }
549
+ function prioritizeActiveQueueRows(queue) {
550
+ const active = [];
551
+ const historical = [];
552
+ const other = [];
553
+ for (const task of queue) {
554
+ const status = String(task?.status || "");
555
+ if (ACTIVE_QUEUE_STATUSES.has(status)) active.push(task);
556
+ else if (HISTORICAL_QUEUE_STATUSES.has(status)) historical.push(task);
557
+ else other.push(task);
558
+ }
559
+ return [...active, ...other, ...historical];
560
+ }
549
561
  function slimQueueTask(task) {
550
562
  return {
551
563
  id: task?.id,
@@ -1580,7 +1592,7 @@ var MESH_RECONCILE_LEDGER_TOOL = {
1580
1592
  };
1581
1593
  var MESH_REFINE_NODE_TOOL = {
1582
1594
  name: "mesh_refine_node",
1583
- description: "The Refinery: Automatically validate and merge a completed worktree node back into its base branch. This tool automates the validation gate and merge queue step. It will merge the node's branch into its base branch and cleanly remove the worktree node and its sessions.",
1595
+ description: "The Refinery: Accept an async validation/merge/cleanup job for a completed worktree node. The immediate response includes async:true, status:'accepted', jobId, interactionId, target node, and startedAt; completion/failure evidence is delivered through pending mesh events and the mesh task ledger.",
1584
1596
  inputSchema: {
1585
1597
  type: "object",
1586
1598
  properties: {
@@ -1974,7 +1986,7 @@ async function meshViewQueue(ctx, args) {
1974
1986
  try {
1975
1987
  const statusFilter = sanitizeQueueStatusFilter(args.status);
1976
1988
  const view = normalizeQueueViewMode(args.view);
1977
- const fullQueue = annotateQueueStaleness((0, import_daemon_core.getQueue)(ctx.mesh.id), ctx.mesh);
1989
+ const fullQueue = prioritizeActiveQueueRows(annotateQueueStaleness((0, import_daemon_core.getQueue)(ctx.mesh.id), ctx.mesh));
1978
1990
  const queue = filterQueueForView(fullQueue, view, statusFilter);
1979
1991
  const summary = buildQueueStatusSummary(fullQueue);
1980
1992
  const visibleSummary = buildQueueStatusSummary(queue);
@@ -2037,6 +2049,10 @@ async function meshQueueCancel(ctx, args) {
2037
2049
  if (!taskId) return JSON.stringify({ success: false, error: "task_id required" });
2038
2050
  const task = (0, import_daemon_core.cancelTask)(ctx.mesh.id, taskId, { reason: args.reason });
2039
2051
  if (!task) return JSON.stringify({ success: false, error: `Queue task '${taskId}' not found` });
2052
+ if (isLocalTransport(ctx.transport)) {
2053
+ ctx.transport.command("trigger_mesh_queue", { meshId: ctx.mesh.id }).catch(() => {
2054
+ });
2055
+ }
2040
2056
  return JSON.stringify({ success: true, task }, null, 2);
2041
2057
  } catch (e) {
2042
2058
  return JSON.stringify({ success: false, error: e.message });
@@ -2803,7 +2819,7 @@ async function meshRefineNode(ctx, args) {
2803
2819
  nodeId: args.node_id,
2804
2820
  inlineMesh: ctx.mesh
2805
2821
  });
2806
- if (result?.success && result.removeResult?.removed !== false) {
2822
+ if (result?.success && result.async !== true && result.removeResult?.removed !== false) {
2807
2823
  const idx = ctx.mesh.nodes.findIndex((n) => n.id === args.node_id);
2808
2824
  if (idx >= 0) {
2809
2825
  ctx.mesh.nodes.splice(idx, 1);
@@ -2818,7 +2834,7 @@ async function meshRefineNode(ctx, args) {
2818
2834
  nodeId: args.node_id,
2819
2835
  inlineMesh: ctx.mesh
2820
2836
  });
2821
- if (res?.success && res.removeResult?.removed !== false) {
2837
+ if (res?.success && res.async !== true && res.removeResult?.removed !== false) {
2822
2838
  const idx = ctx.mesh.nodes.findIndex((n) => n.id === args.node_id);
2823
2839
  if (idx >= 0) {
2824
2840
  ctx.mesh.nodes.splice(idx, 1);
@@ -2855,13 +2871,13 @@ var STANDARD_TOOLS = [
2855
2871
  function buildMcpHelpText() {
2856
2872
  const meshTools = ALL_MESH_TOOLS.map((tool) => tool.name);
2857
2873
  return `
2858
- adhdev-mcp \u2014 ADHDev MCP Server
2874
+ ADHDev MCP Server
2859
2875
 
2860
2876
  Usage:
2861
- adhdev-mcp Local mode (requires standalone daemon)
2862
- adhdev-mcp --api-key <key> Cloud mode (ADHDev cloud API)
2863
- adhdev-mcp --mode ipc --repo-mesh <mesh_id> Cloud daemon IPC mesh mode
2864
- adhdev-mcp --repo-mesh <mesh_id> Mesh mode (coordinator-scoped tools)
2877
+ adhdev mcp Local mode (requires standalone daemon)
2878
+ adhdev mcp --api-key <key> Cloud mode (ADHDev cloud API)
2879
+ adhdev mcp --mode ipc --repo-mesh <mesh_id> Cloud daemon IPC mesh mode
2880
+ adhdev-mcp --help Compatibility bin (same server, legacy package entrypoint)
2865
2881
 
2866
2882
  Options:
2867
2883
  --mode <mode> Transport: local, cloud, or ipc