MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / derivePartState

Function derivePartState

apps/start/src/components/chat/chat-message.tsx:212–222  ·  view source on GitHub ↗
(
  callState: string | undefined,
  resultStatus: string | undefined,
)

Source from the content-addressed store, hash-verified

210}
211
212function derivePartState(
213 callState: string | undefined,
214 resultStatus: string | undefined,
215): string {
216 if (resultStatus === 'success') return 'output-available';
217 if (resultStatus === 'error') return 'output-error';
218 if (resultStatus === 'pending') return 'input-available';
219 if (callState === 'input-streaming') return 'input-streaming';
220 if (callState === 'input-complete') return 'input-available';
221 return 'input-streaming';
222}
223
224function safeParse(json: string): unknown {
225 try {

Callers 1

ChatMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected