(state: unknown)
| 5 | } |
| 6 | |
| 7 | export function toolDisplayMetadata(state: unknown): Record<string, unknown> { |
| 8 | if (!state || typeof state !== "object" || Array.isArray(state)) return {} |
| 9 | if (!("status" in state) || state.status === "pending") return {} |
| 10 | if (!("structured" in state) || !state.structured || typeof state.structured !== "object") return {} |
| 11 | if (Array.isArray(state.structured)) return {} |
| 12 | return state.structured as Record<string, unknown> |
| 13 | } |