(message: SessionMessageResponse, part: Part)
| 92 | } |
| 93 | |
| 94 | private async replayContentPart(message: SessionMessageResponse, part: Part) { |
| 95 | if (part.type !== "text" && part.type !== "file" && part.type !== "reasoning") return |
| 96 | |
| 97 | const sessionUpdate = |
| 98 | part.type === "reasoning" |
| 99 | ? "agent_thought_chunk" |
| 100 | : message.info.role === "user" |
| 101 | ? "user_message_chunk" |
| 102 | : "agent_message_chunk" |
| 103 | |
| 104 | for (const chunk of partsToContentChunks([part as ReplayPart])) { |
| 105 | await this.input.connection.sessionUpdate({ |
| 106 | sessionId: message.info.sessionID, |
| 107 | update: { |
| 108 | sessionUpdate, |
| 109 | messageId: message.info.id, |
| 110 | ...chunk, |
| 111 | }, |
| 112 | }) |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | private async run() { |
| 117 | while (!this.abort.signal.aborted) { |
no test coverage detected