(commit: StreamCommit, raw: string)
| 1257 | } |
| 1258 | |
| 1259 | export 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 | |
| 1272 | function runBash(p: ToolProps<typeof BashTool>): ToolInline { |
| 1273 | return { |
no test coverage detected