@adhdev/daemon-standalone 0.9.76-rc.47 → 0.9.76-rc.49

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.76-rc.47",
3
+ "version": "0.9.76-rc.49",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -34593,7 +34593,7 @@ function formatCompletionMetadata(event) {
34593
34593
  function buildMeshSystemMessage(args) {
34594
34594
  const metadata = formatCompletionMetadata(args.metadataEvent);
34595
34595
  if (args.event === "agent:generating_completed") {
34596
- return `[System] ${args.nodeLabel} has completed its task and is now idle${metadata}. You may use mesh_read_chat to review its progress.`;
34596
+ return `[System] ${args.nodeLabel} has completed its task and is now idle${metadata}. This completion came from the agent status event path; use mesh_read_chat once to review its final progress, but do not poll repeatedly.`;
34597
34597
  }
34598
34598
  if (args.event === "agent:waiting_approval") {
34599
34599
  return `[System] ${args.nodeLabel} is waiting for approval to proceed${metadata}. You may use mesh_read_chat and mesh_approve to handle it.`;
@@ -50759,13 +50759,33 @@ Run 'adhdev doctor' for detailed diagnostics.`
50759
50759
  const requestedSessionIds = Array.isArray(args.sessionIds) ? new Set(args.sessionIds.map((id) => typeof id === "string" ? id.trim() : "").filter(Boolean)) : void 0;
50760
50760
  const sessions = await this.deps.sessionHostControl.listSessions();
50761
50761
  const matched = sessions.filter((record2) => this.sessionMatchesMeshNode(record2, args.node, args.nodeId, requestedSessionIds));
50762
+ const hasExplicitSessionIds = !!requestedSessionIds?.size;
50762
50763
  const stoppedSessionIds = [];
50763
50764
  const deletedSessionIds = [];
50764
50765
  const skippedSessionIds = [];
50766
+ const skippedLiveSessionIds = [];
50767
+ const deleteUnsupportedSessionIds = [];
50768
+ const recordsRemainSessionIds = [];
50765
50769
  const errors = [];
50770
+ const matchedBySurfaceKind = {
50771
+ live_runtime: 0,
50772
+ recovery_snapshot: 0,
50773
+ inactive_record: 0
50774
+ };
50775
+ for (const record2 of matched) {
50776
+ const surfaceKind = getSessionHostSurfaceKind(record2);
50777
+ matchedBySurfaceKind[surfaceKind] += 1;
50778
+ }
50766
50779
  for (const record2 of matched) {
50767
50780
  const sessionId = String(record2.sessionId);
50768
50781
  const completed = this.isCompletedHostedSession(record2);
50782
+ const surfaceKind = getSessionHostSurfaceKind(record2);
50783
+ const liveRuntime = surfaceKind === "live_runtime";
50784
+ if (!hasExplicitSessionIds && liveRuntime) {
50785
+ skippedSessionIds.push(sessionId);
50786
+ skippedLiveSessionIds.push(sessionId);
50787
+ continue;
50788
+ }
50769
50789
  try {
50770
50790
  if (args.mode === "stop") {
50771
50791
  if (!completed) {
@@ -50791,17 +50811,42 @@ Run 'adhdev doctor' for detailed diagnostics.`
50791
50811
  continue;
50792
50812
  }
50793
50813
  } catch (e) {
50794
- errors.push({ sessionId, error: e?.message || String(e) });
50814
+ const message = e?.message || String(e);
50815
+ if (message.includes("Unsupported session host request: delete_session") && (args.mode === "delete_stopped" || args.mode === "stop_and_delete")) {
50816
+ deleteUnsupportedSessionIds.push(sessionId);
50817
+ recordsRemainSessionIds.push(sessionId);
50818
+ if (args.mode === "stop_and_delete" && !completed) {
50819
+ try {
50820
+ await this.deps.sessionHostControl.stopSession(sessionId);
50821
+ stoppedSessionIds.push(sessionId);
50822
+ } catch (stopError) {
50823
+ errors.push({ sessionId, error: stopError?.message || String(stopError) });
50824
+ continue;
50825
+ }
50826
+ }
50827
+ skippedSessionIds.push(sessionId);
50828
+ continue;
50829
+ }
50830
+ errors.push({ sessionId, error: message });
50795
50831
  }
50796
50832
  }
50833
+ const deleteUnsupported = deleteUnsupportedSessionIds.length > 0;
50797
50834
  return {
50798
50835
  success: errors.length === 0,
50799
50836
  mode: args.mode,
50800
50837
  dryRun: args.dryRun === true,
50801
50838
  matchedCount: matched.length,
50839
+ matchedBySurfaceKind,
50802
50840
  stoppedSessionIds,
50803
50841
  deletedSessionIds,
50804
50842
  skippedSessionIds,
50843
+ skippedLiveSessionIds,
50844
+ ...deleteUnsupported ? {
50845
+ deleteUnsupported: true,
50846
+ effectiveCleanup: args.mode === "stop_and_delete" ? "stopped_only_records_remain" : "delete_unsupported_records_remain",
50847
+ deleteUnsupportedSessionIds,
50848
+ recordsRemainSessionIds
50849
+ } : {},
50805
50850
  ...errors.length ? { errors } : {}
50806
50851
  };
50807
50852
  }
@@ -55698,9 +55743,10 @@ var IpcTransport = class {
55698
55743
  }
55699
55744
  fn();
55700
55745
  };
55746
+ const timeoutMs = type2 === "mesh_relay_command" ? 6e4 : 15e3;
55701
55747
  const timeout = setTimeout(() => {
55702
- finish(() => reject(new Error(`Daemon IPC command '${type2}' timed out after 15s`)));
55703
- }, 15e3);
55748
+ finish(() => reject(new Error(`Daemon IPC command '${type2}' timed out after ${Math.round(timeoutMs / 1e3)}s`)));
55749
+ }, timeoutMs);
55704
55750
  let commandSent = false;
55705
55751
  const send = () => {
55706
55752
  if (commandSent) return;
@@ -57043,7 +57089,7 @@ function getNodeLaunchReadiness(node) {
57043
57089
  };
57044
57090
  }
57045
57091
  async function commandForNode(ctx, node, command, args = {}) {
57046
- if (ctx.transport instanceof IpcTransport && node.daemonId) {
57092
+ if (ctx.transport instanceof IpcTransport && node.daemonId && node.daemonId !== ctx.localDaemonId) {
57047
57093
  return ctx.transport.meshCommand(node.daemonId, command, args);
57048
57094
  }
57049
57095
  if (isLocalTransport(ctx.transport)) {