(state: State, ref: Ref, error: string)
| 538 | } |
| 539 | |
| 540 | function failTool(state: State, ref: Ref, error: string): void { |
| 541 | feed(state, { |
| 542 | type: "message.part.updated", |
| 543 | properties: { |
| 544 | sessionID: state.id, |
| 545 | time: Date.now(), |
| 546 | part: { |
| 547 | id: ref.part, |
| 548 | sessionID: state.id, |
| 549 | messageID: ref.msg, |
| 550 | type: "tool", |
| 551 | callID: ref.call, |
| 552 | tool: ref.tool, |
| 553 | state: { |
| 554 | status: "error", |
| 555 | input: ref.input, |
| 556 | error, |
| 557 | metadata: {}, |
| 558 | time: { |
| 559 | start: ref.start, |
| 560 | end: Date.now(), |
| 561 | }, |
| 562 | }, |
| 563 | }, |
| 564 | }, |
| 565 | } as Event) |
| 566 | } |
| 567 | |
| 568 | function emitError(state: State, text: string): void { |
| 569 | const event = { |
no test coverage detected