@adhdev/daemon-core 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 +29 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/router.ts +32 -1
package/dist/index.js
CHANGED
|
@@ -21543,14 +21543,33 @@ var DaemonCommandRouter = class {
|
|
|
21543
21543
|
const requestedSessionIds = Array.isArray(args.sessionIds) ? new Set(args.sessionIds.map((id) => typeof id === "string" ? id.trim() : "").filter(Boolean)) : void 0;
|
|
21544
21544
|
const sessions = await this.deps.sessionHostControl.listSessions();
|
|
21545
21545
|
const matched = sessions.filter((record) => this.sessionMatchesMeshNode(record, args.node, args.nodeId, requestedSessionIds));
|
|
21546
|
+
const hasExplicitSessionIds = !!requestedSessionIds?.size;
|
|
21546
21547
|
const stoppedSessionIds = [];
|
|
21547
21548
|
const deletedSessionIds = [];
|
|
21548
21549
|
const skippedSessionIds = [];
|
|
21550
|
+
const skippedLiveSessionIds = [];
|
|
21549
21551
|
const deleteUnsupportedSessionIds = [];
|
|
21552
|
+
const recordsRemainSessionIds = [];
|
|
21550
21553
|
const errors = [];
|
|
21554
|
+
const matchedBySurfaceKind = {
|
|
21555
|
+
live_runtime: 0,
|
|
21556
|
+
recovery_snapshot: 0,
|
|
21557
|
+
inactive_record: 0
|
|
21558
|
+
};
|
|
21559
|
+
for (const record of matched) {
|
|
21560
|
+
const surfaceKind = getSessionHostSurfaceKind(record);
|
|
21561
|
+
matchedBySurfaceKind[surfaceKind] += 1;
|
|
21562
|
+
}
|
|
21551
21563
|
for (const record of matched) {
|
|
21552
21564
|
const sessionId = String(record.sessionId);
|
|
21553
21565
|
const completed = this.isCompletedHostedSession(record);
|
|
21566
|
+
const surfaceKind = getSessionHostSurfaceKind(record);
|
|
21567
|
+
const liveRuntime = surfaceKind === "live_runtime";
|
|
21568
|
+
if (!hasExplicitSessionIds && liveRuntime) {
|
|
21569
|
+
skippedSessionIds.push(sessionId);
|
|
21570
|
+
skippedLiveSessionIds.push(sessionId);
|
|
21571
|
+
continue;
|
|
21572
|
+
}
|
|
21554
21573
|
try {
|
|
21555
21574
|
if (args.mode === "stop") {
|
|
21556
21575
|
if (!completed) {
|
|
@@ -21579,6 +21598,7 @@ var DaemonCommandRouter = class {
|
|
|
21579
21598
|
const message = e?.message || String(e);
|
|
21580
21599
|
if (message.includes("Unsupported session host request: delete_session") && (args.mode === "delete_stopped" || args.mode === "stop_and_delete")) {
|
|
21581
21600
|
deleteUnsupportedSessionIds.push(sessionId);
|
|
21601
|
+
recordsRemainSessionIds.push(sessionId);
|
|
21582
21602
|
if (args.mode === "stop_and_delete" && !completed) {
|
|
21583
21603
|
try {
|
|
21584
21604
|
await this.deps.sessionHostControl.stopSession(sessionId);
|
|
@@ -21594,15 +21614,23 @@ var DaemonCommandRouter = class {
|
|
|
21594
21614
|
errors.push({ sessionId, error: message });
|
|
21595
21615
|
}
|
|
21596
21616
|
}
|
|
21617
|
+
const deleteUnsupported = deleteUnsupportedSessionIds.length > 0;
|
|
21597
21618
|
return {
|
|
21598
21619
|
success: errors.length === 0,
|
|
21599
21620
|
mode: args.mode,
|
|
21600
21621
|
dryRun: args.dryRun === true,
|
|
21601
21622
|
matchedCount: matched.length,
|
|
21623
|
+
matchedBySurfaceKind,
|
|
21602
21624
|
stoppedSessionIds,
|
|
21603
21625
|
deletedSessionIds,
|
|
21604
21626
|
skippedSessionIds,
|
|
21605
|
-
|
|
21627
|
+
skippedLiveSessionIds,
|
|
21628
|
+
...deleteUnsupported ? {
|
|
21629
|
+
deleteUnsupported: true,
|
|
21630
|
+
effectiveCleanup: args.mode === "stop_and_delete" ? "stopped_only_records_remain" : "delete_unsupported_records_remain",
|
|
21631
|
+
deleteUnsupportedSessionIds,
|
|
21632
|
+
recordsRemainSessionIds
|
|
21633
|
+
} : {},
|
|
21606
21634
|
...errors.length ? { errors } : {}
|
|
21607
21635
|
};
|
|
21608
21636
|
}
|