@adhdev/daemon-core 0.9.82-rc.350 → 0.9.82-rc.351
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.d.ts +1 -0
- package/dist/index.js +108 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +106 -31
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-runtime-store.d.ts +1 -0
- package/package.json +2 -2
- package/src/index.ts +5 -0
- package/src/mesh/mesh-active-work.ts +64 -20
- package/src/mesh/mesh-events-coordinator.ts +84 -5
- package/src/mesh/mesh-events-pending.ts +13 -4
- package/src/mesh/mesh-events-stale.ts +17 -0
- package/src/mesh/mesh-runtime-store.ts +5 -1
- package/src/mesh/mesh-task-stats.ts +8 -1
package/dist/index.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export type { MeshAsyncRefineJobStatus, MeshAsyncRefineJobSummary, MeshAsyncRefi
|
|
|
59
59
|
export { buildMeshHostRequiredFailure, createDefaultMeshHostMetadata, isMeshHostOwner, normalizeMeshDaemonRole, requireMeshHostQueueOwner, resolveMeshHostStatus } from './mesh/mesh-host-ownership.js';
|
|
60
60
|
export { triggerMeshQueue, drainPendingMeshCoordinatorEvents, getPendingMeshCoordinatorEvents, clearPendingMeshCoordinatorEvents, queuePendingMeshCoordinatorEvent, reconcileDirectDispatchCompletionFromTranscript } from './mesh/mesh-events.js';
|
|
61
61
|
export type { PendingMeshCoordinatorEvent } from './mesh/mesh-events.js';
|
|
62
|
+
export { resolveMeshSurfacedSessionPreview, readMeshCompletionSummary } from './mesh/mesh-events-utils.js';
|
|
62
63
|
export { resolveDeliveryDecision, createSessionDelivery, updateSessionDeliveryStatus, getActiveSessionDeliveries, markSessionDeliveriesTerminal, recordCompletionConflict, getRecentCompletionConflicts } from './mesh/mesh-delivery-policy.js';
|
|
63
64
|
export type { MeshSessionDeliveryStatus, MeshSessionDeliveryKind, MeshDeliveryDecision, MeshDeliveryPolicyResult, SessionDeliveryRecord } from './mesh/mesh-delivery-policy.js';
|
|
64
65
|
export { P2pRelayFailureError, buildP2pRelayFailurePayload, classifyP2pRelayFailure, isP2pRelayTransportFailure, } from './mesh/p2p-relay-failure.js';
|
package/dist/index.js
CHANGED
|
@@ -316,10 +316,10 @@ function readInjected(value) {
|
|
|
316
316
|
}
|
|
317
317
|
function getDaemonBuildInfo() {
|
|
318
318
|
if (cached) return cached;
|
|
319
|
-
const commit = readInjected(true ? "
|
|
320
|
-
const commitShort = readInjected(true ? "
|
|
321
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
322
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
319
|
+
const commit = readInjected(true ? "dad22ef2758130d10a3d55e3c419f0095d5e44b7" : void 0) ?? "unknown";
|
|
320
|
+
const commitShort = readInjected(true ? "dad22ef2" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
321
|
+
const version = readInjected(true ? "0.9.82-rc.351" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
322
|
+
const builtAt = readInjected(true ? "2026-06-22T04:04:59.936Z" : void 0);
|
|
323
323
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
324
324
|
return cached;
|
|
325
325
|
}
|
|
@@ -4676,6 +4676,10 @@ var init_mesh_runtime_store = __esm({
|
|
|
4676
4676
|
migratedMeshIds = /* @__PURE__ */ new Set();
|
|
4677
4677
|
fingerprintSweepCounter = 0;
|
|
4678
4678
|
walWriteCounter = 0;
|
|
4679
|
+
// Independent cadence for the tool-call-log sweep. Must NOT share walWriteCounter:
|
|
4680
|
+
// sharing makes each store's threshold drift by the other's write volume (WAL
|
|
4681
|
+
// checkpoint at 500 vs tool-log sweep at 200 would interfere arbitrarily).
|
|
4682
|
+
toolCallLogCounter = 0;
|
|
4679
4683
|
static WAL_CHECK_INTERVAL = 500;
|
|
4680
4684
|
static WAL_MAX_BYTES = 50 * 1024 * 1024;
|
|
4681
4685
|
// 50 MB
|
|
@@ -5569,7 +5573,7 @@ var init_mesh_runtime_store = __esm({
|
|
|
5569
5573
|
"SELECT COUNT(*) as cnt FROM mesh_tool_call_log WHERE mesh_id = ? AND tool = ? AND called_at >= ?"
|
|
5570
5574
|
).get(meshId, tool, windowStart);
|
|
5571
5575
|
const callsInWindow = row?.cnt ?? 0;
|
|
5572
|
-
if (++this.
|
|
5576
|
+
if (++this.toolCallLogCounter % 200 === 0) {
|
|
5573
5577
|
this.db.prepare(
|
|
5574
5578
|
"DELETE FROM mesh_tool_call_log WHERE called_at < ?"
|
|
5575
5579
|
).run(now - Math.max(windowMs * 10, 6e4));
|
|
@@ -6024,9 +6028,9 @@ function computeMeshTaskStats(meshId, opts) {
|
|
|
6024
6028
|
}
|
|
6025
6029
|
return targetIds.map((taskId) => {
|
|
6026
6030
|
const queueEntry = queueById.get(taskId);
|
|
6027
|
-
const status = queueEntry?.status ?? "unknown";
|
|
6028
6031
|
const dispatch = dispatches.get(taskId);
|
|
6029
6032
|
const terminal = terminals.get(taskId);
|
|
6033
|
+
const status = queueEntry?.status ?? (terminal ? terminal.kind === "task_completed" ? "completed" : "failed" : "unknown");
|
|
6030
6034
|
const isTerminalStatus = status === "completed" || status === "failed" || status === "cancelled";
|
|
6031
6035
|
const dispatchTime = parseTime(dispatch?.first ?? queueEntry?.dispatchTimestamp);
|
|
6032
6036
|
const terminalTime = parseTime(terminal?.at);
|
|
@@ -8035,6 +8039,14 @@ function statusFromTerminal(entry) {
|
|
|
8035
8039
|
if (entry.kind === "task_completed") return "idle";
|
|
8036
8040
|
return "failed";
|
|
8037
8041
|
}
|
|
8042
|
+
function classifyDirectDispatch(params) {
|
|
8043
|
+
const { status, isTerminalRow, hasTerminalStatus, liveStatus, liveStaleReason, dispatchedToIdleSession } = params;
|
|
8044
|
+
const isNoTransition = !hasTerminalStatus && !liveStatus;
|
|
8045
|
+
const isIdleUnacknowledged = status === "idle";
|
|
8046
|
+
const ledgerOnlyStaleReason = !isTerminalRow && (isIdleUnacknowledged || isNoTransition || dispatchedToIdleSession && isIdleUnacknowledged) ? LEDGER_ONLY_STALE_REASON : void 0;
|
|
8047
|
+
const isFreshUnacknowledged = Boolean(ledgerOnlyStaleReason && !liveStaleReason);
|
|
8048
|
+
return { ledgerOnlyStaleReason, isFreshUnacknowledged };
|
|
8049
|
+
}
|
|
8038
8050
|
function buildMeshActiveWorkSummary(activeWork) {
|
|
8039
8051
|
const statusCounts = {
|
|
8040
8052
|
pending: 0,
|
|
@@ -8097,10 +8109,14 @@ function buildMeshActiveWork(opts) {
|
|
|
8097
8109
|
const dbStatus = dispatch.status;
|
|
8098
8110
|
const isTerminal = dbStatus === "completed" || dbStatus === "failed" || dbStatus === "stale";
|
|
8099
8111
|
const status = isTerminal ? dbStatus === "completed" ? "idle" : "failed" : live.status || (dbStatus === "acked" ? "generating" : "assigned");
|
|
8100
|
-
const
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8112
|
+
const { ledgerOnlyStaleReason, isFreshUnacknowledged } = classifyDirectDispatch({
|
|
8113
|
+
status,
|
|
8114
|
+
isTerminalRow: isTerminal,
|
|
8115
|
+
hasTerminalStatus: isTerminal,
|
|
8116
|
+
liveStatus: live.status,
|
|
8117
|
+
liveStaleReason: live.staleReason,
|
|
8118
|
+
dispatchedToIdleSession: dispatch.dispatchedToIdleSession === true
|
|
8119
|
+
});
|
|
8104
8120
|
const { title, summary: summary2 } = summarizeMessage(dispatch.message || "");
|
|
8105
8121
|
const record = {
|
|
8106
8122
|
taskId: dispatch.taskId,
|
|
@@ -8143,13 +8159,16 @@ function buildMeshActiveWork(opts) {
|
|
|
8143
8159
|
const live = sessionStatusFromNodes(opts.nodes, dispatch.nodeId, dispatch.sessionId);
|
|
8144
8160
|
const status = terminalStatus || live.status || "assigned";
|
|
8145
8161
|
const terminalRow = Boolean(terminal && terminal.kind !== "task_approval_needed");
|
|
8146
|
-
const
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8162
|
+
const { ledgerOnlyStaleReason, isFreshUnacknowledged } = classifyDirectDispatch({
|
|
8163
|
+
status,
|
|
8164
|
+
isTerminalRow: terminalRow,
|
|
8165
|
+
hasTerminalStatus: Boolean(terminalStatus),
|
|
8166
|
+
liveStatus: live.status,
|
|
8167
|
+
liveStaleReason: live.staleReason,
|
|
8168
|
+
dispatchedToIdleSession: dispatch.payload?.dispatchedToIdleSession === true
|
|
8169
|
+
});
|
|
8150
8170
|
const message = readString6(dispatch.payload?.message) || readString6(dispatch.payload?.summary) || "";
|
|
8151
8171
|
const { title, summary: summary2 } = summarizeMessage(message);
|
|
8152
|
-
const isFreshUnacknowledged = Boolean(ledgerOnlyStaleReason && !live.staleReason);
|
|
8153
8172
|
const record = {
|
|
8154
8173
|
taskId,
|
|
8155
8174
|
source: "direct",
|
|
@@ -8191,13 +8210,16 @@ function buildMeshActiveWork(opts) {
|
|
|
8191
8210
|
const live = sessionStatusFromNodes(opts.nodes, dispatch.nodeId, dispatch.sessionId);
|
|
8192
8211
|
const status = terminalStatus || live.status || "assigned";
|
|
8193
8212
|
const terminalRow = Boolean(terminal && terminal.kind !== "task_approval_needed");
|
|
8194
|
-
const
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8213
|
+
const { ledgerOnlyStaleReason, isFreshUnacknowledged } = classifyDirectDispatch({
|
|
8214
|
+
status,
|
|
8215
|
+
isTerminalRow: terminalRow,
|
|
8216
|
+
hasTerminalStatus: Boolean(terminalStatus),
|
|
8217
|
+
liveStatus: live.status,
|
|
8218
|
+
liveStaleReason: live.staleReason,
|
|
8219
|
+
dispatchedToIdleSession: dispatch.payload?.dispatchedToIdleSession === true
|
|
8220
|
+
});
|
|
8198
8221
|
const message = readString6(dispatch.payload?.message) || readString6(dispatch.payload?.summary) || "";
|
|
8199
8222
|
const { title, summary: summary2 } = summarizeMessage(message);
|
|
8200
|
-
const isFreshUnacknowledged = Boolean(ledgerOnlyStaleReason && !live.staleReason);
|
|
8201
8223
|
const record = {
|
|
8202
8224
|
taskId,
|
|
8203
8225
|
source: "direct",
|
|
@@ -8348,7 +8370,7 @@ function buildCompactStaleDirectWorkSummary(staleDirectWork, opts = {}) {
|
|
|
8348
8370
|
...opts.note ? { note: opts.note } : {}
|
|
8349
8371
|
};
|
|
8350
8372
|
}
|
|
8351
|
-
var DIRECT_DISPATCH_VIA, TERMINAL_LEDGER_KINDS, PRUNABLE_ORPHAN_STALE_REASONS;
|
|
8373
|
+
var DIRECT_DISPATCH_VIA, TERMINAL_LEDGER_KINDS, LEDGER_ONLY_STALE_REASON, PRUNABLE_ORPHAN_STALE_REASONS;
|
|
8352
8374
|
var init_mesh_active_work = __esm({
|
|
8353
8375
|
"src/mesh/mesh-active-work.ts"() {
|
|
8354
8376
|
"use strict";
|
|
@@ -8357,6 +8379,7 @@ var init_mesh_active_work = __esm({
|
|
|
8357
8379
|
init_dist();
|
|
8358
8380
|
DIRECT_DISPATCH_VIA = /* @__PURE__ */ new Set(["p2p_direct", "local_direct", "mesh_send_task"]);
|
|
8359
8381
|
TERMINAL_LEDGER_KINDS = /* @__PURE__ */ new Set(["task_completed", "task_failed", "task_stalled"]);
|
|
8382
|
+
LEDGER_ONLY_STALE_REASON = "direct task dispatch has no provider acknowledgement, transcript append, or active runtime transition";
|
|
8360
8383
|
PRUNABLE_ORPHAN_STALE_REASONS = /* @__PURE__ */ new Set([
|
|
8361
8384
|
"direct task node is no longer in the live mesh",
|
|
8362
8385
|
"direct task session is not present in live session records",
|
|
@@ -8793,6 +8816,7 @@ function queuePendingMeshCoordinatorEvent(event) {
|
|
|
8793
8816
|
return true;
|
|
8794
8817
|
}
|
|
8795
8818
|
const fingerprint = buildPendingEventFingerprint(event);
|
|
8819
|
+
let sqliteOk = false;
|
|
8796
8820
|
try {
|
|
8797
8821
|
MeshRuntimeStore.getInstance().insertPendingEvent({
|
|
8798
8822
|
id: (0, import_crypto7.randomUUID)(),
|
|
@@ -8803,11 +8827,17 @@ function queuePendingMeshCoordinatorEvent(event) {
|
|
|
8803
8827
|
fingerprint: fingerprint || null,
|
|
8804
8828
|
queuedAt: event.queuedAt
|
|
8805
8829
|
});
|
|
8830
|
+
sqliteOk = true;
|
|
8806
8831
|
} catch {
|
|
8807
8832
|
}
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8833
|
+
try {
|
|
8834
|
+
const path42 = getPendingEventsPath(event.meshId, event.targetCoordinatorDaemonId);
|
|
8835
|
+
trimPendingEventsIfNeeded(path42);
|
|
8836
|
+
(0, import_fs10.appendFileSync)(path42, JSON.stringify(event) + "\n", "utf-8");
|
|
8837
|
+
} catch (e) {
|
|
8838
|
+
if (!sqliteOk) throw e;
|
|
8839
|
+
LOG.warn("MeshEvents", `JSONL append failed for mesh ${event.meshId}; SQLite holds the event: ${e?.message || e}`);
|
|
8840
|
+
}
|
|
8811
8841
|
return true;
|
|
8812
8842
|
} catch (e) {
|
|
8813
8843
|
LOG.warn("MeshEvents", `Failed to persist pending coordinator event: ${e?.message || e}`);
|
|
@@ -9206,6 +9236,12 @@ function hasUnterminalDirectDispatchLedgerEntry(meshId, sessionId) {
|
|
|
9206
9236
|
}
|
|
9207
9237
|
return false;
|
|
9208
9238
|
}
|
|
9239
|
+
function isWeakCompletionLedgerPayload(payload) {
|
|
9240
|
+
if (!payload) return false;
|
|
9241
|
+
if (payload.evidenceLevel === "insufficient" || payload.reviewRecommended === true) return true;
|
|
9242
|
+
const diag = readRecord4(payload.completionDiagnostic);
|
|
9243
|
+
return diag?.finalAssistantPresent === false || diag?.blockReason === "missing_final_assistant";
|
|
9244
|
+
}
|
|
9209
9245
|
function findDirectDispatchLedgerEntry(args) {
|
|
9210
9246
|
const entries = readLedgerEntries(args.meshId, { tail: 500 });
|
|
9211
9247
|
for (let i = entries.length - 1; i >= 0; i--) {
|
|
@@ -9242,6 +9278,7 @@ function hasTerminalLedgerAfterDispatch(args) {
|
|
|
9242
9278
|
if (!afterDispatch) continue;
|
|
9243
9279
|
}
|
|
9244
9280
|
if (entry.kind !== "task_completed" && entry.kind !== "task_failed" && entry.kind !== "task_stalled") continue;
|
|
9281
|
+
if (entry.kind === "task_completed" && isWeakCompletionLedgerPayload(entry.payload)) continue;
|
|
9245
9282
|
const terminalTaskId = readNonEmptyString2(entry.payload?.taskId);
|
|
9246
9283
|
if (terminalTaskId && terminalTaskId === args.taskId) return true;
|
|
9247
9284
|
if (terminalTaskId && terminalTaskId !== args.taskId) continue;
|
|
@@ -12564,6 +12601,30 @@ function isDuplicateRefineTerminalEvent(meshId, eventName, metadataEvent) {
|
|
|
12564
12601
|
recordFingerprintSeen(fingerprint);
|
|
12565
12602
|
return false;
|
|
12566
12603
|
}
|
|
12604
|
+
function isFalseIdleCompletion(metadataEvent) {
|
|
12605
|
+
const diag = readRecord4(metadataEvent.completionDiagnostic);
|
|
12606
|
+
if (!diag) return false;
|
|
12607
|
+
return diag.finalAssistantPresent === false || diag.blockReason === "missing_final_assistant";
|
|
12608
|
+
}
|
|
12609
|
+
function isGenuineCompletionEvidence(metadataEvent) {
|
|
12610
|
+
if (isFalseIdleCompletion(metadataEvent)) return false;
|
|
12611
|
+
return !!readWorkerResultMetadata(metadataEvent) || !!readNonEmptyString2(metadataEvent.finalSummary);
|
|
12612
|
+
}
|
|
12613
|
+
function isWeakTerminalLedgerPayload(payload) {
|
|
12614
|
+
if (!payload) return false;
|
|
12615
|
+
if (payload.evidenceLevel === "insufficient" || payload.reviewRecommended === true) return true;
|
|
12616
|
+
const diag = readRecord4(payload.completionDiagnostic);
|
|
12617
|
+
return diag?.finalAssistantPresent === false || diag?.blockReason === "missing_final_assistant";
|
|
12618
|
+
}
|
|
12619
|
+
function resolveActiveDirectDispatchTaskId(meshId, sessionId) {
|
|
12620
|
+
try {
|
|
12621
|
+
const matches = getActiveDirectDispatches(meshId).filter((d) => d.sessionId === sessionId);
|
|
12622
|
+
if (!matches.length) return void 0;
|
|
12623
|
+
return readNonEmptyString2(matches[matches.length - 1].taskId) || void 0;
|
|
12624
|
+
} catch {
|
|
12625
|
+
return void 0;
|
|
12626
|
+
}
|
|
12627
|
+
}
|
|
12567
12628
|
function tryAssignQueueTask(components, meshId, nodeId, sessionId, providerType) {
|
|
12568
12629
|
const mesh = getMeshWithCache(components, meshId);
|
|
12569
12630
|
const node = mesh?.nodes.find((n) => readMeshNodeId(n) === nodeId);
|
|
@@ -13408,7 +13469,8 @@ function injectMeshSystemMessage(components, args) {
|
|
|
13408
13469
|
});
|
|
13409
13470
|
if (terminal?.kind === "task_completed" && !sessionHasActiveAssignment(args.meshId, eventSessionId)) {
|
|
13410
13471
|
const newDispatchAfterTerminal = hasDispatchAfterTerminal(args.meshId, eventSessionId, terminal.id);
|
|
13411
|
-
|
|
13472
|
+
const supersedesWeakTerminal = isWeakTerminalLedgerPayload(terminal.payload) && isGenuineCompletionEvidence(args.metadataEvent);
|
|
13473
|
+
if (!newDispatchAfterTerminal && !supersedesWeakTerminal) {
|
|
13412
13474
|
const terminalProviderSessionId = readNonEmptyString2(terminal.payload.providerSessionId);
|
|
13413
13475
|
const terminalFinalSummary = readNonEmptyString2(terminal.payload.finalSummary);
|
|
13414
13476
|
const eventProviderSessionId = readNonEmptyString2(args.metadataEvent.providerSessionId);
|
|
@@ -13454,24 +13516,30 @@ function injectMeshSystemMessage(components, args) {
|
|
|
13454
13516
|
return { success: true, forwarded: 0, suppressed: true, duplicateStopped: true };
|
|
13455
13517
|
}
|
|
13456
13518
|
}
|
|
13457
|
-
function markSessionTerminal(sessionId, outcome, occurredAtMs) {
|
|
13519
|
+
function markSessionTerminal(sessionId, outcome, occurredAtMs, opts) {
|
|
13458
13520
|
const eventTaskId = readNonEmptyString2(args.metadataEvent.taskId) || void 0;
|
|
13459
13521
|
const task = updateSessionTaskStatus(args.meshId, sessionId, outcome, {
|
|
13460
13522
|
occurredAt: occurredAtMs != null ? new Date(occurredAtMs).toISOString() : void 0,
|
|
13461
13523
|
taskId: eventTaskId
|
|
13462
13524
|
});
|
|
13463
|
-
|
|
13525
|
+
const leaveDirectDispatchActive = !task && opts?.tentativeIfDirect === true;
|
|
13526
|
+
if (!leaveDirectDispatchActive) {
|
|
13527
|
+
updateDirectDispatchStatus(args.meshId, sessionId, outcome);
|
|
13528
|
+
}
|
|
13464
13529
|
markSessionDeliveriesTerminal(args.meshId, sessionId, outcome);
|
|
13465
13530
|
setImmediate(() => cleanupTerminalDirectDispatches());
|
|
13466
13531
|
return task ? { id: task.id } : null;
|
|
13467
13532
|
}
|
|
13468
13533
|
let completedTaskForLedger = null;
|
|
13534
|
+
let directDispatchTaskIdForLedger;
|
|
13469
13535
|
if (args.event === "agent:generating_completed") {
|
|
13470
13536
|
const sessionId = resolveEventSessionId(args.metadataEvent, args.sourceInstanceId);
|
|
13471
13537
|
const nodeId = readNonEmptyString2(args.nodeId) || readNonEmptyString2(args.metadataEvent.meshNodeId);
|
|
13472
13538
|
const providerType = readNonEmptyString2(args.metadataEvent.providerType);
|
|
13473
13539
|
if (sessionId) {
|
|
13474
|
-
|
|
13540
|
+
directDispatchTaskIdForLedger = resolveActiveDirectDispatchTaskId(args.meshId, sessionId);
|
|
13541
|
+
const isFalseIdle = isFalseIdleCompletion(args.metadataEvent);
|
|
13542
|
+
completedTaskForLedger = markSessionTerminal(sessionId, "completed", eventTimestamp, { tentativeIfDirect: isFalseIdle });
|
|
13475
13543
|
if (nodeId && providerType) {
|
|
13476
13544
|
runIdleMaintenanceThenAssignQueue(components, { meshId: args.meshId, nodeId, sessionId, providerType });
|
|
13477
13545
|
}
|
|
@@ -13574,6 +13642,7 @@ function injectMeshSystemMessage(components, args) {
|
|
|
13574
13642
|
}
|
|
13575
13643
|
}
|
|
13576
13644
|
if (sessionId) {
|
|
13645
|
+
directDispatchTaskIdForLedger = resolveActiveDirectDispatchTaskId(args.meshId, sessionId);
|
|
13577
13646
|
completedTaskForLedger = markSessionTerminal(sessionId, "failed");
|
|
13578
13647
|
}
|
|
13579
13648
|
}
|
|
@@ -13603,7 +13672,10 @@ function injectMeshSystemMessage(components, args) {
|
|
|
13603
13672
|
payload: {
|
|
13604
13673
|
event: args.event,
|
|
13605
13674
|
nodeLabel: args.nodeLabel,
|
|
13606
|
-
|
|
13675
|
+
// Fix B: fall back to the direct-dispatch taskId when no work-queue row
|
|
13676
|
+
// matched, so the terminal entry is attributable in mesh task-stats
|
|
13677
|
+
// (otherwise the direct task shows status='unknown' / terminalKind=null).
|
|
13678
|
+
taskId: completedTaskForLedger?.id || directDispatchTaskIdForLedger || void 0,
|
|
13607
13679
|
providerSessionId,
|
|
13608
13680
|
finalSummary,
|
|
13609
13681
|
workerResult,
|
|
@@ -20174,6 +20246,7 @@ __export(index_exports, {
|
|
|
20174
20246
|
readLedgerEntries: () => readLedgerEntries,
|
|
20175
20247
|
readLedgerSlice: () => readLedgerSlice,
|
|
20176
20248
|
readLedgerSliceFromStore: () => readLedgerSliceFromStore,
|
|
20249
|
+
readMeshCompletionSummary: () => readMeshCompletionSummary,
|
|
20177
20250
|
reconcileDirectDispatchCompletionFromTranscript: () => reconcileDirectDispatchCompletionFromTranscript,
|
|
20178
20251
|
recordCompletionConflict: () => recordCompletionConflict,
|
|
20179
20252
|
recordDebugTrace: () => recordDebugTrace,
|
|
@@ -20199,6 +20272,7 @@ __export(index_exports, {
|
|
|
20199
20272
|
resolveMeshHostStatus: () => resolveMeshHostStatus,
|
|
20200
20273
|
resolveMeshNodeAttribution: () => resolveMeshNodeAttribution,
|
|
20201
20274
|
resolveMeshRefineValidationPlan: () => resolveMeshRefineValidationPlan,
|
|
20275
|
+
resolveMeshSurfacedSessionPreview: () => resolveMeshSurfacedSessionPreview,
|
|
20202
20276
|
resolveNodeSchedulingPriority: () => resolveNodeSchedulingPriority,
|
|
20203
20277
|
resolveSessionHostAppName: () => resolveSessionHostAppName,
|
|
20204
20278
|
resolveSessionHostAppNameResolution: () => resolveSessionHostAppNameResolution,
|
|
@@ -22117,6 +22191,7 @@ init_mesh_active_work();
|
|
|
22117
22191
|
init_mesh_refine_status();
|
|
22118
22192
|
init_mesh_host_ownership();
|
|
22119
22193
|
init_mesh_events();
|
|
22194
|
+
init_mesh_events_utils();
|
|
22120
22195
|
init_mesh_delivery_policy();
|
|
22121
22196
|
|
|
22122
22197
|
// src/mesh/p2p-relay-failure.ts
|
|
@@ -43673,7 +43748,7 @@ function runGit2(repoRoot, args) {
|
|
|
43673
43748
|
return "";
|
|
43674
43749
|
}
|
|
43675
43750
|
}
|
|
43676
|
-
function
|
|
43751
|
+
function readRecord5(repoRoot) {
|
|
43677
43752
|
const path42 = (0, import_node_path2.resolve)(repoRoot, PREVIEW_DEPLOY_RECORD);
|
|
43678
43753
|
if (!(0, import_node_fs4.existsSync)(path42)) return null;
|
|
43679
43754
|
try {
|
|
@@ -43713,7 +43788,7 @@ function readCurrentMainCommit(repoRoot) {
|
|
|
43713
43788
|
}
|
|
43714
43789
|
function buildPreviewFreshness(repoRoot) {
|
|
43715
43790
|
const current = readCurrentMainCommit(repoRoot);
|
|
43716
|
-
const record =
|
|
43791
|
+
const record = readRecord5(repoRoot);
|
|
43717
43792
|
const lastPreviewCommit = normalizeCommit(record?.lastPreviewCommit);
|
|
43718
43793
|
const targets = readTargetFreshness(record, current.currentMainCommit);
|
|
43719
43794
|
let status = "unknown";
|
|
@@ -60635,6 +60710,7 @@ var V1_CONTRACT_VERSION = "1.0.0";
|
|
|
60635
60710
|
readLedgerEntries,
|
|
60636
60711
|
readLedgerSlice,
|
|
60637
60712
|
readLedgerSliceFromStore,
|
|
60713
|
+
readMeshCompletionSummary,
|
|
60638
60714
|
reconcileDirectDispatchCompletionFromTranscript,
|
|
60639
60715
|
recordCompletionConflict,
|
|
60640
60716
|
recordDebugTrace,
|
|
@@ -60660,6 +60736,7 @@ var V1_CONTRACT_VERSION = "1.0.0";
|
|
|
60660
60736
|
resolveMeshHostStatus,
|
|
60661
60737
|
resolveMeshNodeAttribution,
|
|
60662
60738
|
resolveMeshRefineValidationPlan,
|
|
60739
|
+
resolveMeshSurfacedSessionPreview,
|
|
60663
60740
|
resolveNodeSchedulingPriority,
|
|
60664
60741
|
resolveSessionHostAppName,
|
|
60665
60742
|
resolveSessionHostAppNameResolution,
|