opencode / packages /tui /src /util /tool-display.ts
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
0dbc9de verified
Raw History Blame Contribute Delete
626 Bytes
export function webSearchProviderLabel(provider: unknown) {
if (provider === "parallel") return "Parallel Web Search"
if (provider === "exa") return "Exa Web Search"
return "Web Search"
}
export function toolDisplayMetadata(state: unknown): Record<string, unknown> {
if (!state || typeof state !== "object" || Array.isArray(state)) return {}
if (!("status" in state) || state.status === "pending") return {}
if (!("structured" in state) || !state.structured || typeof state.structured !== "object") return {}
if (Array.isArray(state.structured)) return {}
return state.structured as Record<string, unknown>
}