@adhdev/daemon-standalone 0.9.76-rc.48 → 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/dist/index.js CHANGED
@@ -52557,14 +52557,33 @@ Run 'adhdev doctor' for detailed diagnostics.`
52557
52557
  const requestedSessionIds = Array.isArray(args.sessionIds) ? new Set(args.sessionIds.map((id) => typeof id === "string" ? id.trim() : "").filter(Boolean)) : void 0;
52558
52558
  const sessions = await this.deps.sessionHostControl.listSessions();
52559
52559
  const matched = sessions.filter((record2) => this.sessionMatchesMeshNode(record2, args.node, args.nodeId, requestedSessionIds));
52560
+ const hasExplicitSessionIds = !!requestedSessionIds?.size;
52560
52561
  const stoppedSessionIds = [];
52561
52562
  const deletedSessionIds = [];
52562
52563
  const skippedSessionIds = [];
52564
+ const skippedLiveSessionIds = [];
52563
52565
  const deleteUnsupportedSessionIds = [];
52566
+ const recordsRemainSessionIds = [];
52564
52567
  const errors = [];
52568
+ const matchedBySurfaceKind = {
52569
+ live_runtime: 0,
52570
+ recovery_snapshot: 0,
52571
+ inactive_record: 0
52572
+ };
52573
+ for (const record2 of matched) {
52574
+ const surfaceKind = getSessionHostSurfaceKind(record2);
52575
+ matchedBySurfaceKind[surfaceKind] += 1;
52576
+ }
52565
52577
  for (const record2 of matched) {
52566
52578
  const sessionId = String(record2.sessionId);
52567
52579
  const completed = this.isCompletedHostedSession(record2);
52580
+ const surfaceKind = getSessionHostSurfaceKind(record2);
52581
+ const liveRuntime = surfaceKind === "live_runtime";
52582
+ if (!hasExplicitSessionIds && liveRuntime) {
52583
+ skippedSessionIds.push(sessionId);
52584
+ skippedLiveSessionIds.push(sessionId);
52585
+ continue;
52586
+ }
52568
52587
  try {
52569
52588
  if (args.mode === "stop") {
52570
52589
  if (!completed) {
@@ -52593,6 +52612,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
52593
52612
  const message = e?.message || String(e);
52594
52613
  if (message.includes("Unsupported session host request: delete_session") && (args.mode === "delete_stopped" || args.mode === "stop_and_delete")) {
52595
52614
  deleteUnsupportedSessionIds.push(sessionId);
52615
+ recordsRemainSessionIds.push(sessionId);
52596
52616
  if (args.mode === "stop_and_delete" && !completed) {
52597
52617
  try {
52598
52618
  await this.deps.sessionHostControl.stopSession(sessionId);
@@ -52608,15 +52628,23 @@ Run 'adhdev doctor' for detailed diagnostics.`
52608
52628
  errors.push({ sessionId, error: message });
52609
52629
  }
52610
52630
  }
52631
+ const deleteUnsupported = deleteUnsupportedSessionIds.length > 0;
52611
52632
  return {
52612
52633
  success: errors.length === 0,
52613
52634
  mode: args.mode,
52614
52635
  dryRun: args.dryRun === true,
52615
52636
  matchedCount: matched.length,
52637
+ matchedBySurfaceKind,
52616
52638
  stoppedSessionIds,
52617
52639
  deletedSessionIds,
52618
52640
  skippedSessionIds,
52619
- ...deleteUnsupportedSessionIds.length ? { deleteUnsupportedSessionIds } : {},
52641
+ skippedLiveSessionIds,
52642
+ ...deleteUnsupported ? {
52643
+ deleteUnsupported: true,
52644
+ effectiveCleanup: args.mode === "stop_and_delete" ? "stopped_only_records_remain" : "delete_unsupported_records_remain",
52645
+ deleteUnsupportedSessionIds,
52646
+ recordsRemainSessionIds
52647
+ } : {},
52620
52648
  ...errors.length ? { errors } : {}
52621
52649
  };
52622
52650
  }