(input: {
tool: string
phase: StreamCommit["phase"]
toolState?: StreamCommit["toolState"]
text?: string
state?: Record<string, unknown>
id?: string
messageID?: string
})
| 232 | } |
| 233 | |
| 234 | function toolCommit(input: { |
| 235 | tool: string |
| 236 | phase: StreamCommit["phase"] |
| 237 | toolState?: StreamCommit["toolState"] |
| 238 | text?: string |
| 239 | state?: Record<string, unknown> |
| 240 | id?: string |
| 241 | messageID?: string |
| 242 | }): StreamCommit { |
| 243 | const id = input.id ?? `${input.tool}-1` |
| 244 | const messageID = input.messageID ?? `msg-${input.tool}` |
| 245 | |
| 246 | return { |
| 247 | kind: "tool", |
| 248 | text: input.text ?? "", |
| 249 | phase: input.phase, |
| 250 | source: "tool", |
| 251 | partID: id, |
| 252 | messageID, |
| 253 | tool: input.tool, |
| 254 | ...(input.toolState ? { toolState: input.toolState } : {}), |
| 255 | ...(input.state ? { part: toolPart(input.tool, input.state, id, messageID) } : {}), |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | test("finalizes markdown tables for streamed and coalesced input", async () => { |
| 260 | const text = |
no test coverage detected