(
role: "user" | "assistant",
text: string,
timestamp: string,
parentId: string | null,
usage: Record<string, unknown>,
)
| 314 | } |
| 315 | |
| 316 | function makeMessageEntry( |
| 317 | role: "user" | "assistant", |
| 318 | text: string, |
| 319 | timestamp: string, |
| 320 | parentId: string | null, |
| 321 | usage: Record<string, unknown>, |
| 322 | ): PiJson { |
| 323 | const message: Record<string, unknown> = { |
| 324 | role, |
| 325 | content: [{ type: "text", text }], |
| 326 | timestamp: Date.parse(timestamp), |
| 327 | }; |
| 328 | if (role === "assistant") { |
| 329 | message.usage = usage; |
| 330 | } |
| 331 | return { |
| 332 | type: "message", |
| 333 | id: shortId(), |
| 334 | parentId, |
| 335 | timestamp, |
| 336 | message, |
| 337 | }; |
| 338 | } |
| 339 | |
| 340 | function makeThinkingEntry( |
| 341 | text: string, |
no test coverage detected