MCPcopy Index your code
hub / github.com/anomalyco/opencode / entryBody

Function entryBody

packages/opencode/src/cli/cmd/run/entry.body.ts:165–205  ·  view source on GitHub ↗
(commit: StreamCommit)

Source from the content-addressed store, hash-verified

163}
164
165export function entryBody(commit: StreamCommit): RunEntryBody {
166 if (commit.summary) {
167 return RUN_ENTRY_NONE
168 }
169
170 const raw = cleanRunText(commit.text)
171
172 if (commit.kind === "user") {
173 return userBody(raw)
174 }
175
176 if (commit.kind === "tool") {
177 return toolEntryBody(commit, raw) ?? RUN_ENTRY_NONE
178 }
179
180 if (commit.kind === "assistant") {
181 if (commit.phase === "start") {
182 return RUN_ENTRY_NONE
183 }
184
185 if (commit.phase === "final") {
186 return commit.interrupted ? textBody("assistant interrupted") : RUN_ENTRY_NONE
187 }
188
189 return markdownBody(raw)
190 }
191
192 if (commit.kind === "reasoning") {
193 if (commit.phase === "start") {
194 return RUN_ENTRY_NONE
195 }
196
197 if (commit.phase === "final") {
198 return commit.interrupted ? textBody("reasoning interrupted") : RUN_ENTRY_NONE
199 }
200
201 return reasoningBody(raw)
202 }
203
204 return systemBody(raw, commit.phase)
205}

Callers 7

visibleFunction · 0.90
structuredFunction · 0.90
entry.body.test.tsFile · 0.90
entryLayoutFunction · 0.90
separatorRowsFunction · 0.90
RunEntryContentFunction · 0.90
appendMethod · 0.90

Calls 7

toolEntryBodyFunction · 0.90
cleanRunTextFunction · 0.85
userBodyFunction · 0.85
reasoningBodyFunction · 0.85
systemBodyFunction · 0.85
textBodyFunction · 0.70
markdownBodyFunction · 0.70

Tested by 2

visibleFunction · 0.72
structuredFunction · 0.72