MCPcopy Create free account
hub / github.com/TanStack/ai / applyToolFixture

Function applyToolFixture

packages/ai-devtools/src/store/ai-context.tsx:677–699  ·  view source on GitHub ↗
(fixture: ToolFixtureRecord)

Source from the content-addressed store, hash-verified

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,

Callers 2

replayObservedToolCallFunction · 0.85
ToolsViewFunction · 0.85

Calls 3

nowMethod · 0.80
toStringMethod · 0.80
emitMethod · 0.45

Tested by

no test coverage detected