MCPcopy Create free account
hub / github.com/tiann/hapi / resolveFirstUserMessage

Method resolveFirstUserMessage

hub/src/sync/syncEngine.ts:793–805  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

791 }
792
793 private resolveFirstUserMessage(sessionId: string): string | undefined {
794 for (const message of this.store.messages.getFirstMessages(sessionId, 50)) {
795 const roleWrapped = unwrapRoleWrappedRecordEnvelope(message.content)
796 const text = roleWrapped?.role === 'user'
797 ? extractUserMessageText(roleWrapped.content)
798 : roleWrapped?.role === 'agent'
799 ? extractClaudeUserMessageTextFromAgentOutput(roleWrapped.content)
800 : undefined
801 if (text) return text
802 }
803
804 return undefined
805 }
806
807 /**
808 * tiann/hapi#824 — sync-on-open auto-migration. Returns the (possibly

Callers 1

Tested by

no test coverage detected