@adhdev/daemon-core 0.9.82-rc.337 → 0.9.82-rc.338

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.
@@ -65,6 +65,31 @@ export interface RecentReadDebugSnapshot {
65
65
  }
66
66
  export declare function shouldEmitRecentReadDebugLog(cache: Map<string, string>, snapshot: RecentReadDebugSnapshot): boolean;
67
67
  export declare function buildMachineInfo(profile?: 'full' | 'live' | 'metadata'): MachineInfo;
68
+ /**
69
+ * Resolve the last user-visible (non-system) message for a session as a preview.
70
+ *
71
+ * Exported so the cloud coordinator can derive a preview for a LOCAL mesh-owned
72
+ * worktree session directly from the real provider instance it hosts. A REMOTE
73
+ * worker session has no local instance (its preview rides the completion event's
74
+ * finalSummary — see resolveMeshSurfacedSessionPreview), but a LOCAL coordinator
75
+ * IS the worker, so its hosted instance's transcript holds the assistant reply and
76
+ * this is the source of truth for that case.
77
+ */
78
+ export declare function getLastDisplayMessage(session: {
79
+ activeChat?: {
80
+ messages?: Array<{
81
+ role?: string;
82
+ content?: unknown;
83
+ receivedAt?: number | string;
84
+ timestamp?: number | string;
85
+ }> | null;
86
+ } | null;
87
+ }): {
88
+ role: string;
89
+ preview: string;
90
+ receivedAt: number;
91
+ hash: string;
92
+ } | null;
68
93
  export { getSessionCurrentNotificationId, applySessionNotificationOverlay } from '../config/recent-activity.js';
69
94
  export declare function getSessionCompletionMarker(session: {
70
95
  activeChat?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.82-rc.337",
3
+ "version": "0.9.82-rc.338",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  "author": "vilmire",
47
47
  "license": "AGPL-3.0-or-later",
48
48
  "dependencies": {
49
- "@adhdev/mesh-shared": "0.9.82-rc.337",
49
+ "@adhdev/mesh-shared": "0.9.82-rc.338",
50
50
  "@adhdev/session-host-core": "*",
51
51
  "@agentclientprotocol/sdk": "^0.16.1",
52
52
  "ajv": "^8.20.0",
package/src/index.ts CHANGED
@@ -320,7 +320,7 @@ export type {
320
320
  // ── Status ──
321
321
  export { DaemonStatusReporter } from './status/reporter.js';
322
322
  export { buildSessionEntries, findCdpManager, hasCdpManager, isCdpConnected } from './status/builders.js';
323
- export { buildStatusSnapshot, buildMachineInfo } from './status/snapshot.js';
323
+ export { buildStatusSnapshot, buildMachineInfo, getLastDisplayMessage } from './status/snapshot.js';
324
324
  export { getDaemonBuildInfo } from './build-info.js';
325
325
  export type { DaemonBuildInfo } from './build-info.js';
326
326
  export { normalizeManagedStatus, isManagedStatusWorking, isManagedStatusWaiting, normalizeActiveChatData } from './status/normalize.js';
@@ -1425,8 +1425,15 @@ export class CliProviderInstance implements ProviderInstance {
1425
1425
  chatTitle: pending.chatTitle,
1426
1426
  duration: pending.duration,
1427
1427
  timestamp: pending.timestamp,
1428
+ // When finalization is forced past the timeout on a `parsed_status:` block
1429
+ // (the parser never confirmed a final assistant turn) we previously rode an
1430
+ // empty `finalSummary` unconditionally. That empty value propagates to the
1431
+ // mesh coordinator's mirror preview (meshSessionLastMessagePreview), leaving a
1432
+ // delegated session's inbox preview blank — or, for a LOCAL worktree session,
1433
+ // stuck on the dispatched user task. If the parser DID surface assistant text,
1434
+ // prefer it; only fall back to '' when no assistant summary can be derived.
1428
1435
  finalSummary: blockReason.startsWith('parsed_status:')
1429
- ? ''
1436
+ ? (this.completionFinalSummary(this.adapter?.getScriptParsedStatus()?.messages) ?? '')
1430
1437
  : this.completionFinalSummary(this.adapter?.getScriptParsedStatus()?.messages),
1431
1438
  completionDiagnostic,
1432
1439
  });
@@ -283,7 +283,17 @@ function simplePreviewHash(value: string): string {
283
283
  return h.toString(16);
284
284
  }
285
285
 
286
- function getLastDisplayMessage(session: {
286
+ /**
287
+ * Resolve the last user-visible (non-system) message for a session as a preview.
288
+ *
289
+ * Exported so the cloud coordinator can derive a preview for a LOCAL mesh-owned
290
+ * worktree session directly from the real provider instance it hosts. A REMOTE
291
+ * worker session has no local instance (its preview rides the completion event's
292
+ * finalSummary — see resolveMeshSurfacedSessionPreview), but a LOCAL coordinator
293
+ * IS the worker, so its hosted instance's transcript holds the assistant reply and
294
+ * this is the source of truth for that case.
295
+ */
296
+ export function getLastDisplayMessage(session: {
287
297
  activeChat?: {
288
298
  messages?: Array<{
289
299
  role?: string;