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

Function parseVerdict

examples/ts-react-chat/src/sandbox-triage-options.ts:26–31  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

24
25/** Read the agent's required `VERDICT: <value>` first line. Returns null if missing/unknown. */
26export function parseVerdict(text: string): Verdict | null {
27 const line = text.split('\n').find((l) => /^\s*verdict\s*:/i.test(l))
28 if (!line) return null
29 const value = line.split(':')[1]?.trim().toLowerCase()
30 return value && VERDICTS.has(value as Verdict) ? (value as Verdict) : null
31}
32
33// Picker-safe shape: only the label, no factory functions or server-only deps.
34export interface PickerSpec {

Callers 2

MessagesFunction · 0.90

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected