MCPcopy Create free account
hub / github.com/anomalyco/opencode / toolDisplayMetadata

Function toolDisplayMetadata

packages/tui/src/util/tool-display.ts:7–13  ·  view source on GitHub ↗
(state: unknown)

Source from the content-addressed store, hash-verified

5}
6
7export 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}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected