MCPcopy Index your code
hub / github.com/codeaashu/claude-code / extractTitleText

Function extractTitleText

src/bridge/bridgeMessaging.ts:103–122  ·  view source on GitHub ↗
(m: Message)

Source from the content-addressed store, hash-verified

101 * implausible (an interrupt implies a prior prompt already flowed through).
102 */
103export function extractTitleText(m: Message): string | undefined {
104 if (m.type !== 'user' || m.isMeta || m.toolUseResult || m.isCompactSummary)
105 return undefined
106 if (m.origin && m.origin.kind !== 'human') return undefined
107 const content = m.message.content
108 let raw: string | undefined
109 if (typeof content === 'string') {
110 raw = content
111 } else {
112 for (const block of content) {
113 if (block.type === 'text') {
114 raw = block.text
115 break
116 }
117 }
118 }
119 if (!raw) return undefined
120 const clean = stripDisplayTagsAllowEmpty(raw)
121 return clean || undefined
122}
123
124// ─── Ingress routing ─────────────────────────────────────────────────────────
125

Callers 2

writeMessagesFunction · 0.85
writeMessagesFunction · 0.85

Calls 1

Tested by

no test coverage detected