Download packages/tui/src/util/tool-display.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 626 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/util/tool-display.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/tui/src/util/tool-display.ts
-
curl -L -o tool-display.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/util/tool-display.ts
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> | |
| } | |