fix(schema): use Zod native JSON schema output
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
+340
-105
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,14 @@
|
|||||||
import { zodToJsonSchema } from "zod-to-json-schema"
|
import { z } from "zod"
|
||||||
import { OhMyOpenCodeConfigSchema } from "../src/config/schema"
|
import { OhMyOpenCodeConfigSchema } from "../src/config/schema"
|
||||||
|
|
||||||
export function createOhMyOpenCodeJsonSchema(): Record<string, unknown> {
|
export function createOhMyOpenCodeJsonSchema(): Record<string, unknown> {
|
||||||
const jsonSchema = zodToJsonSchema(OhMyOpenCodeConfigSchema, {
|
const jsonSchema = z.toJSONSchema(OhMyOpenCodeConfigSchema)
|
||||||
target: "jsonSchema7",
|
|
||||||
$refStrategy: "none",
|
|
||||||
})
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
...jsonSchema,
|
||||||
$schema: "http://json-schema.org/draft-07/schema#",
|
$schema: "http://json-schema.org/draft-07/schema#",
|
||||||
$id: "https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/dev/assets/oh-my-opencode.schema.json",
|
$id: "https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/dev/assets/oh-my-opencode.schema.json",
|
||||||
title: "Oh My OpenCode Configuration",
|
title: "Oh My OpenCode Configuration",
|
||||||
description: "Configuration schema for oh-my-opencode plugin",
|
description: "Configuration schema for oh-my-opencode plugin",
|
||||||
...jsonSchema,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user