(fixture: ToolFixtureRecord)
| 675 | } |
| 676 | |
| 677 | function applyToolFixture(fixture: ToolFixtureRecord) { |
| 678 | const timestamp = Date.now() |
| 679 | const payload: DevtoolsToolFixtureApplyEvent = { |
| 680 | eventId: `devtools:tool-fixture:apply:${fixture.id}:${timestamp}:${Math.random() |
| 681 | .toString(36) |
| 682 | .slice(2)}`, |
| 683 | fixtureId: fixture.id, |
| 684 | timestamp, |
| 685 | source: 'devtools', |
| 686 | visibility: 'devtools-action', |
| 687 | ...(fixture.hookId ? { hookId: fixture.hookId } : {}), |
| 688 | ...(fixture.threadId ? { threadId: fixture.threadId } : {}), |
| 689 | ...(fixture.runId ? { runId: fixture.runId } : {}), |
| 690 | toolName: fixture.toolName, |
| 691 | input: fixture.input, |
| 692 | output: fixture.output, |
| 693 | ...(fixture.execute !== undefined ? { execute: fixture.execute } : {}), |
| 694 | ...(fixture.message ? { message: fixture.message } : {}), |
| 695 | ...(fixture.errorText ? { errorText: fixture.errorText } : {}), |
| 696 | } |
| 697 | |
| 698 | aiEventClient.emit('devtools:tool-fixture:apply', payload) |
| 699 | } |
| 700 | |
| 701 | function mergeFixtures( |
| 702 | fixture: ToolFixtureRecord, |
no test coverage detected