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

Function tupleItemsSchema

packages/llm/src/protocols/utils/tool-schema.ts:19–24  ·  view source on GitHub ↗
(items: ReadonlyArray<unknown>)

Source from the content-addressed store, hash-verified

17}
18
19const tupleItemsSchema = (items: ReadonlyArray<unknown>) => {
20 const projected = items.map(moonshotNode)
21 if (projected.length === 0) return {}
22 if (projected.length === 1) return projected[0]
23 return { anyOf: projected }
24}
25
26const moonshotNode = (schema: unknown): unknown => {
27 if (Array.isArray(schema)) return schema.map(moonshotNode)

Callers 1

moonshotNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected