MCPcopy Create free account
hub / github.com/simstudioai/sim / resolveToolState

Function resolveToolState

apps/sim/lib/copilot/chat/persisted-message.ts:116–125  ·  view source on GitHub ↗
(block: ContentBlock)

Source from the content-addressed store, hash-verified

114// ---------------------------------------------------------------------------
115
116function resolveToolState(block: ContentBlock): PersistedToolState {
117 const tc = block.toolCall
118 if (!tc) return 'pending'
119 if (tc.result?.success !== undefined) {
120 return tc.result.success
121 ? MothershipStreamV1ToolOutcome.success
122 : MothershipStreamV1ToolOutcome.error
123 }
124 return tc.status as PersistedToolState
125}
126
127/**
128 * Copy `timestamp` / `endedAt` from a source object onto a target object.

Callers 1

mapContentBlockBodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected