* 处理数据流
(data: string)
| 94 | |
| 95 | constructor(msgStore: MsgStore) { |
| 96 | this.msgStore = msgStore; |
| 97 | } |
| 98 | |
| 99 | private get indexProvider() { |
| 100 | return this.msgStore.entryIndex; |
| 101 | } |
| 102 | |
| 103 | /** Subscribe to the successful logical-turn signal (emitted at most once). */ |
| 104 | onTurnCompleted(listener: () => void): () => void { |
| 105 | this.turnCompletedListeners.add(listener); |
| 106 | return () => this.turnCompletedListeners.delete(listener); |
| 107 | } |
| 108 | |
| 109 | /** Subscribe to the failed logical-turn signal (emitted at most once). */ |
| 110 | onTurnFailed(listener: () => void): () => void { |
| 111 | this.turnFailedListeners.add(listener); |
| 112 | return () => this.turnFailedListeners.delete(listener); |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * 处理数据流 |
| 117 | */ |
| 118 | processData(data: string): void { |
| 119 | // Strip ANSI escape sequences before buffering. Windows ConPTY injects |
| 120 | // cursor-control / screen-clear / OSC title sequences into the data |
| 121 | // stream that would corrupt JSON parsing. |
| 122 | this.buffer += stripAnsiSequences(data); |
| 123 |
nothing calls this directly
no test coverage detected