feat(hub): expose last user message preview for widgets

Add an additive session_last_user_messages table, backfill it for existing
sessions on startup, and include lastUserMessagePreview in GET /api/sessions.
The iOS widget uses it for the session subtitle without carrying full
message bodies.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-11-07 00:22:16 +08:00
co-authored by HAPI Claude Code
parent 15a3ad69c9
commit 8436cc6c07
6 changed files with 100 additions and 3 deletions
+2
View File
@@ -84,6 +84,8 @@ export type SessionSummary = {
createdAt?: number
/** Original timestamp of the latest user message; absent before any input. */
lastUserMessageAt?: number
/** Last human prompt text, capped server-side; display-only preview. */
lastUserMessagePreview?: string
pinned?: boolean
globalPinned?: boolean
metadata: SessionSummaryMetadata | null