@adhdev/daemon-core 0.9.82-rc.336 → 0.9.82-rc.337
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 +33 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -5
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-events-utils.d.ts +19 -0
- package/package.json +2 -2
- package/src/mesh/mesh-events-coordinator.ts +15 -0
- package/src/mesh/mesh-events-utils.ts +46 -0
package/dist/index.mjs
CHANGED
|
@@ -311,10 +311,10 @@ function readInjected(value) {
|
|
|
311
311
|
}
|
|
312
312
|
function getDaemonBuildInfo() {
|
|
313
313
|
if (cached) return cached;
|
|
314
|
-
const commit = readInjected(true ? "
|
|
315
|
-
const commitShort = readInjected(true ? "
|
|
316
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
317
|
-
const builtAt = readInjected(true ? "2026-06-20T06:
|
|
314
|
+
const commit = readInjected(true ? "587b2d866182a5b6c086d23d9f6cc32d22ca50f5" : void 0) ?? "unknown";
|
|
315
|
+
const commitShort = readInjected(true ? "587b2d86" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
316
|
+
const version = readInjected(true ? "0.9.82-rc.337" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
317
|
+
const builtAt = readInjected(true ? "2026-06-20T06:37:55.432Z" : void 0);
|
|
318
318
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
319
319
|
return cached;
|
|
320
320
|
}
|
|
@@ -7857,6 +7857,26 @@ function readRefineJobId(event) {
|
|
|
7857
7857
|
function readWorkerResultMetadata(event) {
|
|
7858
7858
|
return readRecord4(event.workerResult) || readRecord4(event.meshWorkerResult) || readRecord4(event.structuredResult);
|
|
7859
7859
|
}
|
|
7860
|
+
function resolveMeshSurfacedSessionPreview(metadataEvent) {
|
|
7861
|
+
const workerResult = readWorkerResultMetadata(metadataEvent);
|
|
7862
|
+
const resultRecord = readRecord4(metadataEvent.result);
|
|
7863
|
+
const summaryText = readNonEmptyString2(metadataEvent.finalSummary) || readNonEmptyString2(workerResult?.summary) || readNonEmptyString2(workerResult?.finalSummary) || readNonEmptyString2(resultRecord?.summary) || readNonEmptyString2(resultRecord?.finalSummary);
|
|
7864
|
+
if (!summaryText) return void 0;
|
|
7865
|
+
const truncationSuffix = "...[truncated]";
|
|
7866
|
+
const preview = summaryText.length > MESH_SURFACED_PREVIEW_MAX_CHARS ? `${summaryText.slice(0, MESH_SURFACED_PREVIEW_MAX_CHARS - truncationSuffix.length)}${truncationSuffix}` : summaryText;
|
|
7867
|
+
const timestamp = readEventTimestampValue(metadataEvent.timestamp);
|
|
7868
|
+
return { preview, role: "assistant", receivedAt: timestamp };
|
|
7869
|
+
}
|
|
7870
|
+
function readEventTimestampValue(value) {
|
|
7871
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
7872
|
+
if (typeof value === "string" && value.trim()) {
|
|
7873
|
+
const parsed = Number(value);
|
|
7874
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
7875
|
+
const dateMs = Date.parse(value);
|
|
7876
|
+
if (Number.isFinite(dateMs)) return dateMs;
|
|
7877
|
+
}
|
|
7878
|
+
return 0;
|
|
7879
|
+
}
|
|
7860
7880
|
function formatCompletionMetadata(event) {
|
|
7861
7881
|
const completionDiagnostic = event.completionDiagnostic && typeof event.completionDiagnostic === "object" ? event.completionDiagnostic : null;
|
|
7862
7882
|
const diagnosticReason = completionDiagnostic ? readNonEmptyString2(completionDiagnostic.blockReason) || "present" : "";
|
|
@@ -7986,9 +8006,11 @@ Next step: ${nextStep}`;
|
|
|
7986
8006
|
}
|
|
7987
8007
|
return "";
|
|
7988
8008
|
}
|
|
8009
|
+
var MESH_SURFACED_PREVIEW_MAX_CHARS;
|
|
7989
8010
|
var init_mesh_events_utils = __esm({
|
|
7990
8011
|
"src/mesh/mesh-events-utils.ts"() {
|
|
7991
8012
|
"use strict";
|
|
8013
|
+
MESH_SURFACED_PREVIEW_MAX_CHARS = 512;
|
|
7992
8014
|
}
|
|
7993
8015
|
});
|
|
7994
8016
|
|
|
@@ -10399,6 +10421,7 @@ function injectMeshSystemMessage(components, args) {
|
|
|
10399
10421
|
);
|
|
10400
10422
|
if (components.onMeshCoordinatorEventForwarded) {
|
|
10401
10423
|
try {
|
|
10424
|
+
const surfacedPreview = resolveMeshSurfacedSessionPreview(args.metadataEvent);
|
|
10402
10425
|
components.onMeshCoordinatorEventForwarded({
|
|
10403
10426
|
event: args.event,
|
|
10404
10427
|
meshId: args.meshId,
|
|
@@ -10407,7 +10430,12 @@ function injectMeshSystemMessage(components, args) {
|
|
|
10407
10430
|
// Ensure a `workspace` field reaches updateMeshOwnedSession even when the
|
|
10408
10431
|
// worker provider event only carried `workspaceName`. The merge spread of
|
|
10409
10432
|
// metadataEvent above wins when it already has a non-empty `workspace`.
|
|
10410
|
-
workspace: readNonEmptyString2(args.metadataEvent.workspace) || readNonEmptyString2(args.metadataEvent.workspaceName) || void 0
|
|
10433
|
+
workspace: readNonEmptyString2(args.metadataEvent.workspace) || readNonEmptyString2(args.metadataEvent.workspaceName) || void 0,
|
|
10434
|
+
...surfacedPreview ? {
|
|
10435
|
+
meshSessionLastMessagePreview: surfacedPreview.preview,
|
|
10436
|
+
meshSessionLastMessageRole: surfacedPreview.role,
|
|
10437
|
+
meshSessionLastMessageAt: surfacedPreview.receivedAt || void 0
|
|
10438
|
+
} : {}
|
|
10411
10439
|
});
|
|
10412
10440
|
} catch {
|
|
10413
10441
|
}
|