MCPcopy Create free account
hub / github.com/agent-tower/core / processData

Method processData

packages/server/src/output/codex-parser.ts:96–120  ·  view source on GitHub ↗

* 处理数据流

(data: string)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

parseJsonSegmentsMethod · 0.95
stripAnsiSequencesFunction · 0.85
trimMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected