(
tool: { callId: string; name: string; input: unknown },
timestamp: string,
parentId: string | null,
usage: Record<string, unknown>,
)
| 358 | } |
| 359 | |
| 360 | function makeToolCallEntry( |
| 361 | tool: { callId: string; name: string; input: unknown }, |
| 362 | timestamp: string, |
| 363 | parentId: string | null, |
| 364 | usage: Record<string, unknown>, |
| 365 | ): PiJson { |
| 366 | return { |
| 367 | type: "message", |
| 368 | id: shortId(), |
| 369 | parentId, |
| 370 | timestamp, |
| 371 | message: { |
| 372 | role: "assistant", |
| 373 | content: [ |
| 374 | { |
| 375 | type: "toolCall", |
| 376 | id: tool.callId, |
| 377 | name: tool.name, |
| 378 | arguments: tool.input ?? {}, |
| 379 | }, |
| 380 | ], |
| 381 | timestamp: Date.parse(timestamp), |
| 382 | usage, |
| 383 | }, |
| 384 | }; |
| 385 | } |
| 386 | |
| 387 | function makeToolResultEntry( |
| 388 | tool: { callId: string; name: string; output: unknown }, |
no test coverage detected