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

Function structuredBody

packages/opencode/src/cli/cmd/run/tool.ts:1395–1405  ·  view source on GitHub ↗
(commit: StreamCommit, raw: string)

Source from the content-addressed store, hash-verified

1393}
1394
1395function structuredBody(commit: StreamCommit, raw: string): RunEntryBody | undefined {
1396 const snap = toolSnapshot(commit, raw)
1397 if (!snap) {
1398 return undefined
1399 }
1400
1401 return {
1402 type: "structured",
1403 snapshot: snap,
1404 }
1405}
1406
1407function shellOutput(command: string, raw: string): string | undefined {
1408 const body = stripAnsi(raw).replace(/^\n+/, "").replace(/\n+$/, "")

Callers 1

toolEntryBodyFunction · 0.85

Calls 1

toolSnapshotFunction · 0.85

Tested by

no test coverage detected