Compound type guard for agent thought chunks with text content.
Combines isAgentThoughtChunk and content.type === "text" into a single guard. After narrowing, update.content.text is typed as string.
isAgentThoughtChunk
content.type === "text"
update.content.text
string
The session update to test.
true if u is a ThoughtTextChunkUpdate.
true
u
conn.onSessionUpdate((sessionId, update) => { if (isThoughtTextChunk(update)) { console.log("Thinking:", update.content.text); }}); Copy
conn.onSessionUpdate((sessionId, update) => { if (isThoughtTextChunk(update)) { console.log("Thinking:", update.content.text); }});
Compound type guard for agent thought chunks with text content.
Combines
isAgentThoughtChunkandcontent.type === "text"into a single guard. After narrowing,update.content.textis typed asstring.