MCPcopy
hub / github.com/anomalyco/opencode / run

Method run

packages/opencode/src/acp/event.ts:116–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114 }
115
116 private async run() {
117 while (!this.abort.signal.aborted) {
118 const events = (await this.input.sdk.global.event({
119 signal: this.abort.signal,
120 })) as GlobalEventStream
121
122 for await (const event of events.stream) {
123 if (this.abort.signal.aborted) return
124 if (!event.payload) continue
125 await this.handle(event.payload).catch(() => {})
126 }
127 if (!this.abort.signal.aborted) await new Promise((resolve) => setTimeout(resolve, 1000))
128 }
129 }
130
131 private async handlePartUpdated(event: EventMessagePartUpdated) {
132 const part = event.properties.part

Callers 15

startMethod · 0.95
provideFunction · 0.45
runGoldenScenarioFunction · 0.45
HarnessFunction · 0.45
confirmFunction · 0.45
setupFunction · 0.45
permission.test.tsFile · 0.45
setupFunction · 0.45

Calls 2

handleMethod · 0.95
eventMethod · 0.45

Tested by 15

HarnessFunction · 0.36
setupFunction · 0.36
setupFunction · 0.36
insertSessionFunction · 0.36
replaySessionProjectionFunction · 0.36
setupFunction · 0.36
insertWorkspaceFunction · 0.36
insertProjectFunction · 0.36
attachSessionToWorkspaceFunction · 0.36
runFunction · 0.36
runFunction · 0.36