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

Function nativeSchema

packages/opencode/src/session/llm/native-runtime.ts:162–167  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

160}
161
162function nativeSchema(value: unknown): JsonSchema {
163 if (!value || typeof value !== "object") return { type: "object", properties: {} }
164 if ("jsonSchema" in value && value.jsonSchema && typeof value.jsonSchema === "object")
165 return value.jsonSchema as JsonSchema
166 return asSchema(value as Parameters<typeof asSchema>[0]).jsonSchema as JsonSchema
167}
168
169export function nativeTools(tools: Record<string, Tool>, input: Pick<StreamInput, "messages" | "abort">) {
170 return Object.fromEntries(

Callers 1

nativeToolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected