(
state: State,
ref: Ref,
output: {
title: string
output: string
metadata?: Record<string, unknown>
},
)
| 501 | } |
| 502 | |
| 503 | function doneTool( |
| 504 | state: State, |
| 505 | ref: Ref, |
| 506 | output: { |
| 507 | title: string |
| 508 | output: string |
| 509 | metadata?: Record<string, unknown> |
| 510 | }, |
| 511 | ): void { |
| 512 | feed(state, { |
| 513 | type: "message.part.updated", |
| 514 | properties: { |
| 515 | sessionID: state.id, |
| 516 | time: Date.now(), |
| 517 | part: { |
| 518 | id: ref.part, |
| 519 | sessionID: state.id, |
| 520 | messageID: ref.msg, |
| 521 | type: "tool", |
| 522 | callID: ref.call, |
| 523 | tool: ref.tool, |
| 524 | state: { |
| 525 | status: "completed", |
| 526 | input: ref.input, |
| 527 | output: output.output, |
| 528 | title: output.title, |
| 529 | metadata: output.metadata ?? {}, |
| 530 | time: { |
| 531 | start: ref.start, |
| 532 | end: Date.now(), |
| 533 | }, |
| 534 | }, |
| 535 | }, |
| 536 | }, |
| 537 | } as Event) |
| 538 | } |
| 539 | |
| 540 | function failTool(state: State, ref: Ref, error: string): void { |
| 541 | feed(state, { |
no test coverage detected