autoupgrade

This commit is contained in:
Dax Raad
2025-06-17 01:05:05 -04:00
parent d054f88130
commit 3fe163416d
2 changed files with 35 additions and 1 deletions

View File

@@ -1 +1,24 @@
export namespace GlobalConfig {}
import { z } from "zod"
import { Global } from "."
import { lazy } from "../util/lazy"
import path from "path"
export namespace GlobalConfig {
export const Info = z.object({
autoupdate: z.boolean().optional(),
provider: z.string().optional(),
model: z.string().optional(),
})
export type Info = z.infer<typeof Info>
export const get = lazy(async () => {
const toml = await import(path.join(Global.Path.config, "config"), {
with: {
type: "toml",
},
})
.then((mod) => mod.default)
.catch(() => ({}))
return Info.parse(toml)
})
}