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

Function toolFrame

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

Source from the content-addressed store, hash-verified

1257}
1258
1259export function toolFrame(commit: StreamCommit, raw: string): ToolFrame {
1260 const state = dict(commit.part?.state)
1261 return {
1262 raw,
1263 name: commit.tool || commit.part?.tool || "tool",
1264 input: dict(state.input),
1265 meta: commit.part?.state && "metadata" in commit.part.state ? dict(commit.part.state.metadata) : {},
1266 state,
1267 status: commit.toolState ?? text(state.status),
1268 error: (commit.toolError ?? "").trim(),
1269 }
1270}
1271
1272function runBash(p: ToolProps<typeof BashTool>): ToolInline {
1273 return {

Callers 2

toolSnapshotFunction · 0.85
toolEntryBodyFunction · 0.85

Calls 2

dictFunction · 0.70
textFunction · 0.70

Tested by

no test coverage detected