@adhdev/daemon-core 0.9.82-rc.452 → 0.9.82-rc.453
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 +45 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/mesh/mesh-active-work.ts +7 -5
- package/src/mesh/mesh-event-forwarding.ts +9 -10
- package/src/mesh/mesh-events-stale.ts +7 -7
- package/src/mesh/mesh-ledger.ts +4 -3
- package/src/mesh/mesh-node-identity.ts +9 -6
- package/src/mesh/mesh-queue-assignment.ts +4 -4
- package/src/mesh/mesh-reconcile-loop.ts +5 -6
- package/src/mesh/mesh-review-inbox.ts +4 -3
- package/src/mesh/mesh-routing.ts +2 -2
- package/src/mesh/mesh-runtime-store.ts +6 -8
- package/src/mesh/mesh-work-queue.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -409,10 +409,10 @@ function readInjected(value) {
|
|
|
409
409
|
}
|
|
410
410
|
function getDaemonBuildInfo() {
|
|
411
411
|
if (cached) return cached;
|
|
412
|
-
const commit = readInjected(true ? "
|
|
413
|
-
const commitShort = readInjected(true ? "
|
|
414
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
415
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
412
|
+
const commit = readInjected(true ? "0bdc67e3dfbc383e6a3f07527c75b23b0fa88232" : void 0) ?? "unknown";
|
|
413
|
+
const commitShort = readInjected(true ? "0bdc67e3" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
414
|
+
const version = readInjected(true ? "0.9.82-rc.453" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
415
|
+
const builtAt = readInjected(true ? "2026-07-03T19:10:33.620Z" : void 0);
|
|
416
416
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
417
417
|
return cached;
|
|
418
418
|
}
|
|
@@ -2668,6 +2668,12 @@ function pickBestTransitGitStatus(node, options) {
|
|
|
2668
2668
|
}
|
|
2669
2669
|
return best?.git;
|
|
2670
2670
|
}
|
|
2671
|
+
function sessionIdsEquivalent(a, b) {
|
|
2672
|
+
const idA = readString2(a);
|
|
2673
|
+
const idB = readString2(b);
|
|
2674
|
+
if (!idA || !idB) return false;
|
|
2675
|
+
return idA === idB;
|
|
2676
|
+
}
|
|
2671
2677
|
function normalizeMeshNodeId(node) {
|
|
2672
2678
|
const record = node && typeof node === "object" ? node : {};
|
|
2673
2679
|
return readString2(record.id, record.nodeId, record.node_id);
|
|
@@ -4821,7 +4827,7 @@ function getSessionRecoveryContext(meshId, opts) {
|
|
|
4821
4827
|
if (!failureCountDone) {
|
|
4822
4828
|
if (ts2 < recentWindow) {
|
|
4823
4829
|
failureCountDone = true;
|
|
4824
|
-
} else if (opts.nodeId && e.nodeId
|
|
4830
|
+
} else if (opts.nodeId && !daemonIdsEquivalent(e.nodeId, opts.nodeId)) {
|
|
4825
4831
|
} else if (e.kind === "task_failed") {
|
|
4826
4832
|
if (!isIntentionalCleanupStopEntry(e)) consecutiveNodeFailures++;
|
|
4827
4833
|
} else if (e.kind === "task_completed" || e.kind === "task_dispatched") {
|
|
@@ -4829,9 +4835,9 @@ function getSessionRecoveryContext(meshId, opts) {
|
|
|
4829
4835
|
}
|
|
4830
4836
|
}
|
|
4831
4837
|
if (lastDispatch === null && e.kind === "task_dispatched") {
|
|
4832
|
-
if (opts.sessionId && e.sessionId
|
|
4838
|
+
if (opts.sessionId && sessionIdsEquivalent(e.sessionId, opts.sessionId)) {
|
|
4833
4839
|
lastDispatch = e;
|
|
4834
|
-
} else if (!opts.sessionId && opts.nodeId && e.nodeId
|
|
4840
|
+
} else if (!opts.sessionId && opts.nodeId && daemonIdsEquivalent(e.nodeId, opts.nodeId)) {
|
|
4835
4841
|
lastDispatch = e;
|
|
4836
4842
|
}
|
|
4837
4843
|
}
|
|
@@ -4898,6 +4904,7 @@ var init_mesh_ledger = __esm({
|
|
|
4898
4904
|
import_path4 = require("path");
|
|
4899
4905
|
import_crypto4 = require("crypto");
|
|
4900
4906
|
init_config();
|
|
4907
|
+
init_dist();
|
|
4901
4908
|
import_events = require("events");
|
|
4902
4909
|
init_mesh_runtime_store();
|
|
4903
4910
|
LEDGER_DIR_NAME = "mesh-ledger";
|
|
@@ -5735,7 +5742,7 @@ function updateSessionTaskStatus(meshId, sessionId, status, opts) {
|
|
|
5735
5742
|
const occurredAtIso = opts?.occurredAt ? new Date(opts.occurredAt).toISOString() : void 0;
|
|
5736
5743
|
const entry = store.findAssignedBySession(meshId, sessionId, occurredAtIso, opts?.taskId);
|
|
5737
5744
|
if (!entry) {
|
|
5738
|
-
const assignedRows = store.getActiveAssignmentDetails(meshId).filter((r) => r.sessionId
|
|
5745
|
+
const assignedRows = store.getActiveAssignmentDetails(meshId).filter((r) => sessionIdsEquivalent(r.sessionId, sessionId));
|
|
5739
5746
|
if (assignedRows.length > 0) {
|
|
5740
5747
|
LOG.warn("MeshQueue", `No assigned queue row matched completion for mesh ${meshId} session ${sessionId} (taskId=${opts?.taskId ?? "none"}, occurredAt=${occurredAtIso ?? "none"}); ${assignedRows.length} assigned row(s) exist: ${assignedRows.map((r) => r.id).join(",")}`);
|
|
5741
5748
|
}
|
|
@@ -5859,6 +5866,7 @@ var init_mesh_work_queue = __esm({
|
|
|
5859
5866
|
init_mesh_ledger();
|
|
5860
5867
|
init_mesh_delivery_policy();
|
|
5861
5868
|
init_mesh_task_inflight();
|
|
5869
|
+
init_dist();
|
|
5862
5870
|
ACTIVE_MESH_QUEUE_STATUSES = ["pending", "assigned"];
|
|
5863
5871
|
HISTORICAL_MESH_QUEUE_STATUSES = ["completed", "failed", "cancelled"];
|
|
5864
5872
|
MESH_TASK_MODES = ["code_change", "validation", "live_debug_readonly", "launch_app", "convergence"];
|
|
@@ -6545,7 +6553,7 @@ var init_mesh_runtime_store = __esm({
|
|
|
6545
6553
|
const nodeIsWorktree = opts?.nodeIsWorktree === true;
|
|
6546
6554
|
const convergenceAllows = (candidate) => candidate.taskMode !== "convergence" || !nodeIsWorktree;
|
|
6547
6555
|
const targetMatches = (candidate) => {
|
|
6548
|
-
if (candidate.targetSessionId && candidate.targetSessionId
|
|
6556
|
+
if (candidate.targetSessionId && !sessionIdsEquivalent(candidate.targetSessionId, sessionId)) return false;
|
|
6549
6557
|
if (candidate.targetNodeId && !daemonIdsEquivalent(candidate.targetNodeId, nodeId) && !meshNodeIdMatches({ id: candidate.targetNodeId }, nodeId)) {
|
|
6550
6558
|
return false;
|
|
6551
6559
|
}
|
|
@@ -7930,7 +7938,7 @@ function resolveNodeEvidence(nodeId, ledgerEntries) {
|
|
|
7930
7938
|
let transcriptHandle = null;
|
|
7931
7939
|
for (let i = ledgerEntries.length - 1; i >= 0; i--) {
|
|
7932
7940
|
const entry = ledgerEntries[i];
|
|
7933
|
-
if (entry.nodeId
|
|
7941
|
+
if (!daemonIdsEquivalent(entry.nodeId, nodeId) || !isTerminalLedgerKind(entry.kind)) continue;
|
|
7934
7942
|
const payload = readRecord3(entry.payload) ?? {};
|
|
7935
7943
|
if (!evidence.available) {
|
|
7936
7944
|
if (payload.source === "refine_mesh_node_async_job") {
|
|
@@ -7976,7 +7984,7 @@ function resolveNodeEvidence(nodeId, ledgerEntries) {
|
|
|
7976
7984
|
function hasBlockedReviewRefineResult(nodeId, ledgerEntries) {
|
|
7977
7985
|
for (let i = ledgerEntries.length - 1; i >= 0; i--) {
|
|
7978
7986
|
const entry = ledgerEntries[i];
|
|
7979
|
-
if (entry.nodeId
|
|
7987
|
+
if (!daemonIdsEquivalent(entry.nodeId, nodeId) || !isTerminalLedgerKind(entry.kind)) continue;
|
|
7980
7988
|
const payload = readRecord3(entry.payload) ?? {};
|
|
7981
7989
|
if (payload.source !== "refine_mesh_node_async_job") continue;
|
|
7982
7990
|
const result = readRecord3(payload.result);
|
|
@@ -8008,7 +8016,7 @@ function deriveMeshReviewInboxItems(args) {
|
|
|
8008
8016
|
if (!reviewReason) continue;
|
|
8009
8017
|
const { evidence, transcriptHandle } = resolveNodeEvidence(nodeId, args.ledgerEntries);
|
|
8010
8018
|
const activeRefineJob = [...refineJobs].reverse().find(
|
|
8011
|
-
(job) => (job.nodeId
|
|
8019
|
+
(job) => (daemonIdsEquivalent(job.nodeId, nodeId) || daemonIdsEquivalent(job.targetNodeId, nodeId)) && (job.status === "accepted" || job.status === "running")
|
|
8012
8020
|
) ?? null;
|
|
8013
8021
|
items.push({
|
|
8014
8022
|
nodeId,
|
|
@@ -8040,6 +8048,7 @@ var init_mesh_review_inbox = __esm({
|
|
|
8040
8048
|
"src/mesh/mesh-review-inbox.ts"() {
|
|
8041
8049
|
"use strict";
|
|
8042
8050
|
init_mesh_refine_status();
|
|
8051
|
+
init_dist();
|
|
8043
8052
|
MAX_CHANGED_FILES = 100;
|
|
8044
8053
|
}
|
|
8045
8054
|
});
|
|
@@ -10156,9 +10165,9 @@ function sessionStatusFromNodes(nodes, nodeId, sessionId) {
|
|
|
10156
10165
|
if (value && typeof value === "object") candidates.push(value);
|
|
10157
10166
|
}
|
|
10158
10167
|
const session = candidates.find((item) => {
|
|
10159
|
-
if (typeof item === "string") return item
|
|
10168
|
+
if (typeof item === "string") return sessionIdsEquivalent(item, sessionId);
|
|
10160
10169
|
const id = readString6(item?.id) || readString6(item?.sessionId) || readString6(item?.session_id) || readString6(item?.runtimeSessionId) || readString6(item?.instanceId);
|
|
10161
|
-
return id
|
|
10170
|
+
return sessionIdsEquivalent(id, sessionId);
|
|
10162
10171
|
});
|
|
10163
10172
|
if (!session) return { staleReason: "direct task session is not present in live session records" };
|
|
10164
10173
|
if (typeof session === "string") return {};
|
|
@@ -10183,8 +10192,8 @@ function terminalMatchesDispatch(terminal, dispatch, taskId) {
|
|
|
10183
10192
|
const terminalTaskId = readString6(terminal.payload?.taskId);
|
|
10184
10193
|
if (terminalTaskId && terminalTaskId === taskId) return true;
|
|
10185
10194
|
if (terminalTaskId && terminalTaskId !== taskId) return false;
|
|
10186
|
-
if (dispatch.sessionId && terminal.sessionId
|
|
10187
|
-
return Boolean(dispatch.nodeId && terminal.nodeId
|
|
10195
|
+
if (dispatch.sessionId && sessionIdsEquivalent(terminal.sessionId, dispatch.sessionId)) return true;
|
|
10196
|
+
return Boolean(dispatch.nodeId && daemonIdsEquivalent(terminal.nodeId, dispatch.nodeId) && !dispatch.sessionId);
|
|
10188
10197
|
}
|
|
10189
10198
|
function statusFromTerminal(entry) {
|
|
10190
10199
|
if (entry.kind === "task_approval_needed") return "awaiting_approval";
|
|
@@ -11443,7 +11452,7 @@ function findRecentTerminalLedgerEvidence(args) {
|
|
|
11443
11452
|
for (let i = entries.length - 1; i >= 0; i--) {
|
|
11444
11453
|
const entry = entries[i];
|
|
11445
11454
|
if (entry.kind !== "task_completed" && entry.kind !== "task_failed" && entry.kind !== "task_stalled") continue;
|
|
11446
|
-
if (args.sessionId && entry.sessionId
|
|
11455
|
+
if (args.sessionId && sessionIdsEquivalent(entry.sessionId, args.sessionId)) {
|
|
11447
11456
|
return { id: entry.id, kind: entry.kind, payload: entry.payload || {}, timestamp: entry.timestamp };
|
|
11448
11457
|
}
|
|
11449
11458
|
if (!args.sessionId && args.nodeId && meshNodeIdMatches(entry, args.nodeId)) {
|
|
@@ -11460,7 +11469,7 @@ function hasDispatchAfterTerminal(meshId, sessionId, terminalId) {
|
|
|
11460
11469
|
if (entry.id === terminalId) pastTerminal = true;
|
|
11461
11470
|
continue;
|
|
11462
11471
|
}
|
|
11463
|
-
if (entry.kind === "task_dispatched" && entry.sessionId
|
|
11472
|
+
if (entry.kind === "task_dispatched" && sessionIdsEquivalent(entry.sessionId, sessionId)) return true;
|
|
11464
11473
|
}
|
|
11465
11474
|
return false;
|
|
11466
11475
|
}
|
|
@@ -11468,7 +11477,7 @@ function hasUnterminalDirectDispatchLedgerEntry(meshId, sessionId) {
|
|
|
11468
11477
|
const entries = readLedgerEntries(meshId, { tail: 200 });
|
|
11469
11478
|
for (let i = entries.length - 1; i >= 0; i--) {
|
|
11470
11479
|
const entry = entries[i];
|
|
11471
|
-
if (entry.sessionId
|
|
11480
|
+
if (!sessionIdsEquivalent(entry.sessionId, sessionId)) continue;
|
|
11472
11481
|
if (entry.kind === "task_completed" || entry.kind === "task_failed" || entry.kind === "task_stalled") {
|
|
11473
11482
|
return false;
|
|
11474
11483
|
}
|
|
@@ -11488,7 +11497,7 @@ function findTerminalLedgerEvidenceForTask(args) {
|
|
|
11488
11497
|
const terminalTaskId = readNonEmptyString2(entry.payload?.taskId);
|
|
11489
11498
|
if (terminalTaskId !== taskId) continue;
|
|
11490
11499
|
if (entry.kind === "task_completed" && isWeakCompletionEvidence(entry.payload)) continue;
|
|
11491
|
-
if (args.sessionId && entry.sessionId && entry.sessionId
|
|
11500
|
+
if (args.sessionId && entry.sessionId && !sessionIdsEquivalent(entry.sessionId, args.sessionId)) continue;
|
|
11492
11501
|
if (!args.sessionId && args.nodeId && entry.nodeId && !meshNodeIdMatches(entry, args.nodeId)) continue;
|
|
11493
11502
|
return { id: entry.id, kind: entry.kind, payload: entry.payload || {}, timestamp: entry.timestamp };
|
|
11494
11503
|
}
|
|
@@ -11501,7 +11510,7 @@ function findDirectDispatchLedgerEntry(args) {
|
|
|
11501
11510
|
if (entry.kind !== "task_dispatched") continue;
|
|
11502
11511
|
const payloadTaskId = readNonEmptyString2(entry.payload?.taskId);
|
|
11503
11512
|
if (payloadTaskId !== args.taskId) continue;
|
|
11504
|
-
if (args.sessionId && entry.sessionId && entry.sessionId
|
|
11513
|
+
if (args.sessionId && entry.sessionId && !sessionIdsEquivalent(entry.sessionId, args.sessionId)) continue;
|
|
11505
11514
|
return {
|
|
11506
11515
|
id: entry.id,
|
|
11507
11516
|
timestamp: entry.timestamp,
|
|
@@ -11534,7 +11543,7 @@ function hasTerminalLedgerAfterDispatch(args) {
|
|
|
11534
11543
|
const terminalTaskId = readNonEmptyString2(entry.payload?.taskId);
|
|
11535
11544
|
if (terminalTaskId && terminalTaskId === args.taskId) return true;
|
|
11536
11545
|
if (terminalTaskId && terminalTaskId !== args.taskId) continue;
|
|
11537
|
-
if (args.sessionId && entry.sessionId
|
|
11546
|
+
if (args.sessionId && sessionIdsEquivalent(entry.sessionId, args.sessionId)) return true;
|
|
11538
11547
|
}
|
|
11539
11548
|
return false;
|
|
11540
11549
|
}
|
|
@@ -12860,7 +12869,7 @@ function nodeHasActiveMeshWork(components, meshId, nodeId, currentSessionId) {
|
|
|
12860
12869
|
const instNodeId = readNonEmptyString2(settings.meshNodeId) || readNonEmptyString2(settings.nodeId);
|
|
12861
12870
|
if (!daemonIdsEquivalent(instNodeId, nodeId)) return false;
|
|
12862
12871
|
const sessionId = readNonEmptyString2(state.instanceId);
|
|
12863
|
-
if (currentSessionId && sessionId
|
|
12872
|
+
if (currentSessionId && sessionIdsEquivalent(sessionId, currentSessionId) && isIdleSessionState(state)) return false;
|
|
12864
12873
|
return sessionStateLooksActive(state);
|
|
12865
12874
|
});
|
|
12866
12875
|
}
|
|
@@ -12934,11 +12943,11 @@ function activeProviderAssignedCount(meshId, nodeId, providerType) {
|
|
|
12934
12943
|
return getQueue(meshId, { status: ["assigned"] }).filter((task) => daemonIdsEquivalent(task.assignedNodeId, nodeId) && task.assignedProviderType === providerType).length;
|
|
12935
12944
|
}
|
|
12936
12945
|
function sessionHasActiveAssignment(meshId, sessionId) {
|
|
12937
|
-
if (getQueue(meshId, { status: ["assigned"] }).some((task) => task.assignedSessionId
|
|
12946
|
+
if (getQueue(meshId, { status: ["assigned"] }).some((task) => sessionIdsEquivalent(task.assignedSessionId, sessionId))) {
|
|
12938
12947
|
return true;
|
|
12939
12948
|
}
|
|
12940
12949
|
try {
|
|
12941
|
-
if (getActiveDirectDispatches(meshId).some((d) => d.sessionId
|
|
12950
|
+
if (getActiveDirectDispatches(meshId).some((d) => sessionIdsEquivalent(d.sessionId, sessionId))) return true;
|
|
12942
12951
|
if (hasUnterminalDirectDispatchLedgerEntry(meshId, sessionId)) return true;
|
|
12943
12952
|
} catch {
|
|
12944
12953
|
}
|
|
@@ -13571,7 +13580,7 @@ function resolveWorkerDelegateRouting(components, instanceId, deps) {
|
|
|
13571
13580
|
if (coordinatorMeshId) {
|
|
13572
13581
|
let hasActiveDispatch = false;
|
|
13573
13582
|
try {
|
|
13574
|
-
hasActiveDispatch = getActiveDirectDispatches(coordinatorMeshId).some((d) => d.sessionId
|
|
13583
|
+
hasActiveDispatch = getActiveDirectDispatches(coordinatorMeshId).some((d) => sessionIdsEquivalent(d.sessionId, instanceId)) || hasUnterminalDirectDispatchLedgerEntry(coordinatorMeshId, instanceId);
|
|
13575
13584
|
} catch {
|
|
13576
13585
|
}
|
|
13577
13586
|
if (!hasActiveDispatch) return reject("coordinator_not_dispatch_target");
|
|
@@ -16145,7 +16154,7 @@ function hasRecentIntentionalCleanupStop(meshId, sessionId, nodeId) {
|
|
|
16145
16154
|
const timestamp = new Date(entry.timestamp).getTime();
|
|
16146
16155
|
if (!Number.isNaN(timestamp) && timestamp < cutoff) break;
|
|
16147
16156
|
if (!isIntentionalCleanupStopEntry(entry)) continue;
|
|
16148
|
-
if (sessionId && entry.sessionId
|
|
16157
|
+
if (sessionId && sessionIdsEquivalent(entry.sessionId, sessionId)) return true;
|
|
16149
16158
|
if (!sessionId && nodeId && meshNodeIdMatches(entry, nodeId)) return true;
|
|
16150
16159
|
}
|
|
16151
16160
|
return false;
|
|
@@ -16265,7 +16274,7 @@ function supersedesTruncatedTerminalSummary(args) {
|
|
|
16265
16274
|
}
|
|
16266
16275
|
function resolveActiveDirectDispatchTaskId(meshId, sessionId) {
|
|
16267
16276
|
try {
|
|
16268
|
-
const matches = getActiveDirectDispatches(meshId).filter((d) => d.sessionId
|
|
16277
|
+
const matches = getActiveDirectDispatches(meshId).filter((d) => sessionIdsEquivalent(d.sessionId, sessionId));
|
|
16269
16278
|
if (!matches.length) return void 0;
|
|
16270
16279
|
return readNonEmptyString2(matches[matches.length - 1].taskId) || void 0;
|
|
16271
16280
|
} catch {
|
|
@@ -17059,7 +17068,7 @@ function flushPendingForMeshIdleCoordinators(components, meshId) {
|
|
|
17059
17068
|
let delivered = 0;
|
|
17060
17069
|
for (const pending of pendingEvents) {
|
|
17061
17070
|
const wantSession = readNonEmptyString2(pending.targetCoordinatorSessionId);
|
|
17062
|
-
const targets = wantSession ? idleCoordinators.filter((c) => c.sessionId
|
|
17071
|
+
const targets = wantSession ? idleCoordinators.filter((c) => sessionIdsEquivalent(c.sessionId, wantSession)) : idleCoordinators;
|
|
17063
17072
|
if (targets.length === 0 || !pending.coordinatorMessage) {
|
|
17064
17073
|
try {
|
|
17065
17074
|
queuePendingMeshCoordinatorEvent(pending);
|
|
@@ -17114,7 +17123,7 @@ function setupMeshEventForwarding(components) {
|
|
|
17114
17123
|
}
|
|
17115
17124
|
let hasDirectDispatch = false;
|
|
17116
17125
|
try {
|
|
17117
|
-
hasDirectDispatch = getActiveDirectDispatches(coordinatorMeshId).some((d) => d.sessionId
|
|
17126
|
+
hasDirectDispatch = getActiveDirectDispatches(coordinatorMeshId).some((d) => sessionIdsEquivalent(d.sessionId, flushInstanceId)) || hasUnterminalDirectDispatchLedgerEntry(coordinatorMeshId, flushInstanceId);
|
|
17118
17127
|
} catch {
|
|
17119
17128
|
}
|
|
17120
17129
|
if (!hasDirectDispatch) return;
|
|
@@ -17449,7 +17458,7 @@ function drainAndInjectIntoTargets(meshId, drainDaemonIds, localDaemonId, target
|
|
|
17449
17458
|
for (const pending of pendingEvents) {
|
|
17450
17459
|
const wantSession = readNonEmptyString2(pending.targetCoordinatorSessionId);
|
|
17451
17460
|
if (wantSession) {
|
|
17452
|
-
const matched = targetCoordinators.filter((c) => c.sessionId
|
|
17461
|
+
const matched = targetCoordinators.filter((c) => sessionIdsEquivalent(c.sessionId, wantSession));
|
|
17453
17462
|
if (matched.length === 0) {
|
|
17454
17463
|
holdOrExpireStrictUnmatchedEvent(pending, wantSession, meshId);
|
|
17455
17464
|
continue;
|
|
@@ -54243,7 +54252,7 @@ async function hydrateInlineMeshDirectTruth(args) {
|
|
|
54243
54252
|
const workspace = readStringValue(node?.workspace);
|
|
54244
54253
|
const daemonId = readStringValue(node?.daemonId);
|
|
54245
54254
|
const isSelfNode = Boolean(
|
|
54246
|
-
nodeId && selectedCoordinatorNodeId && nodeId
|
|
54255
|
+
nodeId && selectedCoordinatorNodeId && daemonIdsEquivalent(nodeId, selectedCoordinatorNodeId)
|
|
54247
54256
|
) || Boolean(
|
|
54248
54257
|
daemonId && (daemonIdsEquivalent(daemonId, args.localMachineId) || daemonIdsEquivalent(daemonId, args.statusInstanceId))
|
|
54249
54258
|
) || Boolean(args.meshSource !== "local_config" && nodeIndex === 0);
|
|
@@ -54305,7 +54314,7 @@ async function hydrateInlineMeshDirectTruth(args) {
|
|
|
54305
54314
|
const nodeId = normalizeMeshNodeId(node) || `node_${nodeIndex}`;
|
|
54306
54315
|
const daemonId = readStringValue(node?.daemonId);
|
|
54307
54316
|
const isSelfNode = Boolean(
|
|
54308
|
-
nodeId && selectedCoordinatorNodeId && nodeId
|
|
54317
|
+
nodeId && selectedCoordinatorNodeId && daemonIdsEquivalent(nodeId, selectedCoordinatorNodeId)
|
|
54309
54318
|
) || Boolean(
|
|
54310
54319
|
daemonId && (daemonIdsEquivalent(daemonId, args.localMachineId) || daemonIdsEquivalent(daemonId, args.statusInstanceId))
|
|
54311
54320
|
);
|
|
@@ -54374,7 +54383,7 @@ function summarizeMeshSessionRecord(record) {
|
|
|
54374
54383
|
}
|
|
54375
54384
|
function liveSessionRecordMatchesMeshNode(record, meshId, nodeId, nodeWorkspace = "", nodeIsMissingLocalWorktree = false) {
|
|
54376
54385
|
const recordNodeId = readStringValue(record?.meta?.meshNodeId);
|
|
54377
|
-
if (!recordNodeId || recordNodeId
|
|
54386
|
+
if (!recordNodeId || !daemonIdsEquivalent(recordNodeId, nodeId)) return false;
|
|
54378
54387
|
if (nodeIsMissingLocalWorktree) return false;
|
|
54379
54388
|
const recordWorkspace = readStringValue(record?.workspace);
|
|
54380
54389
|
if (nodeWorkspace && recordWorkspace && !meshWorkspacesEquivalent(recordWorkspace, nodeWorkspace)) return false;
|
|
@@ -54406,7 +54415,7 @@ function collectLiveMeshSessionRecords(args) {
|
|
|
54406
54415
|
const nodeIsMissingLocalWorktree = args.node?.isLocalWorktree === true && !!nodeWorkspace && !fs29.existsSync(nodeWorkspace);
|
|
54407
54416
|
const matches = args.liveSessionRecords.filter((record) => {
|
|
54408
54417
|
const recordNodeId = readStringValue(record?.meta?.meshNodeId);
|
|
54409
|
-
if (recordNodeId && recordNodeId
|
|
54418
|
+
if (recordNodeId && !daemonIdsEquivalent(recordNodeId, args.nodeId)) return false;
|
|
54410
54419
|
if (liveSessionRecordMatchesMeshNode(record, args.meshId, args.nodeId, nodeWorkspace || "", nodeIsMissingLocalWorktree)) return true;
|
|
54411
54420
|
if (nodeIsMissingLocalWorktree) return false;
|
|
54412
54421
|
return !!nodeWorkspace && liveSessionRecordMatchesMeshWorkspace(record, args.meshId, nodeWorkspace);
|
|
@@ -54415,7 +54424,7 @@ function collectLiveMeshSessionRecords(args) {
|
|
|
54415
54424
|
for (const record of args.liveSessionRecords) {
|
|
54416
54425
|
if (readStringValue(record?.meta?.meshCoordinatorFor) !== args.meshId) continue;
|
|
54417
54426
|
const sessionId = readStringValue(record?.sessionId);
|
|
54418
|
-
if (sessionId && matches.some((entry) => readStringValue(entry?.sessionId)
|
|
54427
|
+
if (sessionId && matches.some((entry) => sessionIdsEquivalent(readStringValue(entry?.sessionId), sessionId))) continue;
|
|
54419
54428
|
matches.push(record);
|
|
54420
54429
|
}
|
|
54421
54430
|
}
|