@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 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 ? "40f2025c1de385e59792869a793811db906f4f91" : void 0) ?? "unknown";
320
- const commitShort = readInjected(true ? "40f2025c" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
321
- const version = readInjected(true ? "0.9.82-rc.336" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
322
- const builtAt = readInjected(true ? "2026-06-20T06:32:36.100Z" : void 0);
319
+ const commit = readInjected(true ? "587b2d866182a5b6c086d23d9f6cc32d22ca50f5" : void 0) ?? "unknown";
320
+ const commitShort = readInjected(true ? "587b2d86" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
321
+ const version = readInjected(true ? "0.9.82-rc.337" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
322
+ const builtAt = readInjected(true ? "2026-06-20T06:37:55.432Z" : void 0);
323
323
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
324
324
  return cached;
325
325
  }
@@ -7863,6 +7863,26 @@ function readRefineJobId(event) {
7863
7863
  function readWorkerResultMetadata(event) {
7864
7864
  return readRecord4(event.workerResult) || readRecord4(event.meshWorkerResult) || readRecord4(event.structuredResult);
7865
7865
  }
7866
+ function resolveMeshSurfacedSessionPreview(metadataEvent) {
7867
+ const workerResult = readWorkerResultMetadata(metadataEvent);
7868
+ const resultRecord = readRecord4(metadataEvent.result);
7869
+ const summaryText = readNonEmptyString2(metadataEvent.finalSummary) || readNonEmptyString2(workerResult?.summary) || readNonEmptyString2(workerResult?.finalSummary) || readNonEmptyString2(resultRecord?.summary) || readNonEmptyString2(resultRecord?.finalSummary);
7870
+ if (!summaryText) return void 0;
7871
+ const truncationSuffix = "...[truncated]";
7872
+ const preview = summaryText.length > MESH_SURFACED_PREVIEW_MAX_CHARS ? `${summaryText.slice(0, MESH_SURFACED_PREVIEW_MAX_CHARS - truncationSuffix.length)}${truncationSuffix}` : summaryText;
7873
+ const timestamp = readEventTimestampValue(metadataEvent.timestamp);
7874
+ return { preview, role: "assistant", receivedAt: timestamp };
7875
+ }
7876
+ function readEventTimestampValue(value) {
7877
+ if (typeof value === "number" && Number.isFinite(value)) return value;
7878
+ if (typeof value === "string" && value.trim()) {
7879
+ const parsed = Number(value);
7880
+ if (Number.isFinite(parsed)) return parsed;
7881
+ const dateMs = Date.parse(value);
7882
+ if (Number.isFinite(dateMs)) return dateMs;
7883
+ }
7884
+ return 0;
7885
+ }
7866
7886
  function formatCompletionMetadata(event) {
7867
7887
  const completionDiagnostic = event.completionDiagnostic && typeof event.completionDiagnostic === "object" ? event.completionDiagnostic : null;
7868
7888
  const diagnosticReason = completionDiagnostic ? readNonEmptyString2(completionDiagnostic.blockReason) || "present" : "";
@@ -7992,9 +8012,11 @@ Next step: ${nextStep}`;
7992
8012
  }
7993
8013
  return "";
7994
8014
  }
8015
+ var MESH_SURFACED_PREVIEW_MAX_CHARS;
7995
8016
  var init_mesh_events_utils = __esm({
7996
8017
  "src/mesh/mesh-events-utils.ts"() {
7997
8018
  "use strict";
8019
+ MESH_SURFACED_PREVIEW_MAX_CHARS = 512;
7998
8020
  }
7999
8021
  });
8000
8022
 
@@ -10402,6 +10424,7 @@ function injectMeshSystemMessage(components, args) {
10402
10424
  );
10403
10425
  if (components.onMeshCoordinatorEventForwarded) {
10404
10426
  try {
10427
+ const surfacedPreview = resolveMeshSurfacedSessionPreview(args.metadataEvent);
10405
10428
  components.onMeshCoordinatorEventForwarded({
10406
10429
  event: args.event,
10407
10430
  meshId: args.meshId,
@@ -10410,7 +10433,12 @@ function injectMeshSystemMessage(components, args) {
10410
10433
  // Ensure a `workspace` field reaches updateMeshOwnedSession even when the
10411
10434
  // worker provider event only carried `workspaceName`. The merge spread of
10412
10435
  // metadataEvent above wins when it already has a non-empty `workspace`.
10413
- workspace: readNonEmptyString2(args.metadataEvent.workspace) || readNonEmptyString2(args.metadataEvent.workspaceName) || void 0
10436
+ workspace: readNonEmptyString2(args.metadataEvent.workspace) || readNonEmptyString2(args.metadataEvent.workspaceName) || void 0,
10437
+ ...surfacedPreview ? {
10438
+ meshSessionLastMessagePreview: surfacedPreview.preview,
10439
+ meshSessionLastMessageRole: surfacedPreview.role,
10440
+ meshSessionLastMessageAt: surfacedPreview.receivedAt || void 0
10441
+ } : {}
10414
10442
  });
10415
10443
  } catch {
10416
10444
  }